|  |  |  | 
|---|
|  |  |  | import com.doumee.core.annotation.excel.ExcelExporter; | 
|---|
|  |  |  | import com.doumee.core.annotation.pr.PreventRepeat; | 
|---|
|  |  |  | import com.doumee.core.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.core.model.LoginUserInfo; | 
|---|
|  |  |  | import com.doumee.core.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.core.model.PageData; | 
|---|
|  |  |  | import com.doumee.core.utils.Constants; | 
|---|
|  |  |  | import com.doumee.dao.business.dto.*; | 
|---|
|  |  |  | import com.doumee.dao.business.model.InsuranceApply; | 
|---|
|  |  |  | import com.doumee.dao.business.vo.ApplyPowerVO; | 
|---|
|  |  |  | import com.doumee.dao.business.vo.CountCyclePriceVO; | 
|---|
|  |  |  | import com.doumee.service.business.InsuranceApplyService; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | import org.apache.shiro.authz.annotation.RequiresPermissions; | 
|---|
|  |  |  | import io.swagger.models.auth.In; | 
|---|
|  |  |  | import org.apache.shiro.SecurityUtils; | 
|---|
|  |  |  | import org.apache.shiro.authz.annotation.RequiresPermissions; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  | import javax.servlet.http.HttpServletResponse; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.ArrayList; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import java.util.Objects; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @author 江蹄蹄 | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping("/create") | 
|---|
|  |  |  | @RequiresPermissions("business:insuranceapply:create") | 
|---|
|  |  |  | public ApiResponse create(@RequestBody InsuranceApply insuranceApply) { | 
|---|
|  |  |  | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); | 
|---|
|  |  |  | insuranceApply.setCompanyId(loginUserInfo.getCompanyId()); | 
|---|
|  |  |  | return ApiResponse.success(insuranceApplyService.create(insuranceApply)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PreventRepeat | 
|---|
|  |  |  | @ApiOperation("修改") | 
|---|
|  |  |  | @PostMapping("/updateData") | 
|---|
|  |  |  | @RequiresPermissions("business:insuranceapply:create") | 
|---|
|  |  |  | public ApiResponse updateData(@RequestBody InsuranceApply insuranceApply) { | 
|---|
|  |  |  | return ApiResponse.success(insuranceApplyService.updateData(insuranceApply)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("根据ID删除") | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiOperation("分页查询") | 
|---|
|  |  |  | @PostMapping("/page") | 
|---|
|  |  |  | @RequiresPermissions("business:insuranceapply:query") | 
|---|
|  |  |  | public ApiResponse<PageData<InsuranceApply>> findPage (@RequestBody PageWrap<InsuranceApply> pageWrap) { | 
|---|
|  |  |  | return ApiResponse.success(insuranceApplyService.findPage(pageWrap)); | 
|---|
|  |  |  | public ApiResponse<PageData<InsuranceApply>> findPage (@RequestBody PageWrap<InsuranceApplyQueryDTO> pageWrap) { | 
|---|
|  |  |  | PageData<InsuranceApply> pageData = insuranceApplyService.findPage(pageWrap); | 
|---|
|  |  |  | return ApiResponse.success(pageData); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("列表") | 
|---|
|  |  |  | @PostMapping("/findListByDTO") | 
|---|
|  |  |  | @RequiresPermissions("business:insuranceapply:query") | 
|---|
|  |  |  | public ApiResponse<List<InsuranceApply>> findListByDTO (@RequestBody InsuranceApplyQueryDTO insuranceApplyQueryDTO) { | 
|---|
|  |  |  | return ApiResponse.success(insuranceApplyService.findListByDTO(insuranceApplyQueryDTO)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("导出Excel") | 
|---|
|  |  |  | @PostMapping("/exportExcel") | 
|---|
|  |  |  | @RequiresPermissions("business:insuranceapply:exportExcel") | 
|---|
|  |  |  | public void exportExcel (@RequestBody PageWrap<InsuranceApply> pageWrap, HttpServletResponse response) { | 
|---|
|  |  |  | public void exportExcel (@RequestBody PageWrap<InsuranceApplyQueryDTO> pageWrap, HttpServletResponse response) { | 
|---|
|  |  |  | ExcelExporter.build(InsuranceApply.class).export(insuranceApplyService.findPage(pageWrap).getRecords(), "投保申请信息表", response); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("导出投保详情单") | 
|---|
|  |  |  | @PostMapping("/exportDetailExcel") | 
|---|
|  |  |  | @RequiresPermissions("business:insuranceapply:exportExcel") | 
|---|
|  |  |  | public void exportDetailExcel (@RequestBody  InsuranceApply model, HttpServletResponse response) { | 
|---|
|  |  |  | InsuranceApply insuranceApply =   insuranceApplyService.findDetailForExport(model); | 
|---|
|  |  |  | ExcelExporter.build(InsuranceApply.class).exportApplyDetail(insuranceApply,  response); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | @ApiOperation("根据ID查询") | 
|---|
|  |  |  | @GetMapping("/{id}") | 
|---|
|  |  |  | @RequiresPermissions("business:insuranceapply:query") | 
|---|
|  |  |  | public ApiResponse findById(@PathVariable Integer id) { | 
|---|
|  |  |  | return ApiResponse.success(insuranceApplyService.findById(id)); | 
|---|
|  |  |  | public ApiResponse<InsuranceApply> findById(@PathVariable Integer id) { | 
|---|
|  |  |  | InsuranceApply insuranceApply = insuranceApplyService.findDetail(id); | 
|---|
|  |  |  | return ApiResponse.success(insuranceApply); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | @ApiOperation("企业签署保单") | 
|---|
|  |  |  | @GetMapping("/getSignLink/{id}") | 
|---|
|  |  |  | @RequiresPermissions("business:insuranceapply:query") | 
|---|
|  |  |  | public ApiResponse<String> getSignLink(@PathVariable Integer id) { | 
|---|
|  |  |  | return ApiResponse.success(insuranceApplyService.getSignLink(id)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("申请记录状态处理") | 
|---|
|  |  |  | @PostMapping("/applyOpt") | 
|---|
|  |  |  | public ApiResponse applyOpt (@RequestBody InsuranceApplyOptDTO insuranceApplyOptDTO) { | 
|---|
|  |  |  | insuranceApplyService.applyOpt(insuranceApplyOptDTO); | 
|---|
|  |  |  | return ApiResponse.success("操作成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("获取保单止期与初始金额") | 
|---|
|  |  |  | @PostMapping("/getCountCyclePriceVO") | 
|---|
|  |  |  | public ApiResponse<CountCyclePriceVO> getCountCyclePriceVO (@RequestBody CountCyclePriceDTO countCyclePriceDTO) { | 
|---|
|  |  |  | return ApiResponse.success("操作成功",insuranceApplyService.getCountCyclePriceVO(countCyclePriceDTO)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("获取保障中人数") | 
|---|
|  |  |  | @GetMapping("/guaranteeNum") | 
|---|
|  |  |  | public ApiResponse<Integer> guaranteeNum() { | 
|---|
|  |  |  | return ApiResponse.success(insuranceApplyService.guaranteeNum()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("测试实际金额") | 
|---|
|  |  |  | @GetMapping("/testFee") | 
|---|
|  |  |  | public ApiResponse testFee(Integer id,Integer unionId) { | 
|---|
|  |  |  | insuranceApplyService.updateApplyCurrentFee(id, unionId); | 
|---|
|  |  |  | 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)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("查询保单是否可进行加减保") | 
|---|
|  |  |  | @PostMapping("/getApplyPower") | 
|---|
|  |  |  | @RequiresPermissions("business:insuranceapply:query") | 
|---|
|  |  |  | public ApiResponse<ApplyPowerVO> getApplyPower(@RequestBody ApplyPowerDTO applyPowerDTO) { | 
|---|
|  |  |  | return ApiResponse.success(insuranceApplyService.getApplyPower(applyPowerDTO)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|