k94314517
2025-04-11 c1b5d8b81d63555f6f0095aa823f07d99f80fe21
server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java
@@ -35,6 +35,8 @@
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;
@@ -513,7 +515,7 @@
        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());
        }
@@ -2375,8 +2377,13 @@
    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<>();
@@ -2459,6 +2466,8 @@
            }
            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())
@@ -2535,11 +2544,11 @@
                        .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);
        }
    }
@@ -2592,7 +2601,7 @@
        };
    }
    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 {
@@ -2604,7 +2613,7 @@
                            .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
@@ -2622,6 +2631,7 @@
        }
        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{
@@ -3493,7 +3503,7 @@
        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());
        }
@@ -3578,7 +3588,7 @@
            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());
        }
@@ -3659,7 +3669,7 @@
        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());
        }