| | |
| | | daParamCollectionTempService.insertBatch(saveParamListTemp); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void pushStartStopTime(String paramCode, String paramName, String productNum) { |
| | | ParentVO parentVO = new ParentVO(); |
| | | parentVO.setSiteCode("3983"); |
| | | parentVO.setRecordId(String.valueOf(Instant.now().toEpochMilli())); |
| | | parentVO.setStationCode("OP165"); |
| | | parentVO.setProductNum(productNum); |
| | | parentVO.setTotalResult("1"); |
| | | List<ChildVO> listChildVo = new ArrayList<>(); |
| | | ChildVO childVO = new ChildVO(); |
| | | childVO.setItemCode(paramCode); |
| | | childVO.setItemType("3"); |
| | | childVO.setItemText(paramName); |
| | | childVO.setItemValue(format.format(new Date())); |
| | | childVO.setCheckResult("1"); |
| | | childVO.setCheckTime(format.format(new Date())); |
| | | listChildVo.add(childVO); |
| | | parentVO.setCheckList(listChildVo); |
| | | try{ |
| | | CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> { |
| | | HttpResponse execute = HttpRequest.post(Constants.FACTORY_EMS_UAT_GET_RUL+"deviceResultFeedback").body(JSONUtil.toJsonStr(parentVO)).execute(); |
| | | System.out.println(execute.body()); |
| | | }); |
| | | }catch (Exception e){ |
| | | System.out.println(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void insertBatch(List<DaParamCollection> confList){ |
| | | try{ |
| | |
| | | for (DaParamCollectionTemp daParamCollection : paramList) { |
| | | ChildVO childVO = new ChildVO(); |
| | | childVO.setItemCode(daParamCollection.getParamCode()); |
| | | // BsFormulaChildInfo childOne = bsFormulaChildInfoService.getOne(new LambdaQueryWrapper<BsFormulaChildInfo>().eq(BsFormulaChildInfo::getParamCode, daParamCollection.getParamCode())); |
| | | // 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::getProcessesCode,stationCode)); |
| | | DaCollectionParamConf paramConfOne = paramConfOneList.get(0); |
| | | // if(childOne!=null){ |
| | | // String operationType = childOne.getOperationType(); |
| | | // if(operationType.equals("1")){ |
| | | // childVO.setItemType("2"); |
| | | // }else if(operationType.equals("2")){ |
| | | // childVO.setItemType("1"); |
| | | // } |
| | | // }else { |
| | | // childVO.setItemType("3"); |
| | | // } |
| | | if(paramConfOne!=null){ |
| | | childVO.setItemType(paramConfOne.getItemType()); |
| | | childVO.setItemText(paramConfOne.getCollectParameterName()); |
| | | }else { |
| | | childVO.setItemType("3"); |
| | | childVO.setItemText(""); |
| | | } |
| | | childVO.setItemValue(daParamCollection.getParamValue()); |
| | | if(!paramConfOneList.isEmpty()){ |
| | | if(paramConfOne!=null){ |
| | | childVO.setItemType(paramConfOne.getItemType()); |
| | | 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"); |
| | | 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); |
| | | } |
| | | childVO.setCheckTime(format.format(daParamCollection.getCollectionTime())); |
| | | listChildVo.add(childVO); |
| | | |
| | | } |
| | | parentVO.setCheckList(listChildVo); |
| | | try{ |
| | |
| | | @Override |
| | | public void manualWorkstationsAddBasicParameters(DaParamCollection daParamCollection) { |
| | | // 假设这是从数据库或其他地方获取的参数数据 |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("GC", "南浔工厂"); |
| | | map.put("CXBH", "Pack线"); |
| | | map.put("SBBH", "设备001"); |
| | | map.put("YGBH", SecurityUtils.getUsername()); |
| | | map.put("GDBH", daParamCollection.getWorkOrderNo()); |
| | | map.put("CPXH", daParamCollection.getProductCode()); |
| | | map.put("INT", format.format(daParamCollection.getInboundTime())); |
| | | map.put("OUTT",format.format(new Date())); |
| | | |
| | | map.forEach((key, value) -> { |
| | | DaCollectionParamConf daCollectionParamConf = new DaCollectionParamConf(); |
| | | daCollectionParamConf.setProcessesCode(daParamCollection.getLocationCode()); |
| | | daCollectionParamConf.setCollectParameterId(key); |
| | | List<DaCollectionParamConf> daCollectionParamConfs = daCollectionParamConfMapper.selectDaCollectionParamConfList(daCollectionParamConf); |
| | | DaParamCollection saveData = new DaParamCollection(); |
| | | saveData.setWorkOrderNo(daParamCollection.getWorkOrderNo()); |
| | | saveData.setProductCode(daParamCollection.getProductCode()); |
| | | saveData.setLocationCode(daParamCollection.getLocationCode()); |
| | | saveData.setSfcCode(daParamCollection.getProductBarcode()); |
| | | saveData.setParamCode(daCollectionParamConfs.get(0).getCollectParameterId()); |
| | | saveData.setParamName(daCollectionParamConfs.get(0).getCollectParameterName()); |
| | | saveData.setCollectionTime(new Date()); |
| | | saveData.setParamValue(value); |
| | | daParamCollectionMapper.insertDaParamCollection(saveData); |
| | | }); |
| | | // Map<String, String> map = new HashMap<>(); |
| | | // map.put("GC", "南浔工厂"); |
| | | // map.put("CXBH", "Pack线"); |
| | | // map.put("SBBH", "设备001"); |
| | | // map.put("YGBH", SecurityUtils.getUsername()); |
| | | // map.put("GDBH", daParamCollection.getWorkOrderNo()); |
| | | // map.put("CPXH", daParamCollection.getProductCode()); |
| | | // map.put("INT", format.format(daParamCollection.getInboundTime())); |
| | | // map.put("OUTT",format.format(new Date())); |
| | | // |
| | | // map.forEach((key, value) -> { |
| | | // DaCollectionParamConf daCollectionParamConf = new DaCollectionParamConf(); |
| | | // daCollectionParamConf.setProcessesCode(daParamCollection.getLocationCode()); |
| | | // daCollectionParamConf.setCollectParameterId(key); |
| | | // List<DaCollectionParamConf> daCollectionParamConfs = daCollectionParamConfMapper.selectDaCollectionParamConfList(daCollectionParamConf); |
| | | // DaParamCollection saveData = new DaParamCollection(); |
| | | // saveData.setWorkOrderNo(daParamCollection.getWorkOrderNo()); |
| | | // saveData.setProductCode(daParamCollection.getProductCode()); |
| | | // saveData.setLocationCode(daParamCollection.getLocationCode()); |
| | | // saveData.setSfcCode(daParamCollection.getProductBarcode()); |
| | | // if(daCollectionParamConfs.isEmpty()){ |
| | | // saveData.setParamCode(daCollectionParamConfs.get(0).getCollectParameterId()); |
| | | // saveData.setParamName(daCollectionParamConfs.get(0).getCollectParameterName()); |
| | | // } |
| | | // saveData.setCollectionTime(new Date()); |
| | | // saveData.setParamValue(value); |
| | | // daParamCollectionMapper.insertDaParamCollection(saveData); |
| | | // }); |
| | | } |
| | | |
| | | @Override |