|
|
|
@ -206,13 +206,14 @@ public class MesNcProcessingService implements IMesNcProcessingService {
|
|
|
|
|
if(!Objects.isNull(model.getPart())){
|
|
|
|
|
model.setPart(mesPartService.getMesPartSapByPartNo(model.getPart().getPartNo(), org));
|
|
|
|
|
}
|
|
|
|
|
if (model.getPartInspection().getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) {
|
|
|
|
|
Integer type = model.getType();
|
|
|
|
|
MesDefectType person = StringUtil.isEmpty(model.getPerson())?new MesDefectType():model.getPerson();
|
|
|
|
|
|
|
|
|
|
final String redisKey = MesPcnExtConstWords.SAP_TRANS_JOB_LOCK_TAG + model.getSn();
|
|
|
|
|
RLock rLock = (RLock) redisMesPcn.getLock(redisKey);
|
|
|
|
|
try {
|
|
|
|
|
final String redisKey = MesPcnExtConstWords.SAP_TRANS_JOB_LOCK_TAG + model.getPartInspection().getId();
|
|
|
|
|
RLock rLock = (RLock) redisMesPcn.getLock(redisKey);
|
|
|
|
|
try {
|
|
|
|
|
if (model.getPartInspection().getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) {
|
|
|
|
|
Integer type = model.getType();
|
|
|
|
|
MesDefectType person = StringUtil.isEmpty(model.getPerson())?new MesDefectType():model.getPerson();
|
|
|
|
|
|
|
|
|
|
//使用tryLock拿不到锁直接返回
|
|
|
|
|
//rlock的leaseTime为-1,会每隔WatchdogTimeout秒去续约
|
|
|
|
|
if (!rLock.tryLock()){
|
|
|
|
@ -221,17 +222,16 @@ public class MesNcProcessingService implements IMesNcProcessingService {
|
|
|
|
|
|
|
|
|
|
//保存数据
|
|
|
|
|
saveDate(model, model.getPart(), type, person, org,model.getInventoryLocationCode(),isOrder);
|
|
|
|
|
} finally {
|
|
|
|
|
if (rLock.isHeldByCurrentThread()) {
|
|
|
|
|
rLock.unlock();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
Integer type = model.getType();
|
|
|
|
|
MesDefectType person = StringUtil.isEmpty(model.getPerson())?new MesDefectType():model.getPerson();
|
|
|
|
|
//保存数据
|
|
|
|
|
saveDate(model, model.getPart(), type, person, org,model.getInventoryLocationCode(), isOrder);
|
|
|
|
|
}
|
|
|
|
|
} finally {
|
|
|
|
|
if (rLock.isHeldByCurrentThread()) {
|
|
|
|
|
rLock.unlock();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
Integer type = model.getType();
|
|
|
|
|
MesDefectType person = StringUtil.isEmpty(model.getPerson())?new MesDefectType():model.getPerson();
|
|
|
|
|
//保存数据
|
|
|
|
|
saveDate(model, model.getPart(), type, person, org,model.getInventoryLocationCode(), isOrder);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -370,6 +370,9 @@ public class MesNcProcessingService implements IMesNcProcessingService {
|
|
|
|
|
String workCenterCode = null == model.getPartInspection() ? null : model.getPartInspection().getWorkCenterCode();
|
|
|
|
|
assert model.getPartInspection() != null;
|
|
|
|
|
model.getPartInspection().setQmsSync(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
|
|
|
|
|
if (!Objects.equals(model.getPartInspection().getNcStatus(), MesExtEnumUtil.PART_INSPECTION_NC_STATUS.CREATE.getValue())) {
|
|
|
|
|
throw new ImppBusiException(String.format("零件【%s】已进行过NC处理,请勿重复操作!", part.getPartNo()));
|
|
|
|
|
}
|
|
|
|
|
MesProduceSn sn = getProduceSn(model.getSn(), org);
|
|
|
|
|
//武汉 会输入客户条码 todo 更新工单对应qcStatus
|
|
|
|
|
boolean isWorkOrderQcStatus=false;
|
|
|
|
|