春风项目四线(合箱线、总装线)
wujian
2024-07-10 59e2283a10aee45e6a98e34b432ba345095116db
add 选瓦
已添加7个文件
已修改25个文件
2596 ■■■■■ 文件已修改
jcdm-main/src/main/java/com/jcdm/main/bs/orderScheduling/controller/BsOrderSchedulingController.java 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/controller/DaOpcuaConfigController.java 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/passingStationCollection/domain/ProductNewPassStation.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/passingStationCollection/mapper/ProductNewPassStationMapper.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/passingStationCollection/service/ProductNewPassStationService.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/passingStationCollection/service/impl/DaPassingStationCollectionServiceImpl.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/passingStationCollection/service/impl/ProductNewPassStationServiceImpl.java 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/tileMatchCollection/controller/DaTileMatchCollectionController.java 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/tileMatchCollection/domain/DaTileMatchCollection.java 93 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/tileMatchCollection/domain/ReceiveDataVO.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/tileMatchMiddleware/controller/DaTileMatchMiddlewareController.java 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/tileMatchMiddleware/domain/DaTileMatchMiddleware.java 107 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/tileMatchRules/controller/DaTileMatchRulesController.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/tileMatchRules/domain/DaTileMatchRules.java 174 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/tileMatchRules/service/IDaTileMatchRulesService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/tileMatchRules/service/impl/DaTileMatchRulesServiceImpl.java 80 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/plcserver/CustomRunner.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/plcserver/conf/OPCElement.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java 359 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/rm/repairRecord/mapper/RmRepairRecordMapper.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/resources/mapper/da/passingStationCollection/ProductNewPassStationMapper.xml 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/resources/mapper/da/tileMatchRules/DaTileMatchRulesMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/resources/mapper/rm/repairRecord/RmRepairRecordMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/api/main/bs/tileMatchRules/tileMatchRules.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/api/main/da/tileMatchCollection/tileMatchCollection.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/assets/images/463XT.png 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/cfkb/BalanceShaft/index.vue 264 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/cfkb/connectingRod/index.vue 305 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/cfkb/connectingRodUp/index.vue 233 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/cfkb/crankshaft/index.vue 291 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/cfkb/crankshaftUp/index.vue 115 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/om/productionOrde/index.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/bs/orderScheduling/controller/BsOrderSchedulingController.java
@@ -1,6 +1,7 @@
package com.jcdm.main.bs.orderScheduling.controller;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
@@ -12,7 +13,6 @@
import com.jcdm.common.core.domain.entity.SysDictData;
import com.jcdm.common.core.page.TableDataInfo;
import com.jcdm.common.enums.BusinessType;
import com.jcdm.common.utils.SecurityUtils;
import com.jcdm.common.utils.StringUtils;
import com.jcdm.common.utils.poi.ExcelUtil;
import com.jcdm.main.bs.orderScheduling.common.Constants;
@@ -23,8 +23,9 @@
import com.jcdm.main.bs.orderScheduling.vo.SumDataVO;
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.passingStationCollection.domain.DaPassingStationCollection;
import com.jcdm.main.da.passingStationCollection.domain.ProductNewPassStation;
import com.jcdm.main.da.passingStationCollection.service.ProductNewPassStationService;
import com.jcdm.main.da.tileMatchCollection.domain.DaTileMatchCollection;
import com.jcdm.main.da.tileMatchCollection.service.IDaTileMatchCollectionService;
import com.jcdm.main.om.productionOrde.domain.OmProductionOrdeInfo;
@@ -43,9 +44,10 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
/**
@@ -71,6 +73,8 @@
    private DaParamCollectionMapper daParamCollectionService;
    @Resource
    private IDaTileMatchCollectionService daTileMatchCollectionService;
    @Resource
    private ProductNewPassStationService productNewPassStationService;
    @Autowired
    MiloService miloService;
@@ -315,7 +319,6 @@
        BsOrderScheduling bsOrderScheduling = new BsOrderScheduling();
        bsOrderScheduling.setOrderNo(orderNo);
        //bsOrderScheduling.setProductionStatus("1");
        List<BsOrderScheduling> allList = bsOrderSchedulingService.selectBsOrderSchedulingList(bsOrderScheduling);
        List<BsOrderScheduling> dlist = allList.stream().filter(x->x.getProductionStatus().equals(Constants.WAIT_PRODUCTION)).collect(Collectors.toList());
        List<BsOrderScheduling> collect = allList.stream().filter(x -> x.getProductionStatus().equals(Constants.ORDER_STATUS_ING)
@@ -325,7 +328,7 @@
        DaParamCollection daParamCollection = new DaParamCollection();
        daParamCollection.setParamValue(engineNo);
        daParamCollection.setSfcCode("OP010");
        daParamCollection.setLocationCode("OP010");
        List<DaParamCollection> list = daParamCollectionService.selectDaParamCollectionList(daParamCollection);
        if (CollUtil.isNotEmpty(list)){
            return R.ok(500,"已存在此箱体码,请勿重复扫描");
@@ -358,6 +361,25 @@
        MatchCollection.setParamName("箱体");
        daTileMatchCollectionService.insertDaTileMatchCollection(MatchCollection);
        if (StrUtil.isNotBlank(OrderScheduling.getEngineNo())){
            String snCode = OrderScheduling.getEngineNo();
            if (snCode.startsWith("280") || snCode.startsWith("380")){
                ProductNewPassStation productNewPassStation = new ProductNewPassStation();
                UUID uuid = UUID.randomUUID();
                productNewPassStation.setId(uuid.getMostSignificantBits());
                productNewPassStation.setFinishFlag("0");
                productNewPassStation.setSfcCode(OrderScheduling.getEngineNo());
                productNewPassStation.setCreateTime(new Date());
                productNewPassStation.setBoxCode(engineNo);
                if (snCode.startsWith("280")){
                    productNewPassStation.setProductType("280");
                } else {
                    productNewPassStation.setProductType("380");
                }
                productNewPassStationService.insertPassStation(productNewPassStation);
            }
        }
        //更新上线数量
        int onlineNum = 0;
        List<BsOrderScheduling> onlineNumList = bsOrderSchedulingService.selectBsOrderSchedulingList(bsOrderScheduling)
@@ -377,10 +399,9 @@
        }
        //OPC操作
        ReadWriteEntity entity = new ReadWriteEntity("CFL4HX.HOP010.Code", OrderScheduling.getEngineNo());
        ReadWriteEntity entity = new ReadWriteEntity("CFL4HX.OP010.Code", OrderScheduling.getEngineNo());
        OPCUaSubscription.miloService.writeToOpcUa(entity);//写SN
        ReadWriteEntity entity2 = new ReadWriteEntity("CFL4HX.HOP010.SNDoor", 1);
        OPCUaSubscription.miloService.writeToOpcByte(entity2);//写完成
        OrderScheduling.setProductionStatus("2");
        bsOrderSchedulingService.updateBsOrderScheduling(OrderScheduling);
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/controller/DaOpcuaConfigController.java
@@ -6,18 +6,23 @@
import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.collection.CollUtil;
import com.jcdm.common.core.domain.R;
import com.jcdm.main.da.opcuaconfig.domain.DaOpcuaConfig;
import com.jcdm.main.da.opcuaconfig.domain.NodeEntity;
import com.jcdm.main.da.opcuaconfig.service.IDaOpcuaConfigService;
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.passingStationCollection.domain.ProductNewPassStation;
import com.jcdm.main.da.passingStationCollection.mapper.ProductNewPassStationMapper;
import com.jcdm.main.da.passingStationCollection.service.ProductNewPassStationService;
import com.jcdm.main.da.tileMatchCollection.domain.DaTileMatchCollection;
import com.jcdm.main.da.tileMatchCollection.service.IDaTileMatchCollectionService;
import com.jcdm.main.da.tileMatchMiddleware.domain.DaTileMatchMiddleware;
import com.jcdm.main.da.tileMatchMiddleware.service.IDaTileMatchMiddlewareService;
import com.jcdm.main.da.tileMatchRules.domain.DaTileMatchRules;
import com.jcdm.main.da.tileMatchRules.service.IDaTileMatchRulesService;
import com.jcdm.main.plcserver.conf.OPCElement;
import com.jcdm.main.plcserver.sub.OPCUaSubscription;
import com.kangaroohy.milo.model.ReadWriteEntity;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -59,6 +64,12 @@
    private IDaTileMatchMiddlewareService daTileMatchMiddlewareService;
    @Resource
    private IDaTileMatchCollectionService daTileMatchCollectionService;
    @Resource
    private ProductNewPassStationService productNewPassStationService;
    @Resource
    private ProductNewPassStationMapper productNewPassStationMapper;
    /**
     * æŸ¥è¯¢äº¤äº’信号配置列表
@@ -149,13 +160,12 @@
     */
    @PreAuthorize("@ss.hasPermi('da:opcuaconfig:query')")
    @GetMapping(value = "/barcode1")
    public DaParamCollection setBarcode1(String barcode,String locationCode) {
        Boolean out = true;
        DaParamCollection xParamCollection = null;
    public R setBarcode1(String barcode, String locationCode) {
        ProductNewPassStation resultPassStation = new ProductNewPassStation();
        try {
            Object SNCodeObject = miloService.readFromOpcUa("CFL4HX." + locationCode + ".Code1").getValue();
            Object SNCodeObject = miloService.readFromOpcUa("CFL4HX." + locationCode + ".Code").getValue();
            if (null == SNCodeObject) {
                SNCodeObject = miloService.readFromOpcUa("CFL4HX." + locationCode + ".Code").getValue();
                SNCodeObject = miloService.readFromOpcUa("CFL4HX." + locationCode + ".Code1").getValue();
            }
            if (null != SNCodeObject) {
                String SNCode = SNCodeObject.toString();
@@ -176,36 +186,39 @@
                MatchCollection.setParamName("曲轴");
                daTileMatchCollectionService.insertDaTileMatchCollection(MatchCollection);
                DaTileMatchRules TileMatchRules = new DaTileMatchRules();
                TileMatchRules.setProductSeries("380Y");
                TileMatchRules.setScanObject1("连杆");
                TileMatchRules.setScanObject2("曲轴");
                daTileMatchRulesService.selectDaTileMatchRulesList(TileMatchRules);
//                DaTileMatchRules TileMatchRules = new DaTileMatchRules();
//                TileMatchRules.setProductSeries("380Y");
//                TileMatchRules.setScanObject1("连杆");
//                TileMatchRules.setScanObject2("曲轴");
//                daTileMatchRulesService.selectDaTileMatchRulesList(TileMatchRules);
                for (int i = 1; i <= 3; i++) {
                    DaTileMatchMiddleware TileMatchMiddleware = new DaTileMatchMiddleware();
                    TileMatchMiddleware.setSfcCode(SNCode);
                    TileMatchMiddleware.setCrankshaftNo(barcode);
                    TileMatchMiddleware.setCylinder((long) i);
                    TileMatchMiddleware.setState(1L);
                    TileMatchMiddleware.setCylinder(i);
                    TileMatchMiddleware.setState(1);
                    daTileMatchMiddlewareService.insertDaTileMatchMiddleware(TileMatchMiddleware);
                }
                DaParamCollection ParamCollection = new DaParamCollection();
                ParamCollection.setSfcCode(SNCode);
                ParamCollection.setParamName("箱体");
                List<DaParamCollection> DaParamCollectionlist = daParamCollectionService.selectDaParamCollectionList(ParamCollection);
                List<DaParamCollection> XTParamCollection = DaParamCollectionlist.stream().filter(x -> "箱体".equals(x.getParamName())).collect(Collectors.toList());
                if (CollUtil.isNotEmpty(XTParamCollection)) {
                    xParamCollection = XTParamCollection.get(0);
                ProductNewPassStation productNewPassStation = new ProductNewPassStation();
                productNewPassStation.setFinishFlag(OPCElement.UN_FINISH);
                productNewPassStation.setSfcCode(SNCode);
                List<ProductNewPassStation> productPassStationList = productNewPassStationService.getProductPassStationList(productNewPassStation);
                if (CollUtil.isNotEmpty(productPassStationList)){
                    resultPassStation = productPassStationList.get(0);
                    String rodCode = barcode;
                    productNewPassStationMapper.updatePassStationRodCode(resultPassStation.getSfcCode(),rodCode);
                }
                ReadWriteEntity entity6 = new ReadWriteEntity("CFL4HX.HOP030.Partcode", "1");
                ReadWriteEntity entity6 = new ReadWriteEntity("CFL4HX.OP030.CodeComplete", 1);
                miloService.writeToOpcByte(entity6);
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return xParamCollection;
        return R.ok(resultPassStation);
    }
}
jcdm-main/src/main/java/com/jcdm/main/da/passingStationCollection/domain/ProductNewPassStation.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,27 @@
package com.jcdm.main.da.passingStationCollection.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
@Data
public class ProductNewPassStation {
    private Long id;
    private String sfcCode;
    private String rodCode;
    private String balanceCode;
    private String finishFlag;
    private String productType;
    private String boxCode;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
}
jcdm-main/src/main/java/com/jcdm/main/da/passingStationCollection/mapper/ProductNewPassStationMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
package com.jcdm.main.da.passingStationCollection.mapper;
import com.jcdm.main.da.passingStationCollection.domain.ProductNewPassStation;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
 * äº§å“è¿‡ç«™é‡‡é›†Mapper接口
 *
 * @author yyt
 * @date 2023-12-12
 */
public interface ProductNewPassStationMapper
{
    public void insertPassStation(ProductNewPassStation productNewPassStation);
    public void updatePassStation(ProductNewPassStation productNewPassStation);
    public void updatePassStationBalanceCode(@Param("sfcCode") String sfcCode,@Param("balanceCode") String balanceCode);
    public void updatePassStationRodCode(@Param("sfcCode") String sfcCode, @Param("rodCode") String rodCode);
    public ProductNewPassStation getPassStation(ProductNewPassStation productNewPassStation);
    public List<ProductNewPassStation> getProductPassStationList(ProductNewPassStation productNewPassStation);
    public void updatePassStationBySfcCode(String sfcCode);
    public void updatePassStationRodCodeBySfcCode(String sfcCode);
}
jcdm-main/src/main/java/com/jcdm/main/da/passingStationCollection/service/ProductNewPassStationService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,26 @@
package com.jcdm.main.da.passingStationCollection.service;
import com.jcdm.main.da.passingStationCollection.domain.ProductNewPassStation;
import com.jcdm.main.da.tileMatchCollection.domain.ReceiveDataVO;
import java.util.List;
/**
 * äº§å“è¿‡ç«™é‡‡é›†Service接口
 *
 * @author yyt
 * @date 2023-12-12
 */
public interface ProductNewPassStationService
{
    public ProductNewPassStation getPassStation(ProductNewPassStation productNewPassStation);
    public List<ProductNewPassStation> getProductPassStationList(ProductNewPassStation productNewPassStation);
    public void updatePassStationBySfcCode(String sfcCode);
    public void insertPassStation(ProductNewPassStation productNewPassStation);
    public ReceiveDataVO getDetailData() throws Exception;
}
jcdm-main/src/main/java/com/jcdm/main/da/passingStationCollection/service/impl/DaPassingStationCollectionServiceImpl.java
@@ -1,6 +1,7 @@
package com.jcdm.main.da.passingStationCollection.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson2.JSONObject;
import com.jcdm.common.utils.DateUtils;
import com.jcdm.common.utils.StringUtils;
@@ -213,14 +214,25 @@
    @Override
    public void insertRepairRecordByIds(DaPassingStationCollection daPassingStationCollection) {
        Long[] conditions = daPassingStationCollection.getIds();
        String sfcCode = "";
        List<RmRepairRecord> save = new ArrayList<>();
        for (int i = 0; i < conditions.length; i++) {
            DaPassingStationCollection result = daPassingStationCollectionMapper.selectDaPassingStationCollectionById(conditions[i]);
            if (i==0){
                if (ObjectUtil.isNotEmpty(result)){
                    sfcCode = result.getSfcCode();
                    rmRepairRecordMapper.deleteRmRepairRecordByCode(sfcCode);
                }
            }
            RmRepairRecord rmRepairRecord = new RmRepairRecord();
            rmRepairRecord.setBoxCode(result.getSfcCode());
            rmRepairRecord.setProcessesCode(result.getLocationCode());
            rmRepairRecord.setOriginalResult(result.getOutRsSign());
            rmRepairRecordMapper.insertRmRepairRecord(rmRepairRecord);
            daPassingStationCollectionMapper.deleteDaPassingStationCollectionById(result.getId());
        }
    }
    @Override
    public String SelectSN(String SNcode,String node) {
jcdm-main/src/main/java/com/jcdm/main/da/passingStationCollection/service/impl/ProductNewPassStationServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,73 @@
package com.jcdm.main.da.passingStationCollection.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.jcdm.common.utils.StringUtils;
import com.jcdm.main.da.passingStationCollection.domain.ProductNewPassStation;
import com.jcdm.main.da.passingStationCollection.mapper.ProductNewPassStationMapper;
import com.jcdm.main.da.passingStationCollection.service.ProductNewPassStationService;
import com.jcdm.main.da.tileMatchCollection.domain.ReceiveDataVO;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import static com.jcdm.main.plcserver.sub.OPCUaSubscription.miloService;
@Service
public class ProductNewPassStationServiceImpl implements ProductNewPassStationService {
    @Resource
    private ProductNewPassStationMapper productNewPassStationMapper;
    public ProductNewPassStation getPassStation(ProductNewPassStation productNewPassStation){
        return productNewPassStationMapper.getPassStation(productNewPassStation);
    }
    @Override
    public List<ProductNewPassStation> getProductPassStationList(ProductNewPassStation productNewPassStation) {
        return productNewPassStationMapper.getProductPassStationList(productNewPassStation);
    }
    @Override
    public void updatePassStationBySfcCode(String sfcCode) {
        productNewPassStationMapper.updatePassStationBySfcCode(sfcCode);
    }
    @Override
    public void insertPassStation(ProductNewPassStation productNewPassStation) {
        productNewPassStationMapper.insertPassStation(productNewPassStation);
    }
    @Override
    public ReceiveDataVO getDetailData() throws Exception {
        ReceiveDataVO vo = new ReceiveDataVO();
        Object SNCodeObject = miloService.readFromOpcUa("CFL3ZZ.OP050.Code").getValue();
        if (ObjectUtils.isNotEmpty(SNCodeObject) && StringUtils.isNoneBlank(SNCodeObject.toString())){
            String SNCode = SNCodeObject.toString();
            //获取产品型号
            String productType = getProductTypeBySfcCode(SNCode);
            vo.setProductSeries(productType);
            vo.setSfcCode(SNCode);
        }
        return vo;
    }
    private String getProductTypeBySfcCode(String SNCode) {
        ProductNewPassStation productNewPassStation = new ProductNewPassStation();
        productNewPassStation.setSfcCode(SNCode);
        List<ProductNewPassStation> passStationList = productNewPassStationMapper.getProductPassStationList(productNewPassStation);
        String productType = "";
        if (CollUtil.isNotEmpty(passStationList)){
            ProductNewPassStation passStation = passStationList.get(0);
            if (ObjectUtils.isNotEmpty(passStation)){
                productType = passStation.getProductType();
            }
        }
        return productType;
    }
}
jcdm-main/src/main/java/com/jcdm/main/da/tileMatchCollection/controller/DaTileMatchCollectionController.java
@@ -1,7 +1,23 @@
package com.jcdm.main.da.tileMatchCollection.controller;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.util.StrUtil;
import com.jcdm.common.core.domain.R;
import com.jcdm.main.da.paramCollection.service.IDaParamCollectionService;
import com.jcdm.main.da.passingStationCollection.domain.ProductNewPassStation;
import com.jcdm.main.da.passingStationCollection.mapper.ProductNewPassStationMapper;
import com.jcdm.main.da.passingStationCollection.service.ProductNewPassStationService;
import com.jcdm.main.da.tileMatchCollection.domain.ReceiveDataVO;
import com.jcdm.main.da.tileMatchRules.domain.DaTileMatchRules;
import com.jcdm.main.da.tileMatchRules.service.IDaTileMatchRulesService;
import com.kangaroohy.milo.model.ReadWriteEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@@ -21,6 +37,8 @@
import com.jcdm.common.utils.poi.ExcelUtil;
import com.jcdm.common.core.page.TableDataInfo;
import static com.jcdm.main.plcserver.sub.OPCUaSubscription.miloService;
/**
 * æ¡ç é‡‡é›†Controller
 * 
@@ -33,6 +51,18 @@
{
    @Autowired
    private IDaTileMatchCollectionService daTileMatchCollectionService;
    @Autowired
    private IDaTileMatchRulesService daTileMatchRulesService;
    @Autowired
    private IDaParamCollectionService daParamCollectionService;
    @Resource
    private ProductNewPassStationMapper productNewPassStationMapper;
    @Resource
    private ProductNewPassStationService productNewPassStationService;
    /**
     * æŸ¥è¯¢æ¡ç é‡‡é›†åˆ—表
@@ -101,4 +131,87 @@
    {
        return toAjax(daTileMatchCollectionService.deleteDaTileMatchCollectionByIds(ids));
    }
    @GetMapping("/getBalanceData")
    public R getBalanceData(String boxCode, String balanceCode, String productType) throws Exception {
        List<DaTileMatchRules> resultList = new ArrayList<>();
        if (StrUtil.isBlank(boxCode)){
            return R.fail("箱体码不能为空");
        }
        if (StrUtil.isBlank(balanceCode)){
            return R.fail("平衡轴码不能为空");
        }
        if (StrUtil.isBlank(productType)){
            return R.fail("产品类型不能为空");
        }
        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);
                        }
                    }
                } else if ("372".equals(productType)){
                    for (int i = 1; i < 3; i++) {
                        int finalI = i;
                        int finalAxis = i+4;
                        List<DaTileMatchRules> collect = allMatchRuleList.stream().filter(x -> x.getAxisParameterNoPosition().equals(finalAxis + 1) &&
                                        x.getNeckParameterPosition().equals(finalI + 1) &&
                                        x.getAxisValue().equals(String.valueOf(boxCodeCharArray[finalAxis])) &&
                                        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);
            }
        }
        return R.ok(resultList);
    }
    @GetMapping("/getDetailData")
    public R getDetailData() throws Exception {
        ReceiveDataVO detailData = productNewPassStationService.getDetailData();
        return R.ok(detailData);
    }
}
jcdm-main/src/main/java/com/jcdm/main/da/tileMatchCollection/domain/DaTileMatchCollection.java
@@ -1,9 +1,13 @@
package com.jcdm.main.da.tileMatchCollection.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.jcdm.common.annotation.Excel;
import com.jcdm.common.core.domain.BaseEntity;
import java.util.Date;
/**
 * æ¡ç é‡‡é›†å¯¹è±¡ da_tile_match_collection
@@ -11,9 +15,9 @@
 * @author yyt
 * @date 2024-06-06
 */
public class DaTileMatchCollection extends BaseEntity
@Data
public class DaTileMatchCollection
{
    private static final long serialVersionUID = 1L;
    /** id */
    private Long id;
@@ -42,82 +46,17 @@
    @Excel(name = "条码")
    private String paramValue;
    public void setId(Long id)
    {
        this.id = id;
    }
    /** åˆ›å»ºç”¨æˆ· */
    private String createUser;
    public Long getId()
    {
        return id;
    }
    public void setSfcCode(String sfcCode)
    {
        this.sfcCode = sfcCode;
    }
    /** æ›´æ”¹ç”¨æˆ· */
    private String updateUser;
    public String getSfcCode()
    {
        return sfcCode;
    }
    public void setParamCode(String paramCode)
    {
        this.paramCode = paramCode;
    }
    /** åˆ›å»ºæ—¶é—´ */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    public String getParamCode()
    {
        return paramCode;
    }
    public void setParamName(String paramName)
    {
        this.paramName = paramName;
    }
    public String getParamName()
    {
        return paramName;
    }
    public void setRemarks(String remarks)
    {
        this.remarks = remarks;
    }
    public String getRemarks()
    {
        return remarks;
    }
    public void setLocationCode(String locationCode)
    {
        this.locationCode = locationCode;
    }
    public String getLocationCode()
    {
        return locationCode;
    }
    public void setParamValue(String paramValue)
    {
        this.paramValue = paramValue;
    }
    public String getParamValue()
    {
        return paramValue;
    }
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("sfcCode", getSfcCode())
            .append("paramCode", getParamCode())
            .append("paramName", getParamName())
            .append("createTime", getCreateTime())
            .append("remarks", getRemarks())
            .append("locationCode", getLocationCode())
            .append("paramValue", getParamValue())
            .toString();
    }
    /** æ›´æ–°æ—¶é—´ */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
}
jcdm-main/src/main/java/com/jcdm/main/da/tileMatchCollection/domain/ReceiveDataVO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
package com.jcdm.main.da.tileMatchCollection.domain;
import lombok.Data;
@Data
public class ReceiveDataVO {
    private String SfcCode;
    private String productSeries;
}
jcdm-main/src/main/java/com/jcdm/main/da/tileMatchMiddleware/controller/DaTileMatchMiddlewareController.java
@@ -1,9 +1,13 @@
package com.jcdm.main.da.tileMatchMiddleware.controller;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.collection.CollUtil;
import com.jcdm.main.da.paramCollection.domain.DaParamCollection;
import com.jcdm.main.da.passingStationCollection.domain.ProductNewPassStation;
import com.jcdm.main.da.passingStationCollection.service.ProductNewPassStationService;
import com.jcdm.main.da.tileMatchRules.domain.DaTileMatchRules;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
@@ -38,6 +42,9 @@
{
    @Autowired
    private IDaTileMatchMiddlewareService daTileMatchMiddlewareService;
    @Resource
    private ProductNewPassStationService productNewPassStationService;
    /**
     * æŸ¥è¯¢æ´»å¡žè¿žæ†é…ç“¦ä¸­é—´åˆ—表
@@ -124,12 +131,12 @@
                DaTileMatchMiddleware TileMatchMiddleware=new DaTileMatchMiddleware();
                TileMatchMiddleware.setSfcCode(SNCode);
                TileMatchMiddleware.setPalletNo(barcode);
                TileMatchMiddleware.setState(2L);
                TileMatchMiddleware.setState(2);
                List<DaTileMatchMiddleware> TileMatchMiddlewareList=daTileMatchMiddlewareService.selectDaTileMatchMiddlewareList(TileMatchMiddleware);
                if(TileMatchMiddlewareList.size()>0){
                    for(int i=0;i<TileMatchMiddlewareList.size();i++){
                        DaTileMatchMiddleware Middleware=TileMatchMiddlewareList.get(i);
                        Middleware.setState(3L);
                        Middleware.setState(3);
                        daTileMatchMiddlewareService.updateDaTileMatchMiddleware(Middleware);
                    }
                    rMiddleware=TileMatchMiddlewareList.get(0);
@@ -144,17 +151,32 @@
    @PreAuthorize("@ss.hasPermi('da:tileMatchMiddleware:query')")
    @GetMapping(value = "/barcode")
    public DaTileMatchMiddleware setBarcode(String barcode,String locationCode) {
    public DaTileMatchMiddleware setBarcode(String barcode,String locationCode) throws Exception {
        DaTileMatchMiddleware rMiddleware=new DaTileMatchMiddleware();;
        rMiddleware.setState(1L);
        rMiddleware.setState(1);
        List<DaTileMatchMiddleware> TileMatchMiddlewareList=daTileMatchMiddlewareService.selectDaTileMatchMiddlewareList(rMiddleware);
        String SNCode="";
        if(TileMatchMiddlewareList.size()>0){
            rMiddleware=TileMatchMiddlewareList.get(0);
            rMiddleware.setPalletNo(locationCode);
            rMiddleware.setConnectingrodNo(barcode);
            rMiddleware.setState(2L);
            rMiddleware.setState(2);
            SNCode=rMiddleware.getSfcCode();
            daTileMatchMiddlewareService.updateDaTileMatchMiddleware(rMiddleware);
            //获取产品型号
            ProductNewPassStation productNewPassStation = new ProductNewPassStation();
            productNewPassStation.setSfcCode(SNCode);
            List<ProductNewPassStation> productPassStationList = productNewPassStationService.getProductPassStationList(productNewPassStation);
            if (CollUtil.isNotEmpty(productPassStationList)){
                ProductNewPassStation station = productPassStationList.get(0);
                String productType = station.getProductType();
                rMiddleware.setProductType(productType);
            }
        }
//        ReadWriteEntity entity = new ReadWriteEntity("CFL3ZZ.CR010.Code", SNCode);
//        InitCallback.miloService.writeToOpcUa(entity);//写SN
//        ReadWriteEntity entity2 = new ReadWriteEntity("CFL3ZZ.CR010.CodeRequestFeed", 1);
//        InitCallback.miloService.writeToOpcByte(entity2);//写完成
        return rMiddleware;
    }
}
jcdm-main/src/main/java/com/jcdm/main/da/tileMatchMiddleware/domain/DaTileMatchMiddleware.java
@@ -1,9 +1,14 @@
package com.jcdm.main.da.tileMatchMiddleware.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.jcdm.common.annotation.Excel;
import com.jcdm.common.core.domain.BaseEntity;
import java.util.Date;
/**
 * æ´»å¡žè¿žæ†é…ç“¦ä¸­é—´å¯¹è±¡ da_tile_match_middleware
@@ -11,9 +16,9 @@
 * @author yyt
 * @date 2024-05-28
 */
public class DaTileMatchMiddleware extends BaseEntity
@Data
public class DaTileMatchMiddleware
{
    private static final long serialVersionUID = 1L;
    /** ID */
    private Long id;
@@ -32,7 +37,7 @@
    /** çŠ¶æ€ */
    @Excel(name = "状态")
    private Long state;
    private Integer state;
    /** å¤‡æ³¨ */
    @Excel(name = "备注")
@@ -44,92 +49,22 @@
    /** æ°”缸编号 */
    @Excel(name = "气缸编号")
    private Long cylinder;
    private Integer cylinder;
    public void setId(Long id)
    {
        this.id = id;
    }
    /** åˆ›å»ºç”¨æˆ· */
    private String createUser;
    public Long getId()
    {
        return id;
    }
    public void setSfcCode(String sfcCode)
    {
        this.sfcCode = sfcCode;
    }
    /** æ›´æ”¹ç”¨æˆ· */
    private String updateUser;
    public String getSfcCode()
    {
        return sfcCode;
    }
    public void setPalletNo(String palletNo)
    {
        this.palletNo = palletNo;
    }
    /** åˆ›å»ºæ—¶é—´ */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    public String getPalletNo()
    {
        return palletNo;
    }
    public void setCrankshaftNo(String crankshaftNo)
    {
        this.crankshaftNo = crankshaftNo;
    }
    /** æ›´æ–°æ—¶é—´ */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    public String getCrankshaftNo()
    {
        return crankshaftNo;
    }
    public void setState(Long state)
    {
        this.state = state;
    }
    public Long getState()
    {
        return state;
    }
    public void setRemarks(String remarks)
    {
        this.remarks = remarks;
    }
    public String getRemarks()
    {
        return remarks;
    }
    public void setConnectingrodNo(String connectingrodNo)
    {
        this.connectingrodNo = connectingrodNo;
    }
    public String getConnectingrodNo()
    {
        return connectingrodNo;
    }
    public void setCylinder(Long cylinder)
    {
        this.cylinder = cylinder;
    }
    public Long getCylinder()
    {
        return cylinder;
    }
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("sfcCode", getSfcCode())
            .append("palletNo", getPalletNo())
            .append("crankshaftNo", getCrankshaftNo())
            .append("state", getState())
            .append("remarks", getRemarks())
            .append("connectingrodNo", getConnectingrodNo())
            .append("cylinder", getCylinder())
            .toString();
    }
    @TableField(exist = false)
    private String productType;
}
jcdm-main/src/main/java/com/jcdm/main/da/tileMatchRules/controller/DaTileMatchRulesController.java
@@ -6,6 +6,7 @@
import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.collection.CollUtil;
import com.jcdm.common.core.domain.R;
import com.jcdm.main.da.paramCollection.domain.DaParamCollection;
import com.jcdm.main.da.paramCollection.service.IDaParamCollectionService;
import com.jcdm.main.da.tileMatchCollection.domain.DaTileMatchCollection;
@@ -195,7 +196,7 @@
                    XT = lastOne.getParamValue();
                }
                ReadWriteEntity entity6 = new ReadWriteEntity("CFL4HX.HOP040.Partcode", "1");
                ReadWriteEntity entity6 = new ReadWriteEntity("CFL4HX.HOP040.Partcode", 1);
                miloService.writeToOpcByte(entity6);
            }
        } catch (Exception e) {
@@ -203,4 +204,11 @@
        }
        return XT;
    }
    @GetMapping("/getCheckData")
    public R getCheckData(String SNCode, String XT, String CZ){
        List<DaTileMatchRules> daTileMatchRulesList = daTileMatchRulesService.checkData(SNCode, XT, CZ);
        return R.ok(daTileMatchRulesList);
    }
}
jcdm-main/src/main/java/com/jcdm/main/da/tileMatchRules/domain/DaTileMatchRules.java
@@ -1,9 +1,13 @@
package com.jcdm.main.da.tileMatchRules.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.jcdm.common.annotation.Excel;
import com.jcdm.common.core.domain.BaseEntity;
import java.util.Date;
/**
 * é…ç“¦è§„则对象 da_tile_match_rules
@@ -11,9 +15,9 @@
 * @author jiang
 * @date 2024-01-24
 */
