Просмотр исходного кода

Merge remote-tracking branch 'origin/master'

Joburgess 5 лет назад
Родитель
Сommit
adf296e73f

+ 17 - 8
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -16,6 +16,8 @@ import java.util.stream.Collectors;
 import javax.annotation.Resource;
 
 import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -96,6 +98,8 @@ import com.ym.mec.util.http.HttpUtil;
 @Service
 public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, StudentRegistration> implements StudentRegistrationService {
 
+	private static final Logger LOGGER = LoggerFactory.getLogger(StudentRegistrationServiceImpl.class);
+	
     @Resource
     private StudentRegistrationDao studentRegistrationDao;
     @Autowired
@@ -851,14 +855,19 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                     studentRegistration.getParentsName(), studentPaymentOrder.getActualAmount());
 
 //            //生成课程协议
-            contractService.transferMusicGroupCoursesContract(studentRegistration.getUserId(),studentRegistration.getMusicGroupId());
-            //商品协议(租赁时候有)
-            if(musicOneSubjectClassPlan.getKitGroupPurchaseType().equals(KitGroupPurchaseTypeEnum.LEASE)){
-                StudentPaymentOrderDetail applyOrderMusical = studentPaymentOrderDetailService.findApplyOrderMusical(studentPaymentOrder.getId());
-                if(applyOrderMusical != null && applyOrderMusical.getGoodsIdList() != null && !applyOrderMusical.getGoodsIdList().equals("")){
-                    contractService.transferGoodsContract(studentPaymentOrder.getUserId(),studentPaymentOrder.getMusicGroupId(),applyOrderMusical.getGoodsIdList(),musicOneSubjectClassPlan.getKitGroupPurchaseType());
-                }
-            }
+			try {
+				contractService.transferMusicGroupCoursesContract(studentRegistration.getUserId(), studentRegistration.getMusicGroupId());
+				// 商品协议(租赁时候有)
+				if (musicOneSubjectClassPlan.getKitGroupPurchaseType().equals(KitGroupPurchaseTypeEnum.LEASE)) {
+					StudentPaymentOrderDetail applyOrderMusical = studentPaymentOrderDetailService.findApplyOrderMusical(studentPaymentOrder.getId());
+					if (applyOrderMusical != null && applyOrderMusical.getGoodsIdList() != null && !applyOrderMusical.getGoodsIdList().equals("")) {
+						contractService.transferGoodsContract(studentPaymentOrder.getUserId(), studentPaymentOrder.getMusicGroupId(),
+								applyOrderMusical.getGoodsIdList(), musicOneSubjectClassPlan.getKitGroupPurchaseType());
+					}
+				}
+			} catch (Exception e) {
+				LOGGER.error("协议生成失败",e);
+			}
         }
 
 

