|
|
@ -159,6 +159,23 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
|
|
|
|
skipShippingDetails(model, model.getUserInfo(), orderManagement);
|
|
|
|
skipShippingDetails(model, model.getUserInfo(), orderManagement);
|
|
|
|
//扫描条码
|
|
|
|
//扫描条码
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 修复bug 44253 by castle 同Pisces,零件发运组/发运组明细可以实现“前道工艺”校验
|
|
|
|
|
|
|
|
* 逻辑:
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* 1.查询零件发运组
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* 2.查询对应零件发运组详情
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* 3.根据条码查询有没有在条码表中,用于判断是自制件,有则为自制件
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* 4.自制件需要查看明细是否维护了 前道工艺,如果维护了则需要校验前道工艺有没有加工记录;如果明细没有维护,则找零件发运组是否维护了,维护则需要校验;两者都没有维护,则不需要校验
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* 5.外协件不需要校验前道工艺
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
if(!checkFrontProcess(model, shippingGroup)){
|
|
|
|
|
|
|
|
MesPcnException.throwMesBusiException("条码【%s】前道校验未通过,请检查数据",model.getSn());
|
|
|
|
|
|
|
|
}
|
|
|
|
if (StringUtils.isEmpty(shippingGroup.getConfirmPartType())) {
|
|
|
|
if (StringUtils.isEmpty(shippingGroup.getConfirmPartType())) {
|
|
|
|
MesPcnException.throwMesBusiException("零件发运组【%s】扫描确认方式未维护,请检查数据!");
|
|
|
|
MesPcnException.throwMesBusiException("零件发运组【%s】扫描确认方式未维护,请检查数据!");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -174,6 +191,40 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
|
|
|
|
return model;
|
|
|
|
return model;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private boolean checkFrontProcess(MesSortShippingCheckModel model,MesPartShippingGroup shippingGroup){
|
|
|
|
|
|
|
|
boolean flag = false;
|
|
|
|
|
|
|
|
String organizeCode = model.getOrganizeCode();
|
|
|
|
|
|
|
|
//1.首先校验自制件
|
|
|
|
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode);
|
|
|
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(model.getSn(), "productSn", packBean);
|
|
|
|
|
|
|
|
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"createDatetime"}, packBean);
|
|
|
|
|
|
|
|
MesProduceSn produceSn = produceSnRepository.getByProperty(packBean);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Objects.isNull(produceSn)) {
|
|
|
|
|
|
|
|
//外协件不需要校验前道工艺
|
|
|
|
|
|
|
|
flag = true;
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
//自制件校验前道工艺 零件发运组详情中的优先
|
|
|
|
|
|
|
|
MesPartShippingGroupDetail groupDetail = mesPartShippingGroupService.getMesPartShippingGroupDetailByPartNo(organizeCode, shippingGroup.getShippingGroupCode(), produceSn.getPartNo());
|
|
|
|
|
|
|
|
if (!StringUtils.isEmpty(groupDetail.getFrontProcessCode())){
|
|
|
|
|
|
|
|
Integer count = mesProductionRecordService.findFrontProcessProductionRecord(organizeCode, produceSn.getProductSn(), groupDetail.getFrontProcessCode());
|
|
|
|
|
|
|
|
if (count > 0){
|
|
|
|
|
|
|
|
flag = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}else if (!StringUtils.isEmpty(shippingGroup.getFrontProcessCode())){
|
|
|
|
|
|
|
|
Integer count = mesProductionRecordService.findFrontProcessProductionRecord(organizeCode, produceSn.getProductSn(), shippingGroup.getFrontProcessCode());
|
|
|
|
|
|
|
|
if (count > 0){
|
|
|
|
|
|
|
|
flag = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
//如果都没有
|
|
|
|
|
|
|
|
flag = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return flag;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public MesSortShippingCheckModel saveSnAndLocationCode(MesSortShippingCheckModel model, String organizeCode, String userInfo) {
|
|
|
|
public MesSortShippingCheckModel saveSnAndLocationCode(MesSortShippingCheckModel model, String organizeCode, String userInfo) {
|
|
|
|
//校验条码
|
|
|
|
//校验条码
|
|
|
|