|
@@ -32,8 +32,7 @@ import cn.ezhizao.project.business.service.IBizResourceAllocationService;
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping("/business/resourceAllocation")
|
|
|
-public class BizResourceAllocationController extends BaseController
|
|
|
-{
|
|
|
+public class BizResourceAllocationController extends BaseController {
|
|
|
@Resource
|
|
|
private IBizResourceAllocationService bizResourceAllocationService;
|
|
|
@Resource
|
|
@@ -44,8 +43,7 @@ public class BizResourceAllocationController extends BaseController
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('business:resourceAllocation:list')")
|
|
|
@GetMapping("/list")
|
|
|
- public TableDataInfo list(BizResourceAllocation bizResourceAllocation) throws NoSuchFieldException, IllegalAccessException
|
|
|
- {
|
|
|
+ public TableDataInfo list(BizResourceAllocation bizResourceAllocation) throws NoSuchFieldException, IllegalAccessException {
|
|
|
String tenantId = request.getHeader("tenantId");
|
|
|
bizResourceAllocation.setTenantId(Long.valueOf(tenantId));
|
|
|
startPage();
|
|
@@ -59,8 +57,7 @@ public class BizResourceAllocationController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('business:resourceAllocation:export')")
|
|
|
@Log(title = "资源分配", businessType = BusinessType.EXPORT)
|
|
|
@PostMapping("/export")
|
|
|
- public void export(HttpServletResponse response, BizResourceAllocation bizResourceAllocation) throws NoSuchFieldException, IllegalAccessException
|
|
|
- {
|
|
|
+ public void export(HttpServletResponse response, BizResourceAllocation bizResourceAllocation) throws NoSuchFieldException, IllegalAccessException {
|
|
|
setTenantId(bizResourceAllocation);
|
|
|
List<BizResourceAllocation> list = bizResourceAllocationService.getList(bizResourceAllocation);
|
|
|
ExcelUtil<BizResourceAllocation> util = new ExcelUtil<BizResourceAllocation>(BizResourceAllocation.class);
|
|
@@ -72,8 +69,7 @@ public class BizResourceAllocationController extends BaseController
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('business:resourceAllocation:query')")
|
|
|
@GetMapping(value = "/{id}")
|
|
|
- public AjaxResult getInfo(@PathVariable("id") Long id)
|
|
|
- {
|
|
|
+ public AjaxResult getInfo(@PathVariable("id") Long id) {
|
|
|
return success(bizResourceAllocationService.getById(id));
|
|
|
}
|
|
|
|
|
@@ -83,19 +79,19 @@ public class BizResourceAllocationController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('business:resourceAllocation:add')")
|
|
|
@Log(title = "资源分配", businessType = BusinessType.INSERT)
|
|
|
@PostMapping
|
|
|
- public AjaxResult save(@RequestBody List<BizResourceAllocation> bizResourceAllocation) throws NoSuchFieldException, IllegalAccessException
|
|
|
- {
|
|
|
+ public AjaxResult save(@RequestBody List<BizResourceAllocation> bizResourceAllocation) throws NoSuchFieldException, IllegalAccessException {
|
|
|
String tenantId = request.getHeader("tenantId");
|
|
|
QueryWrapper queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.eq("tenant_id" , Long.valueOf(tenantId));
|
|
|
+ if (!"0".equals(tenantId)){
|
|
|
+ queryWrapper.eq("tenant_id", Long.valueOf(tenantId));
|
|
|
+ }
|
|
|
queryWrapper.eq("dept_user_id", bizResourceAllocation.get(0).getDeptUserId());
|
|
|
List<BizResourceAllocation> oldList = bizResourceAllocationService.list(queryWrapper);
|
|
|
- for (BizResourceAllocation item: bizResourceAllocation
|
|
|
- ) {
|
|
|
+ for (BizResourceAllocation item : bizResourceAllocation) {
|
|
|
item.setTenantId(Long.valueOf(tenantId));
|
|
|
}
|
|
|
|
|
|
- return toAjax(saveOrUpdateBatch(bizResourceAllocationService,bizResourceAllocation,oldList));
|
|
|
+ return toAjax(saveOrUpdateBatch(bizResourceAllocationService, bizResourceAllocation, oldList));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -104,8 +100,7 @@ public class BizResourceAllocationController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('business:resourceAllocation:edit')")
|
|
|
@Log(title = "资源分配", businessType = BusinessType.UPDATE)
|
|
|
@PutMapping
|
|
|
- public AjaxResult edit(@RequestBody BizResourceAllocation bizResourceAllocation) throws NoSuchFieldException, IllegalAccessException
|
|
|
- {
|
|
|
+ public AjaxResult edit(@RequestBody BizResourceAllocation bizResourceAllocation) throws NoSuchFieldException, IllegalAccessException {
|
|
|
String tenantId = request.getHeader("tenantId");
|
|
|
bizResourceAllocation.setTenantId(Long.valueOf(tenantId));
|
|
|
return toAjax(bizResourceAllocationService.updateById(bizResourceAllocation));
|
|
@@ -116,9 +111,8 @@ public class BizResourceAllocationController extends BaseController
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('business:resourceAllocation:remove')")
|
|
|
@Log(title = "资源分配", businessType = BusinessType.DELETE)
|
|
|
- @DeleteMapping("/{ids}")
|
|
|
- public AjaxResult remove(@PathVariable List<Long> ids)
|
|
|
- {
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
+ public AjaxResult remove(@PathVariable List<Long> ids) {
|
|
|
return toAjax(bizResourceAllocationService.removeBatchByIds(ids));
|
|
|
}
|
|
|
}
|