From 7baf242ae2047848eb86df911db9f387f4897ed6 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Mon, 8 Jul 2024 16:11:51 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E7=94=9F=E4=BA=A7=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E4=BB=93=E5=BA=93=E7=AE=A1=E7=90=86=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=94=9F=E4=BA=A7=E7=AE=A1=E7=90=86=E6=89=80=E6=9C=89=E7=9A=84?= =?UTF-8?q?=E6=8D=9F=E8=80=97=E7=8E=87=E6=95=B0=E6=8D=AE=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E9=A2=86=E6=96=99=E5=8D=95=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E9=80=9A=E8=BF=87=E5=90=8E=E7=94=9F=E6=88=90=E5=87=BA?= =?UTF-8?q?=E5=BA=93=E5=8D=95=E8=AF=A6=E6=83=85=E7=9A=84=E6=96=B9=E6=B3=95?= =?UTF-8?q?=EF=BC=9A=E6=B7=BB=E5=8A=A0=E8=BF=87=E6=BB=A4=EF=BC=8C=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E6=98=AF=E4=B8=A4=E4=B8=AA=E7=9B=B8=E5=90=8C=E7=9A=84?= =?UTF-8?q?=E7=89=A9=E6=96=99=EF=BC=8C=E9=A2=86=E6=96=99=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E7=B4=AF=E5=8A=A0=EF=BC=8C=E5=B9=B6=E4=B8=94?= =?UTF-8?q?=E5=8F=AA=E4=BF=9D=E7=95=99=E4=B8=80=E6=9D=A1=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=EF=BC=9B=E6=96=B0=E5=A2=9E=E8=AE=A2=E5=8D=95=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E4=B8=BA=E6=9C=AC=E6=AC=A1=E9=A2=86=E6=96=99=E6=95=B0=20?= =?UTF-8?q?=E4=BF=AE=E4=BF=AE=E6=94=B9=E5=A7=94=E5=86=85=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E5=93=81=E8=B4=A8=E5=90=8E=E7=94=9F=E6=88=90=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E5=8D=95=E7=9A=84=E6=96=B9=E6=B3=95=EF=BC=9A=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E5=8D=95=E5=8F=B7=E7=9A=84=E7=94=9F=E6=88=90?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=EF=BC=9B=E6=96=B0=E5=A2=9E=20=E5=93=81?= =?UTF-8?q?=E8=B4=A8=E5=B7=B2=E5=90=88=E6=A0=BC=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/QualityOrderServiceImpl.java | 1 + .../system/domain/SysMakeorderPickDetail.java | 6 +- .../mapper/WarehouseOutOrderDetailMapper.java | 6 ++ .../impl/WarehouseOutOrderServiceImpl.java | 77 +++++++++++-------- .../WarehouseStorageOrderServiceImpl.java | 8 +- .../WarehouseOutOrderDetailMapper.xml | 9 +++ .../templates/erp/inboundOrder/add.html | 14 ++-- .../inboundOrder/processInboundDetail.html | 14 ++-- .../inboundOrder/produceInboundDetail.html | 14 ++-- .../qualityOrder/makeInStartingQuality.html | 1 + .../system/makeorder/addProduceInbound.html | 9 +-- .../templates/system/makeorder/addpick.html | 7 -- .../templates/system/makeorder/bmps.html | 14 ++-- .../templates/system/makeorder/bmzgqr.html | 14 ++-- .../templates/system/makeorder/detail.html | 14 ++-- .../templates/system/makeorder/gcsh.html | 14 ++-- .../system/makeorderpick/detail.html | 14 ++-- .../templates/system/makeorderpick/edit.html | 14 ++-- .../system/makeorderpick/taskModifyApply.html | 14 ++-- .../system/makeorderpick/taskScjlVerify.html | 14 ++-- .../system/makeorderpick/taskSczgVerify.html | 14 ++-- 21 files changed, 156 insertions(+), 136 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderServiceImpl.java index 3660684f..410a2932 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderServiceImpl.java @@ -349,6 +349,7 @@ public class QualityOrderServiceImpl implements IQualityOrderService //根据品质单号从数据库查询 用于更新入库单 QualityOrder tempQualityOrder = qualityOrderMapper.selectQualityOrderByCode(qualityOrder.getQualityOrderCode()); + tempQualityOrder.setWarehouseCode(warehouseStorageCode); String qualityStatus = tempQualityOrder.getQualityStatus(); String qualityStorageStatus = tempQualityOrder.getQualityStorageStatus(); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysMakeorderPickDetail.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysMakeorderPickDetail.java index 6fafaaf2..475566ec 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysMakeorderPickDetail.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysMakeorderPickDetail.java @@ -66,7 +66,7 @@ public class SysMakeorderPickDetail extends BaseEntity /** 用量 */ private Long useNum; /** 损耗率 */ - private BigDecimal lossRate; + private String lossRate; /** 层级 */ private Long level; /** 排序 */ @@ -216,11 +216,11 @@ public class SysMakeorderPickDetail extends BaseEntity this.useNum = useNum; } - public BigDecimal getLossRate() { + public String getLossRate() { return lossRate; } - public void setLossRate(BigDecimal lossRate) { + public void setLossRate(String lossRate) { this.lossRate = lossRate; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseOutOrderDetailMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseOutOrderDetailMapper.java index a7955417..e857f643 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseOutOrderDetailMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseOutOrderDetailMapper.java @@ -83,6 +83,12 @@ public interface WarehouseOutOrderDetailMapper */ List selectOutOrderDetailListByCode(String outOrderCode); + + /** + * 根据物料号、出库单号、关联单号查询出库单详情数据 + */ + public WarehouseOutOrderDetail selectOutOrderDetailListByThreeCode(WarehouseOutOrderDetail warehouseOutOrderDetail); + /** * 销售单-出库 物料信息关联设备信息 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderServiceImpl.java index 38e3e236..eb5431d5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderServiceImpl.java @@ -311,7 +311,7 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService throw new BusinessException("添加出库单信息失败"); } //生成出库单详情相关信息 - generateWarehouseOutOrder(sysMakeorderPickVo, tempSysMakeorderPickVo, outOrderCode,mergeMakeorderPickDetails); + generateWarehouseOutOrder(sysMakeorderPickVo, tempSysMakeorderPickVo, outOrderCode,sysMakeorderPickDetails); return insertResult; } @@ -343,44 +343,59 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService //生成出库单详情相关信息 - private void generateWarehouseOutOrder(SysMakeorderPickVo sysMakeorderPickVo, SysMakeorderPickVo tempSysMakeorderPickVo, String outOrderCode,List mergeMakeorderPickDetails) { + private void generateWarehouseOutOrder(SysMakeorderPickVo sysMakeorderPickVo, SysMakeorderPickVo tempSysMakeorderPickVo, String outOrderCode,List sysMakeorderPickDetails) { - for (SysMakeorderPickDetail sysMakeorderPickDetail : mergeMakeorderPickDetails) { + for (SysMakeorderPickDetail sysMakeorderPickDetail : sysMakeorderPickDetails) { WarehouseOutOrderDetail warehouseOutOrderDetail = new WarehouseOutOrderDetail(); warehouseOutOrderDetail.setOutOrderCode(outOrderCode); - warehouseOutOrderDetail.setWarehouseOutStatus("4"); warehouseOutOrderDetail.setRelatedOrderCode(tempSysMakeorderPickVo.getMakeNo()); - warehouseOutOrderDetail.setMakeNo(tempSysMakeorderPickVo.getMakeNo()); - //标明来源是生产订单 - warehouseOutOrderDetail.setWarehouseOrderType("1"); - warehouseOutOrderDetail.setWarehouseOutType("1"); - warehouseOutOrderDetail.setMaterialSum(tempSysMakeorderPickVo.getMaterialSum()); - warehouseOutOrderDetail.setEnterpriseSum(tempSysMakeorderPickVo.getEnterpriseSum()); - - warehouseOutOrderDetail.setCreateBy(ShiroUtils.getLoginName()); - warehouseOutOrderDetail.setCreateTime(new Date()); - warehouseOutOrderDetail.setApplyName(sysMakeorderPickVo.getApplyUser()); //物料相关信息 warehouseOutOrderDetail.setMaterialNo(sysMakeorderPickDetail.getMaterialNo()); - warehouseOutOrderDetail.setMaterialName(sysMakeorderPickDetail.getMaterialName()); - warehouseOutOrderDetail.setMaterialDescribe(sysMakeorderPickDetail.getDescribe()); - warehouseOutOrderDetail.setMaterialUnit(sysMakeorderPickDetail.getUnit()); - warehouseOutOrderDetail.setMaterialBrand(sysMakeorderPickDetail.getBrand()); - warehouseOutOrderDetail.setMaterialProcessMethod(sysMakeorderPickDetail.getProcessMethod()); - warehouseOutOrderDetail.setMakeNum(tempSysMakeorderPickVo.getMaterialSum()); + //根据出库单号和关联单号以及物料号查找出库单详情数据 + WarehouseOutOrderDetail tempWarehouseOutOrderDetail = outOrderDetailMapper.selectOutOrderDetailListByThreeCode(warehouseOutOrderDetail); + if (tempWarehouseOutOrderDetail != null){ + warehouseOutOrderDetail.setOutOrderDetailId(tempWarehouseOutOrderDetail.getOutOrderDetailId()); + Integer applyOutOrderSum = (int) (sysMakeorderPickDetail.getPickNum()+tempWarehouseOutOrderDetail.getApplyOutOrderSum()); + Integer makeNum = (int) (sysMakeorderPickDetail.getPickNum() + tempWarehouseOutOrderDetail.getMakeNum()); + warehouseOutOrderDetail.setApplyOutOrderSum(applyOutOrderSum); + warehouseOutOrderDetail.setMakeNum(makeNum); + int updateWarehouseOutOrderDetailResult = outOrderDetailMapper.updateWarehouseOutOrderDetail(warehouseOutOrderDetail); + if (updateWarehouseOutOrderDetailResult <= 0){ + throw new BusinessException("更新出库单详情失败"); + } + }else { + warehouseOutOrderDetail.setWarehouseOutStatus("4"); + warehouseOutOrderDetail.setMakeNo(tempSysMakeorderPickVo.getMakeNo()); + //标明来源是生产订单 + warehouseOutOrderDetail.setWarehouseOrderType("1"); + warehouseOutOrderDetail.setWarehouseOutType("1"); + warehouseOutOrderDetail.setMaterialSum(tempSysMakeorderPickVo.getMaterialSum()); + warehouseOutOrderDetail.setEnterpriseSum(tempSysMakeorderPickVo.getEnterpriseSum()); + + warehouseOutOrderDetail.setCreateBy(ShiroUtils.getLoginName()); + warehouseOutOrderDetail.setCreateTime(new Date()); + warehouseOutOrderDetail.setApplyName(sysMakeorderPickVo.getApplyUser()); + warehouseOutOrderDetail.setMaterialName(sysMakeorderPickDetail.getMaterialName()); + warehouseOutOrderDetail.setMaterialDescribe(sysMakeorderPickDetail.getDescribe()); + warehouseOutOrderDetail.setMaterialUnit(sysMakeorderPickDetail.getUnit()); + warehouseOutOrderDetail.setMaterialBrand(sysMakeorderPickDetail.getBrand()); + warehouseOutOrderDetail.setMaterialProcessMethod(sysMakeorderPickDetail.getProcessMethod()); + //订单数量为本次领料数量 + warehouseOutOrderDetail.setMakeNum(Math.toIntExact(sysMakeorderPickDetail.getPickNum())); //添加申请出库数量 - warehouseOutOrderDetail.setApplyOutOrderSum(Math.toIntExact(sysMakeorderPickDetail.getPickNum())); - - if (StringUtils.isNotEmpty(sysMakeorderPickDetail.getDescribe())) { - String[] splitDescribe = sysMakeorderPickDetail.getDescribe().split(","); - if (splitDescribe.length >= 2) { - warehouseOutOrderDetail.setMaterialModel(splitDescribe[0]); - warehouseOutOrderDetail.setMaterialSpecification(splitDescribe[1]); + warehouseOutOrderDetail.setApplyOutOrderSum(Math.toIntExact(sysMakeorderPickDetail.getPickNum())); + + if (StringUtils.isNotEmpty(sysMakeorderPickDetail.getDescribe())) { + String[] splitDescribe = sysMakeorderPickDetail.getDescribe().split(","); + if (splitDescribe.length >= 2) { + warehouseOutOrderDetail.setMaterialModel(splitDescribe[0]); + warehouseOutOrderDetail.setMaterialSpecification(splitDescribe[1]); + } + } + int insertOutOrderDetailResult = outOrderDetailMapper.insertWarehouseOutOrderDetail(warehouseOutOrderDetail); + if (insertOutOrderDetailResult <= 0){ + throw new BusinessException("新增出库单详情数据失败"); } - } - int insertOutOrderDetailResult = outOrderDetailMapper.insertWarehouseOutOrderDetail(warehouseOutOrderDetail); - if (insertOutOrderDetailResult <= 0){ - throw new BusinessException("新增出库单详情数据失败"); } } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java index 26aeb414..90b65d19 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java @@ -403,8 +403,8 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS public int insertWarehouseStorageOrderByMakeInQualityOrder(QualityOrder tempQualityOrder, List qualityOrderDetailList) { WarehouseStorageOrder warehouseStorageOrder = new WarehouseStorageOrder(); String loginName = ShiroUtils.getLoginName(); - String warehouseStorageCode = redisCache.generateBillNo("RK"); - warehouseStorageOrder.setWarehouseStorageCode(warehouseStorageCode); + + warehouseStorageOrder.setWarehouseStorageCode(tempQualityOrder.getWarehouseCode()); warehouseStorageOrder.setRelatedOrderCode(tempQualityOrder.getRelatedOrderCode()); //暂收设置为全部品质 warehouseStorageOrder.setWarehouseQualityStatus("2"); @@ -423,7 +423,7 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS for (QualityOrderDetail qualityOrderDetail : qualityOrderDetailList) { WarehouseStorageOrderDetail warehouseStorageOrderDetail = new WarehouseStorageOrderDetail(); - warehouseStorageOrderDetail.setWarehouseStorageCode(warehouseStorageCode); + warehouseStorageOrderDetail.setWarehouseStorageCode(tempQualityOrder.getWarehouseCode()); warehouseStorageOrderDetail.setRelatedOrderCode(tempQualityOrder.getRelatedOrderCode()); warehouseStorageOrderDetail.setWarehouseQualityStatus("2"); warehouseStorageOrderDetail.setWarehouseStorageStatus("2"); @@ -433,6 +433,8 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS warehouseStorageOrderDetail.setMakeStorageNum(qualityOrderDetail.getMakeInNum()); //设置委内加工费单价 warehouseStorageOrderDetail.setMakeInUnitPrice(qualityOrderDetail.getMakeInUnitPrice()); + //设置品质已合格数 + warehouseStorageOrderDetail.setQualityHasQualifiedNum(qualityOrderDetail.getQualityHasqualifiedNum()); warehouseStorageOrderDetail.setMaterialNo(qualityOrderDetail.getMaterialNo()); warehouseStorageOrderDetail.setMaterialName(qualityOrderDetail.getMaterialName()); warehouseStorageOrderDetail.setMaterialBrand(qualityOrderDetail.getMaterialBrand()); diff --git a/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseOutOrderDetailMapper.xml b/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseOutOrderDetailMapper.xml index 86072cf3..e9bf857e 100644 --- a/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseOutOrderDetailMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseOutOrderDetailMapper.xml @@ -77,6 +77,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where out_order_code = #{outOrderCode} + + + +