| | |
| | | package org.jeecg.modules.mes.job; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.modules.lsw.service.ILswMaterialService; |
| | | import org.jeecg.modules.mdc.util.DateUtils; |
| | | import org.jeecg.modules.mdc.util.ThrowableUtil; |
| | |
| | | @Value("${xhj.orderStatus:REL}") |
| | | private String ORDER_STATUS; |
| | | |
| | | /** |
| | | * 请求成功编码 |
| | | */ |
| | | private static final String SUCCESS_CODE = "S"; |
| | | |
| | | @Autowired |
| | | private ProductionOrderSync productionOrderSync; |
| | | @Autowired |
| | |
| | | try { |
| | | //调用SAP接口获取生产订单 |
| | | Map<String, Object> productionOrderMap = productionOrderSync.syncProductionOrder(request); |
| | | if (productionOrderMap == null || !SUCCESS_CODE.equals(productionOrderMap.get("ztype"))) { |
| | | if (productionOrderMap == null || !CommonConstant.SAP_SUCCESS_CODE.equals(productionOrderMap.get("ztype"))) { |
| | | log.error("未同步到订单信息!日期:{}", LocalDateTime.now()); |
| | | return; |
| | | } |
| | |
| | | String orderCodes = String.join(",", orderMap.keySet()); |
| | | //订单BOM同步 |
| | | Map<String, Object> orderBomMap = orderBomSync.syncOrderBom(FACTORY_CODE, orderCodes); |
| | | if (orderBomMap == null || !SUCCESS_CODE.equals(orderBomMap.get("ztype"))) { |
| | | if (orderBomMap == null || !CommonConstant.SAP_SUCCESS_CODE.equals(orderBomMap.get("ztype"))) { |
| | | log.error("未同步到订单BOM信息!日期:{}", LocalDateTime.now()); |
| | | return; |
| | | } |
| | |
| | | } |
| | | //订单工序同步 |
| | | Map<String, Object> orderProcessMap = orderProcessSync.syncOrderProcess(FACTORY_CODE, orderCodes); |
| | | if (orderBomMap == null || !SUCCESS_CODE.equals(orderProcessMap.get("ztype"))) { |
| | | if (orderBomMap == null || !CommonConstant.SAP_SUCCESS_CODE.equals(orderProcessMap.get("ztype"))) { |
| | | log.error("未同步到订单工序信息!日期:{}", LocalDateTime.now()); |
| | | return; |
| | | } |