jiangping
2024-01-23 0e31fd20a1be8899f0ade4b7b7fb0e8d196624bf
开发业务接口
已修改13个文件
428 ■■■■■ 文件已修改
server/platform/src/main/java/com/doumee/api/business/ApplyChangeController.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/platform/src/main/java/com/doumee/api/business/InsuranceApplyController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/platform/src/main/java/com/doumee/api/business/TaxesController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/core/utils/Constants.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/join/ApplyChagneDetailJoinMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/model/ApplyChagneDetail.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/model/ApplyChange.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/model/ApplyDetail.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/ApplyChangeService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/InsuranceApplyService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/ApplyChangeServiceImpl.java 258 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/TaxesServiceImpl.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/platform/src/main/java/com/doumee/api/business/ApplyChangeController.java
@@ -37,6 +37,34 @@
    public ApiResponse create(@RequestBody ApplyChange applyChange) {
        return ApiResponse.success(applyChangeService.create(applyChange));
    }
    @PreventRepeat
    @ApiOperation("平台退回投保")
    @PostMapping("/back")
    @RequiresPermissions("business:applychange:back")
    public ApiResponse back(@RequestBody ApplyChange applyChange) {
        return ApiResponse.success(applyChangeService.back(applyChange));
    }
    @PreventRepeat
    @ApiOperation("平台处理退回申请")
    @PostMapping("/dealBackApply")
    @RequiresPermissions("business:applychange:dealBackApply")
    public ApiResponse dealBackApply(@RequestBody ApplyChange applyChange) {
        return ApiResponse.success(applyChangeService.dealBackApply(applyChange));
    }
    @PreventRepeat
    @ApiOperation("平台上传批单")
    @PostMapping("/uploadPidan")
    @RequiresPermissions("business:applychange:uploadPidan")
    public ApiResponse uploadPidan(@RequestBody ApplyChange applyChange) {
        return ApiResponse.success(applyChangeService.uploadPidan(applyChange));
    }
    @PreventRepeat
    @ApiOperation("平台修改批单")
    @PostMapping("/editPidan")
    @RequiresPermissions("business:applychange:editPidan")
    public ApiResponse editPidan(@RequestBody ApplyChange applyChange) {
        return ApiResponse.success(applyChangeService.editPidan(applyChange));
    }
    @ApiOperation("根据ID删除")
    @GetMapping("/delete/{id}")
server/platform/src/main/java/com/doumee/api/business/InsuranceApplyController.java
@@ -69,6 +69,12 @@
    public ApiResponse dealBackApply(@RequestBody InsuranceApply insuranceApply) {
        return ApiResponse.success(insuranceApplyService.dealBackApply(insuranceApply));
    }
    @ApiOperation("平台修改保险单")
    @PostMapping("/editBaoxiandan")
    @RequiresPermissions("business:insuranceapply:editBaoxiandan")
    public ApiResponse editBaoxiandan(@RequestBody InsuranceApply insuranceApply) {
        return ApiResponse.success(insuranceApplyService.editBaoxiandan(insuranceApply));
    }
    @ApiOperation("根据ID删除")
    @GetMapping("/delete/{id}")
server/platform/src/main/java/com/doumee/api/business/TaxesController.java
@@ -99,7 +99,7 @@
    @ApiOperation("根据ID查询")
    @GetMapping("/{id}")
    @RequiresPermissions("business:taxes:query")
    public ApiResponse findById(@PathVariable Integer id) {
    public ApiResponse<Taxes> findById(@PathVariable Integer id) {
        return ApiResponse.success(taxesService.findById(id));
    }
}
server/service/src/main/java/com/doumee/core/utils/Constants.java
@@ -367,7 +367,9 @@
        BD_APPLY_PDF(8, "保单申请表PDF ", "保单申请表PDF "),
        BD_SIGNED_PDF(9, "签署后保单申请表PDF", "签署后保单申请表PDF"),
        COM_SING_IMG(10, "企业印章", "企业印章"),
        BD_DONE_PDF(10, "最终报单", "最终报单"),
        BD_DONE_PDF(11, "最终报单", "最终报单"),
        CA_PD_PDF(12, "最终报单", "最终报单"),
        ;