+ 22 - 18
mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -193,9 +193,9 @@ public class ExportController extends BaseController {
                 for (StudentPaymentOrderDetail orderDetail : row.getOrderDetailList()) {
                     if (orderDetail.getType().equals(OrderDetailTypeEnum.MUSICAL)) {
                         musicalFee = musicalFee.add(orderDetail.getPrice());
-                    }else if(orderDetail.getType().equals(OrderDetailTypeEnum.COURSE)){
+                    } else if (orderDetail.getType().equals(OrderDetailTypeEnum.COURSE)) {
                         courseFee = courseFee.add(orderDetail.getPrice());
-                    }else if (orderDetail.getType().equals(OrderDetailTypeEnum.ACCESSORIES) || orderDetail.getType().equals(OrderDetailTypeEnum.TEACHING) || orderDetail.getType().equals(OrderDetailTypeEnum.OTHER)) {
+                    } else if (orderDetail.getType().equals(OrderDetailTypeEnum.ACCESSORIES) || orderDetail.getType().equals(OrderDetailTypeEnum.TEACHING) || orderDetail.getType().equals(OrderDetailTypeEnum.OTHER)) {
                         teachingFee = teachingFee.add(orderDetail.getPrice());
                     }
                 }
@@ -254,9 +254,9 @@ public class ExportController extends BaseController {
 
         try {
             String[] header = {"序号", "学生姓名", "交易流水号", "订单编号", "收款渠道", "收款账户", "支付金额", "到账时间",
-                    "关联乐团ID/VIP课ID", "课程形态","课程费用", "押金", "乐器", "教辅费用", "零星收款费用", "零星收款类别", "手续费", "专业", "分部", "单位/学校", "备注"};
+                    "关联乐团ID/VIP课ID", "课程形态", "课程费用", "押金", "乐器", "教辅费用", "零星收款费用", "零星收款类别", "手续费", "专业", "分部", "单位/学校", "备注"};
             String[] body = {"id", "user.username", "transNo", "orderNo", "paymentChannel", "merNos", "actualAmount", "payTime", "musicGroupId",
-                    "groupType.desc", "courseFee","leaseFee", "musicalFee", "teachingFee", "sporadicAmount", "sporadicType", "transferFee", "subjectName", "organName", "schoolName", "memo"};
+                    "groupType.desc", "courseFee", "leaseFee", "musicalFee", "teachingFee", "sporadicAmount", "sporadicType", "transferFee", "subjectName", "organName", "schoolName", "memo"};
             HSSFWorkbook workbook = POIUtil.exportExcel(header, body, studentPaymentOrderExportDtos);
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
@@ -282,16 +282,18 @@ public class ExportController extends BaseController {
                 } else {
                     row.setGender("女");
                 }
-                if (row.getPaymentStatus().equals("PAID_COMPLETED")) {
-                    row.setPaymentStatus("完成缴费");
-                } else if (row.getPaymentStatus().equals("NON_PAYMENT")) {
-                    row.setPaymentStatus("未缴费");
-                } else if (row.getPaymentStatus().equals("PROCESSING")) {
-                    row.setPaymentStatus("缴费中");
+                if (row.getPaymentStatus() != null) {
+                    if (row.getPaymentStatus().equals("PAID_COMPLETED")) {
+                        row.setPaymentStatus("完成缴费");
+                    } else if (row.getPaymentStatus().equals("NON_PAYMENT")) {
+                        row.setPaymentStatus("未缴费");
+                    } else if (row.getPaymentStatus().equals("PROCESSING")) {
+                        row.setPaymentStatus("缴费中");
+                    }
                 }
-                if(row.getStudentStatus().equals("NORMAL")){
+                if (row.getStudentStatus().equals("NORMAL")) {
                     row.setStudentStatus("在读");
-                }else {
+                } else {
                     row.setStudentStatus("退团");
                 }
                 if (row.getIsActive()) {
@@ -299,18 +301,20 @@ public class ExportController extends BaseController {
                 } else {
                     row.setActiveName("否");
                 }
-                if(row.getIsNewStudent().equals(1)){
+                if (row.getIsNewStudent().equals(1)) {
                     row.setIsNewStudentStr("是");
-                }else {
+                } else {
                     row.setIsNewStudentStr("否");
                 }
-                row.setNextPaymentDateStr(DateUtil.format(row.getNextPaymentDate(), DateUtil.DEFAULT_PATTERN));
+                if (row.getNextPaymentDate() != null) {
+                    row.setNextPaymentDateStr(DateUtil.format(row.getNextPaymentDate(), DateUtil.DEFAULT_PATTERN));
+                }
                 row.setCurrentGrade(row.getCurrentGrade() + row.getCurrentClass());
             }
-            String[] header = {"学员编号","学员姓名", "性别", "联系电话", "年级班级", "专业", "学员状态", "新增学员", "缴费金额",
+            String[] header = {"学员编号", "学员姓名", "性别", "联系电话", "年级班级", "专业", "学员状态", "新增学员", "缴费金额",
                     "下次缴费日期", "报名缴费", "是否激活"};
-            String[] body = {"userId","realName", "gender", "phone", "currentGrade", "subjectName", "studentStatus", "isNewStudentStr",
-                    "courseFee", "nextPaymentDateStr","paymentStatus", "activeName"};
+            String[] body = {"userId", "realName", "gender", "phone", "currentGrade", "subjectName", "studentStatus", "isNewStudentStr",
+                    "courseFee", "nextPaymentDateStr", "paymentStatus", "activeName"};
             HSSFWorkbook workbook = POIUtil.exportExcel(header, body, musicGroupStudentsDtoPageInfo.getRows());
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");