| | |
| | | |
| | | public static final List<String> ModuleList = new ArrayList<>();//模组工位,用于校验是否传入模组码 |
| | | |
| | | public static final Map<String,String> materialMap = new HashMap();//人工工位 |
| | | public static final Map<String,String> materialMap = new HashMap();//物料集合 |
| | | |
| | | public static final Map<String,String> facMaterialMap = new HashMap();//生产物料转工厂物料请求工单 |
| | | |
| | | public static final Map<String,String> thoroughfareMap = new HashMap();//人工工位 |
| | | public static final String YES = "Y"; |
| | |
| | | public void run(ApplicationArguments args) throws Exception { |
| | | |
| | | //PLC到MES物料转换 |
| | | Constants.materialMap.put("1","9900200461");//微卡电驱动系统总成 |
| | | Constants.materialMap.put("2","9900207783");//微面电驱动系统总成 |
| | | Constants.materialMap.put("1","9900200461");//微卡电驱动系统总成(9999276636)//9900200461 |
| | | Constants.materialMap.put("2","9900207783");//微面电驱动系统总成(9999276639)//9900207783 |
| | | |
| | | Constants.materialMap.put("9900200461","9999276636");//生产物料转工厂物料请求工单 |
| | | Constants.materialMap.put("9900207783","9999276639");//生产物料转工厂物料请求工单 |
| | | |
| | | //通道 |
| | | Constants.thoroughfareMap.put(Constants.OP010,"JCDM035-1"); |
| | |
| | | OmProductionOrdeInfo lastOrder = omProductionOrdeInfoService.getLastOrder(); |
| | | |
| | | log.info("请求工厂MES工单:入参device{},materialCode:{}", device, materialCode); |
| | | String orderJsonString = RestfulService.getProductionWorkOrderRequest(lastOrder.getProductNum(), "OP010",materialCode); |
| | | String facMaterialCode = Constants.facMaterialMap.get(materialCode); |
| | | String orderJsonString = RestfulService.getProductionWorkOrderRequest(lastOrder.getProductNum(), "OP010",facMaterialCode); |
| | | log.info("请求工厂MES工单:出参pack:{}", orderJsonString); |
| | | |
| | | JSONObject jsonObject = new JSONObject(orderJsonString); |
| | |
| | | omProductionOrdeInfo.setWorkOrderNo(dataObject.getStr("productionOrderNum")); |
| | | omProductionOrdeInfo.setProductNum(dataObject.getStr("productNum")); |
| | | omProductionOrdeInfo.setStationCode(device); |
| | | omProductionOrdeInfo.setProductCode(dataObject.getStr("materialCode")); |
| | | omProductionOrdeInfo.setProductCode(materialCode); |
| | | omProductionOrdeInfo.setMaterialCode(dataObject.getStr("materialCode")); |
| | | omProductionOrdeInfo.setPlanQty(Long.valueOf(dataObject.getStr("plannedQuantity"))); |
| | | omProductionOrdeInfo.setOnlineCompletionMark("0"); |
| | | omProductionOrdeInfo.setSfResult("0"); |