|
|
|
@ -184,9 +184,9 @@ public class MesPullingOrderInfoService implements IMesPullingOrderInfoService {
|
|
|
|
|
//查询拉动单主表是JIS拉动且拉动状态为10
|
|
|
|
|
String append = packBean.getWhereAppend() +
|
|
|
|
|
" AND EXISTS (select 1 from MesPullingOrderInfo po where po.pullingOrderNo = model.pullingOrderNo" +
|
|
|
|
|
" and po.pullOrderType=20 and po.pullOrderStatus =10 and po.workCenterCode ='"+bean.getWorkCenterCode()+"' " ;
|
|
|
|
|
packBean.setWhereAppend(append+ " )");
|
|
|
|
|
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.ASC.getValue(), CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"status", "createDatetime"}, packBean);
|
|
|
|
|
" and po.pullOrderType=20 and po.workCenterCode ='" + bean.getWorkCenterCode() + "' ";
|
|
|
|
|
packBean.setWhereAppend(append + " )");
|
|
|
|
|
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.ASC.getValue(), CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"status", "pullingOrderNo"}, packBean);
|
|
|
|
|
|
|
|
|
|
pager = PagerHelper.getPager(pager, mesPullingOrderPartInfoRepository.findByHqlWhereCount(packBean));
|
|
|
|
|
|
|
|
|
@ -203,13 +203,11 @@ public class MesPullingOrderInfoService implements IMesPullingOrderInfoService {
|
|
|
|
|
MesPartPullDetail mesPartPullDetail = pullCodePartMap.get(partInfo.getPullCode() + "=" + partInfo.getPartNo()).get(0);
|
|
|
|
|
partInfo.setScanValidationType(StringUtil.isEmpty(mesPartPullDetail.getScanValidationType()) ? 10 : mesPartPullDetail.getScanValidationType());
|
|
|
|
|
partInfo.setRuleValidation(StringUtil.isEmpty(mesPartPullDetail.getRuleValidation()) ? "" : mesPartPullDetail.getRuleValidation());
|
|
|
|
|
if (partInfo.getScanValidationType() == 10) {
|
|
|
|
|
if (mesPartPullDetail.getScanValidationType() == MesExtEnumUtil.PART_PULL_DETAIL_SCAN_VALIDATION_TYPE.UN_VALIDATE.getValue()) {
|
|
|
|
|
partInfo.setColor(MesExtEnumUtil.PART_PULL_DETAIL_COLOR.WHITE.getCode());
|
|
|
|
|
} else {
|
|
|
|
|
}else if (partInfo.getColor()==MesExtEnumUtil.PART_PULL_DETAIL_COLOR.WHITE.getCode()){
|
|
|
|
|
partInfo.setColor(MesExtEnumUtil.PART_PULL_DETAIL_COLOR.RED.getCode());
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
partInfo.setColor(MesExtEnumUtil.PART_PULL_DETAIL_COLOR.WHITE.getCode());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -224,40 +222,41 @@ public class MesPullingOrderInfoService implements IMesPullingOrderInfoService {
|
|
|
|
|
if (!StringUtil.isEmpty(partInfo)) {
|
|
|
|
|
//查拉动单明细对应的拉动组规则
|
|
|
|
|
DdlPackBean packBeanDetail = DdlPackBean.getDdlPackBean(partInfo.getOrganizeCode());
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(partInfo.getPullCode(), "pullCode", packBeanDetail);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(partInfo.getPullCode(), "pullCode", packBeanDetail);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(partInfo.getPartNo(), "partNo", packBeanDetail);
|
|
|
|
|
MesPartPullDetail mesPartPullDetail = mesPartPullDetailRDao.getByProperty(packBeanDetail);
|
|
|
|
|
if (StringUtil.isEmpty(mesPartPullDetail)){
|
|
|
|
|
MesPcnException.throwMesBusiException("工单【%s】拉动组数据为空", mesPullingOrderInfo.getWorkOrderNo());
|
|
|
|
|
}
|
|
|
|
|
MesPartPullDetail mesPartPullDetail = mesPartPullDetailRDao.getByProperty(packBeanDetail);
|
|
|
|
|
if (StringUtil.isEmpty(mesPartPullDetail)) {
|
|
|
|
|
MesPcnException.throwMesBusiException("工单【%s】拉动组数据为空", mesPullingOrderInfo.getWorkOrderNo());
|
|
|
|
|
}
|
|
|
|
|
//校验规则
|
|
|
|
|
if (checkRule(mesPullingOrderInfo,mesPartPullDetail)){
|
|
|
|
|
if (checkRule(mesPullingOrderInfo, mesPartPullDetail)) {
|
|
|
|
|
//校验成功修改颜色为黄色2
|
|
|
|
|
partInfo.setColor(MesExtEnumUtil.PART_PULL_DETAIL_COLOR.YELLOW.getCode());
|
|
|
|
|
ConvertBean.serviceModelUpdate(partInfo, userName);
|
|
|
|
|
mesPullingOrderPartInfoRepository.update(partInfo);
|
|
|
|
|
}else {
|
|
|
|
|
} else {
|
|
|
|
|
MesPcnException.throwMesBusiException("工单拉动组明细【%s】数据为空", mesPullingOrderInfo.getWorkOrderNo());
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
} else {
|
|
|
|
|
MesPcnException.throwMesBusiException("工单拉动组明细【%s】数据为空", mesPullingOrderInfo.getWorkOrderNo());
|
|
|
|
|
}
|
|
|
|
|
return partInfo;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private boolean checkRule(MesPullingOrderPartInfo mesPullingOrderInfo, MesPartPullDetail mesPartPullDetail) {
|
|
|
|
|
String rule=mesPartPullDetail.getRuleValidation();
|
|
|
|
|
if (mesPullingOrderInfo.getScanValidationType()==MesExtEnumUtil.PART_PULL_DETAIL_SCAN_VALIDATION_TYPE.HOMEMADE_VALIDATE.getValue()){
|
|
|
|
|
String rule = mesPartPullDetail.getRuleValidation();
|
|
|
|
|
if (mesPullingOrderInfo.getScanValidationType() == MesExtEnumUtil.PART_PULL_DETAIL_SCAN_VALIDATION_TYPE.HOMEMADE_VALIDATE.getValue()) {
|
|
|
|
|
List<MesProduceSn> produceSnList = mesProduceSnExtService.getProduceSnList(mesPullingOrderInfo.getOrganizeCode(), mesPullingOrderInfo.getProductSn());
|
|
|
|
|
return mesPartPullDetail.getPullPartNo().equals(produceSnList.get(0).getPartNo());
|
|
|
|
|
}else if (mesPullingOrderInfo.getScanValidationType()==MesExtEnumUtil.PART_PULL_DETAIL_SCAN_VALIDATION_TYPE.COOPERATION_VALIDATE.getValue()){
|
|
|
|
|
} else if (mesPullingOrderInfo.getScanValidationType() == MesExtEnumUtil.PART_PULL_DETAIL_SCAN_VALIDATION_TYPE.COOPERATION_VALIDATE.getValue()) {
|
|
|
|
|
return (Boolean) ((IMesNumberRuleMatchDispatchService) SpringContextsUtil.getBean(MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.MATCH_TYPE_20.getStrategyClass()))
|
|
|
|
|
.matchNumberRule(mesPullingOrderInfo.getOrganizeCode(), mesPullingOrderInfo.getProductSn(), rule, rule)
|
|
|
|
|
.get(MesPcnExtConstWords.RESULT);
|
|
|
|
|
}else {
|
|
|
|
|
} else {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<MesPullingOrderPartInfo> doMesPullingOrderInfoSend(List<MesPullingOrderPartInfo> infoList, String userName) {
|
|
|
|
|
List<MesPullingOrderPartInfo> result = new ArrayList<>();
|
|
|
|
|