| | |
| | | } |
| | | String balanceSplit = ""; |
| | | String boxCodeSplit = ""; |
| | | ArrayList<String> xtList = ListUtil.toList(boxCode.split(";")); |
| | | ArrayList<String> czList = ListUtil.toList(balanceCode.split(";")); |
| | | if (CollUtil.isNotEmpty(xtList) && xtList.size()>1 && |
| | | CollUtil.isNotEmpty(czList) && czList.size()>3){ |
| | | boxCodeSplit = xtList.get(1); |
| | | balanceSplit = czList.get(2); |
| | | } |
| | | DaTileMatchRules daTileMatchRules = new DaTileMatchRules(); |
| | | daTileMatchRules.setScanObject1("箱体"); |
| | | daTileMatchRules.setScanObject2("平衡轴"); |
| | | daTileMatchRules.setProductSeries(productType); |
| | | List<DaTileMatchRules> allMatchRuleList = daTileMatchRulesService.selectDaTileMatchRulesList(daTileMatchRules); |
| | | if (CollUtil.isNotEmpty(allMatchRuleList)){ |
| | | char[] boxCodeCharArray = boxCodeSplit.toCharArray(); |
| | | char[] balanceCodeCharArray = balanceSplit.toCharArray(); |
| | | if (boxCodeCharArray.length>6 && balanceCodeCharArray.length>2){ |
| | | if ("380".equals(productType)){ |
| | | for (int i = 1; i < 3; i++) { |
| | | int finalI = i; |
| | | List<DaTileMatchRules> collect = allMatchRuleList.stream().filter(x -> x.getAxisParameterNoPosition().equals(finalI + 5) && |
| | | x.getNeckParameterPosition().equals(finalI + 1) && |
| | | x.getAxisValue().equals(String.valueOf(boxCodeCharArray[finalI + 4])) && |
| | | x.getNeckValue().equals(String.valueOf(balanceCodeCharArray[finalI]))) |
| | | .collect(Collectors.toList()); |
| | | if (CollUtil.isNotEmpty(collect)){ |
| | | DaTileMatchRules rules = collect.get(0); |
| | | resultList.add(rules); |
| | | if ("380".equals(productType)){ |
| | | // ArrayList<String> xtList = ListUtil.toList(boxCode.split(";")); |
| | | ArrayList<String> xtList = ListUtil.toList(boxCode.split(",")); |
| | | ArrayList<String> czList = ListUtil.toList(balanceCode.split(";")); |
| | | if (CollUtil.isNotEmpty(xtList) && xtList.size()>1 && |
| | | CollUtil.isNotEmpty(czList) && czList.size()>3){ |
| | | boxCodeSplit = xtList.get(1); |
| | | balanceSplit = czList.get(2); |
| | | } |
| | | DaTileMatchRules daTileMatchRules = new DaTileMatchRules(); |
| | | daTileMatchRules.setScanObject1("箱体"); |
| | | daTileMatchRules.setScanObject2("平衡轴"); |
| | | daTileMatchRules.setProductSeries(productType); |
| | | List<DaTileMatchRules> allMatchRuleList = daTileMatchRulesService.selectDaTileMatchRulesList(daTileMatchRules); |
| | | if (CollUtil.isNotEmpty(allMatchRuleList)){ |
| | | char[] boxCodeCharArray = boxCodeSplit.toCharArray(); |
| | | char[] balanceCodeCharArray = balanceSplit.toCharArray(); |
| | | if (boxCodeCharArray.length>6 && balanceCodeCharArray.length>2){ |
| | | if ("380".equals(productType)){ |
| | | for (int i = 1; i < 3; i++) { |
| | | int finalI = i; |
| | | List<DaTileMatchRules> collect = allMatchRuleList.stream().filter(x -> x.getAxisParameterNoPosition().equals(finalI + 5) && |
| | | x.getNeckParameterPosition().equals(finalI + 1) && |
| | | x.getAxisValue().equals(String.valueOf(boxCodeCharArray[finalI + 4])) && |
| | | x.getNeckValue().equals(String.valueOf(balanceCodeCharArray[finalI]))) |
| | | .collect(Collectors.toList()); |
| | | if (CollUtil.isNotEmpty(collect)){ |
| | | DaTileMatchRules rules = collect.get(0); |
| | | resultList.add(rules); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (CollUtil.isEmpty(resultList)){ |
| | | return R.fail("未匹配到平衡轴瓦"); |
| | | } else { |
| | | ReadWriteEntity entity6 = new ReadWriteEntity("CFL4HX.OP040.CodeComplete", 1); |
| | | miloService.writeToOpcByte(entity6); |
| | | ProductNewPassStation passStation = new ProductNewPassStation(); |
| | | passStation.setProductType(productType); |
| | | passStation.setBoxCode(boxCode); |
| | | List<ProductNewPassStation> productPassStationList = productNewPassStationService.getProductPassStationList(passStation); |
| | | if (CollUtil.isNotEmpty(productPassStationList)){ |
| | | ProductNewPassStation newPassStation = productPassStationList.get(0); |
| | | productNewPassStationMapper.updatePassStationBalanceCode(newPassStation.getSfcCode(),balanceCode); |
| | | if (CollUtil.isEmpty(resultList)){ |
| | | return R.fail("未匹配到平衡轴瓦"); |
| | | } else { |
| | | ReadWriteEntity entity6 = new ReadWriteEntity("CFL4HX.OP040.CodeComplete", 1); |
| | | miloService.writeToOpcByte(entity6); |
| | | ProductNewPassStation passStation = new ProductNewPassStation(); |
| | | passStation.setProductType(productType); |
| | | passStation.setBoxCode(boxCode); |
| | | List<ProductNewPassStation> productPassStationList = productNewPassStationService.getProductPassStationList(passStation); |
| | | if (CollUtil.isNotEmpty(productPassStationList)){ |
| | | ProductNewPassStation newPassStation = productPassStationList.get(0); |
| | | productNewPassStationMapper.updatePassStationBalanceCode(newPassStation.getSfcCode(),balanceCode); |
| | | } |
| | | } |
| | | } else if ("196".equals(productType)) { |
| | | // ReadWriteEntity entity6 = new ReadWriteEntity("CFL4HX.OP040.CodeComplete", 1); |
| | | // miloService.writeToOpcByte(entity6); |
| | | } |
| | | |
| | | return R.ok(resultList); |
| | | } |
| | | |