src/main/java/com/zy/asrs/controller/BasJarController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/zy/asrs/controller/BasJarMastController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/zy/asrs/entity/vo/JarMastTableVo.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/zy/common/model/enums/JarStatusType.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/webapp/views/deviceOperate/jarOperate.html | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/zy/asrs/controller/BasJarController.java
@@ -1,21 +1,19 @@ package com.zy.asrs.controller; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.mapper.Wrapper; import com.baomidou.mybatisplus.plugins.Page; import com.core.common.DateUtils; import com.zy.asrs.entity.BasJar; import com.zy.asrs.entity.BasRgv; import com.zy.asrs.entity.vo.JarStateTableVo; import com.zy.asrs.service.BasJarService; import com.core.annotations.ManagerAuth; import com.core.common.BaseRes; import com.core.common.Cools; import com.core.common.R; import com.zy.common.model.enums.JarStatusType; import com.zy.common.web.BaseController; import com.zy.system.entity.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -125,9 +123,11 @@ return R.ok(); } @PostMapping("/table/jar/state") // @ManagerAuth(memo = "JAR信息表") public R jarStateTable(){ @ManagerAuth(memo = "RGV信息表") public R rgvStateTable(){ List<JarStateTableVo> list = new ArrayList<>(); List<BasJar> jars = basJarService.selectList(new EntityWrapper<BasJar>().orderBy("jar_no")); for (BasJar basJar : jars) { @@ -135,8 +135,17 @@ JarStateTableVo vo = new JarStateTableVo(); vo.setJarNo(basJar.getJarNo()); // RGV号 list.add(vo); vo.setJarMode(basJar.getJarMode() == 1?"联机":"脱机" ); // 模式状态 vo.setJarStatus(JarStatusType.get(basJar.getJarMode()).desc); // 状态 vo.setJarNo(basJar.getJarNo()); // 工位1任务号 vo.setRegion(basJar.getRegion()); vo.setJarCode(basJar.getJarCode()); vo.setJarErr(basJar.getJarErr()); } return R.ok().add(jars); return R.ok().add(list); } } src/main/java/com/zy/asrs/controller/BasJarMastController.java
@@ -7,11 +7,16 @@ import com.baomidou.mybatisplus.plugins.Page; import com.core.common.DateUtils; import com.zy.asrs.entity.BasJarMast; import com.zy.asrs.entity.WrkDetl; import com.zy.asrs.entity.WrkMast; import com.zy.asrs.entity.vo.JarMastTableVo; import com.zy.asrs.service.BasJarMastService; import com.core.annotations.ManagerAuth; import com.core.common.BaseRes; import com.core.common.Cools; import com.core.common.R; import com.zy.asrs.service.WrkDetlService; import com.zy.asrs.service.WrkMastService; import com.zy.common.web.BaseController; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -23,6 +28,26 @@ @Autowired private BasJarMastService basJarMastService; @Autowired private WrkMastService wrkMastService; @Autowired private WrkDetlService wrkDetlService; @RequestMapping(value = "/basJarMast/JatId/auth") @ManagerAuth public R getJatIdList(@RequestParam Integer id){ List<BasJarMast> jarMasts = basJarMastService.selectList(new EntityWrapper<BasJarMast>().eq("jar_id", id)); if (Cools.isEmpty(jarMasts)){ return R.error("未查询到信息"); } ArrayList<JarMastTableVo> jarMastTableVos = new ArrayList<>(); jarMasts.forEach(jarMast -> { JarMastTableVo jarMastTableVo = new JarMastTableVo(); wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", jarMast.getWrkNo())); wrkDetlService.selectList(new EntityWrapper<WrkDetl>().eq("wrk_no", jarMast.getWrkNo())); }); return R.ok(jarMastTableVos); } @RequestMapping(value = "/basJarMast/{id}/auth") @ManagerAuth src/main/java/com/zy/asrs/entity/vo/JarMastTableVo.java
New file @@ -0,0 +1,12 @@ package com.zy.asrs.entity.vo; import lombok.Data; @Data public class JarMastTableVo { private Integer jarId; private String jarWrkNo; private Integer status; private String matnr; private String maktx; } src/main/java/com/zy/common/model/enums/JarStatusType.java
New file @@ -0,0 +1,43 @@ package com.zy.common.model.enums; public enum JarStatusType { IDLE(0, "空闲"), MOVING(1, "作业中"), SOS(2, "报警"), WAITING(10, "等待确认"), OFF_LINE(-1, "未知"), OTHER(100, "其它"), ; public Integer id; public String desc; JarStatusType(Integer id, String desc) { this.id = id; this.desc = desc; } public static JarStatusType get(Integer id) { if (null == id) { return null; } for (JarStatusType type : JarStatusType.values()) { if (type.id.equals(id)) { return type; } } return OFF_LINE; } public static JarStatusType get(JarStatusType type) { if (null == type) { return null; } for (JarStatusType jarStatusType : JarStatusType.values()) { if (jarStatusType == type) { return jarStatusType; } } return null; } } src/main/webapp/views/deviceOperate/jarOperate.html
@@ -39,6 +39,25 @@ <div slot="header" class="clearfix"> <span>硫化库位</span> </div> <div v-if="currentIndex == null"> <el-empty description="请选择设备"></el-empty> </div> <div v-else> <el-table border :data="item" highlight-current-row max-height="350" style="width: 100%"> <el-table-column property="jarId" label="硫化罐"> </el-table-column> <el-table-column property="wrkNo" label="工作号"> </el-table-column> <el-table-column property="jarMode" label="模式"> </el-table-column> <el-table-column property="region" label="区域"> </el-table-column> <el-table-column property="jarCode" label="代号"> </el-table-column> <el-table-column property="jarErr" label="异常代码"> </el-table-column> </el-table> </div> </el-card> </div> @@ -53,25 +72,15 @@ </div> <div v-else> <el-descriptions :title="currentTitle" direction="vertical" :column="4" border> <el-descriptions-item label="RGV">{{ tableData[currentIndex].rgvNo }} </el-descriptions-item> <el-descriptions-item label="工作号"> {{ tableData[currentIndex].workNo1 }} <el-descriptions-item label="硫化罐">{{ tableData[currentIndex].jarNo }} </el-descriptions-item> <el-descriptions-item label="模式"> <el-tag>{{ tableData[currentIndex].statusType }}</el-tag> </el-descriptions-item> <el-descriptions-item label="任务状态"> <el-tag>{{ tableData[currentIndex].status}}</el-tag> <el-tag>{{ tableData[currentIndex].jarMode }}</el-tag> </el-descriptions-item> <el-descriptions-item label="设备状态"> <el-tag>{{ tableData[currentIndex].walkPos }}</el-tag> <el-tag>{{ tableData[currentIndex].jarStatus }}</el-tag> </el-descriptions-item> <el-descriptions-item label="故障代码">{{ tableData[currentIndex].warnCode }} </el-descriptions-item> <el-descriptions-item label="故障描述">{{ tableData[currentIndex].alarm }} <el-descriptions-item label="故障代码">{{ tableData[currentIndex].jarErr }} </el-descriptions-item> <!-- <el-descriptions-item label="源站">{{ tableData[currentIndex].staNo }}--> <!-- </el-descriptions-item>--> @@ -134,7 +143,8 @@ } ], demo: 'X', rgvMode: 0 rgvMode: 0, item: [] }, created() { this.init() @@ -182,17 +192,32 @@ setInterval(() => { this.getTableData() this.demoStatus() // this.demoStatus() }, 1000) }, handleRowClick(row, col, event) { const index = this.tableData.indexOf(row) this.currentRow = row; this.currentIndex = index this.currentTitle = row.jarNo + "号硫化罐" this.formParam.rgvNo = row.rgvNo this.enableIn = row.inEnable == "Y" ? true : false this.enableOut = row.outEnable == "Y" ? true : false var that = this const index = that.tableData.indexOf(row) that.currentRow = row; that.currentIndex = index that.currentTitle = row.jarNo + "号硫化罐" that.formParam.rgvNo = row.rgvNo that.enableIn = row.inEnable == "Y" ? true : false that.enableOut = row.outEnable == "Y" ? true : false $.ajax({ url: baseUrl + "/basJarMast/JatId/auth", headers: { 'token': localStorage.getItem('token') }, data: { id: row.jarNo }, success: function (res) { that.item = res.data console.log(that.item) } }); }, getTableData() { let that = this;