Commit d57bd6e5 by 翁国栋

8小时后台--

更新导入保单用户是否已投保逻辑
parent 6a040f43
...@@ -377,7 +377,7 @@ public class InsureContorll { ...@@ -377,7 +377,7 @@ public class InsureContorll {
insureUser.setCreateTime(new Date()); insureUser.setCreateTime(new Date());
insureUser.insert(); insureUser.insert();
if (dataMap.get("errcode").toString().equals("suc")) { if (dataMap.get("errcode").toString().equals("suc")) {
y.setIsInsure(1); y.setIsInsure(1);/*废弃*/
y.insertOrUpdate(); y.insertOrUpdate();
} }
} }
...@@ -491,7 +491,7 @@ public class InsureContorll { ...@@ -491,7 +491,7 @@ public class InsureContorll {
log.info("增员异常:policyDateStart:" + insureDto.getPolicyDateStart() + "policyDateEnd:" + insureDto.getPolicyDateEnd()); log.info("增员异常:policyDateStart:" + insureDto.getPolicyDateStart() + "policyDateEnd:" + insureDto.getPolicyDateEnd());
throw new CustomException("增员异常"); throw new CustomException("增员异常");
} }
y.setIsInsure(1); y.setIsInsure(1);/*废弃*/
y.insertOrUpdate(); y.insertOrUpdate();
}); });
InsureLog.builder().requestParam(JSONObject.toJSONString(setParams(JSONObject.toJSONString(bodyMap), appid, secret))).type(2) InsureLog.builder().requestParam(JSONObject.toJSONString(setParams(JSONObject.toJSONString(bodyMap), appid, secret))).type(2)
...@@ -641,7 +641,7 @@ public class InsureContorll { ...@@ -641,7 +641,7 @@ public class InsureContorll {
} catch (ParseException e) { } catch (ParseException e) {
log.error("获取保单信息异常:", e); log.error("获取保单信息异常:", e);
} }
y.setIsInsure(1); y.setIsInsure(1);/*废弃*/
y.insertOrUpdate(); y.insertOrUpdate();
}); });
oldInsureUserList.forEach(o -> { oldInsureUserList.forEach(o -> {
...@@ -1175,6 +1175,11 @@ public class InsureContorll { ...@@ -1175,6 +1175,11 @@ public class InsureContorll {
throw new CustomException("导入错误,人员为空"); throw new CustomException("导入错误,人员为空");
} }
for (InsureUser insureUser : userList) { for (InsureUser insureUser : userList) {
InsureUser getInsurer = InsureUser.builder().build().selectOne(new QueryWrapper<InsureUser>().lambda()
.eq(InsureUser::getPolicyId,policy.getId()).eq(InsureUser::getStatus,1).eq(InsureUser::getInsureStatus,1).eq(InsureUser::getPolicyDateStart,insureUser.getPolicyDateStart()).eq(InsureUser::getPolicyDateEnd,insureUser.getPolicyDateEnd()));
if(getInsurer!=null){
continue;
}
/*根据名字,身份,所属企业获取员工*/ /*根据名字,身份,所属企业获取员工*/
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda() YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda()
.eq(YgglMainEmp::getName, insureUser.getInsuredEContact()) .eq(YgglMainEmp::getName, insureUser.getInsuredEContact())
...@@ -1182,10 +1187,6 @@ public class InsureContorll { ...@@ -1182,10 +1187,6 @@ public class InsureContorll {
.eq(YgglMainEmp::getOrgCode, insureUser.getOrgCode())); .eq(YgglMainEmp::getOrgCode, insureUser.getOrgCode()));
if (ygglMainEmp != null) { if (ygglMainEmp != null) {
/*如果导入的人已经投保*/
if (ygglMainEmp.getIsInsure() == 1) {
continue;
}
insureUser.setInsuredMobile(ygglMainEmp.getPhone()); insureUser.setInsuredMobile(ygglMainEmp.getPhone());
} else { } else {
QyzxEmpLogin qyzxEmpLogin = QyzxEmpLogin.builder().phone(String.valueOf(System.currentTimeMillis())).pw(Md5.md5(pwd)).regTime(new Date()).orgId(insureUser.getOrgCode()).username(insureUser.getInsuredEContact()).sts(CommonEnum.U_STS_ON.getType()).build(); QyzxEmpLogin qyzxEmpLogin = QyzxEmpLogin.builder().phone(String.valueOf(System.currentTimeMillis())).pw(Md5.md5(pwd)).regTime(new Date()).orgId(insureUser.getOrgCode()).username(insureUser.getInsuredEContact()).sts(CommonEnum.U_STS_ON.getType()).build();
...@@ -1198,7 +1199,7 @@ public class InsureContorll { ...@@ -1198,7 +1199,7 @@ public class InsureContorll {
ygglMainEmp.setZjNum(insureUser.getInsuredNo()); ygglMainEmp.setZjNum(insureUser.getInsuredNo());
ygglMainEmp.setOrgCode(insureUser.getOrgCode()); ygglMainEmp.setOrgCode(insureUser.getOrgCode());
} }
ygglMainEmp.setIsInsure(1); ygglMainEmp.setIsInsure(1);/*废弃*/
ygglMainEmp.insertOrUpdate(); ygglMainEmp.insertOrUpdate();
insureUser.setInsuredName(company.getAttestName()); insureUser.setInsuredName(company.getAttestName());
insureUser.setPolicyId(policy.getId()); insureUser.setPolicyId(policy.getId());
...@@ -1336,7 +1337,7 @@ public class InsureContorll { ...@@ -1336,7 +1337,7 @@ public class InsureContorll {
y.setZjType(0); y.setZjType(0);
y.setZjNum(iu.getInsuredNo()); y.setZjNum(iu.getInsuredNo());
y.setOrgCode(qyzxEntInfoM.getId()); y.setOrgCode(qyzxEntInfoM.getId());
y.setIsInsure(0); y.setIsInsure(0);/*废弃*/
y.insert(); y.insert();
} }
iu.setOrgCode(qyzxEntInfoM.getId()); iu.setOrgCode(qyzxEntInfoM.getId());
...@@ -1821,7 +1822,7 @@ public class InsureContorll { ...@@ -1821,7 +1822,7 @@ public class InsureContorll {
ygglMainEmp.setZjType(0); ygglMainEmp.setZjType(0);
ygglMainEmp.setZjNum(insureUser.getInsuredNo()); ygglMainEmp.setZjNum(insureUser.getInsuredNo());
ygglMainEmp.setOrgCode(insurePolicy.getOrgCode()); ygglMainEmp.setOrgCode(insurePolicy.getOrgCode());
ygglMainEmp.setIsInsure(0); ygglMainEmp.setIsInsure(0);/*废弃*/
ygglMainEmp.insert(); ygglMainEmp.insert();
} }
insureUser.setPolicyDateEnd(insurePolicy.getPolicyDateEnd()); insureUser.setPolicyDateEnd(insurePolicy.getPolicyDateEnd());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment