diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesWarehouseOutServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesWarehouseOutServiceImpl.java index cf8cdac4..139a2ab5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesWarehouseOutServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesWarehouseOutServiceImpl.java @@ -16,6 +16,7 @@ import com.ruoyi.common.utils.StringUtils; import com.ruoyi.system.domain.SysSalesOrder; import com.ruoyi.system.domain.SysSalesOrderChild; import com.ruoyi.system.domain.SysSalesShippingInform; +import com.ruoyi.system.domain.SysSalesShippingInformDetail; import com.ruoyi.system.mapper.SysSalesOrderChildMapper; import com.ruoyi.system.mapper.SysSalesOrderMapper; import com.ruoyi.system.mapper.SysSalesShippingInformMapper; diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysMakeOrderMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysMakeOrderMapper.java index c31a1a5f..ac8f7703 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysMakeOrderMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysMakeOrderMapper.java @@ -119,4 +119,9 @@ public interface SysMakeOrderMapper * 根据入库单号查询生产单号 * */ String selectMakeByWarehouseStorageCode(String warehouseStorageCode); + + /* + * 根据销售单号查询生产订单 + * */ + SysMakeOrder selectMakeOrderBySaleNo(String salesOrderCode); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesShippingInformDetailMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesShippingInformDetailMapper.java index 0bdcba7e..1fafefc5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesShippingInformDetailMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesShippingInformDetailMapper.java @@ -43,6 +43,17 @@ public interface SysSalesShippingInformDetailMapper */ public int updateSysSalesShippingInformDetail(SysSalesShippingInformDetail sysSalesShippingInformDetail); + + + /** + * 修改销售出货通知详情 + * + * @param sysSalesShippingInformDetail 销售出货通知详情 + * @return 结果 + */ + public int updateSysSalesShippingInformDetailByCodeAndNo(SysSalesShippingInformDetail sysSalesShippingInformDetail); + + /** * 删除销售出货通知详情 * diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java index 0616334c..ac717d43 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java @@ -189,6 +189,11 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor sysSalesShippingInform.setMaterialSum(Math.toIntExact(sysSalesOrderVo.getMaterialSum())); //更新数量合计 sysSalesShippingInform.setEnterpriseSum(Math.toIntExact(sysSalesOrderVo.getEnterpriseSum())); + sysSalesShippingInform.setCustomerContact(sysSalesOrderVo.getCustomerDelivery()); + sysSalesShippingInform.setContactNumber(sysSalesOrderVo.getDeliveryPhone()); + sysSalesShippingInform.setCustomerContactAddress(sysSalesOrderVo.getDeliveryAddress()); + + //更新销售出库详情数据 List sysSalesOrderChildList = sysSalesOrder.getSysSalesOrderChildList(); @@ -204,6 +209,7 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor sysSalesShippingInformDetail.setMaterialProcessMethod(sysSalesOrderChild.getProcessMethod()); sysSalesShippingInformDetail.setMakeNum(sysSalesOrderChild.getMaterialNum()); sysSalesShippingInformDetail.setHasOutOrderNum(sysSalesOrderChild.getOutBoundQuantity()); + sysSalesShippingInformDetail.setThisShippingNum(sysSalesOrderChild.getApplyShippingNum()); sysSalesShippingInformDetail.setCreateBy(loginName); sysSalesShippingInformDetail.setCreateTime(new Date()); shippingInformDetailMapper.insertSysSalesShippingInformDetail(sysSalesShippingInformDetail); @@ -236,10 +242,11 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor warehouseOutOrder.setUpdateTime(new Date()); //更新销售订单的出货状态 +// SysSalesShippingInform tempShippingInform = sysSalesShippingInformMapper.selectSysSalesShippingInformByCode(outOrderCode); SysSalesOrder sysSalesOrder = new SysSalesOrder(); sysSalesOrder.setUpdateBy(loginName); sysSalesOrder.setUpdateTime(new Date()); - sysSalesOrder.setSalesOrderCode(sysSalesShippingInform.getSalesOrderCode()); + sysSalesOrder.setSalesOrderCode(warehouseOutOrder.getSalesOrderCode()); //暂收设置为全部出货 sysSalesOrder.setDeliveryStatus("6"); int updateSysSalesOrderResult = sysSalesOrderMapper.updateSysSalesOrderBySalesOrderCode(sysSalesOrder); 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 b41417da..98b20d90 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 @@ -62,6 +62,9 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService private SysSalesShippingInformMapper shippingInformMapper; + @Autowired + private SysSalesShippingInformDetailMapper shippingInformDetailMapper; + /** * 查询仓库出库单 * @@ -232,8 +235,20 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService sysSalesOrderChild.setQuoteId(warehouseOutOrder.getSalesOrderCode()); sysSalesOrderChild.setMaterialCode(warehouseOutOrderDetail.getMaterialNo()); sysSalesOrderChild.setOutBoundQuantity(warehouseOutOrderDetail.getActualOutOrderSum()); + sysSalesOrderChild.setUpdateBy(loginName); + sysSalesOrderChild.setUpdateTime(new Date()); int updateSalesOrderChildResult = salesOrderChildMapper.updateSysSalesOrderChildByCodeAndQuoteId(sysSalesOrderChild); if (updateSalesOrderChildResult <= 0){ + throw new BusinessException("更新销售订单子表数据失败"); + } + SysSalesShippingInformDetail sysSalesShippingInformDetail = new SysSalesShippingInformDetail(); + sysSalesShippingInformDetail.setHasOutOrderNum(warehouseOutOrderDetail.getActualOutOrderSum()); + sysSalesShippingInformDetail.setUpdateBy(loginName); + sysSalesShippingInformDetail.setUpdateTime(new Date()); + sysSalesShippingInformDetail.setOutOrderCode(warehouseOutOrder.getOutOrderCode()); + sysSalesShippingInformDetail.setMaterialNo(warehouseOutOrderDetail.getMaterialNo()); + int updateShippingInformDetailResult = shippingInformDetailMapper.updateSysSalesShippingInformDetailByCodeAndNo(sysSalesShippingInformDetail); + if (updateShippingInformDetailResult <= 0){ throw new BusinessException("更新销售出库详情数据失败"); } warehouseOutOrderDetail.setUpdateBy(loginName); @@ -579,6 +594,18 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService WarehouseOutOrder warehouseOutOrder = new WarehouseOutOrder(); warehouseOutOrder.setOutOrderCode(outOrderCode); + //添加生产单号 + SysMakeOrder makeOrder = sysMakeOrderMapper.selectMakeOrderBySaleNo(salesOrderCode); + if (makeOrder == null){ + log.warn("生产订单编号为空:{}",makeOrder.getMakeNo()); + } + + + warehouseOutOrder.setDeliveryName(sysSalesOrderVo.getCustomerDelivery()); + warehouseOutOrder.setDeliveryNumber(sysSalesOrderVo.getDeliveryPhone()); + warehouseOutOrder.setDeliveryAddress(sysSalesOrderVo.getDeliveryAddress()); + + warehouseOutOrder.setMakeNo(makeOrder.getMakeNo()); //出库状态为 待仓库准备物料 warehouseOutOrder.setWarehouseOutStatus("0"); warehouseOutOrder.setRelatedOrderCode(salesOrderCode); @@ -587,10 +614,17 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService warehouseOutOrder.setWarehouseOrderType("0"); //出库类型设置为 销售出库 warehouseOutOrder.setWarehouseOutType("0"); + + //物料合计 + warehouseOutOrder.setMaterialSum(Math.toIntExact(sysSalesOrderVo.getMaterialSum())); + //数量合计 + warehouseOutOrder.setEnterpriseSum(Math.toIntExact(sysSalesOrderVo.getEnterpriseSum())); + + warehouseOutOrder.setBusinessName(sysSalesOrderVo.getBusinessMembers()); warehouseOutOrder.setCustomerId(sysSalesOrderVo.getEnterpriseCode()); warehouseOutOrder.setCustomerName(sysSalesOrderVo.getEnterpriseName()); - warehouseOutOrder.setApplyName(sysSalesOrderVo.getApplyUserName()); + warehouseOutOrder.setApplyName(sysSalesOrderVo.getApplyUser()); warehouseOutOrder.setDeliveryCondition(sysSalesOrderVo.getDeliveryConditions()); warehouseOutOrder.setCreateTime(new Date()); warehouseOutOrder.setCreateBy(ShiroUtils.getLoginName()); diff --git a/ruoyi-admin/src/main/resources/mapper/system/SysMakeOrderMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/SysMakeOrderMapper.xml index 3a86a777..e0673d57 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/SysMakeOrderMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/SysMakeOrderMapper.xml @@ -270,6 +270,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + +
@@ -25,49 +25,49 @@
- +
- +
- +
- +
- +
- +
- +
- +