修复数量统计bug,手动组装整刀不锁定

This commit is contained in:
Stang 2024-11-07 15:32:02 +08:00
parent ce7a6197ae
commit 5eb96ee45b
2 changed files with 15 additions and 7 deletions

View File

@ -588,12 +588,12 @@ public class BaseKnifeController extends BaseController
// 查询工艺bom // 查询工艺bom
BaseTechnologyBom technologyBom = new BaseTechnologyBom(); BaseTechnologyBom technologyBom = new BaseTechnologyBom();
Boolean lockedFlag = false;
if (zdTask.getAttr4() != null){ if (zdTask.getAttr4() != null){
lockedFlag = true;
technologyBom = baseTechnologyBomService.selectBaseTechnologyBomByTechnologyBomId(zdTask.getAttr4()); technologyBom = baseTechnologyBomService.selectBaseTechnologyBomByTechnologyBomId(zdTask.getAttr4());
} else { } else {
technologyBom.setFigureCode(zdTask.getCode()); technologyBom.setFigureCode(zdTask.getCode());
technologyBom.setLockedStartTime(DateUtils.getNowDate());
technologyBom.setLockedEndTime(DateUtils.getNowDate());
} }
// 出库基础物料 // 出库基础物料
@ -622,9 +622,13 @@ public class BaseKnifeController extends BaseController
baseKnife.setStandardQuantity("1"); baseKnife.setStandardQuantity("1");
baseKnife.setKnifeLife(100); baseKnife.setKnifeLife(100);
baseKnife.setKnifeFineState(0); baseKnife.setKnifeFineState(0);
baseKnife.setIsLocked(1); if (lockedFlag) {
baseKnife.setLockedStartTime(technologyBom.getLockedStartTime()); baseKnife.setIsLocked(1);
baseKnife.setLockedEndTime(technologyBom.getLockedEndTime()); baseKnife.setLockedStartTime(technologyBom.getLockedStartTime());
baseKnife.setLockedEndTime(technologyBom.getLockedEndTime());
} else {
baseKnife.setIsLocked(0);
}
baseKnife.setPlanSheet(zdTask.getAttr4()); baseKnife.setPlanSheet(zdTask.getAttr4());
baseKnife.setItemOrProduct("PRODUCT"); baseKnife.setItemOrProduct("PRODUCT");
baseKnife.setCreateBy(getUsername()); baseKnife.setCreateBy(getUsername());
@ -716,10 +720,14 @@ public class BaseKnifeController extends BaseController
wmsOutTask.setCreateBy(getUsername()); wmsOutTask.setCreateBy(getUsername());
wmsOutTask.setCreateTime(DateUtils.getNowDate()); wmsOutTask.setCreateTime(DateUtils.getNowDate());
wmsOutTaskMapper.insertWmsOutTask(wmsOutTask); wmsOutTaskMapper.insertWmsOutTask(wmsOutTask);
// 更新基础物料数量
MdItem mdItem = mdItemService.selectMdItemById(outPlanDetail.getMdItemId());
mdItem.setStandardNumber(mdItem.getStandardNumber() - outPlanDetail.getRealQuantity());
mdItemService.updateMdItem(mdItem);
} }
// 整刀入库计划 // 整刀入库计划
Random random = new Random();
WmsInPlan wmsInPlan = new WmsInPlan(); WmsInPlan wmsInPlan = new WmsInPlan();
wmsInPlan.setState("1"); wmsInPlan.setState("1");
wmsInPlan.setSourceType("SGLR"); wmsInPlan.setSourceType("SGLR");

View File

@ -560,6 +560,6 @@
<select id="countBaseKnife" resultType="java.lang.Long"> <select id="countBaseKnife" resultType="java.lang.Long">
SELECT COUNT(*) SELECT COUNT(*)
FROM BASE_KNIFE BK FROM BASE_KNIFE BK
WHERE MBB_BD_MRL_ID = #{mbbBdMrlId} WHERE MBB_BD_MRL_ID = #{mbbBdMrlId} AND KNIFE_FINE_STATE = 0 OR KNIFE_FINE_STATE = 1
</select> </select>
</mapper> </mapper>