admin
2025-02-19 48c7ffb6e7137b4b62bfdc63be8aa72d085ba40e
-换型bug修改
已修改2个文件
94 ■■■■■ 文件已修改
jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java
@@ -309,6 +309,7 @@
        updateWrapper.set(BsFormulaChildInfo::getResults, result);
        updateWrapper.eq(BsFormulaChildInfo::getProcessesCode, bsFormulaChildInfo.getLocationCode());
        updateWrapper.eq(BsFormulaChildInfo::getParamCode, bsFormulaChildInfo.getParamCode());
        updateWrapper.eq(BsFormulaChildInfo::getProductCode, bsFormulaChildInfo.getProductCode());
        boolean update = bsFormulaChildInfoService.update(new BsFormulaChildInfo(), updateWrapper);
        return AjaxResult.success(update);
    }
@@ -367,7 +368,8 @@
    @Override
    public AjaxResult jrmWorkpieceRelease(BsFormulaChildInfo bsFormulaChildInfo) {
        this.clearCollectDataAndResultsByProcessesCode(bsFormulaChildInfo);
        daParamCollectionService.pushGeelycvMesFeedback(bsFormulaChildInfo.getProductBarcode(), bsFormulaChildInfo.getLocationCode());
//        daParamCollectionService.pushGeelycvMesFeedback(bsFormulaChildInfo.getProductBarcode(), bsFormulaChildInfo.getLocationCode());
        daParamCollectionService.jrmPushGeelycvMesFeedback(bsFormulaChildInfo.getProductBarcode(), bsFormulaChildInfo.getLocationCode(), bsFormulaChildInfo.getProductCode());
        return AjaxResult.success();
    }
@@ -382,6 +384,7 @@
        String result = "1";
        BsFormulaChildInfo getMaterTwo = new BsFormulaChildInfo();
        getMaterTwo.setProcessesCode(bsFormulaChildInfo.getLocationCode());
        getMaterTwo.setProductCode(bsFormulaChildInfo.getProductCode());
        getMaterTwo.setOperationType("2");
        List<BsFormulaChildInfo> operationType = bsFormulaChildInfoMapper.selectBsFormulaChildInfoList(getMaterTwo);
        List<String> collect = operationType.stream().map(BsFormulaChildInfo::getResults).collect(Collectors.toList());
