feat(台账): 新增入库计划明细
This commit is contained in:
parent
20e58eb0a7
commit
7fbd042688
@ -33,14 +33,13 @@ import static com.ktg.generator.util.MultiModuleCodeGenerator.generateTaskCode;
|
||||
|
||||
/**
|
||||
* 工具台账Controller
|
||||
*
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2024-10-31
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/md/baseKnife")
|
||||
public class BaseKnifeController extends BaseController
|
||||
{
|
||||
public class BaseKnifeController extends BaseController {
|
||||
@Autowired
|
||||
private IBaseKnifeService baseKnifeService;
|
||||
|
||||
@ -101,9 +100,9 @@ public class BaseKnifeController extends BaseController
|
||||
map.put("knifeLifeLeave", item.getKnifeLife() == 0 ? null : String.valueOf(item.getKnifeLife()));
|
||||
map.put("isLocked", item.getIsLocked());
|
||||
map.put("lockedStartTime", item.getLockedStartTime() == null ? null : item.getLockedStartTime());
|
||||
map.put("lockedEndTime",item.getLockedEndTime() == null ? null : item.getLockedEndTime());
|
||||
map.put("planSheet",item.getPlanSheet() == null ? null : item.getPlanSheet());
|
||||
map.put("outInfoList", item.getOutInfoList() );
|
||||
map.put("lockedEndTime", item.getLockedEndTime() == null ? null : item.getLockedEndTime());
|
||||
map.put("planSheet", item.getPlanSheet() == null ? null : item.getPlanSheet());
|
||||
map.put("outInfoList", item.getOutInfoList());
|
||||
result.add(map);
|
||||
});
|
||||
|
||||
@ -155,13 +154,13 @@ public class BaseKnifeController extends BaseController
|
||||
MdItem mdItemTemp = new MdItem();
|
||||
|
||||
// 遍历工艺bom, 所需要的所有材料
|
||||
for (BaseTechnologyBom techBom : technologyBomList){
|
||||
for (BaseTechnologyBom techBom : technologyBomList) {
|
||||
// 空则0
|
||||
countMap.putIfAbsent(techBom.getKnifeCode(), 0);
|
||||
|
||||
// 台账表中查询工具 :并记录数量
|
||||
mdItemTemp = mdItemService.selectMdItemByCode(techBom.getKnifeCode());
|
||||
if (mdItemTemp == null){
|
||||
if (mdItemTemp == null) {
|
||||
operLog.setJsonResult("物料台账查询错误:" + techBom.getKnifeCode());
|
||||
operLogService.insertOperlog(operLog);
|
||||
return AjaxResult.error("物料台账查询错误", techBom.getKnifeCode());
|
||||
@ -170,16 +169,16 @@ public class BaseKnifeController extends BaseController
|
||||
baseKnifeWrapper.setMbbBdMrlId(mdItemTemp.getItemId());
|
||||
baseKnifeWrapper.setIsLocked(0);
|
||||
List<BaseKnife> tempList = this.baseKnifeService.selectBaseKnifeList(baseKnifeWrapper);
|
||||
tempList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife());
|
||||
tempList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife());
|
||||
AtomicInteger knifeCount = new AtomicInteger(techBom.getKnifeCount());
|
||||
|
||||
// 如果台账表中不存在,尝试组刀任务查询
|
||||
if (tempList.isEmpty()){
|
||||
if ("PRODUCT".equals(mdItemTemp.getItemOrProduct())){
|
||||
if (tempList.isEmpty()) {
|
||||
if ("PRODUCT".equals(mdItemTemp.getItemOrProduct())) {
|
||||
// 查询整刀bom项, 如果不存在说明 为基础物料,或者没有记录此整刀的组装
|
||||
bomRouteTemp.setMdItemId(mdItemTemp.getItemId());
|
||||
List<BomRoute> bomRouteList = bomRouteService.selectBomRouteList(bomRouteTemp);
|
||||
if (bomRouteList.isEmpty()){
|
||||
if (bomRouteList.isEmpty()) {
|
||||
operLog.setJsonResult("Bom头查询错误:" + techBom.getKnifeCode());
|
||||
operLogService.insertOperlog(operLog);
|
||||
return AjaxResult.error("Bom头查询错误", techBom.getKnifeCode());
|
||||
@ -189,18 +188,18 @@ public class BaseKnifeController extends BaseController
|
||||
|
||||
if (!bomRoute.getMbbProduBomList().isEmpty()) {
|
||||
// 遍历bom项, 从台账表中筛选对应基础物料
|
||||
for (MbbProduBom bom : bomRoute.getMbbProduBomList()){
|
||||
for (MbbProduBom bom : bomRoute.getMbbProduBomList()) {
|
||||
// 查询基础物料。不包含已锁定的
|
||||
baseKnifeWrapper.setMbbBdMrlId(bom.getMdItemId());
|
||||
baseKnifeWrapper.setIsLocked(0);
|
||||
List<BaseKnife> sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper);
|
||||
|
||||
if (sitmTempList.isEmpty()){
|
||||
if (sitmTempList.isEmpty()) {
|
||||
operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode());
|
||||
operLogService.insertOperlog(operLog);
|
||||
return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode());
|
||||
} else if (countMap.get(sitmTempList.get(0).getKnifeCode()) == null){
|
||||
if (sitmTempList.size() >= bom.getStandardDosage() * knifeCount.get()){
|
||||
} else if (countMap.get(sitmTempList.get(0).getKnifeCode()) == null) {
|
||||
if (sitmTempList.size() >= bom.getStandardDosage() * knifeCount.get()) {
|
||||
countMap.put(sitmTempList.get(0).getKnifeCode(), bom.getStandardDosage() * knifeCount.get());
|
||||
} else {
|
||||
operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode());
|
||||
@ -212,7 +211,7 @@ public class BaseKnifeController extends BaseController
|
||||
}
|
||||
|
||||
// 判断基础物料是否充足
|
||||
if (sitmTempList.size() < countMap.get(sitmTempList.get(0).getKnifeCode()) && countMap.get(sitmTempList.get(0).getKnifeCode()) > bom.getStandardDosage() * knifeCount.get()){
|
||||
if (sitmTempList.size() < countMap.get(sitmTempList.get(0).getKnifeCode()) && countMap.get(sitmTempList.get(0).getKnifeCode()) > bom.getStandardDosage() * knifeCount.get()) {
|
||||
operLog.setJsonResult("基础物料不足进行组装工具:" + techBom.getKnifeCode());
|
||||
operLogService.insertOperlog(operLog);
|
||||
return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode());
|
||||
@ -237,13 +236,13 @@ public class BaseKnifeController extends BaseController
|
||||
countMap.put(item.getKnifeCode(), countMap.get(item.getKnifeCode()) + 1);
|
||||
}
|
||||
});
|
||||
if (knifeCount.get() > 0) {
|
||||
if ("PRODUCT".equals(mdItemTemp.getItemOrProduct())){
|
||||
if (knifeCount.get() > 0) {
|
||||
if ("PRODUCT".equals(mdItemTemp.getItemOrProduct())) {
|
||||
// 查询整刀bom项, 如果不存在说明 为基础物料,或者没有记录此整刀的组装
|
||||
bomRouteTemp.setMdItemId(mdItemTemp.getItemId());
|
||||
|
||||
List<BomRoute> bomRouteList = bomRouteService.selectBomRouteList(bomRouteTemp);
|
||||
if (bomRouteList.isEmpty()){
|
||||
if (bomRouteList.isEmpty()) {
|
||||
operLog.setJsonResult("Bom头查询错误:" + techBom.getKnifeCode());
|
||||
operLogService.insertOperlog(operLog);
|
||||
return AjaxResult.error("Bom头查询错误", techBom.getKnifeCode());
|
||||
@ -253,18 +252,18 @@ public class BaseKnifeController extends BaseController
|
||||
|
||||
if (!bomRoute.getMbbProduBomList().isEmpty()) {
|
||||
// 遍历bom项, 从台账表中筛选对应基础物料
|
||||
for (MbbProduBom bom : bomRoute.getMbbProduBomList()){
|
||||
for (MbbProduBom bom : bomRoute.getMbbProduBomList()) {
|
||||
// 查询基础物料。不包含已锁定的
|
||||
baseKnifeWrapper.setMbbBdMrlId(bom.getMdItemId());
|
||||
baseKnifeWrapper.setIsLocked(0);
|
||||
List<BaseKnife> sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper);
|
||||
|
||||
if (sitmTempList.isEmpty()){
|
||||
if (sitmTempList.isEmpty()) {
|
||||
operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode());
|
||||
operLogService.insertOperlog(operLog);
|
||||
return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode());
|
||||
} else if (countMap.get(sitmTempList.get(0).getKnifeCode()) == null){
|
||||
if (sitmTempList.size() >= bom.getStandardDosage() * knifeCount.get()){
|
||||
} else if (countMap.get(sitmTempList.get(0).getKnifeCode()) == null) {
|
||||
if (sitmTempList.size() >= bom.getStandardDosage() * knifeCount.get()) {
|
||||
countMap.put(sitmTempList.get(0).getKnifeCode(), bom.getStandardDosage() * knifeCount.get());
|
||||
} else {
|
||||
operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode());
|
||||
@ -276,7 +275,7 @@ public class BaseKnifeController extends BaseController
|
||||
}
|
||||
|
||||
// 判断基础物料是否充足
|
||||
if (sitmTempList.size() < countMap.get(sitmTempList.get(0).getKnifeCode()) && countMap.get(sitmTempList.get(0).getKnifeCode()) > bom.getStandardDosage() * knifeCount.get()){
|
||||
if (sitmTempList.size() < countMap.get(sitmTempList.get(0).getKnifeCode()) && countMap.get(sitmTempList.get(0).getKnifeCode()) > bom.getStandardDosage() * knifeCount.get()) {
|
||||
operLog.setJsonResult("基础物料不足进行组装工具:" + techBom.getKnifeCode());
|
||||
operLogService.insertOperlog(operLog);
|
||||
return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode());
|
||||
@ -348,13 +347,13 @@ public class BaseKnifeController extends BaseController
|
||||
MdItem mdItemTemp = new MdItem();
|
||||
|
||||
// 遍历工艺bom, 所需要的所有材料
|
||||
for (BaseTechnologyBom techBom : technologyBomList){
|
||||
for (BaseTechnologyBom techBom : technologyBomList) {
|
||||
// 空则0
|
||||
countMap.putIfAbsent(techBom.getKnifeCode(), 0);
|
||||
|
||||
// 台账表中查询工具 :并记录数量
|
||||
mdItemTemp = mdItemService.selectMdItemByCode(techBom.getKnifeCode());
|
||||
if (mdItemTemp == null){
|
||||
if (mdItemTemp == null) {
|
||||
baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife));
|
||||
operLog.setJsonResult("物料台账查询错误:" + techBom.getKnifeCode());
|
||||
operLogService.insertOperlog(operLog);
|
||||
@ -365,16 +364,16 @@ public class BaseKnifeController extends BaseController
|
||||
baseKnifeWrapper.setMbbBdMrlId(mdItemTemp.getItemId());
|
||||
baseKnifeWrapper.setIsLocked(0);
|
||||
List<BaseKnife> tempList = this.baseKnifeService.selectBaseKnifeList(baseKnifeWrapper);
|
||||
tempList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife());
|
||||
tempList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife());
|
||||
AtomicInteger knifeCount = new AtomicInteger(techBom.getKnifeCount());
|
||||
|
||||
// 如果台账表中不存在,尝试组刀任务查询
|
||||
if (tempList.isEmpty()){
|
||||
if ("PRODUCT".equals(mdItemTemp.getItemOrProduct())){
|
||||
if (tempList.isEmpty()) {
|
||||
if ("PRODUCT".equals(mdItemTemp.getItemOrProduct())) {
|
||||
// 查询整刀bom项, 如果不存在说明 为基础物料,或者没有记录此整刀的组装
|
||||
bomRouteTemp.setMdItemId(mdItemTemp.getItemId());
|
||||
List<BomRoute> bomRouteList = bomRouteService.selectBomRouteList(bomRouteTemp);
|
||||
if (bomRouteList.isEmpty()){
|
||||
if (bomRouteList.isEmpty()) {
|
||||
baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife));
|
||||
operLog.setJsonResult("Bom头查询错误:" + techBom.getKnifeCode());
|
||||
operLogService.insertOperlog(operLog);
|
||||
@ -385,19 +384,19 @@ public class BaseKnifeController extends BaseController
|
||||
|
||||
if (!bomRoute.getMbbProduBomList().isEmpty()) {
|
||||
// 遍历bom项, 从台账表中筛选对应基础物料
|
||||
for (MbbProduBom bom : bomRoute.getMbbProduBomList()){
|
||||
for (MbbProduBom bom : bomRoute.getMbbProduBomList()) {
|
||||
// 查询基础物料。不包含已锁定的
|
||||
baseKnifeWrapper.setMbbBdMrlId(bom.getMdItemId());
|
||||
baseKnifeWrapper.setIsLocked(0);
|
||||
List<BaseKnife> sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper);
|
||||
|
||||
if (sitmTempList.isEmpty()){
|
||||
if (sitmTempList.isEmpty()) {
|
||||
baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife));
|
||||
operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode());
|
||||
operLogService.insertOperlog(operLog);
|
||||
return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode());
|
||||
} else if (countMap.get(sitmTempList.get(0).getKnifeCode()) == null){
|
||||
if (sitmTempList.size() >= bom.getStandardDosage() * knifeCount.get()){
|
||||
} else if (countMap.get(sitmTempList.get(0).getKnifeCode()) == null) {
|
||||
if (sitmTempList.size() >= bom.getStandardDosage() * knifeCount.get()) {
|
||||
countMap.put(sitmTempList.get(0).getKnifeCode(), bom.getStandardDosage() * knifeCount.get());
|
||||
} else {
|
||||
baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife));
|
||||
@ -410,7 +409,7 @@ public class BaseKnifeController extends BaseController
|
||||
}
|
||||
|
||||
// 判断基础物料是否充足
|
||||
if (sitmTempList.size() < countMap.get(sitmTempList.get(0).getKnifeCode()) && countMap.get(sitmTempList.get(0).getKnifeCode()) > bom.getStandardDosage() * knifeCount.get()){
|
||||
if (sitmTempList.size() < countMap.get(sitmTempList.get(0).getKnifeCode()) && countMap.get(sitmTempList.get(0).getKnifeCode()) > bom.getStandardDosage() * knifeCount.get()) {
|
||||
baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife));
|
||||
operLog.setJsonResult("基础物料不足进行组装工具:" + techBom.getKnifeCode());
|
||||
operLogService.insertOperlog(operLog);
|
||||
@ -445,13 +444,13 @@ public class BaseKnifeController extends BaseController
|
||||
baseKnifeService.updateBaseKnife(item);
|
||||
}
|
||||
});
|
||||
if (knifeCount.get() > 0) {
|
||||
if ("PRODUCT".equals(mdItemTemp.getItemOrProduct())){
|
||||
if (knifeCount.get() > 0) {
|
||||
if ("PRODUCT".equals(mdItemTemp.getItemOrProduct())) {
|
||||
// 查询整刀bom项, 如果不存在说明 为基础物料,或者没有记录此整刀的组装
|
||||
bomRouteTemp.setMdItemId(mdItemTemp.getItemId());
|
||||
|
||||
|
||||
List<BomRoute> bomRouteList = bomRouteService.selectBomRouteList(bomRouteTemp);
|
||||
if (bomRouteList.isEmpty()){
|
||||
if (bomRouteList.isEmpty()) {
|
||||
baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife));
|
||||
operLog.setJsonResult("Bom头查询错误:" + techBom.getKnifeCode());
|
||||
operLogService.insertOperlog(operLog);
|
||||
@ -462,19 +461,19 @@ public class BaseKnifeController extends BaseController
|
||||
|
||||
if (!bomRoute.getMbbProduBomList().isEmpty()) {
|
||||
// 遍历bom项, 从台账表中筛选对应基础物料
|
||||
for (MbbProduBom bom : bomRoute.getMbbProduBomList()){
|
||||
for (MbbProduBom bom : bomRoute.getMbbProduBomList()) {
|
||||
// 查询基础物料。不包含已锁定的
|
||||
baseKnifeWrapper.setMbbBdMrlId(bom.getMdItemId());
|
||||
baseKnifeWrapper.setIsLocked(0);
|
||||
List<BaseKnife> sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper);
|
||||
|
||||
if (sitmTempList.isEmpty()){
|
||||
if (sitmTempList.isEmpty()) {
|
||||
baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife));
|
||||
operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode());
|
||||
operLogService.insertOperlog(operLog);
|
||||
return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode());
|
||||
} else if (countMap.get(sitmTempList.get(0).getKnifeCode()) == null){
|
||||
if (sitmTempList.size() >= bom.getStandardDosage() * knifeCount.get()){
|
||||
} else if (countMap.get(sitmTempList.get(0).getKnifeCode()) == null) {
|
||||
if (sitmTempList.size() >= bom.getStandardDosage() * knifeCount.get()) {
|
||||
countMap.put(sitmTempList.get(0).getKnifeCode(), bom.getStandardDosage() * knifeCount.get());
|
||||
} else {
|
||||
baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife));
|
||||
@ -487,7 +486,7 @@ public class BaseKnifeController extends BaseController
|
||||
}
|
||||
|
||||
// 判断基础物料是否充足
|
||||
if (sitmTempList.size() < countMap.get(sitmTempList.get(0).getKnifeCode()) && countMap.get(sitmTempList.get(0).getKnifeCode()) > bom.getStandardDosage() * knifeCount.get()){
|
||||
if (sitmTempList.size() < countMap.get(sitmTempList.get(0).getKnifeCode()) && countMap.get(sitmTempList.get(0).getKnifeCode()) > bom.getStandardDosage() * knifeCount.get()) {
|
||||
baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife));
|
||||
operLog.setJsonResult("基础物料不足进行组装工具:" + techBom.getKnifeCode());
|
||||
operLogService.insertOperlog(operLog);
|
||||
@ -515,7 +514,7 @@ public class BaseKnifeController extends BaseController
|
||||
List<BaseKnife> baseKnifeList;
|
||||
int count;
|
||||
List<MbbProduBom> bomList;
|
||||
for (BaseTechnologyBom techBom : technologyBomList){
|
||||
for (BaseTechnologyBom techBom : technologyBomList) {
|
||||
mdItem = mdItemService.selectMdItemByCode(techBom.getKnifeCode());
|
||||
count = techBom.getKnifeCount() - countMap.get(techBom.getKnifeCode());
|
||||
|
||||
@ -523,21 +522,21 @@ public class BaseKnifeController extends BaseController
|
||||
baseKnifeWrapper.setMbbBdMrlId(mdItem.getItemId());
|
||||
baseKnifeWrapper.setIsLocked(0);
|
||||
baseKnifeList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper);
|
||||
baseKnifeList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife());
|
||||
for (BaseKnife wmsBaseKnife : baseKnifeList){
|
||||
if (wmsBaseKnife.getKnifeLife() >= techBom.getExpendLife() && count > 0){
|
||||
baseKnifeList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife());
|
||||
for (BaseKnife wmsBaseKnife : baseKnifeList) {
|
||||
if (wmsBaseKnife.getKnifeLife() >= techBom.getExpendLife() && count > 0) {
|
||||
count--;
|
||||
}
|
||||
}
|
||||
|
||||
// 整刀不足进行组装
|
||||
if (count > 0){
|
||||
if ("PRODUCT".equals(mdItem.getItemOrProduct())){
|
||||
if (count > 0) {
|
||||
if ("PRODUCT".equals(mdItem.getItemOrProduct())) {
|
||||
// 查询整刀bom项, 如果不存在说明 为基础物料,或者没有记录此整刀的组装
|
||||
bomRouteTemp.setMdItemId(mdItem.getItemId());
|
||||
|
||||
|
||||
List<BomRoute> bomRouteList = bomRouteService.selectBomRouteList(bomRouteTemp);
|
||||
if (bomRouteList.isEmpty()){
|
||||
if (bomRouteList.isEmpty()) {
|
||||
baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife));
|
||||
operLog.setJsonResult("Bom头查询错误:" + techBom.getKnifeCode());
|
||||
operLogService.insertOperlog(operLog);
|
||||
@ -577,8 +576,7 @@ public class BaseKnifeController extends BaseController
|
||||
@PreAuthorize("@ss.hasPermi('md:baseKnife:edit')")
|
||||
@Log(title = "工具台账", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/zdTask")
|
||||
public AjaxResult zdTask(@RequestBody WmsZdTask zdTask)
|
||||
{
|
||||
public AjaxResult zdTask(@RequestBody WmsZdTask zdTask) {
|
||||
String batchNum = "ZZPC001";
|
||||
|
||||
// 判断物料是否充足
|
||||
@ -605,13 +603,13 @@ public class BaseKnifeController extends BaseController
|
||||
BaseTechnologyBom technologyBom = new BaseTechnologyBom();
|
||||
Boolean lockedFlag = false;
|
||||
// attr4 组装任务所属计划单, 如果为空则是手动组装任务不需要锁定
|
||||
if (zdTask.getAttr4() != null){
|
||||
if (zdTask.getAttr4() != null) {
|
||||
lockedFlag = true;
|
||||
}
|
||||
|
||||
// 出库基础物料, 根据图号查询出库计划,如果不存在生成计划,存在则往计划中添加任务
|
||||
WmsOutPlan outPlan = wmsOutPlanMapper.selectWmsOutPlanByPlanCode(zdTask.getAttr4());
|
||||
if (outPlan == null){
|
||||
if (outPlan == null) {
|
||||
// 构建新的出库计划
|
||||
WmsOutPlan outPlanTemp = new WmsOutPlan();
|
||||
outPlanTemp.setPlanCode(zdTask.getAttr4() == null ? zdTask.getCode() : zdTask.getAttr4());
|
||||
@ -687,8 +685,8 @@ public class BaseKnifeController extends BaseController
|
||||
|
||||
// 锁定基础 物料
|
||||
int bomCount = mbbProduBom.getStandardDosage();
|
||||
for (BaseKnife wmsBaseKnife : baseKnifeList){
|
||||
if (bomCount > 0){
|
||||
for (BaseKnife wmsBaseKnife : baseKnifeList) {
|
||||
if (bomCount > 0) {
|
||||
wmsBaseKnife.setIsLocked(1);
|
||||
wmsBaseKnife.setKnifeFineState(2);
|
||||
wmsBaseKnife.setLockedStartTime(technologyBom.getLockedStartTime());
|
||||
@ -712,7 +710,7 @@ public class BaseKnifeController extends BaseController
|
||||
|
||||
// 出库
|
||||
int i = 0;
|
||||
for (WmsOutPlanDetail outPlanDetail : wmsOutPlanDetailList){
|
||||
for (WmsOutPlanDetail outPlanDetail : wmsOutPlanDetailList) {
|
||||
wmsOutPlanMapper.insertWmsOutPlanDetail(outPlanDetail);
|
||||
|
||||
// 出库计划明细,绑定实体
|
||||
@ -764,7 +762,7 @@ public class BaseKnifeController extends BaseController
|
||||
|
||||
// 整刀入库计划, 根据图号查询入库计划,如果不存在生成计划,存在则往计划中添加任务
|
||||
WmsInPlan wmsInPlan = wmsInPlanService.selectWmsInPlanByPlanCode(zdTask.getAttr4());
|
||||
if (wmsInPlan == null){
|
||||
if (wmsInPlan == null) {
|
||||
WmsInPlan wmsInPlanTemp = new WmsInPlan();
|
||||
wmsInPlanTemp.setState("1");
|
||||
wmsInPlanTemp.setSourceType("SGLR");
|
||||
@ -834,13 +832,12 @@ public class BaseKnifeController extends BaseController
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('md:baseKnife:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BaseKnife baseKnife)
|
||||
{
|
||||
public TableDataInfo list(BaseKnife baseKnife) {
|
||||
startPage();
|
||||
List<BaseKnife> list = baseKnifeService.selectBaseKnifeList(baseKnife);
|
||||
list.forEach(item -> {
|
||||
// 查询基础物料
|
||||
if ("PRODUCT".equals(item.getItemOrProduct())){
|
||||
if ("PRODUCT".equals(item.getItemOrProduct())) {
|
||||
BaseKnife baseKnifeWrapper = new BaseKnife();
|
||||
baseKnifeWrapper.setAttr1(item.getBaseKnifeId());
|
||||
item.setBaseKnifeList(baseKnifeService.selectBaseKnifeList(baseKnifeWrapper));
|
||||
@ -855,8 +852,7 @@ public class BaseKnifeController extends BaseController
|
||||
@PreAuthorize("@ss.hasPermi('md:baseKnife:export')")
|
||||
@Log(title = "工具台账", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BaseKnife baseKnife)
|
||||
{
|
||||
public void export(HttpServletResponse response, BaseKnife baseKnife) {
|
||||
List<BaseKnife> list = baseKnifeService.selectBaseKnifeList(baseKnife);
|
||||
ExcelUtil<BaseKnife> util = new ExcelUtil<BaseKnife>(BaseKnife.class);
|
||||
util.exportExcel(response, list, "工具台账数据");
|
||||
@ -867,8 +863,7 @@ public class BaseKnifeController extends BaseController
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('md:baseKnife:query')")
|
||||
@GetMapping(value = "/{baseKnifeId}")
|
||||
public AjaxResult getInfo(@PathVariable("baseKnifeId") Long baseKnifeId)
|
||||
{
|
||||
public AjaxResult getInfo(@PathVariable("baseKnifeId") Long baseKnifeId) {
|
||||
return AjaxResult.success(baseKnifeService.selectBaseKnifeByBaseKnifeId(baseKnifeId));
|
||||
}
|
||||
|
||||
@ -878,8 +873,7 @@ public class BaseKnifeController extends BaseController
|
||||
@PreAuthorize("@ss.hasPermi('md:baseKnife:add')")
|
||||
@Log(title = "工具台账", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BaseKnife baseKnife)
|
||||
{
|
||||
public AjaxResult add(@RequestBody BaseKnife baseKnife) {
|
||||
return toAjax(baseKnifeService.insertBaseKnife(baseKnife));
|
||||
}
|
||||
|
||||
@ -889,8 +883,7 @@ public class BaseKnifeController extends BaseController
|
||||
@PreAuthorize("@ss.hasPermi('md:baseKnife:edit')")
|
||||
@Log(title = "工具台账", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BaseKnife baseKnife)
|
||||
{
|
||||
public AjaxResult edit(@RequestBody BaseKnife baseKnife) {
|
||||
return toAjax(baseKnifeService.updateBaseKnife(baseKnife));
|
||||
}
|
||||
|
||||
@ -900,8 +893,7 @@ public class BaseKnifeController extends BaseController
|
||||
@PreAuthorize("@ss.hasPermi('md:baseKnife:edit')")
|
||||
@Log(title = "工具台账", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/reset/{baseKnifeId}")
|
||||
public AjaxResult reset(@PathVariable Long baseKnifeId)
|
||||
{
|
||||
public AjaxResult reset(@PathVariable Long baseKnifeId) {
|
||||
return toAjax(baseKnifeService.resetBaseKnifeByBaseKnifeId(baseKnifeId));
|
||||
}
|
||||
|
||||
@ -910,9 +902,8 @@ public class BaseKnifeController extends BaseController
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('md:baseKnife:remove')")
|
||||
@Log(title = "工具台账", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{baseKnifeIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] baseKnifeIds)
|
||||
{
|
||||
@DeleteMapping("/{baseKnifeIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] baseKnifeIds) {
|
||||
return toAjax(baseKnifeService.deleteBaseKnifeByBaseKnifeIds(baseKnifeIds));
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,9 @@ import com.ktg.common.utils.DateUtils;
|
||||
import com.ktg.mes.md.domain.*;
|
||||
import com.ktg.mes.md.mapper.*;
|
||||
import com.ktg.mes.md.service.IBaseKnifeService;
|
||||
import com.ktg.mes.wm.domain.WmsInPlanDetailEntity;
|
||||
import com.ktg.mes.wm.mapper.WmsInPlanDetailEntityMapper;
|
||||
import com.ktg.mes.wm.service.impl.WmsInPlanDetailEntityServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -38,6 +41,12 @@ public class BaseKnifeServiceImpl implements IBaseKnifeService {
|
||||
@Autowired
|
||||
private WmsBusinessTypeMapper wmsBusinessTypeMapper;
|
||||
|
||||
@Autowired
|
||||
private WmsInPlanDetailEntityMapper wmsInPlanDetailEntityMapper;
|
||||
|
||||
@Autowired
|
||||
private WmsInPlanDetailEntityServiceImpl wmsInPlanDetailEntityService;
|
||||
|
||||
/**
|
||||
* 查询工具台账
|
||||
*
|
||||
@ -104,6 +113,12 @@ public class BaseKnifeServiceImpl implements IBaseKnifeService {
|
||||
// 注入出库信息对象
|
||||
nowBaseKnife.setOutInfoList(hashMapList);
|
||||
});
|
||||
|
||||
// 构建入库信息
|
||||
WmsInPlanDetailEntity wmsInPlanDetailEntityQuery = new WmsInPlanDetailEntity();
|
||||
wmsInPlanDetailEntityQuery.setKnifeId(nowBaseKnife.getBaseKnifeId());
|
||||
List<WmsInPlanDetailEntity> wmsInPlanDetailEntityList = wmsInPlanDetailEntityService.selectWmsInPlanDetailEntityList(wmsInPlanDetailEntityQuery);
|
||||
nowBaseKnife.setInInfoList(wmsInPlanDetailEntityList);
|
||||
});
|
||||
|
||||
return baseKnifeList;
|
||||
|
Loading…
Reference in New Issue
Block a user