Browse Source

[feat]

修改售后验收前端页面:修复后端料号没有值的问题
修改销售出货前端页面:加上已验收数字段;修改申请出货数字段,如果已验收数等于物料数或者,已申请出货数等于物料数,设置改物料申请出货数为”已出货“
修改销售订单前端页面:销售发起出货前验证该订单是否已结案
修改售后验收后端接口:修改没有设备id和有设备id的方法,重写验收的同时处理销售订单子表的已验收数,按照交付时间的先后,来决定分配已验收数的先后,然后通过分解销售订单号,反查销售订单,并检查每个 SysSalesOrderChild 中的 item.getMaterialNum() 和 item.getHasCheckNum() 是否相等。如果一个销售订单号对应的所有 SysSalesOrderChild 中的这两个值都相等,则将该销售订单的出库状态设置为“全部验收”,否则设置为“部分验收”。
修改销售出货通知的 通过销售发起出货生成销售出货通知单列表后端方法,加上sysSalesOrderChildList参数,后续方法中的数据都来自已经被处理过的 sysSalesOrderChildList中的数据
修改出库单的 通过销售发起出货生成仓库出库单方法 加上sysSalesOrderChildList参数,后续方法中的数据都来自已经被处理过的 sysSalesOrderChildList中的数据
修改 selectSalesOrderChildByCodeAndNo方法,查询的参数加上缺少的一些数据
修改 销售订单子表 的销售出货物料列表展示方法:加上对已验收数的处理
dev
liuxiaoxu 2 weeks ago
parent
commit
9e1228cfb1
  1. 70
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesOutOrderServiceImpl.java
  2. 3
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesShippingInformService.java
  3. 4
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderChildServiceImpl.java
  4. 15
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java
  5. 3
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java
  6. 3
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseOutOrderService.java
  7. 7
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderServiceImpl.java
  8. 3
      ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderChildMapper.xml
  9. 2
      ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOutOrder/aftersalesConfirmCheck.html
  10. 12
      ruoyi-admin/src/main/resources/templates/system/salesOrder/salesDeliverGoods.html
  11. 12
      ruoyi-admin/src/main/resources/templates/system/salesOrder/salesOrder.html

70
ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesOutOrderServiceImpl.java

