From 7384626734765b68cd606da538971574aed98fae Mon Sep 17 00:00:00 2001 From: jun Date: Thu, 16 May 2024 15:28:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9E=9A=E4=B8=BE=E4=BD=8D=E7=BD=AE=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/MesShippingOrderManagementController.java | 2 +- .../base/MesCraftRouteDetailServiceImpl.java | 2 +- .../serviceimpl/base/MesEnumExtService.java | 4 +- .../base/MesEquipmentProdParamCfgServiceImpl.java | 2 +- .../base/MesLoadingVehiclesOrderService.java | 2 +- .../base/MesShippingOrderManagementService.java | 2 +- .../serviceimpl/base/MesWorkOrderService.java | 13 +- .../serviceimpl/busi/MesSpotCheckOrderService.java | 3 +- .../excel/MesWorkOrderBtoExcelServiceImpl.java | 392 ++++ .../i3plus/ext/mes/pojo/util/MesExtEnumUtil.java | 2206 -------------------- 10 files changed, 407 insertions(+), 2221 deletions(-) create mode 100644 modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/excel/MesWorkOrderBtoExcelServiceImpl.java delete mode 100644 modules/i3plus-ext-mes-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pojo/util/MesExtEnumUtil.java diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/controller/base/MesShippingOrderManagementController.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/controller/base/MesShippingOrderManagementController.java index e80a659..029cc76 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/controller/base/MesShippingOrderManagementController.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/controller/base/MesShippingOrderManagementController.java @@ -3,7 +3,7 @@ package cn.estsh.i3plus.ext.mes.apiservice.controller.base; import cn.estsh.i3plus.ext.mes.api.base.IMesShippingOrderManagementService; import cn.estsh.i3plus.ext.mes.apiservice.config.AuthUtilExt; import cn.estsh.i3plus.ext.mes.pojo.constant.MesCommonConstant; -import cn.estsh.i3plus.ext.mes.pojo.util.MesExtEnumUtil; +import cn.estsh.i3plus.pojo.mes.unit.MesExtEnumUtil; import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum; import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil; diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesCraftRouteDetailServiceImpl.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesCraftRouteDetailServiceImpl.java index c72043b..1cbdc49 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesCraftRouteDetailServiceImpl.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesCraftRouteDetailServiceImpl.java @@ -5,7 +5,7 @@ import cn.estsh.i3plus.ext.mes.api.base.IMesCraftRouteService; import cn.estsh.i3plus.ext.mes.api.base.IMesCraftService; import cn.estsh.i3plus.ext.mes.apiservice.config.AuthUtilExt; import cn.estsh.i3plus.ext.mes.apiservice.unit.exception.MesException; -import cn.estsh.i3plus.ext.mes.pojo.util.MesExtEnumUtil; +import cn.estsh.i3plus.pojo.mes.unit.MesExtEnumUtil; import cn.estsh.i3plus.platform.common.convert.ConvertBean; import cn.estsh.i3plus.platform.common.tool.TimeTool; import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesEnumExtService.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesEnumExtService.java index 83b9f1a..c679163 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesEnumExtService.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesEnumExtService.java @@ -2,9 +2,7 @@ package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base; import cn.estsh.i3plus.ext.mes.api.base.IMesEnumExtService; -import cn.estsh.i3plus.ext.mes.pojo.util.MesExtEnumUtil; -import cn.estsh.i3plus.mes.api.iservice.base.IEnumService; -import cn.estsh.i3plus.mes.apiservice.serviceimpl.base.EnumService; +import cn.estsh.i3plus.pojo.mes.unit.MesExtEnumUtil; import cn.estsh.i3plus.mes.apiservice.util.EnumUtil; import cn.estsh.i3plus.platform.common.convert.ConvertBean; import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesEquipmentProdParamCfgServiceImpl.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesEquipmentProdParamCfgServiceImpl.java index c9b40c6..5745576 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesEquipmentProdParamCfgServiceImpl.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesEquipmentProdParamCfgServiceImpl.java @@ -1,7 +1,7 @@ package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base; import cn.estsh.i3plus.ext.mes.api.base.IMesEquipmentProdParamCfgService; -import cn.estsh.i3plus.ext.mes.pojo.util.MesExtEnumUtil; +import cn.estsh.i3plus.pojo.mes.unit.MesExtEnumUtil; import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack; import cn.estsh.i3plus.pojo.mes.bean.MesEquipmentProdParamCfg; diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesLoadingVehiclesOrderService.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesLoadingVehiclesOrderService.java index d9659a3..fdad171 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesLoadingVehiclesOrderService.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesLoadingVehiclesOrderService.java @@ -2,7 +2,7 @@ package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base; import cn.estsh.i3plus.ext.mes.api.base.IMesLoadingVehiclesOrderService; import cn.estsh.i3plus.ext.mes.pojo.constant.MesCommonConstant; -import cn.estsh.i3plus.ext.mes.pojo.util.MesExtEnumUtil; +import cn.estsh.i3plus.pojo.mes.unit.MesExtEnumUtil; import cn.estsh.i3plus.platform.common.convert.ConvertBean; import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum; import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesShippingOrderManagementService.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesShippingOrderManagementService.java index c40e8c7..c8b2584 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesShippingOrderManagementService.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesShippingOrderManagementService.java @@ -2,7 +2,7 @@ package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base; import cn.estsh.i3plus.ext.mes.api.base.IMesConfigService; import cn.estsh.i3plus.ext.mes.api.base.IMesShippingOrderManagementService; -import cn.estsh.i3plus.ext.mes.pojo.util.MesExtEnumUtil; +import cn.estsh.i3plus.pojo.mes.unit.MesExtEnumUtil; import cn.estsh.i3plus.platform.common.convert.ConvertBean; import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum; import cn.estsh.i3plus.platform.common.tool.TimeTool; diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesWorkOrderService.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesWorkOrderService.java index 8da8999..a39d277 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesWorkOrderService.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesWorkOrderService.java @@ -1,12 +1,9 @@ package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base; -import cn.estsh.i3plus.ext.mes.api.base.IMesPartService; -import cn.estsh.i3plus.ext.mes.api.base.IMesProductOffLineService; -import cn.estsh.i3plus.ext.mes.api.base.IMesWorkOrderService; -import cn.estsh.i3plus.ext.mes.api.base.IMesWorkOrderToSapService; +import cn.estsh.i3plus.ext.mes.api.base.*; import cn.estsh.i3plus.ext.mes.apiservice.dao.IMesWorkOrderDao; import cn.estsh.i3plus.ext.mes.apiservice.unit.exception.MesException; -import cn.estsh.i3plus.ext.mes.pojo.util.MesExtEnumUtil; +import cn.estsh.i3plus.pojo.mes.unit.MesExtEnumUtil; import cn.estsh.i3plus.mes.api.iservice.busi.ISyncFuncService; import cn.estsh.i3plus.platform.common.convert.ConvertBean; import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum; @@ -172,6 +169,12 @@ public class MesWorkOrderService extends BaseMesService implements } //更新状态 if (bean.getWorkOrderStatus() > 0) { + if(MesExtEnumUtil.ORDER_STATUS.RELEASE.getValue() == bean.getWorkOrderStatus()){ + if(MesExtEnumUtil.ORDER_STATUS.CREATE.getValue() != result.getWorkOrderStatus()){ + MesException.throwMesBusiException(String.format("工单状态为【%s】不为创建,不允许发布", + MesExtEnumUtil.ORDER_TYPE.valueOfDescription(result.getWorkOrderStatus()))); + } + } result.setWorkOrderStatus(bean.getWorkOrderStatus()); } ConvertBean.serviceModelInitialize(bean, AuthUtil.getSessionUser().getUserName()); diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/MesSpotCheckOrderService.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/MesSpotCheckOrderService.java index e98ff48..0bd68a5 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/MesSpotCheckOrderService.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/MesSpotCheckOrderService.java @@ -1,12 +1,11 @@ package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.busi; -import cn.estsh.i3plus.ext.mes.api.base.IBaseMesService; import cn.estsh.i3plus.ext.mes.api.base.IMesEquipmentSpotCheckService; import cn.estsh.i3plus.ext.mes.api.busi.IMesSpotCheckOrderPartService; import cn.estsh.i3plus.ext.mes.api.busi.IMesSpotCheckOrderResultService; import cn.estsh.i3plus.ext.mes.api.busi.IMesSpotCheckOrderService; import cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base.BaseMesService; -import cn.estsh.i3plus.ext.mes.pojo.util.MesExtEnumUtil; +import cn.estsh.i3plus.pojo.mes.unit.MesExtEnumUtil; import cn.estsh.i3plus.mes.api.iservice.busi.ISyncFuncService; import cn.estsh.i3plus.platform.common.convert.ConvertBean; import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum; diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/excel/MesWorkOrderBtoExcelServiceImpl.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/excel/MesWorkOrderBtoExcelServiceImpl.java new file mode 100644 index 0000000..d89ddf6 --- /dev/null +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/excel/MesWorkOrderBtoExcelServiceImpl.java @@ -0,0 +1,392 @@ +package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.excel; + +import cn.estsh.i3plus.mes.api.iservice.busi.IExcelImportService; +import cn.estsh.i3plus.mes.apiservice.serviceimpl.busi.CommonService; +import cn.estsh.i3plus.mes.apiservice.util.MesCommonUtil; +import cn.estsh.i3plus.platform.common.convert.ConvertBean; +import cn.estsh.i3plus.pojo.mes.bean.MesPartPtr; +import cn.estsh.i3plus.pojo.mes.bean.MesWorkOrder; +import cn.estsh.i3plus.pojo.mes.model.ExcelImportErrorModel; +import cn.estsh.i3plus.pojo.mes.model.ExcelImportResultModel; +import cn.estsh.i3plus.pojo.mes.repository.MesPartPtrRepository; +import cn.estsh.i3plus.pojo.mes.repository.MesPartRepository; +import cn.estsh.i3plus.pojo.mes.repository.MesWorkOrderRepository; +import lombok.extern.slf4j.Slf4j; +import org.apache.poi.ss.usermodel.CellType; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @Description : MES工单导入,BTO + * @Reference : + * @Author : junsheng.li + * @CreateDate 2024/5/16 14:14 + * @Modify: + **/ +@Service +@Slf4j +public class MesWorkOrderBtoExcelServiceImpl implements IExcelImportService { + + @Autowired + private CommonService commonService; + @Autowired + private MesPartRepository partRepository; + @Autowired + private MesWorkOrderRepository mesWorkOrderRDao; + + @Override + public ExcelImportResultModel insertDataByExcel(Workbook workbook, String organizeCode, String userName) { + + //读取表格 + ExcelImportResultModel excelImportResultModel = this.sheetExtractMesWorkOrder(workbook.getSheetAt(0), organizeCode, userName); + //数据入库 + this.insertExcelMesWorkOrder(excelImportResultModel); + return excelImportResultModel; +// return null; + } + + /** + * 工位BOM表导入-读取表格 + * + * @param sheetAt + * @param organizeCode + * @param userName + * @return + */ + private ExcelImportResultModel sheetExtractMesWorkOrder(Sheet sheetAt, String organizeCode, String userName) { + + //从0行开始读取 + int totalNumberOfRows = sheetAt.getLastRowNum() + 1; + + //MesStationBom集合 + List partPtrList = new ArrayList<>(); + + //成功数量 + Integer successRowNum = 0; + //失败数量 + Integer failRowNum = 0; + //错误的行号 + String errorRows = ""; + + //错误行信息集合 + List excelImportErrorModels = new ArrayList<>(); + + // 查询物料表 + Map partCodeEntityMap; + try { + partCodeEntityMap = MesCommonUtil.getCodeEntityMap(partRepository, "partNo", organizeCode, "物料表"); + } catch (Exception e) { + partCodeEntityMap = null; + } + +// //查询关键件条码校验规则表 +// List partPtrList = partPtrRepository.findByProperty(new String[]{MesConstWords.ORGANIZE_CODE, MesConstWords.IS_DELETED}, +// new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()}); +// Map> preventionMap = +// partPtrList.stream().collect(Collectors.groupingBy(k -> k.getPreventionObjectCode() + "&" + k.getPartNo())); + + + Map map = new HashMap<>(); + + for (int i = (sheetAt.getFirstRowNum() + 1); i < totalNumberOfRows; i++) { + Row row = sheetAt.getRow(i); + //空行跳过 + if (null == row) { + continue; + } + //获取总列数 + Short lastCellNum = row.getLastCellNum(); + if (lastCellNum > 0) { + + int rowNum = i + 1; //当前行号 + int errorNum = 0; //错误数量 + String cellNum = ""; //错误列号 + String errorInfo = ""; //错误信息 + + //产线编号 + String workCenterCode = row.getCell(0, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); + + //开始时间 + String startTime = null; + try { + row.getCell(1).setCellType(CellType.STRING); + startTime = row.getCell(1, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); + } catch (Exception e) { + } + //结束时间 + String endTime = null; + try { + row.getCell(2).setCellType(CellType.STRING); + endTime = row.getCell(2, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); + } catch (Exception e) { + } + //PTR车辆数量 + String prtVehicleCount = null; + try { + row.getCell(3).setCellType(CellType.STRING); + prtVehicleCount = row.getCell(3, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); + } catch (Exception e) { + } + + //PTR车辆实际数量 + String prtVehicleActualCount = null; + try { + row.getCell(4).setCellType(CellType.STRING); + prtVehicleActualCount = row.getCell(4, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); + } catch (Exception e) { + } + //原零件号 + String sourcePartNo = null; + try { + row.getCell(5).setCellType(CellType.STRING); + sourcePartNo = row.getCell(5, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); + } catch (Exception e) { + } + + //替换零件号 + String targetPartNo = null; + try { + row.getCell(6).setCellType(CellType.STRING); + targetPartNo = row.getCell(6, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); + } catch (Exception e) { + } + + //是否客户 发送PTR信息 + String isCustomerSendPrtInfo = null; + try { + row.getCell(7).setCellType(CellType.STRING); + isCustomerSendPrtInfo = row.getCell(7, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); + } catch (Exception e) { + } + //排序信息PTR零件号 + String seqInfoPrtPart = null; + try { + row.getCell(8).setCellType(CellType.STRING); + seqInfoPrtPart = row.getCell(8, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); + } catch (Exception e) { + } + + //PTR项目编号 + String ptrProjectNo = null; + try { + row.getCell(9).setCellType(CellType.STRING); + ptrProjectNo = row.getCell(9, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); + } catch (Exception e) { + } + + //替换零件条码规则 + String targetPartNoSnRuleCode = null; + try { + row.getCell(10).setCellType(CellType.STRING); + targetPartNoSnRuleCode = row.getCell(10, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); + } catch (Exception e) { + } + + //总成类型 + String partTypeCode = null; + try { + row.getCell(11).setCellType(CellType.STRING); + partTypeCode = row.getCell(11, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); + } catch (Exception e) { + } + + //总成类型 + String isInterPrt = null; + try { + row.getCell(12).setCellType(CellType.STRING); + isInterPrt = row.getCell(12, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); + } catch (Exception e) { + } + + //目视单显示项 + String visualSingleDisplayItem = null; + try { + row.getCell(13).setCellType(CellType.STRING); + visualSingleDisplayItem = row.getCell(13, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); + } catch (Exception e) { + } + + //起始序号 + String startSeq = null; + try { + row.getCell(14).setCellType(CellType.STRING); + startSeq = row.getCell(14, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); + } catch (Exception e) { + } + + //目视单替换位置 + String visualSingleReplacePosition = null; + try { + row.getCell(14).setCellType(CellType.STRING); + visualSingleReplacePosition = row.getCell(14, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); + } catch (Exception e) { + } + + //硬件版本号 + String hardwareVersionNo = null; + try { + row.getCell(15).setCellType(CellType.STRING); + hardwareVersionNo = row.getCell(15, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); + } catch (Exception e) { + } + + //软件版本号 + String softwareVersionNo = null; + try { + row.getCell(16).setCellType(CellType.STRING); + softwareVersionNo = row.getCell(16, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); + } catch (Exception e) { + } + + //软件版本号 + String status = null; + try { + row.getCell(17).setCellType(CellType.STRING); + status = row.getCell(17, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); + } catch (Exception e) { + } + + //软件版本号 + String memo = null; + try { + row.getCell(18).setCellType(CellType.STRING); + memo = row.getCell(18, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); + } catch (Exception e) { + } + + +// if (!map.containsKey(preventionObjectCode + "&" + partNo)) { +// map.put(preventionObjectCode + "&" + partNo, String.valueOf(rowNum)); +// } else { +// errorNum++; +// cellNum += "A;C;"; +// errorInfo += "第A列数据:" + preventionObjectCode + ",第C列数据:" + partNo; +// } +// +// //校验物料号 +// if (StringUtils.isEmpty(partNo)) { +// errorNum++; +// cellNum += "C;"; +// errorInfo += "第C列数据必填;"; +// } else { +// if (CollectionUtils.isEmpty(partCodeEntityMap) || +// (!CollectionUtils.isEmpty(partCodeEntityMap) && !partCodeEntityMap.containsKey(partNo))) { +// errorNum++; +// cellNum += "C;"; +// errorInfo += "第C列数据无效;"; +// } +// } + + //校验产线编号 + if (StringUtils.isEmpty(workCenterCode)) { + errorNum++; + cellNum += "A;"; + errorInfo += "第A列数据必填;"; + } + + //校验原零件号 + if (StringUtils.isEmpty(sourcePartNo)) { + errorNum++; + cellNum += "F;"; + errorInfo += "第F列数据必填;"; + } + //校验产线编号 + if (StringUtils.isEmpty(targetPartNo)) { + errorNum++; + cellNum += "G;"; + errorInfo += "第G列数据必填;"; + } + //校验替换零件号 + if (StringUtils.isEmpty(ptrProjectNo)) { + errorNum++; + cellNum += "J;"; + errorInfo += "第J列数据必填;"; + } + //校验总成类型 + if (StringUtils.isEmpty(partTypeCode)) { + errorNum++; + cellNum += "L;"; + errorInfo += "第L列数据必填;"; + } + + + //没有错误的时候,封装MesStationBom + if (errorNum == 0) { + + MesPartPtr partPtr; +// if (preventionMap.containsKey(preventionObjectCode + "&" + partNo)) { +// itemPartErrorPrevention = preventionMap.get(partNo).get(0); +// ConvertBean.serviceModelUpdate(itemPartErrorPrevention, userName); +// } else { + partPtr = new MesPartPtr(); + ConvertBean.serviceModelInitialize(partPtr, userName); +// } + partPtr.setWorkCenterCode(workCenterCode); + partPtr.setStartTime(startTime); + partPtr.setEndTime(endTime); + partPtr.setPrtVehicleCount(Integer.parseInt(prtVehicleCount)); + partPtr.setPrtVehicleActualCount(Integer.parseInt(prtVehicleActualCount)); + partPtr.setSourcePartNo(sourcePartNo); + partPtr.setTargetPartNo(targetPartNo); + partPtr.setIsCustomerSendPrtInfo(Integer.parseInt(isCustomerSendPrtInfo)); + partPtr.setSeqInfoPrtPart(seqInfoPrtPart); + partPtr.setPtrProjectNo(ptrProjectNo); + partPtr.setTargetPartNoSnRuleCode(targetPartNoSnRuleCode); + partPtr.setPartTypeCode(Integer.parseInt(partTypeCode)); + partPtr.setIsInterPrt(Integer.parseInt(isInterPrt)); + partPtr.setVisualSingleDisplayItem(visualSingleDisplayItem); + partPtr.setStartSeq(startSeq); + partPtr.setVisualSingleReplacePosition(visualSingleReplacePosition); + partPtr.setHardwareVersionNo(hardwareVersionNo); + partPtr.setSoftwareVersionNo(softwareVersionNo); + partPtr.setStatus(Integer.parseInt(status)); + partPtr.setMemo(memo); + partPtrList.add(partPtr); + successRowNum++; + } else { + //封装错误行信息ExcelImportErrorModel + excelImportErrorModels = commonService.getExcelImportErrorModels(excelImportErrorModels, rowNum, errorNum, cellNum, errorInfo); + + errorRows += rowNum + ";"; + failRowNum++; + } + + } + } + + //校验EXCEL数据 + commonService.checkExcelData(failRowNum, successRowNum, errorRows); + //封装返回结果 + ExcelImportResultModel excelImportResultModel = commonService.getExcelImportResultModel(failRowNum, successRowNum, excelImportErrorModels, errorRows); + excelImportResultModel.setExcelList((failRowNum > 0) ? null : partPtrList); + return excelImportResultModel; + } + + private void insertExcelMesWorkOrder(ExcelImportResultModel excelImportResultModel) { + if (excelImportResultModel == null) { + return; + } + List partPtrList = excelImportResultModel.getExcelList(); + if (CollectionUtils.isEmpty(partPtrList)) { + return; + } + + partPtrList.forEach(k -> { + if (StringUtils.isEmpty(k.getId())) { + mesWorkOrderRDao.insert(k); + } else { + mesWorkOrderRDao.update(k); + } + }); + } +} diff --git a/modules/i3plus-ext-mes-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pojo/util/MesExtEnumUtil.java b/modules/i3plus-ext-mes-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pojo/util/MesExtEnumUtil.java deleted file mode 100644 index 633c5b3..0000000 --- a/modules/i3plus-ext-mes-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pojo/util/MesExtEnumUtil.java +++ /dev/null @@ -1,2206 +0,0 @@ -package cn.estsh.i3plus.ext.mes.pojo.util; - -import com.fasterxml.jackson.annotation.JsonFormat; - -/** - * @Description : - * @Reference : - * @Author : wangjie - * @CreateDate : 2018-10-23 15:53 - * @Modify: - **/ - -public class MesExtEnumUtil { - - /** - * mes导入模块 - */ - @JsonFormat(shape = JsonFormat.Shape.OBJECT) - public enum MES_EXCEL { - - MES_ITEM_PART_ERROR_PREVENTION(40, "mesItemPartErrorPreventionExcelService", "原材料防错,支持编辑"), - MES_PART_PTR(41, "mesPartPtrExcelService", "PTR,支持编辑"), - MES_EXPERIMENTAL_PIECE_RULE(42, "mesExperimentalPieceRuleExcelService", "实验件规则,支持编辑"); - - private int value; - private String service; - private String description; - - MES_EXCEL(int value, String service, String description) { - this.value = value; - this.service = service; - this.description = description; - } - - public static MES_EXCEL getByValue(int value) { - for (MES_EXCEL excel : values()) { - if (excel.getValue() == value) { - return excel; - } - } - return null; - } - - 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 static String valueOfService(int val) { - String tmp = null; - for (int i = 0; i < values().length; i++) { - if (values()[i].value == val) { - tmp = values()[i].service; - } - } - return tmp; - } - - public int getValue() { - return value; - } - - public String getService() { - return service; - } - - public String getDescription() { - return description; - } - } - - - /** - * 工单类型 - */ - @JsonFormat( - shape = JsonFormat.Shape.OBJECT - ) - public static enum ORDER_TYPE { - SORT(10, "排序"), - UN_SORT(20, "非排序"), - BTO(30, "BTO"); - - private int value; - private String description; - - private ORDER_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 ORDER_TYPE_IDENTIFICATION { - S(10, "S"), - P(20, "P"), - N(30, "N"), - E(40, "E"); - - private int value; - private String description; - - private ORDER_TYPE_IDENTIFICATION(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 ORDER_STATUS { - CREATE(10, "未处理"), - RELEASE(20, "已发布"), - process(30, "在加工"), - CLOSE(40, "关闭"), - COMPLETE(50, "已完成"), - SHIPPING(60, "已发运"), - DISMANTLE(70, "已拆解"); - - private int value; - private String description; - - private 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 SHIPPING_ORDER_TYPE { - SORT_SHIPPING(10, "排序发运"); - - private int value; - private String description; - - private SHIPPING_ORDER_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 SHIPPING_ORDER_DETAIL_SHIPPING_STATUS { - PUBLISHED(10, "Published"), - SHIPPINGED(20, "Shippinged"); - - private int value; - private String description; - - private SHIPPING_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 EQUIPMENT_TYPE { - PHYSICAL(10, "物理设备"), - VIRTUAL(20, "虚拟设备"); - - private int value; - private String description; - - private EQUIPMENT_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 EQUIPMENT_VARIABLE_TYPE { - PRODUCTION_PARAM(10, "生产参数"), - PRODUCTION_PARAM_COMPLETED(20, "生产参数完成"); - - private int value; - private String description; - - private EQUIPMENT_VARIABLE_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 SECOND_CATEGORY { - SECOND_CATEGORY_10(10, "物理设备"), - SECOND_CATEGORY_20(20, "虚拟设备"); - - private int value; - private String description; - - private SECOND_CATEGORY(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 EQUIPMENT_CHECK_ORDER_TYPE { - PROCESS_PARAM_INSPECTION(10, "工艺参数点检"), - EQUIPMENT_INSPECTION(20, "设备点检"), - FIRST_INSPECTION(30, "首检"), - ERROR_PROOF_VERIFICATION(40, "防错验证"), - MOLD_INSPECTION(50, "模具点检"), - FIXTURE_INSPECTION(60, "工装点检"); - - private int value; - private String description; - - private EQUIPMENT_CHECK_ORDER_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 EQUIPMENT_CHECK_KEY_TYPES { - DEFAULT(10, "默认"), - KEY_FEATURES(20, "关键特性"), - ERROR_PROOF_VERIFICATION(30, "防错验证"); - - private int value; - private String description; - - private EQUIPMENT_CHECK_KEY_TYPES(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 EQUIPMENT_CHECK_INSPECTION_METHOD { - BEFORE_PROCESSING(10, "加工前"), - AFTER_PROCESSING(20, "加工后"), - ALL_INSPECTIONS(30, "全部点检"), - EQUIPMENT_NOTIFICATION(40, "设备告知"); - - private int value; - private String description; - - private EQUIPMENT_CHECK_INSPECTION_METHOD(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 EQUIPMENT_CHECK_INSPECTION_TRIGGER_METHOD { - EQUIPMENT_TRIGGERED(10, "设备触发"), - PROGRAM_TRIGGERED(20, "程序触发"), - TIME_TRIGGERED(30, "时间触发"); - - private int value; - private String description; - - private EQUIPMENT_CHECK_INSPECTION_TRIGGER_METHOD(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 EQUIPMENT_CHECK_INSPECTION_TRIGGER_CONFIG { - OPTION1(10, "选项1"), - OPTION2(20, "选项2"), - OPTION3(30, "选项3"), - OPTION4(40, "选项4"); - - private int value; - private String description; - - private EQUIPMENT_CHECK_INSPECTION_TRIGGER_CONFIG(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_GROUP_DATE_SOURCE { - CUSTOMER_SORT_INFO(10, "客户排序信息"); - - private int value; - private String description; - - private SHIPPING_GROUP_DATE_SOURCE(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_GROUP_TYPE { - SORT_SHIPPING_ORDERS(10, "排序发运单"), - UN_SORT_SHIPPING_ORDERS(20, "非排序发运单"); - - private int value; - private String description; - - private SHIPPING_GROUP_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 SHIPPING_GROUP_CONFIRM_PART_TYPE { - SCAN_PART_BARCODE(10, "扫零件条码"), - CUSTOMER_PART_BARCODE(20, "客户零件条码"); - - private int value; - private String description; - - private SHIPPING_GROUP_CONFIRM_PART_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 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 SHIPPING_GROUP_CUSTOMER_INFO_POINTS { - CUSTOMER_SORT_INSTRUCTION_TICKET(10, "客户排序指示票"), - PAINTING_OFFLINE_POINT(20, "涂装下线点"), - SYNC_INDICATOR_TICKET(30, "同步指示票"); - - private int value; - private String description; - - private SHIPPING_GROUP_CUSTOMER_INFO_POINTS(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_GROUP_SCAN_CONFIRM_SEQ_MODE { - DEFAULT_SORT(10, "默认排序"), - SCAN_POSITION_MATERIAL_RACK(20, "按料架位置扫描"); - - private int value; - private String description; - - private SHIPPING_GROUP_SCAN_CONFIRM_SEQ_MODE(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_GROUP_SCAN_METHOD_JUDGMENT { - PART_NO(10, "零件号"), - CUSTOMER_PART_NO(20, "客户零件号"); - - private int value; - private String description; - - private SHIPPING_GROUP_SCAN_METHOD_JUDGMENT(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_GROUP_ROUND_METHOD { - ADJUST_BY_WINDOW_TIME(10, "按窗口时间圆整"), - GENERATE_BY_ORDER(20, "按包装圆整"), - ROUND_ACCORDING_TO_PARTS(30, "按零件圆整"), - ROUND_ACCORDING_TO_ORDER(30, "按订单生成"), - ROUND_ACCORDING_TO_PACK_PARTS(30, "按包装零件切换圆整"), - CUST_ORDER_IMPORT(30, "客户订单导入专用"); - - private int value; - private String description; - - private SHIPPING_GROUP_ROUND_METHOD(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 PART_PULL_ROUND_METHOD { - ROUND_BY_QUANTITY(10, "按数量圆整"), - ROUND_VIRTUAL_PART_NUMBER(20, "按虚拟总成号圆整"), - ROUND_DOOR_PANELS_NUMBER(30, "按门板成套圆整"); - - private int value; - private String description; - - private PART_PULL_ROUND_METHOD(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 PART_PULL_ORDER_TYPE { - KITTING_PULL(10, "KITTING拉动"); - - private int value; - private String description; - - private PART_PULL_ORDER_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 PART_PULL_DETAIL_SEND_LIGHT_TYPE { - FLASHING_LIGHT(10, "闪烁灯"), - ALWAYS_LIGHT(20, "常亮灯"), - ALWAYS_LIGHT_DEDUCTION_FREQUENCY(30, "常亮灯逐次扣数"); - - private int value; - private String description; - - private PART_PULL_DETAIL_SEND_LIGHT_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 PART_PULL_DETAIL_SCAN_VALIDATION_TYPE { - VALIDATE(10, "验证"), - UN_VALIDATE(20, "不验证"); - - private int value; - private String description; - - private PART_PULL_DETAIL_SCAN_VALIDATION_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 PART_PULL_DETAIL_TIMELINESS_RULES { - LESS_MIN_TIME_DIFFERENCE_VALID(10, "小于最小时差有效"), - GREATER_MAX_TIME_DIFFERENCE_VALID(20, "大于最大时差有效"), - MAX_AND_MIN_TIME_DIFFERENCE_VALID(30, "最大最小时差间有效"); - - private int value; - private String description; - - private PART_PULL_DETAIL_TIMELINESS_RULES(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 PART_PULL_DETAIL_DATA_VALUE_SOURCE { - FROM_WORK_ORDER(10, "来源于工单"), - FROM_PART_PULL_DETAIL(20, "来源于拉动组明细"); - - private int value; - private String description; - - private PART_PULL_DETAIL_DATA_VALUE_SOURCE(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 PART_TYPE { - ASSEMBLY(10, "总成装配"), - FIRE_HANDLE(20, "火焰处理"), - HOT_PRESS(30, "热压"); - - private int value; - private String description; - - private PART_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; - } - } - - /** - * PTR零件维护-状态 - */ - @JsonFormat( - shape = JsonFormat.Shape.OBJECT - ) - public static enum PTR_PART_STATUS { - CREATE(10, "创建"), - CLOSE(20, "关闭"); - - private int value; - private String description; - - private PTR_PART_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; - } - } - - /** - * PTR零件维护-总成类型 - */ - @JsonFormat(shape = JsonFormat.Shape.OBJECT) - public static enum PTR_PART_TYPE { - CP(10, "CP"), - OHS(20, "OHS"), - DPFL(30, "DPFL"), - DPFR(40, "DPFR"), - DPRL(50, "DPRL"), - DPRR(60, "DPRR"); - - private int value; - private String description; - - private PTR_PART_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 PART_GROUP_PRODUCTION { - SORT_PRODUCTION(10, "排序生产"), - UN_SORT_PRODUCTION(20, "非排序生产"); - - private int value; - private String description; - - private PART_GROUP_PRODUCTION(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 PART_GROUP_SPLIT_ORDER_METHOD { - min_15(10, "15分钟"), - min_30(20, "30分钟"), - min_60(30, "60分钟"), - min_120(40, "120分钟"), - shift_code(50, "班次"), - copy(60, "复制"); - - private int value; - private String description; - - private PART_GROUP_SPLIT_ORDER_METHOD(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 PART_GROUP_DATA_SOURCE { - CUSTOMER_SORT_INFO(10, "客户排序信息"), - CUSTOMER_ORDER(20, "客户订单"); - - private int value; - private String description; - - private PART_GROUP_DATA_SOURCE(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 PART_GROUP_DETAIL_ROUND_METHOD { - ROUND_ON_TIME(10, "按时圆整"), - ROUND_ACCORD_PACK(10, "按包装圆整"), - ROUND_ACCORD_PART(10, "按零件圆整"); - - private int value; - private String description; - - private PART_GROUP_DETAIL_ROUND_METHOD(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 LINE_TYPE { - LINE_TYPE_10(10, "排序产线"), - LINE_TYPE_20(20, "非排序产线"); - private int value; - private String description; - - private LINE_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 GENERATE_STATUS { - GENERATE_STATUS_10(10, "已发布"), - GENERATE_STATUS_20(20, "正在加工"), - GENERATE_STATUS_30(30, "未处理"); - - private int value; - private String description; - - private GENERATE_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 CHECK_TYPE { - CHECK_TYPE_10(10, "无序"), - CHECK_TYPE_20(20, "柔性焊顺序"), - CHECK_TYPE_30(30, "零件号加工顺序"), - CHECK_TYPE_40(40, "工单顺序"); - - - private int value; - private String description; - - private CHECK_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 PUSH_TYPE { - PUSH_TYPE_10(10, "自动推送"), - PUSH_TYPE_20(20, "手动扫描"); - - - private int value; - private String description; - - private PUSH_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 SN_ENTER_TYPE { - SN_ENTER_TYPE_10(10, "扫描器带回车"), - SN_ENTER_TYPE_20(20, "条码带回车"), - SN_ENTER_TYPE_30(20, "条码自带回车"); - - - - private int value; - private String description; - - private SN_ENTER_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 DEFECT_CATEGORY { - POSITION(10, "位置"), - TYPE(20, "类型"), - RESPONSIBILITY(30, "责任"); - - private int value; - private String description; - - private DEFECT_CATEGORY(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_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_VEHICLES_ORDER_STATUS { - POSITION(10, "位置"), - TYPE(20, "类型"), - RESPONSIBILITY(30, "责任"); - - private int value; - private String description; - - private LOADING_VEHICLES_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_VEHICLES_ORDER_WEATHER_CONDITION { - SUNNY_WEATHER(10, "晴天"), - INDOOR_LOADING(20, "室内装车"), - RAIN(30, "雨天"), - SNOW(40, "下雪"); - - private int value; - private String description; - - private LOADING_VEHICLES_ORDER_WEATHER_CONDITION(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 MES_CUSTOMER_ROAD_TYPE { - - CUSTOMER_ROAD_TYPE(10, "客户道口"), - SHIPPING_ROAD_TYPE(20, "发运道口"); - private int value; - private String description; - - private MES_CUSTOMER_ROAD_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 MES_CAR_SERIES_LOOSE_PART_TYPE { - - ASSEMBLY_PART(10, "装配件"), - STANDARD_PART(20, "标配件"); - - private int value; - private String description; - - private MES_CAR_SERIES_LOOSE_PART_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 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; - } - } - - /** - * 设备加工参数维护-数据来源 - */ - @JsonFormat( - shape = JsonFormat.Shape.OBJECT - ) - public static enum DATA_SOURCE { - DATA_SOURCE10(10, "排序加工规则"), - DATA_SOURCE20(20, "非排序加工规则"), - DATA_SOURCE30(30, "腔组明细的ID"); - - private int value; - private String description; - - private DATA_SOURCE(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 REPORT_TYPE { - REPORT(10, "报工"), - WRITE_OFF(20, "冲销"); - - private int value; - private String description; - - private REPORT_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; - } - } - - public enum MES_PART_TYPE { - RAW_MATERIAL("10", "原材料"), - PARTIALLY_PREPARED_PRODUCTS("20", "半成品"), - FINISHED_PRODUCT("30", "成品"), - CONTAINER_PRODUCT("40", "容器"), - UTENSIL("50", "器具"), - WORKING_HOURS("60", "工时"); - private String value; - private String description; - - MES_PART_TYPE(String value, String description) { - this.value = value; - this.description = description; - } - - public String getValue() { - return value; - } - - public String getDescription() { - return description; - } - - public static String valueOfDescription(String val) { - String tmp = null; - for (int i = 0; i < values().length; i++) { - if (values()[i].value.equals(val)) { - tmp = values()[i].description; - } - } - return tmp; - } - - public static String descriptionOfValue(String val) { - String tmp = null; - for (int i = 0; i < values().length; i++) { - if (values()[i].description.equals(val)) { - tmp = values()[i].value; - } - } - return tmp; - } - } - - /** - * 设备加工参数维护-数据来源 - */ - @JsonFormat( - shape = JsonFormat.Shape.OBJECT - ) - public static enum SPOT_CHECK_ORDER_STATUS { - CREATE(10, "创建"), - COMPLETE(20, "完成"), - CLOSE(30, "关闭"); - - private int value; - private String description; - - private SPOT_CHECK_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 SPOT_CHECK_ORDER_TYPE { - PROCESS_PARAMETER_INSPECTION(1, "⼯艺参数点检"), - EQUIPMENT_INSPECTION(2, "设备点检"), - FIRST_PRODUCT_INSPECTION(3, "产品首检"), - ERROR_PROOF_VERIFICATION(4, "防错验证"), - MOLD_INSPECTION(5, "模具点检"), - ASSEMBLY_INSPECTION(6, "⼯装点检"), - SPECIAL_INSPECTION(7, "专检"); - - private int value; - private String description; - - private SPOT_CHECK_ORDER_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; - } - } - -}