Browse Source

[fix]

工程管理 bom信息
修改erpBom实体类,修改用量字段为double类型;
修改erpBomImportVo实体类,修改用量字段为double类型;
修改BOM信息一阶对比controller,用量改为double类型;
修改service接口,用量有关改为double类型;
修改采购计划service,用量计算添加相应转换;
dev
王晓迪 3 months ago
parent
commit
ce2b6679e2
  1. 8
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpBomController.java
  2. 6
      ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpBom.java
  3. 6
      ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpBomImportVo.java
  4. 3
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpBomServiceImpl.java
  5. 2
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchasePlanServiceImpl.java

8
ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpBomController.java

@ -434,15 +434,15 @@ public class ErpBomController extends BaseController
List bom1list = new ArrayList<>(); List bom1list = new ArrayList<>();
List bom2list = new ArrayList<>(); List bom2list = new ArrayList<>();
for (ErpBom erpBom3:list){ for (ErpBom erpBom3:list){
Long useNum1 = erpBom3.getUseNum(); Double useNum1 = erpBom3.getUseNum();
if (useNum1==null){ if (useNum1==null){
useNum1 = 0L; useNum1 = 0.00;
} }
String bom1 = erpBom3.getMaterialNo()+"-"+erpBom3.getMaterialName()+"-"+ useNum1; String bom1 = erpBom3.getMaterialNo()+"-"+erpBom3.getMaterialName()+"-"+ useNum1;
for (ErpBom erpBom4:list1){ for (ErpBom erpBom4:list1){
Long useNum2 = erpBom4.getUseNum(); Double useNum2 = erpBom4.getUseNum();
if (useNum2==null){ if (useNum2==null){
useNum2 = 0L; useNum2 = 0.00;
} }
String bom2 = erpBom4.getMaterialNo()+"-"+erpBom4.getMaterialName()+"-"+ useNum2; String bom2 = erpBom4.getMaterialNo()+"-"+erpBom4.getMaterialName()+"-"+ useNum2;
if (bom1.equals(bom2)){ if (bom1.equals(bom2)){

6
ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpBom.java

@ -64,7 +64,7 @@ public class ErpBom extends BaseEntity
/** 用量 */ /** 用量 */
// @Excel(name = "用量",sort = 8) // @Excel(name = "用量",sort = 8)
private Long useNum; private Double useNum;
/** 损耗率 */ /** 损耗率 */
private String lossRate; private String lossRate;
@ -259,7 +259,7 @@ public class ErpBom extends BaseEntity
{ {
return describe; return describe;
} }
public void setUseNum(Long useNum) public void setUseNum(Double useNum)
{ {
this.useNum = useNum; this.useNum = useNum;
} }
@ -272,7 +272,7 @@ public class ErpBom extends BaseEntity
this.engineer = engineer; this.engineer = engineer;
} }
public Long getUseNum() public Double getUseNum()
{ {
return useNum; return useNum;
} }

6
ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpBomImportVo.java

@ -18,7 +18,7 @@ public class ErpBomImportVo implements Serializable {
/** 用量 */ /** 用量 */
@Excel(name = "用量",sort = 2) @Excel(name = "用量",sort = 2)
private Long useNum; private Double useNum;
/** 损耗率 */ /** 损耗率 */
@Excel(name = "损耗率",sort = 3) @Excel(name = "损耗率",sort = 3)
@ -36,11 +36,11 @@ public class ErpBomImportVo implements Serializable {
this.materialNo = materialNo; this.materialNo = materialNo;
} }
public Long getUseNum() { public Double getUseNum() {
return useNum; return useNum;
} }
public void setUseNum(Long useNum) { public void setUseNum(Double useNum) {
this.useNum = useNum; this.useNum = useNum;
} }

3
ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpBomServiceImpl.java

@ -32,6 +32,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.*; import java.util.*;
/** /**
@ -531,7 +532,7 @@ private ISysAttachService attachService;
{ {
ErpBomImportVo bomImportVo = bomImportVos.get(i); ErpBomImportVo bomImportVo = bomImportVos.get(i);
String materialNo = bomImportVo.getMaterialNo(); String materialNo = bomImportVo.getMaterialNo();
Long useNum = bomImportVo.getUseNum(); Double useNum = bomImportVo.getUseNum();
Double lossRate = bomImportVo.getLossRate(); Double lossRate = bomImportVo.getLossRate();
String remark = bomImportVo.getRemark(); String remark = bomImportVo.getRemark();
ErpMaterialVo erpMaterialVo = materialMapper.selectErpMaterialByMaterialNo(materialNo); ErpMaterialVo erpMaterialVo = materialMapper.selectErpMaterialByMaterialNo(materialNo);

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

@ -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(erpDevelopModifyorderDetail.getMaterialNum() * subBom.getUseNum()); purchasePlanChild.setMaterialNum((long) (erpDevelopModifyorderDetail.getMaterialNum() * subBom.getUseNum()));
purchasePlanChildList.add(purchasePlanChild); purchasePlanChildList.add(purchasePlanChild);
} }
} }

Loading…
Cancel
Save