jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/controller/BsFormulaChildInfoController.java
@@ -48,14 +48,30 @@ * 扫码确认 */ @GetMapping("/fistSetpNumber") public void fistSetpNumber(BsFormulaChildInfo bsFormulaChildInfo) public AjaxResult fistSetpNumber(BsFormulaChildInfo bsFormulaChildInfo) { // try { // String str = "PACK."+bsFormulaChildInfo.getProcessesCode()+".MStepNumber"; // miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(str).value(1).build()); // } catch (Exception e) { // throw new RuntimeException(e); // } Integer stepNumber = 1; try { List<BsFormulaChildInfo> op260 = bsFormulaChildInfoService.list(new LambdaQueryWrapper<BsFormulaChildInfo>().eq(BsFormulaChildInfo::getProcessesCode, bsFormulaChildInfo.getProcessesCode())); List<BsFormulaChildInfo> filteredList = op260.stream() .filter(obj -> obj.getResults() != null && !obj.getResults().isEmpty()) .collect(Collectors.toList()); if(filteredList.size() > 0){ stepNumber = Integer.valueOf(filteredList.get(filteredList.size()-1).getStepSort())+1; } String str = "PACK."+bsFormulaChildInfo.getProcessesCode()+".MStepNumber"; miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(str).value(1).build()); miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(str).value(stepNumber).build()); } catch (Exception e) { throw new RuntimeException(e); } return AjaxResult.success(stepNumber); } /** @@ -164,6 +180,15 @@ /** * 放行请空状态 */ @GetMapping("/checkMaterialCode") public AjaxResult checkMaterialCode(BsFormulaChildInfo bsFormulaChildInfo) { return bsFormulaChildInfoService.checkMaterialCode(bsFormulaChildInfo); } /** * 放行请空状态 */ @GetMapping("/clearWorkpieceRelease") public AjaxResult clearWorkpieceRelease(BsFormulaChildInfo bsFormulaChildInfo) { jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/IBsFormulaChildInfoService.java
@@ -85,4 +85,7 @@ AjaxResult jrmWorkpieceRelease(BsFormulaChildInfo bsFormulaChildInfo); AjaxResult clearWorkpieceRelease(BsFormulaChildInfo bsFormulaChildInfo); AjaxResult checkMaterialCode(BsFormulaChildInfo bsFormulaChildInfo); } jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java
@@ -214,16 +214,16 @@ public AjaxResult yzUpdateTighteningFormula(BsFormulaChildInfo bsFormulaChildInfo) { Boolean b = true; String result = "1"; BsFormulaChildInfo getMaterTwo = new BsFormulaChildInfo(); getMaterTwo.setProcessesCode(bsFormulaChildInfo.getLocationCode()); getMaterTwo.setOperationType("2"); List<BsFormulaChildInfo> operationType = bsFormulaChildInfoMapper.selectBsFormulaChildInfoList(getMaterTwo); List<String> collect = operationType.stream().map(BsFormulaChildInfo::getResults).collect(Collectors.toList()); for (String s : collect) { if(s.equals("")){ // return AjaxResult.success("扫描未完成,禁止拧紧操作!"); } } // BsFormulaChildInfo getMaterTwo = new BsFormulaChildInfo(); // getMaterTwo.setProcessesCode(bsFormulaChildInfo.getLocationCode()); // getMaterTwo.setOperationType("2"); // List<BsFormulaChildInfo> operationType = bsFormulaChildInfoMapper.selectBsFormulaChildInfoList(getMaterTwo); // List<String> collect = operationType.stream().map(BsFormulaChildInfo::getResults).collect(Collectors.toList()); // for (String s : collect) { // if(s.equals("")){ //// return AjaxResult.success("扫描未完成,禁止拧紧操作!"); // } // } BsFormulaChildInfo listQuery = new BsFormulaChildInfo(); listQuery.setParamCode(bsFormulaChildInfo.getParamCode()); listQuery.setProcessesCode(bsFormulaChildInfo.getLocationCode()); @@ -319,7 +319,7 @@ // miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+strA+".RecordDataDone").value(21).build()); // miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+strB+".RecordDataDone").value(21).build()); String locationCode = bsFormulaChildInfo.getLocationCode(); miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+locationCode+".RecordDataDone").value(21).build()); // miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+locationCode+".RecordDataDone").value(21).build()); } catch (Exception e) { throw new RuntimeException(e); } @@ -373,6 +373,22 @@ } @Override public AjaxResult checkMaterialCode(BsFormulaChildInfo bsFormulaChildInfo) { String result = "1"; BsFormulaChildInfo getMaterTwo = new BsFormulaChildInfo(); getMaterTwo.setProcessesCode(bsFormulaChildInfo.getLocationCode()); getMaterTwo.setOperationType("2"); List<BsFormulaChildInfo> operationType = bsFormulaChildInfoMapper.selectBsFormulaChildInfoList(getMaterTwo); List<String> collect = operationType.stream().map(BsFormulaChildInfo::getResults).collect(Collectors.toList()); for (String s : collect) { if(s.equals("")){ result = "2"; } } return AjaxResult.success(result); } @Override public BsFormulaChildInfo releaseCheck(BsFormulaChildInfo bsFormulaChildInfo) { return bsFormulaChildInfoMapper.releaseCheck(bsFormulaChildInfo); } @@ -415,7 +431,7 @@ if(bsFormulaChildInfos.get(0).getSpareField4().equals("1")){ try { result = "3"; miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+bsFormulaChildInfo.getLocationCode()+".RecordDataDone").value(21).build()); // miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+bsFormulaChildInfo.getLocationCode()+".RecordDataDone").value(21).build()); } catch (Exception e) { throw new RuntimeException(e); } @@ -563,7 +579,7 @@ // List<DaPassingStationCollection> daPassingStationCollections = daPassingStationCollectionMapper.selectDaPassingStationCollectionList(daPassingStationCollection); // daPassingStationCollections.get(0).setOutboundTime(new Date()); // daPassingStationCollectionMapper.updateDaPassingStationCollection(daPassingStationCollections.get(0)); miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+bsFormulaChildInfo.getLocationCode()+".RecordDataDone").value(21).build()); // miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+bsFormulaChildInfo.getLocationCode()+".RecordDataDone").value(21).build()); WebSocketUsers.sendMessageToUserByText(map.get(bsFormulaChildInfo.getLocationCode()), "OUT"); } catch (Exception e) { throw new RuntimeException(e); jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java
@@ -36,9 +36,12 @@ import com.jcdm.main.restful.qingYan.doman.ParentVO; import com.kangaroohy.milo.model.ReadWriteEntity; import com.kangaroohy.milo.service.MiloService; import lombok.extern.slf4j.Slf4j; import org.apache.ibatis.session.ExecutorType; import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSessionFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.parameters.P; import org.springframework.stereotype.Service; @@ -55,9 +58,12 @@ * @author yyt * @date 2023-12-13 */ @Slf4j @Service public class DaParamCollectionServiceImpl extends ServiceImpl<DaParamCollectionMapper,DaParamCollection> implements IDaParamCollectionService { private static final Logger logger = LoggerFactory.getLogger("sys-user"); @Autowired private DaParamCollectionMapper daParamCollectionMapper; @@ -119,6 +125,7 @@ // ExecutorType.SIMPLE: 这个执行器类型不做特殊的事情。它为每个语句的执行创建一个新的预处理语句。 // ExecutorType.REUSE: 这个执行器类型会复用预处理语句。 // ExecutorType.BATCH: 这个执行器会批量执行所有更新语句,如果 SELECT 在它们中间执行还会标定它们是 必须的,来保证一个简单并易于理解的行为。 logger.info("进入乐工批量方法saveBeachDaParamCollection"); // 关闭session的自动提交 SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false); @@ -128,6 +135,8 @@ // 提交数据 sqlSession.commit(); sqlSession.rollback(); logger.info("结束乐工批量方法saveBeachDaParamCollection"); } catch (Exception e) { sqlSession.rollback(); } finally { @@ -519,11 +528,13 @@ @Override public void automaticWorkstationPushGeelycvMesFeedback(String packID, String stationCode,List<DaParamCollection> paramList) { logger.info("进入工位{}-工厂MES推送数据方法automaticWorkstationPushGeelycvMesFeedback",stationCode); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // String url = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback"; String url = "https://imes-group.geelycv.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback"; String totalResult = "0"; if(paramList.size() > 0){ logger.info("进入工位{}-拼数据",stationCode); ParentVO parentVO = new ParentVO(); parentVO.setSiteCode("3983"); parentVO.setRecordId(String.valueOf(Instant.now().toEpochMilli())); @@ -571,10 +582,14 @@ listChildVo.add(childVO); } parentVO.setCheckList(listChildVo); logger.info("结束工位{}-拼数据",stationCode); logger.info("进入工位{}-工厂MES推送数据方法HttpResponseSend",stationCode); HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute(); logger.info("结束工位{}-工厂MES推送数据方法HttpResponseSend",stationCode); System.out.println(execute.body()); System.out.println("-----------------------"+totalResult); } logger.info("结束工位{}-工厂MES推送数据方法automaticWorkstationPushGeelycvMesFeedback",stationCode); } @Override jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java
@@ -193,10 +193,10 @@ if(automaticList.stream().anyMatch(s -> s.equals(device))){ //自动工位 //出站保存数据 recordDataDoneValue = outSaveDate(thoroughfare,device); outSaveDate(thoroughfare,device); //记录数据完成 String RecordDataDoneAddress = thoroughfare + "." + device + ".RecordDataDone"; miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(Integer.valueOf(recordDataDoneValue)).build()); /*String RecordDataDoneAddress = thoroughfare + "." + device + ".RecordDataDone"; miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(Integer.valueOf(recordDataDoneValue)).build());*/ }else { //手动工位 // if(device.contains("OP330")){ @@ -271,26 +271,22 @@ /** * 出站保存数据 */ public String outSaveDate(String thoroughfare,String device) { public void outSaveDate(String thoroughfare,String device) { String snCode = ""; String result = ""; String read = thoroughfare + "." + device + "."; try { if(nullList.stream().noneMatch(s -> s.equals(device))){ if(nullList.stream().noneMatch(s -> s.equals(device))){//删除…………………………………………………… if(moduleCodeList.stream().anyMatch(s -> s.equals(device))){ read = read + "ModuleCode"; }else { read = read + "PACKCode"; } } if(device.equals("OP365")){ try { result = saveStationInfo365(thoroughfare,device); return result; // return saveStationInfo365(thoroughfare,device); // return result; saveStationInfo365(thoroughfare,device); }catch (Exception e){ e.printStackTrace(); } @@ -298,7 +294,8 @@ snCode = miloService.readFromOpcUa(read).getValue().toString(); if(null == snCode || "".equals(snCode)){ result = "22"; String RecordDataDoneAddress = thoroughfare + "." + device + ".RecordDataDone"; miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(Integer.valueOf("22")).build()); }else{ String workOrderNo = ""; @@ -324,19 +321,17 @@ //1、更新工单信息 updateOrderInfo(snCode); } try{ daParamCollectionService.automaticWorkstationPushGeelycvMesFeedback(snCode,device,daParamCollectionList); }catch (Exception e){ } result = "21"; } } }catch (Exception e) { logger.error("出站保存数据异常:"+e); } return result; } @@ -374,6 +369,7 @@ * 保存过站采集 */ public void saveStationInfo(String packCode,String thoroughfare,String device,String workOrderNo,String productCode) throws Exception { logger.info("进入工位{}-方法saveStationInfo",device); SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.US); sdf.setTimeZone(TimeZone.getTimeZone("GMT+8")); // CST通常表示中国标准时间,即东八区 String prefix = thoroughfare+"."+device+"."; @@ -392,9 +388,11 @@ daPassingStationCollection.setOutboundTime(format.parse(TimeUtil.test(end)));//出站时间 daPassingStationCollection.setOutRsSign(stationStatus);//出站是否合格 daPassingStationCollectionService.insertDaPassingStationCollection(daPassingStationCollection); logger.info("结束工位{}-方法saveStationInfo",device); } public static List<DaParamCollection> SaveParamData(String packCode,String thoroughfare,String device,String workOrderNo,String productType) throws Exception { logger.info("进入工位{}-方法SaveParamData",device); List<DaCollectionParamConf> list; DaCollectionParamConf daCollectionParamConf = new DaCollectionParamConf(); daCollectionParamConf.setGatherAddress(thoroughfare+ "." + device); @@ -408,54 +406,47 @@ if(!nodeIdList.isEmpty()){ List<ReadWriteEntity> readWriteEntityList = miloService.readFromOpcUa(nodeIdList); for (int i = 0; i < readWriteEntityList.size(); i++) { for(int i=0;i<nodeIdList.size();i++){ if(readWriteEntityList.get(i).getValue() == null){ readWriteEntityList.get(i).setValue(" "); } } for(int i=0;i<nodeIdList.size();i++){ if(!readWriteEntityList.get(i).getValue().toString().equals("0.0")){ String tt = readWriteEntityList.get(i).getValue().toString(); DaParamCollection ParamCollection = new DaParamCollection(); ChildVO childVO = new ChildVO(); ParamCollection.setParamCode(list.get(i).getCollectParameterId()); ParamCollection.setLocationCode(device); if(tt.contains("Time")){ // String str = TimeUtil.getTimestamp(TimeUtil.stringProcessing(tt)); // ParamCollection.setParamValue(str); ParamCollection.setParamValue(TimeUtil.test(TimeUtil.stringProcessing(tt))); }else { ParamCollection.setParamValue(readWriteEntityList.get(i).getValue().toString()); } ParamCollection.setSfcCode(packCode); if(device.contains("OP360")){ String node = nodeIdList.get(i); Object value = miloService.readFromOpcUa("PACK.OP360.ModuleSNCode"+node.charAt(node.length()-1)).getValue(); if(value!=null){ ParamCollection.setModuleCode(value.toString()); } } ParamCollection.setParamName(list.get(i).getCollectParameterName()); ParamCollection.setParamUpper(list.get(i).getParamUpper()); ParamCollection.setParamLower(list.get(i).getParamLower()); ParamCollection.setUnit(list.get(i).getCollectParameterUnit()); //ParamCollection.setState("合格"); ParamCollection.setType(list.get(i).getCollectParameterType()); ParamCollection.setCollectionTime(new Date()); ParamCollection.setWorkOrderNo(workOrderNo); ParamCollection.setProductCode(productType); daParamCollectionlist.add(ParamCollection); // daParamCollectionService.insertDaParamCollection(ParamCollection); String paramValue = readWriteEntityList.get(i).getValue().toString(); DaParamCollection ParamCollection = new DaParamCollection(); ParamCollection.setParamCode(list.get(i).getCollectParameterId()); ParamCollection.setLocationCode(device); if(paramValue.contains("Time")){ ParamCollection.setParamValue(TimeUtil.test(TimeUtil.stringProcessing(paramValue))); }else { ParamCollection.setParamValue(readWriteEntityList.get(i).getValue().toString()); } ParamCollection.setSfcCode(packCode); if(device.contains("OP360")){ String node = nodeIdList.get(i); Object value = miloService.readFromOpcUa("PACK.OP360.ModuleSNCode"+node.charAt(node.length()-1)).getValue(); if(value!=null){ ParamCollection.setModuleCode(value.toString()); } } ParamCollection.setParamName(list.get(i).getCollectParameterName()); ParamCollection.setParamUpper(list.get(i).getParamUpper()); ParamCollection.setParamLower(list.get(i).getParamLower()); ParamCollection.setUnit(list.get(i).getCollectParameterUnit()); ParamCollection.setType(list.get(i).getCollectParameterType()); ParamCollection.setCollectionTime(new Date()); ParamCollection.setWorkOrderNo(workOrderNo); ParamCollection.setProductCode(productType); daParamCollectionlist.add(ParamCollection); } daParamCollectionService.saveBeachDaParamCollection(daParamCollectionlist); } String RecordDataDoneAddress = thoroughfare + "." + device + ".RecordDataDone"; miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(Integer.valueOf("21")).build()); logger.info("给工位{}写了21",device); daParamCollectionService.saveBeachDaParamCollection(daParamCollectionlist); List<DaParamCollection> baseDataList = addBaseData(workOrderNo,productType,device,packCode); for (int i = 0; i < baseDataList.size(); i++){ daParamCollectionlist.add(baseDataList.get(i)); } logger.info("结束工位{}-方法SaveParamData",device); return daParamCollectionlist; } @@ -575,7 +566,7 @@ /** * 保存过站采集 */ public String saveStationInfo365(String thoroughfare,String device) throws Exception { public void saveStationInfo365(String thoroughfare,String device) throws Exception { String RecordDataDoneAddress = thoroughfare + "." + device + ".RecordDataDone"; String prefix = thoroughfare+"."+device+"."; List<DaPassingStationCollection> passingStationCollections = new ArrayList<>(); @@ -612,13 +603,11 @@ passingStationCollections.add(daPassingStationCollection); } daPassingStationCollectionService.saveBeachDaPassingStationCollection(passingStationCollections); // miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(21).build()); miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(21).build()); logger.info("工位{}回复21",device); return "21"; }else { // miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(22).build()); return "22"; miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(22).build()); } } jcdm-ui/src/api/main/bs/formulaChild/formulaChild.js
@@ -97,6 +97,16 @@ } // 查询配方配置子信息列表 export function checkMaterialCode(query) { return request({ url: '/bs/formulaChild/checkMaterialCode', method: 'get', params: query }) } // 查询配方配置子信息列表 export function yzUpdateTighteningFormula(query) { return request({ url: '/bs/formulaChild/yzUpdateTighteningFormula', jcdm-ui/src/views/main/kb/heatingFilmTerminal/index.vue
@@ -409,19 +409,6 @@ serialLink() { this.open1 = true }, bindYzSfc(){ if(this.headContent.sfcCode!==""&&this.headContent.yzSfcCode!==""){ let param = { sfcCode: this.headContent.sfcCode, locationCode: this.headContent.processesCode, yzSfcCode: this.headContent.yzSfcCode } this.$message('可以绑定!'); replaceAssemblyCode(param).then(response => { }); } }, Release(){ // this.$message('portsList!'+this.portsList.length); if(this.btnType === "danger"){ jcdm-ui/src/views/main/kb/preInstalledTerminal/index.vue
@@ -189,6 +189,8 @@ <script> import {getIpv4, listStationConf} from "@/api/main/sc/stationConf"; import { checkMaterialCode, clearWorkpieceRelease, fistSetpNumber, noPageListFormulaChild, workpieceRelease, @@ -325,20 +327,6 @@ serialLink() { this.open1 = true }, bindYzSfc(){ if(this.headContent.sfcCode!==""&&this.headContent.yzSfcCode!==""){ let param = { sfcCode: this.headContent.sfcCode, locationCode: this.headContent.processesCode, yzSfcCode: this.headContent.yzSfcCode } this.$message('可以绑定!'); replaceAssemblyCode(param).then(response => { }); } }, Release(){ // this.$message('portsList!'+this.portsList.length); if(this.btnType === "danger"){ @@ -406,8 +394,14 @@ console.log(tab, event); }, clearClick(){ this.$message('这是一条清除消息提示'); this.headContent.sfcCode = null const param = { productCode: '1P102S', locationCode: this.headContent.processesCode, } clearWorkpieceRelease(param).then(response => {}); this.headContent.sfcCode = '' this.formulaChildList = []; this.$message('清除成功!'); }, scanCompleted(){ this.$message('扫码完成'+this.content); @@ -537,25 +531,36 @@ self.$message('未找到参数码,请检查参数码是否正确'); return; } addTighteningParameters(param).then(response => {}); yzUpdateTighteningFormula(param).then(response => { console.log(response) if(response.msg === "1" || response.msg === "3"){ self.getListFormulaChild() }else { const param = { workOrderNo: self.workpieceInformation.workOrderNo, productCode: "1P102S", locationCode: self.headContent.processesCode, productBarcode: self.headContent.sfcCode, } saveCampaignTimeParameters(param).then(response => {}); workpieceRelease(param).then(response => {}); self.formulaChildList = []; self.headContent.sfcCode = ''; if(self.headContent.sfcCode === null||self.headContent.sfcCode ===''){ self.$message('未找到总成码,请先扫码!'); return; } checkMaterialCode(param).then(response => { if(response.msg === "2"){ self.$message('未扫描物料码完毕!'); return; } }); // self.getListFormulaChild() yzUpdateTighteningFormula(param).then(response => { console.log(response) if(response.msg === "1" || response.msg === "3"){ self.getListFormulaChild() }else { const param = { workOrderNo: self.workpieceInformation.workOrderNo, productCode: "1P102S", locationCode: self.headContent.processesCode, productBarcode: self.headContent.sfcCode, } saveCampaignTimeParameters(param).then(response => {}); workpieceRelease(param).then(response => {}); self.formulaChildList = []; self.headContent.sfcCode = ''; } }); addTighteningParameters(param).then(response => {}); // self.getListFormulaChild() } }; jcdm-ui/src/views/main/kb/stationTerminal/index.vue
@@ -575,7 +575,7 @@ this.endClear() clearWorkpieceRelease(param).then(response => {}); this.headContent.sfcCode = '' this.$message('清楚成功!'); this.$message('清除成功!'); }, scanCompleted(){ this.$message('扫码完成'+this.content); @@ -602,6 +602,12 @@ }); this.getListFormulaChild() this.addOverStationCollection() const param = { processesCode: this.headContent.processesCode, } fistSetpNumber(param).then(response => { console.log("fistSetpNumber------"+response.msg) }); }, addBaseData(){ @@ -673,10 +679,10 @@ if (event.data === "IN") { self.cakeLamp.InPlace = 1; console.log(self.headContent.processesCode); const param = { processesCode: self.headContent.processesCode, } fistSetpNumber(param).then(response => {}); // const param = { // processesCode: self.headContent.processesCode, // } // fistSetpNumber(param).then(response => {}); } else if (event.data === "IN0") { self.cakeLamp.InPlace = 0; } else if (event.data === "OUT") { @@ -782,11 +788,12 @@ const scanValue = this.myserialport.hex2atostr(value).replace(/[\r\n]/g, ''); console.log("串口收到数据-------------------"+scanValue) if(this.headContent.sfcCode !== ''){ if(this.headContent.sfcCode !== '' && this.headContent.sfcCode !== null && this.headContent.sfcCode !== undefined){ if(scanValue.includes("P9900173252")){ this.headContent.yzSfcCode = scanValue this.bindYzSfc(); }else if(scanValue.includes("0RSP1TE")){ }else if(scanValue.includes("0RSP1TE") && this.headContent.processesCode === 'OP240'){ this.headContent.cardCode = scanValue this.bindcardCode(); }else {