From 75b1a93d2c447b3c9fc1de95270694ebdac6faca Mon Sep 17 00:00:00 2001
From: ‘liusuyi’ <1951119284@qq.com>
Date: 星期六, 07 十月 2023 13:51:06 +0800
Subject: [PATCH] 优化
---
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java | 4 ++--
ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java | 4 +---
ard-work/src/main/resources/mapper/app/ArdAppTaskMapper.xml | 26 +++++---------------------
ard-work/src/main/java/com/ruoyi/device/hiksdk/controller/SdkController.java | 19 ++++++++-----------
ard-work/src/main/java/com/ruoyi/device/hiksdk/common/GlobalVariable.java | 2 --
5 files changed, 16 insertions(+), 39 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/device/hiksdk/common/GlobalVariable.java b/ard-work/src/main/java/com/ruoyi/device/hiksdk/common/GlobalVariable.java
index 28bf220..a672b60 100644
--- a/ard-work/src/main/java/com/ruoyi/device/hiksdk/common/GlobalVariable.java
+++ b/ard-work/src/main/java/com/ruoyi/device/hiksdk/common/GlobalVariable.java
@@ -1,8 +1,6 @@
package com.ruoyi.device.hiksdk.common;
-import com.ruoyi.device.hiksdk.domain.recordInfo;
import lombok.Data;
-
import java.util.HashMap;
import java.util.Map;
diff --git a/ard-work/src/main/java/com/ruoyi/device/hiksdk/controller/SdkController.java b/ard-work/src/main/java/com/ruoyi/device/hiksdk/controller/SdkController.java
index 1d8ad07..640fc76 100644
--- a/ard-work/src/main/java/com/ruoyi/device/hiksdk/controller/SdkController.java
+++ b/ard-work/src/main/java/com/ruoyi/device/hiksdk/controller/SdkController.java
@@ -63,10 +63,7 @@
private String index() {
return "test";
}
- @RequestMapping("/media")
- private String media() {
- return "preview2";
- }
+
@GetMapping("/list")
public @ResponseBody
AjaxResult list(ArdCameras ardCamera) {
@@ -104,7 +101,6 @@
cmd.setOperator(SecurityUtils.getUserId());
return toAjax(sdk.pTZControlWithSpeed(cmd));
}
-
@ApiOperation("璋冪敤棰勭疆鐐�")
@PostMapping("/gotoPreset")
@@ -152,7 +148,7 @@
@ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo"})
@Log(title = "鑾峰彇PTZ", businessType = BusinessType.CONTROL)
public @ResponseBody
- AjaxResult GetPTZ(@RequestBody CameraCmd cmd) {
+ AjaxResult getPTZ(@RequestBody CameraCmd cmd) {
cmd.setOperator(SecurityUtils.getUserId());
Map<String, Object> ptzMap = sdk.getPtz(cmd);
return AjaxResult.success("鑾峰彇ptz", ptzMap);
@@ -163,7 +159,7 @@
@Log(title = "鑾峰彇PTZ鑼冨洿", businessType = BusinessType.CONTROL)
@ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo"})
public @ResponseBody
- AjaxResult GetPTZScope(@RequestBody CameraCmd cmd) {
+ AjaxResult getPTZScope(@RequestBody CameraCmd cmd) {
cmd.setOperator(SecurityUtils.getUserId());
Map<String, Object> ptzMap = sdk.getPtzScope(cmd);
return AjaxResult.success("鑾峰彇ptz鑼冨洿", ptzMap);
@@ -174,7 +170,7 @@
@Log(title = "璁剧疆PTZ", businessType = BusinessType.CONTROL)
@ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo", "cmd.ptzMap"})
public @ResponseBody
- AjaxResult SetPTZ(@RequestBody CameraCmd cmd) {
+ AjaxResult setPTZ(@RequestBody CameraCmd cmd) {
cmd.setOperator(SecurityUtils.getUserId());
return toAjax(sdk.setPtz(cmd));
}
@@ -195,7 +191,7 @@
@Log(title = "璁剧疆闆舵柟浣嶈", businessType = BusinessType.CONTROL)
@ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.cmd.chanNo"})
public @ResponseBody
- AjaxResult SetZeroPTZ(@RequestBody CameraCmd cmd) {
+ AjaxResult setZeroPTZ(@RequestBody CameraCmd cmd) {
cmd.setOperator(SecurityUtils.getUserId());
return toAjax(sdk.setZeroPtz(cmd));
}
@@ -281,7 +277,7 @@
@Log(title = "浜戝彴鍔犵儹", businessType = BusinessType.CONTROL)
@ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo", "cmd.enable"})
public @ResponseBody
- AjaxResult HeateRpwron(@RequestBody CameraCmd cmd) {
+ AjaxResult heateRpwron(@RequestBody CameraCmd cmd) {
cmd.setOperator(SecurityUtils.getUserId());
return toAjax(sdk.controlPTHeateRpwron(cmd));
}
@@ -292,7 +288,7 @@
@Log(title = "闀滃ご鍔犵儹", businessType = BusinessType.CONTROL)
@ApiOperationSupport(includeParameters = {"cmd.cameraId", "cmd.chanNo", "cmd.enable"})
public @ResponseBody
- AjaxResult CameraDeicing(@RequestBody CameraCmd cmd) {
+ AjaxResult cameraDeicing(@RequestBody CameraCmd cmd) {
cmd.setOperator(SecurityUtils.getUserId());
return toAjax(sdk.controlCameraDeicing(cmd));
}
@@ -326,6 +322,7 @@
String path = sdk.record(cmd);
return toAjaxString(path, "鎵嬪姩褰曞儚");
}
+
@ApiOperation("鑾峰彇鐩告満鏋惰鍙傛暟")
@PostMapping("/getCameraSetupCFG")
@Log(title = "鑾峰彇鐩告満鏋惰鍙傛暟", businessType = BusinessType.CONTROL)
diff --git a/ard-work/src/main/resources/mapper/app/ArdAppTaskMapper.xml b/ard-work/src/main/resources/mapper/app/ArdAppTaskMapper.xml
index def4551..c2f0eb0 100644
--- a/ard-work/src/main/resources/mapper/app/ArdAppTaskMapper.xml
+++ b/ard-work/src/main/resources/mapper/app/ArdAppTaskMapper.xml
@@ -17,16 +17,11 @@
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
</resultMap>
-
<resultMap id="ArdAppTaskSubResult" type="ArdAppTask" extends="ArdAppTaskResult">
<collection property="ardAppTaskDetailList" column="{id=id,detailUserId=detail_user_id}"
select="selectArdAppTaskDetailListByIdAndUserId"/>
<collection property="ardAppTaskPicList" column="id"
select="selectArdAppTaskPicListById"/>
- <!-- <collection property="ardAppTaskPicList" notNullColumn="sub2_id" javaType="java.util.List"-->
- <!-- resultMap="ArdAppTaskPicResult"/>-->
- <!-- <collection property="ardAppTaskDetailList" notNullColumn="sub1_id" javaType="java.util.List"-->
- <!-- resultMap="ArdAppTaskDetailResult"/>-->
</resultMap>
<resultMap id="ArdAppTaskSub1Result" type="ArdAppTask" extends="ArdAppTaskResult">
<collection property="ardAppTaskPicList" notNullColumn="sub2_id" javaType="java.util.List"
@@ -125,7 +120,6 @@
</where>
order by c.create_time desc
</select>
-
<select id="selectArdAppTaskListWithDetail" parameterType="ArdAppTask" resultMap="ArdAppTaskSubResult">
select DISTINCT(a.id)as idd,c.user_id as detail_user_id,a.* from ard_app_task a
LEFT JOIN ard_app_task_detail c on c.task_id=a.id
@@ -145,7 +139,6 @@
</where>
order by a.create_time desc
</select>
-
<select id="selectArdAppTaskListWithDetailById" parameterType="ArdAppTask" resultMap="ArdAppTaskSubResult">
<include refid="selectArdAppTaskDto"/>
<where>
@@ -164,7 +157,9 @@
</where>
</select>
<select id="selectArdAppTaskDetailListByTaskId" resultType="ArdAppTaskDetail">
- select * from ard_app_task_detail where task_id=#{taskId}
+ select *
+ from ard_app_task_detail
+ where task_id = #{taskId}
</select>
<select id="selectArdAppTaskById" parameterType="String" resultMap="ArdAppTaskSub1Result">
<include refid="selectArdAppTaskDto"/>
@@ -182,13 +177,12 @@
from ard_app_task_pic d
where d.task_id = #{id}
</select>
+
<select id="selectArdAppTaskDetailUserIdsByTaskId" parameterType="String" resultType="java.lang.String">
select DISTINCT(user_id)
from ard_app_task_detail
where task_id = #{taskId}
</select>
-
-
<insert id="insertArdAppTask" parameterType="ArdAppTask">
insert into ard_app_task
<trim prefix="(" suffix=")" suffixOverrides=",">
@@ -218,7 +212,6 @@
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
-
<update id="updateArdAppTask" parameterType="ArdAppTask">
update ard_app_task
<trim prefix="SET" suffixOverrides=",">
@@ -235,53 +228,45 @@
</trim>
where id = #{id}
</update>
-
<delete id="deleteArdAppTaskById" parameterType="String">
delete
from ard_app_task
where id = #{id}
</delete>
-
<delete id="deleteArdAppTaskByIds" parameterType="String">
delete from ard_app_task where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
-
<delete id="deleteArdAppTaskPicByTaskIds" parameterType="String">
delete from ard_app_task_pic where task_id in
<foreach item="taskId" collection="array" open="(" separator="," close=")">
#{taskId}
</foreach>
</delete>
-
<delete id="deleteArdAppTaskPicByTaskId" parameterType="String">
delete
from ard_app_task_pic
where task_id = #{taskId}
</delete>
-
<insert id="batchArdAppTaskPic">
insert into ard_app_task_pic( id, task_id, pic_url) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.id}, #{item.taskId}, #{item.picUrl})
</foreach>
</insert>
-
<delete id="deleteArdAppTaskDetailByTaskIds" parameterType="String">
delete from ard_app_task_detail where task_id in
<foreach item="taskId" collection="array" open="(" separator="," close=")">
#{taskId}
</foreach>
</delete>
-
<delete id="deleteArdAppTaskDetailByTaskId" parameterType="String">
delete
from ard_app_task_detail
where task_id = #{taskId}
</delete>
-
<insert id="batchArdAppTaskDetail">
insert into ard_app_task_detail( id, name, longitude, latitude, altitude, user_id, text, voice,
task_id,status,clock_in_pic_url) values
@@ -290,7 +275,6 @@
#{item.text}, #{item.voice}, #{item.taskId}, #{item.status}, #{item.clockInPicUrl})
</foreach>
</insert>
-
<update id="updateArdAppTaskDetail" parameterType="ArdAppTaskDetail">
update ard_app_task_detail
<trim prefix="SET" suffixOverrides=",">
@@ -355,7 +339,7 @@
<select id="selectUnreadArdAppTaskCount" resultType="Integer">
SELECT COUNT(DISTINCT A.ID)
FROM ard_app_task A
- LEFT JOIN ard_app_task_detail C ON C.task_id = A.ID
+ LEFT JOIN ard_app_task_detail C ON C.task_id = A.ID
WHERE C.view_time IS NULL
AND C.view_flag = '1'
AND C.user_id = #{userId}
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java
index f48d4ea..057d1ae 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java
@@ -4,9 +4,7 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
-import org.springframework.boot.web.servlet.ServletComponentScan;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.scheduling.annotation.EnableAsync;
+
/**
* 鍚姩绋嬪簭
diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java
index 4a174ce..a36bb2b 100644
--- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java
+++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java
@@ -16,8 +16,8 @@
// 琛ㄧず閫氳繃aop妗嗘灦鏆撮湶璇ヤ唬鐞嗗璞�,AopContext鑳藉璁块棶
@EnableAspectJAutoProxy(exposeProxy = true)
// 鎸囧畾瑕佹壂鎻忕殑Mapper绫荤殑鍖呯殑璺緞
-//@MapperScan("com.ruoyi.**.mapper")
-@MapperScan({"com.ruoyi.**.mapper","com.ard.**.mapper"})
+@MapperScan("com.ruoyi.**.mapper")
+//@MapperScan({"com.ruoyi.**.mapper","com.ard.**.mapper"})
public class ApplicationConfig
{
/**
--
Gitblit v1.9.3