|
|
|
@ -3,6 +3,7 @@ package com.hnac.hzims.spare.controller;
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
|
|
|
|
import com.hnac.hzims.AssetsConstants; |
|
|
|
|
import com.hnac.hzims.common.logs.annotation.OperationAnnotation; |
|
|
|
|
import com.hnac.hzims.common.logs.enums.BusinessType; |
|
|
|
|
import com.hnac.hzims.common.logs.enums.OperatorType; |
|
|
|
@ -12,6 +13,8 @@ import com.hnac.hzims.spare.entity.WtSpBasicEntity;
|
|
|
|
|
import com.hnac.hzims.spare.service.IWtSpBasicService; |
|
|
|
|
import com.hnac.hzims.spare.service.IWtSpManagementService; |
|
|
|
|
import com.hnac.hzims.spare.vo.WtSpBasicVO; |
|
|
|
|
import com.hnac.hzinfo.log.annotation.Business; |
|
|
|
|
import com.hnac.hzinfo.log.annotation.Operate; |
|
|
|
|
import io.swagger.annotations.*; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import org.springblade.core.boot.ctrl.BladeController; |
|
|
|
@ -44,6 +47,7 @@ import java.util.Map;
|
|
|
|
|
@AllArgsConstructor |
|
|
|
|
@RequestMapping("/SP_BASIC") |
|
|
|
|
@Api(value = "备品备件基础信息", tags = "备品备件基础信息") |
|
|
|
|
@Business(module = AssetsConstants.APP_NAME,value = "备品备件基础信息",ignore = false) |
|
|
|
|
public class WtSpBasicController extends BladeController { |
|
|
|
|
|
|
|
|
|
private final IWtSpBasicService SP_BASICService; |
|
|
|
@ -57,6 +61,7 @@ public class WtSpBasicController extends BladeController {
|
|
|
|
|
@GetMapping("/detail") |
|
|
|
|
@ApiOperationSupport(order = 1) |
|
|
|
|
@ApiOperation(value = "详情", notes = "传入SP_BASIC") |
|
|
|
|
@Operate(label = "备品备件基础信息详情",type = com.hnac.hzinfo.log.contants.BusinessType.QUERY,ignore = false) |
|
|
|
|
public R<WtSpBasicEntity> detail(WtSpBasicEntity SP_BASIC) { |
|
|
|
|
WtSpBasicEntity detail = SP_BASICService.getOne(Condition.getQueryWrapper(SP_BASIC)); |
|
|
|
|
return R.data(detail); |
|
|
|
@ -69,6 +74,7 @@ public class WtSpBasicController extends BladeController {
|
|
|
|
|
@ApiIgnore |
|
|
|
|
@ApiOperationSupport(order = 2) |
|
|
|
|
@ApiOperation(value = "分页", notes = "传入SP_BASIC") |
|
|
|
|
@Operate(label = "备品备件基础信息分页",type = com.hnac.hzinfo.log.contants.BusinessType.QUERY,ignore = false) |
|
|
|
|
public R<IPage<WtSpBasicEntity>> list(WtSpBasicEntity SP_BASIC, Query query) { |
|
|
|
|
BladeUser bladeUser = AuthUtil.getUser(); |
|
|
|
|
IPage<WtSpBasicEntity> pages = SP_BASICService.page(Condition.getPage(query), Condition.getQueryWrapper(SP_BASIC)); |
|
|
|
@ -80,6 +86,7 @@ public class WtSpBasicController extends BladeController {
|
|
|
|
|
@GetMapping("/stockList") |
|
|
|
|
@ApiOperationSupport(order = 2) |
|
|
|
|
@ApiOperation(value = "临时库存台账", notes = "传入SP_BASIC") |
|
|
|
|
@Operate(label = "临时库存台账",type = com.hnac.hzinfo.log.contants.BusinessType.QUERY,ignore = false) |
|
|
|
|
public R<IPage<SpTemporaryStockEntity>> stockList(WtSpBasicEntity SP_BASIC, Query query) { |
|
|
|
|
IPage<SpTemporaryStockEntity> pages = SP_BASICService.stockList(SP_BASIC, query); |
|
|
|
|
return R.data(pages); |
|
|
|
@ -88,6 +95,7 @@ public class WtSpBasicController extends BladeController {
|
|
|
|
|
@GetMapping("/stockDetail") |
|
|
|
|
@ApiOperationSupport(order = 2) |
|
|
|
|
@ApiOperation(value = "临时库存台账明细", notes = "传入SP_BASIC") |
|
|
|
|
@Operate(label = "临时库存台账明细",type = com.hnac.hzinfo.log.contants.BusinessType.QUERY,ignore = false) |
|
|
|
|
public R<List<SpTemporaryStockDetailEntity>> stockDetail(Long id) { |
|
|
|
|
List<SpTemporaryStockDetailEntity> list = SP_BASICService.stockDetail(id); |
|
|
|
|
return R.data(list); |
|
|
|
@ -103,6 +111,7 @@ public class WtSpBasicController extends BladeController {
|
|
|
|
|
@OperationAnnotation(moduleName = "资产管理",title = "物资库存台账",operatorType = OperatorType.MOBILE,businessType = |
|
|
|
|
BusinessType.GENCODE, |
|
|
|
|
action = "分页查询物资库存台账列表") |
|
|
|
|
@Operate(label = "分页查询物资库存台账列表",type = com.hnac.hzinfo.log.contants.BusinessType.QUERY,ignore = false) |
|
|
|
|
public R<IPage<WtSpBasicVO>> pageList(WtSpBasicEntity SP_BASIC, Query query, Long warehouseId, String sign) { |
|
|
|
|
IPage<WtSpBasicVO> pages = SP_BASICService.selectPage(SP_BASIC, query,warehouseId,sign); |
|
|
|
|
return R.data(pages); |
|
|
|
@ -115,6 +124,7 @@ public class WtSpBasicController extends BladeController {
|
|
|
|
|
}) |
|
|
|
|
@ApiOperationSupport(order = 2) |
|
|
|
|
@ApiOperation(value = "备件列表", notes = "传入basic") |
|
|
|
|
@Operate(label = "备件列表",type = com.hnac.hzinfo.log.contants.BusinessType.QUERY,ignore = false) |
|
|
|
|
public R<List<WtSpBasicEntity>> getlist(@ApiIgnore @RequestParam Map<String, Object> basic) { |
|
|
|
|
List<WtSpBasicEntity> list = SP_BASICService.getList(basic); |
|
|
|
|
return R.data(list); |
|
|
|
@ -126,6 +136,7 @@ public class WtSpBasicController extends BladeController {
|
|
|
|
|
@PostMapping("/save") |
|
|
|
|
@ApiOperationSupport(order = 4) |
|
|
|
|
@ApiOperation(value = "新增", notes = "传入SP_BASIC") |
|
|
|
|
@Operate(label = "备品备件基础信息新增",type = com.hnac.hzinfo.log.contants.BusinessType.INSERT,ignore = false) |
|
|
|
|
public R save(@Valid @RequestBody WtSpBasicEntity SP_BASIC) { |
|
|
|
|
List<WtSpBasicEntity> wtSpBasicEntityList = SP_BASICService.list(Wrappers.<WtSpBasicEntity>lambdaQuery() |
|
|
|
|
.eq(WtSpBasicEntity::getCode, SP_BASIC.getCode())); |
|
|
|
@ -140,6 +151,7 @@ public class WtSpBasicController extends BladeController {
|
|
|
|
|
@PostMapping("/update") |
|
|
|
|
@ApiOperationSupport(order = 5) |
|
|
|
|
@ApiOperation(value = "修改", notes = "传入SP_BASIC") |
|
|
|
|
@Operate(label = "备品备件基础信息修改",type = com.hnac.hzinfo.log.contants.BusinessType.UPDATE,ignore = false) |
|
|
|
|
public R update(@Valid @RequestBody WtSpBasicEntity SP_BASIC) { |
|
|
|
|
List<WtSpBasicEntity> wtSpBasicEntityList = SP_BASICService.list(Wrappers.<WtSpBasicEntity>lambdaQuery() |
|
|
|
|
.eq(WtSpBasicEntity::getCode, SP_BASIC.getCode()) |
|
|
|
@ -158,6 +170,7 @@ public class WtSpBasicController extends BladeController {
|
|
|
|
|
@ApiOperationSupport(order = 6) |
|
|
|
|
@ApiOperation(value = "新增或修改", notes = "传入SP_BASIC") |
|
|
|
|
@ApiIgnore |
|
|
|
|
@Operate(label = "备品备件新增",type = com.hnac.hzinfo.log.contants.BusinessType.INSERT,ignore = false) |
|
|
|
|
public R submit(@Valid @RequestBody WtSpBasicEntity SP_BASIC) { |
|
|
|
|
return R.status(SP_BASICService.saveOrUpdate(SP_BASIC)); |
|
|
|
|
} |
|
|
|
@ -169,6 +182,7 @@ public class WtSpBasicController extends BladeController {
|
|
|
|
|
@PostMapping("/remove") |
|
|
|
|
@ApiOperationSupport(order = 7) |
|
|
|
|
@ApiOperation(value = "逻辑删除", notes = "传入ids") |
|
|
|
|
@Operate(label = "备品备件基础信息逻辑删除",type = com.hnac.hzinfo.log.contants.BusinessType.DELETE,ignore = false) |
|
|
|
|
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
|
|
|
|
return R.status(SP_BASICService.deleteLogic(Func.toLongList(ids))); |
|
|
|
|
} |
|
|
|
@ -179,6 +193,7 @@ public class WtSpBasicController extends BladeController {
|
|
|
|
|
*/ |
|
|
|
|
@ApiOperationSupport(order = 8) |
|
|
|
|
@ApiOperation(value = "库存填写模板导出", notes = "库存填写模板导出") |
|
|
|
|
@Operate(label = "库存填写模板导出",type = com.hnac.hzinfo.log.contants.BusinessType.IMPORT,ignore = false) |
|
|
|
|
@RequestMapping(value = "/writeTemplateDownload", method = {RequestMethod.GET, RequestMethod.POST}) |
|
|
|
|
public void writeTemplateDownload(HttpServletResponse response) { |
|
|
|
|
SP_BASICService.writeTemplateDownload(response); |
|
|
|
@ -190,6 +205,7 @@ public class WtSpBasicController extends BladeController {
|
|
|
|
|
@ApiOperationSupport(order = 9) |
|
|
|
|
@ApiOperation(value = "导入台账填写Excel") |
|
|
|
|
@RequestMapping(value = "/importExcel", method = {RequestMethod.POST}) |
|
|
|
|
@Operate(label = "导入台账填写Excel",type = com.hnac.hzinfo.log.contants.BusinessType.IMPORT,ignore = false) |
|
|
|
|
public R importExcel( @RequestParam MultipartFile file) throws Exception { |
|
|
|
|
// System.out.println(11);
|
|
|
|
|
return SP_BASICService.importExcel(file); |
|
|
|
|