k94314517
2025-05-26 81d7f91fa38e74cab052eb4413bd3e12686935a4
server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java
@@ -19,6 +19,7 @@
import com.doumee.dao.business.model.*;
import com.doumee.dao.business.vo.ApplyPowerVO;
import com.doumee.dao.business.vo.CountCyclePriceVO;
import com.doumee.dao.business.vo.dataBoard.InsuranceDataVO;
import com.doumee.dao.system.SystemUserMapper;
import com.doumee.dao.system.model.SystemUser;
import com.doumee.service.business.InsuranceApplyService;
@@ -64,7 +65,6 @@
    private SmsEmailService smsEmailService;
    @Autowired
    private ApplyChangeJoinMapper applyChangeMapper;
    @Autowired
    private SystemDictDataBiz systemDictDataBiz;
    @Autowired
@@ -73,25 +73,20 @@
    private CompanyMapper companyMapper;
    @Autowired
    private MemberInsuranceJoinMapper memberInsuranceJoinMapper;
    @Autowired
    private ApplyDetailMapper applyDetailMapper;
    @Autowired
    private ApplyDetailJoinMapper applyDetailJoinMapper;
    @Autowired
    private ApplyLogMapper applyLogMapper;
    @Autowired
    private SignService signService;
    @Autowired
    private MultifileMapper multifileMapper;
    @Autowired
    private ApplyLogJoinMapper applyLogJoinMapper;
    @Autowired
    private SolutionsMapper solutionsMapper;
    @Autowired
    private MemberMapper memberMapper;
    @Autowired
@@ -106,7 +101,6 @@
    private DuWorkTypeJoinMapper duWorkTypeJoinMapper;
    @Autowired
    private SolutionWorktypeJoinMapper solutionWorktypeJoinMapper;
    @Autowired
    private NoticesMapper noticesMapper;
    @Autowired
@@ -121,7 +115,8 @@
    private SystemUserMapper systemUserMapper;
    @Autowired
    private CompanyDepartmentMapper companyDepartmentMapper;
    @Autowired
    private InsuranceMapper insuranceMapper;
    @Override
    @Transactional(rollbackFor = {Exception.class,BusinessException.class})
@@ -152,7 +147,6 @@
            }
            update.setStatus(Constants.InsuranceApplyStatus.WTB_RETURN.getKey());
        }
        update.setEditDate(new Date());
        update.setEditor(user.getId());
        update.setCheckDate(update.getEditDate());
@@ -160,7 +154,6 @@
        update.setCheckUserId(user.getId());
        update.setId(model.getId());
        insuranceApplyMapper.updateById(update);
        //存储待办信息
        Constants.NoticeObjectType noticeObjectType = Constants.NoticeObjectType.INSURANCE_APPLY;
        //删除其他待办
@@ -170,8 +163,6 @@
        Notices notices = new Notices(noticeObjectType,Constants.ONE,insuranceApply.getId(),solutions.getName(),
                model.getCompanyId(), Constants.NoticeType.FOUR);
        noticesMapper.insert(notices);
        Constants.ApplyLogType applyLogType = Constants.ApplyLogType.PLATFORM_RETURN;
        String info =applyLogType.getInfo();
        info = info.replace("${param}", update.getCheckInfo());