@ -779,6 +779,7 @@ public class AftersalesOutOrderServiceImpl implements IAftersalesOutOrderService
if (Objects.equals(tempShippingInformDetail.getThisShippingNum(), sysSalesShippingInformDetail.getHasCheckNum())){
allWithoutCheckFlag = 1;
}
// 当前时间
Date now = new Date();
@ -804,21 +805,45 @@ public class AftersalesOutOrderServiceImpl implements IAftersalesOutOrderService
orderChildren.add(tempSalesOrderChild);
}
}
//按照计划交付时间与当前时间的差值排序
orderChildren.sort(Comparator.comparing(o->Math.abs(o.getDeliveryTime().getTime() - now.getTime())));
//更新 HasCheckNum 数据
// 按照计划交付时间与当前时间的差值排序
orderChildren.sort(Comparator.comparing(o -> Math.abs(o.getDeliveryTime().getTime() - now.getTime())));
// 更新 HasCheckNum 数据
boolean shouldContinue = true;
for (SysSalesOrderChild orderChild : orderChildren) {
if (!shouldContinue) {
break;
}
orderChild.setUpdateTime(new Date());
orderChild.setUpdateBy(loginName);
orderChild.setHasCheckNum(sysSalesShippingInformDetail.getHasCheckNum());
// 检查数据库中是否有已有的 hasCheckNum,如果有则进行合计
Integer existingHasCheckNum = orderChild.getHasCheckNum();
Integer currentHasCheckNum = sysSalesShippingInformDetail.getHasCheckNum();
if (existingHasCheckNum != null) {
orderChild.setHasCheckNum(existingHasCheckNum + currentHasCheckNum);
} else {
orderChild.setHasCheckNum(currentHasCheckNum);
}
int updateSalesOrderChildResult = salesOrderChildMapper.updateSysSalesOrderChildByCodeAndQuoteId(orderChild);
if (updateSalesOrderChildResult <= 0) {
throw new BusinessException("更新销售订单子表数据失败");
throw new RuntimeException("更新销售订单子表数据失败");
}
// 检查是否需要继续更新下一个
if (orderChild.getHasCheckNum().equals(orderChild.getMaterialNum())) {
shouldContinue = true;
} else {
shouldContinue = false;
}
}
int updateShippingInformDetailResult = shippingInformDetailMapper.updateSysSalesShippingInformDetail(sysSalesShippingInformDetail);
if (updateShippingInformDetailResult <= 0) {
throw new BusinessException("更新销售出货通知单详情数据失败");
@ -918,17 +943,38 @@ public class AftersalesOutOrderServiceImpl implements IAftersalesOutOrderService
orderChildren.add(tempSalesOrderChild);
}
}
//按照计划交付时间与当前时间的差值排序
orderChildren.sort(Comparator.comparing(o->Math.abs(o.getDeliveryTime().getTime() - now.getTime())));
//更新 HasCheckNum 数据
// 按照计划交付时间与当前时间的差值排序
orderChildren.sort(Comparator.comparing(o -> Math.abs(o.getDeliveryTime().getTime() - now.getTime())));
// 更新 HasCheckNum 数据
boolean shouldContinue = true;
for (SysSalesOrderChild orderChild : orderChildren) {
orderChild.setUpdateTime(new Date());
orderChild.setUpdateBy(loginName);
orderChild.setHasCheckNum(sysSalesShippingInformDetail.getHasCheckNum());
if (!shouldContinue) {
break;
}
// 检查数据库中是否有已有的 hasCheckNum,如果有则进行合计
Integer existingHasCheckNum = orderChild.getHasCheckNum();
Integer currentHasCheckNum = tempShippingInformDetail.getHasCheckNum();
if (existingHasCheckNum != null) {
orderChild.setHasCheckNum(existingHasCheckNum + currentHasCheckNum);
} else {
orderChild.setHasCheckNum(currentHasCheckNum);
}
int updateSalesOrderChildResult = salesOrderChildMapper.updateSysSalesOrderChildByCodeAndQuoteId(orderChild);
if (updateSalesOrderChildResult <= 0) {
throw new BusinessException("更新销售订单子表数据失败");
throw new RuntimeException("更新销售订单子表数据失败");
}
// 检查是否需要继续更新下一个
if (orderChild.getHasCheckNum().equals(orderChild.getMaterialNum())) {
shouldContinue = true;
} else {
shouldContinue = false;
}
}

3
ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesShippingInformService.java

