| | |
| | | @RequiresPermissions("business:applydetail:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<ApplyDetailPageDTO> pageWrap, HttpServletResponse response) { |
| | | //List<T> data, String fileName,String first,String end, HttpServletResponse response |
| | | ExcelExporter.build(ApplyDetail.class).exportWithFirstAndEnd(applyDetailService.findPageForCompany(pageWrap).getRecords(), pageWrap.getModel().getCompanyName()+"_"+pageWrap.getModel().getSolutionName()+".xlsx","在保人员名单",null, response); |
| | | ExcelExporter.build(ApplyDetail.class).exportWithFirstAndEnd(applyDetailService.findPageForCompany(pageWrap).getRecords(), pageWrap.getModel().getSolutionName()+".xlsx","在保人员名单",null, response); |
| | | } |
| | | |
| | | @ApiOperation("根据ID查询") |
| | |
| | | public void exportExcel (@RequestBody PageWrap<InsuranceApplyQueryDTO> pageWrap, HttpServletResponse response) { |
| | | ExcelExporter.build(InsuranceApply.class).export(insuranceApplyService.findPage(pageWrap).getRecords(), "投保申请信息表", response); |
| | | } |
| | | |
| | | @ApiOperation("导出投保详情单") |
| | | @PostMapping("/exportDetailExcel") |
| | | @RequiresPermissions("business:insuranceapply:exportExcel") |
| | |
| | | return ApiResponse.success("操作成功",insuranceApplyService.getCountCyclePriceVO(countCyclePriceDTO)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("测试实际金额") |
| | | @GetMapping("/testFee") |
| | | public ApiResponse testFee(@RequestParam Integer id) { |
| | | insuranceApplyService.updateApplyCurrentFee(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @ApiOperation("获取企业信息") |
| | | @GetMapping("/getCompanyDetail") |
| | | @RequiresPermissions("business:taxes:query") |
| | | public ApiResponse getCompanyDetail() { |
| | | public ApiResponse<Taxes> getCompanyDetail() { |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(!loginUserInfo.getType().equals(Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非企业类用户无法进行该操作"); |
| | |
| | | @ApiOperation(value = "获取直保数据信息",notes = "") |
| | | @GetMapping("/getDirectTaxes") |
| | | @RequiresPermissions("business:taxes:query") |
| | | public ApiResponse getDirectTaxes(@RequestParam Integer id) { |
| | | public ApiResponse<List<TaxesInvoicingVO>> getDirectTaxes(@RequestParam Integer id) { |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(!loginUserInfo.getType().equals(Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非企业类用户无法进行该操作"); |
| | |
| | | @Scheduled(cron = "0 5 00 * * ?") |
| | | public void updateApplyCurrentFee(){ |
| | | log.info("==============定时更新保单实际金额=======start======"); |
| | | insuranceApplyService.updateApplyCurrentFee(); |
| | | insuranceApplyService.updateApplyCurrentFee(null); |
| | | log.info("==============定时更新保单实际金额======end======="); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | public enum ApplyChangeLogStatus { |
| | | UPLOAD(0, "发起申请"), |
| | | RETURN_APPLY(3, "发起退回申请"), |
| | | PLATFORM_AGREE(4, "平台审批通过"), |
| | | PLATFORM_UN_AGREE(0, "审批驳回"), |
| | | CLOSE(5, "关闭"), |
| | | UPLOAD(0, "发起申请",""), |
| | | RETURN_APPLY(3, "发起退回申请","提交意见:${param}"), |
| | | PLATFORM_AGREE(4, "平台审批通过" ,"提交意见:${param}"), |
| | | PLATFORM_UN_AGREE(0, "审批驳回","提交意见:${param}"), |
| | | CLOSE(5, "关闭",""), |
| | | ; |
| | | // 成员变量 |
| | | private String name; |
| | | private String info; |
| | | private int key; |
| | | |
| | | // 构造方法 |
| | | ApplyChangeLogStatus(int key, String name) { |
| | | ApplyChangeLogStatus(int key, String name,String info) { |
| | | this.name = name; |
| | | this.info = info; |
| | | this.key = key; |
| | | } |
| | | |
| | | // 普通方法 |
| | | public static String getName(int index) { |
| | | for (ApplyLogType c : ApplyLogType.values()) { |
| | | for (ApplyChangeLogStatus c : ApplyChangeLogStatus.values()) { |
| | | if (c.getKey() == index) { |
| | | return c.name; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | public static String getInfo(int index) { |
| | | for (ApplyChangeLogStatus c : ApplyChangeLogStatus.values()) { |
| | | if (c.getKey() == index) { |
| | | return c.info; |
| | | } |
| | | } |
| | | return null; |
| | |
| | | this.key = key; |
| | | } |
| | | |
| | | public String getInfo() { |
| | | return info; |
| | | } |
| | | |
| | | public void setInfo(String info) { |
| | | this.info = info; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | |
| | | 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.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)); |
| | | |
| | | |
| | | // Calendar calo = Calendar.getInstance(); |
| | | // Calendar caln = Calendar.getInstance(); // ,"yyyy-MM-dd HH:mm:ss" |
| | | // caln.setTime(DateUtil.StringToDate("2024-02-29 23:59:59")); |
| | | // calo.setTime(DateUtil.StringToDate("2024-02-01 00:00:00")); |
| | | // System.out.println( DateUtil.calculateDaysBetweenDates(calo,caln)); |
| | | } |
| | | |
| | | |
| | |
| | | @ApiModelProperty(value = "操作说明") |
| | | private String optIllustration; |
| | | |
| | | @ApiModelProperty(value = "操作类型:3=退回申请;4=平台审批通过;0=审批驳回;5=关闭") |
| | | @ApiModelProperty(value = "操作类型:3=退回申请;4=平台审批通过;5=审批驳回;6=关闭") |
| | | private Integer optType; |
| | | |
| | | } |
| | |
| | | private Integer baseSolutionId; |
| | | |
| | | @ApiModelProperty(value = "实际保险生效止期开始") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date endTimeS; |
| | | |
| | | @ApiModelProperty(value = "实际保险生效止期结束") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date endTimeE; |
| | | |
| | | @ApiModelProperty(value = "实际保险生效起期开始") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date startTimeS; |
| | | |
| | | @ApiModelProperty(value = "实际保险生效起期结束") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date startTimeE; |
| | | |
| | | @ApiModelProperty(value = "单号") |
| | | private String code; |
| | | |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "提交日期开始") |
| | | private Date createTimeS; |
| | | |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "提交日期结束") |
| | | private Date createTimeE; |
| | | |
| | |
| | | @ApiModelProperty(value = "查询业务主键") |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "查询类型:0=保险方案主键;1=派遣单位主键") |
| | | @ApiModelProperty(value = "查询类型:0=保险方案主键;1=派遣单位主键;2:保单主键") |
| | | private Integer queryType; |
| | | |
| | | |
| | |
| | | @ExcelColumn(name="批单生效时间") |
| | | private Date applyStartTime; |
| | | |
| | | @ApiModelProperty(value = "状态 0待签署 1已签章 2已上传批单 3退回申请 4平台同意 5平台驳回") |
| | | @ExcelColumn(name="状态 0待签署 1已签章 2已上传批单 3退回申请 4平台同意 5平台驳回") |
| | | @ApiModelProperty(value = "状态 0待签署 1已签章 2已上传批单 3退回申请 (待签署) 4退回申请 (已签章) 5平台同意(已退回) 6已关闭 ") |
| | | @ExcelColumn(name="状态 0待签署 1已签章 2已上传批单 3退回申请 (待签署) 4退回申请 (已签章) 5平台同意(已退回) 6已关闭 ") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "在线签章合同号") |
| | | private String signApplyNo; |
| | | @ApiModelProperty(value = "期望保险生效起期") |
| | |
| | | |
| | | |
| | | |
| | | public TaxesInvoicingVO getTaxesInvoicingVO(){ |
| | | |
| | | public TaxesInvoicingVO toTaxesInvoicingVO(){ |
| | | TaxesInvoicingVO taxesInvoicingVO = new TaxesInvoicingVO(); |
| | | taxesInvoicingVO.setId(this.getId()); |
| | | taxesInvoicingVO.setSolutionsName(this.getSolutionsName()); |
| | |
| | | @ApiModelProperty(value = "视频资料地址") |
| | | @ExcelColumn(name="视频资料地址") |
| | | private String videoUrl; |
| | | |
| | | @ApiModelProperty(value = "派遣单位编码(关联dispatch_unit", example = "1") |
| | | @ExcelColumn(name="派遣单位编码(关联dispatch_unit") |
| | | private Integer dispatchUnitId; |
| | |
| | | |
| | | @ApiModelProperty(value = "冲红备注") |
| | | @ExcelColumn(name="冲红备注") |
| | | private String delIInfo; |
| | | private String delInfo; |
| | | |
| | | @ApiModelProperty(value = "冲红操作人员编码", example = "1") |
| | | @ExcelColumn(name="冲红操作人员编码") |
| | | private Integer delUserId; |
| | | private Integer delUerId; |
| | | |
| | | @ApiModelProperty(value = "单据申请编码(关联insurance_apply)", example = "1") |
| | | @ExcelColumn(name="单据申请编码(关联insurance_apply)") |
| | |
| | | |
| | | Integer editBaoxiandan(InsuranceApply param); |
| | | |
| | | void updateApplyCurrentFee(); |
| | | void updateApplyCurrentFee(Integer id); |
| | | |
| | | |
| | | String getSignLink(Integer id); |
| | |
| | | queryWrapper.selectAs(Member::getName,ApplyChagneDetail::getMemberName); |
| | | ApplyDetailPageDTO applyDetailPageDTO = pageWrap.getModel(); |
| | | queryWrapper.exists(!Objects.isNull(applyDetailPageDTO.getApplyId()), |
| | | " select 1 from apply_change ac where ac.isdeleted = 0 and ac.status in (1,2) and ac.applyId = "+applyDetailPageDTO.getApplyId()+" and ac.id = t.apply_change_id "); |
| | | " select 1 from apply_change ac where ac.isdeleted = 0 and ac.status in (1,2) and ac.apply_id = "+applyDetailPageDTO.getApplyId()+" and ac.id = t.apply_change_id "); |
| | | //在保 |
| | | queryWrapper.le(!Objects.isNull(applyDetailPageDTO.getApplyStatus()) |
| | | &&applyDetailPageDTO.getApplyStatus().equals(Constants.ONE), |
| | |
| | | } |
| | | |
| | | this.saveApplyLog(applyChange,Constants.ApplyChangeLogStatus.UPLOAD,null); |
| | | |
| | | |
| | | return applyChange.getId(); |
| | | } |
| | | |
| | |
| | | applyLog.setIsdeleted(Constants.ZERO); |
| | | applyLog.setApplyId(applyChange.getApplyId()); |
| | | applyLog.setTitle(applyChangeLogStatus.getName()); |
| | | applyLog.setContent(content); |
| | | applyLog.setContent(applyChangeLogStatus.getInfo().replace("${param}",content)); |
| | | applyLog.setObjType(applyChangeLogStatus.getKey()); |
| | | applyLog.setObjId( applyChange.getId()); |
| | | applyLog.setStatus(applyChange.getStatus()); |
| | |
| | | .leftJoin(InsuranceApply.class,InsuranceApply::getId,ApplyChange::getApplyId) |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .eq(!Objects.isNull(model.getType()),ApplyChange::getType,model.getType()) |
| | | .eq(!Objects.isNull(model.getStatus()),ApplyChange::getStatus,model.getStatus()) |
| | | .eq(!Objects.isNull(model.getStatus())&&!model.getStatus().equals(Constants.ApplyChangeStatus.RETURN_APPLY_UPLOAD.getKey()),ApplyChange::getStatus,model.getStatus()) |
| | | .in(!Objects.isNull(model.getStatus())&&model.getStatus().equals(Constants.ApplyChangeStatus.RETURN_APPLY_UPLOAD.getKey()),ApplyChange::getStatus, |
| | | Constants.ApplyChangeStatus.RETURN_APPLY_UPLOAD.getKey(), |
| | | Constants.ApplyChangeStatus.RETURN_APPLY_SIGNATURE.getKey()) |
| | | .eq(!Objects.isNull(model.getCompanyId()),InsuranceApply::getCompanyId,model.getCompanyId()) |
| | | .eq(!Objects.isNull(model.getSolutionsId()),ApplyChange::getSolutionsId,model.getSolutionsId()) |
| | | .ge(StringUtils.isNotBlank(model.getCreateDateS()),ApplyChange::getCreateDate, model.getCreateDateS()+" 00:00:00" ) |
| | |
| | | .leftJoin(InsuranceApply.class,InsuranceApply::getId,ApplyChange::getApplyId) |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .eq(!Objects.isNull(model.getType()),ApplyChange::getType,model.getType()) |
| | | .eq(!Objects.isNull(model.getStatus()),ApplyChange::getStatus,model.getStatus()) |
| | | .eq(!Objects.isNull(model.getStatus())&&!model.getStatus().equals(Constants.ApplyChangeStatus.RETURN_APPLY_UPLOAD.getKey()),ApplyChange::getStatus,model.getStatus()) |
| | | .in(!Objects.isNull(model.getStatus())&&model.getStatus().equals(Constants.ApplyChangeStatus.RETURN_APPLY_UPLOAD.getKey()),ApplyChange::getStatus, |
| | | Constants.ApplyChangeStatus.RETURN_APPLY_UPLOAD.getKey(), |
| | | Constants.ApplyChangeStatus.RETURN_APPLY_SIGNATURE.getKey()) |
| | | .eq(!Objects.isNull(model.getCompanyId()),InsuranceApply::getCompanyId,model.getCompanyId()) |
| | | .eq(!Objects.isNull(model.getSolutionsId()),ApplyChange::getSolutionsId,model.getSolutionsId()) |
| | | .ge(StringUtils.isNotBlank(model.getCreateDateS()),ApplyChange::getCreateDate, model.getCreateDateS()+" 00:00:00" ) |
| | |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"数据已删除,无法进行该操作"); |
| | | } |
| | | Constants.ApplyChangeLogStatus applyChangeLogStatus = Constants.ApplyChangeLogStatus.RETURN_APPLY; |
| | | if(applyChangeOptDTO.getOptType().equals(Constants.ApplyChangeStatus.RETURN_APPLY_UPLOAD.getKey()) |
| | | ||applyChangeOptDTO.getOptType().equals(Constants.ApplyChangeStatus.RETURN_APPLY_SIGNATURE.getKey())){ |
| | | |
| | | if(applyChangeOptDTO.getOptType().equals(3)){ |
| | | //发起退回申请 |
| | | if(loginUserInfo.getType().equals(Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非企业端用户无法进行该操作"); |
| | | } |
| | | if(!applyChange.getStatus().equals(Constants.ApplyChangeStatus.UPLOAD.getKey()) ){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"数据状态错误无法进行该操作!"); |
| | | if(!(applyChange.getStatus().equals(Constants.ApplyChangeStatus.UPLOAD.getKey()) |
| | | || applyChange.getStatus().equals(Constants.ApplyChangeStatus.SIGNATURE.getKey()))){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"数据状态错误无法进退回申请!"); |
| | | } |
| | | }else if(applyChangeOptDTO.getOptType().equals(Constants.ApplyChangeStatus.PLATFORM_AGREE.getKey())){ |
| | | |
| | | if(applyChange.getStatus().equals(Constants.ApplyChangeStatus.UPLOAD.getKey())){ |
| | | applyChange.setStatus(Constants.ApplyChangeStatus.RETURN_APPLY_UPLOAD.getKey()); |
| | | }else{ |
| | | applyChange.setStatus(Constants.ApplyChangeStatus.RETURN_APPLY_SIGNATURE.getKey()); |
| | | } |
| | | |
| | | }else if(applyChangeOptDTO.getOptType().equals(4)){ |
| | | applyChangeLogStatus = Constants.ApplyChangeLogStatus.PLATFORM_AGREE; |
| | | //平台同意退回 |
| | | if(loginUserInfo.getType().equals(Constants.ZERO)){ |
| | |
| | | )){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"数据状态错误无法进行该操作!"); |
| | | } |
| | | }else if(applyChangeOptDTO.getOptType().equals(Constants.ApplyChangeStatus.UPLOAD.getKey())){ |
| | | }else if(applyChangeOptDTO.getOptType().equals(5)){ |
| | | applyChangeLogStatus = Constants.ApplyChangeLogStatus.PLATFORM_UN_AGREE; |
| | | //平台驳回退回 |
| | | if(loginUserInfo.getType().equals(Constants.ZERO)){ |
| | |
| | | )){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"数据状态错误无法进行该操作!"); |
| | | } |
| | | }else if(applyChangeOptDTO.getOptType().equals(Constants.ApplyChangeStatus.CLOSE.getKey())){ |
| | | applyChangeLogStatus = Constants.ApplyChangeLogStatus.CLOSE; |
| | | if(applyChange.getStatus().equals(Constants.ApplyChangeStatus.RETURN_APPLY_UPLOAD.getKey())){ |
| | | applyChange.setStatus(Constants.ApplyChangeStatus.UPLOAD.getKey()); |
| | | }else{ |
| | | applyChange.setStatus(Constants.ApplyChangeStatus.SIGNATURE.getKey()); |
| | | } |
| | | }else if(applyChangeOptDTO.getOptType().equals(6)){ |
| | | //企业关闭 |
| | | applyChangeLogStatus = Constants.ApplyChangeLogStatus.CLOSE; |
| | | if(loginUserInfo.getType().equals(Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非企业端用户无法进行该操作"); |
| | | } |
| | | if(!applyChange.getStatus().equals(Constants.ApplyChangeStatus.PLATFORM_AGREE.getKey())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"数据状态错误无法进行该操作!"); |
| | | } |
| | | applyChange.setStatus(Constants.ApplyChangeStatus.CLOSE.getKey()); |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST ); |
| | | } |
| | | applyChange.setStatus(applyChangeOptDTO.getOptType()); |
| | | applyChange.setEditor(loginUserInfo.getId()); |
| | | applyChange.setEditDate(new Date()); |
| | | applyChangeMapper.updateById(applyChange); |
| | | // //存储日志数据 |
| | | |
| | | //存储日志数据 |
| | | this.saveApplyLog(applyChange,applyChangeLogStatus,applyChangeOptDTO.getOptIllustration()); |
| | | } |
| | | |
| | |
| | | duWorktype.setDuSolutionId(duSolution.getId()); |
| | | duWorktype.setStatus(Constants.ZERO); |
| | | duWorktype.setSortnum(j); |
| | | duWorktype.setDispatchUnitId(dispatchUnit.getId()); |
| | | duWorktype.setWorkTypeId(saveDuWorkTypeDTO.getWorkTypeId()); |
| | | duWorktype.setVideoUrl(saveDuWorkTypeDTO.getVideoUrl()); |
| | | duWorktype.setStatus2(Constants.ZERO); |
| | |
| | | duWorktype.setDuSolutionId(duSolution.getId()); |
| | | duWorktype.setStatus(Constants.ZERO); |
| | | duWorktype.setSortnum(duWorkTypeNum + j); |
| | | duWorktype.setDispatchUnitId(saveDispatchUnitDTO.getId()); |
| | | duWorktype.setWorkTypeId(saveDuWorkTypeDTO.getWorkTypeId()); |
| | | duWorktype.setVideoUrl(saveDuWorkTypeDTO.getVideoUrl()); |
| | | duWorktype.setStatus2(Constants.ZERO); |
| | |
| | | @Override |
| | | public List<DispatchUnit> findByDTO(DispatchUnitQueryDTO dispatchUnitQueryDTO) { |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | // List<DispatchUnit> dispatchUnitList = dispatchUnitMapper.selectList(new QueryWrapper<DispatchUnit>().lambda() |
| | | // .eq(DispatchUnit::getIsdeleted,Constants.ZERO) |
| | | // .eq(loginUserInfo.getType().equals(Constants.ONE),DispatchUnit::getCompanyId,loginUserInfo.getCompanyId()) |
| | | // .eq(DispatchUnit::getStatus,Constants.ZERO) |
| | | // .eq(DispatchUnit::getDataType,dispatchUnitQueryDTO.getDataType()) |
| | | // .apply(!Objects.isNull(dispatchUnitQueryDTO.getSolutionId()), " id in ( select d.dispatch_unit_id from du_solution d where d.solution_id = "+dispatchUnitQueryDTO.getSolutionId()+" ) " ) |
| | | // .exists(!Objects.isNull(dispatchUnitQueryDTO.getApplyId()), |
| | | // " select 1 from apply_detail ad where ad.isdeleted = 0 and ad.apply_id = "+dispatchUnitQueryDTO.getApplyId()+" " + |
| | | // " ad.du_id = t.id ") |
| | | // .orderByAsc(DispatchUnit::getSortnum) |
| | | // ); |
| | | |
| | | |
| | | List<DispatchUnit> dispatchUnitList = dispatchUnitJoinMapper.selectJoinList(DispatchUnit.class, |
| | | new MPJLambdaWrapper<DispatchUnit>().selectAll(DispatchUnit.class) |
| | | .selectAs(DuSolution::getId,DispatchUnit::getDuSolutionId) |
| | |
| | | .eq(!Objects.isNull(dispatchUnitQueryDTO.getSolutionId()),DuSolution::getSolutionId,dispatchUnitQueryDTO.getSolutionId()) |
| | | .exists(!Objects.isNull(dispatchUnitQueryDTO.getApplyId()), |
| | | " select 1 from apply_detail ad where ad.isdeleted = 0 and ad.apply_id = "+dispatchUnitQueryDTO.getApplyId()+" " + |
| | | " ad.du_id = t.id ") |
| | | " and ad.du_id = t.id ") |
| | | ); |
| | | |
| | | |
| | | |
| | | return dispatchUnitList; |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public void updateApplyCurrentFee(){ |
| | | public void updateApplyCurrentFee(Integer id){ |
| | | List<InsuranceApply> insuranceApplyList = insuranceApplyMapper.selectList(new QueryWrapper<InsuranceApply>().lambda() |
| | | .eq(InsuranceApply::getIsdeleted,Constants.ZERO) |
| | | .eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey()) |
| | | .ge(InsuranceApply::getStartTime,DateUtil.getDate(new Date(),"yyyy-MM-dd") + " 00:00:00") |
| | | .le(InsuranceApply::getEndTime,DateUtil.getDate(new Date(),"yyyy-MM-dd") + " 23:59:59") |
| | | .eq(!Objects.isNull(id),InsuranceApply::getId,id) |
| | | .le(InsuranceApply::getStartTime,DateUtil.getDate(new Date(),"yyyy-MM-dd") + " 00:00:00") |
| | | .ge(InsuranceApply::getEndTime,DateUtil.getDate(new Date(),"yyyy-MM-dd") + " 23:59:59") |
| | | ); |
| | | |
| | | if(CollectionUtils.isNotEmpty(insuranceApplyList)){ |
| | |
| | | List<ApplyDetail> applyDetailList = applyDetailMapper.selectList(new QueryWrapper<ApplyDetail>().lambda().eq(ApplyDetail::getApplyId,insuranceApply.getId())); |
| | | if(CollectionUtils.isNotEmpty(applyDetailList)){ |
| | | for (ApplyDetail applyDetail: applyDetailList) { |
| | | applyDetail.setCurrentFee(Constants.countDetailFee(solutions,new Date(),applyDetail.getStartTime())); |
| | | //2024-1-30 10:04:24 修改 根据实际天数进行计算 当前费用 总金额/总天数*实际天数 |
| | | Integer maxDays = DateUtil.calculateBetween(applyDetail.getStartTime(),applyDetail.getEndTime(),0) + 1 ; |
| | | BigDecimal fee = applyDetail.getFee(); |
| | | if(applyDetail.getStartTime().compareTo(new Date()) <= 0 && applyDetail.getEndTime().compareTo(new Date()) >= 0 ){ |
| | | Integer days = DateUtil.calculateBetween(applyDetail.getStartTime(),new Date(),0) + 1 ; |
| | | applyDetail.setCurrentFee(fee.divide(BigDecimal.valueOf(maxDays),2, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(days))); |
| | | applyDetailMapper.updateById(applyDetail); |
| | | } |
| | | // DateUtil.daysBetweenDates(applyDetail.getEndTime(),applyDetail.getStartTime()); |
| | | // applyDetail.setCurrentFee(Constants.countDetailFee(solutions,new Date(),applyDetail.getStartTime())); |
| | | // applyDetailMapper.updateById(applyDetail); |
| | | sumAmount = sumAmount.add(applyDetail.getCurrentFee()); |
| | | } |
| | | } |
| | |
| | | .eq(CompanySolution::getCompanyId,user.getCompanyId()) |
| | | .orderByAsc(Solutions::getSortnum) |
| | | ); |
| | | |
| | | // solutionsList.forEach(i->{ |
| | | // //保险时间单位 与 最小投保周期时间单位 规则相同 或者 最小投保周期时间单位 规则为 天时 默认金额 |
| | | // if(i.getTimeUnit().equals(i.getInsureCycleUnit())||i.getInsureCycleUnit().equals(Constants.ZERO)){ |
| | | // i.setCyclePrice(i.getPrice()); |
| | | // }else{ |
| | | // if(i.getInsureCycleUnit().equals(Constants.ONE)){ |
| | | // //最小投保周期时间单位为半月 |
| | | // i.setCyclePrice(i.getPrice().multiply(new BigDecimal(15))); |
| | | // }else if(i.getInsureCycleUnit().equals(Constants.TWO)){ |
| | | // //最小投保周期时间单位为月 则计算当月多少天 |
| | | // if( ){ |
| | | // |
| | | // } |
| | | // } |
| | | // } |
| | | // }); |
| | | return solutionsList; |
| | | } |
| | | |
| | |
| | | .selectAll(InsuranceApply.class) |
| | | .selectAs(Solutions::getName,InsuranceApply::getSolutionsName) |
| | | .select(" ( select count(1) from apply_detail ad where ad.apply_id = t.id ) as insureNum") |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .notExists(" select 1 from taxes t1 inner join tax_detial t2 on t1.id = t2.tax_id where t2.type = 0 and t1.status != 2 and t.id = t2.INSURANCE_APPLY_ID ") |
| | | .eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey()) |
| | | .eq(InsuranceApply::getId,id) |
| | |
| | | if(CollectionUtils.isNotEmpty(applyChangeList)){ |
| | | for (ApplyChange applyChange:applyChangeList) { |
| | | insuranceApply.setFee(insuranceApply.getFee().subtract(applyChange.getFee())); |
| | | TaxesInvoicingVO taxesInvoicingVO = applyChange.getTaxesInvoicingVO(); |
| | | TaxesInvoicingVO taxesInvoicingVO = applyChange.toTaxesInvoicingVO(); |
| | | if(!Objects.isNull(insuranceApply)){ |
| | | taxesInvoicingVO.setAmount(BigDecimal.ZERO); |
| | | } |
| | |
| | | || Objects.isNull(directInvoicingDTO.getInvoicingMoney()) |
| | | || Objects.isNull(directInvoicingDTO.getType()) |
| | | || Objects.isNull(directInvoicingDTO.getInvoicingDetailDTOList()) |
| | | || StringUtils.isNotBlank(directInvoicingDTO.getAddress()) |
| | | || StringUtils.isBlank(directInvoicingDTO.getAddress()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | |
| | | "id in ( select sw.worktype_id from solution_worktype sw where sw.SOLUTION_ID = "+workTypeQueryDTO.getId()+" )") |
| | | .apply(workTypeQueryDTO.getQueryType().equals(Constants.ONE), |
| | | "id in ( select dw.work_type_id from du_worktype dw where dw.du_solution_id = "+workTypeQueryDTO.getId()+" )") |
| | | .apply(workTypeQueryDTO.getQueryType().equals(Constants.TWO), |
| | | "id in ( select dw.WORKTYPE_ID from apply_detail dw where dw.APPLY_ID = "+workTypeQueryDTO.getId()+" )") |
| | | ); |
| | | return list; |
| | | } |