|
|
|
|
@ -56,184 +56,186 @@ import java.util.stream.Collectors; |
|
|
|
|
public class PlatingSmallController extends BladeController { |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private IPlatingSmallService service; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [镀种小类] 详情 |
|
|
|
|
*/ |
|
|
|
|
@GetMapping("/detail") |
|
|
|
|
@ApiOperationSupport(order = 10) |
|
|
|
|
@Operation(summary = "详情", description = "传入PlatingSmall Obj") |
|
|
|
|
public R<PlatingSmallVO> detail(PlatingSmall platingSmall) { |
|
|
|
|
QueryWrapper<PlatingSmall> qw = Condition.getQueryWrapper(platingSmall); |
|
|
|
|
PlatingSmall detail = service.getOne(qw); |
|
|
|
|
PlatingSmallVO detailVO = PlatingSmallWrapper.build().entityVO(detail); |
|
|
|
|
service.setVOValue(detailVO); |
|
|
|
|
return R.data(detailVO); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [镀种小类] list分页 |
|
|
|
|
*/ |
|
|
|
|
@GetMapping("/list") |
|
|
|
|
@ApiOperationSupport(order = 20) |
|
|
|
|
@Operation(summary = "list分页", description = "传入PlatingSmall Obj") |
|
|
|
|
public R<IPage<PlatingSmallVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> platingSmall, |
|
|
|
|
Query query) { |
|
|
|
|
private IPlatingSmallService service; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [镀种小类] 详情 |
|
|
|
|
*/ |
|
|
|
|
@GetMapping("/detail") |
|
|
|
|
@ApiOperationSupport(order = 10) |
|
|
|
|
@Operation(summary = "详情", description = "传入PlatingSmall Obj") |
|
|
|
|
public R<PlatingSmallVO> detail(PlatingSmall platingSmall) { |
|
|
|
|
QueryWrapper<PlatingSmall> qw = Condition.getQueryWrapper(platingSmall); |
|
|
|
|
PlatingSmall detail = service.getOne(qw); |
|
|
|
|
PlatingSmallVO detailVO = PlatingSmallWrapper.build().entityVO(detail); |
|
|
|
|
service.setVOValue(detailVO); |
|
|
|
|
return R.data(detailVO); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [镀种小类] list分页 |
|
|
|
|
*/ |
|
|
|
|
@GetMapping("/list") |
|
|
|
|
@ApiOperationSupport(order = 20) |
|
|
|
|
@Operation(summary = "list分页", description = "传入PlatingSmall Obj") |
|
|
|
|
public R<IPage<PlatingSmallVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> platingSmall, |
|
|
|
|
Query query) { |
|
|
|
|
QueryWrapper<PlatingSmall> qw = Condition.getQueryWrapper(platingSmall, PlatingSmall.class); |
|
|
|
|
IPage<PlatingSmall> pages = service.page(Condition.getPage(query), qw); |
|
|
|
|
IPage<PlatingSmallVO> pagesVO = PlatingSmallWrapper.build().pageVO(pages); |
|
|
|
|
pagesVO.getRecords() |
|
|
|
|
.stream() |
|
|
|
|
.peek(service::setVOValue) |
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
return R.data(pagesVO); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [镀种小类] page分页 |
|
|
|
|
*/ |
|
|
|
|
@GetMapping("/page") |
|
|
|
|
@ApiOperationSupport(order = 21) |
|
|
|
|
@Operation(summary = "page分页", description = "传入PlatingSmall Obj") |
|
|
|
|
public R<IPage<PlatingSmallVO>> page(PlatingSmallVO platingSmall, Query query) { |
|
|
|
|
IPage<PlatingSmallVO> pagesVO = service.selectPlatingSmallPage( |
|
|
|
|
Condition.getPage(query), platingSmall |
|
|
|
|
); |
|
|
|
|
return R.data(pagesVO); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
// 名称
|
|
|
|
|
qw.like(PlatingSmall.COL_BPS_NAME, Func.toStr(platingSmall.get("bpsName"))); |
|
|
|
|
IPage<PlatingSmall> pages = service.page(Condition.getPage(query), qw); |
|
|
|
|
IPage<PlatingSmallVO> pagesVO = PlatingSmallWrapper.build().pageVO(pages); |
|
|
|
|
pagesVO.getRecords() |
|
|
|
|
.stream() |
|
|
|
|
.peek(service::setVOValue) |
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
return R.data(pagesVO); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [镀种小类] page分页 |
|
|
|
|
*/ |
|
|
|
|
@GetMapping("/page") |
|
|
|
|
@ApiOperationSupport(order = 21) |
|
|
|
|
@Operation(summary = "page分页", description = "传入PlatingSmall Obj") |
|
|
|
|
public R<IPage<PlatingSmallVO>> page(PlatingSmallVO platingSmall, Query query) { |
|
|
|
|
IPage<PlatingSmallVO> pagesVO = service.selectPlatingSmallPage( |
|
|
|
|
Condition.getPage(query), platingSmall |
|
|
|
|
); |
|
|
|
|
return R.data(pagesVO); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [镀种小类] list下拉选择 |
|
|
|
|
*/ |
|
|
|
|
@GetMapping("/listForSelect") |
|
|
|
|
@ApiOperationSupport(order = 22) |
|
|
|
|
@Operation(summary = "list下拉选择", description = "") |
|
|
|
|
@Operation(summary = "list下拉选择", description = "") |
|
|
|
|
public R<List<PlatingSmallVO>> listForSelect() { |
|
|
|
|
List<PlatingSmall> list = service.list(); |
|
|
|
|
List<PlatingSmallVO> listVO = PlatingSmallWrapper.build().listVO(list); |
|
|
|
|
return R.data(listVO); |
|
|
|
|
List<PlatingSmall> list = service.list(); |
|
|
|
|
List<PlatingSmallVO> listVO = PlatingSmallWrapper.build().listVO(list); |
|
|
|
|
return R.data(listVO); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [镀种小类] 新增一条 |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/save") |
|
|
|
|
@ApiOperationSupport(order = 30) |
|
|
|
|
@Operation(summary = "新增一条", description = "传入PlatingSmall Obj") |
|
|
|
|
public R save(@Valid @RequestBody PlatingSmall addOne) { |
|
|
|
|
addOne.setId(null); |
|
|
|
|
return R.status(service.save(addOne)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [镀种小类] 新增一条 |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/save") |
|
|
|
|
@ApiOperationSupport(order = 30) |
|
|
|
|
@Operation(summary = "新增一条", description = "传入PlatingSmall Obj") |
|
|
|
|
public R save(@Valid @RequestBody PlatingSmall addOne) { |
|
|
|
|
addOne.setId(null); |
|
|
|
|
return R.status(service.save(addOne)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
/** |
|
|
|
|
* [镀种小类] 新增批量 |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/saveBat") |
|
|
|
|
@ApiOperationSupport(order = 31) |
|
|
|
|
@Operation(summary = "新增批量", description = "传入PlatingSmall List") |
|
|
|
|
public R saveBat(@Valid @RequestBody List<PlatingSmall> addList) { |
|
|
|
|
addList.forEach(one -> { |
|
|
|
|
one.setId(null); |
|
|
|
|
}); |
|
|
|
|
return R.status(service.saveBatch(addList)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [镀种小类] 修改一条 |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/update") |
|
|
|
|
@ApiOperationSupport(order = 40) |
|
|
|
|
@Operation(summary = "修改一条", description = "传入PlatingSmall Obj") |
|
|
|
|
public R update(@Valid @RequestBody PlatingSmall updateOne) { |
|
|
|
|
return R.status(service.updateById(updateOne)); |
|
|
|
|
} |
|
|
|
|
@PostMapping("/saveBat") |
|
|
|
|
@ApiOperationSupport(order = 31) |
|
|
|
|
@Operation(summary = "新增批量", description = "传入PlatingSmall List") |
|
|
|
|
public R saveBat(@Valid @RequestBody List<PlatingSmall> addList) { |
|
|
|
|
addList.forEach(one -> { |
|
|
|
|
one.setId(null); |
|
|
|
|
}); |
|
|
|
|
return R.status(service.saveBatch(addList)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [镀种小类] 修改一条 |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/update") |
|
|
|
|
@ApiOperationSupport(order = 40) |
|
|
|
|
@Operation(summary = "修改一条", description = "传入PlatingSmall Obj") |
|
|
|
|
public R update(@Valid @RequestBody PlatingSmall updateOne) { |
|
|
|
|
return R.status(service.updateById(updateOne)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [镀种小类] 修改批量 |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/updateBat") |
|
|
|
|
@ApiOperationSupport(order = 41) |
|
|
|
|
@Operation(summary = "修改批量", description = "传入PlatingSmall List") |
|
|
|
|
@Operation(summary = "修改批量", description = "传入PlatingSmall List") |
|
|
|
|
public R updateBat(@Valid @RequestBody List<PlatingSmall> updateList) { |
|
|
|
|
return R.status(service.updateBatchById(updateList)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [镀种小类] 新增或修改一条 |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/submit") |
|
|
|
|
@ApiOperationSupport(order = 50) |
|
|
|
|
@Operation(summary = "新增或修改一条", description = "传入PlatingSmall Obj") |
|
|
|
|
public R submit(@Valid @RequestBody PlatingSmall mergeOne) { |
|
|
|
|
return R.status(service.saveOrUpdate(mergeOne)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
/** |
|
|
|
|
* [镀种小类] 新增或修改一条 |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/submit") |
|
|
|
|
@ApiOperationSupport(order = 50) |
|
|
|
|
@Operation(summary = "新增或修改一条", description = "传入PlatingSmall Obj") |
|
|
|
|
public R submit(@Valid @RequestBody PlatingSmall mergeOne) { |
|
|
|
|
return R.status(service.saveOrUpdate(mergeOne)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [镀种小类] 新增或修改批量 |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/submitBat") |
|
|
|
|
@ApiOperationSupport(order = 51) |
|
|
|
|
@Operation(summary = "新增或修改批量", description = "传入PlatingSmall List") |
|
|
|
|
public R submitBat(@Valid @RequestBody List<PlatingSmall> mergeList) { |
|
|
|
|
return R.status(service.saveOrUpdateBatch(mergeList)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [镀种小类] 逻辑删除 |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/remove") |
|
|
|
|
@ApiOperationSupport(order = 61) |
|
|
|
|
@Operation(summary = "逻辑删除", description = "传入ids") |
|
|
|
|
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) { |
|
|
|
|
return R.status(service.deleteLogic(Func.toLongList(ids))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [镀种小类] 导出Excel |
|
|
|
|
*/ |
|
|
|
|
@GetMapping("/exportExcel") |
|
|
|
|
@ApiOperationSupport(order = 70) |
|
|
|
|
@Operation(summary = "导出Excel", description = "传入PlatingSmall") |
|
|
|
|
public void exportExcel(@Parameter(hidden = true) @RequestParam Map<String, Object> platingSmall, |
|
|
|
|
BladeUser bladeUser, HttpServletResponse response) { |
|
|
|
|
QueryWrapper<PlatingSmall> qw = Condition.getQueryWrapper(platingSmall, PlatingSmall.class); |
|
|
|
|
//if (!AuthUtil.isAdministrator()) {
|
|
|
|
|
// queryWrapper.lambda().eq(PlatingSmall::getTenantId, bladeUser.getTenantId());
|
|
|
|
|
//}
|
|
|
|
|
//queryWrapper.lambda().eq(PlatingSmallEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
|
|
|
|
List<PlatingSmallExcel> list = service.exportPlatingSmall(qw); |
|
|
|
|
ExcelUtil.export(response, "[镀种小类]数据" + DateUtil.time(), |
|
|
|
|
"[镀种小类]数据表", list, PlatingSmallExcel.class); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
@PostMapping("/submitBat") |
|
|
|
|
@ApiOperationSupport(order = 51) |
|
|
|
|
@Operation(summary = "新增或修改批量", description = "传入PlatingSmall List") |
|
|
|
|
public R submitBat(@Valid @RequestBody List<PlatingSmall> mergeList) { |
|
|
|
|
return R.status(service.saveOrUpdateBatch(mergeList)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [镀种小类] 逻辑删除 |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/remove") |
|
|
|
|
@ApiOperationSupport(order = 61) |
|
|
|
|
@Operation(summary = "逻辑删除", description = "传入ids") |
|
|
|
|
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) { |
|
|
|
|
return R.status(service.deleteLogic(Func.toLongList(ids))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [镀种小类] 导出Excel |
|
|
|
|
*/ |
|
|
|
|
@GetMapping("/exportExcel") |
|
|
|
|
@ApiOperationSupport(order = 70) |
|
|
|
|
@Operation(summary = "导出Excel", description = "传入PlatingSmall") |
|
|
|
|
public void exportExcel(@Parameter(hidden = true) @RequestParam Map<String, Object> platingSmall, |
|
|
|
|
BladeUser bladeUser, HttpServletResponse response) { |
|
|
|
|
QueryWrapper<PlatingSmall> qw = Condition.getQueryWrapper(platingSmall, PlatingSmall.class); |
|
|
|
|
//if (!AuthUtil.isAdministrator()) {
|
|
|
|
|
// queryWrapper.lambda().eq(PlatingSmall::getTenantId, bladeUser.getTenantId());
|
|
|
|
|
//}
|
|
|
|
|
//queryWrapper.lambda().eq(PlatingSmallEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
|
|
|
|
List<PlatingSmallExcel> list = service.exportPlatingSmall(qw); |
|
|
|
|
ExcelUtil.export(response, "[镀种小类]数据" + DateUtil.time(), |
|
|
|
|
"[镀种小类]数据表", list, PlatingSmallExcel.class); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [镀种小类] 下载Excel模板 |
|
|
|
|
*/ |
|
|
|
|
@GetMapping("/downloadExcelTemplate") |
|
|
|
|
@ApiOperationSupport(order = 71) |
|
|
|
|
@Operation(summary = "下载Excel模板", description = "") |
|
|
|
|
public ResponseEntity<org.springframework.core.io.Resource> downloadExcelTemplate() { |
|
|
|
|
return ExcelExtUtil.downloadXlsTemplate( |
|
|
|
|
"Excel/QA/ImportTemplate-CycleTestItem.xls", |
|
|
|
|
"导入模版-周期试验项目.xls"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [镀种小类] 导入Excel |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/importExcel") |
|
|
|
|
@ApiOperationSupport(order = 72) |
|
|
|
|
@Operation(summary = "导入Excel", description = "MultipartFile") |
|
|
|
|
public R importExcel(@RequestParam("file") MultipartFile file) { |
|
|
|
|
R checkR = ExcelExtUtil.importExcelCheck(file); |
|
|
|
|
if (checkR != null) { |
|
|
|
|
return checkR; |
|
|
|
|
} |
|
|
|
|
List<PlatingSmall> importList = ExcelUtil.read( |
|
|
|
|
file, 0, 1, PlatingSmall.class |
|
|
|
|
); |
|
|
|
|
return R.status(service.saveBatch(importList)); |
|
|
|
|
} |
|
|
|
|
@GetMapping("/downloadExcelTemplate") |
|
|
|
|
@ApiOperationSupport(order = 71) |
|
|
|
|
@Operation(summary = "下载Excel模板", description = "") |
|
|
|
|
public ResponseEntity<org.springframework.core.io.Resource> downloadExcelTemplate() { |
|
|
|
|
return ExcelExtUtil.downloadXlsTemplate( |
|
|
|
|
"Excel/QA/ImportTemplate-CycleTestItem.xls", |
|
|
|
|
"导入模版-周期试验项目.xls"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [镀种小类] 导入Excel |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/importExcel") |
|
|
|
|
@ApiOperationSupport(order = 72) |
|
|
|
|
@Operation(summary = "导入Excel", description = "MultipartFile") |
|
|
|
|
public R importExcel(@RequestParam("file") MultipartFile file) { |
|
|
|
|
R checkR = ExcelExtUtil.importExcelCheck(file); |
|
|
|
|
if (checkR != null) { |
|
|
|
|
return checkR; |
|
|
|
|
} |
|
|
|
|
List<PlatingSmall> importList = ExcelUtil.read( |
|
|
|
|
file, 0, 1, PlatingSmall.class |
|
|
|
|
); |
|
|
|
|
return R.status(service.saveBatch(importList)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|