From 05254cc0cf10fb2f692b2620e7edfdd039060b29 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Sat, 11 Sep 2021 09:37:53 +0800
Subject: [PATCH] 指令查询修改,成绩查询修改,个人位置查询修改

---
 src/main/java/org/springblade/modules/directive/service/impl/DirectiveServiceImpl.java   |    7 ++
 src/main/java/org/springblade/modules/location/service/LiveLocationService.java          |   14 ++++
 src/main/java/org/springblade/modules/performance/mapper/PerformanceMapper.java          |    3 
 src/main/java/org/springblade/modules/location/controller/LiveLocationController.java    |   22 +++++++
 src/main/java/org/springblade/modules/location/mapper/LiveLocationMapper.xml             |   35 +++++++++++
 src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml           |    2 
 src/main/java/org/springblade/modules/location/vo/LiveLocationVo.java                    |    5 +
 src/main/java/org/springblade/modules/location/service/impl/LiveLocationServiceImpl.java |   59 +++++++++++++++++++
 src/main/java/org/springblade/modules/performance/mapper/PerformanceMapper.xml           |    3 
 src/main/java/org/springblade/modules/directive/mapper/DirectiveMapper.xml               |    6 ++
 src/main/java/org/springblade/modules/location/mapper/LiveLocationMapper.java            |   14 ++++
 11 files changed, 166 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/springblade/modules/directive/mapper/DirectiveMapper.xml b/src/main/java/org/springblade/modules/directive/mapper/DirectiveMapper.xml
index 634329a..5562a1d 100644
--- a/src/main/java/org/springblade/modules/directive/mapper/DirectiveMapper.xml
+++ b/src/main/java/org/springblade/modules/directive/mapper/DirectiveMapper.xml
@@ -24,6 +24,12 @@
         <if test="directive.endTime!=null and directive.endTime!=''">
             and sd.send_time &lt;= #{directive.endTime}
         </if>
+        <if test="directive.content!=null and directive.content!=''">
+            and sd.content like concat('%', #{directive.content},'%')
+        </if>
+        <if test="directive.sendName!=null and directive.sendName!=''">
+            and bu.real_name like concat('%', #{directive.sendName},'%')
+        </if>
         <if test="directive.sendDirectiveId!=null and directive.sendDirectiveId!=''">
             and sd.send_directive_id like concat('%', #{directive.sendDirectiveId},'%')
         </if>
diff --git a/src/main/java/org/springblade/modules/directive/service/impl/DirectiveServiceImpl.java b/src/main/java/org/springblade/modules/directive/service/impl/DirectiveServiceImpl.java
index c78ed75..095b8d9 100644
--- a/src/main/java/org/springblade/modules/directive/service/impl/DirectiveServiceImpl.java
+++ b/src/main/java/org/springblade/modules/directive/service/impl/DirectiveServiceImpl.java
@@ -59,6 +59,13 @@
 				}
 				if (!"".equals(builder.toString())) {
 					record.setReceiveName(builder.toString().substring(0, builder.toString().length() - 1));
+					//如果查询接收人
+					if (null!=directive.getReceiveName() && directive.getReceiveName()!=""){
+						//不匹配就删除
+						if (!record.getReceiveName().contains(directive.getReceiveName())){
+							records.remove(record);
+						}
+					}
 				}
 			}
 		}
diff --git a/src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml b/src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
index 128cee9..257fcfb 100644
--- a/src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
+++ b/src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
@@ -1168,7 +1168,7 @@
             and A.jurisdiction =#{jurisdiction}
         </if>
         <if test="deptid!=null and deptid!=''">
-            and d.dept_name like concat(concat('%', #{deptid}),'%')
+            and d.enterpriseName like concat(concat('%', #{deptid}),'%')
         </if>
         <if test="stats!=null and stats!=''">
             and d.stats =#{stats}
diff --git a/src/main/java/org/springblade/modules/location/controller/LiveLocationController.java b/src/main/java/org/springblade/modules/location/controller/LiveLocationController.java
index d6c33c2..423c215 100644
--- a/src/main/java/org/springblade/modules/location/controller/LiveLocationController.java
+++ b/src/main/java/org/springblade/modules/location/controller/LiveLocationController.java
@@ -151,6 +151,17 @@
 		return R.data(liveLocationService.getLocusInfoList(liveLocationVo));
 	}
 
+
+	/**
+	 * 获取指令接收人的轨迹数据
+	 * @param liveLocationVo 实时对象信息
+	 * @return
+	 */
+	@GetMapping("/getDirectiveLocusInfoList")
+	public R<List<List<LocusVo>>> getDirectiveLocusInfoList(LiveLocationVo liveLocationVo){
+		return R.data(liveLocationService.getDirectiveLocusInfoList(liveLocationVo));
+	}
+
 	/**
 	 * 首页实时定位
 	 * @return
@@ -160,4 +171,15 @@
 		return R.data(liveLocationService.getLiveLocationVoList(liveLocationVo));
 	}
 
+
+	/**
+	 * 获取指令接收人的定位信息
+	 * @param liveLocationVo 定位数据信息
+	 * @return
+	 */
+	@GetMapping("/getDirectiveLiveLocationVoList")
+	public R<List<LiveLocationVo>> getDirectiveLiveLocationVoList(LiveLocationVo liveLocationVo){
+		return R.data(liveLocationService.getDirectiveLiveLocationVoList(liveLocationVo));
+	}
+
 }
diff --git a/src/main/java/org/springblade/modules/location/mapper/LiveLocationMapper.java b/src/main/java/org/springblade/modules/location/mapper/LiveLocationMapper.java
index 6c894ae..626b244 100644
--- a/src/main/java/org/springblade/modules/location/mapper/LiveLocationMapper.java
+++ b/src/main/java/org/springblade/modules/location/mapper/LiveLocationMapper.java
@@ -72,4 +72,18 @@
 	 * @return
 	 */
 	List<LiveLocationVo> selectSecurityAndCarAndGunLiveLocationPage(LiveLocationVo liveLocationVo);
+
+	/**
+	 * 获取指令接收人的定位信息
+	 * @param liveLocationVo 定位数据信息
+	 * @return
+	 */
+    LiveLocationVo getDirectiveLiveLocationVo(@Param("liveLocation") LiveLocationVo liveLocationVo);
+
+	/**
+	 * 获取指令接收人的轨迹数据
+	 * @param liveLocationVo 实时对象信息
+	 * @return
+	 */
+	List<LocusVo> getDirectiveLocusInfoList(@Param("liveLocation") LiveLocationVo liveLocationVo);
 }
diff --git a/src/main/java/org/springblade/modules/location/mapper/LiveLocationMapper.xml b/src/main/java/org/springblade/modules/location/mapper/LiveLocationMapper.xml
index c7e9b90..49f316b 100644
--- a/src/main/java/org/springblade/modules/location/mapper/LiveLocationMapper.xml
+++ b/src/main/java/org/springblade/modules/location/mapper/LiveLocationMapper.xml
@@ -214,8 +214,43 @@
 
 
 
+    <!--查询指令接收人的定位信息-->
+    <select id="getDirectiveLiveLocationVo" resultType="org.springblade.modules.location.vo.LiveLocationVo">
+        select
+        *
+        from
+        sys_live_location
+        where
+        1=1
+        <if test="liveLocation.type!=null and liveLocation.type!=''">
+            and type = #{liveLocation.type}
+        </if>
+        <if test="liveLocation.workerId!=null and liveLocation.workerId!=''">
+            and worker_id = #{liveLocation.workerId}
+        </if>
+    </select>
 
 
+    <!--查询指令接收人的定位信息-->
+    <select id="getDirectiveLocusInfoList" resultType="org.springblade.modules.location.vo.LocusVo">
+        select
+        sl.*
+        from
+        sys_locus sl
+        left join
+        sys_live_location sll
+        on
+        sll.id = sl.live_location_id
+        where
+        1=1
+        <if test="liveLocation.type!=null and liveLocation.type!=''">
+            and sll.type = #{liveLocation.type}
+        </if>
+        <if test="liveLocation.workerId!=null and liveLocation.workerId!=''">
+            and sll.worker_id = #{liveLocation.workerId}
+        </if>
+    </select>
+
 
 
 
diff --git a/src/main/java/org/springblade/modules/location/service/LiveLocationService.java b/src/main/java/org/springblade/modules/location/service/LiveLocationService.java
index e6abf02..d6d3b9d 100644
--- a/src/main/java/org/springblade/modules/location/service/LiveLocationService.java
+++ b/src/main/java/org/springblade/modules/location/service/LiveLocationService.java
@@ -48,4 +48,18 @@
 	 * @return
 	 */
 	LiveLocation getLiveLocationInfo(LiveLocation liveLocation);
+
+	/**
+	 * 获取指令接收人的定位信息
+	 * @param liveLocationVo 定位数据信息
+	 * @return
+	 */
+	List<LiveLocationVo> getDirectiveLiveLocationVoList(LiveLocationVo liveLocationVo);
+
+	/**
+	 * 获取指令接收人的轨迹数据
+	 * @param liveLocationVo 实时对象信息
+	 * @return
+	 */
+	List<List<LocusVo>> getDirectiveLocusInfoList(LiveLocationVo liveLocationVo);
 }
diff --git a/src/main/java/org/springblade/modules/location/service/impl/LiveLocationServiceImpl.java b/src/main/java/org/springblade/modules/location/service/impl/LiveLocationServiceImpl.java
index c001c92..49443c8 100644
--- a/src/main/java/org/springblade/modules/location/service/impl/LiveLocationServiceImpl.java
+++ b/src/main/java/org/springblade/modules/location/service/impl/LiveLocationServiceImpl.java
@@ -9,6 +9,8 @@
 import org.springblade.modules.location.vo.LocusVo;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -81,4 +83,61 @@
 	public LiveLocation getLiveLocationInfo(LiveLocation liveLocation) {
 		return baseMapper.getLiveLocationInfo(liveLocation);
 	}
