|  |  |  | 
|---|
|  |  |  | import io.swagger.models.auth.In; | 
|---|
|  |  |  | import org.apache.commons.lang3.StringUtils; | 
|---|
|  |  |  | import org.apache.shiro.SecurityUtils; | 
|---|
|  |  |  | import org.slf4j.Logger; | 
|---|
|  |  |  | import org.slf4j.LoggerFactory; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Value; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  | 
|---|
|  |  |  | if(!Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.WAIT_SIGNATURE.getKey())){ | 
|---|
|  |  |  | throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该申请状态已流转,当前不支持该操作~"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | Company company = user.getCompany(); | 
|---|
|  |  |  | Company company = user.getShowCompany(); | 
|---|
|  |  |  | if(debugModel){ | 
|---|
|  |  |  | company = companyMapper.selectById(model.getCompanyId()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private static Logger logger = LoggerFactory.getLogger(InsuranceApplyServiceImpl.class); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void dealApplyDetailData(InsuranceApply insuranceApply,Solutions solutions,List<ApplyDetail> applyDetailList, | 
|---|
|  |  |  | LoginUserInfo loginUserInfo,CountCyclePriceVO  countCyclePriceVO,Boolean checkNewData){ | 
|---|
|  |  |  | Long start = System.currentTimeMillis(); | 
|---|
|  |  |  | logger.error("处理保单数据开始时间:=========================>"+start); | 
|---|
|  |  |  | //2024年11月6日15:01:34  加入  方案配置了有派遣单位 才会去验证派遣单位数据 | 
|---|
|  |  |  | List<DuSolution>  duSolutionList = new ArrayList<>(); | 
|---|
|  |  |  | List<DuWorktype> duWorktypeList = new ArrayList<>(); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | memberList.addAll(addMemberList); | 
|---|
|  |  |  | for (int i = 0; i < applyDetailList.size(); i++) { | 
|---|
|  |  |  | Long singlStart = System.currentTimeMillis(); | 
|---|
|  |  |  | logger.error("处理保单单条数据开始时间:=========================>"+singlStart); | 
|---|
|  |  |  | ApplyDetail applyDetail = applyDetailList.get(i); | 
|---|
|  |  |  | if(Objects.isNull(applyDetail) | 
|---|
|  |  |  | ||StringUtils.isBlank(applyDetail.getIdcardNo()) | 
|---|
|  |  |  | 
|---|
|  |  |  | .collect(Collectors.toList()).size()<=Constants.ZERO){ | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"【"+applyDetail.getMemberName()+applyDetail.getIdcardNo()+"】员工工种信息未查询到!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //                if(duWorktypeList.stream().filter(d->d.getWorkTypeId().equals(applyDetail.getWorktypeId())) | 
|---|
|  |  |  | //                        .collect(Collectors.toList()).size()<=Constants.ZERO){ | 
|---|
|  |  |  | //                    throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"【"+applyDetail.getMemberName()+applyDetail.getIdcardNo()+"】员工工种信息未查询到!"); | 
|---|
|  |  |  | //                } | 
|---|
|  |  |  | Long singlEnd = System.currentTimeMillis(); | 
|---|
|  |  |  | logger.error("处理保单单条数据结束时间:=========================>"+singlEnd+";耗时:====》"+(singlStart-singlEnd)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | Long end = System.currentTimeMillis(); | 
|---|
|  |  |  | logger.error("处理单数据结束时间:=========================>"+end +";耗时:====》"+(end-start)); | 
|---|
|  |  |  | applyDetailJoinMapper.insertBatchSomeColumn(applyDetailList); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static void checkStaticMemberSolution(Integer solutionId,String idCode,String memberName,Date startTime, | 
|---|
|  |  |  | public static void checkStaticMemberSolution(Integer solutionId,Integer memberId,String memberIdCard,String memberName,Date startTime, | 
|---|
|  |  |  | Date endTime,ApplyDetailJoinMapper applyDetailJoinMapper){ | 
|---|
|  |  |  | List<ApplyDetail> applyDetailList = new ArrayList<ApplyDetail>(); | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | 
|---|
|  |  |  | .leftJoin(InsuranceApply.class,InsuranceApply::getId,ApplyDetail::getApplyId) | 
|---|
|  |  |  | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) | 
|---|
|  |  |  | .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId) | 
|---|
|  |  |  | .eq(ApplyDetail::getIdcardNo,idCode) | 
|---|
|  |  |  | .eq(ApplyDetail::getIdcardNo,memberIdCard) | 
|---|
|  |  |  | .eq(Solutions::getBaseId,solutionId) | 
|---|
|  |  |  | .eq(ApplyDetail::getIsdeleted,Constants.ZERO) | 
|---|
|  |  |  | .notIn(InsuranceApply::getStatus | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if(applyDetailList.size() >Constants.ZERO){ | 
|---|
|  |  |  | String companyName = applyDetailList.get(Constants.ZERO).getCompanyName(); | 
|---|
|  |  |  | String idCode = applyDetailList.get(Constants.ZERO).getIdcardNo(); | 
|---|
|  |  |  | if(StringUtils.isNotBlank(companyName)){ | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"该员工【"+memberName+" "+idCode+"】已在【"+companyName+"】存在保险,请联系客服确认"); | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | 
|---|
|  |  |  | if(!Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.WTB_UPLOAD.getKey())){ | 
|---|
|  |  |  | throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该申请状态已流转,当前不支持该操作~"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | Company company = user.getCompany(); | 
|---|
|  |  |  | Company company = user.getShowCompany(); | 
|---|
|  |  |  | if(debugModel){ | 
|---|
|  |  |  | company = companyMapper.selectById(model.getCompanyId()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对不起,该申请状态已流转,当前不支持签章操作!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); | 
|---|
|  |  |  | Company company = user.getCompany(); | 
|---|
|  |  |  | Company company = user.getShowCompany(); | 
|---|
|  |  |  | if(debugModel){ | 
|---|
|  |  |  | company = companyMapper.selectById(model.getCompanyId()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | if(!Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.WTB_TOUBAOING.getKey())){ | 
|---|
|  |  |  | throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该申请状态已流转,当前不支持该操作~"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | Company company = user.getCompany(); | 
|---|
|  |  |  | Company company = user.getShowCompany(); | 
|---|
|  |  |  | if(debugModel){ | 
|---|
|  |  |  | company = companyMapper.selectById(model.getCompanyId()); | 
|---|
|  |  |  | } | 
|---|