jcdm-main/src/main/java/com/jcdm/main/bs/orderScheduling/controller/BsOrderSchedulingController.java
@@ -1,45 +1,39 @@ package com.jcdm.main.bs.orderScheduling.controller; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import cn.hutool.core.collection.CollUtil; import com.alibaba.excel.EasyExcel; import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; import com.jcdm.common.annotation.Excel; import com.jcdm.common.annotation.Log; import com.jcdm.common.core.controller.BaseController; import com.jcdm.common.core.domain.AjaxResult; import com.jcdm.common.core.domain.R; import com.jcdm.common.core.domain.entity.SysDictData; import com.jcdm.common.utils.DictUtils; import com.jcdm.common.core.page.TableDataInfo; import com.jcdm.common.enums.BusinessType; import com.jcdm.common.utils.StringUtils; import com.jcdm.common.utils.poi.ExcelUtil; import com.jcdm.main.bs.orderScheduling.domain.BsOrderScheduling; import com.jcdm.main.bs.orderScheduling.service.IBsOrderSchedulingService; import com.jcdm.main.bs.orderScheduling.vo.FollowReportVO; import com.jcdm.main.bs.orderScheduling.vo.LineChartVO; import com.jcdm.main.da.paramCollection.domain.DaParamCollection; import com.jcdm.main.da.passingStationCollection.domain.DaPassingStationCollection; import com.jcdm.main.plcserver.conf.OPCElement; import com.jcdm.system.service.ISysDictDataService; import org.springframework.security.access.prepost.PreAuthorize; import com.kangaroohy.milo.model.ReadWriteEntity; import com.kangaroohy.milo.service.MiloService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.jcdm.common.annotation.Log; import com.jcdm.common.core.controller.BaseController; import com.jcdm.common.core.domain.AjaxResult; import com.jcdm.common.enums.BusinessType; import com.jcdm.main.bs.orderScheduling.domain.BsOrderScheduling; import com.jcdm.main.bs.orderScheduling.service.IBsOrderSchedulingService; import com.jcdm.common.utils.poi.ExcelUtil; import com.jcdm.common.core.page.TableDataInfo; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; /** * 订单排产Controller @@ -58,6 +52,15 @@ @Resource private ISysDictDataService iSysDictDataService; @Autowired MiloService miloService; @GetMapping("/forceUpload") public void forceUpload() throws Exception { ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP121_ZZ_CODE_CHECK, 1); miloService.writeToOpcByte(entity); } /** * 查询订单排产列表 */ jcdm-main/src/main/java/com/jcdm/main/plcserver/conf/OPCElement.java
@@ -22,11 +22,13 @@ private static final String OP020_ITEM = "OP.OP100.";// private static final String OP120_ITEM_HX = "CFL4HX.OP120.";// private static final String OP120_ITEM_ZZ = "CFL4ZZ.OP120.";// private static final String OP121_ITEM_ZZ = "CFL4ZZ.OP121.";// public static final String OP020_SaveRequest = OP020_ITEM + "SaveRequest";//请求保存 public static final String OP120_SaveRequestLast = OP120_ITEM_HX + "SaveRequestLast";//请求保存 public static final String OP020_MesSaveFeed = OP020_ITEM + "MesSaveFeed";//Mes保存完成 public static final String OP120_ZZ_CODE_CHECK = OP120_ITEM_ZZ + "CodeCheck";//请求保存 public static final String OP121_ZZ_CODE_CHECK = OP121_ITEM_ZZ + "CodeCheckFeed";//请求保存 public static final String OP050_HX_CODE_CHECK = "CFL4HX.OP050.CodeCheck";//请求保存 //返修监听点位-465 jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java
@@ -321,7 +321,11 @@ DaParamCollection ParamCollection = new DaParamCollection(); ParamCollection.setParamCode(readWriteEntityList.get(i).getIdentifier().toString().split("[.]")[2]); ParamCollection.setLocationCode(parts[1]); ParamCollection.setParamValue(readWriteEntityList.get(i).getValue().toString()); if (readWriteEntityList.get(i) == null){ ParamCollection.setParamValue("0"); }else { ParamCollection.setParamValue(readWriteEntityList.get(i).getValue().toString()); } ParamCollection.setSfcCode(SNCode); ParamCollection.setParamName(list.get(i).getCollectParameterName()); ParamCollection.setParamUpper(list.get(i).getParamUpper()); jcdm-ui/src/api/main/bs/orderScheduling/orderScheduling.js
@@ -8,6 +8,12 @@ params: query }) } export function forceUploadMethod() { return request({ url: '/bs/orderScheduling/forceUpload', method: 'get', }) } //查询追溯报表 export function getFollowReport(query) { return request({ jcdm-ui/src/views/main/kb/engineCheck/index.vue
@@ -44,9 +44,9 @@ <el-row :gutter="10" class="mb8" type="flex" justify="center" style="text-align: center"> <el-col :span="1.5"> <el-button plain :disabled="buttondisabled" type="primary" style="width:400px;height:160px" v-hasPermi="['bs:formula:add']"> <el-button plain type="primary" style="width:400px;height:160px" v-hasPermi="['bs:formula:add']" @click="forceUpload"> <span class="el-icon-thumb" style="font-size:40px;color:black"></span> <span style="font-size:45px;color:black"><strong>强制上线</strong></span> <span style="font-size:45px;color:black" ><strong>强制上线</strong></span> </el-button> </el-col> </el-row> @@ -74,7 +74,7 @@ </template> <script> import { listOrderScheduling, getOrderScheduling, delOrderScheduling, addOrderScheduling, updateOrderScheduling } from "@/api/main/bs/orderScheduling/orderScheduling"; import { listOrderScheduling, forceUploadMethod, getOrderScheduling, delOrderScheduling, addOrderScheduling, updateOrderScheduling } from "@/api/main/bs/orderScheduling/orderScheduling"; import { listPassingStationCollection, getPassingStationCollection, delPassingStationCollection, addPassingStationCollection, updatePassingStationCollection } from "@/api/main/da/passingStationCollection/passingStationCollection"; import {listLineInfo} from "@/api/main/bs/lineInfo/lineInfo"; import WebSocketReconnect from "@/utils/WebsocketTool"; @@ -171,6 +171,20 @@ this.initWebSocket() }, methods: { forceUpload() { console.log('0000', this.form.engineNo) if (this.form.engineNo !== null) { forceUploadMethod(this.form.engineNo).then(res => { }) } else { this.$message({ message: '请输入发动机条码', type: 'error', offset: 300 }) } }, initWebSocket: function (){ //判断当前浏览器是否支持WebSocket if ('WebSocket' in window) { @@ -226,6 +240,7 @@ let OrderSchedulingParam = {engineNo: null} OrderSchedulingParam.engineNo = this.form.engineNo; listOrderScheduling(OrderSchedulingParam).then(response => { console.log(response) if(response.total === 1 ){ this.form.productType = response.rows[0].model this.form.orderNo = response.rows[0].orderNo