@@ -634,13 +636,15 @@
        PLATFORM_CHECK_PASS(11, "投保审核通过",""),
        CA_PLATFORM_CHECK_PASS_NO(12, "退回投保","提交意见:${param}"),
        CA_PLATFORM_AGREE_BACK_APPLY(13, "同意退回申请","提交意见:${param}"),
        CA_PLATFORM_CHECK_APPROVE(14, "批单完成",""),
        CA_PLATFORM_APPROVE(14, "批单完成","保险生效起期:${param1}变更为${param2}"),
        CA_PLATFORM_CHECK_SIGNATURE(15, "企业签章",""),
        CA_COMPANY_EDIT(16, "批单修改","提交意见:${param1}\n${param2}"),
        CA_COMPANY_COMMIT(17, "提交投保","提交意见:${param}"),
        CA_COMPANY_BACK_APPLY(18, "申请退回","提交意见:${param}"),
        CA_COMPANY_CLOSE(19, "关闭订单",""),
        CA_PALTFORM_REFUSE_APPLY(20, "驳回退回申请",""),
        CA_PALTFORM_EDIT_PIDAN(21, "修改批单","修改原因:${param}"),
        PALTFORM_EDIT_BD(22, "修改保单","修改原因:${param}"),
        ;
        // 成员变量
        private String name;
@@ -775,6 +779,14 @@
        }
        return solutions.getPrice().multiply(new BigDecimal(cycle));
    }
    public static BigDecimal countDetailFee(int timeUnit ,BigDecimal price,Date startDate, Date endDate){
        //查询保险实际周期
        Integer cycle = DateUtil.calculateBetween(endDate,startDate,timeUnit);
        if(cycle==-1){
            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"日期信息错误!");
        }
        return Constants.formatBigdecimal(price).multiply(new BigDecimal(cycle));
    }
    public  enum ApplyChangeStatus {
server/service/src/main/java/com/doumee/dao/business/join/ApplyChagneDetailJoinMapper.java
@@ -2,7 +2,10 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.doumee.dao.business.model.ApplyChagneDetail;
import com.doumee.dao.business.model.ApplyDetail;
import com.github.yulichang.base.mapper.MPJJoinMapper;
import java.util.List;
/**
 * @author 江蹄蹄
@@ -10,4 +13,5 @@
 */
public interface ApplyChagneDetailJoinMapper extends MPJJoinMapper<ApplyChagneDetail> {
    void insertBatchSomeColumn(List<ApplyDetail> addList);
}
server/service/src/main/java/com/doumee/dao/business/model/ApplyChagneDetail.java
@@ -67,11 +67,11 @@
    @ApiModelProperty(value = "实际保险生效止期")
    @ExcelColumn(name="实际保险生效止期")
    private String endTime;
    private Date endTime;
    @ApiModelProperty(value = "实际保险生效起期")
    @ExcelColumn(name="实际保险生效起期")
    private String startTime;
    private Date startTime;
    @ApiModelProperty(value = "最近操作时间")
    @ExcelColumn(name="最近操作时间")
@@ -79,7 +79,7 @@
    @ApiModelProperty(value = "派遣单位编码(关联dispatch_unit)")
    @ExcelColumn(name="派遣单位编码(关联dispatch_unit)")
    private String duId;
    private Integer duId;
    @ApiModelProperty(value = "工种编码", example = "1")
    @ExcelColumn(name="工种编码")
@@ -113,4 +113,14 @@
    @TableField(exist = false)
    private String workTypeName;
    @ApiModelProperty(value = "保险费用(人/天)", example = "1")
    @TableField(exist = false)
    private BigDecimal solutionPrice;
    @ApiModelProperty(value = "保险时间单位0天 1半月 2月 3年", example = "1")
    @TableField(exist = false)
    private Integer solutionTimeUnit;
}
server/service/src/main/java/com/doumee/dao/business/model/ApplyChange.java
@@ -162,4 +162,11 @@
    @TableField(exist = false)
    private Integer companyId;
    @ApiModelProperty(value = "批单附件对象")
    @TableField(exist = false)
    private Multifile pidanFile;
    @ApiModelProperty(value = "处理企业申请状态  0同意 1驳回")
    @TableField(exist = false)
    private int dealBackApply;
}
server/service/src/main/java/com/doumee/dao/business/model/ApplyDetail.java
@@ -67,11 +67,11 @@
    @ApiModelProperty(value = "实际保险生效止期")
    @ExcelColumn(name="实际保险生效止期")
    private String endTime;
    private Date endTime;
    @ApiModelProperty(value = "实际保险生效起期")
    @ExcelColumn(name="实际保险生效起期")
    private String startTime;
    private Date startTime;
    @ApiModelProperty(value = "身份证号码")
    @ExcelColumn(name="身份证号码")
