nidapeng
2024-04-11 64d4993478b5ba6a91aa8c535482ae151acaceb2
Merge remote-tracking branch 'origin/1.0.1' into 1.0.1
已修改7个文件
86 ■■■■ 文件已修改
server/service/src/main/java/com/doumee/core/utils/Constants.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/ApplyChagneDetailServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/ApplyChangeServiceImpl.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/TaxesServiceImpl.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/UnionApplyServiceImpl.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/UnionChangeServiceImpl.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/core/utils/Constants.java
@@ -791,6 +791,7 @@
        CA_JIAJIAN_APPLY_SIGN(23, "加减保申请企业签章","",1),
        CA_CHANGUNIT_APPLY_SIGN(24, "换厂申请企业签章","",1),
        CA_UPLOAD_AGAIN(25, "再次投保","",1),
        CA_HBD_AUDIT(42, "审批通过","原因:${param}",1),
        WTB_FINISH_FAQRS(26, "委托保 - 企业完成签署方案确认书","",0),
        WTB_FINISH_MEMBER_LIST(27, "委托保 - 企业完成签署人员名单","",0),
@@ -819,7 +820,6 @@
        CA_HBD_SIGNATURE_TBD(38, "商户签章","",4),
        CA_HBD_UPLOAD_INSURANCE(39, "投保完成","",4),
        CA_HBD_CLOSE(40, "退回申请","原因:${param}",4),
        CA_HBD_AUDIT(41, "审批通过","原因:${param}",4),
server/service/src/main/java/com/doumee/service/business/impl/ApplyChagneDetailServiceImpl.java
@@ -266,7 +266,6 @@
        List<ApplyChagneDetail> list = applyChangeDetailJoinMapper.selectJoinList(ApplyChagneDetail.class, queryWrapper);
        for (ApplyChagneDetail applyChagneDetail:list) {
            applyChagneDetail.setAge(Constants.getAgeByIdCard(applyChagneDetail.getMemberIdcardNo()));
        }
        return list;
    }
server/service/src/main/java/com/doumee/service/business/impl/ApplyChangeServiceImpl.java
@@ -882,7 +882,9 @@
        if (Objects.isNull(insuranceApply)) {
            throw new BusinessException(ResponseStatus.DATA_EMPTY);
        }
        if (!Constants.equalsInteger(insuranceApply.getStatus(),Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey())) {
        if (!(Constants.equalsInteger(insuranceApply.getStatus(),Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey())
        ||Constants.equalsInteger(insuranceApply.getStatus(),Constants.InsuranceApplyStatus.WTB_DONE.getKey())
        )) {
            throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(), "保单状态错误");
        }
        if (DateUtil.compareDate(insuranceApply.getEndTime(),new Date()) >= Constants.ZERO
@@ -1020,6 +1022,13 @@
        //换厂业务
        List<ApplyChagneDetail> changeDetailList = applyChange.getChangeDetailList();
        if (CollectionUtils.isNotEmpty(changeDetailList)) {
            //验证是否存在重复数据
            List<String> idcarNo = changeDetailList.stream().map(m->m.getIdcardNo()).collect(Collectors.toList());
            Set<String> set = new HashSet<>(idcarNo);
            if(idcarNo.size() != set.size()){
                throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"对不起,人员录入数据存在相同数据!");
            }
            this.changeDetail(applyChange,changeDetailList,duWorktypeList,duSolutionList,loginUserInfo);
        }
        return fee;
@@ -2030,7 +2039,7 @@
        CountCyclePriceVO returnCountCyclePriceVO = new CountCyclePriceVO();
        //加减保金额
//        returnCountCyclePriceVO.setCyclePrice(sumPrice.multiply(new BigDecimal(optDays)).divide(new BigDecimal(sumDays),2, RoundingMode.HALF_UP));
        returnCountCyclePriceVO.setCyclePrice(applyDetail.getPrice().multiply(new BigDecimal(optDays)));
        returnCountCyclePriceVO.setCyclePrice(applyDetail.getPrice().multiply(new BigDecimal(optDays)).setScale(2, RoundingMode.HALF_UP));
        return returnCountCyclePriceVO;
    }
