admin
2024-07-23 aa0211e80f03b180aadabeea9d203370d6df99f6
jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java
@@ -554,15 +554,15 @@
            bsFormulaChildInfo.setResults("NG");
            bsFormulaChildInfo.setCollectData(bsFormulaChildInfo.getTightenTheArray());
//            Integer ngTimes = bsFormulaChildInfo.getNgTimes();
//            bsFormulaChildInfo.setNgTimes(ngTimes+1);
//            bsFormulaChildInfoMapper.updateBsFormulaChildInfo(bsFormulaChildInfo);
//
//            if(bsFormulaChildInfo.getNgTimes() > 3){
//                this.recordNgTighteningData(bsFormulaChildInfo.getLocationCode(), bsFormulaChildInfo.getProductCode(), bsFormulaChildInfo.getProductBarcode());
//                WebSocketUsers.sendMessageToUserByText(map.get(bsFormulaChildInfo.getLocationCode()), "NG");
//                return AjaxResult.error("超过三次拧紧 pack NG下线!");
//            }
            Integer ngTimes = bsFormulaChildInfo.getNgTimes();
            bsFormulaChildInfo.setNgTimes(ngTimes+1);
            bsFormulaChildInfoMapper.updateBsFormulaChildInfo(bsFormulaChildInfo);
            if(bsFormulaChildInfo.getNgTimes() > 3){
                this.recordNgTighteningData(bsFormulaChildInfo.getLocationCode(), bsFormulaChildInfo.getProductCode(), bsFormulaChildInfo.getProductBarcode());
                WebSocketUsers.sendMessageToUserByText(map.get(bsFormulaChildInfo.getLocationCode()), "NG");
                return AjaxResult.error("超过三次拧紧 pack NG下线!");
            }
            return AjaxResult.error("拧紧结果NG,请重新拧紧!");
        }else {
            //List<BsFormulaChildInfo> bsFormulaChildInfos = bsFormulaChildInfoMapper.selectBsFormulaChildInfoList(listQuery);
@@ -600,7 +600,17 @@
                String originalString = bsFormulaChildInfo.getTightenTheArray();
                String modifiedString = originalString.replaceFirst("OK", "NG");
                bsFormulaChildInfo.setCollectData(modifiedString);
//                bsFormulaChildInfoMapper.updateBsFormulaChildInfo(bsFormulaChildInfo);
                Integer ngTimes = bsFormulaChildInfo.getNgTimes();
                bsFormulaChildInfo.setNgTimes(ngTimes+1);
                bsFormulaChildInfoMapper.updateBsFormulaChildInfo(bsFormulaChildInfo);
                if(bsFormulaChildInfo.getNgTimes() > 3){
                    this.recordNgTighteningData(bsFormulaChildInfo.getLocationCode(), bsFormulaChildInfo.getProductCode(), bsFormulaChildInfo.getProductBarcode());
                    WebSocketUsers.sendMessageToUserByText(map.get(bsFormulaChildInfo.getLocationCode()), "NG");
                    return AjaxResult.error("超过三次拧紧 pack NG下线!");
                }
                return AjaxResult.error("拧紧结果NG,请重新拧紧!");
            }
@@ -626,7 +636,7 @@
            childInfoTemp.setProcessesCode(childInfo.getProcessesCode());
            childInfoTemp.setProductCode(childInfo.getProductCode());
            childInfoTemp.setStepSort(childInfo.getStepSort());
//            childInfoTemp.setLineCode(childInfo.getId());
            childInfoTemp.setChildId(childInfo.getId());
            bsFormulaChildInfoTempService.save(childInfoTemp);
        }
    }