|
@@ -71,6 +71,8 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
|
|
|
private ContractService contractService;
|
|
|
@Autowired
|
|
|
private GoodsService goodsService;
|
|
|
+ @Autowired
|
|
|
+ private StudentInstrumentService studentInstrumentService;
|
|
|
|
|
|
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
|
|
|
|
@@ -376,10 +378,19 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
|
|
|
) {
|
|
|
throw new BizException("邮寄信息必填");
|
|
|
}
|
|
|
+ Date date = new Date();
|
|
|
+ if (repairInfo.getExemptionAmount().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
+ if (repairInfo.getStudentInstrumentId() != null) {
|
|
|
+ throw new BizException("学生乐器id不存在,请核查");
|
|
|
+ }
|
|
|
+ StudentInstrument studentInstrument = studentInstrumentService.get(repairInfo.getStudentInstrumentId());
|
|
|
+ if (studentInstrument == null || studentInstrument.getEndTime() == null || studentInstrument.getEndTime().compareTo(date) <=0) {
|
|
|
+ throw new BizException("乐保不存在,请核查");
|
|
|
+ }
|
|
|
+ }
|
|
|
SysUser student = sysUserFeignService.queryUserById(repairInfo.getStudentId());
|
|
|
repairInfo.setOrganId(student.getOrganId());
|
|
|
|
|
|
- Date date = new Date();
|
|
|
BigDecimal amount = repairInfo.getAmount();
|
|
|
String orderNo = idGeneratorService.generatorId("payment") + "";
|
|
|
repairInfo.setTransNo(orderNo);
|
|
@@ -414,6 +425,7 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ amount = amount.subtract(repairInfo.getExemptionAmount());
|
|
|
|
|
|
repairInfo.setPayStatus(1);
|
|
|
String channelType = "";
|