@@ -2171,6 +2180,9 @@
        }
        if(applyChange.getId() == null){
            throw  new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        if(Objects.isNull(applyChange)){
            throw  new BusinessException(ResponseStatus.DATA_EMPTY);
        }
        ApplyChange model = applyChangeJoinMapper.selectJoinOne(ApplyChange.class,
                new MPJLambdaWrapper<ApplyChange>()
@@ -2219,7 +2231,7 @@
        }else{
            info = info.replace("${param}", "");
        }
        ApplyLog log = new ApplyLog(applyChange,applyLogType.getName(),info,applyChange.getId(),applyLogType.getKey(), null, null);
        ApplyLog log = new ApplyLog(update,applyLogType.getName(),info,update.getId(),applyLogType.getKey(), null, null);
        applyLogMapper.insert(log);
server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java
@@ -1822,7 +1822,7 @@
                    throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"投保信息异常:总天数与总金额错误");
                }
                applyDetail.setPrice(
                        applyDetail.getFee().divide(new BigDecimal(maxDays),2,RoundingMode.HALF_UP)
                        applyDetail.getFee().divide(new BigDecimal(maxDays),7,RoundingMode.HALF_UP)
                );
                //验证派遣单位信息是否存在
                if(duSolutionList.stream().filter(d->d.getDispatchUnitId().equals(applyDetail.getDuId())).collect(Collectors.toList()).size()<=Constants.ZERO){
@@ -1894,18 +1894,21 @@
            return  new ArrayList<>();
        }
        List<Integer> statusList = Constants.InsuranceApplyStatus.getKesByStatus(collectStatus);
        if(collectStatus.equals(Constants.ApplyCollectStatus.DCD.getKey())){
        if(Constants.equalsInteger(collectStatus,Constants.ApplyCollectStatus.DCD.getKey())){
            statusList.addAll(Constants.InsuranceApplyStatus.getKesByStatus(Constants.ApplyCollectStatus.WTBDCD.getKey()));
        }else if(collectStatus.equals(Constants.ApplyCollectStatus.DSP.getKey())){
        }else if(Constants.equalsInteger(collectStatus,Constants.ApplyCollectStatus.DSP.getKey())){
            statusList.addAll(Constants.InsuranceApplyStatus.getKesByStatus(Constants.ApplyCollectStatus.WTBDSH.getKey()));
        }else if(collectStatus.equals(Constants.ApplyCollectStatus.BZZ.getKey())){
        }else if(Constants.equalsInteger(collectStatus,Constants.ApplyCollectStatus.BZZ.getKey())){
            statusList.addAll(Constants.InsuranceApplyStatus.getKesByStatus(Constants.ApplyCollectStatus.WTBBZZ.getKey()));
        }else if(collectStatus.equals(Constants.ApplyCollectStatus.YTH.getKey())){
        }else if(Constants.equalsInteger(collectStatus,Constants.ApplyCollectStatus.YTH.getKey())){
            statusList.addAll(Constants.InsuranceApplyStatus.getKesByStatus(Constants.ApplyCollectStatus.WTBYTH.getKey()));
        }else if(collectStatus.equals(Constants.ApplyCollectStatus.YGB.getKey())){
        }else if(Constants.equalsInteger(collectStatus,Constants.ApplyCollectStatus.YGB.getKey())){
            statusList.addAll(Constants.InsuranceApplyStatus.getKesByStatus(Constants.ApplyCollectStatus.WTBYGB.getKey()));
        }else if(collectStatus.equals(Constants.ApplyCollectStatus.DQYQZ.getKey())){
        }else if(Constants.equalsInteger(collectStatus,Constants.ApplyCollectStatus.DQYQZ.getKey())){
            statusList.addAll(Constants.InsuranceApplyStatus.getKesByStatus(Constants.ApplyCollectStatus.WTBDQS.getKey()));
        }else if(Constants.equalsInteger(collectStatus,Constants.ApplyCollectStatus.YGQ.getKey())){
            statusList.addAll(Constants.InsuranceApplyStatus.getKesByStatus(Constants.ApplyCollectStatus.WTBBZZ.getKey()));
            statusList.add(Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey());
        }
        return statusList;
server/service/src/main/java/com/doumee/service/business/impl/TaxesServiceImpl.java
@@ -474,20 +474,20 @@
            ){
                throw new BusinessException(ResponseStatus.BAD_REQUEST);
            }
            //查询每个保单下可以投保的金额
            //查询每个保单下可以报销的金额
            InsuranceApply insuranceApply = insuranceApplyJoinMapper.selectJoinOne(InsuranceApply.class,new MPJLambdaWrapper<InsuranceApply>()
                    .selectAll(InsuranceApply.class)
//                    .select(" ifnull(( select sum(td.fee) from taxes ts inner join tax_detial td on td.TAX_ID = ts.id  where ts.status  = 1 and td.INSURANCE_APPLY_ID = t.id ),0) as taxesMoney")
                    .select(" ifnull(( select sum(td.fee) from taxes ts inner join tax_detial td on td.TAX_ID = ts.id  where ts.status != 2 and td.INSURANCE_APPLY_ID = t.id ),0) as taxesMoney ")
                    .eq(InsuranceApply::getId,taxDetial.getInsuranceApplyId())
            );