@@ -225,7 +216,6 @@
                ||StringUtils.isBlank( insuranceApply.getBaoxiandanFile() .getName())){
            throw  new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        InsuranceApply model = insuranceApplyMapper.selectById(insuranceApply.getId());
        if(model == null ||!Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){
            throw  new BusinessException(ResponseStatus.DATA_EMPTY);
@@ -3776,6 +3766,61 @@
        return applyPowerVO;
    }
//    @Override
//    public InsuranceDataVO getInsuranceDataVO(){
//        InsuranceDataVO insuranceDataVO = new InsuranceDataVO();
//        insuranceDataVO.setInsuranceTotal(Constants.ZERO);
//        insuranceDataVO.setInsuranceAddTotal(Constants.ZERO);
//        insuranceDataVO.setInsuranceApplyTotal(Constants.ZERO);
//        insuranceDataVO.setInsuranceApplyAddTotal(Constants.ZERO);
//        insuranceDataVO.setInsuranceUserTotal(Constants.ZERO);
//        insuranceDataVO.setInsuranceUserAddTotal(Constants.ZERO);
//        insuranceDataVO.setTotalAddFee(BigDecimal.ZERO);
//        insuranceDataVO.setTotalFee(BigDecimal.ZERO);
//        //本月日期
//        String monthData = DateUtil.DateToStr(new Date(),"yyyy-MM");
//        //保险公司数量
//        List<Insurance> insuranceList = insuranceMapper.selectList(new QueryWrapper<Insurance>().lambda().eq(Insurance::getIsdeleted,Constants.ZERO).eq(Insurance::getStatus,Constants.ZERO));
//        if(CollectionUtils.isNotEmpty(insuranceList)){
//            insuranceDataVO.setInsuranceTotal(insuranceList.size());
//            insuranceDataVO.setInsuranceAddTotal(insuranceList.stream().filter(i->Objects.nonNull(i.getCreateDate())&&DateUtil.DateToStr(i.getCreateDate(),"yyyy-MM").equals(monthData)).collect(Collectors.toList()).size());
//        }
//
//        //保单数量
//        List<InsuranceApply> insuranceApplyList = insuranceApplyMapper.selectList(new QueryWrapper<InsuranceApply>()
//                .lambda().eq(InsuranceApply::getIsdeleted,Constants.ZERO).in(InsuranceApply::getStatus,
//                Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey(),Constants.InsuranceApplyStatus.WTB_DONE.getKey())
//        );
//        if(CollectionUtils.isNotEmpty(insuranceApplyList)){
//            insuranceDataVO.setInsuranceApplyTotal(insuranceApplyList.size());
//            insuranceDataVO.setInsuranceApplyAddTotal(insuranceApplyList.stream().filter(i->Objects.nonNull(i.getCreateDate())&&DateUtil.DateToStr(i.getCreateDate(),"yyyy-MM").equals(monthData)).collect(Collectors.toList()).size());
//        }
//
//        //在保人数
//        List<ApplyDetail> applyDetailList = applyDetailJoinMapper.selectJoinList(ApplyDetail.class,new MPJLambdaWrapper<ApplyDetail>().selectAll(ApplyDetail.class)
//                .leftJoin(InsuranceApply.class,InsuranceApply::getId,ApplyDetail::getApplyId)
//                .eq(InsuranceApply::getIsdeleted,Constants.ZERO).in(InsuranceApply::getStatus,
//                        Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey(),Constants.InsuranceApplyStatus.WTB_DONE.getKey())
//                .eq(ApplyDetail::getIsdeleted,Constants.ZERO)
//                .apply(" ( t.START_TIME >= now() and t.END_TIME <= now() ) ")
//        );
//        if(CollectionUtils.isNotEmpty(applyDetailList)){
//            insuranceDataVO.setInsuranceUserTotal(applyDetailList.size());
//            insuranceDataVO.setInsuranceUserAddTotal(
//                    applyDetailList.stream().filter(i->Objects.nonNull(i.getCreateDate())&&DateUtil.DateToStr(i.getCreateDate(),"yyyy-MM")
//                            .equals(monthData)).collect(Collectors.toList()).size());
//
//            insuranceDataVO.setTotalFee(applyDetailList.stream().map(i->i.getFee()).reduce(BigDecimal.ZERO,BigDecimal::add));
//            insuranceDataVO.setTotalAddFee(applyDetailList.stream()
//                    .filter(i->Objects.nonNull(i.getCreateDate())&&DateUtil.DateToStr(i.getCreateDate(),"yyyy-MM")
//                    .equals(monthData)).map(i->i.getFee()).reduce(BigDecimal.ZERO,BigDecimal::add));
//        }
//
//        return insuranceDataVO;
//    }
}