From d0ee12d7cf503c45b5816dedc39315a0ee09c727 Mon Sep 17 00:00:00 2001 From: wangqian <1406304305@qq.com> Date: Fri, 28 Nov 2025 22:14:21 +0800 Subject: [PATCH] 库存迁移 --- urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialInController.java | 151 ------------------------------------------------------------------------------------------------------------------------------------------------------- urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialInventoryController.java | 56 -------------------------------------------------------- urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialOutController.java | 126 ------------------------------------------------------------------------------------------------------------------------------ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialTypeController.java | 134 -------------------------------------------------------------------------------------------------------------------------------------- urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialTypeManagerController.java | 104 -------------------------------------------------------------------------------------------------------- urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeManagerPageReqVO.java | 65 ----------------------------------------------------------------- urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeManagerRespVO.java | 83 ----------------------------------------------------------------------------------- urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeManagerSaveReqVO.java | 73 ------------------------------------------------------------------------- urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypePageReqVO.java | 56 -------------------------------------------------------- urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeResp.java | 38 -------------------------------------- urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeRespVO.java | 71 ----------------------------------------------------------------------- urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeSaveReqVO.java | 47 ----------------------------------------------- urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventory/MaterialInventoryController.java | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/MaterialInventoryInController.java | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/vo/MaterialInventoryInPageReqVO.java | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/vo/MaterialInventoryInRespVO.java | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/vo/MaterialInventoryInSaveReqVO.java | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/MaterialInventoryOutController.java | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/vo/MaterialInventoryOutPageReqVO.java | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/vo/MaterialInventoryOutRespVO.java | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/vo/MaterialInventoryOutSaveReqVO.java | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/MaterialTypeController.java | 134 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/MaterialTypeManagerController.java | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeManagerPageReqVO.java | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeManagerRespVO.java | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeManagerSaveReqVO.java | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypePageReqVO.java | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeResp.java | 38 ++++++++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeRespVO.java | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeSaveReqVO.java | 47 +++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialInventoryDO.java | 32 -------------------------------- urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialInventoryInDO.java | 38 -------------------------------------- urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialInventoryOutDO.java | 34 ---------------------------------- urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialTypeDO.java | 80 -------------------------------------------------------------------------------- urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialTypeManagerDO.java | 83 ----------------------------------------------------------------------------------- urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialinventory/MaterialInventoryDO.java | 32 ++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialinventoryin/MaterialInventoryInDO.java | 118 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialinventoryout/MaterialInventoryOutDO.java | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialtype/MaterialTypeDO.java | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialtype/MaterialTypeManagerDO.java | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialInventoryInMapper.java | 13 ------------- urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialInventoryMapper.java | 40 ---------------------------------------- urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialInventoryOutMapper.java | 9 --------- urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialTypeManagerMapper.java | 39 --------------------------------------- urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialTypeMapper.java | 24 ------------------------ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialinventory/MaterialInventoryMapper.java | 39 +++++++++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialinventoryin/MaterialInventoryInMapper.java | 47 +++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialinventoryout/MaterialInventoryOutMapper.java | 45 +++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialtype/MaterialTypeManagerMapper.java | 37 +++++++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialtype/MaterialTypeMapper.java | 24 ++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/enums/ErrorCodeConstants.java | 5 +++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialInventoryService.java | 10 ---------- urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialInventoryServiceImpl.java | 30 ------------------------------ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialServiceImpl.java | 6 ------ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialTypeManagerService.java | 62 -------------------------------------------------------------- urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialTypeManagerServiceImpl.java | 85 ------------------------------------------------------------------------------------- urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialTypeService.java | 72 ------------------------------------------------------------------------ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialTypeServiceImpl.java | 186 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventory/MaterialInventoryService.java | 10 ++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventory/MaterialInventoryServiceImpl.java | 30 ++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryin/MaterialInventoryInService.java | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryin/MaterialInventoryInServiceImpl.java | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryout/MaterialInventoryOutService.java | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryout/MaterialInventoryOutServiceImpl.java | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeManagerService.java | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeManagerServiceImpl.java | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeService.java | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeServiceImpl.java | 186 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 68 files changed, 2854 insertions(+), 1847 deletions(-) delete mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialInController.java delete mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialInventoryController.java delete mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialOutController.java delete mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialTypeController.java delete mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialTypeManagerController.java delete mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeManagerPageReqVO.java delete mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeManagerRespVO.java delete mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeManagerSaveReqVO.java delete mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypePageReqVO.java delete mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeResp.java delete mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeRespVO.java delete mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeSaveReqVO.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventory/MaterialInventoryController.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/MaterialInventoryInController.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/vo/MaterialInventoryInPageReqVO.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/vo/MaterialInventoryInRespVO.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/vo/MaterialInventoryInSaveReqVO.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/MaterialInventoryOutController.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/vo/MaterialInventoryOutPageReqVO.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/vo/MaterialInventoryOutRespVO.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/vo/MaterialInventoryOutSaveReqVO.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/MaterialTypeController.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/MaterialTypeManagerController.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeManagerPageReqVO.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeManagerRespVO.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeManagerSaveReqVO.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypePageReqVO.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeResp.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeRespVO.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeSaveReqVO.java delete mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialInventoryDO.java delete mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialInventoryInDO.java delete mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialInventoryOutDO.java delete mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialTypeDO.java delete mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialTypeManagerDO.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialinventory/MaterialInventoryDO.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialinventoryin/MaterialInventoryInDO.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialinventoryout/MaterialInventoryOutDO.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialtype/MaterialTypeDO.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialtype/MaterialTypeManagerDO.java delete mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialInventoryInMapper.java delete mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialInventoryMapper.java delete mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialInventoryOutMapper.java delete mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialTypeManagerMapper.java delete mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialTypeMapper.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialinventory/MaterialInventoryMapper.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialinventoryin/MaterialInventoryInMapper.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialinventoryout/MaterialInventoryOutMapper.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialtype/MaterialTypeManagerMapper.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialtype/MaterialTypeMapper.java delete mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialInventoryService.java delete mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialInventoryServiceImpl.java delete mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialTypeManagerService.java delete mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialTypeManagerServiceImpl.java delete mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialTypeService.java delete mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialTypeServiceImpl.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventory/MaterialInventoryService.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventory/MaterialInventoryServiceImpl.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryin/MaterialInventoryInService.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryin/MaterialInventoryInServiceImpl.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryout/MaterialInventoryOutService.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryout/MaterialInventoryOutServiceImpl.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeManagerService.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeManagerServiceImpl.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeService.java create mode 100644 urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeServiceImpl.java diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialInController.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialInController.java deleted file mode 100644 index fe348ce..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialInController.java +++ /dev/null @@ -1,151 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.admin.material; - -import com.zteits.urbanops.framework.common.pojo.CommonResult; -import com.zteits.urbanops.framework.common.pojo.PageParam; -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; -import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialDO; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialInventoryDO; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialInventoryInDO; -import com.zteits.urbanops.module.garden.dal.mysql.material.MaterialInventoryInMapper; -import com.zteits.urbanops.module.garden.dal.mysql.material.MaterialInventoryMapper; -import com.zteits.urbanops.module.garden.service.material.MaterialService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.annotation.Resource; -import jakarta.servlet.http.HttpServletResponse; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.bind.annotation.*; - -import java.io.IOException; -import java.util.List; - -import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; - -@Tag(name = "管理后台 - 物料入库") -@RestController -@RequestMapping("/material/in") -public class MaterialInController { - - @Resource - private MaterialInventoryInMapper inMapper; - @Resource - private MaterialInventoryMapper inventoryMapper; - @Resource - private MaterialService materialService; - - @PostMapping("/listForPage") - @Operation(summary = "物料入库-分页") - @PreAuthorize("@ss.hasPermission('material:material/in:list')") - public CommonResult> listForPage(@RequestBody MaterialInventoryInDO where, - @RequestParam(value = "pageNum", required = false) Integer pageNum, - @RequestParam(value = "pageSize", required = false) Integer pageSize) { - PageParam page = new PageParam(); - page.setPageNo(pageNum == null ? 1 : pageNum); - page.setPageSize(pageSize == null ? 10 : pageSize); - PageResult result = inMapper.selectPage(page, null, - new com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX() - .eqIfPresent(MaterialInventoryInDO::getMaterialId, where.getMaterialId()) - .likeIfPresent(MaterialInventoryInDO::getMaterialName, where.getMaterialName()) - .eqIfPresent(MaterialInventoryInDO::getBelongCompanyId, where.getBelongCompanyId()) - .orderByDesc(MaterialInventoryInDO::getCreateTime)); - return success(result); - } - - @GetMapping("/export") - @Operation(summary = "物料入库-导出") - @PreAuthorize("@ss.hasPermission('material:material/in:export')") - public void export(MaterialInventoryInDO where, HttpServletResponse response) throws IOException { - List list = inMapper.selectList(new com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX() - .eqIfPresent(MaterialInventoryInDO::getMaterialId, where.getMaterialId())); - ExcelUtils.write(response, "物料入库.xls", "数据", MaterialInventoryInDO.class, list); - } - - @GetMapping("/select/by/inventoryInNo") - @Operation(summary = "物料入库-详情") - @PreAuthorize("@ss.hasPermission('material:material/in:query')") - public CommonResult getInfo(@RequestParam("inventoryIn_no") String inventoryInNo) { - return success(inMapper.selectByNo(inventoryInNo)); - } - - @PostMapping("/add") - @Operation(summary = "物料入库-添加") - @PreAuthorize("@ss.hasPermission('material:material/in:add')") - @Transactional(rollbackFor = Throwable.class) - public CommonResult add(@RequestBody MaterialInventoryInDO req) { - Long userId = SecurityFrameworkUtils.getLoginUserId(); - MaterialDO material = materialService.getMaterial(req.getMaterialId()); - if (material == null) { - return com.zteits.urbanops.framework.common.pojo.CommonResult.error(400, "无效参数-materialId"); - } - req.setCreator(String.valueOf(userId)); - req.setUpdater(String.valueOf(userId)); - boolean inserted = inMapper.insert(req) > 0; - - MaterialInventoryDO inventory = new MaterialInventoryDO(); - inventory.setMaterialId(req.getMaterialId()); - inventory.setMaterialName(req.getMaterialName()); - inventory.setMaterialTypeId(req.getMaterialTypeId()); - inventory.setMaterialTypeName(req.getMaterialTypeName()); - inventory.setTypeId(material.getTypeId()); - inventory.setTypeName(material.getTypeName()); - inventory.setTypeDetailId(material.getTypeDetailId()); - inventory.setTypeDetailName(material.getTypeDetailName()); - inventory.setSpecifications(req.getSpecifications()); - inventory.setBelongCompanyId(req.getBelongCompanyId()); - inventory.setBelongCompanyName(req.getBelongCompanyName()); - inventory.setUnitId(req.getUnitId()); - inventory.setUnitName(req.getUnitName()); - inventory.setCurrentNum(req.getInInventoryNum()); - inventory.setOutTotalNum(0L); - inventory.setInventoryTotalNum(req.getInInventoryNum()); - inventory.setStatus("0"); - inventory.setDeptId(SecurityFrameworkUtils.getLoginUserDeptId()); - - MaterialInventoryDO existed = inventoryMapper.selectByTypeDetailId(inventory.getTypeDetailId(), inventory.getBelongCompanyId()); - if (existed != null) { - MaterialInventoryDO upd = new MaterialInventoryDO(); - upd.setInventoryId(existed.getInventoryId()); - upd.setInventoryTotalNum((existed.getInventoryTotalNum() == null ? 0 : existed.getInventoryTotalNum()) + inventory.getCurrentNum()); - upd.setCurrentNum((existed.getCurrentNum() == null ? 0 : existed.getCurrentNum()) + inventory.getCurrentNum()); - inventoryMapper.updateById(upd); - } else { - inventoryMapper.insert(inventory); - } - - return success(inserted); - } - - @PostMapping("/edit") - @Operation(summary = "物料入库-修改") - @PreAuthorize("@ss.hasPermission('material:material/in:edit')") - public CommonResult edit(@RequestBody MaterialInventoryInDO req) { - return success(inMapper.updateById(req) > 0); - } - - @GetMapping("/delete/by/id") - @Operation(summary = "物料入库-删除") - @PreAuthorize("@ss.hasPermission('material:material/in:remove')") - @Transactional(rollbackFor = Throwable.class) - public CommonResult remove(@RequestParam("id") Long id) { - MaterialInventoryInDO in = inMapper.selectById(id); - if (in == null) { - return com.zteits.urbanops.framework.common.pojo.CommonResult.error(400, "参数错误"); - } - MaterialInventoryDO inv = inventoryMapper.selectByMaterialId(in.getMaterialId()); - if (inv == null) { - return com.zteits.urbanops.framework.common.pojo.CommonResult.error(400, "参数错误"); - } - if (inv.getCurrentNum() < in.getInInventoryNum()) { - return com.zteits.urbanops.framework.common.pojo.CommonResult.error(409, "库存已使用"); - } - MaterialInventoryDO upd = new MaterialInventoryDO(); - upd.setInventoryId(inv.getInventoryId()); - upd.setCurrentNum(inv.getCurrentNum() - in.getInInventoryNum()); - upd.setInventoryTotalNum(inv.getInventoryTotalNum() - in.getInInventoryNum()); - inventoryMapper.updateById(upd); - return success(inMapper.deleteById(id) > 0); - } -} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialInventoryController.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialInventoryController.java deleted file mode 100644 index 06518f8..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialInventoryController.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.admin.material; - -import com.zteits.urbanops.framework.common.pojo.CommonResult; -import com.zteits.urbanops.framework.common.pojo.PageParam; -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialInventoryDO; -import com.zteits.urbanops.module.garden.service.material.MaterialInventoryService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.annotation.Resource; -import jakarta.servlet.http.HttpServletResponse; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import java.io.IOException; -import java.util.List; - -import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; - -@Tag(name = "管理后台 - 物料库存") -@RestController -@RequestMapping("/material/inventory") -public class MaterialInventoryController { - - @Resource - private MaterialInventoryService inventoryService; - - @PostMapping("/listForPage") - @Operation(summary = "物料库存-分页查询") - @PreAuthorize("@ss.hasPermission('material:inventory:list')") - public CommonResult> listForPage(@RequestBody MaterialInventoryDO where, - @RequestParam(value = "pageNum", required = false) Integer pageNum, - @RequestParam(value = "pageSize", required = false) Integer pageSize) { - PageParam page = new PageParam(); - page.setPageNo(pageNum == null ? 1 : pageNum); - page.setPageSize(pageSize == null ? 10 : pageSize); - return success(inventoryService.selectPage(page, where)); - } - - @GetMapping("/export") - @Operation(summary = "物料库存-导出") - @PreAuthorize("@ss.hasPermission('material:inventory:export')") - public void export(MaterialInventoryDO where, HttpServletResponse response) throws IOException { - List list = inventoryService.selectPage(new PageParam(), where).getList(); - ExcelUtils.write(response, "物料库存.xls", "数据", MaterialInventoryDO.class, list); - } - - @GetMapping("/updateByAlermNum") - @Operation(summary = "物料库存-阈值更新") - @PreAuthorize("@ss.hasPermission('material:inventory:export')") - public CommonResult updateInventoryAlermNum(@RequestParam("material_id") Long materialId, - @RequestParam("alerm_num") Long alermNum) { - return success(inventoryService.updateInventoryAlarmNum(materialId, alermNum)); - } -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialOutController.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialOutController.java deleted file mode 100644 index 62fcf77..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialOutController.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.admin.material; - -import com.zteits.urbanops.framework.common.pojo.CommonResult; -import com.zteits.urbanops.framework.common.pojo.PageParam; -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; -import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialDO; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialInventoryDO; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialInventoryOutDO; -import com.zteits.urbanops.module.garden.dal.mysql.material.MaterialInventoryMapper; -import com.zteits.urbanops.module.garden.dal.mysql.material.MaterialInventoryOutMapper; -import com.zteits.urbanops.module.garden.service.material.MaterialService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.annotation.Resource; -import jakarta.servlet.http.HttpServletResponse; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.bind.annotation.*; - -import java.io.IOException; -import java.util.List; - -import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; - -@Tag(name = "管理后台 - 物料出库") -@RestController -@RequestMapping("/material/out") -public class MaterialOutController { - - @Resource - private MaterialInventoryOutMapper outMapper; - @Resource - private MaterialInventoryMapper inventoryMapper; - @Resource - private MaterialService materialService; - - @PostMapping("/listForPage") - @Operation(summary = "物料出库-分页") - @PreAuthorize("@ss.hasPermission('material:out:list')") - public CommonResult> listForPage(@RequestBody MaterialInventoryOutDO where, - @RequestParam(value = "pageNum", required = false) Integer pageNum, - @RequestParam(value = "pageSize", required = false) Integer pageSize) { - PageParam page = new PageParam(); - page.setPageNo(pageNum == null ? 1 : pageNum); - page.setPageSize(pageSize == null ? 10 : pageSize); - PageResult result = outMapper.selectPage(page, null, - new com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX() - .eqIfPresent(MaterialInventoryOutDO::getMaterialId, where.getMaterialId()) - .likeIfPresent(MaterialInventoryOutDO::getMaterialName, where.getMaterialName()) - .eqIfPresent(MaterialInventoryOutDO::getBelongCompanyId, where.getBelongCompanyId()) - .orderByDesc(MaterialInventoryOutDO::getCreateTime)); - return success(result); - } - - @GetMapping("/export") - @Operation(summary = "物料出库-导出") - @PreAuthorize("@ss.hasPermission('material:out:export')") - public void export(MaterialInventoryOutDO where, HttpServletResponse response) throws IOException { - List list = outMapper.selectList(new com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX() - .eqIfPresent(MaterialInventoryOutDO::getMaterialId, where.getMaterialId())); - ExcelUtils.write(response, "物料出库.xls", "数据", MaterialInventoryOutDO.class, list); - } - - @GetMapping("/{id}") - @Operation(summary = "物料出库-详情") - @PreAuthorize("@ss.hasPermission('material:out:query')") - public CommonResult getInfo(@RequestParam("id") Long id) { - return success(outMapper.selectById(id)); - } - - @PostMapping("/add") - @Operation(summary = "物料出库-添加") - @PreAuthorize("@ss.hasPermission('material:out:add')") - @Transactional(rollbackFor = Throwable.class) - public CommonResult add(@RequestBody MaterialInventoryOutDO req) { - Long userId = SecurityFrameworkUtils.getLoginUserId(); - MaterialDO material = materialService.getMaterial(req.getMaterialId()); - if (material == null) { - return com.zteits.urbanops.framework.common.pojo.CommonResult.error(400, "无效参数"); - } - MaterialInventoryDO inventory = inventoryMapper.selectByTypeDetailId(material.getTypeDetailId(), SecurityFrameworkUtils.getLoginUserDeptId()); - if (inventory == null) { - return com.zteits.urbanops.framework.common.pojo.CommonResult.error(400, req.getMaterialName() + "没有库存"); - } - if (inventory.getCurrentNum() < req.getOutInventoryNum()) { - return com.zteits.urbanops.framework.common.pojo.CommonResult.error(409, "当前库存不足,无法出库"); - } - req.setCreator(String.valueOf(userId)); - boolean inserted = outMapper.insert(req) > 0; - inventoryMapper.updateInventoryByMaterialId(inventory.getInventoryId(), req.getOutInventoryNum()); - return success(inserted); - } - - @PostMapping("/edit") - @Operation(summary = "物料出库-修改") - @PreAuthorize("@ss.hasPermission('material:out:edit')") - public CommonResult edit(@RequestBody MaterialInventoryOutDO req) { - return success(outMapper.updateById(req) > 0); - } - - @GetMapping("/delete/ById") - @Operation(summary = "物料出库-删除") - @PreAuthorize("@ss.hasPermission('material:out:remove')") - public CommonResult remove(@RequestParam("id") Long id) { - MaterialInventoryOutDO out = outMapper.selectById(id); - if (out == null) { - return com.zteits.urbanops.framework.common.pojo.CommonResult.error(400, "参数错误"); - } - MaterialInventoryDO inv = inventoryMapper.selectByMaterialId(out.getMaterialId()); - if (inv == null) { - return com.zteits.urbanops.framework.common.pojo.CommonResult.error(400, "参数错误"); - } - if (inv.getCurrentNum() < out.getOutInventoryNum()) { - return com.zteits.urbanops.framework.common.pojo.CommonResult.error(409, "库存已使用"); - } - MaterialInventoryDO upd = new MaterialInventoryDO(); - upd.setInventoryId(inv.getInventoryId()); - upd.setCurrentNum(inv.getCurrentNum() + out.getOutInventoryNum()); - upd.setInventoryTotalNum(inv.getInventoryTotalNum() + out.getOutInventoryNum()); - upd.setOutTotalNum(inv.getOutTotalNum() - out.getOutInventoryNum()); - inventoryMapper.updateById(upd); - return success(outMapper.deleteById(id) > 0); - } -} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialTypeController.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialTypeController.java deleted file mode 100644 index 2e886e3..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialTypeController.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.admin.material; - -import com.zteits.urbanops.module.garden.controller.admin.material.vo.MaterialTypePageReqVO; -import com.zteits.urbanops.module.garden.controller.admin.material.vo.MaterialTypeRespVO; -import com.zteits.urbanops.module.garden.controller.admin.material.vo.MaterialTypeSaveReqVO; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialTypeDO; -import com.zteits.urbanops.module.garden.service.material.MaterialTypeService; -import org.springframework.web.bind.annotation.*; -import jakarta.annotation.Resource; -import org.springframework.validation.annotation.Validated; -import org.springframework.security.access.prepost.PreAuthorize; -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.zteits.urbanops.framework.common.pojo.PageParam; -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.framework.common.pojo.CommonResult; -import com.zteits.urbanops.framework.common.util.object.BeanUtils; -import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; - -import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; - -import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; -import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*; - -@Tag(name = "管理后台 - 物料类型") -@RestController -@RequestMapping("/garden/material-type") -@Validated -public class MaterialTypeController { - - @Resource - private MaterialTypeService materialTypeService; - - @PostMapping("/create") - @Operation(summary = "创建物料类型") - @PreAuthorize("@ss.hasPermission('garden:material-type:create')") - public CommonResult createMaterialType(@Valid @RequestBody MaterialTypeSaveReqVO createReqVO) { - return success(materialTypeService.createMaterialType(createReqVO)); - } - - @PutMapping("/update") - @Operation(summary = "更新物料类型") - @PreAuthorize("@ss.hasPermission('garden:material-type:update')") - public CommonResult updateMaterialType(@Valid @RequestBody MaterialTypeSaveReqVO updateReqVO) { - materialTypeService.updateMaterialType(updateReqVO); - return success(true); - } - - @DeleteMapping("/delete") - @Operation(summary = "删除物料类型") - @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('garden:material-type:delete')") - public CommonResult deleteMaterialType(@RequestParam("id") Long id) { - materialTypeService.deleteMaterialType(id); - return success(true); - } - - @DeleteMapping("/delete-list") - @Parameter(name = "ids", description = "编号", required = true) - @Operation(summary = "批量删除物料类型") - @PreAuthorize("@ss.hasPermission('garden:material-type:delete')") - public CommonResult deleteMaterialTypeList(@RequestParam("ids") List ids) { - materialTypeService.deleteMaterialTypeListByIds(ids); - return success(true); - } - - @GetMapping("/get") - @Operation(summary = "获得物料类型") - @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('garden:material-type:query')") - public CommonResult getMaterialType(@RequestParam("id") Long id) { - MaterialTypeDO materialType = materialTypeService.getMaterialType(id); - return success(BeanUtils.toBean(materialType, MaterialTypeRespVO.class)); - } - - @GetMapping("/listForPage") - @Operation(summary = "获得物料类型分页") - @PreAuthorize("@ss.hasPermission('garden:material-type:query')") - public CommonResult> getMaterialTypePage(@Valid MaterialTypePageReqVO pageReqVO) { - PageResult pageResult = materialTypeService.getMaterialTypePage(pageReqVO); - return success(BeanUtils.toBean(pageResult, MaterialTypeRespVO.class)); - } - - @GetMapping("/export-excel") - @Operation(summary = "导出物料类型 Excel") - @PreAuthorize("@ss.hasPermission('garden:material-type:export')") - @ApiAccessLog(operateType = EXPORT) - public void exportMaterialTypeExcel(@Valid MaterialTypePageReqVO pageReqVO, - HttpServletResponse response) throws IOException { - pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); - List list = materialTypeService.getMaterialTypePage(pageReqVO).getList(); - // 导出 Excel - ExcelUtils.write(response, "物料类型.xls", "数据", MaterialTypeRespVO.class, - BeanUtils.toBean(list, MaterialTypeRespVO.class)); - } - - - /** - * 获取物料类型详细信息 - */ - @Operation(summary ="物料类型基础表-耗材类型List") - @GetMapping(value = "/getMaterialBigTypeList") - @PreAuthorize("@ss.hasPermission('garden:material-type:query')") - public CommonResult getInfo() { - return success(materialTypeService.queryMaterialBigType(null)); - } - - /** - * 获取物料类型详细信息 - */ - @Operation(summary ="物料类型基础表-类别List") - @GetMapping(value = "/getMaterialMidTypeList") - @PreAuthorize("@ss.hasPermission('garden:material-type:query')") - public CommonResult getMaterialMidTypeList(@RequestParam("material_type_id") Long materialTypeId) { - return success(materialTypeService.queryMaterialMidType(materialTypeId)); - } - - /** - * 获取物料类型详细信息 - */ - @Operation(summary ="物料类型基础表-类别List") - @GetMapping(value = "/getMaterialDetailTypeList") - @PreAuthorize("@ss.hasPermission('garden:material-type:query')") - public CommonResult getMaterialDetailTypeList(@RequestParam("parent_type_id") Long parentTypeId) { - return success(materialTypeService.queryMaterialDetailType(parentTypeId)); - } -} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialTypeManagerController.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialTypeManagerController.java deleted file mode 100644 index 9276880..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialTypeManagerController.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.admin.material; - -import org.springframework.web.bind.annotation.*; -import jakarta.annotation.Resource; -import org.springframework.validation.annotation.Validated; -import org.springframework.security.access.prepost.PreAuthorize; -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.constraints.*; -import jakarta.validation.*; -import jakarta.servlet.http.*; -import java.util.*; -import java.io.IOException; - -import com.zteits.urbanops.framework.common.pojo.PageParam; -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.framework.common.pojo.CommonResult; -import com.zteits.urbanops.framework.common.util.object.BeanUtils; -import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; - -import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; - -import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; -import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*; - -import com.zteits.urbanops.module.garden.controller.admin.material.vo.*; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialTypeManagerDO; -import com.zteits.urbanops.module.garden.service.material.MaterialTypeManagerService; - -@Tag(name = "管理后台 - 耗材类别管理") -@RestController -@RequestMapping("/garden/material-type-manager") -@Validated -public class MaterialTypeManagerController { - - @Resource - private MaterialTypeManagerService materialTypeManagerService; - - @PostMapping("/create") - @Operation(summary = "创建耗材类别管理") - @PreAuthorize("@ss.hasPermission('garden:material-type-manager:create')") - public CommonResult createMaterialTypeManager(@Valid @RequestBody MaterialTypeManagerSaveReqVO createReqVO) { - return success(materialTypeManagerService.createMaterialTypeManager(createReqVO)); - } - - @PutMapping("/update") - @Operation(summary = "更新耗材类别管理") - @PreAuthorize("@ss.hasPermission('garden:material-type-manager:update')") - public CommonResult updateMaterialTypeManager(@Valid @RequestBody MaterialTypeManagerSaveReqVO updateReqVO) { - materialTypeManagerService.updateMaterialTypeManager(updateReqVO); - return success(true); - } - - @DeleteMapping("/delete") - @Operation(summary = "删除耗材类别管理") - @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('garden:material-type-manager:delete')") - public CommonResult deleteMaterialTypeManager(@RequestParam("id") Long id) { - materialTypeManagerService.deleteMaterialTypeManager(id); - return success(true); - } - - @DeleteMapping("/delete-list") - @Parameter(name = "ids", description = "编号", required = true) - @Operation(summary = "批量删除耗材类别管理") - @PreAuthorize("@ss.hasPermission('garden:material-type-manager:delete')") - public CommonResult deleteMaterialTypeManagerList(@RequestParam("ids") List ids) { - materialTypeManagerService.deleteMaterialTypeManagerListByIds(ids); - return success(true); - } - - @GetMapping("/get") - @Operation(summary = "获得耗材类别管理") - @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('garden:material-type-manager:query')") - public CommonResult getMaterialTypeManager(@RequestParam("id") Long id) { - MaterialTypeManagerDO materialTypeManager = materialTypeManagerService.getMaterialTypeManager(id); - return success(BeanUtils.toBean(materialTypeManager, MaterialTypeManagerRespVO.class)); - } - - @GetMapping("/page") - @Operation(summary = "获得耗材类别管理分页") - @PreAuthorize("@ss.hasPermission('garden:material-type-manager:query')") - public CommonResult> getMaterialTypeManagerPage(@Valid MaterialTypeManagerPageReqVO pageReqVO) { - PageResult pageResult = materialTypeManagerService.getMaterialTypeManagerPage(pageReqVO); - return success(BeanUtils.toBean(pageResult, MaterialTypeManagerRespVO.class)); - } - - @GetMapping("/export-excel") - @Operation(summary = "导出耗材类别管理 Excel") - @PreAuthorize("@ss.hasPermission('garden:material-type-manager:export')") - @ApiAccessLog(operateType = EXPORT) - public void exportMaterialTypeManagerExcel(@Valid MaterialTypeManagerPageReqVO pageReqVO, - HttpServletResponse response) throws IOException { - pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); - List list = materialTypeManagerService.getMaterialTypeManagerPage(pageReqVO).getList(); - // 导出 Excel - ExcelUtils.write(response, "耗材类别管理.xls", "数据", MaterialTypeManagerRespVO.class, - BeanUtils.toBean(list, MaterialTypeManagerRespVO.class)); - } - -} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeManagerPageReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeManagerPageReqVO.java deleted file mode 100644 index 399c649..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeManagerPageReqVO.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.admin.material.vo; - -import lombok.*; -import java.util.*; -import io.swagger.v3.oas.annotations.media.Schema; -import com.zteits.urbanops.framework.common.pojo.PageParam; -import org.springframework.format.annotation.DateTimeFormat; -import java.time.LocalDateTime; - -import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; - -@Schema(description = "管理后台 - 耗材类别管理分页 Request VO") -@Data -public class MaterialTypeManagerPageReqVO extends PageParam { - - @Schema(description = "种类ID", example = "1958") - private Long classifyId; - - @Schema(description = "种类名称", example = "芋艿") - private String classifyName; - - @Schema(description = "类别ID", example = "22418") - private Long typeId; - - @Schema(description = "类别名称", example = "王五") - private String typeName; - - @Schema(description = "类别明细ID", example = "22381") - private Long typeDetailId; - - @Schema(description = "类别明细名称", example = "芋艿") - private String typeDetailName; - - @Schema(description = "公司ID", example = "22461") - private Long companyId; - - @Schema(description = "公司名称", example = "李四") - private String companyName; - - @Schema(description = "数量") - private Long num; - - @Schema(description = "单位ID", example = "26719") - private Long unitId; - - @Schema(description = "单位", example = "张三") - private String unitName; - - @Schema(description = " 描述", example = "你说的对") - private String remark; - - @Schema(description = "状态(0正常 1停用)", example = "1") - private Integer status; - - @Schema(description = "创建者") - private String creator; - - @Schema(description = "创建时间") - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime[] createTime; - - @Schema(description = "更新者") - private String updater; - -} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeManagerRespVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeManagerRespVO.java deleted file mode 100644 index f5f608a..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeManagerRespVO.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.admin.material.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 cn.idev.excel.annotation.*; - -@Schema(description = "管理后台 - 耗材类别管理 Response VO") -@Data -@ExcelIgnoreUnannotated -public class MaterialTypeManagerRespVO { - - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22778") - @ExcelProperty("ID") - private Long id; - - @Schema(description = "种类ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1958") - @ExcelProperty("种类ID") - private Long classifyId; - - @Schema(description = "种类名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") - @ExcelProperty("种类名称") - private String classifyName; - - @Schema(description = "类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22418") - @ExcelProperty("类别ID") - private Long typeId; - - @Schema(description = "类别名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") - @ExcelProperty("类别名称") - private String typeName; - - @Schema(description = "类别明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22381") - @ExcelProperty("类别明细ID") - private Long typeDetailId; - - @Schema(description = "类别明细名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") - @ExcelProperty("类别明细名称") - private String typeDetailName; - - @Schema(description = "公司ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22461") - @ExcelProperty("公司ID") - private Long companyId; - - @Schema(description = "公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") - @ExcelProperty("公司名称") - private String companyName; - - @Schema(description = "数量", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("数量") - private Long num; - - @Schema(description = "单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26719") - @ExcelProperty("单位ID") - private Long unitId; - - @Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") - @ExcelProperty("单位") - private String unitName; - - @Schema(description = " 描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对") - @ExcelProperty(" 描述") - private String remark; - - @Schema(description = "状态(0正常 1停用)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") - @ExcelProperty("状态(0正常 1停用)") - private Integer status; - - @Schema(description = "创建者") - @ExcelProperty("创建者") - private String creator; - - @Schema(description = "创建时间") - @ExcelProperty("创建时间") - private LocalDateTime createTime; - - @Schema(description = "更新者") - @ExcelProperty("更新者") - private String updater; - -} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeManagerSaveReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeManagerSaveReqVO.java deleted file mode 100644 index d9d4de1..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeManagerSaveReqVO.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.admin.material.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 MaterialTypeManagerSaveReqVO { - - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22778") - private Long id; - - @Schema(description = "种类ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1958") - @NotNull(message = "种类ID不能为空") - private Long classifyId; - - @Schema(description = "种类名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") - @NotEmpty(message = "种类名称不能为空") - private String classifyName; - - @Schema(description = "类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22418") - @NotNull(message = "类别ID不能为空") - private Long typeId; - - @Schema(description = "类别名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") - @NotEmpty(message = "类别名称不能为空") - private String typeName; - - @Schema(description = "类别明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22381") - @NotNull(message = "类别明细ID不能为空") - private Long typeDetailId; - - @Schema(description = "类别明细名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") - @NotEmpty(message = "类别明细名称不能为空") - private String typeDetailName; - - @Schema(description = "公司ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22461") - @NotNull(message = "公司ID不能为空") - private Long companyId; - - @Schema(description = "公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") - @NotEmpty(message = "公司名称不能为空") - private String companyName; - - @Schema(description = "数量", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "数量不能为空") - private Long num; - - @Schema(description = "单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26719") - @NotNull(message = "单位ID不能为空") - private Long unitId; - - @Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") - @NotEmpty(message = "单位不能为空") - private String unitName; - - @Schema(description = " 描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对") - @NotEmpty(message = " 描述不能为空") - private String remark; - - @Schema(description = "状态(0正常 1停用)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") - @NotNull(message = "状态(0正常 1停用)不能为空") - private Integer status; - - @Schema(description = "创建者") - private String creator; - - @Schema(description = "更新者") - private String updater; - -} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypePageReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypePageReqVO.java deleted file mode 100644 index eaa3f97..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypePageReqVO.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.admin.material.vo; - -import lombok.*; -import java.util.*; -import io.swagger.v3.oas.annotations.media.Schema; -import com.zteits.urbanops.framework.common.pojo.PageParam; -import org.springframework.format.annotation.DateTimeFormat; -import java.time.LocalDateTime; - -import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; - -@Schema(description = "管理后台 - 物料类型分页 Request VO") -@Data -public class MaterialTypePageReqVO extends PageParam { - - @Schema(description = "物料类型ID", example = "31914") - private Long materialTypeId; - - @Schema(description = "耗材类型名称:工具", example = "赵六") - private String materialTypeName; - - @Schema(description = "类别ID", example = "13166") - private Long typeId; - - @Schema(description = "类别名称:药品", example = "李四") - private String typeName; - - @Schema(description = "付物料类型ID", example = "4908") - private Long materialParentTypeId; - - @Schema(description = "类别明细ID", example = "2459") - private Long typeDetailId; - - @Schema(description = "类别明细", example = "赵六") - private String typeDetailName; - - @Schema(description = "父类别ID", example = "6341") - private Long parentTypeId; - - @Schema(description = "备注", example = "你猜") - private String remark; - - @Schema(description = "状态(0正常 1停用)", example = "2") - private String status; - - @Schema(description = "创建者") - private String creator; - - @Schema(description = "创建时间") - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime[] createTime; - - @Schema(description = "更新者") - private String updater; - -} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeResp.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeResp.java deleted file mode 100644 index a838ba7..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeResp.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.admin.material.vo; - -/** - * Copyright: Copyright (c) 2017 zteits - * - * @ClassName: MaterialTypeManagerResp.java - * @Description: - * @version: v1.0.0 - * @author: wangfs - * @date: 2024-11-10 13:50 - * Modification History: - * Date Author Version Description - * ---------------------------------------------------------* - * 2024-11-10 wangfs v1.0.0 创建 - */ - -public class MaterialTypeResp { - - private Long value; - - private String label; - - public Long getValue() { - return value; - } - - public void setValue(Long value) { - this.value = value; - } - - public String getLabel() { - return label; - } - - public void setLabel(String label) { - this.label = label; - } -} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeRespVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeRespVO.java deleted file mode 100644 index 35a47e3..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeRespVO.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.admin.material.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 cn.idev.excel.annotation.*; - -@Schema(description = "管理后台 - 物料类型 Response VO") -@Data -@ExcelIgnoreUnannotated -public class MaterialTypeRespVO { - - @Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23621") - @ExcelProperty("物料ID") - private Long id; - - @Schema(description = "物料类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31914") - @ExcelProperty("物料类型ID") - private Long materialTypeId; - - @Schema(description = "耗材类型名称:工具", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") - @ExcelProperty("耗材类型名称:工具") - private String materialTypeName; - - @Schema(description = "类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13166") - @ExcelProperty("类别ID") - private Long typeId; - - @Schema(description = "类别名称:药品", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") - @ExcelProperty("类别名称:药品") - private String typeName; - - @Schema(description = "付物料类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4908") - @ExcelProperty("付物料类型ID") - private Long materialParentTypeId; - - @Schema(description = "类别明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2459") - @ExcelProperty("类别明细ID") - private Long typeDetailId; - - @Schema(description = "类别明细", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") - @ExcelProperty("类别明细") - private String typeDetailName; - - @Schema(description = "父类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6341") - @ExcelProperty("父类别ID") - private Long parentTypeId; - - @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你猜") - @ExcelProperty("备注") - private String remark; - - @Schema(description = "状态(0正常 1停用)", example = "2") - @ExcelProperty("状态(0正常 1停用)") - private String status; - - @Schema(description = "创建者") - @ExcelProperty("创建者") - private String creator; - - @Schema(description = "创建时间") - @ExcelProperty("创建时间") - private LocalDateTime createTime; - - @Schema(description = "更新者") - @ExcelProperty("更新者") - private String updater; - -} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeSaveReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeSaveReqVO.java deleted file mode 100644 index 0e58545..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeSaveReqVO.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.admin.material.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 MaterialTypeSaveReqVO { - - @Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23621") - private Long id; - - @Schema(description = "物料类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31914") - @NotNull(message = "物料类型ID不能为空") - private Long materialTypeId; - - @Schema(description = "耗材类型名称:工具", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") - @NotEmpty(message = "耗材类型名称:工具不能为空") - private String materialTypeName; - - @Schema(description = "类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13166") - @NotNull(message = "类别ID不能为空") - private Long typeId; - - @Schema(description = "类别名称:药品", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") - @NotEmpty(message = "类别名称:药品不能为空") - private String typeName; - - @Schema(description = "付物料类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4908") - private Long materialParentTypeId; - - @Schema(description = "类别明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2459") - private Long typeDetailId; - - @Schema(description = "类别明细", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") - @NotEmpty(message = "类别明细不能为空") - private String typeDetailName; - - @Schema(description = "父类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6341") - private Long parentTypeId; - - @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你猜") - private String remark; - -} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventory/MaterialInventoryController.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventory/MaterialInventoryController.java new file mode 100644 index 0000000..b28ede4 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventory/MaterialInventoryController.java @@ -0,0 +1,56 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialinventory; + +import com.zteits.urbanops.framework.common.pojo.CommonResult; +import com.zteits.urbanops.framework.common.pojo.PageParam; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventory.MaterialInventoryDO; +import com.zteits.urbanops.module.garden.service.materialinventory.MaterialInventoryService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import java.io.IOException; +import java.util.List; + +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; + +@Tag(name = "管理后台 - 物料库存") +@RestController +@RequestMapping("/material/inventory") +public class MaterialInventoryController { + + @Resource + private MaterialInventoryService inventoryService; + + @PostMapping("/listForPage") + @Operation(summary = "物料库存-分页查询") + @PreAuthorize("@ss.hasPermission('material:inventory:list')") + public CommonResult> listForPage(@RequestBody MaterialInventoryDO where, + @RequestParam(value = "pageNum", required = false) Integer pageNum, + @RequestParam(value = "pageSize", required = false) Integer pageSize) { + PageParam page = new PageParam(); + page.setPageNo(pageNum == null ? 1 : pageNum); + page.setPageSize(pageSize == null ? 10 : pageSize); + return success(inventoryService.selectPage(page, where)); + } + + @GetMapping("/export") + @Operation(summary = "物料库存-导出") + @PreAuthorize("@ss.hasPermission('material:inventory:export')") + public void export(MaterialInventoryDO where, HttpServletResponse response) throws IOException { + List list = inventoryService.selectPage(new PageParam(), where).getList(); + ExcelUtils.write(response, "物料库存.xls", "数据", MaterialInventoryDO.class, list); + } + + @GetMapping("/updateByAlermNum") + @Operation(summary = "物料库存-阈值更新") + @PreAuthorize("@ss.hasPermission('material:inventory:export')") + public CommonResult updateInventoryAlermNum(@RequestParam("material_id") Long materialId, + @RequestParam("alerm_num") Long alermNum) { + return success(inventoryService.updateInventoryAlarmNum(materialId, alermNum)); + } +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/MaterialInventoryInController.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/MaterialInventoryInController.java new file mode 100644 index 0000000..0147b5d --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/MaterialInventoryInController.java @@ -0,0 +1,104 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialinventoryin; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +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.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zteits.urbanops.framework.common.pojo.PageParam; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.CommonResult; +import com.zteits.urbanops.framework.common.util.object.BeanUtils; +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; + +import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; + +import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; +import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*; + +import com.zteits.urbanops.module.garden.controller.admin.materialinventoryin.vo.*; +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventoryin.MaterialInventoryInDO; +import com.zteits.urbanops.module.garden.service.materialinventoryin.MaterialInventoryInService; + +@Tag(name = "管理后台 - 物料入库") +@RestController +@RequestMapping("/garden/material-inventory-in") +@Validated +public class MaterialInventoryInController { + + @Resource + private MaterialInventoryInService materialInventoryInService; + + @PostMapping("/create") + @Operation(summary = "创建物料入库") + @PreAuthorize("@ss.hasPermission('garden:material-inventory-in:create')") + public CommonResult createMaterialInventoryIn(@Valid @RequestBody MaterialInventoryInSaveReqVO createReqVO) { + return success(materialInventoryInService.createMaterialInventoryIn(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新物料入库") + @PreAuthorize("@ss.hasPermission('garden:material-inventory-in:update')") + public CommonResult updateMaterialInventoryIn(@Valid @RequestBody MaterialInventoryInSaveReqVO updateReqVO) { + materialInventoryInService.updateMaterialInventoryIn(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除物料入库") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('garden:material-inventory-in:delete')") + public CommonResult deleteMaterialInventoryIn(@RequestParam("id") Long id) { + materialInventoryInService.deleteMaterialInventoryIn(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除物料入库") + @PreAuthorize("@ss.hasPermission('garden:material-inventory-in:delete')") + public CommonResult deleteMaterialInventoryInList(@RequestParam("ids") List ids) { + materialInventoryInService.deleteMaterialInventoryInListByIds(ids); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得物料入库") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('garden:material-inventory-in:query')") + public CommonResult getMaterialInventoryIn(@RequestParam("id") Long id) { + MaterialInventoryInDO materialInventoryIn = materialInventoryInService.getMaterialInventoryIn(id); + return success(BeanUtils.toBean(materialInventoryIn, MaterialInventoryInRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得物料入库分页") + @PreAuthorize("@ss.hasPermission('garden:material-inventory-in:query')") + public CommonResult> getMaterialInventoryInPage(@Valid MaterialInventoryInPageReqVO pageReqVO) { + PageResult pageResult = materialInventoryInService.getMaterialInventoryInPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialInventoryInRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出物料入库 Excel") + @PreAuthorize("@ss.hasPermission('garden:material-inventory-in:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportMaterialInventoryInExcel(@Valid MaterialInventoryInPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = materialInventoryInService.getMaterialInventoryInPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "物料入库.xls", "数据", MaterialInventoryInRespVO.class, + BeanUtils.toBean(list, MaterialInventoryInRespVO.class)); + } + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/vo/MaterialInventoryInPageReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/vo/MaterialInventoryInPageReqVO.java new file mode 100644 index 0000000..aa520fe --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/vo/MaterialInventoryInPageReqVO.java @@ -0,0 +1,85 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialinventoryin.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zteits.urbanops.framework.common.pojo.PageParam; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 物料入库分页 Request VO") +@Data +public class MaterialInventoryInPageReqVO extends PageParam { + + @Schema(description = "入库批次号") + private String inventoryInNo; + + @Schema(description = "物料ID", example = "7335") + private Long materialId; + + @Schema(description = "物料名称", example = "芋艿") + private String materialName; + + @Schema(description = "物料类型ID", example = "27813") + private Long materialTypeId; + + @Schema(description = "耗材类型名称", example = "李四") + private String materialTypeName; + + @Schema(description = "类别ID", example = "24913") + private Long typeId; + + @Schema(description = "类别名称:药品", example = "李四") + private String typeName; + + @Schema(description = "类别明细ID", example = "53") + private Long typeDetailId; + + @Schema(description = "类别明细", example = "张三") + private String typeDetailName; + + @Schema(description = "规格") + private String specifications; + + @Schema(description = "归属单位ID", example = "27639") + private Long belongCompanyId; + + @Schema(description = "归属单位", example = "王五") + private String belongCompanyName; + + @Schema(description = "入库数量") + private Long inInventoryNum; + + @Schema(description = "单价", example = "17670") + private BigDecimal materialPrice; + + @Schema(description = "单位ID", example = "11362") + private Long unitId; + + @Schema(description = "单位", example = "李四") + private String unitName; + + @Schema(description = "采购日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] buyDate; + + @Schema(description = "供应商名称", example = "王五") + private String supplierName; + + @Schema(description = "联系人", example = "赵六") + private String contactsName; + + @Schema(description = "联系人 电话") + private String contactsPhone; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "部门ID", example = "18025") + private Long deptId; + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/vo/MaterialInventoryInRespVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/vo/MaterialInventoryInRespVO.java new file mode 100644 index 0000000..95fe8aa --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/vo/MaterialInventoryInRespVO.java @@ -0,0 +1,108 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialinventoryin.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import cn.idev.excel.annotation.*; + +@Schema(description = "管理后台 - 物料入库 Response VO") +@Data +@ExcelIgnoreUnannotated +public class MaterialInventoryInRespVO { + + @Schema(description = "入库ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16290") + @ExcelProperty("入库ID") + private Long id; + + @Schema(description = "入库批次号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("入库批次号") + private String inventoryInNo; + + @Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7335") + @ExcelProperty("物料ID") + private Long materialId; + + @Schema(description = "物料名称", example = "芋艿") + @ExcelProperty("物料名称") + private String materialName; + + @Schema(description = "物料类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27813") + @ExcelProperty("物料类型ID") + private Long materialTypeId; + + @Schema(description = "耗材类型名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @ExcelProperty("耗材类型名称") + private String materialTypeName; + + @Schema(description = "类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24913") + @ExcelProperty("类别ID") + private Long typeId; + + @Schema(description = "类别名称:药品", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @ExcelProperty("类别名称:药品") + private String typeName; + + @Schema(description = "类别明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "53") + @ExcelProperty("类别明细ID") + private Long typeDetailId; + + @Schema(description = "类别明细", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @ExcelProperty("类别明细") + private String typeDetailName; + + @Schema(description = "规格", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("规格") + private String specifications; + + @Schema(description = "归属单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27639") + @ExcelProperty("归属单位ID") + private Long belongCompanyId; + + @Schema(description = "归属单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @ExcelProperty("归属单位") + private String belongCompanyName; + + @Schema(description = "入库数量", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("入库数量") + private Long inInventoryNum; + + @Schema(description = "单价", requiredMode = Schema.RequiredMode.REQUIRED, example = "17670") + @ExcelProperty("单价") + private BigDecimal materialPrice; + + @Schema(description = "单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11362") + @ExcelProperty("单位ID") + private Long unitId; + + @Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @ExcelProperty("单位") + private String unitName; + + @Schema(description = "采购日期", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("采购日期") + private LocalDateTime buyDate; + + @Schema(description = "供应商名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @ExcelProperty("供应商名称") + private String supplierName; + + @Schema(description = "联系人", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @ExcelProperty("联系人") + private String contactsName; + + @Schema(description = "联系人 电话", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("联系人 电话") + private String contactsPhone; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "部门ID", example = "18025") + @ExcelProperty("部门ID") + private Long deptId; + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/vo/MaterialInventoryInSaveReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/vo/MaterialInventoryInSaveReqVO.java new file mode 100644 index 0000000..87e7d12 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/vo/MaterialInventoryInSaveReqVO.java @@ -0,0 +1,100 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialinventoryin.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 物料入库新增/修改 Request VO") +@Data +public class MaterialInventoryInSaveReqVO { + + @Schema(description = "入库ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16290") + private Long id; + + @Schema(description = "入库批次号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "入库批次号不能为空") + private String inventoryInNo; + + @Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7335") + @NotNull(message = "物料ID不能为空") + private Long materialId; + + @Schema(description = "物料名称", example = "芋艿") + private String materialName; + + @Schema(description = "物料类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27813") + @NotNull(message = "物料类型ID不能为空") + private Long materialTypeId; + + @Schema(description = "耗材类型名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @NotEmpty(message = "耗材类型名称不能为空") + private String materialTypeName; + + @Schema(description = "类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24913") + @NotNull(message = "类别ID不能为空") + private Long typeId; + + @Schema(description = "类别名称:药品", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @NotEmpty(message = "类别名称:药品不能为空") + private String typeName; + + @Schema(description = "类别明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "53") + @NotNull(message = "类别明细ID不能为空") + private Long typeDetailId; + + @Schema(description = "类别明细", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @NotEmpty(message = "类别明细不能为空") + private String typeDetailName; + + @Schema(description = "规格", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "规格不能为空") + private String specifications; + + @Schema(description = "归属单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27639") + @NotNull(message = "归属单位ID不能为空") + private Long belongCompanyId; + + @Schema(description = "归属单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @NotEmpty(message = "归属单位不能为空") + private String belongCompanyName; + + @Schema(description = "入库数量", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "入库数量不能为空") + private Long inInventoryNum; + + @Schema(description = "单价", requiredMode = Schema.RequiredMode.REQUIRED, example = "17670") + @NotNull(message = "单价不能为空") + private BigDecimal materialPrice; + + @Schema(description = "单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11362") + @NotNull(message = "单位ID不能为空") + private Long unitId; + + @Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @NotEmpty(message = "单位不能为空") + private String unitName; + + @Schema(description = "采购日期", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "采购日期不能为空") + private LocalDateTime buyDate; + + @Schema(description = "供应商名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @NotEmpty(message = "供应商名称不能为空") + private String supplierName; + + @Schema(description = "联系人", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @NotEmpty(message = "联系人不能为空") + private String contactsName; + + @Schema(description = "联系人 电话", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "联系人 电话不能为空") + private String contactsPhone; + + @Schema(description = "部门ID", example = "18025") + private Long deptId; + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/MaterialInventoryOutController.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/MaterialInventoryOutController.java new file mode 100644 index 0000000..0b63277 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/MaterialInventoryOutController.java @@ -0,0 +1,104 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialinventoryout; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +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.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zteits.urbanops.framework.common.pojo.PageParam; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.CommonResult; +import com.zteits.urbanops.framework.common.util.object.BeanUtils; +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; + +import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; + +import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; +import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*; + +import com.zteits.urbanops.module.garden.controller.admin.materialinventoryout.vo.*; +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventoryout.MaterialInventoryOutDO; +import com.zteits.urbanops.module.garden.service.materialinventoryout.MaterialInventoryOutService; + +@Tag(name = "管理后台 - 物料出库") +@RestController +@RequestMapping("/garden/material-inventory-out") +@Validated +public class MaterialInventoryOutController { + + @Resource + private MaterialInventoryOutService materialInventoryOutService; + + @PostMapping("/create") + @Operation(summary = "创建物料出库") + @PreAuthorize("@ss.hasPermission('garden:material-inventory-out:create')") + public CommonResult createMaterialInventoryOut(@Valid @RequestBody MaterialInventoryOutSaveReqVO createReqVO) { + return success(materialInventoryOutService.createMaterialInventoryOut(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新物料出库") + @PreAuthorize("@ss.hasPermission('garden:material-inventory-out:update')") + public CommonResult updateMaterialInventoryOut(@Valid @RequestBody MaterialInventoryOutSaveReqVO updateReqVO) { + materialInventoryOutService.updateMaterialInventoryOut(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除物料出库") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('garden:material-inventory-out:delete')") + public CommonResult deleteMaterialInventoryOut(@RequestParam("id") Long id) { + materialInventoryOutService.deleteMaterialInventoryOut(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除物料出库") + @PreAuthorize("@ss.hasPermission('garden:material-inventory-out:delete')") + public CommonResult deleteMaterialInventoryOutList(@RequestParam("ids") List ids) { + materialInventoryOutService.deleteMaterialInventoryOutListByIds(ids); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得物料出库") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('garden:material-inventory-out:query')") + public CommonResult getMaterialInventoryOut(@RequestParam("id") Long id) { + MaterialInventoryOutDO materialInventoryOut = materialInventoryOutService.getMaterialInventoryOut(id); + return success(BeanUtils.toBean(materialInventoryOut, MaterialInventoryOutRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得物料出库分页") + @PreAuthorize("@ss.hasPermission('garden:material-inventory-out:query')") + public CommonResult> getMaterialInventoryOutPage(@Valid MaterialInventoryOutPageReqVO pageReqVO) { + PageResult pageResult = materialInventoryOutService.getMaterialInventoryOutPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialInventoryOutRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出物料出库 Excel") + @PreAuthorize("@ss.hasPermission('garden:material-inventory-out:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportMaterialInventoryOutExcel(@Valid MaterialInventoryOutPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = materialInventoryOutService.getMaterialInventoryOutPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "物料出库.xls", "数据", MaterialInventoryOutRespVO.class, + BeanUtils.toBean(list, MaterialInventoryOutRespVO.class)); + } + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/vo/MaterialInventoryOutPageReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/vo/MaterialInventoryOutPageReqVO.java new file mode 100644 index 0000000..19ed20c --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/vo/MaterialInventoryOutPageReqVO.java @@ -0,0 +1,78 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialinventoryout.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zteits.urbanops.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 物料出库分页 Request VO") +@Data +public class MaterialInventoryOutPageReqVO extends PageParam { + + @Schema(description = "入库批次号") + private String inventoryOutNo; + + @Schema(description = "物料ID", example = "14541") + private Long materialId; + + @Schema(description = "物料名称", example = "芋艿") + private String materialName; + + @Schema(description = "物料类型ID", example = "9209") + private Long materialTypeId; + + @Schema(description = "耗材类型名称", example = "王五") + private String materialTypeName; + + @Schema(description = "类别ID", example = "12624") + private Long typeId; + + @Schema(description = "类别名称:药品", example = "芋艿") + private String typeName; + + @Schema(description = "类别明细ID", example = "24611") + private Long typeDetailId; + + @Schema(description = "类别明细", example = "王五") + private String typeDetailName; + + @Schema(description = "规格") + private String specifications; + + @Schema(description = "归属单位ID", example = "17128") + private Long belongCompanyId; + + @Schema(description = "归属单位", example = "李四") + private String belongCompanyName; + + @Schema(description = "出库数量") + private Long outInventoryNum; + + @Schema(description = "单位ID", example = "1033") + private Long unitId; + + @Schema(description = "单位", example = "芋艿") + private String unitName; + + @Schema(description = "出库日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] outDate; + + @Schema(description = "备注", example = "你说的对") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "部门ID", example = "22618") + private Long deptId; + + @Schema(description = "类型: 1:手动出库;2:养护类出库", example = "1") + private Integer type; + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/vo/MaterialInventoryOutRespVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/vo/MaterialInventoryOutRespVO.java new file mode 100644 index 0000000..f05118a --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/vo/MaterialInventoryOutRespVO.java @@ -0,0 +1,99 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialinventoryout.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 cn.idev.excel.annotation.*; + +@Schema(description = "管理后台 - 物料出库 Response VO") +@Data +@ExcelIgnoreUnannotated +public class MaterialInventoryOutRespVO { + + @Schema(description = "入库ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18713") + @ExcelProperty("入库ID") + private Long id; + + @Schema(description = "入库批次号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("入库批次号") + private String inventoryOutNo; + + @Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14541") + @ExcelProperty("物料ID") + private Long materialId; + + @Schema(description = "物料名称", example = "芋艿") + @ExcelProperty("物料名称") + private String materialName; + + @Schema(description = "物料类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9209") + @ExcelProperty("物料类型ID") + private Long materialTypeId; + + @Schema(description = "耗材类型名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @ExcelProperty("耗材类型名称") + private String materialTypeName; + + @Schema(description = "类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12624") + @ExcelProperty("类别ID") + private Long typeId; + + @Schema(description = "类别名称:药品", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @ExcelProperty("类别名称:药品") + private String typeName; + + @Schema(description = "类别明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24611") + @ExcelProperty("类别明细ID") + private Long typeDetailId; + + @Schema(description = "类别明细", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @ExcelProperty("类别明细") + private String typeDetailName; + + @Schema(description = "规格", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("规格") + private String specifications; + + @Schema(description = "归属单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17128") + @ExcelProperty("归属单位ID") + private Long belongCompanyId; + + @Schema(description = "归属单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @ExcelProperty("归属单位") + private String belongCompanyName; + + @Schema(description = "出库数量", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("出库数量") + private Long outInventoryNum; + + @Schema(description = "单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1033") + @ExcelProperty("单位ID") + private Long unitId; + + @Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @ExcelProperty("单位") + private String unitName; + + @Schema(description = "出库日期", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("出库日期") + private LocalDateTime outDate; + + @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "部门ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22618") + @ExcelProperty("部门ID") + private Long deptId; + + @Schema(description = "类型: 1:手动出库;2:养护类出库", example = "1") + @ExcelProperty("类型: 1:手动出库;2:养护类出库") + private Integer type; + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/vo/MaterialInventoryOutSaveReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/vo/MaterialInventoryOutSaveReqVO.java new file mode 100644 index 0000000..52510bb --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/vo/MaterialInventoryOutSaveReqVO.java @@ -0,0 +1,91 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialinventoryout.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 MaterialInventoryOutSaveReqVO { + + @Schema(description = "入库ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18713") + private Long id; + + @Schema(description = "入库批次号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "入库批次号不能为空") + private String inventoryOutNo; + + @Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14541") + @NotNull(message = "物料ID不能为空") + private Long materialId; + + @Schema(description = "物料名称", example = "芋艿") + private String materialName; + + @Schema(description = "物料类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9209") + @NotNull(message = "物料类型ID不能为空") + private Long materialTypeId; + + @Schema(description = "耗材类型名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @NotEmpty(message = "耗材类型名称不能为空") + private String materialTypeName; + + @Schema(description = "类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12624") + @NotNull(message = "类别ID不能为空") + private Long typeId; + + @Schema(description = "类别名称:药品", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @NotEmpty(message = "类别名称:药品不能为空") + private String typeName; + + @Schema(description = "类别明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24611") + @NotNull(message = "类别明细ID不能为空") + private Long typeDetailId; + + @Schema(description = "类别明细", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @NotEmpty(message = "类别明细不能为空") + private String typeDetailName; + + @Schema(description = "规格", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "规格不能为空") + private String specifications; + + @Schema(description = "归属单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17128") + @NotNull(message = "归属单位ID不能为空") + private Long belongCompanyId; + + @Schema(description = "归属单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @NotEmpty(message = "归属单位不能为空") + private String belongCompanyName; + + @Schema(description = "出库数量", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "出库数量不能为空") + private Long outInventoryNum; + + @Schema(description = "单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1033") + @NotNull(message = "单位ID不能为空") + private Long unitId; + + @Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @NotEmpty(message = "单位不能为空") + private String unitName; + + @Schema(description = "出库日期", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "出库日期不能为空") + private LocalDateTime outDate; + + @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对") + @NotEmpty(message = "备注不能为空") + private String remark; + + @Schema(description = "部门ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22618") + @NotNull(message = "部门ID不能为空") + private Long deptId; + + @Schema(description = "类型: 1:手动出库;2:养护类出库", example = "1") + private Integer type; + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/MaterialTypeController.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/MaterialTypeController.java new file mode 100644 index 0000000..e7503d5 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/MaterialTypeController.java @@ -0,0 +1,134 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialtype; + +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypePageReqVO; +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeRespVO; +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeSaveReqVO; +import com.zteits.urbanops.module.garden.dal.dataobject.materialtype.MaterialTypeDO; +import com.zteits.urbanops.module.garden.service.materialtype.MaterialTypeService; +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +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.zteits.urbanops.framework.common.pojo.PageParam; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.CommonResult; +import com.zteits.urbanops.framework.common.util.object.BeanUtils; +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; + +import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; + +import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; +import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 物料类型") +@RestController +@RequestMapping("/garden/material-type") +@Validated +public class MaterialTypeController { + + @Resource + private MaterialTypeService materialTypeService; + + @PostMapping("/create") + @Operation(summary = "创建物料类型") + @PreAuthorize("@ss.hasPermission('garden:material-type:create')") + public CommonResult createMaterialType(@Valid @RequestBody MaterialTypeSaveReqVO createReqVO) { + return success(materialTypeService.createMaterialType(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新物料类型") + @PreAuthorize("@ss.hasPermission('garden:material-type:update')") + public CommonResult updateMaterialType(@Valid @RequestBody MaterialTypeSaveReqVO updateReqVO) { + materialTypeService.updateMaterialType(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除物料类型") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('garden:material-type:delete')") + public CommonResult deleteMaterialType(@RequestParam("id") Long id) { + materialTypeService.deleteMaterialType(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除物料类型") + @PreAuthorize("@ss.hasPermission('garden:material-type:delete')") + public CommonResult deleteMaterialTypeList(@RequestParam("ids") List ids) { + materialTypeService.deleteMaterialTypeListByIds(ids); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得物料类型") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('garden:material-type:query')") + public CommonResult getMaterialType(@RequestParam("id") Long id) { + MaterialTypeDO materialType = materialTypeService.getMaterialType(id); + return success(BeanUtils.toBean(materialType, MaterialTypeRespVO.class)); + } + + @GetMapping("/listForPage") + @Operation(summary = "获得物料类型分页") + @PreAuthorize("@ss.hasPermission('garden:material-type:query')") + public CommonResult> getMaterialTypePage(@Valid MaterialTypePageReqVO pageReqVO) { + PageResult pageResult = materialTypeService.getMaterialTypePage(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialTypeRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出物料类型 Excel") + @PreAuthorize("@ss.hasPermission('garden:material-type:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportMaterialTypeExcel(@Valid MaterialTypePageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = materialTypeService.getMaterialTypePage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "物料类型.xls", "数据", MaterialTypeRespVO.class, + BeanUtils.toBean(list, MaterialTypeRespVO.class)); + } + + + /** + * 获取物料类型详细信息 + */ + @Operation(summary ="物料类型基础表-耗材类型List") + @GetMapping(value = "/getMaterialBigTypeList") + @PreAuthorize("@ss.hasPermission('garden:material-type:query')") + public CommonResult getInfo() { + return success(materialTypeService.queryMaterialBigType(null)); + } + + /** + * 获取物料类型详细信息 + */ + @Operation(summary ="物料类型基础表-类别List") + @GetMapping(value = "/getMaterialMidTypeList") + @PreAuthorize("@ss.hasPermission('garden:material-type:query')") + public CommonResult getMaterialMidTypeList(@RequestParam("material_type_id") Long materialTypeId) { + return success(materialTypeService.queryMaterialMidType(materialTypeId)); + } + + /** + * 获取物料类型详细信息 + */ + @Operation(summary ="物料类型基础表-类别List") + @GetMapping(value = "/getMaterialDetailTypeList") + @PreAuthorize("@ss.hasPermission('garden:material-type:query')") + public CommonResult getMaterialDetailTypeList(@RequestParam("parent_type_id") Long parentTypeId) { + return success(materialTypeService.queryMaterialDetailType(parentTypeId)); + } +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/MaterialTypeManagerController.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/MaterialTypeManagerController.java new file mode 100644 index 0000000..219f339 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/MaterialTypeManagerController.java @@ -0,0 +1,105 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialtype; + +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeManagerPageReqVO; +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeManagerRespVO; +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeManagerSaveReqVO; +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +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.zteits.urbanops.framework.common.pojo.PageParam; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.CommonResult; +import com.zteits.urbanops.framework.common.util.object.BeanUtils; +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; + +import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; + +import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; +import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*; + +import com.zteits.urbanops.module.garden.dal.dataobject.materialtype.MaterialTypeManagerDO; +import com.zteits.urbanops.module.garden.service.materialtype.MaterialTypeManagerService; + +@Tag(name = "管理后台 - 耗材类别管理") +@RestController +@RequestMapping("/garden/material-type-manager") +@Validated +public class MaterialTypeManagerController { + + @Resource + private MaterialTypeManagerService materialTypeManagerService; + + @PostMapping("/create") + @Operation(summary = "创建耗材类别管理") + @PreAuthorize("@ss.hasPermission('garden:material-type-manager:create')") + public CommonResult createMaterialTypeManager(@Valid @RequestBody MaterialTypeManagerSaveReqVO createReqVO) { + return success(materialTypeManagerService.createMaterialTypeManager(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新耗材类别管理") + @PreAuthorize("@ss.hasPermission('garden:material-type-manager:update')") + public CommonResult updateMaterialTypeManager(@Valid @RequestBody MaterialTypeManagerSaveReqVO updateReqVO) { + materialTypeManagerService.updateMaterialTypeManager(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除耗材类别管理") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('garden:material-type-manager:delete')") + public CommonResult deleteMaterialTypeManager(@RequestParam("id") Long id) { + materialTypeManagerService.deleteMaterialTypeManager(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除耗材类别管理") + @PreAuthorize("@ss.hasPermission('garden:material-type-manager:delete')") + public CommonResult deleteMaterialTypeManagerList(@RequestParam("ids") List ids) { + materialTypeManagerService.deleteMaterialTypeManagerListByIds(ids); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得耗材类别管理") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('garden:material-type-manager:query')") + public CommonResult getMaterialTypeManager(@RequestParam("id") Long id) { + MaterialTypeManagerDO materialTypeManager = materialTypeManagerService.getMaterialTypeManager(id); + return success(BeanUtils.toBean(materialTypeManager, MaterialTypeManagerRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得耗材类别管理分页") + @PreAuthorize("@ss.hasPermission('garden:material-type-manager:query')") + public CommonResult> getMaterialTypeManagerPage(@Valid MaterialTypeManagerPageReqVO pageReqVO) { + PageResult pageResult = materialTypeManagerService.getMaterialTypeManagerPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialTypeManagerRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出耗材类别管理 Excel") + @PreAuthorize("@ss.hasPermission('garden:material-type-manager:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportMaterialTypeManagerExcel(@Valid MaterialTypeManagerPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = materialTypeManagerService.getMaterialTypeManagerPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "耗材类别管理.xls", "数据", MaterialTypeManagerRespVO.class, + BeanUtils.toBean(list, MaterialTypeManagerRespVO.class)); + } + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeManagerPageReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeManagerPageReqVO.java new file mode 100644 index 0000000..1ae07f2 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeManagerPageReqVO.java @@ -0,0 +1,65 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialtype.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zteits.urbanops.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 耗材类别管理分页 Request VO") +@Data +public class MaterialTypeManagerPageReqVO extends PageParam { + + @Schema(description = "种类ID", example = "1958") + private Long classifyId; + + @Schema(description = "种类名称", example = "芋艿") + private String classifyName; + + @Schema(description = "类别ID", example = "22418") + private Long typeId; + + @Schema(description = "类别名称", example = "王五") + private String typeName; + + @Schema(description = "类别明细ID", example = "22381") + private Long typeDetailId; + + @Schema(description = "类别明细名称", example = "芋艿") + private String typeDetailName; + + @Schema(description = "公司ID", example = "22461") + private Long companyId; + + @Schema(description = "公司名称", example = "李四") + private String companyName; + + @Schema(description = "数量") + private Long num; + + @Schema(description = "单位ID", example = "26719") + private Long unitId; + + @Schema(description = "单位", example = "张三") + private String unitName; + + @Schema(description = " 描述", example = "你说的对") + private String remark; + + @Schema(description = "状态(0正常 1停用)", example = "1") + private Integer status; + + @Schema(description = "创建者") + private String creator; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "更新者") + private String updater; + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeManagerRespVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeManagerRespVO.java new file mode 100644 index 0000000..39b6db0 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeManagerRespVO.java @@ -0,0 +1,83 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialtype.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 cn.idev.excel.annotation.*; + +@Schema(description = "管理后台 - 耗材类别管理 Response VO") +@Data +@ExcelIgnoreUnannotated +public class MaterialTypeManagerRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22778") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "种类ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1958") + @ExcelProperty("种类ID") + private Long classifyId; + + @Schema(description = "种类名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @ExcelProperty("种类名称") + private String classifyName; + + @Schema(description = "类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22418") + @ExcelProperty("类别ID") + private Long typeId; + + @Schema(description = "类别名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @ExcelProperty("类别名称") + private String typeName; + + @Schema(description = "类别明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22381") + @ExcelProperty("类别明细ID") + private Long typeDetailId; + + @Schema(description = "类别明细名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @ExcelProperty("类别明细名称") + private String typeDetailName; + + @Schema(description = "公司ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22461") + @ExcelProperty("公司ID") + private Long companyId; + + @Schema(description = "公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @ExcelProperty("公司名称") + private String companyName; + + @Schema(description = "数量", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("数量") + private Long num; + + @Schema(description = "单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26719") + @ExcelProperty("单位ID") + private Long unitId; + + @Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @ExcelProperty("单位") + private String unitName; + + @Schema(description = " 描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对") + @ExcelProperty(" 描述") + private String remark; + + @Schema(description = "状态(0正常 1停用)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @ExcelProperty("状态(0正常 1停用)") + private Integer status; + + @Schema(description = "创建者") + @ExcelProperty("创建者") + private String creator; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "更新者") + @ExcelProperty("更新者") + private String updater; + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeManagerSaveReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeManagerSaveReqVO.java new file mode 100644 index 0000000..da78e5a --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeManagerSaveReqVO.java @@ -0,0 +1,73 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialtype.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 MaterialTypeManagerSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22778") + private Long id; + + @Schema(description = "种类ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1958") + @NotNull(message = "种类ID不能为空") + private Long classifyId; + + @Schema(description = "种类名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @NotEmpty(message = "种类名称不能为空") + private String classifyName; + + @Schema(description = "类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22418") + @NotNull(message = "类别ID不能为空") + private Long typeId; + + @Schema(description = "类别名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @NotEmpty(message = "类别名称不能为空") + private String typeName; + + @Schema(description = "类别明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22381") + @NotNull(message = "类别明细ID不能为空") + private Long typeDetailId; + + @Schema(description = "类别明细名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @NotEmpty(message = "类别明细名称不能为空") + private String typeDetailName; + + @Schema(description = "公司ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22461") + @NotNull(message = "公司ID不能为空") + private Long companyId; + + @Schema(description = "公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @NotEmpty(message = "公司名称不能为空") + private String companyName; + + @Schema(description = "数量", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "数量不能为空") + private Long num; + + @Schema(description = "单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26719") + @NotNull(message = "单位ID不能为空") + private Long unitId; + + @Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @NotEmpty(message = "单位不能为空") + private String unitName; + + @Schema(description = " 描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对") + @NotEmpty(message = " 描述不能为空") + private String remark; + + @Schema(description = "状态(0正常 1停用)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotNull(message = "状态(0正常 1停用)不能为空") + private Integer status; + + @Schema(description = "创建者") + private String creator; + + @Schema(description = "更新者") + private String updater; + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypePageReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypePageReqVO.java new file mode 100644 index 0000000..9dd1539 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypePageReqVO.java @@ -0,0 +1,56 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialtype.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zteits.urbanops.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 物料类型分页 Request VO") +@Data +public class MaterialTypePageReqVO extends PageParam { + + @Schema(description = "物料类型ID", example = "31914") + private Long materialTypeId; + + @Schema(description = "耗材类型名称:工具", example = "赵六") + private String materialTypeName; + + @Schema(description = "类别ID", example = "13166") + private Long typeId; + + @Schema(description = "类别名称:药品", example = "李四") + private String typeName; + + @Schema(description = "付物料类型ID", example = "4908") + private Long materialParentTypeId; + + @Schema(description = "类别明细ID", example = "2459") + private Long typeDetailId; + + @Schema(description = "类别明细", example = "赵六") + private String typeDetailName; + + @Schema(description = "父类别ID", example = "6341") + private Long parentTypeId; + + @Schema(description = "备注", example = "你猜") + private String remark; + + @Schema(description = "状态(0正常 1停用)", example = "2") + private String status; + + @Schema(description = "创建者") + private String creator; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "更新者") + private String updater; + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeResp.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeResp.java new file mode 100644 index 0000000..7774c43 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeResp.java @@ -0,0 +1,38 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialtype.vo; + +/** + * Copyright: Copyright (c) 2017 zteits + * + * @ClassName: MaterialTypeManagerResp.java + * @Description: + * @version: v1.0.0 + * @author: wangfs + * @date: 2024-11-10 13:50 + * Modification History: + * Date Author Version Description + * ---------------------------------------------------------* + * 2024-11-10 wangfs v1.0.0 创建 + */ + +public class MaterialTypeResp { + + private Long value; + + private String label; + + public Long getValue() { + return value; + } + + public void setValue(Long value) { + this.value = value; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeRespVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeRespVO.java new file mode 100644 index 0000000..a47d98f --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeRespVO.java @@ -0,0 +1,71 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialtype.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 cn.idev.excel.annotation.*; + +@Schema(description = "管理后台 - 物料类型 Response VO") +@Data +@ExcelIgnoreUnannotated +public class MaterialTypeRespVO { + + @Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23621") + @ExcelProperty("物料ID") + private Long id; + + @Schema(description = "物料类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31914") + @ExcelProperty("物料类型ID") + private Long materialTypeId; + + @Schema(description = "耗材类型名称:工具", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @ExcelProperty("耗材类型名称:工具") + private String materialTypeName; + + @Schema(description = "类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13166") + @ExcelProperty("类别ID") + private Long typeId; + + @Schema(description = "类别名称:药品", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @ExcelProperty("类别名称:药品") + private String typeName; + + @Schema(description = "付物料类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4908") + @ExcelProperty("付物料类型ID") + private Long materialParentTypeId; + + @Schema(description = "类别明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2459") + @ExcelProperty("类别明细ID") + private Long typeDetailId; + + @Schema(description = "类别明细", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @ExcelProperty("类别明细") + private String typeDetailName; + + @Schema(description = "父类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6341") + @ExcelProperty("父类别ID") + private Long parentTypeId; + + @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你猜") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "状态(0正常 1停用)", example = "2") + @ExcelProperty("状态(0正常 1停用)") + private String status; + + @Schema(description = "创建者") + @ExcelProperty("创建者") + private String creator; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "更新者") + @ExcelProperty("更新者") + private String updater; + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeSaveReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeSaveReqVO.java new file mode 100644 index 0000000..c50fc07 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeSaveReqVO.java @@ -0,0 +1,47 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialtype.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 MaterialTypeSaveReqVO { + + @Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23621") + private Long id; + + @Schema(description = "物料类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31914") + @NotNull(message = "物料类型ID不能为空") + private Long materialTypeId; + + @Schema(description = "耗材类型名称:工具", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @NotEmpty(message = "耗材类型名称:工具不能为空") + private String materialTypeName; + + @Schema(description = "类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13166") + @NotNull(message = "类别ID不能为空") + private Long typeId; + + @Schema(description = "类别名称:药品", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @NotEmpty(message = "类别名称:药品不能为空") + private String typeName; + + @Schema(description = "付物料类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4908") + private Long materialParentTypeId; + + @Schema(description = "类别明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2459") + private Long typeDetailId; + + @Schema(description = "类别明细", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @NotEmpty(message = "类别明细不能为空") + private String typeDetailName; + + @Schema(description = "父类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6341") + private Long parentTypeId; + + @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你猜") + private String remark; + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialInventoryDO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialInventoryDO.java deleted file mode 100644 index 1ca18c2..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialInventoryDO.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.zteits.urbanops.module.garden.dal.dataobject.material; - -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; -import lombok.Data; - -@TableName("garden_material_inventory") -@Data -public class MaterialInventoryDO extends BaseDO { - @TableId - private Long inventoryId; - private Long materialId; - private String materialName; - private Long materialTypeId; - private String materialTypeName; - private Long typeId; - private String typeName; - private Long typeDetailId; - private String typeDetailName; - private String specifications; - private Long belongCompanyId; - private String belongCompanyName; - private Long unitId; - private String unitName; - private Long currentNum; - private Long outTotalNum; - private Long inventoryTotalNum; - private String status; - private Long inventoryAlermNum; - private Long deptId; -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialInventoryInDO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialInventoryInDO.java deleted file mode 100644 index 422c54c..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialInventoryInDO.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.zteits.urbanops.module.garden.dal.dataobject.material; - -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; -import lombok.Data; - -import java.math.BigDecimal; -import java.util.Date; - -@TableName("garden_material_inventory_in") -@Data -public class MaterialInventoryInDO extends BaseDO { - @TableId - private Long id; - private String inventoryInNo; - private Long materialId; - private String materialName; - private Long materialTypeId; - private String materialTypeName; - private Long typeId; - private String typeName; - private Long typeDetailId; - private String typeDetailName; - private String specifications; - private Long belongCompanyId; - private String belongCompanyName; - private Long inInventoryNum; - private BigDecimal materialPrice; - private Long unitId; - private String unitName; - private Date buyDate; - private String supplierName; - private String contactsName; - private String contactsPhone; - private String status; - private Long deptId; -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialInventoryOutDO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialInventoryOutDO.java deleted file mode 100644 index 345b7e0..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialInventoryOutDO.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.zteits.urbanops.module.garden.dal.dataobject.material; - -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; -import lombok.Data; - -import java.util.Date; - -@TableName("garden_material_inventory_out") -@Data -public class MaterialInventoryOutDO extends BaseDO { - @TableId - private Long id; - private String inventoryOutNo; - private Long materialId; - private String materialName; - private Long materialTypeId; - private String materialTypeName; - private Long typeId; - private String typeName; - private Long typeDetailId; - private String typeDetailName; - private String specifications; - private Long belongCompanyId; - private String belongCompanyName; - private Long outInventoryNum; - private Long unitId; - private String unitName; - private Date outDate; - private String status; - private Integer type; - private Long deptId; -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialTypeDO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialTypeDO.java deleted file mode 100644 index 0ff1b99..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialTypeDO.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.zteits.urbanops.module.garden.dal.dataobject.material; - -import lombok.*; -import java.util.*; -import java.time.LocalDateTime; -import java.time.LocalDateTime; -import com.baomidou.mybatisplus.annotation.*; -import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; - -/** - * 物料类型 DO - * - * @author 超级管理员 - */ -@TableName("garden_material_type") -@KeySequence("garden_material_type_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class MaterialTypeDO extends BaseDO { - - /** - * 物料ID - */ - @TableId - private Long id; - /** - * 物料类型ID - */ - private Long materialTypeId; - /** - * 耗材类型名称:工具 - */ - private String materialTypeName; - /** - * 类别ID - */ - private Long typeId; - /** - * 类别名称:药品 - */ - private String typeName; - /** - * 付物料类型ID - */ - private Long materialParentTypeId; - /** - * 类别明细ID - */ - private Long typeDetailId; - /** - * 类别明细 - */ - private String typeDetailName; - /** - * 父类别ID - */ - private Long parentTypeId; - /** - * 备注 - */ - private String remark; - /** - * 状态(0正常 1停用) - */ - private String status; - /** - * 创建者 - */ - private String creator; - /** - * 更新者 - */ - private String updater; - - -} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialTypeManagerDO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialTypeManagerDO.java deleted file mode 100644 index e2e8010..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialTypeManagerDO.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.zteits.urbanops.module.garden.dal.dataobject.material; - -import lombok.*; -import java.util.*; -import java.time.LocalDateTime; -import java.time.LocalDateTime; -import com.baomidou.mybatisplus.annotation.*; -import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; - -/** - * 耗材类别管理 DO - * - * @author 超级管理员 - */ -@TableName("garden_material_type_manager") -@KeySequence("garden_material_type_manager_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class MaterialTypeManagerDO extends BaseDO { - - /** - * ID - */ - @TableId - private Long id; - /** - * 种类ID - */ - private Long classifyId; - /** - * 种类名称 - */ - private String classifyName; - /** - * 类别ID - */ - private Long typeId; - /** - * 类别名称 - */ - private String typeName; - /** - * 类别明细ID - */ - private Long typeDetailId; - /** - * 类别明细名称 - */ - private String typeDetailName; - /** - * 公司ID - */ - private Long companyId; - /** - * 公司名称 - */ - private String companyName; - /** - * 数量 - */ - private Long num; - /** - * 单位ID - */ - private Long unitId; - /** - * 单位 - */ - private String unitName; - /** - * 描述 - */ - private String remark; - /** - * 状态(0正常 1停用) - */ - private Integer status; - -} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialinventory/MaterialInventoryDO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialinventory/MaterialInventoryDO.java new file mode 100644 index 0000000..eb8909b --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialinventory/MaterialInventoryDO.java @@ -0,0 +1,32 @@ +package com.zteits.urbanops.module.garden.dal.dataobject.materialinventory; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; +import lombok.Data; + +@TableName("garden_material_inventory") +@Data +public class MaterialInventoryDO extends BaseDO { + @TableId + private Long inventoryId; + private Long materialId; + private String materialName; + private Long materialTypeId; + private String materialTypeName; + private Long typeId; + private String typeName; + private Long typeDetailId; + private String typeDetailName; + private String specifications; + private Long belongCompanyId; + private String belongCompanyName; + private Long unitId; + private String unitName; + private Long currentNum; + private Long outTotalNum; + private Long inventoryTotalNum; + private String status; + private Long inventoryAlermNum; + private Long deptId; +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialinventoryin/MaterialInventoryInDO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialinventoryin/MaterialInventoryInDO.java new file mode 100644 index 0000000..22146e3 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialinventoryin/MaterialInventoryInDO.java @@ -0,0 +1,118 @@ +package com.zteits.urbanops.module.garden.dal.dataobject.materialinventoryin; + +import lombok.*; +import java.util.*; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; + +/** + * 物料入库 DO + * + * @author 超级管理员 + */ +@TableName("garden_material_inventory_in") +@KeySequence("garden_material_inventory_in_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class MaterialInventoryInDO extends BaseDO { + + /** + * 入库ID + */ + @TableId + private Long id; + /** + * 入库批次号 + */ + private String inventoryInNo; + /** + * 物料ID + */ + private Long materialId; + /** + * 物料名称 + */ + private String materialName; + /** + * 物料类型ID + */ + private Long materialTypeId; + /** + * 耗材类型名称 + */ + private String materialTypeName; + /** + * 类别ID + */ + private Long typeId; + /** + * 类别名称:药品 + */ + private String typeName; + /** + * 类别明细ID + */ + private Long typeDetailId; + /** + * 类别明细 + */ + private String typeDetailName; + /** + * 规格 + */ + private String specifications; + /** + * 归属单位ID + */ + private Long belongCompanyId; + /** + * 归属单位 + */ + private String belongCompanyName; + /** + * 入库数量 + */ + private Long inInventoryNum; + /** + * 单价 + */ + private BigDecimal materialPrice; + /** + * 单位ID + */ + private Long unitId; + /** + * 单位 + */ + private String unitName; + /** + * 采购日期 + */ + private LocalDateTime buyDate; + /** + * 供应商名称 + */ + private String supplierName; + /** + * 联系人 + */ + private String contactsName; + /** + * 联系人 电话 + */ + private String contactsPhone; + /** + * 部门ID + */ + private Long deptId; + + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialinventoryout/MaterialInventoryOutDO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialinventoryout/MaterialInventoryOutDO.java new file mode 100644 index 0000000..cb4de6e --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialinventoryout/MaterialInventoryOutDO.java @@ -0,0 +1,109 @@ +package com.zteits.urbanops.module.garden.dal.dataobject.materialinventoryout; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; + +/** + * 物料出库 DO + * + * @author 超级管理员 + */ +@TableName("garden_material_inventory_out") +@KeySequence("garden_material_inventory_out_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class MaterialInventoryOutDO extends BaseDO { + + /** + * 入库ID + */ + @TableId + private Long id; + /** + * 入库批次号 + */ + private String inventoryOutNo; + /** + * 物料ID + */ + private Long materialId; + /** + * 物料名称 + */ + private String materialName; + /** + * 物料类型ID + */ + private Long materialTypeId; + /** + * 耗材类型名称 + */ + private String materialTypeName; + /** + * 类别ID + */ + private Long typeId; + /** + * 类别名称:药品 + */ + private String typeName; + /** + * 类别明细ID + */ + private Long typeDetailId; + /** + * 类别明细 + */ + private String typeDetailName; + /** + * 规格 + */ + private String specifications; + /** + * 归属单位ID + */ + private Long belongCompanyId; + /** + * 归属单位 + */ + private String belongCompanyName; + /** + * 出库数量 + */ + private Long outInventoryNum; + /** + * 单位ID + */ + private Long unitId; + /** + * 单位 + */ + private String unitName; + /** + * 出库日期 + */ + private LocalDateTime outDate; + /** + * 备注 + */ + private String remark; + /** + * 部门ID + */ + private Long deptId; + /** + * 类型: 1:手动出库;2:养护类出库 + */ + private Integer type; + + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialtype/MaterialTypeDO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialtype/MaterialTypeDO.java new file mode 100644 index 0000000..fe3ae95 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialtype/MaterialTypeDO.java @@ -0,0 +1,80 @@ +package com.zteits.urbanops.module.garden.dal.dataobject.materialtype; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; + +/** + * 物料类型 DO + * + * @author 超级管理员 + */ +@TableName("garden_material_type") +@KeySequence("garden_material_type_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class MaterialTypeDO extends BaseDO { + + /** + * 物料ID + */ + @TableId + private Long id; + /** + * 物料类型ID + */ + private Long materialTypeId; + /** + * 耗材类型名称:工具 + */ + private String materialTypeName; + /** + * 类别ID + */ + private Long typeId; + /** + * 类别名称:药品 + */ + private String typeName; + /** + * 付物料类型ID + */ + private Long materialParentTypeId; + /** + * 类别明细ID + */ + private Long typeDetailId; + /** + * 类别明细 + */ + private String typeDetailName; + /** + * 父类别ID + */ + private Long parentTypeId; + /** + * 备注 + */ + private String remark; + /** + * 状态(0正常 1停用) + */ + private String status; + /** + * 创建者 + */ + private String creator; + /** + * 更新者 + */ + private String updater; + + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialtype/MaterialTypeManagerDO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialtype/MaterialTypeManagerDO.java new file mode 100644 index 0000000..b17e977 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialtype/MaterialTypeManagerDO.java @@ -0,0 +1,83 @@ +package com.zteits.urbanops.module.garden.dal.dataobject.materialtype; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; + +/** + * 耗材类别管理 DO + * + * @author 超级管理员 + */ +@TableName("garden_material_type_manager") +@KeySequence("garden_material_type_manager_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class MaterialTypeManagerDO extends BaseDO { + + /** + * ID + */ + @TableId + private Long id; + /** + * 种类ID + */ + private Long classifyId; + /** + * 种类名称 + */ + private String classifyName; + /** + * 类别ID + */ + private Long typeId; + /** + * 类别名称 + */ + private String typeName; + /** + * 类别明细ID + */ + private Long typeDetailId; + /** + * 类别明细名称 + */ + private String typeDetailName; + /** + * 公司ID + */ + private Long companyId; + /** + * 公司名称 + */ + private String companyName; + /** + * 数量 + */ + private Long num; + /** + * 单位ID + */ + private Long unitId; + /** + * 单位 + */ + private String unitName; + /** + * 描述 + */ + private String remark; + /** + * 状态(0正常 1停用) + */ + private Integer status; + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialInventoryInMapper.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialInventoryInMapper.java deleted file mode 100644 index f570329..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialInventoryInMapper.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.zteits.urbanops.module.garden.dal.mysql.material; - -import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialInventoryInDO; -import org.apache.ibatis.annotations.Mapper; - -@Mapper -public interface MaterialInventoryInMapper extends BaseMapperX { - default MaterialInventoryInDO selectByNo(String inventoryInNo) { - return selectOne(new com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX() - .eq(MaterialInventoryInDO::getInventoryInNo, inventoryInNo)); - } -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialInventoryMapper.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialInventoryMapper.java deleted file mode 100644 index 253e8c8..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialInventoryMapper.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.zteits.urbanops.module.garden.dal.mysql.material; - -import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; -import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialInventoryDO; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -@Mapper -public interface MaterialInventoryMapper extends BaseMapperX { - - default MaterialInventoryDO selectByMaterialId(Long materialId) { - return selectOne(new LambdaQueryWrapperX().eq(MaterialInventoryDO::getMaterialId, materialId)); - } - - default MaterialInventoryDO selectByTypeDetailId(Long typeDetailId, Long companyId) { - return selectOne(new LambdaQueryWrapperX() - .eq(MaterialInventoryDO::getTypeDetailId, typeDetailId) - .eq(MaterialInventoryDO::getBelongCompanyId, companyId)); - } - - default int updateInventoryByMaterialId(Long inventoryId, Long outNum) { - MaterialInventoryDO inv = selectById(inventoryId); - if (inv == null) return 0; - MaterialInventoryDO upd = new MaterialInventoryDO(); - upd.setInventoryId(inventoryId); - upd.setCurrentNum(inv.getCurrentNum() - outNum); - upd.setOutTotalNum(inv.getOutTotalNum() == null ? outNum : inv.getOutTotalNum() + outNum); - return updateById(upd); - } - - default int updateInventoryAlarmNum(Long materialId, Long inventoryAlermNum) { - MaterialInventoryDO inv = selectByMaterialId(materialId); - if (inv == null) return 0; - MaterialInventoryDO upd = new MaterialInventoryDO(); - upd.setInventoryId(inv.getInventoryId()); - upd.setInventoryAlermNum(inventoryAlermNum); - return updateById(upd); - } -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialInventoryOutMapper.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialInventoryOutMapper.java deleted file mode 100644 index 496da02..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialInventoryOutMapper.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.zteits.urbanops.module.garden.dal.mysql.material; - -import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialInventoryOutDO; -import org.apache.ibatis.annotations.Mapper; - -@Mapper -public interface MaterialInventoryOutMapper extends BaseMapperX { -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialTypeManagerMapper.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialTypeManagerMapper.java deleted file mode 100644 index d6b5aa6..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialTypeManagerMapper.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.zteits.urbanops.module.garden.dal.mysql.material; - -import java.util.*; - -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; -import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialTypeManagerDO; -import org.apache.ibatis.annotations.Mapper; -import com.zteits.urbanops.module.garden.controller.admin.material.vo.*; - -/** - * 耗材类别管理 Mapper - * - * @author 超级管理员 - */ -@Mapper -public interface MaterialTypeManagerMapper extends BaseMapperX { - - default PageResult selectPage(MaterialTypeManagerPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .eqIfPresent(MaterialTypeManagerDO::getClassifyId, reqVO.getClassifyId()) - .likeIfPresent(MaterialTypeManagerDO::getClassifyName, reqVO.getClassifyName()) - .eqIfPresent(MaterialTypeManagerDO::getTypeId, reqVO.getTypeId()) - .likeIfPresent(MaterialTypeManagerDO::getTypeName, reqVO.getTypeName()) - .eqIfPresent(MaterialTypeManagerDO::getTypeDetailId, reqVO.getTypeDetailId()) - .likeIfPresent(MaterialTypeManagerDO::getTypeDetailName, reqVO.getTypeDetailName()) - .eqIfPresent(MaterialTypeManagerDO::getCompanyId, reqVO.getCompanyId()) - .likeIfPresent(MaterialTypeManagerDO::getCompanyName, reqVO.getCompanyName()) - .eqIfPresent(MaterialTypeManagerDO::getNum, reqVO.getNum()) - .eqIfPresent(MaterialTypeManagerDO::getUnitId, reqVO.getUnitId()) - .likeIfPresent(MaterialTypeManagerDO::getUnitName, reqVO.getUnitName()) - .eqIfPresent(MaterialTypeManagerDO::getRemark, reqVO.getRemark()) - .eqIfPresent(MaterialTypeManagerDO::getStatus, reqVO.getStatus()) - .betweenIfPresent(MaterialTypeManagerDO::getCreateTime, reqVO.getCreateTime()) - .orderByDesc(MaterialTypeManagerDO::getId)); - } - -} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialTypeMapper.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialTypeMapper.java deleted file mode 100644 index 6274d2a..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialTypeMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.zteits.urbanops.module.garden.dal.mysql.material; - -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; -import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; -import com.zteits.urbanops.module.garden.controller.admin.material.vo.MaterialTypePageReqVO; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialTypeDO; -import org.apache.ibatis.annotations.Mapper; - -/** - * 物料类型 Mapper - * - * @author 超级管理员 - */ -@Mapper -public interface MaterialTypeMapper extends BaseMapperX { - - default PageResult selectPage(MaterialTypePageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .likeIfPresent(MaterialTypeDO::getTypeName, reqVO.getTypeName()) - .orderByDesc(MaterialTypeDO::getTypeName)); - } - -} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialinventory/MaterialInventoryMapper.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialinventory/MaterialInventoryMapper.java new file mode 100644 index 0000000..0df450a --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialinventory/MaterialInventoryMapper.java @@ -0,0 +1,39 @@ +package com.zteits.urbanops.module.garden.dal.mysql.materialinventory; + +import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; +import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventory.MaterialInventoryDO; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface MaterialInventoryMapper extends BaseMapperX { + + default MaterialInventoryDO selectByMaterialId(Long materialId) { + return selectOne(new LambdaQueryWrapperX().eq(MaterialInventoryDO::getMaterialId, materialId)); + } + + default MaterialInventoryDO selectByTypeDetailId(Long typeDetailId, Long companyId) { + return selectOne(new LambdaQueryWrapperX() + .eq(MaterialInventoryDO::getTypeDetailId, typeDetailId) + .eq(MaterialInventoryDO::getBelongCompanyId, companyId)); + } + + default int updateInventoryByMaterialId(Long inventoryId, Long outNum) { + MaterialInventoryDO inv = selectById(inventoryId); + if (inv == null) return 0; + MaterialInventoryDO upd = new MaterialInventoryDO(); + upd.setInventoryId(inventoryId); + upd.setCurrentNum(inv.getCurrentNum() - outNum); + upd.setOutTotalNum(inv.getOutTotalNum() == null ? outNum : inv.getOutTotalNum() + outNum); + return updateById(upd); + } + + default int updateInventoryAlarmNum(Long materialId, Long inventoryAlermNum) { + MaterialInventoryDO inv = selectByMaterialId(materialId); + if (inv == null) return 0; + MaterialInventoryDO upd = new MaterialInventoryDO(); + upd.setInventoryId(inv.getInventoryId()); + upd.setInventoryAlermNum(inventoryAlermNum); + return updateById(upd); + } +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialinventoryin/MaterialInventoryInMapper.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialinventoryin/MaterialInventoryInMapper.java new file mode 100644 index 0000000..7b175bf --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialinventoryin/MaterialInventoryInMapper.java @@ -0,0 +1,47 @@ +package com.zteits.urbanops.module.garden.dal.mysql.materialinventoryin; + +import java.util.*; + +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventoryin.MaterialInventoryInDO; +import org.apache.ibatis.annotations.Mapper; +import com.zteits.urbanops.module.garden.controller.admin.materialinventoryin.vo.*; + +/** + * 物料入库 Mapper + * + * @author 超级管理员 + */ +@Mapper +public interface MaterialInventoryInMapper extends BaseMapperX { + + default PageResult selectPage(MaterialInventoryInPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(MaterialInventoryInDO::getInventoryInNo, reqVO.getInventoryInNo()) + .eqIfPresent(MaterialInventoryInDO::getMaterialId, reqVO.getMaterialId()) + .likeIfPresent(MaterialInventoryInDO::getMaterialName, reqVO.getMaterialName()) + .eqIfPresent(MaterialInventoryInDO::getMaterialTypeId, reqVO.getMaterialTypeId()) + .likeIfPresent(MaterialInventoryInDO::getMaterialTypeName, reqVO.getMaterialTypeName()) + .eqIfPresent(MaterialInventoryInDO::getTypeId, reqVO.getTypeId()) + .likeIfPresent(MaterialInventoryInDO::getTypeName, reqVO.getTypeName()) + .eqIfPresent(MaterialInventoryInDO::getTypeDetailId, reqVO.getTypeDetailId()) + .likeIfPresent(MaterialInventoryInDO::getTypeDetailName, reqVO.getTypeDetailName()) + .eqIfPresent(MaterialInventoryInDO::getSpecifications, reqVO.getSpecifications()) + .eqIfPresent(MaterialInventoryInDO::getBelongCompanyId, reqVO.getBelongCompanyId()) + .likeIfPresent(MaterialInventoryInDO::getBelongCompanyName, reqVO.getBelongCompanyName()) + .eqIfPresent(MaterialInventoryInDO::getInInventoryNum, reqVO.getInInventoryNum()) + .eqIfPresent(MaterialInventoryInDO::getMaterialPrice, reqVO.getMaterialPrice()) + .eqIfPresent(MaterialInventoryInDO::getUnitId, reqVO.getUnitId()) + .likeIfPresent(MaterialInventoryInDO::getUnitName, reqVO.getUnitName()) + .betweenIfPresent(MaterialInventoryInDO::getBuyDate, reqVO.getBuyDate()) + .likeIfPresent(MaterialInventoryInDO::getSupplierName, reqVO.getSupplierName()) + .likeIfPresent(MaterialInventoryInDO::getContactsName, reqVO.getContactsName()) + .eqIfPresent(MaterialInventoryInDO::getContactsPhone, reqVO.getContactsPhone()) + .betweenIfPresent(MaterialInventoryInDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(MaterialInventoryInDO::getDeptId, reqVO.getDeptId()) + .orderByDesc(MaterialInventoryInDO::getId)); + } + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialinventoryout/MaterialInventoryOutMapper.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialinventoryout/MaterialInventoryOutMapper.java new file mode 100644 index 0000000..854b8d5 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialinventoryout/MaterialInventoryOutMapper.java @@ -0,0 +1,45 @@ +package com.zteits.urbanops.module.garden.dal.mysql.materialinventoryout; + +import java.util.*; + +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventoryout.MaterialInventoryOutDO; +import org.apache.ibatis.annotations.Mapper; +import com.zteits.urbanops.module.garden.controller.admin.materialinventoryout.vo.*; + +/** + * 物料出库 Mapper + * + * @author 超级管理员 + */ +@Mapper +public interface MaterialInventoryOutMapper extends BaseMapperX { + + default PageResult selectPage(MaterialInventoryOutPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(MaterialInventoryOutDO::getInventoryOutNo, reqVO.getInventoryOutNo()) + .eqIfPresent(MaterialInventoryOutDO::getMaterialId, reqVO.getMaterialId()) + .likeIfPresent(MaterialInventoryOutDO::getMaterialName, reqVO.getMaterialName()) + .eqIfPresent(MaterialInventoryOutDO::getMaterialTypeId, reqVO.getMaterialTypeId()) + .likeIfPresent(MaterialInventoryOutDO::getMaterialTypeName, reqVO.getMaterialTypeName()) + .eqIfPresent(MaterialInventoryOutDO::getTypeId, reqVO.getTypeId()) + .likeIfPresent(MaterialInventoryOutDO::getTypeName, reqVO.getTypeName()) + .eqIfPresent(MaterialInventoryOutDO::getTypeDetailId, reqVO.getTypeDetailId()) + .likeIfPresent(MaterialInventoryOutDO::getTypeDetailName, reqVO.getTypeDetailName()) + .eqIfPresent(MaterialInventoryOutDO::getSpecifications, reqVO.getSpecifications()) + .eqIfPresent(MaterialInventoryOutDO::getBelongCompanyId, reqVO.getBelongCompanyId()) + .likeIfPresent(MaterialInventoryOutDO::getBelongCompanyName, reqVO.getBelongCompanyName()) + .eqIfPresent(MaterialInventoryOutDO::getOutInventoryNum, reqVO.getOutInventoryNum()) + .eqIfPresent(MaterialInventoryOutDO::getUnitId, reqVO.getUnitId()) + .likeIfPresent(MaterialInventoryOutDO::getUnitName, reqVO.getUnitName()) + .betweenIfPresent(MaterialInventoryOutDO::getOutDate, reqVO.getOutDate()) + .eqIfPresent(MaterialInventoryOutDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(MaterialInventoryOutDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(MaterialInventoryOutDO::getDeptId, reqVO.getDeptId()) + .eqIfPresent(MaterialInventoryOutDO::getType, reqVO.getType()) + .orderByDesc(MaterialInventoryOutDO::getId)); + } + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialtype/MaterialTypeManagerMapper.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialtype/MaterialTypeManagerMapper.java new file mode 100644 index 0000000..70482b3 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialtype/MaterialTypeManagerMapper.java @@ -0,0 +1,37 @@ +package com.zteits.urbanops.module.garden.dal.mysql.materialtype; + +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeManagerPageReqVO; +import com.zteits.urbanops.module.garden.dal.dataobject.materialtype.MaterialTypeManagerDO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 耗材类别管理 Mapper + * + * @author 超级管理员 + */ +@Mapper +public interface MaterialTypeManagerMapper extends BaseMapperX { + + default PageResult selectPage(MaterialTypeManagerPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(MaterialTypeManagerDO::getClassifyId, reqVO.getClassifyId()) + .likeIfPresent(MaterialTypeManagerDO::getClassifyName, reqVO.getClassifyName()) + .eqIfPresent(MaterialTypeManagerDO::getTypeId, reqVO.getTypeId()) + .likeIfPresent(MaterialTypeManagerDO::getTypeName, reqVO.getTypeName()) + .eqIfPresent(MaterialTypeManagerDO::getTypeDetailId, reqVO.getTypeDetailId()) + .likeIfPresent(MaterialTypeManagerDO::getTypeDetailName, reqVO.getTypeDetailName()) + .eqIfPresent(MaterialTypeManagerDO::getCompanyId, reqVO.getCompanyId()) + .likeIfPresent(MaterialTypeManagerDO::getCompanyName, reqVO.getCompanyName()) + .eqIfPresent(MaterialTypeManagerDO::getNum, reqVO.getNum()) + .eqIfPresent(MaterialTypeManagerDO::getUnitId, reqVO.getUnitId()) + .likeIfPresent(MaterialTypeManagerDO::getUnitName, reqVO.getUnitName()) + .eqIfPresent(MaterialTypeManagerDO::getRemark, reqVO.getRemark()) + .eqIfPresent(MaterialTypeManagerDO::getStatus, reqVO.getStatus()) + .betweenIfPresent(MaterialTypeManagerDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(MaterialTypeManagerDO::getId)); + } + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialtype/MaterialTypeMapper.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialtype/MaterialTypeMapper.java new file mode 100644 index 0000000..25682fd --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialtype/MaterialTypeMapper.java @@ -0,0 +1,24 @@ +package com.zteits.urbanops.module.garden.dal.mysql.materialtype; + +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypePageReqVO; +import com.zteits.urbanops.module.garden.dal.dataobject.materialtype.MaterialTypeDO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 物料类型 Mapper + * + * @author 超级管理员 + */ +@Mapper +public interface MaterialTypeMapper extends BaseMapperX { + + default PageResult selectPage(MaterialTypePageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .likeIfPresent(MaterialTypeDO::getTypeName, reqVO.getTypeName()) + .orderByDesc(MaterialTypeDO::getTypeName)); + } + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/enums/ErrorCodeConstants.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/enums/ErrorCodeConstants.java index fdf11c9..181cb14 100644 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/enums/ErrorCodeConstants.java +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/enums/ErrorCodeConstants.java @@ -76,4 +76,9 @@ public interface ErrorCodeConstants { ErrorCode MATERIAL_TYPE_MANAGER_NOT_EXISTS = new ErrorCode(1-100-004-002, "耗材类别管理不存在"); ErrorCode MATERIAL_NOT_EXISTS = new ErrorCode(1-100-004-003, "耗材管理不存在"); + + ErrorCode MATERIAL_INVENTORY_IN_NOT_EXISTS = new ErrorCode(1-100-004-004, "物料入库不存在"); + + ErrorCode MATERIAL_INVENTORY_OUT_NOT_EXISTS = new ErrorCode(1-100-004-005, "物料出库不存在"); + } diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialInventoryService.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialInventoryService.java deleted file mode 100644 index d2615e1..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialInventoryService.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.zteits.urbanops.module.garden.service.material; - -import com.zteits.urbanops.framework.common.pojo.PageParam; -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialInventoryDO; - -public interface MaterialInventoryService { - PageResult selectPage(PageParam pageParam, MaterialInventoryDO where); - Boolean updateInventoryAlarmNum(Long materialId, Long alermNum); -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialInventoryServiceImpl.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialInventoryServiceImpl.java deleted file mode 100644 index 9327c7c..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialInventoryServiceImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.zteits.urbanops.module.garden.service.material; - -import com.zteits.urbanops.framework.common.pojo.PageParam; -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialInventoryDO; -import com.zteits.urbanops.module.garden.dal.mysql.material.MaterialInventoryMapper; -import jakarta.annotation.Resource; -import org.springframework.stereotype.Service; - -@Service -public class MaterialInventoryServiceImpl implements MaterialInventoryService { - - @Resource - private MaterialInventoryMapper mapper; - - @Override - public PageResult selectPage(PageParam pageParam, MaterialInventoryDO where) { - return mapper.selectPage(pageParam, null, new com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX() - .eqIfPresent(MaterialInventoryDO::getMaterialId, where.getMaterialId()) - .likeIfPresent(MaterialInventoryDO::getMaterialName, where.getMaterialName()) - .eqIfPresent(MaterialInventoryDO::getTypeDetailId, where.getTypeDetailId()) - .eqIfPresent(MaterialInventoryDO::getBelongCompanyId, where.getBelongCompanyId()) - .orderByDesc(MaterialInventoryDO::getUpdateTime)); - } - - @Override - public Boolean updateInventoryAlarmNum(Long materialId, Long alermNum) { - return mapper.updateInventoryAlarmNum(materialId, alermNum) > 0; - } -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialServiceImpl.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialServiceImpl.java index 0f8ce15..eecf2c5 100644 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialServiceImpl.java +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialServiceImpl.java @@ -1,19 +1,14 @@ package com.zteits.urbanops.module.garden.service.material; -import cn.hutool.core.collection.CollUtil; -import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialTypeDO; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; -import org.springframework.transaction.annotation.Transactional; import java.util.*; import com.zteits.urbanops.module.garden.controller.admin.material.vo.*; import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialDO; import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.framework.common.pojo.PageParam; import com.zteits.urbanops.framework.common.util.object.BeanUtils; import com.zteits.urbanops.module.garden.dal.mysql.material.MaterialMapper; @@ -22,7 +17,6 @@ import static com.zteits.urbanops.framework.common.exception.enums.GlobalErrorCo import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception0; import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertList; -import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.diffList; import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.*; /** diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialTypeManagerService.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialTypeManagerService.java deleted file mode 100644 index 2baaa8f..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialTypeManagerService.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.zteits.urbanops.module.garden.service.material; - -import java.util.*; -import jakarta.validation.*; -import com.zteits.urbanops.module.garden.controller.admin.material.vo.*; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialTypeManagerDO; -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.framework.common.pojo.PageParam; - -/** - * 耗材类别管理 Service 接口 - * - * @author 超级管理员 - */ -public interface MaterialTypeManagerService { - - /** - * 创建耗材类别管理 - * - * @param createReqVO 创建信息 - * @return 编号 - */ - Long createMaterialTypeManager(@Valid MaterialTypeManagerSaveReqVO createReqVO); - - /** - * 更新耗材类别管理 - * - * @param updateReqVO 更新信息 - */ - void updateMaterialTypeManager(@Valid MaterialTypeManagerSaveReqVO updateReqVO); - - /** - * 删除耗材类别管理 - * - * @param id 编号 - */ - void deleteMaterialTypeManager(Long id); - - /** - * 批量删除耗材类别管理 - * - * @param ids 编号 - */ - void deleteMaterialTypeManagerListByIds(List ids); - - /** - * 获得耗材类别管理 - * - * @param id 编号 - * @return 耗材类别管理 - */ - MaterialTypeManagerDO getMaterialTypeManager(Long id); - - /** - * 获得耗材类别管理分页 - * - * @param pageReqVO 分页查询 - * @return 耗材类别管理分页 - */ - PageResult getMaterialTypeManagerPage(MaterialTypeManagerPageReqVO pageReqVO); - -} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialTypeManagerServiceImpl.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialTypeManagerServiceImpl.java deleted file mode 100644 index b606f20..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialTypeManagerServiceImpl.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.zteits.urbanops.module.garden.service.material; - -import cn.hutool.core.collection.CollUtil; -import org.springframework.stereotype.Service; -import jakarta.annotation.Resource; -import org.springframework.validation.annotation.Validated; -import org.springframework.transaction.annotation.Transactional; - -import java.util.*; -import com.zteits.urbanops.module.garden.controller.admin.material.vo.*; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialTypeManagerDO; -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.framework.common.pojo.PageParam; -import com.zteits.urbanops.framework.common.util.object.BeanUtils; - -import com.zteits.urbanops.module.garden.dal.mysql.material.MaterialTypeManagerMapper; - -import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; -import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertList; -import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.diffList; -import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.*; - -/** - * 耗材类别管理 Service 实现类 - * - * @author 超级管理员 - */ -@Service -@Validated -public class MaterialTypeManagerServiceImpl implements MaterialTypeManagerService { - - @Resource - private MaterialTypeManagerMapper materialTypeManagerMapper; - - @Override - public Long createMaterialTypeManager(MaterialTypeManagerSaveReqVO createReqVO) { - // 插入 - MaterialTypeManagerDO materialTypeManager = BeanUtils.toBean(createReqVO, MaterialTypeManagerDO.class); - materialTypeManagerMapper.insert(materialTypeManager); - - // 返回 - return materialTypeManager.getId(); - } - - @Override - public void updateMaterialTypeManager(MaterialTypeManagerSaveReqVO updateReqVO) { - // 校验存在 - validateMaterialTypeManagerExists(updateReqVO.getId()); - // 更新 - MaterialTypeManagerDO updateObj = BeanUtils.toBean(updateReqVO, MaterialTypeManagerDO.class); - materialTypeManagerMapper.updateById(updateObj); - } - - @Override - public void deleteMaterialTypeManager(Long id) { - // 校验存在 - validateMaterialTypeManagerExists(id); - // 删除 - materialTypeManagerMapper.deleteById(id); - } - - @Override - public void deleteMaterialTypeManagerListByIds(List ids) { - // 删除 - materialTypeManagerMapper.deleteByIds(ids); - } - - - private void validateMaterialTypeManagerExists(Long id) { - if (materialTypeManagerMapper.selectById(id) == null) { - throw exception(MATERIAL_TYPE_MANAGER_NOT_EXISTS); - } - } - - @Override - public MaterialTypeManagerDO getMaterialTypeManager(Long id) { - return materialTypeManagerMapper.selectById(id); - } - - @Override - public PageResult getMaterialTypeManagerPage(MaterialTypeManagerPageReqVO pageReqVO) { - return materialTypeManagerMapper.selectPage(pageReqVO); - } - -} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialTypeService.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialTypeService.java deleted file mode 100644 index 1f4e0f8..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialTypeService.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.zteits.urbanops.module.garden.service.material; - -import java.util.*; - -import com.zteits.urbanops.module.garden.controller.admin.material.vo.MaterialTypePageReqVO; -import com.zteits.urbanops.module.garden.controller.admin.material.vo.MaterialTypeResp; -import com.zteits.urbanops.module.garden.controller.admin.material.vo.MaterialTypeSaveReqVO; -import jakarta.validation.*; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialTypeDO; -import com.zteits.urbanops.framework.common.pojo.PageResult; - -/** - * 物料类型 Service 接口 - * - * @author 超级管理员 - */ -public interface MaterialTypeService { - - /** - * 创建物料类型 - * - * @param createReqVO 创建信息 - * @return 编号 - */ - Long createMaterialType(@Valid MaterialTypeSaveReqVO createReqVO); - - /** - * 更新物料类型 - * - * @param updateReqVO 更新信息 - */ - void updateMaterialType(@Valid MaterialTypeSaveReqVO updateReqVO); - - /** - * 删除物料类型 - * - * @param id 编号 - */ - void deleteMaterialType(Long id); - - /** - * 批量删除物料类型 - * - * @param ids 编号 - */ - void deleteMaterialTypeListByIds(List ids); - - /** - * 获得物料类型 - * - * @param id 编号 - * @return 物料类型 - */ - MaterialTypeDO getMaterialType(Long id); - - /** - * 获得物料类型分页 - * - * @param pageReqVO 分页查询 - * @return 物料类型分页 - */ - PageResult getMaterialTypePage(MaterialTypePageReqVO pageReqVO); - - List queryMaterialBigType(Long materialTypeId); - - List queryMaterialMidType(Long materialTypeId); - - List queryMaterialDetailType(Long parentTypeId); - - Long selectMaxTypeDetailId(Long materialTypeId, Long typeId); - -} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialTypeServiceImpl.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialTypeServiceImpl.java deleted file mode 100644 index 87467a3..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialTypeServiceImpl.java +++ /dev/null @@ -1,186 +0,0 @@ -package com.zteits.urbanops.module.garden.service.material; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.zteits.urbanops.module.garden.controller.admin.material.vo.MaterialTypePageReqVO; -import com.zteits.urbanops.module.garden.controller.admin.material.vo.MaterialTypeResp; -import com.zteits.urbanops.module.garden.controller.admin.material.vo.MaterialTypeSaveReqVO; -import org.apache.commons.collections4.CollectionUtils; -import org.springframework.stereotype.Service; -import jakarta.annotation.Resource; -import org.springframework.validation.annotation.Validated; - -import java.util.*; -import java.util.stream.Collectors; - -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialTypeDO; -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.framework.common.util.object.BeanUtils; - -import com.zteits.urbanops.module.garden.dal.mysql.material.MaterialTypeMapper; - -import static com.zteits.urbanops.framework.common.exception.enums.GlobalErrorCodeConstants.BAD_REQUEST; -import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; -import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception0; -import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertList; -import static com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils.getLoginUserDeptId; -import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.*; - -/** - * 物料类型 Service 实现类 - * - * @author 超级管理员 - */ -@Service -@Validated -public class MaterialTypeServiceImpl implements MaterialTypeService { - - @Resource - private MaterialTypeMapper materialTypeMapper; - - @Override - public Long createMaterialType(MaterialTypeSaveReqVO createReqVO) { - // 插入 - QueryWrapper sql = new QueryWrapper<>(); - sql.lambda().eq(MaterialTypeDO::getMaterialTypeId, createReqVO.getMaterialTypeId()) - .eq(MaterialTypeDO::getTypeId, createReqVO.getTypeId()) - .eq(MaterialTypeDO::getTypeDetailName, createReqVO.getTypeDetailName()); - List materialTypes = materialTypeMapper.selectList(sql); - if (null != materialTypes && !materialTypes.isEmpty()) { - MaterialTypeDO materialType1 = materialTypes.get(0); - throw exception0(BAD_REQUEST.getCode(), "耗材类型:"+materialType1.getMaterialTypeName()+",类别:"+materialType1.getTypeName()+",类别明细:"+materialType1.getTypeDetailName() + " 的配置已存在"); - } - Long selectMaxTypeDetailId = selectMaxTypeDetailId(createReqVO.getMaterialTypeId(), createReqVO.getTypeId()); - createReqVO.setTypeDetailId(selectMaxTypeDetailId + 1); - MaterialTypeDO materialType = BeanUtils.toBean(createReqVO, MaterialTypeDO.class); - materialType.setParentTypeId(createReqVO.getTypeId()); - materialType.setMaterialParentTypeId(createReqVO.getMaterialTypeId()); - materialType.setStatus("0"); - materialType.setCreator(String.valueOf(getLoginUserDeptId())); - materialType.setUpdater(materialType.getCreator()); - materialTypeMapper.insert(materialType); - - // 返回 - return materialType.getId(); - } - - @Override - public void updateMaterialType(MaterialTypeSaveReqVO updateReqVO) { - // 校验存在 - validateMaterialTypeExists(updateReqVO.getId()); - // 更新 - MaterialTypeDO updateObj = BeanUtils.toBean(updateReqVO, MaterialTypeDO.class); - materialTypeMapper.updateById(updateObj); - } - - @Override - public void deleteMaterialType(Long id) { - // 校验存在 - validateMaterialTypeExists(id); - // 删除 - materialTypeMapper.deleteById(id); - } - - @Override - public void deleteMaterialTypeListByIds(List ids) { - // 删除 - materialTypeMapper.deleteByIds(ids); - } - - - private void validateMaterialTypeExists(Long id) { - if (materialTypeMapper.selectById(id) == null) { - throw exception(MATERIAL_TYPE_NOT_EXISTS); - } - } - - @Override - public MaterialTypeDO getMaterialType(Long id) { - return materialTypeMapper.selectById(id); - } - - @Override - public PageResult getMaterialTypePage(MaterialTypePageReqVO pageReqVO) { - return materialTypeMapper.selectPage(pageReqVO); - } - - @Override - public List queryMaterialBigType(Long materialTypeId) { - List list; - // 入参为空时查询所有,非空时按ID查询 - if (materialTypeId == null) { - list = materialTypeMapper.selectList(); - } else { - list = materialTypeMapper.selectList(MaterialTypeDO::getMaterialTypeId, materialTypeId); - } - - // 空列表判断,避免空指针 - if (list == null || list.isEmpty()) { - return List.of(); // 返回空列表而非null,更符合Java规范 - } - - Set seenIds = new HashSet<>(); - return list.stream() - .map(doObj -> { - MaterialTypeResp resp = new MaterialTypeResp(); - resp.setValue(doObj.getMaterialTypeId()); - resp.setLabel(doObj.getMaterialTypeName()); - return resp; - }) - .filter(resp -> seenIds.add(resp.getValue())) // add成功返回true(未重复) - .collect(Collectors.toList()); - } - - @Override - public List queryMaterialMidType(Long materialParentTypeId) { - List list = materialTypeMapper.selectList(MaterialTypeDO::getMaterialParentTypeId, materialParentTypeId); - // 2. 空列表判断,避免空指针 - if (list == null || list.isEmpty()) { - return List.of(); // 返回空列表而非null,更符合Java规范 - } - Set seenIds = new HashSet<>(); - return list.stream() - .map(doObj -> { - MaterialTypeResp resp = new MaterialTypeResp(); - resp.setValue(doObj.getTypeId()); - resp.setLabel(doObj.getTypeName()); - return resp; - }) - .filter(resp -> seenIds.add(resp.getValue())) // add成功返回true(未重复) - .collect(Collectors.toList()); - } - - @Override - public List queryMaterialDetailType(Long parentTypeId) { - List list = materialTypeMapper.selectList(MaterialTypeDO::getParentTypeId, parentTypeId); - // 2. 空列表判断,避免空指针 - if (list == null || list.isEmpty()) { - return List.of(); // 返回空列表而非null,更符合Java规范 - } - Set seenIds = new HashSet<>(); - return list.stream() - .map(doObj -> { - MaterialTypeResp resp = new MaterialTypeResp(); - resp.setValue(doObj.getTypeDetailId()); - resp.setLabel(doObj.getTypeDetailName()); - return resp; - }) - .filter(resp -> seenIds.add(resp.getValue())) // add成功返回true(未重复) - .collect(Collectors.toList()); - } - - @Override - public Long selectMaxTypeDetailId(Long materialTypeId, Long typeId) { - QueryWrapper qw = new QueryWrapper<>(); - qw.select("max(type_detail_id) AS maxId") - .eq("material_type_id", materialTypeId) - .eq("type_id", typeId); - - List> maps = materialTypeMapper.selectMaps(qw); - return CollectionUtils.isEmpty(maps) - ? 0L - : Optional.ofNullable((Number) maps.get(0).get("maxId")) - .map(Number::longValue) - .orElse(0L); - } - -} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventory/MaterialInventoryService.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventory/MaterialInventoryService.java new file mode 100644 index 0000000..c4ab7cd --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventory/MaterialInventoryService.java @@ -0,0 +1,10 @@ +package com.zteits.urbanops.module.garden.service.materialinventory; + +import com.zteits.urbanops.framework.common.pojo.PageParam; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventory.MaterialInventoryDO; + +public interface MaterialInventoryService { + PageResult selectPage(PageParam pageParam, MaterialInventoryDO where); + Boolean updateInventoryAlarmNum(Long materialId, Long alermNum); +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventory/MaterialInventoryServiceImpl.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventory/MaterialInventoryServiceImpl.java new file mode 100644 index 0000000..ac041f9 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventory/MaterialInventoryServiceImpl.java @@ -0,0 +1,30 @@ +package com.zteits.urbanops.module.garden.service.materialinventory; + +import com.zteits.urbanops.framework.common.pojo.PageParam; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventory.MaterialInventoryDO; +import com.zteits.urbanops.module.garden.dal.mysql.materialinventory.MaterialInventoryMapper; +import jakarta.annotation.Resource; +import org.springframework.stereotype.Service; + +@Service +public class MaterialInventoryServiceImpl implements MaterialInventoryService { + + @Resource + private MaterialInventoryMapper mapper; + + @Override + public PageResult selectPage(PageParam pageParam, MaterialInventoryDO where) { + return mapper.selectPage(pageParam, null, new com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX() + .eqIfPresent(MaterialInventoryDO::getMaterialId, where.getMaterialId()) + .likeIfPresent(MaterialInventoryDO::getMaterialName, where.getMaterialName()) + .eqIfPresent(MaterialInventoryDO::getTypeDetailId, where.getTypeDetailId()) + .eqIfPresent(MaterialInventoryDO::getBelongCompanyId, where.getBelongCompanyId()) + .orderByDesc(MaterialInventoryDO::getUpdateTime)); + } + + @Override + public Boolean updateInventoryAlarmNum(Long materialId, Long alermNum) { + return mapper.updateInventoryAlarmNum(materialId, alermNum) > 0; + } +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryin/MaterialInventoryInService.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryin/MaterialInventoryInService.java new file mode 100644 index 0000000..e5b5727 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryin/MaterialInventoryInService.java @@ -0,0 +1,62 @@ +package com.zteits.urbanops.module.garden.service.materialinventoryin; + +import java.util.*; +import jakarta.validation.*; +import com.zteits.urbanops.module.garden.controller.admin.materialinventoryin.vo.*; +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventoryin.MaterialInventoryInDO; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.PageParam; + +/** + * 物料入库 Service 接口 + * + * @author 超级管理员 + */ +public interface MaterialInventoryInService { + + /** + * 创建物料入库 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createMaterialInventoryIn(@Valid MaterialInventoryInSaveReqVO createReqVO); + + /** + * 更新物料入库 + * + * @param updateReqVO 更新信息 + */ + void updateMaterialInventoryIn(@Valid MaterialInventoryInSaveReqVO updateReqVO); + + /** + * 删除物料入库 + * + * @param id 编号 + */ + void deleteMaterialInventoryIn(Long id); + + /** + * 批量删除物料入库 + * + * @param ids 编号 + */ + void deleteMaterialInventoryInListByIds(List ids); + + /** + * 获得物料入库 + * + * @param id 编号 + * @return 物料入库 + */ + MaterialInventoryInDO getMaterialInventoryIn(Long id); + + /** + * 获得物料入库分页 + * + * @param pageReqVO 分页查询 + * @return 物料入库分页 + */ + PageResult getMaterialInventoryInPage(MaterialInventoryInPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryin/MaterialInventoryInServiceImpl.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryin/MaterialInventoryInServiceImpl.java new file mode 100644 index 0000000..beb8895 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryin/MaterialInventoryInServiceImpl.java @@ -0,0 +1,85 @@ +package com.zteits.urbanops.module.garden.service.materialinventoryin; + +import cn.hutool.core.collection.CollUtil; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.zteits.urbanops.module.garden.controller.admin.materialinventoryin.vo.*; +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventoryin.MaterialInventoryInDO; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.PageParam; +import com.zteits.urbanops.framework.common.util.object.BeanUtils; + +import com.zteits.urbanops.module.garden.dal.mysql.materialinventoryin.MaterialInventoryInMapper; + +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertList; +import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.diffList; +import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.*; + +/** + * 物料入库 Service 实现类 + * + * @author 超级管理员 + */ +@Service +@Validated +public class MaterialInventoryInServiceImpl implements MaterialInventoryInService { + + @Resource + private MaterialInventoryInMapper materialInventoryInMapper; + + @Override + public Long createMaterialInventoryIn(MaterialInventoryInSaveReqVO createReqVO) { + // 插入 + MaterialInventoryInDO materialInventoryIn = BeanUtils.toBean(createReqVO, MaterialInventoryInDO.class); + materialInventoryInMapper.insert(materialInventoryIn); + + // 返回 + return materialInventoryIn.getId(); + } + + @Override + public void updateMaterialInventoryIn(MaterialInventoryInSaveReqVO updateReqVO) { + // 校验存在 + validateMaterialInventoryInExists(updateReqVO.getId()); + // 更新 + MaterialInventoryInDO updateObj = BeanUtils.toBean(updateReqVO, MaterialInventoryInDO.class); + materialInventoryInMapper.updateById(updateObj); + } + + @Override + public void deleteMaterialInventoryIn(Long id) { + // 校验存在 + validateMaterialInventoryInExists(id); + // 删除 + materialInventoryInMapper.deleteById(id); + } + + @Override + public void deleteMaterialInventoryInListByIds(List ids) { + // 删除 + materialInventoryInMapper.deleteByIds(ids); + } + + + private void validateMaterialInventoryInExists(Long id) { + if (materialInventoryInMapper.selectById(id) == null) { + throw exception(MATERIAL_INVENTORY_IN_NOT_EXISTS); + } + } + + @Override + public MaterialInventoryInDO getMaterialInventoryIn(Long id) { + return materialInventoryInMapper.selectById(id); + } + + @Override + public PageResult getMaterialInventoryInPage(MaterialInventoryInPageReqVO pageReqVO) { + return materialInventoryInMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryout/MaterialInventoryOutService.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryout/MaterialInventoryOutService.java new file mode 100644 index 0000000..7030aea --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryout/MaterialInventoryOutService.java @@ -0,0 +1,62 @@ +package com.zteits.urbanops.module.garden.service.materialinventoryout; + +import java.util.*; +import jakarta.validation.*; +import com.zteits.urbanops.module.garden.controller.admin.materialinventoryout.vo.*; +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventoryout.MaterialInventoryOutDO; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.PageParam; + +/** + * 物料出库 Service 接口 + * + * @author 超级管理员 + */ +public interface MaterialInventoryOutService { + + /** + * 创建物料出库 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createMaterialInventoryOut(@Valid MaterialInventoryOutSaveReqVO createReqVO); + + /** + * 更新物料出库 + * + * @param updateReqVO 更新信息 + */ + void updateMaterialInventoryOut(@Valid MaterialInventoryOutSaveReqVO updateReqVO); + + /** + * 删除物料出库 + * + * @param id 编号 + */ + void deleteMaterialInventoryOut(Long id); + + /** + * 批量删除物料出库 + * + * @param ids 编号 + */ + void deleteMaterialInventoryOutListByIds(List ids); + + /** + * 获得物料出库 + * + * @param id 编号 + * @return 物料出库 + */ + MaterialInventoryOutDO getMaterialInventoryOut(Long id); + + /** + * 获得物料出库分页 + * + * @param pageReqVO 分页查询 + * @return 物料出库分页 + */ + PageResult getMaterialInventoryOutPage(MaterialInventoryOutPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryout/MaterialInventoryOutServiceImpl.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryout/MaterialInventoryOutServiceImpl.java new file mode 100644 index 0000000..4bf635e --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryout/MaterialInventoryOutServiceImpl.java @@ -0,0 +1,85 @@ +package com.zteits.urbanops.module.garden.service.materialinventoryout; + +import cn.hutool.core.collection.CollUtil; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.zteits.urbanops.module.garden.controller.admin.materialinventoryout.vo.*; +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventoryout.MaterialInventoryOutDO; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.PageParam; +import com.zteits.urbanops.framework.common.util.object.BeanUtils; + +import com.zteits.urbanops.module.garden.dal.mysql.materialinventoryout.MaterialInventoryOutMapper; + +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertList; +import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.diffList; +import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.*; + +/** + * 物料出库 Service 实现类 + * + * @author 超级管理员 + */ +@Service +@Validated +public class MaterialInventoryOutServiceImpl implements MaterialInventoryOutService { + + @Resource + private MaterialInventoryOutMapper materialInventoryOutMapper; + + @Override + public Long createMaterialInventoryOut(MaterialInventoryOutSaveReqVO createReqVO) { + // 插入 + MaterialInventoryOutDO materialInventoryOut = BeanUtils.toBean(createReqVO, MaterialInventoryOutDO.class); + materialInventoryOutMapper.insert(materialInventoryOut); + + // 返回 + return materialInventoryOut.getId(); + } + + @Override + public void updateMaterialInventoryOut(MaterialInventoryOutSaveReqVO updateReqVO) { + // 校验存在 + validateMaterialInventoryOutExists(updateReqVO.getId()); + // 更新 + MaterialInventoryOutDO updateObj = BeanUtils.toBean(updateReqVO, MaterialInventoryOutDO.class); + materialInventoryOutMapper.updateById(updateObj); + } + + @Override + public void deleteMaterialInventoryOut(Long id) { + // 校验存在 + validateMaterialInventoryOutExists(id); + // 删除 + materialInventoryOutMapper.deleteById(id); + } + + @Override + public void deleteMaterialInventoryOutListByIds(List ids) { + // 删除 + materialInventoryOutMapper.deleteByIds(ids); + } + + + private void validateMaterialInventoryOutExists(Long id) { + if (materialInventoryOutMapper.selectById(id) == null) { + throw exception(MATERIAL_INVENTORY_OUT_NOT_EXISTS); + } + } + + @Override + public MaterialInventoryOutDO getMaterialInventoryOut(Long id) { + return materialInventoryOutMapper.selectById(id); + } + + @Override + public PageResult getMaterialInventoryOutPage(MaterialInventoryOutPageReqVO pageReqVO) { + return materialInventoryOutMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeManagerService.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeManagerService.java new file mode 100644 index 0000000..c32a9a7 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeManagerService.java @@ -0,0 +1,63 @@ +package com.zteits.urbanops.module.garden.service.materialtype; + +import java.util.*; + +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeManagerPageReqVO; +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeManagerSaveReqVO; +import jakarta.validation.*; +import com.zteits.urbanops.module.garden.dal.dataobject.materialtype.MaterialTypeManagerDO; +import com.zteits.urbanops.framework.common.pojo.PageResult; + +/** + * 耗材类别管理 Service 接口 + * + * @author 超级管理员 + */ +public interface MaterialTypeManagerService { + + /** + * 创建耗材类别管理 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createMaterialTypeManager(@Valid MaterialTypeManagerSaveReqVO createReqVO); + + /** + * 更新耗材类别管理 + * + * @param updateReqVO 更新信息 + */ + void updateMaterialTypeManager(@Valid MaterialTypeManagerSaveReqVO updateReqVO); + + /** + * 删除耗材类别管理 + * + * @param id 编号 + */ + void deleteMaterialTypeManager(Long id); + + /** + * 批量删除耗材类别管理 + * + * @param ids 编号 + */ + void deleteMaterialTypeManagerListByIds(List ids); + + /** + * 获得耗材类别管理 + * + * @param id 编号 + * @return 耗材类别管理 + */ + MaterialTypeManagerDO getMaterialTypeManager(Long id); + + /** + * 获得耗材类别管理分页 + * + * @param pageReqVO 分页查询 + * @return 耗材类别管理分页 + */ + PageResult getMaterialTypeManagerPage(MaterialTypeManagerPageReqVO pageReqVO); + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeManagerServiceImpl.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeManagerServiceImpl.java new file mode 100644 index 0000000..9e8c2fe --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeManagerServiceImpl.java @@ -0,0 +1,83 @@ +package com.zteits.urbanops.module.garden.service.materialtype; + +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeManagerPageReqVO; +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeManagerSaveReqVO; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; + +import com.zteits.urbanops.module.garden.dal.dataobject.materialtype.MaterialTypeManagerDO; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.util.object.BeanUtils; + +import com.zteits.urbanops.module.garden.dal.mysql.materialtype.MaterialTypeManagerMapper; + +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertList; +import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.*; + +/** + * 耗材类别管理 Service 实现类 + * + * @author 超级管理员 + */ +@Service +@Validated +public class MaterialTypeManagerServiceImpl implements MaterialTypeManagerService { + + @Resource + private MaterialTypeManagerMapper materialTypeManagerMapper; + + @Override + public Long createMaterialTypeManager(MaterialTypeManagerSaveReqVO createReqVO) { + // 插入 + MaterialTypeManagerDO materialTypeManager = BeanUtils.toBean(createReqVO, MaterialTypeManagerDO.class); + materialTypeManagerMapper.insert(materialTypeManager); + + // 返回 + return materialTypeManager.getId(); + } + + @Override + public void updateMaterialTypeManager(MaterialTypeManagerSaveReqVO updateReqVO) { + // 校验存在 + validateMaterialTypeManagerExists(updateReqVO.getId()); + // 更新 + MaterialTypeManagerDO updateObj = BeanUtils.toBean(updateReqVO, MaterialTypeManagerDO.class); + materialTypeManagerMapper.updateById(updateObj); + } + + @Override + public void deleteMaterialTypeManager(Long id) { + // 校验存在 + validateMaterialTypeManagerExists(id); + // 删除 + materialTypeManagerMapper.deleteById(id); + } + + @Override + public void deleteMaterialTypeManagerListByIds(List ids) { + // 删除 + materialTypeManagerMapper.deleteByIds(ids); + } + + + private void validateMaterialTypeManagerExists(Long id) { + if (materialTypeManagerMapper.selectById(id) == null) { + throw exception(MATERIAL_TYPE_MANAGER_NOT_EXISTS); + } + } + + @Override + public MaterialTypeManagerDO getMaterialTypeManager(Long id) { + return materialTypeManagerMapper.selectById(id); + } + + @Override + public PageResult getMaterialTypeManagerPage(MaterialTypeManagerPageReqVO pageReqVO) { + return materialTypeManagerMapper.selectPage(pageReqVO); + } + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeService.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeService.java new file mode 100644 index 0000000..cdcf3f7 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeService.java @@ -0,0 +1,72 @@ +package com.zteits.urbanops.module.garden.service.materialtype; + +import java.util.*; + +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypePageReqVO; +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeResp; +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeSaveReqVO; +import jakarta.validation.*; +import com.zteits.urbanops.module.garden.dal.dataobject.materialtype.MaterialTypeDO; +import com.zteits.urbanops.framework.common.pojo.PageResult; + +/** + * 物料类型 Service 接口 + * + * @author 超级管理员 + */ +public interface MaterialTypeService { + + /** + * 创建物料类型 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createMaterialType(@Valid MaterialTypeSaveReqVO createReqVO); + + /** + * 更新物料类型 + * + * @param updateReqVO 更新信息 + */ + void updateMaterialType(@Valid MaterialTypeSaveReqVO updateReqVO); + + /** + * 删除物料类型 + * + * @param id 编号 + */ + void deleteMaterialType(Long id); + + /** + * 批量删除物料类型 + * + * @param ids 编号 + */ + void deleteMaterialTypeListByIds(List ids); + + /** + * 获得物料类型 + * + * @param id 编号 + * @return 物料类型 + */ + MaterialTypeDO getMaterialType(Long id); + + /** + * 获得物料类型分页 + * + * @param pageReqVO 分页查询 + * @return 物料类型分页 + */ + PageResult getMaterialTypePage(MaterialTypePageReqVO pageReqVO); + + List queryMaterialBigType(Long materialTypeId); + + List queryMaterialMidType(Long materialTypeId); + + List queryMaterialDetailType(Long parentTypeId); + + Long selectMaxTypeDetailId(Long materialTypeId, Long typeId); + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeServiceImpl.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeServiceImpl.java new file mode 100644 index 0000000..db76698 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeServiceImpl.java @@ -0,0 +1,186 @@ +package com.zteits.urbanops.module.garden.service.materialtype; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypePageReqVO; +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeResp; +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeSaveReqVO; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; +import java.util.stream.Collectors; + +import com.zteits.urbanops.module.garden.dal.dataobject.materialtype.MaterialTypeDO; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.util.object.BeanUtils; + +import com.zteits.urbanops.module.garden.dal.mysql.materialtype.MaterialTypeMapper; + +import static com.zteits.urbanops.framework.common.exception.enums.GlobalErrorCodeConstants.BAD_REQUEST; +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception0; +import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertList; +import static com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils.getLoginUserDeptId; +import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.*; + +/** + * 物料类型 Service 实现类 + * + * @author 超级管理员 + */ +@Service +@Validated +public class MaterialTypeServiceImpl implements MaterialTypeService { + + @Resource + private MaterialTypeMapper materialTypeMapper; + + @Override + public Long createMaterialType(MaterialTypeSaveReqVO createReqVO) { + // 插入 + QueryWrapper sql = new QueryWrapper<>(); + sql.lambda().eq(MaterialTypeDO::getMaterialTypeId, createReqVO.getMaterialTypeId()) + .eq(MaterialTypeDO::getTypeId, createReqVO.getTypeId()) + .eq(MaterialTypeDO::getTypeDetailName, createReqVO.getTypeDetailName()); + List materialTypes = materialTypeMapper.selectList(sql); + if (null != materialTypes && !materialTypes.isEmpty()) { + MaterialTypeDO materialType1 = materialTypes.get(0); + throw exception0(BAD_REQUEST.getCode(), "耗材类型:"+materialType1.getMaterialTypeName()+",类别:"+materialType1.getTypeName()+",类别明细:"+materialType1.getTypeDetailName() + " 的配置已存在"); + } + Long selectMaxTypeDetailId = selectMaxTypeDetailId(createReqVO.getMaterialTypeId(), createReqVO.getTypeId()); + createReqVO.setTypeDetailId(selectMaxTypeDetailId + 1); + MaterialTypeDO materialType = BeanUtils.toBean(createReqVO, MaterialTypeDO.class); + materialType.setParentTypeId(createReqVO.getTypeId()); + materialType.setMaterialParentTypeId(createReqVO.getMaterialTypeId()); + materialType.setStatus("0"); + materialType.setCreator(String.valueOf(getLoginUserDeptId())); + materialType.setUpdater(materialType.getCreator()); + materialTypeMapper.insert(materialType); + + // 返回 + return materialType.getId(); + } + + @Override + public void updateMaterialType(MaterialTypeSaveReqVO updateReqVO) { + // 校验存在 + validateMaterialTypeExists(updateReqVO.getId()); + // 更新 + MaterialTypeDO updateObj = BeanUtils.toBean(updateReqVO, MaterialTypeDO.class); + materialTypeMapper.updateById(updateObj); + } + + @Override + public void deleteMaterialType(Long id) { + // 校验存在 + validateMaterialTypeExists(id); + // 删除 + materialTypeMapper.deleteById(id); + } + + @Override + public void deleteMaterialTypeListByIds(List ids) { + // 删除 + materialTypeMapper.deleteByIds(ids); + } + + + private void validateMaterialTypeExists(Long id) { + if (materialTypeMapper.selectById(id) == null) { + throw exception(MATERIAL_TYPE_NOT_EXISTS); + } + } + + @Override + public MaterialTypeDO getMaterialType(Long id) { + return materialTypeMapper.selectById(id); + } + + @Override + public PageResult getMaterialTypePage(MaterialTypePageReqVO pageReqVO) { + return materialTypeMapper.selectPage(pageReqVO); + } + + @Override + public List queryMaterialBigType(Long materialTypeId) { + List list; + // 入参为空时查询所有,非空时按ID查询 + if (materialTypeId == null) { + list = materialTypeMapper.selectList(); + } else { + list = materialTypeMapper.selectList(MaterialTypeDO::getMaterialTypeId, materialTypeId); + } + + // 空列表判断,避免空指针 + if (list == null || list.isEmpty()) { + return List.of(); // 返回空列表而非null,更符合Java规范 + } + + Set seenIds = new HashSet<>(); + return list.stream() + .map(doObj -> { + MaterialTypeResp resp = new MaterialTypeResp(); + resp.setValue(doObj.getMaterialTypeId()); + resp.setLabel(doObj.getMaterialTypeName()); + return resp; + }) + .filter(resp -> seenIds.add(resp.getValue())) // add成功返回true(未重复) + .collect(Collectors.toList()); + } + + @Override + public List queryMaterialMidType(Long materialParentTypeId) { + List list = materialTypeMapper.selectList(MaterialTypeDO::getMaterialParentTypeId, materialParentTypeId); + // 2. 空列表判断,避免空指针 + if (list == null || list.isEmpty()) { + return List.of(); // 返回空列表而非null,更符合Java规范 + } + Set seenIds = new HashSet<>(); + return list.stream() + .map(doObj -> { + MaterialTypeResp resp = new MaterialTypeResp(); + resp.setValue(doObj.getTypeId()); + resp.setLabel(doObj.getTypeName()); + return resp; + }) + .filter(resp -> seenIds.add(resp.getValue())) // add成功返回true(未重复) + .collect(Collectors.toList()); + } + + @Override + public List queryMaterialDetailType(Long parentTypeId) { + List list = materialTypeMapper.selectList(MaterialTypeDO::getParentTypeId, parentTypeId); + // 2. 空列表判断,避免空指针 + if (list == null || list.isEmpty()) { + return List.of(); // 返回空列表而非null,更符合Java规范 + } + Set seenIds = new HashSet<>(); + return list.stream() + .map(doObj -> { + MaterialTypeResp resp = new MaterialTypeResp(); + resp.setValue(doObj.getTypeDetailId()); + resp.setLabel(doObj.getTypeDetailName()); + return resp; + }) + .filter(resp -> seenIds.add(resp.getValue())) // add成功返回true(未重复) + .collect(Collectors.toList()); + } + + @Override + public Long selectMaxTypeDetailId(Long materialTypeId, Long typeId) { + QueryWrapper qw = new QueryWrapper<>(); + qw.select("max(type_detail_id) AS maxId") + .eq("material_type_id", materialTypeId) + .eq("type_id", typeId); + + List> maps = materialTypeMapper.selectMaps(qw); + return CollectionUtils.isEmpty(maps) + ? 0L + : Optional.ofNullable((Number) maps.get(0).get("maxId")) + .map(Number::longValue) + .orElse(0L); + } + +} -- libgit2 0.21.4