public class DaTileMatchRules extends BaseEntity
@Data
public class DaTileMatchRules
{
    private static final long serialVersionUID = 1L;
    /** ä¸»é”®id */
    private Long id;
@@ -44,11 +48,11 @@
    /** è½´å‚数数位置 */
    @Excel(name = "轴参数数位置")
    private Long axisParameterNoPosition;
    private Integer axisParameterNoPosition;
    /** é¢ˆå‚数数位置 */
    @Excel(name = "颈参数数位置")
    private Long neckParameterPosition;
    private Integer neckParameterPosition;
    /** è½´å€¼ */
    @Excel(name = "轴值")
@@ -74,162 +78,12 @@
    @Excel(name = "状态", readConverterExp = "1=合格、2不合格")
    private String state;
    public void setId(Long id)
    {
        this.id = id;
    }
    public Long getId()
    {
        return id;
    }
    public void setProductSeries(String productSeries)
    {
        this.productSeries = productSeries;
    }
    /** åˆ›å»ºæ—¶é—´ */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    public String getProductSeries()
    {
        return productSeries;
    }
    public void setScanObject1(String scanObject1)
    {
        this.scanObject1 = scanObject1;
    }
    public String getScanObject1()
    {
        return scanObject1;
    }
    public void setScanObject2(String scanObject2)
    {
        this.scanObject2 = scanObject2;
    }
    public String getScanObject2()
    {
        return scanObject2;
    }
    public void setAxisName(String axisName)
    {
        this.axisName = axisName;
    }
    public String getAxisName()
    {
        return axisName;
    }
    public void setNeckName(String neckName)
    {
        this.neckName = neckName;
    }
    public String getNeckName()
    {
        return neckName;
    }
    public void setTileName(String tileName)
    {
        this.tileName = tileName;
    }
    public String getTileName()
    {
        return tileName;
    }
    public void setAxisParameterNoPosition(Long axisParameterNoPosition)
    {
        this.axisParameterNoPosition = axisParameterNoPosition;
    }
    public Long getAxisParameterNoPosition()
    {
        return axisParameterNoPosition;
    }
    public void setNeckParameterPosition(Long neckParameterPosition)
    {
        this.neckParameterPosition = neckParameterPosition;
    }
    public Long getNeckParameterPosition()
    {
        return neckParameterPosition;
    }
    public void setAxisValue(String axisValue)
    {
        this.axisValue = axisValue;
    }
    public String getAxisValue()
    {
        return axisValue;
    }
    public void setNeckValue(String neckValue)
    {
        this.neckValue = neckValue;
    }
    public String getNeckValue()
    {
        return neckValue;
    }
    public void setTileColor(String tileColor)
    {
        this.tileColor = tileColor;
    }
    public String getTileColor()
    {
        return tileColor;
    }
    public void setCreateUser(String createUser)
    {
        this.createUser = createUser;
    }
    public String getCreateUser()
    {
        return createUser;
    }
    public void setUpdateUser(String updateUser)
    {
        this.updateUser = updateUser;
    }
    public String getUpdateUser()
    {
        return updateUser;
    }
    public void setState(String state)
    {
        this.state = state;
    }
    public String getState()
    {
        return state;
    }
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("productSeries", getProductSeries())
            .append("scanObject1", getScanObject1())
            .append("scanObject2", getScanObject2())
            .append("axisName", getAxisName())
            .append("neckName", getNeckName())
            .append("tileName", getTileName())
            .append("axisParameterNoPosition", getAxisParameterNoPosition())
            .append("neckParameterPosition", getNeckParameterPosition())
            .append("axisValue", getAxisValue())
            .append("neckValue", getNeckValue())
            .append("tileColor", getTileColor())
            .append("createUser", getCreateUser())
            .append("createTime", getCreateTime())
            .append("updateUser", getUpdateUser())
            .append("updateTime", getUpdateTime())
            .append("state", getState())
            .toString();
    }
    /** æ›´æ–°æ—¶é—´ */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
}
jcdm-main/src/main/java/com/jcdm/main/da/tileMatchRules/service/IDaTileMatchRulesService.java
@@ -58,4 +58,6 @@
     * @return ç»“æžœ
     */
    public int deleteDaTileMatchRulesById(Long id);
    List<DaTileMatchRules> checkData(String SNCode, String XT, String CZ);
}
jcdm-main/src/main/java/com/jcdm/main/da/tileMatchRules/service/impl/DaTileMatchRulesServiceImpl.java
@@ -1,12 +1,22 @@
package com.jcdm.main.da.tileMatchRules.service.impl;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.util.StrUtil;
import com.jcdm.common.utils.DateUtils;
import com.jcdm.main.da.passingStationCollection.domain.ProductNewPassStation;
import com.jcdm.main.da.passingStationCollection.service.ProductNewPassStationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jcdm.main.da.tileMatchRules.mapper.DaTileMatchRulesMapper;
import com.jcdm.main.da.tileMatchRules.domain.DaTileMatchRules;
import com.jcdm.main.da.tileMatchRules.service.IDaTileMatchRulesService;
import javax.annotation.Resource;
/**
 * é…ç“¦è§„则Service业务层处理
@@ -19,6 +29,9 @@
{
    @Autowired
    private DaTileMatchRulesMapper daTileMatchRulesMapper;
    @Resource
    private ProductNewPassStationService productNewPassStationService;
    /**
     * æŸ¥è¯¢é…ç“¦è§„则
@@ -93,4 +106,71 @@
    {
        return daTileMatchRulesMapper.deleteDaTileMatchRulesById(id);
    }
    @Override
    public List<DaTileMatchRules> checkData(String SNCode, String XT, String CZ) {
        List<DaTileMatchRules> resultList =new ArrayList<>();
        ProductNewPassStation productNewPassStation = new ProductNewPassStation();
        productNewPassStation.setSfcCode(SNCode);
        List<ProductNewPassStation> passStationList = productNewPassStationService.getProductPassStationList(productNewPassStation);
        if (CollUtil.isNotEmpty(passStationList)){
            ProductNewPassStation passStation = passStationList.get(0);
            String productType = passStation.getProductType();
            DaTileMatchRules daTileMatchRules = new DaTileMatchRules();
            daTileMatchRules.setProductSeries(productType);
            daTileMatchRules.setScanObject1("箱体");
            daTileMatchRules.setScanObject2("曲轴");
            List<DaTileMatchRules> daTileMatchRulesList = this.selectDaTileMatchRulesList(daTileMatchRules);
            if (StrUtil.isNotBlank(XT) && StrUtil.isNotBlank(CZ)){
                ArrayList<String> xtList = ListUtil.toList(XT.split(";"));
                ArrayList<String> czList = new ArrayList<>();
                String s2 = "";
                if (CZ.contains(";")){
                    czList = ListUtil.toList(CZ.split(";"));
                    if (CollUtil.isNotEmpty(czList) && czList.size()>2){
                        s2 = czList.get(2);
                    }
                } else if (CZ.contains(",")){
                    czList = ListUtil.toList(CZ.split(","));
                    if (CollUtil.isNotEmpty(czList) && czList.size()>1){
                        s2 = czList.get(1);
                    }
                }
                if (CollUtil.isNotEmpty(xtList) && xtList.size()>1 &&
                        StrUtil.isNotBlank(s2)){
                    String s1 = xtList.get(2);
                    if ("380".equals(productType)){
                        for (int i = 1; i < 5; i++){
                            char[] charArray1 = s1.toCharArray();
                            String axisValue;
                            String neckValue;
                            if (charArray1.length >= 7){
                                axisValue = String.valueOf(charArray1[i]);
                            } else {
                                axisValue = "";
                            }
                            char[] charArray2 = s2.toCharArray();
                            if (charArray2.length >= 8){
                                neckValue = String.valueOf(charArray2[i]);
                            } else {
                                neckValue = "";
                            }
                            Integer position = i+1;
                            List<DaTileMatchRules> collect = daTileMatchRulesList.stream().filter(x -> position.equals(x.getAxisParameterNoPosition())
                                    && position.equals(x.getNeckParameterPosition())
                                    && x.getAxisValue().equals(axisValue)
                                    && x.getNeckValue().equals(neckValue)).collect(Collectors.toList());
                            if (CollUtil.isNotEmpty(collect)){
                                DaTileMatchRules daTileMatchRules1 = collect.get(0);
                                resultList.add(daTileMatchRules1);
                            }
                        }
                    }
                }
            }
        }
        return resultList;
    }
}
jcdm-main/src/main/java/com/jcdm/main/plcserver/CustomRunner.java
@@ -7,6 +7,7 @@
import com.jcdm.main.da.opcuaconfig.domain.DaOpcuaConfig;
import com.jcdm.main.da.opcuaconfig.service.IDaOpcuaConfigService;
import com.jcdm.main.da.paramCollection.service.IDaParamCollectionService;
import com.jcdm.main.da.passingStationCollection.service.ProductNewPassStationService;
import com.jcdm.main.da.passingStationCollection.service.impl.DaPassingStationCollectionServiceImpl;
import com.jcdm.main.plcserver.sub.OPCUaSubscription;
import com.jcdm.main.rm.repairRecord.service.IRmRepairRecordService;
@@ -47,6 +48,9 @@
    @Resource
    private IBsTechnologyRouteChildInfoService bsTechnologyRouteChildInfoService;
    @Resource
    private ProductNewPassStationService productNewPassStationService;
    @Override
    public void run(ApplicationArguments args) throws Exception {
@@ -60,7 +64,8 @@
                bsOrderSchedulingService,
                lists,
                rmRepairRecordService,
                bsTechnologyRouteChildInfoService);
                bsTechnologyRouteChildInfoService,
                productNewPassStationService);
        miloService.subscriptionFromOpcUa(collect,100,opcUaSubscription);
    }
jcdm-main/src/main/java/com/jcdm/main/plcserver/conf/OPCElement.java
@@ -47,6 +47,26 @@
    public static final String QUALIFIED = "合格";
    public static final String UN_QUALIFIED = "不合格";
    public static final String OP010_REQUEST_PRODUCT_TYPE = "CFL4HX.OP010.RequestProductType";
    public static final String OP010_SAVE_REQUEST = "CFL4HX.OP010.SaveRequest";
    public static final String OP010_CODE_CHECK = "CFL4HX.OP010.CodeCheck";
    public static final String OP020_CODE_CHECK = "CFL4HX.OP020.CodeCheck";
    public static final String OP020_PRINT_REQUEST = "CFL4HX.OP020.PrintRequest";
    public static final String OP030_CODE_CHECK = "CFL4HX.OP030.CodeCheck";
    public static final String OP040_CODE_CHECK = "CFL4HX.OP040.CodeCheck";
    public static final String OP050_CODE_CHECK = "CFL4HX.OP050.CodeCheck";
    public static final String OP060_CODE_CHECK = "CFL4HX.OP060.CodeCheck";
    public static final String OP030_SAVE_REQUEST = "CFL4HX.OP030.SaveRequest";
    public static final String OP040_SAVE_REQUEST = "CFL4HX.OP040.SaveRequest";
    public static final String OP050_SAVE_REQUEST = "CFL4HX.OP050.SaveRequest";
    public static final String OP060_SAVE_REQUEST = "CFL4HX.OP060.SaveRequest";
    public static final String OP080_SAVE_REQUEST = "CFL4HX.OP080.SaveRequest";
    public static final String OP100_SAVE_REQUEST = "CFL4HX.OP100.SaveRequest";
    public static final String OP050_SAVE_REQUEST_LAST = "CFL4HX.OP050.SaveRequestLast";
    public static final String OP080_SAVE_REQUEST_LAST = "CFL4HX.OP080.SaveRequestLast";
    public static final String OP100_SAVE_REQUEST_LAST = "CFL4HX.OP100.SaveRequestLast";
    public static final String OP060_SAVE_REQUEST_LAST = "CFL4HX.OP060.SaveRequestLast";
    public static final String UN_FINISH = "0";
    public static final String FINISHED = "1";
}
jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java
@@ -3,6 +3,7 @@
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.jcdm.common.core.domain.BaseEntity;
import com.jcdm.main.bs.domain.BsTechnologyRouteChildInfo;
import com.jcdm.main.bs.orderScheduling.domain.BsOrderScheduling;
import com.jcdm.main.bs.orderScheduling.service.IBsOrderSchedulingService;
@@ -13,6 +14,8 @@
import com.jcdm.main.da.paramCollection.domain.DaParamCollection;
import com.jcdm.main.da.paramCollection.service.IDaParamCollectionService;
import com.jcdm.main.da.passingStationCollection.domain.DaPassingStationCollection;
import com.jcdm.main.da.passingStationCollection.domain.ProductNewPassStation;
import com.jcdm.main.da.passingStationCollection.service.ProductNewPassStationService;
import com.jcdm.main.da.passingStationCollection.service.impl.DaPassingStationCollectionServiceImpl;
import com.jcdm.main.plcserver.conf.OPCElement;
import com.jcdm.main.rm.repairRecord.domain.RmRepairRecord;
@@ -21,6 +24,7 @@
import com.kangaroohy.milo.runner.subscription.SubscriptionCallback;
import com.kangaroohy.milo.service.MiloService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
@@ -55,6 +59,7 @@
    public IRmRepairRecordService rmRepairRecordService;
    public IBsTechnologyRouteChildInfoService bsTechnologyRouteChildInfoService;
    public ProductNewPassStationService productNewPassStationService;
    public HashMap<String,List<DaCollectionParamConf>> allCollectParamList = new HashMap<>();
@@ -65,7 +70,8 @@
                             IBsOrderSchedulingService bsOrderSchedulingService,
                             List<DaOpcuaConfig> lists,
                             IRmRepairRecordService rmRepairRecordService,
                             IBsTechnologyRouteChildInfoService bsTechnologyRouteChildInfoService) {
                             IBsTechnologyRouteChildInfoService bsTechnologyRouteChildInfoService,
                             ProductNewPassStationService productNewPassStationService) {
        OPCUaSubscription.miloService = miloService;
        this.collectionParamConfService = collectionParamConfService;
        this.daParamCollectionService = daParamCollectionService;
@@ -74,6 +80,7 @@
        this.lists = lists;
        this.rmRepairRecordService = rmRepairRecordService;
        this.bsTechnologyRouteChildInfoService = bsTechnologyRouteChildInfoService;
        this.productNewPassStationService = productNewPassStationService;
    }
@@ -93,45 +100,104 @@
                    logger.info("-------监听到,{}的CODE_CHECK的信号",identifier);
                    //logger.info("-------time--------------,{}",LocalDateTime.now());
                    //sn
                    this.SNRetrieval(identifier,value.toString());
                    if (identifier.equals(OPCElement.OP120_ZZ_CODE_CHECK) && "1".equals(value.toString())){
                        //总装上线扫码传输数据
                        logger.info("-------监听到,{}的扫码枪扫码的CODE_CHECK的信号",identifier);
                        scannerGunMessage();
                    }
                    if (identifier.equals(OPCElement.OP060_HX_CODE_CHECK) && "1".equals(value.toString())){
                        Object SNCodeObject = miloService.readFromOpcUa("CFL4HX.OP060.Code1").getValue();
                        if (null == SNCodeObject){
                            SNCodeObject = miloService.readFromOpcUa("CFL4HX.OP060.Code").getValue();
                    if (OPCElement.OP010_CODE_CHECK.equals(identifier)){
                        ReadWriteEntity entity = new ReadWriteEntity("CFL4HX.OP010.CodeCheckFeed", 1);
                        OPCUaSubscription.miloService.writeToOpcByte(entity);//写完成
                    } else if (OPCElement.OP020_CODE_CHECK.equals(identifier)) {
                        ReadWriteEntity entity = new ReadWriteEntity("CFL4HX.OP020.CodeCheckFeed", 1);
                        OPCUaSubscription.miloService.writeToOpcByte(entity);//写完成
                    } else if (OPCElement.OP030_CODE_CHECK.equals(identifier)) {
                        ReadWriteEntity entity = new ReadWriteEntity("CFL4HX.OP030.CodeCheckFeed", 1);
                        OPCUaSubscription.miloService.writeToOpcByte(entity);//写完成
                        Object SNCodeObject = miloService.readFromOpcUa("CFL4HX.OP030.Code").getValue();
                        if (ObjectUtil.isNotEmpty(SNCodeObject)){
                            String snCode = SNCodeObject.toString();
                            if (StrUtil.isNotBlank(snCode)){
                                String type = productNewFlag(snCode);
                                if ("280".equals(type) || "380".equals(type)){
                                    //获取箱体码
                                    ProductNewPassStation productNewPassStation = new ProductNewPassStation();
                                    productNewPassStation.setFinishFlag(OPCElement.UN_FINISH);
                                    productNewPassStation.setSfcCode(snCode);
                                    List<ProductNewPassStation> productPassStationList = productNewPassStationService.getProductPassStationList(productNewPassStation);
                                    if (CollUtil.isNotEmpty(productPassStationList)){
                                        List<ProductNewPassStation> collect = productPassStationList.stream().sorted(Comparator.comparing(ProductNewPassStation::getCreateTime).reversed()).collect(Collectors.toList());
                                        ProductNewPassStation productNewPassStation1 = collect.get(0);
                                        String boxCode = productNewPassStation1.getBoxCode();
                                        passingStationCollectionServiceImpl.sendMessage(type+"*"+boxCode,"OP030");
                                    }
                                }
                            }
                        }
                        if (null != SNCodeObject){
                            String XT=null;
                            String CZ=null;
                            String SNCode = SNCodeObject.toString();
                            DaParamCollection ParamCollection = new DaParamCollection();
                            ParamCollection.setSfcCode(SNCode);
                            List<DaParamCollection> DaParamCollectionlist=daParamCollectionService.selectDaParamCollectionList(ParamCollection);
                            List<DaParamCollection> XTParamCollection = DaParamCollectionlist.stream().filter(x -> "箱体".equals(x.getParamName())).collect(Collectors.toList());
                            if (CollUtil.isNotEmpty(XTParamCollection)){
                                DaParamCollection lastOne = XTParamCollection.get(0);
                                XT = lastOne.getParamValue();
                            }
                            List<DaParamCollection> CZParamCollection = DaParamCollectionlist.stream().filter(x -> "曲轴".equals(x.getParamName())).collect(Collectors.toList());
                            if (CollUtil.isNotEmpty(CZParamCollection)){
                                DaParamCollection lastOne = CZParamCollection.get(0);
                                CZ = lastOne.getParamValue();
                            }
                            if(null != XT&&null != CZ) {
                                passingStationCollectionServiceImpl.sendMessage(XT+"*"+CZ,"OP060");
                            }
                    } else if (OPCElement.OP040_CODE_CHECK.equals(identifier)) {
                        ReadWriteEntity entity = new ReadWriteEntity("CFL4HX.OP040.CodeCheckFeed", 1);
                        OPCUaSubscription.miloService.writeToOpcByte(entity);//写完成
                        //推送数据
                        log.info("进入OP040.CodeCheck");
                        tile2("CFL4HX.OP040.CodeCheck");
                    } else {
                        this.SNRetrieval(identifier,value.toString());
                        if (identifier.equals(OPCElement.OP120_ZZ_CODE_CHECK) && "1".equals(value.toString())){
                            //总装上线扫码传输数据
                            logger.info("-------监听到,{}的扫码枪扫码的CODE_CHECK的信号",identifier);
                            scannerGunMessage();
                        }
                    }
                }
                if (collect2.contains(identifier)){
                    if ("1".equals(value.toString())){
                        logger.info("-------监听到,{}的SAVE_REQUEST_LAST的信号",identifier);
                        //logger.info("-------time--------------,{}",LocalDateTime.now());
                        this.SaveData(identifier);
                        //HX线改装
                        if (OPCElement.OP010_REQUEST_PRODUCT_TYPE.equals(identifier)){
                           Object SNCodeObject = miloService.readFromOpcUa("CFL4HX.OP010.Code").getValue();
                           if (ObjectUtil.isNotEmpty(SNCodeObject)){
                               String snCode = SNCodeObject.toString();
                               ReadWriteEntity entity3 = new ReadWriteEntity("CFL4HX.OP010.ProductTypeSN",snCode);
                               OPCUaSubscription.miloService.writeToOpcUa(entity3);//写产品SN号反馈
                               ReadWriteEntity entity2 = new ReadWriteEntity("CFL4HX.OP010.SNDone", 1);
                               OPCUaSubscription.miloService.writeToOpcByte(entity2);//写完成
                           }
                        } else if (OPCElement.OP010_SAVE_REQUEST.equals(identifier)) {
                            ReadWriteEntity entity2 = new ReadWriteEntity("CFL4HX.OP010.SaveFeed", 1);
                            OPCUaSubscription.miloService.writeToOpcByte(entity2);//写完成
                        } else if (OPCElement.OP020_PRINT_REQUEST.equals(identifier)) {
                            Object SNCodeObject = miloService.readFromOpcUa("CFL4HX.OP020.Code").getValue();
                            if (ObjectUtil.isNotEmpty(SNCodeObject)){
                                String snCode = SNCodeObject.toString();
                                if (snCode.startsWith("380")){
                                    String[] split = snCode.split(StrUtil.SPACE);
                                    if (split.length>1){
                                        ReadWriteEntity entity = new ReadWriteEntity("CFL4HX.OP020.PrintSN1", split[0]);
                                        OPCUaSubscription.miloService.writeToOpcByte(entity);//写完成
                                        ReadWriteEntity entity2 = new ReadWriteEntity("CFL4HX.OP020.PrintSN2", split[1]);
                                        OPCUaSubscription.miloService.writeToOpcByte(entity2);//写完成
                                        ReadWriteEntity entity3 = new ReadWriteEntity("CFL4HX.OP020.SendSNDone", 1);
                                        OPCUaSubscription.miloService.writeToOpcByte(entity3);//写完成
                                    }
                                } else {
                                    ReadWriteEntity entity = new ReadWriteEntity("CFL4HX.OP020.PrintSN1", snCode);
                                    OPCUaSubscription.miloService.writeToOpcByte(entity);//写完成
                                    ReadWriteEntity entity3 = new ReadWriteEntity("CFL4HX.OP020.SendSNDone", 1);
                                    OPCUaSubscription.miloService.writeToOpcByte(entity3);//写完成
                                }
                            }
                        } else if (OPCElement.OP030_SAVE_REQUEST.equals(identifier)) {
                            ReadWriteEntity entity2 = new ReadWriteEntity("CFL4HX.OP030.SaveFeed", 1);
                            OPCUaSubscription.miloService.writeToOpcByte(entity2);//写完成
                            cleanForm("CFL4HX.OP030.SaveFeed");
                        } else if (OPCElement.OP040_SAVE_REQUEST.equals(identifier)) {
                            cleanForm040(OPCElement.OP040_SAVE_REQUEST);
                            ReadWriteEntity entity2 = new ReadWriteEntity("CFL4HX.OP040.SaveFeed", 1);
                            OPCUaSubscription.miloService.writeToOpcByte(entity2);//写完成
                        } else {
                            this.SaveData(identifier);
                        }
                    }
                }
            }
@@ -210,34 +276,56 @@
                    miloService.writeToOpcByte(entity);
                    logger.info("监听到返回codecheckfeed信号,{}",entity);
                    //首站传输订单号
                    if (OPCElement.OP050_HX_CODE_CHECK.equals(Node)){
                        //查询订单号
                        BsOrderScheduling bsOrderScheduling = new BsOrderScheduling();
                        bsOrderScheduling.setEngineNo(SNCode);
                        List<BsOrderScheduling> tempList = bsOrderSchedulingService.selectBsOrderSchedulingList(bsOrderScheduling);
                        String orderNum = "";
                        if (CollUtil.isNotEmpty(tempList)){
                            BsOrderScheduling bsOrderScheduling1 = tempList.get(0);
                            orderNum = bsOrderScheduling1.getOrderNo();
                        }
                        ReadWriteEntity entity2 = new ReadWriteEntity(parts[0]+"."+parts[1]+".OrderNumber", orderNum);
                        miloService.writeToOpcUa(entity2);
                    }
//                    if (OPCElement.OP050_HX_CODE_CHECK.equals(Node)){
//                        //查询订单号
//                        BsOrderScheduling bsOrderScheduling = new BsOrderScheduling();
//                        bsOrderScheduling.setEngineNo(SNCode);
//                        List<BsOrderScheduling> tempList = bsOrderSchedulingService.selectBsOrderSchedulingList(bsOrderScheduling);
//                        String orderNum = "";
//                        if (CollUtil.isNotEmpty(tempList)){
//                            BsOrderScheduling bsOrderScheduling1 = tempList.get(0);
//                            orderNum = bsOrderScheduling1.getOrderNo();
//                        }
//                        ReadWriteEntity entity2 = new ReadWriteEntity(parts[0]+"."+parts[1]+".OrderNumber", orderNum);
//                        miloService.writeToOpcUa(entity2);
//                    }
                    //如果是返修工位需要传输返修工位号
                    if (OPCElement.OP465_ZZ_CODE_CHECK.equals(Node) || OPCElement.OP355_ZZ_CODE_CHECK.equals(Node)
                    || OPCElement.OP695_ZZ_CODE_CHECK.equals(Node) || OPCElement.OP755_ZZ_CODE_CHECK.equals(Node)){
                        rework(SNCode,Node,daPassingStationCollections,rmRepairRecords);
                    }
                    if (OPCElement.OP020_HX_CODE_CHECK.equals(Node)) {
                        //激光打码
                        String[] printcode=SNCode.split("\\s+");
                        ReadWriteEntity entity3 = new ReadWriteEntity("CFL4HX.HOP020.PrintCode1", printcode[0]);
                        OPCUaSubscription.miloService.writeToOpcUa(entity3);//写SN
                        ReadWriteEntity entity5 = new ReadWriteEntity("CFL4HX.HOP020.PrintCode2", printcode[1]);
                        OPCUaSubscription.miloService.writeToOpcUa(entity5);//写SN
                        ReadWriteEntity entity6 = new ReadWriteEntity("CFL4HX.HOP020.SNDoor", "1");
                        logger.info("发动机号{},请求打码内容写入成功,返回SNDoor信号信号1",SNCode);
                        miloService.writeToOpcByte(entity6);
                    if (OPCElement.OP050_CODE_CHECK.equals(Node)) {
                        //新机型050
                        String type = productNewFlag(SNCode);
                        if ("280".equals(type) || "380".equals(type)){
                            ProductNewPassStation productNewPassStation = new ProductNewPassStation();
                            productNewPassStation.setSfcCode(SNCode);
                            List<ProductNewPassStation> passStationList = productNewPassStationService.getProductPassStationList(productNewPassStation);
                            ProductNewPassStation productNewPassStation2 = new ProductNewPassStation();
                            productNewPassStation2.setFinishFlag("0");
                            List<ProductNewPassStation> collect = productNewPassStationService.getProductPassStationList(productNewPassStation2)
                                    .stream().sorted(Comparator.comparing(ProductNewPassStation::getCreateTime))
                                    .collect(Collectors.toList());
                            String partSfcCode = "";
                            if (CollUtil.isNotEmpty(collect)){
                                ProductNewPassStation passStation = collect.get(0);
                                partSfcCode = passStation.getSfcCode();
                            }
                            if (CollUtil.isNotEmpty(passStationList)){
                                ProductNewPassStation passStation = passStationList.get(0);
                                String productType = "";
                                if (ObjectUtils.isNotEmpty(passStation)){
                                    productType = passStation.getProductType();
                                }
                                passingStationCollectionServiceImpl.sendMessage(SNCode+"*sfcCode*"+productType+"*"+partSfcCode,"OP050");
                            }
                        }
                    }
                    if (OPCElement.OP060_CODE_CHECK.equals(Node)){
                        String type = productNewFlag(SNCode);
                        if ("280".equals(type) || "380".equals(type)){
                            checkBoxRod(Node);
                        }
                    }
                    System.out.println(entity);
@@ -415,7 +503,26 @@
                    allCollectParamList.put(gatherAddress,list);
                }
            }
            //60只采集老车型
            if (OPCElement.OP060_SAVE_REQUEST.equals(Node) || OPCElement.OP060_SAVE_REQUEST_LAST.equals(Node)){
                String s = productNewFlag(SNCode);
                if ("280".equals(s) || "380".equals(s)){
                    list = new ArrayList<>();
                }
            }
            //80、100只采集新车型
            if (OPCElement.OP080_SAVE_REQUEST.equals(Node)
                    || OPCElement.OP080_SAVE_REQUEST_LAST.equals(Node)
                    || OPCElement.OP100_SAVE_REQUEST.equals(Node)
                    || OPCElement.OP100_SAVE_REQUEST_LAST.equals(Node)){
                String s = productNewFlag(SNCode);
                if (StrUtil.isNotEmpty(s)){
                    if (!"280".equals(s) && !"380".equals(s)){
                        list = new ArrayList<>();
                    }
                }
            }
            List<String> nodeIdList = list.stream().map(info -> {
                String nodeid = info.getGatherAddress();
                return nodeid;
@@ -431,9 +538,19 @@
                //返回plc保存成功
                if (parts.length==3){
                    if ("SaveRequest".equals(parts[2])){
                        if (OPCElement.OP050_SAVE_REQUEST.equals(Node)){
                            cleanForm050(Node);
                        } else if (OPCElement.OP060_SAVE_REQUEST.equals(Node)){
                            cleanForm060(Node);
                        }
                        ReadWriteEntity entity = new ReadWriteEntity(parts[0] + "." + parts[1] + ".SaveFeed", 1);
                                miloService.writeToOpcByte(entity);
                    }else if ("SaveRequestLast".equals(parts[2])){
                        if (OPCElement.OP050_SAVE_REQUEST_LAST.equals(Node)){
                            cleanForm050(Node);
                        } else if (OPCElement.OP060_SAVE_REQUEST_LAST.equals(Node)){
                            cleanForm060(Node);
                        }
                        ReadWriteEntity entity = new ReadWriteEntity(parts[0] + "." + parts[1] + ".SaveFeedLast", 1);
                                miloService.writeToOpcByte(entity);
                    }
@@ -470,21 +587,22 @@
                    daParamCollectionService.saveBeachDaParamCollection(daParamCollectionlist);
                    logger.info("{}发动机({})采集数据保存完成",SNCode,Node);
                }
            Long beatTime = 0L;
            if (ObjectUtil.isNotEmpty(object)){
                String str = object.toString();
                beatTime = Float.valueOf(str).longValue();
            }
            Object ProductStatus = miloService.readFromOpcUa(parts[0] + "." + parts[1] + ".ProductStatus").getValue();
            logger.info("ProductStatus,{}",ProductStatus.toString());
            String str1="合格" ;
            if (ObjectUtil.isNotEmpty(ProductStatus)){
                logger.info("ProductStatus,{}",ProductStatus.toString());
                String productStatusString = ProductStatus.toString();
                if (productStatusString.contains("2") || productStatusString.contains("3")){
                    str1="不合格";
                }else {
                    str1="合格";
                }
            }
            Long beatTime = 0L;
            if (ObjectUtil.isNotEmpty(object)){
                String str = object.toString();
                beatTime = Float.valueOf(str).longValue();
            }
            DaPassingStationCollection PassingStationCollection=new DaPassingStationCollection();
            PassingStationCollection.setSfcCode(SNCode);
@@ -518,4 +636,123 @@
            bsOrderSchedulingService.updateBsOrderScheduling(bsOrderScheduling);
        }
    }
    public String productNewFlag(String SNCode){
        String type;
        if (SNCode.startsWith("280")){
            type = "280";
        } else if (SNCode.startsWith("380")){
            type = "380";
        }else {
            type = "oldType";
        }
        return type;
    }
    public void tile2(String Node) throws Exception {
        String[] parts = Node.split("[.]");
        Object SNCodeObject = miloService.readFromOpcUa(parts[0] + "." + parts[1] + ".Code").getValue();
        if (null != SNCodeObject) {
            String SNCode = SNCodeObject.toString();
            String productNewFlag = productNewFlag(SNCode);
            if ("380".equals(productNewFlag)){
                ProductNewPassStation passStation = new ProductNewPassStation();
                passStation.setSfcCode(SNCode);
                List<ProductNewPassStation> productPassStationList = productNewPassStationService.getProductPassStationList(passStation);
                if (CollUtil.isNotEmpty(productPassStationList)){
                    ProductNewPassStation productNewPassStation = productPassStationList.get(0);
                    String boxCode = productNewPassStation.getBoxCode();
                    String productType = productNewPassStation.getProductType();
                    passingStationCollectionServiceImpl.sendMessage(productType+"*"+boxCode, "OP040");
                }
            } else if ("280".equals(productNewFlag)){
            }
        }
    }
    public void cleanForm(String Node) throws Exception {
        String[] parts = Node.split("[.]");
        Object SNCodeObject = miloService.readFromOpcUa(parts[0] + "." + parts[1] + ".Code").getValue();
        if (ObjectUtils.isNotEmpty(SNCodeObject)){
            String snCode = SNCodeObject.toString();
            String s = productNewFlag(snCode);
            if ("280".equals(s) || "380".equals(s)){
                passingStationCollectionServiceImpl.sendMessage("clean","OP030");
            }
        }
    }
    public void cleanForm040(String Node) throws Exception {
        String[] parts = Node.split("[.]");
        Object SNCodeObject = miloService.readFromOpcUa(parts[0] + "." + parts[1] + ".Code").getValue();
        if (ObjectUtils.isNotEmpty(SNCodeObject)){
            String snCode = SNCodeObject.toString();
            String s = productNewFlag(snCode);
            if ("280".equals(s) || "380".equals(s)){
                passingStationCollectionServiceImpl.sendMessage("clean*clean","OP040");
            }
        }
    }
    public void cleanForm050(String Node) throws Exception {
        String[] parts = Node.split("[.]");
        Object SNCodeObject = miloService.readFromOpcUa(parts[0] + "." + parts[1] + ".Code").getValue();
        if (ObjectUtils.isNotEmpty(SNCodeObject)){
            String snCode = SNCodeObject.toString();
            String s = productNewFlag(snCode);
            if ("280".equals(s) || "380".equals(s)){
                ProductNewPassStation passStation = new ProductNewPassStation();
                passStation.setSfcCode(snCode);
                List<ProductNewPassStation> productPassStationList = productNewPassStationService.getProductPassStationList(passStation);
                if (CollUtil.isNotEmpty(productPassStationList)){
                    productNewPassStationService.updatePassStationBySfcCode(snCode);
                }
                passingStationCollectionServiceImpl.sendMessage("clean*clean","OP050");
            }
        }
    }
    public void cleanForm060(String Node) throws Exception {
        String[] parts = Node.split("[.]");
        Object SNCodeObject = miloService.readFromOpcUa(parts[0] + "." + parts[1] + ".Code").getValue();
        if (ObjectUtils.isNotEmpty(SNCodeObject)){
            String snCode = SNCodeObject.toString();
            String s = productNewFlag(snCode);
            if ("280".equals(s) || "380".equals(s)){
                passingStationCollectionServiceImpl.sendMessage("clean*clean","OP060");
            }
        }
    }
    public void checkBoxRod(String Node) throws Exception {
        String[] parts = Node.split("[.]");
        Object SNCodeObject = miloService.readFromOpcUa(parts[0] + "." + parts[1] + ".Code").getValue();
        if (null != SNCodeObject) {
            String SNCode = SNCodeObject.toString();
            String s = productNewFlag(SNCode);
            if ("280".equals(s) || "380".equals(s)){
                sendTo060(SNCode,parts);
            }
        }
    }
    private void sendTo060(String SNCode, String[] parts) throws Exception {
        String boxCode = "";
        String rodCode = "";
        ProductNewPassStation productNewPassStation = new ProductNewPassStation();
        productNewPassStation.setSfcCode(SNCode);
        List<ProductNewPassStation> productPassStationList = productNewPassStationService.getProductPassStationList(productNewPassStation);
        if (CollUtil.isNotEmpty(productPassStationList)){
            ProductNewPassStation passStation = productPassStationList.get(0);
            boxCode = passStation.getBoxCode();
            rodCode = passStation.getRodCode();
        }
        //配瓦校验
        passingStationCollectionServiceImpl.sendMessage(boxCode + "*" + rodCode + "*" + SNCode, parts[1]);
    }
}
jcdm-main/src/main/java/com/jcdm/main/rm/repairRecord/mapper/RmRepairRecordMapper.java
@@ -50,6 +50,7 @@
     * @return ç»“æžœ
     */
    public int deleteRmRepairRecordById(Long id);
    public int deleteRmRepairRecordByCode(String code);
    /**
     * æ‰¹é‡åˆ é™¤è¿”修记录
jcdm-main/src/main/resources/mapper/da/passingStationCollection/ProductNewPassStationMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jcdm.main.da.passingStationCollection.mapper.ProductNewPassStationMapper">
    <resultMap type="ProductNewPassStation" id="ProductNewPassStationResult">
        <result property="id"    column="id"    />
        <result property="sfcCode"    column="sfc_code"    />
        <result property="rodCode"    column="rod_code"    />
        <result property="finishFlag"    column="finish_flag"    />
        <result property="productType"    column="product_type"    />
        <result property="createTime"    column="create_time"    />
        <result property="boxCode"    column="box_code"    />
        <result property="balanceCode"    column="balance_code"    />
    </resultMap>
    <sql id="selectProductNewPassStationVo">
        select id, sfc_code,rod_code, finish_flag,product_type,create_time,box_code,balance_code from product_new_pass_station
    </sql>
    <insert id="insertPassStation">
        insert into product_new_pass_station
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="sfcCode != null">sfc_code,</if>
            <if test="rodCode != null">rod_code,</if>
            <if test="finishFlag != null">finish_flag,</if>
            <if test="createTime != null">create_time,</if>
            <if test="productType != null">product_type,</if>
            <if test="boxCode != null">box_code,</if>
            <if test="balanceCode != null">balance_code,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="sfcCode != null">#{sfcCode},</if>
            <if test="rodCode != null">#{rodCode},</if>
            <if test="finishFlag != null">#{finishFlag},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="productType != null">#{productType},</if>
            <if test="boxCode != null">#{boxCode},</if>
            <if test="balanceCode != null">#{balanceCode},</if>
        </trim>
    </insert>
    <update id="updatePassStation">
        update product_new_pass_station
        <trim prefix="SET" suffixOverrides=",">
            <if test="sfcCode != null">#{sfcCode},</if>
            <if test="rodCode != null">#{rodCode},</if>
            <if test="finishFlag != null">#{finishFlag},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="productType != null">#{productType},</if>
            <if test="boxCode != null">#{boxCode},</if>
            <if test="balanceCode != null">#{balanceCode},</if>
        </trim>
        where id = #{productNewPassStation.id}
    </update>
    <update id="updatePassStationBySfcCode">
        update product_new_pass_station set finish_flag = '1' where sfc_code = #{sfcCode}
    </update>
    <update id="updatePassStationRodCodeBySfcCode"> update product_new_pass_station set finish_flag = '1' where sfc_code = #{sfcCode}</update>
    <update id="updatePassStationBalanceCode">
        update product_new_pass_station set balance_code = #{balanceCode} where sfc_code = #{sfcCode}
    </update>
    <update id="updatePassStationRodCode">
        update product_new_pass_station set rod_code = #{rodCode} where sfc_code = #{sfcCode}
    </update>
    <select id="getPassStation"
            resultMap="ProductNewPassStationResult">
        <include refid="selectProductNewPassStationVo"/>
        <where>
            <if test="sfcCode != null">and sfc_code = #{sfcCode}</if>
            <if test="rodCode != null">and rod_code = #{rodCode}</if>
            <if test="finishFlag != null">and finish_flag = #{finishFlag}</if>
            <if test="productType != null">and product_type = #{productType}</if>
            <if test="boxCode != null">and box_code = #{boxCode}</if>
            <if test="balanceCode != null">and balance_code = #{balanceCode}</if>
        </where>
    </select>
    <select id="getProductPassStationList"
            resultMap="ProductNewPassStationResult">
        <include refid="selectProductNewPassStationVo"/>
        <where>
            <if test="sfcCode != null">and sfc_code = #{sfcCode}</if>
            <if test="rodCode != null">and rod_code = #{rodCode}</if>
            <if test="finishFlag != null">and finish_flag = #{finishFlag}</if>
            <if test="productType != null">and product_type = #{productType}</if>
            <if test="boxCode != null">and box_code = #{boxCode}</if>
            <if test="balanceCode != null">and balance_code = #{balanceCode}</if>
        </where>
    </select>
</mapper>
jcdm-main/src/main/resources/mapper/da/tileMatchRules/DaTileMatchRulesMapper.xml
@@ -39,8 +39,8 @@
            <if test="tileName != null  and tileName != ''"> and tile_name like concat('%', #{tileName}, '%')</if>
            <if test="axisParameterNoPosition != null "> and axis_parameter_no_position = #{axisParameterNoPosition}</if>
            <if test="neckParameterPosition != null "> and neck_parameter_position = #{neckParameterPosition}</if>
            <if test="axisValue != null  and axisValue != ''"> and axis_value = SUBSTRING(#{axisValue}, axis_parameter_no_position+1, 1)</if>
            <if test="neckValue != null  and neckValue != ''"> and neck_value = SUBSTRING(#{neckValue}, neck_parameter_position+1, 1)</if>
            <if test="axisValue != null  and axisValue != ''"> and axis_value = SUBSTRING(#{axisValue}, axis_parameter_no_position, 1)</if>
            <if test="neckValue != null  and neckValue != ''"> and neck_value = SUBSTRING(#{neckValue}, neck_parameter_position, 1)</if>
            <if test="tileColor != null  and tileColor != ''"> and tile_color = #{tileColor}</if>
            <if test="createUser != null  and createUser != ''"> and create_user = #{createUser}</if>
            <if test="updateUser != null  and updateUser != ''"> and update_user = #{updateUser}</if>
jcdm-main/src/main/resources/mapper/rm/repairRecord/RmRepairRecordMapper.xml
@@ -128,4 +128,8 @@
            #{id}
        </foreach>
    </delete>
    <delete id="deleteRmRepairRecordByCode">
        delete from rm_repair_record where box_code = #{code}
    </delete>
</mapper>
jcdm-ui/src/api/main/bs/tileMatchRules/tileMatchRules.js
@@ -50,3 +50,10 @@
    params: param
  })
}
export function getCheckData(query) {
  return request({
    url: '/da/tileMatchRules/getCheckData',
    method: 'get',
    params: query
  })
}
jcdm-ui/src/api/main/da/tileMatchCollection/tileMatchCollection.js
@@ -42,3 +42,10 @@
    method: 'delete'
  })
}
export function getBalanceData(param) {
  return request({
    url: '/da/tileMatchCollection/getBalanceData',
    method: 'get',
    params: param
  })
}
jcdm-ui/src/assets/images/463XT.png
jcdm-ui/src/views/main/cfkb/BalanceShaft/index.vue
@@ -1,41 +1,26 @@
<template>
  <div class="app-container">
    <div style="width: 100%">
      <el-card class="box-card" >
        <el-form :model="from" size="large" :inline="true" label-width="68px" @submit.native.prevent>
          <el-form-item label-width="200" label="平衡轴码" :prop="from.scanObject2"  style="align-content: center">
            <input v-model="from.scanObject2"
                   ref="inputdata"
                   style="height: 39px; width: 300px"
                   placeholder="请输入平衡轴码"
            />
          </el-form-item>
        </el-form>
        <el-form :model="from" ref="queryForm" :inline="true" >
          <el-form-item  label="机型:" prop="productSeries" >
            <el-select v-model="from.productSeries" placeholder="" clearable   style="width: 105px">
              <el-option
                v-for="dict in dict.type.productseries"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
              />
            </el-select>
          </el-form-item>
          <el-form-item  label="瓦名称:" prop="tileName" >
            <el-select v-model="from.tileName" placeholder="" clearable style="width: 125px" >
              <el-option
                v-for="dict in dict.type.tilename"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
              />
            </el-select>
          </el-form-item>
          <el-button type="primary" icon="el-icon-refresh" @click="handleQuery">查询</el-button>
        </el-form>
      </el-card>
      <el-row :gutter="3">
        <el-col :span="10">
          <el-card class="box-card" >
            <el-form :model="queryParams" size="large" :inline="true" label-width="68px" @submit.native.prevent>
              <el-form-item label-width="200" label="平衡轴码" :prop="queryParams.scanObject2"  style="align-content: center">
                <input v-model="queryParams.scanObject2"
                       ref="inputdata"
                       style="height: 39px; width: 300px"
                       placeholder="请输入平衡轴码"
                />
              </el-form-item>
            </el-form>
          </el-card>
        </el-col>
        <el-col :span="14">
          <el-card shadow="always" class="boxSize">
            <span class="centerText" >{{noticeMessage}}</span>
          </el-card>
        </el-col>
      </el-row>
      <el-col :span="24" >
        <el-card class="bottom-card">
          <div slot="header" class="clearfix">
@@ -52,9 +37,6 @@
            <el-descriptions-item label="平衡轴码">
              <span>{{queryParams.scanObject2}}</span>
            </el-descriptions-item>
            <el-descriptions-item label="瓦名称">
              <span>{{queryParams.tileName}}</span>
            </el-descriptions-item>
            <el-descriptions-item label="配瓦颜色">
              <span v-for="(word, index) in queryParams.words" :key="index" :style="{ backgroundColor: queryParams.colors[index],fontSize: '30px',}">{{ word }}</span>
            </el-descriptions-item>
@@ -69,6 +51,9 @@
import VueQr from 'vue-qr'
import { listTileMatchRules, getTileMatchRules, delTileMatchRules, addTileMatchRules, updateTileMatchRules } from "@/api/main/bs/tileMatchRules/tileMatchRules";
import {setBarcode} from "@/api/main/bs/tileMatchRules/tileMatchRules";
import { getUrl } from "@/api/main/bs/orderScheduling/orderScheduling";
import WebSocketReconnect from "@/utils/WebsocketTool";
import { getBalanceData } from "@/api/main/da/tileMatchCollection/tileMatchCollection"
export default {
  name: "index",
  dicts: ['colour_hex','productseries','axisname','neckname','tilename'],
@@ -77,6 +62,7 @@
  },
  data(){
    return{
      noticeMessage: "请等待托盘数据读取",
      scannerFlag: false,
      loading: true,
      tileMatchKbList: [],
@@ -85,12 +71,12 @@
      from:{
        pageNum: 1,
        pageSize: 10,
        productSeries: '380Y',
        productSeries: '',
        scanObject1: null,
        scanObject2: '',
        axisName: null,
        neckName: null,
        tileName: '平衡轴瓦',
        tileName: '',
        axisParameterNoPosition: null,
        neckParameterPosition: null,
        axisValue: null,
@@ -125,6 +111,7 @@
    }
  },
  mounted() {
    this.getWebUrl()
    this.setFocus()
    this.$refs.inputdata.addEventListener('keydown',this.handleScannerInput)
  },
@@ -132,6 +119,63 @@
    this.$refs.inputdata.removeEventListener('keydown',this.handleScannerInput)
  },
  methods:{
    getWebUrl() {
      getUrl().then(res => {
        this.websocketUrl = res + "OP040"
        console.log('websocketUrl:', this.websocketUrl)
        this.initWebSocket()
      })
    },
    initWebSocket: function () {
      //判断当前浏览器是否支持WebSocket
      if ('WebSocket' in window) {
        //连接WebSocket节点
        this.websocket = new WebSocketReconnect(this.websocketUrl);
        //接收到消息的回调方法
        this.websocket.socket.onmessage = (event) => {
          let data = event.data;
          if (data != null && data !== '') {
            this.result = JSON.parse(data);
            console.log('this.result.server_message',this.result.server_message)
            const parts3 = this.result.server_message.split("*");
            if (parts3.length >= 2) {
              if (parts3[0] === 'clean'){
                console.log('090909')
                this.queryParams.productSeries = ''
                this.queryParams.scanObject1 = ''
                this.queryParams.scanObject2 = ''
                this.queryParams.words = ['------', '------', ]
                this.queryParams.colors = ['#FFFFFF', '#FFFFFF']
                this.noticeMessage = "请等待托盘数据读取"
              }else {
                this.queryParams.productSeries = parts3[0];
                this.queryParams.scanObject1 = parts3[1];
                if (this.queryParams.scanObject1 !== null && this.queryParams.scanObject1 !== ''){
                  this.noticeMessage = "请扫描平衡轴码"
                }
              }
            }
          }
        }
        //监听窗口关闭事件,当窗口关闭时,主动去关闭websocket连接,防止连接还没断开就关闭窗口,server端会抛异常。
        window.onbeforeunload = function () {
          this.websocket.close()
        }
        //关闭连接
        function closeWebSocket() {
          this.websocket.close()
        }
        //发送消息
        function send() {
          this.websocket.socket.send({kk: 123})
        }
      } else {
        alert('浏览器不支持webSocket')
      }
    },
    refresh() {
      location.reload();
    },
@@ -142,126 +186,41 @@
    },
    handleScannerInput(event){
      if (this.scannerFlag){
        this.from.scanObject2 = ''
        this.queryParams.scanObject2 = ''
        this.$refs.inputdata.value = ''
        this.scannerFlag = false
      }
      const input = event.target
      const inputValue = input.value
      this.from.scanObject2 = inputValue
      this.queryParams.scanObject2 = inputValue
      if (event.key === 'Enter'){
        this.scannerFlag = true
        console.log('条码:',this.from.scanObject2)
        console.log('条码:',this.queryParams.scanObject2)
        //扫描完成
        if (typeof this.from.scanObject2 !== 'undefined') {
          console.log('条码:',this.from.scanObject2,'HOP040')
          setBarcode({barcode:this.from.scanObject2,locationCode:'HOP040'}).then(res =>{
        if (this.queryParams.scanObject2 !== null && this.queryParams.scanObject2 !== '') {
          console.log('条码:',this.queryParams.scanObject2,'OP040')
          getBalanceData({boxCode: this.queryParams.scanObject1,balanceCode: this.queryParams.scanObject2,productType: this.queryParams.productSeries}).then(res =>{
            console.log('res',res)
            this.from.scanObject1=res
            this.handleQuery()
            if (res.code === 200){
              this.$message({
                message:'配瓦成功',
                type:'success'
              })
              this.noticeMessage = '配瓦成功'
              for (var i = 0; i < res.data.length; i++) {
                this.queryParams.colors[i] = res.data[i].tileColor;
                this.queryParams.words[i] = res.data[i].tileName;
              }
            }else {
              this.$message({
                message:res.msg,
                type:'warning'
              })
            }
          })
        }
      }
    },
    /** æœç´¢æŒ‰é’®æ“ä½œ */
    handleQuery() {
      this.clear();
      if(this.from.scanObject1 !== null && this.from.scanObject2 !== null
        // && this.from.axisName !== null && this.from.axisName !== ""
        // && this.from.neckName !== null && this.from.neckName !== ""
        // && this.from.tileName !== null && this.from.tileName !== ""
        && this.from.productSeries !== null && this.from.productSeries !== "")
      {
        this.axisValueextracted();
        this.neckValueextracted();
        if(this.queryParams.axisValue !== null && this.queryParams.neckValue !== null){
          this.insetFromToQueryParams();
          this.getList();
        }
        else{
          const h = this.$createElement;
          this.$message({
            message: h('p',null, [
              h('span', null, '警告 '),
              h('i', { style: 'color: black' }, '箱体码或平衡轴码输入有误'),
              h()]),
            type: 'error',
            center: true,
            offset:300
          });
        }
      }
      else{
        console.log("搜索条件",this.from.scanObject1 ,this.from.scanObject2)
        const h = this.$createElement;
        this.$message({
          message: h('p',null, [
            h('span', null, '警告 '),
            h('i', { style: 'color: black' }, '请填写所有搜索条件'),
            h()]),
          type: 'error',
          center: true,
          offset:300
        });
      }
    },
    // å–箱体码第三段为配瓦值
    axisValueextracted() {
      const parts1 = this.from.scanObject1.split(",");
      if (parts1.length >= 2) {
        //const axisValueextracted = parts1[2].substring(3,4);
        const axisValueextracted = parts1[1];
        return this.queryParams.axisValue= axisValueextracted;
      }
    },
    //取曲轴码第三段为配瓦值
    neckValueextracted() {
      const parts2 = this.from.scanObject2.split(";");
      if (parts2.length >= 3) {
        //const neckValueextracted = parts2[2].substring(3,4);
        const neckValueextracted = parts2[2];
        return this.queryParams.neckValue= neckValueextracted;
      }
    },
    //取配瓦颜色
    getList() {
      let queryParams = {
        productSeries : this.queryParams.productSeries,
        axisName : this.queryParams.axisName,
        neckName : this.queryParams.neckName,
        tileName : this.queryParams.tileName,
        axisValue: this.queryParams.axisValue,
        neckValue: this.queryParams.neckValue,
      }
      console.log(queryParams)
      listTileMatchRules(queryParams).then(response => {
        // this.queryParams.tileColor = response.rows[0].tileColor;
        this.queryParams.words= ['------', '------']
        this.queryParams.colors= ['#FFFFFF', '#FFFFFF']
        for (var i=0;i<response.rows.length;i++){
          this.queryParams.colors[i]=response.rows[i].tileColor;
          this.queryParams.words[i]=response.rows[i].tileName;
        }
        console.log('颜色:',response)
      });
    },
    clear(){
      this.queryParams.axisValue=null;
      this.queryParams.neckValue=null;
    },
    insetFromToQueryParams(){
      this.queryParams.productSeries=this.from.productSeries;
      this.queryParams.axisName=this.from.axisName;
      this.queryParams.neckName=this.from.neckName;
      this.queryParams.tileName=this.from.tileName;
      this.queryParams.scanObject1=this.from.scanObject1;
      this.queryParams.scanObject2=this.from.scanObject2;
    }
  },
}
</script>
@@ -276,5 +235,16 @@
::v-deep .el-input .el-input--medium .el-input--suffix{
  width: 200px;
}
.centerText{
  color: red;
  font-weight: bold;
  font-size: 35px;
  display: flex;
  align-content: center;
  justify-content: center;
}
.boxSize {
  height: 80px;
}
</style>
jcdm-ui/src/views/main/cfkb/connectingRod/index.vue
@@ -3,23 +3,6 @@
    <div style="width: 100%">
      <el-card class="box-card" >
        <el-form :model="from" size="large" :inline="true" label-width="78px" @submit.native.prevent>
          <el-form-item label="曲轴码:" prop="scanObject1" >
            <el-input
              style="width: 350px"
              v-model="from.scanObject1"
              placeholder="请输曲轴码"
              clearable
              @keyup.enter.native="handleQuery"
              @input="handleQuery"
            />
          </el-form-item>
          <el-form-item label-width="200" label="托盘码" :prop="from.scanObject3"  style="align-content: center">
            <input v-model="from.scanObject3"
                   ref="inputdata2"
                   style="height: 39px; width: 300px"
                   placeholder="请输入托盘码"
            />
          </el-form-item>
          <el-form-item label-width="200" label="连杆码" :prop="from.scanObject2"  style="align-content: center">
            <input v-model="from.scanObject2"
                   ref="inputdata1"
