From d72163a55b0b666b9810d5ffefd8fd82e617f5e2 Mon Sep 17 00:00:00 2001
From: Fancy <Fancy.fx@outlook.com>
Date: 星期二, 27 八月 2024 15:28:36 +0800
Subject: [PATCH] add userList

---
 pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/schedule/ScheduleCtrl.java |   12 ++++++++++++
 pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoBa/BaUserMapper.java          |    2 ++
 pms-parent/pms-global/src/main/resources/mapper/BaUserMapper.xml                      |    7 +++++++
 pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/schedule/ScheduleSv.java   |   31 ++++++++++++++++++++++++++-----
 4 files changed, 47 insertions(+), 5 deletions(-)

diff --git a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoBa/BaUserMapper.java b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoBa/BaUserMapper.java
index efda1a5..500f80a 100644
--- a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoBa/BaUserMapper.java
+++ b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoBa/BaUserMapper.java
@@ -25,6 +25,8 @@
 
     BaUser login(Map<String, Object> params) ;
 
+    List<BaUser> getUserList() ;
+
     Long selectSomeCount(Map<String, Object> params) ;
 
     List<BaUser> selectSome(Map<String, Object> params) ;
diff --git a/pms-parent/pms-global/src/main/resources/mapper/BaUserMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/BaUserMapper.xml
index 12b158a..d128a39 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/BaUserMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/BaUserMapper.xml
@@ -84,6 +84,13 @@
     where disabled!=1 and deleted!=1 and phone=#{phone} and password=#{password}
   </select>
 
+  <select id="getUserList" resultMap="loginResultMap" >
+    select
+    <include refid="Login_Column_List" />
+    from ba_user
+    where disabled!=1 and deleted!=1
+  </select>
+
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="oneResultMap">
     <!--@mbg.generated-->
     select 
diff --git a/pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/schedule/ScheduleCtrl.java b/pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/schedule/ScheduleCtrl.java
index 32367ed..7f13c65 100644
--- a/pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/schedule/ScheduleCtrl.java
+++ b/pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/schedule/ScheduleCtrl.java
@@ -6,6 +6,7 @@
 import com.dy.common.webUtil.BaseResponseUtils;
 import com.dy.common.webUtil.QueryResultVo;
 import com.dy.pmsGlobal.aop.Log;
+import com.dy.pmsGlobal.pojoBa.BaUser;
 import com.dy.pmsGlobal.pojoPr.PrSchedule;
 import jakarta.servlet.http.HttpServletResponse;
 import jakarta.validation.Valid;
@@ -101,6 +102,17 @@
         QueryResultVo<List<PrSchedule>> list = sv.selectSome(vo) ;
         return BaseResponseUtils.buildSuccess(list);
     }
+    /**
+     * 鏍规嵁ID鏌ヨ
+     * @return
+     */
+    @GetMapping(path="getUserList")
+    @SsoPowerAop(power = "-1")
+    @Log("鏌ヨ绯荤粺涓搷浣滀汉鍛樹俊鎭�")
+    public BaseResponse<List<BaUser>> getUserList(){
+        List<BaUser> userList = sv.selectById();
+        return BaseResponseUtils.buildSuccess(userList);
+    }
 
 
     @PostMapping(path="export")
diff --git a/pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/schedule/ScheduleSv.java b/pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/schedule/ScheduleSv.java
index a7c5ec4..2df51e4 100644
--- a/pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/schedule/ScheduleSv.java
+++ b/pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/schedule/ScheduleSv.java
@@ -1,10 +1,13 @@
 package com.dy.pmsProduct.schedule;
 
 import com.dy.common.webUtil.QueryResultVo;
+import com.dy.pmsGlobal.daoBa.BaPrivilegeMapper;
+import com.dy.pmsGlobal.daoBa.BaUserMapper;
 import com.dy.pmsGlobal.daoPlt.PltStationMapper;
 import com.dy.pmsGlobal.daoPr.PrAssemblyPlanMapper;
 import com.dy.pmsGlobal.daoPr.PrScheduleMapper;
 import com.dy.pmsGlobal.daoPr.PrScheduleRelMapper;
