Merge branch 'uat-temp-castle-2412250942-44253' into test

tags/yfai-pcn-ext-v2.6
王杰 5 months ago
commit 4fda271266

@ -27,4 +27,7 @@ public interface IMesPartShippingGroupService {
@ApiOperation(value = "发运组明细") @ApiOperation(value = "发运组明细")
MesPartShippingGroupDetail getMesPartShippingGroupDetail(String organizeCode, String shippingGroupCode, String partNo, String custPartNo); MesPartShippingGroupDetail getMesPartShippingGroupDetail(String organizeCode, String shippingGroupCode, String partNo, String custPartNo);
@ApiOperation(value = "发运组明细")
MesPartShippingGroupDetail getMesPartShippingGroupDetailByPartNo(String organizeCode, String shippingGroupCode, String partNo);
} }

@ -19,6 +19,9 @@ public interface IMesProductionRecordService {
@ApiOperation(value = "根据零件条码查询加工记录信息") @ApiOperation(value = "根据零件条码查询加工记录信息")
List<MesProductionRecord> findProductionRecordList(String organizeCode, String productSn); List<MesProductionRecord> findProductionRecordList(String organizeCode, String productSn);
@ApiOperation(value = "根据零件条码和工艺查询加工记录")
Integer findFrontProcessProductionRecord(String organizeCode, String productSn,String craftCode);
@ApiOperation(value = "查询加工记录, 根据完成时间倒序") @ApiOperation(value = "查询加工记录, 根据完成时间倒序")
List<MesProductionRecord> findProductionRecordListCompleteDateTimeDesc(String organizeCode, String productSn); List<MesProductionRecord> findProductionRecordListCompleteDateTimeDesc(String organizeCode, String productSn);

@ -94,4 +94,13 @@ public class MesPartShippingGroupService implements IMesPartShippingGroupService
DdlPreparedPack.getStringEqualPack(custPartNo, "custPartNo", packBean); DdlPreparedPack.getStringEqualPack(custPartNo, "custPartNo", packBean);
return mesPartShippingGroupDetailRepository.getByProperty(packBean); return mesPartShippingGroupDetailRepository.getByProperty(packBean);
} }
@Override
public MesPartShippingGroupDetail getMesPartShippingGroupDetailByPartNo(String organizeCode, String shippingGroupCode, String partNo) {
if(StringUtil.isEmpty(organizeCode) || StringUtil.isEmpty(shippingGroupCode) || StringUtil.isEmpty(partNo)) return null;
DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getStringEqualPack(shippingGroupCode, "shippingGroupCode", packBean);
DdlPreparedPack.getStringEqualPack(partNo, "partNo", packBean);
return mesPartShippingGroupDetailRepository.getByProperty(packBean);
}
} }

@ -67,6 +67,14 @@ public class MesProductionRecordService implements IMesProductionRecordService {
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), productSn}); new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), productSn});
} }
@Override
public Integer findFrontProcessProductionRecord(String organizeCode, String productSn, String craftCode) {
if (StringUtils.isEmpty(organizeCode) || StringUtils.isEmpty(productSn) || StringUtils.isEmpty(craftCode)) return null;
return productionRecordRepository.findByPropertyCount(
new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, MesPcnExtConstWords.PRODUCT_SN, MesPcnExtConstWords.CRAFT_CODE},
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), productSn, craftCode});
}
//查询加工记录, 根据完成时间倒序 //查询加工记录, 根据完成时间倒序
@Override @Override
public List<MesProductionRecord> findProductionRecordListCompleteDateTimeDesc(String organizeCode, String productSn) { public List<MesProductionRecord> findProductionRecordListCompleteDateTimeDesc(String organizeCode, String productSn) {

@ -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) {
//校验条码 //校验条码

@ -92,6 +92,8 @@ public class MesShippingScanSnStrategyServiceImpl implements IMesShippingScanStr
} }
private void checkShippingDetails(MesSortShippingCheckModel model, MesShippingOrderManagement orderManagement, MesPartShippingGroup shippingGroup, MesProduceSn produceSn, MesShippingOrderManagementDetail detail) { private void checkShippingDetails(MesSortShippingCheckModel model, MesShippingOrderManagement orderManagement, MesPartShippingGroup shippingGroup, MesProduceSn produceSn, MesShippingOrderManagementDetail detail) {
//校验发运单明细顺序 //校验发运单明细顺序
if (!Objects.isNull(shippingGroup) && !StringUtils.isEmpty(shippingGroup.getIsEnableShippingFailSafe()) && CommonEnumUtil.VALID == shippingGroup.getIsEnableShippingFailSafe()) { if (!Objects.isNull(shippingGroup) && !StringUtils.isEmpty(shippingGroup.getIsEnableShippingFailSafe()) && CommonEnumUtil.VALID == shippingGroup.getIsEnableShippingFailSafe()) {
Optional<MesShippingOrderManagementDetail> first = model.getDetailList().stream().filter(k -> k.getCustInfoSeq().compareTo(detail.getCustInfoSeq()) < 0 && !Objects.equals(k.getIsScanFlg(), MesCommonConstant.TRUE_INTEGER)).findFirst(); Optional<MesShippingOrderManagementDetail> first = model.getDetailList().stream().filter(k -> k.getCustInfoSeq().compareTo(detail.getCustInfoSeq()) < 0 && !Objects.equals(k.getIsScanFlg(), MesCommonConstant.TRUE_INTEGER)).findFirst();

Loading…
Cancel
Save