cl
2024-07-12 997e697edaf59893248bc2467223058b221a4de2
jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java
@@ -123,7 +123,7 @@
                        if (ObjectUtil.isNotNull(value1)){
                            String cellCode = value1.toString();
                            //反馈电芯ocv检测结果
                            boolean b = OCVResultFeedBack(thoroughfare, device,cellCode);
                            boolean b = OCVResultFeedBack(thoroughfare, device,cellCode);//对替换电芯校验
                            //四个电芯的状态
                            if (b){
                                scanResult = 11;
@@ -146,7 +146,7 @@
                    //1:告知MES托盘已到站,请求下发进站状态
                    if (Constants.OP030.equals(device)){
                        //反馈电芯ocv检测结果
                        boolean b = OCVResultFeedBack(thoroughfare, device);
                        boolean b = OCVResultFeedBack(thoroughfare, device);//进站对4个电芯校验
                        //四个电芯的状态
                        if (b){
                            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(11).build());
@@ -504,13 +504,19 @@
                CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> {
                    //插入参数采集表
                    daParamCollectionService.insertBatch(collectionList);
                    //如果220工位,进行报工
                    if("M1OP220".equals(device)) {
                        RestfulService.getWorkReportResultFeedback(moduleCode, "M1OP220", format.format(new Date()));
                    }
                    //上传到工厂mes
                    ParentVO parentVO = new ParentVO();
                    parentVO.setStationCode(device);//工位
                    parentVO.setSiteCode("3983");
                    parentVO.setRecordId(UUID.randomUUID().toString());
                    if("2".equals(stationStatus)){
                    if("2".equals(stationStatus)){//工站状态
                        parentVO.setTotalResult("0");
                    }else {
                        parentVO.setTotalResult("1");
@@ -898,5 +904,29 @@
        return flag;
    }
    /**
     * AMES报工结果回传
     * @param productNum
     * @param stationCode
     * @param confirmTime
     * @return
     */
    //{"code":"success","data":{"productNum":"LCV123456P0600036","stationCode":"1HZ01","resultCode":"S","resultText":"报工成功"},"message":"API调用成功"}
    public static String getWorkReportResultFeedback(String productNum,String stationCode,String confirmTime)
    {
        String result = "";
        try {
            String url = Constants.FACTORY_EMS_UAT_GET_RUL + "workReportResultFeedback?siteCode="+Constants.FACTORY_EMS_SITE_CODE+"&stationCode="+stationCode+"&productNum="+productNum+"&confirmTime="+confirmTime;
            HttpResponse response = HttpRequest.get(url).execute();
            HttpRequest httpRequest = HttpRequest.get(url);
            result =  response.body();
        }catch (Exception e){
            e.printStackTrace();
        }finally {
            return result;
        }
    }
}