@@ -28,93 +11,86 @@
            />
          </el-form-item>
        </el-form>
        <el-form :model="from" ref="queryForm" :inline="true" >
          <el-form-item  label="机型:" prop="productSeries" >
            <el-select v-model="from.productSeries" placeholder="" clearable   style="width: 105px">
              <el-option
                v-for="dict in dict.type.productseries"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
              />
            </el-select>
          </el-form-item>
          <el-form-item  label="瓦名称:" prop="tileName" >
            <el-select v-model="from.tileName" placeholder="" clearable style="width: 125px" >
              <el-option
                v-for="dict in dict.type.tilename"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
              />
            </el-select>
          </el-form-item>
          <el-button type="primary" icon="el-icon-refresh" @click="handleQuery">查询</el-button>
        </el-form>
      </el-card>
      <el-col :span="24" >
        <el-card class="bottom-card">
          <div slot="header" class="clearfix">
            <i class="el-icon-tickets"></i>
            <span style="font-weight: bold">当前产品信息</span>
      <el-row :gutter="0">
        <el-col :span="6">
          <div >
            <el-card style="height: 500px">
              <el-descriptions class="margin-top" :column="1" direction="horizontal">
                <el-descriptions-item label="机型">{{queryParams.productSeries}}</el-descriptions-item>
                <el-descriptions-item label="发动机编号">{{queryParams.sfcCode}}</el-descriptions-item>
                <el-descriptions-item label="曲轴码">{{queryParams.scanObject1}}</el-descriptions-item>
                <el-descriptions-item label="连杆码">{{queryParams.scanObject2}}</el-descriptions-item>
                <el-descriptions-item label="瓦名称">{{queryParams.tileName}}</el-descriptions-item>
                <!--                <el-descriptions-item label="缸体编号">{{queryParams.axisName}}</el-descriptions-item>-->
                <el-descriptions-item label="1缸配瓦颜色"><span  style="color: #FFFFFF;"  :style="{ backgroundColor: queryParams.tileColor1 }">{{queryParams.tileColor1}}</span></el-descriptions-item>
                <el-descriptions-item label="2缸配瓦颜色"><span  style="color: #FFFFFF;"  :style="{ backgroundColor: queryParams.tileColor2 }">{{queryParams.tileColor2}}</span></el-descriptions-item>
                <el-descriptions-item label="3缸配瓦颜色"><span  style="color: #FFFFFF;"  :style="{ backgroundColor: queryParams.tileColor3 }">{{queryParams.tileColor3}}</span></el-descriptions-item>
              </el-descriptions>
            </el-card>
          </div>
          <el-descriptions :column="1"  :label-style="{'font-size': '20px'}" border  :content-style="{'min-width': '300px'}">
            <el-descriptions-item label="机型">
              <span>{{queryParams.productSeries}}</span>
            </el-descriptions-item>
            <el-descriptions-item label="发动机编号">
              <span>{{queryParams.sfcCode}}</span>
            </el-descriptions-item>
            <el-descriptions-item label="托盘码">
              <span>{{queryParams.scanObject3}}</span>
            </el-descriptions-item>
            <el-descriptions-item label="曲轴码">
              <span>{{queryParams.scanObject1}}</span>
            </el-descriptions-item>
            <el-descriptions-item label="连杆码">
              <span>{{queryParams.scanObject2}}</span>
            </el-descriptions-item>
            <el-descriptions-item label="瓦名称">
              <span>{{queryParams.tileName}}</span>
            </el-descriptions-item>
            <el-descriptions-item label="缸体编号">
              <span>{{queryParams.axisName}}</span>
            </el-descriptions-item>
            <el-descriptions-item label="配瓦颜色">
              <span  style="color: #FFFFFF;"  :style="{ backgroundColor: queryParams.tileColor }">{{queryParams.tileColor}}</span>
            </el-descriptions-item>
          </el-descriptions>
          <el-divider></el-divider>
        </el-card>
      </el-col>
        </el-col>
        <el-col :span="18">
          <div>
            <el-card style="height: 500px; overflow: auto">
              <el-table border :data="tileMatchMiddlewareList">
                <el-table-column
                  type="index"
                  label="序号"
                  width="50"
                  align="center"></el-table-column>
                <el-table-column label="发动机号" align="center" prop="sfcCode" width="180"></el-table-column>
                <el-table-column label="曲轴码" align="center" prop="crankshaftNo" width="250"></el-table-column>
                <el-table-column label="连杆码" align="center" prop="connectingrodNo" width="250"></el-table-column>
                <el-table-column label="气缸编号" align="center" prop="cylinder" width="100"></el-table-column>
                <el-table-column label="状态" align="center" prop="state" width="100">
                  <template slot-scope="scope">
                    <dict-tag :options="dict.type.corod" :value="scope.row.state"/>
                  </template>
                </el-table-column>
              </el-table>
              <pagination
                v-show="total>0"
                :total="total"
                :page.sync="queryParams.pageNum"
                :limit.sync="queryParams.pageSize"
                @pagination="getListData"
              />
            </el-card>
          </div>
        </el-col>
      </el-row>
    </div>
  </div>
