From 7b000a54bf5bb0902cc60b911d3100b969f27eb9 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Thu, 21 Nov 2024 10:54:21 +0800 Subject: [PATCH 1/9] =?UTF-8?q?[feat]=E9=87=87=E8=B4=AD=E7=AE=A1=E7=90=86?= =?UTF-8?q?=20=E9=87=87=E8=B4=AD=E5=85=A5=E5=BA=93=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=96=B0=E5=A2=9EpurchaseOrderId=E4=BD=9C?= =?UTF-8?q?=E4=B8=BA=E9=9A=90=E8=97=8F=E5=AD=97=E6=AE=B5=EF=BC=9B=E6=96=B0?= =?UTF-8?q?=E5=A2=9EsubmitHandler=E6=96=B9=E6=B3=95=EF=BC=9A=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0=E8=A2=AB=E9=80=89=E6=8B=A9=E7=9A=84=E7=89=A9=E6=96=99?= =?UTF-8?q?=E6=89=8D=E5=8F=AF=E4=BB=A5=E5=85=A5=E5=BA=93=EF=BC=8C=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E5=85=A5=E5=BA=93=E7=89=A9=E6=96=99=E4=B8=AD=E5=90=8C?= =?UTF-8?q?=E6=97=B6=E5=8C=85=E5=90=AB=E4=BB=93=E5=BA=93=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E5=92=8C=E9=87=87=E8=B4=AD=E5=85=A5=E5=BA=93=EF=BC=8C=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E9=9C=80=E8=A6=81=E5=88=86=E5=BC=80=E5=85=A5=E5=BA=93?= =?UTF-8?q?=EF=BC=9B=E9=87=87=E8=B4=AD=E5=85=A5=E5=BA=93=E5=8D=95=E5=AD=90?= =?UTF-8?q?=E8=A1=A8=E6=96=B0=E5=A2=9E=20purchaseOrderChildId=E3=80=81mate?= =?UTF-8?q?rialPhotourl=E3=80=81warehouseDept=E3=80=81=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E5=88=B0=E8=B4=A7=E6=95=B0=E5=A6=82=E6=9E=9C?= =?UTF-8?q?=E6=9A=82=E6=94=B6=E6=95=B0=E7=AD=89=E4=BA=8E=E5=AE=9E=E9=99=85?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E6=95=B0=E6=88=96=E8=80=85=E5=AE=9E=E9=99=85?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E6=95=B0=E7=AD=89=E4=BA=8E=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E5=B7=B2=E5=88=B0=E8=B4=A7=E6=95=B0=E6=98=BE=E7=A4=BA=E4=B8=8D?= =?UTF-8?q?=E5=8F=AF=E7=BC=96=E8=BE=91=EF=BC=8C=E5=90=A6=E5=88=99=E5=8F=AF?= =?UTF-8?q?=E7=BC=96=E8=BE=91=EF=BC=9B=E5=B9=B6=E4=B8=94=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E5=88=B0=E8=B4=A7=E6=95=B0=E4=B8=8D=E8=83=BD=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E3=80=81=E5=8F=AA=E8=83=BD=E4=B8=BA=E6=95=B0=E3=80=81=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E4=B8=BA=E5=B0=8F=E6=95=B0=E3=80=81=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E5=B0=8F=E4=BA=8E0=20=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=AE=9E=E4=BD=93=E7=B1=BB=20warehouseStorageStatus=E5=92=8C?= =?UTF-8?q?=E4=BB=93=E5=BA=93=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4=EF=BC=9B?= =?UTF-8?q?=E6=96=B0=E5=A2=9EnotifyHasArrivedSum=EF=BC=8Cmapper.xml?= =?UTF-8?q?=E6=89=80=E6=9C=89=E6=96=B9=E6=B3=95=E5=8A=A0=E4=B8=8AnotifyHas?= =?UTF-8?q?ArrivedSum=E5=AD=97=E6=AE=B5=20=E9=87=87=E8=B4=AD=E8=AE=A2?= =?UTF-8?q?=E5=8D=95Controller=E6=96=B0=E5=A2=9E=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E5=85=A5=E5=BA=93=E9=80=9A=E7=9F=A5=E5=8D=95?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3=20=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E8=AE=A2=E5=8D=95impl=E5=B1=82=E6=96=B0=E5=A2=9E=EF=BC=9A=20?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E9=87=87=E8=B4=AD=E5=85=A5=E5=BA=93=E5=8D=95?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E3=80=81=E6=96=B0=E5=A2=9E=20=E7=94=9F?= =?UTF-8?q?=E6=88=90=E9=87=87=E8=B4=AD=E5=85=A5=E5=BA=93=E5=8D=95=E5=AD=90?= =?UTF-8?q?=E8=A1=A8=E6=96=B9=E6=B3=95=E3=80=81=E6=96=B0=E5=A2=9E=20?= =?UTF-8?q?=E7=94=9F=E6=88=90=E9=87=87=E8=B4=AD=E5=85=A5=E5=BA=93=E5=8D=95?= =?UTF-8?q?=E4=B8=BB=E8=A1=A8=E6=96=B9=E6=B3=95=E3=80=81=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=20=E7=94=9F=E6=88=90=E4=BB=93=E5=BA=93=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E5=8D=95=E6=96=B9=E6=B3=95=E3=80=81=E6=96=B0=E5=A2=9E=20?= =?UTF-8?q?=E7=94=9F=E6=88=90=E4=BB=93=E5=BA=93=E5=85=A5=E5=BA=93=E5=8D=95?= =?UTF-8?q?=E5=AD=90=E8=A1=A8=E6=96=B9=E6=B3=95=E3=80=81=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=20=E6=9B=B4=E6=96=B0=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=AD=90=E8=A1=A8=E6=96=B9=E6=B3=95=EF=BC=9B=E5=A6=82=E6=9E=9C?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E5=B7=B2=E5=88=B0=E8=B4=A7=E6=95=B0=E7=AD=89?= =?UTF-8?q?=E4=BA=8E=E5=AE=9E=E9=99=85=E9=87=87=E8=B4=AD=E6=80=BB=E6=95=B0?= =?UTF-8?q?=EF=BC=8C=E5=88=99=E8=AE=BE=E7=BD=AE=E9=87=87=E8=B4=AD=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E4=B8=BA=E5=85=A8=E9=83=A8=E5=85=A5=E5=BA=93=EF=BC=8C?= =?UTF-8?q?=E5=90=A6=E5=88=99=E4=B8=BA=E9=83=A8=E5=88=86=E5=85=A5=E5=BA=93?= =?UTF-8?q?=EF=BC=8C=E5=8F=AA=E6=9C=89=E4=B8=8D=E4=B8=BA=E5=85=A8=E9=83=A8?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E4=B9=8B=E5=89=8D=E5=8F=AF=E4=BB=A5=E4=B8=80?= =?UTF-8?q?=E7=9B=B4=E5=8F=91=E8=B5=B7=E5=85=A5=E5=BA=93=20=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E5=85=A5=E5=BA=93=E5=8D=95=E5=AD=90=E8=A1=A8=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=20=E6=89=B9=E9=87=8F=E6=96=B0=E5=A2=9E=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E5=85=A5=E5=BA=93=E5=8D=95=E5=AD=90=E8=A1=A8=E6=96=B9?= =?UTF-8?q?=E6=B3=95=20=E4=BB=93=E5=BA=93=E5=85=A5=E5=BA=93=E5=8D=95?= =?UTF-8?q?=E5=AE=9E=E4=BD=93=E7=B1=BB=E6=89=80=E6=9C=89=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=8A=A0=E4=B8=8A=E5=AD=97=E5=85=B8=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=20=E4=BB=93=E5=BA=93=E5=85=A5=E5=BA=93=E5=8D=95?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E5=8A=A0=E4=B8=8A=E7=89=A9=E6=96=99=E5=9E=8B?= =?UTF-8?q?=E5=8F=B7=E5=AD=97=E6=AE=B5=EF=BC=8Cmapper.xml=E6=89=80?= =?UTF-8?q?=E6=9C=89=E6=96=B9=E6=B3=95=E5=8A=A0=E4=B8=8A=E7=89=A9=E6=96=99?= =?UTF-8?q?=E5=9E=8B=E5=8F=B7=E5=AD=97=E6=AE=B5=20=E4=BB=93=E5=BA=93?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E5=8D=95=E8=AF=A6=E6=83=85=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=20=E6=89=B9=E9=87=8F=E6=8F=92=E5=85=A5=E4=BB=93=E5=BA=93?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E8=AF=A6=E6=83=85=E6=95=B0=E6=8D=AE=E6=96=B9?= =?UTF-8?q?=E6=B3=95=20=E6=8C=89=E7=85=A7prd=E8=B0=83=E6=95=B4=EF=BC=8C?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BB=93=E5=BA=93=E5=85=A5=E5=BA=93=E5=8D=95?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E5=88=97=E8=A1=A8=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/PurchaseOrderController.java | 12 +- .../ruoyi/purchase/domain/PurchaseOrder.java | 18 +- .../mapper/PurchaseStorageChildMapper.java | 5 + .../service/IPurchaseOrderService.java | 5 + .../impl/PurchaseOrderServiceImpl.java | 253 +++++++++- .../domain/WarehouseStorageOrder.java | 23 +- .../domain/WarehouseStorageOrderDetail.java | 16 +- .../WarehouseStorageOrderDetailMapper.java | 5 + .../mapper/purchase/PurchaseOrderMapper.xml | 7 +- .../purchase/PurchaseStorageChildMapper.xml | 86 ++++ .../WarehouseStorageOrderDetailMapper.xml | 133 ++++++ .../purchaseOrder/addPurchaseStorage.html | 132 +++++- .../purchase/purchaseOrder/purchaseOrder.html | 13 +- .../purchaseStorage/purchaseStorage.html | 446 +++++++++++------- 14 files changed, 937 insertions(+), 217 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseOrderController.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseOrderController.java index 50fc93eb..5c2ea0e2 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseOrderController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseOrderController.java @@ -214,15 +214,13 @@ public class PurchaseOrderController extends BaseController /** * 新增采购入库通知单 */ - @RequiresPermissions("purchase:purchaseOrder:addPurchaseOrderStorage") + @RequiresPermissions("purchase:purchaseOrder:addPurchaseStorage") @Log(title = "采购订单", businessType = BusinessType.INSERT) - @PostMapping("/addPurchaseOrderStorageSave") + @PostMapping("/addPurchaseStorage") @ResponseBody - public AjaxResult addPurchaseOrderStorageSave(@RequestBody WarehouseStorageOrder warehouseStorageOrder) { - // 数据校验,确保前端传入数据格式正确 - // 生成采购订单编号 - // 执行主表插入操作 - return toAjax(purchaseOrderService.addPurchaseOrderStorage(warehouseStorageOrder)); // 假设toAjax方法处理成功逻辑 + public AjaxResult addPurchaseStorageSave(@RequestBody PurchaseOrder purchaseOrder) { + + return toAjax(purchaseOrderService.addPurchaseStorageSave(purchaseOrder)); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrder.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrder.java index 55ddc6e9..fb1e7667 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrder.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrder.java @@ -31,8 +31,8 @@ public class PurchaseOrder extends BaseEntity @Excel(name = "采购计划单号") private String purchasePlanCode; - /** 采购入库状态(0待采购、1采购中、2待暂收、3部分暂收、4全部暂收、5已暂收、6待入库、7部分入库、8全部入库、9已入库) */ - @Excel(name = "采购入库状态",dictType = "eceiptStatus") + /** 入库状态(0待暂收、1已暂收、2待入库、3部分入库、4全部入库) */ + @Excel(name = "采购入库状态",dictType = "warehouse_storage_status") private String warehouseStorageStatus; /** 打款结案状态(0待打款、1部分打款、2全部打款、3部分结案、4已结案) */ @@ -67,6 +67,11 @@ public class PurchaseOrder extends BaseEntity @Excel(name = "入库数") private Integer storageSum; + /** 通知已到货总数 */ + @Excel(name = "通知已到货总数") + private Integer notifyHasArrivedSum; + + /** 不含税总价(RMB) */ @Excel(name = "不含税总价(RMB)") private BigDecimal noRmbSum; @@ -249,6 +254,14 @@ public class PurchaseOrder extends BaseEntity return noRmbSum; } + public Integer getNotifyHasArrivedSum() { + return notifyHasArrivedSum; + } + + public void setNotifyHasArrivedSum(Integer notifyHasArrivedSum) { + this.notifyHasArrivedSum = notifyHasArrivedSum; + } + public void setNoRmbSum(BigDecimal noRmbSum) { this.noRmbSum = noRmbSum; } @@ -457,6 +470,7 @@ public class PurchaseOrder extends BaseEntity .append("sharedInventoryOccupancySum", getSharedInventoryOccupancySum()) .append("refundsExchangesSum", getRefundsExchangesSum()) .append("storageSum", getStorageSum()) + .append("notifyHasArrivedSum", getNotifyHasArrivedSum()) .append("noRmbSum", getNoRmbSum()) .append("rmbSum", getRmbSum()) .append("eceiptType", getEceiptType()) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseStorageChildMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseStorageChildMapper.java index 9dcd401f..346edf6b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseStorageChildMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseStorageChildMapper.java @@ -74,4 +74,9 @@ public interface PurchaseStorageChildMapper * @return 结果 */ public int restorePurchaseStorageChildById(Long purchaseStorageChildId); + + /** + * 批量新增采购入库单子表 + * */ + int insertBatchPurchaseStorageChild(List purchaseStorageChildren); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseOrderService.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseOrderService.java index 40052372..06bff188 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseOrderService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseOrderService.java @@ -122,4 +122,9 @@ public interface IPurchaseOrderService AjaxResult uploadSingleFile(MultipartFile file,String purchaseOrderCode); + /** + * 创建采购入库单 + * */ + + int addPurchaseStorageSave(PurchaseOrder purchaseOrder); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderServiceImpl.java index 69273fba..1a424d63 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderServiceImpl.java @@ -31,10 +31,7 @@ import com.ruoyi.process.general.service.IProcessService; import com.ruoyi.process.todoitem.mapper.BizTodoItemMapper; import com.ruoyi.purchase.domain.*; import com.ruoyi.purchase.domain.Vo.*; -import com.ruoyi.purchase.mapper.PurchaseOrderChildMapper; -import com.ruoyi.purchase.mapper.PurchaseOrderMapper; -import com.ruoyi.purchase.mapper.PurchasePlanChildMapper; -import com.ruoyi.purchase.mapper.PurchasePlanMapper; +import com.ruoyi.purchase.mapper.*; import com.ruoyi.purchase.service.IPurchaseOrderService; import com.ruoyi.system.domain.SysAttachFile; import com.ruoyi.system.domain.SysCompanyInformation; @@ -97,12 +94,23 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService @Autowired private PurchasePlanMapper purchasePlanMapper; + + @Autowired + private PurchaseStorageMapper purchaseStorageMapper; + + + @Autowired + private PurchaseStorageChildMapper purchaseStorageChildMapper; + @Autowired private RedisCache redisCache; @Autowired private WarehouseStorageOrderMapper warehouseStorageOrderMapper; + @Autowired + private WarehouseStorageOrderDetailMapper warehouseStorageOrderDetailMapper; + @Autowired private WarehouseStorageOrderDetailMapper storageOrderDetailMapper; @@ -1156,6 +1164,243 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService } + /** + * 创建采购入库单 + * */ + @Transactional(rollbackFor = Exception.class) + @Override + public int addPurchaseStorageSave(PurchaseOrder purchaseOrder) { + Long purchaseOrderId = purchaseOrder.getPurchaseOrderId(); + + List purchaseOrderChildList = purchaseOrder.getPurchaseOrderChildList(); + + + //过滤掉通知已到货数为空的数据 + purchaseOrderChildList = purchaseOrderChildList.stream().filter(item -> item.getNotifyArriveNum() != null).collect(Collectors.toList()); + + boolean allNotifyArriveNum = purchaseOrderChildList.stream().allMatch(item -> item.getNotifyArriveNum() == 0); + if (allNotifyArriveNum){ + throw new BusinessException("通知到货数不能都为0"); + } + + + //过滤掉通知到货数为0的数据 + List filterPurchaseOrderChildList = purchaseOrderChildList.stream().filter(item -> item.getNotifyArriveNum() != 0).collect(Collectors.toList()); + + + purchaseOrder = purchaseOrderMapper.selectPurchaseOrderById(purchaseOrderId); + + + String warehouseStorageCode = redisCache.generateBillNo("RK"); + + + //生成采购入库单子表 + buildPurchaseStorageChild(purchaseOrder, warehouseStorageCode,filterPurchaseOrderChildList); + + //生成采购入库单主表 + buildPurchaseStorage(purchaseOrder, filterPurchaseOrderChildList, warehouseStorageCode); + + //生成仓库入库单 + buildWarehouseStorage(purchaseOrder, warehouseStorageCode,filterPurchaseOrderChildList); + + //生成仓库入库单子表 + buildWarehouseChild(purchaseOrder, warehouseStorageCode,filterPurchaseOrderChildList); + + //更新采购订单子表 + updatePurchaseOrderChildData(purchaseOrder, filterPurchaseOrderChildList); + + int allNotifyArrivedNum = filterPurchaseOrderChildList.stream().mapToInt(PurchaseOrderChild::getNotifyArriveNum).sum(); + int allNotifyHasArrivedNum = filterPurchaseOrderChildList.stream().mapToInt(PurchaseOrderChild::getNotifyHasArrivedNum).sum(); + + if (allNotifyHasArrivedNum == 0){ + purchaseOrder.setNotifyHasArrivedSum(allNotifyArrivedNum); + }else { + purchaseOrder.setNotifyHasArrivedSum(allNotifyHasArrivedNum + allNotifyArrivedNum); + } + + if (purchaseOrder.getNotifyHasArrivedSum().equals(purchaseOrder.getActualPurchaseSum())){ + purchaseOrder.setWarehouseStorageStatus("4"); + }if (purchaseOrder.getNotifyHasArrivedSum() < purchaseOrder.getActualPurchaseSum()){ + purchaseOrder.setWarehouseStorageStatus("3"); + } + + return purchaseOrderMapper.updatePurchaseOrder(purchaseOrder); + } + + //采购入库更新采购订单子表的数据 + private void updatePurchaseOrderChildData(PurchaseOrder purchaseOrder, List filterPurchaseOrderChildList) { + + for (PurchaseOrderChild purchaseOrderChild : filterPurchaseOrderChildList) { + if (purchaseOrderChild.getNotifyHasArrivedNum() == 0 || purchaseOrderChild.getNotifyHasArrivedNum() == null){ + purchaseOrderChild.setNotifyHasArrivedNum(purchaseOrderChild.getNotifyArriveNum()); + }else { + purchaseOrderChild.setNotifyHasArrivedNum(purchaseOrderChild.getNotifyHasArrivedNum() + purchaseOrderChild.getNotifyArriveNum()); + } + int updatePurchaseOrderChild = purchaseOrderChildMapper.updatePurchaseOrderChild(purchaseOrderChild); + if (updatePurchaseOrderChild <= 0){ + throw new BusinessException("更新采购订单子表数据失败"); + } + } + } + + + //采购入库生成采购入库单主表 + private void buildPurchaseStorage(PurchaseOrder purchaseOrder, List filterPurchaseOrderChildList, String warehouseStorageCode) { + PurchaseStorage purchaseStorage = new PurchaseStorage(); + + PurchaseOrderChild purchaseOrderChild = filterPurchaseOrderChildList.get(0); + purchaseStorage.setWarehouseStorageStatus("0"); + purchaseStorage.setWarehouseStorageType("5"); + purchaseStorage.setWarehouseDeptType(purchaseOrderChild.getWarehouseDept()); + purchaseStorage.setWarehouseQualityStatus("0"); + purchaseStorage.setWarehouseOrderType("0"); + + + purchaseStorage.setArrivedTime(purchaseOrder.getArrivedTime()); + purchaseStorage.setRelatedOrderCode(purchaseOrder.getPurchaseOrderCode()); + purchaseStorage.setSupplierCode(purchaseOrder.getSupplierCode()); + purchaseStorage.setSupplierName(purchaseOrder.getSupplierName()); + purchaseStorage.setWarehouseStorageCode(warehouseStorageCode); + + int allNotifyArrivedNum = filterPurchaseOrderChildList.stream().mapToInt(PurchaseOrderChild::getNotifyArriveNum).sum(); + int allNotifyHasArrivedNum = filterPurchaseOrderChildList.stream().mapToInt(PurchaseOrderChild::getNotifyHasArrivedNum).sum(); + + if (allNotifyHasArrivedNum == 0){ + purchaseStorage.setNotifyArrivedSum(allNotifyArrivedNum); + }else { + purchaseStorage.setNotifyArrivedSum(allNotifyHasArrivedNum + allNotifyArrivedNum); + } + purchaseStorage.setActualArrivedSum(allNotifyArrivedNum); + int insertResult = purchaseStorageMapper.insertPurchaseStorage(purchaseStorage); + if (insertResult <= 0){ + throw new BusinessException("生成采购入库单数据失败"); + } + + } + + //采购入库生成仓库入库主表数据 + private void buildWarehouseStorage(PurchaseOrder purchaseOrder, String warehouseStorageCode, List filterPurchaseOrderChildList) { + + PurchaseOrderChild purchaseOrderChild = filterPurchaseOrderChildList.get(0); + WarehouseStorageOrder warehouseStorageOrder = new WarehouseStorageOrder(); + warehouseStorageOrder.setWarehouseStorageCode(warehouseStorageCode); + warehouseStorageOrder.setWarehouseStorageStatus("0"); + warehouseStorageOrder.setWarehouseStorageType("5"); + warehouseStorageOrder.setWarehouseDeptType(purchaseOrderChild.getWarehouseDept()); + warehouseStorageOrder.setWarehouseQualityStatus("0"); + warehouseStorageOrder.setWarehouseOrderType("0"); + int allNotifyArrivedNum = filterPurchaseOrderChildList.stream().mapToInt(PurchaseOrderChild::getNotifyArriveNum).sum(); + int allNotifyHasArrivedNum = filterPurchaseOrderChildList.stream().mapToInt(PurchaseOrderChild::getNotifyHasArrivedNum).sum(); + if (allNotifyHasArrivedNum == 0){ + warehouseStorageOrder.setNotifyArrivedNum(allNotifyArrivedNum); + }else { + warehouseStorageOrder.setNotifyArrivedNum(allNotifyHasArrivedNum + allNotifyArrivedNum); + } + warehouseStorageOrder.setActualArrivedNum(allNotifyArrivedNum); + warehouseStorageOrder.setArrivedTime(purchaseOrder.getArrivedTime()); + warehouseStorageOrder.setRelatedOrderCode(purchaseOrder.getPurchaseOrderCode()); + warehouseStorageOrder.setCreateTime(new Date()); + warehouseStorageOrder.setCreateBy(ShiroUtils.getLoginName()); + + int insertResult = warehouseStorageOrderMapper.insertWarehouseStorageOrder(warehouseStorageOrder); + if (insertResult <= 0){ + throw new BusinessException("生成仓库入库单数据失败"); + } + + } + + //采购入库生成仓库入库子表数据 + private void buildWarehouseChild(PurchaseOrder purchaseOrder, String warehouseStorageCode, List filterPurchaseOrderChildList) { + + String purchaseOrderCode = purchaseOrder.getPurchaseOrderCode(); + List warehouseStorageOrderDetailChildren = new ArrayList<>(); + for (PurchaseOrderChild purchaseOrderChild : filterPurchaseOrderChildList) { + WarehouseStorageOrderDetail warehouseStorageOrderDetail = new WarehouseStorageOrderDetail(); + warehouseStorageOrderDetail.setWarehouseStorageCode(warehouseStorageCode); + warehouseStorageOrderDetail.setRelatedOrderCode(purchaseOrderCode); + warehouseStorageOrderDetail.setMaterialNo(purchaseOrderChild.getMaterialNo()); + warehouseStorageOrderDetail.setMaterialName(purchaseOrderChild.getMaterialName()); + warehouseStorageOrderDetail.setMaterialPhotourl(purchaseOrderChild.getMaterialPhotourl()); + warehouseStorageOrderDetail.setMaterialBrand(purchaseOrderChild.getMaterialBrand()); + warehouseStorageOrderDetail.setMaterialDescribe(purchaseOrderChild.getMaterialDescribe()); + warehouseStorageOrderDetail.setMaterialModel(purchaseOrderChild.getMaterialModel()); + warehouseStorageOrderDetail.setMaterialProcessMethod(purchaseOrderChild.getMaterialProcessMethod()); + warehouseStorageOrderDetail.setMaterialUnit(purchaseOrderChild.getMaterialUnit()); + warehouseStorageOrderDetail.setMaterialPhotourl(purchaseOrderChild.getMaterialPhotourl()); + warehouseStorageOrderDetail.setMaterialType(purchaseOrderChild.getMaterialType()); + warehouseStorageOrderDetail.setMaterialDeptType(purchaseOrderChild.getWarehouseDept()); + warehouseStorageOrderDetail.setArrivedTime(purchaseOrderChild.getPlanDeliveryTime()); + warehouseStorageOrderDetail.setCreateTime(new Date()); + warehouseStorageOrderDetail.setCreateBy(ShiroUtils.getLoginName()); + Integer notifyArriveNum = purchaseOrderChild.getNotifyArriveNum(); + Integer notifyHasArrivedNum = purchaseOrderChild.getNotifyHasArrivedNum(); + + //通知到货数<= 实际采购数 + if (notifyArriveNum > purchaseOrderChild.getActualPurchaseNum()){ + throw new BusinessException("通知到货数不能大于实际采购数"); + } + + if (notifyHasArrivedNum == null){ + warehouseStorageOrderDetail.setNotifyHasArrivedNum(notifyArriveNum); + }else { + warehouseStorageOrderDetail.setNotifyHasArrivedNum(notifyHasArrivedNum + notifyArriveNum); + } + warehouseStorageOrderDetail.setActualArriveNum(notifyArriveNum); + warehouseStorageOrderDetailChildren.add(warehouseStorageOrderDetail); + } + int result = warehouseStorageOrderDetailMapper.insertBatchWarehouseStorageOrderDetail(warehouseStorageOrderDetailChildren); + if (result <= 0){ + throw new RuntimeException("生成仓库入库子表数据失败"); + } + } + + + + + //采购入库生成采购入库子表数据 + private void buildPurchaseStorageChild(PurchaseOrder purchaseOrder, String warehouseStorageCode, List purchaseOrderChildList) { + String purchaseOrderCode = purchaseOrder.getPurchaseOrderCode(); + List purchaseStorageChildren = new ArrayList<>(); + for (PurchaseOrderChild purchaseOrderChild : purchaseOrderChildList) { + PurchaseStorageChild purchaseStorageChild = new PurchaseStorageChild(); + purchaseStorageChild.setWarehouseStorageCode(warehouseStorageCode); + purchaseStorageChild.setRelatedOrderCode(purchaseOrderCode); + purchaseStorageChild.setMaterialNo(purchaseOrderChild.getMaterialNo()); + purchaseStorageChild.setMaterialName(purchaseOrderChild.getMaterialName()); + purchaseStorageChild.setMaterialBrand(purchaseOrderChild.getMaterialBrand()); + purchaseStorageChild.setMaterialDescribe(purchaseOrderChild.getMaterialDescribe()); + purchaseStorageChild.setMaterialPhotourl(purchaseOrderChild.getMaterialPhotourl()); + purchaseStorageChild.setMaterialModel(purchaseOrderChild.getMaterialModel()); + purchaseStorageChild.setMaterialProcessMethod(purchaseOrderChild.getMaterialProcessMethod()); + purchaseStorageChild.setMaterialUnit(purchaseOrderChild.getMaterialUnit()); + purchaseStorageChild.setMaterialPhotourl(purchaseOrderChild.getMaterialPhotourl()); + purchaseStorageChild.setMaterialType(purchaseOrderChild.getMaterialType()); + purchaseStorageChild.setMaterialDeptType(purchaseOrderChild.getWarehouseDept()); + purchaseStorageChild.setArrivedTime(purchaseOrderChild.getPlanDeliveryTime()); + purchaseStorageChild.setCreateTime(new Date()); + purchaseStorageChild.setCreateBy(ShiroUtils.getLoginName()); + Integer notifyArriveNum = purchaseOrderChild.getNotifyArriveNum(); + Integer notifyHasArrivedNum = purchaseOrderChild.getNotifyHasArrivedNum(); + + //通知到货数<= 实际采购数 + if (notifyArriveNum > purchaseOrderChild.getActualPurchaseNum()){ + throw new BusinessException("通知到货数不能大于实际采购数"); + } + + if (notifyHasArrivedNum == null){ + purchaseStorageChild.setNotifyHasArrivedNum(notifyArriveNum); + }else { + purchaseStorageChild.setNotifyHasArrivedNum(notifyHasArrivedNum + notifyArriveNum); + } + purchaseStorageChild.setActualArriveNum(notifyArriveNum); + purchaseStorageChildren.add(purchaseStorageChild); + } + int result = purchaseStorageChildMapper.insertBatchPurchaseStorageChild(purchaseStorageChildren); + if (result <= 0){ + throw new RuntimeException("生成采购入库子表数据失败"); + } + } + /** * 启动流程实例 * */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseStorageOrder.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseStorageOrder.java index 1c10a17f..659e1ddc 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseStorageOrder.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseStorageOrder.java @@ -28,27 +28,28 @@ public class WarehouseStorageOrder extends BaseEntity private String warehouseStorageCode; /** 关联订单号(多种订单类型) */ - @Excel(name = "关联订单号", readConverterExp = "多=种订单类型") + @Excel(name = "关联订单号") private String relatedOrderCode; - /** 仓库入库状态 */ - @Excel(name = "仓库入库状态") + /** 仓库入库状态(0待暂收、1已暂收、2待入库、3部分入库、4全部入库) */ + @Excel(name = "仓库入库状态",dictType = "warehouse_storage_status") private String warehouseStorageStatus; - /** 仓库品质状态 */ - @Excel(name = "仓库品质状态") + /** 品质状态(0待品质、1部分品质、2全部品质) */ + @Excel(name = "品质状态",dictType = "warehouse_quality_status") private String warehouseQualityStatus; - /** 仓库入库类型 */ - @Excel(name = "仓库入库类型") + + /** 入库类型(0采购入库、1供应商补货、2委内入库、3公司退货、4委外入库、5生产入库) */ + @Excel(name = "入库类型",dictType ="warehouse_storage_type" ) private String warehouseStorageType; - /** 仓库订单类型 */ - @Excel(name = "仓库订单类型") + /** 订单类型(0采购订单、1生产订单、2退换货订单、3委外订单) */ + @Excel(name = "订单类型",dictType = "storage_order_type") private String warehouseOrderType; - /** 仓库入库部门类型 */ - @Excel(name = "仓库入库部门类型") + /** 入库部门类型(0仓库,1采购 ) */ + @Excel(name = "入库部门类型",dictType = "warehouse_dept_type") private String warehouseDeptType; /** 通知已到货数量 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseStorageOrderDetail.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseStorageOrderDetail.java index 0d536378..ea163c81 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseStorageOrderDetail.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseStorageOrderDetail.java @@ -105,6 +105,10 @@ public class WarehouseStorageOrderDetail extends BaseEntity @Excel(name = "物料图片地址") private String materialPhotourl; + /** 物料型号*/ + @Excel(name = "物料型号") + private String materialModel; + /** 物料品牌 */ @Excel(name = "物料品牌") private String materialBrand; @@ -445,7 +449,16 @@ public class WarehouseStorageOrderDetail extends BaseEntity { return materialBrand; } - public void setMaterialUnit(String materialUnit) + + public String getMaterialModel() { + return materialModel; + } + + public void setMaterialModel(String materialModel) { + this.materialModel = materialModel; + } + + public void setMaterialUnit(String materialUnit) { this.materialUnit = materialUnit; } @@ -745,6 +758,7 @@ public class WarehouseStorageOrderDetail extends BaseEntity .append("materialType", getMaterialType()) .append("materialPhotourl", getMaterialPhotourl()) .append("materialBrand", getMaterialBrand()) + .append("materialModel", getMaterialModel()) .append("materialUnit", getMaterialUnit()) .append("materialDescribe", getMaterialDescribe()) .append("materialProcessMethod", getMaterialProcessMethod()) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseStorageOrderDetailMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseStorageOrderDetailMapper.java index 4ccba705..4f6b55aa 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseStorageOrderDetailMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseStorageOrderDetailMapper.java @@ -114,4 +114,9 @@ public interface WarehouseStorageOrderDetailMapper * */ int updateWarehouseStorageOrderDetailByCode(WarehouseStorageOrderDetail storageOrderDetail); + /** + * 批量插入仓库入库详情数据 + * */ + int insertBatchWarehouseStorageOrderDetail(List warehouseStorageOrderDetailChildren); + } diff --git a/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderMapper.xml b/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderMapper.xml index b1fe8d8d..22d39026 100644 --- a/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderMapper.xml @@ -17,6 +17,7 @@ + @@ -45,7 +46,7 @@ - select purchase_order_id, purchase_order_code, purchase_plan_code, warehouse_storage_status, payment_status, supplier_code, supplier_name, material_sum, actual_purchase_sum, shared_inventory_occupancy_sum, refunds_exchanges_sum, storage_sum, noRmb_sum, rmb_sum, eceipt_type, arrived_time, stock_no, stock_name, receive_person, receive_person_phone, receive_address, purchase_buyer, use_status, audit_status, create_by, create_time, update_by, update_time, del_flag, instance_id, instance_type, submit_instance_id, cancel_instance_id, restore_instance_id, apply_title, apply_user, apply_time from purchase_order + select purchase_order_id, purchase_order_code, purchase_plan_code, warehouse_storage_status, payment_status, supplier_code, supplier_name, material_sum, actual_purchase_sum, shared_inventory_occupancy_sum, refunds_exchanges_sum, storage_sum, notify_has_arrived_sum,noRmb_sum, rmb_sum, eceipt_type, arrived_time, stock_no, stock_name, receive_person, receive_person_phone, receive_address, purchase_buyer, use_status, audit_status, create_by, create_time, update_by, update_time, del_flag, instance_id, instance_type, submit_instance_id, cancel_instance_id, restore_instance_id, apply_title, apply_user, apply_time from purchase_order +
@@ -69,6 +70,76 @@ $("#form-addPurchaseStorage-edit").validate({ focusCleanup: true}); + + + function submitHandler() { + // 获取表单数据 + const purchaseStorageData = $("#form-addPurchaseStorage-edit").serializeArray().reduce((obj, item) => { + obj[item.name] = item.value; + return obj; + }, {}); + + + var table = $('#bootstrap-table').bootstrapTable("getSelections"); + + + if (table.length === 0){ + $.modal.alertWarning("请至少选择一条要入库的物料"); + return; + } + + // 检查是否有同时存在 warehouseDept 为 1 和 0 的记录 + var hasWarehouseDept1 = false; + var hasWarehouseDept0 = false; + for (var i = 0; i < table.length; i++) { + var warehouseDept = table[i].warehouseDept; + if (warehouseDept === "1") { + hasWarehouseDept1 = true; + } else if (warehouseDept === "0") { + hasWarehouseDept0 = true; + } + } + + if (hasWarehouseDept1 && hasWarehouseDept0) { + $.modal.alertWarning("入库物料中同时包含仓库入库和采购入库,需要分开入库"); + return; + } + + var materialDataList = table.map(function(item) { + // 根据实际字段名调整 + return { + "purchaseOrderChildId":item.purchaseOrderChildId, + "materialNo": item.materialNo, + "materialName": item.materialName, + "materialPhotourl" : item.materialPhotourl, + "materialType": item.materialType, + "materialDescribe": item.materialDescribe, + "materialBrand": item.materialBrand, + "materialUnit": item.materialUnit, + "materialProcessMethod": item.materialProcessMethod, + "warehouseDept": item.warehouseDept, + "planPurchaseNum": item.planPurchaseNum, + "actualPurchaseNum": item.actualPurchaseNum, + "planDeliveryTime": item.planDeliveryTime, + "notifyHasArrivedNum": item.notifyHasArrivedNum, + "temporaryNum": item.temporaryNum, + "hasStorageNum": item.hasStorageNum, + "notifyArriveNum": item.notifyArriveNum, + }; + }); + + const combinedData = Object.assign({}, purchaseStorageData, { + purchaseOrderChildList: materialDataList, + }); + // 合并表单数据和表格数据 + console.log(combinedData) + // 使用 JSON.stringify() 序列化数据 + const jsonData = JSON.stringify(combinedData); + // 发送 AJAX 请求到后端接口 + $.operate.saveJson(prefix + "/addPurchaseStorage", jsonData); + } + + //物料信息展示列表 $(function() { var options = { @@ -83,7 +154,11 @@ columns: [{ checkbox: true }, - + { + field: 'purchaseOrderChildId', + title: '主键', + visible: false + }, { title: '料号', field: 'materialNo', @@ -92,6 +167,11 @@ title: '物料名称', field: 'materialName', }, + { + title: '图片', + field: 'materialPhotourl', + visible: false + }, { title: '物料类型', field: 'materialType', @@ -127,7 +207,7 @@ }, { title: '物料入库部门', - field: 'materialDeptType', + field: 'warehouseDept', formatter:function (value) { return $.table.selectDictLabel(warehouseDeptDatas, value); } @@ -141,7 +221,51 @@ {title: '已入库数',field: 'hasStorageNum', }, - {title: '通知到货数',field: 'notifyArriveNum' + {title: '通知到货数',field: 'notifyArriveNum', + editable: { + //动态禁用行内编辑 + noEditFormatter: function(value, row, index){ + if (row.temporaryNum === row.actualPurchaseNum || row.actualPurchaseNum === row.notifyHasArrivedNum){ + return "不可入库"; + }else { + return false; + } + }, + validate: function(value) { + if ($.trim(value) === '') { + return '通知到货数不能为空'; + } + if (isNaN(value)) { + return '请输入有效的数字'; + } + if (value < 0) { + return '通知到货数不能小于0'; + } + //不能为小数 + if (value % 1 !== 0) { + return '本次验收数不能为小数'; + } + }, + }, + formatter: function (value, row) { + // 检查 row 是否存在 + if (!row) { + return ""; + } + + // 检查 notifyArriveNum 是否存在 + if (row.notifyArriveNum === undefined || row.notifyArriveNum === null) { + return ""; + } + + // 根据 notifyArriveNum 的值决定返回值 + if (row.notifyArriveNum) { + return row.notifyArriveNum; + } else { + return value; + } + } + } ] }; diff --git a/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/purchaseOrder.html b/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/purchaseOrder.html index 0643b3b2..41d3336a 100644 --- a/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/purchaseOrder.html +++ b/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/purchaseOrder.html @@ -20,7 +20,7 @@
  • - @@ -75,7 +75,7 @@ var addPurchaseStorageFlag = [[${@permission.hasPermi('purchase:purchaseOrder:addPurchaseStorage')}]]; - var warehouseStorageStatusDatas = [[${@dict.getType('eceiptStatus')}]]; + var warehouseStorageStatusDatas = [[${@dict.getType('warehouse_storage_status')}]]; var paymentStatusDatas = [[${@dict.getType('sys_pay_close')}]]; var useStatusDatas = [[${@dict.getType('useStatus')}]]; var auditStatusDatas = [[${@dict.getType('auditStatus')}]]; @@ -239,8 +239,12 @@ if(row.auditStatus=="1" && row.useStatus=="1" && !row.cancelInstanceId) { // 作废 actions.push(' 作废'); - //入库通知 - actions.push(' 入库通知'); + + //入库状态(0待暂收、1已暂收、2待入库、3部分入库、4全部入库) + if(row.warehouseStorageStatus=="2" || row.warehouseStorageStatus=="3"){ + //入库通知 + actions.push(' 入库通知'); + } // 已作废 } @@ -344,6 +348,7 @@ //入库通知 function addPurchaseStorage(purchaseOrderId) { + //入库状态(0待暂收、1已暂收、2待入库、3部分入库、4全部入库) var url = prefix + "/addPurchaseStorage/" + purchaseOrderId; $.modal.open("入库通知", url); } diff --git a/ruoyi-admin/src/main/resources/templates/purchase/purchaseStorage/purchaseStorage.html b/ruoyi-admin/src/main/resources/templates/purchase/purchaseStorage/purchaseStorage.html index c3580eed..f7a34c29 100644 --- a/ruoyi-admin/src/main/resources/templates/purchase/purchaseStorage/purchaseStorage.html +++ b/ruoyi-admin/src/main/resources/templates/purchase/purchaseStorage/purchaseStorage.html @@ -1,196 +1,276 @@ - + -
    -
    -
    -
    -
    -
      -
    • - - -
    • -
    • - - -
    • -
    • - - -
    • -
    • - - -
    • - -
    • - - -
    • -
    • - - -
    • -
    • - - - - - -
    • -
    • -  搜索 -  重置 -
    • -
    -
    -
    -
    +
    +
    +
    +
    +
    +
      +
    • + + +
    • +
    • + + +
    • +
    • + + +
    • +
    • + + +
    • +
    • + + +
    • +
    • + + +
    • +
    • + + +
    • +
    • + + +
    • +
    • + + +
    • +
    • + + + - + +
    • +
    • +  搜索 +  重置 +
    • +
    +
    +
    +
    - -
    -
    -
    + +
    +
    - - + $.table.init(options); + }); + \ No newline at end of file From 6a18a33ee778515edc55bf3cf91137ca0d57e520 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Thu, 21 Nov 2024 11:27:58 +0800 Subject: [PATCH 2/9] =?UTF-8?q?[feat]=E9=87=87=E8=B4=AD=E7=AE=A1=E7=90=86?= =?UTF-8?q?=20=E4=BF=AE=E5=A4=8D=E6=B7=BB=E5=8A=A0=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E5=8D=95=E5=89=8D=E7=AB=AF=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=EF=BC=8C=E7=89=A9=E6=96=99=E7=B1=BB=E5=9E=8B=E4=B8=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=80=BC=E7=9A=84=E9=97=AE=E9=A2=98=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E9=87=87=E8=B4=AD=E5=85=A5=E5=BA=93=E5=8D=95=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5=E9=9D=A2=EF=BC=8C=E6=96=B0=E5=A2=9E=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E6=8C=89=E9=92=AE=E5=92=8C=E6=96=B9=E6=B3=95=20?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E5=85=A5=E5=BA=93=E5=8D=95=E5=AD=90=E8=A1=A8?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E9=80=9A=E8=BF=87=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E5=8D=95=E5=8F=B7=E6=9F=A5=E8=AF=A2=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E5=85=A5=E5=BA=93=E5=8D=95=E5=AD=90=E8=A1=A8=E6=96=B9?= =?UTF-8?q?=E6=B3=95=20=E9=87=87=E8=B4=AD=E5=85=A5=E5=BA=93=E5=8D=95?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E4=BF=9D=E5=AD=98=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E5=8D=95=E8=AF=A6=E6=83=85=E6=96=B9=E6=B3=95?= =?UTF-8?q?=20=E9=87=87=E8=B4=AD=E5=85=A5=E5=BA=93=E5=8D=95=E5=AD=90?= =?UTF-8?q?=E8=A1=A8=E6=96=B0=E5=A2=9E=20=E6=A0=B9=E6=8D=AE=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E5=85=A5=E5=BA=93=E5=8D=95=E5=8F=B7=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E5=85=A5=E5=BA=93=E5=8D=95=E5=AD=90=E8=A1=A8?= =?UTF-8?q?=E6=96=B9=E6=B3=95=20=E9=87=87=E8=B4=AD=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E5=8D=95Controller1=E6=96=B0=E5=A2=9E=20=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E5=8D=95=E8=AF=A6=E6=83=85=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E3=80=82=E6=96=B0=E5=A2=9E=E4=BF=AE=E6=94=B9=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E5=85=A5=E5=BA=93=E5=8D=95=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=EF=BC=8C=E6=96=B0=E5=A2=9E=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E5=85=A5=E5=BA=93=E5=8D=95=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E7=89=A9=E6=96=99=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/PurchaseStorageController.java | 47 +++ .../mapper/PurchaseStorageChildMapper.java | 5 + .../service/IPurchaseStorageChildService.java | 5 + .../service/IPurchaseStorageService.java | 6 + .../impl/PurchaseStorageChildServiceImpl.java | 11 + .../impl/PurchaseStorageServiceImpl.java | 12 + .../purchase/PurchaseStorageChildMapper.xml | 7 +- .../purchaseOrder/addPurchaseStorage.html | 2 +- .../purchase/purchaseStorage/detail.html | 302 ++++++------------ .../purchaseStorage/purchaseStorage.html | 8 +- 10 files changed, 189 insertions(+), 216 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseStorageController.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseStorageController.java index d4a20160..7f4de215 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseStorageController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseStorageController.java @@ -1,6 +1,9 @@ package com.ruoyi.purchase.controller; import java.util.List; + +import com.ruoyi.purchase.domain.PurchaseStorageChild; +import com.ruoyi.purchase.service.IPurchaseStorageChildService; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -34,6 +37,10 @@ public class PurchaseStorageController extends BaseController @Autowired private IPurchaseStorageService purchaseStorageService; + @Autowired + private IPurchaseStorageChildService purchaseStorageChildService; + + @RequiresPermissions("purchase:purchaseStorage:view") @GetMapping() public String purchaseStorage() @@ -112,6 +119,46 @@ public class PurchaseStorageController extends BaseController return toAjax(purchaseStorageService.updatePurchaseStorage(purchaseStorage)); } + + /** + * 采购入库单详情 + * + * */ + @GetMapping("/detail/{purchaseStorageId}") + public String detail(@PathVariable("purchaseStorageId") Long purchaseStorageId, ModelMap mmap) + { + PurchaseStorage purchaseStorage = purchaseStorageService.selectPurchaseStorageById(purchaseStorageId); + mmap.put("purchaseStorage", purchaseStorage); + return prefix + "/detail"; + } + + /** + * 修改保存采购入库单详情 + */ + @Log(title = "采购入库单", businessType = BusinessType.UPDATE) + @PostMapping("/detail") + @ResponseBody + public AjaxResult detailSave(PurchaseStorage purchaseStorage) + { + return toAjax(purchaseStorageService.detailPurchaseStorage(purchaseStorage)); + } + + + /** + * 查询采购入库单详情物料信息 + */ + @PostMapping("/selectStorageChildMaterialList") + @ResponseBody + public TableDataInfo selectStorageChildMaterialList(PurchaseStorage purchaseStorage) + { + startPage(); + + String warehouseStorageCode = purchaseStorage.getWarehouseStorageCode(); + List list = purchaseStorageChildService.selectPurchaseStorageChildListByCode(warehouseStorageCode); + return getDataTable(list); + } + + /** * 删除采购入库单 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseStorageChildMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseStorageChildMapper.java index 346edf6b..f0163dc3 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseStorageChildMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseStorageChildMapper.java @@ -79,4 +79,9 @@ public interface PurchaseStorageChildMapper * 批量新增采购入库单子表 * */ int insertBatchPurchaseStorageChild(List purchaseStorageChildren); + + /** + * 根据采购入库单号查询采购入库单子表 + * */ + List selectPurchaseStorageChildListByCode(String warehouseStorageCode); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseStorageChildService.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseStorageChildService.java index 8bd07eac..f8e61e34 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseStorageChildService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseStorageChildService.java @@ -72,4 +72,9 @@ public interface IPurchaseStorageChildService * @return */ int restorePurchaseStorageChildById(Long purchaseStorageChildId); + + /** + * 通过采购入库单号查询采购入库单子表 + * */ + List selectPurchaseStorageChildListByCode(String warehouseStorageCode); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseStorageService.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseStorageService.java index 22dc2dd7..0ecd03b7 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseStorageService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseStorageService.java @@ -72,4 +72,10 @@ public interface IPurchaseStorageService * @return */ int restorePurchaseStorageById(Long purchaseStorageId); + + /** + * 保存采购入库单详情 + * + * */ + int detailPurchaseStorage(PurchaseStorage purchaseStorage); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseStorageChildServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseStorageChildServiceImpl.java index 330f3673..b00d5d7f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseStorageChildServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseStorageChildServiceImpl.java @@ -46,6 +46,17 @@ public class PurchaseStorageChildServiceImpl implements IPurchaseStorageChildSer return purchaseStorageChildMapper.selectPurchaseStorageChildList(purchaseStorageChild); } + /** + * 根据采购入库单号查询采购入库单子表列表 + * + * @param warehouseStorageCode 采购入库单号 + * @return 采购入库单子表 + */ + @Override + public List selectPurchaseStorageChildListByCode(String warehouseStorageCode) { + return purchaseStorageChildMapper.selectPurchaseStorageChildListByCode(warehouseStorageCode); + } + /** * 新增采购入库单子表 * diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseStorageServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseStorageServiceImpl.java index e20cbef3..edb384cd 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseStorageServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseStorageServiceImpl.java @@ -76,6 +76,18 @@ public class PurchaseStorageServiceImpl implements IPurchaseStorageService return purchaseStorageMapper.updatePurchaseStorage(purchaseStorage); } + + /** + * 详情采购入库单 + * + * @param purchaseStorage 采购入库单 + * @return 结果 + */ + @Override + public int detailPurchaseStorage(PurchaseStorage purchaseStorage) { + return 1; + } + /** * 删除采购入库单对象 * diff --git a/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseStorageChildMapper.xml b/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseStorageChildMapper.xml index b300c968..d767ecce 100644 --- a/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseStorageChildMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseStorageChildMapper.xml @@ -59,7 +59,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where purchase_storage_child_id = #{purchaseStorageChildId} - + + + insert into purchase_storage_child diff --git a/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/addPurchaseStorage.html b/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/addPurchaseStorage.html index 73e092f4..bddec91a 100644 --- a/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/addPurchaseStorage.html +++ b/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/addPurchaseStorage.html @@ -176,7 +176,7 @@ title: '物料类型', field: 'materialType', formatter: function (value,row, index) { - $.table.selectCategoryLabel(materialTypeDatas, value) + return $.table.selectCategoryLabel(materialTypeDatas, value) } }, { diff --git a/ruoyi-admin/src/main/resources/templates/purchase/purchaseStorage/detail.html b/ruoyi-admin/src/main/resources/templates/purchase/purchaseStorage/detail.html index 8ecfe64a..b07de413 100644 --- a/ruoyi-admin/src/main/resources/templates/purchase/purchaseStorage/detail.html +++ b/ruoyi-admin/src/main/resources/templates/purchase/purchaseStorage/detail.html @@ -3,194 +3,115 @@ -
    -
    - + + +
    + +
    + +
    +
    - +
    - +
    - +
    - +
    + +
    - +
    - +
    -
    - -
    -
    - -
    + + + + + +
    +
    +
    +
    - +
    +
    - diff --git a/ruoyi-admin/src/main/resources/templates/purchase/purchaseStorage/purchaseStorage.html b/ruoyi-admin/src/main/resources/templates/purchase/purchaseStorage/purchaseStorage.html index f7a34c29..1131ddcd 100644 --- a/ruoyi-admin/src/main/resources/templates/purchase/purchaseStorage/purchaseStorage.html +++ b/ruoyi-admin/src/main/resources/templates/purchase/purchaseStorage/purchaseStorage.html @@ -263,7 +263,7 @@ align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('编辑 '); + actions.push('详情 '); var actionLinks = actions.join(''); return $.table.dropdownToggle(actionLinks); } @@ -271,6 +271,12 @@ }; $.table.init(options); }); + + //详情 + function detail(purchaseStorageId) { + var url = prefix + "/detail/" + purchaseStorageId; + $.modal.open("详情", url); + } \ No newline at end of file From 75b786d6520952e7e0b22c1fae887c3395acf79e Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Thu, 21 Nov 2024 14:54:47 +0800 Subject: [PATCH 3/9] =?UTF-8?q?[fix]=E9=87=87=E8=B4=AD=E7=AE=A1=E7=90=86?= =?UTF-8?q?=20=E4=BF=AE=E5=A4=8D=E9=87=87=E8=B4=AD=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=B8=8D=E5=87=86=E7=A1=AE=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95=E7=9A=84=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E4=B8=8D=E5=87=86=E7=A1=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/PurchaseOrderServiceImpl.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderServiceImpl.java index 1a424d63..e71b9598 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderServiceImpl.java @@ -1206,18 +1206,19 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService //生成仓库入库单子表 buildWarehouseChild(purchaseOrder, warehouseStorageCode,filterPurchaseOrderChildList); - //更新采购订单子表 - updatePurchaseOrderChildData(purchaseOrder, filterPurchaseOrderChildList); - int allNotifyArrivedNum = filterPurchaseOrderChildList.stream().mapToInt(PurchaseOrderChild::getNotifyArriveNum).sum(); int allNotifyHasArrivedNum = filterPurchaseOrderChildList.stream().mapToInt(PurchaseOrderChild::getNotifyHasArrivedNum).sum(); - if (allNotifyHasArrivedNum == 0){ + if (purchaseOrder.getNotifyHasArrivedSum() == null || purchaseOrder.getNotifyHasArrivedSum() == 0 ){ purchaseOrder.setNotifyHasArrivedSum(allNotifyArrivedNum); }else { - purchaseOrder.setNotifyHasArrivedSum(allNotifyHasArrivedNum + allNotifyArrivedNum); + purchaseOrder.setNotifyHasArrivedSum(allNotifyArrivedNum + purchaseOrder.getNotifyHasArrivedSum()); } + + //更新采购订单子表 + updatePurchaseOrderChildData(purchaseOrder, filterPurchaseOrderChildList); + if (purchaseOrder.getNotifyHasArrivedSum().equals(purchaseOrder.getActualPurchaseSum())){ purchaseOrder.setWarehouseStorageStatus("4"); }if (purchaseOrder.getNotifyHasArrivedSum() < purchaseOrder.getActualPurchaseSum()){ @@ -1231,7 +1232,7 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService private void updatePurchaseOrderChildData(PurchaseOrder purchaseOrder, List filterPurchaseOrderChildList) { for (PurchaseOrderChild purchaseOrderChild : filterPurchaseOrderChildList) { - if (purchaseOrderChild.getNotifyHasArrivedNum() == 0 || purchaseOrderChild.getNotifyHasArrivedNum() == null){ + if (purchaseOrderChild.getNotifyHasArrivedNum() == null || purchaseOrderChild.getNotifyHasArrivedNum() == 0){ purchaseOrderChild.setNotifyHasArrivedNum(purchaseOrderChild.getNotifyArriveNum()); }else { purchaseOrderChild.setNotifyHasArrivedNum(purchaseOrderChild.getNotifyHasArrivedNum() + purchaseOrderChild.getNotifyArriveNum()); @@ -1289,6 +1290,7 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService warehouseStorageOrder.setWarehouseDeptType(purchaseOrderChild.getWarehouseDept()); warehouseStorageOrder.setWarehouseQualityStatus("0"); warehouseStorageOrder.setWarehouseOrderType("0"); + warehouseStorageOrder.setArrivedTime(purchaseOrder.getArrivedTime()); int allNotifyArrivedNum = filterPurchaseOrderChildList.stream().mapToInt(PurchaseOrderChild::getNotifyArriveNum).sum(); int allNotifyHasArrivedNum = filterPurchaseOrderChildList.stream().mapToInt(PurchaseOrderChild::getNotifyHasArrivedNum).sum(); if (allNotifyHasArrivedNum == 0){ @@ -1330,6 +1332,8 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService warehouseStorageOrderDetail.setMaterialType(purchaseOrderChild.getMaterialType()); warehouseStorageOrderDetail.setMaterialDeptType(purchaseOrderChild.getWarehouseDept()); warehouseStorageOrderDetail.setArrivedTime(purchaseOrderChild.getPlanDeliveryTime()); + warehouseStorageOrderDetail.setSupplierCode(purchaseOrder.getSupplierCode()); + warehouseStorageOrderDetail.setSupplierName(purchaseOrder.getSupplierName()); warehouseStorageOrderDetail.setCreateTime(new Date()); warehouseStorageOrderDetail.setCreateBy(ShiroUtils.getLoginName()); Integer notifyArriveNum = purchaseOrderChild.getNotifyArriveNum(); @@ -1377,6 +1381,8 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService purchaseStorageChild.setMaterialType(purchaseOrderChild.getMaterialType()); purchaseStorageChild.setMaterialDeptType(purchaseOrderChild.getWarehouseDept()); purchaseStorageChild.setArrivedTime(purchaseOrderChild.getPlanDeliveryTime()); + purchaseStorageChild.setSupplierCode(purchaseOrder.getSupplierCode()); + purchaseStorageChild.setSupplierName(purchaseOrder.getSupplierName()); purchaseStorageChild.setCreateTime(new Date()); purchaseStorageChild.setCreateBy(ShiroUtils.getLoginName()); Integer notifyArriveNum = purchaseOrderChild.getNotifyArriveNum(); From ac8b410f33ceb790c1effd0bb611ee6e852f5e00 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Thu, 21 Nov 2024 15:29:12 +0800 Subject: [PATCH 4/9] =?UTF-8?q?[fix]=E9=87=87=E8=B4=AD=E7=AE=A1=E7=90=86?= =?UTF-8?q?=20=E4=BE=9B=E5=BA=94=E5=95=86=E6=96=B0=E5=A2=9E=E4=BE=9B?= =?UTF-8?q?=E5=BA=94=E5=95=86=E8=B5=84=E8=B4=A8=E6=9F=A5=E8=AF=A2=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=EF=BC=8C=E4=BF=AE=E6=94=B9=E4=BE=9B=E5=BA=94=E5=95=86?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E6=9F=A5=E8=AF=A2bug=20=E4=BE=9B=E5=BA=94?= =?UTF-8?q?=E5=95=86=E7=B1=BB=E5=9E=8B=E5=92=8C=E4=BE=9B=E5=BA=94=E5=95=86?= =?UTF-8?q?=E8=B5=84=E8=B4=A8=E5=AF=BC=E5=87=BA=E5=8A=A0=E4=B8=8A=E5=AD=97?= =?UTF-8?q?=E5=85=B8=20=E4=BF=AE=E5=A4=8D=E4=BE=9B=E5=BA=94=E5=95=86?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=88=86=E9=A1=B5=E6=9F=A5=E8=AF=A2=E5=90=8E?= =?UTF-8?q?=E7=AB=AFbug=E9=97=AE=E9=A2=98=20=E4=BE=9B=E5=BA=94=E5=95=86?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=9A=84=E5=AE=A1=E6=A0=B8=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=8A=A0=E4=B8=8AtaskStatus=E5=AD=97=E6=AE=B5=EF=BC=8C?= =?UTF-8?q?=E5=8A=A0=E4=B8=8A=E6=96=B0=E7=9A=84=E7=8A=B6=E6=80=81=20?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E9=80=9A=E8=BF=87=E5=92=8C=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E6=8B=92=E7=BB=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SysSupplierController.java | 27 +------ .../com/ruoyi/system/domain/SysSupplier.java | 17 +++-- .../ruoyi/system/domain/Vo/SysSupplierVo.java | 14 ++++ .../service/impl/SysSupplierServiceImpl.java | 8 ++ .../mapper/system/SysSupplierMapper.xml | 13 +--- .../templates/system/supplier/supplier.html | 75 +++++++++++-------- 6 files changed, 77 insertions(+), 77 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSupplierController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSupplierController.java index 878ae357..1c75a6c2 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSupplierController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSupplierController.java @@ -95,35 +95,10 @@ public class SysSupplierController extends BaseController @ResponseBody public TableDataInfo list(SysSupplier sysSupplier) { - try { + startPage(); List list = sysSupplierService.selectSysSupplierList(sysSupplier); - SysUser curUser = ShiroUtils.getSysUser(); - String loginName = ShiroUtils.getLoginName(); - Long userId = curUser.getUserId(); - Set roleKeys = roleService.selectRoleKeys(userId); -// List sysUserlist = sysUserService.selectRoleToUserList("cgyRole"); -// sysUserlist.add(curUser); - //如果主管审批,查看当前自己部门的审核 - //如果经理审计需要查询自己部门下所有业务员的提交的订单,以及自身的提交的订单 -// if (roleKeys.contains("cgjlRole")) { -// List findUser = sysUserlist.stream().filter(item -> (item.getDeptId().equals(curUser.getDeptId()))).collect(Collectors.toList()); -// Set user = findUser.stream().map(SysUser::getLoginName).collect(Collectors.toSet()); -// startPage(); -// List list2 = list.stream().filter(item -> user.contains(item.getCreateBy())).collect(Collectors.toList()); -// return getDataTable(list2); -// } - // 业务员角色只能看到自己创建的数据 - if (roleKeys.contains("cgyRole")) { - sysSupplier.setCreateBy(curUser.getLoginName()); - startPage(); - List list2 = sysSupplierService.selectSysSupplierList(sysSupplier); - return getDataTable(list2); - } return getDataTable(list); - }catch(NullPointerException e){ - throw new NullPointerException("当前用户没有申请客户资料"); - } } /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSupplier.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSupplier.java index d8801454..6dbf900b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSupplier.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSupplier.java @@ -24,11 +24,6 @@ public class SysSupplier extends BaseEntity /*使用状态*/ private String useStatus; - /** 供应商类型 (0采购供应商、1委外供应商)*/ - private String supplierType; - - /** 供应商资质(1合格、2不合格、3特殊供应商)*/ - private String supplierQualification; /*采购员*/ private String purchaseBuyer; /** 供应商编号 */ @@ -39,6 +34,16 @@ public class SysSupplier extends BaseEntity @Excel(name = "供应商名称") private String supplierName; + + /** 供应商类型 (0采购供应商、1委外供应商)*/ + @Excel( name = "供应商类型",dictType = "sys_supplier_type") + private String supplierType; + + /** 供应商资质(1合格、2不合格、3特殊供应商)*/ + @Excel( name = "供应商资质",dictType = "sys_supplier_qualification") + private String supplierQualification; + + /** 内外销 */ @Excel(name = "内外销") private String exportSales; @@ -154,7 +159,7 @@ public class SysSupplier extends BaseEntity private String financialContact; /** 是否含税 */ - @Excel(name = "是否含税") + @Excel(name = "是否含税", dictType = "sys_confirm_tax") private String confirmTax; /** 税率 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/SysSupplierVo.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/SysSupplierVo.java index 4ae7b39f..4011c33a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/SysSupplierVo.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/SysSupplierVo.java @@ -18,6 +18,11 @@ public class SysSupplierVo extends SysSupplier { private String taskId; /** 任务名称 */ private String taskName; + + // 当前状态 + private String taskStatus; + + /** 办理时间 */ private Date doneTime; /** 创建人 */ @@ -95,12 +100,21 @@ public class SysSupplierVo extends SysSupplier { } + public String getTaskStatus() { + return taskStatus; + } + + public void setTaskStatus(String taskStatus) { + this.taskStatus = taskStatus; + } + @Override public String toString() { return "SysSupplierVo{" + "applyUserName='" + applyUserName + '\'' + ", taskId='" + taskId + '\'' + ", taskName='" + taskName + '\'' + + ", taskStatus='" + taskStatus + '\'' + ", doneTime=" + doneTime + ", createUserName='" + createUserName + '\'' + ", suspendState='" + suspendState + '\'' + diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSupplierServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSupplierServiceImpl.java index 566adc44..2bd093d1 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSupplierServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSupplierServiceImpl.java @@ -146,6 +146,14 @@ public class SysSupplierServiceImpl implements ISysSupplierService{ } else { sysSupplierVo.setTaskName("未启动"); } + + sysSupplierVo.setTaskStatus(sysSupplierVo.getTaskName()); + if(sysSupplierVo.getAuditStatus()!=null && sysSupplierVo.getAuditStatus().equals("1")){ + sysSupplierVo.setTaskStatus("审核通过"); + }else if(sysSupplierVo.getAuditStatus()!=null && sysSupplierVo.getAuditStatus().equals("2")){ + sysSupplierVo.setTaskStatus("审核拒绝"); + } + returnList.add(sysSupplierVo); } returnList.setTotal(CollectionUtils.isEmpty(list) ? 0 : list.getTotal()); diff --git a/ruoyi-admin/src/main/resources/mapper/system/SysSupplierMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/SysSupplierMapper.xml index fbd02f5e..57ed74b6 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/SysSupplierMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/SysSupplierMapper.xml @@ -114,6 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and sup.supplier_code like concat('%', #{supplierCode}, '%') and sup.supplier_name like concat('%', #{supplierName}, '%') and sup.supplier_type = #{supplierType} + and sup.supplier_qualification = #{supplierQualification} and sup.use_status = #{useStatus} and sup.audit_status = #{auditStatus} and sup.purchase_buyer = #{purchaseBuyer} @@ -129,18 +130,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" or sup.receive_address like concat('%',#{receiveAddress},'%') and sup.invoice_company_name like concat('%', #{invoiceCompanyName}, '%') and sup.company_tax_number like concat('%', #{companyTaxNumber}, '%') - - and sup.instance_id = #{instanceId} - and sup.instance_type = #{instanceType} - and sup.submit_instance_id = #{submitInstanceId} - and sup.cancel_instance_id = #{cancelInstanceId} - and sup.restore_instance_id = #{restoreInstanceId} - and sup.apply_title = #{applyTitle} - and sup.apply_user = #{applyUser} - and sup.apply_time = #{applyTime} - and sup.create_time between #{params.beginCreateTime} and #{params.endCreateTime} - - and ((sup.supplierCode like concat('%',#{keyword},'%') or sup.suppplierName like concat('%',#{keyword},'%')) order by sup.apply_time asc, sup.create_time desc diff --git a/ruoyi-admin/src/main/resources/templates/system/supplier/supplier.html b/ruoyi-admin/src/main/resources/templates/system/supplier/supplier.html index 131de1d2..44daa7ae 100644 --- a/ruoyi-admin/src/main/resources/templates/system/supplier/supplier.html +++ b/ruoyi-admin/src/main/resources/templates/system/supplier/supplier.html @@ -28,21 +28,24 @@
  • -
  • - -
  • - - + +
  •  搜索 @@ -92,50 +95,48 @@ removeUrl: prefix + "/remove", exportUrl: prefix + "/export", detailUrl: prefix + "/detail/{id}", - search: false, - showExport: true, - showSearch: false, - showRefresh: false, - showToggle: false, - showColumns: false, - showExport: false, - showExport: true, - showColumns: true, - showToggle: true, - clickToSelect: true, modalName: "供应商资料", fixedColumns:true, fixedRightNumber:1, columns: [{checkbox: true}, {title: '供应商id',field: 'supplierId',visible: false}, - {title: '审核状态',field: 'auditStatus',formatter: function(value, row, index) { - return $.table.selectDictLabel(auditStatusDatas, value); - }}, - {title: '使用状态',field: 'useStatus',formatter: function(value, row, index) { - return $.table.selectDictLabel(useStatusDatas, value); - }}, {title: '流程实例ID',field: 'instanceId',visible: false}, { title: '流程提交实例ID',field: 'submitInstanceId',visible: false}, { title:'流程作废实例ID',field: 'cancelInstanceId',visible: false}, {title: '流程恢复实例ID',field: 'restoreInstanceId', visible: false}, { title: '流程实例类型', field: 'instanceTypeName',visible: false}, {title: '申请人ID',field: 'applyUser', visible: false}, + {title: '审核状态',field: 'auditStatus',visible: false,formatter: function(value, row, index) { + return $.table.selectDictLabel(auditStatusDatas, value); + }}, { field: 'applyUserName', title: '申请人', + visible: false, formatter: function(value, row, index) { return '' + (value ? value : "-") + ''; } }, - {field: 'applyTime',title: '申请时间'}, {title: '当前任务ID',field: 'taskId',visible: false}, { title: '待办用户ID',field: 'todoUserId', visible: false}, - { title: '当前任务名称',field: 'taskName', + { title: '当前任务名称',field: 'taskName', visible: false, align: 'center', formatter: function(value, row, index) { return '' + value + ''; } }, + + {title: '当前状态',field: 'taskStatus', align: 'center', + formatter: function(value, row, index) { + if(row.auditStatus!="1"&&value != "未启动"){ + return '' + value + ''; + } + if(value === "未启动"){ + return '' + value + ''; + } + return '' + value + '';} + }, + { title: '供应商编号',field: 'supplierCode'}, {title: '供应商名称',field: 'supplierName'}, {title: '供应商类型',field: 'supplierType',formatter: function(value, row, index) { @@ -197,6 +198,13 @@ } } }, + {field: 'applyTime',title: '申请时间'}, + + {title: '使用状态',field: 'useStatus',formatter: function(value, row, index) { + return $.table.selectDictLabel(useStatusDatas, value); + }}, + + { field: 'updateInfoTime', title: '上次修改时间', @@ -216,17 +224,17 @@ var actions = []; if(row.auditStatus=="1" && row.useStatus=="1" && !row.cancelInstanceId) { // 作废 - actions.push(' 作废'); + actions.push(' 作废'); // 编辑 - actions.push(' 编辑 '); + actions.push(' 编辑 '); // 已作废 }else{ - actions.push(' 编辑 '); + actions.push(' 编辑 '); } // 有流程实例id if(row.useStatus=="2" && !row.restoreInstanceId){ // 恢复 - actions.push(' 恢复 '); + actions.push(' 恢复 '); } // 有流程实例id if (row.instanceId) { @@ -235,17 +243,18 @@ var todoUserIdList = row.todoUserId.split(","); if(todoUserIdList.includes(loginName)){ var nodeName = row.taskName=='驳回调整'?' 调整申请':' 审批'; - actions.push(' '+nodeName+' '); + actions.push(' '+nodeName+' '); } } // 审批历史 - actions.push(' 审批历史 '); + actions.push(' 审批历史 '); // 进度查看 - actions.push(' 进度查看 '); + actions.push(' 进度查看 '); } // 详情 - actions.push(' 详情 '); - return actions.join(''); + actions.push(' 详情 '); + var actionLinks = actions.join(''); + return $.table.dropdownToggle(actionLinks); } } ], From f6ca237cd6ca53693557ba0c26fe70bc43d5f5cd Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Thu, 21 Nov 2024 15:45:45 +0800 Subject: [PATCH 5/9] =?UTF-8?q?[fix]=E9=87=87=E8=B4=AD=E7=AE=A1=E7=90=86?= =?UTF-8?q?=20=E6=8C=89=E7=85=A7=E6=96=B0=E7=89=88=E4=B8=87=E6=9D=90?= =?UTF-8?q?=E9=9C=80=E6=B1=82=EF=BC=8C=E8=B0=83=E6=95=B4=E4=BE=9B=E5=BA=94?= =?UTF-8?q?=E5=95=86=E7=9A=84=E5=AE=A1=E6=89=B9=E6=B5=81=E7=A8=8B=E4=B8=BA?= =?UTF-8?q?=EF=BC=9A=E7=9B=AE=E5=89=8D=E6=B2=A1=E6=9C=89=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E7=BB=8F=E7=90=86=E8=BF=99=E4=B8=AA=E8=81=8C=E4=BD=8D=EF=BC=8C?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E7=94=B1=E5=89=AF=E6=80=BB=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=E5=8D=B3=E5=8F=AF=EF=BC=8C=E4=BB=A5=E5=90=8E=E6=9C=89=E6=AD=A4?= =?UTF-8?q?=E5=B2=97=E4=BD=8D=E4=B9=8B=E5=90=8E=EF=BC=8C=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=91=98=E5=8F=AF=E4=BB=A5=E4=BF=AE=E6=94=B9=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E4=B8=BA=EF=BC=9A=E9=87=87=E8=B4=AD=E5=91=98?= =?UTF-8?q?-=E9=87=87=E8=B4=AD=E7=BB=8F=E7=90=86-=E5=89=AF=E6=80=BB=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BE=9B=E5=BA=94=E5=95=86=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=E8=A7=92=E8=89=B2=E6=A0=A1=E9=AA=8C=E7=9A=84?= =?UTF-8?q?=E6=96=B9=E6=B3=95=20=E6=96=B0=E5=A2=9E=E5=89=AF=E6=80=BB?= =?UTF-8?q?=E7=BB=8F=E7=90=86=E5=AE=A1=E6=89=B9=E5=89=8D=E7=AB=AF=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/service/impl/SysSupplierServiceImpl.java | 11 ++++++----- .../{taskCgzgVerify.html => taskFzjlVerify.html} | 10 +++++----- 2 files changed, 11 insertions(+), 10 deletions(-) rename ruoyi-admin/src/main/resources/templates/system/supplier/{taskCgzgVerify.html => taskFzjlVerify.html} (98%) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSupplierServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSupplierServiceImpl.java index 2bd093d1..3a2149b7 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSupplierServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSupplierServiceImpl.java @@ -441,15 +441,16 @@ public class SysSupplierServiceImpl implements ISysSupplierService{ private void buildAuthority(SysUser user, Map variables) { Set roleKeys = roleService.selectRoleKeys(user.getUserId()); + variables.put("cgjlExist",false); + + // 角色不同审核人不同 if(roleKeys.contains("cgyRole")){ variables.put("authority",1); }else if(roleKeys.contains("cgjlRole")){ - variables.put("authority",2); - }else if(roleKeys.contains("cgzgRole")){ + variables.put("cgjlExist",true); + }else if(roleKeys.contains("admin")){ variables.put("authority",3); - } - // 角色不同审核人不同 - if(roleKeys.contains("admin")){ + }else if(roleKeys.contains("fzjlRole")){ variables.put("authority",4); } } diff --git a/ruoyi-admin/src/main/resources/templates/system/supplier/taskCgzgVerify.html b/ruoyi-admin/src/main/resources/templates/system/supplier/taskFzjlVerify.html similarity index 98% rename from ruoyi-admin/src/main/resources/templates/system/supplier/taskCgzgVerify.html rename to ruoyi-admin/src/main/resources/templates/system/supplier/taskFzjlVerify.html index c2537d61..96d36e91 100644 --- a/ruoyi-admin/src/main/resources/templates/system/supplier/taskCgzgVerify.html +++ b/ruoyi-admin/src/main/resources/templates/system/supplier/taskFzjlVerify.html @@ -8,7 +8,7 @@
    -
    + @@ -328,9 +328,9 @@
  • - +
    - @@ -354,14 +354,14 @@