Browse Source

[feat] 销售管理 仓库管理

新增销售出货通知列表数据库 sys_sales_shipping_inform_detail
新增销售出货通知domain
新增销售出货通知录service
新增销售出货通知serviceImpl
新增销售出货通知mapper
修复 销售单出库 拿不到销售订单号和出库单号的问题
新增 销售单发起出货的时候 新增销售出库单详情数据后端接口
新增 销售出库单确认发货更新 销售订单的出货状态后端接口
新增 销售单出库 更新销售出货通知列表的数据后端接口
新增 销售单出库 更新销售订单子表的数据后端接口
dev
liuxiaoxu 4 months ago
parent
commit
256d70235c
  1. 294
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesShippingInformDetail.java
  2. 77
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesShippingInformDetailMapper.java
  3. 75
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesShippingInformDetailService.java
  4. 126
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformDetailServiceImpl.java
  5. 47
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java
  6. 14
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseOutOrderController.java
  7. 44
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderServiceImpl.java
  8. 152
      ruoyi-admin/src/main/resources/mapper/system/SysSalesShippingInformDetailMapper.xml
  9. 21
      ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/salesOutWarehouse.html

294
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();
}
}

77
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<SysSalesShippingInformDetail> 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);
}

75
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<SysSalesShippingInformDetail> 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);
}

126
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<SysSalesShippingInformDetail> 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);
}
}

47
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<SysSalesOrderChild> 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("更新出库单数据失败");

14
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<AfterSalesShippingDevice> list = outOrderDetailService.selectShippingDeviceList(afterSalesShippingDevice);
List<SelectShippingDeviceVO> list = aftersalesWarehouseOutService.showAftersalesShippingDeviceListTwo(materialNo);
return getDataTable(list);
}

