From 1f712d545d8cfd4e9dac74d22a67ebf599df1577 Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期五, 06 十月 2023 11:24:56 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
ard-work/src/main/java/com/ruoyi/plan/controller/ArdEplanController.java | 38 ++++++++++++++++++
ard-work/src/main/java/com/ruoyi/alarm/filter/mapper/ArdAlarmFilterMapper.java | 9 ++++
ard-work/src/main/java/com/ruoyi/alarm/filter/controller/ArdAlarmFilterController.java | 7 +--
ard-work/src/main/java/com/ruoyi/alarm/filter/service/IArdAlarmFilterService.java | 8 +++
ard-work/src/main/resources/mapper/alarm/ArdAlarmFilterMapper.xml | 7 +++
ard-work/src/main/java/com/ruoyi/alarm/filter/service/impl/ArdAlarmFilterServiceImpl.java | 9 ++++
6 files changed, 71 insertions(+), 7 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/filter/controller/ArdAlarmFilterController.java b/ard-work/src/main/java/com/ruoyi/alarm/filter/controller/ArdAlarmFilterController.java
index 892ab0b..2208a0e 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/filter/controller/ArdAlarmFilterController.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/filter/controller/ArdAlarmFilterController.java
@@ -105,11 +105,10 @@
@ApiOperation("鎭㈠鎶ヨ杩囨护")
@PreAuthorize("@ss.hasPermi('alarm:filter:edit')")
@Log(title = "鎭㈠鎶ヨ杩囨护", businessType = BusinessType.UPDATE)
- @PutMapping("/recovery")
- public AjaxResult recovery(@RequestBody ArdAlarmFilter ardAlarmFilter)
+ @PutMapping("/recovery/{ids}")
+ public AjaxResult recovery(@PathVariable String[] ids)
{
- ardAlarmFilter.setEndTime(DateUtils.covertTime(new Date()));
- return toAjax(ardAlarmFilterService.updateArdAlarmFilter(ardAlarmFilter));
+ return toAjax(ardAlarmFilterService.RecoveryArdAlarmFilter(ids));
}
/**
* 鍒犻櫎鎶ヨ杩囨护
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/filter/mapper/ArdAlarmFilterMapper.java b/ard-work/src/main/java/com/ruoyi/alarm/filter/mapper/ArdAlarmFilterMapper.java
index c3c12cd..5481085 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/filter/mapper/ArdAlarmFilterMapper.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/filter/mapper/ArdAlarmFilterMapper.java
@@ -1,7 +1,9 @@
package com.ruoyi.alarm.filter.mapper;
+import java.util.Date;
import java.util.List;
import com.ruoyi.alarm.filter.domain.ArdAlarmFilter;
+import org.apache.ibatis.annotations.Param;
/**
* 鎶ヨ杩囨护Mapper鎺ュ彛
@@ -58,4 +60,11 @@
* @return 缁撴灉
*/
public int deleteArdAlarmFilterByIds(String[] ids);
+ /**
+ * 鎵归噺鎭㈠鎶ヨ杩囨护
+ *
+ * @param ids 闇�瑕佹仮澶嶇殑鏁版嵁涓婚敭闆嗗悎
+ * @return 缁撴灉
+ */
+ public int batchRecoveryArdAlarmFilterByIds(String[] ids);
}
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/filter/service/IArdAlarmFilterService.java b/ard-work/src/main/java/com/ruoyi/alarm/filter/service/IArdAlarmFilterService.java
index a3de5bb..6138b38 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/filter/service/IArdAlarmFilterService.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/filter/service/IArdAlarmFilterService.java
@@ -42,7 +42,13 @@
* @return 缁撴灉
*/
public int updateArdAlarmFilter(ArdAlarmFilter ardAlarmFilter);
-
+ /**
+ * 鎵归噺鎭㈠鎶ヨ杩囨护
+ *
+ * @param ids 闇�瑕佹仮澶嶇殑鎶ヨ杩囨护涓婚敭闆嗗悎
+ * @return 缁撴灉
+ */
+ public int RecoveryArdAlarmFilter(String[] ids);
/**
* 鎵归噺鍒犻櫎鎶ヨ杩囨护
*
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/filter/service/impl/ArdAlarmFilterServiceImpl.java b/ard-work/src/main/java/com/ruoyi/alarm/filter/service/impl/ArdAlarmFilterServiceImpl.java
index f105536..adaf6f8 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/filter/service/impl/ArdAlarmFilterServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/filter/service/impl/ArdAlarmFilterServiceImpl.java
@@ -17,6 +17,8 @@
import com.ruoyi.alarm.filter.domain.ArdAlarmFilter;
import com.ruoyi.alarm.filter.service.IArdAlarmFilterService;
+import javax.annotation.Resource;
+
/**
* 鎶ヨ杩囨护Service涓氬姟灞傚鐞�
*
@@ -25,7 +27,7 @@
*/
@Service
public class ArdAlarmFilterServiceImpl implements IArdAlarmFilterService {
- @Autowired
+ @Resource
private ArdAlarmFilterMapper ardAlarmFilterMapper;
/**
@@ -80,6 +82,11 @@
return ardAlarmFilterMapper.updateArdAlarmFilter(ardAlarmFilter);
}
+ @Override
+ public int RecoveryArdAlarmFilter(String[] ids) {
+ return ardAlarmFilterMapper.batchRecoveryArdAlarmFilterByIds(ids);
+ }
+
/**
* 鎵归噺鍒犻櫎鎶ヨ杩囨护
*
diff --git a/ard-work/src/main/java/com/ruoyi/plan/controller/ArdEplanController.java b/ard-work/src/main/java/com/ruoyi/plan/controller/ArdEplanController.java
index 2d4feae..fb6bd28 100644
--- a/ard-work/src/main/java/com/ruoyi/plan/controller/ArdEplanController.java
+++ b/ard-work/src/main/java/com/ruoyi/plan/controller/ArdEplanController.java
@@ -107,11 +107,37 @@
/**
* 鑾峰彇搴旀�ラ妗堣缁嗕俊鎭�
*/
- @PreAuthorize("@ss.hasPermi('plan:eplan:query')")
+ /*@PreAuthorize("@ss.hasPermi('plan:eplan:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return success(ardEplanService.selectArdEplanById(id));
+ }*/
+ @PreAuthorize("@ss.hasPermi('plan:eplan:query')")
+ @GetMapping(value = "/{id}")
+ public AjaxResult getInfo(@PathVariable("id") String id)
+ {
+ ArdEplan result = ardEplanService.selectArdEplanById(id);
+ Map<String,Object> map = new HashMap();
+ map.put("id",result.getId());
+ map.put("name",result.getName());
+ map.put("time",result.getTime());
+ String info = result.getInfo();
+ String[] infoArr = info.split(";");
+ List<Map<String,String>> infoList = new ArrayList();
+ for(String str : infoArr){
+ Map<String,String> infoMap = new HashMap();
+ infoMap.put("longitude",str.split(",")[0]);
+ infoMap.put("latitude",str.split(",")[1]);
+ infoMap.put("altitude",str.split(",")[2]);
+ infoMap.put("text",str.split(",")[3]);
+ infoList.add(infoMap);
+ }
+ map.put("obj",infoList);
+ map.put("userId",result.getUserId());
+ map.put("deptId",result.getDeptId());
+ map.put("createBy",result.getCreateBy());
+ return success(map);
}
/**
@@ -174,6 +200,10 @@
@PutMapping
public AjaxResult edit(@RequestBody Map<String,Object> para)
{
+ ArdEplan result = ardEplanService.selectArdEplanById((String) para.get("id"));
+ if(!result.getDeptId().equals(String.valueOf((Integer) para.get("deptId")))){
+ return toAjax(0);//闈炴湰閮ㄩ棬棰勬鏃犳硶鏇存敼
+ }
ArdEplan ardEplan = new ArdEplan();
ardEplan.setId((String) para.get("id"));
ardEplan.setName((String) para.get("name"));
@@ -209,6 +239,12 @@
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
+ ArdEplan result = ardEplanService.selectArdEplanById(ids[0]);
+ String userId = SecurityUtils.getUserId();
+ SysUser sysUser = userService.selectUserById(userId);
+ if(!result.getDeptId().equals(String.valueOf(sysUser.getDeptId()))){
+ return toAjax(0);//闈炴湰閮ㄩ棬棰勬鏃犳硶鍒犻櫎
+ }
return toAjax(ardEplanService.deleteArdEplanByIds(ids));
}
}
diff --git a/ard-work/src/main/resources/mapper/alarm/ArdAlarmFilterMapper.xml b/ard-work/src/main/resources/mapper/alarm/ArdAlarmFilterMapper.xml
index 2a5e9c2..50a42b1 100644
--- a/ard-work/src/main/resources/mapper/alarm/ArdAlarmFilterMapper.xml
+++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmFilterMapper.xml
@@ -102,4 +102,11 @@
#{id}
</foreach>
</delete>
+ <update id="batchRecoveryArdAlarmFilterByIds" parameterType="String">
+ update ard_alarm_filter set end_time=now()::timestamp(0)
+ where id in
+ <foreach item="id" collection="array" open="(" separator="," close=")">
+ #{id}
+ </foreach>
+ </update>
</mapper>
\ No newline at end of file
--
Gitblit v1.9.3