+import com.dy.pmsGlobal.pojoBa.BaUser;
 import com.dy.pmsGlobal.pojoPlt.PltStation;
 import com.dy.pmsGlobal.pojoPr.PrSchedule;
 import com.dy.pmsGlobal.pojoPr.PrScheduleRel;
@@ -25,39 +28,53 @@
     private PrScheduleRelMapper scheduleRelDao;
     private PrAssemblyPlanMapper assemblyPlanDao;
     private PltStationMapper stationDao;
+    private BaUserMapper baUserDao;
+
     @Autowired
     public void setStationDao(PltStationMapper stationDao) {
         this.stationDao = stationDao;
     }
+
     @Autowired
     public void setScheduleRelDao(PrScheduleRelMapper scheduleRelDao) {
         this.scheduleRelDao = scheduleRelDao;
     }
+
     @Autowired
     public void setAssemblyPlanDao(PrAssemblyPlanMapper assemblyPlanDao) {
         this.assemblyPlanDao = assemblyPlanDao;
     }
+
     @Autowired
     public void setScheduleDao(PrScheduleMapper scheduleDao) {
         this.scheduleDao = scheduleDao;
     }
+
+    @Autowired
+    private void setBaUserMapper(BaUserMapper baUserDao) {
+        this.baUserDao = baUserDao;
+    }
+
     @Transactional
     public int save(PrSchedule schedule) {
         int count = scheduleDao.insertSelective(schedule);
         saveRel(schedule);
         return count;
     }
+
     @Transactional
     public int update(PrSchedule schedule) {
         scheduleRelDao.deleteByScheduleId(schedule.id);
         saveRel(schedule);
         return scheduleDao.updateByPrimaryKeySelective(schedule);
     }
+
     private void saveRel(PrSchedule schedule) {
-        schedule.relList.forEach(rel ->validateRelData(rel, schedule));
+        schedule.relList.forEach(rel -> validateRelData(rel, schedule));
         schedule.relList.forEach(rel -> scheduleRelDao.insertSelective(rel));
     }
-    private void validateRelData(PrScheduleRel rel,PrSchedule schedule) {
+
+    private void validateRelData(PrScheduleRel rel, PrSchedule schedule) {
         validatePlan(rel);
         validateStation(rel);
         rel.scheduleId = schedule.id;
@@ -87,11 +104,16 @@
         return scheduleDao.selectByPrimaryKey(id);
     }
 
+    public List<BaUser> selectById() {
+        List<BaUser> userList = baUserDao.getUserList();
+        return userList;
+    }
+
     public QueryResultVo<List<PrSchedule>> selectSome(QueryVo vo) {
         Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo);
         //鏌ヨ绗﹀悎鏉′欢鐨勮褰曟�绘暟
         Long itemTotal = scheduleDao.selectSomeCount(params);
-        QueryResultVo<List<PrSchedule>> rsVo = new QueryResultVo<>(vo.pageSize, vo.pageCurr) ;
+        QueryResultVo<List<PrSchedule>> rsVo = new QueryResultVo<>(vo.pageSize, vo.pageCurr);
         //璁$畻鍒嗛〉绛変俊鎭�
         rsVo.calculateAndSet(itemTotal, params);
         //鏌ヨ绗﹀悎鏉′欢鐨勮褰�
@@ -100,8 +122,7 @@
     }
 
     public List<Map<String, Object>> selectPlan(QueryVo vo) {
-        List<Map<String,Object>> list = assemblyPlanDao.selectByPlanName(vo.planName);
-
+        List<Map<String, Object>> list = assemblyPlanDao.selectByPlanName(vo.planName);
         return list;
     }
 

--
Gitblit v1.8.0