修复刀柄也进行计算寿命bug

This commit is contained in:
Stang 2024-11-07 15:53:34 +08:00
parent 5eb96ee45b
commit 1fb81c6bed

View File

@ -166,7 +166,6 @@ public class BaseKnifeController extends BaseController
return AjaxResult.error("物料台账查询错误", techBom.getKnifeCode());
}
// 查询台账数据
baseKnifeWrapper.setMbbBdMrlId(mdItemTemp.getItemId());
baseKnifeWrapper.setIsLocked(0);
List<BaseKnife> tempList = this.baseKnifeService.selectBaseKnifeList(baseKnifeWrapper);
@ -184,7 +183,7 @@ public class BaseKnifeController extends BaseController
operLogService.insertOperlog(operLog);
return AjaxResult.error("Bom头查询错误", techBom.getKnifeCode());
}
BomRoute bomRoute = bomRouteService.selectBomRouteByBomRouteId(bomRouteList.get(0).getBomRouteId());
if (!bomRoute.getMbbProduBomList().isEmpty()) {
@ -194,7 +193,6 @@ public class BaseKnifeController extends BaseController
baseKnifeWrapper.setMbbBdMrlId(bom.getMdItemId());
baseKnifeWrapper.setIsLocked(0);
List<BaseKnife> sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper);
sitmTempList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife());
if (sitmTempList.isEmpty()){
operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode());
@ -233,6 +231,7 @@ public class BaseKnifeController extends BaseController
// 将物料填入集合
tempList.forEach(item -> {
if (knifeCount.get() > 0 && tempList.size() > countMap.get(item.getKnifeCode())) {
// 更新数量
knifeCount.getAndDecrement();
countMap.put(item.getKnifeCode(), countMap.get(item.getKnifeCode()) + 1);
}
@ -241,6 +240,7 @@ public class BaseKnifeController extends BaseController
if ("PRODUCT".equals(mdItemTemp.getItemOrProduct())){
// 查询整刀bom项 如果不存在说明 为基础物料或者没有记录此整刀的组装
bomRouteTemp.setMdItemId(mdItemTemp.getItemId());
List<BomRoute> bomRouteList = bomRouteService.selectBomRouteList(bomRouteTemp);
if (bomRouteList.isEmpty()){
operLog.setJsonResult("Bom头查询错误" + techBom.getKnifeCode());
@ -257,7 +257,6 @@ public class BaseKnifeController extends BaseController
baseKnifeWrapper.setMbbBdMrlId(bom.getMdItemId());
baseKnifeWrapper.setIsLocked(0);
List<BaseKnife> sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper);
sitmTempList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife());
if (sitmTempList.isEmpty()){
operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode());
@ -378,7 +377,6 @@ public class BaseKnifeController extends BaseController
baseKnifeWrapper.setMbbBdMrlId(bom.getMdItemId());
baseKnifeWrapper.setIsLocked(0);
List<BaseKnife> sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper);
sitmTempList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife());
if (sitmTempList.isEmpty()){
baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife));
@ -456,7 +454,6 @@ public class BaseKnifeController extends BaseController
baseKnifeWrapper.setMbbBdMrlId(bom.getMdItemId());
baseKnifeWrapper.setIsLocked(0);
List<BaseKnife> sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper);
sitmTempList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife());
if (sitmTempList.isEmpty()){
baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife));