-
admin
2024-05-10 d545f19a84599c8664d3a7db87f35e02b1bf93f5
jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java
@@ -6,6 +6,7 @@
import java.util.Map;
import java.util.stream.Collectors;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -214,7 +215,7 @@
            Integer stepNumber = Integer.valueOf(bsFormulaChildInfos.get(0).getStepSort());
            try {
                miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+bsFormulaChildInfo.getLocationCode()+".StepNumber").value(stepNumber).build());
                miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+bsFormulaChildInfo.getLocationCode()+".MStepNumber").value(stepNumber).build());
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
@@ -244,7 +245,9 @@
                .eq(BsFormulaChildInfo::getProcessesCode, bsFormulaChildInfo.getLocationCode())
                .eq(BsFormulaChildInfo::getProductCode, bsFormulaChildInfo.getProductCode())
                .eq(BsFormulaChildInfo::getOperationType, "2")
        );
        ).stream().filter(x -> StrUtil.isBlank(x.getCollectData())).collect(Collectors.toList());
        for (BsFormulaChildInfo formulaChildInfo : infos) {
            if(bsFormulaChildInfo.getScanBarcode().contains(formulaChildInfo.getMaterialCode())){
                bsFormulaChildInfos.add(formulaChildInfo);
@@ -348,7 +351,7 @@
    public void jrmAddParameterCollection(BsFormulaChildInfo bsFormulaChildInfo){
        String scanBarCode = bsFormulaChildInfo.getSfcBarcode();
        String[] modeleSplit = scanBarCode.split(",");
        for (String modele : modeleSplit) {
//        for (String modele : modeleSplit) {
            DaParamCollection daParamCollection = new DaParamCollection();
            daParamCollection.setParamCode(bsFormulaChildInfo.getParamCode());
            daParamCollection.setWorkOrderNo(bsFormulaChildInfo.getWorkOrderNo());
@@ -356,9 +359,14 @@
            daParamCollection.setParamValue(bsFormulaChildInfo.getParamValue());
            daParamCollection.setProductCode(bsFormulaChildInfo.getProductCode());
            daParamCollection.setCollectionTime(new Date());
            daParamCollection.setSfcCode(modele);
            if(bsFormulaChildInfo.getParamCode().contains("B")){
                daParamCollection.setSfcCode(modeleSplit[1]);
            }else {
                daParamCollection.setSfcCode(modeleSplit[0]);
            }
//            daParamCollection.setSfcCode(modele);
            daParamCollectionMapper.insertDaParamCollection(daParamCollection);
        }
//        }
    }
@@ -404,7 +412,7 @@
            Integer stepNumber = Integer.valueOf(bsFormulaChildInfos.get(0).getStepSort());
            try {
                miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+bsFormulaChildInfo.getLocationCode()+".StepNumber").value(stepNumber).build());
                miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+bsFormulaChildInfo.getLocationCode()+".MStepNumber").value(stepNumber).build());
            } catch (Exception e) {
                throw new RuntimeException(e);
            }