From 14603033735b607ce54b5a1b8fb334a29a6d22ce Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Mon, 24 Jun 2024 17:28:59 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=E4=BB=93=E5=BA=93=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E4=BB=93=E5=BA=93=E5=85=A5=E5=BA=93=E5=8D=95=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=BB=93=E5=BA=93=E5=85=A5=E5=BA=93=20=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E8=AE=A2=E5=8D=95=E6=9A=82=E6=94=B6=E5=90=8E=E7=AB=AF?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3,=E6=96=B0=E5=A2=9E=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E6=9A=82=E6=94=B6=E5=90=8E,=E4=BB=93=E5=BA=93=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E7=8A=B6=E6=80=81=E6=94=B9=E4=B8=BA=E5=B7=B2=E6=9A=82?= =?UTF-8?q?=E6=94=B6,=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95=E6=9A=82?= =?UTF-8?q?=E6=94=B6=E8=BD=AC=E4=B8=BA=E5=93=81=E8=B4=A8=E5=8D=95=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BB=93=E5=BA=93=E5=85=A5=E5=BA=93=E5=8D=95?= =?UTF-8?q?=E6=9A=82=E6=94=B6=E6=8C=89=E9=92=AE=E7=9A=84=E4=BB=93=E5=BA=93?= =?UTF-8?q?ID=E5=9B=9E=E6=98=BE=E9=97=AE=E9=A2=98=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=93=81=E8=B4=A8=E5=8D=95,=E5=93=81=E8=B4=A8=E5=8D=95?= =?UTF-8?q?=E8=AF=A6=E6=83=85,=E5=93=81=E8=B4=A8=E5=8D=95=E6=8A=A5?= =?UTF-8?q?=E5=91=8A,=E5=93=81=E8=B4=A8=E5=8D=95=E4=B8=8D=E5=90=88?= =?UTF-8?q?=E6=A0=BC=E5=88=86=E7=B1=BB=E6=96=B0=E5=A2=9E=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../quality/service/IQualityOrderService.java | 7 + .../service/impl/QualityOrderServiceImpl.java | 180 ++++++++++++++++++ .../WarehouseStorageOrderController.java | 2 +- .../IWarehouseStorageOrderService.java | 6 + .../WarehouseStorageOrderServiceImpl.java | 119 +++++++++++- .../storageOrder/temporaryPurchase.html | 6 +- 6 files changed, 314 insertions(+), 6 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityOrderService.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityOrderService.java index 3d681473..f6a4e709 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityOrderService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityOrderService.java @@ -2,6 +2,8 @@ package com.ruoyi.quality.service; import java.util.List; import com.ruoyi.quality.domain.QualityOrder; +import com.ruoyi.warehouse.domain.WarehouseStorageOrder; +import com.ruoyi.warehouse.domain.WarehouseStorageOrderDetail; /** * 品质管理品质单Service接口 @@ -72,4 +74,9 @@ public interface IQualityOrderService * @return */ int restoreQualityOrderById(Long qualityOrderId); + + /* + * + * */ + void insertQualityOrderByWarehouseStorageOrder(WarehouseStorageOrder warehouseStorageOrder, List warehouseStorageOrderDetailList); } 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 0beb2176..5dc8bda7 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 @@ -1,8 +1,20 @@ package com.ruoyi.quality.service.impl; +import java.util.ArrayList; +import java.util.Date; import java.util.List; + +import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; +import com.ruoyi.quality.domain.QualityOrderDetail; +import com.ruoyi.quality.domain.QualityOrderReport; +import com.ruoyi.quality.domain.QualityOrderReportUnqualified; +import com.ruoyi.quality.mapper.QualityOrderDetailMapper; +import com.ruoyi.quality.mapper.QualityOrderReportMapper; +import com.ruoyi.quality.mapper.QualityOrderReportUnqualifiedMapper; +import com.ruoyi.warehouse.domain.WarehouseStorageOrder; +import com.ruoyi.warehouse.domain.WarehouseStorageOrderDetail; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.quality.mapper.QualityOrderMapper; @@ -22,6 +34,19 @@ public class QualityOrderServiceImpl implements IQualityOrderService @Autowired private QualityOrderMapper qualityOrderMapper; + + @Autowired + private QualityOrderDetailMapper orderDetailMapper; + + @Autowired + private QualityOrderReportMapper orderReportMapper; + + @Autowired + private QualityOrderReportUnqualifiedMapper orderReportUnqualifiedMapper; + + @Autowired + private RedisCache redisCache; + /** * 查询品质管理品质单 * @@ -123,4 +148,159 @@ public class QualityOrderServiceImpl implements IQualityOrderService { return qualityOrderMapper.restoreQualityOrderById(qualityOrderId); } + + + + /* + * 采购入库仓库入库后生成品质单 + * */ + @Override + public void insertQualityOrderByWarehouseStorageOrder(WarehouseStorageOrder warehouseStorageOrder, List storageOrderDetailList) { + + QualityOrder qualityOrder = new QualityOrder(); + qualityOrder.setCreateTime(new Date()); + qualityOrder.setCreateBy(warehouseStorageOrder.getCreateBy()); + //使用redis自动生成品质单号 + String qualityOrderCode = redisCache.generateBillNo("PZ"); + + qualityOrder.setQualityOrderCode(qualityOrderCode); + qualityOrder.setInStorageCode(warehouseStorageOrder.getWarehouseStorageCode()); + qualityOrder.setRelatedOrderCode(warehouseStorageOrder.getRelatedOrderCode()); + qualityOrder.setQualityStatus("0"); + qualityOrder.setQualityOrderType("0"); + qualityOrder.setQualityStorageStatus("0"); + qualityOrder.setThisArrivedNum(warehouseStorageOrder.getActualArrivedNum()); + qualityOrder.setWarehouseCode(warehouseStorageOrder.getWarehouseCode()); + qualityOrder.setWarehouseName(warehouseStorageOrder.getWarehouseName()); + qualityOrder.setDeliveryInspectionTime(warehouseStorageOrder.getDeliveryInspectionTime()); + qualityOrderMapper.insertQualityOrder(qualityOrder); + + + //新增三个子表的数据 + for (WarehouseStorageOrderDetail detail : storageOrderDetailList) { + // 构建QualityOrderDetail,假设其他属性与QualityOrder相同,故不重复设置 + insertQualityOrderDetailByWarehouseStorageOrder(warehouseStorageOrder, detail, qualityOrderCode); + insertQualityOrderReportByWarehouseStorageOrder(detail); + insertQualityOrderUnqualifiedByWarehouseStorageOrder(detail); + // ... + } + + } + + private void insertQualityOrderUnqualifiedByWarehouseStorageOrder( WarehouseStorageOrderDetail warehouseStorageOrderDetail) { + QualityOrderReportUnqualified qualityOrderReportUnqualified = new QualityOrderReportUnqualified(); + //插入品质报告不合格数 + qualityOrderReportUnqualified.setSupplierCode(warehouseStorageOrderDetail.getSupplierCode()); + qualityOrderReportUnqualified.setSupplierName(warehouseStorageOrderDetail.getSupplierName()); + qualityOrderReportUnqualified.setMaterialNo(warehouseStorageOrderDetail.getMaterialNo()); + qualityOrderReportUnqualified.setMaterialName(warehouseStorageOrderDetail.getMaterialName()); + qualityOrderReportUnqualified.setCreateTime(new Date()); + qualityOrderReportUnqualified.setCreateBy(warehouseStorageOrderDetail.getCreateBy()); + orderReportUnqualifiedMapper.insertQualityOrderReportUnqualified(qualityOrderReportUnqualified); + + } + + private void insertQualityOrderReportByWarehouseStorageOrder(WarehouseStorageOrderDetail warehouseStorageOrderDetail) { + QualityOrderReport qualityOrderReport = new QualityOrderReport(); + //插入品质单报告开始品质单 + qualityOrderReport.setSupplierCode(qualityOrderReport.getSupplierCode()); + qualityOrderReport.setSupplierName(warehouseStorageOrderDetail.getSupplierName()); + qualityOrderReport.setMaterialNo(warehouseStorageOrderDetail.getMaterialNo()); + qualityOrderReport.setMaterialName(warehouseStorageOrderDetail.getMaterialName()); + qualityOrderReport.setQualityHasqualifiedNum(warehouseStorageOrderDetail.getQualityHasQualifiedNum()); + qualityOrderReport.setCreateTime(new Date()); + qualityOrderReport.setCreateBy(warehouseStorageOrderDetail.getCreateBy()); + orderReportMapper.insertQualityOrderReport(qualityOrderReport); + } + + private void insertQualityOrderDetailByWarehouseStorageOrder(WarehouseStorageOrder warehouseStorageOrder, WarehouseStorageOrderDetail warehouseStorageOrderDetail, String qualityOrderCode) { + + QualityOrderDetail qualityOrderDetail = new QualityOrderDetail(); + + //插入数据到品质报告详情和 品质报告 + qualityOrderDetail.setQualityOrderCode(qualityOrderCode); + qualityOrderDetail.setInStorageCode(warehouseStorageOrder.getWarehouseStorageCode()); + qualityOrderDetail.setRelatedOrderCode(warehouseStorageOrder.getRelatedOrderCode()); + qualityOrderDetail.setQualityStatus("0"); + qualityOrderDetail.setQualityOrderType("0"); + qualityOrderDetail.setQualityStorageStatus("0"); + qualityOrderDetail.setMaterialNo(warehouseStorageOrderDetail.getMaterialNo()); + qualityOrderDetail.setMaterialBrand(warehouseStorageOrderDetail.getMaterialBrand()); + qualityOrderDetail.setMaterialDescribe(warehouseStorageOrderDetail.getMaterialDescribe()); + qualityOrderDetail.setMaterialName(warehouseStorageOrderDetail.getMaterialName()); + qualityOrderDetail.setMaterialProcessMethod(warehouseStorageOrderDetail.getMaterialProcessMethod()); + qualityOrderDetail.setMaterialPhotourl(warehouseStorageOrderDetail.getMaterialPhotourl()); + qualityOrderDetail.setMaterialUnit(warehouseStorageOrderDetail.getMaterialUnit()); + qualityOrderDetail.setMaterialType(warehouseStorageOrderDetail.getMaterialType()); + qualityOrderDetail.setMakeTotal(warehouseStorageOrderDetail.getMakeTotal()); + qualityOrderDetail.setSupplierCode(warehouseStorageOrderDetail.getSupplierCode()); + qualityOrderDetail.setSupplierName(warehouseStorageOrderDetail.getSupplierName()); + qualityOrderDetail.setSupplierAddress(warehouseStorageOrderDetail.getSupplierAddress()); + qualityOrderDetail.setCustomerContact(warehouseStorageOrderDetail.getCustomerContact()); + qualityOrderDetail.setContactNumber(warehouseStorageOrderDetail.getContactNumber()); + qualityOrderDetail.setQualityHasqualifiedNum(warehouseStorageOrderDetail.getQualityHasQualifiedNum()); + qualityOrderDetail.setCreateTime(new Date()); + qualityOrderDetail.setCreateBy(warehouseStorageOrderDetail.getCreateBy()); + orderDetailMapper.insertQualityOrderDetail(qualityOrderDetail); + + + } + + +// /* +// * 根据仓库入库单采购入库 生成品质单 +// * */ +// private void insertQualityOrderByWarehouseStorageOrder(WarehouseStorageOrder warehouseStorageOrder, List storageOrderDetailList) { +// +// +// +// +// //插入数据到品质报告详情和 品质报告 +// for (WarehouseStorageOrderDetail warehouseStorageOrderDetail : storageOrderDetailList) { +// QualityOrderDetail qualityOrderDetail = new QualityOrderDetail(); +// QualityOrderReport qualityOrderReport = new QualityOrderReport(); +// QualityOrderReportUnqualified qualityOrderReportUnqualified = new QualityOrderReportUnqualified(); +// qualityOrderDetail.setQualityOrderCode(qualityOrderCode); +// qualityOrderDetail.setInStorageCode(warehouseStorageOrder.getWarehouseStorageCode()); +// qualityOrderDetail.setRelatedOrderCode(warehouseStorageOrder.getRelatedOrderCode()); +// qualityOrderDetail.setQualityStatus("0"); +// qualityOrderDetail.setQualityOrderType("0"); +// qualityOrderDetail.setQualityStorageStatus("0"); +// qualityOrderDetail.setMaterialNo(warehouseStorageOrderDetail.getMaterialNo()); +// qualityOrderDetail.setMaterialBrand(warehouseStorageOrderDetail.getMaterialBrand()); +// qualityOrderDetail.setMaterialDescribe(warehouseStorageOrderDetail.getMaterialDescribe()); +// qualityOrderDetail.setMaterialName(warehouseStorageOrderDetail.getMaterialName()); +// qualityOrderDetail.setMaterialProcessMethod(warehouseStorageOrderDetail.getMaterialProcessMethod()); +// qualityOrderDetail.setMaterialPhotourl(warehouseStorageOrderDetail.getMaterialPhotourl()); +// qualityOrderDetail.setMaterialUnit(warehouseStorageOrderDetail.getMaterialUnit()); +// qualityOrderDetail.setMaterialType(warehouseStorageOrderDetail.getMaterialType()); +// qualityOrderDetail.setMakeTotal(warehouseStorageOrderDetail.getMakeTotal()); +// qualityOrderDetail.setSupplierCode(warehouseStorageOrderDetail.getSupplierCode()); +// qualityOrderDetail.setSupplierName(warehouseStorageOrderDetail.getSupplierName()); +// qualityOrderDetail.setSupplierAddress(warehouseStorageOrderDetail.getSupplierAddress()); +// qualityOrderDetail.setCustomerContact(warehouseStorageOrderDetail.getCustomerContact()); +// qualityOrderDetail.setContactNumber(warehouseStorageOrderDetail.getContactNumber()); +// qualityOrderDetail.setQualityHasqualifiedNum(warehouseStorageOrderDetail.getQualityHasQualifiedNum()); +// qualityOrderDetail.setCreateTime(new Date()); +// qualityOrderDetail.setCreateBy(warehouseStorageOrderDetail.getCreateBy()); +// orderDetailMapper.insertQualityOrderDetail(qualityOrderDetail); +// //插入品质单报告开始品质单 +// qualityOrderReport.setSupplierCode(warehouseStorageOrderDetail.getSupplierCode()); +// qualityOrderReport.setSupplierName(warehouseStorageOrderDetail.getSupplierName()); +// qualityOrderReport.setMaterialNo(warehouseStorageOrderDetail.getMaterialNo()); +// qualityOrderReport.setMaterialName(warehouseStorageOrderDetail.getMaterialName()); +// qualityOrderReport.setQualityHasqualifiedNum(warehouseStorageOrderDetail.getQualityHasQualifiedNum()); +// qualityOrderDetail.setCreateTime(new Date()); +// qualityOrderDetail.setCreateBy(warehouseStorageOrderDetail.getCreateBy()); +// orderReportMapper.insertQualityOrderReport(qualityOrderReport); +// //插入品质报告不合格数 +// qualityOrderReportUnqualified.setSupplierCode(warehouseStorageOrderDetail.getSupplierCode()); +// qualityOrderReportUnqualified.setSupplierName(warehouseStorageOrderDetail.getSupplierName()); +// qualityOrderReportUnqualified.setMaterialNo(warehouseStorageOrderDetail.getMaterialNo()); +// qualityOrderReportUnqualified.setMaterialName(warehouseStorageOrderDetail.getMaterialName()); +// qualityOrderReportUnqualified.setCreateTime(new Date()); +// qualityOrderReportUnqualified.setCreateBy(warehouseStorageOrderDetail.getCreateBy()); +// orderReportUnqualifiedMapper.insertQualityOrderReportUnqualified(qualityOrderReportUnqualified); +// } +// } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseStorageOrderController.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseStorageOrderController.java index f8cd11c0..877d4a91 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseStorageOrderController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseStorageOrderController.java @@ -197,7 +197,7 @@ public class WarehouseStorageOrderController extends BaseController @ResponseBody public AjaxResult temporaryPurchaseSave(@RequestBody WarehouseStorageOrder warehouseStorageOrder) { - return toAjax(warehouseStorageOrderService.updateWarehouseStorageOrder(warehouseStorageOrder)); + return toAjax(warehouseStorageOrderService.temporaryPurchaseWarehouseStorageOrder(warehouseStorageOrder)); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseStorageOrderService.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseStorageOrderService.java index 3c8399da..bf2f3cab 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseStorageOrderService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseStorageOrderService.java @@ -77,4 +77,10 @@ public interface IWarehouseStorageOrderService * 入库-生产订单 * */ int updateStorageMake(WarehouseStorageOrder warehouseStorageOrder); + + + /** + * 修改保存暂收-采购单(采购入库) + */ + int temporaryPurchaseWarehouseStorageOrder(WarehouseStorageOrder warehouseStorageOrder); } 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 865d6386..ecbc1261 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 @@ -1,12 +1,27 @@ package com.ruoyi.warehouse.service.impl; +import java.util.ArrayList; +import java.util.Date; import java.util.List; + +import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.quality.domain.QualityOrder; +import com.ruoyi.quality.domain.QualityOrderDetail; +import com.ruoyi.quality.domain.QualityOrderReport; +import com.ruoyi.quality.domain.QualityOrderReportUnqualified; +import com.ruoyi.quality.mapper.QualityOrderDetailMapper; +import com.ruoyi.quality.mapper.QualityOrderMapper; +import com.ruoyi.quality.mapper.QualityOrderReportMapper; +import com.ruoyi.quality.mapper.QualityOrderReportUnqualifiedMapper; +import com.ruoyi.quality.service.IQualityOrderService; import com.ruoyi.warehouse.domain.WarehouseStorageOrderDetail; import com.ruoyi.warehouse.mapper.WarehouseStorageOrderDetailMapper; import lombok.extern.slf4j.Slf4j; +import org.activiti.editor.language.json.converter.util.CollectionUtils; +import org.apache.avalon.framework.service.ServiceException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.warehouse.mapper.WarehouseStorageOrderMapper; @@ -14,6 +29,7 @@ import com.ruoyi.warehouse.domain.WarehouseStorageOrder; import com.ruoyi.warehouse.service.IWarehouseStorageOrderService; import com.ruoyi.common.core.text.Convert; import org.springframework.transaction.annotation.Transactional; +import org.springframework.transaction.interceptor.TransactionAspectSupport; /** * 仓库入库单Service业务层处理 @@ -30,6 +46,13 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS @Autowired private WarehouseStorageOrderDetailMapper storageOrderDetailMapper; + + @Autowired + private IQualityOrderService qualityOrderService; + + @Autowired + private RedisCache redisCache; + /** * 查询仓库入库单 * @@ -71,7 +94,7 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS /** * 修改仓库入库单 - * + * * @param warehouseStorageOrder 仓库入库单 * @return 结果 */ @@ -102,11 +125,103 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS } } } - + warehouseStorageOrder.setWarehouseStorageStatus("1"); return warehouseStorageOrderMapper.updateWarehouseStorageOrder(warehouseStorageOrder); } + + + /** + * 修改保存暂收-采购单(采购入库) + * + * @param warehouseStorageOrder 仓库入库单 + * @return 结果 + */ + @Transactional + @Override + public int temporaryPurchaseWarehouseStorageOrder(WarehouseStorageOrder warehouseStorageOrder) { + String loginName = ShiroUtils.getLoginName(); + warehouseStorageOrder.setUpdateBy(loginName); + warehouseStorageOrder.setUpdateTime(DateUtils.getNowDate()); + warehouseStorageOrder.setWarehouseStorageStatus("1"); + updateWarehouseStorageOrderDetails(warehouseStorageOrder); + + int updateResult = warehouseStorageOrderMapper.updateWarehouseStorageOrder(warehouseStorageOrder); + if (updateResult <= 0) { + throw new RuntimeException("更新入库单主记录失败"); + } + + try { + qualityOrderService.insertQualityOrderByWarehouseStorageOrder(warehouseStorageOrder, warehouseStorageOrder.getWarehouseStorageOrderDetailList()); + } catch (Exception e) { + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + log.error("生成品质单时发生错误", e); + throw new RuntimeException("生成品质单时发生错误"); + } + + return updateResult; + } + + /* + * 更新仓库入库单详情的数据 + * */ + private void updateWarehouseStorageOrderDetails(WarehouseStorageOrder warehouseStorageOrder) { + List details = warehouseStorageOrder.getWarehouseStorageOrderDetailList(); + if (!CollectionUtils.isEmpty(details)) { + for (WarehouseStorageOrderDetail detail : details) { + detail.setWarehouseStorageCode(warehouseStorageOrder.getWarehouseStorageCode()); + WarehouseStorageOrderDetail tempStorageOrderDetail = new WarehouseStorageOrderDetail(); + tempStorageOrderDetail.setMaterialNo(detail.getMaterialNo()); + tempStorageOrderDetail.setSupplierCode(detail.getSupplierCode()); + tempStorageOrderDetail.setWarehouseStorageCode(warehouseStorageOrder.getWarehouseStorageCode()); + WarehouseStorageOrderDetail storageOrderDetailFromData = storageOrderDetailMapper.selectWarehouseStorageOrderByObject(tempStorageOrderDetail); + if (storageOrderDetailFromData == null){ + log.warn("数据库中入库单详情为空:{}",tempStorageOrderDetail); + }else { + storageOrderDetailMapper.updateWarehouseStorageOrderDetailByObject(detail); + } + } + } + } + + + /* + * 原仓库入库单暂收 + * + */ +// @Transactional +// @Override +// public int updateWarehouseStorageOrder(WarehouseStorageOrder warehouseStorageOrder) +// { +// String loginName = ShiroUtils.getLoginName(); +// warehouseStorageOrder.setUpdateBy(loginName); +// warehouseStorageOrder.setUpdateTime(DateUtils.getNowDate()); +// +// List storageOrderDetailList = warehouseStorageOrder.getWarehouseStorageOrderDetailList(); +// +// if (StringUtils.isEmpty(storageOrderDetailList)){ +// log.warn("入库单详情为空:{}",storageOrderDetailList); +// }else { +// for (WarehouseStorageOrderDetail warehouseStorageOrderDetail : storageOrderDetailList) { +// warehouseStorageOrderDetail.setWarehouseStorageCode(warehouseStorageOrder.getWarehouseStorageCode()); +// WarehouseStorageOrderDetail tempStorageOrderDetail = new WarehouseStorageOrderDetail(); +// tempStorageOrderDetail.setMaterialNo(warehouseStorageOrderDetail.getMaterialNo()); +// tempStorageOrderDetail.setSupplierCode(warehouseStorageOrderDetail.getSupplierCode()); +// tempStorageOrderDetail.setWarehouseStorageCode(warehouseStorageOrder.getWarehouseStorageCode()); +// WarehouseStorageOrderDetail storageOrderDetailFromData = storageOrderDetailMapper.selectWarehouseStorageOrderByObject(tempStorageOrderDetail); +// if (storageOrderDetailFromData == null){ +// log.warn("数据库中入库单详情为空:{}",tempStorageOrderDetail); +// }else { +// storageOrderDetailMapper.updateWarehouseStorageOrderDetailByObject(warehouseStorageOrderDetail); +// } +// } +// } +// warehouseStorageOrder.setWarehouseStorageStatus("1"); +// return warehouseStorageOrderMapper.updateWarehouseStorageOrder(warehouseStorageOrder); +// } + + /* * 入库-生产订单 * */ diff --git a/ruoyi-admin/src/main/resources/templates/warehouse/storageOrder/temporaryPurchase.html b/ruoyi-admin/src/main/resources/templates/warehouse/storageOrder/temporaryPurchase.html index b34a95ea..6c67a6cf 100644 --- a/ruoyi-admin/src/main/resources/templates/warehouse/storageOrder/temporaryPurchase.html +++ b/ruoyi-admin/src/main/resources/templates/warehouse/storageOrder/temporaryPurchase.html @@ -148,7 +148,7 @@ // 使用 JSON.stringify() 序列化数据 const jsonData = JSON.stringify(combinedData); // 发送 AJAX 请求到后端接口 - $.operate.saveJson(prefix + "/temporaryPurchaseWarehouse", jsonData); + $.operate.saveJson(prefix + "/temporaryPurchase", jsonData); } $("input[name='arrivedTime']").datetimepicker({ @@ -351,7 +351,7 @@ // 清空下拉框现有选项 selectElement.empty(); - // 添加默认选项(如果需要)编辑时不需要添加默认选项 + // // 添加默认选项(如果需要)编辑时不需要添加默认选项 selectElement.append(''); // 遍历返回的数据,添加为下拉框的选项 @@ -359,7 +359,7 @@ // 仓库ID selectElement.append(''); }); - // $('#warehouseCode').val(stockNO); + $('#warehouseCode').val(warehouseCode); } else { $.modal.errMsg("数据为空"); }