|
@@ -2,6 +2,7 @@ package com.ym.mec.biz.service.impl;
|
|
|
|
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
+import com.ym.mec.biz.dal.dao.StudentDao;
|
|
|
import com.ym.mec.biz.dal.dao.StudentRepairDao;
|
|
|
import com.ym.mec.biz.dal.dao.SysConfigDao;
|
|
|
import com.ym.mec.biz.dal.dto.BasicUserDto;
|
|
@@ -49,6 +50,8 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
|
|
|
private SysUserCashAccountDetailService sysUserCashAccountDetailService;
|
|
|
@Autowired
|
|
|
private SysMessageService sysMessageService;
|
|
|
+ @Autowired
|
|
|
+ private StudentDao studentDao;
|
|
|
|
|
|
@Override
|
|
|
public BaseDAO<Integer, StudentRepair> getDAO() {
|
|
@@ -85,6 +88,16 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Map addRepair(StudentRepair repairInfo) throws Exception {
|
|
|
+ studentDao.lockUser(repairInfo.getEmployeeId());
|
|
|
+ if (repairInfo.getSendType() != null && 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("邮寄信息必填");
|
|
|
+ }
|
|
|
+ SysUser student = sysUserFeignService.queryUserById(repairInfo.getStudentId());
|
|
|
+ repairInfo.setOrganId(student.getOrganId());
|
|
|
|
|
|
Date date = new Date();
|
|
|
BigDecimal amount = repairInfo.getAmount();
|
|
@@ -146,7 +159,7 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
|
|
|
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<>();
|
|
|
classFee.put("course", BigDecimal.ZERO);
|
|
@@ -157,8 +170,8 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
|
|
|
Map payMap = payService.getPayMap(
|
|
|
amount,
|
|
|
orderNo,
|
|
|
- baseApiUrl + "/api-web/studentOrder/notify",
|
|
|
- baseApiUrl + "/api-web/studentOrder/paymentResult?orderNo=" + orderNo,
|
|
|
+ baseApiUrl + "/api-student/studentOrder/notify",
|
|
|
+ baseApiUrl + "/api-student/studentOrder/paymentResult?type=edu&orderNo=" + orderNo,
|
|
|
"乐器维修",
|
|
|
"乐器维修",
|
|
|
repairInfo.getStudentId(),
|
|
@@ -184,6 +197,7 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
|
|
|
if (sysUser == null) {
|
|
|
throw new BizException("用户信息获取失败");
|
|
|
}
|
|
|
+ studentDao.lockUser(sysUser.getId());
|
|
|
StudentRepair studentRepair = studentRepairDao.getRepairInfo(id);
|
|
|
if (studentRepair == null) {
|
|
|
throw new BizException("维修信息不存在");
|
|
@@ -239,6 +253,7 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
|
|
|
}
|
|
|
Date date = new Date();
|
|
|
StudentRepair studentRepair = studentRepairDao.get(repairInfo.getId());
|
|
|
+ studentDao.lockUser(studentRepair.getStudentId());
|
|
|
BigDecimal amount = studentRepair.getAmount();
|
|
|
String orderNo = idGeneratorService.generatorId("payment") + "";
|
|
|
studentRepair.setTransNo(orderNo);
|