server/service/src/main/java/com/doumee/service/business/ApplyChangeService.java
@@ -4,6 +4,8 @@
import com.doumee.core.model.PageWrap;
import com.doumee.dao.business.dto.ApplyChangeOptDTO;
import com.doumee.dao.business.model.ApplyChange;
import com.doumee.dao.business.model.InsuranceApply;
import java.util.List;
/**
@@ -22,6 +24,7 @@
    Integer create(ApplyChange applyChange);
    Integer back(ApplyChange param);
    Integer dealBackApply(ApplyChange param);
    Integer uploadPidan(ApplyChange insuranceApply);
    /**
     * 主键删除
     *
@@ -103,4 +106,6 @@
    void changeOpt(ApplyChangeOptDTO applyChangeOptDTO);
    ApplyChange findDetail(Integer id);
    Integer editPidan(ApplyChange applyChange);
}
server/service/src/main/java/com/doumee/service/business/InsuranceApplyService.java
@@ -112,4 +112,6 @@
    Integer check(InsuranceApply insuranceApply);
     InsuranceApply  findDetailForExport(InsuranceApply model);
    Integer editBaoxiandan(InsuranceApply param);
}
server/service/src/main/java/com/doumee/service/business/impl/ApplyChangeServiceImpl.java
@@ -63,6 +63,8 @@
    private MemberMapper memberMapper;
    @Autowired
    private MultifileMapper multifileMapper;
    @Autowired
    private DuSolutionMapper duSolutionMapper;
    @Autowired
    private DuWorktypeMapper duWorktypeMapper;
@@ -113,6 +115,215 @@
        return  1;
    }
    @Override
    @Transactional(rollbackFor = {Exception.class,BusinessException.class})
    public Integer uploadPidan(ApplyChange param) {
        if(param.getId() == null
                || param.getValidCode() == null
                || param.getApplyStartTime() == null
                || param.getPidanFile() == null
                ||StringUtils.isBlank( param.getPidanFile().getFileurl())
                ||StringUtils.isBlank( param.getPidanFile() .getName())){
            throw  new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        ApplyChange model = applyChangeMapper.selectById(param.getId());
        if(model == null ||!Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){
            throw  new BusinessException(ResponseStatus.DATA_EMPTY);
        }
        if(!Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.SIGNATURE.getKey())){
            throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该申请状态已流转,当前不支持该操作~");
        }
        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        ApplyChange update = new ApplyChange();
        update.setEditDate(new Date());
        update.setEditor(user.getId());
        update.setStatus(Constants.ApplyChangeStatus.APPROVE.getKey());
        update.setCheckDate(update.getEditDate());
        update.setCheckInfo(param.getCheckInfo());
        update.setCheckUserId(user.getId());
        update.setId(model.getId());
        update.setValidCode(param.getValidCode());
        update.setApplyStartTime(model.getApplyStartTime());
        applyChangeMapper.updateById(update);
        param.getPidanFile().setIsdeleted(Constants.ZERO);
        param.getPidanFile().setCreator(user.getId());
        param.getPidanFile().setObjId(update.getId());
        param.getPidanFile().setCreateDate(update.getEditDate());
        param.getPidanFile().setObjType(Constants.MultiFile.CA_PD_PDF.getKey());
        param.getPidanFile().setType(Constants.TWO);
        multifileMapper.insert(param.getPidanFile());
        update.setApplyId(model.getApplyId());
        long times =  param.getApplyStartTime().getTime() - model.getValidTime().getTime();
        //处理加减保明细数据
        dealDetailsValidTime(update,times);
        Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_PLATFORM_APPROVE;
        String info = "";
        if(model.getValidTime()!=null && model.getValidTime().getTime()/1000!= param.getApplyStartTime().getTime()/1000){
            info =applyLogType.getInfo();
            info = info.replace("${param1}",DateUtil.getPlusTime2(model.getValidTime()));
            info = info.replace("${param2}",DateUtil.getPlusTime2(param.getApplyStartTime()));
        }
        ApplyLog log = new ApplyLog(update,applyLogType.getName(), info,update.getId(),applyLogType.getKey(),JSONObject.toJSONString(model), JSONObject.toJSONString(update));
        applyLogMapper.insert(log);
        return  1;
    }
    @Override
    @Transactional(rollbackFor = {Exception.class,BusinessException.class})
    public     Integer editPidan(ApplyChange param) {
        if(param.getId() == null
                || param.getValidCode() == null
                || param.getPidanFile() == null
                || param.getCheckInfo() == null
                ||StringUtils.isBlank( param.getPidanFile().getFileurl())
                ||StringUtils.isBlank( param.getPidanFile() .getName())){
            throw  new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        ApplyChange model = applyChangeMapper.selectById(param.getId());
        if(model == null ||!Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){
            throw  new BusinessException(ResponseStatus.DATA_EMPTY);
        }
        if(!Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.APPROVE.getKey())){
            throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该申请当前不支持该操作~");
        }
        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        ApplyChange update = new ApplyChange();
        update.setEditDate(new Date());
        update.setEditor(user.getId());
        update.setCheckDate(update.getEditDate());
        update.setCheckInfo(param.getCheckInfo());
        update.setCheckUserId(user.getId());
        update.setId(model.getId());
        update.setValidCode(param.getValidCode());
        applyChangeMapper.updateById(update);
        //删除原有的保单信息
        multifileMapper.delete(new UpdateWrapper<Multifile>().lambda()
                .set(Multifile::getIsdeleted,Constants.ZERO)
                .eq(Multifile::getIsdeleted,Constants.ZERO)
                .eq(Multifile::getObjId,update.getId())
                .eq(Multifile::getObjType,Constants.MultiFile.CA_PD_PDF.getKey())
        );
        param.getPidanFile().setIsdeleted(Constants.ZERO);
        param.getPidanFile().setObjId(update.getId());
        param.getPidanFile().setCreator(user.getId());
        param.getPidanFile().setCreateDate(update.getEditDate());
        param.getPidanFile().setObjType(Constants.MultiFile.CA_PD_PDF.getKey());
        param.getPidanFile().setType(Constants.TWO);
        multifileMapper.insert(param.getPidanFile());
        Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_PALTFORM_EDIT_PIDAN;
        String info =  applyLogType.getInfo();
        info = info.replace("${param}",param.getCheckInfo());
        ApplyLog log = new ApplyLog(update,applyLogType.getName(), info,update.getId(),applyLogType.getKey(),JSONObject.toJSONString(model), JSONObject.toJSONString(update));
        applyLogMapper.insert(log);
        return  1;
    }
    /**
     * 处理加减保明细数据
     * @param update
     * @param times
     */
    private void dealDetailsValidTime(ApplyChange update,long times) {
        List<ApplyChagneDetail> detailList = applyChagneDetailJoinMapper.selectJoinList(ApplyChagneDetail.class,
                new MPJLambdaWrapper<ApplyChagneDetail>()
                        .selectAll(ApplyChagneDetail.class)
                        .selectAs(Solutions::getTimeUnit,ApplyChagneDetail::getSolutionTimeUnit)
                        .selectAs(Solutions::getPrice,ApplyChagneDetail::getSolutionPrice)
                  .leftJoin(ApplyChange.class, ApplyChange::getId, ApplyChagneDetail::getApplyChangeId)
                  .leftJoin(Solutions.class, Solutions::getId, ApplyChange::getSolutionsId)
                  .eq(ApplyChagneDetail::getApplyChangeId,update.getId())
                  .eq(ApplyChagneDetail::getIsdeleted,Constants.ZERO) );
        if(detailList ==null || detailList.size()==0){
            return;
        }
        List<ApplyDetail> addList = new ArrayList<>();
        List<Integer> reduceMembers = new ArrayList<>();
        BigDecimal totalFee = new BigDecimal(0);
        BigDecimal currentFee = new BigDecimal(0);
        for(ApplyChagneDetail detail : detailList){
            if(Constants.equalsInteger(detail.getType(),Constants.ZERO)){
                //加保
                ApplyDetail add = new ApplyDetail();
                add.setApplyId(update.getApplyId());
                add.setValidCode(update.getValidCode());
                add.setFee(detail.getFee());
                add.setIsdeleted(Constants.ZERO);
                add.setCreator(update.getEditor());
                add.setCreateDate(update.getEditDate());
                add.setMemberId(detail.getMemberId());
                add.setMemberName(detail.getMemberName());
                add.setWorktypeId(detail.getWorktypeId());
                add.setDuId(detail.getDuId());
                add.setStartTime(update.getApplyStartTime());
                add.setEndTime(detail.getEndTime());
                add.setFee(Constants.countDetailFee(detail.getSolutionTimeUnit(),detail.getSolutionPrice(), add.getStartTime(),add.getEndTime()));
                if(DateUtil.daysBetweenDates(add.getStartTime(),new Date() )>=0){
                    //如果已产生费用,计算已产生费用
                    add.setCurrentFee(Constants.countDetailFee(detail.getSolutionTimeUnit(),detail.getSolutionPrice(), add.getStartTime(),new Date()));
                }
                addList.add(add);
                totalFee.add(add.getFee());
                currentFee.add(add.getCurrentFee());
            }else{
                //减保操作
                //查询员工是在主单下 是否存在生效中的数据
                ApplyDetail oldModel = applyDetailJoinMapper.selectOne(new QueryWrapper<ApplyDetail>().lambda()
                        .eq(ApplyDetail::getApplyId, update.getApplyId())
                        .eq(ApplyDetail::getMemberId, detail.getMemberId())
                        .orderByDesc(ApplyDetail::getCreateDate)
                        .last("limit 1"));
                if(oldModel == null || oldModel.getStartTime()==null || oldModel.getStartTime().getTime() > update.getApplyStartTime().getTime()){
                    throw  new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,用户【"+detail.getMemberName()+"】原保单信息有误,当前申请不支持减保处理!");
                }
                BigDecimal updateFee = (Constants.countDetailFee(detail.getSolutionTimeUnit(),detail.getSolutionPrice(), oldModel.getStartTime(),update.getApplyStartTime()));
                BigDecimal updateCurrentFee = new BigDecimal(0);
                if(DateUtil.daysBetweenDates(update.getApplyStartTime(),new Date() )>0){
                    //如果生效时间 是今天之前,退回已产生费用,计算已产生费用(总费用-已产生费用)
                    updateCurrentFee = updateFee.subtract(oldModel.getCurrentFee());
                }
                applyDetailJoinMapper.update(null, new UpdateWrapper<ApplyDetail>().lambda()
                        .setSql(" fee = ifnull(fee,0)+"+updateFee)
                        .setSql(" current_fee = "+updateFee)
                        .set(ApplyDetail::getEditor,update.getEditor())
                        .set(ApplyDetail::getEditDate,update.getEditDate())
                        .eq(ApplyDetail::getId,oldModel.getApplyId())
                );
                totalFee.add(updateFee);
                currentFee.add(updateCurrentFee);
            }
        }
        if(addList!=null && addList.size()>0){
            applyChagneDetailJoinMapper.insertBatchSomeColumn(addList);
        }
        if(totalFee.compareTo(new BigDecimal(0)) != 0){
            //如果保单金额发生编码,更新总保单金额
            insuranceApplyMapper.update(null, new UpdateWrapper<InsuranceApply>().lambda()
                    .setSql(" fee = ifnull(fee,0)+"+totalFee)
                    .setSql(" current_fee = ifnull(current_fee,0)+"+currentFee)
                    .set(InsuranceApply::getEditor,update.getEditor())
                    .set(InsuranceApply::getEditDate,update.getEditDate())
                    .eq(InsuranceApply::getId,update.getApplyId())
            );
        }
    }
    /**
     * 平台退回投保
     * @param param
@@ -129,28 +340,46 @@
        if(model == null ||!Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){
            throw  new BusinessException(ResponseStatus.DATA_EMPTY);
        }
        if(Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.UPLOAD.getKey())
                ||Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.APPROVE.getKey())){
            //已提交和已完成状态不支持审核不通过
        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        Constants.ApplyLogType applyLogType = null;
        String info = "";
        ApplyChange update = new ApplyChange();
        if(param.getDealBackApply() ==1){
            //如果是驳回,只能可驳回已签章状态下的退回申请状态进行操作
            if(!Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.RETURN_APPLY_SIGNATURE.getKey())){
            throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该申请状态已流转,当前不支持该操作~");
        }
        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        ApplyChange update = new ApplyChange();
            applyLogType = Constants.ApplyLogType.CA_PALTFORM_REFUSE_APPLY;
            info = applyLogType.getInfo();
            info = info.replace("${param}", param.getCheckInfo());
            update.setStatus(Constants.ApplyChangeStatus.SIGNATURE.getKey());
        }else{
            //如果是同意,两种申请退回状态都可操作
            if(!(Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.RETURN_APPLY_SIGNATURE.getKey())
                    ||Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.RETURN_APPLY_UPLOAD.getKey()))){
                throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该申请状态已流转,当前不支持该操作~");
            }
            applyLogType = Constants.ApplyLogType.CA_PALTFORM_REFUSE_APPLY;
            if( Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.RETURN_APPLY_SIGNATURE.getKey())){
                update.setStatus(Constants.ApplyChangeStatus.SIGNATURE.getKey());
            }else if( Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.RETURN_APPLY_UPLOAD.getKey())){
                update.setStatus(Constants.ApplyChangeStatus.UPLOAD.getKey());
            }
        }
        update.setEditDate(new Date());
        update.setEditor(user.getId());
        update.setStatus(Constants.ApplyChangeStatus.PALTFORM_CHECK_PASS_NO.getKey());
        //同意退回,直接回到最初状态,如果驳回退回申请,则保单状态回到待上传保险单
        update.setCheckDate(update.getEditDate());
        update.setCheckInfo(param.getCheckInfo());
        update.setCheckUserId(user.getId());
        update.setId(model.getId());
        applyChangeMapper.updateById(update);
        Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_PLATFORM_CHECK_PASS_NO;
        String info =applyLogType.getInfo();
        info = info.replace("${param}", update.getCheckInfo());
        ApplyLog log = new ApplyLog(update,applyLogType.getName(),info,update.getId(),applyLogType.getKey(), JSONObject.toJSONString(model), JSONObject.toJSONString(update));
        applyLogMapper.insert(log);
        return  1;
    }
@@ -281,13 +510,12 @@
            List<ApplyDetail> applyDetailList = applyDetailJoinMapper.selectList(new QueryWrapper<ApplyDetail>().lambda()
                    .eq(ApplyDetail::getApplyId, applyChange.getApplyId())
                    .eq(ApplyDetail::getMemberId, applyChagneDetail.getMemberId())
                    .le(ApplyDetail::getStartTime, "now()")
                    .ge(ApplyDetail::getEndTime, "now()"));
                    .orderByDesc(ApplyDetail::getCreateDate));
            if (applyDetailList.size() > Constants.ONE) {
                throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "减保人员【" + applyChagneDetail.getMemberName() + "】保单信息异常,存在多条数据");
            }
            ApplyDetail applyDetail = applyDetailList.get(Constants.ZERO);
            if (applyChange.getValidTime().compareTo(DateUtil.StringToDate(applyDetail.getEndTime())) <= 0) {
            if (applyChange.getValidTime().compareTo(applyDetail.getEndTime()) <= 0) {
                throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "减保人员【" + applyChagneDetail.getMemberName() + "】保单保障日期至:【" + applyDetail.getEndTime() + "】无法通过本次申请");
            }
            applyChagneDetail.setCreateDate(new Date());
@@ -296,8 +524,8 @@
            applyChagneDetail.setApplyChangeId(applyChange.getId());
            applyChagneDetail.setType(Constants.ONE);
            applyChagneDetail.setFee(
                    Constants.countDetailFee(solutions,DateUtil.stringToDate(applyDetail.getEndTime(),"yyyy-MM-dd HH:mm:ss"),DateUtil.stringToDate(applyDetail.getStartTime(),"yyyy-MM-dd HH:mm:ss"))
                            .subtract(Constants.countDetailFee(solutions,applyChange.getValidTime(),DateUtil.stringToDate(applyDetail.getStartTime(),"yyyy-MM-dd HH:mm:ss")))
                    Constants.countDetailFee(solutions, applyDetail.getEndTime(),applyDetail.getStartTime())
                            .subtract(Constants.countDetailFee(solutions,applyChange.getValidTime(), applyDetail.getStartTime()))
            );
            applyChagneDetailJoinMapper.insert(applyChagneDetail);
        }
@@ -407,7 +635,7 @@
                throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "换厂人员【" + applyChagneDetail.getMemberName() + "】保单信息异常,存在多条数据");
            }
            ApplyDetail applyDetail = applyDetailList.get(Constants.ZERO);
            if(applyChange.getValidTime().compareTo(DateUtil.StringToDate(applyDetail.getEndTime()))<=0){
            if(applyChange.getValidTime().compareTo( applyDetail.getEndTime())<=0){
                throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "换厂人员【" + applyChagneDetail.getMemberName() + "】保单保障日期至:【"+applyDetail.getEndTime()+"】无法通过本次申请");
            }
            //验证派遣单位信息 与工种信息 是否存在
server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java
@@ -128,9 +128,11 @@
        if(!Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.SIGNATURE.getKey())){
            throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该申请状态已流转,当前不支持该操作~");
        }
        if(insuranceApply.getApplyEndTime()== null || insuranceApply.getStartTime().getTime()>insuranceApply.getApplyEndTime().getTime() ){
        if(model.getApplyEndTime()== null || insuranceApply.getStartTime().getTime()>insuranceApply.getApplyEndTime().getTime() ){
            throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该申请生效周期时间不符合要求,请确认后修改重试~");
        }
        //计算实际截止时间
        Date actEndTime = new Date(insuranceApply.getApplyEndTime().getTime() + (insuranceApply.getStartTime().getTime() - model.getApplyStartTime().getTime()));
        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        InsuranceApply update = new InsuranceApply();
        update.setEditDate(new Date());
@@ -141,12 +143,13 @@
        update.setCheckUserId(user.getId());
        update.setId(model.getId());
        update.setCode(insuranceApply.getCode());
        update.setEndTime(model.getApplyEndTime());
        update.setEndTime(actEndTime);
        update.setStartTime(insuranceApply.getStartTime());
        insuranceApplyMapper.updateById(update);
        insuranceApply.getBaoxiandanFile().setIsdeleted(Constants.ZERO);
        insuranceApply.getBaoxiandanFile().setCreator(user.getId());
        insuranceApply.getToubaodanFile().setObjId(update.getId());
        insuranceApply.getBaoxiandanFile().setCreateDate(update.getEditDate());
        insuranceApply.getBaoxiandanFile().setObjType(Constants.MultiFile.BD_DONE_PDF.getKey());
        insuranceApply.getBaoxiandanFile().setType(Constants.TWO);
@@ -162,6 +165,60 @@
        }
        ApplyLog log = new ApplyLog(update,applyLogType.getName(), info,update.getId(),applyLogType.getKey(),JSONObject.toJSONString(model), JSONObject.toJSONString(update));
        applyLogMapper.insert(log);
        return  1;
    }
    @Override
    @Transactional(rollbackFor = {Exception.class,BusinessException.class})
    public     Integer editBaoxiandan(InsuranceApply param) {
        if(param.getId() == null
                || param.getCode() == null
                || param.getBaoxiandanFile() == null
                || param.getCheckInfo() == null
                ||StringUtils.isBlank( param.getBaoxiandanFile().getFileurl())
                ||StringUtils.isBlank( param.getBaoxiandanFile() .getName())){
            throw  new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        InsuranceApply model = insuranceApplyMapper.selectById(param.getId());
        if(model == null ||!Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){
            throw  new BusinessException(ResponseStatus.DATA_EMPTY);
        }
        if(!Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey())){
            throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该申请当前不支持该操作~");
        }
        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        InsuranceApply update = new InsuranceApply();
        update.setEditDate(new Date());
        update.setEditor(user.getId());
        update.setCheckDate(update.getEditDate());
        update.setCheckInfo(param.getCheckInfo());
        update.setCheckUserId(user.getId());
        update.setId(model.getId());
        update.setCode(param.getCode());
        insuranceApplyMapper.updateById(update);
        //删除原有的保单信息
        multifileMapper.delete(new UpdateWrapper<Multifile>().lambda()
                .set(Multifile::getIsdeleted,Constants.ZERO)
                .eq(Multifile::getIsdeleted,Constants.ZERO)
                .eq(Multifile::getObjId,update.getId())
                .eq(Multifile::getObjType,Constants.MultiFile.BD_DONE_PDF.getKey())
        );
        param.getBaoxiandanFile().setIsdeleted(Constants.ZERO);
        param.getBaoxiandanFile().setObjId(update.getId());
        param.getBaoxiandanFile().setCreator(user.getId());
        param.getBaoxiandanFile().setCreateDate(update.getEditDate());
        param.getBaoxiandanFile().setObjType(Constants.MultiFile.BD_DONE_PDF.getKey());
        param.getBaoxiandanFile().setType(Constants.TWO);
        multifileMapper.insert(param.getBaoxiandanFile());
        Constants.ApplyLogType applyLogType = Constants.ApplyLogType.PALTFORM_EDIT_BD;
        String info =  applyLogType.getInfo();
        info = info.replace("${param}",param.getCheckInfo());
        ApplyLog log = new ApplyLog(update,applyLogType.getName(), info,update.getId(),applyLogType.getKey(),JSONObject.toJSONString(model), JSONObject.toJSONString(update));
        applyLogMapper.insert(log);
        return  1;
    }
@@ -208,8 +265,6 @@
        }
        update.setEditDate(new Date());
        update.setEditor(user.getId());
        //同意退回,直接回到最初状态,如果驳回退回申请,则保单状态回到待上传保险单
        update.setStatus(insuranceApply.getDealBackApply() ==0?Constants.InsuranceApplyStatus.UPLOAD.getKey():Constants.InsuranceApplyStatus.SIGNATURE.getKey());
        update.setCheckDate(update.getEditDate());
        update.setCheckInfo(insuranceApply.getCheckInfo());
        update.setCheckUserId(user.getId());
@@ -252,6 +307,7 @@
        insuranceApply.getToubaodanFile().setIsdeleted(Constants.ZERO);
        insuranceApply.getToubaodanFile().setCreator(user.getId());
        insuranceApply.getToubaodanFile().setObjId(update.getId());
        insuranceApply.getToubaodanFile().setCreateDate(update.getEditDate());
        insuranceApply.getToubaodanFile().setObjType(Constants.MultiFile.BD_APPLY_PDF.getKey());
        insuranceApply.getToubaodanFile().setType(Constants.TWO);
server/service/src/main/java/com/doumee/service/business/impl/TaxesServiceImpl.java
@@ -209,6 +209,10 @@
        if(model==null || !Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){
            throw  new BusinessException(ResponseStatus.DATA_EMPTY);
        }
        if(Constants.equalsInteger(model.getType(),Constants.ZERO)){
            List<TaxDetial> detialList = getDetailsApplysListById(id);
            model.setApplyList(detialList);
        }else{
        //查询明细列表
        List<TaxDetial> detialList = getJoinDetailListById(id);
        List<TaxDetial> applyList = new ArrayList<>();//投保和加减保
@@ -227,9 +231,21 @@
        }
        model.setApplyList(applyList);
        model.setDelTaxList(delList);
        }
        return model;
    }
    private List<TaxDetial> getDetailsApplysListById(Integer id) {
            MPJLambdaWrapper<TaxDetial> queryWrapper = new MPJLambdaWrapper<>();
            queryWrapper.selectAll(TaxDetial.class);
            queryWrapper.selectAs(InsuranceApply::getCode,TaxDetial::getApplyCode);
            queryWrapper.selectAs(Solutions::getName,TaxDetial::getSolutionName);
            queryWrapper.leftJoin(InsuranceApply.class,InsuranceApply::getId,TaxDetial::getInsuranceApplyId);
            queryWrapper.leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId);
            List<TaxDetial> detialList =  taxDetailJoinMapper.selectJoinList(TaxDetial.class,queryWrapper.orderByAsc(TaxDetial::getType));
            return detialList;
    }
    @Override
    public Taxes findOne(Taxes taxes) {
        QueryWrapper<Taxes> wrapper = new QueryWrapper<>(taxes);