|  |  |  | 
|---|
|  |  |  | import com.doumee.core.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.core.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.core.model.PageData; | 
|---|
|  |  |  | import com.doumee.core.utils.Constants; | 
|---|
|  |  |  | import com.doumee.dao.business.dto.CountCyclePriceDTO; | 
|---|
|  |  |  | import com.doumee.dao.business.dto.InsuranceApplyOptDTO; | 
|---|
|  |  |  | import com.doumee.dao.business.dto.InsuranceApplyQueryDTO; | 
|---|
|  |  |  | import com.doumee.dao.business.dto.SmsCheckDTO; | 
|---|
|  |  |  | import com.doumee.dao.business.model.InsuranceApply; | 
|---|
|  |  |  | import com.doumee.dao.business.vo.CountCyclePriceVO; | 
|---|
|  |  |  | import com.doumee.service.business.InsuranceApplyService; | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.ArrayList; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import java.util.Objects; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @author 江蹄蹄 | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping("/page") | 
|---|
|  |  |  | @RequiresPermissions("business:insuranceapply:query") | 
|---|
|  |  |  | public ApiResponse<PageData<InsuranceApply>> findPage (@RequestBody PageWrap<InsuranceApplyQueryDTO> pageWrap) { | 
|---|
|  |  |  | return ApiResponse.success(insuranceApplyService.findPage(pageWrap)); | 
|---|
|  |  |  | PageData<InsuranceApply> pageData = insuranceApplyService.findPage(pageWrap); | 
|---|
|  |  |  | pageData.getRecords().forEach(i->{ | 
|---|
|  |  |  | if(i.getSolutionType().equals(Constants.ONE)&&!i.getStatus().equals(Constants.InsuranceApplyStatus.WTB_DONE.getKey())){ | 
|---|
|  |  |  | i.setFee(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | return ApiResponse.success(pageData); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("列表") | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping("/exportDetailExcel") | 
|---|
|  |  |  | @RequiresPermissions("business:insuranceapply:exportExcel") | 
|---|
|  |  |  | public void exportDetailExcel (@RequestBody  InsuranceApply model, HttpServletResponse response) { | 
|---|
|  |  |  | ExcelExporter.build(InsuranceApply.class).exportApplyDetail(insuranceApplyService.findDetailForExport(model),  response); | 
|---|
|  |  |  | InsuranceApply insuranceApply =   insuranceApplyService.findDetailForExport(model); | 
|---|
|  |  |  | if(Objects.nonNull(insuranceApply)&&insuranceApply.getSolutionType().equals(Constants.ONE) | 
|---|
|  |  |  | &&!insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.WTB_DONE.getKey())){ | 
|---|
|  |  |  | insuranceApply.setFee(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ExcelExporter.build(InsuranceApply.class).exportApplyDetail(insuranceApply,  response); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | @ApiOperation("根据ID查询") | 
|---|
|  |  |  | @GetMapping("/{id}") | 
|---|
|  |  |  | @RequiresPermissions("business:insuranceapply:query") | 
|---|
|  |  |  | public ApiResponse<InsuranceApply> findById(@PathVariable Integer id) { | 
|---|
|  |  |  | return ApiResponse.success(insuranceApplyService.findDetail(id)); | 
|---|
|  |  |  | InsuranceApply insuranceApply = insuranceApplyService.findDetail(id); | 
|---|
|  |  |  | if(Objects.nonNull(insuranceApply)&&insuranceApply.getSolutionType().equals(Constants.ONE)&&!insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.WTB_DONE.getKey())){ | 
|---|
|  |  |  | insuranceApply.setFee(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return ApiResponse.success(insuranceApply); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | @ApiOperation("根据ID查询") | 
|---|
|  |  |  | @ApiOperation("企业签署保单") | 
|---|
|  |  |  | @GetMapping("/getSignLink/{id}") | 
|---|
|  |  |  | @RequiresPermissions("business:insuranceapply:query") | 
|---|
|  |  |  | public ApiResponse<String> getSignLink(@PathVariable Integer id) { | 
|---|
|  |  |  | 
|---|
|  |  |  | return ApiResponse.success("操作成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("获取保单止期与初始金额") | 
|---|
|  |  |  | @PostMapping("/getCountCyclePriceVO") | 
|---|
|  |  |  | public ApiResponse<CountCyclePriceVO> getCountCyclePriceVO (@RequestBody CountCyclePriceDTO countCyclePriceDTO) { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("获取保障中人数") | 
|---|
|  |  |  | @GetMapping("/guaranteeNum") | 
|---|
|  |  |  | public ApiResponse<Integer> guaranteeNum() { | 
|---|
|  |  |  | return ApiResponse.success(insuranceApplyService.guaranteeNum()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("测试实际金额") | 
|---|
|  |  |  | @GetMapping("/testFee") | 
|---|
|  |  |  | public ApiResponse testFee(@RequestParam Integer id) { | 
|---|
|  |  |  | public ApiResponse testFee(Integer id) { | 
|---|
|  |  |  | insuranceApplyService.updateApplyCurrentFee(id); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("测试生成待续保通知") | 
|---|
|  |  |  | @GetMapping("/generateNotice") | 
|---|
|  |  |  | public ApiResponse generateNotice() { | 
|---|
|  |  |  | insuranceApplyService.generateNotice(); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("方案确认书签章业务") | 
|---|
|  |  |  | @PostMapping("/signTBQRSLink") | 
|---|
|  |  |  | @RequiresPermissions("business:insuranceapply:query") | 
|---|
|  |  |  | public ApiResponse<String> getSignTBQRSLink(@RequestBody SmsCheckDTO smsCheckDTO) { | 
|---|
|  |  |  | return ApiResponse.success(insuranceApplyService.getSignTBQRSLink(smsCheckDTO)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | @ApiOperation("人员名单签章") | 
|---|
|  |  |  | @PostMapping("/getMemberListOnlineSignLink") | 
|---|
|  |  |  | @RequiresPermissions("business:insuranceapply:query") | 
|---|
|  |  |  | public ApiResponse<String> getMemberListOnlineSignLink(@RequestBody SmsCheckDTO smsCheckDTO) { | 
|---|
|  |  |  | return ApiResponse.success(insuranceApplyService.getMemberListOnlineSignLink(smsCheckDTO)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("投保申请单签章业务") | 
|---|
|  |  |  | @PostMapping("/getSignWTBTBDLink") | 
|---|
|  |  |  | @RequiresPermissions("business:insuranceapply:query") | 
|---|
|  |  |  | public ApiResponse<String> getSignWTBTBDLink(@RequestBody SmsCheckDTO smsCheckDTO) { | 
|---|
|  |  |  | return ApiResponse.success(insuranceApplyService.getSignWTBTBDLink(smsCheckDTO)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|