diff --git a/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/TreeSelect.java b/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/TreeSelect.java new file mode 100644 index 00000000..30a74855 --- /dev/null +++ b/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/TreeSelect.java @@ -0,0 +1,56 @@ +package com.bonus.common.biz.domain; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * TreeSelect树结构实体类 + * @author syruan + */ +@Data +public class TreeSelect implements Serializable { + + private static final long serialVersionUID = 469203039368157600L; + + /** 节点ID */ + private Long id; + + /** 节点名称 */ + private String label; + + /** 节点级别 */ + private Integer level; + + /** 父节点id */ + private Long parentId; + + /** 公司id */ + private String companyId; + + /** 子节点集合 */ + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private List children; + + public TreeSelect() { + + } + + public TreeSelect(Long id, String label, Integer level, Long parentId, List children) { + this.id = id; + this.label = label; + this.level = level; + this.parentId = parentId; + this.children = children; + } + + public TreeSelect(Long id, String label, Integer level, Long parentId) { + this.id = id; + this.label = label; + this.level = level; + this.parentId = parentId; + } + +} diff --git a/bonus-common-biz/src/main/java/com/bonus/common/biz/enums/DataCodeEnum.java b/bonus-common-biz/src/main/java/com/bonus/common/biz/enums/DataCodeEnum.java new file mode 100644 index 00000000..6b1aab14 --- /dev/null +++ b/bonus-common-biz/src/main/java/com/bonus/common/biz/enums/DataCodeEnum.java @@ -0,0 +1,26 @@ +package com.bonus.common.biz.enums; + +import lombok.Getter; + +/** + * @author : 阮世耀 + * @version : 1.0 + * @PackagePath: com.bonus.common.biz.enums + * @CreateTime: 2024-10-15 10:28 + * @Description: 数据状态枚举类 + */ +@Getter +public enum DataCodeEnum { + + NORMAL(0, "正常"), + DELETED(2, "已删除"); + + private final int code; + private final String msg; + + DataCodeEnum(int code, String msg) { + this.code = code; + this.msg = msg; + } + +} diff --git a/bonus-common-biz/src/main/java/com/bonus/common/biz/enums/HttpCodeEnum.java b/bonus-common-biz/src/main/java/com/bonus/common/biz/enums/HttpCodeEnum.java index df53128d..7032eee0 100644 --- a/bonus-common-biz/src/main/java/com/bonus/common/biz/enums/HttpCodeEnum.java +++ b/bonus-common-biz/src/main/java/com/bonus/common/biz/enums/HttpCodeEnum.java @@ -1,5 +1,12 @@ package com.bonus.common.biz.enums; +import lombok.Getter; + +/** + * @author bonus + */ + +@Getter public enum HttpCodeEnum { // 成功 SUCCESS(200, "操作成功"), @@ -20,19 +27,13 @@ public enum HttpCodeEnum { NICKNAME_EXIST(512, "昵称已存在"), LOGIN_ERROR(505, "用户名或密码错误"), REPEATE_ERROR(600, "不允许重复提交,请稍候再试"); - int code; - String msg; + + private final int code; + private final String msg; HttpCodeEnum(int code, String errorMessage) { this.code = code; this.msg = errorMessage; } - public int getCode() { - return code; - } - - public String getMsg() { - return msg; - } } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/MachineController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/MachineController.java index 68d63bc9..652a4acf 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/MachineController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/MachineController.java @@ -33,8 +33,8 @@ import com.bonus.common.core.web.page.TableDataInfo; @Api(tags = "机具设备管理接口") @RestController @RequestMapping("/ma_machine") -public class MachineController extends BaseController -{ +public class MachineController extends BaseController { + @Autowired private IMachineService machineService; diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/SupplierInfoController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/SupplierInfoController.java index 61cd22f3..ea8163fe 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/SupplierInfoController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/SupplierInfoController.java @@ -1,6 +1,7 @@ package com.bonus.material.ma.controller; import java.util.List; +import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import com.bonus.common.log.enums.OperaType; import com.bonus.material.common.annotation.PreventRepeatSubmit; @@ -25,94 +26,86 @@ import com.bonus.common.core.utils.poi.ExcelUtil; import com.bonus.common.core.web.page.TableDataInfo; /** - * 供应商管理Controller - * - * @author xsheng - * @date 2024-09-27 + * 物资厂家管理Controller + * @author bonus */ -@Api(tags = "供应商管理接口") +@Api(tags = "物资厂家管理接口") @RestController @RequestMapping("/ma_supplier_info") -public class SupplierInfoController extends BaseController -{ - @Autowired +public class SupplierInfoController extends BaseController { + + @Resource private ISupplierInfoService supplierInfoService; /** - * 查询供应商管理列表 + * 查询物资厂家管理列表 */ - @ApiOperation(value = "查询供应商管理列表") + @ApiOperation(value = "查询物资厂家管理列表") @RequiresPermissions("ma:info:list") @GetMapping("/list") - public TableDataInfo list(SupplierInfo supplierInfo) - { + public TableDataInfo list(SupplierInfo supplierInfo) { startPage(); List list = supplierInfoService.selectSupplierInfoList(supplierInfo); return getDataTable(list); } /** - * 导出供应商管理列表 + * 导出物资厂家管理列表 */ - @ApiOperation(value = "导出供应商管理列表") + @ApiOperation(value = "导出物资厂家管理列表") @PreventRepeatSubmit @RequiresPermissions("ma:info:export") - @SysLog(title = "供应商管理", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出供应商管理") + @SysLog(title = "物资厂家管理", businessType = OperaType.EXPORT, logType = 1,module = "物资管理->导出物资厂家管理") @PostMapping("/export") - public void export(HttpServletResponse response, SupplierInfo supplierInfo) - { + public void export(HttpServletResponse response, SupplierInfo supplierInfo) { List list = supplierInfoService.selectSupplierInfoList(supplierInfo); - ExcelUtil util = new ExcelUtil(SupplierInfo.class); - util.exportExcel(response, list, "供应商管理数据"); + ExcelUtil util = new ExcelUtil<>(SupplierInfo.class); + util.exportExcel(response, list, "物资厂家管理数据"); } /** - * 获取供应商管理详细信息 + * 获取物资厂家管理详细信息 */ - @ApiOperation(value = "获取供应商管理详细信息") + @ApiOperation(value = "获取物资厂家管理详细信息") @RequiresPermissions("ma:info:query") @GetMapping(value = "/{supplierId}") - public AjaxResult getInfo(@PathVariable("supplierId") Long supplierId) - { + public AjaxResult getInfo(@PathVariable("supplierId") Long supplierId) { return success(supplierInfoService.selectSupplierInfoBySupplierId(supplierId)); } /** - * 新增供应商管理 + * 新增物资厂家管理 */ - @ApiOperation(value = "新增供应商管理") + @ApiOperation(value = "新增物资厂家管理") @PreventRepeatSubmit @RequiresPermissions("ma:info:add") - @SysLog(title = "供应商管理", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增供应商管理") + @SysLog(title = "物资厂家管理", businessType = OperaType.INSERT, module = "物资管理->新增物资厂家管理") @PostMapping - public AjaxResult add(@RequestBody SupplierInfo supplierInfo) - { + public AjaxResult add(@RequestBody SupplierInfo supplierInfo) { return toAjax(supplierInfoService.insertSupplierInfo(supplierInfo)); } /** - * 修改供应商管理 + * 修改物资厂家管理 */ - @ApiOperation(value = "修改供应商管理") + @ApiOperation(value = "修改物资厂家管理") @PreventRepeatSubmit @RequiresPermissions("ma:info:edit") - @SysLog(title = "供应商管理", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改供应商管理") + @SysLog(title = "物资厂家管理", businessType = OperaType.UPDATE, module = "物资管理->修改物资厂家管理") @PutMapping - public AjaxResult edit(@RequestBody SupplierInfo supplierInfo) - { + public AjaxResult edit(@RequestBody SupplierInfo supplierInfo) { return toAjax(supplierInfoService.updateSupplierInfo(supplierInfo)); } /** - * 删除供应商管理 + * 删除物资厂家管理 */ - @ApiOperation(value = "删除供应商管理") + @ApiOperation(value = "删除物资厂家管理") @PreventRepeatSubmit @RequiresPermissions("ma:info:remove") - @SysLog(title = "供应商管理", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除供应商管理") + @SysLog(title = "物资厂家管理", businessType = OperaType.DELETE, module = "物资管理->删除物资厂家管理") @DeleteMapping("/{supplierIds}") - public AjaxResult remove(@PathVariable Long[] supplierIds) - { + public AjaxResult remove(@PathVariable Long[] supplierIds) { return toAjax(supplierInfoService.deleteSupplierInfoBySupplierIds(supplierIds)); } } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java index d0531686..0a7bc6c5 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java @@ -1,20 +1,22 @@ package com.bonus.material.ma.controller; +import java.util.ArrayList; import java.util.List; +import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import javax.validation.constraints.NotNull; + import com.bonus.common.log.enums.OperaType; import com.bonus.material.common.annotation.PreventRepeatSubmit; +import com.bonus.common.biz.domain.TreeSelect; +import com.bonus.material.ma.vo.MaTypeListVo; +import com.bonus.material.ma.vo.MaTypeSelectVo; +import com.bonus.material.warehouse.domain.WhHouseSet; +import com.bonus.material.warehouse.service.IWhHouseSetService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import com.bonus.common.log.annotation.SysLog; import com.bonus.common.security.annotation.RequiresPermissions; import com.bonus.material.ma.domain.Type; @@ -25,94 +27,165 @@ import com.bonus.common.core.utils.poi.ExcelUtil; import com.bonus.common.core.web.page.TableDataInfo; /** - * 机具类型管理Controller - * - * @author xsheng - * @date 2024-09-27 + * 物资类型管理Controller + * @author syruan */ -@Api(tags = "机具类型管理接口") +@Api(tags = "物资类型管理接口") @RestController @RequestMapping("/ma_type") -public class TypeController extends BaseController -{ - @Autowired +public class TypeController extends BaseController { + + @Resource private ITypeService typeService; + @Resource + private IWhHouseSetService houseSetService; + /** - * 查询机具类型管理列表 + * 查询物资类型管理列表 */ - @ApiOperation(value = "查询机具类型管理列表") + @ApiOperation(value = "查询物资类型管理列表") @RequiresPermissions("ma:type:list") @GetMapping("/list") - public TableDataInfo list(Type type) - { + public TableDataInfo list(MaTypeListVo type) { startPage(); - List list = typeService.selectTypeList(type); + List list = typeService.selectTypeListAndParent(type); return getDataTable(list); } /** - * 导出机具类型管理列表 + * 根据物资仓库ID查询施工类型 */ - @ApiOperation(value = "导出机具类型管理列表") - @PreventRepeatSubmit - @RequiresPermissions("ma:type:export") - @SysLog(title = "机具类型管理", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出机具类型管理") - @PostMapping("/export") - public void export(HttpServletResponse response, Type type) - { - List list = typeService.selectTypeList(type); - ExcelUtil util = new ExcelUtil(Type.class); - util.exportExcel(response, list, "机具类型管理数据"); + @ApiOperation(value = "根据物资仓库ID查询施工类型") + @RequiresPermissions("ma:type:list") + @GetMapping("/selectMaTypeListByHouseId") + public AjaxResult selectMaTypeListByHouseId(@NotNull(message = "物资仓库ID不能为空") Long houseId) { + List list = typeService.selectMaTypeListByHouseId(houseId); + return success(list); } /** - * 获取机具类型管理详细信息 + * 根据物资类型ID查询子级下拉列表 --不进行递归穿透 */ - @ApiOperation(value = "获取机具类型管理详细信息") + @ApiOperation(value = "根据物资类型ID-查询子级下拉列表") + @RequiresPermissions("ma:type:list") + @GetMapping("/selectMaTypeListByTypeId") + public AjaxResult selectMaTypeListByTypeId(@NotNull(message = "物资类型ID不能为空") Long typeId) { + List list = typeService.getMaTypeSelectVoListByParentId(typeId); + return success(list); + } + + /** + * 根据左列表类型id查询右表格 --- 暂未启用,代码有问题!! + * TODO: 待完善 + * @param typeId 左列表类型id + */ + @ApiOperation(value = "根据左列表类型id查询右表格") + @GetMapping("/getListByMaType") + public AjaxResult getListByMaType(Long typeId, @RequestParam(required = false) String typeName, Integer level) { + List parentIds = typeService.selectParentId(typeId, level); + List listByMaType = new ArrayList<>(); + for (Integer parentId : parentIds) { + listByMaType.addAll(typeService.getListByParentId(parentId.longValue(), typeName)); + } +// Integer pageIndex = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1); +// Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10); +// return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, listByMaType)); + return null; + } + + /** + * TODO : 后续优化代码逻辑 + * 物资类型下拉树 + */ + @ApiOperation(value = "物资类型下拉树") + @RequiresPermissions("ma:type:list") + @GetMapping("/getMaTypeTreeSelect") + public AjaxResult getMaTypeTreeSelect(@RequestParam(required = false, defaultValue = "", value = "typeName") String typeName, @RequestParam(required = false, defaultValue = "", value = "parentId") String parentId) { + // 1.顶级节点及子节点数据全部查询完毕 + List maTypeList = typeService.getMaTypeTree(typeName, parentId); + // 2.查询所有的仓库配置 + List whHouseSets = houseSetService.selectListByMaType(null); + // 2.1 定义最终接口返回集合 + List treeSelectResultList = new ArrayList<>(); + // 3.遍历所有配置关联 + for (WhHouseSet whHouseSet : whHouseSets) { + Long typeId = whHouseSet.getTypeId(); + if (typeId == null) {continue;} + // 构造函数定义0级Tree对象 + TreeSelect thisTree = new TreeSelect(whHouseSet.getId(),whHouseSet.getHouseName(),0,null); + // 定义1级列表,并循环push相应的1级节点 + List oneLevelTreeList = new ArrayList<>(); + for (TreeSelect treeSelect : maTypeList) { + if (treeSelect.getId().equals(typeId)) { + oneLevelTreeList.add(treeSelect); + } + } + // 把处理后对应上的1级列表当作child存入0级Tree对象中 + thisTree.setChildren(!oneLevelTreeList.isEmpty() ? oneLevelTreeList : null); + // 最后把0级Tree对象存入Result返回集合中,返回给前端 + treeSelectResultList.add(thisTree); + } + return AjaxResult.success(treeSelectResultList); + } + + /** + * 导出物资类型管理列表 + */ + @ApiOperation(value = "导出物资类型列表") + @PreventRepeatSubmit + @RequiresPermissions("ma:type:export") + @SysLog(title = "物资类型管理", businessType = OperaType.EXPORT, module = "仓储管理->导出物资类型") + @PostMapping("/export") + public void export(HttpServletResponse response, Type type) { + List list = typeService.selectTypeList(type); + ExcelUtil util = new ExcelUtil(Type.class); + util.exportExcel(response, list, "物资类型管理数据"); + } + + /** + * 获取物资类型管理详细信息 + */ + @ApiOperation(value = "获取物资类型详细信息") @RequiresPermissions("ma:type:query") @GetMapping(value = "/{typeId}") - public AjaxResult getInfo(@PathVariable("typeId") Long typeId) - { + public AjaxResult getInfo(@PathVariable("typeId") Long typeId) { return success(typeService.selectTypeByTypeId(typeId)); } /** - * 新增机具类型管理 + * 新增物资类型管理 */ - @ApiOperation(value = "新增机具类型管理") + @ApiOperation(value = "新增物资类型") @PreventRepeatSubmit @RequiresPermissions("ma:type:add") - @SysLog(title = "机具类型管理", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增机具类型管理") + @SysLog(title = "物资类型管理", businessType = OperaType.INSERT, module = "仓储管理->新增物资类型") @PostMapping - public AjaxResult add(@RequestBody Type type) - { + public AjaxResult add(@RequestBody Type type) { return toAjax(typeService.insertType(type)); } /** - * 修改机具类型管理 + * 修改物资类型管理 */ - @ApiOperation(value = "修改机具类型管理") + @ApiOperation(value = "修改物资类型") @PreventRepeatSubmit @RequiresPermissions("ma:type:edit") - @SysLog(title = "机具类型管理", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改机具类型管理") + @SysLog(title = "物资类型管理", businessType = OperaType.UPDATE, module = "仓储管理->修改物资类型") @PutMapping - public AjaxResult edit(@RequestBody Type type) - { + public AjaxResult edit(@RequestBody Type type) { return toAjax(typeService.updateType(type)); } /** - * 删除机具类型管理 + * 删除物资类型管理 */ - @ApiOperation(value = "删除机具类型管理") + @ApiOperation(value = "删除物资类型") @PreventRepeatSubmit @RequiresPermissions("ma:type:remove") - @SysLog(title = "机具类型管理", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除机具类型管理") + @SysLog(title = "物资类型管理", businessType = OperaType.DELETE, module = "仓储管理->删除物资类型") @DeleteMapping("/{typeIds}") - public AjaxResult remove(@PathVariable Long[] typeIds) - { + public AjaxResult remove(@PathVariable Long[] typeIds) { return toAjax(typeService.deleteTypeByTypeIds(typeIds)); } } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeKeeperController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeKeeperController.java index d719aff8..b328de4f 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeKeeperController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeKeeperController.java @@ -26,15 +26,13 @@ import com.bonus.common.core.web.page.TableDataInfo; /** * 库管员配置Controller - * - * @author xsheng - * @date 2024-09-27 + * @author bonus */ @Api(tags = "库管员配置接口") @RestController @RequestMapping("/ma_type_keeper") -public class TypeKeeperController extends BaseController -{ +public class TypeKeeperController extends BaseController { + @Autowired private ITypeKeeperService typeKeeperService; @@ -44,8 +42,7 @@ public class TypeKeeperController extends BaseController @ApiOperation(value = "查询库管员配置列表") @RequiresPermissions("ma:keeper:list") @GetMapping("/list") - public TableDataInfo list(TypeKeeper typeKeeper) - { + public TableDataInfo list(TypeKeeper typeKeeper) { startPage(); List list = typeKeeperService.selectTypeKeeperList(typeKeeper); return getDataTable(list); @@ -57,10 +54,9 @@ public class TypeKeeperController extends BaseController @ApiOperation(value = "导出库管员配置列表") @PreventRepeatSubmit @RequiresPermissions("ma:keeper:export") - @SysLog(title = "库管员配置", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出库管员配置") + @SysLog(title = "库管员配置", businessType = OperaType.EXPORT, module = "仓储管理->导出库管员配置") @PostMapping("/export") - public void export(HttpServletResponse response, TypeKeeper typeKeeper) - { + public void export(HttpServletResponse response, TypeKeeper typeKeeper) { List list = typeKeeperService.selectTypeKeeperList(typeKeeper); ExcelUtil util = new ExcelUtil(TypeKeeper.class); util.exportExcel(response, list, "库管员配置数据"); @@ -72,8 +68,7 @@ public class TypeKeeperController extends BaseController @ApiOperation(value = "获取库管员配置详细信息") @RequiresPermissions("ma:keeper:query") @GetMapping(value = "/{ID}") - public AjaxResult getInfo(@PathVariable("ID") Long ID) - { + public AjaxResult getInfo(@PathVariable("ID") Long ID) { return success(typeKeeperService.selectTypeKeeperByID(ID)); } @@ -83,10 +78,9 @@ public class TypeKeeperController extends BaseController @ApiOperation(value = "新增库管员配置") @PreventRepeatSubmit @RequiresPermissions("ma:keeper:add") - @SysLog(title = "库管员配置", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增库管员配置") + @SysLog(title = "库管员配置", businessType = OperaType.INSERT, module = "仓储管理->新增库管员配置") @PostMapping - public AjaxResult add(@RequestBody TypeKeeper typeKeeper) - { + public AjaxResult add(@RequestBody TypeKeeper typeKeeper) { return toAjax(typeKeeperService.insertTypeKeeper(typeKeeper)); } @@ -96,10 +90,9 @@ public class TypeKeeperController extends BaseController @ApiOperation(value = "修改库管员配置") @PreventRepeatSubmit @RequiresPermissions("ma:keeper:edit") - @SysLog(title = "库管员配置", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改库管员配置") + @SysLog(title = "库管员配置", businessType = OperaType.UPDATE, module = "仓储管理->修改库管员配置") @PutMapping - public AjaxResult edit(@RequestBody TypeKeeper typeKeeper) - { + public AjaxResult edit(@RequestBody TypeKeeper typeKeeper) { return toAjax(typeKeeperService.updateTypeKeeper(typeKeeper)); } @@ -109,7 +102,7 @@ public class TypeKeeperController extends BaseController @ApiOperation(value = "删除库管员配置") @PreventRepeatSubmit @RequiresPermissions("ma:keeper:remove") - @SysLog(title = "库管员配置", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除库管员配置") + @SysLog(title = "库管员配置", businessType = OperaType.DELETE, module = "仓储管理->删除库管员配置") @DeleteMapping("/{IDs}") public AjaxResult remove(@PathVariable Long[] IDs) { diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/SupplierInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/SupplierInfo.java index 4c820e6e..71f67ca1 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/SupplierInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/SupplierInfo.java @@ -3,24 +3,24 @@ package com.bonus.material.ma.domain; import com.bonus.common.core.annotation.Excel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.ToString; import com.bonus.common.core.web.domain.BaseEntity; /** - * 供应商管理对象 ma_supplier_info - * - * @author xsheng - * @date 2024-09-27 + * 物资厂家管理对象 ma_supplier_info + * @author bonus */ +@EqualsAndHashCode(callSuper = false) @Data @ToString -public class SupplierInfo extends BaseEntity -{ - private static final long serialVersionUID = 1L; +public class SupplierInfo extends BaseEntity { - /** 仓库ID */ + private static final long serialVersionUID = 1720446126255482527L; + + /** 厂家ID */ private Long supplierId; /** 名称 */ diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Type.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Type.java index 9a9c07ce..6de6e0c2 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Type.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Type.java @@ -1,26 +1,28 @@ package com.bonus.material.ma.domain; import java.math.BigDecimal; +import java.util.ArrayList; import java.util.Date; +import java.util.List; + import com.fasterxml.jackson.annotation.JsonFormat; import com.bonus.common.core.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonInclude; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.ToString; import com.bonus.common.core.web.domain.BaseEntity; /** - * 机具类型管理对象 ma_type - * - * @author xsheng - * @date 2024-09-27 + * 物资类型对象 ma_type + * @author syruan */ - - +@EqualsAndHashCode(callSuper = false) @Data @ToString -public class Type extends BaseEntity -{ +public class Type extends BaseEntity { + private static final long serialVersionUID = 1L; /** 类型ID */ @@ -134,5 +136,8 @@ public class Type extends BaseEntity @ApiModelProperty(value = "推送智慧工程定义的门类分类机具编码") private String intelligentCode; + /** 子节点 */ + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private List children = new ArrayList<>(); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/TypeKeeper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/TypeKeeper.java index 3bf63608..660b4187 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/TypeKeeper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/TypeKeeper.java @@ -3,22 +3,20 @@ package com.bonus.material.ma.domain; import com.bonus.common.core.annotation.Excel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.ToString; import com.bonus.common.core.web.domain.BaseEntity; /** * 库管员配置对象 ma_type_keeper - * - * @author xsheng - * @date 2024-09-27 */ - +@EqualsAndHashCode(callSuper = false) @Data @ToString -public class TypeKeeper extends BaseEntity -{ - private static final long serialVersionUID = 1L; +public class TypeKeeper extends BaseEntity { + + private static final long serialVersionUID = -5333521595576336827L; /** 主键ID */ private Long ID; @@ -27,10 +25,17 @@ public class TypeKeeper extends BaseEntity private Long typeId; /** 用户 */ - @Excel(name = "用户") - @ApiModelProperty(value = "用户") + @Excel(name = "用户ID") + @ApiModelProperty(value = "用户ID") private Long userId; + /** + * 用户名称 + */ + @Excel(name = "用户名称") + @ApiModelProperty(value = "用户名称") + private String userName; + /** 数据所属组织 */ @Excel(name = "数据所属组织") @ApiModelProperty(value = "数据所属组织") diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/PartRepairMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/PartRepairMapper.java index 830682a4..f5db8b41 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/PartRepairMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/PartRepairMapper.java @@ -5,12 +5,11 @@ import com.bonus.material.ma.domain.PartRepair; /** * 维修班配件配置Mapper接口 - * + * * @author xsheng * @date 2024-09-27 */ -public interface PartRepairMapper -{ +public interface PartRepairMapper { /** * 查询维修班配件配置 * diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/SupplierInfoMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/SupplierInfoMapper.java index 5c5b03e6..63cdc5b1 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/SupplierInfoMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/SupplierInfoMapper.java @@ -4,58 +4,55 @@ import java.util.List; import com.bonus.material.ma.domain.SupplierInfo; /** - * 供应商管理Mapper接口 - * - * @author xsheng - * @date 2024-09-27 + * 物资厂家管理Mapper接口 + * @author syruan */ -public interface SupplierInfoMapper -{ +public interface SupplierInfoMapper { /** - * 查询供应商管理 + * 根据id查询物资厂家 * - * @param supplierId 供应商管理主键 - * @return 供应商管理 + * @param supplierId 物资厂家管理主键 + * @return 物资厂家管理 */ - public SupplierInfo selectSupplierInfoBySupplierId(Long supplierId); + SupplierInfo selectSupplierInfoBySupplierId(Long supplierId); /** - * 查询供应商管理列表 + * 查询物资厂家管理列表 * - * @param supplierInfo 供应商管理 - * @return 供应商管理集合 + * @param supplierInfo 物资厂家管理 + * @return 物资厂家管理集合 */ - public List selectSupplierInfoList(SupplierInfo supplierInfo); + List selectSupplierInfoList(SupplierInfo supplierInfo); /** - * 新增供应商管理 + * 新增物资厂家 * - * @param supplierInfo 供应商管理 + * @param supplierInfo 物资厂家管理 * @return 结果 */ - public int insertSupplierInfo(SupplierInfo supplierInfo); + int insertSupplierInfo(SupplierInfo supplierInfo); /** - * 修改供应商管理 + * 修改物资厂家 * - * @param supplierInfo 供应商管理 + * @param supplierInfo 物资厂家管理 * @return 结果 */ - public int updateSupplierInfo(SupplierInfo supplierInfo); + int updateSupplierInfo(SupplierInfo supplierInfo); /** - * 删除供应商管理 + * 删除物资厂家 * - * @param supplierId 供应商管理主键 + * @param supplierId 物资厂家管理主键 * @return 结果 */ - public int deleteSupplierInfoBySupplierId(Long supplierId); + int deleteSupplierInfoBySupplierId(Long supplierId); /** - * 批量删除供应商管理 + * 批量删除物资厂家 * * @param supplierIds 需要删除的数据主键集合 * @return 结果 */ - public int deleteSupplierInfoBySupplierIds(Long[] supplierIds); + int deleteSupplierInfoBySupplierIds(Long[] supplierIds); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/TypeKeeperMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/TypeKeeperMapper.java index 1273e086..4dc372fd 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/TypeKeeperMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/TypeKeeperMapper.java @@ -2,22 +2,20 @@ package com.bonus.material.ma.mapper; import java.util.List; import com.bonus.material.ma.domain.TypeKeeper; +import org.apache.ibatis.annotations.Mapper; /** * 库管员配置Mapper接口 - * - * @author xsheng - * @date 2024-09-27 */ -public interface TypeKeeperMapper -{ +@Mapper +public interface TypeKeeperMapper { /** * 查询库管员配置 * * @param ID 库管员配置主键 * @return 库管员配置 */ - public TypeKeeper selectTypeKeeperByID(Long ID); + TypeKeeper selectTypeKeeperByID(Long ID); /** * 查询库管员配置列表 @@ -25,7 +23,7 @@ public interface TypeKeeperMapper * @param typeKeeper 库管员配置 * @return 库管员配置集合 */ - public List selectTypeKeeperList(TypeKeeper typeKeeper); + List selectTypeKeeperList(TypeKeeper typeKeeper); /** * 新增库管员配置 @@ -33,7 +31,7 @@ public interface TypeKeeperMapper * @param typeKeeper 库管员配置 * @return 结果 */ - public int insertTypeKeeper(TypeKeeper typeKeeper); + int insertTypeKeeper(TypeKeeper typeKeeper); /** * 修改库管员配置 @@ -41,7 +39,7 @@ public interface TypeKeeperMapper * @param typeKeeper 库管员配置 * @return 结果 */ - public int updateTypeKeeper(TypeKeeper typeKeeper); + int updateTypeKeeper(TypeKeeper typeKeeper); /** * 删除库管员配置 @@ -49,7 +47,7 @@ public interface TypeKeeperMapper * @param ID 库管员配置主键 * @return 结果 */ - public int deleteTypeKeeperByID(Long ID); + int deleteTypeKeeperByID(Long ID); /** * 批量删除库管员配置 @@ -57,5 +55,5 @@ public interface TypeKeeperMapper * @param IDs 需要删除的数据主键集合 * @return 结果 */ - public int deleteTypeKeeperByIDs(Long[] IDs); + int deleteTypeKeeperByIDs(Long[] IDs); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/TypeMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/TypeMapper.java index 68b10f46..30af360e 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/TypeMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/TypeMapper.java @@ -2,60 +2,107 @@ package com.bonus.material.ma.mapper; import java.util.List; import com.bonus.material.ma.domain.Type; +import com.bonus.material.ma.vo.MaTypeListVo; +import com.bonus.material.ma.vo.MaTypeSelectVo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** - * 机具类型管理Mapper接口 - * - * @author xsheng - * @date 2024-09-27 + * 物资类型Mapper接口 + * @author syruan */ -public interface TypeMapper -{ +@Mapper +public interface TypeMapper { /** - * 查询机具类型管理 + * 查询物资类型 * - * @param typeId 机具类型管理主键 - * @return 机具类型管理 + * @param typeId 物资类型主键 + * @return 物资类型 */ - public Type selectTypeByTypeId(Long typeId); + Type selectTypeByTypeId(Long typeId); /** - * 查询机具类型管理列表 - * - * @param type 机具类型管理 - * @return 机具类型管理集合 + * 根据level层级和typeID 查询父级ID + * @param typeId 物资类型主键 + * @param level 类型层级 */ - public List selectTypeList(Type type); + List selectParentId( @Param("typeId")Long typeId, @Param("level")Integer level); /** - * 新增机具类型管理 + * 根据物资仓库的ID查询物资类型列表 + * @param houseId 物资仓库ID + */ + List selectMaTypeListByHouseId(Long houseId); + + List getListByTypeName(@Param("typeId") Long typeId, @Param("typeName") String typeName); + + /** + * 查询物资类型下拉树结构--根据上级ID + * @param parentId 父级ID + */ + List getMaTypeSelectVoListByParentId(@Param("parentId") Long parentId); + + /** + * 物资类型树形结构 + * @param level 排除层级 + */ + List selectMaTypeTree(@Param("level") Integer level); + + /** + * 查询物资类型列表 * - * @param type 机具类型管理 + * @param type 物资类型 + * @return 物资类型集合 + */ + List selectTypeList(Type type); + + + /** + * 查询物资类型列表 -- 并且查询当前节点的父级节点名称 + * + * @param typeListVo 物资类型 + * @return 物资类型集合 + */ + List selectTypeListAndParent(Type typeListVo); + + + /** + * 新增物资类型 + * + * @param type 物资类型 * @return 结果 */ - public int insertType(Type type); + int insertType(Type type); /** - * 修改机具类型管理 + * 修改物资类型 * - * @param type 机具类型管理 + * @param type 物资类型 * @return 结果 */ - public int updateType(Type type); + int updateType(Type type); /** - * 删除机具类型管理 + * 删除物资类型 -- 真实删除 * - * @param typeId 机具类型管理主键 + * @param typeId 物资类型主键 * @return 结果 */ - public int deleteTypeByTypeId(Long typeId); + int deleteTypeByTypeId(Long typeId); /** - * 批量删除机具类型管理 + * 删除物资类型 -- 逻辑删除 + * + * @param typeId 物资类型主键 + * @return 结果 + */ + int logicDeleteTypeByTypeId(Long typeId); + + /** + * 批量删除物资类型 -- 逻辑删除 * * @param typeIds 需要删除的数据主键集合 * @return 结果 */ - public int deleteTypeByTypeIds(Long[] typeIds); + int logicDeleteTypeByTypeIds(Long[] typeIds); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ISupplierInfoService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ISupplierInfoService.java index a9ef72f6..3226fe8d 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ISupplierInfoService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ISupplierInfoService.java @@ -4,58 +4,56 @@ import java.util.List; import com.bonus.material.ma.domain.SupplierInfo; /** - * 供应商管理Service接口 + * 物资厂家管理Service接口 * - * @author xsheng - * @date 2024-09-27 + * @author bonus */ -public interface ISupplierInfoService -{ +public interface ISupplierInfoService { /** - * 查询供应商管理 + * 查询物资厂家管理 * - * @param supplierId 供应商管理主键 - * @return 供应商管理 + * @param supplierId 物资厂家管理主键 + * @return 物资厂家管理 */ - public SupplierInfo selectSupplierInfoBySupplierId(Long supplierId); + SupplierInfo selectSupplierInfoBySupplierId(Long supplierId); /** - * 查询供应商管理列表 + * 查询物资厂家管理列表 * - * @param supplierInfo 供应商管理 - * @return 供应商管理集合 + * @param supplierInfo 物资厂家管理 + * @return 物资厂家管理集合 */ - public List selectSupplierInfoList(SupplierInfo supplierInfo); + List selectSupplierInfoList(SupplierInfo supplierInfo); /** - * 新增供应商管理 + * 新增物资厂家管理 * - * @param supplierInfo 供应商管理 + * @param supplierInfo 物资厂家管理 * @return 结果 */ - public int insertSupplierInfo(SupplierInfo supplierInfo); + int insertSupplierInfo(SupplierInfo supplierInfo); /** - * 修改供应商管理 + * 修改物资厂家管理 * - * @param supplierInfo 供应商管理 + * @param supplierInfo 物资厂家管理 * @return 结果 */ - public int updateSupplierInfo(SupplierInfo supplierInfo); + int updateSupplierInfo(SupplierInfo supplierInfo); /** - * 批量删除供应商管理 + * 批量删除物资厂家管理 * - * @param supplierIds 需要删除的供应商管理主键集合 + * @param supplierIds 需要删除的物资厂家管理主键集合 * @return 结果 */ - public int deleteSupplierInfoBySupplierIds(Long[] supplierIds); + int deleteSupplierInfoBySupplierIds(Long[] supplierIds); /** - * 删除供应商管理信息 + * 删除物资厂家管理信息 * - * @param supplierId 供应商管理主键 + * @param supplierId 物资厂家管理主键 * @return 结果 */ - public int deleteSupplierInfoBySupplierId(Long supplierId); + int deleteSupplierInfoBySupplierId(Long supplierId); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ITypeKeeperService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ITypeKeeperService.java index 39a73c7a..701e600f 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ITypeKeeperService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ITypeKeeperService.java @@ -5,19 +5,15 @@ import com.bonus.material.ma.domain.TypeKeeper; /** * 库管员配置Service接口 - * - * @author xsheng - * @date 2024-09-27 */ -public interface ITypeKeeperService -{ +public interface ITypeKeeperService { /** * 查询库管员配置 * * @param ID 库管员配置主键 * @return 库管员配置 */ - public TypeKeeper selectTypeKeeperByID(Long ID); + TypeKeeper selectTypeKeeperByID(Long ID); /** * 查询库管员配置列表 @@ -25,7 +21,7 @@ public interface ITypeKeeperService * @param typeKeeper 库管员配置 * @return 库管员配置集合 */ - public List selectTypeKeeperList(TypeKeeper typeKeeper); + List selectTypeKeeperList(TypeKeeper typeKeeper); /** * 新增库管员配置 @@ -33,7 +29,7 @@ public interface ITypeKeeperService * @param typeKeeper 库管员配置 * @return 结果 */ - public int insertTypeKeeper(TypeKeeper typeKeeper); + int insertTypeKeeper(TypeKeeper typeKeeper); /** * 修改库管员配置 @@ -41,7 +37,7 @@ public interface ITypeKeeperService * @param typeKeeper 库管员配置 * @return 结果 */ - public int updateTypeKeeper(TypeKeeper typeKeeper); + int updateTypeKeeper(TypeKeeper typeKeeper); /** * 批量删除库管员配置 @@ -49,7 +45,7 @@ public interface ITypeKeeperService * @param IDs 需要删除的库管员配置主键集合 * @return 结果 */ - public int deleteTypeKeeperByIDs(Long[] IDs); + int deleteTypeKeeperByIDs(Long[] IDs); /** * 删除库管员配置信息 @@ -57,5 +53,5 @@ public interface ITypeKeeperService * @param ID 库管员配置主键 * @return 结果 */ - public int deleteTypeKeeperByID(Long ID); + int deleteTypeKeeperByID(Long ID); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ITypeService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ITypeService.java index 3420fdf5..6ea729cc 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ITypeService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ITypeService.java @@ -1,61 +1,86 @@ package com.bonus.material.ma.service; import java.util.List; + +import com.bonus.common.biz.domain.TreeSelect; import com.bonus.material.ma.domain.Type; +import com.bonus.material.ma.vo.MaTypeListVo; +import com.bonus.material.ma.vo.MaTypeSelectVo; /** - * 机具类型管理Service接口 - * - * @author xsheng - * @date 2024-09-27 + * 物资类型Service接口 + * @author syruan */ -public interface ITypeService -{ +public interface ITypeService { /** - * 查询机具类型管理 + * 查询物资类型 * - * @param typeId 机具类型管理主键 - * @return 机具类型管理 + * @param typeId 物资类型主键 + * @return 物资类型 */ - public Type selectTypeByTypeId(Long typeId); + Type selectTypeByTypeId(Long typeId); + + List selectParentId(Long typeId, Integer level); + + List selectMaTypeListByHouseId(Long houseId); + + List getListByParentId(Long typeId, String typeName); /** - * 查询机具类型管理列表 - * - * @param type 机具类型管理 - * @return 机具类型管理集合 + * 查询物资类型下拉树结构--根据上级ID + * @param parentId 父级id */ - public List selectTypeList(Type type); + List getMaTypeSelectVoListByParentId(Long parentId); /** - * 新增机具类型管理 + * 查询物资类型列表 * - * @param type 机具类型管理 + * @param type 物资类型 + * @return 物资类型集合 + */ + List selectTypeList(Type type); + + List selectTypeListAndParent(Type type); + + /** + * 新增物资类型 + * + * @param type 物资类型 * @return 结果 */ - public int insertType(Type type); + int insertType(Type type); /** - * 修改机具类型管理 + * 修改物资类型 * - * @param type 机具类型管理 + * @param type 物资类型 * @return 结果 */ - public int updateType(Type type); + int updateType(Type type); /** - * 批量删除机具类型管理 + * 批量删除物资类型 * - * @param typeIds 需要删除的机具类型管理主键集合 + * @param typeIds 需要删除的物资类型主键集合 * @return 结果 */ - public int deleteTypeByTypeIds(Long[] typeIds); + int deleteTypeByTypeIds(Long[] typeIds); /** - * 删除机具类型管理信息 + * 删除物资类型信息 * - * @param typeId 机具类型管理主键 + * @param typeId 物资类型主键 * @return 结果 */ - public int deleteTypeByTypeId(Long typeId); + int deleteTypeByTypeId(Long typeId); + + List getMaTypeTree(String typeName, String parentId); + + /** + * 构建前端所需要树结构 + * + * @param maTypeList 状态列表 + * @return 树结构列表 + */ + List buildMaTypeTree(List maTypeList); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/SupplierInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/SupplierInfoServiceImpl.java index 47bfc76b..ba057dfe 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/SupplierInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/SupplierInfoServiceImpl.java @@ -8,89 +8,83 @@ import com.bonus.material.ma.mapper.SupplierInfoMapper; import com.bonus.material.ma.domain.SupplierInfo; import com.bonus.material.ma.service.ISupplierInfoService; +import javax.annotation.Resource; + /** - * 供应商管理Service业务层处理 + * 物资厂家管理Service业务层处理 * - * @author xsheng - * @date 2024-09-27 + * @author bonus */ @Service -public class SupplierInfoServiceImpl implements ISupplierInfoService -{ - @Autowired +public class SupplierInfoServiceImpl implements ISupplierInfoService { + @Resource private SupplierInfoMapper supplierInfoMapper; /** - * 查询供应商管理 + * 查询物资厂家管理 * - * @param supplierId 供应商管理主键 - * @return 供应商管理 + * @param supplierId 物资厂家管理主键 + * @return 物资厂家管理 */ @Override - public SupplierInfo selectSupplierInfoBySupplierId(Long supplierId) - { + public SupplierInfo selectSupplierInfoBySupplierId(Long supplierId) { return supplierInfoMapper.selectSupplierInfoBySupplierId(supplierId); } /** - * 查询供应商管理列表 + * 查询物资厂家管理列表 * - * @param supplierInfo 供应商管理 - * @return 供应商管理 + * @param supplierInfo 物资厂家管理 + * @return 物资厂家管理 */ @Override - public List selectSupplierInfoList(SupplierInfo supplierInfo) - { + public List selectSupplierInfoList(SupplierInfo supplierInfo) { return supplierInfoMapper.selectSupplierInfoList(supplierInfo); } /** - * 新增供应商管理 + * 新增物资厂家管理 * - * @param supplierInfo 供应商管理 + * @param supplierInfo 物资厂家管理 * @return 结果 */ @Override - public int insertSupplierInfo(SupplierInfo supplierInfo) - { + public int insertSupplierInfo(SupplierInfo supplierInfo) { supplierInfo.setCreateTime(DateUtils.getNowDate()); return supplierInfoMapper.insertSupplierInfo(supplierInfo); } /** - * 修改供应商管理 + * 修改物资厂家管理 * - * @param supplierInfo 供应商管理 + * @param supplierInfo 物资厂家管理 * @return 结果 */ @Override - public int updateSupplierInfo(SupplierInfo supplierInfo) - { + public int updateSupplierInfo(SupplierInfo supplierInfo) { supplierInfo.setUpdateTime(DateUtils.getNowDate()); return supplierInfoMapper.updateSupplierInfo(supplierInfo); } /** - * 批量删除供应商管理 + * 批量删除物资厂家管理 * - * @param supplierIds 需要删除的供应商管理主键 + * @param supplierIds 需要删除的物资厂家管理主键 * @return 结果 */ @Override - public int deleteSupplierInfoBySupplierIds(Long[] supplierIds) - { + public int deleteSupplierInfoBySupplierIds(Long[] supplierIds) { return supplierInfoMapper.deleteSupplierInfoBySupplierIds(supplierIds); } /** - * 删除供应商管理信息 + * 删除物资厂家管理信息 * - * @param supplierId 供应商管理主键 + * @param supplierId 物资厂家管理主键 * @return 结果 */ @Override - public int deleteSupplierInfoBySupplierId(Long supplierId) - { + public int deleteSupplierInfoBySupplierId(Long supplierId) { return supplierInfoMapper.deleteSupplierInfoBySupplierId(supplierId); } } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeKeeperServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeKeeperServiceImpl.java index 11e4155b..0da9dd02 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeKeeperServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeKeeperServiceImpl.java @@ -15,8 +15,8 @@ import com.bonus.material.ma.service.ITypeKeeperService; * @date 2024-09-27 */ @Service -public class TypeKeeperServiceImpl implements ITypeKeeperService -{ +public class TypeKeeperServiceImpl implements ITypeKeeperService { + @Autowired private TypeKeeperMapper typeKeeperMapper; @@ -27,8 +27,7 @@ public class TypeKeeperServiceImpl implements ITypeKeeperService * @return 库管员配置 */ @Override - public TypeKeeper selectTypeKeeperByID(Long ID) - { + public TypeKeeper selectTypeKeeperByID(Long ID) { return typeKeeperMapper.selectTypeKeeperByID(ID); } @@ -39,8 +38,7 @@ public class TypeKeeperServiceImpl implements ITypeKeeperService * @return 库管员配置 */ @Override - public List selectTypeKeeperList(TypeKeeper typeKeeper) - { + public List selectTypeKeeperList(TypeKeeper typeKeeper) { return typeKeeperMapper.selectTypeKeeperList(typeKeeper); } @@ -51,8 +49,7 @@ public class TypeKeeperServiceImpl implements ITypeKeeperService * @return 结果 */ @Override - public int insertTypeKeeper(TypeKeeper typeKeeper) - { + public int insertTypeKeeper(TypeKeeper typeKeeper) { typeKeeper.setCreateTime(DateUtils.getNowDate()); return typeKeeperMapper.insertTypeKeeper(typeKeeper); } @@ -64,8 +61,7 @@ public class TypeKeeperServiceImpl implements ITypeKeeperService * @return 结果 */ @Override - public int updateTypeKeeper(TypeKeeper typeKeeper) - { + public int updateTypeKeeper(TypeKeeper typeKeeper) { typeKeeper.setUpdateTime(DateUtils.getNowDate()); return typeKeeperMapper.updateTypeKeeper(typeKeeper); } @@ -77,8 +73,7 @@ public class TypeKeeperServiceImpl implements ITypeKeeperService * @return 结果 */ @Override - public int deleteTypeKeeperByIDs(Long[] IDs) - { + public int deleteTypeKeeperByIDs(Long[] IDs) { return typeKeeperMapper.deleteTypeKeeperByIDs(IDs); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java index 7dc5cb9f..2057fa68 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java @@ -1,96 +1,291 @@ package com.bonus.material.ma.service.impl; +import java.util.ArrayList; import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +import com.bonus.common.biz.domain.TreeSelect; +import com.bonus.common.biz.enums.DataCodeEnum; import com.bonus.common.core.utils.DateUtils; -import org.springframework.beans.factory.annotation.Autowired; +import com.bonus.common.core.utils.StringUtils; +import com.bonus.material.ma.vo.MaTypeListVo; +import com.bonus.material.ma.vo.MaTypeSelectVo; import org.springframework.stereotype.Service; import com.bonus.material.ma.mapper.TypeMapper; import com.bonus.material.ma.domain.Type; import com.bonus.material.ma.service.ITypeService; +import javax.annotation.Resource; + /** - * 机具类型管理Service业务层处理 - * - * @author xsheng - * @date 2024-09-27 + * 物资类型管理Service业务层实现 + * @author syruan */ @Service -public class TypeServiceImpl implements ITypeService -{ - @Autowired +public class TypeServiceImpl implements ITypeService { + + /** + * 物资类型管理树最小级别 + */ + public static final Integer TYPE_MIN_LEVEL = 4; + + @Resource private TypeMapper typeMapper; /** - * 查询机具类型管理 + * 查询物资类型 -- 根据id * - * @param typeId 机具类型管理主键 - * @return 机具类型管理 + * @param typeId 物资类型管理主键 */ @Override - public Type selectTypeByTypeId(Long typeId) - { + public Type selectTypeByTypeId(Long typeId) { return typeMapper.selectTypeByTypeId(typeId); } + @Override + public List selectParentId(Long typeId, Integer level) { + return typeMapper.selectParentId(typeId, level); + } + + @Override + public List selectMaTypeListByHouseId(Long houseId) { + return typeMapper.selectMaTypeListByHouseId(houseId); + } + /** - * 查询机具类型管理列表 - * - * @param type 机具类型管理 - * @return 机具类型管理 + * 根据组织树parent_id查询结果 + * + * @param typeId 父级id + * @param typeName 名称筛选 */ @Override - public List selectTypeList(Type type) - { + public List getListByParentId(Long typeId, String typeName) { + return typeMapper.getListByTypeName(typeId, typeName); + } + + @Override + public List getMaTypeSelectVoListByParentId(Long parentId) { + return typeMapper.getMaTypeSelectVoListByParentId(parentId); + } + + /** + * 查询物资类型管理列表 + * + * @param type 物资类型管理 + * @return 物资类型管理 + */ + @Override + public List selectTypeList(Type type) { + if (type != null ) { + if (type.getDelFlag() == null || type.getDelFlag().isEmpty()) { + // 如果没赋值,则默认查询正常数据状态 + type.setDelFlag(String.valueOf(DataCodeEnum.NORMAL.getCode())); + } + // 如果是顶级节点,则查询所有子节点 + if ("0".equals(type.getLevel())) { + type.setLevel(null); + } + } return typeMapper.selectTypeList(type); } /** - * 新增机具类型管理 + * 查询物资类型管理列表 -- 并获取父级信息 + * + * @param type 物资类型管理 + * @return 物资类型管理 + */ + @Override + public List selectTypeListAndParent(Type type) { + // 如果是顶级节点,则查询所有子节点 + if (type != null && type.getLevel() != null && "0".equals(type.getLevel())) { + type.setLevel(null); + } + + // 拿到数据要处理一下上级信息 + List maTypeListVos; + try { + maTypeListVos = typeMapper.selectTypeListAndParent(type); + } catch (Exception e) { + throw new RuntimeException(e.getMessage()); + } + + // 检查Mapper集合 + if (maTypeListVos == null || maTypeListVos.isEmpty()) { + return new ArrayList<>(); + } + + + for (MaTypeListVo maTypeListVo : maTypeListVos) { + // ------------ 检查 ----------- + + // object对象是空的,忽略处理 + if (maTypeListVo == null) { + continue; + } + // 没有上级就不需要处理,或者level等级不清晰的也不进行处理 + if (maTypeListVo.getParentId() == null || maTypeListVo.getLevel() == null) { + continue; + } + // 1级节点已经是顶级,无上级,所以不需要处理 + if ("1".equals(maTypeListVo.getLevel())) { + continue; + } + // ------------ 检查结束 ----------- + + + // 进行数据处理 + switch (maTypeListVo.getLevel()) { + case "2": + // 二级节点父级是一级节点,所以要拿到父节点名称,并赋值至ONE_LEVEL_NAME字段 + maTypeListVo.setParentOneLevelName(maTypeListVo.getParentThreeLevelName() == null ? "" : maTypeListVo.getParentThreeLevelName()); + break; + case "3": + // 三级节点父级是二级节点和一级节点, 要把祖父类型名称放入一级字段,把父类型名称存入二级字段 + maTypeListVo.setParentOneLevelName(maTypeListVo.getParentTwoLevelName() == null ? "" : maTypeListVo.getParentTwoLevelName()); + maTypeListVo.setParentTwoLevelName(maTypeListVo.getParentThreeLevelName() == null ? "" : maTypeListVo.getParentThreeLevelName()); + break; + case "4": + // 四级节点父级是三级节点和二级节点和一级节点, 要把祖父类型名称放入一级字段,把父类型名称存入二级字段,子类型名称存入三级字段 + // 但因为4级节点内循环3次,已按顺序处理,所以此处无需处理 + break; + } + + } + return maTypeListVos; + } + + /** + * 新增物资类型管理 * - * @param type 机具类型管理 + * @param type 物资类型管理 * @return 结果 */ @Override - public int insertType(Type type) - { + public int insertType(Type type) { type.setCreateTime(DateUtils.getNowDate()); return typeMapper.insertType(type); } /** - * 修改机具类型管理 + * 修改物资类型管理 * - * @param type 机具类型管理 + * @param type 物资类型管理 * @return 结果 */ @Override - public int updateType(Type type) - { + public int updateType(Type type) { type.setUpdateTime(DateUtils.getNowDate()); return typeMapper.updateType(type); } /** - * 批量删除机具类型管理 + * 批量删除物资类型管理 * - * @param typeIds 需要删除的机具类型管理主键 + * @param typeIds 需要删除的物资类型管理主键 * @return 结果 */ @Override - public int deleteTypeByTypeIds(Long[] typeIds) - { - return typeMapper.deleteTypeByTypeIds(typeIds); + public int deleteTypeByTypeIds(Long[] typeIds) { + return typeMapper.logicDeleteTypeByTypeIds(typeIds); } /** - * 删除机具类型管理信息 + * 删除物资类型 * - * @param typeId 机具类型管理主键 + * @param typeId 物资类型管理主键 * @return 结果 */ @Override - public int deleteTypeByTypeId(Long typeId) - { - return typeMapper.deleteTypeByTypeId(typeId); + public int deleteTypeByTypeId(Long typeId) { + return typeMapper.logicDeleteTypeByTypeId(typeId); } + + + @Override + public List getMaTypeTree(String typeName, String parentId) { + List maTypes = typeMapper.selectMaTypeTree(TYPE_MIN_LEVEL); + List builtMaTypeList = buildMaTypeTree(maTypes); + + List treeSelectList = builtMaTypeList.stream() + .filter(Objects::nonNull) + .map(this::convertToTreeSelect) + .collect(Collectors.toList()); + + // 查询顶级节点的仓库配置信息 + + // 如果没有查询到那么返回空 + return treeSelectList; + } + + /** + * 通过构造函数将 Type对象 转换为 TreeSelect -- 并递归处理子节点 + * @param type 要进行转换的object对象 + */ + private TreeSelect convertToTreeSelect(Type type) { + List children = type.getChildren().stream() + .filter(Objects::nonNull) + .map(this::convertToTreeSelect) + .collect(Collectors.toList()); + return new TreeSelect(type.getTypeId(), type.getTypeName(),Integer.valueOf(type.getLevel()),type.getParentId(), children); + } + + /** + * 构建前端所需要树结构 + * + * @param maTypeList 部门列表 + * @return 树结构列表 + */ + @Override + public List buildMaTypeTree(List maTypeList) { + List returnList = new ArrayList(); + List tempList = maTypeList.stream().map(Type::getTypeId).collect(Collectors.toList()); + for (Type maType : maTypeList) { + // 如果是顶级节点, 遍历该父节点的所有子节点 + if (!tempList.contains(maType.getParentId())) { + recursionFn(maTypeList, maType); + returnList.add(maType); + } + } + if (returnList.isEmpty()) { + returnList = maTypeList; + } + return returnList; + } + + /** + * 递归列表 + */ + private void recursionFn(List list, Type t) { + // 得到子节点列表 + List childList = getChildList(list, t); + t.setChildren(childList); + for (Type tChild : childList) { + if (hasChild(list, tChild)) { + recursionFn(list, tChild); + } + } + } + + /** + * 得到子节点列表 + */ + private List getChildList(List list, Type t) { + List tlist = new ArrayList<>(); + for (Type n : list) { + if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getTypeId().longValue()) { + tlist.add(n); + } + } + return tlist; + } + + /** + * 判断是否有子节点 + */ + private boolean hasChild(List list, Type t) { + return !getChildList(list, t).isEmpty(); + } + } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/vo/MaTypeListVo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/vo/MaTypeListVo.java new file mode 100644 index 00000000..377c8c22 --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/vo/MaTypeListVo.java @@ -0,0 +1,26 @@ +package com.bonus.material.ma.vo; + +import com.bonus.material.ma.domain.Type; +import lombok.Getter; +import lombok.Setter; + +/** + * @author : 阮世耀 + * @version : 1.0 + * @PackagePath: com.bonus.material.ma.vo + * @CreateTime: 2024-10-14 17:47 + * @Description: 物资类型列表展示VO + */ +@Getter +@Setter +public class MaTypeListVo extends Type { + + private String parentOneLevelName; + + private String parentTwoLevelName; + + private String parentThreeLevelName; + + private String parentFourLevelName; + +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/vo/MaTypeSelectVo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/vo/MaTypeSelectVo.java new file mode 100644 index 00000000..2e247f91 --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/vo/MaTypeSelectVo.java @@ -0,0 +1,23 @@ +package com.bonus.material.ma.vo; + +import lombok.Data; + +/** + * @author : 阮世耀 + * @version : 1.0 + * @PackagePath: com.bonus.material.ma.vo + * @CreateTime: 2024-10-15 15:39 + * @Description: 物资类型下拉框 + */ +@Data +public class MaTypeSelectVo { + + private Long typeId; + + private String typeName; + + private String parentId; + + private Integer level; + +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/controller/WhHouseInfoController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/controller/WhHouseInfoController.java index b2de6065..a92c19b8 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/controller/WhHouseInfoController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/controller/WhHouseInfoController.java @@ -33,8 +33,8 @@ import com.bonus.common.core.web.page.TableDataInfo; @Api(tags = "仓库管理接口") @RestController @RequestMapping("/wh_house_info") -public class WhHouseInfoController extends BaseController -{ +public class WhHouseInfoController extends BaseController { + @Autowired private IWhHouseInfoService whHouseInfoService; @@ -44,23 +44,32 @@ public class WhHouseInfoController extends BaseController @ApiOperation(value = "查询仓库管理列表") @RequiresPermissions("warehouse:info:list") @GetMapping("/list") - public TableDataInfo list(WhHouseInfo whHouseInfo) - { + public TableDataInfo list(WhHouseInfo whHouseInfo) { startPage(); List list = whHouseInfoService.selectWhHouseInfoList(whHouseInfo); return getDataTable(list); } + /** + * 查询仓库列表 -- 不分页 + */ + @ApiOperation(value = "查询仓库列表--不分页") + @RequiresPermissions("warehouse:info:list") + @GetMapping("/listNoPage") + public AjaxResult listNoPage(WhHouseInfo whHouseInfo) { + List list = whHouseInfoService.selectWhHouseInfoList(whHouseInfo); + return success(list); + } + /** * 导出仓库管理列表 */ @ApiOperation(value = "导出仓库管理列表") @PreventRepeatSubmit @RequiresPermissions("warehouse:info:export") - @SysLog(title = "仓库管理", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出仓库管理") + @SysLog(title = "仓库管理", businessType = OperaType.EXPORT, module = "仓储管理->导出仓库管理") @PostMapping("/export") - public void export(HttpServletResponse response, WhHouseInfo whHouseInfo) - { + public void export(HttpServletResponse response, WhHouseInfo whHouseInfo) { List list = whHouseInfoService.selectWhHouseInfoList(whHouseInfo); ExcelUtil util = new ExcelUtil(WhHouseInfo.class); util.exportExcel(response, list, "仓库管理数据"); @@ -72,8 +81,7 @@ public class WhHouseInfoController extends BaseController @ApiOperation(value = "获取仓库管理详细信息") @RequiresPermissions("warehouse:info:query") @GetMapping(value = "/{houseId}") - public AjaxResult getInfo(@PathVariable("houseId") Long houseId) - { + public AjaxResult getInfo(@PathVariable("houseId") Long houseId) { return success(whHouseInfoService.selectWhHouseInfoByHouseId(houseId)); } @@ -85,8 +93,7 @@ public class WhHouseInfoController extends BaseController @RequiresPermissions("warehouse:info:add") @SysLog(title = "仓库管理", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增仓库管理") @PostMapping - public AjaxResult add(@RequestBody WhHouseInfo whHouseInfo) - { + public AjaxResult add(@RequestBody WhHouseInfo whHouseInfo) { return toAjax(whHouseInfoService.insertWhHouseInfo(whHouseInfo)); } @@ -98,8 +105,7 @@ public class WhHouseInfoController extends BaseController @RequiresPermissions("warehouse:info:edit") @SysLog(title = "仓库管理", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改仓库管理") @PutMapping - public AjaxResult edit(@RequestBody WhHouseInfo whHouseInfo) - { + public AjaxResult edit(@RequestBody WhHouseInfo whHouseInfo) { return toAjax(whHouseInfoService.updateWhHouseInfo(whHouseInfo)); } @@ -109,10 +115,9 @@ public class WhHouseInfoController extends BaseController @ApiOperation(value = "删除仓库管理") @PreventRepeatSubmit @RequiresPermissions("warehouse:info:remove") - @SysLog(title = "仓库管理", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除仓库管理") + @SysLog(title = "仓库管理", businessType = OperaType.DELETE, module = "仓储管理->删除仓库管理") @DeleteMapping("/{houseIds}") - public AjaxResult remove(@PathVariable Long[] houseIds) - { + public AjaxResult remove(@PathVariable Long[] houseIds) { return toAjax(whHouseInfoService.deleteWhHouseInfoByHouseIds(houseIds)); } } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/controller/WhHouseSetController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/controller/WhHouseSetController.java index 36e2f9ee..58f368e9 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/controller/WhHouseSetController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/controller/WhHouseSetController.java @@ -33,8 +33,8 @@ import com.bonus.common.core.web.page.TableDataInfo; @Api(tags = "仓库货架配置接口") @RestController @RequestMapping("/wh_house_set") -public class WhHouseSetController extends BaseController -{ +public class WhHouseSetController extends BaseController { + @Autowired private IWhHouseSetService whHouseSetService; diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/domain/WhHouseInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/domain/WhHouseInfo.java index a80385f0..9e828752 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/domain/WhHouseInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/domain/WhHouseInfo.java @@ -3,22 +3,20 @@ package com.bonus.material.warehouse.domain; import com.bonus.common.core.annotation.Excel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.ToString; import com.bonus.common.core.web.domain.BaseEntity; /** * 仓库管理对象 wh_house_info - * - * @author xsheng - * @date 2024-09-27 + * @author bonus */ - - +@EqualsAndHashCode(callSuper = false) @Data @ToString -public class WhHouseInfo extends BaseEntity -{ - private static final long serialVersionUID = 1L; +public class WhHouseInfo extends BaseEntity { + + private static final long serialVersionUID = -6993602646196064834L; /** 仓库ID */ private Long houseId; @@ -28,6 +26,16 @@ public class WhHouseInfo extends BaseEntity @ApiModelProperty(value = "工程项目名称") private String houseName; + /** 实物库名称 */ + @Excel(name = "实物库名称") + @ApiModelProperty(value = "实物库名称") + private String physicalName; + + /** 仓库地理位置 */ + @Excel(name = "仓库地理位置") + @ApiModelProperty(value = "仓库地址位置") + private String geoLocation; + /** 上级ID */ @Excel(name = "上级ID") @ApiModelProperty(value = "上级ID") @@ -43,11 +51,12 @@ public class WhHouseInfo extends BaseEntity private Long deptId; /** 删除标志(0代表存在 2代表删除) */ + @ApiModelProperty(value = "删除标志(0存在 2代表已删除)") private String delFlag; /** 数据所属组织 */ - @Excel(name = "数据所属组织") - @ApiModelProperty(value = "数据所属组织") + @Excel(name = "所属组织") + @ApiModelProperty(value = "所属组织") private String companyId; /** 排序 */ diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/domain/WhHouseSet.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/domain/WhHouseSet.java index 848eae97..8cef9dd3 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/domain/WhHouseSet.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/domain/WhHouseSet.java @@ -1,11 +1,15 @@ package com.bonus.material.warehouse.domain; +import com.bonus.common.biz.domain.TreeSelect; import com.bonus.common.core.annotation.Excel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.ToString; import com.bonus.common.core.web.domain.BaseEntity; +import java.util.ArrayList; +import java.util.List; + /** * 仓库货架配置对象 wh_house_set * @@ -16,8 +20,8 @@ import com.bonus.common.core.web.domain.BaseEntity; @Data @ToString -public class WhHouseSet extends BaseEntity -{ +public class WhHouseSet extends BaseEntity { + private static final long serialVersionUID = 1L; /** 主键id */ @@ -28,6 +32,10 @@ public class WhHouseSet extends BaseEntity @ApiModelProperty(value = "仓库ID") private Long houseId; + @Excel(name = "仓库名称") + @ApiModelProperty(value = "仓库名称") + private String houseName; + /** 机具类型ID */ @Excel(name = "机具类型ID") @ApiModelProperty(value = "机具类型ID") @@ -65,5 +73,9 @@ public class WhHouseSet extends BaseEntity @ApiModelProperty(value = "货架编号") private String shelfNum; + /** + * 仓库下物资树 + */ + private List treeSelectList = new ArrayList<>(); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/mapper/WhHouseInfoMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/mapper/WhHouseInfoMapper.java index a07ddada..82976b74 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/mapper/WhHouseInfoMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/mapper/WhHouseInfoMapper.java @@ -25,7 +25,7 @@ public interface WhHouseInfoMapper * @param whHouseInfo 仓库管理 * @return 仓库管理集合 */ - public List selectWhHouseInfoList(WhHouseInfo whHouseInfo); + List selectWhHouseInfoList(WhHouseInfo whHouseInfo); /** * 新增仓库管理 diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/mapper/WhHouseSetMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/mapper/WhHouseSetMapper.java index 6d29a8cd..128dae9f 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/mapper/WhHouseSetMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/mapper/WhHouseSetMapper.java @@ -25,7 +25,14 @@ public interface WhHouseSetMapper * @param whHouseSet 仓库货架配置 * @return 仓库货架配置集合 */ - public List selectWhHouseSetList(WhHouseSet whHouseSet); + List selectWhHouseSetList(WhHouseSet whHouseSet); + + + /** + * 根据物资类型id查询机具列表 + * @param typeId 物资类型id + */ + List selectListByMaType(Long typeId); /** * 新增仓库货架配置 diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/service/IWhHouseInfoService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/service/IWhHouseInfoService.java index 56f3c7b7..d0736cd2 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/service/IWhHouseInfoService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/service/IWhHouseInfoService.java @@ -9,15 +9,14 @@ import com.bonus.material.warehouse.domain.WhHouseInfo; * @author xsheng * @date 2024-09-27 */ -public interface IWhHouseInfoService -{ +public interface IWhHouseInfoService { /** * 查询仓库管理 * * @param houseId 仓库管理主键 * @return 仓库管理 */ - public WhHouseInfo selectWhHouseInfoByHouseId(Long houseId); + WhHouseInfo selectWhHouseInfoByHouseId(Long houseId); /** * 查询仓库管理列表 @@ -25,7 +24,7 @@ public interface IWhHouseInfoService * @param whHouseInfo 仓库管理 * @return 仓库管理集合 */ - public List selectWhHouseInfoList(WhHouseInfo whHouseInfo); + List selectWhHouseInfoList(WhHouseInfo whHouseInfo); /** * 新增仓库管理 @@ -33,7 +32,7 @@ public interface IWhHouseInfoService * @param whHouseInfo 仓库管理 * @return 结果 */ - public int insertWhHouseInfo(WhHouseInfo whHouseInfo); + int insertWhHouseInfo(WhHouseInfo whHouseInfo); /** * 修改仓库管理 @@ -41,7 +40,7 @@ public interface IWhHouseInfoService * @param whHouseInfo 仓库管理 * @return 结果 */ - public int updateWhHouseInfo(WhHouseInfo whHouseInfo); + int updateWhHouseInfo(WhHouseInfo whHouseInfo); /** * 批量删除仓库管理 @@ -49,7 +48,7 @@ public interface IWhHouseInfoService * @param houseIds 需要删除的仓库管理主键集合 * @return 结果 */ - public int deleteWhHouseInfoByHouseIds(Long[] houseIds); + int deleteWhHouseInfoByHouseIds(Long[] houseIds); /** * 删除仓库管理信息 @@ -57,5 +56,5 @@ public interface IWhHouseInfoService * @param houseId 仓库管理主键 * @return 结果 */ - public int deleteWhHouseInfoByHouseId(Long houseId); + int deleteWhHouseInfoByHouseId(Long houseId); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/service/IWhHouseSetService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/service/IWhHouseSetService.java index 099d74f6..0d384784 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/service/IWhHouseSetService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/service/IWhHouseSetService.java @@ -27,6 +27,8 @@ public interface IWhHouseSetService */ public List selectWhHouseSetList(WhHouseSet whHouseSet); + List selectListByMaType(Long typeId); + /** * 新增仓库货架配置 * diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/service/impl/WhHouseInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/service/impl/WhHouseInfoServiceImpl.java index 6680527b..09eebf28 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/service/impl/WhHouseInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/service/impl/WhHouseInfoServiceImpl.java @@ -39,8 +39,7 @@ public class WhHouseInfoServiceImpl implements IWhHouseInfoService * @return 仓库管理 */ @Override - public List selectWhHouseInfoList(WhHouseInfo whHouseInfo) - { + public List selectWhHouseInfoList(WhHouseInfo whHouseInfo) { return whHouseInfoMapper.selectWhHouseInfoList(whHouseInfo); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/service/impl/WhHouseSetServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/service/impl/WhHouseSetServiceImpl.java index 9e77c606..dff1857a 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/service/impl/WhHouseSetServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/service/impl/WhHouseSetServiceImpl.java @@ -44,6 +44,14 @@ public class WhHouseSetServiceImpl implements IWhHouseSetService return whHouseSetMapper.selectWhHouseSetList(whHouseSet); } + + @Override + public List selectListByMaType(Long typeId) { + return whHouseSetMapper.selectListByMaType(typeId); + } + ; + + /** * 新增仓库货架配置 * diff --git a/bonus-modules/bonus-material/src/main/resources/bootstrap-sgzb_bns_local.yml b/bonus-modules/bonus-material/src/main/resources/bootstrap-sgzb_bns_local.yml index e0b166ef..be72758f 100644 --- a/bonus-modules/bonus-material/src/main/resources/bootstrap-sgzb_bns_local.yml +++ b/bonus-modules/bonus-material/src/main/resources/bootstrap-sgzb_bns_local.yml @@ -9,12 +9,10 @@ spring: discovery: # 服务注册地址 server-addr: 127.0.0.1:8848 - # namespace: sgzb_bns namespace: sgzb_bns config: # 配置中心地址 server-addr: 127.0.0.1:8848 - # namespace: sgzb_bns namespace: sgzb_bns # 配置文件格式 file-extension: yml diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/SupplierInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/SupplierInfoMapper.xml index dbba8ae6..cc2cae3c 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/SupplierInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/SupplierInfoMapper.xml @@ -38,6 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and business_license = #{businessLicense} and company_id = #{companyId} and status = #{status} + and del_flag = '0' @@ -59,8 +60,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" del_flag, create_by, create_time, - update_by, - update_time, remark, company_id, status, @@ -76,8 +75,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{delFlag}, #{createBy}, #{createTime}, - #{updateBy}, - #{updateTime}, #{remark}, #{companyId}, #{status}, @@ -94,9 +91,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" phone = #{phone}, business_scope = #{businessScope}, business_license = #{businessLicense}, - del_flag = #{delFlag}, - create_by = #{createBy}, - create_time = #{createTime}, update_by = #{updateBy}, update_time = #{updateTime}, remark = #{remark}, @@ -107,11 +101,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from ma_supplier_info where supplier_id = #{supplierId} + update ma_supplier_info set del_flag = 2 where supplier_id = #{supplierId} - delete from ma_supplier_info where supplier_id in + update ma_supplier_info set del_flag = 2 where supplier_id in #{supplierId} diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeKeeperMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeKeeperMapper.xml index 7260d12f..6394a01b 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeKeeperMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeKeeperMapper.xml @@ -52,8 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" type_id = #{typeId}, user_id = #{userId}, - create_time = #{createTime}, - update_time = #{updateTime}, + update_time = #{updateTime}, company_id = #{companyId}, where ID = #{ID} diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml index 8d0ee58c..be58065a 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml @@ -3,6 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + @@ -34,15 +35,54 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - select type_id, type_name, parent_id, storage_num, type_code, model_code, unit_id, manage_type, lease_price, eff_time, rent_price, buy_price, pay_ratio, level, rated_load, test_load, holding_time, warn_num, del_flag, create_by, create_time, update_by, update_time, is_plan, is_ancuo, remark, fac_model, intelligent_code from ma_type + select + type_id, type_name, parent_id, storage_num, type_code, model_code, unit_id, manage_type, lease_price, + eff_time, rent_price, buy_price, pay_ratio, level, rated_load, test_load, holding_time, warn_num, + create_by, create_time, update_by, update_time, is_plan,is_ancuo, remark, fac_model, intelligent_code + from ma_type @@ -69,6 +110,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where type_id = #{typeId} + + insert into ma_type @@ -85,12 +151,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" rent_price, buy_price, pay_ratio, - level, + `level`, rated_load, test_load, holding_time, warn_num, - del_flag, create_by, create_time, update_by, @@ -119,7 +184,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{testLoad}, #{holdingTime}, #{warnNum}, - #{delFlag}, #{createBy}, #{createTime}, #{updateBy}, @@ -147,14 +211,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" rent_price = #{rentPrice}, buy_price = #{buyPrice}, pay_ratio = #{payRatio}, - level = #{level}, + `level` = #{level}, rated_load = #{ratedLoad}, test_load = #{testLoad}, holding_time = #{holdingTime}, warn_num = #{warnNum}, - del_flag = #{delFlag}, - create_by = #{createBy}, - create_time = #{createTime}, update_by = #{updateBy}, update_time = #{updateTime}, is_plan = #{isPlan}, @@ -170,10 +231,104 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" delete from ma_type where type_id = #{typeId} - - delete from ma_type where type_id in + + update ma_type set del_flag = 2 where type_id in #{typeId} + + + update ma_type set del_flag = 2 where type_id = #{typeId,jdbcType=BIGINT} + + + + + + + + + + + \ No newline at end of file diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/warehouse/WhHouseInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/warehouse/WhHouseInfoMapper.xml index 144fe4b6..5c41eadc 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/warehouse/WhHouseInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/warehouse/WhHouseInfoMapper.xml @@ -6,6 +6,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + @@ -22,13 +24,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select house_id, house_name, parent_id, status, dept_id, del_flag, create_by, create_time, update_by, update_time, remark, company_id, sort, concat, phone from wh_house_info + select house_id, house_name, physical_name, geo_location, parent_id, status, dept_id, del_flag, create_by, create_time, update_by, update_time, remark, company_id, sort, concat, phone from wh_house_info + SELECT + mhs.house_id, mhs.type_id, mhs.ma_id, mhs.num, mhs.status, mhs.dept_id, mhs.del_flag, + mhs.create_by, mhs.create_time, mhs.update_by,mhs.update_time,mhs.remark,mhs.company_id,mhi.house_name + from wh_house_set mhs + left join ma_type mt on mt.type_id = mhs.type_id + left join ma_type mt1 on mt.parent_id = mt1.type_id + left join ma_type mt2 on mt1.parent_id = mt2.type_id + left join wh_house_info mhi on mhs.house_id = mhi.house_id + \ No newline at end of file