From 768498719683f85e5ed19c73eb3d14cdbf420df4 Mon Sep 17 00:00:00 2001 From: admin <15939171744@163.com> Date: 星期一, 01 七月 2024 14:03:01 +0800 Subject: [PATCH] 绑定小车码,预装总成码,手动工位扫码,拧紧逻辑优化 --- jcdm-ui/src/views/main/da/passingStationCollection/index.vue | 62 + jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java | 164 +++-- jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/service/impl/OmProductionOrdeInfoServiceImpl.java | 38 + jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/domain/DaParamCollection.java | 30 + jcdm-ui/src/api/main/da/paramCollection/paramCollection.js | 9 jcdm-ui/src/views/main/kb/preInstalledTerminal/index.vue | 110 +-- jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/IDaParamCollectionService.java | 4 jcdm-main/src/main/resources/mapper/bs/beatSetting/BsBeatSettingMapper.xml | 12 jcdm-ui/src/api/main/om/productionOrde/productionOrde.js | 7 jcdm-ui/src/views/main/cfkb/Instructions/index.vue | 2 jcdm-main/src/main/java/com/jcdm/main/bs/beatSetting/domain/BsBeatSetting.java | 28 - jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/IBsFormulaChildInfoService.java | 4 jcdm-main/src/main/java/com/jcdm/main/restful/factoryMes/service/RestfulService.java | 18 jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java | 11 jcdm-main/src/main/resources/mapper/om/productionOrde/OmProductionOrdeInfoMapper.xml | 2 jcdm-ui/src/views/main/om/productionOrde/index.vue | 253 ++++++--- jcdm-main/src/main/java/com/jcdm/main/plcserver/CustomRunner.java | 98 +- jcdm-ui/src/views/main/kb/stationTerminal/index.vue | 233 +++++-- jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/controller/BsFormulaChildInfoController.java | 4 jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java | 145 ++++- jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/controller/DaParamCollectionController.java | 9 jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/service/IOmProductionOrdeInfoService.java | 5 jcdm-main/src/main/java/com/jcdm/main/restful/qingYan/service/ExternalInterface.java | 43 + jcdm-ui/src/views/main/da/paramCollection/index.vue | 46 + jcdm-main/src/main/java/com/jcdm/main/da/passingStationCollection/domain/DaPassingStationCollection.java | 24 jcdm-main/src/main/java/com/jcdm/main/da/testDeviceInterface/domain/DaTestDeviceInterface.java | 3 jcdm-ui/src/views/main/bs/formulaChild/index.vue | 60 +- jcdm-ui/src/views/main/da/testDeviceInterface/index.vue | 145 ++-- 28 files changed, 1,011 insertions(+), 558 deletions(-) diff --git a/jcdm-main/src/main/java/com/jcdm/main/bs/beatSetting/domain/BsBeatSetting.java b/jcdm-main/src/main/java/com/jcdm/main/bs/beatSetting/domain/BsBeatSetting.java index 62395e2..f45b9e2 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/bs/beatSetting/domain/BsBeatSetting.java +++ b/jcdm-main/src/main/java/com/jcdm/main/bs/beatSetting/domain/BsBeatSetting.java @@ -30,14 +30,6 @@ @Excel(name = "鑺傛媿") private String beat; - /** 棰勭暀瀛楁1 */ - @Excel(name = "棰勭暀瀛楁1") - private String spareField1; - - /** 棰勭暀瀛楁2 */ - @Excel(name = "棰勭暀瀛楁2") - private String spareField2; - /** 鍒涘缓鐢ㄦ埛 */ @Excel(name = "鍒涘缓鐢ㄦ埛") private String createUser; @@ -86,24 +78,6 @@ { return beat; } - public void setSpareField1(String spareField1) - { - this.spareField1 = spareField1; - } - - public String getSpareField1() - { - return spareField1; - } - public void setSpareField2(String spareField2) - { - this.spareField2 = spareField2; - } - - public String getSpareField2() - { - return spareField2; - } public void setCreateUser(String createUser) { this.createUser = createUser; @@ -139,8 +113,6 @@ .append("productCode", getProductCode()) .append("productName", getProductName()) .append("beat", getBeat()) - .append("spareField1", getSpareField1()) - .append("spareField2", getSpareField2()) .append("remark", getRemark()) .append("createUser", getCreateUser()) .append("createTime", getCreateTime()) diff --git a/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/controller/BsFormulaChildInfoController.java b/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/controller/BsFormulaChildInfoController.java index a77d9ca..c1676a3 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/controller/BsFormulaChildInfoController.java +++ b/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/controller/BsFormulaChildInfoController.java @@ -83,7 +83,9 @@ List<BsFormulaChildInfo> list = bsFormulaChildInfoService.list(new LambdaQueryWrapper<BsFormulaChildInfo>() .eq(BsFormulaChildInfo::getProductCode,bsFormulaChildInfo.getProductCode()) - .eq(BsFormulaChildInfo::getProcessesCode,bsFormulaChildInfo.getProcessesCode())); + .eq(BsFormulaChildInfo::getProcessesCode,bsFormulaChildInfo.getProcessesCode()) + .orderByAsc(BsFormulaChildInfo::getStepSort) + ); if (CollUtil.isNotEmpty(list)){ List<BsFormulaChildInfo> collect1 = list.stream().filter(x -> Constants.OK.equals(x.getResults())).collect(Collectors.toList()); List<BsFormulaChildInfo> collect2 = list.stream().filter(x -> !Constants.OK.equals(x.getResults())).collect(Collectors.toList()); diff --git a/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/IBsFormulaChildInfoService.java b/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/IBsFormulaChildInfoService.java index c71dd8f..1f75969 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/IBsFormulaChildInfoService.java +++ b/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/IBsFormulaChildInfoService.java @@ -88,4 +88,8 @@ AjaxResult checkMaterialCode(BsFormulaChildInfo bsFormulaChildInfo); + AjaxResult clearCollectDataAndResultsByProcessesCode(BsFormulaChildInfo bsFormulaChildInfo); + + AjaxResult updateTighteningData(BsFormulaChildInfo bsFormulaChildInfo,String result,String data); + } diff --git a/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java b/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java index b22018a..3221f31 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java +++ b/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java @@ -11,6 +11,7 @@ import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.jcdm.common.core.domain.AjaxResult; import com.jcdm.common.utils.DateUtils; @@ -180,10 +181,13 @@ .eq(BsFormulaChildInfo::getProductCode, bsFormulaChildInfo.getProductCode()) .eq(BsFormulaChildInfo::getOperationType, "2") ); - for (BsFormulaChildInfo formulaChildInfo : infos) { - if(bsFormulaChildInfo.getScanBarcode().contains(formulaChildInfo.getMaterialCode())){ - bsFormulaChildInfos.add(formulaChildInfo); - break; + List<String> newResultsList = infos.stream().map(s -> s.getCollectData()).collect(Collectors.toList()); + if(newResultsList.stream().noneMatch(results -> results.equals(bsFormulaChildInfo.getScanBarcode()))){ + for (BsFormulaChildInfo formulaChildInfo : infos) { + if(bsFormulaChildInfo.getScanBarcode().contains(formulaChildInfo.getMaterialCode())) { + bsFormulaChildInfos.add(formulaChildInfo); + break; + } } } if(bsFormulaChildInfos.size()>0){ @@ -225,42 +229,44 @@ //// return AjaxResult.success("鎵弿鏈畬鎴愶紝绂佹鎷х揣鎿嶄綔锛�"); // } // } - BsFormulaChildInfo listQuery = new BsFormulaChildInfo(); - listQuery.setParamCode(bsFormulaChildInfo.getParamCode()); - listQuery.setProcessesCode(bsFormulaChildInfo.getLocationCode()); - String paramCode = bsFormulaChildInfo.getTightenTheArray(); - if(paramCode.contains("N")){ +// BsFormulaChildInfo listQuery = new BsFormulaChildInfo(); +// listQuery.setParamCode(bsFormulaChildInfo.getParamCode()); +// listQuery.setProcessesCode(bsFormulaChildInfo.getLocationCode()); + String paramData = bsFormulaChildInfo.getTightenTheArray(); + if(paramData.contains("N")){ result = "3"; - List<BsFormulaChildInfo> bsFormulaChildInfos = bsFormulaChildInfoMapper.selectBsFormulaChildInfoList(listQuery); - bsFormulaChildInfos.get(0).setResults("NG"); - bsFormulaChildInfos.get(0).setCollectData(bsFormulaChildInfo.getTightenTheArray()); - bsFormulaChildInfoMapper.updateBsFormulaChildInfo(bsFormulaChildInfos.get(0)); +// List<BsFormulaChildInfo> bsFormulaChildInfos = bsFormulaChildInfoMapper.selectBsFormulaChildInfoList(listQuery); +// bsFormulaChildInfos.get(0).setResults("NG"); +// bsFormulaChildInfos.get(0).setCollectData(bsFormulaChildInfo.getTightenTheArray()); +// bsFormulaChildInfoMapper.updateBsFormulaChildInfo(bsFormulaChildInfos.get(0)); + this.updateTighteningData(bsFormulaChildInfo,"NG",paramData); // return AjaxResult.success("鎵弿缁撴灉NG,璇烽噸鏂版壂鎻忥紒"); }else { - List<BsFormulaChildInfo> bsFormulaChildInfos = bsFormulaChildInfoMapper.selectBsFormulaChildInfoList(listQuery); - if(bsFormulaChildInfos.get(0).getSpareField2()!=null&&bsFormulaChildInfos.get(0).getSpareField3()!=null){ +// List<BsFormulaChildInfo> bsFormulaChildInfos = bsFormulaChildInfoMapper.selectBsFormulaChildInfoList(listQuery); + if(bsFormulaChildInfo.getSpareField2()!=null&&bsFormulaChildInfo.getSpareField3()!=null){ String tightenArray = bsFormulaChildInfo.getTightenTheArray().replace("[", "").replace("]", "").replace(" ", ""); String[] tightenDataParts = tightenArray.split(","); - b = TimeUtil.isNumberInRange(Double.parseDouble(tightenDataParts[0]),Double.parseDouble(bsFormulaChildInfos.get(0).getSpareField2()),Double.parseDouble(bsFormulaChildInfos.get(0).getSpareField3())); + b = TimeUtil.isNumberInRange(Double.parseDouble(tightenDataParts[0]),Double.parseDouble(bsFormulaChildInfo.getSpareField2()),Double.parseDouble(bsFormulaChildInfo.getSpareField3())); } if(b){ result = "3"; - bsFormulaChildInfos.get(0).setResults("OK"); - bsFormulaChildInfos.get(0).setCollectData(bsFormulaChildInfo.getTightenTheArray()); - bsFormulaChildInfoMapper.updateBsFormulaChildInfo(bsFormulaChildInfos.get(0)); - logger.info("yzUpdateTighteningFormula--鏌ヨ鏉′欢鍙傛暟锛�"+listQuery); - logger.info("yzUpdateTighteningFormula--鏌ヨ缁撴灉锛�"+bsFormulaChildInfos.get(0)); - Integer stepNumber = Integer.valueOf(bsFormulaChildInfos.get(0).getStepSort()); +// bsFormulaChildInfos.get(0).setResults("OK"); +// bsFormulaChildInfos.get(0).setCollectData(bsFormulaChildInfo.getTightenTheArray()); +// bsFormulaChildInfoMapper.updateBsFormulaChildInfo(bsFormulaChildInfos.get(0)); + this.updateTighteningData(bsFormulaChildInfo,"OK",paramData); +// logger.info("yzUpdateTighteningFormula--鏌ヨ鏉′欢鍙傛暟锛�"+listQuery); +// logger.info("yzUpdateTighteningFormula--鏌ヨ缁撴灉锛�"+bsFormulaChildInfos.get(0)); + Integer stepNumber = Integer.valueOf(bsFormulaChildInfo.getStepSort()); try { miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+bsFormulaChildInfo.getLocationCode()+".MStepNumber").value(stepNumber+1).build()); } catch (Exception e) { throw new RuntimeException(e); } - String spareField4 = bsFormulaChildInfos.get(0).getSpareField4(); + String spareField4 = bsFormulaChildInfo.getSpareField4(); if (spareField4 != null && !spareField4.isEmpty()) { // 鎵ц鎿嶄綔 - if(bsFormulaChildInfos.get(0).getSpareField4().equals("1")){ + if(bsFormulaChildInfo.getSpareField4().equals("1")){ try { // WebSocketUsers.sendMessageToUserByText(map.get(bsFormulaChildInfo.getLocationCode()), "OUT"); result = "2"; @@ -271,16 +277,28 @@ } }else { result = "3"; - List<BsFormulaChildInfo> bsFormulaChildInfos1 = bsFormulaChildInfoMapper.selectBsFormulaChildInfoList(listQuery); - bsFormulaChildInfos1.get(0).setResults("NG"); - String originalString = bsFormulaChildInfo.getTightenTheArray(); - String modifiedString = originalString.replaceFirst("OK", "NG"); - bsFormulaChildInfos1.get(0).setCollectData(modifiedString); - bsFormulaChildInfoMapper.updateBsFormulaChildInfo(bsFormulaChildInfos1.get(0)); +// List<BsFormulaChildInfo> bsFormulaChildInfos1 = bsFormulaChildInfoMapper.selectBsFormulaChildInfoList(listQuery); +// bsFormulaChildInfos1.get(0).setResults("NG"); +// String originalString = bsFormulaChildInfo.getTightenTheArray(); + String modifiedString = paramData.replaceFirst("OK", "NG"); +// bsFormulaChildInfos1.get(0).setCollectData(modifiedString); +// bsFormulaChildInfoMapper.updateBsFormulaChildInfo(bsFormulaChildInfos1.get(0)); + this.updateTighteningData(bsFormulaChildInfo,"NG",modifiedString); // return AjaxResult.success("鎵弿缁撴灉NG,璇烽噸鏂版壂鎻忥紒"); } } return AjaxResult.success(result); + } + + @Override + public AjaxResult updateTighteningData(BsFormulaChildInfo bsFormulaChildInfo,String result,String data) { + LambdaUpdateWrapper<BsFormulaChildInfo> updateWrapper = new LambdaUpdateWrapper(); + updateWrapper.set(BsFormulaChildInfo::getCollectData, data); + updateWrapper.set(BsFormulaChildInfo::getResults, result); + updateWrapper.eq(BsFormulaChildInfo::getProcessesCode, bsFormulaChildInfo.getLocationCode()); + updateWrapper.eq(BsFormulaChildInfo::getParamCode, bsFormulaChildInfo.getParamCode()); + boolean update = bsFormulaChildInfoService.update(new BsFormulaChildInfo(), updateWrapper); + return AjaxResult.success(update); } @Override @@ -334,14 +352,15 @@ @Override public AjaxResult jrmWorkpieceRelease(BsFormulaChildInfo bsFormulaChildInfo) { - List<BsFormulaChildInfo> list = bsFormulaChildInfoService.list(new LambdaQueryWrapper<BsFormulaChildInfo>() - .eq(BsFormulaChildInfo::getProcessesCode, bsFormulaChildInfo.getLocationCode()) - .eq(BsFormulaChildInfo::getProductCode, bsFormulaChildInfo.getProductCode())); - for (BsFormulaChildInfo info : list) { - info.setCollectData(""); - info.setResults(""); - bsFormulaChildInfoService.saveOrUpdate(info); - } + this.clearCollectDataAndResultsByProcessesCode(bsFormulaChildInfo); +// List<BsFormulaChildInfo> list = bsFormulaChildInfoService.list(new LambdaQueryWrapper<BsFormulaChildInfo>() +// .eq(BsFormulaChildInfo::getProcessesCode, bsFormulaChildInfo.getLocationCode()) +// .eq(BsFormulaChildInfo::getProductCode, bsFormulaChildInfo.getProductCode())); +// for (BsFormulaChildInfo info : list) { +// info.setCollectData(""); +// info.setResults(""); +// bsFormulaChildInfoService.saveOrUpdate(info); +// } String[] split = bsFormulaChildInfo.getProductBarcode().split(","); try { for (int i = 0; i < split.length; i++) { @@ -374,14 +393,15 @@ @Override public AjaxResult clearWorkpieceRelease(BsFormulaChildInfo bsFormulaChildInfo) { - List<BsFormulaChildInfo> list = bsFormulaChildInfoService.list(new LambdaQueryWrapper<BsFormulaChildInfo>() - .eq(BsFormulaChildInfo::getProcessesCode, bsFormulaChildInfo.getLocationCode()) - .eq(BsFormulaChildInfo::getProductCode, bsFormulaChildInfo.getProductCode())); - for (BsFormulaChildInfo info : list) { - info.setCollectData(""); - info.setResults(""); - bsFormulaChildInfoService.saveOrUpdate(info); - } +// List<BsFormulaChildInfo> list = bsFormulaChildInfoService.list(new LambdaQueryWrapper<BsFormulaChildInfo>() +// .eq(BsFormulaChildInfo::getProcessesCode, bsFormulaChildInfo.getLocationCode()) +// .eq(BsFormulaChildInfo::getProductCode, bsFormulaChildInfo.getProductCode())); +// for (BsFormulaChildInfo info : list) { +// info.setCollectData(""); +// info.setResults(""); +// bsFormulaChildInfoService.saveOrUpdate(info); +// } + this.clearCollectDataAndResultsByProcessesCode(bsFormulaChildInfo); return AjaxResult.success(); } @@ -399,6 +419,17 @@ } } return AjaxResult.success(result); + } + + @Override + public AjaxResult clearCollectDataAndResultsByProcessesCode(BsFormulaChildInfo bsFormulaChildInfo) { + LambdaUpdateWrapper<BsFormulaChildInfo> updateWrapper = new LambdaUpdateWrapper(); + updateWrapper.set(BsFormulaChildInfo::getCollectData, ""); + updateWrapper.set(BsFormulaChildInfo::getResults,""); + updateWrapper.eq(BsFormulaChildInfo::getProcessesCode, bsFormulaChildInfo.getLocationCode()); + BsFormulaChildInfo info = new BsFormulaChildInfo(); + boolean update = this.update(info,updateWrapper); + return AjaxResult.success(update); } @Override @@ -522,28 +553,29 @@ @Override public AjaxResult workpieceRelease(BsFormulaChildInfo bsFormulaChildInfo) { - List<BsFormulaChildInfo> list = bsFormulaChildInfoService.list(new LambdaQueryWrapper<BsFormulaChildInfo>() - .eq(BsFormulaChildInfo::getProcessesCode, bsFormulaChildInfo.getLocationCode()) - .eq(BsFormulaChildInfo::getProductCode, bsFormulaChildInfo.getProductCode())); - for (BsFormulaChildInfo info : list) { - info.setCollectData(""); - info.setResults(""); - bsFormulaChildInfoService.saveOrUpdate(info); - } + this.clearCollectDataAndResultsByProcessesCode(bsFormulaChildInfo); +// List<BsFormulaChildInfo> list = bsFormulaChildInfoService.list(new LambdaQueryWrapper<BsFormulaChildInfo>() +// .eq(BsFormulaChildInfo::getProcessesCode, bsFormulaChildInfo.getLocationCode()) +// .eq(BsFormulaChildInfo::getProductCode, bsFormulaChildInfo.getProductCode())); +// for (BsFormulaChildInfo info : list) { +// info.setCollectData(""); +// info.setResults(""); +// bsFormulaChildInfoService.saveOrUpdate(info); +// } try { daParamCollectionService.pushGeelycvMesFeedback(bsFormulaChildInfo.getProductBarcode(), bsFormulaChildInfo.getLocationCode()); - String barCode = bsFormulaChildInfo.getProductBarcode(); - String locationCode = bsFormulaChildInfo.getLocationCode(); - - if(StringUtils.isNotBlank(locationCode)&&StringUtils.isNotBlank(barCode)){ - DaPassingStationCollection daPassingStationCollection = new DaPassingStationCollection(); - daPassingStationCollection.setOutRsSign("1"); - daPassingStationCollection.setOutboundTime(new Date()); - daPassingStationCollection.setSfcCode(barCode); - daPassingStationCollection.setLocationCode(locationCode); - int updateDaPassingStation = daPassingStationCollectionService.updateDaPassingStationCollectionBySfcCodeAndLocationCode(daPassingStationCollection); - logger.info("鏅�氫汉宸ュ伐浣嶆洿鏂拌繃绔欒褰晆pdateDaPassingStationCollectionBySfcCodeAndLocationCode:鏇存柊浜唟}鏉℃暟鎹�-鏇存柊鏉′欢pack鐮亄}-宸ヤ綅{}",updateDaPassingStation,barCode,locationCode); - } +// String barCode = bsFormulaChildInfo.getProductBarcode(); +// String locationCode = bsFormulaChildInfo.getLocationCode(); +// +// if(StringUtils.isNotBlank(locationCode)&&StringUtils.isNotBlank(barCode)){ +// DaPassingStationCollection daPassingStationCollection = new DaPassingStationCollection(); +// daPassingStationCollection.setOutRsSign("1"); +// daPassingStationCollection.setOutboundTime(new Date()); +// daPassingStationCollection.setSfcCode(barCode); +// daPassingStationCollection.setLocationCode(locationCode); +// int updateDaPassingStation = daPassingStationCollectionService.updateDaPassingStationCollectionBySfcCodeAndLocationCode(daPassingStationCollection); +// logger.info("鏅�氫汉宸ュ伐浣嶆洿鏂拌繃绔欒褰晆pdateDaPassingStationCollectionBySfcCodeAndLocationCode:鏇存柊浜唟}鏉℃暟鎹�-鏇存柊鏉′欢pack鐮亄}-宸ヤ綅{}",updateDaPassingStation,barCode,locationCode); +// } // DaPassingStationCollection passingStationCollectionOne = daPassingStationCollectionService.getOne(new LambdaQueryWrapper<DaPassingStationCollection>().eq(DaPassingStationCollection::getSfcCode, barCode).eq(DaPassingStationCollection::getLocationCode, locationCode)); // if (passingStationCollectionOne != null) { diff --git a/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/controller/DaParamCollectionController.java b/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/controller/DaParamCollectionController.java index 73b2417..dcd6c74 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/controller/DaParamCollectionController.java +++ b/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/controller/DaParamCollectionController.java @@ -125,6 +125,15 @@ /** * 鍑烘垬鏃堕棿鍙傛暟澧炲姞 */ + @PostMapping("/preInstallOut") + public void preInstallOut(@RequestBody DaParamCollection daParamCollection) + { + daParamCollectionService.preInstallOut(daParamCollection); + } + + /** + * 鍑烘垬鏃堕棿鍙傛暟澧炲姞 + */ @PostMapping("/checkRecordDataDone") public AjaxResult checkRecordDataDone(@RequestBody DaParamCollection daParamCollection) { diff --git a/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/domain/DaParamCollection.java b/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/domain/DaParamCollection.java index 6405e3d..d87839c 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/domain/DaParamCollection.java +++ b/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/domain/DaParamCollection.java @@ -1,8 +1,10 @@ package com.jcdm.main.da.paramCollection.domain; import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; import com.jcdm.common.annotation.Excel; import com.jcdm.common.core.domain.BaseEntity; +import com.jcdm.main.bs.formulaChild.domain.BsFormulaChildInfo; import lombok.Data; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -117,6 +119,34 @@ @TableField(exist = false) private String weightValue; + @TableField(exist = false) + private BsFormulaChildInfo formulaChildEntity; + + @TableField(exist = false) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date inboundTime; + + @TableField(exist = false) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date outboundTime; + + + public Date getInboundTime() { + return inboundTime; + } + + public void setInboundTime(Date inboundTime) { + this.inboundTime = inboundTime; + } + + public BsFormulaChildInfo getFormulaChildEntity() { + return formulaChildEntity; + } + + public void setFormulaChildEntity(BsFormulaChildInfo formulaChildEntity) { + this.formulaChildEntity = formulaChildEntity; + } + public String getTightenTheArray() { return tightenTheArray; } diff --git a/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/IDaParamCollectionService.java b/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/IDaParamCollectionService.java index aea5023..b486d42 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/IDaParamCollectionService.java +++ b/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/IDaParamCollectionService.java @@ -86,4 +86,8 @@ AjaxResult checkRecordDataDone(DaParamCollection daParamCollection); void enterWeighing(DaParamCollection daParamCollection); + + void manualWorkstationsAddBasicParameters(DaParamCollection daParamCollection); + + void preInstallOut(DaParamCollection daParamCollection); } diff --git a/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java b/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java index 1a378e7..fa722ee 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java +++ b/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java @@ -7,11 +7,14 @@ import cn.hutool.db.Db; import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpResponse; +import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.jcdm.common.core.domain.AjaxResult; import com.jcdm.common.utils.DateUtils; +import com.jcdm.common.utils.SecurityUtils; import com.jcdm.common.utils.StringUtils; import com.jcdm.main.bs.formula.service.IBsFormulaInfoService; import com.jcdm.main.bs.formula.service.impl.BsFormulaInfoServiceImpl; @@ -30,6 +33,7 @@ import com.jcdm.main.da.passingStationCollection.domain.DaPassingStationCollection; import com.jcdm.main.da.passingStationCollection.mapper.DaPassingStationCollectionMapper; import com.jcdm.main.da.passingStationCollection.service.IDaPassingStationCollectionService; +import com.jcdm.main.om.productionOrde.domain.OmProductionOrdeInfo; import com.jcdm.main.om.productionOrde.service.IOmProductionOrdeInfoService; import com.jcdm.main.plcserver.sub.OPCUaSubscription; import com.jcdm.main.restful.factoryMes.service.RestfulService; @@ -98,6 +102,9 @@ @Autowired private IOmProductionOrdeInfoService omProductionOrdeInfoService; + + @Autowired + private IDaPassingStationCollectionService daPassingStationCollectionService; public SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); @@ -258,12 +265,13 @@ @Override public void saveCampaignTimeParameters(DaParamCollection daParamCollection) { - List<BsFormulaChildInfo> list = bsFormulaChildInfoService.list(new LambdaQueryWrapper<BsFormulaChildInfo>() - .eq(BsFormulaChildInfo::getProcessesCode, daParamCollection.getLocationCode()) - .eq(BsFormulaChildInfo::getSpareField4, "1") - ); - if(StringUtils.isNotBlank(list.get(0).getResults())){ - if(!list.get(0).getResults().equals("OK")){ +// List<BsFormulaChildInfo> list = bsFormulaChildInfoService.list(new LambdaQueryWrapper<BsFormulaChildInfo>() +// .eq(BsFormulaChildInfo::getProcessesCode, daParamCollection.getLocationCode()) +// .eq(BsFormulaChildInfo::getSpareField4, "1") +// ); + BsFormulaChildInfo childInfo = daParamCollection.getFormulaChildEntity(); + if(StringUtils.isNotBlank(childInfo.getResults())){ + if(!childInfo.getResults().equals("OK")){ try { miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+daParamCollection.getLocationCode()+".RecordDataDone").value(22).build()); } catch (Exception e) { @@ -279,37 +287,52 @@ } return; } - BsFormulaChildInfo bsFormulaChildInfo = new BsFormulaChildInfo(); - bsFormulaChildInfo.setProcessesCode(daParamCollection.getLocationCode()); - bsFormulaChildInfo.setProductCode(daParamCollection.getProductCode()); - bsFormulaChildInfo.setSpareField4("1"); - List<BsFormulaChildInfo> bsFormulaChildInfos = bsFormulaChildInfoMapper.selectBsFormulaChildInfoList(bsFormulaChildInfo); - String result = bsFormulaChildInfos.get(0).getResults(); +// BsFormulaChildInfo bsFormulaChildInfo = new BsFormulaChildInfo(); +// bsFormulaChildInfo.setProcessesCode(daParamCollection.getLocationCode()); +// bsFormulaChildInfo.setProductCode(daParamCollection.getProductCode()); +// bsFormulaChildInfo.setSpareField4("1"); +// List<BsFormulaChildInfo> bsFormulaChildInfos = bsFormulaChildInfoMapper.selectBsFormulaChildInfoList(bsFormulaChildInfo); + String result = childInfo.getResults(); if(result != null && !result.isEmpty()){ try { - //杩囩珯鍙傛暟閲囬泦璁板綍鍑虹珯鏃堕棿 - DaCollectionParamConf daCollectionParamConf = new DaCollectionParamConf(); - daCollectionParamConf.setProcessesCode(daParamCollection.getLocationCode()); - daCollectionParamConf.setCollectParameterId("OUTT"); - List<DaCollectionParamConf> daCollectionParamConfs = daCollectionParamConfMapper.selectDaCollectionParamConfList(daCollectionParamConf); - DaParamCollection saveData = new DaParamCollection(); - saveData.setWorkOrderNo(daParamCollection.getWorkOrderNo()); - saveData.setProductCode(daParamCollection.getProductCode()); - saveData.setLocationCode(daParamCollection.getLocationCode()); - saveData.setSfcCode(daParamCollection.getProductBarcode()); - saveData.setParamCode(daCollectionParamConfs.get(0).getCollectParameterId()); - saveData.setParamName(daCollectionParamConfs.get(0).getCollectParameterName()); - saveData.setCollectionTime(new Date()); - saveData.setParamValue(DateUtil.formatDateTime(new Date())); - daParamCollectionMapper.insertDaParamCollection(saveData); +// //鏇存柊鍙傛暟閲囬泦閰嶇疆琛� +// DaCollectionParamConf daCollectionParamConf = new DaCollectionParamConf(); +// daCollectionParamConf.setProcessesCode(daParamCollection.getLocationCode()); +// daCollectionParamConf.setCollectParameterId("OUTT"); +// List<DaCollectionParamConf> daCollectionParamConfs = daCollectionParamConfMapper.selectDaCollectionParamConfList(daCollectionParamConf); +// DaParamCollection saveData = new DaParamCollection(); +// saveData.setWorkOrderNo(daParamCollection.getWorkOrderNo()); +// saveData.setProductCode(daParamCollection.getProductCode()); +// saveData.setLocationCode(daParamCollection.getLocationCode()); +// saveData.setSfcCode(daParamCollection.getProductBarcode()); +// saveData.setParamCode(daCollectionParamConfs.get(0).getCollectParameterId()); +// saveData.setParamName(daCollectionParamConfs.get(0).getCollectParameterName()); +// saveData.setCollectionTime(new Date()); +// saveData.setParamValue(DateUtil.formatDateTime(new Date())); +// daParamCollectionMapper.insertDaParamCollection(saveData); - //鏇存柊杩囩珯璁板綍琛ㄥ嚭绔欐椂闂� + //澧炲姞杩囩珯璁板綍 DaPassingStationCollection daPassingStationCollection = new DaPassingStationCollection(); daPassingStationCollection.setWorkOrderNo(daParamCollection.getWorkOrderNo()); + daPassingStationCollection.setSfcCode(daParamCollection.getProductBarcode()); + daPassingStationCollection.setProductCode(daParamCollection.getProductCode()); daPassingStationCollection.setLocationCode(daParamCollection.getLocationCode()); - List<DaPassingStationCollection> daPassingStationCollections = daPassingStationCollectionMapper.selectDaPassingStationCollectionList(daPassingStationCollection); - daPassingStationCollections.get(0).setOutboundTime(new Date()); - int i = daPassingStationCollectionMapper.updateDaPassingStationCollection(daPassingStationCollections.get(0)); + daPassingStationCollection.setInboundTime(daParamCollection.getInboundTime()); + daPassingStationCollection.setOutboundTime(new Date()); + daPassingStationCollection.setCreateTime(new Date()); + daPassingStationCollection.setOutRsSign("1"); + boolean save = daPassingStationCollectionService.save(daPassingStationCollection); + + //娣诲姞鍩虹鍙傛暟 + this.manualWorkstationsAddBasicParameters(daParamCollection); + +// //鏇存柊杩囩珯璁板綍琛ㄥ嚭绔欐椂闂� +// DaPassingStationCollection daPassingStationCollection = new DaPassingStationCollection(); +// daPassingStationCollection.setWorkOrderNo(daParamCollection.getWorkOrderNo()); +// daPassingStationCollection.setLocationCode(daParamCollection.getLocationCode()); +// List<DaPassingStationCollection> daPassingStationCollections = daPassingStationCollectionMapper.selectDaPassingStationCollectionList(daPassingStationCollection); +// daPassingStationCollections.get(0).setOutboundTime(new Date()); +// int i = daPassingStationCollectionMapper.updateDaPassingStationCollection(daPassingStationCollections.get(0)); // OPCUaSubscription.SaveParamData(daParamCollection.getProductBarcode(),"OP",daParamCollection.getLocationCode(),daParamCollection.getWorkOrderNo(),daParamCollection.getProductCode()); @@ -320,12 +343,14 @@ CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> { logger.info("OP230鎶ュ伐寮�濮�-宸ュ巶MES寮傛鏂规硶"); String reportResult = RestfulService.getWorkReportResultFeedback(daParamCollection.getProductBarcode(), "OP230", format.format(new Date())); - if("".equals(reportResult)){ - //鎵ц鎶ュ伐澶辫触鏂规硶 + JSONObject jsonObject = new JSONObject(reportResult); + String code = jsonObject.getStr("code"); + if("success".equals(code)){ + //濡傛灉鎴愬姛锛屾墽琛屾姤宸ユ垚鍔熸柟娉曪紝淇敼鏄惁鎶ュ伐涓�1锛屾坊鍔犳姤宸ユ椂闂� + omProductionOrdeInfoService.updateOrderByProductNum("1",daParamCollection.getProductBarcode(),"OP230"); }else{ //瑙f瀽宸ュ巶mes杩斿洖缁撴灉锛屽鏋滃け璐ワ紝鎵ц鎶ュ伐澶辫触鏂规硶锛屼慨鏀规槸鍚︽姤宸ヤ负2锛屾坊鍔犳姤宸ユ椂闂� - - //濡傛灉鎴愬姛锛屾墽琛屾姤宸ユ垚鍔熸柟娉曪紝淇敼鏄惁鎶ュ伐涓�1锛屾坊鍔犳姤宸ユ椂闂� + omProductionOrdeInfoService.updateOrderByProductNum("2",daParamCollection.getProductBarcode(),"OP230"); } logger.info("OP230鎶ュ伐缁撴潫-宸ュ巶MES寮傛鏂规硶{}"+reportResult); }); @@ -488,8 +513,8 @@ public void pushGeelycvMesFeedback(String packID, String stationCode) { logger.info("杩涘叆浜哄伐宸ヤ綅鎺ㄩ�佸伐鍘侻ES鏁版嵁鏂规硶-pushGeelycvMesFeedback-宸ヤ綅{}-pack鐮亄}",stationCode,packID); 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 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"; List<DaParamCollectionTemp> paramList = daParamCollectionTempService.list(new LambdaQueryWrapper<DaParamCollectionTemp>().eq(DaParamCollectionTemp::getSfcCode, packID).eq(DaParamCollectionTemp::getLocationCode, stationCode)); if(paramList.size() > 0){ @@ -704,4 +729,50 @@ RestfulService.getWorkReportResultFeedback(daParamCollection.getSfcCode(),"OP500",format.format(new Date())); } + @Override + public void manualWorkstationsAddBasicParameters(DaParamCollection daParamCollection) { + // 鍋囪杩欐槸浠庢暟鎹簱鎴栧叾浠栧湴鏂硅幏鍙栫殑鍙傛暟鏁版嵁 + Map<String, String> map = new HashMap<>(); + map.put("GC", "鍗楁禂宸ュ巶"); + map.put("CXBH", "Pack绾�"); + map.put("SBBH", "璁惧001"); + map.put("YGBH", SecurityUtils.getUsername()); + map.put("GDBH", daParamCollection.getWorkOrderNo()); + map.put("CPXH", daParamCollection.getProductCode()); + map.put("INT", format.format(daParamCollection.getInboundTime())); + map.put("OUTT",format.format(new Date())); + + map.forEach((key, value) -> { + DaCollectionParamConf daCollectionParamConf = new DaCollectionParamConf(); + daCollectionParamConf.setProcessesCode(daParamCollection.getLocationCode()); + daCollectionParamConf.setCollectParameterId(key); + List<DaCollectionParamConf> daCollectionParamConfs = daCollectionParamConfMapper.selectDaCollectionParamConfList(daCollectionParamConf); + DaParamCollection saveData = new DaParamCollection(); + saveData.setWorkOrderNo(daParamCollection.getWorkOrderNo()); + saveData.setProductCode(daParamCollection.getProductCode()); + saveData.setLocationCode(daParamCollection.getLocationCode()); + saveData.setSfcCode(daParamCollection.getProductBarcode()); + saveData.setParamCode(daCollectionParamConfs.get(0).getCollectParameterId()); + saveData.setParamName(daCollectionParamConfs.get(0).getCollectParameterName()); + saveData.setCollectionTime(new Date()); + saveData.setParamValue(value); + daParamCollectionMapper.insertDaParamCollection(saveData); + }); + } + + @Override + public void preInstallOut(DaParamCollection daParamCollection) { + //澧炲姞杩囩珯璁板綍 + DaPassingStationCollection daPassingStationCollection = new DaPassingStationCollection(); + daPassingStationCollection.setSfcCode(daParamCollection.getProductBarcode()); + daPassingStationCollection.setLocationCode(daParamCollection.getLocationCode()); + daPassingStationCollection.setInboundTime(daParamCollection.getInboundTime()); + daPassingStationCollection.setOutboundTime(new Date()); + daPassingStationCollection.setCreateTime(new Date()); + daPassingStationCollection.setOutRsSign("1"); + boolean save = daPassingStationCollectionService.save(daPassingStationCollection); + //娣诲姞鍩虹鍙傛暟 + this.manualWorkstationsAddBasicParameters(daParamCollection); + } + } diff --git a/jcdm-main/src/main/java/com/jcdm/main/da/passingStationCollection/domain/DaPassingStationCollection.java b/jcdm-main/src/main/java/com/jcdm/main/da/passingStationCollection/domain/DaPassingStationCollection.java index 131f9c8..46341c2 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/da/passingStationCollection/domain/DaPassingStationCollection.java +++ b/jcdm-main/src/main/java/com/jcdm/main/da/passingStationCollection/domain/DaPassingStationCollection.java @@ -83,6 +83,10 @@ /** 棰勭暀瀛楁2 */ private String spareField2; + private Date createTime; + + private Date updateTime; + /** 鍒涘缓鐢ㄦ埛 */ private String createUser; @@ -96,6 +100,26 @@ @TableField(exist = false) private Long[] ids; + @Override + public Date getCreateTime() { + return createTime; + } + + @Override + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + @Override + public Date getUpdateTime() { + return updateTime; + } + + @Override + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + public Long[] getIds() { return ids; } diff --git a/jcdm-main/src/main/java/com/jcdm/main/da/testDeviceInterface/domain/DaTestDeviceInterface.java b/jcdm-main/src/main/java/com/jcdm/main/da/testDeviceInterface/domain/DaTestDeviceInterface.java index 20e22de..2031606 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/da/testDeviceInterface/domain/DaTestDeviceInterface.java +++ b/jcdm-main/src/main/java/com/jcdm/main/da/testDeviceInterface/domain/DaTestDeviceInterface.java @@ -1,5 +1,6 @@ package com.jcdm.main.da.testDeviceInterface.domain; +import com.fasterxml.jackson.annotation.JsonFormat; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.jcdm.common.annotation.Excel; @@ -68,8 +69,10 @@ @Excel(name = "鍒涘缓鐢ㄦ埛") private String createUser; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date updateTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date createTime; /** 鏇存敼鐢ㄦ埛 */ diff --git a/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java b/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java index f645c2e..46ff5d3 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java +++ b/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java @@ -136,6 +136,8 @@ omProductionOrdeInfo.setProductNum(dataObject.getStr("productNum")); omProductionOrdeInfo.setStationCode(dataObject.getStr("stationCode")); omProductionOrdeInfo.setMaterialCode(dataObject.getStr("materialCode")); + omProductionOrdeInfo.setOnlineCompletionMark("0"); + omProductionOrdeInfo.setSfResult("0"); if(dataObject.getStr("model").equals("PE01A")){ omProductionOrdeInfo.setProductCode("1P102S"); }else { @@ -249,4 +251,13 @@ { return omProductionOrdeInfoService.findBytrolleyYardGetOne(omProductionOrdeInfo); } + + @GetMapping("/workReportingByStation/{id}/{stationCode}") + public AjaxResult workReportingByStation(@PathVariable("id") Long id, @PathVariable("stationCode") String stationCode) + { + OmProductionOrdeInfo omProductionOrdeInfo = new OmProductionOrdeInfo(); + omProductionOrdeInfo.setId(id); + omProductionOrdeInfo.setStationCode(stationCode); + return omProductionOrdeInfoService.workReportingByStation(omProductionOrdeInfo); + } } diff --git a/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/service/IOmProductionOrdeInfoService.java b/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/service/IOmProductionOrdeInfoService.java index 6acda4e..12de657 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/service/IOmProductionOrdeInfoService.java +++ b/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/service/IOmProductionOrdeInfoService.java @@ -75,4 +75,9 @@ AjaxResult findBytrolleyYardGetOne(OmProductionOrdeInfo omProductionOrdeInfo); List<OmProductionOrdeInfo> checkCarCode(OmProductionOrdeInfo omProductionOrdeInfo); + + AjaxResult workReportingByStation(OmProductionOrdeInfo omProductionOrdeInfo); + + void updateOrderByProductNum(String status,String productNum,String stationCode); + } diff --git a/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/service/impl/OmProductionOrdeInfoServiceImpl.java b/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/service/impl/OmProductionOrdeInfoServiceImpl.java index fcd563a..9488546 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/service/impl/OmProductionOrdeInfoServiceImpl.java +++ b/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/service/impl/OmProductionOrdeInfoServiceImpl.java @@ -1,10 +1,14 @@ package com.jcdm.main.om.productionOrde.service.impl; +import java.text.SimpleDateFormat; +import java.util.Date; import java.util.List; import java.util.stream.Collectors; import cn.hutool.core.util.ObjectUtil; +import cn.hutool.json.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.jcdm.common.core.domain.AjaxResult; import com.jcdm.common.utils.DateUtils; @@ -29,6 +33,7 @@ public class OmProductionOrdeInfoServiceImpl extends ServiceImpl<OmProductionOrdeInfoMapper,OmProductionOrdeInfo> implements IOmProductionOrdeInfoService { private static final Logger logger = LoggerFactory.getLogger("sys-user"); + public SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); @Autowired private OmProductionOrdeInfoMapper omProductionOrdeInfoMapper; @@ -197,4 +202,37 @@ List<OmProductionOrdeInfo> list = omProductionOrdeInfoService.list(new LambdaQueryWrapper<OmProductionOrdeInfo>().eq(OmProductionOrdeInfo::getProductNum, omProductionOrdeInfo.getProductNum()).isNotNull(OmProductionOrdeInfo::getTrolleyYard)); return list; } + + @Override + public AjaxResult workReportingByStation(OmProductionOrdeInfo info) { + OmProductionOrdeInfo omProductionOrdeInfo = omProductionOrdeInfoService.getById(info.getId()); + logger.info("OP230鎶ュ伐寮�濮�-宸ュ巶MES寮傛鏂规硶"); + String reportResult = RestfulService.getWorkReportResultFeedback(omProductionOrdeInfo.getProductNum(), info.getStationCode(), format.format(new Date())); + JSONObject jsonObject = new JSONObject(reportResult); + String code = jsonObject.getStr("code"); + String status = jsonObject.getJSONObject("data").getStr("resultCode"); + if("success".equals(code)&&"S".equals(status)){ + //濡傛灉鎴愬姛锛屾墽琛屾姤宸ユ垚鍔熸柟娉曪紝淇敼鏄惁鎶ュ伐涓�1锛屾坊鍔犳姤宸ユ椂闂� + this.updateOrderByProductNum("1",omProductionOrdeInfo.getProductNum(),info.getStationCode()); + }else{ + //瑙f瀽宸ュ巶mes杩斿洖缁撴灉锛屽鏋滃け璐ワ紝鎵ц鎶ュ伐澶辫触鏂规硶锛屼慨鏀规槸鍚︽姤宸ヤ负2锛屾坊鍔犳姤宸ユ椂闂� + this.updateOrderByProductNum("2",omProductionOrdeInfo.getProductNum(),info.getStationCode()); + } + return null; + } + + @Override + public void updateOrderByProductNum(String onlineCompletionMark, String productNum, String stationCode) { + LambdaUpdateWrapper<OmProductionOrdeInfo> updateWrapper = new LambdaUpdateWrapper<>(); + if(stationCode.equals("OP230")){ + updateWrapper.set(OmProductionOrdeInfo::getOnlineCompletionMark,onlineCompletionMark); + updateWrapper.set(OmProductionOrdeInfo::getActualStartTime,new Date()); + } + if(stationCode.equals("OP500")){ + updateWrapper.set(OmProductionOrdeInfo::getSfResult,onlineCompletionMark); + } + updateWrapper.eq(OmProductionOrdeInfo::getProductNum,productNum); + OmProductionOrdeInfo omProductionOrdeInfo = new OmProductionOrdeInfo(); + omProductionOrdeInfoService.update(omProductionOrdeInfo,updateWrapper); + } } diff --git a/jcdm-main/src/main/java/com/jcdm/main/plcserver/CustomRunner.java b/jcdm-main/src/main/java/com/jcdm/main/plcserver/CustomRunner.java index 52d205c..9a9c710 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/plcserver/CustomRunner.java +++ b/jcdm-main/src/main/java/com/jcdm/main/plcserver/CustomRunner.java @@ -63,56 +63,56 @@ public List<String> getSubList(){ List<String> lists = new ArrayList<>(); lists.add(OPCElement.PACK_OP230_RecordData);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP240_RecordData);//璇锋眰璁板綍鏁版嵁. - lists.add(OPCElement.PACK_OP240_AngleResult);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP2501_AngleResult);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP2502_AngleResult);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP2503_AngleResult);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP260_RecordData);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP260_AngleResult);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP270_RecordData);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP270_AngleResult);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP290_RecordData);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP290_AngleResult);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP300A_RecordData);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP300B_RecordData);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP310A_RecordData);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP310B_RecordData);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP330_RecordData);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP380_RecordData);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP380_AngleResult);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP400_RecordData);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP400_AngleResult);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP410_RecordData);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP410_AngleResult);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP4301_RecordData);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP4302_RecordData);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP4303_RecordData);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP4304_RecordData);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP440_RecordData);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP450_RecordData);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP450_AngleResult);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP460_RecordData);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP460_AngleResult);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP4801_RecordData);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP4802_RecordData);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP4803_RecordData);//璇锋眰璁板綍鏁版嵁 - - lists.add(OPCElement.PACK_OP500_RecordData);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP500_AngleResult);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP240_RecordData);//璇锋眰璁板綍鏁版嵁. +// lists.add(OPCElement.PACK_OP240_AngleResult);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP2501_AngleResult);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP2502_AngleResult);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP2503_AngleResult);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP260_RecordData);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP260_AngleResult);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP270_RecordData);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP270_AngleResult);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP290_RecordData);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP290_AngleResult);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP300A_RecordData);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP300B_RecordData);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP310A_RecordData);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP310B_RecordData);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP330_RecordData);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP380_RecordData);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP380_AngleResult);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP400_RecordData);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP400_AngleResult);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP410_RecordData);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP410_AngleResult);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP4301_RecordData);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP4302_RecordData);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP4303_RecordData);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP4304_RecordData);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP440_RecordData);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP450_RecordData);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP450_AngleResult);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP460_RecordData);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP460_AngleResult);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP4801_RecordData);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP4802_RecordData);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP4803_RecordData);//璇锋眰璁板綍鏁版嵁 // - lists.add(OPCElement.PACK_OP280_RecordData);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP320A_RecordData);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP320B_RecordData);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP340A_RecordData);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP340B_RecordData);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP350A_RecordData);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP350B_RecordData);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP360_RecordData);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP365_RecordData);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP370_RecordData);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP390_RecordData);//璇锋眰璁板綍鏁版嵁 - lists.add(OPCElement.PACK_OP470_RecordData);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP500_RecordData);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP500_AngleResult);//璇锋眰璁板綍鏁版嵁 +//// +// lists.add(OPCElement.PACK_OP280_RecordData);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP320A_RecordData);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP320B_RecordData);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP340A_RecordData);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP340B_RecordData);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP350A_RecordData);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP350B_RecordData);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP360_RecordData);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP365_RecordData);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP370_RecordData);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP390_RecordData);//璇锋眰璁板綍鏁版嵁 +// lists.add(OPCElement.PACK_OP470_RecordData);//璇锋眰璁板綍鏁版嵁 return lists; } diff --git a/jcdm-main/src/main/java/com/jcdm/main/restful/factoryMes/service/RestfulService.java b/jcdm-main/src/main/java/com/jcdm/main/restful/factoryMes/service/RestfulService.java index 331b1d9..8cc1b31 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/restful/factoryMes/service/RestfulService.java +++ b/jcdm-main/src/main/java/com/jcdm/main/restful/factoryMes/service/RestfulService.java @@ -2,23 +2,27 @@ import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpResponse; +import cn.hutool.json.JSONObject; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; public class RestfulService { public static void main(String[] args) { - String str = "uuuuuu11uuuuuuuuuuuuuuu"; - System.out.println(str.length()); -// getWorkReportResultFeedback() https://imes-uat-group.geelycv-test.com + String json = "{\"code\":\"success\",\"data\":{\"productNum\":\"LCV123456P0600036\",\"stationCode\":\"1HZ01\",\"resultCode\":\"S\",\"resultText\":\"鎶ュ伐鎴愬姛\"},\"message\":\"API 璋冪敤鎴愬姛\"}"; + JSONObject jsonObject = new JSONObject(json); + String code = jsonObject.getStr("code"); + String resultCode = jsonObject.getJSONObject("data").getStr("resultCode"); + System.out.println("code: " + code); + System.out.println("resultCode: " + resultCode); } -// public static final String getRealmName = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/aMesSysIntegration"; + public static final String getRealmName = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/aMesSysIntegration"; // -// public static final String postRealmName = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/interface"; + public static final String postRealmName = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/interface"; - public static final String getRealmName = "https://imes-group.geelycv.com/api/mom-open/restful/aMesSysIntegration"; +// public static final String getRealmName = "https://imes-group.geelycv.com/api/mom-open/restful/aMesSysIntegration"; - public static final String postRealmName = "https://imes-group.geelycv.com/api/mom-open/restful/interface"; +// public static final String postRealmName = "https://imes-group.geelycv.com/api/mom-open/restful/interface"; public static final String siteCode = "3983"; diff --git a/jcdm-main/src/main/java/com/jcdm/main/restful/qingYan/service/ExternalInterface.java b/jcdm-main/src/main/java/com/jcdm/main/restful/qingYan/service/ExternalInterface.java index a77555f..0d833f4 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/restful/qingYan/service/ExternalInterface.java +++ b/jcdm-main/src/main/java/com/jcdm/main/restful/qingYan/service/ExternalInterface.java @@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpResponse; +import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.fasterxml.jackson.core.JsonProcessingException; @@ -12,6 +13,8 @@ import com.jcdm.common.core.domain.AjaxResult; import com.jcdm.common.utils.StringUtils; import com.jcdm.framework.websocket.WebSocketUsers; +import com.jcdm.main.bs.beatSetting.domain.BsBeatSetting; +import com.jcdm.main.bs.beatSetting.service.IBsBeatSettingService; import com.jcdm.main.bs.formulaChild.domain.BsFormulaChildInfo; import com.jcdm.main.bs.formulaChild.service.IBsFormulaChildInfoService; import com.jcdm.main.constant.Constants; @@ -23,6 +26,7 @@ import com.jcdm.main.da.testDeviceInterface.service.IDaTestDeviceInterfaceService; import com.jcdm.main.om.productionOrde.domain.OmProductionOrdeInfo; import com.jcdm.main.om.productionOrde.service.IOmProductionOrdeInfoService; +import com.jcdm.main.restful.factoryMes.service.RestfulService; import com.jcdm.main.restful.qingYan.doman.*; import lombok.extern.slf4j.Slf4j; import org.aspectj.weaver.loadtime.Aj; @@ -65,6 +69,9 @@ @Autowired private IBsFormulaChildInfoService bsFormulaChildInfoService; + + @Autowired + private IBsBeatSettingService bsBeatSettingService; private IDaPassingStationCollectionService passingStationCollectionService; @@ -205,14 +212,38 @@ return AjaxResult.success(restFulOrders); } + public static void main(String[] args) { + String str = "0RSPB0011A2E3AE5P0000002 2024-05-28 15:48:51"; + String[] split = str.split(" "); + System.out.println(split[0]); + System.out.println(split[1]); + + } + @GetMapping("/getQualityData") public AjaxResult getQualityData(){ - List<DaPassingStationCollection> qualified = daPassingStationCollectionService.list(new LambdaQueryWrapper<DaPassingStationCollection>().eq(DaPassingStationCollection::getOutRsSign, "1")); - List<DaPassingStationCollection> unQualified = daPassingStationCollectionService.list(new LambdaQueryWrapper<DaPassingStationCollection>().eq(DaPassingStationCollection::getOutRsSign, "2")); - Map<String,Integer> map = new HashMap<>(); - map.put("qualified",qualified.size()); - map.put("unQualified",unQualified.size()); - return AjaxResult.success(map); +// List<DaPassingStationCollection> qualified = daPassingStationCollectionService.list(new LambdaQueryWrapper<DaPassingStationCollection>().eq(DaPassingStationCollection::getOutRsSign, "1")); +// List<DaPassingStationCollection> unQualified = daPassingStationCollectionService.list(new LambdaQueryWrapper<DaPassingStationCollection>().eq(DaPassingStationCollection::getOutRsSign, "2")); +// Map<String,Integer> map = new HashMap<>(); +// map.put("qualified",qualified.size()); +// map.put("unQualified",unQualified.size()); + for (BsBeatSetting bsBeatSetting : bsBeatSettingService.list()) { + String str = bsBeatSetting.getProductCode(); + String[] split = str.split(" "); + String reportResult = RestfulService.getWorkReportResultFeedback(split[0], "OP500", "2024-06-27 15:48:51"); + JSONObject jsonObject = new JSONObject(reportResult); + String code = jsonObject.getStr("code"); + String status = jsonObject.getJSONObject("data").getStr("resultCode"); + if("success".equals(code)&&"S".equals(status)){ + //濡傛灉鎴愬姛锛屾墽琛屾姤宸ユ垚鍔熸柟娉曪紝淇敼鏄惁鎶ュ伐涓�1锛屾坊鍔犳姤宸ユ椂闂� + bsBeatSetting.setProductName("S"); + this.bsBeatSettingService.saveOrUpdate(bsBeatSetting); + }else{ + bsBeatSetting.setProductName("F"); + this.bsBeatSettingService.saveOrUpdate(bsBeatSetting); + } + } + return AjaxResult.success(); } diff --git a/jcdm-main/src/main/resources/mapper/bs/beatSetting/BsBeatSettingMapper.xml b/jcdm-main/src/main/resources/mapper/bs/beatSetting/BsBeatSettingMapper.xml index f0a65db..194ca63 100644 --- a/jcdm-main/src/main/resources/mapper/bs/beatSetting/BsBeatSettingMapper.xml +++ b/jcdm-main/src/main/resources/mapper/bs/beatSetting/BsBeatSettingMapper.xml @@ -9,8 +9,6 @@ <result property="productCode" column="product_code" /> <result property="productName" column="product_name" /> <result property="beat" column="beat" /> - <result property="spareField1" column="spare_field_1" /> - <result property="spareField2" column="spare_field_2" /> <result property="remark" column="remark" /> <result property="createUser" column="create_user" /> <result property="createTime" column="create_time" /> @@ -20,7 +18,7 @@ </resultMap> <sql id="selectBsBeatSettingVo"> - select id, product_code, product_name, beat, spare_field_1, spare_field_2, remark, create_user, create_time, update_user, update_time, data_source from bs_beat_setting + select id, product_code, product_name, beat, remark, create_user, create_time, update_user, update_time, data_source from bs_beat_setting </sql> <select id="selectBsBeatSettingList" parameterType="BsBeatSetting" resultMap="BsBeatSettingResult"> @@ -29,8 +27,6 @@ <if test="productCode != null and productCode != ''"> and product_code = #{productCode}</if> <if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if> <if test="beat != null and beat != ''"> and beat = #{beat}</if> - <if test="spareField1 != null and spareField1 != ''"> and spare_field_1 = #{spareField1}</if> - <if test="spareField2 != null and spareField2 != ''"> and spare_field_2 = #{spareField2}</if> <if test="createUser != null and createUser != ''"> and create_user = #{createUser}</if> <if test="updateUser != null and updateUser != ''"> and update_user = #{updateUser}</if> <if test="dataSource != null and dataSource != ''"> and data_source = #{dataSource}</if> @@ -48,8 +44,6 @@ <if test="productCode != null">product_code,</if> <if test="productName != null">product_name,</if> <if test="beat != null and beat != ''">beat,</if> - <if test="spareField1 != null">spare_field_1,</if> - <if test="spareField2 != null">spare_field_2,</if> <if test="remark != null">remark,</if> <if test="createUser != null">create_user,</if> <if test="createTime != null">create_time,</if> @@ -61,8 +55,6 @@ <if test="productCode != null">#{productCode},</if> <if test="productName != null">#{productName},</if> <if test="beat != null and beat != ''">#{beat},</if> - <if test="spareField1 != null">#{spareField1},</if> - <if test="spareField2 != null">#{spareField2},</if> <if test="remark != null">#{remark},</if> <if test="createUser != null">#{createUser},</if> <if test="createTime != null">#{createTime},</if> @@ -78,8 +70,6 @@ <if test="productCode != null">product_code = #{productCode},</if> <if test="productName != null">product_name = #{productName},</if> <if test="beat != null and beat != ''">beat = #{beat},</if> - <if test="spareField1 != null">spare_field_1 = #{spareField1},</if> - <if test="spareField2 != null">spare_field_2 = #{spareField2},</if> <if test="remark != null">remark = #{remark},</if> <if test="createUser != null">create_user = #{createUser},</if> <if test="createTime != null">create_time = #{createTime},</if> diff --git a/jcdm-main/src/main/resources/mapper/om/productionOrde/OmProductionOrdeInfoMapper.xml b/jcdm-main/src/main/resources/mapper/om/productionOrde/OmProductionOrdeInfoMapper.xml index a8698ef..efc2d79 100644 --- a/jcdm-main/src/main/resources/mapper/om/productionOrde/OmProductionOrdeInfoMapper.xml +++ b/jcdm-main/src/main/resources/mapper/om/productionOrde/OmProductionOrdeInfoMapper.xml @@ -81,6 +81,8 @@ <if test="resultText != null and resultText != ''"> and result_text = #{resultText}</if> <if test="resultCode != null and resultCode != ''"> and result_code = #{resultCode}</if> <if test="sfResult != null and sfResult != ''"> and sf_result = #{sfResult}</if> + <if test="onlineCompletionMark != null and sfResult != ''"> and online_completion_mark = #{onlineCompletionMark}</if> + </where> ORDER BY stream_number DESC </select> diff --git a/jcdm-ui/src/api/main/da/paramCollection/paramCollection.js b/jcdm-ui/src/api/main/da/paramCollection/paramCollection.js index b259fca..f77c8db 100644 --- a/jcdm-ui/src/api/main/da/paramCollection/paramCollection.js +++ b/jcdm-ui/src/api/main/da/paramCollection/paramCollection.js @@ -71,6 +71,15 @@ }) } +export function preInstallOut(data) { + return request({ + url: '/main/paramCollection/preInstallOut', + method: 'post', + data: data + }) +} + + // 鏂板璁惧浜у搧杩囩▼鍙傛暟閲囬泦 saveCampaignTimeParameters export function saveCampaignTimeParameters(data) { return request({ diff --git a/jcdm-ui/src/api/main/om/productionOrde/productionOrde.js b/jcdm-ui/src/api/main/om/productionOrde/productionOrde.js index 56a8cee..bfbf89b 100644 --- a/jcdm-ui/src/api/main/om/productionOrde/productionOrde.js +++ b/jcdm-ui/src/api/main/om/productionOrde/productionOrde.js @@ -74,6 +74,13 @@ }) } +export function workReportingByStation(id,stationCode) { + return request({ + url: '/om/productionOrde/workReportingByStation/' + id+'/' + stationCode, + method: 'get', + }) +} + // 鏂板鐢熶骇宸ュ崟 export function addProductionOrde(data) { return request({ diff --git a/jcdm-ui/src/views/main/bs/formulaChild/index.vue b/jcdm-ui/src/views/main/bs/formulaChild/index.vue index a21f8d0..963afa4 100644 --- a/jcdm-ui/src/views/main/bs/formulaChild/index.vue +++ b/jcdm-ui/src/views/main/bs/formulaChild/index.vue @@ -2,22 +2,6 @@ <div class="app-container"> <el-card class="box-card"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> - <el-form-item label="杞﹂棿" prop="workshopCode"> - <el-input - v-model="queryParams.workshopCode" - placeholder="璇疯緭鍏ヨ溅闂�" - clearable - @keyup.enter.native="handleQuery" - /> - </el-form-item> - <el-form-item label="浜х嚎" prop="lineCode"> - <el-input - v-model="queryParams.lineCode" - placeholder="璇疯緭鍏ヤ骇绾�" - clearable - @keyup.enter.native="handleQuery" - /> - </el-form-item> <el-form-item label="宸ュ簭" prop="processesCode"> <el-input v-model="queryParams.processesCode" @@ -26,24 +10,40 @@ @keyup.enter.native="handleQuery" /> </el-form-item> - <el-form-item label="浜у搧缂栧彿" prop="productCode"> + <el-form-item label="鍙傛暟缂栫爜" prop="paramCode"> <el-input - v-model="queryParams.productCode" - placeholder="璇疯緭鍏ヤ骇鍝佺紪鍙�" + v-model="queryParams.paramCode" + placeholder="璇疯緭鍏ュ弬鏁扮紪鐮�" clearable @keyup.enter.native="handleQuery" /> </el-form-item> -<!-- <el-form-item label="绫诲瀷" prop="operationType">--> -<!-- <el-select v-model="queryParams.operationType" placeholder="璇烽�夋嫨绫诲瀷" clearable>--> -<!-- <el-option--> -<!-- v-for="dict in dict.type.${dictType}"--> -<!-- :key="dict.value"--> -<!-- :label="dict.label"--> -<!-- :value="dict.value"--> -<!-- />--> -<!-- </el-select>--> +<!-- <el-form-item label="浜х嚎" prop="lineCode">--> +<!-- <el-input--> +<!-- v-model="queryParams.lineCode"--> +<!-- placeholder="璇疯緭鍏ヤ骇绾�"--> +<!-- clearable--> +<!-- @keyup.enter.native="handleQuery"--> +<!-- />--> <!-- </el-form-item>--> +<!-- <el-form-item label="浜у搧缂栧彿" prop="productCode">--> +<!-- <el-input--> +<!-- v-model="queryParams.productCode"--> +<!-- placeholder="璇疯緭鍏ヤ骇鍝佺紪鍙�"--> +<!-- clearable--> +<!-- @keyup.enter.native="handleQuery"--> +<!-- />--> +<!-- </el-form-item>--> + <el-form-item label="绫诲瀷" prop="operationType"> + <el-select v-model="queryParams.operationType" placeholder="璇烽�夋嫨绫诲瀷" clearable> + <el-option + v-for="dict in dict.type.operation_type" + :key="dict.value" + :label="dict.label" + :value="dict.value" + /> + </el-select> + </el-form-item> <el-form-item style="float: right"> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button> @@ -218,12 +218,12 @@ /> <!-- 娣诲姞鎴栦慨鏀归厤鏂归厤缃瓙淇℃伅瀵硅瘽妗� --> - <el-dialog v-dialogpop-up :title="title" :visible.sync="open" width="500px" append-to-body> + <el-dialog v-dialogpop-up :title="title" :visible.sync="open" width="1000px" append-to-body> <span slot="title"> <i class="el-icon-s-order"></i> {{titleName}} </span> - <el-form ref="form" :model="form" :rules="rules" label-width="80px"> + <el-form ref="form" :inline="true" :model="form" :rules="rules" label-width="80px"> <!-- <el-form-item label="杞﹂棿" prop="workshopCode">--> <!-- <el-input v-model="form.workshopCode" placeholder="璇疯緭鍏ヨ溅闂�" />--> <!-- </el-form-item>--> diff --git a/jcdm-ui/src/views/main/cfkb/Instructions/index.vue b/jcdm-ui/src/views/main/cfkb/Instructions/index.vue index 2f02ed9..80e636b 100644 --- a/jcdm-ui/src/views/main/cfkb/Instructions/index.vue +++ b/jcdm-ui/src/views/main/cfkb/Instructions/index.vue @@ -45,7 +45,7 @@ <br> <br> <br> - <div ref="canvasWrapper" id="canvasWrapper1" style="display: flex;justify-content: center;margin-top: -27px"></div> + <div ref="canvasWrapper" id="canvasWrapper1" style="display: flex;justify-content: center;margin-top: -27px;"></div> <span style="font-size: 10px;word-break: break-all;display: flex;justify-content: center;width: 155px;margin-left: 9px">P9900166410#T{{text1}}#V993983#SSW002.005#HHW001.001#NBMS#</span> <br> <br> diff --git a/jcdm-ui/src/views/main/da/paramCollection/index.vue b/jcdm-ui/src/views/main/da/paramCollection/index.vue index 7e5bf2e..8e4394f 100644 --- a/jcdm-ui/src/views/main/da/paramCollection/index.vue +++ b/jcdm-ui/src/views/main/da/paramCollection/index.vue @@ -2,18 +2,42 @@ <div class="app-container"> <el-card class="box-card"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> - <el-form-item label="浜у搧缂栫爜" prop="productCode"> + <el-form-item label="宸ュ崟缂栧彿" prop="workOrderNo"> <el-input - v-model="queryParams.productCode" - placeholder="璇疯緭鍏ヤ骇鍝佺紪鐮�" + v-model="queryParams.workOrderNo" + placeholder="璇疯緭鍏ュ伐鍗曠紪鍙�" clearable @keyup.enter.native="handleQuery" /> </el-form-item> - <el-form-item label="浜у搧鍚嶇О" prop="productName"> + <el-form-item label-width="100px" label="鎬绘垚搴忓垪鍙�" prop="sfcCode"> <el-input - v-model="queryParams.productName" - placeholder="璇疯緭鍏ヤ骇鍝佸悕绉�" + v-model="queryParams.sfcCode" + placeholder="璇疯緭鍏ユ�绘垚搴忓垪鍙�" + clearable + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="鍙傛暟缂栫爜" prop="paramCode"> + <el-input + v-model="queryParams.paramCode" + placeholder="璇疯緭鍏ュ弬鏁扮紪鐮�" + clearable + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="宸ュ簭" prop="locationCode"> + <el-input + v-model="queryParams.locationCode" + placeholder="璇疯緭鍏ュ伐搴�" + clearable + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="浜у搧缂栫爜" prop="productCode"> + <el-input + v-model="queryParams.productCode" + placeholder="璇疯緭鍏ヤ骇鍝佺紪鐮�" clearable @keyup.enter.native="handleQuery" /> @@ -73,15 +97,15 @@ <el-table v-loading="loading" border :data="paramCollectionList" @selection-change="handleSelectionChange" v-if="paramCollectionList.length > 0"> <el-table-column type="selection" width="55" align="center" /> - <el-table-column label="宸ュ崟缂栧彿" width="150" align="center" prop="workOrderNo"></el-table-column> - <el-table-column label="鎬绘垚搴忓垪鍙�" align="center" width="140" prop="sfcCode" ></el-table-column> - <el-table-column label="浜у搧缂栧彿" align="center" width="150" prop="productCode"></el-table-column> + <el-table-column label="宸ュ崟缂栧彿" width="100" align="center" prop="workOrderNo"></el-table-column> + <el-table-column label="鎬绘垚搴忓垪鍙�" align="center" width="290" prop="sfcCode" ></el-table-column> + <el-table-column label="浜у搧缂栧彿" align="center" width="100" prop="productCode"></el-table-column> <!-- <el-table-column label="浜х嚎缂栧彿" align="center" prop="productionLine"></el-table-column>--> <el-table-column label="宸ュ簭缂栧彿" align="center" prop="locationCode"></el-table-column> <!-- <el-table-column label="璁惧缂栧彿" align="center" prop="equipmentNo"></el-table-column>--> - <el-table-column label="鍙傛暟缂栫爜" width="150" align="center" prop="paramCode"></el-table-column> + <el-table-column label="鍙傛暟缂栫爜" width="190" align="center" prop="paramCode"></el-table-column> <el-table-column label="鍙傛暟鍚嶇О" width="150" align="center" prop="paramName"></el-table-column> - <el-table-column label="鍙傛暟鍊�" width="160" align="center" prop="paramValue"></el-table-column> + <el-table-column label="鍙傛暟鍊�" width="330" align="center" prop="paramValue"></el-table-column> <!-- <el-table-column label="鍙傛暟涓婇檺" align="center" prop="paramUpper"></el-table-column> <el-table-column label="鍙傛暟涓嬮檺" align="center" prop="paramLower"></el-table-column>--> <el-table-column label="閲囬泦鏃堕棿" align="center" prop="collectionTime" width="160"> diff --git a/jcdm-ui/src/views/main/da/passingStationCollection/index.vue b/jcdm-ui/src/views/main/da/passingStationCollection/index.vue index bcde3fa..5e54595 100644 --- a/jcdm-ui/src/views/main/da/passingStationCollection/index.vue +++ b/jcdm-ui/src/views/main/da/passingStationCollection/index.vue @@ -2,6 +2,30 @@ <div class="app-container"> <el-card class="box-card"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> + <el-form-item label="宸ュ崟缂栧彿" prop="workOrderNo"> + <el-input + v-model="queryParams.workOrderNo" + placeholder="璇疯緭鍏ュ伐鍗曠紪鍙�" + clearable + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label-width="100px" label="鎬绘垚搴忓垪鍙�" prop="sfcCode"> + <el-input + v-model="queryParams.sfcCode" + placeholder="璇疯緭鍏ユ�绘垚搴忓垪鍙�" + clearable + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="宸ュ簭" prop="locationCode"> + <el-input + v-model="queryParams.locationCode" + placeholder="璇疯緭鍏ュ伐搴�" + clearable + @keyup.enter.native="handleQuery" + /> + </el-form-item> <el-form-item label="鍏ョ珯鏃堕棿" prop="inboundTime"> <el-date-picker clearable v-model="queryParams.inboundTime" @@ -73,11 +97,11 @@ <el-table v-loading="loading" border :data="passingStationCollectionList" @selection-change="handleSelectionChange" v-if="passingStationCollectionList.length > 0"> <el-table-column type="selection" width="55" align="center" /> - <el-table-column label="宸ュ崟缂栧彿" align="center" prop="workOrderNo"> + <el-table-column label="宸ュ崟缂栧彿" width="100" align="center" prop="workOrderNo"> </el-table-column> -<!-- <el-table-column label="鎬绘垚搴忓垪鍙�" align="center" prop="sfcCode">--> -<!-- </el-table-column>--> - <el-table-column label="浜у搧搴忓垪鍙�" align="center" prop="productCode"> + <el-table-column label="鎬绘垚搴忓垪鍙�" width="310" align="center" prop="sfcCode"> + </el-table-column> + <el-table-column label="浜у搧缂栫爜" align="center" prop="productCode"> </el-table-column> <!-- <el-table-column label="浜х嚎缂栧彿" align="center" prop="productionLine">--> <!-- </el-table-column>--> @@ -94,7 +118,10 @@ </template> </el-table-column> - <el-table-column label="鏄惁鍚堟牸" align="center" prop="outRsSign"> + <el-table-column label="鏄惁鍚堟牸" align="center"> + <template slot-scope="scope"> + <dict-tag :options="dict.type.qualified_status" :value="scope.row.outRsSign"/> + </template> </el-table-column> <el-table-column label="NG鍘熷洜" align="center" prop="outMsgSign"> </el-table-column> @@ -103,19 +130,19 @@ <!-- <span>{{ parseTime(scope.row.collectionTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>--> <!-- </template>--> <!-- </el-table-column>--> - <el-table-column label="鑺傛媿鏃堕棿" align="center" prop="beatTime"> - </el-table-column> +<!-- <el-table-column label="鑺傛媿鏃堕棿" align="center" prop="beatTime">--> +<!-- </el-table-column>--> <el-table-column fixed="right" label="鎿嶄綔" width="200" align="center" class-name="small-padding fixed-width"> <template slot-scope="scope"> - <el-button - size="mini" - type="success" - plain - style="width: 72px" - icon="el-icon-edit" - @click="handleUpdate(scope.row)" - v-hasPermi="['da:passingStationCollection:edit']" - >淇敼</el-button> +<!-- <el-button--> +<!-- size="mini"--> +<!-- type="success"--> +<!-- plain--> +<!-- style="width: 72px"--> +<!-- icon="el-icon-edit"--> +<!-- @click="handleUpdate(scope.row)"--> +<!-- v-hasPermi="['da:passingStationCollection:edit']"--> +<!-- >淇敼</el-button>--> <el-button size="mini" type="danger" @@ -178,7 +205,7 @@ placeholder="璇烽�夋嫨鍑虹珯鏃堕棿"> </el-date-picker> </el-form-item> - <el-form-item label="鏄惁鍚堟牸" prop="outRsSign"> + <el-form-item label="鏄惁鍚堟牸"> <el-input v-model="form.outRsSign" placeholder="璇疯緭鍏ュ嚭绔欐槸鍚﹀悎鏍�" /> </el-form-item> <el-form-item label="NG鍘熷洜" prop="outMsgSign"> @@ -209,6 +236,7 @@ export default { name: "PassingStationCollection", + dicts: ['qualified_status'], data() { return { // 閬僵灞� diff --git a/jcdm-ui/src/views/main/da/testDeviceInterface/index.vue b/jcdm-ui/src/views/main/da/testDeviceInterface/index.vue index 9e6d15d..51df07c 100644 --- a/jcdm-ui/src/views/main/da/testDeviceInterface/index.vue +++ b/jcdm-ui/src/views/main/da/testDeviceInterface/index.vue @@ -2,10 +2,10 @@ <div class="app-container"> <el-card class="box-card"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> - <el-form-item label="妫�楠岃褰曠紪鍙�" prop="recordId"> + <el-form-item label-width="1" label="妫�楠岃褰曠紪鍙�" prop="recordId"> <el-input v-model="queryParams.recordId" - placeholder="璇疯緭鍏ユ楠岃褰曠紪鍙凤紝鐢卞悇璁惧鎸夎嚜瀹氳鍒欑敓鎴愶紝鍞竴缂栫爜" + placeholder="璇疯緭鍏ユ楠岃褰曠紪鍙�" clearable @keyup.enter.native="handleQuery" /> @@ -69,38 +69,38 @@ <el-card style="margin-top: 10px" class="box-card"> <el-row :gutter="10" class="mb8"> - <el-col :span="1.5"> - <el-button - type="primary" - plain - icon="el-icon-plus" - size="mini" - @click="handleAdd" - v-hasPermi="['da:testDeviceInterface:add']" - >鏂板</el-button> - </el-col> - <el-col :span="1.5"> - <el-button - type="success" - plain - icon="el-icon-edit" - size="mini" - :disabled="single" - @click="handleUpdate" - v-hasPermi="['da:testDeviceInterface:edit']" - >淇敼</el-button> - </el-col> - <el-col :span="1.5"> - <el-button - type="danger" - plain - icon="el-icon-delete" - size="mini" - :disabled="multiple" - @click="handleDelete" - v-hasPermi="['da:testDeviceInterface:remove']" - >鍒犻櫎</el-button> - </el-col> +<!-- <el-col :span="1.5">--> +<!-- <el-button--> +<!-- type="primary"--> +<!-- plain--> +<!-- icon="el-icon-plus"--> +<!-- size="mini"--> +<!-- @click="handleAdd"--> +<!-- v-hasPermi="['da:testDeviceInterface:add']"--> +<!-- >鏂板</el-button>--> +<!-- </el-col>--> +<!-- <el-col :span="1.5">--> +<!-- <el-button--> +<!-- type="success"--> +<!-- plain--> +<!-- icon="el-icon-edit"--> +<!-- size="mini"--> +<!-- :disabled="single"--> +<!-- @click="handleUpdate"--> +<!-- v-hasPermi="['da:testDeviceInterface:edit']"--> +<!-- >淇敼</el-button>--> +<!-- </el-col>--> +<!-- <el-col :span="1.5">--> +<!-- <el-button--> +<!-- type="danger"--> +<!-- plain--> +<!-- icon="el-icon-delete"--> +<!-- size="mini"--> +<!-- :disabled="multiple"--> +<!-- @click="handleDelete"--> +<!-- v-hasPermi="['da:testDeviceInterface:remove']"--> +<!-- >鍒犻櫎</el-button>--> +<!-- </el-col>--> <el-col :span="1.5"> <el-button type="warning" @@ -116,57 +116,56 @@ <el-table border v-loading="loading" :data="testDeviceInterfaceList" @selection-change="handleSelectionChange"> <el-table-column type="selection" width="55" align="center" /> - <el-table-column label="id" align="center" prop="id" /> - <el-table-column label="妫�楠岃褰曠紪鍙�" align="center" prop="recordId"> + <el-table-column label="妫�楠岃褰曠紪鍙�" width="100" :show-overflow-tooltip='true' align="center" prop="recordId"> </el-table-column> - <el-table-column label="绔欑偣缂栧彿" align="center" prop="stationCode"> + <el-table-column label="绔欑偣缂栧彿" width="100" align="center" prop="stationCode"> </el-table-column> - <el-table-column label="pack鐮�" align="center" prop="productNum"> + <el-table-column label="pack鐮�" width="230" :show-overflow-tooltip='true' align="center" prop="productNum"> </el-table-column> - <el-table-column label="鏁翠綋缁撴灉 " align="center" prop="totalResult"> + <el-table-column label="鏁翠綋缁撴灉" width="100" align="center" prop="totalResult"> </el-table-column> - <el-table-column label="宸ュ崟鍙�" align="center" prop="workOrderNo"> + <el-table-column label="宸ュ崟鍙�" width="100" align="center" prop="workOrderNo"> </el-table-column> - <el-table-column label="渚涘簲鍟嗙被鍨�" align="center" prop="supplierType"> +<!-- <el-table-column label="渚涘簲鍟嗙被鍨�" align="center" prop="supplierType">--> +<!-- </el-table-column>--> + <el-table-column label="鍏ュ弬" width="300" :show-overflow-tooltip='true' align="center" prop="checkList"> </el-table-column> - <el-table-column label="鍏ュ弬" align="center" prop="checkList"> - </el-table-column> - <el-table-column label="鐘舵�佺紪鐮�" align="center" prop="resultCode"> - </el-table-column> - <el-table-column label="杩斿洖淇℃伅" align="center" prop="resultMessage"> - </el-table-column> - <el-table-column label="鍑哄弬" align="center" prop="resultData"> - </el-table-column> +<!-- <el-table-column label="鐘舵�佺紪鐮�" width="100" align="center" prop="resultCode">--> +<!-- </el-table-column>--> +<!-- <el-table-column label="杩斿洖淇℃伅" width="100" align="center" prop="resultMessage">--> +<!-- </el-table-column>--> +<!-- <el-table-column label="鍑哄弬" width="100" align="center" prop="resultData">--> +<!-- </el-table-column>--> <el-table-column label="鍒涘缓鐢ㄦ埛" align="center" prop="createUser"> </el-table-column> - <el-table-column label="鍒涘缓鏃堕棿" align="center" prop="createTime"> + <el-table-column label="鍒涘缓鏃堕棿" width="160" align="center" prop="createTime"> </el-table-column> <el-table-column label="鏇存敼鐢ㄦ埛" align="center" prop="updateUser"> </el-table-column> - <el-table-column label="鏇存敼鏃堕棿" align="center" prop="updateTime"> + <el-table-column label="鏇存敼鏃堕棿" width="160" align="center" prop="updateTime"> </el-table-column> - <el-table-column fixed="right" width="200" label="鎿嶄綔" align="center" class-name="small-padding fixed-width"> - <template slot-scope="scope"> - <el-button - size="mini" - type="success" - plain - style="width: 72px" - icon="el-icon-edit" - @click="handleUpdate(scope.row)" - v-hasPermi="['da:testDeviceInterface:edit']" - >淇敼</el-button> - <el-button - size="mini" - type="danger" - plain - style="width: 72px" - icon="el-icon-delete" - @click="handleDelete(scope.row)" - v-hasPermi="['da:testDeviceInterface:remove']" - >鍒犻櫎</el-button> - </template> - </el-table-column> +<!-- <el-table-column fixed="right" width="200" label="鎿嶄綔" align="center" class-name="small-padding fixed-width">--> +<!-- <template slot-scope="scope">--> +<!-- <el-button--> +<!-- size="mini"--> +<!-- type="success"--> +<!-- plain--> +<!-- style="width: 72px"--> +<!-- icon="el-icon-edit"--> +<!-- @click="handleUpdate(scope.row)"--> +<!-- v-hasPermi="['da:testDeviceInterface:edit']"--> +<!-- >淇敼</el-button>--> +<!-- <el-button--> +<!-- size="mini"--> +<!-- type="danger"--> +<!-- plain--> +<!-- style="width: 72px"--> +<!-- icon="el-icon-delete"--> +<!-- @click="handleDelete(scope.row)"--> +<!-- v-hasPermi="['da:testDeviceInterface:remove']"--> +<!-- >鍒犻櫎</el-button>--> +<!-- </template>--> +<!-- </el-table-column>--> </el-table> </el-card> diff --git a/jcdm-ui/src/views/main/kb/preInstalledTerminal/index.vue b/jcdm-ui/src/views/main/kb/preInstalledTerminal/index.vue index 68e47eb..8aeedb5 100644 --- a/jcdm-ui/src/views/main/kb/preInstalledTerminal/index.vue +++ b/jcdm-ui/src/views/main/kb/preInstalledTerminal/index.vue @@ -4,6 +4,7 @@ <el-col :span="7"> <el-card shadow="never"> <span class="head-font">宸ヤ綅缂栧彿 : {{headContent.processesCode}}</span> + <span hidden>{{headContent.inboundTime}}</span> </el-card> </el-col> <el-col :span="7"> @@ -201,7 +202,7 @@ import USBDevice from "@/utils/usb.json"; import {addPassingStationCollection} from "@/api/main/da/passingStationCollection/passingStationCollection"; import { - addTighteningParameters, + addTighteningParameters, preInstallOut, replaceAssemblyCode, saveCampaignTimeParameters, yzAddBasicParameters, @@ -229,6 +230,7 @@ processesName: '璐存爣鏈�-璐寸爜', sfcCode: '', yzSfcCode: '', + inboundTime: '', }, workpieceInformation: { workOrderNo: null, @@ -259,7 +261,8 @@ }, content: '', activeName: 'first', - url: "ws://192.168.2.76:8080/websocket/message/", + url: "ws://10.103.210.248:8080/websocket/message/", + // url: "ws://192.168.2.76:8080/websocket/message/", message: "", text_content: "", ws: null, @@ -337,6 +340,20 @@ } + }, + + getCurrentTime() { + const now = new Date(); + const year = now.getFullYear(); + const month = this.padTimeUnit(now.getMonth() + 1); // 鏈堜唤鏄粠0寮�濮嬬殑 + const day = this.padTimeUnit(now.getDate()); + const hours = this.padTimeUnit(now.getHours()); + const minutes = this.padTimeUnit(now.getMinutes()); + const seconds = this.padTimeUnit(now.getSeconds()); + return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; + }, + padTimeUnit(value) { + return value.toString().padStart(2, '0'); }, serialPortMethod(value){ let formulaChildParams = { @@ -420,7 +437,7 @@ } fistSetpNumber(param).then(response => {}); this.getListFormulaChild() - this.addOverStationCollection() + // this.addOverStationCollection() }, /** 鍏ョ珯澧炲姞杩囩珯閲囬泦璁板綍 **/ @@ -477,36 +494,7 @@ this.$message('websocket杩炴帴鎴愬姛锛�'); }; this.ws.onmessage = function (event) { - if (event.data === "IN") { - self.cakeLamp.InPlace = 1; - } else if (event.data === "IN0") { - self.cakeLamp.InPlace = 0; - } else if (event.data === "OUT") { - console.log("out") - - const param = { - workOrderNo: self.workpieceInformation.workOrderNo, - productCode: "1P102S", - locationCode: self.headContent.processesCode, - productBarcode: self.headContent.sfcCode, - } - // saveCampaignTimeParameters(param).then(response => {}); - // self.cakeLamp.release = 1; - workpieceRelease(param).then(response => {}); - self.formulaChildList = []; - self.headContent.sfcCode = ''; - console.log(self.formulaChildList) - } else if (event.data === "END") { - // const param = { - // workOrderNo: self.workpieceInformation.workOrderNo, - // productCode: self.workpieceInformation.productCode, - // locationCode: self.headContent.processesCode, - // productBarcode: self.headContent.sfcCode, - // } - // saveCampaignTimeParameters(param).then(response => {}); - // self.endClear() - // workpieceRelease(param).then(response => {}); - } else if (event.data.includes("[")) { + if(event.data.includes("[")) { let formulaChilds = ""; self.formulaChildList.sort((a, b) => a.stepSort - b.stepSort); self.formulaChildList @@ -523,45 +511,46 @@ tightenTheArray: event.data, paramCode: formulaChilds.paramCode, // workOrderNo: self.workpieceInformation.workOrderNo, - productCode: "1P102S", + // productCode: "1P102S", locationCode: self.headContent.processesCode, productBarcode: self.headContent.sfcCode, - } - if(formulaChilds.paramCode === null||formulaChilds.paramCode ===''){ - self.$message('鏈壘鍒板弬鏁扮爜锛岃妫�鏌ュ弬鏁扮爜鏄惁姝g‘'); - return; + spareField2: formulaChilds.spareField2, + spareField3: formulaChilds.spareField3, + spareField4: formulaChilds.spareField4, + stepSort: formulaChilds.stepSort } if(self.headContent.sfcCode === null||self.headContent.sfcCode ===''){ self.$message('鏈壘鍒版�绘垚鐮侊紝璇峰厛鎵爜锛�'); return; } + if(formulaChilds.paramCode === null||formulaChilds.paramCode ===''){ + self.$message('鏈壘鍒板弬鏁扮爜锛岃妫�鏌ュ弬鏁扮爜鏄惁姝g‘'); + return; + } + checkMaterialCode(param).then(response => { if(response.msg === "2"){ self.$message('鏈壂鎻忕墿鏂欑爜瀹屾瘯锛�'); - return; + }else { + yzUpdateTighteningFormula(param).then(response => { + console.log(response) + if(response.msg === "1" || response.msg === "3"){ + self.getListFormulaChild() + }else { + const param = { + locationCode: self.headContent.processesCode, + productBarcode: self.headContent.sfcCode, + inboundTime: self.headContent.inboundTime + } + preInstallOut(param).then(response => {}); + workpieceRelease(param).then(response => {}); + self.formulaChildList = []; + self.headContent.sfcCode = ''; + } + }); + 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 = ''; - } - }); - addTighteningParameters(param).then(response => {}); - // self.getListFormulaChild() - } }; }, @@ -581,6 +570,7 @@ this.serialPortMethod(scanValue) } else { this.headContent.sfcCode = scanValue; + this.headContent.inboundTime = this.getCurrentTime(); this.getList() } diff --git a/jcdm-ui/src/views/main/kb/stationTerminal/index.vue b/jcdm-ui/src/views/main/kb/stationTerminal/index.vue index 4872951..b64b35f 100644 --- a/jcdm-ui/src/views/main/kb/stationTerminal/index.vue +++ b/jcdm-ui/src/views/main/kb/stationTerminal/index.vue @@ -34,18 +34,21 @@ <el-descriptions-item label="宸ュ崟缂栧彿"> <span>{{workpieceInformation.workOrderNo}}</span> </el-descriptions-item> - <el-descriptions-item label="浜у搧缂栧彿"> + <el-descriptions-item label="浜у搧鍨嬪彿"> <span>{{workpieceInformation.productCode}}</span> </el-descriptions-item> - <el-descriptions-item label="浜у搧鍨嬪彿"> - <span>{{workpieceInformation.productModel}}</span> + <el-descriptions-item label="灏忚溅鐮�"> + <span>{{headContent.cardCode}}</span> </el-descriptions-item> - <el-descriptions-item label="浜у搧鍚嶇О"> - <span>{{workpieceInformation.productName}}</span> - </el-descriptions-item> -<!-- <el-descriptions-item label="鑺傛媿">--> -<!-- <span>{{workpieceInformation.beat}}</span>--> +<!-- <el-descriptions-item label="浜у搧鍨嬪彿">--> +<!-- <span>{{workpieceInformation.productModel}}</span>--> <!-- </el-descriptions-item>--> +<!-- <el-descriptions-item label="浜у搧鍚嶇О">--> +<!-- <span>{{workpieceInformation.productName}}</span>--> +<!-- </el-descriptions-item>--> + <el-descriptions-item label="寮�濮嬫椂闂�"> + <span>{{workpieceInformation.inboundTime}}</span> + </el-descriptions-item> </el-descriptions> <el-divider></el-divider> <el-row> @@ -93,10 +96,10 @@ <!-- <el-button @click="bindYzSfc" type="primary">缁戝畾</el-button>--> <!-- </el-row>--> - <el-row v-show="onLineBinDing" style="margin-top: 20px"> - <el-col></el-col> - <span style="width: 130px;" class="head-font">灏忚溅鐮� : {{headContent.cardCode}}</span> - </el-row> +<!-- <el-row v-show="onLineBinDing" style="margin-top: 20px">--> +<!-- <el-col></el-col>--> +<!-- <span style="width: 130px;" class="head-font">灏忚溅鐮� : {{headContent.cardCode}}</span>--> +<!-- </el-row>--> <!-- <el-row v-show="onLineBinDing" style="margin-top: 20px">--> <!-- <el-button @click="bindcardCode" type="primary">缁戝畾</el-button>--> <!-- </el-row>--> @@ -111,18 +114,21 @@ <el-table height="500" :cell-style="rowStyle" :data="formulaChildList"> <!-- <el-table-column label="鎺掑簭" width="60" align="center" type="index">--> <!-- </el-table-column>--> - <el-table-column label="鎷х揣姝ュ彿" align="center" prop="stepSort"> + <el-table-column label="鎷х揣姝ュ彿" width="80" align="center" prop="stepSort"> </el-table-column> -<!-- <el-table-column label="鎿嶄綔鍐呭" :show-overflow-tooltip='true' align="center" prop="operationSteps">--> <el-table-column label="鎿嶄綔鍐呭" align="center" prop="operationSteps"> </el-table-column> - <el-table-column label="浜у搧缂栧彿" align="center" prop="productCode"> +<!-- <el-table-column label="涓婇檺" width="60" align="center" prop="spareField3">--> +<!-- </el-table-column>--> +<!-- <el-table-column label="涓嬮檺" width="60" align="center" prop="spareField4">--> +<!-- </el-table-column>--> + <el-table-column label="浜у搧缂栧彿" width="80" align="center" prop="productCode"> </el-table-column> - <el-table-column label="鐗╂枡缂栫爜" align="center" prop="materialCode"> + <el-table-column label="鐗╂枡缂栫爜" width="110" align="center" prop="materialCode"> </el-table-column> <el-table-column label="閲囬泦鍊�" align="center" prop="collectData"> </el-table-column> - <el-table-column label="缁撴灉" align="center" prop="results"> + <el-table-column label="缁撴灉" width="60" align="center" prop="results"> </el-table-column> </el-table> @@ -361,7 +367,7 @@ productCode: null, productModel: null, productName: null, - beat: null, + inboundTime: null, }, // 鏌ヨ鍙傛暟 queryParams: { @@ -385,7 +391,8 @@ }, content: '', activeName: 'first', - url: "ws://192.168.2.76:8080/websocket/message/", + url: "ws://10.103.210.248:8080/websocket/message/", + // url: "ws://192.168.2.76:8080/websocket/message/", message: "", text_content: "", ws: null, @@ -415,6 +422,7 @@ passingStationForm: {}, originalArray: [], yzSfcFlag: 1, + endYz: false, } }, beforeDestroy() { @@ -451,11 +459,11 @@ }, }, methods: { - bindcardCode(){ - this.$message('缁戝畾鎴愬姛锛�'); + bindcardCode(scanValue){ + // this.$message('缁戝畾鎴愬姛锛�'); let param = { productNum: this.headContent.sfcCode, - trolleyYard: this.headContent.cardCode, + trolleyYard: scanValue, } trolleyYardBinDing(param).then(response => { }); @@ -560,6 +568,7 @@ this.workpieceInformation.workOrderNo = null; this.workpieceInformation.productModel = null; this.workpieceInformation.productName = null; + this.workpieceInformation.inboundTime = null; this.headContent.sfcCode = ''; this.headContent.yzSfcCode = ''; this.headContent.cardCode = ''; @@ -598,12 +607,11 @@ this.workpieceInformation.productCode = rowsData.productCode; this.workpieceInformation.productModel = rowsData.productModel; this.workpieceInformation.productName = rowsData.productName; - // this.timer = setInterval(() => { - // this.workpieceInformation.beat++; - // }, 1000); + this.headContent.cardCode = rowsData.trolleyYard; }); this.getListFormulaChild() - this.addOverStationCollection() + // this.addOverStationCollection() + this.workpieceInformation.inboundTime = this.getCurrentTime() const param = { processesCode: this.headContent.processesCode, } @@ -612,6 +620,19 @@ }); }, + getCurrentTime() { + const now = new Date(); + const year = now.getFullYear(); + const month = this.padTimeUnit(now.getMonth() + 1); // 鏈堜唤鏄粠0寮�濮嬬殑 + const day = this.padTimeUnit(now.getDate()); + const hours = this.padTimeUnit(now.getHours()); + const minutes = this.padTimeUnit(now.getMinutes()); + const seconds = this.padTimeUnit(now.getSeconds()); + return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; + }, + padTimeUnit(value) { + return value.toString().padStart(2, '0'); + }, addBaseData(){ addBasicParameters(this.passingStationForm).then(response => {}); }, @@ -662,7 +683,7 @@ this.onLineBinDing = true } if(this.headContent.processesCode === 'OP260'){ - this.showInput = true + // this.showInput = true } console.log('璁剧疆宸ヤ綅缂栫爜' + this.headContent.processesCode) @@ -690,12 +711,8 @@ } else if (event.data === "OUT") { self.cakeLamp.release = 1; } else if (event.data === "END") { - const param = { - workOrderNo: self.workpieceInformation.workOrderNo, - productCode: self.workpieceInformation.productCode, - locationCode: self.headContent.processesCode, - productBarcode: self.headContent.sfcCode, - } + + const formulaChildIndex = self.formulaChildList.length-1 const orderParam = { productNum: self.headContent.sfcCode, @@ -703,49 +720,97 @@ if(self.headContent.sfcCode=== ''||self.headContent.sfcCode=== null){ self.$message('鎬绘垚鐮佷负绌猴紝璇锋壂鐮侊紒') - return + return; } - checkCarCode(orderParam).then(response => { - console.log(response.data) - if(response.data === 1){ - if(self.headContent.processesCode === "OP260"){ - checkYzSfcCode(orderParam).then(response => { - if(response.data === 1){ - saveCampaignTimeParameters(param).then(response => { - checkRecordDataDone(param).then(response => { - if(response.msg === "21"){ - self.cakeLamp.release = 1; - self.endClear() - workpieceRelease(param).then(response => {}); - }else { - self.$message('鏈仛瀹屽伐搴忕姝㈡斁琛�'); - } - }); - }); - }else { - self.$message('璇峰厛缁戝畾棰勮鎬绘垚'); - } - }); - }else { - saveCampaignTimeParameters(param).then(response => { - checkRecordDataDone(param).then(response => { - if(response.msg === "21"){ - self.cakeLamp.release = 1; - self.endClear() - workpieceRelease(param).then(response => {}); - }else { - self.$message('鏈仛瀹屽伐搴忕姝㈡斁琛�'); - } - }); - }); - } - }else { - self.$alert('<strong style="color: red;font-size: 30px">鏈壂鎻忓皬杞︾爜绂佹鏀捐</strong>', '鎻愮ず', { - dangerouslyUseHTMLString: true - }); - } - }); + // if(self.headContent.cardCode === null || self.headContent.cardCode === ''){ + // self.$alert('<strong style="color: red;font-size: 30px">鏈壂鎻忓皬杞︾爜绂佹鏀捐</strong>', '鎻愮ず', { + // dangerouslyUseHTMLString: true + // }); + // return; + // } + + if(self.formulaChildList[formulaChildIndex].results !== 'OK'){ + self.$message('鏈仛瀹屽伐搴忕姝㈡斁琛�'); + return; + } + + + const param = { + workOrderNo: self.workpieceInformation.workOrderNo, + productCode: self.workpieceInformation.productCode, + locationCode: self.headContent.processesCode, + productBarcode: self.headContent.sfcCode, + inboundTime: self.workpieceInformation.inboundTime, + formulaChildEntity: self.formulaChildList[formulaChildIndex] + } + + console.log("杩涘叆鏈�缁堟柟娉�") + self.endSaveData(param) + + + // if(self.headContent.processesCode === "OP260"){ + // checkYzSfcCode(orderParam).then(response => { + // if(response.data === 0){ + // self.$message('鏈粦瀹氭�绘垚鐮佺姝㈡斁琛�'); + // return; + // }else { + // self.endSaveData(param) + // // saveCampaignTimeParameters(param).then(response => { + // // self.cakeLamp.release = 1; + // // self.endClear() + // // workpieceRelease(param).then(response => {});}); + // } + // }) + // }else { + // self.endSaveData(param) + // // saveCampaignTimeParameters(param).then(response => { + // // self.cakeLamp.release = 1; + // // self.endClear() + // // workpieceRelease(param).then(response => {}); + // // }); + // } + + // checkCarCode(orderParam).then(response => { + // console.log(response.data) + // if(response.data === 1){ + // if(self.headContent.processesCode === "OP260"){ + // checkYzSfcCode(orderParam).then(response => { + // if(response.data === 1){ + // saveCampaignTimeParameters(param).then(response => { + // checkRecordDataDone(param).then(response => { + // if(response.msg === "21"){ + // self.cakeLamp.release = 1; + // self.endClear() + // workpieceRelease(param).then(response => {}); + // }else { + // self.$message('鏈仛瀹屽伐搴忕姝㈡斁琛�'); + // } + // }); + // }); + // }else { + // self.$message('璇峰厛缁戝畾棰勮鎬绘垚'); + // } + // }); + // }else { + // saveCampaignTimeParameters(param).then(response => { + // checkRecordDataDone(param).then(response => { + // if(response.msg === "21"){ + // self.cakeLamp.release = 1; + // self.endClear() + // workpieceRelease(param).then(response => {}); + // }else { + // self.$message('鏈仛瀹屽伐搴忕姝㈡斁琛�'); + // } + // }); + // }); + // } + // }else { + // self.$alert('<strong style="color: red;font-size: 30px">鏈壂鎻忓皬杞︾爜绂佹鏀捐</strong>', '鎻愮ず', { + // dangerouslyUseHTMLString: true + // }); + // } + // }); } else if (event.data.includes("[")) { let formulaChilds = ""; self.formulaChildList.sort((a, b) => a.stepSort - b.stepSort); @@ -794,7 +859,13 @@ }; }, - + endSaveData(param){ + saveCampaignTimeParameters(param).then(response => { + this.cakeLamp.release = 1; + this.endClear() + workpieceRelease(param).then(response => {}); + }); + }, //鎺ュ彈鏁版嵁鐨勫洖璋� callBack(value) { @@ -805,12 +876,14 @@ console.log("sfc=--"+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") && this.headContent.processesCode === 'OP240'){ + // if(scanValue.includes("P9900173252")){ + // this.headContent.yzSfcCode = scanValue + // this.bindYzSfc(); + // }else + if(scanValue.includes("0RSP1TE") && this.headContent.processesCode === 'OP240'){ this.headContent.cardCode = scanValue - this.bindcardCode(); + this.bindcardCode(scanValue); + this.serialPortMethod(scanValue) }else { this.$message('宸ヤ綅缁堢鎵弿鐗╂枡缂栫爜'+scanValue); console.log(scanValue) diff --git a/jcdm-ui/src/views/main/om/productionOrde/index.vue b/jcdm-ui/src/views/main/om/productionOrde/index.vue index 6d25ebd..a8f7e88 100644 --- a/jcdm-ui/src/views/main/om/productionOrde/index.vue +++ b/jcdm-ui/src/views/main/om/productionOrde/index.vue @@ -10,24 +10,51 @@ @keyup.enter.native="handleQuery" /> </el-form-item> - <el-form-item label="浜у搧鍚嶇О" prop="productName"> + <el-form-item label="浜у搧缂栫爜" prop="productCode"> <el-input - v-model="queryParams.productName" - placeholder="璇疯緭鍏ヤ骇鍝佸悕绉�" + v-model="queryParams.productCode" + placeholder="璇疯緭鍏ヤ骇鍝佺紪鐮�" clearable @keyup.enter.native="handleQuery" /> </el-form-item> - <el-form-item label="宸ュ崟鐘舵��" prop="orderStatus"> - <el-select v-model="queryParams.orderStatus" placeholder="璇烽�夋嫨宸ュ崟鐘舵��" clearable> + <el-form-item label-width="80" label="PACK鐮�" prop="productNum"> + <el-input + v-model="queryParams.productNum" + placeholder="璇疯緭鍏ACK鐮�" + clearable + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="灏忚溅鐮�" prop="trolleyYard"> + <el-input + v-model="queryParams.trolleyYard" + placeholder="璇疯緭鍏ュ皬杞︾爜" + clearable + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label-width="1" label="涓婄嚎鎶ュ伐鐘舵��" prop="onlineCompletionMark"> + <el-select v-model="queryParams.onlineCompletionMark" placeholder="璇烽�夋嫨涓婄嚎鎶ュ伐鐘舵��" clearable> <el-option - v-for="dict in dict.type.order_state" + v-for="dict in dict.type.work_reporting_status" :key="dict.value" :label="dict.label" :value="dict.value" /> </el-select> </el-form-item> + <el-form-item label-width="1" label="涓嬬嚎鎶ュ伐鐘舵��" prop="sfResult"> + <el-select v-model="queryParams.sfResult" placeholder="璇烽�夋嫨涓嬬嚎鎶ュ伐鐘舵��" clearable> + <el-option + v-for="dict in dict.type.work_reporting_status" + :key="dict.value" + :label="dict.label" + :value="dict.value" + /> + </el-select> + </el-form-item> + <div style="display: none"> <div id="printMe" style="width: 500px;"> <div ref="canvasWrapper" id="canvasWrapper" style="display: flex;justify-content: center;"></div> @@ -80,54 +107,54 @@ <el-card style="margin-top: 10px" class="box-card"> <el-row :gutter="10" class="mb8"> - <el-col :span="1.5"> - <el-button - type="primary" - plain - icon="el-icon-plus" - size="mini" - @click="handleAdd" - v-hasPermi="['om:productionOrde:add']" - >鏂板</el-button> - </el-col> - <el-col :span="1.5"> - <el-button - type="success" - plain - icon="el-icon-edit" - size="mini" - :disabled="single" - @click="handleUpdate" - v-hasPermi="['om:productionOrde:edit']" - >淇敼</el-button> - </el-col> - <el-col :span="1.5"> +<!-- <el-col :span="1.5">--> <!-- <el-button--> -<!-- type="danger"--> +<!-- type="primary"--> <!-- plain--> -<!-- icon="el-icon-delete"--> +<!-- icon="el-icon-plus"--> <!-- size="mini"--> -<!-- :disabled="multiple"--> -<!-- @click="handleDelete"--> -<!-- v-hasPermi="['om:productionOrde:remove']"--> -<!-- >鍒犻櫎</el-button>--> - <el-button - type="info" - icon="el-icon-upload2" - size="mini" - @click="handleImport" - >瀵煎叆</el-button> - </el-col> - <el-col :span="1.5"> - <el-button - type="warning" - plain - icon="el-icon-download" - size="mini" - @click="handleExport" - v-hasPermi="['om:productionOrde:export']" - >瀵煎嚭</el-button> - </el-col> +<!-- @click="handleAdd"--> +<!-- v-hasPermi="['om:productionOrde:add']"--> +<!-- >鏂板</el-button>--> +<!-- </el-col>--> +<!-- <el-col :span="1.5">--> +<!-- <el-button--> +<!-- type="success"--> +<!-- plain--> +<!-- icon="el-icon-edit"--> +<!-- size="mini"--> +<!-- :disabled="single"--> +<!-- @click="handleUpdate"--> +<!-- v-hasPermi="['om:productionOrde:edit']"--> +<!-- >淇敼</el-button>--> +<!-- </el-col>--> +<!-- <el-col :span="1.5">--> +<!--<!– <el-button–>--> +<!--<!– type="danger"–>--> +<!--<!– plain–>--> +<!--<!– icon="el-icon-delete"–>--> +<!--<!– size="mini"–>--> +<!--<!– :disabled="multiple"–>--> +<!--<!– @click="handleDelete"–>--> +<!--<!– v-hasPermi="['om:productionOrde:remove']"–>--> +<!--<!– >鍒犻櫎</el-button>–>--> +<!-- <el-button--> +<!-- type="info"--> +<!-- icon="el-icon-upload2"--> +<!-- size="mini"--> +<!-- @click="handleImport"--> +<!-- >瀵煎叆</el-button>--> +<!-- </el-col>--> +<!-- <el-col :span="1.5">--> +<!-- <el-button--> +<!-- type="warning"--> +<!-- plain--> +<!-- icon="el-icon-download"--> +<!-- size="mini"--> +<!-- @click="handleExport"--> +<!-- v-hasPermi="['om:productionOrde:export']"--> +<!-- >瀵煎嚭</el-button>--> +<!-- </el-col>--> <el-col :span="1.5"> <el-button type="warning" @@ -147,6 +174,26 @@ @click="patchwork" >琛ユ墦</el-button> </el-col> + <el-col :span="1.5"> + <el-button + type="warning" + plain + icon="el-icon-download" + size="mini" + :disabled="onlineSingle" + @click="onlineWorkReporting" + >涓婄嚎鎶ュ伐</el-button> + </el-col> + <el-col :span="1.5"> + <el-button + type="warning" + plain + icon="el-icon-download" + size="mini" + :disabled="offlineSingle" + @click="offlineWorkReporting" + >涓嬬嚎鎶ュ伐</el-button> + </el-col> <!-- <el-col :span="1.5">--> <!-- <el-button--> <!-- type="warning"--> @@ -162,12 +209,14 @@ <el-table border v-loading="loading" :data="productionOrdeList" @selection-change="handleSelectionChange"> <el-table-column type="selection" width="55" align="center" /> - <el-table-column label="鐢熶骇宸ュ崟鍙�" width="160" align="center"> - <template slot-scope="scope"> - <router-link :to="{path: '/main/workReport-data/index/', query: {workOrderNo: scope.row.workOrderNo} }" class="link-type"> - <span>{{ scope.row.workOrderNo }}</span> - </router-link> - </template> +<!-- <el-table-column label="鐢熶骇宸ュ崟鍙�" width="160" align="center">--> +<!-- <template slot-scope="scope">--> +<!-- <router-link :to="{path: '/main/workReport-data/index/', query: {workOrderNo: scope.row.workOrderNo} }" class="link-type">--> +<!-- <span>{{ scope.row.workOrderNo }}</span>--> +<!-- </router-link>--> +<!-- </template>--> +<!-- </el-table-column>--> + <el-table-column label="鐢熶骇宸ュ崟鍙�" width="160" align="center" prop="workOrderNo"> </el-table-column> <!-- <el-table-column label="璁㈠崟缂栧彿" width="140" align="center" prop="salesOrderCode">--> <!-- </el-table-column>--> @@ -175,34 +224,41 @@ </el-table-column> <el-table-column :show-overflow-tooltip='true' label="灏忚溅鐮�" width="160" align="center" prop="trolleyYard"> </el-table-column> - <el-table-column label="浜у搧缂栧彿" width="110" align="center" prop="productCode"> + <el-table-column label="浜у搧鍨嬪彿" width="110" align="center" prop="productCode"> </el-table-column> <el-table-column label="浜у搧鍚嶇О" width="120" align="center" prop="productName"> </el-table-column> - <el-table-column label="浜у搧鍨嬪彿" align="center" prop="productModel"> + <el-table-column label="涓婄嚎鏄惁鎶ュ伐" align="center" width="120"> + <template slot-scope="scope"> + <dict-tag :options="dict.type.work_reporting_status" :value="scope.row.onlineCompletionMark"/> + </template> </el-table-column> -<!-- <el-table-column label="宸ュ崟鐘舵��" width="100" align="center" prop="orderStatus">--> + <el-table-column label="瀹為檯寮�濮嬫椂闂�" width="160" align="center" prop="actualStartTime"> + </el-table-column> + <el-table-column label="涓嬬嚎鏄惁鎶ュ伐" width="120" align="center"> + <template slot-scope="scope"> + <dict-tag :options="dict.type.work_reporting_status" :value="scope.row.sfResult"/> + </template> + </el-table-column> +<!-- <el-table-column width="240" fixed="right" label="鎿嶄綔" align="center" class-name="small-padding fixed-width">--> <!-- <template slot-scope="scope">--> -<!-- <dict-tag :options="dict.type.order_state" :value="scope.row.orderStatus"/>--> +<!-- <el-button--> +<!-- size="mini"--> +<!-- type="success"--> +<!-- plain--> +<!-- style="width: 72px"--> +<!-- @click="onlineWorkReporting(scope.row)"--> +<!-- :disabled="isEditDisabled(scope.row.onlineCompletionMark)"--> +<!-- >涓婄嚎鎶ュ伐</el-button>--> +<!-- <el-button--> +<!-- size="mini"--> +<!-- plain--> +<!-- style="width: 72px"--> +<!-- type="danger"--> +<!-- @click="offlineWorkReporting(scope.row)"--> +<!-- :disabled="isEditDisabled(scope.row.sfResult)"--> +<!-- >涓嬬嚎鎶ュ伐</el-button>--> <!-- </template>--> -<!-- </el-table-column>--> -<!-- <el-table-column label="宸ュ巶缂栧彿" align="center" prop="siteCode">--> -<!-- </el-table-column>--> - <el-table-column label="宸ョ珯缂栧彿" align="center" prop="stationCode"> - </el-table-column> -<!-- <el-table-column label="鎶ュ伐淇℃伅缁撴灉" width="110" align="center" prop="resultText">--> -<!-- </el-table-column>--> -<!-- <el-table-column label="鎶ュ伐缁撴灉浠g爜" width="110" align="center" prop="resultCode">--> -<!-- </el-table-column>--> -<!-- <el-table-column label="鏄惁鎶ュ伐" width="80" align="center" prop="sfResult">--> -<!-- </el-table-column>--> -<!-- <el-table-column label="瀹為檯寮�濮嬫椂闂�" width="160" align="center" prop="actualStartTime">--> -<!-- </el-table-column>--> -<!-- <el-table-column label="褰撳墠绔欑偣鎶ュ伐鏃堕棿" width="160" align="center" prop="actualEndTime">--> -<!-- </el-table-column>--> -<!-- <el-table-column label="鍒涘缓浜�" width="80" align="center" prop="createUser">--> -<!-- </el-table-column>--> -<!-- <el-table-column label="澶囨敞" width="100" align="center" prop="remarks">--> <!-- </el-table-column>--> </el-table> </el-card> @@ -307,13 +363,13 @@ delProductionOrde, addProductionOrde, updateProductionOrde, - receivingWorkOrders, jieBang + receivingWorkOrders, jieBang, workReportingByStation } from "@/api/main/om/productionOrde/productionOrde"; import QRCode from "qrcodejs2"; export default { name: "ProductionOrde", - dicts: ['order_state'], + dicts: ['order_state','work_reporting_status'], components: { ItemSelect , }, @@ -335,6 +391,8 @@ ids: [], // 闈炲崟涓鐢� single: true, + onlineSingle: true, + offlineSingle: true, // 闈炲涓鐢� multiple: true, move: true, @@ -416,6 +474,20 @@ this.test1() }, methods: { + onlineWorkReporting(row){ + const id = row.id || this.ids + const stationCode = "OP230" + workReportingByStation(id,stationCode).then(response => { + this.getList() + }); + }, + offlineWorkReporting(row){ + const id = row.id || this.ids + const stationCode = "OP500" + workReportingByStation(id,stationCode).then(response => { + this.getList() + }); + }, jieBang(row){ const id = row.id || this.ids jieBang(id).then(response => { @@ -644,6 +716,25 @@ this.ids = selection.map(item => item.id) this.single = selection.length!==1 this.multiple = !selection.length + this.onlineSingle = selection.length!==1 + this.offlineSingle = selection.length!==1 + + if(selection.length === 0){ + this.onlineSingle = true + this.offlineSingle = true + } + if(selection.length === 1){ + if(selection[0].onlineCompletionMark === '2'){ + this.onlineSingle = false + }else { + this.onlineSingle = true + } + if(selection[0].sfResult === '2'){ + this.offlineSingle = false + }else { + this.offlineSingle = true + } + } }, /** 鏂板鎸夐挳鎿嶄綔 */ handleAdd() { -- Gitblit v1.9.3