|  |  | 
 |  |  | 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 org.springframework.web.bind.annotation.*; | 
 |  |  | import javax.servlet.http.HttpServletResponse; | 
 |  |  |  | 
 |  |  | import java.math.BigDecimal; | 
 |  |  | import java.util.ArrayList; | 
 |  |  | import java.util.List; | 
 |  |  |  | 
 |  |  | 
 |  |  |     @PostMapping("/page") | 
 |  |  |     @RequiresPermissions("business:applydetail:query") | 
 |  |  |     public ApiResponse<PageData<ApplyDetail>> findPage (@RequestBody PageWrap<ApplyDetailPageDTO> pageWrap) { | 
 |  |  |         return ApiResponse.success(applyDetailService.findPageForCompany(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<ApplyDetailPageDTO> pageWrap, HttpServletResponse response) { | 
 |  |  |         ExcelExporter.build(ApplyDetail.class).export(applyDetailService.findPageForCompany(pageWrap).getRecords(), "投保申请明细信息表", response); | 
 |  |  |         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).exportWithFirstAndEnd(pageData.getRecords(), pageWrap.getModel().getSolutionName()+".xlsx","在保人员名单",null, response); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @ApiOperation("根据ID查询") |