+
+
+	/**
+	 * 获取指令接收人的定位信息
+	 * @param liveLocationVo 定位数据信息
+	 * @return
+	 */
+	@Override
+	public List<LiveLocationVo> getDirectiveLiveLocationVoList(LiveLocationVo liveLocationVo) {
+		ArrayList<LiveLocationVo> arrayList = new ArrayList<>();
+		//人员
+		if (liveLocationVo.getType()==1){
+			String userIds = liveLocationVo.getUserIds();
+			if (null!=userIds && userIds!=""){
+				List<String> list = Arrays.asList(userIds.split(","));
+				if (list.size()>0){
+					list.forEach(userId->{
+						liveLocationVo.setWorkerId(Long.parseLong(userId));
+						LiveLocationVo directiveLiveLocationVo = baseMapper.getDirectiveLiveLocationVo(liveLocationVo);
+						//如果存在定位数据
+						if (null!=directiveLiveLocationVo){
+							arrayList.add(directiveLiveLocationVo);
+						}
+					});
+				}
+			}
+		}
+		return arrayList;
+	}
+
+	/**
+	 * 获取指令接收人的轨迹数据
+	 * @param liveLocationVo 实时对象信息
+	 * @return
+	 */
+	@Override
+	public List<List<LocusVo>> getDirectiveLocusInfoList(LiveLocationVo liveLocationVo) {
+		List<List<LocusVo>> arrayList = new ArrayList<>();
+		//人员
+		if (liveLocationVo.getType()==1){
+			String userIds = liveLocationVo.getUserIds();
+			if (null!=userIds && userIds!=""){
+				List<String> list = Arrays.asList(userIds.split(","));
+				if (list.size()>0){
+					list.forEach(userId->{
+						liveLocationVo.setWorkerId(Long.parseLong(userId));
+						List<LocusVo> directiveLocusInfoList = baseMapper.getDirectiveLocusInfoList(liveLocationVo);
+						//如果存在轨迹数据
+						if (directiveLocusInfoList.size()>0){
+							arrayList.add(directiveLocusInfoList);
+						}
+					});
+				}
+			}
+		}
+		return arrayList;
+	}
 }
diff --git a/src/main/java/org/springblade/modules/location/vo/LiveLocationVo.java b/src/main/java/org/springblade/modules/location/vo/LiveLocationVo.java
index 5b10304..4f5e550 100644
--- a/src/main/java/org/springblade/modules/location/vo/LiveLocationVo.java
+++ b/src/main/java/org/springblade/modules/location/vo/LiveLocationVo.java
@@ -54,4 +54,9 @@
 	 */
 	private String carNum;
 
+	/**
+	 * 指令接收人id
+	 */
+	private String userIds;
+
 }
diff --git a/src/main/java/org/springblade/modules/performance/mapper/PerformanceMapper.java b/src/main/java/org/springblade/modules/performance/mapper/PerformanceMapper.java
index 4d9c4cd..82898bf 100644
--- a/src/main/java/org/springblade/modules/performance/mapper/PerformanceMapper.java
+++ b/src/main/java/org/springblade/modules/performance/mapper/PerformanceMapper.java
@@ -16,6 +16,7 @@
  */
 package org.springblade.modules.performance.mapper;
 
+import org.apache.ibatis.annotations.Param;
 import org.springblade.modules.performance.entity.Performance;
 import org.springblade.modules.performance.vo.PerformanceVO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -38,6 +39,6 @@
 	 * @param performance
 	 * @return
 	 */
-	List<PerformanceVO> selectPerformancePage(IPage page, PerformanceVO performance);
+	List<PerformanceVO> selectPerformancePage(IPage page,@Param("performance") PerformanceVO performance);
 	Map<String, String> queryYearPer(String year);
 }
diff --git a/src/main/java/org/springblade/modules/performance/mapper/PerformanceMapper.xml b/src/main/java/org/springblade/modules/performance/mapper/PerformanceMapper.xml
index 7ea5d9a..ddcf401 100644
--- a/src/main/java/org/springblade/modules/performance/mapper/PerformanceMapper.xml
+++ b/src/main/java/org/springblade/modules/performance/mapper/PerformanceMapper.xml
@@ -19,9 +19,8 @@
 
 
     <select id="selectPerformancePage" resultMap="performanceResultMap">
-        select * from sys_performance
+        select * from sys_performance where securityId = #{performance.securityid}
     </select>
-
 
     <!--查询本年所有月份的表现差的数量-->
     <select id="queryYearPer" resultType="java.util.HashMap">

--
Gitblit v1.9.3