@ -3,6 +3,7 @@ package com.ruoyi.system.service;
import java.util.List;
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.domain.Vo.ConfirmReceivingDetailVo;
@ -82,7 +83,7 @@ public interface ISysSalesShippingInformService
/**
* 通过销售发起出货生成销售出货通知单列表
* */
int generateShippingInformBySalesOrder(SysSalesOrder sysSalesOrder, String outOrderCode,List<Long> salesOrderIdList);
int generateShippingInformBySalesOrder(List<SysSalesOrderChild> sysSalesOrderChildList, SysSalesOrder sysSalesOrder, String outOrderCode, List<Long> salesOrderIdList);
/**

4
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderChildServiceImpl.java

@ -119,6 +119,10 @@ public class SysSalesOrderChildServiceImpl implements ISysSalesOrderChildService
(existingItem.getOutBoundQuantity() != null ? existingItem.getOutBoundQuantity() : 0) +
(newItem.getOutBoundQuantity() != null ? newItem.getOutBoundQuantity() : 0)
);
existingItem.setHasCheckNum(
(existingItem.getHasCheckNum() != null ? existingItem.getHasCheckNum() : 0) +
(newItem.getHasCheckNum() != null ? newItem.getHasCheckNum() : 0)
);
return existingItem;
}
));

15
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java

@ -533,8 +533,11 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService
List<SysSalesOrderChild> sysSalesOrderChildList = sysSalesOrder.getSysSalesOrderChildList();
//过滤掉申请出货数为null的数据,也就是本次不发起出货
sysSalesOrderChildList = sysSalesOrderChildList.stream().filter(sysSalesOrderChild -> (sysSalesOrderChild.getApplyShippingNum() != null)).collect(Collectors.toList());
//过滤掉申请出货数为0的数据,也就是本次不发起出货
sysSalesOrderChildList = sysSalesOrderChildList.stream().filter(sysSalesOrderChild -> sysSalesOrderChild.getApplyShippingNum() != 0 ).collect(Collectors.toList());
sysSalesOrderChildList = sysSalesOrderChildList.stream().filter(sysSalesOrderChild -> (sysSalesOrderChild.getApplyShippingNum() != 0)).collect(Collectors.toList());
List<Long> salesOrderIdList = sysSalesOrder.getSalesOrderIdList();
@ -572,9 +575,13 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService
if (hasApplyShippingNum == null) {
hasApplyShippingNum = 0; // 确保 hasApplyShippingNum 不为 null
}
if (hasApplyShippingNum+oldChild.getApplyShippingNum() > oldChild.getMaterialNum()){
throw new BusinessException("申请出货数与已申请出货数之和不能大于订单数量");
}
// 计算新的已申请出货数
hasApplyShippingNum += applyShippingNum;
oldChild.setHasApplyShippingNum(hasApplyShippingNum);
oldChild.setUpdateTime(new Date());
oldChild.setUpdateBy(loginName);
@ -596,10 +603,10 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService
//两个表生成同一个出库单号
String outOrderCode = redisCache.generateBillNo("CK");
//通过销售发起出货生成仓库出库单
int insertWarehouseOutOrderResult = warehouseOutOrderService.generateWarehouseOutOrderBySalesOrder(sysSalesOrder,outOrderCode,salesOrderIdList);
int insertWarehouseOutOrderResult = warehouseOutOrderService.generateWarehouseOutOrderBySalesOrder(sysSalesOrderChildList,sysSalesOrder,outOrderCode,salesOrderIdList);
//通过销售发起出货生成销售出货通知单列表
int insertShippingInformResult = sysSalesShippingInformService.generateShippingInformBySalesOrder(sysSalesOrder,outOrderCode,salesOrderIdList);
int insertShippingInformResult = sysSalesShippingInformService.generateShippingInformBySalesOrder(sysSalesOrderChildList,sysSalesOrder,outOrderCode,salesOrderIdList);
return sysSalesOrderMapper.updateSysSalesOrderBySalesOrderCode(sysSalesOrder);
}

3
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java

@ -203,7 +203,7 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
* 通过销售发起出货生成销售出货通知单列表
* */
@Override
public int generateShippingInformBySalesOrder(SysSalesOrder sysSalesOrder,String outOrderCode,List<Long> salesOrderIdList) {
public int generateShippingInformBySalesOrder(List<SysSalesOrderChild> sysSalesOrderChildList,SysSalesOrder sysSalesOrder,String outOrderCode,List<Long> salesOrderIdList) {
String loginName = ShiroUtils.getLoginName();
@ -271,7 +271,6 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
//更新销售出货通知详情数据
List<SysSalesOrderChild> sysSalesOrderChildList = sysSalesOrder.getSysSalesOrderChildList();
for (SysSalesOrderChild sysSalesOrderChild : sysSalesOrderChildList) {
SysSalesShippingInformDetail sysSalesShippingInformDetail = new SysSalesShippingInformDetail();
sysSalesShippingInformDetail.setOutOrderCode(outOrderCode);

3
ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseOutOrderService.java

@ -6,6 +6,7 @@ import com.ruoyi.aftersales.domain.vo.SelectShippingDeviceVO;
import com.ruoyi.erp.domain.vo.ErpDevelopModifyorderPickingVo;
import com.ruoyi.system.domain.SysMakeorderPickVo;
import com.ruoyi.system.domain.SysSalesOrder;
import com.ruoyi.system.domain.SysSalesOrderChild;
import com.ruoyi.system.domain.Vo.BaseEmpRequisiteOrderVO;
import com.ruoyi.warehouse.domain.WarehouseOutOrder;
import org.springframework.transaction.annotation.Transactional;
@ -109,7 +110,7 @@ public interface IWarehouseOutOrderService
/**
* 通过销售发起出货生成仓库出库单
* */
int generateWarehouseOutOrderBySalesOrder(SysSalesOrder sysSalesOrder, String outOrderCode, List<Long> salesOrderIdList);
int generateWarehouseOutOrderBySalesOrder(List<SysSalesOrderChild> sysSalesOrderChildList, SysSalesOrder sysSalesOrder, String outOrderCode, List<Long> salesOrderIdList);
/**
* 开发修改单领料审核通过后生产出库单

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

@ -978,7 +978,7 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService
* 通过销售发起出货生成仓库出库单
* */
@Override
public int generateWarehouseOutOrderBySalesOrder(SysSalesOrder sysSalesOrder,String outOrderCode,List<Long> salesOrderIdList) {
public int generateWarehouseOutOrderBySalesOrder(List<SysSalesOrderChild> sysSalesOrderChildList,SysSalesOrder sysSalesOrder,String outOrderCode,List<Long> salesOrderIdList) {
// String salesOrderCode = sysSalesOrder.getSalesOrderCode();
// if (StringUtils.isEmpty(salesOrderCode)){
@ -1034,7 +1034,7 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService
warehouseOutOrder.setCreateTime(new Date());
warehouseOutOrder.setCreateBy(ShiroUtils.getLoginName());
//新增出库单明细
CreateOutOrderDetailBySalesOrderChildList(sysSalesOrder,outOrderCode);
CreateOutOrderDetailBySalesOrderChildList(sysSalesOrder, sysSalesOrderChildList,outOrderCode);
return warehouseOutOrderMapper.insertWarehouseOutOrder(warehouseOutOrder);
}
@ -1055,8 +1055,7 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService
//新增出库单明细
private void CreateOutOrderDetailBySalesOrderChildList(SysSalesOrder sysSalesOrder,String outOrderCode) {
List<SysSalesOrderChild> sysSalesOrderChildList = sysSalesOrder.getSysSalesOrderChildList();
private void CreateOutOrderDetailBySalesOrderChildList( SysSalesOrder sysSalesOrder,List<SysSalesOrderChild> sysSalesOrderChildList,String outOrderCode) {
for (SysSalesOrderChild sysSalesOrderChild : sysSalesOrderChildList) {
WarehouseOutOrderDetail warehouseOutOrderDetail = new WarehouseOutOrderDetail();
warehouseOutOrderDetail.setOutOrderCode(outOrderCode);

3
ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderChildMapper.xml

@ -104,7 +104,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectSalesOrderChildByCodeAndNo" resultMap="SysSalesOrderChildResult">
select id, quoteId, materialId, materialCode, materialName, materialType, processMethod, material_model, brand,
warehouseDept,materialNum, has_check_num, apply_shipping_num, out_bound_quantity
warehouseDept,materialNum, has_check_num, apply_shipping_num, out_bound_quantity, delivery_time,countTax,
materialRmb, materialNoRmb, materialNoUsd, materialUsd
from sys_sales_order_child
where quoteId = #{quoteId}
and materialCode = #{materialCode}

2
ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOutOrder/aftersalesConfirmCheck.html

@ -138,7 +138,7 @@
// 根据实际字段名调整
return {
"shippingInformDetailId": item.shippingInformDetailId,
"materialCode": item.materialCode,
"materialNo": item.materialNo,
"materialName": item.materialName,
"materialType": item.materialType,
"materialProcessMethod": item.materialProcessMethod,

12
ruoyi-admin/src/main/resources/templates/system/salesOrder/salesDeliverGoods.html

@ -363,6 +363,10 @@
title: '订单数量',
field: 'materialNum',
},
{
title: '已验收数',
field: 'hasCheckNum',
},
{
title: '已完成数',
field: 'finishNum',
@ -381,6 +385,14 @@
title: '申请出货数',
field: 'applyShippingNum',
editable: {
//动态禁用行内编辑
noEditFormatter: function(value, row, index){
if (row.hasCheckNum === row.materialNum || row.hasApplyShippingNum === row.materialNum){
return "已出货";
}else {
return false;
}
},
validate: function(value) {
if ($.trim(value) === '') {
return '申请出货数不能为空';

12
ruoyi-admin/src/main/resources/templates/system/salesOrder/salesOrder.html

@ -600,7 +600,7 @@
// const ALL_SHIPPING = "6"; //全部出货
// const PART_CHECK = "7"; //部分验收
// const ALL_CHECK = "8";//全部验收
// const HAS_CLOSE= "3";//已结案
const HAS_CLOSE= "3";//已结案
var enterpriseCode; //客户id
@ -641,11 +641,11 @@
// return;
// }
// //检查结案状态
// if (row.closeStatus === HAS_CLOSE) {
// showWarning("存在已结案的订单");
// valid = false;
// return;
// }
if (row.closeStatus === HAS_CLOSE) {
showWarning("存在已结案的订单");
valid = false;
return;
}
// 如果所有条件都满足,将销售订单ID添加到有效列表中
validSalesOrderIds.push(row.salesOrderId);
});

Loading…
Cancel
Save