Browse Source

[feat] 销售管理 仓库管理 售后管理 生产管理

新增 根据销售单号查询生产订单后端接口
新增 根据 出库单号和物料号更新销售出货通知详情后端接口
修复 通过销售发起出货生成销售出货通知单列表后端接口中缺少的字段
新增 修改保存销售单-出库后端接口方法中新增加 同时更新销售出库详情数据
修复 准备物料中部分数据传递不到后端问题
dev
liuxiaoxu 4 months ago
parent
commit
da75a3a98a
  1. 1
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesWarehouseOutServiceImpl.java
  2. 5
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysMakeOrderMapper.java
  3. 11
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesShippingInformDetailMapper.java
  4. 9
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java
  5. 36
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderServiceImpl.java
  6. 7
      ruoyi-admin/src/main/resources/mapper/system/SysMakeOrderMapper.xml
  7. 34
      ruoyi-admin/src/main/resources/mapper/system/SysSalesShippingInformDetailMapper.xml
  8. 18
      ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/prepareMaterial.html

1
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.SysSalesOrder;
import com.ruoyi.system.domain.SysSalesOrderChild; import com.ruoyi.system.domain.SysSalesOrderChild;
import com.ruoyi.system.domain.SysSalesShippingInform; import com.ruoyi.system.domain.SysSalesShippingInform;
import com.ruoyi.system.domain.SysSalesShippingInformDetail;
import com.ruoyi.system.mapper.SysSalesOrderChildMapper; import com.ruoyi.system.mapper.SysSalesOrderChildMapper;
import com.ruoyi.system.mapper.SysSalesOrderMapper; import com.ruoyi.system.mapper.SysSalesOrderMapper;
import com.ruoyi.system.mapper.SysSalesShippingInformMapper; import com.ruoyi.system.mapper.SysSalesShippingInformMapper;

5
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysMakeOrderMapper.java

@ -119,4 +119,9 @@ public interface SysMakeOrderMapper
* 根据入库单号查询生产单号 * 根据入库单号查询生产单号
* */ * */
String selectMakeByWarehouseStorageCode(String warehouseStorageCode); String selectMakeByWarehouseStorageCode(String warehouseStorageCode);
/*
* 根据销售单号查询生产订单
* */
SysMakeOrder selectMakeOrderBySaleNo(String salesOrderCode);
} }

11
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesShippingInformDetailMapper.java

