From df5e0dee7606532ec5ab226fc4114dfeb3949565 Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期四, 07 十二月 2023 13:25:08 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/crm/manager/service/impl/PlanServiceImpl.java | 5 ++
src/main/resources/mapper/PlanMapper.xml | 6 +++
src/main/java/com/zy/crm/manager/controller/BIController.java | 59 +++++++++++++++++++++++++++++
src/main/java/com/zy/crm/manager/service/PlanService.java | 2 +
src/main/java/com/zy/crm/manager/mapper/PlanMapper.java | 2 +
5 files changed, 74 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/zy/crm/manager/controller/BIController.java b/src/main/java/com/zy/crm/manager/controller/BIController.java
index f355b47..7f65669 100644
--- a/src/main/java/com/zy/crm/manager/controller/BIController.java
+++ b/src/main/java/com/zy/crm/manager/controller/BIController.java
@@ -4,14 +4,22 @@
import com.core.annotations.ManagerAuth;
import com.core.common.R;
import com.zy.crm.common.web.BaseController;
+import com.zy.crm.manager.entity.ContractSales;
import com.zy.crm.manager.entity.Plan;
+import com.zy.crm.manager.entity.PlanType;
+import com.zy.crm.manager.entity.ProcessPermissions;
import com.zy.crm.manager.service.PlanService;
+import com.zy.crm.manager.service.PlanTypeService;
+import com.zy.crm.manager.service.ProcessPermissionsService;
+import com.zy.crm.system.entity.User;
+import com.zy.crm.system.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -20,6 +28,12 @@
@Autowired
private PlanService planService;
+ @Autowired
+ private PlanTypeService planTypeService;
+ @Autowired
+ private UserService userService;
+ @Autowired
+ private ProcessPermissionsService processPermissionsService;
@RequestMapping(value = "/pending/approval/auth")
@ManagerAuth
@@ -32,4 +46,49 @@
List<Map<String, Object>> maps = planService.selectMaps(wrapper);
return R.ok().add(maps);
}
+
+ @RequestMapping(value = "/pending/user/approval/auth")
+ @ManagerAuth
+ public R getPlanByUser() {
+ PlanType planType = new PlanType();
+ planType.setType(1);
+ planType.setType(1);
+ User planLeader = planTypeService.findPlanLeader(planType);
+ List<User> users = userService.selectList(new EntityWrapper<User>().eq("dept_id", planLeader.getDeptId()));
+ List<ProcessPermissions> processPermissionsList = processPermissionsService.selectList(new EntityWrapper<ProcessPermissions>().eq("process_memo", 101));
+ for (ProcessPermissions processPermissions:processPermissionsList){
+ User user = userService.selectById(processPermissions.getUserId());
+ users.add(user);
+ }
+ List<Map<String, Object>> result = new ArrayList<>();
+
+ for (User user:users){
+ List<Plan> plans = planService.selctPlanListByDirector(user.getId());
+ String userList = "";
+ for (Plan plan:plans){
+ userList = userList+","+plan.getUserId$();
+ }
+ int director = planService.selectCount(new EntityWrapper<Plan>().eq("director", user.getId()));
+
+
+ Map<String, Object> map = new HashMap<>();
+ map.put("user", user.getNickname());
+ map.put("value", userList);
+ map.put("anfme", director);
+ result.add(map);
+ }
+
+// List<PlanType> planTypes = planTypeService.selectList(new EntityWrapper<PlanType>().eq("type", "1").eq("host_id",1));
+// for (PlanType planType2:planTypes){
+//
+// }
+
+ // 浼犲叆鐢ㄦ埛id鏌ヨ瑙勫垝鍗� 鍖哄垎锛岄�氳繃鍖哄垎鍑烘潵鐨勮鍒掑崟绫诲瀷鏌ヨ 瑙勫垝鐢宠鍗�
+ //
+ EntityWrapper<Plan> wrapper = new EntityWrapper<>();
+ wrapper.setSqlSelect("user_id");
+ wrapper.eq("settle",2).eq("assistant_host_sign",0).groupBy("user_id");
+ List<Map<String, Object>> maps = planService.selectMaps(wrapper);
+ return R.ok().add(maps);
+ }
}
diff --git a/src/main/java/com/zy/crm/manager/mapper/PlanMapper.java b/src/main/java/com/zy/crm/manager/mapper/PlanMapper.java
index f897021..344ea91 100644
--- a/src/main/java/com/zy/crm/manager/mapper/PlanMapper.java
+++ b/src/main/java/com/zy/crm/manager/mapper/PlanMapper.java
@@ -20,4 +20,6 @@
List<Plan> listByPage(Page<Plan> page, @Param("hostId")Long hostId, @Param("deptId") String deptId, @Param("userId") Long userId ,@Param("director")Long director, @Param("condition") String condition);
+ List<Plan> selctPlanListByDirector(Long userId);
+
}
diff --git a/src/main/java/com/zy/crm/manager/service/PlanService.java b/src/main/java/com/zy/crm/manager/service/PlanService.java
index d0c3ac1..1a3240a 100644
--- a/src/main/java/com/zy/crm/manager/service/PlanService.java
+++ b/src/main/java/com/zy/crm/manager/service/PlanService.java
@@ -15,4 +15,6 @@
Page<Plan> getPage(Page<Plan> page, Long hostId, String deptId, Long userId,Long direcote, String condition);
+ List<Plan> selctPlanListByDirector(Long userId);
+
}
diff --git a/src/main/java/com/zy/crm/manager/service/impl/PlanServiceImpl.java b/src/main/java/com/zy/crm/manager/service/impl/PlanServiceImpl.java
index 34ca013..ea75cba 100644
--- a/src/main/java/com/zy/crm/manager/service/impl/PlanServiceImpl.java
+++ b/src/main/java/com/zy/crm/manager/service/impl/PlanServiceImpl.java
@@ -66,4 +66,9 @@
}
}
+ @Override
+ public List<Plan> selctPlanListByDirector(Long userId){
+ return this.baseMapper.selctPlanListByDirector(userId);
+ }
+
}
diff --git a/src/main/resources/mapper/PlanMapper.xml b/src/main/resources/mapper/PlanMapper.xml
index 5d8bf24..ab3a62c 100644
--- a/src/main/resources/mapper/PlanMapper.xml
+++ b/src/main/resources/mapper/PlanMapper.xml
@@ -128,4 +128,10 @@
and settle < settle_size
</select>
+ <select id="selctPlanListByDirector" resultType="java.lang.Integer">
+ select DISTINCT user_id from man_plan
+ where 1=1
+ and director = #{director}
+ </select>
+
</mapper>
--
Gitblit v1.9.1