This commit is contained in:
Stang 2024-11-05 17:17:07 +08:00
parent 70f4f0bb27
commit 17e64f7c75
5 changed files with 29 additions and 25 deletions

View File

@ -541,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();
@ -582,7 +586,7 @@ public class BaseKnifeController extends BaseController
baseKnife.setKnifeLife(100);
baseKnife.setKnifeFineState(0);
baseKnife.setIsLocked(0);
baseKnife.setPlanSheet("");
baseKnife.setPlanSheet(planSheet);
baseKnife.setItemOrProduct("PRODUCT");
baseKnife.setCreateBy(getUsername());
baseKnife.setCreateTime(DateUtils.getNowDate());
@ -604,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());
@ -656,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());
@ -672,7 +676,6 @@ 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("组装单据");
@ -683,7 +686,7 @@ public class BaseKnifeController extends BaseController
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());
@ -701,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 = "具寿命")
@Excel(name = "具寿命")
private Integer knifeLife;
/**
* 具状态
* 具状态
*/
@Excel(name = "具状态")
@Excel(name = "具状态")
private Integer knifeFineState;
/**

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

@ -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()">