@ -43,6 +43,17 @@ public interface SysSalesShippingInformDetailMapper
*/ */
public int updateSysSalesShippingInformDetail(SysSalesShippingInformDetail sysSalesShippingInformDetail); public int updateSysSalesShippingInformDetail(SysSalesShippingInformDetail sysSalesShippingInformDetail);
/**
* 修改销售出货通知详情
*
* @param sysSalesShippingInformDetail 销售出货通知详情
* @return 结果
*/
public int updateSysSalesShippingInformDetailByCodeAndNo(SysSalesShippingInformDetail sysSalesShippingInformDetail);
/** /**
* 删除销售出货通知详情 * 删除销售出货通知详情
* *

9
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.setMaterialSum(Math.toIntExact(sysSalesOrderVo.getMaterialSum()));
//更新数量合计 //更新数量合计
sysSalesShippingInform.setEnterpriseSum(Math.toIntExact(sysSalesOrderVo.getEnterpriseSum())); sysSalesShippingInform.setEnterpriseSum(Math.toIntExact(sysSalesOrderVo.getEnterpriseSum()));
sysSalesShippingInform.setCustomerContact(sysSalesOrderVo.getCustomerDelivery());
sysSalesShippingInform.setContactNumber(sysSalesOrderVo.getDeliveryPhone());
sysSalesShippingInform.setCustomerContactAddress(sysSalesOrderVo.getDeliveryAddress());
//更新销售出库详情数据 //更新销售出库详情数据
List<SysSalesOrderChild> sysSalesOrderChildList = sysSalesOrder.getSysSalesOrderChildList(); List<SysSalesOrderChild> sysSalesOrderChildList = sysSalesOrder.getSysSalesOrderChildList();
@ -204,6 +209,7 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
sysSalesShippingInformDetail.setMaterialProcessMethod(sysSalesOrderChild.getProcessMethod()); sysSalesShippingInformDetail.setMaterialProcessMethod(sysSalesOrderChild.getProcessMethod());
sysSalesShippingInformDetail.setMakeNum(sysSalesOrderChild.getMaterialNum()); sysSalesShippingInformDetail.setMakeNum(sysSalesOrderChild.getMaterialNum());
sysSalesShippingInformDetail.setHasOutOrderNum(sysSalesOrderChild.getOutBoundQuantity()); sysSalesShippingInformDetail.setHasOutOrderNum(sysSalesOrderChild.getOutBoundQuantity());
sysSalesShippingInformDetail.setThisShippingNum(sysSalesOrderChild.getApplyShippingNum());
sysSalesShippingInformDetail.setCreateBy(loginName); sysSalesShippingInformDetail.setCreateBy(loginName);
sysSalesShippingInformDetail.setCreateTime(new Date()); sysSalesShippingInformDetail.setCreateTime(new Date());
shippingInformDetailMapper.insertSysSalesShippingInformDetail(sysSalesShippingInformDetail); shippingInformDetailMapper.insertSysSalesShippingInformDetail(sysSalesShippingInformDetail);
@ -236,10 +242,11 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
warehouseOutOrder.setUpdateTime(new Date()); warehouseOutOrder.setUpdateTime(new Date());
//更新销售订单的出货状态 //更新销售订单的出货状态
// SysSalesShippingInform tempShippingInform = sysSalesShippingInformMapper.selectSysSalesShippingInformByCode(outOrderCode);
SysSalesOrder sysSalesOrder = new SysSalesOrder(); SysSalesOrder sysSalesOrder = new SysSalesOrder();
sysSalesOrder.setUpdateBy(loginName); sysSalesOrder.setUpdateBy(loginName);
sysSalesOrder.setUpdateTime(new Date()); sysSalesOrder.setUpdateTime(new Date());
sysSalesOrder.setSalesOrderCode(sysSalesShippingInform.getSalesOrderCode()); sysSalesOrder.setSalesOrderCode(warehouseOutOrder.getSalesOrderCode());
//暂收设置为全部出货 //暂收设置为全部出货
sysSalesOrder.setDeliveryStatus("6"); sysSalesOrder.setDeliveryStatus("6");
int updateSysSalesOrderResult = sysSalesOrderMapper.updateSysSalesOrderBySalesOrderCode(sysSalesOrder); int updateSysSalesOrderResult = sysSalesOrderMapper.updateSysSalesOrderBySalesOrderCode(sysSalesOrder);

36
ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderServiceImpl.java

@ -62,6 +62,9 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService
private SysSalesShippingInformMapper shippingInformMapper; private SysSalesShippingInformMapper shippingInformMapper;
@Autowired
private SysSalesShippingInformDetailMapper shippingInformDetailMapper;
/** /**
* 查询仓库出库单 * 查询仓库出库单
* *
@ -232,8 +235,20 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService
sysSalesOrderChild.setQuoteId(warehouseOutOrder.getSalesOrderCode()); sysSalesOrderChild.setQuoteId(warehouseOutOrder.getSalesOrderCode());
sysSalesOrderChild.setMaterialCode(warehouseOutOrderDetail.getMaterialNo()); sysSalesOrderChild.setMaterialCode(warehouseOutOrderDetail.getMaterialNo());
sysSalesOrderChild.setOutBoundQuantity(warehouseOutOrderDetail.getActualOutOrderSum()); sysSalesOrderChild.setOutBoundQuantity(warehouseOutOrderDetail.getActualOutOrderSum());
sysSalesOrderChild.setUpdateBy(loginName);
sysSalesOrderChild.setUpdateTime(new Date());
int updateSalesOrderChildResult = salesOrderChildMapper.updateSysSalesOrderChildByCodeAndQuoteId(sysSalesOrderChild); int updateSalesOrderChildResult = salesOrderChildMapper.updateSysSalesOrderChildByCodeAndQuoteId(sysSalesOrderChild);
if (updateSalesOrderChildResult <= 0){ 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("更新销售出库详情数据失败"); throw new BusinessException("更新销售出库详情数据失败");
} }
warehouseOutOrderDetail.setUpdateBy(loginName); warehouseOutOrderDetail.setUpdateBy(loginName);
@ -579,6 +594,18 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService
WarehouseOutOrder warehouseOutOrder = new WarehouseOutOrder(); WarehouseOutOrder warehouseOutOrder = new WarehouseOutOrder();
warehouseOutOrder.setOutOrderCode(outOrderCode); 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.setWarehouseOutStatus("0");
warehouseOutOrder.setRelatedOrderCode(salesOrderCode); warehouseOutOrder.setRelatedOrderCode(salesOrderCode);
@ -587,10 +614,17 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService
warehouseOutOrder.setWarehouseOrderType("0"); warehouseOutOrder.setWarehouseOrderType("0");
//出库类型设置为 销售出库 //出库类型设置为 销售出库
warehouseOutOrder.setWarehouseOutType("0"); warehouseOutOrder.setWarehouseOutType("0");
//物料合计
warehouseOutOrder.setMaterialSum(Math.toIntExact(sysSalesOrderVo.getMaterialSum()));
//数量合计
warehouseOutOrder.setEnterpriseSum(Math.toIntExact(sysSalesOrderVo.getEnterpriseSum()));
warehouseOutOrder.setBusinessName(sysSalesOrderVo.getBusinessMembers()); warehouseOutOrder.setBusinessName(sysSalesOrderVo.getBusinessMembers());
warehouseOutOrder.setCustomerId(sysSalesOrderVo.getEnterpriseCode()); warehouseOutOrder.setCustomerId(sysSalesOrderVo.getEnterpriseCode());
warehouseOutOrder.setCustomerName(sysSalesOrderVo.getEnterpriseName()); warehouseOutOrder.setCustomerName(sysSalesOrderVo.getEnterpriseName());
warehouseOutOrder.setApplyName(sysSalesOrderVo.getApplyUserName()); warehouseOutOrder.setApplyName(sysSalesOrderVo.getApplyUser());
warehouseOutOrder.setDeliveryCondition(sysSalesOrderVo.getDeliveryConditions()); warehouseOutOrder.setDeliveryCondition(sysSalesOrderVo.getDeliveryConditions());
warehouseOutOrder.setCreateTime(new Date()); warehouseOutOrder.setCreateTime(new Date());
warehouseOutOrder.setCreateBy(ShiroUtils.getLoginName()); warehouseOutOrder.setCreateBy(ShiroUtils.getLoginName());

7
ruoyi-admin/src/main/resources/mapper/system/SysMakeOrderMapper.xml

@ -270,6 +270,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="selectMakeOrderBySaleNo" parameterType="String" resultMap="SysMakeOrderResult">
<include refid="selectSysMakeOrderVo"/>
where a.saleNo = #{saleNo}
</select>
<select id="selectMakeByWarehouseStorageCode" parameterType="String" resultType="String"> <select id="selectMakeByWarehouseStorageCode" parameterType="String" resultType="String">
SELECT DISTINCT sm.makeNo SELECT DISTINCT sm.makeNo
FROM sys_makeorder sm FROM sys_makeorder sm

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

@ -136,6 +136,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where shipping_inform_detail_id = #{shippingInformDetailId} where shipping_inform_detail_id = #{shippingInformDetailId}
</update> </update>
<update id="updateSysSalesShippingInformDetailByCodeAndNo" 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 out_order_code = #{outOrderCode}
and material_no = #{materialNo}
</update>
<delete id="deleteSysSalesShippingInformDetailById" parameterType="Long"> <delete id="deleteSysSalesShippingInformDetailById" parameterType="Long">
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 = #{shippingInformDetailId}
</delete> </delete>

18
ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/prepareMaterial.html

@ -11,7 +11,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">出库单号:</label> <label class="col-sm-3 control-label">出库单号:</label>
<div class="col-sm-8"> <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> </div>
<div class="form-group"> <div class="form-group">
@ -25,49 +25,49 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">销售订单号:</label> <label class="col-sm-3 control-label">销售订单号:</label>
<div class="col-sm-8"> <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> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">申请人员:</label> <label class="col-sm-3 control-label">申请人员:</label>
<div class="col-sm-8"> <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" readonly>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">生产单号:</label> <label class="col-sm-3 control-label">生产单号:</label>
<div class="col-sm-8"> <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> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">客户ID:</label> <label class="col-sm-3 control-label">客户ID:</label>
<div class="col-sm-8"> <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> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">客户名称:</label> <label class="col-sm-3 control-label">客户名称:</label>
<div class="col-sm-8"> <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> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">收货联系人:</label> <label class="col-sm-3 control-label">收货联系人:</label>
<div class="col-sm-8"> <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> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">收货电话:</label> <label class="col-sm-3 control-label">收货电话:</label>
<div class="col-sm-8"> <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> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">收货地址:</label> <label class="col-sm-3 control-label">收货地址:</label>
<div class="col-sm-8"> <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> </div>
<div class="form-group"> <div class="form-group">

Loading…
Cancel
Save