|
@@ -310,7 +310,8 @@ public class ITopInstSettleServiceImpl extends ServiceImpl<TopInstSettleMapper,
|
|
|
//订单金额
|
|
|
Long orderGoodsId = orderGoodsIds.stream().filter(item -> {
|
|
|
TopOldOrderGoods one = topOldOrderGoodsService.getById(item);
|
|
|
- return EncryptHandler.decrypt(one.getUserCard()).equals(bo.getUserCard()) && one.getUserName().equals(bo.getUserName());
|
|
|
+ String decrypt = EncryptHandler.decrypt(one.getUserCard());
|
|
|
+ return decrypt.equals(bo.getUserCard()) && one.getUserName().equals(bo.getUserName());
|
|
|
}).findFirst().orElse(null);
|
|
|
if (ObjectUtils.isNotNull(orderGoodsId)){
|
|
|
TopOldOrderGoods orderGoods = topOldOrderGoodsService.getById(orderGoodsId);
|
|
@@ -403,6 +404,11 @@ public class ITopInstSettleServiceImpl extends ServiceImpl<TopInstSettleMapper,
|
|
|
}
|
|
|
|
|
|
private void createCheckLog(String settleSn,Long loginId,String loginName){
|
|
|
+ //当前创建人的角色
|
|
|
+ List<TopSysUserRole> userRoles = topSysUserRoleService
|
|
|
+ .list(new LambdaQueryWrapper<TopSysUserRole>()
|
|
|
+ .eq(TopSysUserRole::getUserId, loginId));
|
|
|
+
|
|
|
List<TopOldOrderCheckLog> checkLogListTwo = topOldOrderCheckLogService
|
|
|
.list(new LambdaQueryWrapper<TopOldOrderCheckLog>()
|
|
|
.eq(TopOldOrderCheckLog::getOrderSn, settleSn)
|
|
@@ -410,19 +416,35 @@ public class ITopInstSettleServiceImpl extends ServiceImpl<TopInstSettleMapper,
|
|
|
if (CollectionUtils.isNotEmpty(checkLogListTwo)){
|
|
|
//重新提交重置审核流程
|
|
|
checkLogListTwo.forEach(item -> {
|
|
|
- if (item.getType() == 8){
|
|
|
- item.setCheckStatus(2);
|
|
|
+ if (userRoles.stream().anyMatch(x -> x.getRoleId().equals(item.getRoleId())) && item.getType() == 7){
|
|
|
+ //创建人包含审核角色(跳过审核)
|
|
|
+ item.setCheckStatus(1);
|
|
|
+ item.setCheckTime(DateUtils.getNowTime());
|
|
|
+ item.setCheckUsername(loginName);
|
|
|
}else {
|
|
|
- item.setCheckStatus(0);
|
|
|
+ item.setCheckStatus(item.getType() == 7?0:2);
|
|
|
}
|
|
|
});
|
|
|
topOldOrderCheckLogService.updateBatchById(checkLogListTwo);
|
|
|
+ //当前审核标签
|
|
|
+ TopOldOrderCheckLog checkLog = checkLogListTwo.stream()
|
|
|
+ .filter(x -> x.getCheckStatus() != 1).sorted(Comparator.comparing(TopOldOrderCheckLog::getCheckSort)).findFirst().orElse(null);
|
|
|
+ checkLog.setCheckSign(1);
|
|
|
+ topOldOrderCheckLogService.updateById(checkLog);
|
|
|
+ //订单审核状态
|
|
|
+ Integer checkStatus = 2;//审核流程
|
|
|
+ for (TopOldOrderCheckLog item : checkLogListTwo) {
|
|
|
+ if (item.getId().equals(checkLog.getId()) && item.getType() == 8 ){
|
|
|
+ checkStatus = 4;//待支付
|
|
|
+ }
|
|
|
+ }
|
|
|
update(new LambdaUpdateWrapper<TopInstSettle>()
|
|
|
- .eq(TopInstSettle::getSettleSn,settleSn)
|
|
|
- .set(TopInstSettle::getCheckStatus,2)//审核流程
|
|
|
- .eq(TopInstSettle::getStatus,1));
|
|
|
+ .set(TopInstSettle::getCheckStatus,checkStatus)
|
|
|
+ .set(TopInstSettle::getStatus,1)
|
|
|
+ .eq(TopInstSettle::getSettleSn,settleSn));
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
//获取审核和支付流程
|
|
|
List<TopOldOrderCheck> list = topOldOrderCheckService
|
|
|
.list(new LambdaQueryWrapper<TopOldOrderCheck>()
|
|
@@ -432,10 +454,7 @@ public class ITopInstSettleServiceImpl extends ServiceImpl<TopInstSettleMapper,
|
|
|
if (CollectionUtils.isEmpty(list)){
|
|
|
throw new CustomException("请先配置供应商结算的审核流程!");
|
|
|
}
|
|
|
- //当前创建人的角色
|
|
|
- List<TopSysUserRole> userRoles = topSysUserRoleService
|
|
|
- .list(new LambdaQueryWrapper<TopSysUserRole>()
|
|
|
- .eq(TopSysUserRole::getUserId, loginId));
|
|
|
+
|
|
|
List<TopOldOrderCheckLog> checkLogList = new ArrayList<>();
|
|
|
for (TopOldOrderCheck orderCheck : list) {
|
|
|
TopOldOrderCheckLog checkLog = new TopOldOrderCheckLog();
|
|
@@ -534,6 +553,7 @@ public class ITopInstSettleServiceImpl extends ServiceImpl<TopInstSettleMapper,
|
|
|
TopSysRole role = topSysRoleService.getById(refundLog.getRoleId());
|
|
|
item.setCheckRole(role.getRoleName());
|
|
|
item.setCheckTime(refundLog.getCheckTime());
|
|
|
+ item.setCheckReason(refundLog.getCheckReason());
|
|
|
}
|
|
|
}else {
|
|
|
TopOldOrderCheckLog checkLog = topOldOrderCheckLogService
|
|
@@ -920,17 +940,21 @@ public class ITopInstSettleServiceImpl extends ServiceImpl<TopInstSettleMapper,
|
|
|
String path = OLD_SYS_HOST + "/WitSystem/BussinessApi/NeedToPay";
|
|
|
try {
|
|
|
respone = HttpUtils.postFormBody(path, params);
|
|
|
- if (!respone.contains("\"Status\":true")) {
|
|
|
+ if (respone.contains("\"Status\":true")) {
|
|
|
+ //支付中
|
|
|
+ settle.setCheckStatus(8);
|
|
|
+ updateById(settle);
|
|
|
+ }else {
|
|
|
//支付失败
|
|
|
settle.setCheckStatus(5);
|
|
|
updateById(settle);
|
|
|
- throw new CustomException("供应商结算支付请求错误" + respone);
|
|
|
+ log.error("供应商结算支付请求错误" + respone);
|
|
|
}
|
|
|
} catch (IOException e) {
|
|
|
//支付失败
|
|
|
settle.setCheckStatus(5);
|
|
|
updateById(settle);
|
|
|
- throw new CustomException("供应商结算支付请求错误" + e.getMessage());
|
|
|
+ log.error("供应商结算支付请求错误" + respone);
|
|
|
}
|
|
|
topOrderBankPayService.save(add);
|
|
|
return true;
|
|
@@ -1107,12 +1131,18 @@ public class ITopInstSettleServiceImpl extends ServiceImpl<TopInstSettleMapper,
|
|
|
Order order = orderService.getOne(new LambdaQueryWrapper<Order>().eq(Order::getOrderSn, bo.getOrderSn()));
|
|
|
User user = userService.getById(order.getUserId());
|
|
|
if (!EncryptHandler.decrypt(user.getIdCard()).equals(bo.getUserCard())){
|
|
|
- throw new CustomException(String.format("订单【%s】和学员【%s】不匹配,请检查!",bo.getOrderSn(),bo.getUserName()));
|
|
|
+ throw new CustomException(String.format("订单【%s】和学员【%s】身份证不匹配,请检查!",bo.getOrderSn(),bo.getUserName()));
|
|
|
+ }
|
|
|
+ if (!user.getRealname().equals(bo.getUserName())){
|
|
|
+ throw new CustomException(String.format("订单【%s】和学员【%s】名称不匹配,请检查!",bo.getOrderSn(),bo.getUserName()));
|
|
|
}
|
|
|
}else {
|
|
|
List<TopOldOrderGoods> list = topOldOrderGoodsService.list(new LambdaQueryWrapper<TopOldOrderGoods>().eq(TopOldOrderGoods::getOrderSn, bo.getOrderSn()));
|
|
|
if (list.stream().noneMatch(item -> EncryptHandler.decrypt(item.getUserCard()).equals(bo.getUserCard()))){
|
|
|
- throw new CustomException(String.format("订单【%s】和学员【%s】不匹配,请检查!",bo.getOrderSn(),bo.getUserName()));
|
|
|
+ throw new CustomException(String.format("订单【%s】和学员【%s】身份证不匹配,请检查!",bo.getOrderSn(),bo.getUserName()));
|
|
|
+ }
|
|
|
+ if (list.stream().noneMatch(item -> item.getUserName().equals(bo.getUserName()))){
|
|
|
+ throw new CustomException(String.format("订单【%s】和学员【%s】名称不匹配,请检查!",bo.getOrderSn(),bo.getUserName()));
|
|
|
}
|
|
|
}
|
|
|
|