Ver Fonte

LY 专项培训

ly há 3 anos atrás
pai
commit
716c088491

+ 5 - 1
master/src/main/java/com/ruoyi/project/plant/mapper/TStaffmgrMapper.java

@@ -6,6 +6,8 @@ import java.util.Map;
 import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
 import com.ruoyi.project.common.domain.DataEntity;
 import com.ruoyi.project.plant.domain.TStaffmgr;
+import com.ruoyi.project.system.domain.SysUser;
+import com.ruoyi.project.training.spec.domain.TStSuccessor;
 
 /**
  * 人员管理Mapper接口
@@ -21,7 +23,6 @@ public interface TStaffmgrMapper
      * @param tStaffmgr 人员管理
      * @return 人员管理集合
      */
-    @DataScope(deptAlias = "d")
     public List<TStaffmgr> selectMentorList(TStaffmgr tStaffmgr);
 
     /**
@@ -113,4 +114,7 @@ public interface TStaffmgrMapper
     int reLeftTStaffmgrByIds(Long id);
 
 
+    List<TStaffmgr> selectTStaffmgrByPost(SysUser sysUser);
+
+    List<TStaffmgr> selectTMentorStaffmgrByPost(SysUser sysUser);
 }

+ 5 - 0
master/src/main/java/com/ruoyi/project/plant/service/ITStaffmgrService.java

@@ -4,6 +4,8 @@ import java.util.List;
 
 import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
 import com.ruoyi.project.plant.domain.TStaffmgr;
+import com.ruoyi.project.system.domain.SysUser;
+import com.ruoyi.project.training.spec.domain.TStSuccessor;
 
 /**
  * 人员管理Service接口
@@ -101,4 +103,7 @@ public interface ITStaffmgrService
     int reLeftTStaffmgrByIds(Long id);
 
 
+    List<TStaffmgr> selectTStaffmgrByPost(SysUser sysUser);
+
+    List<TStaffmgr> selectTMentorStaffmgrByPost(SysUser sysUser);
 }

+ 14 - 0
master/src/main/java/com/ruoyi/project/plant/service/impl/TStaffmgrServiceImpl.java

@@ -1,6 +1,9 @@
 package com.ruoyi.project.plant.service.impl;
 
 import java.util.List;
+
+import com.ruoyi.project.system.domain.SysUser;
+import com.ruoyi.project.training.spec.domain.TStSuccessor;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.project.plant.mapper.TStaffmgrMapper;
@@ -149,4 +152,15 @@ public class TStaffmgrServiceImpl implements ITStaffmgrService
     public int reLeftTStaffmgrByIds(Long id) {
         return tStaffmgrMapper.reLeftTStaffmgrByIds(id);
     }
+
+    @Override
+    public List<TStaffmgr> selectTStaffmgrByPost(SysUser sysUser) {
+        return tStaffmgrMapper.selectTStaffmgrByPost(sysUser);
+    }
+
+    @Override
+    public List<TStaffmgr> selectTMentorStaffmgrByPost(SysUser sysUser) {
+        return tStaffmgrMapper.selectTMentorStaffmgrByPost(sysUser);
+    }
+
 }

+ 27 - 0
master/src/main/java/com/ruoyi/project/training/spec/controller/TStSuccessorController.java

@@ -93,6 +93,33 @@ public class TStSuccessorController extends BaseController
         return getDataTable(list);
     }
 
+    /**
+     * 查询学员下拉
+     */
+    @GetMapping("/listPostStaff")
+    public AjaxResult listPostStaff(TStSuccessor tStSuccessor)
+    {
+        Long userId = getUserId();
+        SysUser sysUser = sysUserService.selectUserById(userId);
+        List<TStaffmgr> list = tStaffmgrService.selectTStaffmgrByPost(sysUser);
+        return AjaxResult.success(list);
+    }
+
+    /**
+     * 查询学员下拉
+     */
+    @GetMapping("/listPostMentorStaff")
+    public AjaxResult listPostMentorStaff(TStSuccessor tStSuccessor)
+    {
+        Long userId = getUserId();
+        SysUser sysUser = sysUserService.selectUserById(userId);
+        List<TStaffmgr> list = tStaffmgrService.selectTMentorStaffmgrByPost(sysUser);
+        return AjaxResult.success(list);
+    }
+
+
+
+
     /**
      * 导出继任者清单列表
      */

+ 22 - 0
master/src/main/resources/mybatis/plant/TStaffmgrMapper.xml

@@ -343,4 +343,26 @@
         order by dataName
     </select>
 