44
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<WarehouseOutOrderDetail> 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;
}
/**

152
ruoyi-admin/src/main/resources/mapper/system/SysSalesShippingInformDetailMapper.xml

@ -0,0 +1,152 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.SysSalesShippingInformDetailMapper">
<resultMap type="SysSalesShippingInformDetail" id="SysSalesShippingInformDetailResult">
<result property="shippingInformDetailId" column="shipping_inform_detail_id" />
<result property="outOrderCode" column="out_order_code" />
<result property="customerId" column="customer_id" />
<result property="customerName" column="customer_name" />
<result property="materialNo" column="material_no" />
<result property="materialName" column="material_name" />
<result property="materialType" column="material_type" />
<result property="materialPhotourl" column="material_photoUrl" />
<result property="materialBrand" column="material_brand" />
<result property="materialUnit" column="material_unit" />
<result property="materialDescribe" column="material_describe" />
<result property="materialProcessMethod" column="material_process_method" />
<result property="materialModel" column="material_model" />
<result property="materialSpecification" column="material_specification" />
<result property="makeNum" column="make_num" />
<result property="thisShippingNum" column="this_shipping_num" />
<result property="hasOutOrderNum" column="has_out_order_num" />
<result property="thisCheckNum" column="this_check_num" />
<result property="hasCheckNum" column="has_check_num" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectSysSalesShippingInformDetailVo">
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
</sql>
<select id="selectSysSalesShippingInformDetailList" parameterType="SysSalesShippingInformDetail" resultMap="SysSalesShippingInformDetailResult">
<include refid="selectSysSalesShippingInformDetailVo"/>
<where>
</where>
</select>
<select id="selectSysSalesShippingInformDetailById" parameterType="Long" resultMap="SysSalesShippingInformDetailResult">
<include refid="selectSysSalesShippingInformDetailVo"/>
where shipping_inform_detail_id = #{shippingInformDetailId}
</select>
<insert id="insertSysSalesShippingInformDetail" parameterType="SysSalesShippingInformDetail" useGeneratedKeys="true" keyProperty="shippingInformDetailId">
insert into sys_sales_shipping_inform_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="outOrderCode != null">out_order_code,</if>
<if test="customerId != null">customer_id,</if>
<if test="customerName != null">customer_name,</if>
<if test="materialNo != null">material_no,</if>
<if test="materialName != null">material_name,</if>
<if test="materialType != null">material_type,</if>
<if test="materialPhotourl != null">material_photoUrl,</if>
<if test="materialBrand != null">material_brand,</if>
<if test="materialUnit != null">material_unit,</if>
<if test="materialDescribe != null">material_describe,</if>
<if test="materialProcessMethod != null">material_process_method,</if>
<if test="materialModel != null">material_model,</if>
<if test="materialSpecification != null">material_specification,</if>
<if test="makeNum != null">make_num,</if>
<if test="thisShippingNum != null">this_shipping_num,</if>
<if test="hasOutOrderNum != null">has_out_order_num,</if>
<if test="thisCheckNum != null">this_check_num,</if>
<if test="hasCheckNum != null">has_check_num,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="outOrderCode != null">#{outOrderCode},</if>
<if test="customerId != null">#{customerId},</if>
<if test="customerName != null">#{customerName},</if>
<if test="materialNo != null">#{materialNo},</if>
<if test="materialName != null">#{materialName},</if>
<if test="materialType != null">#{materialType},</if>
<if test="materialPhotourl != null">#{materialPhotourl},</if>
<if test="materialBrand != null">#{materialBrand},</if>
<if test="materialUnit != null">#{materialUnit},</if>
<if test="materialDescribe != null">#{materialDescribe},</if>
<if test="materialProcessMethod != null">#{materialProcessMethod},</if>
<if test="materialModel != null">#{materialModel},</if>
<if test="materialSpecification != null">#{materialSpecification},</if>
<if test="makeNum != null">#{makeNum},</if>
<if test="thisShippingNum != null">#{thisShippingNum},</if>
<if test="hasOutOrderNum != null">#{hasOutOrderNum},</if>
<if test="thisCheckNum != null">#{thisCheckNum},</if>
<if test="hasCheckNum != null">#{hasCheckNum},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateSysSalesShippingInformDetail" parameterType="SysSalesShippingInformDetail">
update sys_sales_shipping_inform_detail
<trim prefix="SET" suffixOverrides=",">
<if test="outOrderCode != null">out_order_code = #{outOrderCode},</if>
<if test="customerId != null">customer_id = #{customerId},</if>
<if test="customerName != null">customer_name = #{customerName},</if>
<if test="materialNo != null">material_no = #{materialNo},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="materialType != null">material_type = #{materialType},</if>
<if test="materialPhotourl != null">material_photoUrl = #{materialPhotourl},</if>
<if test="materialBrand != null">material_brand = #{materialBrand},</if>
<if test="materialUnit != null">material_unit = #{materialUnit},</if>
<if test="materialDescribe != null">material_describe = #{materialDescribe},</if>
<if test="materialProcessMethod != null">material_process_method = #{materialProcessMethod},</if>
<if test="materialModel != null">material_model = #{materialModel},</if>
<if test="materialSpecification != null">material_specification = #{materialSpecification},</if>
<if test="makeNum != null">make_num = #{makeNum},</if>
<if test="thisShippingNum != null">this_shipping_num = #{thisShippingNum},</if>
<if test="hasOutOrderNum != null">has_out_order_num = #{hasOutOrderNum},</if>
<if test="thisCheckNum != null">this_check_num = #{thisCheckNum},</if>
<if test="hasCheckNum != null">has_check_num = #{hasCheckNum},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where shipping_inform_detail_id = #{shippingInformDetailId}
</update>
<delete id="deleteSysSalesShippingInformDetailById" parameterType="Long">
delete from sys_sales_shipping_inform_detail where shipping_inform_detail_id = #{shippingInformDetailId}
</delete>
<delete id="deleteSysSalesShippingInformDetailByIds" parameterType="String">
delete from sys_sales_shipping_inform_detail where shipping_inform_detail_id in
<foreach item="shippingInformDetailId" collection="array" open="(" separator="," close=")">
#{shippingInformDetailId}
</foreach>
</delete>
<update id="cancelSysSalesShippingInformDetailById" parameterType="Long">
update sys_sales_shipping_inform_detail set del_flag = '1' where shipping_inform_detail_id = #{shippingInformDetailId}
</update>
<update id="restoreSysSalesShippingInformDetailById" parameterType="Long">
update sys_sales_shipping_inform_detail set del_flag = '0' where shipping_inform_detail_id = #{shippingInformDetailId}
</update>
</mapper>

21
ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/salesOutWarehouse.html

@ -11,7 +11,7 @@
<div class="form-group">
<label class="col-sm-3 control-label">出库单号:</label>
<div class="col-sm-8">
<input name="outOrderCode" th:field="*{outOrderCode}" class="form-control" type="text" disabled>
<input name="outOrderCode" th:field="*{outOrderCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
@ -25,19 +25,19 @@
<div class="form-group">
<label class="col-sm-3 control-label">销售订单号:</label>
<div class="col-sm-8">
<input name="salesOrderCode" th:field="*{salesOrderCode}" class="form-control" type="text" disabled>
<input name="salesOrderCode" th:field="*{salesOrderCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">申请人员:</label>
<div class="col-sm-8">
<input name="applyName" th:field="*{applyName}" class="form-control" type="text" disabled>
<input name="applyName" th:field="*{applyName}" class="form-control" type="text" r\>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">生产单号:</label>
<div class="col-sm-8">
<input name="makeNo" th:field="*{makeNo}" class="form-control" type="text" disabled>
<input name="makeNo" th:field="*{makeNo}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
@ -52,31 +52,31 @@
<div class="form-group">
<label class="col-sm-3 control-label">客户ID:</label>
<div class="col-sm-8">
<input name="customerId" th:field="*{customerId}" class="form-control" type="text" disabled>
<input name="customerId" th:field="*{customerId}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">客户名称:</label>
<div class="col-sm-8">
<input name="customerName" th:field="*{customerName}" class="form-control" type="text" disabled>
<input name="customerName" th:field="*{customerName}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收货联系人:</label>
<div class="col-sm-8">
<input name="deliveryName" th:field="*{deliveryName}" class="form-control" type="text" disabled>
<input name="deliveryName" th:field="*{deliveryName}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收货电话:</label>
<div class="col-sm-8">
<input name="deliveryNumber" th:field="*{deliveryNumber}" class="form-control" type="text" disabled>
<input name="deliveryNumber" th:field="*{deliveryNumber}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收货地址:</label>
<div class="col-sm-8">
<input name="deliveryAddress" th:field="*{deliveryAddress}" class="form-control" type="text" disabled>
<input name="deliveryAddress" th:field="*{deliveryAddress}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
@ -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: [

Loading…
Cancel
Save