JIS物料拉动PCN页面2

tags/yfai-pcn-ext-v2.3
gsz 9 months ago
parent 188741a4dd
commit 8290261d5b

@ -121,7 +121,7 @@ public class MesPullingOrderInfoController {
throw new ImppBusiException("拉动单明细状态不为未送料状态!"); throw new ImppBusiException("拉动单明细状态不为未送料状态!");
} }
MesPullingOrderPartInfo pullingOrderInfo = mesPullingOrderInfoService.doMesPullingOrderInfoJisScan(info, AuthUtil.getSessionUser().getUserName()); MesPullingOrderPartInfo pullingOrderInfo = mesPullingOrderInfoService.doMesPullingOrderInfoJisScan(info, AuthUtil.getSessionUser().getUserName());
return ResultBean.success("拉动单打印成功") return ResultBean.success("JIS物料拉动校验条码成功")
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()) .setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode())
.setResultObject(pullingOrderInfo); .setResultObject(pullingOrderInfo);
} catch (ImppBusiException e) { } catch (ImppBusiException e) {
@ -134,9 +134,16 @@ public class MesPullingOrderInfoController {
@ApiOperation(value = "JIS物料拉动-送料按钮") @ApiOperation(value = "JIS物料拉动-送料按钮")
public ResultBean doMesPullingOrderInfoSend(@RequestBody List<MesPullingOrderPartInfo> infoList) { public ResultBean doMesPullingOrderInfoSend(@RequestBody List<MesPullingOrderPartInfo> infoList) {
try { try {
for (MesPullingOrderPartInfo partInfo : infoList) {
if (MesExtEnumUtil.PULL_ORDER_PART_STATUS.SENTED.getValue()==partInfo.getStatus()) {
throw new ImppBusiException("JIS物料拉动状态不为未送料状态");
}
if (MesExtEnumUtil.PART_PULL_DETAIL_COLOR.RED.getCode()==partInfo.getColor()) {
throw new ImppBusiException("JIS物料拉动需要扫描条码校验");
}
}
List<MesPullingOrderPartInfo> pullingOrderInfos = mesPullingOrderInfoService.doMesPullingOrderInfoSend(infoList, AuthUtil.getSessionUser().getUserName()); List<MesPullingOrderPartInfo> pullingOrderInfos = mesPullingOrderInfoService.doMesPullingOrderInfoSend(infoList, AuthUtil.getSessionUser().getUserName());
return ResultBean.success("拉动单打印成功") return ResultBean.success("拉动单送料成功")
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()) .setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode())
.setResultList(pullingOrderInfos); .setResultList(pullingOrderInfos);
} catch (ImppBusiException e) { } catch (ImppBusiException e) {

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

Loading…
Cancel
Save