Merge remote-tracking branch 'gitea/master'

This commit is contained in:
LJW 2024-11-06 14:26:23 +08:00
commit 24ebffa072
7 changed files with 53 additions and 47 deletions

View File

@ -95,8 +95,8 @@ public class BaseKnifeController extends BaseController
map.put("mbbMrlClass", item.getKnifeType());
map.put("wmsAreaCode", item.getAreaCode());
map.put("knifeLife", "100");
map.put("knifeLifeUser", item.getKnifeLife() == null ? null : String.valueOf(100 - Integer.parseInt(item.getKnifeLife())));
map.put("knifeLifeLeave", item.getKnifeLife() == null ? null : item.getKnifeLife());
map.put("knifeLifeUser", item.getKnifeLife() == 0 ? null : String.valueOf(100 - item.getKnifeLife()));
map.put("knifeLifeLeave", item.getKnifeLife() == 0 ? null : String.valueOf(item.getKnifeLife()));
map.put("isLocked", item.getIsLocked().toString());
map.put("lockedStartTime", item.getLockedStartTime() == null ? null : item.getLockedStartTime().toString());
map.put("lockedEndTime",item.getLockedEndTime() == null ? null : item.getLockedEndTime().toString());
@ -126,9 +126,11 @@ public class BaseKnifeController extends BaseController
@PostMapping("/open/checkForAlignment")
@ResponseBody
public AjaxResult checkForAlignment(@RequestBody String json) {
// 检查请求json是否正确
List<BaseTechnologyBom> technologyBomList = JSON.parseArray(json, BaseTechnologyBom.class);
if (technologyBomList.isEmpty() || technologyBomList.size() == 1 && technologyBomList.get(0).getKnifeCode() == null)
return AjaxResult.error("未检测到工艺bom项");
// 记录请求数据
technologyBomList.forEach(baseTechnologyBom -> baseTechnologyBomService.insertBaseTechnologyBom(baseTechnologyBom));
// 构建日志
@ -164,10 +166,11 @@ public class BaseKnifeController extends BaseController
return AjaxResult.error("物料台账查询错误", techBom.getKnifeCode());
}
// 查询台账数据
baseKnifeWrapper.setMbbBdMrlId(mdItemTemp.getItemId());
baseKnifeWrapper.setIsLocked(0);
List<BaseKnife> tempList = this.baseKnifeService.selectBaseKnifeList(baseKnifeWrapper);
tempList.removeIf(baseKnife -> Integer.parseInt(baseKnife.getKnifeLife()) < Integer.parseInt(techBom.getExpendLife()));
tempList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife());
AtomicInteger knifeCount = new AtomicInteger(techBom.getKnifeCount());
// 如果台账表中不存在尝试组刀任务查询
@ -191,7 +194,7 @@ public class BaseKnifeController extends BaseController
baseKnifeWrapper.setMbbBdMrlId(bom.getMdItemId());
baseKnifeWrapper.setIsLocked(0);
List<BaseKnife> sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper);
sitmTempList.removeIf(baseKnife -> Integer.parseInt(baseKnife.getKnifeLife()) < Integer.parseInt(techBom.getExpendLife()));
sitmTempList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife());
if (sitmTempList.isEmpty()){
operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode());
@ -229,7 +232,7 @@ public class BaseKnifeController extends BaseController
} else {
// 将物料填入集合
tempList.forEach(item -> {
if (knifeCount.get() > 0 && Integer.parseInt(item.getKnifeLife()) >= Integer.parseInt(techBom.getExpendLife()) && tempList.size() > countMap.get(item.getKnifeCode())) {
if (knifeCount.get() > 0 && tempList.size() > countMap.get(item.getKnifeCode())) {
knifeCount.getAndDecrement();
countMap.put(item.getKnifeCode(), countMap.get(item.getKnifeCode()) + 1);
}
@ -245,7 +248,6 @@ public class BaseKnifeController extends BaseController
return AjaxResult.error("Bom头查询错误", techBom.getKnifeCode());
}
BomRoute bomRoute = bomRouteService.selectBomRouteByBomRouteId(bomRouteList.get(0).getBomRouteId());
if (!bomRoute.getMbbProduBomList().isEmpty()) {
@ -255,7 +257,7 @@ public class BaseKnifeController extends BaseController
baseKnifeWrapper.setMbbBdMrlId(bom.getMdItemId());
baseKnifeWrapper.setIsLocked(0);
List<BaseKnife> sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper);
sitmTempList.removeIf(baseKnife -> Integer.parseInt(baseKnife.getKnifeLife()) < Integer.parseInt(techBom.getExpendLife()));
sitmTempList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife());
if (sitmTempList.isEmpty()){
operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode());
@ -346,7 +348,7 @@ public class BaseKnifeController extends BaseController
baseKnifeWrapper.setMbbBdMrlId(mdItemTemp.getItemId());
baseKnifeWrapper.setIsLocked(0);
List<BaseKnife> tempList = this.baseKnifeService.selectBaseKnifeList(baseKnifeWrapper);
tempList.removeIf(baseKnife -> Integer.parseInt(baseKnife.getKnifeLife()) < Integer.parseInt(techBom.getExpendLife()));
tempList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife());
AtomicInteger knifeCount = new AtomicInteger(techBom.getKnifeCount());
// 如果台账表中不存在尝试组刀任务查询
@ -371,7 +373,7 @@ public class BaseKnifeController extends BaseController
baseKnifeWrapper.setMbbBdMrlId(bom.getMdItemId());
baseKnifeWrapper.setIsLocked(0);
List<BaseKnife> sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper);
sitmTempList.removeIf(baseKnife -> Integer.parseInt(baseKnife.getKnifeLife()) < Integer.parseInt(techBom.getExpendLife()));
sitmTempList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife());
if (sitmTempList.isEmpty()){
operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode());
@ -409,7 +411,7 @@ public class BaseKnifeController extends BaseController
} else {
// 将物料填入集合
tempList.forEach(item -> {
if (knifeCount.get() > 0 && Integer.parseInt(item.getKnifeLife()) >= Integer.parseInt(techBom.getExpendLife()) && tempList.size() > countMap.get(item.getKnifeCode())) {
if (knifeCount.get() > 0 && tempList.size() > countMap.get(item.getKnifeCode())) {
knifeCount.getAndDecrement();
countMap.put(item.getKnifeCode(), countMap.get(item.getKnifeCode()) + 1);
}
@ -435,7 +437,7 @@ public class BaseKnifeController extends BaseController
baseKnifeWrapper.setMbbBdMrlId(bom.getMdItemId());
baseKnifeWrapper.setIsLocked(0);
List<BaseKnife> sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper);
sitmTempList.removeIf(baseKnife -> Integer.parseInt(baseKnife.getKnifeLife()) < Integer.parseInt(techBom.getExpendLife()));
sitmTempList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife());
if (sitmTempList.isEmpty()){
operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode());
@ -487,9 +489,9 @@ public class BaseKnifeController extends BaseController
baseKnifeWrapper.setMbbBdMrlId(mdItem.getItemId());
baseKnifeWrapper.setIsLocked(0);
baseKnifeList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper);
baseKnifeList.removeIf(wmsBaseKnife -> Integer.parseInt(wmsBaseKnife.getKnifeLife()) < Integer.parseInt(techBom.getExpendLife()));
baseKnifeList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife());
for (BaseKnife wmsBaseKnife : baseKnifeList){
if (Integer.parseInt(wmsBaseKnife.getKnifeLife()) >= Integer.parseInt(techBom.getExpendLife()) && count > 0){
if (wmsBaseKnife.getKnifeLife() >= techBom.getExpendLife() && count > 0){
count--;
}
}
@ -539,6 +541,10 @@ public class BaseKnifeController extends BaseController
@PutMapping("/zdTask")
public AjaxResult zdTask(@RequestBody WmsZdTask zdTask)
{
String planSheet = "JHD001";
String batchNum = "ZZPC001";
// 判断物料是否充足
BomRoute bomRoute = bomRouteService.selectBomRouteByBomRouteId(zdTask.getAttr1());
BaseKnife baseKnifeWrapper = new BaseKnife();
@ -577,10 +583,10 @@ public class BaseKnifeController extends BaseController
baseKnife.setAreaCode(zdTask.getAttr3());
baseKnife.setSafeStock(mdItem.getMinStock().toString().split("\\.")[0]);
baseKnife.setStandardQuantity("1");
baseKnife.setKnifeLife("100");
baseKnife.setKnifeLife(100);
baseKnife.setKnifeFineState(0);
baseKnife.setIsLocked(0);
baseKnife.setPlanSheet("");
baseKnife.setPlanSheet(planSheet);
baseKnife.setItemOrProduct("PRODUCT");
baseKnife.setCreateBy(getUsername());
baseKnife.setCreateTime(DateUtils.getNowDate());
@ -602,7 +608,7 @@ public class BaseKnifeController extends BaseController
outPlanDetail.setMdItemUnit(mdItemOutPlan.getUnitName());
outPlanDetail.setPlannedQuantity(mbbProduBom.getStandardDosage() * zdTask.getProductIdQty());
outPlanDetail.setRealQuantity(mbbProduBom.getStandardDosage() * zdTask.getProductIdQty());
outPlanDetail.setDetailBatchNum("1");
outPlanDetail.setDetailBatchNum(batchNum);
WmStorageArea wmStorageArea = wmStorageAreaService.selectWmStorageAreaByAreaCode(zdTask.getAttr3());
outPlanDetail.setWmStorageAreaId(wmStorageArea.getAreaId());
outPlanDetail.setWmStorageAreaCode(wmStorageArea.getAreaCode());
@ -654,7 +660,7 @@ public class BaseKnifeController extends BaseController
wmsOutTask.setTaskNumber(outPlanDetail.getPlannedQuantity());
wmsOutTask.setOutNumber(outPlanDetail.getRealQuantity());
wmsOutTask.setWmStorageAreaId(outPlanDetail.getWmStorageAreaId());
wmsOutTask.setBatchNum("1");
wmsOutTask.setBatchNum(batchNum);
wmsOutTask.setMdItemId(outPlanDetail.getMdItemId());
wmsOutTask.setMdItemCode(outPlanDetail.getMdItemCode());
wmsOutTask.setMdItemName(outPlanDetail.getMdItemName());
@ -670,18 +676,17 @@ public class BaseKnifeController extends BaseController
WmsInPlan wmsInPlan = new WmsInPlan();
wmsInPlan.setState("1");
wmsInPlan.setSourceType("SGLR");
wmsInPlan.setWareId("10");
wmsInPlan.setCellCode(zdTask.getAttr3());
wmsInPlan.setPlanCode(zdTask.getCode() + random.nextInt(100));
wmsInPlan.setRelBillCode("组装单据");
wmsInPlan.setPlanTypeId("7");
wmsInPlan.setPlanTypeId("13");
wmsInPlan.setCreateBy(getUsername());
wmsInPlan.setCreateTime(DateUtils.getNowDate());
List<WmsInPlanDetails> wmsInPlanDetailsList = new ArrayList<>();
WmsInPlanDetails wmsInPlanDetails = new WmsInPlanDetails();
wmsInPlanDetails.setMaterialId(zdTask.getmProductId().toString());
wmsInPlanDetails.setBatch("10112");
wmsInPlanDetails.setBatch(batchNum);
wmsInPlanDetails.setCellId("1");
wmsInPlanDetails.setQuantity(zdTask.getProductIdQty().toString());
wmsInPlanDetails.setQuantityIn(zdTask.getProductIdQty().toString());
@ -699,7 +704,7 @@ public class BaseKnifeController extends BaseController
wmsInTask.setActualInQuantity(zdTask.getProductIdQty());
WmStorageArea wmStorageArea = wmStorageAreaService.selectWmStorageAreaByAreaCode(zdTask.getAttr3());
wmsInTask.setCellTgt(wmStorageArea.getAreaId());
wmsInTask.setBatch("11011");
wmsInTask.setBatch(batchNum);
wmsInTask.setMaterialId(zdTask.getmProductId().toString());
wmsInTask.setPlanTypeId("9");
wmsInTask.setPlanInStatus("1");

View File

@ -252,10 +252,10 @@ public class MdItemController extends BaseController {
mdItem.setItemTypeName(type.getItemTypeName());
mdItem.setItemOrProduct(type.getItemOrProduct());
}
if (StringUtils.isNotNull(mdItem.getSafeStockFlag()) && "N".equals(mdItem.getSafeStockFlag())) {
mdItem.setMinStock(0D);
mdItem.setMaxStock(0D);
}
// if (StringUtils.isNotNull(mdItem.getSafeStockFlag()) && "N".equals(mdItem.getSafeStockFlag())) {
// mdItem.setMinStock(0D);
// mdItem.setMaxStock(0D);
// }
MdUnitMeasure measure = mdUnitMeasureService.selectMdUnitByCode(mdItem.getUnitOfMeasure());
if (StringUtils.isNotNull(measure)) {
mdItem.setUnitName(measure.getMeasureName());

View File

@ -9,7 +9,7 @@ import java.util.HashMap;
import java.util.List;
/**
* 具台账对象 BASE_KNIFE
* 具台账对象 BASE_KNIFE
*
* @author yinjinlu
* @date 2024-10-31
@ -35,15 +35,15 @@ public class BaseKnife extends BaseEntity {
private String rfid;
/**
* 具编码
* 具编码
*/
@Excel(name = "具编码")
@Excel(name = "具编码")
private String knifeCode;
/**
* 具名称
* 具名称
*/
@Excel(name = "具名称")
@Excel(name = "具名称")
private String knifeName;
/**
@ -53,9 +53,9 @@ public class BaseKnife extends BaseEntity {
private String knifeUnit;
/**
* 具类型物料分类
* 具类型物料分类
*/
@Excel(name = "具类型", readConverterExp = "物料分类")
@Excel(name = "具类型", readConverterExp = "物料分类")
private String knifeType;
/**
@ -77,15 +77,15 @@ public class BaseKnife extends BaseEntity {
private String areaCode;
/**
* 具寿命
* 具寿命
*/
@Excel(name = "具寿命")
private String knifeLife;
@Excel(name = "具寿命")
private Integer knifeLife;
/**
* 具状态
* 具状态
*/
@Excel(name = "具状态")
@Excel(name = "具状态")
private Integer knifeFineState;
/**
@ -294,11 +294,11 @@ public class BaseKnife extends BaseEntity {
this.areaCode = areaCode;
}
public String getKnifeLife() {
public Integer getKnifeLife() {
return knifeLife;
}
public void setKnifeLife(String knifeLife) {
public void setKnifeLife(Integer knifeLife) {
this.knifeLife = knifeLife;
}

View File

@ -46,7 +46,7 @@ public class BaseTechnologyBom extends BaseEntity
/** 消耗定额 */
@Excel(name = "消耗定额")
private String expendLife;
private Integer expendLife;
/** 锁定开始时间 */
@Excel(name = "锁定开始时间")
@ -135,12 +135,12 @@ public class BaseTechnologyBom extends BaseEntity
{
return knifeCount;
}
public void setExpendLife(String expendLife)
public void setExpendLife(Integer expendLife)
{
this.expendLife = expendLife;
}
public String getExpendLife()
public Integer getExpendLife()
{
return expendLife;
}

View File

@ -38,7 +38,7 @@ public class MdItem extends BaseEntity {
private Double maxStock;
private String highValue;
private Integer attr1;
private String attr2;
private Integer attr2;
private String attr3;
private String attr4;
@ -195,11 +195,11 @@ public class MdItem extends BaseEntity {
this.attr1 = attr1;
}
public String getAttr2() {
public Integer getAttr2() {
return attr2;
}
public void setAttr2(String attr2) {
public void setAttr2(Integer attr2) {
this.attr2 = attr2;
}

View File

@ -149,7 +149,7 @@ public class WmsInTaskController extends BaseController {
baseKnife.setAreaCode(wmStorageArea.getAreaCode());
baseKnife.setSafeStock(mbbBdMrlMitm.getMinStock().toString().split("\\.")[0]);
baseKnife.setStandardQuantity("1");
baseKnife.setKnifeLife("100");
baseKnife.setKnifeLife(100);
baseKnife.setKnifeFineState(0);
baseKnife.setPlanSheet("");
baseKnife.setResetCount(mbbBdMrlMitm.getAttr1());

View File

@ -51,6 +51,7 @@
max_stock,
high_value,
attr1,
attr2,
create_by,
create_time,
remark
@ -183,7 +184,7 @@
enable_flag,
</if>
safe_stock_flag,
<if test="safeStockFlag == 'Y'.toString()">
<if test="minStock != null and minStock != ''">
min_stock,
</if>
<if test="safeStockFlag == 'Y'.toString()">