Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/master'

hym 4 anni fa
parent
commit
bd763356ee

+ 15 - 0
sms_water/src/main/java/com/huaxu/controller/SceneController.java

@@ -61,6 +61,21 @@ public class SceneController {
         return new AjaxMessage<>(ResultStatus.OK, menuEntities);
     }
 
+    @ApiOperation(value = "查询场景树")
+    @RequestMapping(value = "/selectListForParm", method = RequestMethod.POST)
+    @ResponseBody
+    public AjaxMessage<List<SceneEntity>> selectListForParm(@RequestParam(required = false) Long comId,@RequestParam(required = false) Long deptId) {
+        if (comId != null) {
+            SceneEntity sceneEntity = new SceneEntity();
+            sceneEntity.setCompanyOrgId(comId);
+            sceneEntity.setDeptOrgId(deptId);
+            List<SceneEntity> menuEntities = sceneService.findAllList(sceneEntity);
+            return new AjaxMessage<>(ResultStatus.OK, menuEntities);
+        } else {
+            return new AjaxMessage<>(ResultStatus.OK);
+        }
+    }
+
     /**
      * 新增
      */

+ 2 - 2
sms_water/src/main/java/com/huaxu/entity/DeviceAttributeEntity.java

@@ -66,7 +66,7 @@ public class DeviceAttributeEntity  implements Serializable {
     @ApiModelProperty(value = "数据删除标记")
     private Integer status;
 
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "2020-12-12 12:12:12")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     @ApiModelProperty(value = "创建时间", example = "2020-12-12 12:12:12")
     private Date dateCreate;
 
@@ -81,7 +81,7 @@ public class DeviceAttributeEntity  implements Serializable {
     /**
      * 更新时间
      */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "2020-12-12 12:12:12")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     @ApiModelProperty(value = "更新时间", example = "2020-12-12 12:12:12")
     private Date dateUpdate;
 

+ 2 - 2
sms_water/src/main/java/com/huaxu/entity/DeviceAttributeSpecsEntity.java

@@ -40,7 +40,7 @@ public class DeviceAttributeSpecsEntity  implements Serializable{
     @ApiModelProperty(value = "数据删除标记")
     private Integer status;
 
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "2020-12-12 12:12:12")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
     @ApiModelProperty(value = "创建时间",example = "2020-12-12 12:12:12")
     private Date dateCreate;
 
@@ -51,7 +51,7 @@ public class DeviceAttributeSpecsEntity  implements Serializable{
     @ApiModelProperty(value = "更新者")
     private String updateBy;
     /** 更新时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "2020-12-12 12:12:12")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
     @ApiModelProperty(value = "更新时间",example = "2020-12-12 12:12:12")
     private Date dateUpdate;
 

+ 2 - 2
sms_water/src/main/java/com/huaxu/entity/DeviceTypeEntity.java

@@ -49,7 +49,7 @@ public class DeviceTypeEntity implements Serializable {
     @ApiModelProperty(value = "数据删除标记")
     private Integer status;
 
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "2020-12-12 12:12:12")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
     @ApiModelProperty(value = "创建时间",example = "2020-12-12 12:12:12")
     private Date dateCreate;
 
@@ -60,7 +60,7 @@ public class DeviceTypeEntity implements Serializable {
     @ApiModelProperty(value = "更新者")
     private String updateBy;
     /** 更新时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "2020-12-12 12:12:12")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
     @ApiModelProperty(value = "更新时间",example = "2020-12-12 12:12:12")
     private Date dateUpdate;
 

+ 4 - 4
sms_water/src/main/java/com/huaxu/entity/SceneEntity.java

@@ -79,8 +79,8 @@ public class SceneEntity implements Serializable {
     private Long enableState;
 
     /** 投运时间 */
-    @ApiModelProperty(value = "投运时间",example = "2020-12-12 12:12:12")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "2020-12-12 12:12:12")
+    @ApiModelProperty(value = "投运时间",example = "2020-12-12")
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
     private Date runTime;
 
     /** 地址 */
@@ -100,7 +100,7 @@ public class SceneEntity implements Serializable {
     @ApiModelProperty(value = "数据删除标记")
     private Integer status;
 
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "2020-12-12 12:12:12")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
     @ApiModelProperty(value = "创建时间",example = "2020-12-12 12:12:12")
     private Date dateCreate;
 
@@ -111,7 +111,7 @@ public class SceneEntity implements Serializable {
     @ApiModelProperty(value = "更新者")
     private String updateBy;
     /** 更新时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "2020-12-12 12:12:12")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
     @ApiModelProperty(value = "更新时间",example = "2020-12-12 12:12:12")
     private Date dateUpdate;
 

+ 2 - 2
sms_water/src/main/java/com/huaxu/entity/SceneTypeEntity.java

@@ -47,7 +47,7 @@ public class SceneTypeEntity implements Serializable {
     @TableLogic
     private Integer status;
 
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "2020-12-12 12:12:12")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
     @ApiModelProperty(value = "创建时间",example = "2020-12-12 12:12:12")
     private Date dateCreate;
 
@@ -59,7 +59,7 @@ public class SceneTypeEntity implements Serializable {
     private String updateBy;
 
     /** 更新时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "2020-12-12 12:12:12")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
     @ApiModelProperty(value = "更新时间",example = "2020-12-12 12:12:12")
     private Date dateUpdate;
 

+ 9 - 1
sms_water/src/main/resources/mapper/SceneMapper.xml

@@ -68,6 +68,14 @@
         <include refid="deviceJoins"/>
         <where>
             a.status=1
+            <if test="scene.companyOrgId!=null and scene.deptOrgId!=null">
+               and a.DEPT_ORG_ID = #{scene.deptOrgId} and a.COMPANY_ORG_ID = #{scene.companyOrgId}
+            </if>
+
+            <if test="scene.companyOrgId!=null and scene.deptOrgId == null">
+                and a.DEPT_ORG_ID is null and a.COMPANY_ORG_ID = #{scene.companyOrgId}
+            </if>
+
             <if test="scene.tenantId != null  and scene.tenantId != ''">and a.tenant_id = #{scene.tenantId}</if>
             <if test="scene.parentSceneId != null ">and a.parent_scene_id = #{scene.parentSceneId}</if>
             <if test="scene.sceneName != null  and scene.sceneName != ''">
@@ -204,6 +212,6 @@
                 </if>
             </if>
         </where>
-        order by  a.date_create
+        order by  a.date_create  desc
     </select>
 </mapper>