From 256d70235c7a829d414f6cf164179fc99ad85a1a Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Thu, 11 Jul 2024 15:47:08 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E9=94=80=E5=94=AE=E7=AE=A1=E7=90=86?= =?UTF-8?q?=20=E4=BB=93=E5=BA=93=E7=AE=A1=E7=90=86=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E9=94=80=E5=94=AE=E5=87=BA=E8=B4=A7=E9=80=9A=E7=9F=A5=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=95=B0=E6=8D=AE=E5=BA=93=20sys=5Fsales=5Fshipping?= =?UTF-8?q?=5Finform=5Fdetail=20=E6=96=B0=E5=A2=9E=E9=94=80=E5=94=AE?= =?UTF-8?q?=E5=87=BA=E8=B4=A7=E9=80=9A=E7=9F=A5domain=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E9=94=80=E5=94=AE=E5=87=BA=E8=B4=A7=E9=80=9A=E7=9F=A5=E5=BD=95?= =?UTF-8?q?service=20=E6=96=B0=E5=A2=9E=E9=94=80=E5=94=AE=E5=87=BA?= =?UTF-8?q?=E8=B4=A7=E9=80=9A=E7=9F=A5serviceImpl=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E9=94=80=E5=94=AE=E5=87=BA=E8=B4=A7=E9=80=9A=E7=9F=A5mapper=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E9=94=80=E5=94=AE=E5=8D=95=E5=87=BA?= =?UTF-8?q?=E5=BA=93=20=E6=8B=BF=E4=B8=8D=E5=88=B0=E9=94=80=E5=94=AE?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=8F=B7=E5=92=8C=E5=87=BA=E5=BA=93=E5=8D=95?= =?UTF-8?q?=E5=8F=B7=E7=9A=84=E9=97=AE=E9=A2=98=20=E6=96=B0=E5=A2=9E=20?= =?UTF-8?q?=E9=94=80=E5=94=AE=E5=8D=95=E5=8F=91=E8=B5=B7=E5=87=BA=E8=B4=A7?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=20=E6=96=B0=E5=A2=9E=E9=94=80?= =?UTF-8?q?=E5=94=AE=E5=87=BA=E5=BA=93=E5=8D=95=E8=AF=A6=E6=83=85=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=20=E9=94=80=E5=94=AE=E5=87=BA=E5=BA=93=E5=8D=95?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E5=8F=91=E8=B4=A7=E6=9B=B4=E6=96=B0=20?= =?UTF-8?q?=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E7=9A=84=E5=87=BA=E8=B4=A7?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E9=94=80=E5=94=AE=E5=8D=95=E5=87=BA?= =?UTF-8?q?=E5=BA=93=20=E6=9B=B4=E6=96=B0=E9=94=80=E5=94=AE=E5=87=BA?= =?UTF-8?q?=E8=B4=A7=E9=80=9A=E7=9F=A5=E5=88=97=E8=A1=A8=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=20=E9=94=80=E5=94=AE=E5=8D=95=E5=87=BA=E5=BA=93=20?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E5=AD=90?= =?UTF-8?q?=E8=A1=A8=E7=9A=84=E6=95=B0=E6=8D=AE=E5=90=8E=E7=AB=AF=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/SysSalesShippingInformDetail.java | 294 ++++++++++++++++++ .../SysSalesShippingInformDetailMapper.java | 77 +++++ .../ISysSalesShippingInformDetailService.java | 75 +++++ ...sSalesShippingInformDetailServiceImpl.java | 126 ++++++++ .../SysSalesShippingInformServiceImpl.java | 47 ++- .../WarehouseOutOrderController.java | 14 +- .../impl/WarehouseOutOrderServiceImpl.java | 44 ++- .../SysSalesShippingInformDetailMapper.xml | 152 +++++++++ .../warehouseOutOrder/salesOutWarehouse.html | 21 +- 9 files changed, 823 insertions(+), 27 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesShippingInformDetail.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesShippingInformDetailMapper.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesShippingInformDetailService.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformDetailServiceImpl.java create mode 100644 ruoyi-admin/src/main/resources/mapper/system/SysSalesShippingInformDetailMapper.xml diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesShippingInformDetail.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesShippingInformDetail.java new file mode 100644 index 00000000..1263ee00 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesShippingInformDetail.java @@ -0,0 +1,294 @@ +package com.ruoyi.system.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 销售出货通知详情对象 sys_sales_shipping_inform_detail + * + * @author 刘晓旭 + * @date 2024-07-11 + */ +public class SysSalesShippingInformDetail extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 出货通知单id */ + private Long shippingInformDetailId; + + /** 出库单号 */ + @Excel(name = "出库单号") + private String outOrderCode; + + /** 客户代码/id */ + @Excel(name = "客户代码/id") + private String customerId; + + /** 客户名称 */ + @Excel(name = "客户名称") + private String customerName; + + /** 料号 */ + @Excel(name = "料号") + private String materialNo; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String materialName; + + /** 物料类型 */ + @Excel(name = "物料类型") + private String materialType; + + /** 物料图片地址 */ + @Excel(name = "物料图片地址") + private String materialPhotourl; + + /** 物料品牌 */ + @Excel(name = "物料品牌") + private String materialBrand; + + /** 物料单位 */ + @Excel(name = "物料单位") + private String materialUnit; + + /** 物料描述 */ + @Excel(name = "物料描述") + private String materialDescribe; + + /** 物料加工方式 */ + @Excel(name = "物料加工方式") + private String materialProcessMethod; + + /** 物料型号 */ + @Excel(name = "物料型号") + private String materialModel; + + /** 物料规格 */ + @Excel(name = "物料规格") + private String materialSpecification; + + /** 订单数 */ + @Excel(name = "订单数") + private Integer makeNum; + + /** 本次出货数 */ + @Excel(name = "本次出货数") + private Integer thisShippingNum; + + /** 已出库数 */ + @Excel(name = "已出库数") + private Integer hasOutOrderNum; + + /** 本次验收数 */ + @Excel(name = "本次验收数") + private Integer thisCheckNum; + + /** 已验收数 */ + @Excel(name = "已验收数") + private Integer hasCheckNum; + + public void setShippingInformDetailId(Long shippingInformDetailId) + { + this.shippingInformDetailId = shippingInformDetailId; + } + + public Long getShippingInformDetailId() + { + return shippingInformDetailId; + } + public void setOutOrderCode(String outOrderCode) + { + this.outOrderCode = outOrderCode; + } + + public String getOutOrderCode() + { + return outOrderCode; + } + public void setCustomerId(String customerId) + { + this.customerId = customerId; + } + + public String getCustomerId() + { + return customerId; + } + public void setCustomerName(String customerName) + { + this.customerName = customerName; + } + + public String getCustomerName() + { + return customerName; + } + public void setMaterialNo(String materialNo) + { + this.materialNo = materialNo; + } + + public String getMaterialNo() + { + return materialNo; + } + public void setMaterialName(String materialName) + { + this.materialName = materialName; + } + + public String getMaterialName() + { + return materialName; + } + public void setMaterialType(String materialType) + { + this.materialType = materialType; + } + + public String getMaterialType() + { + return materialType; + } + public void setMaterialPhotourl(String materialPhotourl) + { + this.materialPhotourl = materialPhotourl; + } + + public String getMaterialPhotourl() + { + return materialPhotourl; + } + public void setMaterialBrand(String materialBrand) + { + this.materialBrand = materialBrand; + } + + public String getMaterialBrand() + { + return materialBrand; + } + public void setMaterialUnit(String materialUnit) + { + this.materialUnit = materialUnit; + } + + public String getMaterialUnit() + { + return materialUnit; + } + public void setMaterialDescribe(String materialDescribe) + { + this.materialDescribe = materialDescribe; + } + + public String getMaterialDescribe() + { + return materialDescribe; + } + public void setMaterialProcessMethod(String materialProcessMethod) + { + this.materialProcessMethod = materialProcessMethod; + } + + public String getMaterialProcessMethod() + { + return materialProcessMethod; + } + public void setMaterialModel(String materialModel) + { + this.materialModel = materialModel; + } + + public String getMaterialModel() + { + return materialModel; + } + public void setMaterialSpecification(String materialSpecification) + { + this.materialSpecification = materialSpecification; + } + + public String getMaterialSpecification() + { + return materialSpecification; + } + public void setMakeNum(Integer makeNum) + { + this.makeNum = makeNum; + } + + public Integer getMakeNum() + { + return makeNum; + } + public void setThisShippingNum(Integer thisShippingNum) + { + this.thisShippingNum = thisShippingNum; + } + + public Integer getThisShippingNum() + { + return thisShippingNum; + } + public void setHasOutOrderNum(Integer hasOutOrderNum) + { + this.hasOutOrderNum = hasOutOrderNum; + } + + public Integer getHasOutOrderNum() + { + return hasOutOrderNum; + } + public void setThisCheckNum(Integer thisCheckNum) + { + this.thisCheckNum = thisCheckNum; + } + + public Integer getThisCheckNum() + { + return thisCheckNum; + } + public void setHasCheckNum(Integer hasCheckNum) + { + this.hasCheckNum = hasCheckNum; + } + + public Integer getHasCheckNum() + { + return hasCheckNum; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("shippingInformDetailId", getShippingInformDetailId()) + .append("outOrderCode", getOutOrderCode()) + .append("customerId", getCustomerId()) + .append("customerName", getCustomerName()) + .append("materialNo", getMaterialNo()) + .append("materialName", getMaterialName()) + .append("materialType", getMaterialType()) + .append("materialPhotourl", getMaterialPhotourl()) + .append("materialBrand", getMaterialBrand()) + .append("materialUnit", getMaterialUnit()) + .append("materialDescribe", getMaterialDescribe()) + .append("materialProcessMethod", getMaterialProcessMethod()) + .append("materialModel", getMaterialModel()) + .append("materialSpecification", getMaterialSpecification()) + .append("makeNum", getMakeNum()) + .append("thisShippingNum", getThisShippingNum()) + .append("hasOutOrderNum", getHasOutOrderNum()) + .append("thisCheckNum", getThisCheckNum()) + .append("hasCheckNum", getHasCheckNum()) + .append("createTime", getCreateTime()) + .append("createBy", getCreateBy()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} 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 new file mode 100644 index 00000000..80900bad --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesShippingInformDetailMapper.java @@ -0,0 +1,77 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.SysSalesShippingInformDetail; + +/** + * 销售出货通知详情Mapper接口 + * + * @author 刘晓旭 + * @date 2024-07-11 + */ +public interface SysSalesShippingInformDetailMapper +{ + /** + * 查询销售出货通知详情 + * + * @param shippingInformDetailId 销售出货通知详情ID + * @return 销售出货通知详情 + */ + public SysSalesShippingInformDetail selectSysSalesShippingInformDetailById(Long shippingInformDetailId); + + /** + * 查询销售出货通知详情列表 + * + * @param sysSalesShippingInformDetail 销售出货通知详情 + * @return 销售出货通知详情集合 + */ + public List selectSysSalesShippingInformDetailList(SysSalesShippingInformDetail sysSalesShippingInformDetail); + + /** + * 新增销售出货通知详情 + * + * @param sysSalesShippingInformDetail 销售出货通知详情 + * @return 结果 + */ + public int insertSysSalesShippingInformDetail(SysSalesShippingInformDetail sysSalesShippingInformDetail); + + /** + * 修改销售出货通知详情 + * + * @param sysSalesShippingInformDetail 销售出货通知详情 + * @return 结果 + */ + public int updateSysSalesShippingInformDetail(SysSalesShippingInformDetail sysSalesShippingInformDetail); + + /** + * 删除销售出货通知详情 + * + * @param shippingInformDetailId 销售出货通知详情ID + * @return 结果 + */ + public int deleteSysSalesShippingInformDetailById(Long shippingInformDetailId); + + /** + * 批量删除销售出货通知详情 + * + * @param shippingInformDetailIds 需要删除的数据ID + * @return 结果 + */ + public int deleteSysSalesShippingInformDetailByIds(String[] shippingInformDetailIds); + + /** + * 作废销售出货通知详情 + * + * @param shippingInformDetailId 销售出货通知详情ID + * @return 结果 + */ + public int cancelSysSalesShippingInformDetailById(Long shippingInformDetailId); + + /** + * 恢复销售出货通知详情 + * + * @param shippingInformDetailId 销售出货通知详情ID + * @return 结果 + */ + public int restoreSysSalesShippingInformDetailById(Long shippingInformDetailId); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesShippingInformDetailService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesShippingInformDetailService.java new file mode 100644 index 00000000..cb157419 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesShippingInformDetailService.java @@ -0,0 +1,75 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.SysSalesShippingInformDetail; + +/** + * 销售出货通知详情Service接口 + * + * @author 刘晓旭 + * @date 2024-07-11 + */ +public interface ISysSalesShippingInformDetailService +{ + /** + * 查询销售出货通知详情 + * + * @param shippingInformDetailId 销售出货通知详情ID + * @return 销售出货通知详情 + */ + public SysSalesShippingInformDetail selectSysSalesShippingInformDetailById(Long shippingInformDetailId); + + /** + * 查询销售出货通知详情列表 + * + * @param sysSalesShippingInformDetail 销售出货通知详情 + * @return 销售出货通知详情集合 + */ + public List selectSysSalesShippingInformDetailList(SysSalesShippingInformDetail sysSalesShippingInformDetail); + + /** + * 新增销售出货通知详情 + * + * @param sysSalesShippingInformDetail 销售出货通知详情 + * @return 结果 + */ + public int insertSysSalesShippingInformDetail(SysSalesShippingInformDetail sysSalesShippingInformDetail); + + /** + * 修改销售出货通知详情 + * + * @param sysSalesShippingInformDetail 销售出货通知详情 + * @return 结果 + */ + public int updateSysSalesShippingInformDetail(SysSalesShippingInformDetail sysSalesShippingInformDetail); + + /** + * 批量删除销售出货通知详情 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteSysSalesShippingInformDetailByIds(String ids); + + /** + * 删除销售出货通知详情信息 + * + * @param shippingInformDetailId 销售出货通知详情ID + * @return 结果 + */ + public int deleteSysSalesShippingInformDetailById(Long shippingInformDetailId); + + /** + * 作废销售出货通知详情 + * @param shippingInformDetailId 销售出货通知详情ID + * @return + */ + int cancelSysSalesShippingInformDetailById(Long shippingInformDetailId); + + /** + * 恢复销售出货通知详情 + * @param shippingInformDetailId 销售出货通知详情ID + * @return + */ + int restoreSysSalesShippingInformDetailById(Long shippingInformDetailId); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformDetailServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformDetailServiceImpl.java new file mode 100644 index 00000000..aa8d6c81 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformDetailServiceImpl.java @@ -0,0 +1,126 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.ShiroUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.mapper.SysSalesShippingInformDetailMapper; +import com.ruoyi.system.domain.SysSalesShippingInformDetail; +import com.ruoyi.system.service.ISysSalesShippingInformDetailService; +import com.ruoyi.common.core.text.Convert; + +/** + * 销售出货通知详情Service业务层处理 + * + * @author 刘晓旭 + * @date 2024-07-11 + */ +@Service +public class SysSalesShippingInformDetailServiceImpl implements ISysSalesShippingInformDetailService +{ + @Autowired + private SysSalesShippingInformDetailMapper sysSalesShippingInformDetailMapper; + + /** + * 查询销售出货通知详情 + * + * @param shippingInformDetailId 销售出货通知详情ID + * @return 销售出货通知详情 + */ + @Override + public SysSalesShippingInformDetail selectSysSalesShippingInformDetailById(Long shippingInformDetailId) + { + return sysSalesShippingInformDetailMapper.selectSysSalesShippingInformDetailById(shippingInformDetailId); + } + + /** + * 查询销售出货通知详情列表 + * + * @param sysSalesShippingInformDetail 销售出货通知详情 + * @return 销售出货通知详情 + */ + @Override + public List selectSysSalesShippingInformDetailList(SysSalesShippingInformDetail sysSalesShippingInformDetail) + { + return sysSalesShippingInformDetailMapper.selectSysSalesShippingInformDetailList(sysSalesShippingInformDetail); + } + + /** + * 新增销售出货通知详情 + * + * @param sysSalesShippingInformDetail 销售出货通知详情 + * @return 结果 + */ + @Override + public int insertSysSalesShippingInformDetail(SysSalesShippingInformDetail sysSalesShippingInformDetail) + { + sysSalesShippingInformDetail.setCreateTime(DateUtils.getNowDate()); + String loginName = ShiroUtils.getLoginName(); + sysSalesShippingInformDetail.setCreateBy(loginName); + return sysSalesShippingInformDetailMapper.insertSysSalesShippingInformDetail(sysSalesShippingInformDetail); + } + + /** + * 修改销售出货通知详情 + * + * @param sysSalesShippingInformDetail 销售出货通知详情 + * @return 结果 + */ + @Override + public int updateSysSalesShippingInformDetail(SysSalesShippingInformDetail sysSalesShippingInformDetail) + { + String loginName = ShiroUtils.getLoginName(); + sysSalesShippingInformDetail.setUpdateBy(loginName); + sysSalesShippingInformDetail.setUpdateTime(DateUtils.getNowDate()); + return sysSalesShippingInformDetailMapper.updateSysSalesShippingInformDetail(sysSalesShippingInformDetail); + } + + /** + * 删除销售出货通知详情对象 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + @Override + public int deleteSysSalesShippingInformDetailByIds(String ids) + { + return sysSalesShippingInformDetailMapper.deleteSysSalesShippingInformDetailByIds(Convert.toStrArray(ids)); + } + + /** + * 删除销售出货通知详情信息 + * + * @param shippingInformDetailId 销售出货通知详情ID + * @return 结果 + */ + @Override + public int deleteSysSalesShippingInformDetailById(Long shippingInformDetailId) + { + return sysSalesShippingInformDetailMapper.deleteSysSalesShippingInformDetailById(shippingInformDetailId); + } + + /** + * 作废销售出货通知详情 + * + * @param shippingInformDetailId 销售出货通知详情ID + * @return 结果 + */ + @Override + public int cancelSysSalesShippingInformDetailById(Long shippingInformDetailId) + { + return sysSalesShippingInformDetailMapper.cancelSysSalesShippingInformDetailById(shippingInformDetailId); + } + + /** + * 恢复销售出货通知详情信息 + * + * @param shippingInformDetailId 销售出货通知详情ID + * @return 结果 + */ + @Override + public int restoreSysSalesShippingInformDetailById(Long shippingInformDetailId) + { + return sysSalesShippingInformDetailMapper.restoreSysSalesShippingInformDetailById(shippingInformDetailId); + } +} 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 96682a81..73d963f2 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 @@ -9,9 +9,9 @@ import com.ruoyi.common.exception.BusinessException; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.system.domain.SysSalesOrder; -import com.ruoyi.system.domain.SysSalesOrderVo; +import com.ruoyi.system.domain.*; import com.ruoyi.system.mapper.SysSalesOrderMapper; +import com.ruoyi.system.mapper.SysSalesShippingInformDetailMapper; import com.ruoyi.warehouse.domain.WarehouseOutOrder; import com.ruoyi.warehouse.mapper.WarehouseOutOrderMapper; import com.ruoyi.warehouse.mapper.WarehouseStorageOrderMapper; @@ -19,7 +19,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.system.mapper.SysSalesShippingInformMapper; -import com.ruoyi.system.domain.SysSalesShippingInform; import com.ruoyi.system.service.ISysSalesShippingInformService; import com.ruoyi.common.core.text.Convert; import org.springframework.transaction.annotation.Transactional; @@ -46,6 +45,9 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor @Autowired private WarehouseOutOrderMapper warehouseOutOrderMapper; + @Autowired + private SysSalesShippingInformDetailMapper shippingInformDetailMapper; + /** * 查询销售出货通知 * @@ -154,6 +156,8 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor @Override public int generateShippingInformBySalesOrder(SysSalesOrder sysSalesOrder,String outOrderCode) { + String loginName = ShiroUtils.getLoginName(); + SysSalesShippingInform sysSalesShippingInform = new SysSalesShippingInform(); String salesOrderCode = sysSalesOrder.getSalesOrderCode(); if (StringUtils.isEmpty(salesOrderCode)){ @@ -174,11 +178,34 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor sysSalesShippingInform.setCustomerName(sysSalesOrderVo.getEnterpriseName()); sysSalesShippingInform.setDeliveryCondition(sysSalesOrderVo.getDeliveryConditions()); sysSalesShippingInform.setCreateTime(new Date()); - sysSalesShippingInform.setCreateBy(ShiroUtils.getLoginName()); + sysSalesShippingInform.setCreateBy(loginName); sysSalesShippingInform.setAllPriceExcludingTaxDollar(BigDecimal.valueOf(sysSalesOrderVo.getNoUsdSum())); sysSalesShippingInform.setAllPriceExcludingTaxRmb(BigDecimal.valueOf(sysSalesOrderVo.getNoRmbSum())); sysSalesShippingInform.setAllPriceIncludesTax(BigDecimal.valueOf(sysSalesOrderVo.getRmbTaxSum())); + //更新物料合计 + sysSalesShippingInform.setMaterialSum(Math.toIntExact(sysSalesOrderVo.getMaterialSum())); + //更新数量合计 + sysSalesShippingInform.setEnterpriseSum(Math.toIntExact(sysSalesOrderVo.getEnterpriseSum())); + + //更新销售出库详情数据 + List sysSalesOrderChildList = sysSalesOrder.getSysSalesOrderChildList(); + for (SysSalesOrderChild sysSalesOrderChild : sysSalesOrderChildList) { + SysSalesShippingInformDetail sysSalesShippingInformDetail = new SysSalesShippingInformDetail(); + sysSalesShippingInformDetail.setOutOrderCode(outOrderCode); + sysSalesShippingInformDetail.setMaterialNo(sysSalesOrderChild.getMaterialCode()); + sysSalesShippingInformDetail.setMaterialName(sysSalesOrderChild.getMaterialName()); + sysSalesShippingInformDetail.setMaterialType(sysSalesOrderChild.getMaterialType()); + sysSalesShippingInformDetail.setMaterialBrand(sysSalesOrderChild.getBrand()); + sysSalesShippingInformDetail.setMaterialUnit(sysSalesOrderChild.getUnit()); + sysSalesShippingInformDetail.setMaterialDescribe(sysSalesOrderChild.getDescribe()); + sysSalesShippingInformDetail.setMaterialProcessMethod(sysSalesOrderChild.getProcessMethod()); + sysSalesShippingInformDetail.setMakeNum(sysSalesOrderChild.getMaterialNum()); + sysSalesShippingInformDetail.setHasOutOrderNum(sysSalesOrderChild.getOutBoundQuantity()); + sysSalesShippingInformDetail.setCreateBy(loginName); + sysSalesShippingInformDetail.setCreateTime(new Date()); + shippingInformDetailMapper.insertSysSalesShippingInformDetail(sysSalesShippingInformDetail); + } return sysSalesShippingInformMapper.insertSysSalesShippingInform(sysSalesShippingInform); } @@ -205,6 +232,18 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor warehouseOutOrder.setUpdateBy(loginName); warehouseOutOrder.setUpdateTime(new Date()); + //更新销售订单的出货状态 + SysSalesOrder sysSalesOrder = new SysSalesOrder(); + sysSalesOrder.setUpdateBy(loginName); + sysSalesOrder.setUpdateTime(new Date()); + sysSalesOrder.setSalesOrderCode(sysSalesShippingInform.getSalesOrderCode()); + //暂收设置为全部出货 + sysSalesOrder.setDeliveryStatus("6"); + int updateSysSalesOrderResult = sysSalesOrderMapper.updateSysSalesOrderBySalesOrderCode(sysSalesOrder); + if (updateSysSalesOrderResult <= 0){ + throw new BusinessException("更新销售订单数据失败"); + } + int updateWarehouseOutOrderResult = warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder); if (updateWarehouseOutOrderResult <= 0){ throw new BusinessException("更新出库单数据失败"); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseOutOrderController.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseOutOrderController.java index 41453844..130a7a03 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseOutOrderController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseOutOrderController.java @@ -5,6 +5,8 @@ import java.util.Map; import java.util.stream.Collectors; import com.ruoyi.aftersales.domain.AfterSalesShippingDevice; +import com.ruoyi.aftersales.domain.vo.SelectShippingDeviceVO; +import com.ruoyi.aftersales.service.IAftersalesWarehouseOutService; import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail; import com.ruoyi.warehouse.domain.WarehouseStorageOrderDetail; import com.ruoyi.warehouse.service.IWarehouseOutOrderDetailService; @@ -40,6 +42,10 @@ public class WarehouseOutOrderController extends BaseController @Autowired private IWarehouseOutOrderDetailService outOrderDetailService; + + @Autowired + private IAftersalesWarehouseOutService aftersalesWarehouseOutService; + @RequiresPermissions("warehouse:warehouseOutOrder:view") @GetMapping() public String warehouseOutOrder() @@ -231,14 +237,10 @@ public class WarehouseOutOrderController extends BaseController */ @PostMapping("/getShippingDeviceList") @ResponseBody - public TableDataInfo getShippingDeviceList( @RequestParam("salesOrderCode") String salesOrderCode, - @RequestParam("materialNo") String materialNo) + public TableDataInfo getShippingDeviceList(@RequestParam("materialNo") String materialNo) { startPage(); - AfterSalesShippingDevice afterSalesShippingDevice = new AfterSalesShippingDevice(); - afterSalesShippingDevice.setSalesOrderCode(salesOrderCode); - afterSalesShippingDevice.setMaterialNo(materialNo); - List list = outOrderDetailService.selectShippingDeviceList(afterSalesShippingDevice); + List list = aftersalesWarehouseOutService.showAftersalesShippingDeviceListTwo(materialNo); return getDataTable(list); } 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 a189925d..b41417da 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 @@ -46,6 +46,9 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService @Autowired private SysMakeorderPickDetailMapper makeorderPickDetailMapper; + @Autowired + private SysSalesOrderChildMapper salesOrderChildMapper; + @Autowired private SysMakeOrderMapper sysMakeOrderMapper; @@ -210,29 +213,58 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService /** * 修改保存销售单-出库 */ - @Transactional + @Transactional(rollbackFor = Exception.class) @Override public int updateSalesOutWarehouse(WarehouseOutOrder warehouseOutOrder) { String loginName = ShiroUtils.getLoginName(); warehouseOutOrder.setUpdateBy(loginName); warehouseOutOrder.setUpdateTime(new Date()); - warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder); + //设置为已出库 + warehouseOutOrder.setWarehouseOutStatus("7"); List warehouseOutOrderDetailList = warehouseOutOrder.getWarehouseOutOrderDetailList(); if (StringUtils.isEmpty(warehouseOutOrderDetailList)){ log.warn("保存销售单-出库,物料列表信息为空:{}",warehouseOutOrder); } - int updateRows = 0; for (WarehouseOutOrderDetail warehouseOutOrderDetail : warehouseOutOrderDetailList) { + SysSalesOrderChild sysSalesOrderChild = new SysSalesOrderChild(); + sysSalesOrderChild.setQuoteId(warehouseOutOrder.getSalesOrderCode()); + sysSalesOrderChild.setMaterialCode(warehouseOutOrderDetail.getMaterialNo()); + sysSalesOrderChild.setOutBoundQuantity(warehouseOutOrderDetail.getActualOutOrderSum()); + int updateSalesOrderChildResult = salesOrderChildMapper.updateSysSalesOrderChildByCodeAndQuoteId(sysSalesOrderChild); + if (updateSalesOrderChildResult <= 0){ + throw new BusinessException("更新销售出库详情数据失败"); + } warehouseOutOrderDetail.setUpdateBy(loginName); warehouseOutOrderDetail.setUpdateTime(new Date()); warehouseOutOrderDetail.setRemark(warehouseOutOrder.getRemark()); warehouseOutOrderDetail.setDeliveryDate(warehouseOutOrder.getDeliveryDate()); - //更新数据库记录 - updateRows += outOrderDetailMapper.updateWarehouseOutOrderDetail(warehouseOutOrderDetail); + int updateWarehouseOutOrderDetailResult = outOrderDetailMapper.updateWarehouseOutOrderDetail(warehouseOutOrderDetail); + if (updateWarehouseOutOrderDetailResult <= 0){ + throw new BusinessException("更新出库单详情数据失败"); + } } - return updateRows; + //更新销售出货通知列表 + SysSalesShippingInform sysSalesShippingInform = new SysSalesShippingInform(); + //出货状态为待收货 + sysSalesShippingInform.setWarehouseOutStatus("9"); + sysSalesShippingInform.setOutOrderCode(warehouseOutOrder.getOutOrderCode()); + + + //更新已出库数 + int updateSysSalesShippingInformResult = shippingInformMapper.updateSysSalesShippingInformByOutOrderCode(sysSalesShippingInform); + if (updateSysSalesShippingInformResult <= 0){ + throw new BusinessException("更新销售出库单数据失败"); + } + + int updateWarehouseOutOrderResult = warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder); + + if (updateWarehouseOutOrderResult <= 0){ + throw new BusinessException("更新销售出库数据失败"); + } + + return updateWarehouseOutOrderResult; } /** diff --git a/ruoyi-admin/src/main/resources/mapper/system/SysSalesShippingInformDetailMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/SysSalesShippingInformDetailMapper.xml new file mode 100644 index 00000000..0426d9d8 --- /dev/null +++ b/ruoyi-admin/src/main/resources/mapper/system/SysSalesShippingInformDetailMapper.xml @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select shipping_inform_detail_id, out_order_code, customer_id, customer_name, material_no, material_name, material_type, material_photoUrl, material_brand, material_unit, material_describe, material_process_method, material_model, material_specification, make_num, this_shipping_num, has_out_order_num, this_check_num, has_check_num, create_time, create_by, update_by, update_time, remark from sys_sales_shipping_inform_detail + + + + + + + + insert into sys_sales_shipping_inform_detail + + out_order_code, + customer_id, + customer_name, + material_no, + material_name, + material_type, + material_photoUrl, + material_brand, + material_unit, + material_describe, + material_process_method, + material_model, + material_specification, + make_num, + this_shipping_num, + has_out_order_num, + this_check_num, + has_check_num, + create_time, + create_by, + update_by, + update_time, + remark, + + + #{outOrderCode}, + #{customerId}, + #{customerName}, + #{materialNo}, + #{materialName}, + #{materialType}, + #{materialPhotourl}, + #{materialBrand}, + #{materialUnit}, + #{materialDescribe}, + #{materialProcessMethod}, + #{materialModel}, + #{materialSpecification}, + #{makeNum}, + #{thisShippingNum}, + #{hasOutOrderNum}, + #{thisCheckNum}, + #{hasCheckNum}, + #{createTime}, + #{createBy}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + + update sys_sales_shipping_inform_detail + + out_order_code = #{outOrderCode}, + customer_id = #{customerId}, + customer_name = #{customerName}, + material_no = #{materialNo}, + material_name = #{materialName}, + material_type = #{materialType}, + material_photoUrl = #{materialPhotourl}, + material_brand = #{materialBrand}, + material_unit = #{materialUnit}, + material_describe = #{materialDescribe}, + material_process_method = #{materialProcessMethod}, + material_model = #{materialModel}, + material_specification = #{materialSpecification}, + make_num = #{makeNum}, + this_shipping_num = #{thisShippingNum}, + has_out_order_num = #{hasOutOrderNum}, + this_check_num = #{thisCheckNum}, + has_check_num = #{hasCheckNum}, + create_time = #{createTime}, + create_by = #{createBy}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where shipping_inform_detail_id = #{shippingInformDetailId} + + + + delete from sys_sales_shipping_inform_detail where shipping_inform_detail_id = #{shippingInformDetailId} + + + + delete from sys_sales_shipping_inform_detail where shipping_inform_detail_id in + + #{shippingInformDetailId} + + + + + update sys_sales_shipping_inform_detail set del_flag = '1' where shipping_inform_detail_id = #{shippingInformDetailId} + + + + update sys_sales_shipping_inform_detail set del_flag = '0' where shipping_inform_detail_id = #{shippingInformDetailId} + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/salesOutWarehouse.html b/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/salesOutWarehouse.html index cab7e0dc..55513cc8 100644 --- a/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/salesOutWarehouse.html +++ b/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/salesOutWarehouse.html @@ -11,7 +11,7 @@
- +
@@ -25,19 +25,19 @@
- +
- +
- +
@@ -52,31 +52,31 @@
- +
- +
- +
- +
- +
@@ -150,7 +150,7 @@ // 使用 JSON.stringify() 序列化数据 const jsonData = JSON.stringify(combinedData); // 发送 AJAX 请求到后端接口 - $.operate.saveJson(prefix + "/prepareMaterial", jsonData); + $.operate.saveJson(prefix + "/salesOutWarehouse", jsonData); } //物料信息展示列表 @@ -266,7 +266,6 @@ sidePagination: "server", contentType: "application/x-www-form-urlencoded", queryParams : { - salesOrderCode: row.salesOrderCode, materialNo: row.materialNo, }, columns: [