admin
2024-06-15 8cfe20288690f2ba46c804f41f39e8aa48c2dea0
jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java
@@ -18,6 +18,8 @@
import com.jcdm.main.da.paramCollection.domain.DaParamCollection;
import com.jcdm.main.da.paramCollection.mapper.DaParamCollectionMapper;
import com.jcdm.main.da.paramCollection.service.IDaParamCollectionService;
import com.jcdm.main.da.paramCollectionTemp.domain.DaParamCollectionTemp;
import com.jcdm.main.da.paramCollectionTemp.service.IDaParamCollectionTempService;
import com.jcdm.main.da.passingStationCollection.domain.DaPassingStationCollection;
import com.jcdm.main.da.passingStationCollection.mapper.DaPassingStationCollectionMapper;
import com.jcdm.main.da.passingStationCollection.service.IDaPassingStationCollectionService;
@@ -71,6 +73,9 @@
    @Autowired
    private IDaPassingStationCollectionService daPassingStationCollectionService;
    @Autowired
    private IDaParamCollectionTempService daParamCollectionTempService;
    Map<String, Session> map = WebSocketUsers.getUsers();
@@ -327,6 +332,47 @@
    }
    @Override
    public AjaxResult jrmWorkpieceRelease(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);
        }
        String[] split = bsFormulaChildInfo.getProductBarcode().split(",");
        try {
            for (int i = 0; i < split.length; i++) {
                daParamCollectionService.pushGeelycvMesFeedback(split[i], bsFormulaChildInfo.getLocationCode());
                String barCode = bsFormulaChildInfo.getProductBarcode();
                String locationCode = bsFormulaChildInfo.getLocationCode();
                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();
    }
    @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);
        }
        return AjaxResult.success();
    }
    @Override
    public BsFormulaChildInfo releaseCheck(BsFormulaChildInfo bsFormulaChildInfo) {
        return bsFormulaChildInfoMapper.releaseCheck(bsFormulaChildInfo);
    }
@@ -391,6 +437,16 @@
        daParamCollection.setCollectionTime(new Date());
        daParamCollection.setSfcCode(bsFormulaChildInfo.getSfcBarcode());
        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());
        daParamCollectionTemp.setSfcCode(bsFormulaChildInfo.getSfcBarcode());
        daParamCollectionTempService.save(daParamCollectionTemp);
    }
    public void jrmAddParameterCollection(BsFormulaChildInfo bsFormulaChildInfo){
@@ -413,6 +469,19 @@
            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);
    }
    @Override