cl
2024-09-06 e0391b17f64e4c79f7b1d4ffa2963772c2ebed52
添加报工失败二次报工
已修改2个文件
12 ■■■■ 文件已修改
jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java
@@ -321,7 +321,8 @@
                        CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> {
                            logger.info("OP100报工开始-工厂MES异步方法");
                            String stationCode = "M1P100";//因为上层系统只支持6位,所有报工工位为M1P100
                            String reportResult = RestfulService.getWorkReportResultFeedback(daParamCollection.getProductBarcode(), stationCode, format.format(new Date()));
                            //String reportResult = RestfulService.getWorkReportResultFeedback(daParamCollection.getProductBarcode(), stationCode, format.format(new Date()));
                            String reportResult = OPCUaSubscription.getWorkReportResultFeedback(daParamCollection.getProductBarcode(), stationCode, format.format(new Date()));
                            JSONObject jsonObject = new JSONObject(reportResult);
                            String code = jsonObject.getStr("code");
                            if("success".equals(code)){
jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java
@@ -1056,14 +1056,21 @@
    public static String getWorkReportResultFeedback(String productNum,String stationCode,String confirmTime)
    {
        String result = "";
        String url = Constants.FACTORY_EMS_UAT_GET_RUL + "workReportResultFeedback?siteCode="+Constants.FACTORY_EMS_SITE_CODE+"&stationCode="+stationCode+"&productNum="+productNum+"&confirmTime="+confirmTime;
        try {
            String url = Constants.FACTORY_EMS_UAT_GET_RUL + "workReportResultFeedback?siteCode="+Constants.FACTORY_EMS_SITE_CODE+"&stationCode="+stationCode+"&productNum="+productNum+"&confirmTime="+confirmTime;
            log.info("执行工厂MES报工方法start,序列号{}工位号{}url{}",productNum,stationCode ,url);
            HttpResponse response = HttpRequest.get(url).execute();
            //HttpRequest httpRequest = HttpRequest.get(url);
            result =  response.body();
            log.info("执行工厂MES报工方法第一次end,序列号{}工位号{}返回数据{}",productNum,stationCode ,result);
        }catch (Exception e){
            throw new RuntimeException(e);
        }finally {
            if(result.isEmpty()){
                HttpResponse response = HttpRequest.get(url).execute();
                result =  response.body();
                log.info("执行工厂MES报工方法第二次end,序列号{}工位号{}返回数据{}",productNum,stationCode ,result);
            }
            return result;
        }
    }