+
+    <select id="selectTMentorStaffmgrByPost"  resultMap="TStaffmgrResult">
+        <include refid="selectTStaffmgrVo"/>
+            LEFT JOIN SYS_DICT_DATA s on d.ACTUALPOST = s.DICT_VALUE and s.DICT_TYPE = 'ACTUALPOST'
+        where
+            d.dept_id = #{deptId}
+            and (s.DICT_LABEL like '%主管%'
+            or s.DICT_LABEL like '%经理%'
+            or s.DICT_LABEL like '%工程师%'
+            )
+    </select>
+
+    <select id="selectTStaffmgrByPost"  resultMap="TStaffmgrResult">
+        <include refid="selectTStaffmgrVo"/>
+        LEFT JOIN SYS_DICT_DATA s on d.ACTUALPOST = s.DICT_VALUE and s.DICT_TYPE = 'ACTUALPOST'
+        where
+        d.dept_id = #{deptId}
+        and (s.DICT_LABEL like '%主操%'
+        or s.DICT_LABEL like '%班长%'
+        or s.DICT_LABEL like '%工长%'
+        )
+    </select>
 </mapper>

+ 17 - 0
ui/src/api/training/spec/successor.js

@@ -17,6 +17,23 @@ export function listSuccessor(query) {
   })
 }
 
+// 查询学员
+export function listPostStaff(query) {
+  return request({
+    url: '/spec/successor/listPostStaff',
+    method: 'get',
+    params: query
+  })
+}
+// 查询导师
+export function listPostMentorStaff(query) {
+  return request({
+    url: '/spec/successor/listPostMentorStaff',
+    method: 'get',
+    params: query
+  })
+}
+
 // 查询继任者清单详细
 export function getSuccessor(id) {
   return request({

+ 16 - 13
ui/src/views/training/spec/successor/index.vue

@@ -142,13 +142,13 @@
     <!-- 添加或修改继任者清单对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="培养员工编号" prop="staffId">
+        <el-form-item label="培养员工" prop="staffId">
             <el-select v-model="form.staffId" filterable :placeholder="$t('请选择')+$t('学员')">
               <el-option
                 v-for="item in userOption"
-                :key="item.userId"
-                :label="item.nickName"
-                :value="item.userId"
+                :key="item.staffId"
+                :label="item.name +'  '+ item.deptName"
+                :value="item.staffId"
                 :disabled="item.disabled">
               </el-option>
           </el-select>
@@ -166,13 +166,13 @@
             ></el-option>
           </el-select>
         </el-form-item>
-        <el-form-item label="导师员工编号" prop="mentorStaffId">
+        <el-form-item label="导师员工" prop="mentorStaffId">
           <el-select v-model="form.mentorStaffId" filterable :placeholder="$t('请选择')+$t('导师')">
             <el-option
-              v-for="item in userOption"
-              :key="item.userId"
-              :label="item.nickName"
-              :value="item.userId"
+              v-for="item in userMentorOption"
+              :key="item.staffId"
+              :label="item.name +'  '+ item.deptName"
+              :value="item.staffId"
               :disabled="item.disabled">
             </el-option>
           </el-select>
@@ -231,13 +231,12 @@
 </template>
 
 <script>
-import { listSuccessor, getSuccessor, delSuccessor, addSuccessor, updateSuccessor, exportSuccessor, importTemplate} from "@/api/training/spec/successor";
+import { listSuccessor, getSuccessor, delSuccessor, addSuccessor, updateSuccessor, exportSuccessor, importTemplate ,listPostStaff,listPostMentorStaff} from "@/api/training/spec/successor";
 import { treeselect } from "@/api/system/dept";
 import { getToken } from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import StaffResume from "./staffResume"
-import {listPostUser} from "@/api/system/user";
 
 export default {
   name: "Successor",
@@ -251,6 +250,7 @@ export default {
       // 选中数组
       ids: [],
       userOption:[],
+      userMentorOption: [],
       // 非单个禁用
       single: true,
       // 非多个禁用
@@ -324,8 +324,11 @@ export default {
     this.getDicts("st_successor_status").then(response => {
       this.stSuccessorStatusOptions = response.data;
     });
-    listPostUser(this.queryParams).then(response => {
-      this.userOption = response;
+    listPostStaff(this.queryParams).then(response => {
+      this.userOption = response.data;
+    });
+    listPostMentorStaff(this.queryParams).then(response => {
+      this.userMentorOption = response.data;
     });
   },
   methods: {