|
@@ -162,6 +162,24 @@ public class PolicyOrderLogic {
|
|
|
|
|
|
String errPrefix = "第" + (index) + "行";
|
|
|
|
|
|
+ AdminWebsit adminWebsit = adminWebsitService.lambdaQuery().eq(AdminWebsit::getWebsitNumber, (String) row.get(1)).one();
|
|
|
+
|
|
|
+ User user = userService.lambdaQuery().eq(User::getIdCard, (String) row.get(6))
|
|
|
+ .one();
|
|
|
+
|
|
|
+ if (user == null)
|
|
|
+ throw new RemoteServiceException((String) row.get(4)+"身份证找不到对应师傅");
|
|
|
+
|
|
|
+ WebsitUser websitUser = websitUserService.lambdaQuery()
|
|
|
+ .eq(WebsitUser::getWebsitId, (String) row.get(1))
|
|
|
+ .eq(WebsitUser::getUserId, user.getUserId())
|
|
|
+ .one();
|
|
|
+
|
|
|
+
|
|
|
+ if (websitUser==null)
|
|
|
+ throw new RemoteServiceException(errPrefix + "未找到该师傅");
|
|
|
+
|
|
|
+
|
|
|
if (StringUtils.isAnyBlank((String) row.get(1), (String) row.get(6))) {
|
|
|
throw new RemoteServiceException(errPrefix + "黄色区域为必填项");
|
|
|
}
|
|
@@ -189,7 +207,7 @@ public class PolicyOrderLogic {
|
|
|
workerPolicy.setType("IN");
|
|
|
workerPolicy.setOrderId(policyOrder.getId());
|
|
|
workerPolicy.setPolicyName(policyOrder.getPolicyName());
|
|
|
- workerPolicy.setCompany(policyOrder.getBelongCompany());
|
|
|
+ workerPolicy.setCompany(policyOrder.getCompany());
|
|
|
workerPolicy.setPolicyOrder(policyOrder.getPolicyNumber());
|
|
|
workerPolicy.setPolicyType("IN");
|
|
|
workerPolicy.setStartTime(DateUtil.parse((String) row.get(9), "yyyy-MM-dd"));
|
|
@@ -207,27 +225,103 @@ public class PolicyOrderLogic {
|
|
|
workerPolicy.setStatus("DSX");
|
|
|
}
|
|
|
workerPolicy.insert();
|
|
|
- }
|
|
|
|
|
|
- policyOrder.setStartTime(DateUtil.parse((String) row.get(9), "yyyy-MM-dd"));
|
|
|
- policyOrder.setEndTime(this.getEndOfDay(DateUtil.endOfDay(DateUtil.parse((String) row.get(10), "yyyy-MM-dd"))));
|
|
|
- policyOrder.setClassWebsitId((String) row.get(11));
|
|
|
- policyOrder.setClassWebsitName((String) row.get(12));
|
|
|
- policyOrder.setPayAmount(Convert.toBigDecimal(row.get(8)));
|
|
|
- policyOrder.setIsImport(IsYesNoEnum.YES.getKey());
|
|
|
- policyOrder.setBuyUnit(sysDictCompany.getDictValue());
|
|
|
- policyOrder.setBuyUnitId(sysDictCompany.getDictCode());
|
|
|
+ policyOrder.setStartTime(DateUtil.parse((String) row.get(9), "yyyy-MM-dd"));
|
|
|
+ policyOrder.setEndTime(this.getEndOfDay(DateUtil.endOfDay(DateUtil.parse((String) row.get(10), "yyyy-MM-dd"))));
|
|
|
+ policyOrder.setClassWebsitId((String) row.get(11));
|
|
|
+ policyOrder.setClassWebsitName((String) row.get(12));
|
|
|
+ policyOrder.setPayAmount(Convert.toBigDecimal(row.get(8)));
|
|
|
+ policyOrder.setIsImport(IsYesNoEnum.YES.getKey());
|
|
|
+ policyOrder.setBuyUnit(sysDictCompany.getDictValue());
|
|
|
+ policyOrder.setBuyUnitId(sysDictCompany.getDictCode());
|
|
|
|
|
|
|
|
|
- if (new Date().after(policyOrder.getStartTime()) && new Date().before(policyOrder.getEndTime()))
|
|
|
- policyOrder.setPolicyOrderStatus("BZZ");
|
|
|
- else if (new Date().after(policyOrder.getEndTime()))
|
|
|
- policyOrder.setPolicyOrderStatus("YSX");
|
|
|
- else {
|
|
|
- policyOrder.setPolicyOrderStatus("DSX");
|
|
|
- }
|
|
|
+ if (new Date().after(policyOrder.getStartTime()) && new Date().before(policyOrder.getEndTime()))
|
|
|
+ policyOrder.setPolicyOrderStatus("BZZ");
|
|
|
+ else if (new Date().after(policyOrder.getEndTime()))
|
|
|
+ policyOrder.setPolicyOrderStatus("YSX");
|
|
|
+ else {
|
|
|
+ policyOrder.setPolicyOrderStatus("DSX");
|
|
|
+ }
|
|
|
+
|
|
|
+ policyOrder.updateById();
|
|
|
+
|
|
|
+ }else {
|
|
|
+
|
|
|
+
|
|
|
+ PolicyOrder policyOrderup = new PolicyOrder();
|
|
|
+
|
|
|
+ policyOrderup.setId(IdWorker.getIdStr());
|
|
|
+ policyOrderup.setPolicyId(policyOrderup.getId());
|
|
|
+ policyOrderup.setPolicyNumber(policyOrderup.getId());
|
|
|
+ policyOrderup.setPolicyName("意外险");
|
|
|
|
|
|
- policyOrder.updateById();
|
|
|
+ policyOrderup.setType("IN");
|
|
|
+
|
|
|
+ policyOrderup.setWebsitUserId(websitUser.getId());
|
|
|
+
|
|
|
+ policyOrderup.setStartTime(DateUtil.parse((String) row.get(9), "yyyy-MM-dd"));
|
|
|
+ policyOrderup.setEndTime(this.getEndOfDay(DateUtil.parse((String) row.get(10), "yyyy-MM-dd")));
|
|
|
+
|
|
|
+ policyOrderup.setIsSend(IsYesNoEnum.NO.getKey());
|
|
|
+ policyOrderup.setIsReceipt(IsYesNoEnum.NO.getKey());
|
|
|
+
|
|
|
+
|
|
|
+ policyOrderup.setBelongCompany(adminWebsit.getBelongCompany());
|
|
|
+ policyOrderup.setBelongCompanyCode(adminWebsit.getBelongCompanyCode());
|
|
|
+
|
|
|
+ policyOrderup.setCompanyWechatId(adminWebsit.getCompanyWechatId());
|
|
|
+ policyOrderup.setCompanyWechatName(adminWebsit.getCompanyWechatName());
|
|
|
+
|
|
|
+ policyOrderup.setWebsitId(adminWebsit.getWebsitId());
|
|
|
+ policyOrderup.setWebsitName(adminWebsit.getName());
|
|
|
+
|
|
|
+ policyOrderup.setWorkerIdcard(user.getIdCard());
|
|
|
+ policyOrderup.setWorkerMobile(user.getMobile());
|
|
|
+ policyOrderup.setWorkerName(user.getNickName());
|
|
|
+ policyOrderup.setWorkerNumber(user.getWorkerNumber());
|
|
|
+ policyOrderup.setIsImport(IsYesNoEnum.YES.getKey());
|
|
|
+ policyOrderup.setIsImport(IsYesNoEnum.YES.getKey());
|
|
|
+ policyOrderup.setBuyUnit(sysDictCompany.getDictValue());
|
|
|
+ policyOrderup.setBuyUnitId(sysDictCompany.getDictCode());
|
|
|
+
|
|
|
+
|
|
|
+ if (new Date().after(policyOrderup.getStartTime()) && new Date().before(policyOrderup.getEndTime()))
|
|
|
+ policyOrderup.setPolicyOrderStatus("BZZ");
|
|
|
+ else if (new Date().after(policyOrderup.getEndTime()))
|
|
|
+ policyOrderup.setPolicyOrderStatus("YSX");
|
|
|
+ else {
|
|
|
+ policyOrderup.setPolicyOrderStatus("DSX");
|
|
|
+ }
|
|
|
+
|
|
|
+ policyOrderup.insert();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ WorkerPolicy workerPolicy = new WorkerPolicy();
|
|
|
+ workerPolicy.setWorkerId(websitUser.getWorkerNumber());
|
|
|
+ workerPolicy.setType("IN");
|
|
|
+
|
|
|
+ workerPolicy.setPolicyName(policyOrderup.getPolicyName());
|
|
|
+ workerPolicy.setCompany(policyOrderup.getCompany());
|
|
|
+
|
|
|
+ workerPolicy.setPolicyType("IN");
|
|
|
+ workerPolicy.setStartTime(policyOrderup.getStartTime());
|
|
|
+ workerPolicy.setEndTime(policyOrderup.getEndTime());
|
|
|
+ workerPolicy.setWebsitUserId(websitUser.getId());
|
|
|
+ workerPolicy.setWebsitId(websitUser.getWebsitId());
|
|
|
+ workerPolicy.setWebsitName(adminWebsit.getName());
|
|
|
+ workerPolicy.setWorkerName(user.getNickName());
|
|
|
+
|
|
|
+ if (new Date().after(workerPolicy.getStartTime()) && new Date().before(workerPolicy.getEndTime()))
|
|
|
+ workerPolicy.setStatus("BZZ");
|
|
|
+ else if (new Date().after(workerPolicy.getEndTime()))
|
|
|
+ workerPolicy.setStatus("YSX");
|
|
|
+ else {
|
|
|
+ workerPolicy.setStatus("DSX");
|
|
|
+ }
|
|
|
+ workerPolicy.insert();
|
|
|
+ }
|
|
|
|
|
|
|
|
|
}
|