Kaynağa Gözat

设备新加字段、大屏设备列表修改

LLL 1 yıl önce
ebeveyn
işleme
a35061dd34

+ 26 - 31
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/itdmDevice/controller/ItdmDeviceController.java

@@ -1,43 +1,31 @@
 package org.jeecg.modules.itdmDevice.controller;
 
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.common.util.oConvertUtils;
-import org.jeecg.modules.itdmDevice.entity.ItdmDevice;
-import org.jeecg.modules.itdmDevice.service.IItdmDeviceService;
-
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
-
-import org.jeecgframework.poi.excel.ExcelImportUtil;
-import org.jeecgframework.poi.excel.def.NormalExcelConstants;
-import org.jeecgframework.poi.excel.entity.ExportParams;
-import org.jeecgframework.poi.excel.entity.ImportParams;
-import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.base.controller.JeecgController;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.modules.itdmDevice.convert.ItdmDeviceConvert1;
+import org.jeecg.modules.itdmDevice.entity.ItdmDevice;
+import org.jeecg.modules.itdmDevice.service.IItdmDeviceService;
+import org.jeecg.modules.itdmDevice.vo.ItdmDeviceXLListVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-import org.springframework.web.multipart.MultipartHttpServletRequest;
 import org.springframework.web.servlet.ModelAndView;
-import com.alibaba.fastjson.JSON;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.jeecg.common.aspect.annotation.AutoLog;
 
- /**
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
  * @Description: 设备表
  * @Author: jeecg-boot
  * @Date:   2023-05-20
@@ -56,10 +44,17 @@ public class ItdmDeviceController extends JeecgController<ItdmDevice, IItdmDevic
 	  */
 	 @ApiOperation(value="设备下拉列表", notes="设备下拉列表")
 	 @GetMapping("/xialalist")
-	 public List<ItdmDevice> list1()
+	 public List<ItdmDeviceXLListVO> list1()
 	 {
 		 List<ItdmDevice> list = itdmDeviceService.queryList();
-		 return list;
+		 List<ItdmDeviceXLListVO> list1 = list.stream().map(i->{
+		 	String zyxbzText ="";
+		 	if(i.getZyxbz()==0) zyxbzText ="气候试验";
+		 	else if(i.getZyxbz()==1) zyxbzText ="力学试验";
+		 	else if(i.getZyxbz()==2) zyxbzText ="重要试验";
+			return ItdmDeviceConvert1.INSTANCE.convert(i,zyxbzText);
+		 }).collect(Collectors.toList());
+		 return list1;
 	 }
 
 

+ 18 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/itdmDevice/entity/ItdmDevice.java

@@ -129,4 +129,22 @@ public class ItdmDevice implements Serializable {
 	@Excel(name = "备注", width = 15)
     @ApiModelProperty(value = "备注")
     private java.lang.String remark;
+    /**单价*/
+    @Excel(name = "单价", width = 15)
+    @ApiModelProperty(value = "单价")
+    private java.lang.Integer danjia;
+    /**是否能删除(0不可删除1可删除)*/
+    @Excel(name = "是否能删除", width = 15)
+    @ApiModelProperty(value = "是否能删除")
+    private java.lang.Integer izDelete;
+    /**重要性标准*/
+    @Excel(name = "重要性标准", width = 15, dicCode = "shiyan_shebe_type")
+    @Dict(dicCode = "shiyan_shebe_type")
+    @ApiModelProperty(value = "重要性标准")
+    private java.lang.Integer zyxbz;
+    /**是否在大屏展示(0不展示1展示)*/
+    @Excel(name = "是否在大屏展示", width = 15)
+    @ApiModelProperty(value = "是否在大屏展示")
+    private java.lang.Integer izDisplay;
+
 }

+ 4 - 1
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/largeScreen/task/DemoTask2.java

@@ -96,7 +96,10 @@ public class DemoTask2 {
          * 3 故障——故障状态中,不根据硬件传过来的设备状态而修改故障状态
          * 4 解除故障
          * */
-        List<ItdmDevice> deviceList = deviceService.queryList();
+//        List<ItdmDevice> deviceList = deviceService.queryList();
+        Map<String, Object> deviceMap = new HashMap<>();
+        deviceMap.put("iz_display",1);
+        List<ItdmDevice> deviceList = deviceService.listByMap(deviceMap);
         List<ItdmDeviceWSVO> deviceWSVOList = deviceList.stream().map(i->{
                 return ItdmDeviceConvert.INSTANCE.convert(i);
         }).collect(Collectors.toList());

+ 4 - 1
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/largeScreen/task/DemoTask3.java

@@ -95,7 +95,10 @@ public class DemoTask3 {
          * 3 故障——故障状态中,不根据硬件传过来的设备状态而修改故障状态
          * 4 解除故障
          * */
-        List<ItdmDevice> deviceList = deviceService.queryList();
+//        List<ItdmDevice> deviceList = deviceService.queryList();
+        Map<String, Object> deviceMap = new HashMap<>();
+        deviceMap.put("iz_display",1);
+        List<ItdmDevice> deviceList = deviceService.listByMap(deviceMap);
         List<ItdmDeviceWSVO> deviceWSVOList = deviceList.stream().map(i->{
             return ItdmDeviceConvert.INSTANCE.convert(i);
         }).collect(Collectors.toList());