|
|
|
|
@ -24,6 +24,7 @@ import org.springblade.core.secure.BladeUser; |
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
import org.springblade.core.tool.utils.DateUtil; |
|
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
|
import org.springblade.desk.basic.constant.BAModuleConst; |
|
|
|
|
import org.springblade.desk.basic.excel.RelTeamSetUserExcel; |
|
|
|
|
import org.springblade.desk.basic.pojo.entity.RelTeamSetUser; |
|
|
|
|
import org.springblade.desk.basic.pojo.vo.RelTeamSetUserVO; |
|
|
|
|
@ -45,7 +46,7 @@ import java.util.stream.Collectors; |
|
|
|
|
* @since 2026-01-13 |
|
|
|
|
*/ |
|
|
|
|
@RestController |
|
|
|
|
@RequestMapping("/RelTeamSetUser") |
|
|
|
|
@RequestMapping(BAModuleConst.CONTROLLER_PREFIX + "/RelTeamSetUser") |
|
|
|
|
@Data |
|
|
|
|
@AllArgsConstructor |
|
|
|
|
@EqualsAndHashCode(callSuper = true) |
|
|
|
|
@ -54,184 +55,184 @@ import java.util.stream.Collectors; |
|
|
|
|
public class RelTeamSetUserController extends BladeController { |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private IRelTeamSetUserService service; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [班组用户关联] 详情 |
|
|
|
|
*/ |
|
|
|
|
@GetMapping("/detail") |
|
|
|
|
@ApiOperationSupport(order = 10) |
|
|
|
|
@Operation(summary = "详情", description = "传入RelTeamSetUser Obj") |
|
|
|
|
public R<RelTeamSetUserVO> detail(RelTeamSetUser relTeamSetUser) { |
|
|
|
|
QueryWrapper<RelTeamSetUser> qw = Condition.getQueryWrapper(relTeamSetUser); |
|
|
|
|
RelTeamSetUser detail = service.getOne(qw); |
|
|
|
|
RelTeamSetUserVO detailVO = RelTeamSetUserWrapper.build().entityVO(detail); |
|
|
|
|
service.setVOValue(detailVO); |
|
|
|
|
return R.data(detailVO); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [班组用户关联] list分页 |
|
|
|
|
*/ |
|
|
|
|
@GetMapping("/list") |
|
|
|
|
@ApiOperationSupport(order = 20) |
|
|
|
|
@Operation(summary = "list分页", description = "传入RelTeamSetUser Obj") |
|
|
|
|
public R<IPage<RelTeamSetUserVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> relTeamSetUser, |
|
|
|
|
Query query) { |
|
|
|
|
private IRelTeamSetUserService service; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [班组用户关联] 详情 |
|
|
|
|
*/ |
|
|
|
|
@GetMapping("/detail") |
|
|
|
|
@ApiOperationSupport(order = 10) |
|
|
|
|
@Operation(summary = "详情", description = "传入RelTeamSetUser Obj") |
|
|
|
|
public R<RelTeamSetUserVO> detail(RelTeamSetUser relTeamSetUser) { |
|
|
|
|
QueryWrapper<RelTeamSetUser> qw = Condition.getQueryWrapper(relTeamSetUser); |
|
|
|
|
RelTeamSetUser detail = service.getOne(qw); |
|
|
|
|
RelTeamSetUserVO detailVO = RelTeamSetUserWrapper.build().entityVO(detail); |
|
|
|
|
service.setVOValue(detailVO); |
|
|
|
|
return R.data(detailVO); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [班组用户关联] list分页 |
|
|
|
|
*/ |
|
|
|
|
@GetMapping("/list") |
|
|
|
|
@ApiOperationSupport(order = 20) |
|
|
|
|
@Operation(summary = "list分页", description = "传入RelTeamSetUser Obj") |
|
|
|
|
public R<IPage<RelTeamSetUserVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> relTeamSetUser, |
|
|
|
|
Query query) { |
|
|
|
|
QueryWrapper<RelTeamSetUser> qw = Condition.getQueryWrapper(relTeamSetUser, RelTeamSetUser.class); |
|
|
|
|
IPage<RelTeamSetUser> pages = service.page(Condition.getPage(query), qw); |
|
|
|
|
IPage<RelTeamSetUserVO> pagesVO = RelTeamSetUserWrapper.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 = "传入RelTeamSetUser Obj") |
|
|
|
|
public R<IPage<RelTeamSetUserVO>> page(RelTeamSetUserVO relTeamSetUser, Query query) { |
|
|
|
|
IPage<RelTeamSetUserVO> pagesVO = service.selectRelTeamSetUserPage( |
|
|
|
|
Condition.getPage(query), relTeamSetUser |
|
|
|
|
); |
|
|
|
|
return R.data(pagesVO); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
IPage<RelTeamSetUser> pages = service.page(Condition.getPage(query), qw); |
|
|
|
|
IPage<RelTeamSetUserVO> pagesVO = RelTeamSetUserWrapper.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 = "传入RelTeamSetUser Obj") |
|
|
|
|
public R<IPage<RelTeamSetUserVO>> page(RelTeamSetUserVO relTeamSetUser, Query query) { |
|
|
|
|
IPage<RelTeamSetUserVO> pagesVO = service.selectRelTeamSetUserPage( |
|
|
|
|
Condition.getPage(query), relTeamSetUser |
|
|
|
|
); |
|
|
|
|
return R.data(pagesVO); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [班组用户关联] list下拉选择 |
|
|
|
|
*/ |
|
|
|
|
@GetMapping("/listForSelect") |
|
|
|
|
@ApiOperationSupport(order = 22) |
|
|
|
|
@Operation(summary = "list下拉选择", description = "") |
|
|
|
|
@Operation(summary = "list下拉选择", description = "") |
|
|
|
|
public R<List<RelTeamSetUserVO>> listForSelect() { |
|
|
|
|
List<RelTeamSetUser> list = service.list(); |
|
|
|
|
List<RelTeamSetUserVO> listVO = RelTeamSetUserWrapper.build().listVO(list); |
|
|
|
|
return R.data(listVO); |
|
|
|
|
List<RelTeamSetUser> list = service.list(); |
|
|
|
|
List<RelTeamSetUserVO> listVO = RelTeamSetUserWrapper.build().listVO(list); |
|
|
|
|
return R.data(listVO); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [班组用户关联] 新增一条 |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/save") |
|
|
|
|
@ApiOperationSupport(order = 30) |
|
|
|
|
@Operation(summary = "新增一条", description = "传入RelTeamSetUser Obj") |
|
|
|
|
public R save(@Valid @RequestBody RelTeamSetUser addOne) { |
|
|
|
|
addOne.setId(null); |
|
|
|
|
return R.status(service.save(addOne)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [班组用户关联] 新增一条 |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/save") |
|
|
|
|
@ApiOperationSupport(order = 30) |
|
|
|
|
@Operation(summary = "新增一条", description = "传入RelTeamSetUser Obj") |
|
|
|
|
public R save(@Valid @RequestBody RelTeamSetUser addOne) { |
|
|
|
|
addOne.setId(null); |
|
|
|
|
return R.status(service.save(addOne)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
/** |
|
|
|
|
* [班组用户关联] 新增批量 |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/saveBat") |
|
|
|
|
@ApiOperationSupport(order = 31) |
|
|
|
|
@Operation(summary = "新增批量", description = "传入RelTeamSetUser List") |
|
|
|
|
public R saveBat(@Valid @RequestBody List<RelTeamSetUser> addList) { |
|
|
|
|
addList.forEach(one -> { |
|
|
|
|
one.setId(null); |
|
|
|
|
}); |
|
|
|
|
return R.status(service.saveBatch(addList)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [班组用户关联] 修改一条 |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/update") |
|
|
|
|
@ApiOperationSupport(order = 40) |
|
|
|
|
@Operation(summary = "修改一条", description = "传入RelTeamSetUser Obj") |
|
|
|
|
public R update(@Valid @RequestBody RelTeamSetUser updateOne) { |
|
|
|
|
return R.status(service.updateById(updateOne)); |
|
|
|
|
} |
|
|
|
|
@PostMapping("/saveBat") |
|
|
|
|
@ApiOperationSupport(order = 31) |
|
|
|
|
@Operation(summary = "新增批量", description = "传入RelTeamSetUser List") |
|
|
|
|
public R saveBat(@Valid @RequestBody List<RelTeamSetUser> addList) { |
|
|
|
|
addList.forEach(one -> { |
|
|
|
|
one.setId(null); |
|
|
|
|
}); |
|
|
|
|
return R.status(service.saveBatch(addList)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [班组用户关联] 修改一条 |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/update") |
|
|
|
|
@ApiOperationSupport(order = 40) |
|
|
|
|
@Operation(summary = "修改一条", description = "传入RelTeamSetUser Obj") |
|
|
|
|
public R update(@Valid @RequestBody RelTeamSetUser updateOne) { |
|
|
|
|
return R.status(service.updateById(updateOne)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [班组用户关联] 修改批量 |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/updateBat") |
|
|
|
|
@ApiOperationSupport(order = 41) |
|
|
|
|
@Operation(summary = "修改批量", description = "传入RelTeamSetUser List") |
|
|
|
|
@Operation(summary = "修改批量", description = "传入RelTeamSetUser List") |
|
|
|
|
public R updateBat(@Valid @RequestBody List<RelTeamSetUser> updateList) { |
|
|
|
|
return R.status(service.updateBatchById(updateList)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [班组用户关联] 新增或修改一条 |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/submit") |
|
|
|
|
@ApiOperationSupport(order = 50) |
|
|
|
|
@Operation(summary = "新增或修改一条", description = "传入RelTeamSetUser Obj") |
|
|
|
|
public R submit(@Valid @RequestBody RelTeamSetUser mergeOne) { |
|
|
|
|
return R.status(service.saveOrUpdate(mergeOne)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
/** |
|
|
|
|
* [班组用户关联] 新增或修改一条 |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/submit") |
|
|
|
|
@ApiOperationSupport(order = 50) |
|
|
|
|
@Operation(summary = "新增或修改一条", description = "传入RelTeamSetUser Obj") |
|
|
|
|
public R submit(@Valid @RequestBody RelTeamSetUser mergeOne) { |
|
|
|
|
return R.status(service.saveOrUpdate(mergeOne)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [班组用户关联] 新增或修改批量 |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/submitBat") |
|
|
|
|
@ApiOperationSupport(order = 51) |
|
|
|
|
@Operation(summary = "新增或修改批量", description = "传入RelTeamSetUser List") |
|
|
|
|
public R submitBat(@Valid @RequestBody List<RelTeamSetUser> 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 = "传入RelTeamSetUser") |
|
|
|
|
public void exportExcel(@Parameter(hidden = true) @RequestParam Map<String, Object> relTeamSetUser, |
|
|
|
|
BladeUser bladeUser, HttpServletResponse response) { |
|
|
|
|
QueryWrapper<RelTeamSetUser> qw = Condition.getQueryWrapper(relTeamSetUser, RelTeamSetUser.class); |
|
|
|
|
//if (!AuthUtil.isAdministrator()) {
|
|
|
|
|
// queryWrapper.lambda().eq(RelTeamSetUser::getTenantId, bladeUser.getTenantId());
|
|
|
|
|
//}
|
|
|
|
|
//queryWrapper.lambda().eq(RelTeamSetUserEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
|
|
|
|
List<RelTeamSetUserExcel> list = service.exportRelTeamSetUser(qw); |
|
|
|
|
ExcelUtil.export(response, "[班组用户关联]数据" + DateUtil.time(), |
|
|
|
|
"[班组用户关联]数据表", list, RelTeamSetUserExcel.class); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
@PostMapping("/submitBat") |
|
|
|
|
@ApiOperationSupport(order = 51) |
|
|
|
|
@Operation(summary = "新增或修改批量", description = "传入RelTeamSetUser List") |
|
|
|
|
public R submitBat(@Valid @RequestBody List<RelTeamSetUser> 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 = "传入RelTeamSetUser") |
|
|
|
|
public void exportExcel(@Parameter(hidden = true) @RequestParam Map<String, Object> relTeamSetUser, |
|
|
|
|
BladeUser bladeUser, HttpServletResponse response) { |
|
|
|
|
QueryWrapper<RelTeamSetUser> qw = Condition.getQueryWrapper(relTeamSetUser, RelTeamSetUser.class); |
|
|
|
|
//if (!AuthUtil.isAdministrator()) {
|
|
|
|
|
// queryWrapper.lambda().eq(RelTeamSetUser::getTenantId, bladeUser.getTenantId());
|
|
|
|
|
//}
|
|
|
|
|
//queryWrapper.lambda().eq(RelTeamSetUserEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
|
|
|
|
List<RelTeamSetUserExcel> list = service.exportRelTeamSetUser(qw); |
|
|
|
|
ExcelUtil.export(response, "[班组用户关联]数据" + DateUtil.time(), |
|
|
|
|
"[班组用户关联]数据表", list, RelTeamSetUserExcel.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<RelTeamSetUser> importList = ExcelUtil.read( |
|
|
|
|
file, 0, 1, RelTeamSetUser.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<RelTeamSetUser> importList = ExcelUtil.read( |
|
|
|
|
file, 0, 1, RelTeamSetUser.class |
|
|
|
|
); |
|
|
|
|
return R.status(service.saveBatch(importList)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|