tags/yfai-pcn-ext-v1.0
LML丶 1 year ago
parent 3a11f72a50
commit 96d8cf462d

@ -5,9 +5,9 @@ import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesNcProcessingService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesNcProcessingInputModel;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesNcProcessingPartAndLotModel;
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtEnumUtil;
import cn.estsh.i3plus.pojo.base.bean.ListPager;
import cn.estsh.i3plus.pojo.base.common.Pager;
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
import cn.estsh.impp.framework.boot.auth.AuthUtil;
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
@ -77,7 +77,7 @@ public class MesNcProcessingController {
throw new ImppBusiException("产品条码为空或零件号+批次为空");
}
String description = MesPcnExtEnumUtil.NC_TYPE.valueOfDescription(model.getType());
String description = MesExtEnumUtil.NC_TYPE.valueOfDescription(model.getType());
if (StringUtils.isEmpty(description)) {
throw new ImppBusiException(String.format("【%s】类型不存在请检查数据", model.getType()));

@ -3,7 +3,6 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.busi;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesConfigService;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesInputDefectRecordService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesInputDefectRecordModel;
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtEnumUtil;
import cn.estsh.i3plus.mes.pcn.api.iservice.busi.ISyncFuncService;
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
import cn.estsh.i3plus.platform.common.tool.TimeTool;
@ -13,6 +12,7 @@ import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
import cn.estsh.i3plus.pojo.mes.bean.*;
import cn.estsh.i3plus.pojo.mes.model.GenSerialNoModel;
import cn.estsh.i3plus.pojo.mes.repository.*;
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
import cn.estsh.impp.framework.boot.auth.AuthUtil;
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
import cn.estsh.impp.framework.boot.util.ResultBean;
@ -155,7 +155,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
//检查条码
MesProduceSn produceSn = checkProduceSn(defectRecordList.get(0).getSerialNumber(), org);
produceSn.setQcStatus(MesPcnExtEnumUtil.PRODUCE_QC_STATUS.SUSPICIOUS.getValue());
produceSn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.SUSPICIOUS.getValue());
//检查物料
MesPart part = checkPartByPartNo(produceSn.getPartNo(), org);
@ -196,13 +196,13 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
//根据条码状态判断 是不是已下线条码
//若不是已下线的条码则提示 条码状态 请选择已下线的条码
if (produceSn.getSnStatus() != MesPcnExtEnumUtil.PRODUCE_SN_STATUS.OFFLINE.getValue()) {
throw new ImppBusiException(String.format("【%s】此条码状态为【%s】,请选择【%s】状态的条码", serialNumber, produceSn.getSnStatus(), MesPcnExtEnumUtil.PRODUCE_SN_STATUS.OFFLINE.getValue()));
if (produceSn.getSnStatus() != MesExtEnumUtil.PRODUCE_SN_STATUS.OFFLINE.getValue()) {
throw new ImppBusiException(String.format("【%s】此条码状态为【%s】,请选择【%s】状态的条码", serialNumber, produceSn.getSnStatus(), MesExtEnumUtil.PRODUCE_SN_STATUS.OFFLINE.getValue()));
}
//是否需要判断条码质量状态
if (produceSn.getQcStatus() != MesPcnExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue()) {
throw new ImppBusiException(String.format("【%s】此条码状态为【%s】,请选择【%s】状态的条码", serialNumber, produceSn.getSnStatus(), MesPcnExtEnumUtil.PRODUCE_SN_STATUS.OFFLINE.getValue()));
if (produceSn.getQcStatus() != MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue()) {
throw new ImppBusiException(String.format("【%s】此条码状态为【%s】,请选择【%s】状态的条码", serialNumber, produceSn.getSnStatus(), MesExtEnumUtil.PRODUCE_SN_STATUS.OFFLINE.getValue()));
}
return produceSn;
}

@ -7,7 +7,6 @@ import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesNcProcessingInputModel;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesNcProcessingModel;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesNcProcessingPartAndLotModel;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesNcProcessingViewModel;
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtEnumUtil;
import cn.estsh.i3plus.mes.pcn.api.iservice.busi.ISyncFuncService;
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
import cn.estsh.i3plus.platform.common.tool.TimeTool;
@ -20,6 +19,7 @@ import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
import cn.estsh.i3plus.pojo.mes.bean.*;
import cn.estsh.i3plus.pojo.mes.model.GenSerialNoModel;
import cn.estsh.i3plus.pojo.mes.repository.*;
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
import cn.estsh.impp.framework.boot.auth.AuthUtil;
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
import cn.estsh.impp.framework.boot.util.ResultBean;
@ -335,7 +335,7 @@ public class MesNcProcessingService implements IMesNcProcessingService {
zrsum = (rb.getResultList().get(0)).toString();
}
if (type == MesPcnExtEnumUtil.NC_TYPE.NORMAL.getValue() || type == MesPcnExtEnumUtil.NC_TYPE.RELEASE.getValue()) {
if (type == MesExtEnumUtil.NC_TYPE.NORMAL.getValue() || type == MesExtEnumUtil.NC_TYPE.RELEASE.getValue()) {
MesMove move = new MesMove();
move.setMatnr(part.getPartNo());
move.setOrganizeCode(org);

@ -4,13 +4,13 @@ import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesJisShippingService;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesShippingLoadingCheckService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesShippingLoadingCheckModel;
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtEnumUtil;
import cn.estsh.i3plus.platform.common.util.MesPcnConstWords;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
import cn.estsh.i3plus.pojo.mes.bean.*;
import cn.estsh.i3plus.pojo.mes.repository.*;
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
import cn.estsh.impp.framework.boot.util.ImppRedis;
import lombok.extern.slf4j.Slf4j;
@ -66,9 +66,9 @@ public class MesShippingLoadingCheckService implements IMesShippingLoadingCheckS
}
//校验装车单状态 必须是未装车条码
if (vehiclesOrder.getStatus() != MesPcnExtEnumUtil.SHIPPING_ORDER_STATUS.CREATE.getValue() && vehiclesOrder.getStatus() != MesPcnExtEnumUtil.SHIPPING_ORDER_STATUS.PUBLISHED.getValue()) {
if (vehiclesOrder.getStatus() != MesExtEnumUtil.SHIPPING_ORDER_STATUS.CREATE.getValue() && vehiclesOrder.getStatus() != MesExtEnumUtil.SHIPPING_ORDER_STATUS.PUBLISHED.getValue()) {
throw new ImppBusiException(String.format("【%s】此装车单状态为【%s】,请选择状态为【%s】状态的装车单", loadingVehiclesOrder.getLoadingOrderNo(),
MesPcnExtEnumUtil.SHIPPING_ORDER_STATUS.valueOfDescription(vehiclesOrder.getStatus()), MesPcnExtEnumUtil.SHIPPING_ORDER_STATUS.CREATE.getDescription()));
MesExtEnumUtil.SHIPPING_ORDER_STATUS.valueOfDescription(vehiclesOrder.getStatus()), MesExtEnumUtil.SHIPPING_ORDER_STATUS.CREATE.getDescription()));
}
@ -88,7 +88,7 @@ public class MesShippingLoadingCheckService implements IMesShippingLoadingCheckS
List<MesShippingOrderManagement> orderManagementList = shippingOrderManagementRepository.findByHqlWhere(orderManagementPackBean);
//未校验完成的发运单
List<String> orderNoList =
orderManagementList.stream().filter(k -> k.getStatus() != MesPcnExtEnumUtil.SHIPPING_ORDER_STATUS.VERIFICATION_COMPLETED.getValue()).map(k -> k.getShippingGroupNo()).collect(Collectors.toList());
orderManagementList.stream().filter(k -> k.getStatus() != MesExtEnumUtil.SHIPPING_ORDER_STATUS.VERIFICATION_COMPLETED.getValue()).map(k -> k.getShippingGroupNo()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(orderNoList)) {
throw new ImppBusiException(String.format("【%s】此装车单中发运单为【%s】还未做完【排序发运校验】请检查数据", vehiclesOrder.getLoadingOrderNo(), orderNoList));
@ -126,7 +126,7 @@ public class MesShippingLoadingCheckService implements IMesShippingLoadingCheckS
//查询最近扫描完成的装车单号
DdlPackBean recentlyOrderPackBean = DdlPackBean.getDdlPackBean(loadingVehiclesOrder.organizeCode);
DdlPreparedPack.getNumEqualPack(MesPcnExtEnumUtil.SHIPPING_ORDER_STATUS.SHIPPED.getValue(), "status", recentlyOrderPackBean);
DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.SHIPPING_ORDER_STATUS.SHIPPED.getValue(), "status", recentlyOrderPackBean);
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"modifyDatetime"}, recentlyOrderPackBean);
MesLoadingVehiclesOrder recentlyVehiclesOrder = vehiclesOrderRepository.getByProperty(recentlyOrderPackBean);
@ -145,7 +145,7 @@ public class MesShippingLoadingCheckService implements IMesShippingLoadingCheckS
//查询最近扫描完成的装车单号
DdlPackBean orderPackBean = DdlPackBean.getDdlPackBean(org);
DdlPreparedPack.getNumEqualPack(MesPcnExtEnumUtil.SHIPPING_ORDER_STATUS.CREATE.getValue(), "status", orderPackBean);
DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.SHIPPING_ORDER_STATUS.CREATE.getValue(), "status", orderPackBean);
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"seq"}, orderPackBean);
MesLoadingVehiclesOrder loadingVehiclesOrder = vehiclesOrderRepository.getByProperty(orderPackBean);
@ -210,13 +210,13 @@ public class MesShippingLoadingCheckService implements IMesShippingLoadingCheckS
//修改装车单 装车单明细数据状态。
//装车单主表
vehiclesOrder.setStatus(MesPcnExtEnumUtil.LOADING_ORDER_STATUS.LOADED.getValue());
vehiclesOrder.setStatus(MesExtEnumUtil.LOADING_ORDER_STATUS.LOADED.getValue());
//装车单明细
DdlPackBean vehiclesOrderDetailPackBean = DdlPackBean.getDdlPackBean(org);
DdlPreparedPack.getStringEqualPack(vehiclesOrder.getLoadingOrderNo(), "loadingOrderNo", vehiclesOrderDetailPackBean);
List<MesLoadingVehiclesOrderDetail> vehiclesOrderDetailList = vehiclesOrderDetailRepository.findByHqlWhere(vehiclesOrderDetailPackBean);
vehiclesOrderDetailList.forEach(k -> k.setStatus(MesPcnExtEnumUtil.LOADING_DETAIL_ORDER_STATUS.LOADED.getValue()));
vehiclesOrderDetailList.forEach(k -> k.setStatus(MesExtEnumUtil.LOADING_DETAIL_ORDER_STATUS.LOADED.getValue()));
vehiclesOrderDetailRepository.saveAll(vehiclesOrderDetailList);
vehiclesOrderRepository.save(vehiclesOrder);
@ -248,13 +248,13 @@ public class MesShippingLoadingCheckService implements IMesShippingLoadingCheckS
DdlPreparedPack.getStringEqualPack(vehiclesOrder.getLoadingOrderNo(), "loadingOrderNo", vehiclesOrderDetailPackBean);
List<MesLoadingVehiclesOrderDetail> vehiclesOrderDetailList = vehiclesOrderDetailRepository.findByHqlWhere(vehiclesOrderDetailPackBean);
orderManagementList.forEach(k -> k.setStatus(MesPcnExtEnumUtil.SHIPPING_ORDER_STATUS.SHIPPED.getValue()));
orderManagementDetailList.forEach(k -> k.setStatus(MesPcnExtEnumUtil.SHIPPING_ORDER_STATUS.SHIPPED.getValue()));
produceSnList.forEach(k -> k.setSnStatus(MesPcnExtEnumUtil.PRODUCE_SN_STATUS.SHIPPED.getValue()));
vehiclesOrder.setStatus(MesPcnExtEnumUtil.LOADING_ORDER_STATUS.SHIPPING.getValue());
orderManagementList.forEach(k -> k.setStatus(MesExtEnumUtil.SHIPPING_ORDER_STATUS.SHIPPED.getValue()));
orderManagementDetailList.forEach(k -> k.setStatus(MesExtEnumUtil.SHIPPING_ORDER_STATUS.SHIPPED.getValue()));
produceSnList.forEach(k -> k.setSnStatus(MesExtEnumUtil.PRODUCE_SN_STATUS.SHIPPED.getValue()));
vehiclesOrder.setStatus(MesExtEnumUtil.LOADING_ORDER_STATUS.SHIPPING.getValue());
vehiclesOrderDetailList.forEach(k -> {
k.setStatus(MesPcnExtEnumUtil.LOADING_DETAIL_ORDER_STATUS.SHIPPING.getValue());
k.setShippingStatus(MesPcnExtEnumUtil.LOADING_ORDER_DETAIL_SHIPPING_STATUS.SHIPPINGED.getValue());
k.setStatus(MesExtEnumUtil.LOADING_DETAIL_ORDER_STATUS.SHIPPING.getValue());
k.setShippingStatus(MesExtEnumUtil.LOADING_ORDER_DETAIL_SHIPPING_STATUS.SHIPPINGED.getValue());
});
List<MesJisShipping> jisShippingList = jisShippingService.getJisShipping(orderManagementDetailList, org);

