From f53b64264f842b9e798ad386ed6f707e44a40bbf Mon Sep 17 00:00:00 2001 From: chenhao Date: Thu, 13 Nov 2025 19:29:14 +0800 Subject: [PATCH] =?UTF-8?q?feat(inventory):=20=E5=A2=9E=E5=8A=A0=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E7=BC=96=E5=8F=B7=E5=AD=97=E6=AE=B5=E5=B9=B6=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=8F=91=E8=B4=A7=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在待办完成页面增加项目编号输入框和显示列- 修改库存执行页面数量校验条件从<=0为<0- 优化外发编辑页面上传功能,支持获取仓库ID - 发货功能增加detailId参数传递- 更新库存发货服务实现,新增detailId字段处理 -修复库存信息查询SQL统计逻辑错误 - 完善库存导入逻辑,返回仓库ID和产品序列号数据 - 增加OuterDeliveryProductVo的ID字段 - 流程待办增加项目编号字段及查询条件 - 扩展文件上传支持图片、PDF和Word文档格式- 发货查看页面增加备注信息展示 --- .../templates/flowable/todo/complete.html | 9 +++++++++ .../templates/inventory/delivery/view.html | 4 +++- .../templates/inventory/execution/edit.html | 2 +- .../templates/inventory/execution/track.html | 2 +- .../resources/templates/inventory/outer/edit.html | 10 ++++++---- .../com/ruoyi/sip/domain/InventoryDelivery.java | 2 +- .../java/com/ruoyi/sip/flowable/domain/Todo.java | 1 + .../flowable/service/impl/TodoServiceImpl.java | 1 + .../sip/service/IOmsInventoryInnerService.java | 3 ++- .../impl/InventoryDeliveryServiceImpl.java | 8 ++++++++ .../service/impl/InventoryOuterServiceImpl.java | 1 + .../impl/OmsInventoryInnerServiceImpl.java | 15 ++++++++------- .../com/ruoyi/sip/vo/OuterDeliveryProductVo.java | 1 + .../src/main/resources/mapper/flow/TodoMapper.xml | 3 +++ .../mapper/inventory/InventoryInfoMapper.xml | 2 +- 15 files changed, 47 insertions(+), 17 deletions(-) diff --git a/ruoyi-admin/src/main/resources/templates/flowable/todo/complete.html b/ruoyi-admin/src/main/resources/templates/flowable/todo/complete.html index 288cdda0..e3d5e972 100644 --- a/ruoyi-admin/src/main/resources/templates/flowable/todo/complete.html +++ b/ruoyi-admin/src/main/resources/templates/flowable/todo/complete.html @@ -48,6 +48,10 @@
- +
diff --git a/ruoyi-admin/src/main/resources/templates/inventory/outer/edit.html b/ruoyi-admin/src/main/resources/templates/inventory/outer/edit.html index 14785e37..eb352083 100644 --- a/ruoyi-admin/src/main/resources/templates/inventory/outer/edit.html +++ b/ruoyi-admin/src/main/resources/templates/inventory/outer/edit.html @@ -281,7 +281,8 @@ let data = JSON.parse(res.currentTarget.response) if (data.code === 0) { $.modal.msgSuccess('上传成功'); - productSnData = data.data; + productSnData = data.data.productSnDataList; + $('[name="warehouseId"]').val(data.data.warehouseId) $.table.refreshOptions($.extend(productSnOptions, { url: '', data: productSnData, @@ -434,7 +435,7 @@ formatter: function (value, row, index) { var actions = []; let disabled = Number(row.quantity) <= Number(row.deliveryGenerateQuantity) + Number(row.deliveryConfirmQuantity) - actions.push(`发货`); + actions.push(`发货`); return actions.join(''); } }] @@ -442,7 +443,7 @@ $.table.init(options); } - function checkDelivery(quantity,deliveryGenerateQuantity,deliveryConfirmQuantity, warehouseId, productCode) { + function checkDelivery(quantity,deliveryGenerateQuantity,deliveryConfirmQuantity, warehouseId, productCode,detailId) { initModal() // $.table.set('bootstrap-table') let width = 1000, height = 700 @@ -499,13 +500,14 @@ logisticsCode: $('#logisticsCode').val(), productCode: productCode, quantity: productSnData.length <= 0 ? arrays.length : productSnData.length, - warehouseId: warehouseId, + warehouseId: $('[name="warehouseId"]').val(), logisticsCompany: $('#logisticsCompany').val(), deliveryType: $('#deliveryType').val(), deliveryTime: $('#deliveryTime').val(), deliveryTimeType: $('#deliveryTimeType').val(), outerCode: $('[name="outerCode"]').val(), remark: $('[name="remark"]').val(), + detailId: detailId, productSnDataList: productSnData, } var config = { diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/InventoryDelivery.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/InventoryDelivery.java index 6821611d..9546605a 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/InventoryDelivery.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/InventoryDelivery.java @@ -77,7 +77,7 @@ public class InventoryDelivery extends BaseEntity - + private Long detailId; private String createByName; private String remark; diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/flowable/domain/Todo.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/flowable/domain/Todo.java index c4c48ea7..b248aa45 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/flowable/domain/Todo.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/flowable/domain/Todo.java @@ -100,4 +100,5 @@ public class Todo extends BaseEntity private Long businessId; private String businessName; + private String projectCode; } diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/flowable/service/impl/TodoServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/flowable/service/impl/TodoServiceImpl.java index 1e99d4c2..b757227b 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/flowable/service/impl/TodoServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/flowable/service/impl/TodoServiceImpl.java @@ -169,6 +169,7 @@ public class TodoServiceImpl implements TodoService { return; } item.setBusinessId(projectOrderInfo.getId()); + item.setProjectCode(projectOrderInfo.getProjectCode()); item.setBusinessName(projectOrderInfo.getProjectName()); }); } diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/IOmsInventoryInnerService.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/IOmsInventoryInnerService.java index 23fc5bbf..a1c503d3 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/IOmsInventoryInnerService.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/IOmsInventoryInnerService.java @@ -1,6 +1,7 @@ package com.ruoyi.sip.service; import java.util.List; +import java.util.Map; import com.ruoyi.sip.domain.InventoryInfo; import com.ruoyi.sip.domain.OmsInventoryInner; @@ -64,5 +65,5 @@ public interface IOmsInventoryInnerService void importByOuter(List inventoryInfoList,String productCode); - List getInventoryInfoList(List inventoryInfoExcelDtoList, String productCode); + Map getInventoryInfoList(List inventoryInfoExcelDtoList, String productCode); } diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/InventoryDeliveryServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/InventoryDeliveryServiceImpl.java index 03139f1e..8ca70a0c 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/InventoryDeliveryServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/InventoryDeliveryServiceImpl.java @@ -12,6 +12,7 @@ import com.ruoyi.common.utils.StringUtils; import com.ruoyi.sip.domain.*; import com.ruoyi.sip.dto.ApiDataQueryDto; import com.ruoyi.sip.dto.inventory.InventoryDeliveryDetailExcelDto; +import com.ruoyi.sip.mapper.InventoryOuterDetailMapper; import com.ruoyi.sip.mapper.InventoryOuterMapper; import com.ruoyi.sip.service.*; import com.ruoyi.sip.vo.DeliveryInfoVo; @@ -41,6 +42,8 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService { private IOmsInventoryInnerService omsInventoryInnerService; @Resource private InventoryOuterMapper inventoryOuterMapper; + @Resource + private InventoryOuterDetailMapper inventoryOuterDetailMapper; @Autowired private IProjectProductInfoService projectProductInfoService; @Autowired @@ -129,6 +132,10 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService { } omsInventoryInnerService.importByOuter(productSnDataList,inventoryDelivery.getProductCode()); } + InventoryOuterDetail inventoryOuterDetail = new InventoryOuterDetail(); + inventoryOuterDetail.setId(inventoryDelivery.getDetailId()); + inventoryOuterDetail.setWarehouseId(inventoryDelivery.getWarehouseId()); + inventoryOuterDetailMapper.updateInventoryOuterDetail(inventoryOuterDetail); int i = inventoryDeliveryMapper.insertInventoryDelivery(inventoryDelivery); if (CollUtil.isNotEmpty(detailList)){ for (OmsInventoryDeliveryDetail detail : detailList) { @@ -303,6 +310,7 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService { .map(OmsInventoryDeliveryDetail::getProductSn).collect(Collectors.toList())); } queryParams.setOuterCode(dbData.getOuterCode()); + queryParams.setWarehouseId(dbData.getWarehouseId()); List inventoryInfos = inventoryInfoService.selectInventoryInfoList(queryParams); return inventoryInfos.stream().map(item->{ InventoryDeliveryDetailExcelDto detailExcelDto = new InventoryDeliveryDetailExcelDto(); diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/InventoryOuterServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/InventoryOuterServiceImpl.java index 1868fdc6..155d4677 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/InventoryOuterServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/InventoryOuterServiceImpl.java @@ -268,6 +268,7 @@ public class InventoryOuterServiceImpl implements IInventoryOuterService List detailList = detailService.selectInventoryOuterDetailList(inventoryOuterDetail); List productVoList = detailList.stream().map(item -> { OuterDeliveryProductVo vo = new OuterDeliveryProductVo(); + vo.setId(item.getId()); vo.setProductCode(item.getProductCode()); vo.setModel(item.getModel()); vo.setQuantity(item.getQuantity()); diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/OmsInventoryInnerServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/OmsInventoryInnerServiceImpl.java index 8522e831..d47caeb0 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/OmsInventoryInnerServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/OmsInventoryInnerServiceImpl.java @@ -1,7 +1,5 @@ package com.ruoyi.sip.service.impl; -import java.math.BigDecimal; -import java.math.RoundingMode; import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; @@ -210,7 +208,7 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService { } @Override - public List getInventoryInfoList(List inventoryInfoExcelDtoList, String productCode) { + public Map getInventoryInfoList(List inventoryInfoExcelDtoList, String productCode) { long count = inventoryInfoExcelDtoList.stream().filter(item -> !item.getProductCode().equals(productCode)).count(); if (count > 0){ throw new ServiceException("导入清单的产品与出库单不符"); @@ -224,6 +222,9 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService { throw new ServiceException("产品编码对应产品未找到"); } List warehouseInfoList = warehouseInfoService.listByNameList(warehouseNameList); + if (CollUtil.isEmpty(warehouseInfoList)) { + throw new ServiceException("仓库未找到,导入失败"); + } Map warehouseInfoMap = warehouseInfoList.stream().collect(Collectors.toMap(OmsWarehouseInfo::getWarehouseName, Function.identity(), (v1, v2) -> v1)); List inventoryInfoList = inventoryInfoExcelDtoList.stream().map(item -> { InventoryInfo info = new InventoryInfo(); @@ -234,9 +235,6 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService { info.setProductDesc(productInfos.get(0).getDescription()); info.setInnerPrice(item.getInnerPrice()); OmsWarehouseInfo omsWarehouseInfo = warehouseInfoMap.get(item.getWarehouseName()); - if (omsWarehouseInfo == null){ - throw new ServiceException("仓库未找到,导入失败"); - } info.setWarehouseId(omsWarehouseInfo.getId()); info.setWarehouseName(omsWarehouseInfo.getWarehouseName()); @@ -246,7 +244,10 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService { if (CollUtil.isNotEmpty(repeatSnList)) { throw new ServiceException(StrUtil.format("SN码[{}]已存在,导入失败", repeatSnList)); } - return inventoryInfoList; + Map result=new HashMap<>(); + result.put("warehouseId",warehouseInfoList.get(0).getId()); + result.put("productSnDataList",inventoryInfoList); + return result; } diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/vo/OuterDeliveryProductVo.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/vo/OuterDeliveryProductVo.java index b723ac51..5942fb15 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/vo/OuterDeliveryProductVo.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/vo/OuterDeliveryProductVo.java @@ -18,6 +18,7 @@ import lombok.Data; */ @Data public class OuterDeliveryProductVo { + private Long id; private String productCode; private String model; private Long quantity; diff --git a/ruoyi-sip/src/main/resources/mapper/flow/TodoMapper.xml b/ruoyi-sip/src/main/resources/mapper/flow/TodoMapper.xml index d4819ec3..98b3571b 100644 --- a/ruoyi-sip/src/main/resources/mapper/flow/TodoMapper.xml +++ b/ruoyi-sip/src/main/resources/mapper/flow/TodoMapper.xml @@ -67,6 +67,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" '%') and task_name like concat('%', #{taskName}, '%') + and business_key in ( + select order_code from project_info t1 inner join project_order_info t2 on t1.id=t2.project_id where t1.project_code like concat('%', #{projectCode}, '%') + ) and approve_user_name = #{approveUserName} and apply_user_name like concat('%', diff --git a/ruoyi-sip/src/main/resources/mapper/inventory/InventoryInfoMapper.xml b/ruoyi-sip/src/main/resources/mapper/inventory/InventoryInfoMapper.xml index 5c65ec40..a3757aec 100644 --- a/ruoyi-sip/src/main/resources/mapper/inventory/InventoryInfoMapper.xml +++ b/ruoyi-sip/src/main/resources/mapper/inventory/InventoryInfoMapper.xml @@ -62,7 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"