Browse Source

设备管理有效期过期查询

LLL 1 year ago
parent
commit
3b0553244e

+ 2 - 2
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/baogao/util/PoiTiUtils.java

@@ -87,7 +87,7 @@ public class PoiTiUtils {
             map1.put("name", i.getDeviceName());
             map1.put("xinghao", i.getDeviceModel());
             map1.put("guanliCode", i.getDeviceNo());
-            map1.put("youxiaoqi", i.getDeviceLife());
+            map1.put("youxiaoqi", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(i.getDeviceLife()));
             return map1;
         }).collect(Collectors.toList());
 
@@ -226,7 +226,7 @@ public class PoiTiUtils {
             map.put("sname" + i, shebei.getDeviceName());
             map.put("sxinghao" + i, shebei.getDeviceModel());
             map.put("sguanliCode" + i, shebei.getDeviceNo());
-            map.put("syouxiaoqi" + i, shebei.getDeviceLife());
+            map.put("syouxiaoqi" + i, new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(shebei.getDeviceLife()));
         }
         return map;
     }

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

@@ -43,6 +43,35 @@ public class ItdmDeviceController extends JeecgController<ItdmDevice, IItdmDevic
 	@Autowired
 	private IItdmDeviceService itdmDeviceService;
 
+
+	/**
+	 * 分页列表设备过期查询
+	 *
+	 * @param itdmDevice
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "设备表-过期查询")
+	@ApiOperation(value="设备表-过期查询", notes="设备表-过期查询")
+	@GetMapping(value = "/expireList")
+	public Result<IPage<ItdmDevice>> queryExpirePageList(ItdmDevice itdmDevice,
+												   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+												   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+												   HttpServletRequest req) {
+		ItdmDevice itdmDevice1 = new ItdmDevice();
+		QueryWrapper<ItdmDevice> queryWrapper = QueryGenerator.initQueryWrapper(itdmDevice1, req.getParameterMap());
+		queryWrapper.lambda().like(StringUtils.isNoneBlank(itdmDevice.getDeviceName()),ItdmDevice::getDeviceName,itdmDevice.getDeviceName());
+		queryWrapper.lambda().like(StringUtils.isNoneBlank(itdmDevice.getDeviceType()),ItdmDevice::getDeviceType,itdmDevice.getDeviceType());
+
+		queryWrapper.lt("device_life", new Date()); // 查询有效期小于当前时间的设备
+
+		Page<ItdmDevice> page = new Page<ItdmDevice>(pageNo, pageSize);
+		IPage<ItdmDevice> pageList = itdmDeviceService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+
 	 /**
 	  * 设备下拉列表
 	  */

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

@@ -94,9 +94,11 @@ public class ItdmDevice implements Serializable {
     @ApiModelProperty(value = "设备型号")
     private java.lang.String deviceModel;
 	/**计量有效期*/
-	@Excel(name = "计量有效期", width = 15)
+    @Excel(name = "计量有效期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "计量有效期")
-    private java.lang.String deviceLife;
+    private java.util.Date deviceLife;
 	/**本次运行开始时间*/
 	@Excel(name = "本次运行开始时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
 	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")

+ 4 - 2
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/itdmDevice/vo/ItdmDeviceXLListVO.java

@@ -83,9 +83,11 @@ public class ItdmDeviceXLListVO implements Serializable {
     @ApiModelProperty(value = "设备型号")
     private java.lang.String deviceModel;
     /**计量有效期*/
-    @Excel(name = "计量有效期", width = 15)
+    @Excel(name = "计量有效期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "计量有效期")
-    private java.lang.String deviceLife;
+    private java.util.Date deviceLife;
     /**本次运行开始时间*/
     @Excel(name = "本次运行开始时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
     @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")