|  |  |  | 
|---|
|  |  |  | 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.model.Solutions; | 
|---|
|  |  |  | import com.doumee.dao.business.model.SolutionsBase; | 
|---|
|  |  |  | import com.doumee.service.business.SolutionsBaseService; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.ArrayList; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import java.util.Objects; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @author 江蹄蹄 | 
|---|
|  |  |  | * @date 2024/01/16 10:03 | 
|---|
|  |  |  | * @date 2024/10/28 19:16 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Api(tags = "保险方案信息表(基表)") | 
|---|
|  |  |  | @Api(tags = "保险方案信息表") | 
|---|
|  |  |  | @RestController | 
|---|
|  |  |  | @RequestMapping("/business/solutionsBase") | 
|---|
|  |  |  | public class SolutionsBaseController extends BaseController { | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping("/updateById") | 
|---|
|  |  |  | @RequiresPermissions("business:solutionsbase:update") | 
|---|
|  |  |  | public ApiResponse updateById(@RequestBody SolutionsBase solutionsBase) { | 
|---|
|  |  |  | solutionsBaseService.updateById(solutionsBase); | 
|---|
|  |  |  | if(Objects.isNull(solutionsBase.getSaveType()) | 
|---|
|  |  |  | || Constants.equalsInteger(solutionsBase.getSaveType(),Constants.ZERO)){ | 
|---|
|  |  |  | solutionsBaseService.updateById(solutionsBase); | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | solutionsBaseService.saveSolutionsRisk(solutionsBase); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("禁用启用") | 
|---|
|  |  |  | @PostMapping("/updateStatus") | 
|---|
|  |  |  | @RequiresPermissions("business:solutionsbase:update") | 
|---|
|  |  |  | public ApiResponse updateStatus(@RequestBody SolutionsBase bean) { | 
|---|
|  |  |  | solutionsBaseService.updateStatus(bean); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("分页查询") | 
|---|
|  |  |  | @PostMapping("/page") | 
|---|
|  |  |  | 
|---|
|  |  |  | return ApiResponse.success(solutionsBaseService.findPage(pageWrap)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("列表查询") | 
|---|
|  |  |  | @PostMapping("/list") | 
|---|
|  |  |  | @RequiresPermissions("business:solutionsbase:query") | 
|---|
|  |  |  | public ApiResponse<List<SolutionsBase>> list (@RequestBody SolutionsBase solutionsBase) { | 
|---|
|  |  |  | return ApiResponse.success(solutionsBaseService.findList(solutionsBase)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("导出Excel") | 
|---|
|  |  |  | @PostMapping("/exportExcel") | 
|---|
|  |  |  | @RequiresPermissions("business:solutionsbase:exportExcel") | 
|---|
|  |  |  | public void exportExcel (@RequestBody PageWrap<SolutionsBase> pageWrap, HttpServletResponse response) { | 
|---|
|  |  |  | ExcelExporter.build(SolutionsBase.class).export(solutionsBaseService.findPage(pageWrap).getRecords(), "保险方案信息表(基表)", response); | 
|---|
|  |  |  | ExcelExporter.build(SolutionsBase.class).export(solutionsBaseService.findPage(pageWrap).getRecords(), "保险方案信息表", response); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("根据ID查询") | 
|---|
|  |  |  | 
|---|
|  |  |  | public ApiResponse findById(@PathVariable Integer id) { | 
|---|
|  |  |  | return ApiResponse.success(solutionsBaseService.findById(id)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("测试生成主方案") | 
|---|
|  |  |  | @GetMapping("/createSolutionBase") | 
|---|
|  |  |  | public ApiResponse createSolutionBase(Integer solutionId) { | 
|---|
|  |  |  | solutionsBaseService.createSolutionBase(solutionId); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|