| | |
| | | @PostMapping("/exportExcel") |
| | | @RequiresPermissions("business:applydetail:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<ApplyDetailPageDTO> pageWrap, HttpServletResponse response) { |
| | | pageWrap.getModel().setIsExcel(Constants.ONE); |
| | | PageData<ApplyDetail> pageData = applyDetailService.findPageForCompany(pageWrap); |
| | | pageData.getRecords().forEach(i->{ |
| | | if(i.getSolutionType().equals(Constants.ONE)&&!i.getStatus().equals(Constants.InsuranceApplyStatus.WTB_DONE.getKey())){ |
| | |
| | | header1.createCell(1).setCellValue("保险方案"); |
| | | header1.createCell(2).setCellValue("保险生效起期"); |
| | | header1.createCell(3).setCellValue("保险生效止期"); |
| | | header1.createCell(4).setCellValue("投保人数"); |
| | | header1.createCell(4).setCellValue("在保/投保人数"); |
| | | header1.createCell(5).setCellValue("总费用(元)"); |
| | | for (int i = 0; i < 6; i++) { |
| | | configFirstCell(sxssfWorkbook,header1.getCell(i)); |
| | |
| | | header2.createCell(1).setCellValue(data.getSolutionsName()); |
| | | header2.createCell(2).setCellValue(com.doumee.core.utils.DateUtil.getPlusTime2(data.getStartTime())); |
| | | header2.createCell(3).setCellValue(com.doumee.core.utils.DateUtil.getPlusTime2(data.getEndTime())); |
| | | header2.createCell(4).setCellValue(data.getInsureNum()); |
| | | header2.createCell(4).setCellValue(data.getGuaranteeNum()+" / "+data.getInsureNum()); |
| | | header2.createCell(5).setCellValue(Constants.formatBigdecimal2Float(data.getFee()).toString()); |
| | | for (int i = 0; i < 6; i++) { |
| | | configDataCell(sxssfWorkbook, header2.getCell(i)); |
| | |
| | | header1.createCell(2).setCellValue("保险方案"); |
| | | header1.createCell(3).setCellValue("保险生效起期"); |
| | | header1.createCell(4).setCellValue("保险生效止期"); |
| | | header1.createCell(5).setCellValue("投保人数"); |
| | | header1.createCell(5).setCellValue("在保/投保人数"); |
| | | header1.createCell(6).setCellValue("总费用(元)"); |
| | | for (int i = 0; i < 7; i++) { |
| | | configFirstCell(sxssfWorkbook,header1.getCell(i)); |
| | |
| | | header2.createCell(2).setCellValue(data.getSolutionName()); |
| | | header2.createCell(3).setCellValue(com.doumee.core.utils.DateUtil.getPlusTime2(data.getStartTime())); |
| | | header2.createCell(4).setCellValue(com.doumee.core.utils.DateUtil.getPlusTime2(data.getEndTime())); |
| | | header2.createCell(5).setCellValue(data.getInsureNum()); |
| | | header2.createCell(5).setCellValue(data.getGuaranteeNum()+" / "+data.getInsureNum()); |
| | | header2.createCell(6).setCellValue(Constants.formatBigdecimal2Float(data.getFee()).toString()); |
| | | for (int i = 0; i < 7; i++) { |
| | | configDataCell(sxssfWorkbook, header2.getCell(i)); |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 加减保业务使用 |
| | | * 根据方案、开始/结束日期 |
| | | */ |
| | | public void calculateRetreatCost(){ |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // public static CountCyclePriceVO countPriceVO(Date startDate, Solutions solutions){ |
| | | // CountCyclePriceVO countCyclePriceVO = new CountCyclePriceVO(); |
| | | // if(solutions.getInsureCycleUnit().equals(Constants.ZERO)){ |
| | |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | // System.out.println(DateUtil.DateToStr(DateUtil.afterDateByType( |
| | | // DateUtil.stringToDate("2024-02-01","yyyy-MM-dd") |
| | | // ,1,1),"yyyy-MM-dd HH:mm:ss")); |
| | | |
| | | // System.out.println( DateUtil.daysBetweenDates(DateUtil.stringToDate("2024-02-29","yyyy-MM-dd"), |
| | | // DateUtil.stringToDate("2024-02-01","yyyy-MM-dd")) |
| | | // ); |
| | | // |
| | | // System.out.println(DateUtil.calculateBetween(DateUtil.StringToDate("2024-02-29 23:59:59"),DateUtil.StringToDate("2024-02-01 00:00:00"),0)); |
| | | |
| | | |
| | | // System.out.println( |
| | | // DateUtil.DateToStr( |
| | | // |
| | | // DateUtil.getMontageDate(DateUtil.StringToDate("2024-02-29 21:59:59"),1) ,"yyyy-MM-dd HH:mm:ss" |
| | | // ) |
| | | // ); |
| | | // |
| | | // |
| | | // |
| | | // System.out.println( |
| | | // |
| | | // DateUtil.DateToStr( |
| | | // |
| | | // DateUtil.getMontageDate(DateUtil.StringToDate("2024-02-29 21:59:59"),2) ,"yyyy-MM-dd HH:mm:ss" |
| | | // ) |
| | | // |
| | | // ); |
| | | // |
| | | // System.out.println( |
| | | // |
| | | // DateUtil.DateToStr( |
| | | // |
| | | // DateUtil.getMontageDate(DateUtil.StringToDate("2024-02-29 21:59:59"),3) ,"yyyy-MM-dd HH:mm:ss" |
| | | // ) |
| | | |
| | | // ); |
| | | |
| | | // System.out.println( |
| | | // new BigDecimal(16).divide(new BigDecimal(15.5),0, RoundingMode.CEILING) |
| | | // ); |
| | | LocalDate startDate = DateUtil.StringToDate("2021-02-28 23:59:59").toInstant() |
| | | .atZone(ZoneId.systemDefault()) |
| | | .toLocalDate(); |
| | | LocalDate endDate = DateUtil.StringToDate("2022-04-05 23:59:59").toInstant() |
| | | .atZone(ZoneId.systemDefault()) |
| | | .toLocalDate(); |
| | | // LocalDate startDate= LocalDate.of(2021,2,28); |
| | | // LocalDate endDate =LocalDate.of(2022,4,5); |
| | | Period period = Period.between(startDate,endDate); |
| | | int months = period.getYears()* 12 + period.getMonths(); |
| | | System.out.println("Months between the two dates: " + months); |
| | | |
| | | |
| | | /* Calendar calo = Calendar.getInstance(); |
| | | Calendar caln = Calendar.getInstance(); // ,"yyyy-MM-dd HH:mm:ss" |
| | | caln.setTime(DateUtil.StringToDate("2024-03-06 23:59:59")); |
| | | calo.setTime(DateUtil.StringToDate("2024-02-05 00:00:00")); |
| | | System.out.println( DateUtil.calculateMonthsBetweenDates(calo,caln));*/ |
| | | |
| | | // System.out.println( |
| | | // DateUtil.DateToStr( |
| | | // DateUtil.getNextMonthFirst(new Date()) |
| | | // ,"yyyy-MM-dd HH:mm:ss") |
| | | // |
| | | // ); |
| | | // System.out.println( |
| | | // DateUtil.DateToStr( |
| | | // DateUtil.getNextMonthFirst( |
| | | // DateUtil.StringToDate("2024-12-29 21:59:59") |
| | | // ) |
| | | // ,"yyyy-MM-dd HH:mm:ss") |
| | | // |
| | | // ); |
| | | |
| | | } |
| | | |
| | |
| | | @ApiModelProperty(value = "生效止期 yyyy-MM-dd 结束") |
| | | private String endTimeE; |
| | | |
| | | |
| | | @ApiModelProperty(value = "是否是导出;0=否;1=是",hidden = true) |
| | | private Integer isExcel; |
| | | |
| | | @ApiModelProperty(value = "保单主键") |
| | | private Integer applyId; |
| | | @ApiModelProperty(value = "加减保主键") |
| | |
| | | @TableField(exist = false) |
| | | private String duName; |
| | | |
| | | |
| | | @ApiModelProperty(value = "投保明细主键",hidden = true,notes = "减保业务存储,提供处理到加保后的保单明细行业务数据上") |
| | | @TableField(exist = false) |
| | | private Integer applyDetailId; |
| | | |
| | | @ApiModelProperty(value = "工种名称") |
| | | @TableField(exist = false) |
| | | private String workTypeName; |
| | |
| | | // @ExcelColumn(name="来源主键(apply_chagne_detail)加减保生成存在") |
| | | private Integer fromId; |
| | | |
| | | @ApiModelProperty(value = "减少费用") |
| | | // @ExcelColumn(name="当前费用") |
| | | private BigDecimal reduceMoney; |
| | | |
| | | @ApiModelProperty(value = "加保业务绑定的减保数据主键") |
| | | // @ExcelColumn(name="当前费用") |
| | | private Integer reduceId; |
| | | |
| | | @ApiModelProperty(value = "加减保数据状态:0=正常;1=不可减保") |
| | | // @ExcelColumn(name="当前费用") |
| | | private Integer changeStatus; |
| | | |
| | | |
| | | @ApiModelProperty(value = "保单号") |
| | | @TableField(exist = false) |
| | | private String applyCode; |
| | |
| | | @TableField(exist = false) |
| | | private Integer applyStatus; |
| | | |
| | | @ApiModelProperty(value = "是否是导出;0=否;1=是",hidden = true) |
| | | @TableField(exist = false) |
| | | private Integer isExcel; |
| | | |
| | | |
| | | @ApiModelProperty(value = "保单状态") |
| | |
| | | @TableField(exist = false) |
| | | private Integer insureNum; |
| | | |
| | | @ApiModelProperty(value = "在保人数") |
| | | @TableField(exist = false) |
| | | private Integer guaranteeNum; |
| | | |
| | | |
| | | @ApiModelProperty(value = "开票金额") |
| | | @TableField(exist = false) |
| | | private BigDecimal taxesMoney; |
| | |
| | | @ApiModelProperty(value = "投保人数") |
| | | @TableField(exist = false) |
| | | private Integer insureNum; |
| | | |
| | | @ApiModelProperty(value = "在保人数") |
| | | @TableField(exist = false) |
| | | private Integer guaranteeNum; |
| | | |
| | | @ApiModelProperty(value = "状态名称") |
| | | @TableField(exist = false) |
| | | private String statusInfo; |
| | |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到企业分配保险方案信息"); |
| | | } |
| | | //申请时间必须处于保单的时间范围内 |
| | | if (!(DateUtil.compareDate( insuranceApply.getStartTime(),applyChange.getValidTime()) >= Constants.ZERO |
| | | && DateUtil.compareDate( applyChange.getValidTime(),insuranceApply.getEndTime()) >= Constants.ZERO)) { |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "申请日期未处于保单日期内,无法进行该操作"); |
| | | } |
| | | // if (!(DateUtil.compareDate( insuranceApply.getStartTime(),applyChange.getValidTime()) >= Constants.ZERO |
| | | // && DateUtil.compareDate( applyChange.getValidTime(),insuranceApply.getEndTime()) >= Constants.ZERO)) { |
| | | // throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "申请日期未处于保单日期内,无法进行该操作"); |
| | | // } |
| | | //查询保单下是否存在进行中的加减保/换厂单据 |
| | | if(applyChangeMapper.selectCount(new QueryWrapper<ApplyChange>().lambda() |
| | | .eq(ApplyChange::getApplyId,insuranceApply.getId()) |
| | |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到企业分配保险方案信息"); |
| | | } |
| | | //申请时间必须处于保单的时间范围内 |
| | | if (!(DateUtil.compareDate( insuranceApply.getStartTime(),applyChange.getValidTime()) >= Constants.ZERO |
| | | && DateUtil.compareDate( applyChange.getValidTime(),insuranceApply.getEndTime()) >= Constants.ZERO)) { |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "申请日期未处于保单日期内,无法进行该操作"); |
| | | } |
| | | // if (!(DateUtil.compareDate( insuranceApply.getStartTime(),applyChange.getValidTime()) >= Constants.ZERO |
| | | // && DateUtil.compareDate( applyChange.getValidTime(),insuranceApply.getEndTime()) >= Constants.ZERO)) { |
| | | // throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "申请日期未处于保单日期内,无法进行该操作"); |
| | | // } |
| | | //查询保单下是否存在进行中的加减保/换厂单据 |
| | | if(applyChangeMapper.selectCount(new QueryWrapper<ApplyChange>().lambda() |
| | | .eq(ApplyChange::getApplyId,insuranceApply.getId()) |
| | |
| | | |
| | | |
| | | public BigDecimal dealApplyChangeData(ApplyChange applyChange,InsuranceApply insuranceApply,CompanySolution companySolution,Solutions solutions,LoginUserInfo loginUserInfo,BigDecimal fee){ |
| | | |
| | | |
| | | if(Objects.nonNull(solutions.getDelOnlyReplace())&& solutions.getDelOnlyReplace().equals(Constants.ONE)){ |
| | | if(applyChange.getDelDetailList().size() > applyChange.getAddDetailList().size()){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "该保险方案仅支持替换(减保人数不得大于加保人数)"); |
| | | } |
| | | } |
| | | //查询保险方案下的所有派遣单位 |
| | | List<DuSolution> duSolutionList = duSolutionJoinMapper.selectJoinList(DuSolution.class,new MPJLambdaWrapper<DuSolution>() |
| | | .selectAll(DuSolution.class) |
| | |
| | | if(!CollectionUtils.isNotEmpty(duSolutionList)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"数据异常:保险方案下未查询到派遣单位"); |
| | | } |
| | | |
| | | //查询所有派遣单位下的工种 |
| | | List<Integer> duSolutionIdList = duSolutionList.stream().map(i->i.getId()).collect(Collectors.toList()); |
| | | List<DuWorktype> duWorktypeList = duWorktypeMapper.selectList(new QueryWrapper<DuWorktype>().lambda() |
| | |
| | | |
| | | ApplyChangeCyclePriceDTO applyChangeCyclePriceDTO = new ApplyChangeCyclePriceDTO(); |
| | | applyChangeCyclePriceDTO.setApplyId(insuranceApply.getId()); |
| | | |
| | | |
| | | //加保数据 |
| | | List<ApplyChagneDetail> addDetailList = applyChange.getAddDetailList(); |
| | | Integer addDetailSize = 0 ; |
| | | |
| | | if (CollectionUtils.isNotEmpty(addDetailList)) { |
| | | addDetailSize = addDetailList.size(); |
| | | if(Objects.isNull(solutions.getCanAdd()) || solutions.getCanAdd().equals(Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "该保险方案无法进行加保"); |
| | | } |
| | | // if(companySolution.getCanAdd().equals(Constants.ZERO)){ |
| | | // throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "该企业分配保险方案无法进行加保"); |
| | | // } |
| | | //验证是否存在重复数据 |
| | | List<String> idcarNo = addDetailList.stream().map(m->m.getIdcardNo()).collect(Collectors.toList()); |
| | | Set<String> set = new HashSet<>(idcarNo); |
| | |
| | | |
| | | //减保数据 |
| | | List<ApplyChagneDetail> delDetailList = applyChange.getDelDetailList(); |
| | | Integer delDetailSize = 0 ; |
| | | if (CollectionUtils.isNotEmpty(delDetailList)) { |
| | | delDetailSize = delDetailList.size() ; |
| | | //验证是否存在重复数据 |
| | | List<String> idcarNo = delDetailList.stream().map(m->m.getIdcardNo()).collect(Collectors.toList()); |
| | | Set<String> set = new HashSet<>(idcarNo); |
| | |
| | | fee = fee.add(delDetailList.stream().map(ApplyChagneDetail::getFee).reduce(BigDecimal.ZERO,BigDecimal::add)); |
| | | } |
| | | |
| | | if(Objects.nonNull(solutions.getDelOnlyReplace())&& solutions.getDelOnlyReplace().equals(Constants.ONE)){ |
| | | if(delDetailSize > addDetailSize){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "该保险方案仅支持替换(减保人数不得大于加保人数)"); |
| | | } |
| | | } |
| | | |
| | | |
| | | //换厂业务 |
| | | List<ApplyChagneDetail> changeDetailList = applyChange.getChangeDetailList(); |
| | |
| | | applyChagneDetail.setIsdeleted(Constants.ZERO); |
| | | applyChagneDetail.setApplyChangeId(applyChange.getId()); |
| | | applyChagneDetail.setType(Constants.ONE); |
| | | |
| | | applyChagneDetail.setApplyDetailId(applyDetail.getId()); |
| | | applyChagneDetail.setStartTime(applyDetail.getStartTime()); |
| | | applyChagneDetail.setEndTime(endTime); |
| | | |
| | |
| | | //查询减保日期 |
| | | // Integer delDays = DateUtil.daysBetweenDates(applyDetail.getEndTime(),endTime); |
| | | // ; |
| | | //查询周期数量 |
| | | applyChagneDetail.setFee( |
| | | Constants.reduceFee(solutions, |
| | | Objects.isNull(insuranceApply.getServerCost())? |
| | |
| | | } |
| | | //根据批单日期 和 结束日期 计算金额 |
| | | //验证批单日期是否在当前日期后 且 在保单结束日期前 申请时间必须处于保单的时间范围内 |
| | | if (!(DateUtil.compareDate( insuranceApply.getStartTime(),applyChangeCyclePriceDTO.getValidTime()) >= Constants.ZERO |
| | | && DateUtil.compareDate( applyChangeCyclePriceDTO.getValidTime(),insuranceApply.getEndTime()) >= Constants.ZERO)) { |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "申请日期未处于保单日期内,无法进行该操作"); |
| | | } |
| | | // if (!(DateUtil.compareDate( insuranceApply.getStartTime(),applyChangeCyclePriceDTO.getValidTime()) >= Constants.ZERO |
| | | // && DateUtil.compareDate( applyChangeCyclePriceDTO.getValidTime(),insuranceApply.getEndTime()) >= Constants.ZERO)) { |
| | | // throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "申请日期未处于保单日期内,无法进行该操作"); |
| | | // } |
| | | BigDecimal sumPrice = Objects.isNull(insuranceApply.getServerCost())?solutions.getPrice():solutions.getPrice().add(insuranceApply.getServerCost()); |
| | | CountCyclePriceVO returnCountCyclePriceVO = new CountCyclePriceVO(); |
| | | returnCountCyclePriceVO.setCyclePrice(Constants.addFee(solutions, |
| | |
| | | queryWrapper.leftJoin(Company.class,Company::getId,Member::getCompanyId); |
| | | queryWrapper.eq( applyDetailPageDTO.getApplyId()!=null,ApplyDetail::getApplyId,applyDetailPageDTO.getApplyId()); |
| | | queryWrapper.eq( applyDetailPageDTO.getUnionApplyId()!=null,ApplyDetail::getUnionApplyId,applyDetailPageDTO.getUnionApplyId()); |
| | | queryWrapper.ge(Objects.nonNull(applyDetailPageDTO.getIsExcel())&&Constants.equalsInteger(applyDetailPageDTO.getIsExcel(),Constants.ONE), |
| | | ApplyDetail::getEndTime,DateUtil.getPlusTime2(new Date())); |
| | | List<ApplyDetail> pageData= applyDetailJoinMapper.selectJoinList( ApplyDetail.class, queryWrapper); |
| | | if(pageData!=null){ |
| | | int num = 1; |
| | |
| | | queryWrapper.le(StringUtils.isNotBlank(applyDetailPageDTO.getStartTimeE()),ApplyDetail::getStartTime,applyDetailPageDTO.getStartTimeE()+" 23:59:59.0"); |
| | | queryWrapper.ge(StringUtils.isNotBlank(applyDetailPageDTO.getEndTimeS()),ApplyDetail::getEndTime,applyDetailPageDTO.getEndTimeS()+" 00:00:00.0"); |
| | | queryWrapper.le(StringUtils.isNotBlank(applyDetailPageDTO.getEndTimeE()),ApplyDetail::getEndTime,applyDetailPageDTO.getEndTimeE()+" 23:59:59.0"); |
| | | queryWrapper.ge(Objects.nonNull(applyDetailPageDTO.getIsExcel())&&Constants.equalsInteger(applyDetailPageDTO.getIsExcel(),Constants.ONE), |
| | | ApplyDetail::getEndTime,DateUtil.getPlusTime2(new Date())); |
| | | |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(pageWrap.getSorts())){ |
| | | for(PageWrap.SortData sortData: pageWrap.getSorts()) { |
| | |
| | | newVersion.setCheckDate(update.getEditDate()); |
| | | newVersion.setCheckUserId(update.getCheckUserId()); |
| | | newVersion.setCheckInfo(update.getCheckInfo()); |
| | | newVersion.setStatus(Constants.ZERO); |
| | | newVersion.setCreateDate(update.getCreateDate()); |
| | | newVersion.setCreator(update.getEditor()); |
| | | newVersion.setBaseId(model.getId()); |
| | |
| | | |
| | | |
| | | for (DuWorktype w : worktypes) { |
| | | if(Constants.equalsInteger(w.getStatus(),Constants.TWO)){ |
| | | continue; |
| | | } |
| | | DuWorktype nw = new DuWorktype(); |
| | | BeanUtils.copyProperties(w, nw); |
| | | nw.setCreateDate(new Date()); |
| | | nw.setCheckDate(update.getEditDate()); |
| | | nw.setStatus(Constants.ONE); |
| | | nw.setDuSolutionId(ns.getId()); |
| | |
| | | Constants.NoticeObjectType noticeObjectType = Constants.NoticeObjectType.DISPATCH_UNIT; |
| | | //删除其他待办 |
| | | noticesMapper.delete(new QueryWrapper<Notices>().lambda().eq(Notices::getObjType,noticeObjectType.getKey()).eq(Notices::getObjId,dispatchUnit.getId())); |
| | | |
| | | |
| | | return 1; |
| | | } |
| | |
| | | @Override |
| | | public void updateById(DispatchUnit dispatchUnit) { |
| | | dispatchUnitMapper.updateById(dispatchUnit); |
| | | //更新历史表状态 |
| | | if(Objects.nonNull(dispatchUnit.getId())&& Objects.nonNull(dispatchUnit.getStatus())){ |
| | | dispatchUnitMapper.update(null,new UpdateWrapper<DispatchUnit>().lambda() |
| | | .set(DispatchUnit::getStatus,dispatchUnit.getStatus()) |
| | | .eq(DispatchUnit::getDataType,Constants.TWO) |
| | | .eq(DispatchUnit::getBaseId,dispatchUnit.getId()) |
| | | ); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | queryWrapper.selectAs(Solutions::getTimeUnit,InsuranceApply::getTimeUnit); |
| | | queryWrapper.select(" DATEDIFF( t.END_TIME ,now() ) AS loseEfficacyDays "); |
| | | queryWrapper.select(" ( select count(DISTINCT(ad.MEMBER_ID)) from apply_detail ad where ad.apply_id = t.id ) as insureNum"); |
| | | queryWrapper.select(" ( select count(DISTINCT(ad.MEMBER_ID)) from apply_detail ad where ad.apply_id = t.id and ad.END_TIME > now() ) as guaranteeNum"); |
| | | if(!Objects.isNull(pageWrap.getModel())&&!Objects.isNull(pageWrap.getModel().getType())){ |
| | | queryWrapper.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"); |
| | | queryWrapper.select(" ( select td.CREATE_DATE 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 order by td.CREATE_DATE desc limit 1 ) as taxesLast "); |
| | |
| | | .selectAs(Company::getName,InsuranceApply::getCompanyName) |
| | | .select(" ( select max(ac.APPLY_START_TIME) from apply_change ac where ac.apply_id = t.id and ac.status = 2 ) as lastChangeDate") |
| | | .select(" ( select count(DISTINCT(ad.MEMBER_ID)) from apply_detail ad where ad.apply_id = t.id ) as insureNum") |
| | | .select(" ( select count(DISTINCT(ad.MEMBER_ID)) from apply_detail ad where ad.apply_id = t.id and ad.END_TIME > now() ) as guaranteeNum") |
| | | .select(" t3.name as shopName") |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId) |
| | |
| | | .selectAs(Solutions::getName,InsuranceApply::getSolutionsName) |
| | | .selectAs(Solutions::getType,InsuranceApply::getSolutionType) |
| | | .selectAs(Company::getName,InsuranceApply::getCompanyName) |
| | | .select(" ( select count(DISTINCT(ad.MEMBER_ID)) from apply_detail ad where ad.apply_id = t.id and ad.END_TIME > now() ) as guaranteeNum") |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId) |
| | | .eq(InsuranceApply::getId,model.getId()) |
| | |
| | | .selectAs(DispatchUnit::getName,ApplyDetail::getDuName) |
| | | .leftJoin(Worktype.class,Worktype::getId,ApplyDetail::getWorktypeId) |
| | | .leftJoin(DispatchUnit.class,DispatchUnit::getId,ApplyDetail::getDuId) |
| | | .ge(ApplyDetail::getEndTime,DateUtil.getPlusTime2(new Date())) |
| | | .eq(ApplyDetail::getApplyId,model.getId()); |
| | | //查询明细 |
| | | List<ApplyDetail> detailList =applyDetailJoinMapper.selectJoinList(ApplyDetail.class,wrapper1); |
| | |
| | | solutions.setVersion(UUID.randomUUID().toString());//版本号 |
| | | solutions.setDataType(Constants.ZERO); |
| | | solutions.setStatus(Constants.ZERO); |
| | | //2024年6月17日15:56:18 仅支持替换模式下,批增日期 等于 批减日期 |
| | | if(Constants.equalsInteger(solutions.getDelOnlyReplace(),Constants.ONE)){ |
| | | solutions.setAddValidDays(solutions.getDelValidDays()); |
| | | } |
| | | solutionsMapper.insert(solutions);//基础版本 |
| | | |
| | | //如果有工种,则产生一个新的有效历史版本 ~ |
| | |
| | | solutions.setEditor(user.getId()); |
| | | solutions.setVersion(UUID.randomUUID().toString()); |
| | | solutions.setEditDate(new Date()); |
| | | |
| | | //2024年6月17日15:56:18 仅支持替换模式下,批增日期 等于 批减日期 |
| | | if(Constants.equalsInteger(solutions.getDelOnlyReplace(),Constants.ONE)){ |
| | | solutions.setAddValidDays(solutions.getDelValidDays()); |
| | | } |
| | | solutionsMapper.updateById(solutions); |
| | | |
| | | Solutions oldVersion = solutionsMapper.selectOne(new QueryWrapper<Solutions>() |
| | |
| | | .selectAs(Solutions::getSpecialAgreement,UnionApply::getSpecialAgreement) |
| | | .selectAs(Solutions::getSpecialInfo,UnionApply::getSpecialInfo); |
| | | queryWrapper.select("(select count(distinct(b.MEMBER_ID)) from apply_detail b where b.isdeleted=0 and b.union_apply_id=t.id) as insureNum "); |
| | | queryWrapper.select("(select count(distinct(b.MEMBER_ID)) from apply_detail b where b.isdeleted=0 and b.END_TIME > now() and b.union_apply_id=t.id) as guaranteeNum "); |
| | | |
| | | if(pageWrap.getModel().getQueryFlag() == 1){ |
| | | queryWrapper.select("(select count(1) from apply_change a inner join insurance_apply b on a.apply_id = b.id where b.union_apply_id=t.id " + |
| | |
| | | .selectAs(Solutions::getName,UnionApply::getSolutionName) |
| | | .selectAs(Company::getName,UnionApply::getCompanyName) |
| | | .select(" ( select count(DISTINCT(ad.MEMBER_ID)) from apply_detail ad where ad.UNION_APPLY_ID = t.id ) as insureNum") |
| | | .select("(select count(distinct(b.MEMBER_ID)) from apply_detail b where b.isdeleted=0 and b.END_TIME > now() and b.union_apply_id=t.id) as guaranteeNum ") |
| | | .select(" ( select group_concat(DISTINCT(cd.name)) from insurance_apply ad left join company cd on ad.company_id = cd.id where ad.UNION_APPLY_ID = t.id ) as companyNames") |
| | | .leftJoin(Solutions.class,Solutions::getId,UnionApply::getSolutionId) |
| | | .leftJoin(Company.class,Company::getId,UnionApply::getCompanyId) |