feat:物料管理盘点相关
This commit is contained in:
@@ -0,0 +1,118 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.admin;
|
||||
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckBatchPageReqVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckBatchRespVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckBatchSaveReqVO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||
import com.zt.plat.framework.business.annotation.FileUploadController;
|
||||
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryCheckBatchDO;
|
||||
import com.zt.plat.module.qms.resource.material.service.MaterialInventoryCheckBatchService;
|
||||
|
||||
@Tag(name = "管理后台 - 库存盘点项")
|
||||
@RestController
|
||||
@RequestMapping("/qms/material-inventory-check-batch")
|
||||
@Validated
|
||||
@FileUploadController(source = "qms.materialinventorycheckbatch")
|
||||
public class MaterialInventoryCheckBatchController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||
|
||||
static {
|
||||
FileUploadController annotation = MaterialInventoryCheckBatchController.class.getAnnotation(FileUploadController.class);
|
||||
if (annotation != null) {
|
||||
setFileUploadInfo(annotation);
|
||||
}
|
||||
}
|
||||
|
||||
@Resource
|
||||
private MaterialInventoryCheckBatchService materialInventoryCheckBatchService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建库存盘点项")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-check-batch:create')")
|
||||
public CommonResult<MaterialInventoryCheckBatchRespVO> createMaterialInventoryCheckBatch(@Valid @RequestBody MaterialInventoryCheckBatchSaveReqVO createReqVO) {
|
||||
return success(materialInventoryCheckBatchService.createMaterialInventoryCheckBatch(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新库存盘点项")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-check-batch:update')")
|
||||
public CommonResult<Boolean> updateMaterialInventoryCheckBatch(@Valid @RequestBody MaterialInventoryCheckBatchSaveReqVO updateReqVO) {
|
||||
materialInventoryCheckBatchService.updateMaterialInventoryCheckBatch(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除库存盘点项")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-check-batch:delete')")
|
||||
public CommonResult<Boolean> deleteMaterialInventoryCheckBatch(@RequestParam("id") Long id) {
|
||||
materialInventoryCheckBatchService.deleteMaterialInventoryCheckBatch(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除库存盘点项")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-check-batch:delete')")
|
||||
public CommonResult<Boolean> deleteMaterialInventoryCheckBatchList(@RequestBody BatchDeleteReqVO req) {
|
||||
materialInventoryCheckBatchService.deleteMaterialInventoryCheckBatchListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得库存盘点项")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-check-batch:query')")
|
||||
public CommonResult<MaterialInventoryCheckBatchRespVO> getMaterialInventoryCheckBatch(@RequestParam("id") Long id) {
|
||||
MaterialInventoryCheckBatchDO materialInventoryCheckBatch = materialInventoryCheckBatchService.getMaterialInventoryCheckBatch(id);
|
||||
return success(BeanUtils.toBean(materialInventoryCheckBatch, MaterialInventoryCheckBatchRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得库存盘点项分页")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-check-batch:query')")
|
||||
public CommonResult<PageResult<MaterialInventoryCheckBatchRespVO>> getMaterialInventoryCheckBatchPage(@Valid MaterialInventoryCheckBatchPageReqVO pageReqVO) {
|
||||
PageResult<MaterialInventoryCheckBatchDO> pageResult = materialInventoryCheckBatchService.getMaterialInventoryCheckBatchPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, MaterialInventoryCheckBatchRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出库存盘点项 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-check-batch:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportMaterialInventoryCheckBatchExcel(@Valid MaterialInventoryCheckBatchPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<MaterialInventoryCheckBatchDO> list = materialInventoryCheckBatchService.getMaterialInventoryCheckBatchPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "库存盘点项.xls", "数据", MaterialInventoryCheckBatchRespVO.class,
|
||||
BeanUtils.toBean(list, MaterialInventoryCheckBatchRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.admin;
|
||||
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckPageReqVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckRespVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckSaveReqVO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||
import com.zt.plat.framework.business.annotation.FileUploadController;
|
||||
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryCheckDO;
|
||||
import com.zt.plat.module.qms.resource.material.service.MaterialInventoryCheckService;
|
||||
|
||||
@Tag(name = "管理后台 - 库存盘点")
|
||||
@RestController
|
||||
@RequestMapping("/qms/material-inventory-check")
|
||||
@Validated
|
||||
@FileUploadController(source = "qms.materialinventorycheck")
|
||||
public class MaterialInventoryCheckController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||
|
||||
static {
|
||||
FileUploadController annotation = MaterialInventoryCheckController.class.getAnnotation(FileUploadController.class);
|
||||
if (annotation != null) {
|
||||
setFileUploadInfo(annotation);
|
||||
}
|
||||
}
|
||||
|
||||
@Resource
|
||||
private MaterialInventoryCheckService materialInventoryCheckService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建库存盘点")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-check:create')")
|
||||
public CommonResult<MaterialInventoryCheckRespVO> createMaterialInventoryCheck(@Valid @RequestBody MaterialInventoryCheckSaveReqVO createReqVO) {
|
||||
return success(materialInventoryCheckService.createMaterialInventoryCheck(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新库存盘点")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-check:update')")
|
||||
public CommonResult<Boolean> updateMaterialInventoryCheck(@Valid @RequestBody MaterialInventoryCheckSaveReqVO updateReqVO) {
|
||||
materialInventoryCheckService.updateMaterialInventoryCheck(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除库存盘点")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-check:delete')")
|
||||
public CommonResult<Boolean> deleteMaterialInventoryCheck(@RequestParam("id") Long id) {
|
||||
materialInventoryCheckService.deleteMaterialInventoryCheck(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除库存盘点")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-check:delete')")
|
||||
public CommonResult<Boolean> deleteMaterialInventoryCheckList(@RequestBody BatchDeleteReqVO req) {
|
||||
materialInventoryCheckService.deleteMaterialInventoryCheckListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得库存盘点")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-check:query')")
|
||||
public CommonResult<MaterialInventoryCheckRespVO> getMaterialInventoryCheck(@RequestParam("id") Long id) {
|
||||
MaterialInventoryCheckDO materialInventoryCheck = materialInventoryCheckService.getMaterialInventoryCheck(id);
|
||||
return success(BeanUtils.toBean(materialInventoryCheck, MaterialInventoryCheckRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得库存盘点分页")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-check:query')")
|
||||
public CommonResult<PageResult<MaterialInventoryCheckRespVO>> getMaterialInventoryCheckPage(@Valid MaterialInventoryCheckPageReqVO pageReqVO) {
|
||||
PageResult<MaterialInventoryCheckDO> pageResult = materialInventoryCheckService.getMaterialInventoryCheckPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, MaterialInventoryCheckRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出库存盘点 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-check:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportMaterialInventoryCheckExcel(@Valid MaterialInventoryCheckPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<MaterialInventoryCheckDO> list = materialInventoryCheckService.getMaterialInventoryCheckPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "库存盘点.xls", "数据", MaterialInventoryCheckRespVO.class,
|
||||
BeanUtils.toBean(list, MaterialInventoryCheckRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.admin;
|
||||
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckDetailPageReqVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckDetailRespVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckDetailSaveReqVO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||
import com.zt.plat.framework.business.annotation.FileUploadController;
|
||||
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryCheckDetailDO;
|
||||
import com.zt.plat.module.qms.resource.material.service.MaterialInventoryCheckDetailService;
|
||||
|
||||
@Tag(name = "管理后台 - 库存盘点明细")
|
||||
@RestController
|
||||
@RequestMapping("/qms/material-inventory-check-detail")
|
||||
@Validated
|
||||
@FileUploadController(source = "qms.materialinventorycheckdetail")
|
||||
public class MaterialInventoryCheckDetailController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||
|
||||
static {
|
||||
FileUploadController annotation = MaterialInventoryCheckDetailController.class.getAnnotation(FileUploadController.class);
|
||||
if (annotation != null) {
|
||||
setFileUploadInfo(annotation);
|
||||
}
|
||||
}
|
||||
|
||||
@Resource
|
||||
private MaterialInventoryCheckDetailService materialInventoryCheckDetailService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建库存盘点明细")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-check-detail:create')")
|
||||
public CommonResult<MaterialInventoryCheckDetailRespVO> createMaterialInventoryCheckDetail(@Valid @RequestBody MaterialInventoryCheckDetailSaveReqVO createReqVO) {
|
||||
return success(materialInventoryCheckDetailService.createMaterialInventoryCheckDetail(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新库存盘点明细")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-check-detail:update')")
|
||||
public CommonResult<Boolean> updateMaterialInventoryCheckDetail(@Valid @RequestBody MaterialInventoryCheckDetailSaveReqVO updateReqVO) {
|
||||
materialInventoryCheckDetailService.updateMaterialInventoryCheckDetail(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除库存盘点明细")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-check-detail:delete')")
|
||||
public CommonResult<Boolean> deleteMaterialInventoryCheckDetail(@RequestParam("id") Long id) {
|
||||
materialInventoryCheckDetailService.deleteMaterialInventoryCheckDetail(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除库存盘点明细")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-check-detail:delete')")
|
||||
public CommonResult<Boolean> deleteMaterialInventoryCheckDetailList(@RequestBody BatchDeleteReqVO req) {
|
||||
materialInventoryCheckDetailService.deleteMaterialInventoryCheckDetailListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得库存盘点明细")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-check-detail:query')")
|
||||
public CommonResult<MaterialInventoryCheckDetailRespVO> getMaterialInventoryCheckDetail(@RequestParam("id") Long id) {
|
||||
MaterialInventoryCheckDetailDO materialInventoryCheckDetail = materialInventoryCheckDetailService.getMaterialInventoryCheckDetail(id);
|
||||
return success(BeanUtils.toBean(materialInventoryCheckDetail, MaterialInventoryCheckDetailRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得库存盘点明细分页")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-check-detail:query')")
|
||||
public CommonResult<PageResult<MaterialInventoryCheckDetailRespVO>> getMaterialInventoryCheckDetailPage(@Valid MaterialInventoryCheckDetailPageReqVO pageReqVO) {
|
||||
PageResult<MaterialInventoryCheckDetailDO> pageResult = materialInventoryCheckDetailService.getMaterialInventoryCheckDetailPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, MaterialInventoryCheckDetailRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出库存盘点明细 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-check-detail:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportMaterialInventoryCheckDetailExcel(@Valid MaterialInventoryCheckDetailPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<MaterialInventoryCheckDetailDO> list = materialInventoryCheckDetailService.getMaterialInventoryCheckDetailPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "库存盘点明细.xls", "数据", MaterialInventoryCheckDetailRespVO.class,
|
||||
BeanUtils.toBean(list, MaterialInventoryCheckDetailRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.admin;
|
||||
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLocationPageReqVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLocationRespVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLocationSaveReqVO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||
import com.zt.plat.framework.business.annotation.FileUploadController;
|
||||
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialLocationDO;
|
||||
import com.zt.plat.module.qms.resource.material.service.MaterialLocationService;
|
||||
|
||||
@Tag(name = "管理后台 - 存放位置")
|
||||
@RestController
|
||||
@RequestMapping("/qms/material-location")
|
||||
@Validated
|
||||
@FileUploadController(source = "qms.materiallocation")
|
||||
public class MaterialLocationController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||
|
||||
static {
|
||||
FileUploadController annotation = MaterialLocationController.class.getAnnotation(FileUploadController.class);
|
||||
if (annotation != null) {
|
||||
setFileUploadInfo(annotation);
|
||||
}
|
||||
}
|
||||
|
||||
@Resource
|
||||
private MaterialLocationService materialLocationService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建存放位置")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-location:create')")
|
||||
public CommonResult<MaterialLocationRespVO> createMaterialLocation(@Valid @RequestBody MaterialLocationSaveReqVO createReqVO) {
|
||||
return success(materialLocationService.createMaterialLocation(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新存放位置")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-location:update')")
|
||||
public CommonResult<Boolean> updateMaterialLocation(@Valid @RequestBody MaterialLocationSaveReqVO updateReqVO) {
|
||||
materialLocationService.updateMaterialLocation(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除存放位置")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-location:delete')")
|
||||
public CommonResult<Boolean> deleteMaterialLocation(@RequestParam("id") Long id) {
|
||||
materialLocationService.deleteMaterialLocation(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除存放位置")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-location:delete')")
|
||||
public CommonResult<Boolean> deleteMaterialLocationList(@RequestBody BatchDeleteReqVO req) {
|
||||
materialLocationService.deleteMaterialLocationListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得存放位置")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-location:query')")
|
||||
public CommonResult<MaterialLocationRespVO> getMaterialLocation(@RequestParam("id") Long id) {
|
||||
MaterialLocationDO materialLocation = materialLocationService.getMaterialLocation(id);
|
||||
return success(BeanUtils.toBean(materialLocation, MaterialLocationRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得存放位置分页")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-location:query')")
|
||||
public CommonResult<PageResult<MaterialLocationRespVO>> getMaterialLocationPage(@Valid MaterialLocationPageReqVO pageReqVO) {
|
||||
PageResult<MaterialLocationDO> pageResult = materialLocationService.getMaterialLocationPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, MaterialLocationRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出存放位置 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-location:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportMaterialLocationExcel(@Valid MaterialLocationPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<MaterialLocationDO> list = materialLocationService.getMaterialLocationPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "存放位置.xls", "数据", MaterialLocationRespVO.class,
|
||||
BeanUtils.toBean(list, MaterialLocationRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 库存盘点项分页 Request VO")
|
||||
@Data
|
||||
public class MaterialInventoryCheckBatchPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "父id", example = "9310")
|
||||
private Long checkId;
|
||||
|
||||
@Schema(description = "盘点物料大类ID", example = "18437")
|
||||
private Long checkProductId;
|
||||
|
||||
@Schema(description = "盘点部门ID", example = "17789")
|
||||
private Long checkDepartmentId;
|
||||
|
||||
@Schema(description = "应有量")
|
||||
private String expected;
|
||||
|
||||
@Schema(description = "实有量")
|
||||
private String actual;
|
||||
|
||||
@Schema(description = "差异")
|
||||
private String difference;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 库存盘点项 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class MaterialInventoryCheckBatchRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "12065")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "父id", example = "9310")
|
||||
@ExcelProperty("父id")
|
||||
private Long checkId;
|
||||
|
||||
@Schema(description = "盘点物料大类ID", example = "18437")
|
||||
@ExcelProperty("盘点物料大类ID")
|
||||
private Long checkProductId;
|
||||
|
||||
@Schema(description = "盘点部门ID", example = "17789")
|
||||
@ExcelProperty("盘点部门ID")
|
||||
private Long checkDepartmentId;
|
||||
|
||||
@Schema(description = "应有量")
|
||||
@ExcelProperty("应有量")
|
||||
private String expected;
|
||||
|
||||
@Schema(description = "实有量")
|
||||
@ExcelProperty("实有量")
|
||||
private String actual;
|
||||
|
||||
@Schema(description = "差异")
|
||||
@ExcelProperty("差异")
|
||||
private String difference;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
@ExcelProperty("所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 库存盘点项新增/修改 Request VO")
|
||||
@Data
|
||||
public class MaterialInventoryCheckBatchSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "12065")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "父id", example = "9310")
|
||||
private Long checkId;
|
||||
|
||||
@Schema(description = "盘点物料大类ID", example = "18437")
|
||||
private Long checkProductId;
|
||||
|
||||
@Schema(description = "盘点部门ID", example = "17789")
|
||||
private Long checkDepartmentId;
|
||||
|
||||
@Schema(description = "应有量")
|
||||
private String expected;
|
||||
|
||||
@Schema(description = "实有量")
|
||||
private String actual;
|
||||
|
||||
@Schema(description = "差异")
|
||||
private String difference;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 库存盘点明细分页 Request VO")
|
||||
@Data
|
||||
public class MaterialInventoryCheckDetailPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "盘点批次id", example = "12013")
|
||||
private Long checkBatchId;
|
||||
|
||||
@Schema(description = "物料实例id", example = "2480")
|
||||
private Long infomationId;
|
||||
|
||||
@Schema(description = "是否存在")
|
||||
private String present;
|
||||
|
||||
@Schema(description = "当前数量")
|
||||
private String currentQuantity;
|
||||
|
||||
@Schema(description = "状态", example = "1")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "处置方式,字典配置")
|
||||
private String disposalMethod;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 库存盘点明细 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class MaterialInventoryCheckDetailRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "16347")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "盘点批次id", example = "12013")
|
||||
@ExcelProperty("盘点批次id")
|
||||
private Long checkBatchId;
|
||||
|
||||
@Schema(description = "物料实例id", example = "2480")
|
||||
@ExcelProperty("物料实例id")
|
||||
private Long infomationId;
|
||||
|
||||
@Schema(description = "是否存在")
|
||||
@ExcelProperty("是否存在")
|
||||
private String present;
|
||||
|
||||
@Schema(description = "当前数量")
|
||||
@ExcelProperty("当前数量")
|
||||
private String currentQuantity;
|
||||
|
||||
@Schema(description = "状态", example = "1")
|
||||
@ExcelProperty("状态")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "处置方式,字典配置")
|
||||
@ExcelProperty("处置方式,字典配置")
|
||||
private String disposalMethod;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
@ExcelProperty("所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
@Schema(description = "管理后台 - 库存盘点明细新增/修改 Request VO")
|
||||
@Data
|
||||
public class MaterialInventoryCheckDetailSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "16347")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "盘点批次id", example = "12013")
|
||||
private Long checkBatchId;
|
||||
|
||||
@Schema(description = "物料实例id", example = "2480")
|
||||
private Long infomationId;
|
||||
|
||||
@Schema(description = "是否存在")
|
||||
private String present;
|
||||
|
||||
@Schema(description = "当前数量")
|
||||
private String currentQuantity;
|
||||
|
||||
@Schema(description = "状态", example = "1")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "处置方式,字典配置")
|
||||
private String disposalMethod;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 库存盘点分页 Request VO")
|
||||
@Data
|
||||
public class MaterialInventoryCheckPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "业务类型", example = "2")
|
||||
private String businessType;
|
||||
|
||||
@Schema(description = "业务类型编码")
|
||||
private String businessTypeCode;
|
||||
|
||||
@Schema(description = "申请人")
|
||||
private String applyUser;
|
||||
|
||||
@Schema(description = "申请人id", example = "31128")
|
||||
private Long applyUserId;
|
||||
|
||||
@Schema(description = "申请部门")
|
||||
private String applyDepartment;
|
||||
|
||||
@Schema(description = "申请部门id", example = "16511")
|
||||
private Long applyDepartmentId;
|
||||
|
||||
@Schema(description = "申请时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] applyTime;
|
||||
|
||||
@Schema(description = "流程实例id", example = "6407")
|
||||
private String flowInstanceId;
|
||||
|
||||
@Schema(description = "流程审批状态", example = "2")
|
||||
private String flowStatus;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 库存盘点 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class MaterialInventoryCheckRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "2275")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "标题")
|
||||
@ExcelProperty("标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "业务类型", example = "2")
|
||||
@ExcelProperty("业务类型")
|
||||
private String businessType;
|
||||
|
||||
@Schema(description = "业务类型编码")
|
||||
@ExcelProperty("业务类型编码")
|
||||
private String businessTypeCode;
|
||||
|
||||
@Schema(description = "申请人")
|
||||
@ExcelProperty("申请人")
|
||||
private String applyUser;
|
||||
|
||||
@Schema(description = "申请人id", example = "31128")
|
||||
@ExcelProperty("申请人id")
|
||||
private Long applyUserId;
|
||||
|
||||
@Schema(description = "申请部门")
|
||||
@ExcelProperty("申请部门")
|
||||
private String applyDepartment;
|
||||
|
||||
@Schema(description = "申请部门id", example = "16511")
|
||||
@ExcelProperty("申请部门id")
|
||||
private Long applyDepartmentId;
|
||||
|
||||
@Schema(description = "申请时间")
|
||||
@ExcelProperty("申请时间")
|
||||
private LocalDateTime applyTime;
|
||||
|
||||
@Schema(description = "流程实例id", example = "6407")
|
||||
@ExcelProperty("流程实例id")
|
||||
private String flowInstanceId;
|
||||
|
||||
@Schema(description = "流程审批状态", example = "2")
|
||||
@ExcelProperty("流程审批状态")
|
||||
private String flowStatus;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
@ExcelProperty("所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 库存盘点新增/修改 Request VO")
|
||||
@Data
|
||||
public class MaterialInventoryCheckSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "2275")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "业务类型", example = "2")
|
||||
private String businessType;
|
||||
|
||||
@Schema(description = "业务类型编码")
|
||||
private String businessTypeCode;
|
||||
|
||||
@Schema(description = "申请人")
|
||||
private String applyUser;
|
||||
|
||||
@Schema(description = "申请人id", example = "31128")
|
||||
private Long applyUserId;
|
||||
|
||||
@Schema(description = "申请部门")
|
||||
private String applyDepartment;
|
||||
|
||||
@Schema(description = "申请部门id", example = "16511")
|
||||
private Long applyDepartmentId;
|
||||
|
||||
@Schema(description = "申请时间")
|
||||
private LocalDateTime applyTime;
|
||||
|
||||
@Schema(description = "流程实例id", example = "6407")
|
||||
private String flowInstanceId;
|
||||
|
||||
@Schema(description = "流程审批状态", example = "2")
|
||||
private String flowStatus;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 存放位置分页 Request VO")
|
||||
@Data
|
||||
public class MaterialLocationPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "上级id", example = "15203")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "名称", example = "赵六")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "编码路径")
|
||||
private String codePath;
|
||||
|
||||
@Schema(description = "容量")
|
||||
private String capacity;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 存放位置 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class MaterialLocationRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "7748")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "上级id", example = "15203")
|
||||
@ExcelProperty("上级id")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "名称", example = "赵六")
|
||||
@ExcelProperty("名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "编码")
|
||||
@ExcelProperty("编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "编码路径")
|
||||
@ExcelProperty("编码路径")
|
||||
private String codePath;
|
||||
|
||||
@Schema(description = "容量")
|
||||
@ExcelProperty("容量")
|
||||
private String capacity;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
@ExcelProperty("所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
@Schema(description = "管理后台 - 存放位置新增/修改 Request VO")
|
||||
@Data
|
||||
public class MaterialLocationSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "7748")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "上级id", example = "15203")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "名称", example = "赵六")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "编码路径")
|
||||
private String codePath;
|
||||
|
||||
@Schema(description = "容量")
|
||||
private String capacity;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.zt.plat.module.qms.resource.material.dal.dataobject;
|
||||
|
||||
import lombok.*;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
/**
|
||||
* 库存盘点项 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("t_mtrl_invt_chk_bat")
|
||||
@KeySequence("t_mtrl_invt_chk_bat_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class MaterialInventoryCheckBatchDO extends BusinessBaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 父id
|
||||
*/
|
||||
@TableField("CHK_ID")
|
||||
private Long checkId;
|
||||
/**
|
||||
* 盘点物料大类ID
|
||||
*/
|
||||
@TableField("CHK_PDT_ID")
|
||||
private Long checkProductId;
|
||||
/**
|
||||
* 盘点部门ID
|
||||
*/
|
||||
@TableField("CHK_DEPT_ID")
|
||||
private Long checkDepartmentId;
|
||||
/**
|
||||
* 应有量
|
||||
*/
|
||||
@TableField("EXPT")
|
||||
private String expected;
|
||||
/**
|
||||
* 实有量
|
||||
*/
|
||||
@TableField("ACT")
|
||||
private String actual;
|
||||
/**
|
||||
* 差异
|
||||
*/
|
||||
@TableField("DIFF")
|
||||
private String difference;
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@TableField("SYS_DEPT_CD")
|
||||
private String systemDepartmentCode;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("RMK")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.zt.plat.module.qms.resource.material.dal.dataobject;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
/**
|
||||
* 库存盘点 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("t_mtrl_invt_chk")
|
||||
@KeySequence("t_mtrl_invt_chk_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class MaterialInventoryCheckDO extends BusinessBaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@TableField("TTL")
|
||||
private String title;
|
||||
/**
|
||||
* 业务类型
|
||||
*/
|
||||
@TableField("BSN_TP")
|
||||
private String businessType;
|
||||
/**
|
||||
* 业务类型编码
|
||||
*/
|
||||
@TableField("BSN_TP_CD")
|
||||
private String businessTypeCode;
|
||||
/**
|
||||
* 申请人
|
||||
*/
|
||||
@TableField("APL_USER")
|
||||
private String applyUser;
|
||||
/**
|
||||
* 申请人id
|
||||
*/
|
||||
@TableField("APL_USER_ID")
|
||||
private Long applyUserId;
|
||||
/**
|
||||
* 申请部门
|
||||
*/
|
||||
@TableField("APL_DEPT")
|
||||
private String applyDepartment;
|
||||
/**
|
||||
* 申请部门id
|
||||
*/
|
||||
@TableField("APL_DEPT_ID")
|
||||
private Long applyDepartmentId;
|
||||
/**
|
||||
* 申请时间
|
||||
*/
|
||||
@TableField("APL_TM")
|
||||
private LocalDateTime applyTime;
|
||||
/**
|
||||
* 流程实例id
|
||||
*/
|
||||
@TableField("FLW_INSC_ID")
|
||||
private String flowInstanceId;
|
||||
/**
|
||||
* 流程审批状态
|
||||
*/
|
||||
@TableField("FLW_STS")
|
||||
private String flowStatus;
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@TableField("SYS_DEPT_CD")
|
||||
private String systemDepartmentCode;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("RMK")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.zt.plat.module.qms.resource.material.dal.dataobject;
|
||||
|
||||
import lombok.*;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
/**
|
||||
* 库存盘点明细 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("t_mtrl_invt_chk_dtl")
|
||||
@KeySequence("t_mtrl_invt_chk_dtl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class MaterialInventoryCheckDetailDO extends BusinessBaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 盘点批次id
|
||||
*/
|
||||
@TableField("CHK_BAT_ID")
|
||||
private Long checkBatchId;
|
||||
/**
|
||||
* 物料实例id
|
||||
*/
|
||||
@TableField("INF_ID")
|
||||
private Long infomationId;
|
||||
/**
|
||||
* 是否存在
|
||||
*/
|
||||
@TableField("PRST")
|
||||
private String present;
|
||||
/**
|
||||
* 当前数量
|
||||
*/
|
||||
@TableField("CRNT_QTY")
|
||||
private String currentQuantity;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@TableField("STS")
|
||||
private String status;
|
||||
/**
|
||||
* 处置方式,字典配置
|
||||
*/
|
||||
@TableField("DSPL_MTHD")
|
||||
private String disposalMethod;
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@TableField("SYS_DEPT_CD")
|
||||
private String systemDepartmentCode;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("RMK")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.zt.plat.module.qms.resource.material.dal.dataobject;
|
||||
|
||||
import lombok.*;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
/**
|
||||
* 存放位置 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("t_mtrl_loc")
|
||||
@KeySequence("t_mtrl_loc_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class MaterialLocationDO extends BusinessBaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 上级id
|
||||
*/
|
||||
@TableField("PRN_ID")
|
||||
private Long parentId;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@TableField("NAME")
|
||||
private String name;
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
@TableField("CD")
|
||||
private String code;
|
||||
/**
|
||||
* 编码路径
|
||||
*/
|
||||
@TableField("CD_PATH")
|
||||
private String codePath;
|
||||
/**
|
||||
* 容量
|
||||
*/
|
||||
@TableField("CPY")
|
||||
private String capacity;
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@TableField("SYS_DEPT_CD")
|
||||
private String systemDepartmentCode;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("RMK")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.zt.plat.module.qms.resource.material.dal.mapper;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryCheckBatchDO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckBatchPageReqVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 库存盘点项 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface MaterialInventoryCheckBatchMapper extends BaseMapperX<MaterialInventoryCheckBatchDO> {
|
||||
|
||||
default PageResult<MaterialInventoryCheckBatchDO> selectPage(MaterialInventoryCheckBatchPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<MaterialInventoryCheckBatchDO>()
|
||||
.eqIfPresent(MaterialInventoryCheckBatchDO::getCheckId, reqVO.getCheckId())
|
||||
.eqIfPresent(MaterialInventoryCheckBatchDO::getCheckProductId, reqVO.getCheckProductId())
|
||||
.eqIfPresent(MaterialInventoryCheckBatchDO::getCheckDepartmentId, reqVO.getCheckDepartmentId())
|
||||
.eqIfPresent(MaterialInventoryCheckBatchDO::getExpected, reqVO.getExpected())
|
||||
.eqIfPresent(MaterialInventoryCheckBatchDO::getActual, reqVO.getActual())
|
||||
.eqIfPresent(MaterialInventoryCheckBatchDO::getDifference, reqVO.getDifference())
|
||||
.eqIfPresent(MaterialInventoryCheckBatchDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||
.eqIfPresent(MaterialInventoryCheckBatchDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(MaterialInventoryCheckBatchDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(MaterialInventoryCheckBatchDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.zt.plat.module.qms.resource.material.dal.mapper;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryCheckDetailDO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckDetailPageReqVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 库存盘点明细 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface MaterialInventoryCheckDetailMapper extends BaseMapperX<MaterialInventoryCheckDetailDO> {
|
||||
|
||||
default PageResult<MaterialInventoryCheckDetailDO> selectPage(MaterialInventoryCheckDetailPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<MaterialInventoryCheckDetailDO>()
|
||||
.eqIfPresent(MaterialInventoryCheckDetailDO::getCheckBatchId, reqVO.getCheckBatchId())
|
||||
.eqIfPresent(MaterialInventoryCheckDetailDO::getInfomationId, reqVO.getInfomationId())
|
||||
.eqIfPresent(MaterialInventoryCheckDetailDO::getPresent, reqVO.getPresent())
|
||||
.eqIfPresent(MaterialInventoryCheckDetailDO::getCurrentQuantity, reqVO.getCurrentQuantity())
|
||||
.eqIfPresent(MaterialInventoryCheckDetailDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(MaterialInventoryCheckDetailDO::getDisposalMethod, reqVO.getDisposalMethod())
|
||||
.eqIfPresent(MaterialInventoryCheckDetailDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||
.eqIfPresent(MaterialInventoryCheckDetailDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(MaterialInventoryCheckDetailDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(MaterialInventoryCheckDetailDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.zt.plat.module.qms.resource.material.dal.mapper;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryCheckDO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckPageReqVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 库存盘点 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface MaterialInventoryCheckMapper extends BaseMapperX<MaterialInventoryCheckDO> {
|
||||
|
||||
default PageResult<MaterialInventoryCheckDO> selectPage(MaterialInventoryCheckPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<MaterialInventoryCheckDO>()
|
||||
.eqIfPresent(MaterialInventoryCheckDO::getTitle, reqVO.getTitle())
|
||||
.eqIfPresent(MaterialInventoryCheckDO::getBusinessType, reqVO.getBusinessType())
|
||||
.eqIfPresent(MaterialInventoryCheckDO::getBusinessTypeCode, reqVO.getBusinessTypeCode())
|
||||
.eqIfPresent(MaterialInventoryCheckDO::getApplyUser, reqVO.getApplyUser())
|
||||
.eqIfPresent(MaterialInventoryCheckDO::getApplyUserId, reqVO.getApplyUserId())
|
||||
.eqIfPresent(MaterialInventoryCheckDO::getApplyDepartment, reqVO.getApplyDepartment())
|
||||
.eqIfPresent(MaterialInventoryCheckDO::getApplyDepartmentId, reqVO.getApplyDepartmentId())
|
||||
.betweenIfPresent(MaterialInventoryCheckDO::getApplyTime, reqVO.getApplyTime())
|
||||
.eqIfPresent(MaterialInventoryCheckDO::getFlowInstanceId, reqVO.getFlowInstanceId())
|
||||
.eqIfPresent(MaterialInventoryCheckDO::getFlowStatus, reqVO.getFlowStatus())
|
||||
.eqIfPresent(MaterialInventoryCheckDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||
.eqIfPresent(MaterialInventoryCheckDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(MaterialInventoryCheckDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(MaterialInventoryCheckDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.zt.plat.module.qms.resource.material.dal.mapper;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialLocationDO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLocationPageReqVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 存放位置 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface MaterialLocationMapper extends BaseMapperX<MaterialLocationDO> {
|
||||
|
||||
default PageResult<MaterialLocationDO> selectPage(MaterialLocationPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<MaterialLocationDO>()
|
||||
.eqIfPresent(MaterialLocationDO::getParentId, reqVO.getParentId())
|
||||
.likeIfPresent(MaterialLocationDO::getName, reqVO.getName())
|
||||
.eqIfPresent(MaterialLocationDO::getCode, reqVO.getCode())
|
||||
.eqIfPresent(MaterialLocationDO::getCodePath, reqVO.getCodePath())
|
||||
.eqIfPresent(MaterialLocationDO::getCapacity, reqVO.getCapacity())
|
||||
.eqIfPresent(MaterialLocationDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||
.eqIfPresent(MaterialLocationDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(MaterialLocationDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(MaterialLocationDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.zt.plat.module.qms.resource.material.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckBatchPageReqVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckBatchRespVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckBatchSaveReqVO;
|
||||
import jakarta.validation.*;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.*;
|
||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryCheckBatchDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
|
||||
/**
|
||||
* 库存盘点项 Service 接口
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
public interface MaterialInventoryCheckBatchService {
|
||||
|
||||
/**
|
||||
* 创建库存盘点项
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
MaterialInventoryCheckBatchRespVO createMaterialInventoryCheckBatch(@Valid MaterialInventoryCheckBatchSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新库存盘点项
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateMaterialInventoryCheckBatch(@Valid MaterialInventoryCheckBatchSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除库存盘点项
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteMaterialInventoryCheckBatch(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除库存盘点项
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteMaterialInventoryCheckBatchListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得库存盘点项
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 库存盘点项
|
||||
*/
|
||||
MaterialInventoryCheckBatchDO getMaterialInventoryCheckBatch(Long id);
|
||||
|
||||
/**
|
||||
* 获得库存盘点项分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 库存盘点项分页
|
||||
*/
|
||||
PageResult<MaterialInventoryCheckBatchDO> getMaterialInventoryCheckBatchPage(MaterialInventoryCheckBatchPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.zt.plat.module.qms.resource.material.service;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckBatchPageReqVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckBatchRespVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckBatchSaveReqVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.*;
|
||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryCheckBatchDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
|
||||
import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialInventoryCheckBatchMapper;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 库存盘点项 Service 实现类
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class MaterialInventoryCheckBatchServiceImpl implements MaterialInventoryCheckBatchService {
|
||||
|
||||
@Resource
|
||||
private MaterialInventoryCheckBatchMapper materialInventoryCheckBatchMapper;
|
||||
|
||||
@Override
|
||||
public MaterialInventoryCheckBatchRespVO createMaterialInventoryCheckBatch(MaterialInventoryCheckBatchSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
MaterialInventoryCheckBatchDO materialInventoryCheckBatch = BeanUtils.toBean(createReqVO, MaterialInventoryCheckBatchDO.class);
|
||||
materialInventoryCheckBatchMapper.insert(materialInventoryCheckBatch);
|
||||
// 返回
|
||||
return BeanUtils.toBean(materialInventoryCheckBatch, MaterialInventoryCheckBatchRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateMaterialInventoryCheckBatch(MaterialInventoryCheckBatchSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateMaterialInventoryCheckBatchExists(updateReqVO.getId());
|
||||
// 更新
|
||||
MaterialInventoryCheckBatchDO updateObj = BeanUtils.toBean(updateReqVO, MaterialInventoryCheckBatchDO.class);
|
||||
materialInventoryCheckBatchMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteMaterialInventoryCheckBatch(Long id) {
|
||||
// 校验存在
|
||||
validateMaterialInventoryCheckBatchExists(id);
|
||||
// 删除
|
||||
materialInventoryCheckBatchMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteMaterialInventoryCheckBatchListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateMaterialInventoryCheckBatchExists(ids);
|
||||
// 删除
|
||||
materialInventoryCheckBatchMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateMaterialInventoryCheckBatchExists(List<Long> ids) {
|
||||
List<MaterialInventoryCheckBatchDO> list = materialInventoryCheckBatchMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(MATERIAL_INVENTORY_CHECK_BATCH_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateMaterialInventoryCheckBatchExists(Long id) {
|
||||
if (materialInventoryCheckBatchMapper.selectById(id) == null) {
|
||||
throw exception(MATERIAL_INVENTORY_CHECK_BATCH_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaterialInventoryCheckBatchDO getMaterialInventoryCheckBatch(Long id) {
|
||||
return materialInventoryCheckBatchMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<MaterialInventoryCheckBatchDO> getMaterialInventoryCheckBatchPage(MaterialInventoryCheckBatchPageReqVO pageReqVO) {
|
||||
return materialInventoryCheckBatchMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.zt.plat.module.qms.resource.material.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckDetailPageReqVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckDetailRespVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckDetailSaveReqVO;
|
||||
import jakarta.validation.*;
|
||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryCheckDetailDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
|
||||
/**
|
||||
* 库存盘点明细 Service 接口
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
public interface MaterialInventoryCheckDetailService {
|
||||
|
||||
/**
|
||||
* 创建库存盘点明细
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
MaterialInventoryCheckDetailRespVO createMaterialInventoryCheckDetail(@Valid MaterialInventoryCheckDetailSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新库存盘点明细
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateMaterialInventoryCheckDetail(@Valid MaterialInventoryCheckDetailSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除库存盘点明细
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteMaterialInventoryCheckDetail(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除库存盘点明细
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteMaterialInventoryCheckDetailListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得库存盘点明细
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 库存盘点明细
|
||||
*/
|
||||
MaterialInventoryCheckDetailDO getMaterialInventoryCheckDetail(Long id);
|
||||
|
||||
/**
|
||||
* 获得库存盘点明细分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 库存盘点明细分页
|
||||
*/
|
||||
PageResult<MaterialInventoryCheckDetailDO> getMaterialInventoryCheckDetailPage(MaterialInventoryCheckDetailPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.zt.plat.module.qms.resource.material.service;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckDetailPageReqVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckDetailRespVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckDetailSaveReqVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryCheckDetailDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
|
||||
import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialInventoryCheckDetailMapper;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 库存盘点明细 Service 实现类
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class MaterialInventoryCheckDetailServiceImpl implements MaterialInventoryCheckDetailService {
|
||||
|
||||
@Resource
|
||||
private MaterialInventoryCheckDetailMapper materialInventoryCheckDetailMapper;
|
||||
|
||||
@Override
|
||||
public MaterialInventoryCheckDetailRespVO createMaterialInventoryCheckDetail(MaterialInventoryCheckDetailSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
MaterialInventoryCheckDetailDO materialInventoryCheckDetail = BeanUtils.toBean(createReqVO, MaterialInventoryCheckDetailDO.class);
|
||||
materialInventoryCheckDetailMapper.insert(materialInventoryCheckDetail);
|
||||
// 返回
|
||||
return BeanUtils.toBean(materialInventoryCheckDetail, MaterialInventoryCheckDetailRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateMaterialInventoryCheckDetail(MaterialInventoryCheckDetailSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateMaterialInventoryCheckDetailExists(updateReqVO.getId());
|
||||
// 更新
|
||||
MaterialInventoryCheckDetailDO updateObj = BeanUtils.toBean(updateReqVO, MaterialInventoryCheckDetailDO.class);
|
||||
materialInventoryCheckDetailMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteMaterialInventoryCheckDetail(Long id) {
|
||||
// 校验存在
|
||||
validateMaterialInventoryCheckDetailExists(id);
|
||||
// 删除
|
||||
materialInventoryCheckDetailMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteMaterialInventoryCheckDetailListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateMaterialInventoryCheckDetailExists(ids);
|
||||
// 删除
|
||||
materialInventoryCheckDetailMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateMaterialInventoryCheckDetailExists(List<Long> ids) {
|
||||
List<MaterialInventoryCheckDetailDO> list = materialInventoryCheckDetailMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(MATERIAL_INVENTORY_CHECK_DETAIL_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateMaterialInventoryCheckDetailExists(Long id) {
|
||||
if (materialInventoryCheckDetailMapper.selectById(id) == null) {
|
||||
throw exception(MATERIAL_INVENTORY_CHECK_DETAIL_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaterialInventoryCheckDetailDO getMaterialInventoryCheckDetail(Long id) {
|
||||
return materialInventoryCheckDetailMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<MaterialInventoryCheckDetailDO> getMaterialInventoryCheckDetailPage(MaterialInventoryCheckDetailPageReqVO pageReqVO) {
|
||||
return materialInventoryCheckDetailMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.zt.plat.module.qms.resource.material.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckPageReqVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckRespVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckSaveReqVO;
|
||||
import jakarta.validation.*;
|
||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryCheckDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
|
||||
/**
|
||||
* 库存盘点 Service 接口
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
public interface MaterialInventoryCheckService {
|
||||
|
||||
/**
|
||||
* 创建库存盘点
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
MaterialInventoryCheckRespVO createMaterialInventoryCheck(@Valid MaterialInventoryCheckSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新库存盘点
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateMaterialInventoryCheck(@Valid MaterialInventoryCheckSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除库存盘点
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteMaterialInventoryCheck(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除库存盘点
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteMaterialInventoryCheckListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得库存盘点
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 库存盘点
|
||||
*/
|
||||
MaterialInventoryCheckDO getMaterialInventoryCheck(Long id);
|
||||
|
||||
/**
|
||||
* 获得库存盘点分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 库存盘点分页
|
||||
*/
|
||||
PageResult<MaterialInventoryCheckDO> getMaterialInventoryCheckPage(MaterialInventoryCheckPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.zt.plat.module.qms.resource.material.service;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckPageReqVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckRespVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckSaveReqVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.*;
|
||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryCheckDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
|
||||
import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialInventoryCheckMapper;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 库存盘点 Service 实现类
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class MaterialInventoryCheckServiceImpl implements MaterialInventoryCheckService {
|
||||
|
||||
@Resource
|
||||
private MaterialInventoryCheckMapper materialInventoryCheckMapper;
|
||||
|
||||
@Override
|
||||
public MaterialInventoryCheckRespVO createMaterialInventoryCheck(MaterialInventoryCheckSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
MaterialInventoryCheckDO materialInventoryCheck = BeanUtils.toBean(createReqVO, MaterialInventoryCheckDO.class);
|
||||
materialInventoryCheckMapper.insert(materialInventoryCheck);
|
||||
// 返回
|
||||
return BeanUtils.toBean(materialInventoryCheck, MaterialInventoryCheckRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateMaterialInventoryCheck(MaterialInventoryCheckSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateMaterialInventoryCheckExists(updateReqVO.getId());
|
||||
// 更新
|
||||
MaterialInventoryCheckDO updateObj = BeanUtils.toBean(updateReqVO, MaterialInventoryCheckDO.class);
|
||||
materialInventoryCheckMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteMaterialInventoryCheck(Long id) {
|
||||
// 校验存在
|
||||
validateMaterialInventoryCheckExists(id);
|
||||
// 删除
|
||||
materialInventoryCheckMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteMaterialInventoryCheckListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateMaterialInventoryCheckExists(ids);
|
||||
// 删除
|
||||
materialInventoryCheckMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateMaterialInventoryCheckExists(List<Long> ids) {
|
||||
List<MaterialInventoryCheckDO> list = materialInventoryCheckMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(MATERIAL_INVENTORY_CHECK_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateMaterialInventoryCheckExists(Long id) {
|
||||
if (materialInventoryCheckMapper.selectById(id) == null) {
|
||||
throw exception(MATERIAL_INVENTORY_CHECK_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaterialInventoryCheckDO getMaterialInventoryCheck(Long id) {
|
||||
return materialInventoryCheckMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<MaterialInventoryCheckDO> getMaterialInventoryCheckPage(MaterialInventoryCheckPageReqVO pageReqVO) {
|
||||
return materialInventoryCheckMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.zt.plat.module.qms.resource.material.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLocationPageReqVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLocationRespVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLocationSaveReqVO;
|
||||
import jakarta.validation.*;
|
||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialLocationDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
|
||||
/**
|
||||
* 存放位置 Service 接口
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
public interface MaterialLocationService {
|
||||
|
||||
/**
|
||||
* 创建存放位置
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
MaterialLocationRespVO createMaterialLocation(@Valid MaterialLocationSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新存放位置
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateMaterialLocation(@Valid MaterialLocationSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除存放位置
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteMaterialLocation(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除存放位置
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteMaterialLocationListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得存放位置
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 存放位置
|
||||
*/
|
||||
MaterialLocationDO getMaterialLocation(Long id);
|
||||
|
||||
/**
|
||||
* 获得存放位置分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 存放位置分页
|
||||
*/
|
||||
PageResult<MaterialLocationDO> getMaterialLocationPage(MaterialLocationPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.zt.plat.module.qms.resource.material.service;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLocationPageReqVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLocationRespVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLocationSaveReqVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialLocationDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
|
||||
import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialLocationMapper;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 存放位置 Service 实现类
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class MaterialLocationServiceImpl implements MaterialLocationService {
|
||||
|
||||
@Resource
|
||||
private MaterialLocationMapper materialLocationMapper;
|
||||
|
||||
@Override
|
||||
public MaterialLocationRespVO createMaterialLocation(MaterialLocationSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
MaterialLocationDO materialLocation = BeanUtils.toBean(createReqVO, MaterialLocationDO.class);
|
||||
materialLocationMapper.insert(materialLocation);
|
||||
// 返回
|
||||
return BeanUtils.toBean(materialLocation, MaterialLocationRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateMaterialLocation(MaterialLocationSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateMaterialLocationExists(updateReqVO.getId());
|
||||
// 更新
|
||||
MaterialLocationDO updateObj = BeanUtils.toBean(updateReqVO, MaterialLocationDO.class);
|
||||
materialLocationMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteMaterialLocation(Long id) {
|
||||
// 校验存在
|
||||
validateMaterialLocationExists(id);
|
||||
// 删除
|
||||
materialLocationMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteMaterialLocationListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateMaterialLocationExists(ids);
|
||||
// 删除
|
||||
materialLocationMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateMaterialLocationExists(List<Long> ids) {
|
||||
List<MaterialLocationDO> list = materialLocationMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(MATERIAL_LOCATION_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateMaterialLocationExists(Long id) {
|
||||
if (materialLocationMapper.selectById(id) == null) {
|
||||
throw exception(MATERIAL_LOCATION_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaterialLocationDO getMaterialLocation(Long id) {
|
||||
return materialLocationMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<MaterialLocationDO> getMaterialLocationPage(MaterialLocationPageReqVO pageReqVO) {
|
||||
return materialLocationMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zt.plat.module.qms.resource.material.dal.mapper.MaterialInventoryCheckBatchMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zt.plat.module.qms.resource.material.dal.mapper.MaterialInventoryCheckDetailMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zt.plat.module.qms.resource.material.dal.mapper.MaterialInventoryCheckMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zt.plat.module.qms.resource.material.dal.mapper.MaterialLocationMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user