| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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; |
| | | |
| | | /** |
| | |
| | | private DaParamCollectionMapper daParamCollectionService; |
| | | @Resource |
| | | private IDaTileMatchCollectionService daTileMatchCollectionService; |
| | | @Resource |
| | | private ProductNewPassStationService productNewPassStationService; |
| | | |
| | | @Autowired |
| | | MiloService miloService; |
| | |
| | | |
| | | 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) |
| | |
| | | |
| | | 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,"å·²å卿¤ç®±ä½ç ï¼è¯·å¿é夿«æ"); |
| | |
| | | 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) |
| | |
| | | } |
| | | |
| | | //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); |
| | |
| | | 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; |
| | |
| | | private IDaTileMatchMiddlewareService daTileMatchMiddlewareService; |
| | | @Resource |
| | | private IDaTileMatchCollectionService daTileMatchCollectionService; |
| | | |
| | | @Resource |
| | | private ProductNewPassStationService productNewPassStationService; |
| | | |
| | | @Resource |
| | | private ProductNewPassStationMapper productNewPassStationMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢äº¤äºä¿¡å·é
ç½®å表 |
| | |
| | | */ |
| | | @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(); |
| | |
| | | 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); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | @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) { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | import com.jcdm.common.utils.poi.ExcelUtil; |
| | | import com.jcdm.common.core.page.TableDataInfo; |
| | | |
| | | import static com.jcdm.main.plcserver.sub.OPCUaSubscription.miloService; |
| | | |
| | | /** |
| | | * æ¡ç ééController |
| | | * |
| | |
| | | { |
| | | @Autowired |
| | | private IDaTileMatchCollectionService daTileMatchCollectionService; |
| | | |
| | | @Autowired |
| | | private IDaTileMatchRulesService daTileMatchRulesService; |
| | | |
| | | @Autowired |
| | | private IDaParamCollectionService daParamCollectionService; |
| | | |
| | | @Resource |
| | | private ProductNewPassStationMapper productNewPassStationMapper; |
| | | |
| | | @Resource |
| | | private ProductNewPassStationService productNewPassStationService; |
| | | |
| | | /** |
| | | * æ¥è¯¢æ¡ç ééå表 |
| | |
| | | { |
| | | 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); |
| | | } |
| | | } |
| | |
| | | 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 |
| | |
| | | * @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; |
| | |
| | | @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; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.jcdm.main.da.tileMatchCollection.domain; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ReceiveDataVO { |
| | | |
| | | private String SfcCode; |
| | | |
| | | private String productSeries; |
| | | |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | { |
| | | @Autowired |
| | | private IDaTileMatchMiddlewareService daTileMatchMiddlewareService; |
| | | |
| | | @Resource |
| | | private ProductNewPassStationService productNewPassStationService; |
| | | |
| | | /** |
| | | * æ¥è¯¢æ´»å¡è¿æé
ç¦ä¸é´å表 |
| | |
| | | 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); |
| | |
| | | |
| | | @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; |
| | | } |
| | | } |
| | |
| | | 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 |
| | |
| | | * @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; |
| | |
| | | |
| | | /** ç¶æ */ |
| | | @Excel(name = "ç¶æ") |
| | | private Long state; |
| | | private Integer state; |
| | | |
| | | /** 夿³¨ */ |
| | | @Excel(name = "夿³¨") |
| | |
| | | |
| | | /** æ°ç¼¸ç¼å· */ |
| | | @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; |
| | | } |
| | |
| | | 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; |
| | |
| | | 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) { |
| | |
| | | } |
| | | 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); |
| | | } |
| | | } |
| | |
| | | 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 |
| | |
| | | * @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; |
| | |
| | | |
| | | /** è½´åæ°æ°ä½ç½® */ |
| | | @Excel(name = "è½´åæ°æ°ä½ç½®") |
| | | private Long axisParameterNoPosition; |
| | | private Integer axisParameterNoPosition; |
| | | |
| | | /** é¢åæ°æ°ä½ç½® */ |
| | | @Excel(name = "é¢åæ°æ°ä½ç½®") |
| | | private Long neckParameterPosition; |
| | | private Integer neckParameterPosition; |
| | | |
| | | /** è½´å¼ */ |
| | | @Excel(name = "è½´å¼") |
| | |
| | | @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; |
| | | } |
| | |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteDaTileMatchRulesById(Long id); |
| | | |
| | | List<DaTileMatchRules> checkData(String SNCode, String XT, String CZ); |
| | | } |
| | |
| | | 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ä¸å¡å±å¤ç |
| | |
| | | { |
| | | @Autowired |
| | | private DaTileMatchRulesMapper daTileMatchRulesMapper; |
| | | |
| | | @Resource |
| | | private ProductNewPassStationService productNewPassStationService; |
| | | |
| | | /** |
| | | * æ¥è¯¢é
ç¦è§å |
| | |
| | | { |
| | | 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; |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | @Resource |
| | | private IBsTechnologyRouteChildInfoService bsTechnologyRouteChildInfoService; |
| | | |
| | | @Resource |
| | | private ProductNewPassStationService productNewPassStationService; |
| | | |
| | | @Override |
| | | public void run(ApplicationArguments args) throws Exception { |
| | | |
| | |
| | | bsOrderSchedulingService, |
| | | lists, |
| | | rmRepairRecordService, |
| | | bsTechnologyRouteChildInfoService); |
| | | bsTechnologyRouteChildInfoService, |
| | | productNewPassStationService); |
| | | miloService.subscriptionFromOpcUa(collect,100,opcUaSubscription); |
| | | } |
| | | |
| | |
| | | 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"; |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | public IRmRepairRecordService rmRepairRecordService; |
| | | |
| | | public IBsTechnologyRouteChildInfoService bsTechnologyRouteChildInfoService; |
| | | public ProductNewPassStationService productNewPassStationService; |
| | | |
| | | public HashMap<String,List<DaCollectionParamConf>> allCollectParamList = new HashMap<>(); |
| | | |
| | |
| | | IBsOrderSchedulingService bsOrderSchedulingService, |
| | | List<DaOpcuaConfig> lists, |
| | | IRmRepairRecordService rmRepairRecordService, |
| | | IBsTechnologyRouteChildInfoService bsTechnologyRouteChildInfoService) { |
| | | IBsTechnologyRouteChildInfoService bsTechnologyRouteChildInfoService, |
| | | ProductNewPassStationService productNewPassStationService) { |
| | | OPCUaSubscription.miloService = miloService; |
| | | this.collectionParamConfService = collectionParamConfService; |
| | | this.daParamCollectionService = daParamCollectionService; |
| | |
| | | this.lists = lists; |
| | | this.rmRepairRecordService = rmRepairRecordService; |
| | | this.bsTechnologyRouteChildInfoService = bsTechnologyRouteChildInfoService; |
| | | this.productNewPassStationService = productNewPassStationService; |
| | | |
| | | |
| | | } |
| | |
| | | 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); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | 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); |
| | | |
| | |
| | | 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; |
| | |
| | | //è¿å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); |
| | | } |
| | |
| | | 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); |
| | |
| | | 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]); |
| | | } |
| | | } |
| | |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteRmRepairRecordById(Long id); |
| | | public int deleteRmRepairRecordByCode(String code); |
| | | |
| | | /** |
| | | * æ¹éå é¤è¿ä¿®è®°å½ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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> |
| | |
| | | <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> |
| | |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | <delete id="deleteRmRepairRecordByCode"> |
| | | delete from rm_repair_record where box_code = #{code} |
| | | </delete> |
| | | |
| | | </mapper> |
| | |
| | | params: param |
| | | }) |
| | | } |
| | | export function getCheckData(query) { |
| | | return request({ |
| | | url: '/da/tileMatchRules/getCheckData', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | |
| | | method: 'delete' |
| | | }) |
| | | } |
| | | export function getBalanceData(param) { |
| | | return request({ |
| | | url: '/da/tileMatchCollection/getBalanceData', |
| | | method: 'get', |
| | | params: param |
| | | }) |
| | | } |
| | |
| | | <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"> |
| | |
| | | <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> |
| | |
| | | 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'], |
| | |
| | | }, |
| | | data(){ |
| | | return{ |
| | | noticeMessage: "请çå¾
æçæ°æ®è¯»å", |
| | | scannerFlag: false, |
| | | loading: true, |
| | | tileMatchKbList: [], |
| | |
| | | from:{ |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | productSeries: '380Y', |
| | | productSeries: '', |
| | | scanObject1: null, |
| | | scanObject2: '', |
| | | axisName: null, |
| | | neckName: null, |
| | | tileName: '平衡轴ç¦', |
| | | tileName: '', |
| | | axisParameterNoPosition: null, |
| | | neckParameterPosition: null, |
| | | axisValue: null, |
| | |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getWebUrl() |
| | | this.setFocus() |
| | | this.$refs.inputdata.addEventListener('keydown',this.handleScannerInput) |
| | | }, |
| | |
| | | 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(); |
| | | }, |
| | |
| | | }, |
| | | 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> |
| | |
| | | ::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> |
| | |
| | | <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" |
| | |
| | | /> |
| | | </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: 'è¿æç¦', |
| | |
| | | neckParameterPosition: null, |
| | | axisValue: null, |
| | | neckValue: null, |
| | | tileColor: null, |
| | | createUser: null, |
| | | updateUser: null, |
| | | state: null, |
| | |
| | | productSeries: null, |
| | | scanObject1: null, |
| | | scanObject2: null, |
| | | scanObject3: null, |
| | | axisName: null, |
| | | neckName: null, |
| | | tileName: null, |
| | |
| | | neckParameterPosition: null, |
| | | axisValue: null, |
| | | neckValue: null, |
| | | tileColor: null, |
| | | tileColor1: null, |
| | | tileColor2: null, |
| | | tileColor3: null, |
| | | tileColor4: null, |
| | | createUser: null, |
| | | updateUser: null, |
| | | state: null, |
| | |
| | | }, |
| | | 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() { |
| | |
| | | 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 |
| | | } |
| | |
| | | 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, [ |
| | |
| | | |
| | | // åç®±ä½ç ç¬¬ä¸æ®µä¸ºé
ç¦å¼ |
| | | 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; |
| | | } |
| | | } |
| | | }, |
| | | //åé
ç¦é¢è² |
| | |
| | | } |
| | | 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(){ |
| | |
| | | }, |
| | | 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 |
| | | } |
| | | }) |
| | | } |
| | | |
| | | }, |
| | |
| | | </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>--> |
| | | <!--<!– <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"> |
| | |
| | | <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="ç»æ"> |
| | |
| | | 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'], |
| | |
| | | } |
| | | }, |
| | | 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 => { |
| | |
| | | }); |
| | | }); |
| | | }, |
| | | 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, [ |
| | |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | // åç®±ä½ç ç¬¬ä¸æ®µä¸ºé
ç¦å¼ |
| | | 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() { |
| | |
| | | }, |
| | | 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; |
| | | } |
| | | |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | <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'], |
| | |
| | | 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: '主轴ç¦', |
| | |
| | | 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èç¹ |
| | |
| | | //æ¥æ¶å°æ¶æ¯çåè°æ¹æ³ |
| | | 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(); |
| | |
| | | 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') |
| | |
| | | }, |
| | | /** æç´¢æé®æä½ */ |
| | | 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; |
| | | } |
| | | |
| | | }, |
| | |
| | | </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; |
| | | } |
| | | |
| | |
| | | </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"> |
| | |
| | | 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'], |
| | |
| | | return{ |
| | | scannerFlag: false, |
| | | loading: true, |
| | | locationCode: "æªé
ç½®", |
| | | locationCode: "OP030", |
| | | locationName: "æªé
置工ä½", |
| | | tileMatchKbList: [], |
| | | qrCode: '', |
| | |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getWebUrl() |
| | | this.setFocus() |
| | | this.getStationConf() |
| | | //this.getNowTime() |
| | | this.$refs.inputdata.addEventListener('keydown',this.handleScannerInput) |
| | | }, |
| | |
| | | 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(); |
| | | }, |
| | |
| | | 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' |
| | | }) |
| | | } |
| | | }) |
| | | |
| | |
| | | } |
| | | }, |
| | | |
| | | /** æ¥è¯¢å·¥ä½ç»ç«¯é
ç½®å表 */ |
| | | 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(); |
| | |
| | | icon="el-icon-wind-power" |
| | | size="mini" |
| | | @click="getProductionNotice" |
| | | v-hasPermi="['om:productionOrde:receive']" |
| | | >æ¥æ¶</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | |
| | | size="mini" |
| | | :disabled="single" |
| | | @click="CreatehandleUpdate" |
| | | v-hasPermi="['om:productionOrde:createUpdate']" |
| | | >çæ</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |