Browse Source

[fix]基础资料 工程管理

修改请购单详情物料数量的类型
生产订单列表新增根据创建时间排序,新增修改人和修改时间
修改生产订单的列表查询接口。新增根据创建时间排序
修改生产订单的创建时间来自销售订单的申请时间
修改采购计划的采购计划数的数据类型
修改 生产订单工程审核后生成采购计划后端接口:修复因bom修改用量数据类型导致的数据不匹配问题
修改生产bom的用量类型
dev
liuxiaoxu 3 months ago
parent
commit
1b87f70f10
  1. 15
      ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchasePlanChild.java
  2. 27
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchasePlanServiceImpl.java
  3. 14
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysMakeorderBom.java
  4. 2
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseRequisitioningOrderServiceImpl.java
  5. 4
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysMakeOrderServiceImpl.java
  6. 1
      ruoyi-admin/src/main/resources/mapper/system/SysMakeOrderMapper.xml
  7. 16
      ruoyi-admin/src/main/resources/templates/system/makeorder/makeorder.html

15
ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchasePlanChild.java

@ -67,7 +67,7 @@ public class PurchasePlanChild extends BaseEntity
/** 采购计划数 */ /** 采购计划数 */
@Excel(name = "采购计划数") @Excel(name = "采购计划数")
private Long materialNum; private Double materialNum;
/** 物料的对外报价 */ /** 物料的对外报价 */
private Long materialSole; private Long materialSole;
@ -214,16 +214,15 @@ public class PurchasePlanChild extends BaseEntity
this.unit = unit; this.unit = unit;
} }
public void setMaterialNum(Long materialNum) public Double getMaterialNum() {
{ return materialNum;
this.materialNum = materialNum;
} }
public Long getMaterialNum() public void setMaterialNum(Double materialNum) {
{ this.materialNum = materialNum;
return materialNum;
} }
public void setMaterialSole(Long materialSole)
public void setMaterialSole(Long materialSole)
{ {
this.materialSole = materialSole; this.materialSole = materialSole;
} }

27
ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchasePlanServiceImpl.java

@ -220,7 +220,7 @@ public class PurchasePlanServiceImpl implements IPurchasePlanService
salesOrderChildByMaterialNo.put(salesOrderMaterialNo, salesOrderChild); salesOrderChildByMaterialNo.put(salesOrderMaterialNo, salesOrderChild);
} }
Long purchasePlanMaterialSum = 0L; double purchasePlanMaterialSum = 0L;
// 第三步:计算purchasePlanNum // 第三步:计算purchasePlanNum
for (SysMakeorderBom filterSysMakeorderBom : filterSysMakeorderBoms) { for (SysMakeorderBom filterSysMakeorderBom : filterSysMakeorderBoms) {
String salesOrderMaterialNo = filterSysMakeorderBom.getSalesOrderMaterialNo(); String salesOrderMaterialNo = filterSysMakeorderBom.getSalesOrderMaterialNo();
@ -229,10 +229,10 @@ public class PurchasePlanServiceImpl implements IPurchasePlanService
//物料数量 //物料数量
long materialNum = sysSalesOrderChild.getMaterialNum(); long materialNum = sysSalesOrderChild.getMaterialNum();
//用量 //用量
long useNum = filterSysMakeorderBom.getUseNum(); Double useNum = filterSysMakeorderBom.getUseNum();
//采购计划数 //采购计划数
long purchasePlanNum = materialNum * useNum; double purchasePlanNum = materialNum * useNum;
// 立即创建PurchasePlanChild对象 // 立即创建PurchasePlanChild对象
PurchasePlanChild purchasePlanChild = new PurchasePlanChild(); PurchasePlanChild purchasePlanChild = new PurchasePlanChild();
@ -243,7 +243,7 @@ public class PurchasePlanServiceImpl implements IPurchasePlanService
if (tempPurchasePlanChild != null){ if (tempPurchasePlanChild != null){
purchasePlanChild.setPurchasePlanChildId(tempPurchasePlanChild.getPurchasePlanChildId()); purchasePlanChild.setPurchasePlanChildId(tempPurchasePlanChild.getPurchasePlanChildId());
long addMaterialNum = tempPurchasePlanChild.getMaterialNum() + purchasePlanNum; double addMaterialNum = tempPurchasePlanChild.getMaterialNum() + purchasePlanNum;
//设置计划采购数 //设置计划采购数
purchasePlanChild.setMaterialNum(addMaterialNum); purchasePlanChild.setMaterialNum(addMaterialNum);
purchasePlanChildMapper.updatePurchasePlanChild(purchasePlanChild); purchasePlanChildMapper.updatePurchasePlanChild(purchasePlanChild);
@ -324,7 +324,7 @@ public class PurchasePlanServiceImpl implements IPurchasePlanService
.collect(Collectors.toList()); .collect(Collectors.toList());
for (ErpBom subBom : filterSubBomList) { for (ErpBom subBom : filterSubBomList) {
PurchasePlanChild purchasePlanChild = createPurchasePlanChild(purchasePlanCode, subBom, loginName); PurchasePlanChild purchasePlanChild = createPurchasePlanChild(purchasePlanCode, subBom, loginName);
purchasePlanChild.setMaterialNum((long) (erpDevelopModifyorderDetail.getMaterialNum() * subBom.getUseNum())); purchasePlanChild.setMaterialNum((double) (erpDevelopModifyorderDetail.getMaterialNum() * subBom.getUseNum()));
purchasePlanChildList.add(purchasePlanChild); purchasePlanChildList.add(purchasePlanChild);
} }
} }
@ -338,10 +338,13 @@ public class PurchasePlanServiceImpl implements IPurchasePlanService
purchasePlan.setMaterialAmount(Long.valueOf(filterMergedPurchasePlanChildList.size())); purchasePlan.setMaterialAmount(Long.valueOf(filterMergedPurchasePlanChildList.size()));
// 计算所有 PurchasePlanChild 的 materialNum 总和 // 计算所有 PurchasePlanChild 的 materialNum 总和
Long totalMaterialNum = filterMergedPurchasePlanChildList.stream() // Long totalMaterialNum = filterMergedPurchasePlanChildList.stream()
.mapToLong(PurchasePlanChild::getMaterialNum) // .mapToLong(PurchasePlanChild::getMaterialNum)
.sum(); // .sum();
purchasePlan.setMaterialSum(totalMaterialNum);
double totalMaterialNum = filterMergedPurchasePlanChildList.stream().mapToDouble(purchasePlanChild -> purchasePlanChild.getMaterialNum()).sum();
purchasePlan.setMaterialSum((long) totalMaterialNum);
// 批量新增采购计划子表 // 批量新增采购计划子表
// purchasePlanChildMapper.batchInsertPurchasePlanChild(filterMergedPurchasePlanChildList); // purchasePlanChildMapper.batchInsertPurchasePlanChild(filterMergedPurchasePlanChildList);
@ -365,7 +368,7 @@ public class PurchasePlanServiceImpl implements IPurchasePlanService
purchasePlanChild.setBrand(detail.getMaterialBrand()); purchasePlanChild.setBrand(detail.getMaterialBrand());
purchasePlanChild.setUnit(detail.getMaterialUnit()); purchasePlanChild.setUnit(detail.getMaterialUnit());
purchasePlanChild.setDescribe(detail.getMaterialDescribe()); purchasePlanChild.setDescribe(detail.getMaterialDescribe());
purchasePlanChild.setMaterialNum(Long.valueOf(detail.getMaterialNum())); purchasePlanChild.setMaterialNum(Double.valueOf(detail.getMaterialNum()));
purchasePlanChild.setWarehouseDept(detail.getWarehouseDept()); purchasePlanChild.setWarehouseDept(detail.getWarehouseDept());
return purchasePlanChild; return purchasePlanChild;
} }
@ -409,7 +412,7 @@ public class PurchasePlanServiceImpl implements IPurchasePlanService
return redisCache.generateBillNo("CGJH"); return redisCache.generateBillNo("CGJH");
} }
private PurchasePlan buildPurchasePlan(SysMakeOrder sysMakeOrder, String purchasePlanCode,Integer materialAmount,Long purchasePlanMaterialSum) { private PurchasePlan buildPurchasePlan(SysMakeOrder sysMakeOrder, String purchasePlanCode,Integer materialAmount,double purchasePlanMaterialSum) {
PurchasePlan purchasePlan = new PurchasePlan(); PurchasePlan purchasePlan = new PurchasePlan();
purchasePlan.setCorrelationCode(sysMakeOrder.getMakeNo()); purchasePlan.setCorrelationCode(sysMakeOrder.getMakeNo());
purchasePlan.setPurchasePlanCode(purchasePlanCode); purchasePlan.setPurchasePlanCode(purchasePlanCode);
@ -418,7 +421,7 @@ public class PurchasePlanServiceImpl implements IPurchasePlanService
purchasePlan.setMaterialAmount((long) materialAmount); purchasePlan.setMaterialAmount((long) materialAmount);
//添加数量合计 //添加数量合计
purchasePlan.setMaterialSum(purchasePlanMaterialSum); purchasePlan.setMaterialSum((long) purchasePlanMaterialSum);
purchasePlan.setNoRmbSum(sysMakeOrder.getNoRate()); purchasePlan.setNoRmbSum(sysMakeOrder.getNoRate());
purchasePlan.setRmbSum(sysMakeOrder.getRate()); purchasePlan.setRmbSum(sysMakeOrder.getRate());
purchasePlan.setApplyUser(sysMakeOrder.getSalesman()); purchasePlan.setApplyUser(sysMakeOrder.getSalesman());

14
ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysMakeorderBom.java

@ -74,7 +74,7 @@ public class SysMakeorderBom extends BaseEntity
/** 用量 */ /** 用量 */
@Excel(name = "用量") @Excel(name = "用量")
private Long useNum; private Double useNum;
/** 损耗率 */ /** 损耗率 */
@Excel(name = "损耗率") @Excel(name = "损耗率")
@ -214,16 +214,16 @@ public class SysMakeorderBom extends BaseEntity
{ {
return describe; return describe;
} }
public void setUseNum(Long useNum)
{
this.useNum = useNum;
}
public Long getUseNum()
{ public Double getUseNum() {
return useNum; return useNum;
} }
public void setUseNum(Double useNum) {
this.useNum = useNum;
}
public String getLossRate() { public String getLossRate() {
return lossRate; return lossRate;
} }

2
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseRequisitioningOrderServiceImpl.java

@ -529,7 +529,7 @@ public class BaseRequisitioningOrderServiceImpl implements IBaseRequisitioningOr
purchasePlanChild.setMaterialName(requisitioningOrderDetail.getMaterialName()); purchasePlanChild.setMaterialName(requisitioningOrderDetail.getMaterialName());
purchasePlanChild.setDescribe(requisitioningOrderDetail.getDescribe()); purchasePlanChild.setDescribe(requisitioningOrderDetail.getDescribe());
purchasePlanChild.setBrand(requisitioningOrderDetail.getBrand()); purchasePlanChild.setBrand(requisitioningOrderDetail.getBrand());
purchasePlanChild.setMaterialNum(requisitioningOrderDetail.getMaterialNum()); purchasePlanChild.setMaterialNum(Double.valueOf(requisitioningOrderDetail.getMaterialNum()));
purchasePlanChild.setMaterialType(requisitioningOrderDetail.getMaterialType()); purchasePlanChild.setMaterialType(requisitioningOrderDetail.getMaterialType());
purchasePlanChild.setMaterialNoRmb(requisitioningOrderDetail.getMaterialNoRmb()); purchasePlanChild.setMaterialNoRmb(requisitioningOrderDetail.getMaterialNoRmb());
purchasePlanChild.setMaterialRmb(requisitioningOrderDetail.getMaterialRmb()); purchasePlanChild.setMaterialRmb(requisitioningOrderDetail.getMaterialRmb());

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

@ -126,7 +126,7 @@ public class SysMakeOrderServiceImpl implements ISysMakeOrderService
{ {
String loginName = ShiroUtils.getLoginName(); String loginName = ShiroUtils.getLoginName();
sysMakeOrder.setCreateBy(loginName); sysMakeOrder.setCreateBy(loginName);
sysMakeOrder.setCreateTime(DateUtils.getNowDate());
return sysMakeOrderMapper.insertSysMakeOrder(sysMakeOrder); return sysMakeOrderMapper.insertSysMakeOrder(sysMakeOrder);
} }
@ -246,6 +246,7 @@ public class SysMakeOrderServiceImpl implements ISysMakeOrderService
makeOrder.setMaterial(String.valueOf(sysSalesOrderVo.getMaterialSum())); makeOrder.setMaterial(String.valueOf(sysSalesOrderVo.getMaterialSum()));
String makeNo = redisCache.generateBillNo("PO"); String makeNo = redisCache.generateBillNo("PO");
makeOrder.setMakeNo(makeNo); makeOrder.setMakeNo(makeNo);
makeOrder.setCreateTime(sysSalesOrderVo.getApplyTime());
insertSysMakeOrder(makeOrder); insertSysMakeOrder(makeOrder);
// 生成部门待预审数据 // 生成部门待预审数据
List<SysSalesOrderChild> salesOrderChildList = salesOrderChildService.selectSysSalesOrderChildByQuoteId(salesOrderCode); List<SysSalesOrderChild> salesOrderChildList = salesOrderChildService.selectSysSalesOrderChildByQuoteId(salesOrderCode);
@ -291,6 +292,7 @@ public class SysMakeOrderServiceImpl implements ISysMakeOrderService
orderBom.setSalesOrderCode(saleNo); orderBom.setSalesOrderCode(saleNo);
orderBom.setSalesOrderMaterialNo(materialCode); orderBom.setSalesOrderMaterialNo(materialCode);
orderBom.setLossRate(subBom.getLossRate()); orderBom.setLossRate(subBom.getLossRate());
orderBom.setUseNum(subBom.getUseNum());
//如果sys_makeorder_bom数据表里面没有入库部门.这里给他加入 //如果sys_makeorder_bom数据表里面没有入库部门.这里给他加入
//orderBom.setWarehouseDept(subBom.getWarehouseDept()); //orderBom.setWarehouseDept(subBom.getWarehouseDept());
sortNo++; sortNo++;

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

@ -68,6 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="customerOderCode != null and customerOderCode != ''"> and a.customerOderCode = #{customerOderCode}</if> <if test="customerOderCode != null and customerOderCode != ''"> and a.customerOderCode = #{customerOderCode}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and a.create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if> <if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and a.create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
</where> </where>
order by a.create_time desc
</select> </select>
<select id="selectSysMakeOrderById" parameterType="Long" resultMap="SysMakeOrderResult"> <select id="selectSysMakeOrderById" parameterType="Long" resultMap="SysMakeOrderResult">

16
ruoyi-admin/src/main/resources/templates/system/makeorder/makeorder.html

@ -122,6 +122,7 @@
modalName: "生产订单", modalName: "生产订单",
fixedColumns: true, // 启用冻结列 fixedColumns: true, // 启用冻结列
fixedRightNumber: 1, // 冻结右列个数 fixedRightNumber: 1, // 冻结右列个数
sortable: true, // 是否启用排序
columns: [{ columns: [{
checkbox: true checkbox: true
}, },
@ -222,6 +223,21 @@
title: '部门主管确认状态', title: '部门主管确认状态',
visible: false visible: false
}, },
{
title: '录入时间',
field: 'createTime',
sortable: true,
},
{
title: '更新人',
field: 'updateBy',
},
{
title: '上次更新时间',
field: 'updateTime',
},
{ {
title: '操作', title: '操作',
align: 'center', align: 'center',

Loading…
Cancel
Save