jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java
@@ -388,7 +388,10 @@ @Override public AjaxResult workpieceRelease(BsFormulaChildInfo bsFormulaChildInfo) { daParamCollectionService.pushGeelycvMesFeedback(bsFormulaChildInfo.getProductBarcode(), bsFormulaChildInfo.getLocationCode()); try { daParamCollectionService.pushGeelycvMesFeedback(bsFormulaChildInfo.getProductBarcode(), bsFormulaChildInfo.getLocationCode()); }catch (Exception e){ } List<BsFormulaChildInfo> list = bsFormulaChildInfoService.list(new LambdaQueryWrapper<BsFormulaChildInfo>() .eq(BsFormulaChildInfo::getProcessesCode, bsFormulaChildInfo.getLocationCode()) .eq(BsFormulaChildInfo::getProductCode, bsFormulaChildInfo.getProductCode())); jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/controller/DaParamCollectionController.java
@@ -47,7 +47,7 @@ @GetMapping("/testput") public void testput() { daParamCollectionService.pushGeelycvMesFeedback("0RSPB001139E3AE5B0000002","OP470"); daParamCollectionService.pushGeelycvMesFeedback("0RSPB001139E3AE5B0000054","OP240"); } /** @@ -125,6 +125,15 @@ /** * 出战时间参数增加 */ @PostMapping("/checkRecordDataDone") public AjaxResult checkRecordDataDone(@RequestBody DaParamCollection daParamCollection) { return daParamCollectionService.checkRecordDataDone(daParamCollection); } /** * 出战时间参数增加 */ @PostMapping("/jrmSaveCampaignTimeParameters") public void jrmSaveCampaignTimeParameters(@RequestBody DaParamCollection daParamCollection) { jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/IDaParamCollectionService.java
@@ -1,6 +1,7 @@ package com.jcdm.main.da.paramCollection.service; import com.baomidou.mybatisplus.extension.service.IService; import com.jcdm.common.core.domain.AjaxResult; import com.jcdm.main.da.paramCollection.domain.DaParamCollection; import java.util.List; @@ -79,4 +80,6 @@ void sendToFactoryMes(String stationCode,String productNum ); void pushGeelycvMesFeedback(String packID,String stationCode); AjaxResult checkRecordDataDone(DaParamCollection daParamCollection); } jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java
@@ -2,6 +2,7 @@ import cn.hutool.core.collection.CollUtil; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.db.Db; import cn.hutool.http.HttpRequest; @@ -9,6 +10,7 @@ import cn.hutool.json.JSONUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.StringUtils; import com.jcdm.main.bs.formula.service.IBsFormulaInfoService; @@ -27,6 +29,7 @@ import com.jcdm.main.da.passingStationCollection.mapper.DaPassingStationCollectionMapper; import com.jcdm.main.da.passingStationCollection.service.IDaPassingStationCollectionService; import com.jcdm.main.plcserver.sub.OPCUaSubscription; import com.jcdm.main.restful.factoryMes.service.RestfulService; import com.jcdm.main.restful.qingYan.doman.ChildVO; import com.jcdm.main.restful.qingYan.doman.ParentVO; import com.kangaroohy.milo.model.ReadWriteEntity; @@ -79,6 +82,8 @@ @Autowired private IDaCollectionParamConfService daCollectionParamConfService; public SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); /** * 查询设备产品过程参数采集 @@ -229,7 +234,16 @@ .eq(BsFormulaChildInfo::getProcessesCode, daParamCollection.getLocationCode()) .eq(BsFormulaChildInfo::getSpareField4, "1") ); if(!list.get(0).getResults().equals("OK")){ if(StringUtils.isNotBlank(list.get(0).getResults())){ if(!list.get(0).getResults().equals("OK")){ try { miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+daParamCollection.getLocationCode()+".RecordDataDone").value(22).build()); } catch (Exception e) { throw new RuntimeException(e); } return; } }else { try { miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+daParamCollection.getLocationCode()+".RecordDataDone").value(22).build()); } catch (Exception e) { @@ -273,6 +287,9 @@ //给opc发21 miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+daParamCollection.getLocationCode()+".RecordDataDone").value(21).build()); if(daParamCollection.getLocationCode().equals("OP240")){ RestfulService.getWorkReportResultFeedback(daParamCollection.getProductBarcode(),"OP230",format.format(new Date())); } } catch (Exception e) { throw new RuntimeException(e); } @@ -442,19 +459,21 @@ childVO.setItemCode(daParamCollection.getParamCode()); BsFormulaChildInfo childOne = bsFormulaChildInfoService.getOne(new LambdaQueryWrapper<BsFormulaChildInfo>().eq(BsFormulaChildInfo::getParamCode, daParamCollection.getParamCode())); DaCollectionParamConf paramConfOne = daCollectionParamConfService.getOne(new LambdaQueryWrapper<DaCollectionParamConf>().eq(DaCollectionParamConf::getCollectParameterId, daParamCollection.getParamCode())); if(childOne!=null){ String operationType = childOne.getOperationType(); if(operationType.equals("1")){ childVO.setItemType("2"); }else if(operationType.equals("2")){ childVO.setItemType("1"); } }else { childVO.setItemType("3"); } // if(childOne!=null){ // String operationType = childOne.getOperationType(); // if(operationType.equals("1")){ // childVO.setItemType("2"); // }else if(operationType.equals("2")){ // childVO.setItemType("1"); // } // }else { // childVO.setItemType("3"); // } if(paramConfOne!=null){ childVO.setItemType(paramConfOne.getSpareField1()); childVO.setItemText(paramConfOne.getCollectParameterName()); }else { childVO.setItemType("3"); childVO.setItemText(""); } childVO.setItemValue(daParamCollection.getParamValue()); @@ -479,4 +498,18 @@ } @Override public AjaxResult checkRecordDataDone(DaParamCollection daParamCollection) { String result = ""; try { Object recordDataDone = miloService.readFromOpcUa("PACK" + "." + daParamCollection.getLocationCode() + ".RecordDataDone").getValue(); if(ObjectUtil.isNotNull(recordDataDone)){ result = recordDataDone.toString(); } } catch (Exception e) { throw new RuntimeException(e); } return AjaxResult.success(result); } } jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java
@@ -11,6 +11,7 @@ import com.jcdm.common.core.domain.entity.SysUser; import com.jcdm.common.core.domain.model.LoginUser; import com.jcdm.common.utils.ServletUtils; import com.jcdm.common.utils.StringUtils; import com.jcdm.main.om.productionOrde.domain.OmProductionOrdeInfo; import com.jcdm.main.om.productionOrde.domain.OmProductionOrdeInfoExcelImport; import com.jcdm.main.om.productionOrde.mapper.OmProductionOrdeInfoMapper; @@ -61,6 +62,37 @@ return getDataTable(list); } @GetMapping("/checkCarCode") public AjaxResult checkCarCode(OmProductionOrdeInfo omProductionOrdeInfo) { Integer i = 0; List<OmProductionOrdeInfo> list = omProductionOrdeInfoService.list(new LambdaQueryWrapper<OmProductionOrdeInfo>().eq(OmProductionOrdeInfo::getProductNum, omProductionOrdeInfo.getProductNum())); if(StringUtils.isNotBlank(list.get(0).getTrolleyYard())){ i = 1; } return AjaxResult.success(i); } @GetMapping("/checkYzSfcCode") public AjaxResult checkYzSfcCode(OmProductionOrdeInfo omProductionOrdeInfo) { Integer i = 0; List<OmProductionOrdeInfo> list = omProductionOrdeInfoService.list(new LambdaQueryWrapper<OmProductionOrdeInfo>().eq(OmProductionOrdeInfo::getProductNum, omProductionOrdeInfo.getProductNum())); if(StringUtils.isNotBlank(list.get(0).getSpareField2())){ i = 1; } return AjaxResult.success(i); } @GetMapping("/bindYzSfcFlag") public AjaxResult bindYzSfcFlag(OmProductionOrdeInfo omProductionOrdeInfo) { List<OmProductionOrdeInfo> list = omProductionOrdeInfoService.list(new LambdaQueryWrapper<OmProductionOrdeInfo>().eq(OmProductionOrdeInfo::getProductNum, omProductionOrdeInfo.getProductNum())); list.get(0).setSpareField2("1"); omProductionOrdeInfoService.saveOrUpdate(list.get(0)); return AjaxResult.success(null); } /** * 导出生产工单列表 */ jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/service/IOmProductionOrdeInfoService.java
@@ -73,4 +73,6 @@ AjaxResult getCarCodeSize(OmProductionOrdeInfo omProductionOrdeInfo); AjaxResult findBytrolleyYardGetOne(OmProductionOrdeInfo omProductionOrdeInfo); List<OmProductionOrdeInfo> checkCarCode(OmProductionOrdeInfo omProductionOrdeInfo); } jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/service/impl/OmProductionOrdeInfoServiceImpl.java
@@ -177,4 +177,10 @@ } return AjaxResult.success(str); } @Override public List<OmProductionOrdeInfo> checkCarCode(OmProductionOrdeInfo omProductionOrdeInfo) { List<OmProductionOrdeInfo> list = omProductionOrdeInfoService.list(new LambdaQueryWrapper<OmProductionOrdeInfo>().eq(OmProductionOrdeInfo::getProductNum, omProductionOrdeInfo.getProductNum()).isNotNull(OmProductionOrdeInfo::getTrolleyYard)); return list; } } jcdm-ui/src/api/main/da/paramCollection/paramCollection.js
@@ -54,6 +54,15 @@ } // 新增设备产品过程参数采集 saveCampaignTimeParameters export function checkRecordDataDone(data) { return request({ url: '/main/paramCollection/checkRecordDataDone', method: 'post', data: data }) } // 新增设备产品过程参数采集 saveCampaignTimeParameters export function saveCampaignTimeParameters(data) { return request({ url: '/main/paramCollection/saveCampaignTimeParameters', jcdm-ui/src/api/main/om/productionOrde/productionOrde.js
@@ -9,6 +9,33 @@ }) } // 查询生产工单列表 export function bindYzSfcFlag(query) { return request({ url: '/om/productionOrde/bindYzSfcFlag', method: 'get', params: query }) } // 查询生产工单列表 export function checkYzSfcCode(query) { return request({ url: '/om/productionOrde/checkYzSfcCode', method: 'get', params: query }) } // 查询生产工单列表 export function checkCarCode(query) { return request({ url: '/om/productionOrde/checkCarCode', method: 'get', params: query }) } export function upDownMove(query) { return request({ url: '/om/productionOrde/upDownMove', jcdm-ui/src/views/main/kb/stationTerminal/index.vue
@@ -308,6 +308,8 @@ import MySerialPort from "@/utils/MySerialPort"; import USBDevice from "@/utils/usb.json"; import { bindYzSfcFlag, checkCarCode, checkYzSfcCode, findBytrolleyYardGetOne, listProductionOrde, receivingWorkOrders, @@ -319,7 +321,7 @@ addParamCollection, addTighteningParameters, saveCampaignTimeParameters, replaceAssemblyCode, replaceAssemblyCode, checkRecordDataDone, } from "@/api/main/da/paramCollection/paramCollection"; export default { @@ -407,6 +409,7 @@ passingStationForm: {}, originalArray: [], yzSfcFlag: 1, } }, beforeDestroy() { @@ -463,8 +466,14 @@ locationCode: this.headContent.processesCode, yzSfcCode: this.headContent.yzSfcCode } const orderParam = { productNum: this.headContent.sfcCode, } replaceAssemblyCode(param).then(response => { this.$message('绑定成功!'); bindYzSfcFlag(orderParam).then(response => { this.yzSfcFlag = 1 }); }); } }, @@ -662,10 +671,48 @@ locationCode: self.headContent.processesCode, productBarcode: self.headContent.sfcCode, } saveCampaignTimeParameters(param).then(response => {}); self.cakeLamp.release = 1; self.endClear() workpieceRelease(param).then(response => {}); const orderParam = { productNum: self.headContent.sfcCode, } 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.$message('未绑定小车码禁止放行'); } }); } else if (event.data.includes("[")) { let formulaChilds = ""; self.formulaChildList.sort((a, b) => a.stepSort - b.stepSort); jcdm-ui/src/views/main/om/productionOrde/index.vue
@@ -102,15 +102,15 @@ >修改</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="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" @@ -137,6 +137,16 @@ @click="getWorkOrders" >接收</el-button> </el-col> <el-col :span="1.5"> <el-button type="warning" plain icon="el-icon-download" size="mini" :disabled="single" @click="patchwork" >补打</el-button> </el-col> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> </el-row> @@ -151,7 +161,7 @@ </el-table-column> <!-- <el-table-column label="订单编号" width="140" align="center" prop="salesOrderCode">--> <!-- </el-table-column>--> <el-table-column :show-overflow-tooltip='true' label="pack码" width="160" align="center" prop="productNum"> <el-table-column :show-overflow-tooltip='true' label="pack码" width="220" align="center" prop="productNum"> </el-table-column> <el-table-column :show-overflow-tooltip='true' label="小车码" width="160" align="center" prop="trolleyYard"> </el-table-column> @@ -159,33 +169,31 @@ </el-table-column> <el-table-column label="产品名称" width="120" align="center" prop="productName"> </el-table-column> <el-table-column label="产品序列号" width="110" align="center" prop="productNum"> </el-table-column> <el-table-column label="产品型号" align="center" prop="productModel"> </el-table-column> <el-table-column label="工单状态" width="100" align="center" prop="orderStatus"> <template slot-scope="scope"> <dict-tag :options="dict.type.order_state" :value="scope.row.orderStatus"/> </template> </el-table-column> <!-- <el-table-column label="工单状态" width="100" align="center" prop="orderStatus">--> <!-- <template slot-scope="scope">--> <!-- <dict-tag :options="dict.type.order_state" :value="scope.row.orderStatus"/>--> <!-- </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="报工结果代码" 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-column label="报工信息结果" width="110" align="center" prop="resultText">--> <!-- </el-table-column>--> <!-- <el-table-column label="报工结果代码" 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> @@ -278,7 +286,7 @@ import { getToken } from "@/utils/auth"; import { listLineInfo } from "@/api/main/bs/lineInfo/lineInfo"; import { listWorkshop } from "@/api/main/bs/workshop/workshop"; import { listProductBom } from "@/api/main/bs/ProductBom/ProductBom"; import {getProductBom, listProductBom} from "@/api/main/bs/ProductBom/ProductBom"; import { listTechnologyRoute} from "@/api/main/bs/technologyRoute/technologyRoute"; import ItemSelect from "@/components/itemSelect/single.vue"; import { @@ -398,7 +406,19 @@ this.test1() }, methods: { async getWorkOrders(){ patchwork(row){ const id = row.id || this.ids getProductionOrde(id).then(response => { console.log(response.data) this.packCode = response.data.productNum console.log(this.packCode) this.test1() setTimeout(() => { this.print() },50) }); }, async getWorkOrders(){ await receivingWorkOrders().then(response => { this.getList() this.packCode = response.msg; @@ -588,19 +608,25 @@ this.handleQuery(); }, // 多选框选中数据 // handleSelectionChange(selection) { // this.ids = selection.map(item => item.id) // this.move = selection.length!==1 // if(!selection.length){ // this.single = true // this.multiple = true // }else { // if(selection[0].orderStatus === '1' && selection.length === 1){ // this.single = false // this.multiple = false // } // } // // }, // 多选框选中数据 handleSelectionChange(selection) { this.ids = selection.map(item => item.id) this.move = selection.length!==1 if(!selection.length){ this.single = true this.multiple = true }else { if(selection[0].orderStatus === '1' && selection.length === 1){ this.single = false this.multiple = false } } this.single = selection.length!==1 this.multiple = !selection.length }, /** 新增按钮操作 */ handleAdd() {