| | |
| | | return ApiResponse.success("æä½æå",applyChangeService.getChangeCountCyclePriceVO(applyChangeCyclePriceDTO)); |
| | | } |
| | | |
| | | @ApiOperation("æä¿ç¡®è®¤ä¹¦ç¾ç« ä¸å¡") |
| | | @GetMapping("/getChangeMemberListOnlineSignLink/{id}") |
| | | @RequiresPermissions("business:applychange:query") |
| | | public ApiResponse<String> getChangeMemberListOnlineSignLink(@PathVariable Integer id) { |
| | | return ApiResponse.success(applyChangeService.getChangeMemberListOnlineSignLink(id)); |
| | | } |
| | | |
| | | } |
| | |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation("æä¿ç¡®è®¤ä¹¦ç¾ç« ä¸å¡") |
| | | @GetMapping("/getSignTBQRSLink/{id}") |
| | | @RequiresPermissions("business:insuranceapply:query") |
| | | public ApiResponse<String> getSignTBQRSLink(@PathVariable Integer id) { |
| | | return ApiResponse.success(insuranceApplyService.getSignTBQRSLink(id)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("人åååç¾ç« ") |
| | | @GetMapping("/getMemberListOnlineSignLink/{id}") |
| | | @RequiresPermissions("business:insuranceapply:query") |
| | | public ApiResponse<String> getMemberListOnlineSignLink(@PathVariable Integer id) { |
| | | return ApiResponse.success(insuranceApplyService.getMemberListOnlineSignLink(id)); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | @GetMapping("/{id}") |
| | | @RequiresPermissions("business:member:query") |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | return ApiResponse.success(memberService.findById(id)); |
| | | return ApiResponse.success(memberService.findDetailById(id)); |
| | | } |
| | | |
| | | |
| | |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.dao.business.dto.*; |
| | | import com.doumee.dao.business.model.UnionApply; |
| | | import com.doumee.service.business.UnionApplyService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | return ApiResponse.success(unionApplyService.findById(id)); |
| | | } |
| | | |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("å建åå¹¶å") |
| | | @PostMapping("/merge") |
| | | @RequiresPermissions("business:unionapply:create") |
| | | public ApiResponse merge(@RequestBody SaveUnionApplyDTO saveUnionApplyDTO) { |
| | | return ApiResponse.success(unionApplyService.merge(saveUnionApplyDTO)); |
| | | } |
| | | |
| | | @ApiOperation("å
³éåå¹¶å") |
| | | @GetMapping("/close") |
| | | @RequiresPermissions("business:unionapply:close") |
| | | public ApiResponse close(@RequestParam Integer id) { |
| | | unionApplyService.cancelMerge(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("ä¸ä¼ æä¿å") |
| | | @PostMapping("/uploadToubaodan") |
| | | @RequiresPermissions("business:unionapply:create") |
| | | public ApiResponse uploadToubaodan(@RequestBody UploadMultifileDTO uploadMultifileDTO) { |
| | | unionApplyService.uploadToubaodan(uploadMultifileDTO); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("ç¾ç½²ç³è¯·å") |
| | | @GetMapping("/getSignLink") |
| | | @RequiresPermissions("business:unionapply:query") |
| | | public ApiResponse getSignLink(@RequestParam Integer id) { |
| | | unionApplyService.getSignLink(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("ä¸ä¼ ä¿é©å") |
| | | @PostMapping("/uploadBXD") |
| | | @RequiresPermissions("business:unionchange:query") |
| | | public ApiResponse uploadBXD(@RequestBody UnionApplyBXDDTO unionApplyBXDDTO) { |
| | | unionApplyService.uploadBXD(unionApplyBXDDTO); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.dao.business.dto.SaveUnionChangeDTO; |
| | | import com.doumee.dao.business.dto.UnionChangeBXDDTO; |
| | | import com.doumee.dao.business.model.UnionChange; |
| | | import com.doumee.service.business.UnionChangeService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | return ApiResponse.success(unionChangeService.findById(id)); |
| | | } |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("å建åå¹¶å") |
| | | @PostMapping("/merge") |
| | | @RequiresPermissions("business:unionchange:create") |
| | | public ApiResponse merge(@RequestBody SaveUnionChangeDTO saveUnionChangeDTO) { |
| | | return ApiResponse.success(unionChangeService.merge(saveUnionChangeDTO)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("å
³éåå¹¶å") |
| | | @GetMapping("/close") |
| | | @RequiresPermissions("business:unionchange:close") |
| | | public ApiResponse close(@RequestParam Integer id) { |
| | | unionChangeService.cancelMerge(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("ç¾ç½²ç³è¯·å") |
| | | @GetMapping("/getSignLink") |
| | | @RequiresPermissions("business:unionchange:query") |
| | | public ApiResponse getSignLink(@RequestParam Integer id) { |
| | | unionChangeService.getSignLink(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation("ä¸ä¼ ä¿é©å") |
| | | @PostMapping("/uploadBXD") |
| | | @RequiresPermissions("business:unionchange:query") |
| | | public ApiResponse uploadBXD(@RequestBody UnionChangeBXDDTO unionChangeBXDDTO) { |
| | | unionChangeService.uploadBXD(unionChangeBXDDTO); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | } |
| | |
| | | * @param data æ°æ® |
| | | * @param sheetName Sheetåç§° |
| | | */ |
| | | public String exportJiajianBaoExcelToPdf (ApplyChange data, String sheetName) { |
| | | public String exportJiajianBaoExcelToPdf (ApplyChange data, String sheetName,String cellValue) { |
| | | SXSSFWorkbook sxssfWorkbook; |
| | | try { |
| | | sxssfWorkbook = new SXSSFWorkbook(); |
| | |
| | | configTitleCell(sxssfWorkbook,title.getCell(i)); |
| | | } |
| | | Row header1 = sheet.createRow(1); |
| | | header1.createCell(0).setCellValue("æä¿ä¼ä¸"); |
| | | header1.createCell(0).setCellValue(cellValue); |
| | | header1.createCell(3).setCellValue("ä¿é©æ¹æ¡"); |
| | | header1.createCell(4).setCellValue("ä¿åå·"); |
| | | header1.createCell(5).setCellValue("ä¿é©çæèµ·æ"); |
| | |
| | | sheet.addMergedRegion(new CellRangeAddress(rowIndex ,rowIndex,0,11)); |
| | | Row header7= sheet.createRow(rowIndex+1); |
| | | header7.setHeight((short) 3000); |
| | | header7.createCell(0).setCellValue("æä¿ä¼ä¸ç¾ç« ï¼ \n \n \n" +"æ¥æï¼ å¹´ æ æ¥ "); |
| | | header7.createCell(0).setCellValue(cellValue+"ç¾ç« ï¼ \n \n \n" +"æ¥æï¼ å¹´ æ æ¥ "); |
| | | for (int i =0; i < 12; i++) { |
| | | if(i>0){ |
| | | header7.createCell(i).setCellValue(""); |
| | |
| | | * @param data æ°æ® |
| | | * @param sheetName Sheetåç§° |
| | | */ |
| | | public String exportChangeUnitExcelToPdf (ApplyChange data, String sheetName) { |
| | | public String exportChangeUnitExcelToPdf (ApplyChange data, String sheetName,String cellValue) { |
| | | SXSSFWorkbook sxssfWorkbook; |
| | | try { |
| | | sxssfWorkbook = new SXSSFWorkbook(); |
| | |
| | | configTitleCell(sxssfWorkbook,title.getCell(i)); |
| | | } |
| | | Row header1 = sheet.createRow(1); |
| | | header1.createCell(0).setCellValue("æä¿ä¼ä¸"); |
| | | header1.createCell(0).setCellValue(cellValue); |
| | | header1.createCell(1).setCellValue("ä¿é©æ¹æ¡"); |
| | | header1.createCell(2).setCellValue(""); |
| | | header1.createCell(3).setCellValue("ä¿åå·"); |
| | |
| | | sheet.addMergedRegion(new CellRangeAddress(rowIndex ,rowIndex,0,7)); |
| | | Row header7= sheet.createRow(rowIndex+1); |
| | | header7.setHeight((short) 3000); |
| | | header7.createCell(0).setCellValue("æä¿ä¼ä¸ç¾ç« ï¼ \n \n \n" +"æ¥æï¼ å¹´ æ æ¥ "); |
| | | header7.createCell(0).setCellValue(cellValue + "ç¾ç« ï¼ \n \n \n" +"æ¥æï¼ å¹´ æ æ¥ "); |
| | | for (int i =0; i < 8; i++) { |
| | | if(i>0){ |
| | | header7.createCell(i).setCellValue(""); |
| | |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å¯¼åº æä¿ç³è¯·è¯¦å |
| | | * @param insuranceApply æ°æ® |
| | | * @param sheetName Sheetåç§° |
| | | */ |
| | | public String exportApplyExcelToPdf(InsuranceApply insuranceApply, String sheetName) { |
| | | SXSSFWorkbook sxssfWorkbook; |
| | | try { |
| | | sxssfWorkbook = new SXSSFWorkbook(); |
| | | Sheet sheet = sxssfWorkbook.createSheet(sheetName); |
| | | for (int i = 0; i < 6; i++) { |
| | | sheet.setColumnWidth(i, ((i==3|| i== 4|| i== 5 )?16:8) * 2 * 256); |
| | | } |
| | | sheet.createFreezePane(0, 1); |
| | | sheet.addMergedRegion(new CellRangeAddress(0 ,0,0,6)); |
| | | Row title = sheet.createRow(0); |
| | | title.setHeight((short) 2000); |
| | | Cell c = title.createCell(0); |
| | | c.setCellValue(sheetName); |
| | | configFirstCell(sxssfWorkbook,c); |
| | | for (int i = 0; i < 8; i++) { |
| | | if(i>0){ |
| | | title.createCell(i).setCellValue(""); |
| | | } |
| | | configTitleCell(sxssfWorkbook,title.getCell(i)); |
| | | } |
| | | Row header1 = sheet.createRow(1); |
| | | header1.createCell(0).setCellValue("æä¿äºº"); |
| | | header1.createCell(1).setCellValue("æ¥ä¿é©äºº"); |
| | | header1.createCell(2).setCellValue("æä¿äººæ°"); |
| | | header1.createCell(3).setCellValue("ä¿é©æ¹æ¡"); |
| | | header1.createCell(4).setCellValue("ä¿é©çæèµ·æ"); |
| | | header1.createCell(5).setCellValue("ä¿é©çææ¢æ"); |
| | | for (int i = 0; i < 6; i++) { |
| | | configFirstCell(sxssfWorkbook,header1.getCell(i)); |
| | | } |
| | | sheet.addMergedRegion(new CellRangeAddress(1 ,1,1,2)); |
| | | |
| | | Row header2 = sheet.createRow(2); |
| | | header2.createCell(0).setCellValue(insuranceApply.getShopName()); |
| | | header2.createCell(1).setCellValue(insuranceApply.getCompanyName()); |
| | | header2.createCell(2).setCellValue(insuranceApply.getInsureNum()); |
| | | header2.createCell(3).setCellValue(insuranceApply.getSolutionsName()); |
| | | header2.createCell(4).setCellValue(com.doumee.core.utils.DateUtil.getPlusTime2(insuranceApply.getStartTime())); |
| | | header2.createCell(5).setCellValue(com.doumee.core.utils.DateUtil.getPlusTime2(insuranceApply.getEndTime())); |
| | | sheet.addMergedRegion(new CellRangeAddress(2 ,2,1,2)); |
| | | for (int i = 0; i < 6; i++) { |
| | | configDataCell(sxssfWorkbook,header2.getCell(i)); |
| | | } |
| | | Row header4 = sheet.createRow(3); |
| | | header4.createCell(0).setCellValue("åºå·"); |
| | | header4.createCell(1).setCellValue("åå·¥å§å"); |
| | | header4.createCell(2).setCellValue("æ§å«"); |
| | | header4.createCell(3).setCellValue("身份è¯å·"); |
| | | header4.createCell(4).setCellValue("æ´¾é£åä½"); |
| | | header4.createCell(5).setCellValue("ææå±å·¥ç§"); |
| | | for (int i = 0; i < 6; i++) { |
| | | configFirstCell(sxssfWorkbook,header4.getCell(i)); |
| | | } |
| | | // åå»ºæ°æ®è®°å½ |
| | | for (int rowIndex = 0; rowIndex <insuranceApply.getApplyDetailList().size(); rowIndex++) { |
| | | ApplyDetail addModel = insuranceApply.getApplyDetailList().get(rowIndex); |
| | | Row header5 = sheet.createRow(rowIndex + 4); |
| | | header5.createCell(0).setCellValue(rowIndex+1); |
| | | header5.createCell(1).setCellValue(StringUtils.defaultString(addModel.getMemberName(),"")); |
| | | header5.createCell(2).setCellValue(Constants.equalsInteger(addModel.getSex(),0)?"ç·":(Constants.equalsInteger(addModel.getSex(),1)?"女":"-")); |
| | | header5.createCell(3).setCellValue(StringUtils.defaultString(addModel.getIdcardNo(),"")); |
| | | header5.createCell(6).setCellValue(StringUtils.defaultString(addModel.getDuName(),"")); |
| | | header5.createCell(7).setCellValue(StringUtils.defaultString(addModel.getWorkTypeName(),"")); |
| | | for (int i = 0; i < 6; i++) { |
| | | configDataCell(sxssfWorkbook,header5.getCell(i)); |
| | | } |
| | | } |
| | | int rowIndex = 4+insuranceApply.getApplyDetailList().size(); |
| | | Row header6= sheet.createRow(rowIndex); |
| | | header6.createCell(0).setCellValue("æä¿ä¼ä¸ç³æ:\n" + |
| | | "1ãå¨ç³è¯·ä¹¦ä¸å¡«åçä¸åå
容å±å®ï¼å¦åæ¬ä¼ä¸æ¿æ
ä¸åæ³å¾è´£ä»»ã\n" + |
| | | "2ãç±äºåæ´åç人产ççæ³å¾çº 纷æ¬ä¼ä¸æ¿æ¿æ
ä¸åæ³å¾è´£ä»»ã\n" + |
| | | "3ãæ¬ç³è¯·è¡¨çç¾ç« 为æ¬ä¼ä¸äº²èªç¾ç½²ï¼å¦ç±æ¤äº§ççæ³å¾çº 纷æ¬ä¼ä¸æ¿æ¿æ
ä¸åæ³å¾è´£ä»»ã\n"); |
| | | for (int i = 1; i < 6; i++) { |
| | | header6.createCell(i).setCellValue(""); |
| | | } |
| | | for (int i =0; i < 6; i++) { |
| | | if(i>0){ |
| | | header6.createCell(i).setCellValue(""); |
| | | } |
| | | configInfoCell(sxssfWorkbook,header6.getCell(i),HorizontalAlignment.LEFT); |
| | | } |
| | | header6.setHeight((short) 2000); |
| | | sheet.addMergedRegion(new CellRangeAddress(rowIndex ,rowIndex,0,7)); |
| | | Row header7= sheet.createRow(rowIndex+1); |
| | | header7.setHeight((short) 3000); |
| | | header7.createCell(0).setCellValue("æä¿ä¼ä¸ç¾ç« ï¼ \n \n \n" +"æ¥æï¼ å¹´ æ æ¥ "); |
| | | for (int i =0; i < 6; i++) { |
| | | if(i>0){ |
| | | header7.createCell(i).setCellValue(""); |
| | | } |
| | | configInfoCell(sxssfWorkbook,header7.getCell(i),HorizontalAlignment.RIGHT); |
| | | } |
| | | sheet.addMergedRegion(new CellRangeAddress(rowIndex+1 ,rowIndex+1,0,7)); |
| | | |
| | | //临æ¶ç¼å²åº |
| | | ByteArrayOutputStream out = new ByteArrayOutputStream(); |
| | | //åå»ºä¸´æ¶æä»¶ |
| | | sxssfWorkbook.write(out); |
| | | byte [] bookByteAry = out.toByteArray(); |
| | | InputStream in = new ByteArrayInputStream(bookByteAry); |
| | | String tempExcel = saveIsToFile(in); |
| | | String tempPdf =System.getProperty("java.io.tmpdir")+File.separator+UUID.randomUUID().toString()+".pdf"; |
| | | // ExcelToPdfTool.excelToPdf(in,tempPdf);//转PDF |
| | | ExcelToPdfTool.excelToPdf(tempExcel,tempPdf);//转PDF |
| | | File f = new File(tempPdf); |
| | | if(f!=null && f.isFile() && f.length()>0){ |
| | | return tempPdf; |
| | | } |
| | | } catch (Exception e) { |
| | | // throw new BusinessException(ResponseStatus.EXPORT_EXCEL_ERROR, e); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | private String saveIsToFile(InputStream inputStream) { |
| | | try { |
| | | String fileName =System.getProperty("java.io.tmpdir")+File.separator+UUID.randomUUID().toString()+".xlsx"; |
| | |
| | | |
| | | HBD_BD_APPLY_PDF(15, "åå¹¶å-ä¿åç³è¯·è¡¨PDF ", "åå¹¶å-ä¿åç³è¯·è¡¨PDF "), |
| | | HBD_BD_SIGNED_PDF(16, "åå¹¶å-ç¾ç½²åä¿åç³è¯·è¡¨PDF", "åå¹¶å-ç¾ç½²åä¿åç³è¯·è¡¨PDF"), |
| | | COMPANY_TBD_SIGNED_PDF(17, "åå¹¶å-æä¿å-åæ·æäº¤ï¼ä¼ä¸ç¾ç½²ï¼", "åå¹¶å-ç¾ç½²åä¿åç³è¯·è¡¨PDF"), |
| | | SOLUTIONS_CONFIRMATION_LATTER(18, "å§æä¿ - æä¿æ¹æ¡ç¡®è®¤ä¹¦", "å§æä¿ - æ¹æ¡ç¡®è®¤ä¹¦"), |
| | | MEMBER_LIST_LATTER(19, "å§æä¿ - æä¿äººååå", "å§æä¿ - æ¹æ¡ç¡®è®¤ä¹¦"), |
| | | CHANGE_MEMBER_LIST_LATTER(20, "å§æä¿ - å åä¿äººååå", "å§æä¿ - æ¹æ¡ç¡®è®¤ä¹¦"), |
| | | |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | public enum UnionChangeStatus { |
| | | MERGE(0, "å¾
ç¾ç½²ç³è¯·å","",0), |
| | | UPLOAD_INSURANCE_POLICY(1, "å¾
ä¸ä¼ ä¿å","",0), |
| | | FINISH(2, "ä¿éä¸","",0), |
| | | CLOSE(3, "å
³é","",0), |
| | | ; |
| | | // æååé |
| | | private String name; |
| | | private String info; |
| | | private int key; |
| | | private int collectStatus; |
| | | |
| | | |
| | | // æé æ¹æ³ |
| | | UnionChangeStatus(int key, String name,String info,int collectStatus) { |
| | | this.name = name; |
| | | this.key = key; |
| | | this.info = info; |
| | | this.collectStatus = collectStatus; |
| | | } |
| | | |
| | | // æ®éæ¹æ³ |
| | | public static String getName(int index) { |
| | | for (UnionChangeStatus c : UnionChangeStatus.values()) { |
| | | if (c.getKey() == index) { |
| | | return c.name; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | public static List<Integer> getKesByStatus(Integer collectStatus) { |
| | | List<Integer> list = new ArrayList<>(); |
| | | if(collectStatus!=null){ |
| | | for (UnionChangeStatus c : UnionChangeStatus.values()) { |
| | | if (Constants.equalsInteger(c.getCollectStatus() ,collectStatus)) { |
| | | list.add(c.getKey()); |
| | | } |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | public static Integer getCollectStatus(Integer index) { |
| | | for (UnionChangeStatus c : UnionChangeStatus.values()) { |
| | | if (Constants.equalsInteger(c.getKey() , index)) { |
| | | return c.collectStatus; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | public static String getInfo(int index) { |
| | | for (UnionChangeStatus c : UnionChangeStatus.values()) { |
| | | if (c.getKey() == index) { |
| | | return c.info; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | // get set æ¹æ³ |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public int getKey() { |
| | | return key; |
| | | } |
| | | |
| | | public void setKey(int key) { |
| | | this.key = key; |
| | | } |
| | | |
| | | public String getInfo() { |
| | | return info; |
| | | } |
| | | |
| | | public void setInfo(String info) { |
| | | this.info = info; |
| | | } |
| | | |
| | | public int getCollectStatus() { |
| | | return collectStatus; |
| | | } |
| | | |
| | | public void setCollectStatus(int collectStatus) { |
| | | this.collectStatus = collectStatus; |
| | | } |
| | | } |
| | | |
| | | public enum InsuranceApplyStatus { |
| | | UPLOAD(0, "æäº¤æä¿","",0), |
| | | PLATFORM_RETURN(1, "å®¡æ ¸ä¸éè¿","æäº¤æè§ï¼${param}",4), |
| | |
| | | CLOSE(9, "订åå
³é","",6), |
| | | PLATFORM_CHECK_PASS(10,"平尿ä¿å®¡æ ¸éè¿","æäº¤æè§ï¼${param}",0), |
| | | COMPANY_BACK_APPLY_PASS(11, "ä¼ä¸ç³è¯·éå(平尿ä¿å®¡æ ¸éè¿)","æäº¤æè§ï¼${param}",5), |
| | | COMPANY_APPLY_SIGNATURE(12, "å§æä¿-ä¼ä¸å·²ç¾ç½²æä¿ç¡®è®¤ä¹¦","æäº¤æè§ï¼${param}",5), |
| | | COMPANY_MEMBER_LIST_SIGNATURE(13, "å§æä¿-ä¼ä¸å·²ç¾ç½²äººååå","æäº¤æè§ï¼${param}",5), |
| | | ; |
| | | // æååé |
| | | private String name; |
| | |
| | | CLOSE(6, "å·²å
³é"), |
| | | PALTFORM_CHECK_PASS(7, "å®¡æ ¸éè¿"), |
| | | PALTFORM_CHECK_PASS_NO(8, "å®¡æ ¸ä¸éè¿"), |
| | | COMPANY_SIGN(9, "ä¼ä¸ç¾ç½²äººååå - å§æä¿"), |
| | | ; |
| | | // æååé |
| | | private String name; |
| | |
| | | @Data |
| | | public class MemberQueryDTO { |
| | | |
| | | @ApiModelProperty(value = "æ¨¡ç³æ¥è¯¢ ææºå·+身份è¯å·ç ") |
| | | private String keywords; |
| | | |
| | | @ApiModelProperty(value = "åå·¥åç§°") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "æ´¾é£å®ä½åç§°") |
| | | private String duName; |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.business.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Created by IntelliJ IDEA. |
| | | * |
| | | * @Author : Rk |
| | | * @create 2024/3/15 14:42 |
| | | */ |
| | | @Data |
| | | public class SaveUnionChangeDTO { |
| | | |
| | | @ApiModelProperty(value = "æä¿åå¹¶å主é®") |
| | | private Integer unionApplyId; |
| | | |
| | | @ApiModelProperty(value = "å åä¿/æ¢ååæ®ä¸»é® å¤ä¸ªä»¥,åå²") |
| | | private List<Integer> applyIds; |
| | | |
| | | @ApiModelProperty(value = "æ¹åæ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date applyDate; |
| | | |
| | | @ApiModelProperty(value = "ä¸å¡ç±»åï¼0=å åä¿;1=æ¢å") |
| | | private Integer businessType; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.business.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Created by IntelliJ IDEA. |
| | | * |
| | | * @Author : Rk |
| | | * @create 2024/3/20 16:52 |
| | | */ |
| | | @Data |
| | | public class UnionChangeBXDDTO { |
| | | |
| | | @ApiModelProperty(value = "åå¹¶å主é®") |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "ä¿åå·") |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "æ¹åæ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date applyDate; |
| | | |
| | | @ApiModelProperty(value = "ä¿åæä»¶å°å") |
| | | private String fileUrl; |
| | | |
| | | @ApiModelProperty(value = "ä¿åæä»¶åç§°") |
| | | private String fileName; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "åæ´éé¢") |
| | | @ExcelColumn(name="åæ´éé¢") |
| | | private BigDecimal fee; |
| | | |
| | | @ApiModelProperty(value = "åå¹¶å-æä¿åç¶æ 0=æªä¸ä¼ ;1=å·²ä¸ä¼ ;2=å·²ç¾ç½²", example = "1") |
| | | private Integer unionChangeTbdStatus; |
| | | |
| | | @ApiModelProperty(value = "人åååç¾ç½²ååå·") |
| | | @ExcelColumn(name="人åååç¾ç½²ååå·") |
| | | private String signMemberListNo; |
| | | |
| | | @ApiModelProperty(value = "ä¿åå·") |
| | | @TableField(exist = false) |
| | | private String applyCode; |
| | |
| | | private String createDateE; |
| | | |
| | | @ApiModelProperty(value = "æ¹åçæèµ·ææ¶é´") |
| | | @TableField(exist = false) |
| | | private String applyStartS; |
| | | |
| | | @ApiModelProperty(value = "æ¹åæ¢ææ¶é´") |
| | | @TableField(exist = false) |
| | | private String applyStartE; |
| | | |
| | | @ApiModelProperty(value = "ä¿é©æ¹æ¡ä¸»é®") |
| | |
| | | @ExcelColumn(name="åå¹¶åç¼ç ï¼å
³èunion_apply)") |
| | | private Integer unionApplyId; |
| | | |
| | | @ApiModelProperty(value = "åå¹¶å-æä¿åç¶æ 0=æªä¸ä¼ ;1=å·²ä¸ä¼ ;2=å·²ç¾ç½²", example = "1") |
| | | private Integer unionApplyTbdStatus; |
| | | |
| | | @ApiModelProperty(value = "åå·") |
| | | @ExcelColumn(name="åå·") |
| | | private String code; |
| | |
| | | @ApiModelProperty(value = "æ»è´¹ç¨") |
| | | @ExcelColumn(name="æ»è´¹ç¨") |
| | | private BigDecimal fee; |
| | | |
| | | @ApiModelProperty(value = "å¨çº¿ç¡®è®¤ä¹¦ååå·") |
| | | @ExcelColumn(name="å¨çº¿ç¡®è®¤ä¹¦ååå·") |
| | | private String signQrsNo; |
| | | |
| | | @ApiModelProperty(value = "人åååç¾ç½²ååå·") |
| | | @ExcelColumn(name="人åååç¾ç½²ååå·") |
| | | private String signMemberListNo; |
| | | |
| | | @ApiModelProperty(value = "ä¼ä¸åç§°") |
| | | @TableField(exist = false) |
| | |
| | | @TableField(exist = false) |
| | | private Integer newVersionSolutionId; |
| | | |
| | | |
| | | @ApiModelProperty(value = "åæ·åç§°") |
| | | @TableField(exist = false) |
| | | private String shopName; |
| | | |
| | | |
| | | |
| | | public TaxesInvoicingVO toTaxesInvoicingVO(){ |
| | | TaxesInvoicingVO taxesInvoicingVO = new TaxesInvoicingVO(); |
| | | taxesInvoicingVO.setId(this.getId()); |
| | |
| | | @ApiModelProperty(value = "æ¥æ¶æä»¶é®ç®±") |
| | | @ExcelColumn(name="æ¥æ¶æä»¶é®ç®±") |
| | | private String email; |
| | | |
| | | @ApiModelProperty(value = "æ¿å
å
¬å¸") |
| | | @ExcelColumn(name="æ¿å
å
¬å¸") |
| | | private String companyName; |
| | |
| | | |
| | | @ApiModelProperty(value = "ç¶æ 0å¾
ç¾ç½²ç³è¯·å 1å¾
ä¸ä¼ æ¹å 2å·²ä¸ä¼ æ¹å 3éå") |
| | | @ExcelColumn(name="ç¶æ 0å¾
ç¾ç½²ç³è¯·å 1å¾
ä¸ä¼ æ¹å 2å·²ä¸ä¼ æ¹å 3éå") |
| | | private String status; |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "ææä¿é©çæèµ·æ") |
| | | @ExcelColumn(name="ææä¿é©çæèµ·æ") |
| | |
| | | @ExcelColumn(name="å¨çº¿ç¾ç« ååå·") |
| | | private String signApplyNo; |
| | | |
| | | @ApiModelProperty(value = "åå¹¶ä¿å主é®") |
| | | @ExcelColumn(name="åå¹¶ä¿å主é®") |
| | | private Integer unionApplyId; |
| | | |
| | | } |
| | |
| | | String getSignLinkChangeUnit(ApplyChange model); |
| | | |
| | | CountCyclePriceVO getChangeCountCyclePriceVO(ApplyChangeCyclePriceDTO applyChangeCyclePriceDTO); |
| | | |
| | | /** |
| | | * å§æä¿ äººåååç¾ç½² |
| | | * @param applyChangeId |
| | | * @return |
| | | */ |
| | | String getChangeMemberListOnlineSignLink(Integer applyChangeId); |
| | | |
| | | } |
| | |
| | | CountCyclePriceVO getCountCyclePriceVO(CountCyclePriceDTO countCyclePriceDTO); |
| | | |
| | | void generateNotice(); |
| | | |
| | | /** |
| | | * 详æ
ä¿¡æ¯ |
| | | * @param applyId |
| | | * @return |
| | | */ |
| | | InsuranceApply queryApplyDetail(Integer applyId); |
| | | |
| | | /** |
| | | * å§æä¿ æä¿ç¡®è®¤ä¹¦ç¾ç« ä¸å¡ |
| | | * @param applyId |
| | | * @return |
| | | */ |
| | | String getSignTBQRSLink(Integer applyId); |
| | | |
| | | /** |
| | | * 人åååç¾ç« |
| | | * @param applyId |
| | | * @return |
| | | */ |
| | | String getMemberListOnlineSignLink(Integer applyId); |
| | | } |
| | | |
| | |
| | | */ |
| | | Member findById(Integer id); |
| | | |
| | | Member findDetailById(Integer id); |
| | | |
| | | /** |
| | | * æ¡ä»¶æ¥è¯¢åæ¡è®°å½ |
| | | * |
| | |
| | | * ä¿ååå¹¶ |
| | | * @param saveUnionApplyDTO |
| | | */ |
| | | void merge(SaveUnionApplyDTO saveUnionApplyDTO); |
| | | Integer merge(SaveUnionApplyDTO saveUnionApplyDTO); |
| | | |
| | | /** |
| | | * åæ¶åå¹¶å |
| | |
| | | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.dto.SaveUnionChangeDTO; |
| | | import com.doumee.dao.business.dto.UnionChangeBXDDTO; |
| | | import com.doumee.dao.business.model.UnionChange; |
| | | import java.util.List; |
| | | |
| | |
| | | * @return long |
| | | */ |
| | | long count(UnionChange unionChange); |
| | | |
| | | /** |
| | | * å建åå¹¶åï¼å åä¿/æ¢ååï¼ |
| | | * @param saveUnionChangeDTO |
| | | * @return |
| | | */ |
| | | Integer merge(SaveUnionChangeDTO saveUnionChangeDTO); |
| | | |
| | | /** |
| | | * å
³é åå¹¶åï¼å åä¿/æ¢ååï¼ |
| | | * @param id |
| | | */ |
| | | void cancelMerge(Integer id); |
| | | |
| | | |
| | | /** |
| | | * åå¹¶åï¼å åä¿/æ¢åï¼ - æä¿ç³è¯·ç¾ç½² |
| | | * @param id |
| | | * @return |
| | | */ |
| | | String getSignLink(Integer id); |
| | | |
| | | |
| | | /** |
| | | * åå¹¶å ä¸ä¼ ä¿é©å |
| | | * @param unionChangeBXDDTO |
| | | */ |
| | | void uploadBXD(UnionChangeBXDDTO unionChangeBXDDTO); |
| | | |
| | | |
| | | } |
| | |
| | | ); |
| | | |
| | | update.setFee(totalFee); |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | Constants.ApplyChangeStatus.RETURN_APPLY_SIGNATURE.getKey()) |
| | | // .eq(!Objects.isNull(model.getCompanyId()),InsuranceApply::getCompanyId,model.getCompanyId()) |
| | | // .eq(!Objects.isNull(model.getSolutionsId()),ApplyChange::getSolutionsId,model.getSolutionsId()) |
| | | .eq(!Objects.isNull(model.getType()),Solutions::getType,model.getSolutionType()) |
| | | .eq(!Objects.isNull(model.getSolutionType()),Solutions::getType,model.getSolutionType()) |
| | | .eq(!Objects.isNull(model.getApplyId()),ApplyChange::getApplyId,model.getApplyId()) |
| | | .eq(!Objects.isNull(model.getBaseSolutionsId()),Solutions::getBaseId,model.getBaseSolutionsId()) |
| | | .ge(StringUtils.isNotBlank(model.getCreateDateS()),ApplyChange::getCreateDate, model.getCreateDateS()+" 00:00:00" ) |
| | |
| | | } |
| | | String fileUrl = null; |
| | | if(Constants.equalsObject(model.getType(), Constants.ONE)){ |
| | | fileUrl = ExcelExporter.build(ApplyChange.class).exportChangeUnitExcelToPdf(model,"æ¢åç³è¯·è¡¨"); |
| | | fileUrl = ExcelExporter.build(ApplyChange.class).exportChangeUnitExcelToPdf(model,"æ¢åç³è¯·è¡¨","æä¿ä¼ä¸"); |
| | | }else{ |
| | | fileUrl = ExcelExporter.build(ApplyChange.class).exportJiajianBaoExcelToPdf(model,"å åä¿ç³è¯·è¡¨"); |
| | | fileUrl = ExcelExporter.build(ApplyChange.class).exportJiajianBaoExcelToPdf(model,"å åä¿ç³è¯·è¡¨","æä¿ä¼ä¸"); |
| | | } |
| | | String notifyUrl = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.SIGN_DONE_NOTIFY_URL).getCode(); |
| | | notifyUrl = notifyUrl.replace("${type}","0").replace("${id}",model.getId().toString()); |
| | |
| | | update.setEditDate(new Date()); |
| | | update.setSignApplyNo(applyNo); |
| | | applyChangeMapper.updateById(update); |
| | | |
| | | |
| | | |
| | | return link; |
| | | } |
| | |
| | | return sumPrice.divide(new BigDecimal(sumDays),2, RoundingMode.HALF_UP).multiply(new BigDecimal(optDays)); |
| | | } |
| | | |
| | | public ApplyChange queryApplyChangeData(Integer applyChangeId){ |
| | | ApplyChange model = findDetail(applyChangeId); |
| | | if(Objects.isNull(model) ||! Constants.equalsInteger(Constants.ZERO,model.getIsdeleted())){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | MPJLambdaWrapper<ApplyChagneDetail> queryWrapper = new MPJLambdaWrapper<>(); |
| | | queryWrapper.selectAll(ApplyChagneDetail.class); |
| | | queryWrapper.select("t2.name",ApplyChagneDetail::getWorkTypeName); |
| | | queryWrapper.select("t3.name",ApplyChagneDetail::getDuName); |
| | | queryWrapper.select("t4.name",ApplyChagneDetail::getOldWorkTypeName); |
| | | queryWrapper.select("t5.name",ApplyChagneDetail::getOldDuName); |
| | | queryWrapper.selectAs(Member::getName,ApplyChagneDetail::getMemberName); |
| | | queryWrapper.selectAs(Member::getSex,ApplyChagneDetail::getSex); |
| | | queryWrapper.selectAs(Member::getIdcardNo,ApplyChagneDetail::getMemberIdcardNo); |
| | | queryWrapper.leftJoin(Member.class,Member::getId,ApplyChagneDetail::getMemberId); |
| | | queryWrapper.leftJoin(Worktype.class,Worktype::getId,ApplyChagneDetail::getWorktypeId); |
| | | queryWrapper.leftJoin(DispatchUnit.class,DispatchUnit::getId,ApplyChagneDetail::getDuId); |
| | | queryWrapper.leftJoin(Worktype.class,Worktype::getId,ApplyChagneDetail::getOldWorktypeId); |
| | | queryWrapper.leftJoin(DispatchUnit.class,DispatchUnit::getId,ApplyChagneDetail::getOldDuId); |
| | | queryWrapper.eq(ApplyChagneDetail::getApplyChangeId,applyChangeId); |
| | | List<ApplyChagneDetail> list = applyChangeDetailJoinMapper.selectJoinList(ApplyChagneDetail.class, queryWrapper); |
| | | for (ApplyChagneDetail applyChagneDetail:list) { |
| | | applyChagneDetail.setAge(Constants.getAgeByIdCard(applyChagneDetail.getMemberIdcardNo())); |
| | | } |
| | | if(CollectionUtils.isNotEmpty(list)){ |
| | | model.setAddDetailList(list.stream().filter(m->m.getType().equals(Constants.ZERO)).collect(Collectors.toList())); |
| | | model.setDelDetailList(list.stream().filter(m->m.getType().equals(Constants.ONE)).collect(Collectors.toList())); |
| | | model.setChangeDetailList(list.stream().filter(m->m.getType().equals(Constants.TWO)).collect(Collectors.toList())); |
| | | } |
| | | return model; |
| | | } |
| | | |
| | | /** |
| | | * 人åååç¾ç« |
| | | */ |
| | | @Override |
| | | public String getChangeMemberListOnlineSignLink(Integer applyChangeId) { |
| | | ApplyChange model = this.queryApplyChangeData(applyChangeId); |
| | | if(Objects.isNull(model)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æªæ¥è¯¢å åä¿ä¿¡æ¯"); |
| | | } |
| | | if(Objects.isNull(model) ||! Constants.equalsInteger(Constants.ZERO,model.getIsdeleted())){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(!Constants.equalsInteger(Constants.ZERO,model.getStatus())){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对ä¸èµ·ï¼è¯¥ç³è¯·ç¶æå·²æµè½¬ï¼å½å䏿¯æç¾ç« æä½ï¼"); |
| | | } |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | Company company = user.getCompany(); |
| | | if(debugModel){ |
| | | company = companyMapper.selectById(model.getCompanyId()); |
| | | } |
| | | if(company== null || StringUtils.isBlank( company.getEmail()) || !Constants.equalsInteger(company.getSignStatus(),Constants.THREE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对ä¸èµ·ï¼ä¼ä¸å°æªå
·å¤å¨çº¿ç¾ç« æ¡ä»¶ï¼è¯·è系平å°ç®¡çå确认~"); |
| | | } |
| | | Solutions solutions = solutionsMapper.selectById(model.getSolutionsId()); |
| | | if(Objects.isNull(solutions)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æªæ¥è¯¢æ¹æ¡ä¿¡æ¯"); |
| | | } |
| | | if(solutions.getType().equals(Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对ä¸èµ·ï¼éå§æä¿æ¹æ¡ä¿åï¼æ æ³è¿è¡è¯¥æä½!"); |
| | | } |
| | | String fileUrl = null; |
| | | if(Constants.equalsObject(model.getType(), Constants.ONE)){ |
| | | fileUrl = ExcelExporter.build(ApplyChange.class).exportChangeUnitExcelToPdf(model,"æ¢åç³è¯·è¡¨","被ä¿é©äºº"); |
| | | }else{ |
| | | fileUrl = ExcelExporter.build(ApplyChange.class).exportJiajianBaoExcelToPdf(model,"å åä¿ç³è¯·è¡¨","被ä¿é©äºº"); |
| | | } |
| | | String notifyUrl = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.SIGN_DONE_NOTIFY_URL).getCode(); |
| | | notifyUrl = notifyUrl.replace("${type}","0").replace("${id}",model.getId().toString()); |
| | | String applyNo = signService.applySignLocalFile(company.getName(),company.getName(),fileUrl,company.getCode(),company.getEmail(),"人åååç¾ç« ",company.getSignId(),notifyUrl); |
| | | if(StringUtils.isBlank(applyNo) ){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对ä¸èµ·ï¼è·åå¨çº¿ç¾ç« å°å失败ï¼è¯·ç¨åéè¯ï¼"); |
| | | } |
| | | String link = signService.signLink(applyNo,company.getName(),company.getCode()); |
| | | if(StringUtils.isBlank(link) ){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对ä¸èµ·ï¼è·åå¨çº¿ç¾ç« å°å失败ï¼è¯·ç¨åéè¯ï¼"); |
| | | } |
| | | ApplyChange update= new ApplyChange(); |
| | | update.setId(model.getId()); |
| | | update.setEditor(user.getId()); |
| | | update.setEditDate(new Date()); |
| | | update.setSignMemberListNo(applyNo); |
| | | applyChangeMapper.updateById(update); |
| | | return link; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | |
| | | |
| | | @Autowired |
| | | private NoticesMapper noticesMapper; |
| | | @Autowired |
| | | private UnionApplyJoinMapper unionApplyJoinMapper; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public String getSignLink(Integer id) { |
| | | if(id == null ){ |
| | |
| | | update.setEditDate(new Date()); |
| | | update.setSignApplyNo(applyNo); |
| | | insuranceApplyMapper.updateById(update); |
| | | |
| | | return link; |
| | | } |
| | | |
| | | |
| | | public String uploadSignFile(String link){ |
| | | try { |
| | | String bucketName = systemDictDataBiz.queryByCode(Constants.OSS,Constants.BUCKETNAME).getCode(); |
| | |
| | | |
| | | startSendEmail(f, model.getCompanyName(),model.getSolutionsName(),model.getSolutionEmail()); |
| | | return f; |
| | | |
| | | } |
| | | |
| | | /** |
| | | * å§æä¿ æ¹æ¡ç¡®è®¤ä¹¦ï¼ä¼ä¸ï¼ |
| | | * @param model |
| | | * @param fileurl |
| | | * @param fullUrl |
| | | * @return |
| | | */ |
| | | public Multifile uploadFAQRSSignedFileDo(InsuranceApply model,String fileurl,String fullUrl) { |
| | | InsuranceApply update = new InsuranceApply(); |
| | | update.setEditDate(new Date()); |
| | | update.setEditor(model.getCreator()); |
| | | update.setStatus(Constants.InsuranceApplyStatus.COMPANY_APPLY_SIGNATURE.getKey()); |
| | | update.setCheckDate(update.getEditDate()); |
| | | update.setCheckInfo("ä¼ä¸å®æç¾ç½²æ¹æ¡ç¡®è®¤ä¹¦"); |
| | | update.setCheckUserId(model.getCreator()); |
| | | update.setId(model.getId()); |
| | | insuranceApplyMapper.updateById(update); |
| | | |
| | | Multifile f = new Multifile(); |
| | | f.setIsdeleted(Constants.ZERO); |
| | | f.setCreator(model.getCreator()); |
| | | f.setObjId(update.getId()); |
| | | f.setCreateDate(update.getEditDate()); |
| | | f.setObjType(Constants.MultiFile.SOLUTIONS_CONFIRMATION_LATTER.getKey()); |
| | | f.setType(Constants.TWO); |
| | | f.setFileurl(fileurl); |
| | | f.setFileurlFull(fullUrl); |
| | | f.setInfo("ä¼ä¸å®æç¾ç½²æ¹æ¡ç¡®è®¤ä¹¦"); |
| | | f.setName("æ¹æ¡ç¡®è®¤ä¹¦.pdf"); |
| | | multifileMapper.insert(f); |
| | | return f; |
| | | } |
| | | |
| | | /** |
| | | * å§æä¿ ä¼ä¸ç¾ç½² 人ååå |
| | | * @param model |
| | | * @param fileurl |
| | | * @param fullUrl |
| | | * @return |
| | | */ |
| | | public Multifile uploadApplyMemberListSignedFileDo(InsuranceApply model,String fileurl,String fullUrl) { |
| | | InsuranceApply update = new InsuranceApply(); |
| | | update.setEditDate(new Date()); |
| | | update.setEditor(model.getCreator()); |
| | | update.setStatus(Constants.InsuranceApplyStatus.COMPANY_MEMBER_LIST_SIGNATURE.getKey()); |
| | | update.setCheckDate(update.getEditDate()); |
| | | update.setCheckInfo("ä¼ä¸å®æç¾ç½²äººååå"); |
| | | update.setCheckUserId(model.getCreator()); |
| | | update.setId(model.getId()); |
| | | insuranceApplyMapper.updateById(update); |
| | | |
| | | Multifile f = new Multifile(); |
| | | f.setIsdeleted(Constants.ZERO); |
| | | f.setCreator(model.getCreator()); |
| | | f.setObjId(update.getId()); |
| | | f.setCreateDate(update.getEditDate()); |
| | | f.setObjType(Constants.MultiFile.MEMBER_LIST_LATTER.getKey()); |
| | | f.setType(Constants.TWO); |
| | | f.setFileurl(fileurl); |
| | | f.setFileurlFull(fullUrl); |
| | | f.setInfo("ä¼ä¸å®æç¾ç½²äººååå"); |
| | | f.setName("人ååå.pdf"); |
| | | multifileMapper.insert(f); |
| | | return f; |
| | | } |
| | | |
| | | |
| | | public Multifile uploadChangeSignedFileDo(ApplyChange model,String fileurl,String fullurl) { |
| | | Integer companyId = model.getCompanyId(); |
| | | ApplyChange update = new ApplyChange(); |
| | |
| | | |
| | | startSendEmail(f,model.getCompanyName(),model.getSolutionsName(),model.getSolutionEmail()); |
| | | return f; |
| | | } |
| | | |
| | | |
| | | public Multifile uploadChangeMemberListSignedFileDo(ApplyChange model,String fileurl,String fullurl) { |
| | | ApplyChange update = new ApplyChange(); |
| | | update.setEditDate(new Date()); |
| | | update.setEditor(model.getCreator()); |
| | | update.setStatus(Constants.ApplyChangeStatus.COMPANY_SIGN.getKey()); |
| | | update.setCheckDate(update.getEditDate()); |
| | | update.setCheckInfo("ä¼ä¸å®æç¾ç½²äººååå"); |
| | | update.setCheckUserId(model.getCreator()); |
| | | update.setId(model.getId()); |
| | | applyChangeMapper.updateById(update); |
| | | |
| | | Multifile f = new Multifile(); |
| | | f.setIsdeleted(Constants.ZERO); |
| | | f.setCreator(model.getCreator()); |
| | | f.setObjId(update.getId()); |
| | | f.setCreateDate(update.getEditDate()); |
| | | f.setObjType(Constants.MultiFile.CHANGE_MEMBER_LIST_LATTER.getKey()); |
| | | f.setType(Constants.TWO); |
| | | f.setFileurl(fileurl); |
| | | f.setFileurlFull(fullurl); |
| | | f.setInfo("ä¼ä¸å®æç¾ç½²äººååå"); |
| | | f.setName("ç¾ç« 人ååå.pdf"); |
| | | multifileMapper.insert(f); |
| | | |
| | | return f; |
| | | } |
| | | |
| | | /** |
| | | * åæ·åå¹¶å åæ·ç¾ç½²æä¿ç³è¯·å |
| | | * @param model |
| | | * @param fileurl |
| | | * @param fullUrl |
| | | * @return |
| | | */ |
| | | public Multifile uploadUnionApplySignedFileDo(UnionApply model,String fileurl,String fullUrl) { |
| | | UnionApply update = new UnionApply(); |
| | | update.setEditDate(new Date()); |
| | | update.setEditor(model.getCreator()); |
| | | update.setStatus(Constants.UnionApplyStatus.UPLOAD_INSURANCE_POLICY.getKey()); |
| | | update.setCheckDate(update.getEditDate()); |
| | | update.setCheckInfo("忷宿ç¾ç½²"); |
| | | update.setCheckUserId(model.getCreator()); |
| | | update.setId(model.getId()); |
| | | unionApplyJoinMapper.updateById(update); |
| | | |
| | | //åå¨å¾
åä¿¡æ¯ |
| | | // Constants.NoticeObjectType noticeObjectType = Constants.NoticeObjectType.INSURANCE_APPLY; |
| | | // //å é¤å
¶ä»å¾
å |
| | | // noticesMapper.delete(new QueryWrapper<Notices>().lambda().eq(Notices::getObjType,noticeObjectType.getKey()) |
| | | // .ne(Notices::getType,Constants.NoticeType.SIX.getStatus()) |
| | | // .eq(Notices::getObjId,model.getId())); |
| | | // Notices notices = new Notices(noticeObjectType,Constants.ZERO,model.getId(),model.getSolutionsName(),model.getCompanyId(),Constants.NoticeType.TWO); |
| | | // noticesMapper.insert(notices); |
| | | |
| | | Multifile f = new Multifile(); |
| | | f.setIsdeleted(Constants.ZERO); |
| | | f.setCreator(model.getCreator()); |
| | | f.setObjId(update.getId()); |
| | | f.setCreateDate(update.getEditDate()); |
| | | f.setObjType(Constants.MultiFile.HBD_BD_APPLY_PDF.getKey()); |
| | | f.setType(Constants.TWO); |
| | | f.setFileurl(fileurl); |
| | | f.setFileurlFull(fullUrl); |
| | | f.setInfo("åæ·ç¾ç½²æä¿å"); |
| | | f.setName("åæ·ç¾ç½²æä¿å.pdf"); |
| | | multifileMapper.insert(f); |
| | | // Constants.ApplyLogType applyLogType = Constants.ApplyLogType.SIGNATURE; |
| | | // ApplyLog log = new ApplyLog(update,applyLogType.getName(), null,update.getId(),applyLogType.getKey(),JSONObject.toJSONString(model), JSONObject.toJSONString(update)); |
| | | // applyLogMapper.insert(log); |
| | | // |
| | | // startSendEmail(f, model.getCompanyName(),model.getSolutionsName(),model.getSolutionEmail()); |
| | | return f; |
| | | } |
| | | |
| | | private void startSendEmail(Multifile f, String companyName, String solutionsName, String solutionEmail) { |
| | |
| | | |
| | | @Override |
| | | public void dealWaitSignedData(){ |
| | | String path = systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode()+ |
| | | systemDictDataBiz.queryByCode(Constants.OSS,Constants.APPLY_FILE).getCode(); |
| | | //ç´ä¿ä¿å ä¼ä¸ç¾ç« æ°æ®å¤ç |
| | | List<InsuranceApply> applyList = insuranceApplyJoinMapper.selectJoinList(InsuranceApply.class, |
| | | new MPJLambdaWrapper<InsuranceApply>() |
| | | .selectAll(InsuranceApply.class) |
| | |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId) |
| | | .eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.WAIT_SIGNATURE.getKey()) |
| | | .eq(Solutions::getType,Constants.ZERO) |
| | | .isNotNull(InsuranceApply::getSignApplyNo)); |
| | | String path = systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode()+ |
| | | systemDictDataBiz.queryByCode(Constants.OSS,Constants.APPLY_FILE).getCode(); |
| | | if(applyList !=null && applyList.size()>0 ){ |
| | | for(InsuranceApply model : applyList){ |
| | | String status = signService.linkFileStatus(model.getSignApplyNo()); |
| | |
| | | return; |
| | | } |
| | | } |
| | | //å§æä¿ ä¼ä¸ç¾ç½²æä¿ç¡®è®¤ä¹¦ |
| | | applyList = insuranceApplyJoinMapper.selectJoinList(InsuranceApply.class, |
| | | new MPJLambdaWrapper<InsuranceApply>() |
| | | .selectAll(InsuranceApply.class) |
| | | .selectAs(Solutions::getName,InsuranceApply::getSolutionsName) |
| | | .selectAs(Solutions::getEmail,InsuranceApply::getSolutionEmail) |
| | | .selectAs(Company::getName,InsuranceApply::getCompanyName) |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId) |
| | | .eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD.getKey()) |
| | | .eq(Solutions::getType,Constants.ONE) |
| | | .isNotNull(InsuranceApply::getSignQrsNo)); |
| | | if(applyList !=null && applyList.size()>0 ){ |
| | | for(InsuranceApply model : applyList){ |
| | | String status = signService.linkFileStatus(model.getSignQrsNo()); |
| | | if(!StringUtils.equals(status,"3")){ |
| | | continue; |
| | | } |
| | | String link = signService.linkFile(model.getSignQrsNo()); |
| | | String fileUrl = uploadSignFile(link); |
| | | if(StringUtils.isBlank(fileUrl)){ |
| | | //妿ä¸è½½å¤±è´¥ï¼æ¸
é¤ååï¼ä¸æ¬¡ç¾ç« éæ°çææ°åå |
| | | return; |
| | | } |
| | | uploadFAQRSSignedFileDo(model,fileUrl,path+fileUrl); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | //å§æä¿ ä¼ä¸ç¾ç½²äººååå |
| | | applyList = insuranceApplyJoinMapper.selectJoinList(InsuranceApply.class, |
| | | new MPJLambdaWrapper<InsuranceApply>() |
| | | .selectAll(InsuranceApply.class) |
| | | .selectAs(Solutions::getName,InsuranceApply::getSolutionsName) |
| | | .selectAs(Solutions::getEmail,InsuranceApply::getSolutionEmail) |
| | | .selectAs(Company::getName,InsuranceApply::getCompanyName) |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId) |
| | | .eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.COMPANY_APPLY_SIGNATURE.getKey()) |
| | | .eq(Solutions::getType,Constants.ONE) |
| | | .isNotNull(InsuranceApply::getSignMemberListNo)); |
| | | if(applyList !=null && applyList.size()>0 ){ |
| | | for(InsuranceApply model : applyList){ |
| | | String status = signService.linkFileStatus(model.getSignMemberListNo()); |
| | | if(!StringUtils.equals(status,"3")){ |
| | | continue; |
| | | } |
| | | String link = signService.linkFile(model.getSignMemberListNo()); |
| | | String fileUrl = uploadSignFile(link); |
| | | if(StringUtils.isBlank(fileUrl)){ |
| | | //妿ä¸è½½å¤±è´¥ï¼æ¸
é¤ååï¼ä¸æ¬¡ç¾ç« éæ°çææ°åå |
| | | return; |
| | | } |
| | | uploadApplyMemberListSignedFileDo(model,fileUrl,path+fileUrl); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | List<ApplyChange> chagneList = applyChangeMapper.selectJoinList(ApplyChange.class, |
| | | new MPJLambdaWrapper<ApplyChange>() |
| | | .selectAll(ApplyChange.class) |
| | |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId) |
| | | .eq(ApplyChange::getStatus,Constants.ApplyChangeStatus.UPLOAD.getKey()) |
| | | .eq(Solutions::getType,Constants.ZERO) |
| | | .isNotNull(ApplyChange::getSignApplyNo)); |
| | | if(chagneList !=null && chagneList.size()>0 ){ |
| | | for(ApplyChange model : chagneList){ |
| | |
| | | return; |
| | | } |
| | | } |
| | | |
| | | chagneList = applyChangeMapper.selectJoinList(ApplyChange.class, |
| | | new MPJLambdaWrapper<ApplyChange>() |
| | | .selectAll(ApplyChange.class) |
| | | .selectAs(Solutions::getName,InsuranceApply::getSolutionsName) |
| | | .selectAs(Solutions::getEmail,InsuranceApply::getSolutionEmail) |
| | | .selectAs(Company::getName,InsuranceApply::getCompanyName) |
| | | .selectAs(InsuranceApply::getCompanyId,ApplyChange::getCompanyId) |
| | | .leftJoin(InsuranceApply.class,InsuranceApply::getId,ApplyChange::getApplyId) |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId) |
| | | .eq(ApplyChange::getStatus,Constants.ApplyChangeStatus.UPLOAD.getKey()) |
| | | .eq(Solutions::getType,Constants.ONE) |
| | | .isNotNull(ApplyChange::getSignMemberListNo)); |
| | | if(chagneList !=null && chagneList.size()>0 ){ |
| | | for(ApplyChange model : chagneList){ |
| | | String status = signService.linkFileStatus(model.getSignMemberListNo()); |
| | | if(!StringUtils.equals(status,"3")){ |
| | | continue; |
| | | } |
| | | String link = signService.linkFile(model.getSignMemberListNo()); |
| | | String fileUrl = uploadSignFile(link); |
| | | if(StringUtils.isBlank(fileUrl)){ |
| | | //妿ä¸è½½å¤±è´¥ï¼æ¸
é¤ååï¼ä¸æ¬¡ç¾ç« éæ°çææ°åå |
| | | return; |
| | | } |
| | | uploadChangeMemberListSignedFileDo(model,fileUrl,path+fileUrl); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | *åå¹¶æä¿å ç¾ç½²ä¸å¡ |
| | | */ |
| | | List<UnionApply> unionApplyList = unionApplyJoinMapper.selectJoinList(UnionApply.class, |
| | | new MPJLambdaWrapper<UnionApply>() |
| | | .selectAll(UnionApply.class) |
| | | .eq(UnionApply::getStatus,Constants.UnionApplyStatus.WAIT_SIGNATURE.getKey()) |
| | | .isNotNull(UnionApply::getSignApplyNo)); |
| | | if(unionApplyList !=null && unionApplyList.size()>0 ){ |
| | | for(UnionApply model : unionApplyList){ |
| | | String status = signService.linkFileStatus(model.getSignApplyNo()); |
| | | if(!StringUtils.equals(status,"3")){ |
| | | continue; |
| | | } |
| | | String link = signService.linkFile(model.getSignApplyNo()); |
| | | String fileUrl = uploadSignFile(link); |
| | | if(StringUtils.isBlank(fileUrl)){ |
| | | //妿ä¸è½½å¤±è´¥ï¼æ¸
é¤ååï¼ä¸æ¬¡ç¾ç« éæ°çææ°åå |
| | | return; |
| | | } |
| | | uploadUnionApplySignedFileDo(model,fileUrl,path+fileUrl); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | } |
| | | @Override |
| | | public void dealSignResult(NotifyDataReq data){ |
| | |
| | | //妿已ä¿å
¨,å¯ä¸è½½ç¾çº¦éä»¶ |
| | | String path = systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode()+ |
| | | systemDictDataBiz.queryByCode(Constants.OSS,Constants.APPLY_FILE).getCode(); |
| | | //ç´ä¿ æä¿ç³è¯· |
| | | InsuranceApply model = insuranceApplyJoinMapper.selectJoinOne(InsuranceApply.class, |
| | | new MPJLambdaWrapper<InsuranceApply>() |
| | | .selectAll(InsuranceApply.class) |
| | |
| | | .selectAs(Company::getName,InsuranceApply::getCompanyName) |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId) |
| | | .eq(Solutions::getType,Constants.ZERO) |
| | | .eq(InsuranceApply::getSignApplyNo,data.getApplyNo()) |
| | | .last("limit 1" )); |
| | | if(model != null && Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.WAIT_SIGNATURE.getKey())){ |
| | |
| | | uploadSignedFileDo(model,fileUrl,path+fileUrl); |
| | | return; |
| | | } |
| | | //å§æä¿ ä¼ä¸æ¹æ¡ç¡®è®¤ä¹¦ |
| | | InsuranceApply modelTBQRS = insuranceApplyJoinMapper.selectJoinOne(InsuranceApply.class, |
| | | new MPJLambdaWrapper<InsuranceApply>() |
| | | .selectAll(InsuranceApply.class) |
| | | .selectAs(Solutions::getName,InsuranceApply::getSolutionsName) |
| | | .selectAs(Solutions::getEmail,InsuranceApply::getSolutionEmail) |
| | | .selectAs(Company::getName,InsuranceApply::getCompanyName) |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId) |
| | | .eq(Solutions::getType,Constants.ONE) |
| | | .eq(InsuranceApply::getSignQrsNo,data.getApplyNo()) |
| | | .last("limit 1" )); |
| | | if(modelTBQRS != null && Constants.equalsInteger(modelTBQRS.getStatus(),Constants.InsuranceApplyStatus.UPLOAD.getKey())){ |
| | | //宿ç¾ç½²å·²å®ææä½ |
| | | String link = signService.linkFile(data.getApplyNo()); |
| | | String fileUrl = uploadSignFile(link); |
| | | if(StringUtils.isBlank(fileUrl)){ |
| | | //妿ä¸è½½å¤±è´¥ï¼æ¸
é¤ååï¼ä¸æ¬¡ç¾ç« éæ°çææ°åå |
| | | return; |
| | | } |
| | | uploadFAQRSSignedFileDo(modelTBQRS,fileUrl,path+fileUrl); |
| | | return; |
| | | } |
| | | //å§æä¿ ä¼ä¸ç¾ç½²äººååå |
| | | InsuranceApply modelMemberList = insuranceApplyJoinMapper.selectJoinOne(InsuranceApply.class, |
| | | new MPJLambdaWrapper<InsuranceApply>() |
| | | .selectAll(InsuranceApply.class) |
| | | .selectAs(Solutions::getName,InsuranceApply::getSolutionsName) |
| | | .selectAs(Solutions::getEmail,InsuranceApply::getSolutionEmail) |
| | | .selectAs(Company::getName,InsuranceApply::getCompanyName) |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId) |
| | | .eq(Solutions::getType,Constants.ONE) |
| | | .eq(InsuranceApply::getSignMemberListNo,data.getApplyNo()) |
| | | .last("limit 1" )); |
| | | if(modelMemberList != null && Constants.equalsInteger(modelMemberList.getStatus(),Constants.InsuranceApplyStatus.COMPANY_APPLY_SIGNATURE.getKey())){ |
| | | //宿ç¾ç½²å·²å®ææä½ |
| | | String link = signService.linkFile(data.getApplyNo()); |
| | | String fileUrl = uploadSignFile(link); |
| | | if(StringUtils.isBlank(fileUrl)){ |
| | | //妿ä¸è½½å¤±è´¥ï¼æ¸
é¤ååï¼ä¸æ¬¡ç¾ç« éæ°çææ°åå |
| | | return; |
| | | } |
| | | uploadApplyMemberListSignedFileDo(modelMemberList,fileUrl,path+fileUrl); |
| | | return; |
| | | } |
| | | |
| | | //ç´ä¿ å åä¿ä¼ä¸ç¾ç½² |
| | | ApplyChange applyChange = applyChangeMapper.selectJoinOne(ApplyChange.class, |
| | | new MPJLambdaWrapper<ApplyChange>() |
| | | .selectAll(ApplyChange.class) |
| | |
| | | .leftJoin(InsuranceApply.class,InsuranceApply::getId,ApplyChange::getApplyId) |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId) |
| | | .eq(Solutions::getType,Constants.ZERO) |
| | | .eq(ApplyChange::getSignApplyNo,data.getApplyNo()).last("limit 1" )); |
| | | if(applyChange != null &&Constants.equalsInteger(applyChange.getStatus(),Constants.ApplyChangeStatus.UPLOAD.getKey())){ |
| | | String link = signService.linkFile(data.getApplyNo()); |
| | |
| | | } |
| | | uploadChangeSignedFileDo(applyChange,fileUrl,path+fileUrl); |
| | | } |
| | | |
| | | //å§æä¿ å åä¿ä¼ä¸ç¾ç½² |
| | | ApplyChange applyChangeMemberList = applyChangeMapper.selectJoinOne(ApplyChange.class, |
| | | new MPJLambdaWrapper<ApplyChange>() |
| | | .selectAll(ApplyChange.class) |
| | | .selectAs(Solutions::getName,InsuranceApply::getSolutionsName) |
| | | .selectAs(Solutions::getEmail,InsuranceApply::getSolutionEmail) |
| | | .selectAs(Company::getName,InsuranceApply::getCompanyName) |
| | | .selectAs(InsuranceApply::getCompanyId,ApplyChange::getCompanyId) |
| | | .leftJoin(InsuranceApply.class,InsuranceApply::getId,ApplyChange::getApplyId) |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId) |
| | | .eq(Solutions::getType,Constants.ONE) |
| | | .eq(ApplyChange::getSignMemberListNo,data.getApplyNo()).last("limit 1" )); |
| | | if(applyChangeMemberList != null &&Constants.equalsInteger(applyChangeMemberList.getStatus(),Constants.ApplyChangeStatus.UPLOAD.getKey())){ |
| | | String link = signService.linkFile(data.getApplyNo()); |
| | | String fileUrl = uploadSignFile(link); |
| | | if(StringUtils.isBlank(fileUrl)){ |
| | | //妿ä¸è½½å¤±è´¥ï¼æ¸
é¤ååï¼ä¸æ¬¡ç¾ç« éæ°çææ°åå |
| | | return; |
| | | } |
| | | uploadChangeMemberListSignedFileDo(applyChangeMemberList,fileUrl,path+fileUrl); |
| | | } |
| | | |
| | | |
| | | //æä¿åå¹¶å åæ·ç¾ç½²ä¿å |
| | | UnionApply unionApply = unionApplyJoinMapper.selectOne(new QueryWrapper<UnionApply>() |
| | | .lambda().eq(UnionApply::getSignApplyNo,data.getApplyNo()).last(" limit 1 ")); |
| | | if(unionApply != null &&Constants.equalsInteger(unionApply.getStatus(),Constants.UnionApplyStatus.WAIT_SIGNATURE.getKey())){ |
| | | String link = signService.linkFile(data.getApplyNo()); |
| | | String fileUrl = uploadSignFile(link); |
| | | if(StringUtils.isBlank(fileUrl)){ |
| | | //妿ä¸è½½å¤±è´¥ï¼æ¸
é¤ååï¼ä¸æ¬¡ç¾ç« éæ°çææ°åå |
| | | return; |
| | | } |
| | | uploadUnionApplySignedFileDo(unionApply,fileUrl,path+fileUrl); |
| | | } |
| | | }else if(Constants.equalsInteger(data.getSignStatus(), Constants.TWO )){ |
| | | //妿已æç¾ï¼æ¸
é¤ååï¼ä¸æ¬¡ç¾ç« éæ°çææ°åå |
| | | insuranceApplyMapper.update(null,new UpdateWrapper<InsuranceApply>().lambda() |
| | | .set(InsuranceApply::getSignApplyNo,null) |
| | | .eq(InsuranceApply::getSignApplyNo,data.getApplyNo())); |
| | | //妿已æç¾ï¼æ¸
é¤ååï¼ä¸æ¬¡ç¾ç« éæ°çææ°åå |
| | | applyChangeMapper.update(null,new UpdateWrapper<ApplyChange>().lambda() |
| | | .set(ApplyChange::getSignApplyNo,null) |
| | | .eq(ApplyChange::getSignApplyNo,data.getApplyNo())); |
| | | insuranceApplyMapper.update(null,new UpdateWrapper<InsuranceApply>().lambda() |
| | | .set(InsuranceApply::getSignQrsNo,null) |
| | | .eq(InsuranceApply::getSignQrsNo,data.getApplyNo())); |
| | | insuranceApplyMapper.update(null,new UpdateWrapper<InsuranceApply>().lambda() |
| | | .set(InsuranceApply::getSignMemberListNo,null) |
| | | .eq(InsuranceApply::getSignMemberListNo,data.getApplyNo())); |
| | | unionApplyJoinMapper.update(null,new UpdateWrapper<UnionApply>().lambda() |
| | | .set(UnionApply::getSignApplyNo,null) |
| | | .eq(UnionApply::getSignApplyNo,data.getApplyNo())); |
| | | applyChangeMapper.update(null,new UpdateWrapper<ApplyChange>().lambda() |
| | | .set(ApplyChange::getSignMemberListNo,null) |
| | | .eq(ApplyChange::getSignMemberListNo,data.getApplyNo())); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | | public Integer uploadToubaodan(InsuranceApply insuranceApply) { |
| | |
| | | Notices notices = new Notices(noticeObjectType,Constants.ONE,model.getId(),solutions.getName(), |
| | | model.getCompanyId(), Constants.NoticeType.ONE); |
| | | noticesMapper.insert(notices); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | |
| | |
| | | .selectAs(Solutions::getTimeUnit,InsuranceApply::getTimeUnit) |
| | | .selectAs(Solutions::getType,InsuranceApply::getSolutionType) |
| | | .selectAs(Solutions::getName,InsuranceApply::getSolutionsName) |
| | | .selectAs(Solutions::getName,InsuranceApply::getShopName) |
| | | .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") |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId) |
| | | .leftJoin(Company.class,Company::getId,Solutions::getShopId) |
| | | .eq(InsuranceApply::getId,id) |
| | | .last("limit 1"); |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å§æå® æä¿ç¡®è®¤ä¹¦ |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public String getSignTBQRSLink(Integer id) { |
| | | if(id == null ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | MPJLambdaWrapper wrapper= new MPJLambdaWrapper<InsuranceApply>() |
| | | .selectAll(InsuranceApply.class) |
| | | .selectAs(Solutions::getSignKeyword,InsuranceApply::getSignKeyword) |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .eq(InsuranceApply::getId,id) |
| | | .last("limit 1"); |
| | | |
| | | InsuranceApply model = insuranceApplyJoinMapper.selectJoinOne(InsuranceApply.class,wrapper); |
| | | if(model == null ||!Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | Solutions solutions = solutionsMapper.selectById(model.getSolutionId()); |
| | | if(Objects.isNull(solutions)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æªæ¥è¯¢æ¹æ¡ä¿¡æ¯"); |
| | | } |
| | | if(solutions.getType().equals(Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对ä¸èµ·ï¼éå§æä¿æ¹æ¡ä¿å!"); |
| | | } |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | Constants.ApplyLogType applyLogType = null; |
| | | String info = ""; |
| | | //妿æ¯é©³å,åªè½å¯é©³åå·²ç¾ç« ç¶æä¸çéåç³è¯·ç¶æè¿è¡æä½ |
| | | if(!Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.UPLOAD.getKey())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对ä¸èµ·ï¼è¯¥ç³è¯·ç¶æå·²æµè½¬ï¼å½å䏿¯æè¯¥æä½~"); |
| | | } |
| | | Company company = user.getCompany(); |
| | | if(debugModel){ |
| | | company = companyMapper.selectById(model.getCompanyId()); |
| | | } |
| | | if(company== null || StringUtils.isBlank( company.getEmail()) || !Constants.equalsInteger(company.getSignStatus(),Constants.THREE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对ä¸èµ·ï¼ä¼ä¸å°æªå
·å¤å¨çº¿ç¾ç« æ¡ä»¶ï¼è¯·è系平å°ç®¡çå确认~"); |
| | | } |
| | | Multifile f = multifileMapper.selectOne(new QueryWrapper<Multifile>().lambda() |
| | | .eq(Multifile::getObjId,solutions.getId()) |
| | | .eq(Multifile::getObjType,Constants.MultiFile.SOLUTIONS_CONFIRMATION_LATTER.getKey()) |
| | | .eq(Multifile::getIsdeleted,Constants.ZERO).last("limit 1")); |
| | | if(f == null || StringUtils.isBlank(f.getFileurl())){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对ä¸èµ·ï¼è·å确认书æä»¶å¤±è´¥ï¼è¯·èç³»åæ·ç¡®è®¤æä¿ç¡®è®¤ä¹¦æ¯å¦æ£ç¡®ï¼"); |
| | | } |
| | | String url = systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode()+systemDictDataBiz.queryByCode(Constants.OSS,Constants.APPLY_FILE).getCode()+f.getFileurl(); |
| | | String notifyUrl = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.SIGN_DONE_NOTIFY_URL).getCode(); |
| | | notifyUrl = notifyUrl.replace("${type}","0").replace("${id}",model.getId().toString()); |
| | | String applyNo = signService.applySign(company.getName(),url,company.getName(),company.getCode(),company.getEmail(),model.getSignKeyword(),company.getSignId(),notifyUrl); |
| | | if(StringUtils.isBlank(applyNo) ){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对ä¸èµ·ï¼è·åå¨çº¿ç¾ç« å°å失败ï¼è¯·ç¨åéè¯ï¼"); |
| | | } |
| | | String link = signService.signLink(applyNo,company.getName(),company.getCode()); |
| | | if(StringUtils.isBlank(link) ){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对ä¸èµ·ï¼è·åå¨çº¿ç¾ç« å°å失败ï¼è¯·ç¨åéè¯ï¼"); |
| | | } |
| | | InsuranceApply update= new InsuranceApply(); |
| | | update.setId(model.getId()); |
| | | update.setEditor(user.getId()); |
| | | update.setEditDate(new Date()); |
| | | update.setSignQrsNo(applyNo); |
| | | insuranceApplyMapper.updateById(update); |
| | | return link; |
| | | } |
| | | |
| | | @Override |
| | | public InsuranceApply queryApplyDetail(Integer applyId){ |
| | | InsuranceApply model = findDetail(applyId); |
| | | if(Objects.isNull(model) ||! Constants.equalsInteger(Constants.ZERO,model.getIsdeleted())){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | //æ¥è¯¢ä¿åæç»ä¿¡æ¯ |
| | | List<ApplyDetail> applyDetailList = applyDetailJoinMapper.selectJoinList(ApplyDetail.class,new MPJLambdaWrapper<ApplyDetail>() |
| | | .selectAll(ApplyDetail.class) |
| | | .selectAs(Worktype::getName,ApplyDetail::getWorkTypeName) |
| | | .selectAs(DispatchUnit::getName,ApplyDetail::getDuName) |
| | | .leftJoin(Worktype.class,Worktype::getId,ApplyDetail::getWorktypeId) |
| | | .leftJoin(DispatchUnit.class,DispatchUnit::getId,ApplyDetail::getDuId) |
| | | .isNull(ApplyDetail::getFromId) |
| | | .eq(ApplyDetail::getId,model.getId()) |
| | | ); |
| | | model.setApplyDetailList(applyDetailList); |
| | | return model; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 人åååç¾ç« |
| | | */ |
| | | @Override |
| | | public String getMemberListOnlineSignLink(Integer applyId) { |
| | | InsuranceApply model = this.queryApplyDetail(applyId); |
| | | if(Objects.isNull(model)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æªæ¥è¯¢ä¿åä¿¡æ¯"); |
| | | } |
| | | if(Objects.isNull(model) ||! Constants.equalsInteger(Constants.ZERO,model.getIsdeleted())){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(!Constants.equalsInteger(Constants.ZERO,model.getStatus())){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对ä¸èµ·ï¼è¯¥ç³è¯·ç¶æå·²æµè½¬ï¼å½å䏿¯æç¾ç« æä½ï¼"); |
| | | } |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | Company company = user.getCompany(); |
| | | if(debugModel){ |
| | | company = companyMapper.selectById(model.getCompanyId()); |
| | | } |
| | | if(company== null || StringUtils.isBlank( company.getEmail()) || !Constants.equalsInteger(company.getSignStatus(),Constants.THREE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对ä¸èµ·ï¼ä¼ä¸å°æªå
·å¤å¨çº¿ç¾ç« æ¡ä»¶ï¼è¯·è系平å°ç®¡çå确认~"); |
| | | } |
| | | Solutions solutions = solutionsMapper.selectById(model.getSolutionId()); |
| | | if(Objects.isNull(solutions)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æªæ¥è¯¢æ¹æ¡ä¿¡æ¯"); |
| | | } |
| | | if(solutions.getType().equals(Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对ä¸èµ·ï¼éå§æä¿æ¹æ¡ä¿åï¼æ æ³è¿è¡è¯¥æä½!"); |
| | | } |
| | | String fileUrl = ExcelExporter.build(InsuranceApply.class).exportApplyExcelToPdf(model,"人ååå"); |
| | | String notifyUrl = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.SIGN_DONE_NOTIFY_URL).getCode(); |
| | | notifyUrl = notifyUrl.replace("${type}","0").replace("${id}",model.getId().toString()); |
| | | String applyNo = signService.applySignLocalFile(company.getName(),company.getName(),fileUrl,company.getCode(),company.getEmail(),"æä¿ååç¾ç« ",company.getSignId(),notifyUrl); |
| | | if(StringUtils.isBlank(applyNo) ){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对ä¸èµ·ï¼è·åå¨çº¿ç¾ç« å°å失败ï¼è¯·ç¨åéè¯ï¼"); |
| | | } |
| | | String link = signService.signLink(applyNo,company.getName(),company.getCode()); |
| | | if(StringUtils.isBlank(link) ){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对ä¸èµ·ï¼è·åå¨çº¿ç¾ç« å°å失败ï¼è¯·ç¨åéè¯ï¼"); |
| | | } |
| | | InsuranceApply update= new InsuranceApply(); |
| | | update.setId(model.getId()); |
| | | update.setEditor(user.getId()); |
| | | update.setEditDate(new Date()); |
| | | update.setSignMemberListNo(applyNo); |
| | | insuranceApplyMapper.updateById(update); |
| | | return link; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Member findDetailById(Integer id) { |
| | | MPJLambdaWrapper<Member> queryWrapper = new MPJLambdaWrapper<>(); |
| | | queryWrapper.selectAll(Member.class) |
| | | .selectAs(DispatchUnit::getName,Member::getDuName) |
| | | .selectAs(Worktype::getName,Member::getWorkTypeName) |
| | | .selectAs(Solutions::getName,Member::getSolutionName) |
| | | .selectAs(Company::getName,Member::getCompanyName) |
| | | .select(" case when now() between t.start_time and t.end_time then 1 else 2 end solutionsStatus ") |
| | | .leftJoin(InsuranceApply.class,InsuranceApply::getId,Member::getApplyId) |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .leftJoin(DispatchUnit.class,DispatchUnit::getId,Member::getDuId) |
| | | .leftJoin(Worktype.class,Worktype::getId,Member::getWorktypeId) |
| | | .leftJoin(Company.class,Company::getId,Member::getCompanyId) |
| | | .eq(Member::getId,id) |
| | | .eq(Member::getIsdeleted, Constants.ZERO) |
| | | .last(" limit 1 ") |
| | | ; |
| | | return memberJoinMapper.selectJoinOne(Member.class,queryWrapper); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public Member findOne(Member member) { |
| | | QueryWrapper<Member> wrapper = new QueryWrapper<>(member); |
| | | return memberMapper.selectOne(wrapper); |
| | |
| | | .leftJoin(DispatchUnit.class,DispatchUnit::getId,Member::getDuId) |
| | | .leftJoin(Worktype.class,Worktype::getId,Member::getWorktypeId) |
| | | .leftJoin(Company.class,Company::getId,Member::getCompanyId) |
| | | .and(StringUtils.isNotBlank(memberQueryDTO.getKeywords()), |
| | | i->i.like(Member::getName, memberQueryDTO.getKeywords()).or().like( |
| | | Member::getIdcardNo,memberQueryDTO.getKeywords() |
| | | )) |
| | | .eq(Member::getIsdeleted, Constants.ZERO) |
| | | // .eq(Member::getCompanyId, memberQueryDTO.getCompanyId()) |
| | | .like(StringUtils.isNotBlank(memberQueryDTO.getName()),Member::getName, memberQueryDTO.getName()) |
| | |
| | | |
| | | |
| | | @Override |
| | | public void merge(SaveUnionApplyDTO saveUnionApplyDTO){ |
| | | public Integer merge(SaveUnionApplyDTO saveUnionApplyDTO){ |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(user.getType().equals(Constants.TWO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"éåæ·ç¨æ·ï¼æ æ³è¿è¡è¯¥æä½"); |
| | |
| | | || Objects.isNull(saveUnionApplyDTO.getApplyIds()) |
| | | || Objects.isNull(saveUnionApplyDTO.getStartDate()) |
| | | || Objects.isNull(saveUnionApplyDTO.getEndDate()) |
| | | || Objects.isNull(saveUnionApplyDTO.getBaseSolutionId()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | |
| | | .selectAs(InsuranceApply::getSolutionBaseId,Solutions::getBaseId) |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .eq(InsuranceApply::getIsdeleted, Constants.ZERO) |
| | | .eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.PLATFORM_CHECK_PASS.getKey()) |
| | | .eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.COMPANY_MEMBER_LIST_SIGNATURE.getKey()) |
| | | .eq(Solutions::getBaseId,saveUnionApplyDTO.getBaseSolutionId()) |
| | | .in(InsuranceApply::getId,saveUnionApplyDTO.getApplyIds()) |
| | | .isNull(InsuranceApply::getUnionApplyId) |
| | |
| | | Integer maxDays = DateUtil.calculateBetween(saveUnionApplyDTO.getStartDate(),saveUnionApplyDTO.getEndDate(),0); |
| | | List<ApplyDetail> applyDetailList = applyDetailJoinMapper.selectList(new QueryWrapper<ApplyDetail>().lambda().select(ApplyDetail::getPrice) |
| | | .in(ApplyDetail::getApplyId,saveUnionApplyDTO.getApplyIds())); |
| | | //unionApply.setFee(insuranceApplyList.stream().map(i->i.getFee()).reduce(BigDecimal.ZERO,BigDecimal::add)); |
| | | unionApply.setFee(applyDetailList.stream().map(i->i.getPrice().multiply(new BigDecimal(maxDays))).reduce(BigDecimal.ZERO,BigDecimal::add)); |
| | | unionApplyMapper.insert(unionApply); |
| | | |
| | |
| | | applyDetailJoinMapper.update(null,new UpdateWrapper<ApplyDetail>().lambda() |
| | | .set(ApplyDetail::getUnionApplyId,unionApply.getId()) |
| | | .in(ApplyDetail::getApplyId,saveUnionApplyDTO.getApplyIds())); |
| | | |
| | | return unionApply.getId(); |
| | | |
| | | } |
| | | |
| | |
| | | if(unionApply.getStatus().equals(Constants.UnionApplyStatus.FINISH.getKey())){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"对ä¸èµ·ï¼åå¹¶åä¸å¡å·²å®ç»ï¼æ¨æ æ³è¿è¡è¯¥æä½ï¼"); |
| | | } |
| | | if(unionApply.getStatus().equals(Constants.UnionApplyStatus.CLOSE.getKey())){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"对ä¸èµ·ï¼åå¹¶åä¸å¡å·²å
³é"); |
| | | } |
| | | //åå¹¶åç¶æå¤äºå¾
æä¿ |
| | | if(unionApply.getStatus().equals(Constants.UnionApplyStatus.UPLOAD_INSURANCE_POLICY.getKey()) |
| | | || unionApply.getStatus().equals(Constants.UnionApplyStatus.WAIT_SIGNATURE.getKey())){ |
| | |
| | | .set(InsuranceApply::getCheckUserId,user.getId()) |
| | | .eq(InsuranceApply::getUnionApplyId,unionApply.getId())); |
| | | |
| | | |
| | | applyDetailJoinMapper.update(null,new UpdateWrapper<ApplyDetail>().lambda() |
| | | .set(ApplyDetail::getUnionApplyId,null) |
| | | .eq(ApplyDetail::getUnionApplyId,unionApply.getId())); |
| | | |
| | | |
| | | unionApplyMapper.update(null,new UpdateWrapper<UnionApply>().lambda() |
| | | .set(UnionApply::getCheckDate,new Date()) |
| | |
| | | }else if(useDays>0){ |
| | | currentFee = new BigDecimal(useDays).multiply(price); |
| | | } |
| | | //ä¸ä¼ ä¿åä¿¡æ¯ |
| | | if(StringUtils.isNotBlank(unionApplyBXDDDetailTO.getFileUrl())){ |
| | | Multifile multifile = new Multifile(); |
| | | multifile.setIsdeleted(Constants.ZERO); |
| | | multifile.setCreator(user.getId()); |
| | | multifile.setCreateDate(new Date()); |
| | | multifile.setObjId(insuranceApply.getId()); |
| | | multifile.setObjType(Constants.MultiFile.COMPANY_TBD_SIGNED_PDF.getKey()); |
| | | multifile.setType(Constants.TWO); |
| | | multifile.setFileurl(unionApplyBXDDDetailTO.getFileUrl()); |
| | | multifile.setName(unionApplyBXDDDetailTO.getFileName()); |
| | | multifileMapper.insert(multifile); |
| | | insuranceApply.setUnionApplyTbdStatus(Constants.ONE); |
| | | }else{ |
| | | insuranceApply.setUnionApplyTbdStatus(Constants.ZERO); |
| | | } |
| | | //æ´æ°æä¿ç³è¯·å |
| | | insuranceApplyJoinMapper.update(null,new UpdateWrapper<InsuranceApply>().lambda() |
| | | .set(InsuranceApply::getFee, |
| | |
| | | .set(InsuranceApply::getCurrentFee,currentFee.multiply(new BigDecimal(applyDetails.size()))) |
| | | .set(InsuranceApply::getStartTime,unionApplyBXDDTO.getStartTime()) |
| | | .set(InsuranceApply::getEndTime,unionApplyBXDDTO.getEndTime()) |
| | | .set(InsuranceApply::getUnionApplyTbdStatus,insuranceApply.getUnionApplyTbdStatus()) |
| | | .set(InsuranceApply::getEditDate,new Date()) |
| | | .set(InsuranceApply::getEditor,user.getId()) |
| | | .eq(InsuranceApply::getId,insuranceApply.getId())); |
| | |
| | | .set(ApplyDetail::getEndTime,unionApplyBXDDTO.getEndTime()) |
| | | .in(ApplyDetail::getId,applyDetails.stream().map(m->m.getId()).collect(Collectors.toList())) |
| | | ); |
| | | //ä¸ä¼ ä¿åä¿¡æ¯ |
| | | if(StringUtils.isNotBlank(unionApplyBXDDDetailTO.getFileUrl())){ |
| | | Multifile multifile = new Multifile(); |
| | | multifile.setIsdeleted(Constants.ZERO); |
| | | multifile.setCreator(user.getId()); |
| | | multifile.setCreateDate(new Date()); |
| | | multifile.setObjId(insuranceApply.getId()); |
| | | multifile.setObjType(Constants.MultiFile.BD_APPLY_PDF.getKey()); |
| | | multifile.setType(Constants.TWO); |
| | | multifile.setFileurl(unionApplyBXDDDetailTO.getFileUrl()); |
| | | multifile.setName(unionApplyBXDDDetailTO.getFileName()); |
| | | multifileMapper.insert(multifile); |
| | | } |
| | | |
| | | sumFee = sumFee.add(price.multiply(new BigDecimal(applyDetails.size())).multiply(new BigDecimal(maxDays))); |
| | | sumCurrFee = sumCurrFee.add(currentFee.multiply(new BigDecimal(applyDetails.size()))); |
| | | } |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.UnionChangeMapper; |
| | | import com.doumee.dao.business.model.UnionChange; |
| | | import com.doumee.dao.business.*; |
| | | import com.doumee.dao.business.dto.SaveUnionApplyDTO; |
| | | import com.doumee.dao.business.dto.SaveUnionChangeDTO; |
| | | import com.doumee.dao.business.dto.UnionChangeBXDDTO; |
| | | import com.doumee.dao.business.join.ApplyChagneDetailJoinMapper; |
| | | import com.doumee.dao.business.join.ApplyChangeJoinMapper; |
| | | import com.doumee.dao.business.join.ApplyDetailJoinMapper; |
| | | import com.doumee.dao.business.join.MemberInsuranceJoinMapper; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.business.vo.CountCyclePriceVO; |
| | | import com.doumee.service.business.UnionChangeService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.doumee.service.business.third.SignService; |
| | | import com.github.xiaoymin.knife4j.core.util.CollectionUtils; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * å åä¿æ¢ååå¹¶åä¿¡æ¯è¡¨Serviceå®ç° |
| | |
| | | |
| | | @Autowired |
| | | private UnionChangeMapper unionChangeMapper; |
| | | |
| | | @Autowired |
| | | private ApplyChangeJoinMapper applyChangeJoinMapper; |
| | | |
| | | @Autowired |
| | | private ApplyChagneDetailJoinMapper applyChagneDetailJoinMapper; |
| | | |
| | | @Autowired |
| | | private CompanyMapper companyMapper; |
| | | |
| | | @Autowired |
| | | private SolutionsMapper solutionsMapper; |
| | | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | |
| | | @Autowired |
| | | private SignService signService; |
| | | |
| | | @Autowired |
| | | private MemberMapper memberMapper; |
| | | |
| | | @Autowired |
| | | private ApplyDetailJoinMapper applyDetailJoinMapper; |
| | | |
| | | @Autowired |
| | | private MemberInsuranceJoinMapper memberInsuranceJoinMapper; |
| | | |
| | | @Autowired |
| | | private InsuranceApplyMapper insuranceApplyMapper; |
| | | |
| | | @Override |
| | | public Integer create(UnionChange unionChange) { |
| | |
| | | QueryWrapper<UnionChange> wrapper = new QueryWrapper<>(unionChange); |
| | | return unionChangeMapper.selectCount(wrapper); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public Integer merge(SaveUnionChangeDTO saveUnionChangeDTO){ |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(user.getType().equals(Constants.TWO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"éåæ·ç¨æ·ï¼æ æ³è¿è¡è¯¥æä½"); |
| | | } |
| | | if(Objects.isNull(saveUnionChangeDTO) |
| | | || Objects.isNull(saveUnionChangeDTO.getApplyIds()) |
| | | || Objects.isNull(saveUnionChangeDTO.getApplyDate()) |
| | | || Objects.isNull(saveUnionChangeDTO.getUnionApplyId()) |
| | | || Objects.isNull(saveUnionChangeDTO.getBusinessType()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | List<ApplyChange> applyChangeList = applyChangeJoinMapper.selectJoinList(ApplyChange.class, |
| | | new MPJLambdaWrapper<ApplyChange>() |
| | | .selectAll(ApplyChange.class) |
| | | .leftJoin(InsuranceApply.class,InsuranceApply::getId,ApplyChange::getApplyId) |
| | | .eq(ApplyChange::getIsdeleted, Constants.ZERO) |
| | | .eq(InsuranceApply::getUnionApplyId,saveUnionChangeDTO.getUnionApplyId()) |
| | | .eq(ApplyChange::getStatus,Constants.ApplyChangeStatus.COMPANY_SIGN.getKey()) |
| | | .eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey()) |
| | | .eq(ApplyChange::getType,saveUnionChangeDTO.getBusinessType()) |
| | | .in(ApplyChange::getId,saveUnionChangeDTO.getApplyIds()) |
| | | .isNull(ApplyChange::getUnionChangeId) |
| | | ); |
| | | //æ¥è¯¢æ°æ®æ¯å¦å卿ªå¤äºå®¡æ¹éè¿çæ°æ® |
| | | if(applyChangeList.size()!=saveUnionChangeDTO.getApplyIds().size()){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"å卿°æ®å·²å¤çï¼è¯·å·æ°éè¯"); |
| | | } |
| | | |
| | | UnionChange unionChange = new UnionChange(); |
| | | unionChange.setCreateDate(new Date()); |
| | | unionChange.setCreator(user.getId()); |
| | | unionChange.setShopId(user.getCompanyId()); |
| | | unionChange.setUnionApplyId(saveUnionChangeDTO.getUnionApplyId()); |
| | | unionChange.setApplyStartTime(saveUnionChangeDTO.getApplyDate()); |
| | | unionChange.setType(saveUnionChangeDTO.getBusinessType()); |
| | | unionChange.setStatus(Constants.UnionChangeStatus.MERGE.getKey()); |
| | | unionChangeMapper.insert(unionChange); |
| | | |
| | | applyChangeJoinMapper.update(null,new UpdateWrapper<ApplyChange>().lambda() |
| | | .set(ApplyChange::getUnionChangeId,unionChange.getId()) |
| | | .set(ApplyChange::getCheckDate,new Date()) |
| | | .set(ApplyChange::getCheckUserId,user.getId()) |
| | | .in(ApplyChange::getId,saveUnionChangeDTO.getApplyIds()) |
| | | ); |
| | | |
| | | applyChagneDetailJoinMapper.update(null,new UpdateWrapper<ApplyChagneDetail>().lambda() |
| | | .set(ApplyChagneDetail::getUnionChangeId,unionChange.getId()) |
| | | .in(ApplyChagneDetail::getApplyId,saveUnionChangeDTO.getApplyIds())); |
| | | return unionChange.getId(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * åæ¶ä¿ååå¹¶ |
| | | * @param id |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | | public void cancelMerge(Integer id){ |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(user.getType().equals(Constants.TWO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"éåæ·ç¨æ·ï¼æ æ³è¿è¡è¯¥æä½ï¼"); |
| | | } |
| | | UnionChange unionChange = unionChangeMapper.selectById(id); |
| | | if(Objects.isNull(unionChange)||!Constants.equalsInteger(unionChange.getIsdeleted(),Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(!unionChange.getShopId().equals(user.getCompanyId())){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"对ä¸èµ·éæ¨çåå¹¶åï¼æ¨æ æ³è¿è¡æä½ï¼"); |
| | | } |
| | | if(unionChange.getStatus().equals(Constants.UnionChangeStatus.FINISH.getKey())){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"对ä¸èµ·ï¼åå¹¶åä¸å¡å·²å®ç»ï¼æ¨æ æ³è¿è¡è¯¥æä½ï¼"); |
| | | } |
| | | if(unionChange.getStatus().equals(Constants.UnionChangeStatus.CLOSE.getKey())){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"对ä¸èµ·ï¼åå¹¶åä¸å¡å·²å
³é"); |
| | | } |
| | | |
| | | applyChangeJoinMapper.update(null,new UpdateWrapper<ApplyChange>().lambda() |
| | | .set(ApplyChange::getUnionChangeId,null) |
| | | .set(ApplyChange::getCheckDate,new Date()) |
| | | .set(ApplyChange::getCheckUserId,user.getId()) |
| | | .in(ApplyChange::getUnionChangeId,unionChange.getId()) |
| | | ); |
| | | |
| | | applyChagneDetailJoinMapper.update(null,new UpdateWrapper<ApplyChagneDetail>().lambda() |
| | | .set(ApplyChagneDetail::getUnionChangeId,null) |
| | | .in(ApplyChagneDetail::getApplyId,unionChange.getId())); |
| | | |
| | | unionChangeMapper.update(null,new UpdateWrapper<UnionChange>().lambda() |
| | | .set(UnionChange::getStatus,Constants.UnionApplyStatus.CLOSE.getKey()) |
| | | .eq(UnionChange::getId,unionChange.getId()) |
| | | ); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * åå¹¶åï¼å åä¿/æ¢åï¼ - æä¿ç³è¯·ç¾ç½² |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | | public String getSignLink(Integer id) { |
| | | if(id == null ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | UnionChange unionChange = unionChangeMapper.selectById(id); |
| | | if(Objects.isNull(unionChange)||!Constants.equalsInteger(unionChange.getIsdeleted(),Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(!unionChange.getShopId().equals(user.getCompanyId())){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"对ä¸èµ·éæ¨çåå¹¶åï¼æ¨æ æ³è¿è¡æä½ï¼"); |
| | | } |
| | | if(unionChange.getStatus().equals(Constants.UnionChangeStatus.FINISH.getKey())){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"对ä¸èµ·ï¼åå¹¶åä¸å¡å·²å®ç»ï¼æ¨æ æ³è¿è¡è¯¥æä½ï¼"); |
| | | } |
| | | if(unionChange.getStatus().equals(Constants.UnionChangeStatus.CLOSE.getKey())){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"对ä¸èµ·ï¼åå¹¶åä¸å¡å·²å
³é"); |
| | | } |
| | | if(unionChange.getStatus().equals(Constants.UnionChangeStatus.MERGE.getKey())){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"对ä¸èµ·ï¼åå¹¶åç¶æå·²æµè½¬"); |
| | | } |
| | | Company company = companyMapper.selectById(user.getCompanyId()); |
| | | if(company== null || StringUtils.isBlank( company.getEmail()) || !Constants.equalsInteger(company.getSignStatus(),Constants.THREE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对ä¸èµ·ï¼ä¼ä¸å°æªå
·å¤å¨çº¿ç¾ç« æ¡ä»¶ï¼è¯·è系平å°ç®¡çå确认~"); |
| | | } |
| | | |
| | | String fileUrl = null; |
| | | if(Constants.equalsObject(unionChange.getType(), Constants.ONE)){ |
| | | // fileUrl = ExcelExporter.build(ApplyChange.class).exportChangeUnitExcelToPdf(model,"æ¢åç³è¯·è¡¨","被ä¿é©äºº"); |
| | | }else{ |
| | | // fileUrl = ExcelExporter.build(ApplyChange.class).exportJiajianBaoExcelToPdf(model,"å åä¿ç³è¯·è¡¨","被ä¿é©äºº"); |
| | | } |
| | | |
| | | String notifyUrl = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.SIGN_DONE_NOTIFY_URL).getCode(); |
| | | notifyUrl = notifyUrl.replace("${type}","0").replace("${id}",unionChange.getId().toString()); |
| | | String applyNo = signService.applySignLocalFile(company.getName(),company.getName(),fileUrl,company.getCode(),company.getEmail(),"åå¹¶åï¼å åä¿/æ¢åï¼ç³è¯·ç¾ç½²",company.getSignId(),notifyUrl); |
| | | if(StringUtils.isBlank(applyNo) ){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对ä¸èµ·ï¼è·åå¨çº¿ç¾ç« å°å失败ï¼è¯·ç¨åéè¯ï¼"); |
| | | } |
| | | String link = signService.signLink(applyNo,company.getName(),company.getCode()); |
| | | if(StringUtils.isBlank(link) ){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对ä¸èµ·ï¼è·åå¨çº¿ç¾ç« å°å失败ï¼è¯·ç¨åéè¯ï¼"); |
| | | } |
| | | |
| | | UnionChange update= new UnionChange(); |
| | | update.setId(unionChange.getId()); |
| | | update.setEditor(user.getId()); |
| | | update.setEditDate(new Date()); |
| | | update.setSignApplyNo(applyNo); |
| | | unionChangeMapper.updateById(update); |
| | | return link; |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public void uploadBXD(UnionChangeBXDDTO unionChangeBXDDTO){ |
| | | if(Objects.isNull(unionChangeBXDDTO) |
| | | || Objects.isNull(unionChangeBXDDTO.getId()) |
| | | || Objects.isNull(unionChangeBXDDTO.getApplyDate()) |
| | | || StringUtils.isBlank(unionChangeBXDDTO.getFileName()) |
| | | || StringUtils.isBlank(unionChangeBXDDTO.getFileUrl()) |
| | | || StringUtils.isBlank(unionChangeBXDDTO.getCode()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | UnionChange unionChange = unionChangeMapper.selectById(unionChangeBXDDTO.getId()); |
| | | if(Objects.isNull(unionChange)||!Constants.equalsInteger(unionChange.getIsdeleted(),Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(!unionChange.getShopId().equals(user.getCompanyId())){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"对ä¸èµ·éæ¨çåå¹¶åï¼æ¨æ æ³è¿è¡æä½ï¼"); |
| | | } |
| | | if(unionChange.getStatus().equals(Constants.UnionChangeStatus.FINISH.getKey())){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"对ä¸èµ·ï¼åå¹¶åä¸å¡å·²å®ç»ï¼æ¨æ æ³è¿è¡è¯¥æä½ï¼"); |
| | | } |
| | | if(unionChange.getStatus().equals(Constants.UnionChangeStatus.CLOSE.getKey())){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"对ä¸èµ·ï¼åå¹¶åä¸å¡å·²å
³é"); |
| | | } |
| | | if(unionChange.getStatus().equals(Constants.UnionChangeStatus.UPLOAD_INSURANCE_POLICY.getKey())){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"对ä¸èµ·ï¼åå¹¶åç¶æå·²æµè½¬"); |
| | | } |
| | | |
| | | List<ApplyChange> applyChangeList = applyChangeJoinMapper.selectJoinList(ApplyChange.class, |
| | | new MPJLambdaWrapper<ApplyChange>() |
| | | .selectAll(ApplyChange.class) |
| | | .selectAs(InsuranceApply::getSolutionId,ApplyChange::getSolutionsId) |
| | | .selectAs(InsuranceApply::getCode,ApplyChange::getApplyCode) |
| | | .leftJoin(InsuranceApply.class,InsuranceApply::getId,ApplyChange::getApplyId) |
| | | .eq(ApplyChange::getUnionChangeId,unionChange.getId())); |
| | | if(CollectionUtils.isNotEmpty(applyChangeList)){ |
| | | for (ApplyChange applyChange:applyChangeList) { |
| | | applyChange.setApplyStartTime(unionChangeBXDDTO.getApplyDate()); |
| | | applyChange.setValidTime(unionChangeBXDDTO.getApplyDate()); |
| | | applyChange.setEditDate(new Date()); |
| | | applyChange.setEditor(user.getId()); |
| | | List<ApplyChagneDetail> allList = applyChagneDetailJoinMapper.selectList(new QueryWrapper<ApplyChagneDetail>().lambda().eq(ApplyChagneDetail::getApplyChangeId,applyChange.getId())); |
| | | this.dealApplyChangeDetail(applyChange,allList); |
| | | } |
| | | } |
| | | unionChangeMapper.update(null,new UpdateWrapper<UnionChange>().lambda() |
| | | .set(UnionChange::getStatus,Constants.UnionChangeStatus.FINISH.getKey()) |
| | | .set(UnionChange::getEditDate,new Date()) |
| | | .set(UnionChange::getEditor,user.getId()) |
| | | .eq(UnionChange::getId,unionChangeBXDDTO.getId()) |
| | | ); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | public void dealApplyChangeDetail(ApplyChange applyChange,List<ApplyChagneDetail> applyChagneDetailList){ |
| | | |
| | | BigDecimal totalFee = BigDecimal.ZERO; |
| | | BigDecimal currentFee = BigDecimal.ZERO; |
| | | //æ¥è¯¢æåè®°å½ è·å对åºåä»· |
| | | ApplyDetail applyDetail = applyDetailJoinMapper.selectOne(new QueryWrapper<ApplyDetail>().lambda().eq(ApplyDetail::getApplyId,applyChange.getApplyId()).last(" limit 1 ")); |
| | | if(Objects.isNull(applyDetail)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"æªæ¥è¯¢å°ä¿åæç»æ°æ®"); |
| | | } |
| | | //è·ååä»· |
| | | BigDecimal price = applyDetail.getPrice(); |
| | | for (ApplyChagneDetail detail:applyChagneDetailList) { |
| | | Member member = memberMapper.selectById(detail.getMemberId()); |
| | | if(Objects.isNull(member)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æªæ¥è¯¢å°åå·¥æ°æ®"); |
| | | } |
| | | if (Constants.equalsInteger(detail.getType(), Constants.ZERO)) { |
| | | this.addChangeDetailData(applyChange,detail,price,currentFee,totalFee); |
| | | }else if(Constants.equalsInteger(detail.getType(),Constants.ONE)){ |
| | | this.reduceChangeDetailData(applyChange,detail,applyDetail,price,currentFee,totalFee); |
| | | }else{ |
| | | this.otherChangeDetailData(applyChange,detail,applyDetail,price); |
| | | } |
| | | } |
| | | |
| | | 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, applyChange.getEditor()) |
| | | .set(InsuranceApply::getEditDate, applyChange.getEditDate()) |
| | | .eq(InsuranceApply::getId, applyChange.getApplyId()) |
| | | ); |
| | | applyChangeJoinMapper.update(null, new UpdateWrapper<ApplyChange>().lambda() |
| | | .set(ApplyChange::getFee,totalFee) |
| | | .set(ApplyChange::getEditor, applyChange.getEditor()) |
| | | .set(ApplyChange::getEditDate, applyChange.getEditDate()) |
| | | .eq(ApplyChange::getId, applyChange.getApplyId()) |
| | | ); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å ä¿æ°æ®å¤ç |
| | | * @param applyChange |
| | | * @param detail |
| | | * @param price |
| | | * @param currentFee |
| | | * @param totalFee |
| | | */ |
| | | public void addChangeDetailData(ApplyChange applyChange,ApplyChagneDetail detail |
| | | ,BigDecimal price,BigDecimal currentFee,BigDecimal totalFee){ |
| | | //æ¥è¯¢å ä¿äººåæ¯å¦åå¨ å²çªç ä¿åæç»æ°æ® |
| | | if(applyDetailJoinMapper.selectCount(new QueryWrapper<ApplyDetail>() |
| | | .lambda() |
| | | .eq(ApplyDetail::getApplyId,applyChange.getApplyId()) |
| | | .eq(ApplyDetail::getIdcardNo,detail.getIdcardNo()) |
| | | .le(ApplyDetail::getStartTime,DateUtil.getMontageDate(applyChange.getApplyStartTime(),1)) |
| | | .ge(ApplyDetail::getEndTime,DateUtil.getMontageDate(detail.getEndTime(),2)) |
| | | )>Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "å½åä¿åä¸ï¼å ä¿äººåã" + detail.getMemberName() + "ãå卿¥æå²çªçæ°æ®"); |
| | | } |
| | | //æ»å¤©æ° |
| | | Integer countDays = DateUtil.daysBetweenDates(DateUtil.getMontageDate(detail.getEndTime(), 2), applyChange.getApplyStartTime()); |
| | | //å ä¿ |
| | | ApplyDetail add = new ApplyDetail(); |
| | | if(new Date().compareTo(DateUtil.getMontageDate(applyChange.getApplyStartTime(), 2))>=0){ |
| | | Integer days = DateUtil.daysBetweenDates(DateUtil.getMontageDate(new Date(), 2), applyChange.getApplyStartTime()) + 1; |
| | | //å¦æå·²å·²äº§çè´¹ç¨ï¼è®¡ç®å·²å·²äº§çè´¹ç¨ |
| | | add.setCurrentFee(new BigDecimal(days).multiply(price)); |
| | | }else{ |
| | | add.setCurrentFee(BigDecimal.ZERO); |
| | | } |
| | | add.setApplyId(applyChange.getApplyId()); |
| | | add.setValidCode(applyChange.getValidCode()); |
| | | add.setFee(detail.getFee()); |
| | | add.setIsdeleted(Constants.ZERO); |
| | | add.setCreator(applyChange.getEditor()); |
| | | add.setCreateDate(applyChange.getEditDate()); |
| | | add.setMemberId(detail.getMemberId()); |
| | | add.setMemberName(detail.getMemberName()); |
| | | add.setWorktypeId(detail.getWorktypeId()); |
| | | add.setIsdeleted(Constants.ZERO); |
| | | add.setIdcardNo(detail.getIdcardNo()); |
| | | add.setSex(Constants.getSexByIdCard(detail.getIdcardNo())); |
| | | add.setMemberName(detail.getMemberName()); |
| | | add.setDuId(detail.getDuId()); |
| | | add.setStartTime(applyChange.getApplyStartTime()); |
| | | add.setStartTime(DateUtil.getMontageDate(applyChange.getApplyStartTime(), 1)); |
| | | add.setEndTime(DateUtil.getMontageDate(detail.getEndTime(), 2)); |
| | | add.setFee(new BigDecimal(countDays).multiply(price)); |
| | | applyDetailJoinMapper.insert(add); |
| | | |
| | | detail.setFee(add.getFee()); |
| | | applyChagneDetailJoinMapper.update(null,new UpdateWrapper<ApplyChagneDetail>().lambda() |
| | | .set(ApplyChagneDetail::getFee,add.getFee()) |
| | | .set(ApplyChagneDetail::getStartTime,DateUtil.getMontageDate(applyChange.getApplyStartTime(), 1)) |
| | | .eq(ApplyChagneDetail::getId,detail.getId()) |
| | | ); |
| | | |
| | | totalFee = totalFee.add(add.getFee()); |
| | | currentFee = currentFee.add(add.getCurrentFee()); |
| | | |
| | | MemberInsurance memberInsurance = new MemberInsurance(detail, applyChange, applyChange.getEditor(), add.getId(),applyChange.getSolutionsId()); |
| | | memberInsurance.setStartTime(add.getStartTime()); |
| | | memberInsurance.setEndTime(add.getEndTime()); |
| | | memberInsurance.setRelationType(Constants.ONE); |
| | | memberInsuranceJoinMapper.insert(memberInsurance); |
| | | } |
| | | |
| | | /** |
| | | * åä¿æ°æ®å¤ç |
| | | * @param applyChange |
| | | * @param detail |
| | | * @param applyDetail |
| | | * @param price |
| | | * @param currentFee |
| | | * @param totalFee |
| | | */ |
| | | public void reduceChangeDetailData(ApplyChange applyChange,ApplyChagneDetail detail,ApplyDetail applyDetail |
| | | ,BigDecimal price,BigDecimal currentFee,BigDecimal totalFee){ |
| | | //æ¥è¯¢åå·¥æ¯å¨ä¸»åä¸ æ¯å¦åå¨çæä¸çæ°æ® |
| | | ApplyDetail oldModel = applyDetailJoinMapper.selectOne(new QueryWrapper<ApplyDetail>().lambda() |
| | | .eq(ApplyDetail::getApplyId, applyChange.getApplyId()) |
| | | .eq(ApplyDetail::getMemberId, detail.getMemberId()) |
| | | .orderByDesc(ApplyDetail::getCreateDate) |
| | | .last("limit 1")); |
| | | if (oldModel == null || oldModel.getStartTime() == null || oldModel.getStartTime().getTime() > applyChange.getApplyStartTime().getTime()) { |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "对ä¸èµ·ï¼ç¨æ·ã" + detail.getMemberName() + "ãåä¿åä¿¡æ¯æè¯¯ï¼å½åç³è¯·ä¸æ¯æåä¿å¤çï¼"); |
| | | } |
| | | //计ç®å·²çæå¤©æ° |
| | | //å½å®¡æ¹æ¶é´ å°äº å½åæ¶é´ 计ç®å®é
åå°éé¢ å 为已æ£éé¢ä¼å¤§äº åºæ£éé¢ |
| | | BigDecimal pullFee = BigDecimal.ZERO; |
| | | //åä¿åå°çéé¢ |
| | | BigDecimal reduceFee = BigDecimal.ZERO; |
| | | if (DateUtil.daysBetweenDates(DateUtil.getMontageDate(new Date(), 2),applyChange.getApplyStartTime()) > 0) { |
| | | //计ç®å¤æ£éé¢ |
| | | Integer days = DateUtil.daysBetweenDates(DateUtil.getMontageDate(new Date(), 2), applyChange.getApplyStartTime()) + 1; |
| | | pullFee = new BigDecimal(days).multiply(price).multiply(new BigDecimal(-1)); |
| | | } |
| | | //è®¡ç®æä¿æç»åºåå°çå¤©æ° |
| | | Integer reduceDays = DateUtil.daysBetweenDates(DateUtil.getMontageDate(applyDetail.getEndTime(), 2), applyChange.getApplyStartTime()) + 1; |
| | | if(reduceDays>0){ |
| | | reduceFee = new BigDecimal(reduceDays).multiply(price).multiply(new BigDecimal(-1)); |
| | | } |
| | | applyDetailJoinMapper.update(null, new UpdateWrapper<ApplyDetail>().lambda() |
| | | .setSql(" fee = ifnull(fee,0)+" + reduceFee) |
| | | .setSql(" current_fee = ifnull(current_fee,0)+" + pullFee) |
| | | .set(oldModel.getStartTime().compareTo(applyChange.getApplyStartTime())!=0,ApplyDetail::getEndTime, DateUtil.getMontageDate(applyChange.getApplyStartTime(), 3)) |
| | | .set(oldModel.getStartTime().compareTo(applyChange.getApplyStartTime())==0,ApplyDetail::getEndTime, DateUtil.getMontageDate(applyChange.getApplyStartTime(), 2)) |
| | | .set(ApplyDetail::getEditor, applyChange.getEditor()) |
| | | .set(ApplyDetail::getEditDate, applyChange.getEditDate()) |
| | | .eq(ApplyDetail::getId, oldModel.getId()) |
| | | ); |
| | | totalFee = totalFee.add(reduceFee); |
| | | currentFee = currentFee.add(pullFee); |
| | | |
| | | //ä¿®æ¹ åå·¥æä¿æç»è®°å½ å岿°æ® |
| | | memberInsuranceJoinMapper.update(null, new UpdateWrapper<MemberInsurance>().lambda() |
| | | .setSql(" fee = ifnull(fee,0)+" + reduceFee) |
| | | .set(oldModel.getStartTime().compareTo(applyChange.getApplyStartTime())!=0,MemberInsurance::getEndTime,DateUtil.getMontageDate(applyChange.getApplyStartTime(), 3)) |
| | | .set(oldModel.getStartTime().compareTo(applyChange.getApplyStartTime())==0,MemberInsurance::getEndTime,DateUtil.getMontageDate(applyChange.getApplyStartTime(), 2)) |
| | | .eq(MemberInsurance::getRelationId, oldModel.getId()) |
| | | ); |
| | | |
| | | //ä¿®æ¹ä¸å¡æç»è¡æ°æ®å®é
æ¹åæ¥æ |
| | | applyChagneDetailJoinMapper.update(null,new UpdateWrapper<ApplyChagneDetail>().lambda() |
| | | .setSql(" fee = ifnull(fee,0)+" + reduceFee) |
| | | .set(ApplyChagneDetail::getEndTime,DateUtil.getMontageDate(applyChange.getApplyStartTime(), 3)) |
| | | .eq(ApplyChagneDetail::getId,detail.getId()) |
| | | ); |
| | | } |
| | | |
| | | public void otherChangeDetailData(ApplyChange applyChange,ApplyChagneDetail detail,ApplyDetail applyDetail,BigDecimal price){ |
| | | |
| | | //å®é
æ¹åçææ¥æ |
| | | Date applyStartTime = DateUtil.getMontageDate(applyChange.getApplyStartTime(),1); |
| | | |
| | | //æ¥è¯¢åä¿äººåæ¯å¦åå¨ å²çªç ä¿åæç»æ°æ® |
| | | if(applyDetailJoinMapper.selectCount(new QueryWrapper<ApplyDetail>() |
| | | .lambda() |
| | | .eq(ApplyDetail::getApplyId,applyChange.getApplyId()) |
| | | .eq(ApplyDetail::getIdcardNo,detail.getIdcardNo()) |
| | | .le(ApplyDetail::getStartTime,applyStartTime) |
| | | .ge(ApplyDetail::getEndTime,applyStartTime) |
| | | )<=Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "å½åä¿åä¸ï¼æ¢å人åã" + detail.getMemberName() + "ãæªæ¥è¯¢å°ç¬¦åæ¹åæ¥æçæ°æ®"); |
| | | } |
| | | |
| | | //æ¥è¯¢åå·¥æ¯å¨ä¸»åä¸ æ¯å¦åå¨çæä¸çæ°æ® |
| | | ApplyDetail oldModel = applyDetailJoinMapper.selectOne(new QueryWrapper<ApplyDetail>().lambda() |
| | | .eq(ApplyDetail::getApplyId, applyChange.getApplyId()) |
| | | .eq(ApplyDetail::getMemberId, detail.getMemberId()) |
| | | .le(ApplyDetail::getStartTime,applyStartTime) |
| | | .ge(ApplyDetail::getEndTime,applyStartTime) |
| | | .orderByDesc(ApplyDetail::getCreateDate) |
| | | .last("limit 1")); |
| | | if(oldModel == null ){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对ä¸èµ·ï¼ç¨æ·ã"+detail.getMemberName()+"ãåä¿åä¿¡æ¯æè¯¯ï¼æ¹åæ¥ææªå¨ä¿åæ¥æå
ï¼"); |
| | | } |
| | | //妿å®é
æ¹åæ¥æ å åè®°å½æ¥æç¸ç åç´æ¥ä¿®æ¹è®°å½æ´¾é£åä½ä¸å·¥ç§ä¿¡æ¯ |
| | | if(applyStartTime.compareTo(oldModel.getStartTime())!=Constants.ZERO){ |
| | | //å½åæ¥æå¤§äºæ¹åæ¥æ éè¦åæ»æ°æ®å®é
æ°æ® |
| | | Boolean flag = DateUtil.getMontageDate(new Date(),2).compareTo(DateUtil.getMontageDate(applyStartTime,2))>0; |
| | | //æ¢åååå²è®°å½çè´¹ç¨ fee |
| | | Integer days = DateUtil.daysBetweenDates(DateUtil.getMontageDate(applyStartTime,3),DateUtil.getMontageDate(oldModel.getStartTime(),1))+1; |
| | | BigDecimal oldFee = new BigDecimal(days).multiply(price); |
| | | BigDecimal fee = oldModel.getFee(); |
| | | BigDecimal oldCurrentFee = oldModel.getCurrentFee(); |
| | | |
| | | applyDetailJoinMapper.update(null, new UpdateWrapper<ApplyDetail>().lambda() |
| | | .set(ApplyDetail::getEditor,applyChange.getEditor()) |
| | | .set(ApplyDetail::getEditDate,applyChange.getEditDate()) |
| | | .set(ApplyDetail::getEndTime,DateUtil.getMontageDate(applyStartTime,3)) |
| | | .set(ApplyDetail::getFee,oldFee) |
| | | .set(flag,ApplyDetail::getCurrentFee,oldFee) |
| | | .eq(ApplyDetail::getId,oldModel.getId()) |
| | | ); |
| | | |
| | | //ä¿®æ¹ åå·¥æä¿æç»è®°å½ å岿°æ® |
| | | memberInsuranceJoinMapper.update(null,new UpdateWrapper<MemberInsurance>().lambda() |
| | | .set(MemberInsurance::getEndTime,applyStartTime) |
| | | .set(MemberInsurance::getFee,oldFee) |
| | | .eq(MemberInsurance::getRelationId,oldModel.getId()) |
| | | ); |
| | | |
| | | ApplyDetail add = new ApplyDetail(); |
| | | add.setApplyId(oldModel.getApplyId()); |
| | | add.setCreateDate(new Date()); |
| | | add.setCreator(applyChange.getEditor()); |
| | | add.setMemberId(oldModel.getMemberId()); |
| | | add.setIdcardNo(detail.getIdcardNo()); |
| | | add.setSex(Constants.getSexByIdCard(detail.getIdcardNo())); |
| | | add.setMemberName(detail.getMemberName()); |
| | | add.setStartTime(DateUtil.getMontageDate(applyStartTime,1)); |
| | | add.setEndTime(oldModel.getEndTime()); |
| | | add.setDuId(detail.getDuId()); |
| | | add.setWorktypeId(detail.getWorktypeId()); |
| | | add.setIdcardNo(oldModel.getIdcardNo()); |
| | | add.setFee(fee.subtract(oldFee)); |
| | | add.setIsdeleted(Constants.ZERO); |
| | | if(flag){ |
| | | add.setCurrentFee(oldCurrentFee.multiply(oldFee)); |
| | | }else{ |
| | | add.setCurrentFee(BigDecimal.ZERO); |
| | | } |
| | | add.setSex(oldModel.getSex()); |
| | | add.setMemberName(oldModel.getMemberName()); |
| | | add.setFromId(detail.getId()); |
| | | applyDetailJoinMapper.insert(add); |
| | | |
| | | MemberInsurance memberInsurance = new MemberInsurance(applyDetail,applyChange.getId()); |
| | | memberInsurance.setSolutionId(detail.getSolutionId()); |
| | | memberInsurance.setWorktypeName(detail.getWorkTypeName()); |
| | | memberInsurance.setDuName(detail.getDuName()); |
| | | memberInsurance.setApplyChangeId(detail.getApplyChangeId()); |
| | | memberInsurance.setSolutionName(detail.getSolutionsName()); |
| | | memberInsurance.setPdCode(applyChange.getValidCode()); |
| | | memberInsurance.setBdCode(applyChange.getApplyCode()); |
| | | memberInsurance.setRelationType(Constants.ONE); |
| | | memberInsuranceJoinMapper.insert(memberInsurance); |
| | | |
| | | }else{ |
| | | applyDetailJoinMapper.update(null, new UpdateWrapper<ApplyDetail>().lambda() |
| | | .set(ApplyDetail::getEditor,applyChange.getEditor()) |
| | | .set(ApplyDetail::getEditDate,applyChange.getEditDate()) |
| | | .set(ApplyDetail::getDuId,detail.getDuId()) |
| | | .set(ApplyDetail::getWorktypeId,detail.getWorktypeId()) |
| | | .eq(ApplyDetail::getId,oldModel.getId()) |
| | | ); |
| | | //åå·¥æä¿æç»è®°å½ å岿°æ® |
| | | memberInsuranceJoinMapper.update(null,new UpdateWrapper<MemberInsurance>().lambda() |
| | | .set(MemberInsurance::getDuId,detail.getDuId()) |
| | | .set(MemberInsurance::getDuName,detail.getDuName()) |
| | | .set(MemberInsurance::getWorktypeId,detail.getWorktypeId()) |
| | | .set(MemberInsurance::getWorktypeName,detail.getWorkTypeName()) |
| | | .eq(MemberInsurance::getRelationId,oldModel.getId()) |
| | | ); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | } |