Commit 4577cd95 authored by huyuchen's avatar huyuchen

huych-含风险项目商险不购买申请提交

parent 08a3c6aa
...@@ -164,156 +164,159 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance ...@@ -164,156 +164,159 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
} }
try { try {
//获取明细当日最大申请编号 //获取明细当日最大申请编号
String applyDetail = baseMapper.getMaxInusuranceDetailCode(); String applyDetail;
//暂存不做校验 synchronized (this) {
if (CommonConstants.ONE_STRING.equals(tInsuranceUnpurchaseApply.getSaveFlag())) { applyDetail = baseMapper.getMaxInusuranceDetailCode();
if (Common.isEmpty(tInsuranceUnpurchaseApply.getId())) { //暂存不做校验
if (CommonConstants.ONE_STRING.equals(tInsuranceUnpurchaseApply.getSaveFlag())) {
if (Common.isEmpty(tInsuranceUnpurchaseApply.getId())) {
// tInsuranceUnpurchaseApply.setApplyNo(applyNo); // tInsuranceUnpurchaseApply.setApplyNo(applyNo);
tInsuranceUnpurchaseApply.setCreateBy(user.getId()); tInsuranceUnpurchaseApply.setCreateBy(user.getId());
tInsuranceUnpurchaseApply.setCreateName(user.getNickname()); tInsuranceUnpurchaseApply.setCreateName(user.getNickname());
tInsuranceUnpurchaseApply.setCreateUserDeptName(user.getDeptName()); tInsuranceUnpurchaseApply.setCreateUserDeptName(user.getDeptName());
tInsuranceUnpurchaseApply.setCreateUserDeptId(user.getDeptId().toString()); tInsuranceUnpurchaseApply.setCreateUserDeptId(user.getDeptId().toString());
baseMapper.insert(tInsuranceUnpurchaseApply); baseMapper.insert(tInsuranceUnpurchaseApply);
}else { } else {
baseMapper.updateById(tInsuranceUnpurchaseApply); baseMapper.updateById(tInsuranceUnpurchaseApply);
}
//更新附件
updateFileId(tInsuranceUnpurchaseApply);
//先删除明细表数据再重新生成
if (Common.isNotNull(tInsuranceUnpurchaseApply.getId())) {
personService.remove(Wrappers.<TInsuranceUnpurchasePerson>lambdaQuery()
.eq(TInsuranceUnpurchasePerson::getParnetId, tInsuranceUnpurchaseApply.getId()));
}
List<TInsuranceUnpurchasePerson> personList = new ArrayList<>();
if (Common.isNotNull(tInsuranceUnpurchaseApply.getPersonList()) && !tInsuranceUnpurchaseApply.getPersonList().isEmpty()) {
for (TInsuranceUnpurchasePersonAddVo vo : tInsuranceUnpurchaseApply.getPersonList()) {
TInsuranceUnpurchasePerson person = new TInsuranceUnpurchasePerson();
person.setEmpIdcardNo(vo.getEmpIdcardNo());
person.setEmpName(vo.getEmpName());
person.setPost(vo.getPost());
person.setApplyNoDetail(getDetailCode(applyDetail,vo.getRowIndex()));
initValue(tInsuranceUnpurchaseApply, person);
personList.add(person);
} }
personService.saveBatch(personList); //更新附件
} updateFileId(tInsuranceUnpurchaseApply);
return R.ok(); //先删除明细表数据再重新生成
} else if (CommonConstants.TWO_STRING.equals(tInsuranceUnpurchaseApply.getSaveFlag())) {
//校验若该项目&该人员身份证号是否已经有过“已购买社保”的不购买商险明细,若有也会禁止重复提交!提示:姓名+身份证号、姓名+身份证号、已有申请记录,无需重复提交,可删除后再提交;
//校验该身份证&姓名组合的数据能否找到在途或在保的社保-工伤险数据,即是否为-“工伤”险正常参保的人员,不受项目限制,若“工伤”险皆正常在保或有在途“待审核、待办理”,则可正常提交,若未正常参保或无在途的参保数据,则提示“姓名+身份证号、姓名+身份证号无正常参保或派单中的数据,禁止提交!”
List<TInsuranceUnpurchasePersonAddVo> personList = addAndUpdCheck(tInsuranceUnpurchaseApply);
if (Common.isNotNull(personList) && !personList.isEmpty() &&
personList.stream().noneMatch(e -> CommonConstants.ONE_STRING.equals(e.getCode()))) {
//申请编号
String applyNo = getCode();
tInsuranceUnpurchaseApply.setUnbuyNum(String.valueOf(personList.size()));
if (Common.isNotNull(tInsuranceUnpurchaseApply.getId())) { if (Common.isNotNull(tInsuranceUnpurchaseApply.getId())) {
if (Common.isEmpty(tInsuranceUnpurchaseApply.getApplyNo())) {
tInsuranceUnpurchaseApply.setApplyNo(applyNo);
}
//申请人是否属于子分公司和该项目是否有审批通过记录赋值
setValue(tInsuranceUnpurchaseApply,user,tInsuranceUnpurchaseApply.getApplyNo());
tInsuranceUnpurchaseApply.setCreateTimeZc(LocalDateTime.now());
baseMapper.updateById(tInsuranceUnpurchaseApply);
if (tInsuranceUnpurchaseApply.getAuditFlag().equals(CommonConstants.ZERO_STRING)) {
// 记录提交审核日志
TAuditRecord submitAuditRecord = new TAuditRecord();
submitAuditRecord.setDomainId(tInsuranceUnpurchaseApply.getId());
submitAuditRecord.setFlowId(CommonConstants.EMPTY_STRING);
submitAuditRecord.setNodeId(CommonConstants.EMPTY_STRING);
submitAuditRecord.setApprovalMan(user.getId());
submitAuditRecord.setApprovalManName(user.getNickname());
// 审批结果为“提交”
submitAuditRecord.setApprovalResult(CommonConstants.dingleDigitStrArray[3]);
submitAuditRecord.setDeleteFlag(CommonConstants.NOT_DELETE_FLAG);
submitAuditRecord.setApprovalTime(LocalDateTime.now());
// 审核记录标识 1当前审核记录
submitAuditRecord.setPreFlag(CommonConstants.ONE_STRING);
submitAuditRecord.setSubmitMan(user.getId());
submitAuditRecord.setSubmitManName(user.getNickname());
// 申请原因
// submitAuditRecord.setReason(reason);
// 审核类型
submitAuditRecord.setAuditType(CommonConstants.ZERO_STRING);
submitAuditRecord.setCreateTime(LocalDateTime.now());
// 提交节点名称
submitAuditRecord.setNodeName("提交即审核通过");
submitAuditRecord.setSubmitCreateTime(LocalDateTime.now());
submitAuditRecord.setEntityName(applyNo);
auditRecordService.save(submitAuditRecord);
}
//更新附件
updateFileId(tInsuranceUnpurchaseApply);
//先删除明细表数据再重新生成
personService.remove(Wrappers.<TInsuranceUnpurchasePerson>lambdaQuery() personService.remove(Wrappers.<TInsuranceUnpurchasePerson>lambdaQuery()
.eq(TInsuranceUnpurchasePerson::getParnetId, tInsuranceUnpurchaseApply.getId())); .eq(TInsuranceUnpurchasePerson::getParnetId, tInsuranceUnpurchaseApply.getId()));
List<TInsuranceUnpurchasePerson> personInfoList = new ArrayList<>(); }
for (TInsuranceUnpurchasePersonAddVo vo : personList) { List<TInsuranceUnpurchasePerson> personList = new ArrayList<>();
if (Common.isNotNull(tInsuranceUnpurchaseApply.getPersonList()) && !tInsuranceUnpurchaseApply.getPersonList().isEmpty()) {
for (TInsuranceUnpurchasePersonAddVo vo : tInsuranceUnpurchaseApply.getPersonList()) {
TInsuranceUnpurchasePerson person = new TInsuranceUnpurchasePerson(); TInsuranceUnpurchasePerson person = new TInsuranceUnpurchasePerson();
person.setEmpIdcardNo(vo.getEmpIdcardNo()); person.setEmpIdcardNo(vo.getEmpIdcardNo());
person.setEmpName(vo.getEmpName()); person.setEmpName(vo.getEmpName());
person.setPost(vo.getPost()); person.setPost(vo.getPost());
person.setApplyNoDetail(getDetailCode(applyDetail, vo.getRowIndex())); person.setApplyNoDetail(getDetailCode(applyDetail, vo.getRowIndex()));
person.setCreateTime(tInsuranceUnpurchaseApply.getCreateTimeZc());
initValue(tInsuranceUnpurchaseApply, person); initValue(tInsuranceUnpurchaseApply, person);
personInfoList.add(person); personList.add(person);
} }
personService.saveBatch(personInfoList); personService.saveBatch(personList);
} else { }
//申请人是否属于子分公司和该项目是否有审批通过记录赋值 return R.ok();
setValue(tInsuranceUnpurchaseApply,user,applyNo); } else if (CommonConstants.TWO_STRING.equals(tInsuranceUnpurchaseApply.getSaveFlag())) {
tInsuranceUnpurchaseApply.setCreateTimeZc(LocalDateTime.now());
tInsuranceUnpurchaseApply.setCreateBy(user.getId()); //校验若该项目&该人员身份证号是否已经有过“已购买社保”的不购买商险明细,若有也会禁止重复提交!提示:姓名+身份证号、姓名+身份证号、已有申请记录,无需重复提交,可删除后再提交;
tInsuranceUnpurchaseApply.setCreateName(user.getNickname()); //校验该身份证&姓名组合的数据能否找到在途或在保的社保-工伤险数据,即是否为-“工伤”险正常参保的人员,不受项目限制,若“工伤”险皆正常在保或有在途“待审核、待办理”,则可正常提交,若未正常参保或无在途的参保数据,则提示“姓名+身份证号、姓名+身份证号无正常参保或派单中的数据,禁止提交!”
tInsuranceUnpurchaseApply.setCreateUserDeptName(user.getDeptName()); List<TInsuranceUnpurchasePersonAddVo> personList = addAndUpdCheck(tInsuranceUnpurchaseApply);
tInsuranceUnpurchaseApply.setCreateUserDeptId(user.getDeptId().toString()); if (Common.isNotNull(personList) && !personList.isEmpty() &&
tInsuranceUnpurchaseApply.setApplyNo(applyNo); personList.stream().noneMatch(e -> CommonConstants.ONE_STRING.equals(e.getCode()))) {
baseMapper.insert(tInsuranceUnpurchaseApply); //申请编号
if (tInsuranceUnpurchaseApply.getAuditFlag().equals(CommonConstants.ZERO_STRING)) { String applyNo = getCode();
// 记录提交审核日志 tInsuranceUnpurchaseApply.setUnbuyNum(String.valueOf(personList.size()));
TAuditRecord submitAuditRecord = new TAuditRecord(); if (Common.isNotNull(tInsuranceUnpurchaseApply.getId())) {
submitAuditRecord.setDomainId(tInsuranceUnpurchaseApply.getId()); if (Common.isEmpty(tInsuranceUnpurchaseApply.getApplyNo())) {
submitAuditRecord.setFlowId(CommonConstants.EMPTY_STRING); tInsuranceUnpurchaseApply.setApplyNo(applyNo);
submitAuditRecord.setNodeId(CommonConstants.EMPTY_STRING); }
submitAuditRecord.setApprovalMan(user.getId()); //申请人是否属于子分公司和该项目是否有审批通过记录赋值
submitAuditRecord.setApprovalManName(user.getNickname()); setValue(tInsuranceUnpurchaseApply, user, tInsuranceUnpurchaseApply.getApplyNo());
// 审批结果为“提交” tInsuranceUnpurchaseApply.setCreateTimeZc(LocalDateTime.now());
submitAuditRecord.setApprovalResult(CommonConstants.dingleDigitStrArray[3]); baseMapper.updateById(tInsuranceUnpurchaseApply);
submitAuditRecord.setDeleteFlag(CommonConstants.NOT_DELETE_FLAG); if (tInsuranceUnpurchaseApply.getAuditFlag().equals(CommonConstants.ZERO_STRING)) {
submitAuditRecord.setApprovalTime(LocalDateTime.now()); // 记录提交审核日志
// 审核记录标识 1当前审核记录 TAuditRecord submitAuditRecord = new TAuditRecord();
submitAuditRecord.setPreFlag(CommonConstants.ONE_STRING); submitAuditRecord.setDomainId(tInsuranceUnpurchaseApply.getId());
submitAuditRecord.setSubmitMan(user.getId()); submitAuditRecord.setFlowId(CommonConstants.EMPTY_STRING);
submitAuditRecord.setSubmitManName(user.getNickname()); submitAuditRecord.setNodeId(CommonConstants.EMPTY_STRING);
// 申请原因 submitAuditRecord.setApprovalMan(user.getId());
submitAuditRecord.setApprovalManName(user.getNickname());
// 审批结果为“提交”
submitAuditRecord.setApprovalResult(CommonConstants.dingleDigitStrArray[3]);
submitAuditRecord.setDeleteFlag(CommonConstants.NOT_DELETE_FLAG);
submitAuditRecord.setApprovalTime(LocalDateTime.now());
// 审核记录标识 1当前审核记录
submitAuditRecord.setPreFlag(CommonConstants.ONE_STRING);
submitAuditRecord.setSubmitMan(user.getId());
submitAuditRecord.setSubmitManName(user.getNickname());
// 申请原因
// submitAuditRecord.setReason(reason); // submitAuditRecord.setReason(reason);
// 审核类型 // 审核类型
submitAuditRecord.setAuditType(CommonConstants.ZERO_STRING); submitAuditRecord.setAuditType(CommonConstants.ZERO_STRING);
submitAuditRecord.setCreateTime(LocalDateTime.now()); submitAuditRecord.setCreateTime(LocalDateTime.now());
// 提交节点名称 // 提交节点名称
submitAuditRecord.setNodeName("提交即审核通过"); submitAuditRecord.setNodeName("提交即审核通过");
submitAuditRecord.setSubmitCreateTime(LocalDateTime.now()); submitAuditRecord.setSubmitCreateTime(LocalDateTime.now());
submitAuditRecord.setEntityName(applyNo); submitAuditRecord.setEntityName(applyNo);
auditRecordService.save(submitAuditRecord); auditRecordService.save(submitAuditRecord);
} }
//更新附件 //更新附件
updateFileId(tInsuranceUnpurchaseApply); updateFileId(tInsuranceUnpurchaseApply);
List<TInsuranceUnpurchasePerson> personInfoList = new ArrayList<>(); //先删除明细表数据再重新生成
for (TInsuranceUnpurchasePersonAddVo vo : personList) { personService.remove(Wrappers.<TInsuranceUnpurchasePerson>lambdaQuery()
TInsuranceUnpurchasePerson person = new TInsuranceUnpurchasePerson(); .eq(TInsuranceUnpurchasePerson::getParnetId, tInsuranceUnpurchaseApply.getId()));
person.setEmpIdcardNo(vo.getEmpIdcardNo()); List<TInsuranceUnpurchasePerson> personInfoList = new ArrayList<>();
person.setEmpName(vo.getEmpName()); for (TInsuranceUnpurchasePersonAddVo vo : personList) {
person.setPost(vo.getPost()); TInsuranceUnpurchasePerson person = new TInsuranceUnpurchasePerson();
person.setApplyNoDetail(getDetailCode(applyDetail, vo.getRowIndex())); person.setEmpIdcardNo(vo.getEmpIdcardNo());
person.setCreateTime(tInsuranceUnpurchaseApply.getCreateTimeZc()); person.setEmpName(vo.getEmpName());
initValue(tInsuranceUnpurchaseApply, person); person.setPost(vo.getPost());
personInfoList.add(person); person.setApplyNoDetail(getDetailCode(applyDetail, vo.getRowIndex()));
person.setCreateTime(tInsuranceUnpurchaseApply.getCreateTimeZc());
initValue(tInsuranceUnpurchaseApply, person);
personInfoList.add(person);
}
personService.saveBatch(personInfoList);
} else {
//申请人是否属于子分公司和该项目是否有审批通过记录赋值
setValue(tInsuranceUnpurchaseApply, user, applyNo);
tInsuranceUnpurchaseApply.setCreateTimeZc(LocalDateTime.now());
tInsuranceUnpurchaseApply.setCreateBy(user.getId());
tInsuranceUnpurchaseApply.setCreateName(user.getNickname());
tInsuranceUnpurchaseApply.setCreateUserDeptName(user.getDeptName());
tInsuranceUnpurchaseApply.setCreateUserDeptId(user.getDeptId().toString());
tInsuranceUnpurchaseApply.setApplyNo(applyNo);
baseMapper.insert(tInsuranceUnpurchaseApply);
if (tInsuranceUnpurchaseApply.getAuditFlag().equals(CommonConstants.ZERO_STRING)) {
// 记录提交审核日志
TAuditRecord submitAuditRecord = new TAuditRecord();
submitAuditRecord.setDomainId(tInsuranceUnpurchaseApply.getId());
submitAuditRecord.setFlowId(CommonConstants.EMPTY_STRING);
submitAuditRecord.setNodeId(CommonConstants.EMPTY_STRING);
submitAuditRecord.setApprovalMan(user.getId());
submitAuditRecord.setApprovalManName(user.getNickname());
// 审批结果为“提交”
submitAuditRecord.setApprovalResult(CommonConstants.dingleDigitStrArray[3]);
submitAuditRecord.setDeleteFlag(CommonConstants.NOT_DELETE_FLAG);
submitAuditRecord.setApprovalTime(LocalDateTime.now());
// 审核记录标识 1当前审核记录
submitAuditRecord.setPreFlag(CommonConstants.ONE_STRING);
submitAuditRecord.setSubmitMan(user.getId());
submitAuditRecord.setSubmitManName(user.getNickname());
// 申请原因
// submitAuditRecord.setReason(reason);
// 审核类型
submitAuditRecord.setAuditType(CommonConstants.ZERO_STRING);
submitAuditRecord.setCreateTime(LocalDateTime.now());
// 提交节点名称
submitAuditRecord.setNodeName("提交即审核通过");
submitAuditRecord.setSubmitCreateTime(LocalDateTime.now());
submitAuditRecord.setEntityName(applyNo);
auditRecordService.save(submitAuditRecord);
}
//更新附件
updateFileId(tInsuranceUnpurchaseApply);
List<TInsuranceUnpurchasePerson> personInfoList = new ArrayList<>();
for (TInsuranceUnpurchasePersonAddVo vo : personList) {
TInsuranceUnpurchasePerson person = new TInsuranceUnpurchasePerson();
person.setEmpIdcardNo(vo.getEmpIdcardNo());
person.setEmpName(vo.getEmpName());
person.setPost(vo.getPost());
person.setApplyNoDetail(getDetailCode(applyDetail, vo.getRowIndex()));
person.setCreateTime(tInsuranceUnpurchaseApply.getCreateTimeZc());
initValue(tInsuranceUnpurchaseApply, person);
personInfoList.add(person);
}
personService.saveBatch(personInfoList);
} }
personService.saveBatch(personInfoList); } else {
return R.failed(personList);
} }
} else {
return R.failed(personList);
} }
} }
} catch (Exception e) { } catch (Exception e) {
...@@ -350,8 +353,7 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance ...@@ -350,8 +353,7 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
public List<TInsuranceUnpurchasePersonAddVo> addAndUpdCheck(TInsuranceUnpurchaseApply tInsuranceUnpurchaseApply) { public List<TInsuranceUnpurchasePersonAddVo> addAndUpdCheck(TInsuranceUnpurchaseApply tInsuranceUnpurchaseApply) {
Map<String,String> sameCheckMap = new HashMap<>(); Map<String,String> sameCheckMap = new HashMap<>();
TInsuranceUnpurchaseApply exitApply;
TInsuranceUnpurchasePerson exit;
List<TInsuranceUnpurchasePersonAddVo> personList = tInsuranceUnpurchaseApply.getPersonList(); List<TInsuranceUnpurchasePersonAddVo> personList = tInsuranceUnpurchaseApply.getPersonList();
if (Common.isNotNull(personList) && !personList.isEmpty()) { if (Common.isNotNull(personList) && !personList.isEmpty()) {
R<Boolean> flagSocial; R<Boolean> flagSocial;
......
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
inner join t_insurance_unpurchase_person b inner join t_insurance_unpurchase_person b
on a.id = b.PARNET_ID on a.id = b.PARNET_ID
where where
1=1 and a.DELETE_FLAG = '0' and a.reason_type = '1' and a.status != '0' 1=1 and a.DELETE_FLAG = '0' and a.reason_type = '1' and a.status in ('2','3')
<if test="id != null "> <if test="id != null ">
AND a.id != #{id} AND a.id != #{id}
</if> </if>
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
inner join t_insurance_unpurchase_person b inner join t_insurance_unpurchase_person b
on a.id = b.PARNET_ID on a.id = b.PARNET_ID
where where
1=1 and a.DELETE_FLAG = '0' and a.reason_type = '2' and a.status != '0' and b.SALARY_NUM = 0 1=1 and a.DELETE_FLAG = '0' and a.reason_type = '2' and a.status in ('2','3') and b.SALARY_NUM = 0
<if test="id != null "> <if test="id != null ">
AND a.id != #{id} AND a.id != #{id}
</if> </if>
......
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