|  |  |  | 
|---|
|  |  |  | 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.ApplyDetailPageDTO; | 
|---|
|  |  |  | import com.doumee.dao.business.model.ApplyDetail; | 
|---|
|  |  |  | import com.doumee.service.business.ApplyDetailService; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  | import javax.servlet.http.HttpServletResponse; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.math.BigDecimal; | 
|---|
|  |  |  | import java.util.ArrayList; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiOperation("分页查询") | 
|---|
|  |  |  | @PostMapping("/page") | 
|---|
|  |  |  | @RequiresPermissions("business:applydetail:query") | 
|---|
|  |  |  | public ApiResponse<PageData<ApplyDetail>> findPage (@RequestBody PageWrap<ApplyDetail> pageWrap) { | 
|---|
|  |  |  | return ApiResponse.success(applyDetailService.findPage(pageWrap)); | 
|---|
|  |  |  | public ApiResponse<PageData<ApplyDetail>> findPage (@RequestBody PageWrap<ApplyDetailPageDTO> pageWrap) { | 
|---|
|  |  |  | PageData<ApplyDetail> pageData = applyDetailService.findPageForCompany(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("导出Excel") | 
|---|
|  |  |  | @ApiOperation("列表查询") | 
|---|
|  |  |  | @PostMapping("/findList") | 
|---|
|  |  |  | @RequiresPermissions("business:applydetail:query") | 
|---|
|  |  |  | public ApiResponse<List<ApplyDetail>> findList (@RequestBody ApplyDetailPageDTO applyDetailPageDTO) { | 
|---|
|  |  |  | return ApiResponse.success(applyDetailService.findListForCompany(applyDetailPageDTO)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("查询全部") | 
|---|
|  |  |  | @PostMapping("/list") | 
|---|
|  |  |  | @RequiresPermissions("business:applydetail:query") | 
|---|
|  |  |  | public ApiResponse<List<ApplyDetail>> list (@RequestBody  ApplyDetail pageWrap) { | 
|---|
|  |  |  | return ApiResponse.success(applyDetailService.findList(pageWrap)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("导出在保人员详单Excel") | 
|---|
|  |  |  | @PostMapping("/exportExcel") | 
|---|
|  |  |  | @RequiresPermissions("business:applydetail:exportExcel") | 
|---|
|  |  |  | public void exportExcel (@RequestBody PageWrap<ApplyDetail> pageWrap, HttpServletResponse response) { | 
|---|
|  |  |  | ExcelExporter.build(ApplyDetail.class).export(applyDetailService.findPage(pageWrap).getRecords(), "投保申请明细信息表", response); | 
|---|
|  |  |  | public void exportExcel (@RequestBody PageWrap<ApplyDetailPageDTO> pageWrap, HttpServletResponse response) { | 
|---|
|  |  |  | pageWrap.getModel().setIsExcel(Constants.ONE); | 
|---|
|  |  |  | PageData<ApplyDetail> pageData = applyDetailService.findPageForCompany(pageWrap); | 
|---|
|  |  |  | pageData.getRecords().forEach(i->{ | 
|---|
|  |  |  | if(i.getSolutionType().equals(Constants.ONE)&&!i.getStatus().equals(Constants.InsuranceApplyStatus.WTB_DONE.getKey())){ | 
|---|
|  |  |  | i.setFee(BigDecimal.ZERO); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | ExcelExporter.build(ApplyDetail.class).exportWithSheetAndFirstAndEnd(pageData.getRecords(), pageWrap.getModel().getSolutionName()+".xlsx","《"+pageWrap.getModel().getSolutionName()+"》"+"保单人员信息",null, "保单人员",response); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("根据ID查询") | 
|---|
|  |  |  | 
|---|
|  |  |  | public ApiResponse findById(@PathVariable Integer id) { | 
|---|
|  |  |  | return ApiResponse.success(applyDetailService.findById(id)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("查询员工投保记录") | 
|---|
|  |  |  | @GetMapping("/getMemberApplyList") | 
|---|
|  |  |  | public ApiResponse<List<ApplyDetail>> getMemberApplyList(@RequestParam Integer memberId) { | 
|---|
|  |  |  | return ApiResponse.success(applyDetailService.getMemberApplyList(memberId)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("查询人员可报案数据") | 
|---|
|  |  |  | @GetMapping("/getMemberSettleClaimsList") | 
|---|
|  |  |  | public ApiResponse<List<ApplyDetail>> getMemberSettleClaimsList(@RequestParam Integer memberId) { | 
|---|
|  |  |  | return ApiResponse.success(applyDetailService.getMemberSettleClaimsList(memberId)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|