diff --git a/bonus-common-biz/src/main/java/com/bonus/common/biz/constant/BmConfigItems.java b/bonus-common-biz/src/main/java/com/bonus/common/biz/constant/BmConfigItems.java index 0b2f14aa..0e00c824 100644 --- a/bonus-common-biz/src/main/java/com/bonus/common/biz/constant/BmConfigItems.java +++ b/bonus-common-biz/src/main/java/com/bonus/common/biz/constant/BmConfigItems.java @@ -5,6 +5,11 @@ package com.bonus.common.biz.constant; * @author bonus */ public class BmConfigItems { + + public static final String KU_GUAN_ROLE_IDS = "KuGuanRoleIDs"; + + public static final String WEI_XIU_ROLE_IDS = "KuGuanRoleIDs"; + public static final String LEASE_TASK_AUDIT_ROLE_KEYS = "LeaseTaskAuditRoleKeys"; public static final String BACK_TASK_AUDIT_ROLE_KEYS = "BackTaskAuditRoleKeys"; diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/BmConfigServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/BmConfigServiceImpl.java index 81cd0bac..51e09d0f 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/BmConfigServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/BmConfigServiceImpl.java @@ -116,10 +116,37 @@ public class BmConfigServiceImpl implements IBmConfigService if (StringUtils.isEmpty(value1)) { return value2; } else { - return value1; + return value1.trim(); } } + /**获取所设定的库管员role ids*/ + public List getKuGuanRoleIds() { + List list = new ArrayList(); + BmConfig bmConfig = bmConfigMapper.selectBmConfigByItemName(BmConfigItems.KU_GUAN_ROLE_IDS); + if (Objects.nonNull(bmConfig)) { + String value = getValueWithDefault(bmConfig.getItemValue(), ""); + if (StringUtils.isNotEmpty(value)) { + list = Arrays.asList(value.split(",")); + } + } + return list; + } + + /**获取所设定的维修员role ids*/ + public List getWeiXiuRoleIds() { + List list = new ArrayList(); + BmConfig bmConfig = bmConfigMapper.selectBmConfigByItemName(BmConfigItems.WEI_XIU_ROLE_IDS); + if (Objects.nonNull(bmConfig)) { + String value = getValueWithDefault(bmConfig.getItemValue(), ""); + if (StringUtils.isNotEmpty(value)) { + list = Arrays.asList(value.split(",")); + } + } + return list; + } + + /**获取所设定的领料审核角色列表*/ public List getLeaseTaskAuditRoleKeys() { List list = new ArrayList(); BmConfig bmConfig = bmConfigMapper.selectBmConfigByItemName(BmConfigItems.LEASE_TASK_AUDIT_ROLE_KEYS); @@ -132,6 +159,7 @@ public class BmConfigServiceImpl implements IBmConfigService return list; } + /**获取所设定的退料审核角色列表*/ public List getBackTaskAuditRoleKeys() { List list = new ArrayList(); BmConfig bmConfig = bmConfigMapper.selectBmConfigByItemName(BmConfigItems.BACK_TASK_AUDIT_ROLE_KEYS); 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 9e32a676..642e4efd 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 @@ -53,6 +53,14 @@ public class TypeController extends BaseController { return getDataTable(list); } + @ApiOperation(value = "查询物资类型管理列表(无分页)") + @RequiresPermissions("ma:type:list") + @GetMapping("/listNoPage") + public AjaxResult listNoPage(MaTypeListVo type) { + List list = typeService.selectTypeListAndParentInfo(type); + return typeService.getMyTypeAndBindUsers(list); + } + /** * 根据左列表类型id查询右表格 * 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 7b3b00e5..2adbd68d 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 @@ -72,6 +72,18 @@ public class TypeKeeperController extends BaseController { return success(typeKeeperService.selectTypeKeeperByID(ID)); } + /** + * 新增库管员配置 + */ +// @ApiOperation(value = "新增库管员配置") +// @PreventRepeatSubmit +// @RequiresPermissions("ma:keeper:add") +// @SysLog(title = "库管员配置", businessType = OperaType.INSERT, module = "物资管理->新增库管员配置") +// @PostMapping +// public AjaxResult add(@RequestBody TypeKeeper typeKeeper) { +// return toAjax(typeKeeperService.insertTypeKeeper(typeKeeper)); +// } + /** * 新增库管员配置 */ @@ -80,8 +92,8 @@ public class TypeKeeperController extends BaseController { @RequiresPermissions("ma:keeper:add") @SysLog(title = "库管员配置", businessType = OperaType.INSERT, module = "物资管理->新增库管员配置") @PostMapping - public AjaxResult add(@RequestBody TypeKeeper typeKeeper) { - return toAjax(typeKeeperService.insertTypeKeeper(typeKeeper)); + public AjaxResult add(@RequestBody List typeKeepers) { + return toAjax(typeKeeperService.insertTypeKeeper(typeKeepers)); } /** @@ -112,13 +124,23 @@ public class TypeKeeperController extends BaseController { /** * 删除单个库管员配置 */ - @ApiOperation(value = "删除单个库管员配置") +// @ApiOperation(value = "删除单个库管员配置") +// @PreventRepeatSubmit +// @RequiresPermissions("ma:keeper:remove") +// @SysLog(title = "库管员配置", businessType = OperaType.DELETE, logType = 1,module = "物资管理->删除单个库管员配置") +// @DeleteMapping +// public AjaxResult remove(@RequestBody TypeKeeper typeKeeper) +// { +// return toAjax(typeKeeperService.deleteTypeKeeperByUserIdAndTypeId(typeKeeper)); +// } + + @ApiOperation(value = "删除库管员配置") @PreventRepeatSubmit @RequiresPermissions("ma:keeper:remove") @SysLog(title = "库管员配置", businessType = OperaType.DELETE, logType = 1,module = "物资管理->删除单个库管员配置") @DeleteMapping - public AjaxResult remove(@RequestBody TypeKeeper typeKeeper) + public AjaxResult remove(@RequestBody List typeKeepers) { - return toAjax(typeKeeperService.deleteTypeKeeperByUserIdAndTypeId(typeKeeper)); + return toAjax(typeKeeperService.deleteTypeKeeperByUserIdAndTypeId(typeKeepers)); } } 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 c5c195a9..aeaaff0f 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 @@ -38,10 +38,10 @@ public interface TypeKeeperMapper { /** * 新增库管员配置 * - * @param typeKeeper 库管员配置 + * @param typeKeepers 库管员配置 * @return 结果 */ - int insertTypeKeeper(TypeKeeper typeKeeper); + int insertTypeKeeper(List typeKeepers); /** * 修改库管员配置 @@ -59,11 +59,6 @@ public interface TypeKeeperMapper { */ int deleteTypeKeeperByID(Long ID); - /** - * 根据用户ID和物资类型ID删除库管员配置 - */ - int deleteTypeKeeperByUserIdAndTypeId(TypeKeeper typeKeeper); - /** * 批量删除库管员配置 * @@ -71,4 +66,9 @@ public interface TypeKeeperMapper { * @return 结果 */ int deleteTypeKeeperByIDs(Long[] IDs); + + /** + * 根据用户ID和物资类型ID删除库管员配置 + */ + int deleteTypeKeeperByUserIdAndTypeId(List typeKeepers); } 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 6a129bda..efab85c3 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 @@ -31,10 +31,10 @@ public interface ITypeKeeperService { /** * 新增库管员配置 * - * @param typeKeeper 库管员配置 + * @param typeKeepers 库管员配置 * @return 结果 */ - int insertTypeKeeper(TypeKeeper typeKeeper); + int insertTypeKeeper(List typeKeepers); /** * 修改库管员配置 @@ -63,8 +63,8 @@ public interface ITypeKeeperService { /** * 根据用户ID和物资类型ID删除库管员配置信息 * - * @param typeKeeper + * @param typeKeepers * @return */ - int deleteTypeKeeperByUserIdAndTypeId(TypeKeeper typeKeeper); + int deleteTypeKeeperByUserIdAndTypeId(List typeKeepers); } 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 b6893b75..baac7699 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 @@ -99,4 +99,6 @@ public interface ITypeService { List buildMaTypeTree(List maTypeList); AjaxResult getMaTypeConfigList(MaTypeConfigDto maTypeConfigDto); + + AjaxResult getMyTypeAndBindUsers(List list); } 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 dc6b184b..5bff4228 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 @@ -54,13 +54,13 @@ public class TypeKeeperServiceImpl implements ITypeKeeperService { /** * 新增库管员配置 * - * @param typeKeeper 库管员配置 + * @param typeKeepers 库管员配置 * @return 结果 */ @Override - public int insertTypeKeeper(TypeKeeper typeKeeper) { - typeKeeper.setCreateTime(DateUtils.getNowDate()); - return typeKeeperMapper.insertTypeKeeper(typeKeeper); + public int insertTypeKeeper(List typeKeepers) { + typeKeepers.forEach(typeKeeper -> typeKeeper.setCreateTime(DateUtils.getNowDate())); + return typeKeeperMapper.insertTypeKeeper(typeKeepers); } /** @@ -101,11 +101,11 @@ public class TypeKeeperServiceImpl implements ITypeKeeperService { /** * 根据用户ID和物资类型ID删除库管员配置信息 * - * @param typeKeeper + * @param typeKeepers * @return */ @Override - public int deleteTypeKeeperByUserIdAndTypeId(TypeKeeper typeKeeper) { - return typeKeeperMapper.deleteTypeKeeperByUserIdAndTypeId(typeKeeper); + public int deleteTypeKeeperByUserIdAndTypeId(List typeKeepers) { + return typeKeeperMapper.deleteTypeKeeperByUserIdAndTypeId(typeKeepers); } } 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 d1aa2562..62176d58 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 @@ -470,7 +470,7 @@ public class TypeServiceImpl implements ITypeService { // 1.外层 先对比维修班组 for (TypeRepair typeRepair : typeRepairList) { // 2.判断当前维修配置信息中的物资类型id是否等于当前物资类型配置信息中的物资类型id - if (typeRepair.getTypeId().equals(typeConfigVo1.getTypeId())) { + if (Objects.nonNull(typeRepair.getTypeId()) && typeRepair.getTypeId().equals(typeConfigVo1.getTypeId())) { // 3.如果相等,把维修员信息设置到物资类型配置信息中 typeConfigVo1.setRepairUserId(typeRepair.getUserId()); typeConfigVo1.setRepairUserName(typeRepair.getUserName()); @@ -480,7 +480,7 @@ public class TypeServiceImpl implements ITypeService { // 1.外层 再对比库管班组 for (TypeKeeper typeKeeper : typeKeeperList) { // 2.判断当前库管配置信息中的物资类型id是否等于当前物资类型配置信息中的物资类型id - if (typeKeeper.getTypeId().equals(typeConfigVo1.getTypeId())) { + if (Objects.nonNull(typeKeeper.getTypeId()) && typeKeeper.getTypeId().equals(typeConfigVo1.getTypeId())) { // 3.如果相等,把库管员信息设置到物资类型配置信息中 typeConfigVo1.setKeeperUserId(typeKeeper.getUserId()); typeConfigVo1.setKeeperUserName(typeKeeper.getUserName()); @@ -493,7 +493,7 @@ public class TypeServiceImpl implements ITypeService { for (MaTypeConfigVo typeConfigVo2 : typeConfigVo1.getChildren()) { // 7.有维修配置信息,把维修员信息设置到子节点中 for (TypeRepair typeRepair : typeRepairList) { - if (typeRepair.getTypeId().equals(typeConfigVo2.getTypeId())) { + if (Objects.nonNull(typeRepair.getTypeId()) && typeRepair.getTypeId().equals(typeConfigVo2.getTypeId())) { typeConfigVo2.setRepairUserId(typeRepair.getUserId()); typeConfigVo2.setRepairUserName(typeRepair.getUserName()); } @@ -504,7 +504,7 @@ public class TypeServiceImpl implements ITypeService { for (MaTypeConfigVo typeConfigVo3 : typeConfigVo1.getChildren()) { // 9.判断子节点是否有库管配置信息 for (TypeKeeper typeKeeper : typeKeeperList) { - if (typeKeeper.getTypeId().equals(typeConfigVo3.getTypeId())) { + if (Objects.nonNull(typeKeeper.getTypeId()) && typeKeeper.getTypeId().equals(typeConfigVo3.getTypeId())) { typeConfigVo3.setKeeperUserId(typeKeeper.getUserId()); typeConfigVo3.setKeeperUserName(typeKeeper.getUserName()); } @@ -546,4 +546,33 @@ public class TypeServiceImpl implements ITypeService { // 返回前端 return AjaxResult.success(filteredList); } + + @Override + public AjaxResult getMyTypeAndBindUsers(List list) { + List typeRepairList = typeRepairService.selectTypeRepairListAndUserName(new TypeRepair()); + List typeKeeperList = typeKeeperService.selectTypeKeeperListAndUserName(new TypeKeeper()); + for (MaTypeListVo maTypeListVo : list) { + if (CollectionUtils.isNotEmpty(typeRepairList)) { + for (TypeRepair typeRepair : typeRepairList) { + if (Objects.nonNull(typeRepair.getTypeId()) && typeRepair.getTypeId().equals(maTypeListVo.getTypeId())) { + maTypeListVo.setRepairUserId(typeRepair.getUserId()); + maTypeListVo.setRepairUserName(typeRepair.getUserName()); + break; + } + } + } + if (CollectionUtils.isNotEmpty(typeKeeperList)) { + for (TypeKeeper typeKeeper : typeKeeperList) { + if (Objects.nonNull(typeKeeper.getTypeId()) && typeKeeper.getTypeId().equals(maTypeListVo.getTypeId())) { + maTypeListVo.setKeeperUserId(typeKeeper.getUserId()); + maTypeListVo.setKeeperUserName(typeKeeper.getUserName()); + } + } + } + } + return AjaxResult.success(list); + } + + + } 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 index 59248010..5a8c018b 100644 --- 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 @@ -3,7 +3,6 @@ package com.bonus.material.ma.vo; import com.bonus.common.core.annotation.Excel; import com.bonus.material.ma.domain.Type; import io.swagger.annotations.ApiModelProperty; -import io.swagger.annotations.ApiOperation; import lombok.Getter; import lombok.Setter; @@ -30,4 +29,16 @@ public class MaTypeListVo extends Type { @ApiModelProperty(value = "物资名称") private String materialName; + @ApiModelProperty(value = "库管员id") + private Long keeperUserId; + + @ApiModelProperty(value = "库管员姓名") + private String keeperUserName; + + @ApiModelProperty(value = "维修员id") + private Long repairUserId; + + @ApiModelProperty(value = "维修员姓名") + private String repairUserName; + } diff --git a/bonus-modules/bonus-material/src/main/resources/bootstrap-sgzb_bns_test.yml b/bonus-modules/bonus-material/src/main/resources/bootstrap-sgzb_bns_test.yml deleted file mode 100644 index b2188d78..00000000 --- a/bonus-modules/bonus-material/src/main/resources/bootstrap-sgzb_bns_test.yml +++ /dev/null @@ -1,28 +0,0 @@ -# Tomcat -server: - port: 18588 - -# Spring -spring: - cloud: - nacos: - discovery: - # 服务注册地址 - server-addr: 192.168.0.56:8848 - # namespace: sgzb_bns - namespace: sgzb_bns - config: - # 配置中心地址 - server-addr: 192.168.0.56:8848 - # namespace: sgzb_bns - namespace: sgzb_bns - # 配置文件格式 - file-extension: yml - # 共享配置 - shared-configs: - - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} - -#加密组件 -jasypt: - encryptor: - password: Encrypt diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/MachineMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/MachineMapper.xml index 2ac8a133..ffba0dc9 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/MachineMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/MachineMapper.xml @@ -149,6 +149,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" mtk.user_id as keeperId, mtr.user_id as repairId, baa.asset_name as assetName, + ma.assets_id as assetsId, ma.remark as remark FROM ma_machine ma 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 7e3a918f..e0c1df7c 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 @@ -37,21 +37,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - insert into ma_type_keeper - - type_id, - user_id, - create_time, - update_time, - company_id, - - - #{typeId}, - #{userId}, - #{createTime}, - #{updateTime}, - #{companyId}, - + insert into ma_type_keeper (type_id,user_id,create_time,update_time,company_id) + values + + ( + #{item.typeId}, + #{item.userId}, + #{item.createTime}, + #{item.updateTime}, + #{item.companyId} + ) + @@ -90,6 +86,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from ma_type_keeper where user_id = #{userId} and type_id = #{typeId} + delete from ma_type_keeper where + type_id in + + ( + #{item.typeId} + ) + + and + user_id in + + ( + #{item.userId} + ) + \ No newline at end of file diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/warehouse/WhHouseSetMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/warehouse/WhHouseSetMapper.xml index 4fe9b06a..7df8c1cd 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/warehouse/WhHouseSetMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/warehouse/WhHouseSetMapper.xml @@ -115,12 +115,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" \ No newline at end of file