//            if(Objects.isNull(insuranceApply)){
//                throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"保单号【"+taxDetial.getApplyCode()+"】未查询到保单信息");
//            }
//            if(insuranceApply.getCurrentFee().subtract(insuranceApply.getTaxesMoney()).compareTo(taxDetial.getFee())!=Constants.ZERO){
//                //throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"保单号【"+taxDetial.getApplyCode()+"】可报销金额错误【"+insuranceApply.getCurrentFee().subtract(insuranceApply.getTaxesMoney())+"】");
//                throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"保单号【"+taxDetial.getApplyCode()+"】可报销金额错误");
//            }
            if(Objects.isNull(insuranceApply)){
                throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"保单号【"+taxDetial.getApplyCode()+"】未查询到保单信息");
            }
            if(insuranceApply.getCurrentFee().subtract(insuranceApply.getTaxesMoney()).compareTo(taxDetial.getFee())!=Constants.ZERO){
                //throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"保单号【"+taxDetial.getApplyCode()+"】可报销金额错误【"+insuranceApply.getCurrentFee().subtract(insuranceApply.getTaxesMoney())+"】");
                throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"保单号【"+taxDetial.getApplyCode()+"】不满足开票条件");
            }
            taxDetial.setCreator(user.getId());
            taxDetial.setCreateDate(new Date());
            taxDetial.setIsdeleted(Constants.ZERO);
server/service/src/main/java/com/doumee/service/business/impl/UnionApplyServiceImpl.java
@@ -387,7 +387,6 @@
                }
            }
        }
    }
