|  |  | 
 |  |  | import com.doumee.core.model.ApiResponse; | 
 |  |  | import com.doumee.core.model.PageData; | 
 |  |  | import com.doumee.core.model.PageWrap; | 
 |  |  | import com.doumee.dao.business.dto.CloseDTO; | 
 |  |  | import com.doumee.dao.business.dto.SaveUnionChangeDTO; | 
 |  |  | import com.doumee.dao.business.dto.SmsCheckDTO; | 
 |  |  | import com.doumee.dao.business.dto.UnionChangeBXDDTO; | 
 |  |  | import com.doumee.dao.business.model.UnionApply; | 
 |  |  | import com.doumee.dao.business.model.UnionChange; | 
 |  |  | import com.doumee.service.business.InsuranceApplyService; | 
 |  |  | import com.doumee.service.business.UnionChangeService; | 
 |  |  | import io.swagger.annotations.Api; | 
 |  |  | import io.swagger.annotations.ApiOperation; | 
 |  |  | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private UnionChangeService unionChangeService; | 
 |  |  |     @Autowired | 
 |  |  |     private InsuranceApplyService insuranceApplyService; | 
 |  |  |  | 
 |  |  |     @PreventRepeat | 
 |  |  |     @ApiOperation("新建") | 
 |  |  | 
 |  |  |     @GetMapping("/{id}") | 
 |  |  |     @RequiresPermissions("business:unionchange:query") | 
 |  |  |     public ApiResponse findById(@PathVariable Integer id) { | 
 |  |  |         return ApiResponse.success(unionChangeService.findById(id)); | 
 |  |  |         return ApiResponse.success(unionChangeService.getDetail(id)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @PreventRepeat | 
 |  |  |     @ApiOperation("创建合并单") | 
 |  |  |     @PostMapping("/merge") | 
 |  |  |     @RequiresPermissions("business:unionchange:create") | 
 |  |  |     public ApiResponse merge(@RequestBody SaveUnionChangeDTO saveUnionChangeDTO) { | 
 |  |  |         return ApiResponse.success(unionChangeService.merge(saveUnionChangeDTO)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @ApiOperation("关闭合并单") | 
 |  |  |     @PostMapping("/close") | 
 |  |  |     @RequiresPermissions("business:unionchange:close") | 
 |  |  |     public ApiResponse close(@RequestBody CloseDTO closeDTO) { | 
 |  |  |         unionChangeService.cancelMerge(closeDTO); | 
 |  |  |         return ApiResponse.success(null); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @ApiOperation("签署申请单") | 
 |  |  |     @PostMapping("/getSignLink") | 
 |  |  |     @RequiresPermissions("business:unionchange:sign") | 
 |  |  |     public ApiResponse getSignLink(@RequestBody SmsCheckDTO smsCheckDTO) { | 
 |  |  |         return ApiResponse.success(unionChangeService.getSignLink(smsCheckDTO)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @ApiOperation("上传保险单") | 
 |  |  |     @PostMapping("/uploadBXD") | 
 |  |  |     @RequiresPermissions("business:unionchange:uploadBXD") | 
 |  |  |     public ApiResponse uploadBXD(@RequestBody UnionChangeBXDDTO unionChangeBXDDTO) { | 
 |  |  |         unionChangeService.uploadBXD(unionChangeBXDDTO); | 
 |  |  |         insuranceApplyService.updateApplyCurrentFee(null,unionChangeBXDDTO.getApplyId()); | 
 |  |  |         return ApiResponse.success(null); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @ApiOperation("导出投保详情单") | 
 |  |  |     @PostMapping("/exportDetailExcel") | 
 |  |  |     @RequiresPermissions("business:unionchange:exportExcel") | 
 |  |  |     public void exportDetailExcel (@RequestBody UnionChange model, HttpServletResponse response) { | 
 |  |  |         ExcelExporter.build(UnionChange.class).exportUnionChangeDetail(unionChangeService.unionChangeDetail(model.getId()),  response); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  | } |