@@ -519,7 +522,12 @@
    public AjaxResult workpieceRelease(BsFormulaChildInfo bsFormulaChildInfo) {
        this.clearCollectDataAndResultsByProcessesCode(bsFormulaChildInfo);
        try {
            daParamCollectionService.pushGeelycvMesFeedback(bsFormulaChildInfo.getProductBarcode(), bsFormulaChildInfo.getLocationCode());
            String locationCode = bsFormulaChildInfo.getLocationCode();
            if(locationCode.equals("POP301")||locationCode.equals("PPOP241")||locationCode.equals("PPOP242")){
                daParamCollectionService.jrmPushGeelycvMesFeedback(bsFormulaChildInfo.getProductBarcode(), bsFormulaChildInfo.getLocationCode(),bsFormulaChildInfo.getProductCode());
            }else {
                daParamCollectionService.pushGeelycvMesFeedback(bsFormulaChildInfo.getProductBarcode(), bsFormulaChildInfo.getLocationCode());
            }
        }catch (Exception e){
        }
        return AjaxResult.success();
@@ -530,6 +538,7 @@
        Boolean b = true;
        BsFormulaChildInfo getMaterTwo = new BsFormulaChildInfo();
        getMaterTwo.setProcessesCode(bsFormulaChildInfo.getLocationCode());
        getMaterTwo.setProductCode(bsFormulaChildInfo.getProductCode());
        getMaterTwo.setOperationType("2");
        List<BsFormulaChildInfo> operationType = bsFormulaChildInfoMapper.selectBsFormulaChildInfoList(getMaterTwo);
        List<String> collect = operationType.stream().map(BsFormulaChildInfo::getResults).collect(Collectors.toList());
jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java
@@ -527,12 +527,16 @@
            parentVO.setTotalResult("1");
            List<ChildVO> listChildVo = new ArrayList<>();
            String productModel = "PE01B";
            OmProductionOrdeInfo orderOne = omProductionOrdeInfoService.getOne(new LambdaQueryWrapper<OmProductionOrdeInfo>().eq(OmProductionOrdeInfo::getProductNum, packID));
            productModel = orderOne.getProductCode();
            for (DaParamCollectionTemp daParamCollection : paramList) {
                ChildVO childVO = new ChildVO();
                childVO.setItemCode(daParamCollection.getParamCode());
                List<DaCollectionParamConf> paramConfOneList = daCollectionParamConfService.list(new LambdaQueryWrapper<DaCollectionParamConf>()
                        .eq(DaCollectionParamConf::getCollectParameterId, daParamCollection.getParamCode())
                        .eq(DaCollectionParamConf::getProductModel, "PE01B")
                        .eq(DaCollectionParamConf::getProductModel, productModel)
                );
                DaCollectionParamConf paramConfOne = paramConfOneList.get(0);
                if(paramConfOne!=null){
@@ -597,6 +601,10 @@
            parentVO.setTotalResult("1");
            List<ChildVO> listChildVo = new ArrayList<>();
            String productModel = "PE01B";
            OmProductionOrdeInfo orderOne = omProductionOrdeInfoService.getOne(new LambdaQueryWrapper<OmProductionOrdeInfo>().eq(OmProductionOrdeInfo::getProductNum, packID));
            productModel = orderOne.getProductCode();
            for (DaParamCollection daParamCollection : paramList) {
                ChildVO childVO = new ChildVO();
                childVO.setItemCode(daParamCollection.getParamCode());
@@ -604,7 +612,7 @@
//                DaCollectionParamConf paramConfOne = daCollectionParamConfService.getOne(new LambdaQueryWrapper<DaCollectionParamConf>().eq(DaCollectionParamConf::getCollectParameterId, daParamCollection.getParamCode()));
                List<DaCollectionParamConf> paramConfOneList = daCollectionParamConfService.list(new LambdaQueryWrapper<DaCollectionParamConf>()
                        .eq(DaCollectionParamConf::getCollectParameterId, daParamCollection.getParamCode())
                        .eq(DaCollectionParamConf::getProductModel, "PE01B")
                        .eq(DaCollectionParamConf::getProductModel, productModel)
                );
                DaCollectionParamConf paramConfOne = paramConfOneList.get(0);
                if(paramConfOne!=null){
@@ -892,6 +900,75 @@
        }
    }
    @Override
    public void jrmPushGeelycvMesFeedback(String packID, String stationCode, String productCode) {
        logger.info("进入人工工位推送工厂MES数据方法-pushGeelycvMesFeedback-工位{}-pack码{}",stationCode,packID);
        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 totalResult = "0";
        List<DaParamCollectionTemp> paramList = daParamCollectionTempService.list(new LambdaQueryWrapper<DaParamCollectionTemp>().eq(DaParamCollectionTemp::getSfcCode, packID).eq(DaParamCollectionTemp::getLocationCode, stationCode));
        if(paramList.size() > 0){
            ParentVO parentVO = new ParentVO();
            parentVO.setSiteCode("3983");
            parentVO.setRecordId(String.valueOf(Instant.now().toEpochMilli()));
            parentVO.setStationCode(stationCode);
            parentVO.setProductNum(packID);
            parentVO.setTotalResult("1");
            List<ChildVO> listChildVo = new ArrayList<>();
            for (DaParamCollectionTemp daParamCollection : paramList) {
                ChildVO childVO = new ChildVO();
                childVO.setItemCode(daParamCollection.getParamCode());
                List<DaCollectionParamConf> paramConfOneList = daCollectionParamConfService.list(new LambdaQueryWrapper<DaCollectionParamConf>()
                        .eq(DaCollectionParamConf::getCollectParameterId, daParamCollection.getParamCode())
                        .eq(DaCollectionParamConf::getProductModel, productCode)
                );
                DaCollectionParamConf paramConfOne = paramConfOneList.get(0);
                if(paramConfOne!=null){
                    childVO.setItemType(paramConfOne.getSpareField1());
                    childVO.setItemText(paramConfOne.getCollectParameterName());
                }else {
                    childVO.setItemType("3");
                    childVO.setItemText("");
                }
                childVO.setItemValue(daParamCollection.getParamValue());
                if(daParamCollection.getParamValue().equals("1")){
                    childVO.setCheckResult("1");
                }else if(daParamCollection.getParamValue().equals("2")){
                    childVO.setCheckResult("0");
                    parentVO.setTotalResult("0");
                    totalResult = "1";
                }else {
                    childVO.setCheckResult("1");
                }
                childVO.setCheckTime(format.format(daParamCollection.getCollectionTime()));
                listChildVo.add(childVO);
            }
            parentVO.setCheckList(listChildVo);
            try{
                CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> {
                    logger.info("工位{}---开始执行异步方法---pack码是{}"+stationCode,packID);
                    HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute();
                    logger.info("工位{}---异步方法执行结束---pack码是{}"+stationCode,packID);
                    logger.info("手动工位{}传工厂入参VO{}---pack码是{}" + stationCode,new Gson().toJson(parentVO),packID);
                    logger.info("手动工位{}传工厂MES异步方法{}---pack码是{}"+stationCode,execute.body(),packID);
                    DaParamCollectionTemp daParamCollectionTemp = new DaParamCollectionTemp();
                    daParamCollectionTemp.setSfcCode(packID);
                    daParamCollectionTemp.setLocationCode(stationCode);
                    int i = daParamCollectionTempService.deleteDaParamCollectionTempBySfcCodeAndLocationCode(daParamCollectionTemp);
                    logger.info("删除临时表数据条数{}-工位{}-pack码{}",i,stationCode,packID);
                });
            }catch (Exception e){
                System.out.println(e.getMessage());
            }
            logger.info("结束人工工位推送工厂MES数据方法-pushGeelycvMesFeedback-工位{}-pack码{}",stationCode,packID);
        }
    }
    public static String getRandomNumberBetween(double min, double max) {
        return String.format("%.1f",min + (Math.random() * (max - min)));
    }