admin
2024-07-05 20635fa3540068045b07471f08ab107b9d0f4281
jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java
@@ -309,21 +309,21 @@
                //给opc发21
                miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("MOZU1."+daParamCollection.getLocationCode()+".RecordDataDone").value(21).build());
                if(daParamCollection.getLocationCode().equals("OP240")){
                if(daParamCollection.getLocationCode().equals("M1OP100-1") || daParamCollection.getLocationCode().equals("M1OP100-2") ){
                    try{
                        CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> {
                            logger.info("OP230报工开始-工厂MES异步方法");
                            String reportResult = RestfulService.getWorkReportResultFeedback(daParamCollection.getProductBarcode(), "OP230", format.format(new Date()));
                            logger.info("OP100报工开始-工厂MES异步方法");
                            String reportResult = RestfulService.getWorkReportResultFeedback(daParamCollection.getProductBarcode(), daParamCollection.getLocationCode(), format.format(new Date()));
                            JSONObject jsonObject = new JSONObject(reportResult);
                            String code = jsonObject.getStr("code");
                            if("success".equals(code)){
                                //如果成功,执行报工成功方法,修改是否报工为1,添加报工时间
                                omProductionOrdeInfoService.updateOrderByProductNum("1",daParamCollection.getProductBarcode(),"OP230");
                                omProductionOrdeInfoService.updateOrderByProductNum("1",daParamCollection.getProductBarcode(),daParamCollection.getLocationCode());
                            }else{
                                //解析工厂mes返回结果,如果失败,执行报工失败方法,修改是否报工为2,添加报工时间
                                omProductionOrdeInfoService.updateOrderByProductNum("2",daParamCollection.getProductBarcode(),"OP230");
                                omProductionOrdeInfoService.updateOrderByProductNum("2",daParamCollection.getProductBarcode(),daParamCollection.getLocationCode());
                            }
                            logger.info("OP230报工结束-工厂MES异步方法{}"+reportResult);
                            logger.info("OP100报工结束-工厂MES异步方法{}"+reportResult);
                        });
                    }catch (Exception e){
                        System.out.println(e.getMessage());
@@ -592,7 +592,7 @@
            try{
                CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> {
                    logger.info("开始执行异步方法");
                    HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute();
                    HttpResponse execute = HttpRequest.post(Constants.FACTORY_EMS_UAT_RUL+"deviceResultFeedback").body(JSONUtil.toJsonStr(parentVO)).execute();
                    logger.info("异步方法执行结束");
                    logger.info("手动工位传工厂MES异步方法{}"+execute.body());
@@ -622,8 +622,8 @@
    public void automaticWorkstationPushGeelycvMesFeedback(String packID, String stationCode,List<DaParamCollection> paramList) {
        logger.info("进入工位{}-工厂MES推送数据方法automaticWorkstationPushGeelycvMesFeedback",stationCode);
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//        String url = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback";
        String url = "https://imes-group.geelycv.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback";
        String url = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback";
//        String url = "https://imes-group.geelycv.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback";
        String totalResult = "0";
        if(paramList.size() > 0){
            logger.info("进入工位{}-拼数据",stationCode);
@@ -679,7 +679,7 @@
            try{
                CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> {
                    logger.info("开始执行异步方法");
                    HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute();
                    HttpResponse execute = HttpRequest.post(Constants.FACTORY_EMS_UAT_RUL+"deviceResultFeedback").body(JSONUtil.toJsonStr(parentVO)).execute();
                    System.out.println(execute.body());
                    logger.info("异步方法执行结束");
                    logger.info("自动工位传工厂MES异步方法{}"+execute.body());