|
@@ -195,38 +195,43 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
- public Map updateRepair(StudentRepair repairInfo) throws Exception {
|
|
|
|
|
|
+ public Map payRepair(StudentRepair repairInfo) throws Exception {
|
|
|
|
+ if(repairInfo.getSendType().equals(1) &&
|
|
|
|
+ (repairInfo.getContactName() ==null ||repairInfo.getContactName().isEmpty()) &&
|
|
|
|
+ (repairInfo.getContactMobile() ==null ||repairInfo.getContactMobile().isEmpty()) &&
|
|
|
|
+ (repairInfo.getAddress() ==null ||repairInfo.getAddress().isEmpty())
|
|
|
|
+ ){
|
|
|
|
+ throw new BizException("邮寄信息必填");
|
|
|
|
+ }
|
|
Date date = new Date();
|
|
Date date = new Date();
|
|
StudentRepair studentRepair = studentRepairDao.get(repairInfo.getId());
|
|
StudentRepair studentRepair = studentRepairDao.get(repairInfo.getId());
|
|
- BigDecimal amount = repairInfo.getAmount();
|
|
|
|
|
|
+ BigDecimal amount = studentRepair.getAmount();
|
|
String orderNo = idGeneratorService.generatorId("payment") + "";
|
|
String orderNo = idGeneratorService.generatorId("payment") + "";
|
|
- repairInfo.setTransNo(orderNo);
|
|
|
|
- repairInfo.setRepairStatus(0);
|
|
|
|
- repairInfo.setPayStatus(0);
|
|
|
|
- repairInfo.setCreateTime(date);
|
|
|
|
- repairInfo.setUpdateTime(date);
|
|
|
|
- studentRepairDao.insert(repairInfo);
|
|
|
|
- if (repairInfo.getType() == 1) {
|
|
|
|
- Map<String, Object> repairInfoMap = new HashMap<>();
|
|
|
|
- MapUtil.populateMap(repairInfoMap, repairInfo);
|
|
|
|
- return repairInfoMap;
|
|
|
|
- }
|
|
|
|
- repairInfo.setPayStatus(1);
|
|
|
|
|
|
+ studentRepair.setTransNo(orderNo);
|
|
|
|
+ studentRepair.setRepairStatus(0);
|
|
|
|
+ studentRepair.setPayStatus(1);
|
|
|
|
+ studentRepair.setSendType(repairInfo.getSendType());
|
|
|
|
+ studentRepair.setContactName(repairInfo.getContactName());
|
|
|
|
+ studentRepair.setContactMobile(repairInfo.getContactMobile());
|
|
|
|
+ studentRepair.setAddress(repairInfo.getAddress());
|
|
|
|
+ studentRepair.setUpdateTime(date);
|
|
|
|
+ studentRepairDao.update(repairInfo);
|
|
|
|
+
|
|
String channelType = "";
|
|
String channelType = "";
|
|
|
|
|
|
StudentPaymentOrder studentPaymentOrder = new StudentPaymentOrder();
|
|
StudentPaymentOrder studentPaymentOrder = new StudentPaymentOrder();
|
|
- studentPaymentOrder.setUserId(repairInfo.getStudentId());
|
|
|
|
|
|
+ studentPaymentOrder.setUserId(studentRepair.getStudentId());
|
|
studentPaymentOrder.setGroupType(GroupType.REPAIR);
|
|
studentPaymentOrder.setGroupType(GroupType.REPAIR);
|
|
studentPaymentOrder.setOrderNo(orderNo);
|
|
studentPaymentOrder.setOrderNo(orderNo);
|
|
studentPaymentOrder.setType(OrderTypeEnum.REPAIR);
|
|
studentPaymentOrder.setType(OrderTypeEnum.REPAIR);
|
|
studentPaymentOrder.setExpectAmount(amount);
|
|
studentPaymentOrder.setExpectAmount(amount);
|
|
studentPaymentOrder.setActualAmount(amount);
|
|
studentPaymentOrder.setActualAmount(amount);
|
|
studentPaymentOrder.setStatus(DealStatusEnum.ING);
|
|
studentPaymentOrder.setStatus(DealStatusEnum.ING);
|
|
- studentPaymentOrder.setMusicGroupId(repairInfo.getId().toString());
|
|
|
|
|
|
+ studentPaymentOrder.setMusicGroupId(studentRepair.getId().toString());
|
|
studentPaymentOrder.setPaymentChannel("BALANCE");
|
|
studentPaymentOrder.setPaymentChannel("BALANCE");
|
|
studentPaymentOrder.setUpdateTime(date);
|
|
studentPaymentOrder.setUpdateTime(date);
|
|
- studentPaymentOrder.setOrganId(repairInfo.getOrganId());
|
|
|
|
- studentPaymentOrder.setRoutingOrganId(repairInfo.getOrganId());
|
|
|
|
|
|
+ studentPaymentOrder.setOrganId(studentRepair.getOrganId());
|
|
|
|
+ studentPaymentOrder.setRoutingOrganId(studentRepair.getOrganId());
|
|
|
|
|
|
studentPaymentOrderService.insert(studentPaymentOrder);
|
|
studentPaymentOrderService.insert(studentPaymentOrder);
|
|
studentPaymentOrder.setVersion(0);
|
|
studentPaymentOrder.setVersion(0);
|
|
@@ -241,7 +246,7 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
|
|
return notifyMap;
|
|
return notifyMap;
|
|
}
|
|
}
|
|
|
|
|
|
- String baseApiUrl = sysConfigDao.findConfigValue(SysConfigService.EDU_TEACHER_BASE_URL);
|
|
|
|
|
|
+ String baseApiUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
|
|
|
|
|
|
Map<String, BigDecimal> classFee = new HashMap<>();
|
|
Map<String, BigDecimal> classFee = new HashMap<>();
|
|
classFee.put("course", BigDecimal.ZERO);
|
|
classFee.put("course", BigDecimal.ZERO);
|
|
@@ -256,9 +261,9 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
|
|
baseApiUrl + "/api-web/studentOrder/paymentResult?orderNo=" + orderNo,
|
|
baseApiUrl + "/api-web/studentOrder/paymentResult?orderNo=" + orderNo,
|
|
"乐器维修",
|
|
"乐器维修",
|
|
"乐器维修",
|
|
"乐器维修",
|
|
- repairInfo.getStudentId(),
|
|
|
|
|
|
+ studentRepair.getStudentId(),
|
|
classFee,
|
|
classFee,
|
|
- repairInfo.getOrganId()
|
|
|
|
|
|
+ studentRepair.getOrganId()
|
|
);
|
|
);
|
|
|
|
|
|
Map<String, BigDecimal> routingFee = (Map<String, BigDecimal>) payMap.get("routingFee");
|
|
Map<String, BigDecimal> routingFee = (Map<String, BigDecimal>) payMap.get("routingFee");
|