</template>
<script>
import VueQr from 'vue-qr'
import {setBarcode} from "@/api/main/da/tileMatchMiddleware/tileMatchMiddleware";
import {listTileMatchRules, getTileMatchRules, delTileMatchRules, addTileMatchRules, updateTileMatchRules} from "@/api/main/bs/tileMatchRules/tileMatchRules";
import {listTileMatchRules} from "@/api/main/bs/tileMatchRules/tileMatchRules";
import {listTileMatchMiddleware} from "@/api/main/da/tileMatchMiddleware/tileMatchMiddleware";
import {getSumDataMethod} from "@/api/main/bs/orderScheduling/orderScheduling";
export default {
  name: "index",
  dicts: ['colour_hex','productseries','axisname','neckname','tilename'],
  dicts: ['colour_hex','productseries','axisname','neckname','tilename','corod'],
  components: {
    VueQr,
  },
  data(){
    return{
      total: 0,
      scannerFlag: false,
      loading: true,
      tileMatchKbList: [],
      tileMatchMiddlewareList: [],
      qrCode: '',
      // æŸ¥è¯¢å‚æ•°
      from:{
        locationCode: 'CR010',
        pageNum: 1,
        pageSize: 10,
        productSeries:'380Y',
        productSeries:'',
        scanObject1: null,
        scanObject2: null,
        scanObject3: null,
        axisName: null,
        neckName: null,
        tileName: '连杆瓦',
@@ -122,7 +98,6 @@
        neckParameterPosition: null,
        axisValue: null,
        neckValue: null,
        tileColor: null,
        createUser: null,
        updateUser: null,
        state: null,
@@ -134,7 +109,6 @@
        productSeries: null,
        scanObject1: null,
        scanObject2: null,
        scanObject3: null,
        axisName: null,
        neckName: null,
        tileName: null,
@@ -142,7 +116,10 @@
        neckParameterPosition: null,
        axisValue: null,
        neckValue: null,
        tileColor: null,
        tileColor1: null,
        tileColor2: null,
        tileColor3: null,
        tileColor4: null,
        createUser: null,
        updateUser: null,
        state: null,
@@ -153,13 +130,11 @@
  },
  mounted() {
    this.setFocus1()
    this.setFocus2()
    this.getListData()
    this.$refs.inputdata1.addEventListener('keydown',this.handleScannerInput1)
    this.$refs.inputdata2.addEventListener('keydown',this.handleScannerInput2)
  },
  beforeDestroy() {
    this.$refs.inputdata1.removeEventListener('keydown',this.handleScannerInput1)
    this.$refs.inputdata2.removeEventListener('keydown',this.handleScannerInput2)
  },
  methods:{
    refresh() {
@@ -170,14 +145,8 @@
        this.$refs.inputdata1.focus()
      })
    },
    setFocus2(){
      this.$nextTick(()=>{
        this.$refs.inputdata2.focus()
      })
    },
    handleScannerInput1(event){
      if (this.scannerFlag){
        this.from.scanObject2 = ''
        this.$refs.inputdata1.value = ''
        this.scannerFlag = false
      }
@@ -186,54 +155,75 @@
      this.from.scanObject2 = inputValue
      if (event.key === 'Enter'){
        this.scannerFlag = true
        //console.log('条码:',this.from.scanObject2)
        this.$refs.inputdata2.focus();
        //扫描完成
        if (typeof this.from.scanObject2 !== 'undefined') {
          setBarcode({barcode:this.from.scanObject2,locationCode:this.from.scanObject3}).then(res =>{
            console.log('res',res)
            this.queryParams.sfcCode=res.sfcCode;
            this.from.scanObject1=res.crankshaftNo;
            this.queryParams.axisName=res.cylinder;
            this.handleQuery()
            //this.from.scanObject2=this.from.scanObject2
            //this.queryParams.scanObject1=this.from.scanObject1
          })
        console.log('sssss',this.from.scanObject2)
        if (this.from.scanObject2 !== null && this.from.scanObject2 !== '') {
          console.log('r22222222222222222')
          if (this.from.scanObject2.indexOf(";") !== -1){
            const parts1 = this.from.scanObject2.split(";");
            console.log('paes',parts1)
            if (parts1.length >= 3) {
              setBarcode({barcode:this.from.scanObject2,locationCode:this.from.locationCode}).then(res =>{
                console.log('res123456',res)
                if (res.id !== null && res.id !== ''){
                  this.$message({
                    message: '配瓦成功',
                    type: 'success'
                  });
                  this.from.productSeries = res.productType
                  this.queryParams.productSeries = res.productType
                  this.queryParams.sfcCode=res.sfcCode;
                  this.from.scanObject1=res.crankshaftNo;
                  this.from.connectingrodNo=res.connectingrodNo;
                  this.queryParams.axisName=res.cylinder;
                  this.handleQuery()
                }
                //this.queryParams.scanObject1=this.from.scanObject1
              })
            } else {
              this.$message({
                message: '连杆码格式错误,请检查',
                type: 'error'
              });
            }
          }else {
            this.$message({
              message: '连杆码格式错误,请检查',
              type: 'error'
            });
          }
        }else {
          this.$message({
            message: '连杆码格式错误,请检查',
            type: 'error'
          });
          console.log('3232323')
          // this.handleQuery()
        }
        this.handleQuery()
      }
    },
    handleScannerInput2(event){
      if (this.scannerFlag){
        this.from.scanObject3 = ''
        this.$refs.inputdata2.value = ''
        this.scannerFlag = false
      }
      const input = event.target
      const inputValue = input.value
      this.from.scanObject3= inputValue
      if (event.key === 'Enter'){
        this.scannerFlag = true
        console.log('条码2:',this.from.scanObject3)
        this.$refs.inputdata1.focus();
        this.from.scanObject2 = ''
        //扫描完成
      }
    },
    /** æœç´¢æŒ‰é’®æ“ä½œ */
    handleQuery() {
      this.clear();
      if(this.from.scanObject3 !== null && this.from.scanObject2 !== null
        && this.from.productSeries !== null && this.from.productSeries !== "")
      console.log("1111")
      if(this.from.scanObject2 !== null && this.from.productSeries !== null && this.from.productSeries !== "")
      {
        console.log("222")
        this.axisValueextracted();
        this.neckValueextracted();
        console.log('this.queryParams.axisValue',this.queryParams.axisValue)
        console.log('this.queryParams.neckValue',this.queryParams.neckValue)
        if(this.queryParams.axisValue !== null && this.queryParams.neckValue !== null){
          console.log('77777')
          console.log('this.queryParams.axisValue',this.queryParams.axisValue)
          console.log('this.queryParams.neckValue',this.queryParams.neckValue)
          this.insetFromToQueryParams();
          this.getList();
        }
        else{
          console.log('000000')
          const h = this.$createElement;
          this.$message({
            message: h('p',null, [
@@ -262,22 +252,30 @@
    // å–箱体码第三段为配瓦值
    axisValueextracted() {
      const parts1 = this.from.scanObject2.split(";");
      if (parts1.length >= 3) {
        //const axisValueextracted = parts1[2].substring(3,4);
        const axisValueextracted = parts1[2];
        return this.queryParams.axisValue= axisValueextracted;
      console.log("33")
      if (this.from.scanObject2.indexOf(";") !== -1){
        const parts1 = this.from.scanObject2.split(";");
        if (parts1.length >= 3) {
          console.log("44",parts1)
          //const axisValueextracted = parts1[2].substring(3,4);
          const axisValueextracted = parts1[2];
          return this.queryParams.axisValue= axisValueextracted;
        }
      }
    },
    //取曲轴码第三段为配瓦值
    neckValueextracted() {
      const parts2 = this.from.scanObject1.split(";");
      if (parts2.length >= 3) {
        //const neckValueextracted = parts2[2].substring(3,4);
        const neckValueextracted = parts2[2];
        return this.queryParams.neckValue= neckValueextracted;
      console.log('4432')
      console.log('scanObject1',this.from.scanObject1)
      if (this.from.scanObject1.indexOf(";") !== -1){
        const parts2 = this.from.scanObject1.split(";");
        if (parts2.length >= 3) {
          //const neckValueextracted = parts2[2].substring(3,4);
          const neckValueextracted = parts2[2];
          return this.queryParams.neckValue= neckValueextracted;
        }
      }
    },
    //取配瓦颜色
@@ -292,7 +290,22 @@
      }
      console.log('参数:',queryParams)
      listTileMatchRules(queryParams).then(response => {
        this.queryParams.tileColor = response.rows[0].tileColor;
        console.log('this.queryParams',this.queryParams);
        console.log('res',response)
        if (response.rows.length>0){
          if(this.queryParams.axisName===1){
            this.queryParams.tileColor1 = response.rows[0].tileColor;
          }
          if(this.queryParams.axisName===2){
            this.queryParams.tileColor2 = response.rows[0].tileColor;
          }
          if(this.queryParams.axisName===3){
            this.queryParams.tileColor3 = response.rows[0].tileColor;
          }
        }
        console.log(this.queryParams);
        this.getListData();
      });
    },
    clear(){
@@ -301,12 +314,28 @@
    },
    insetFromToQueryParams(){
      this.queryParams.productSeries=this.from.productSeries;
      //this.queryParams.axisName=this.from.axisName;
      this.queryParams.neckName=this.from.neckName;
      this.queryParams.tileName=this.from.tileName;
      this.queryParams.scanObject1=this.from.scanObject1;
      this.queryParams.scanObject2=this.from.scanObject2;
      this.queryParams.scanObject3=this.from.scanObject3;
    },
    //查询列表
    getListData(){
      console.log('this.queryParams111',this.dataList)
      const query = {
        pageNum:this.queryParams.pageNum,
        pageSize:this.queryParams.pageSize
      }
      listTileMatchMiddleware(query).then(res => {
        console.log('resssss',res)
        if (res.code === 200){
          // this.$message({
          //   message: '查询成功',
          //   type: 'success'
          // });
          this.tileMatchMiddlewareList = res.rows
          this.total = res.total
        }
      })
    }
  },
jcdm-ui/src/views/main/cfkb/connectingRodUp/index.vue
@@ -28,18 +28,18 @@
          </el-card>
        </el-col>
      </el-row>
      <el-card class="box-card" >
        <el-form :model="from" size="large" :inline="true" label-width="68px" @submit.native.prevent>
          <el-form-item label-width="200" label="活塞连杆托盘码" :prop="from.scanObject2"  style="align-content: center">
            <input v-model="from.scanObject2"
                   ref="inputdata"
                   style="height: 39px; width: 300px"
                   placeholder="请输入活塞连杆托盘码"
            />
          </el-form-item>
<!--          <el-button type="primary" icon="el-icon-refresh" @click="handleQuery">查询</el-button>-->
        </el-form>
      </el-card>
      <!--      <el-card class="box-card" >-->
      <!--        <el-form :model="from" size="large" :inline="true" label-width="68px" @submit.native.prevent>-->
      <!--          <el-form-item label-width="200" label="活塞连杆托盘码" :prop="from.scanObject2"  style="align-content: center">-->
      <!--            <input v-model="from.scanObject2"-->
      <!--                   ref="inputdata"-->
      <!--                   style="height: 39px; width: 300px"-->
      <!--                   placeholder="请输入活塞连杆托盘码"-->
      <!--            />-->
      <!--          </el-form-item>-->
      <!--&lt;!&ndash;          <el-button type="primary" icon="el-icon-refresh" @click="handleQuery">查询</el-button>&ndash;&gt;-->
      <!--        </el-form>-->
      <!--      </el-card>-->
      <el-col :span="24" >
        <el-card class="bottom-card">
          <div slot="header" class="clearfix">
@@ -50,10 +50,10 @@
            <el-descriptions-item label="机型">
              <span>{{queryParams.productSeries}}</span>
            </el-descriptions-item>
            <el-descriptions-item label="箱体码">
            <el-descriptions-item label="箱体对应SN码">
              <span>{{queryParams.scanObject1}}</span>
            </el-descriptions-item>
            <el-descriptions-item label="曲轴码">
            <el-descriptions-item label="曲轴对应SN码">
              <span>{{queryParams.scanObject2}}</span>
            </el-descriptions-item>
            <el-descriptions-item label="结果">
@@ -70,7 +70,10 @@
import VueQr from 'vue-qr'
import { listTileMatchRules, getTileMatchRules, delTileMatchRules, addTileMatchRules, updateTileMatchRules } from "@/api/main/bs/tileMatchRules/tileMatchRules";
import {listStationConf,getIp} from "@/api/main/sc/stationConf";
import {setBarcodeup} from "@/api/main/da/tileMatchMiddleware/tileMatchMiddleware";
import {setBarcodeup, outSign, getDetailData} from "@/api/main/da/tileMatchMiddleware/tileMatchMiddleware";
import {getUrl} from "@/api/main/bs/orderScheduling/orderScheduling";
import WebSocketReconnect from "@/utils/WebsocketTool";
import result from "../../../../components/Crontab/result.vue";
export default {
  name: "index",
  dicts: ['colour_hex','productseries','axisname','neckname','tilename'],
@@ -130,59 +133,94 @@
    }
  },
  mounted() {
    this.setFocus()
    this.getStationConf()
    //this.getNowTime()
    this.$refs.inputdata.addEventListener('keydown',this.handleScannerInput)
  },
  beforeDestroy() {
    this.$refs.inputdata.removeEventListener('keydown',this.handleScannerInput)
    this.getWebUrl()
    this.getDetailMessage()
  },
  methods:{
    refresh() {
      location.reload();
    },
    setFocus(){
      this.$nextTick(()=>{
        this.$refs.inputdata.focus()
    getWebUrl(){
      getUrl().then(res=>{
        this.websocketUrl = res+"OP050"
        console.log('websocketUrl:',this.websocketUrl)
        this.initWebSocket()
      })
    },
    handleScannerInput(event){
      if (this.scannerFlag){
        this.from.scanObject2 = ''
        this.$refs.inputdata.value = ''
        this.scannerFlag = false
      }
      const input = event.target
      const inputValue = input.value
      this.from.scanObject2 = inputValue
      if (event.key === 'Enter'){
        this.scannerFlag = true
        //扫描完成
        if (typeof this.from.scanObject2 !== 'undefined'&& typeof this.locationCode !== 'undefined' ) {
          setBarcodeup({barcode:this.from.scanObject2,locationCode:this.locationCode}).then(res => {
            if (res===''){
              this.$message({
                message:res.msg,
                type:'warning'
              })
            }else {
              this.$message({
                message:'操作成功',
                type:'success'
              })
              console.log('返回:',res)
              this.queryParams.productSeries=res.sfcCode;
              this.queryParams.scanObject1=res.connectingRodNo;
              this.queryParams.scanObject2=res.PalletNo;
              this.queryParams.words="扫码成功";
              this.queryParams.tileColor='#00FF00';
    initWebSocket: function (){
      //判断当前浏览器是否支持WebSocket
      if ('WebSocket' in window) {
        //连接WebSocket节点
        this.websocket = new WebSocketReconnect(this.websocketUrl);
        //接收到消息的回调方法
        this.websocket.socket.onmessage = (event) => {
          let data = event.data;
          if (data != null && data !== ''){
            this.result = JSON.parse(data);
            const resultMessage = this.result.server_message.split("*");
            console.log('resultMessage',resultMessage)
            if (resultMessage.length >=3){
              if (resultMessage[1] === "sfcCode"){
                this.queryParams.scanObject1 = resultMessage[0]
                this.queryParams.productSeries = resultMessage[2]
                this.queryParams.scanObject2 = resultMessage[3]
              } else if (resultMessage[1] === "rodCode"){
                this.queryParams.scanObject2 = resultMessage[0]
                this.queryParams.productSeries = resultMessage[2]
              } else if (resultMessage[1] === "clean"){
                this.queryParams.scanObject1 = ""
                this.queryParams.scanObject2 = ""
                this.queryParams.words = ""
                this.queryParams.tileColor = ""
              }
            }
          })
            if (this.queryParams.scanObject1 !== null && this.queryParams.scanObject1 !== ''
              && this.queryParams.scanObject2 !== null && this.queryParams.scanObject2 !== ''){
              if (this.queryParams.scanObject1 === this.queryParams.scanObject2){
                this.queryParams.words = "配对成功"
                this.queryParams.tileColor = "#3dcc1d"
                //请求出站
                // this.passStation()
              }else {
                this.queryParams.words = "配对失败"
                this.queryParams.tileColor = "#f50909"
              }
            }
            // const parts3 = this.result.server_message.split("*");
            // if (parts3.length >= 2) {
            //   this.from.scanObject2=parts3[0];
            //   this.queryParams.words=parts3[1];
            //   this.queryParams.tileColor= parts3[2];
            //   this.handleQuery();
            // }
          }
        }
        //监听窗口关闭事件,当窗口关闭时,主动去关闭websocket连接,防止连接还没断开就关闭窗口,server端会抛异常。
        window.onbeforeunload = function () {
          this.websocket.close()
        }
        //关闭连接
        function closeWebSocket() {
          this.websocket.close()
        }
        //发送消息
        function send() {
          this.websocket.socket.send({ kk: 123 })
        }
      } else {
        alert('浏览器不支持webSocket')
      }
    },
    //刷新获取信息
    getDetailMessage(){
      getDetailData().then(res => {
        if (res.data == 200){
          console.log('res200',res)
          this.queryParams.scanObject1 = res.SfcCode
          this.queryParams.productSeries = res.productSeries
        }
      })
    },
    /** æŸ¥è¯¢å·¥ä½ç»ˆç«¯é…ç½®åˆ—表 */
    getStationConf() {
      getIp().then(response => {
@@ -195,35 +233,33 @@
        });
      });
    },
    passStation(){
      outSign().then(res =>{
        console.log("res",res)
        if (res.code === 200){
          console.log('1212121')
          this.$message({
            message: '匹配成功,已过站',
            type: 'success',
            duration:3000
          });
          this.queryParams.productSeries = ''
          this.queryParams.scanObject1 = ''
          this.queryParams.scanObject2 = ''
          this.queryParams.words = ''
          this.queryParams.tileColor = ''
        }
      })
    },
    /** æœç´¢æŒ‰é’®æ“ä½œ */
    handleQuery() {
      this.clear();
      if(this.from.scanObject1 !== null && this.from.scanObject2 !== null
        && this.from.axisName !== null && this.from.axisName !== ""
        && this.from.neckName !== null && this.from.neckName !== ""
        && this.from.tileName !== null && this.from.tileName !== ""
        && this.from.productSeries !== null && this.from.productSeries !== "")
      if(this.from.scanObject2 !== null)
      {
        this.axisValueextracted();
        this.neckValueextracted();
        if(this.queryParams.axisValue !== null && this.queryParams.neckValue !== null){
          this.insetFromToQueryParams();
          this.getList();
        }
        else{
          const h = this.$createElement;
          this.$message({
            message: h('p',null, [
              h('span', null, '警告 '),
              h('i', { style: 'color: black' }, '箱体码或曲轴码输入有误'),
              h()]),
            type: 'error',
            center: true,
            offset:300
          });
        }
      }
      else{
        this.insetFromToQueryParams();
        //this.getList();
      } else{
        const h = this.$createElement;
        this.$message({
          message: h('p',null, [
@@ -236,26 +272,12 @@
        });
      }
    },
    // å–箱体码第三段为配瓦值
    axisValueextracted() {
      const parts1 = this.from.scanObject1.split(";");
      if (parts1.length >= 3) {
        //const axisValueextracted = parts1[2].substring(3,4);
        const axisValueextracted = parts1[2];
        return this.queryParams.axisValue= axisValueextracted;
      }
    },
    //取曲轴码第三段为配瓦值
    neckValueextracted() {
      const parts2 = this.from.scanObject2.split(";");
      if (parts2.length >= 3) {
        //const neckValueextracted = parts2[2].substring(3,4);
        const neckValueextracted = parts2[2];
        return this.queryParams.neckValue= neckValueextracted;
      }
    cleanForm(){
      this.queryParams.productSeries = ""
      this.queryParams.scanObject1 = ""
      this.queryParams.scanObject2 = ""
      this.queryParams.words = ""
      this.queryParams.tileColor = ""
    },
    //取配瓦颜色
    getList() {
@@ -278,10 +300,7 @@
    },
    insetFromToQueryParams(){
      this.queryParams.productSeries=this.from.productSeries;
      this.queryParams.axisName=this.from.axisName;
      this.queryParams.neckName=this.from.neckName;
      this.queryParams.tileName=this.from.tileName;
      this.queryParams.scanObject1=this.from.scanObject1;
      this.queryParams.scanObject2=this.from.scanObject2;
    }
jcdm-ui/src/views/main/cfkb/crankshaft/index.vue
@@ -2,78 +2,11 @@
  <div class="app-container">
    <div style="width: 100%">
      <el-card class="box-card" >
        <el-form :model="from" ref="queryForm" :inline="true" >
          <el-form-item label="箱体码:" prop="scanObject1" >
            <el-input
              style="width: 350px"
              v-model="from.scanObject1"
              placeholder="请输入箱体码"
              clearable
              @keyup.enter.native="handleQuery"
              @input="handleQuery"
            />
          </el-form-item>
          <el-form-item label="曲轴码:" prop="scanObject2" >
            <el-input
              style="width: 350px"
              v-model="from.scanObject2"
              placeholder="请输入曲轴码"
              clearable
              @keyup.enter.native="handleQuery"
              @input="handleQuery"
            />
          </el-form-item>
        </el-form>
        <el-form :model="from" ref="queryForm" :inline="true" >
          <el-form-item  label="机型:" prop="productSeries" >
            <el-select v-model="from.productSeries" placeholder="" clearable   style="width: 105px">
              <el-option
                v-for="dict in dict.type.productseries"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
                @keyup.enter.native="handleQuery"
              />
            </el-select>
          </el-form-item>
<!--          <el-form-item  label="轴名称:" prop="axisName" >-->
<!--            <el-select v-model="from.axisName" placeholder="" clearable style="width: 125px">-->
<!--              <el-option-->
<!--                v-for="dict in dict.type.axisname"-->
<!--                :key="dict.value"-->
<!--                :label="dict.label"-->
<!--                :value="dict.value"-->
<!--                @keyup.enter.native="handleQuery"-->
<!--              />-->
<!--            </el-select>-->
<!--          </el-form-item>-->
<!--          <el-form-item  label="颈名称:" prop="neckName" >-->
<!--            <el-select v-model="from.neckName" placeholder="" clearable style="width: 125px">-->
<!--              <el-option-->
<!--                v-for="dict in dict.type.neckname"-->
<!--                :key="dict.value"-->
<!--                :label="dict.label"-->
<!--                :value="dict.value"-->
<!--                @keyup.enter.native="handleQuery"-->
<!--              />-->
<!--            </el-select>-->
<!--          </el-form-item>-->
          <el-form-item  label="瓦名称:" prop="tileName" >
            <el-select v-model="from.tileName" placeholder="" clearable style="width: 125px" >
              <el-option
                v-for="dict in dict.type.tilename"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
                @keyup.enter.native="handleQuery"
              />
            </el-select>
          </el-form-item>
          <el-button type="primary" icon="el-icon-refresh" @click="handleQuery">查询</el-button>
        </el-form>
        <div slot="header" style="text-align: center">
          <span style="font-weight: bold; font-size: 30px; text-align: center">曲轴配瓦</span>
        </div>
      </el-card>
      <el-col :span="24" >
      <el-col :span="14" >
        <el-card class="bottom-card">
          <div slot="header" class="clearfix">
            <i class="el-icon-tickets"></i>
@@ -89,18 +22,18 @@
            <el-descriptions-item label="曲轴码">
              <span>{{queryParams.scanObject2}}</span>
            </el-descriptions-item>
<!--            <el-descriptions-item label="轴名称">-->
<!--              <span>{{queryParams.axisName}}</span>-->
<!--            </el-descriptions-item>-->
<!--            <el-descriptions-item label="颈名称">-->
<!--              <span>{{queryParams.neckName}}</span>-->
<!--            </el-descriptions-item>-->
            <!--            <el-descriptions-item label="轴名称">-->
            <!--              <span>{{queryParams.axisName}}</span>-->
            <!--            </el-descriptions-item>-->
            <!--            <el-descriptions-item label="颈名称">-->
            <!--              <span>{{queryParams.neckName}}</span>-->
            <!--            </el-descriptions-item>-->
            <el-descriptions-item label="瓦名称">
              <span>{{queryParams.tileName}}</span>
            </el-descriptions-item>
<!--            <el-descriptions-item label="重量">-->
<!--              <span>{{queryParams.weight}}</span>-->
<!--            </el-descriptions-item>-->
            <!--            <el-descriptions-item label="重量">-->
            <!--              <span>{{queryParams.weight}}</span>-->
            <!--            </el-descriptions-item>-->
            <el-descriptions-item label="配瓦颜色">
              <span v-for="(word, index) in queryParams.words" :key="index" :style="{ backgroundColor: queryParams.colors[index],fontSize: '30px',}">{{ word }}</span>
            </el-descriptions-item>
@@ -108,14 +41,40 @@
          <el-divider></el-divider>
        </el-card>
      </el-col>
      <el-col :span="10" >
        <div id="block"  >
          <!-- å˜é‡èµ‹å€¼ :src="imageUrl"  -->
          <!-- ç›´æŽ¥è¯»å–文件路径 :src="require('@/assets/images/profile.jpg')" -->
          <el-image id="imageRef" fit="contain" :src="require('@/assets/images/463XT.png')" style="width:480px;height:390px;"
                    @click="clickMarkPoint($event)"></el-image>
          <div1 class="marker" id="marker5" style="width: 20px; height: 20px; backgroundColor: red; right: 88px; bottom: 132px; position: relative; border-radius: 50%;"
          >
            <span><font style="color:yellow;text-align:center">5</font></span>
          </div1>
          <div2 class="marker" id="marker4" style="width: 20px; height: 20px; background-color: red; right: 173px; bottom: 132px; position: relative; border-radius: 50%;">
            <span><font style="color:yellow;text-align:center">4</font></span>
          </div2>
          <div3 class="marker" id="marker3" style="width: 20px; height: 20px; background-color: red; right: 260px; bottom: 132px; position: relative; border-radius: 50%;">
            <span><font style="color:yellow;text-align:center">3</font></span>
          </div3>
          <div4 class="marker" id="marker2" style="width: 20px; height: 20px; background-color: red; right: 345px; bottom: 132px; position: relative; border-radius: 50%;">
            <span><font style="color:yellow;text-align:center">2</font></span>
          </div4>
          <div5 class="marker" id="marker1" style="width: 20px; height: 20px; background-color: red; right: 435px; bottom: 132px; position: relative; border-radius: 50%;">
            <span><font style="color:yellow;text-align:center">1</font></span>
          </div5>
        </div>
      </el-col>
    </div>
  </div>
</template>
<script>
import VueQr from 'vue-qr'
import { listTileMatchRules, getTileMatchRules, delTileMatchRules, addTileMatchRules, updateTileMatchRules } from "@/api/main/bs/tileMatchRules/tileMatchRules";
import { listTileMatchRules,getTileMatchRules, delTileMatchRules, addTileMatchRules, updateTileMatchRules } from "@/api/main/bs/tileMatchRules/tileMatchRules";
import {forceUploadMethod, getUrl} from "@/api/main/bs/orderScheduling/orderScheduling";
import WebSocketReconnect from "@/utils/WebsocketTool";
import {getCheckData} from "../../../../api/main/bs/tileMatchRules/tileMatchRules";
export default {
  name: "index",
  dicts: ['colour_hex','productseries','axisname','neckname','tilename'],
@@ -133,11 +92,12 @@
      from:{
        pageNum: 1,
        pageSize: 10,
        productSeries: '380Y',
        // scanObject1: 'ONYL01FZ0120003023123;1206B0026;D2212BA',
        // scanObject2: 'P0NYK0410001000;T231107031;D2222232;S500003',
        scanObject1: null,
        scanObject2: null,
        productSeries: '',
        scanObject1: '',
        scanObject2: '',
        SNCode: '',
        // scanObject1: null,
        // scanObject2: null,
        axisName: null,
        neckName: null,
        tileName: '主轴瓦',
@@ -177,14 +137,15 @@
  mounted() {
    this.getWebUrl()
  },
  methods:{
    getWebUrl(){
      getUrl().then(res=>{
        this.websocketUrl = res+"OP060"
  methods: {
    getWebUrl() {
      getUrl().then(res => {
        this.websocketUrl = res + "OP060"
        console.log('websocketUrl:', this.websocketUrl)
        this.initWebSocket()
      })
    },
    initWebSocket: function (){
    initWebSocket: function () {
      //判断当前浏览器是否支持WebSocket
      if ('WebSocket' in window) {
        //连接WebSocket节点
@@ -192,13 +153,28 @@
        //接收到消息的回调方法
        this.websocket.socket.onmessage = (event) => {
          let data = event.data;
          if (data != null && data !== ''){
          if (data != null && data !== '') {
            this.result = JSON.parse(data);
            const parts3 = this.result.server_message.split("*");
            if (parts3.length >= 2) {
              this.from.scanObject1=parts3[0];
              this.from.scanObject2=parts3[1];
              this.handleQuery();
              if (parts3[0] === 'clean'){
                this.from.scanObject1 = ''
                this.from.scanObject2 = ''
                this.from.SNCode = ''
                this.queryParams.scanObject1 = ''
                this.queryParams.scanObject2 = ''
                this.queryParams.SNCode = ''
                this.queryParams.productSeries = ''
                this.from.productSeries = ''
                this.queryParams.words = ['------', '------', '------', '------']
                this.queryParams.colors = ['#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF']
              } else {
                this.from.scanObject1 = parts3[0];
                this.from.scanObject2 = parts3[1];
                this.from.SNCode = parts3[2];
                this.handleQuery();
              }
            }
            // if (this.form.scanObject1 !== null && this.form.scanObject1 !== ''){
            //    this.handleQuery();
@@ -209,13 +185,15 @@
        window.onbeforeunload = function () {
          this.websocket.close()
        }
        //关闭连接
        function closeWebSocket() {
          this.websocket.close()
        }
        //发送消息
        function send() {
          this.websocket.socket.send({ kk: 123 })
          this.websocket.socket.send({kk: 123})
        }
      } else {
        alert('浏览器不支持webSocket')
@@ -223,99 +201,116 @@
    },
    /** æœç´¢æŒ‰é’®æ“ä½œ */
    handleQuery() {
      console.log('111111111')
      this.clear();
      if(this.from.scanObject1 !== null && this.from.scanObject2 !== null
      if (this.from.scanObject1 !== null && this.from.scanObject1 !== ""
        // && this.from.axisName !== null && this.from.axisName !== ""
        // && this.from.neckName !== null && this.from.neckName !== ""
        // && this.from.tileName !== null && this.from.tileName !== ""
        && this.from.productSeries !== null && this.from.productSeries !== "")
      {
        && this.from.scanObject2 !== null && this.from.scanObject2 !== "") {
        console.log('2222222')
        this.axisValueextracted();
        this.neckValueextracted();
        if(this.queryParams.axisValue !== null && this.queryParams.neckValue !== null){
        if (this.queryParams.axisValue !== null && this.queryParams.neckValue !== null) {
          this.insetFromToQueryParams();
          this.getList();
        }
        else{
        } else {
          const h = this.$createElement;
          this.$message({
            message: h('p',null, [
            message: h('p', null, [
              h('span', null, '警告 '),
              h('i', { style: 'color: black' }, '箱体码或曲轴码输入有误'),
              h('i', {style: 'color: black'}, '箱体码或曲轴码输入有误'),
              h()]),
            type: 'error',
            center: true,
            offset:300
            offset: 300
          });
        }
      }
      else{
      } else {
        const h = this.$createElement;
        this.$message({
          message: h('p',null, [
          message: h('p', null, [
            h('span', null, '警告 '),
            h('i', { style: 'color: black' }, '请填写所有搜索条件'),
            h('i', {style: 'color: black'}, '请填写所有搜索条件'),
            h()]),
          type: 'error',
          center: true,
          offset:300
          offset: 300
        });
      }
    },
    // å–箱体码第三段为配瓦值
    axisValueextracted() {
      const parts1 = this.from.scanObject1.split(",");
      if (parts1.length >= 2) {
        //const axisValueextracted = parts1[2].substring(3,4);
        const axisValueextracted = parts1[1];
        return this.queryParams.axisValue= axisValueextracted;
      console.log("33")
      if (this.from.scanObject1.indexOf(";") !== -1) {
        const parts1 = this.from.scanObject1.split(";");
        if (parts1.length >= 3) {
          console.log("44", parts1)
          //const axisValueextracted = parts1[2].substring(3,4);
          const axisValueextracted = parts1[2];
          return this.queryParams.axisValue = axisValueextracted;
        }
      }
    },
    //取曲轴码第三段为配瓦值
    neckValueextracted() {
      const parts2 = this.from.scanObject2.split(";");
      if (parts2.length >= 3) {
        //const neckValueextracted = parts2[2].substring(3,4);
        const neckValueextracted = parts2[2];
        return this.queryParams.neckValue= neckValueextracted;
      console.log('4432')
      console.log('scanObject2', this.from.scanObject2)
      if (this.from.scanObject2.indexOf(";") !== -1) {
        const parts2 = this.from.scanObject2.split(";");
        if (parts2.length >= 3) {
          //const neckValueextracted = parts2[2].substring(3,4);
          const neckValueextracted = parts2[2];
          return this.queryParams.neckValue = neckValueextracted;
        }
      }
    },
    //取配瓦颜色
    getList() {
      let queryParams = {
        productSeries : this.queryParams.productSeries,
        axisName : this.queryParams.axisName,
        neckName : this.queryParams.neckName,
        tileName : this.queryParams.tileName,
        axisValue: this.queryParams.axisValue,
        neckValue: this.queryParams.neckValue,
        SNCode: this.from.SNCode,
        XT: this.from.scanObject1,
        CZ: this.from.scanObject2,
      }
      console.log(queryParams)
      listTileMatchRules(queryParams).then(response => {
        this.queryParams.words= ['------', '------', '------', '------']
        this.queryParams.colors= ['#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF']
        for (var i=0;i<response.rows.length;i++){
          this.queryParams.colors[i]=response.rows[i].tileColor;
          this.queryParams.words[i]=response.rows[i].tileName;
      console.log('queryParams', queryParams)
      getCheckData(queryParams).then(response => {
        console.log('resssss', response)
        this.queryParams.words = ['------', '------', '------', '------']
        this.queryParams.colors = ['#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF']
        if (response.code === 200) {
          if (response.data.length > 0) {
            this.queryParams.productSeries = response.data[0].productSeries
          }
          for (var i = 0; i < response.data.length; i++) {
            this.queryParams.colors[i] = response.data[i].tileColor;
            this.queryParams.words[i] = response.data[i].tileName;
          }
          document.getElementById('marker1').style.backgroundColor = this.queryParams.colors[0];
          document.getElementById('marker2').style.backgroundColor = this.queryParams.colors[1];
          document.getElementById('marker3').style.backgroundColor = this.queryParams.colors[2];
          document.getElementById('marker4').style.backgroundColor = this.queryParams.colors[3];
          document.getElementById('marker5').style.backgroundColor = this.queryParams.colors[4];
          console.log('颜色:', response)
        }
        console.log('颜色:',response)
      });
    },
    clear(){
      this.queryParams.axisValue=null;
      this.queryParams.neckValue=null;
    clear() {
      this.queryParams.axisValue = null;
      this.queryParams.neckValue = null;
    },
    insetFromToQueryParams(){
      this.queryParams.productSeries=this.from.productSeries;
      this.queryParams.axisName=this.from.axisName;
      this.queryParams.neckName=this.from.neckName;
      this.queryParams.tileName=this.from.tileName;
      this.queryParams.scanObject1=this.from.scanObject1;
      this.queryParams.scanObject2=this.from.scanObject2;
    insetFromToQueryParams() {
      this.queryParams.productSeries = this.from.productSeries;
      this.queryParams.axisName = this.from.axisName;
      this.queryParams.neckName = this.from.neckName;
      this.queryParams.tileName = this.from.tileName;
      this.queryParams.scanObject1 = this.from.scanObject1;
      this.queryParams.scanObject2 = this.from.scanObject2;
    }
  },
@@ -323,13 +318,15 @@
</script>
<style scoped>
::v-deep .el-form-item__label{
::v-deep .el-form-item__label {
  font-size: large;
}
::v-deep .el-card__body{
::v-deep .el-card__body {
  padding: 15px 20px 0px 20px;
}
::v-deep .el-input .el-input--medium .el-input--suffix{
::v-deep .el-input .el-input--medium .el-input--suffix {
  width: 200px;
}
jcdm-ui/src/views/main/cfkb/crankshaftUp/index.vue
@@ -8,26 +8,7 @@
          </div>
        </template>
      </el-card>
      <el-row :gutter="3">
        <el-col :span="6">
          <el-card shadow="always" class="boxSize">
            <div class="centerImg">
              <img style="width: 140px;height: 30px;" src="@/assets/logo/jcdm2.png" alt="dark">
            </div>
          </el-card>
        </el-col>
        <el-col :span="3">
          <el-card shadow="always" class="boxSize">
            <span class="centerText" style="height: 60px">{{locationCode}}</span>
          </el-card>
        </el-col>
        <el-col :span="15">
          <el-card shadow="always" class="boxSize">
            <span class="centerText" >{{locationName}}</span>
          </el-card>
        </el-col>
      </el-row>
      <el-card class="box-card" >
        <el-form :model="from" size="large" :inline="true" label-width="68px" @submit.native.prevent>
          <el-form-item label-width="200" label="曲轴码" :prop="from.scanObject2"  style="align-content: center">
@@ -71,6 +52,8 @@
import { listTileMatchRules, getTileMatchRules, delTileMatchRules, addTileMatchRules, updateTileMatchRules } from "@/api/main/bs/tileMatchRules/tileMatchRules";
import {listStationConf,getIp} from "@/api/main/sc/stationConf";
import {setBarcode1} from "@/api/main/da/opcuaconfig/opcuaconfig";
import WebSocketReconnect from "@/utils/WebsocketTool";
import {getUrl} from "@/api/main/bs/orderScheduling/orderScheduling";
export default {
  name: "index",
  dicts: ['colour_hex','productseries','axisname','neckname','tilename'],
@@ -81,7 +64,7 @@
    return{
      scannerFlag: false,
      loading: true,
      locationCode: "未配置",
      locationCode: "OP030",
      locationName: "未配置工位",
      tileMatchKbList: [],
      qrCode: '',
@@ -130,8 +113,8 @@
    }
  },
  mounted() {
    this.getWebUrl()
    this.setFocus()
    this.getStationConf()
    //this.getNowTime()
    this.$refs.inputdata.addEventListener('keydown',this.handleScannerInput)
  },
@@ -139,6 +122,65 @@
    this.$refs.inputdata.removeEventListener('keydown',this.handleScannerInput)
  },
  methods:{
    getWebUrl(){
      getUrl().then(res=>{
        this.websocketUrl = res+"OP030"
        console.log('websocketUrl:',this.websocketUrl)
        this.initWebSocket()
      })
    },
    initWebSocket: function (){
      //判断当前浏览器是否支持WebSocket
      if ('WebSocket' in window) {
        //连接WebSocket节点
        this.websocket = new WebSocketReconnect(this.websocketUrl);
        //接收到消息的回调方法
        this.websocket.socket.onmessage = (event) => {
          let data = event.data;
          if (data != null && data !== ''){
            this.result = JSON.parse(data);
            if (this.result.server_message === 'clean'){
              this.$refs.inputdata1.focus();
              this.from.scanObject1 = ''
              this.from.scanObjectCopy = ''
              this.from.scanObject2 = ''
              this.from.scanObject3 = ''
              this.from.scanObject4 = ''
              this.from.scanObject5 = ''
              this.queryParams.productSeries = ''
              this.queryParams.scanObject1 = ''
              this.queryParams.scanObjectCopy = ''
              this.queryParams.scanObject2 = ''
              this.queryParams.scanObject3 = ''
              this.queryParams.scanObject4 = ''
              this.queryParams.scanObject5 = ''
              this.queryParams.checkResult = ''
              this.queryParams.checkResultColor = ''
              this.queryParams.tileColor = ''
              this.queryParams.words = ''
            } else if (this.result.server_message.indexOf("*") !== -1){
              const parts1 = this.result.server_message.split("*");
              if (parts1.length >= 2) {
                console.log("44",parts1)
                //const axisValueextracted = parts1[2].substring(3,4);
                this.queryParams.productSeries = parts1[0]
                this.queryParams.scanObject1 = parts1[1]
              }
            }
          }
        }
        //监听窗口关闭事件,当窗口关闭时,主动去关闭websocket连接,防止连接还没断开就关闭窗口,server端会抛异常。
        window.onbeforeunload = function () {
          this.websocket.close()
        }
        //关闭连接
        function closeWebSocket() {
          this.websocket.close()
        }
      } else {
        alert('浏览器不支持webSocket')
      }
    },
    refresh() {
      location.reload();
    },
@@ -160,26 +202,23 @@
        this.scannerFlag = true
        this.from.scanObject2 = inputValue
        //console.log('条码:',this.from.scanObject2,this.locationCode)
        if (typeof this.from.scanObject2 !== 'undefined'&& typeof this.locationCode !== 'undefined' ) {
        if (this.from.scanObject2 !== null && this.from.scanObject2 !== '' && this.locationCode !== '' ) {
          console.log('条码:',this.from.scanObject2,this.locationCode)
          setBarcode1({barcode:this.from.scanObject2,locationCode:this.locationCode}).then(res => {
            if (res.data===500){
              this.$message({
                message:res.msg,
                type:'warning'
              })
            }else {
            if (res.code === 200){
              this.$message({
                message:'操作成功',
                type:'success'
              })
              console.log('返回:',res)
              this.queryParams.productSeries=res.sfcCode
              this.queryParams.scanObject1=res.paramValue
              this.queryParams.scanObject2=this.from.scanObject2
              this.queryParams.scanObject2 = this.from.scanObject2
              this.queryParams.words="扫码成功";
              this.queryParams.tileColor='#00FF00';
            }else {
              this.$message({
                message:res.msg,
                type:'warning'
              })
            }
          })
@@ -193,18 +232,6 @@
      }
    },
    /** æŸ¥è¯¢å·¥ä½ç»ˆç«¯é…ç½®åˆ—表 */
    getStationConf() {
      getIp().then(response => {
        let queryParams = {
          ipAddress: response.msg,
        }
        listStationConf(queryParams).then(response => {
          this.locationName = response.rows[0].processesName
          this.locationCode = response.rows[0].processesCode
        });
      });
    },
    /** æœç´¢æŒ‰é’®æ“ä½œ */
    handleQuery() {
      this.clear();
jcdm-ui/src/views/main/om/productionOrde/index.vue
@@ -101,7 +101,6 @@
          icon="el-icon-wind-power"
          size="mini"
          @click="getProductionNotice"
          v-hasPermi="['om:productionOrde:receive']"
        >接收</el-button>
      </el-col>
      <el-col :span="1.5">
@@ -112,7 +111,6 @@
          size="mini"
          :disabled="single"
          @click="CreatehandleUpdate"
          v-hasPermi="['om:productionOrde:createUpdate']"
        >生成</el-button>
      </el-col>
      <el-col :span="1.5">