From 793482f8ca48c004a880f69e4718929a551d31f0 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Mon, 4 Nov 2024 14:18:36 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=BA=93=E7=AE=A1=E7=BB=B4=E4=BF=AE?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=E5=85=B3=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ma/controller/TypeController.java | 34 ++-- .../material/ma/service/ITypeService.java | 4 +- .../ma/service/impl/TypeServiceImpl.java | 188 +++++++++--------- .../purchase/domain/PurchaseCheckInfo.java | 2 + 4 files changed, 115 insertions(+), 113 deletions(-) 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 642e4efd..01b3a247 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,13 +53,13 @@ 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); - } +// @ApiOperation(value = "查询物资类型管理列表(无分页)") +// @RequiresPermissions("ma:type:list") +// @GetMapping("/listNoPage") +// public AjaxResult listNoPage(MaTypeListVo type) { +// List list = typeService.selectTypeListAndParentInfo(type); +// return typeService.getMyTypeAndBindUsers(list); +// } /** * 根据左列表类型id查询右表格 @@ -71,13 +71,13 @@ public class TypeController extends BaseController { @GetMapping("/getListByMaType") public AjaxResult getListByMaType(MaTypeListVo type) { List parentIds = typeService.selectParentId(type); - List listByMaType = new ArrayList<>(); + List myTypeList = new ArrayList<>(); for (Integer parentId : parentIds) { - listByMaType.addAll(typeService.getListByParentId(parentId.longValue(), type)); + myTypeList.addAll(typeService.getListByParentId(parentId.longValue(), type)); } Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1); Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10); - return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, listByMaType)); + return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, typeService.getMyTypeAndBindUsers(myTypeList))); } /** @@ -190,13 +190,13 @@ public class TypeController extends BaseController { /** * 查询物资类型配置右侧列表 */ - @ApiOperation(value = "查询物资类型配置右侧列表") - @RequiresPermissions("ma:typeConfig:list") - @GetMapping("/getMaTypeConfigList") - public AjaxResult getMaTypeConfigList(MaTypeConfigDto maTypeConfigDto) { - // 调用service处理业务逻辑 - return typeService.getMaTypeConfigList(maTypeConfigDto); - } +// @ApiOperation(value = "查询物资类型配置右侧列表") +// @RequiresPermissions("ma:typeConfig:list") +// @GetMapping("/getMaTypeConfigList") +// public AjaxResult getMaTypeConfigList(MaTypeConfigDto maTypeConfigDto) { +// // 调用service处理业务逻辑 +// return typeService.getMaTypeConfigList(maTypeConfigDto); +// } /** 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 baac7699..94740f4a 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 @@ -98,7 +98,7 @@ public interface ITypeService { */ List buildMaTypeTree(List maTypeList); - AjaxResult getMaTypeConfigList(MaTypeConfigDto maTypeConfigDto); +// AjaxResult getMaTypeConfigList(MaTypeConfigDto maTypeConfigDto); - AjaxResult getMyTypeAndBindUsers(List list); + List getMyTypeAndBindUsers(List list); } 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 62176d58..c98f2e93 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 @@ -454,101 +454,101 @@ public class TypeServiceImpl implements ITypeService { return !getChildList(list, t).isEmpty(); } - @Override - public AjaxResult getMaTypeConfigList(MaTypeConfigDto maTypeConfigDto) { - // 1.把所有物资类型查出来 - List list = selectThreeFourLevelTypeListAndParent(new Type()); - // 2.把维修配置信息查出来 - List typeRepairList = typeRepairService.selectTypeRepairListAndUserName(new TypeRepair()); - // 3.把库管配置信息查出来 - List typeKeeperList = typeKeeperService.selectTypeKeeperListAndUserName(new TypeKeeper()); - - // ------------------- 开启数据处理 --------------------- - - // 4.循环所有物资类型,重型数据集合保障只循环一次,减少性能损失 - for (MaTypeConfigVo typeConfigVo1 : list) { - // 1.外层 先对比维修班组 - for (TypeRepair typeRepair : typeRepairList) { - // 2.判断当前维修配置信息中的物资类型id是否等于当前物资类型配置信息中的物资类型id - if (Objects.nonNull(typeRepair.getTypeId()) && typeRepair.getTypeId().equals(typeConfigVo1.getTypeId())) { - // 3.如果相等,把维修员信息设置到物资类型配置信息中 - typeConfigVo1.setRepairUserId(typeRepair.getUserId()); - typeConfigVo1.setRepairUserName(typeRepair.getUserName()); - break; - } - } - // 1.外层 再对比库管班组 - for (TypeKeeper typeKeeper : typeKeeperList) { - // 2.判断当前库管配置信息中的物资类型id是否等于当前物资类型配置信息中的物资类型id - if (Objects.nonNull(typeKeeper.getTypeId()) && typeKeeper.getTypeId().equals(typeConfigVo1.getTypeId())) { - // 3.如果相等,把库管员信息设置到物资类型配置信息中 - typeConfigVo1.setKeeperUserId(typeKeeper.getUserId()); - typeConfigVo1.setKeeperUserName(typeKeeper.getUserName()); - } - } - - // 5.判断当前物资类型配置信息是否有子节点 - if (typeConfigVo1.getChildren() != null) { - // 6.有子节点,继续循环子节点,判断子节点是否有维修配置信息 - for (MaTypeConfigVo typeConfigVo2 : typeConfigVo1.getChildren()) { - // 7.有维修配置信息,把维修员信息设置到子节点中 - for (TypeRepair typeRepair : typeRepairList) { - if (Objects.nonNull(typeRepair.getTypeId()) && typeRepair.getTypeId().equals(typeConfigVo2.getTypeId())) { - typeConfigVo2.setRepairUserId(typeRepair.getUserId()); - typeConfigVo2.setRepairUserName(typeRepair.getUserName()); - } - } - } - - // 8.有子节点,继续循环子节点, - for (MaTypeConfigVo typeConfigVo3 : typeConfigVo1.getChildren()) { - // 9.判断子节点是否有库管配置信息 - for (TypeKeeper typeKeeper : typeKeeperList) { - if (Objects.nonNull(typeKeeper.getTypeId()) && typeKeeper.getTypeId().equals(typeConfigVo3.getTypeId())) { - typeConfigVo3.setKeeperUserId(typeKeeper.getUserId()); - typeConfigVo3.setKeeperUserName(typeKeeper.getUserName()); - } - } - } - } - - } - - // -------------------- 数据处理结束 --------------------- - - // TODO: 先暂时取消后续过滤流程 - if (true) { - return AjaxResult.success(list); - } - - - // ------------------- 数据过滤开始 --------------------- - if (maTypeConfigDto == null || maTypeConfigDto.getUserId() == null || maTypeConfigDto.getUserId() == 0L) { - // 如果参数无效,则返回原始列表 - return AjaxResult.success(list); - } - - List filteredList = new ArrayList<>(); - - for (MaTypeConfigVo maTypeConfigVo : list) { - if ( - maTypeConfigVo.getKeeperUserId().equals(maTypeConfigDto.getUserId()) || - maTypeConfigVo.getRepairUserId().equals(maTypeConfigDto.getUserId()) - ) - { - filteredList.add(maTypeConfigVo); - } - } - - // ------------------- 数据过滤结束 --------------------- - - - // 返回前端 - return AjaxResult.success(filteredList); - } +// @Override +// public AjaxResult getMaTypeConfigList(MaTypeConfigDto maTypeConfigDto) { +// // 1.把所有物资类型查出来 +// List list = selectThreeFourLevelTypeListAndParent(new Type()); +// // 2.把维修配置信息查出来 +// List typeRepairList = typeRepairService.selectTypeRepairListAndUserName(new TypeRepair()); +// // 3.把库管配置信息查出来 +// List typeKeeperList = typeKeeperService.selectTypeKeeperListAndUserName(new TypeKeeper()); +// +// // ------------------- 开启数据处理 --------------------- +// +// // 4.循环所有物资类型,重型数据集合保障只循环一次,减少性能损失 +// for (MaTypeConfigVo typeConfigVo1 : list) { +// // 1.外层 先对比维修班组 +// for (TypeRepair typeRepair : typeRepairList) { +// // 2.判断当前维修配置信息中的物资类型id是否等于当前物资类型配置信息中的物资类型id +// if (Objects.nonNull(typeRepair.getTypeId()) && typeRepair.getTypeId().equals(typeConfigVo1.getTypeId())) { +// // 3.如果相等,把维修员信息设置到物资类型配置信息中 +// typeConfigVo1.setRepairUserId(typeRepair.getUserId()); +// typeConfigVo1.setRepairUserName(typeRepair.getUserName()); +// break; +// } +// } +// // 1.外层 再对比库管班组 +// for (TypeKeeper typeKeeper : typeKeeperList) { +// // 2.判断当前库管配置信息中的物资类型id是否等于当前物资类型配置信息中的物资类型id +// if (Objects.nonNull(typeKeeper.getTypeId()) && typeKeeper.getTypeId().equals(typeConfigVo1.getTypeId())) { +// // 3.如果相等,把库管员信息设置到物资类型配置信息中 +// typeConfigVo1.setKeeperUserId(typeKeeper.getUserId()); +// typeConfigVo1.setKeeperUserName(typeKeeper.getUserName()); +// } +// } +// +// // 5.判断当前物资类型配置信息是否有子节点 +// if (typeConfigVo1.getChildren() != null) { +// // 6.有子节点,继续循环子节点,判断子节点是否有维修配置信息 +// for (MaTypeConfigVo typeConfigVo2 : typeConfigVo1.getChildren()) { +// // 7.有维修配置信息,把维修员信息设置到子节点中 +// for (TypeRepair typeRepair : typeRepairList) { +// if (Objects.nonNull(typeRepair.getTypeId()) && typeRepair.getTypeId().equals(typeConfigVo2.getTypeId())) { +// typeConfigVo2.setRepairUserId(typeRepair.getUserId()); +// typeConfigVo2.setRepairUserName(typeRepair.getUserName()); +// } +// } +// } +// +// // 8.有子节点,继续循环子节点, +// for (MaTypeConfigVo typeConfigVo3 : typeConfigVo1.getChildren()) { +// // 9.判断子节点是否有库管配置信息 +// for (TypeKeeper typeKeeper : typeKeeperList) { +// if (Objects.nonNull(typeKeeper.getTypeId()) && typeKeeper.getTypeId().equals(typeConfigVo3.getTypeId())) { +// typeConfigVo3.setKeeperUserId(typeKeeper.getUserId()); +// typeConfigVo3.setKeeperUserName(typeKeeper.getUserName()); +// } +// } +// } +// } +// +// } +// +// // -------------------- 数据处理结束 --------------------- +// +// // TODO: 先暂时取消后续过滤流程 +// if (true) { +// return AjaxResult.success(list); +// } +// +// +// // ------------------- 数据过滤开始 --------------------- +// if (maTypeConfigDto == null || maTypeConfigDto.getUserId() == null || maTypeConfigDto.getUserId() == 0L) { +// // 如果参数无效,则返回原始列表 +// return AjaxResult.success(list); +// } +// +// List filteredList = new ArrayList<>(); +// +// for (MaTypeConfigVo maTypeConfigVo : list) { +// if ( +// maTypeConfigVo.getKeeperUserId().equals(maTypeConfigDto.getUserId()) || +// maTypeConfigVo.getRepairUserId().equals(maTypeConfigDto.getUserId()) +// ) +// { +// filteredList.add(maTypeConfigVo); +// } +// } +// +// // ------------------- 数据过滤结束 --------------------- +// +// +// // 返回前端 +// return AjaxResult.success(filteredList); +// } @Override - public AjaxResult getMyTypeAndBindUsers(List list) { + public List getMyTypeAndBindUsers(List list) { List typeRepairList = typeRepairService.selectTypeRepairListAndUserName(new TypeRepair()); List typeKeeperList = typeKeeperService.selectTypeKeeperListAndUserName(new TypeKeeper()); for (MaTypeListVo maTypeListVo : list) { @@ -570,7 +570,7 @@ public class TypeServiceImpl implements ITypeService { } } } - return AjaxResult.success(list); + return list; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/purchase/domain/PurchaseCheckInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/purchase/domain/PurchaseCheckInfo.java index 444afb47..8726cd0b 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/purchase/domain/PurchaseCheckInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/purchase/domain/PurchaseCheckInfo.java @@ -11,6 +11,7 @@ import lombok.EqualsAndHashCode; import lombok.ToString; import com.bonus.common.core.web.domain.BaseEntity; +import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; /** @@ -46,6 +47,7 @@ public class PurchaseCheckInfo extends BaseEntity { /** 到货日期 */ @ApiModelProperty(value = "到货日期") + @NotNull(message = "到货日期不能为空") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @Excel(name = "到货日期", width = 30, dateFormat = "yyyy-MM-dd") private Date arrivalTime; From d8283918da7b48babec180c533f068642026661b Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Mon, 4 Nov 2024 16:06:31 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BB=93=E5=BA=93=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/material/warehouse/WhHouseInfoMapper.xml | 4 ++-- .../resources/mapper/material/warehouse/WhHouseSetMapper.xml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) 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 5c99f87a..168f1a95 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 @@ -109,11 +109,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - update wh_house_info set del_flag = '2' where house_id = #{houseId} + delete from wh_house_info where house_id = #{houseId} - update wh_house_info set del_flag = '2' where house_id in + delete from wh_house_info where house_id in #{houseId} 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 7df8c1cd..fdbddf17 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 @@ -122,5 +122,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join ma_type mt1 on mt.parent_id = mt1.type_id left join ma_type mt2 on mt1.parent_id = mt2.type_id right join wh_house_info mhi on mhs.house_id = mhi.house_id + where mhi.del_flag=0 \ No newline at end of file From 303423045158b686f250f826fae35371f292bf88 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Tue, 5 Nov 2024 11:04:02 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E9=99=84=E4=BB=B6=E8=A1=A8=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bonus/material/basic/domain/BmFileInfo.java | 10 ++++++++++ .../mapper/material/basic/BmFileInfoMapper.xml | 14 +++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmFileInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmFileInfo.java index b3754eec..0b2fa507 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmFileInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmFileInfo.java @@ -24,6 +24,11 @@ public class BmFileInfo extends BaseEntity /** 主键id */ private Long id; + /** 任务类型, 参考数据字典 tm_task_type */ + @Excel(name = "任务类型") + @ApiModelProperty(value = "任务类型") + private Long taskType; + /** 任务id */ @Excel(name = "任务id") @ApiModelProperty(value = "任务id") @@ -44,6 +49,11 @@ public class BmFileInfo extends BaseEntity @ApiModelProperty(value = "文件路径") private String url; + /** 文件类型, 参考数据字典 bm_file_type */ + @Excel(name = "文件类型") + @ApiModelProperty(value = "文件类型") + private Long fileType; + /** 数据字典 */ @Excel(name = "数据字典") @ApiModelProperty(value = "数据字典") diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmFileInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmFileInfoMapper.xml index ddfa77d7..7aa97639 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmFileInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmFileInfoMapper.xml @@ -5,26 +5,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + - select id, task_id, model_id, name, url, dic_id, create_by, create_time from bm_file_info + select id, task_type, task_id, model_id, name, url, file_type, dic_id, create_by, create_time from bm_file_info @@ -37,19 +41,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" insert into bm_file_info + task_type, task_id, model_id, name, url, + file_type, dic_id, create_by, create_time, + #{taskType}, #{taskId}, #{modelId}, #{name}, #{url}, + #{fileType}, #{dicId}, #{createBy}, #{createTime}, @@ -59,10 +67,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update bm_file_info + task_type = #{taskType}, task_id = #{taskId}, model_id = #{modelId}, name = #{name}, url = #{url}, + file_type = #{fileType}, dic_id = #{dicId}, create_by = #{createBy}, create_time = #{createTime}, @@ -84,8 +94,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" delete from bm_file_info + and task_type = #{taskType} and task_id = #{taskId} and model_id = #{modelId} + and file_type = #{fileType} and dic_id = #{dicId} From 7db17948710d307194a74933379d325d572a9ac0 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Tue, 5 Nov 2024 11:31:30 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E7=89=A9=E8=B5=84=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/bonus/material/ma/controller/TypeController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 01b3a247..a77561bf 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 @@ -77,7 +77,8 @@ public class TypeController extends BaseController { } Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1); Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10); - return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, typeService.getMyTypeAndBindUsers(myTypeList))); + List result = typeService.getMyTypeAndBindUsers(myTypeList); + return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, result)); } /**