admin
2024-07-09 4e83fa344f6cba81412fb354e7f32a88a8f34fde
jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java
@@ -338,6 +338,8 @@
//                        miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+strA+".RecordDataDone").value(21).build());
//                        miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+strB+".RecordDataDone").value(21).build());
                        String locationCode = bsFormulaChildInfo.getLocationCode();
                        WebSocketUsers.sendMessageToUserByText(map.get(locationCode), "OUT");
//                        miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+locationCode+".RecordDataDone").value(21).build());
                    } catch (Exception e) {
                        throw new RuntimeException(e);
@@ -353,54 +355,12 @@
    @Override
    public AjaxResult jrmWorkpieceRelease(BsFormulaChildInfo bsFormulaChildInfo) {
        this.clearCollectDataAndResultsByProcessesCode(bsFormulaChildInfo);
//        List<BsFormulaChildInfo> list = bsFormulaChildInfoService.list(new LambdaQueryWrapper<BsFormulaChildInfo>()
//                .eq(BsFormulaChildInfo::getProcessesCode, bsFormulaChildInfo.getLocationCode())
//                .eq(BsFormulaChildInfo::getProductCode, bsFormulaChildInfo.getProductCode()));
//        for (BsFormulaChildInfo info : list) {
//            info.setCollectData("");
//            info.setResults("");
//            bsFormulaChildInfoService.saveOrUpdate(info);
//        }
        String[] split = bsFormulaChildInfo.getProductBarcode().split(",");
        try {
            for (int i = 0; i < split.length; i++) {
                daParamCollectionService.pushGeelycvMesFeedback(split[i], bsFormulaChildInfo.getLocationCode());
                String barCode = split[i];
                String locationCode = bsFormulaChildInfo.getLocationCode();
                if(StringUtils.isNotBlank(locationCode)&&StringUtils.isNotBlank(barCode)){
                    DaPassingStationCollection daPassingStationCollection = new DaPassingStationCollection();
                    daPassingStationCollection.setOutRsSign("1");
                    daPassingStationCollection.setOutboundTime(new Date());
                    daPassingStationCollection.setSfcCode(barCode);
                    daPassingStationCollection.setLocationCode(locationCode);
                    int updateDaPassingStation = daPassingStationCollectionService.updateDaPassingStationCollectionBySfcCodeAndLocationCode(daPassingStationCollection);
                    logger.info("加热膜人工工位更新过站记录updateDaPassingStationCollectionBySfcCodeAndLocationCode:更新了{}条数据-更新条件pack码{}-工位{}",updateDaPassingStation,barCode,locationCode);
                }
//                DaPassingStationCollection passingStationCollectionOne = daPassingStationCollectionService.getOne(new LambdaQueryWrapper<DaPassingStationCollection>().eq(DaPassingStationCollection::getSfcCode, barCode).eq(DaPassingStationCollection::getLocationCode, locationCode));
//                if (passingStationCollectionOne != null) {
//                    passingStationCollectionOne.setOutRsSign("1");
//                    passingStationCollectionOne.setOutboundTime(new Date());
//                    daPassingStationCollectionService.saveOrUpdate(passingStationCollectionOne);
//                }
            }
        }catch (Exception e){
        }
        daParamCollectionService.pushGeelycvMesFeedback(bsFormulaChildInfo.getProductBarcode(), bsFormulaChildInfo.getLocationCode());
        return AjaxResult.success();
    }
    @Override
    public AjaxResult clearWorkpieceRelease(BsFormulaChildInfo bsFormulaChildInfo) {
//        List<BsFormulaChildInfo> list = bsFormulaChildInfoService.list(new LambdaQueryWrapper<BsFormulaChildInfo>()
//                .eq(BsFormulaChildInfo::getProcessesCode, bsFormulaChildInfo.getLocationCode())
//                .eq(BsFormulaChildInfo::getProductCode, bsFormulaChildInfo.getProductCode()));
//        for (BsFormulaChildInfo info : list) {
//            info.setCollectData("");
//            info.setResults("");
//            bsFormulaChildInfoService.saveOrUpdate(info);
//        }
        this.clearCollectDataAndResultsByProcessesCode(bsFormulaChildInfo);
        return AjaxResult.success();
    }
@@ -518,71 +478,33 @@
    public void jrmAddParameterCollection(BsFormulaChildInfo bsFormulaChildInfo){
        String scanBarCode = bsFormulaChildInfo.getSfcBarcode();
        String[] modeleSplit = scanBarCode.split(",");
//        for (String modele : modeleSplit) {
            DaParamCollection daParamCollection = new DaParamCollection();
            daParamCollection.setParamCode(bsFormulaChildInfo.getParamCode());
            daParamCollection.setWorkOrderNo(bsFormulaChildInfo.getWorkOrderNo());
            daParamCollection.setLocationCode(bsFormulaChildInfo.getLocationCode());
            daParamCollection.setParamValue(bsFormulaChildInfo.getParamValue());
            daParamCollection.setProductCode(bsFormulaChildInfo.getProductCode());
            daParamCollection.setCollectionTime(new Date());
            if(bsFormulaChildInfo.getParamCode().contains("B")){
                daParamCollection.setSfcCode(modeleSplit[1]);
            }else {
                daParamCollection.setSfcCode(modeleSplit[0]);
            }
//            daParamCollection.setSfcCode(modele);
            daParamCollectionMapper.insertDaParamCollection(daParamCollection);
//        }
        DaParamCollection daParamCollection = new DaParamCollection();
        daParamCollection.setParamCode(bsFormulaChildInfo.getParamCode());
        daParamCollection.setWorkOrderNo(bsFormulaChildInfo.getWorkOrderNo());
        daParamCollection.setLocationCode(bsFormulaChildInfo.getLocationCode());
        daParamCollection.setParamValue(bsFormulaChildInfo.getParamValue());
        daParamCollection.setProductCode(bsFormulaChildInfo.getProductCode());
        daParamCollection.setCollectionTime(new Date());
        daParamCollection.setSfcCode(scanBarCode);
        daParamCollectionMapper.insertDaParamCollection(daParamCollection);
            DaParamCollectionTemp daParamCollectionTemp = new DaParamCollectionTemp();
            daParamCollectionTemp.setParamCode(bsFormulaChildInfo.getParamCode());
            daParamCollectionTemp.setWorkOrderNo(bsFormulaChildInfo.getWorkOrderNo());
            daParamCollectionTemp.setLocationCode(bsFormulaChildInfo.getLocationCode());
            daParamCollectionTemp.setParamValue(bsFormulaChildInfo.getParamValue());
            daParamCollectionTemp.setProductCode(bsFormulaChildInfo.getProductCode());
            daParamCollectionTemp.setCollectionTime(new Date());
            if(bsFormulaChildInfo.getParamCode().contains("B")){
                daParamCollectionTemp.setSfcCode(modeleSplit[1]);
            }else {
                daParamCollectionTemp.setSfcCode(modeleSplit[0]);
            }
            daParamCollectionTempService.save(daParamCollectionTemp);
        DaParamCollectionTemp daParamCollectionTemp = new DaParamCollectionTemp();
        daParamCollectionTemp.setParamCode(bsFormulaChildInfo.getParamCode());
        daParamCollectionTemp.setWorkOrderNo(bsFormulaChildInfo.getWorkOrderNo());
        daParamCollectionTemp.setLocationCode(bsFormulaChildInfo.getLocationCode());
        daParamCollectionTemp.setParamValue(bsFormulaChildInfo.getParamValue());
        daParamCollectionTemp.setProductCode(bsFormulaChildInfo.getProductCode());
        daParamCollectionTemp.setCollectionTime(new Date());
        daParamCollection.setSfcCode(scanBarCode);
        daParamCollectionTempService.save(daParamCollectionTemp);
    }
    @Override
    public AjaxResult workpieceRelease(BsFormulaChildInfo bsFormulaChildInfo) {
        this.clearCollectDataAndResultsByProcessesCode(bsFormulaChildInfo);
//        List<BsFormulaChildInfo> list = bsFormulaChildInfoService.list(new LambdaQueryWrapper<BsFormulaChildInfo>()
//                .eq(BsFormulaChildInfo::getProcessesCode, bsFormulaChildInfo.getLocationCode())
//                .eq(BsFormulaChildInfo::getProductCode, bsFormulaChildInfo.getProductCode()));
//        for (BsFormulaChildInfo info : list) {
//            info.setCollectData("");
//            info.setResults("");
//            bsFormulaChildInfoService.saveOrUpdate(info);
//        }
        try {
            daParamCollectionService.pushGeelycvMesFeedback(bsFormulaChildInfo.getProductBarcode(), bsFormulaChildInfo.getLocationCode());
//            String barCode = bsFormulaChildInfo.getProductBarcode();
//            String locationCode = bsFormulaChildInfo.getLocationCode();
//
//            if(StringUtils.isNotBlank(locationCode)&&StringUtils.isNotBlank(barCode)){
//                DaPassingStationCollection daPassingStationCollection = new DaPassingStationCollection();
//                daPassingStationCollection.setOutRsSign("1");
//                daPassingStationCollection.setOutboundTime(new Date());
//                daPassingStationCollection.setSfcCode(barCode);
//                daPassingStationCollection.setLocationCode(locationCode);
//                int updateDaPassingStation = daPassingStationCollectionService.updateDaPassingStationCollectionBySfcCodeAndLocationCode(daPassingStationCollection);
//                logger.info("普通人工工位更新过站记录updateDaPassingStationCollectionBySfcCodeAndLocationCode:更新了{}条数据-更新条件pack码{}-工位{}",updateDaPassingStation,barCode,locationCode);
//            }
//            DaPassingStationCollection passingStationCollectionOne = daPassingStationCollectionService.getOne(new LambdaQueryWrapper<DaPassingStationCollection>().eq(DaPassingStationCollection::getSfcCode, barCode).eq(DaPassingStationCollection::getLocationCode, locationCode));
//            if (passingStationCollectionOne != null) {
//                passingStationCollectionOne.setOutRsSign("1");
//                passingStationCollectionOne.setOutboundTime(new Date());
//                daPassingStationCollectionService.saveOrUpdate(passingStationCollectionOne);
//            }
        }catch (Exception e){
        }
        return AjaxResult.success();