cl
2024-07-15 aa5f09da9849ea4465b2e9e50a4c9df7b85f7948
修改参数采集
已修改2个文件
51 ■■■■ 文件已修改
jcdm-main/src/main/java/com/jcdm/main/constant/Constants.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/constant/Constants.java
@@ -59,10 +59,10 @@
    public static final Integer INT_THREE= 3;
    public static final Integer INT_FOUR= 4;
    public static final Integer INT_ZERO= 0;
//    public static final String FACTORY_EMS_UAT_GET_RUL = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/aMesSysIntegration/";
//    public static final String FACTORY_EMS_UAT_POST_RUL = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/interface/";
    public static final String FACTORY_EMS_UAT_GET_RUL = "https://imes-group.geelycv.com/api/mom-open/restful/aMesSysIntegration/";
    public static final String FACTORY_EMS_UAT_POST_RUL = "https://imes-group.geelycv.com/api/mom-open/restful/interface/";
    public static final String FACTORY_EMS_UAT_GET_RUL = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/aMesSysIntegration/";
    public static final String FACTORY_EMS_UAT_POST_RUL = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/interface/";
/*    public static final String FACTORY_EMS_UAT_GET_RUL = "https://imes-group.geelycv.com/api/mom-open/restful/aMesSysIntegration/";
    public static final String FACTORY_EMS_UAT_POST_RUL = "https://imes-group.geelycv.com/api/mom-open/restful/interface/";*/
    public static final String FACTORY_EMS_SITE_CODE = "3983";
jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java
@@ -289,11 +289,11 @@
                omProductionOrdeInfo.setWorkOrderNo(dataObject.getStr("productionOrderNum"));
                omProductionOrdeInfo.setProductNum(dataObject.getStr("productNum"));
                omProductionOrdeInfo.setStationCode(dataObject.getStr("stationCode"));
                omProductionOrdeInfo.setMaterialCode(dataObject.getStr("materialCode"));
                omProductionOrdeInfo.setProductCode(dataObject.getStr("materialCode"));
                omProductionOrdeInfo.setPlanQty(Long.valueOf(dataObject.getStr("plannedQuantity")));
                omProductionOrdeInfo.setOnlineCompletionMark("0");
                omProductionOrdeInfo.setSfResult("0");
                omProductionOrdeInfo.setProductCode(dataObject.getStr("model"));
                omProductionOrdeInfo.setProductModel(dataObject.getStr("model"));
                omProductionOrdeInfo.setCreateTime(new Date());
                omProductionOrdeInfo.setCreateUser("工厂MES");
                omProductionOrdeInfoService.save(omProductionOrdeInfo);
@@ -483,6 +483,8 @@
                        paramValue = readWriteEntityList.get(i).getValue().toString();//参数值
                        if("DATE".equals(list.get(i).getCollectParameterType()) && !paramValue.isEmpty()){
                            paramValue = format.parse(TimeUtil.test(TimeUtil.stringProcessing(paramValue))).toString();
                        }else if("MODEL".equals(list.get(i).getCollectParameterType()) && !paramValue.isEmpty()){
                            paramValue = Constants.materialMap.get(paramValue);
                        }
                    }
                    daParamCollection.setParamValue(paramValue);//参数值
@@ -921,12 +923,45 @@
            HttpRequest httpRequest = HttpRequest.get(url);
            result =  response.body();
        }catch (Exception e){
            e.printStackTrace();
            throw new RuntimeException(e);
        }finally {
            return result;
        }
    }
    /**
     * 获取采集参数基础数据
     * @param productCode
     * @param stationCode
     * @return list
     */
    public List<ChildVO> getCollectParamBasicData(String productCode , String stationCode) {
        List<ChildVO> basicList = new ArrayList<>();
        try {
            //查询参数配置表
            List<DaCollectionParamConf> list = collectionParamConfService.list(new LambdaQueryWrapper<DaCollectionParamConf>()
                    .eq(DaCollectionParamConf::getProcessesCode, stationCode)//工位
                    .eq(DaCollectionParamConf::getCollectParameterType, "BASIC")//采集参数类型
            );
            if (CollUtil.isNotEmpty(list)){
                for(DaCollectionParamConf conf:list){
                    ChildVO childVO = new ChildVO();
                    childVO.setItemCode(conf.getCollectParameterId());//参数
                    childVO.setItemType(conf.getItemType());
                    childVO.setItemValue(conf.getParamCentral());//参数值
                    childVO.setItemText(conf.getCollectParameterName());
                    childVO.setCheckResult("1");
                    childVO.setCheckTime(format.format(new Date()));
                    basicList.add(childVO);
                }
            }
            return basicList;
        }catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}