Browse Source

部门新增字段显示标识

anderx 3 years ago
parent
commit
db2c829280

+ 2 - 0
src/main/java/com/goafanti/admin/service/DepartmentService.java

@@ -28,4 +28,6 @@ public interface DepartmentService {
 
 
 	List<Department> selectSubDeps(String subId);
+
+
 }

+ 17 - 4
src/main/java/com/goafanti/common/mapper/UserMidMapper.xml

@@ -574,8 +574,11 @@
     <if test="aid != null">
       and a.id= #{aid}
     </if>
-    <if test="depId != null">
-      and a.department_id = #{depId}
+    <if test="deps != null">
+      and a.department_id in
+      <foreach close=")" collection="deps" item="deps" open="(" separator=",">
+        #{deps.id}
+      </foreach>
     </if>
     <if test="amountType != null">
       <if test="amountType == 1">
@@ -607,8 +610,11 @@
     <if test="aid != null">
       and a.id= #{aid}
     </if>
-    <if test="depId != null">
-      and a.department_id = #{depId}
+    <if test="deps != null">
+      and a.department_id in
+      <foreach close=")" collection="deps" item="deps" open="(" separator=",">
+        #{deps.id}
+      </foreach>
     </if>
     <if test="amountType != null">
       <if test="amountType == 1">
@@ -655,6 +661,10 @@
     <if test="aid !=null">
       and  b.aid= #{aid}
     </if>
+
+    <if test="uid !=null">
+      and  b.id= #{uid}
+    </if>
     <if test="orderType !=null">
       <if test="orderType ==1">
         and(a.sales_type &lt; 3 or (a.sales_type &gt; 3 and a.sales_type &lt; 6))
@@ -697,6 +707,9 @@
     <if test="aid !=null">
       and  b.aid= #{aid}
     </if>
+    <if test="uid !=null">
+      and  b.id= #{uid}
+    </if>
     <if test="orderType !=null">
       <if test="orderType ==1">
         and(a.sales_type &lt; 3 or (a.sales_type &gt; 3 and a.sales_type &lt; 6))

+ 9 - 0
src/main/java/com/goafanti/order/bo/InputSignStatistics.java

@@ -4,6 +4,7 @@ public class InputSignStatistics {
 
     private String depId;
     private String aid;
+    private String uid;
     private Integer amountType;
     private String signTimeStart;
     private String signTimeEnd;
@@ -12,6 +13,14 @@ public class InputSignStatistics {
     private Integer pageSize;
     private Integer pageNo;
 
+    public String getUid() {
+        return uid;
+    }
+
+    public void setUid(String uid) {
+        this.uid = uid;
+    }
+
     public Integer getOrderType() {
         return orderType;
     }

+ 13 - 4
src/main/java/com/goafanti/order/service/impl/UserStatisticsServiceImpl.java

@@ -1,7 +1,9 @@
 package com.goafanti.order.service.impl;
 
+import com.goafanti.admin.service.DepartmentService;
 import com.goafanti.common.dao.TOrderNewMapper;
 import com.goafanti.common.dao.UserMidMapper;
+import com.goafanti.common.model.Department;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
@@ -12,14 +14,14 @@ import groovy.util.logging.Log4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 @Service
 @Log4j
 public class UserStatisticsServiceImpl extends BaseMybatisDao<UserMidMapper> implements UserStaticticsService {
 
+	@Autowired
+	private DepartmentService departmentService;
 
 	@Override
 	public Pagination<OutSignSummary> signSummary(InputSignSummary in) {
@@ -69,7 +71,14 @@ public class UserStatisticsServiceImpl extends BaseMybatisDao<UserMidMapper> imp
 
 
 	private void addsignStatisticsParam(InputSignStatistics in, Map<String, Object> map) {
-		if (in.getDepId()!=null)map.put("depId",in.getDepId());
+		if (in.getDepId()!=null){
+			String[] ss=in.getDepId().split(",");
+			List<Department> ls=new ArrayList<>();
+			Arrays.stream(ss).forEach(e ->{
+				ls.addAll(departmentService.selectSubDeps(e));
+			});
+			map.put("deps",ls);
+		}
 		if (StringUtils.isNotBlank(in.getAid())) map.put("aid", in.getAid());
 		if (in.getAmountType()!=null)map.put("amountType",in.getAmountType());
 		if (in.getSignTimeStart()!=null)map.put("signTimeStart",in.getSignTimeStart());