@ -4,13 +4,13 @@ import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesJisShippingService;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesSortShippingCheckService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesSortShippingCheckModel;
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtEnumUtil;
import cn.estsh.i3plus.platform.common.util.MesPcnConstWords;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
import cn.estsh.i3plus.pojo.mes.bean.*;
import cn.estsh.i3plus.pojo.mes.repository.*;
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
import cn.estsh.impp.framework.boot.util.ImppRedis;
import lombok.extern.slf4j.Slf4j;
@ -73,9 +73,9 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
}
//校验装车单状态 必须是未装车条码
if (orderManagement.getStatus() != MesPcnExtEnumUtil.SHIPPING_ORDER_STATUS.CREATE.getValue()) {
if (orderManagement.getStatus() != MesExtEnumUtil.SHIPPING_ORDER_STATUS.CREATE.getValue()) {
throw new ImppBusiException(String.format("【%s】此发运单状态为【%s】,请选择状态为【%s】状态的发运单", shippingOrderManagement.getShippingOrderNo(), orderManagement.getStatus(),
MesPcnExtEnumUtil.SHIPPING_ORDER_STATUS.CREATE.getValue()));
MesExtEnumUtil.SHIPPING_ORDER_STATUS.CREATE.getValue()));
}
@ -101,9 +101,9 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
DdlPreparedPack.getStringEqualPack(vehiclesOrderDetail.getLoadingOrderNo(), "loadingOrderNo", orderPackBean);
MesLoadingVehiclesOrder vehiclesOrder = vehiclesOrderRepository.getByProperty(orderPackBean);
//若没进行装车校验,则提示【%s】此发运单对应的【%s】此装车单状态为【%s】请选择状态为【%s】的数据
if (vehiclesOrder.getStatus() != MesPcnExtEnumUtil.LOADING_ORDER_STATUS.LOADED.getValue()) {
if (vehiclesOrder.getStatus() != MesExtEnumUtil.LOADING_ORDER_STATUS.LOADED.getValue()) {
throw new ImppBusiException(String.format("【%s】此发运单对应的【%s】此装车单状态为【%s】请选择状态为【%s】的数据", shippingOrderManagement.getShippingOrderNo(),
vehiclesOrder.getLoadingOrderNo(), vehiclesOrder.getStatus(), MesPcnExtEnumUtil.LOADING_ORDER_STATUS.LOADED.getDescription()));
vehiclesOrder.getLoadingOrderNo(), vehiclesOrder.getStatus(), MesExtEnumUtil.LOADING_ORDER_STATUS.LOADED.getDescription()));
}
}
}
@ -121,7 +121,7 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
//查询最近扫描完成的装车单号
DdlPackBean recentlyOrderPackBean = DdlPackBean.getDdlPackBean(shippingOrderManagement.organizeCode);
DdlPreparedPack.getNumEqualPack(MesPcnExtEnumUtil.SHIPPING_ORDER_STATUS.SHIPPED.getValue(), "status", recentlyOrderPackBean);
DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.SHIPPING_ORDER_STATUS.SHIPPED.getValue(), "status", recentlyOrderPackBean);
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"modifyDatetime"}, recentlyOrderPackBean);
MesShippingOrderManagement recentlyVehiclesOrder = shippingOrderManagementRepository.getByProperty(recentlyOrderPackBean);
@ -217,7 +217,7 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
//查询最近扫描完成的装车单号
DdlPackBean orderPackBean = DdlPackBean.getDdlPackBean(org);
DdlPreparedPack.getNumEqualPack(MesPcnExtEnumUtil.SHIPPING_ORDER_STATUS.CREATE.getValue(), "status", orderPackBean);
DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.SHIPPING_ORDER_STATUS.CREATE.getValue(), "status", orderPackBean);
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"seq"}, orderPackBean);
MesShippingOrderManagement orderManagement = shippingOrderManagementRepository.getByProperty(orderPackBean);
@ -235,14 +235,14 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
throw new ImppBusiException(String.format("【%s】此产品条码不存在请检查数据", model.getSn()));
}
//校验产品条码状态 必须是状态为已下线条码
if (produceSn.getSnStatus() != MesPcnExtEnumUtil.PRODUCE_SN_STATUS.OFFLINE.getValue()) {
if (produceSn.getSnStatus() != MesExtEnumUtil.PRODUCE_SN_STATUS.OFFLINE.getValue()) {
throw new ImppBusiException(String.format("【%s】此条码状态为【%s】,请选择状态为【%s】状态的条码", model.getSn(), produceSn.getSnStatus(),
MesPcnExtEnumUtil.PRODUCE_SN_STATUS.OFFLINE.getValue()));
MesExtEnumUtil.PRODUCE_SN_STATUS.OFFLINE.getValue()));
}
//校验产品质量状态 必须是状态为合格条码
if (produceSn.getQcStatus() != MesPcnExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue()) {
if (produceSn.getQcStatus() != MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue()) {
throw new ImppBusiException(String.format("【%s】此条码质量状态为【%s】,请选择状态为【%s】状态的条码", model.getSn(), produceSn.getQcStatus(),
MesPcnExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue()));
MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue()));
}
Optional optional = model.getDetailList().stream().filter(k -> !StringUtils.isEmpty(k.getBarcode()) && k.getBarcode().equals(model.getSn())).findFirst();
@ -291,7 +291,7 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
//排序校验完成的发运单数量
Long completed =
orderManagementAllList.stream().filter(k -> k.getStatus() == MesPcnExtEnumUtil.SHIPPING_ORDER_STATUS.VERIFICATION_COMPLETED.getValue()).count();
orderManagementAllList.stream().filter(k -> k.getStatus() == MesExtEnumUtil.SHIPPING_ORDER_STATUS.VERIFICATION_COMPLETED.getValue()).count();
//若剩余的发运单号都校验完成
if (completed.intValue() + 1 == orderManagementAllList.size()) {
@ -299,7 +299,7 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
//修改对应装车单 装车单明细 发运单 发运明细 条码数据 报工给wms。
//发运单状态修改为校验完成
orderManagement.setStatus(MesPcnExtEnumUtil.SHIPPING_ORDER_STATUS.VERIFICATION_COMPLETED.getValue());
orderManagement.setStatus(MesExtEnumUtil.SHIPPING_ORDER_STATUS.VERIFICATION_COMPLETED.getValue());
//发运单明细状态修改为校验完成
DdlPackBean orderManagementDetailPackBean = DdlPackBean.getDdlPackBean(org);
@ -308,7 +308,7 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
List<String> snList = new ArrayList<>();
for (MesShippingOrderManagementDetail detail : orderManagementDetailList) {
detail.setStatus(MesPcnExtEnumUtil.SHIPPING_ORDER_STATUS.VERIFICATION_COMPLETED.getValue());
detail.setStatus(MesExtEnumUtil.SHIPPING_ORDER_STATUS.VERIFICATION_COMPLETED.getValue());
Optional<MesShippingOrderManagementDetail> optional1 =
model.getDetailList().stream().filter(k -> k.getShippingOrderNo().equals(detail.getShippingOrderNo())).findFirst();
detail.setBarcode(optional1.get().getBarcode());
@ -319,33 +319,33 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
DdlPreparedPack.getInPackList(snList, "serialNumber", producePackBean);
List<MesProduceSn> produceSnList = produceSnRepository.findByHqlWhere(producePackBean);
//条码校验完成
produceSnList.forEach(k -> k.setSnStatus(MesPcnExtEnumUtil.PRODUCE_SN_STATUS.CHECKED.getValue()));
produceSnList.forEach(k -> k.setSnStatus(MesExtEnumUtil.PRODUCE_SN_STATUS.CHECKED.getValue()));
//修改当前发运单状态
orderManagement.setStatus(MesPcnExtEnumUtil.SHIPPING_ORDER_STATUS.SHIPPED.getValue());
orderManagement.setStatus(MesExtEnumUtil.SHIPPING_ORDER_STATUS.SHIPPED.getValue());
//修改当前发运单明细状态
orderManagementDetailList.forEach(k -> k.setStatus(MesPcnExtEnumUtil.SHIPPING_ORDER_STATUS.SHIPPED.getValue()));
orderManagementDetailList.forEach(k -> k.setStatus(MesExtEnumUtil.SHIPPING_ORDER_STATUS.SHIPPED.getValue()));
//当前发运单明细 需要报工的数据
List<MesJisShipping> jisShippingList = jisShippingService.getJisShipping(orderManagementDetailList, org);
//修改当前发运单明细条码状态
produceSnList.forEach(k -> k.setSnStatus(MesPcnExtEnumUtil.PRODUCE_SN_STATUS.SHIPPED.getValue()));
produceSnList.forEach(k -> k.setSnStatus(MesExtEnumUtil.PRODUCE_SN_STATUS.SHIPPED.getValue()));
//装车单
DdlPackBean orderPackBean = DdlPackBean.getDdlPackBean(org);
DdlPreparedPack.getStringEqualPack(orderManagement.getLoadingOrderNo(), "loadingOrderNo", orderPackBean);
MesLoadingVehiclesOrder vehiclesOrder = vehiclesOrderRepository.getByProperty(orderPackBean);
vehiclesOrder.setStatus(MesPcnExtEnumUtil.LOADING_ORDER_STATUS.SHIPPING.getValue());
vehiclesOrder.setStatus(MesExtEnumUtil.LOADING_ORDER_STATUS.SHIPPING.getValue());
//装车单明细
DdlPackBean vehiclesOrderDetailPackBean = DdlPackBean.getDdlPackBean(org);
DdlPreparedPack.getStringEqualPack(vehiclesOrder.getLoadingOrderNo(), "loadingOrderNo", vehiclesOrderDetailPackBean);
List<MesLoadingVehiclesOrderDetail> vehiclesOrderDetailList = vehiclesOrderDetailRepository.findByHqlWhere(vehiclesOrderDetailPackBean);
vehiclesOrderDetailList.forEach(k -> {
k.setStatus(MesPcnExtEnumUtil.LOADING_DETAIL_ORDER_STATUS.SHIPPING.getValue());
k.setShippingStatus(MesPcnExtEnumUtil.LOADING_ORDER_DETAIL_SHIPPING_STATUS.SHIPPINGED.getValue());
k.setStatus(MesExtEnumUtil.LOADING_DETAIL_ORDER_STATUS.SHIPPING.getValue());
k.setShippingStatus(MesExtEnumUtil.LOADING_ORDER_DETAIL_SHIPPING_STATUS.SHIPPINGED.getValue());
});
//此发运单所在装车单对应剩余发运单
@ -353,18 +353,18 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
DdlPreparedPack.getStringNoEqualPack(model.getShippingOrderNo(), "shippingOrderNo", orderManagementPackBean);
DdlPreparedPack.getStringEqualPack(orderManagement.getLoadingOrderNo(), "loadingOrderNo", orderManagementPackBean);
List<MesShippingOrderManagement> orderManagementtSurplusList = shippingOrderManagementRepository.findByHqlWhere(orderManagementPackBean);
orderManagementtSurplusList.forEach(k -> k.setStatus(MesPcnExtEnumUtil.SHIPPING_ORDER_STATUS.SHIPPED.getValue()));
orderManagementtSurplusList.forEach(k -> k.setStatus(MesExtEnumUtil.SHIPPING_ORDER_STATUS.SHIPPED.getValue()));
//此发运单所在装车单对应剩余发运单明细
List<MesShippingOrderManagementDetail> orderManagementDetailSurplusList = shippingOrderManagementDetailRepository.findByHqlWhere(orderManagementPackBean);
orderManagementDetailSurplusList.forEach(k -> k.setStatus(MesPcnExtEnumUtil.SHIPPING_ORDER_STATUS.SHIPPED.getValue()));
orderManagementDetailSurplusList.forEach(k -> k.setStatus(MesExtEnumUtil.SHIPPING_ORDER_STATUS.SHIPPED.getValue()));
//剩余发运单明细的条码
List<String> snSurplusList = orderManagementDetailSurplusList.stream().map(k -> k.getBarcode()).collect(Collectors.toList());
producePackBean = DdlPackBean.getDdlPackBean(org);
DdlPreparedPack.getInPackList(snSurplusList, "serialNumber", producePackBean);
List<MesProduceSn> produceSnSurplusList = produceSnRepository.findByHqlWhere(producePackBean);
produceSnSurplusList.forEach(k -> k.setSnStatus(MesPcnExtEnumUtil.PRODUCE_SN_STATUS.SHIPPED.getValue()));
produceSnSurplusList.forEach(k -> k.setSnStatus(MesExtEnumUtil.PRODUCE_SN_STATUS.SHIPPED.getValue()));
//剩余发运单明细 需要报工的数据
List<MesJisShipping> jisShippingSurplusList = jisShippingService.getJisShipping(orderManagementDetailSurplusList, org);
@ -396,7 +396,7 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
//发运单状态修改为校验完成
orderManagement.setStatus(MesPcnExtEnumUtil.SHIPPING_ORDER_STATUS.VERIFICATION_COMPLETED.getValue());
orderManagement.setStatus(MesExtEnumUtil.SHIPPING_ORDER_STATUS.VERIFICATION_COMPLETED.getValue());
//发运单明细状态修改为校验完成
DdlPackBean orderManagementDetailPackBean = DdlPackBean.getDdlPackBean(org);
@ -405,7 +405,7 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
List<String> snList = new ArrayList<>();
for (MesShippingOrderManagementDetail detail : orderManagementDetailList) {
detail.setStatus(MesPcnExtEnumUtil.SHIPPING_ORDER_STATUS.VERIFICATION_COMPLETED.getValue());
detail.setStatus(MesExtEnumUtil.SHIPPING_ORDER_STATUS.VERIFICATION_COMPLETED.getValue());
Optional<MesShippingOrderManagementDetail> optional1 =
model.getDetailList().stream().filter(k -> k.getShippingOrderNo().equals(detail.getShippingOrderNo())).findFirst();
detail.setBarcode(optional1.get().getBarcode());
@ -416,7 +416,7 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
DdlPreparedPack.getInPackList(snList, "serialNumber", producePackBean);
List<MesProduceSn> produceSnList = produceSnRepository.findByHqlWhere(producePackBean);
//条码校验完成
produceSnList.forEach(k -> k.setSnStatus(MesPcnExtEnumUtil.PRODUCE_SN_STATUS.CHECKED.getValue()));
produceSnList.forEach(k -> k.setSnStatus(MesExtEnumUtil.PRODUCE_SN_STATUS.CHECKED.getValue()));
produceSnRepository.saveAll(produceSnList);
shippingOrderManagementRepository.save(orderManagement);
@ -425,7 +425,7 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
} else {
//发运单状态修改为校验完成
orderManagement.setStatus(MesPcnExtEnumUtil.SHIPPING_ORDER_STATUS.VERIFICATION_COMPLETED.getValue());
orderManagement.setStatus(MesExtEnumUtil.SHIPPING_ORDER_STATUS.VERIFICATION_COMPLETED.getValue());
//发运单明细状态修改为校验完成
DdlPackBean orderManagementDetailPackBean = DdlPackBean.getDdlPackBean(org);
@ -434,7 +434,7 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
List<String> snList = new ArrayList<>();
for (MesShippingOrderManagementDetail detail : orderManagementDetailList) {
detail.setStatus(MesPcnExtEnumUtil.SHIPPING_ORDER_STATUS.VERIFICATION_COMPLETED.getValue());
detail.setStatus(MesExtEnumUtil.SHIPPING_ORDER_STATUS.VERIFICATION_COMPLETED.getValue());
Optional<MesShippingOrderManagementDetail> optional1 =
model.getDetailList().stream().filter(k -> k.getShippingOrderNo().equals(detail.getShippingOrderNo())).findFirst();
detail.setBarcode(optional1.get().getBarcode());
@ -445,7 +445,7 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
DdlPreparedPack.getInPackList(snList, "serialNumber", producePackBean);
List<MesProduceSn> produceSnList = produceSnRepository.findByHqlWhere(producePackBean);
//条码校验完成
produceSnList.forEach(k -> k.setSnStatus(MesPcnExtEnumUtil.PRODUCE_SN_STATUS.CHECKED.getValue()));
produceSnList.forEach(k -> k.setSnStatus(MesExtEnumUtil.PRODUCE_SN_STATUS.CHECKED.getValue()));
produceSnRepository.saveAll(produceSnList);
shippingOrderManagementRepository.save(orderManagement);
@ -457,7 +457,7 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
//否装车
//发运单状态修改为校验完成
orderManagement.setStatus(MesPcnExtEnumUtil.SHIPPING_ORDER_STATUS.SHIPPED.getValue());
orderManagement.setStatus(MesExtEnumUtil.SHIPPING_ORDER_STATUS.SHIPPED.getValue());
//发运单明细状态修改为校验完成
DdlPackBean orderManagementDetailPackBean = DdlPackBean.getDdlPackBean(org);
@ -466,7 +466,7 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
List<String> snList = new ArrayList<>();
for (MesShippingOrderManagementDetail detail : orderManagementDetailList) {
detail.setStatus(MesPcnExtEnumUtil.SHIPPING_ORDER_STATUS.VERIFICATION_COMPLETED.getValue());
detail.setStatus(MesExtEnumUtil.SHIPPING_ORDER_STATUS.VERIFICATION_COMPLETED.getValue());
Optional<MesShippingOrderManagementDetail> optional1 =
model.getDetailList().stream().filter(k -> k.getShippingOrderNo().equals(detail.getShippingOrderNo())).findFirst();
detail.setBarcode(optional1.get().getBarcode());
@ -475,7 +475,7 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
DdlPackBean producePackBean = DdlPackBean.getDdlPackBean(org);
DdlPreparedPack.getInPackList(snList, "serialNumber", producePackBean);
List<MesProduceSn> produceSnList = produceSnRepository.findByHqlWhere(producePackBean);
produceSnList.forEach(k -> k.setSnStatus(MesPcnExtEnumUtil.PRODUCE_SN_STATUS.SHIPPED.getValue()));
produceSnList.forEach(k -> k.setSnStatus(MesExtEnumUtil.PRODUCE_SN_STATUS.SHIPPED.getValue()));
//当前发运单明细 需要报工的数据
List<MesJisShipping> jisShippingList = jisShippingService.getJisShipping(orderManagementDetailList, org);

@ -3,7 +3,6 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.busi;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.spot.IMesSpotCheckOrderService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesSpotCheckOrderModel;
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtEnumUtil;
import cn.estsh.i3plus.mes.pcn.api.iservice.busi.ISyncFuncService;
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
import cn.estsh.i3plus.platform.common.tool.TimeTool;
@ -16,7 +15,7 @@ import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
import cn.estsh.i3plus.pojo.mes.bean.*;
import cn.estsh.i3plus.pojo.mes.model.GenSerialNoModel;
import cn.estsh.i3plus.pojo.mes.repository.*;
import cn.estsh.i3plus.pojo.mes.unit.MesExtEnumUtil;
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
import cn.estsh.impp.framework.boot.auth.AuthUtil;
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
import lombok.extern.slf4j.Slf4j;
@ -160,8 +159,24 @@ public class MesSpotCheckOrderService implements IMesSpotCheckOrderService {
if (realMap.containsKey(result.getRealEquipVariableId())) {
String value = realMap.get(result.getRealEquipVariableId()).get(0).getEquipVariableValue();
result.setSpotCheckRealValue(value);
//根据获取的值判断是否是设备自定义参数 或者认为录入参数
//没有值则判断设备bad 导致人工手填
if (StringUtils.isEmpty(value)) {
//实际录入方式 设置为认为录入参数
result.setRealValueRecordType(MesExtEnumUtil.SPOT_VALUE_RECORD_TYPE.ARTIFICIAL_INPUT.getValue());
} else {
//实际录入方式 设置为设备自定义参数
result.setRealValueRecordType(MesExtEnumUtil.SPOT_VALUE_RECORD_TYPE.EQUIPMENT_INPUT.getValue());
}
} else {
//若实际值表中没有数据,则
//实际录入方式 设置为设备自定义参数
result.setRealValueRecordType(MesExtEnumUtil.SPOT_VALUE_RECORD_TYPE.EQUIPMENT_INPUT.getValue());
}
} else {
//手动获取 设置为认为录入参数
result.setRealValueRecordType(MesExtEnumUtil.SPOT_VALUE_RECORD_TYPE.ARTIFICIAL_INPUT.getValue());
}
}
@ -361,13 +376,13 @@ public class MesSpotCheckOrderService implements IMesSpotCheckOrderService {
//根据条码状态判断 是不是已下线条码
//若不是已下线的条码则提示 条码状态 请选择已下线的条码
if (produceSn.getSnStatus() != MesPcnExtEnumUtil.PRODUCE_SN_STATUS.OFFLINE.getValue()) {
throw new ImppBusiException(String.format("【%s】此条码状态为【%s】,请选择【%s】状态的条码", serialNumber, produceSn.getSnStatus(), MesPcnExtEnumUtil.PRODUCE_SN_STATUS.OFFLINE.getValue()));
if (produceSn.getSnStatus() != MesExtEnumUtil.PRODUCE_SN_STATUS.OFFLINE.getValue()) {
throw new ImppBusiException(String.format("【%s】此条码状态为【%s】,请选择【%s】状态的条码", serialNumber, produceSn.getSnStatus(), MesExtEnumUtil.PRODUCE_SN_STATUS.OFFLINE.getValue()));
}
//是否需要判断条码质量状态
if (produceSn.getQcStatus() != MesPcnExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue()) {
throw new ImppBusiException(String.format("【%s】此条码状态为【%s】,请选择【%s】状态的条码", serialNumber, produceSn.getSnStatus(), MesPcnExtEnumUtil.PRODUCE_SN_STATUS.OFFLINE.getValue()));
if (produceSn.getQcStatus() != MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue()) {
throw new ImppBusiException(String.format("【%s】此条码状态为【%s】,请选择【%s】状态的条码", serialNumber, produceSn.getSnStatus(), MesExtEnumUtil.PRODUCE_SN_STATUS.OFFLINE.getValue()));
}
return produceSn;
}

@ -1,378 +0,0 @@
package cn.estsh.i3plus.ext.mes.pcn.pojo.util;
import com.fasterxml.jackson.annotation.JsonFormat;
public class MesPcnExtEnumUtil {
/**
* -
*/
@JsonFormat(
shape = JsonFormat.Shape.OBJECT
)
public static enum LOADING_ORDER_STATUS {
CREATE(10, "创建"),
LOADING(15, "装车中"),
LOADED(20, "已装车"),
SHIPPING(30, "已发运"),
CLOSE(40, "关闭");
private int value;
private String description;
private LOADING_ORDER_STATUS(int value, String description) {
this.value = value;
this.description = description;
}
public static String valueOfDescription(int val) {
String tmp = null;
for (int i = 0; i < values().length; ++i) {
if (values()[i].value == val) {
tmp = values()[i].description;
}
}
return tmp;
}
public int getValue() {
return this.value;
}
public String getDescription() {
return this.description;
}
}
/**
* -
*/
@JsonFormat(
shape = JsonFormat.Shape.OBJECT
)
public static enum LOADING_DETAIL_ORDER_STATUS {
CREATE(10, "创建"),
LOADED(20, "已装车"),
SHIPPING(30, "已发运"),
CLOSE(40, "关闭");
private int value;
private String description;
private LOADING_DETAIL_ORDER_STATUS(int value, String description) {
this.value = value;
this.description = description;
}
public static String valueOfDescription(int val) {
String tmp = null;
for (int i = 0; i < values().length; ++i) {
if (values()[i].value == val) {
tmp = values()[i].description;
}
}
return tmp;
}
public int getValue() {
return this.value;
}
public String getDescription() {
return this.description;
}
}
/**
*
*/
@JsonFormat(
shape = JsonFormat.Shape.OBJECT
)
public static enum SHIPPING_ORDER_STATUS {
CREATE(10, "创建"),
PUBLISHED(20, "已发布"),
SHIPPED(30, "已发运"),
VERIFYING(35, "校验中"),
VERIFICATION_COMPLETED(40, "校验完成");
private int value;
private String description;
private SHIPPING_ORDER_STATUS(int value, String description) {
this.value = value;
this.description = description;
}
public static String valueOfDescription(int val) {
String tmp = null;
for (int i = 0; i < values().length; ++i) {
if (values()[i].value == val) {
tmp = values()[i].description;
}
}
return tmp;
}
public int getValue() {
return this.value;
}
public String getDescription() {
return this.description;
}
}
/**
* -
*/
@JsonFormat(
shape = JsonFormat.Shape.OBJECT
)
public static enum LOADING_ORDER_DETAIL_SHIPPING_STATUS {
PUBLISHED(10, "Published"),
SHIPPINGED(20, "Shippinged");
private int value;
private String description;
private LOADING_ORDER_DETAIL_SHIPPING_STATUS(int value, String description) {
this.value = value;
this.description = description;
}
public static String valueOfDescription(int val) {
String tmp = null;
for (int i = 0; i < values().length; ++i) {
if (values()[i].value == val) {
tmp = values()[i].description;
}
}
return tmp;
}
public int getValue() {
return this.value;
}
public String getDescription() {
return this.description;
}
}
/**
* -
*/
@JsonFormat(
shape = JsonFormat.Shape.OBJECT
)
public static enum PRODUCE_SN_STATUS {
CREATE(10, "创建"),
OFFLINE(20, "已完成"),
ASSEMBLY(30, "已装配"),
CHECKED(40, "已校验"),
SHIPPED(50, "发运");
private int value;
private String description;
private PRODUCE_SN_STATUS(int value, String description) {
this.value = value;
this.description = description;
}
public static String valueOfDescription(int val) {
String tmp = null;
for (int i = 0; i < values().length; ++i) {
if (values()[i].value == val) {
tmp = values()[i].description;
}
}
return tmp;
}
public int getValue() {
return this.value;
}
public String getDescription() {
return this.description;
}
}
/**
* -
*/
@JsonFormat(
shape = JsonFormat.Shape.OBJECT
)
public static enum PRODUCE_QC_STATUS {
QUALIFIED(10, "合格"),
SUSPICIOUS(20, "可疑"),
SCRAP(30, "报废");
private int value;
private String description;
private PRODUCE_QC_STATUS(int value, String description) {
this.value = value;
this.description = description;
}
public static String valueOfDescription(int val) {
String tmp = null;
for (int i = 0; i < values().length; ++i) {
if (values()[i].value == val) {
tmp = values()[i].description;
}
}
return tmp;
}
public int getValue() {
return this.value;
}
public String getDescription() {
return this.description;
}
}
/**
* -
*/
@JsonFormat(
shape = JsonFormat.Shape.OBJECT
)
public static enum DEFECT_ALARM_CONFIG_SIDES {
FRONT(10, "正面"),
BACK(20, "反面");
private int value;
private String description;
private DEFECT_ALARM_CONFIG_SIDES(int value, String description) {
this.value = value;
this.description = description;
}
public static String valueOfDescription(int val) {
String tmp = null;
for (int i = 0; i < values().length; ++i) {
if (values()[i].value == val) {
tmp = values()[i].description;
}
}
return tmp;
}
public int getValue() {
return this.value;
}
public String getDescription() {
return this.description;
}
}
/**
* NC-
*/
@JsonFormat(
shape = JsonFormat.Shape.OBJECT
)
public static enum NC_TYPE {
NORMAL(10, "转正常"),
REWORK(20, "返工"),
SCRAP(30, "报废"),
RELEASE(40, "放行");
private int value;
private String description;
private NC_TYPE(int value, String description) {
this.value = value;
this.description = description;
}
public static String valueOfDescription(int val) {
String tmp = null;
for (int i = 0; i < values().length; ++i) {
if (values()[i].value == val) {
tmp = values()[i].description;
}
}
return tmp;
}
public int getValue() {
return this.value;
}
public String getDescription() {
return this.description;
}
}
@JsonFormat(
shape = JsonFormat.Shape.OBJECT
)
public static enum SPOT_CHECK_ITEM_TYPE {
AUTO(1, "自动"),
MANUAL(2, "手动");
private int value;
private String description;
private SPOT_CHECK_ITEM_TYPE(int value, String description) {
this.value = value;
this.description = description;
}
public static String valueOfDescription(int val) {
String tmp = null;
for(int i = 0; i < values().length; ++i) {
if (values()[i].value == val) {
tmp = values()[i].description;
}
}
return tmp;
}
public int getValue() {
return this.value;
}
public String getDescription() {
return this.description;
}
}
}
Loading…
Cancel
Save