|
|
@@ -1068,7 +1068,12 @@ public class HlgPaymentServiceImpl extends ServiceImpl<HlgPaymentMapper, HlgPaym
|
|
|
// }
|
|
|
// }
|
|
|
if (hlgPaymentDetailList.size() > 0) {
|
|
|
- savePayment(hlgPaymentDetailList, hlgPayment, userList);
|
|
|
+ String message=savePayment(hlgPaymentDetailList, hlgPayment, userList);
|
|
|
+ if("60天内已存在相同笔数相同金额的付款".equals(message)){
|
|
|
+ Map map2 = new HashMap();
|
|
|
+ map2.put("reason", "60天内已存在相同笔数相同金额的付款");
|
|
|
+ resultlist.add(map2);
|
|
|
+ }
|
|
|
if(userListTotal.size()>0){
|
|
|
hlgUserService.updateBatchById(userListTotal);
|
|
|
}
|
|
|
@@ -1348,7 +1353,14 @@ public class HlgPaymentServiceImpl extends ServiceImpl<HlgPaymentMapper, HlgPaym
|
|
|
* @param
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public void savePayment(List<HlgPaymentDetailExport> hlgPaymentDetailList, HlgPayment hlgPayment, List<HlgUser> userList) {
|
|
|
+ public String savePayment(List<HlgPaymentDetailExport> hlgPaymentDetailList, HlgPayment hlgPayment, List<HlgUser> userList) {
|
|
|
+
|
|
|
+ //定义导入付款总金额 用于判断60天内是否存在相同金额相同笔数的付款
|
|
|
+ Double sumMoney = 0.00;
|
|
|
+ for (int i = 0; i < hlgPaymentDetailList.size(); i++) {
|
|
|
+ sumMoney = businessAccountUtils.add(sumMoney, Double.parseDouble(hlgPaymentDetailList.get(i).getPayment()));
|
|
|
+ }
|
|
|
+
|
|
|
for (int i = 0; i < userList.size(); i++) {
|
|
|
hlgUserService.save(userList.get(i));
|
|
|
}
|
|
|
@@ -1365,6 +1377,8 @@ public class HlgPaymentServiceImpl extends ServiceImpl<HlgPaymentMapper, HlgPaym
|
|
|
jsonObject1.put("subcontractorId", hlgPayment.getSubcontractorId());
|
|
|
jsonObject1.put("cpType", hlgPayment.getCpType());
|
|
|
jsonObject1.put("companyCode", hlgCompany.getCompanyCode());
|
|
|
+ jsonObject1.put("sumMoney",sumMoney);
|
|
|
+ jsonObject1.put("paymentSize",hlgPaymentDetailList.size());
|
|
|
log.info("param============{}", JSONObject.toJSONString(jsonObject1));
|
|
|
//数据加密
|
|
|
String biz_content = CryptTool.encode(JSONObject.toJSONString(jsonObject1));
|
|
|
@@ -1380,6 +1394,8 @@ public class HlgPaymentServiceImpl extends ServiceImpl<HlgPaymentMapper, HlgPaym
|
|
|
hlgUser.setUserCode(list1.get(i).get("userCode").toString());
|
|
|
hlgUserService.updateById(hlgUser);
|
|
|
}
|
|
|
+ String message=jsonObject.getString("message");
|
|
|
+ return message;
|
|
|
} else {
|
|
|
String message = jsonObject.getString("message");
|
|
|
//抛出异常,事务回滚
|