工单整理修改车间取值逻辑

master
Leon 4 years ago
parent ada6099b6b
commit 6cf48654c7

@ -8,6 +8,8 @@ package com.foreverwin.mesnac.common.constant;
*/
public interface Constants {
String OP_6106GX = "6106GX";
String STATUS_NEW = "NEW";
String STATE_CONFIRM ="CONF";
String STATE_REJECT="REJ";
@ -175,6 +177,4 @@ public interface Constants {
*/
String UNTREATED = "UN"; //未处理
String PROCESSED = "PR"; //已处理
}

@ -94,13 +94,6 @@ public class ShopOrderReleaseServiceImpl implements ShopOrderReleaseService {
}
for (ShopOrderRelease shopOrderReleaseModel : shopOrderList) {
String workCenter = shopOrderReleaseModel.getWorkCenter();
String workCenterBo = HandleEnum.WORK_CENTER.getHandle(site, workCenter);
WorkCenter workCenterModel = workCenterService.getById(workCenterBo);
if (workCenterModel == null) {
throw new BaseException("工作中心[" + workCenter + "]不存在");
}
//查询工单信息
String shopOrder = shopOrderReleaseModel.getShopOrder();
String shopOrderBo = shopOrderReleaseModel.getShopOrderBo();
@ -133,6 +126,23 @@ public class ShopOrderReleaseServiceImpl implements ShopOrderReleaseService {
throw new BaseException("工艺路线[" +StringUtils.trimHandle(routerBo)+ "]主数据不完整,请确认");
}
//获取车间
String workCenter = null;
String workCenterBo = null;
for (RouterDTO routerDTO: routerList) {
String operation = routerDTO.getOperation();
if (!Constants.OP_6106GX.equals(operation) && operation.contains("_")) {
workCenter = operation.split("_")[0];
workCenterBo = HandleEnum.WORK_CENTER.getHandle(site, workCenter);
WorkCenter workCenterModel = workCenterService.getById(workCenterBo);
if (workCenterModel == null) {
throw BusinessException.build("生产车间【" +workCenter+ "】不存在");
}
break;
}
}
//工单下达
ReleaseShopOrderResponse response = null;
try {

@ -546,7 +546,7 @@ public class InterfaceServiceImpl implements InterfaceService {
String operation = null;
String operationBo = null;
if (StringUtil.isBlank(erpWorkCenter)) {
operation = "6106GX";
operation = Constants.OP_6106GX;
Operation operationModel = operationService.getCurrentRevisionRef(site, operation);
if (operationModel == null) {
throw BusinessException.build("工序编号【" +operation+ "】不存在");

Loading…
Cancel
Save