@@ -450,13 +449,22 @@
        Integer maxDays = DateUtil.calculateBetween(saveUnionApplyDTO.getStartDate(),saveUnionApplyDTO.getEndDate(),0);
        List<ApplyDetail> applyDetailList = applyDetailJoinMapper.selectList(new QueryWrapper<ApplyDetail>().lambda().select(ApplyDetail::getId,ApplyDetail::getPrice)
        List<ApplyDetail> applyDetailList = applyDetailJoinMapper.selectList(new QueryWrapper<ApplyDetail>().lambda()
                .select(ApplyDetail::getId,ApplyDetail::getPrice,ApplyDetail::getStartTime,ApplyDetail::getEndTime,ApplyDetail::getFee)
                .in(ApplyDetail::getApplyId,saveUnionApplyDTO.getApplyIds())
                .eq(ApplyDetail::getIsdeleted,Constants.ZERO));
        if(applyDetailList.size()==0){
            throw  new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对不起,存在委托投保申请记录信息有误,请返回查看申请人员是否为空!");
        }
        unionApply.setFee(applyDetailList.stream().map(i->Constants.formatBigdecimal(i.getPrice()).multiply(new BigDecimal(maxDays))).reduce(BigDecimal.ZERO,BigDecimal::add));
        BigDecimal fee = BigDecimal.ZERO;
        for (ApplyDetail applyDetail:applyDetailList) {
            Integer oldDays = DateUtil.calculateBetween(applyDetail.getStartTime(),applyDetail.getEndTime(),0);
            fee =fee.add(new BigDecimal(maxDays).multiply( applyDetail.getFee()).divide(new BigDecimal(oldDays),2,RoundingMode.HALF_UP));
        }
        unionApply.setFee(fee);
//        unionApply.setFee(applyDetailList.stream()
//                .map(i->Constants.formatBigdecimal(i.getPrice()).multiply(new BigDecimal(maxDays))).reduce(BigDecimal.ZERO,BigDecimal::add));
        unionApplyMapper.insert(unionApply);
server/service/src/main/java/com/doumee/service/business/impl/UnionChangeServiceImpl.java
@@ -36,6 +36,7 @@
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
@@ -187,7 +188,7 @@
                    fee = fee.subtract(new BigDecimal(maxDays).multiply(applyChagneDetail.getPrice())).add(applyChagneDetail.getFee());
                }
            }
            unionChange.setFee(fee);
            unionChange.setFee(fee.setScale(2, RoundingMode.HALF_UP));
            //查询操作记录
            List<ApplyLog> applyLogList = applyLogJoinMapper.selectJoinList(ApplyLog.class,
                    new MPJLambdaWrapper<ApplyLog>()
@@ -389,6 +390,8 @@
        UnionChange unionChange = new UnionChange();
        unionChange.setCreateDate(new Date());
        unionChange.setCreator(user.getId());
        unionChange.setEditDate(new Date());
        unionChange.setEditor(user.getId());
        unionChange.setShopId(user.getCompanyId());
        unionChange.setIsdeleted(Constants.ZERO);
        unionChange.setUnionApplyId(saveUnionChangeDTO.getUnionApplyId());
@@ -699,6 +702,7 @@
        }
        if(CollectionUtils.isNotEmpty(applyChangeList)){
            for (ApplyChange applyChange:applyChangeList) {
                ApplyChange oldModel = applyChange;
                applyChange.setApplyStartTime(unionChangeBXDDTO.getApplyDate());
                applyChange.setValidTime(unionChangeBXDDTO.getApplyDate());
                applyChange.setEditDate(new Date());
@@ -727,6 +731,18 @@
                                .eq(ApplyChagneDetail::getApplyChangeId,applyChange.getId()));
                this.dealApplyChangeDetail(applyChange,allList);
                applyChangeJoinMapper.updateById(applyChange);
                //存储批单完成信息
                Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_PLATFORM_APPROVE;
                String info = "";
                if(applyChange.getValidTime()!=null && applyChange.getValidTime().getTime()/1000!= applyChange.getApplyStartTime().getTime()/1000){
                    info =applyLogType.getInfo();
                    info = info.replace("${param1}",DateUtil.getPlusTime2(applyChange.getValidTime()));
                    info = info.replace("${param2}",DateUtil.getPlusTime2(applyChange.getApplyStartTime()));
                }
                ApplyLog log = new ApplyLog(applyChange,applyLogType.getName(), info,applyChange.getId(),applyLogType.getKey(),JSONObject.toJSONString(oldModel), JSONObject.toJSONString(applyChange));
                applyLogMapper.insert(log);
            }
        }
        unionChangeMapper.update(null,new UpdateWrapper<UnionChange>().lambda()