Ver código fonte

1.目标录入合作者在Excel中可多选
2.修复新增修改时查询到离职人员

jiangbiao 3 anos atrás
pai
commit
179f00b5c6

+ 14 - 0
master/src/main/java/com/ruoyi/project/plant/controller/TStaffmgrController.java

@@ -169,6 +169,20 @@ public class TStaffmgrController extends BaseController
         return getDataTable(list);
     }
 
+    /**
+     * 查询人员管理列表
+     */
+    @PreAuthorize("@ss.hasPermi('plant:staffmgr:list')")
+    @GetMapping("/getAllList")
+    public TableDataInfo getAllList(TStaffmgr tStaffmgr)
+    {
+        ServletUtils.getParameter("sexs");
+        startPage();
+        logger.info("staffmgr:" + tStaffmgr);
+        List<TStaffmgr> list = tStaffmgrService.selectAllTStaffmgrList(tStaffmgr);
+        return getDataTable(list);
+    }
+
     /**
      * 查询人员公司级培训时间列表
      */

+ 23 - 18
master/src/main/java/com/ruoyi/project/plant/controller/TTargetlistController.java

@@ -209,11 +209,13 @@ public class TTargetlistController extends BaseController
         List<SysDictData> partners = iSysDictTypeService.selectDictDataByType("PARTNERS");
         //部门查询
         List<SysDept> dept = iSysDeptService.selectDeptList(new SysDept());
-        //父菜单查询
-        List<TTargetlist> tTargetlists = tTargetlistService.selectTTargetlistList(new TTargetlist());
         int rowNum = sheet.getPhysicalNumberOfRows();
         int failNumber = 0;
+        int successNumber = 0;
+        int failNum = 0;
         for (int i = 1; i < rowNum; i++) {
+            //父菜单查询
+            List<TTargetlist> tTargetlists = tTargetlistService.selectTTargetlistList(new TTargetlist());
             try {
                 logger.info("读取行数:" + i);
                 Row row = sheet.getRow(i);
@@ -256,11 +258,19 @@ public class TTargetlistController extends BaseController
                         } else if (j == 6) {
                             entity.setYardstick(cellValue);//判断标准
                         } else if (j == 7) {
-                            for (SysDictData p : partners) {
-                                if (p.getDictLabel().equals(cellValue)) {
-                                    entity.setPartners(p.getDictValue());//合作者
+                            String[] split = cellValue.split(",");
+                            String partner = "";
+                            for (String s : split) {
+                                for (SysDictData p : partners) {
+                                    if (p.getDictLabel().equals(s.trim())) {
+                                        partner += p.getDictValue() + ",";//合作者
+                                        break;
+                                    }
                                 }
                             }
+                            if (partner.length() > 0)
+                                partner = partner.substring(0,partner.length()-1);
+                            entity.setPartners(partner);
                         } else if (j == 8) {
                             for (SysDept d : dept) {
                                 if (d.getDeptName().equals(cellValue.trim())) {
@@ -275,24 +285,19 @@ public class TTargetlistController extends BaseController
                 entity.setCreaterCode(userId.toString());
                 logger.info("entity:" + entity);
                 list.add(entity);
+                failNum++;
+                try {
+                    tTargetlistService.insertTTargetlist(entity);
+                    successNumber++;
+                }catch (Exception e){
+                    failNumber++;
+                    failRow.add(failNum+1);
+                }
             }catch (Exception e){
                 failNumber++;
                 failRow.add(i+1);
             }
         }
-        int successNumber = 0;
-        int failNum = 0;
-        for (TTargetlist t : list
-        ) {
-            failNum++;
-            try {
-                tTargetlistService.insertTTargetlist(t);
-                successNumber++;
-            }catch (Exception e){
-                failNumber++;
-                failRow.add(failNum+1);
-            }
-        }
         logger.info("list:" + JSON.toJSONString(list));
         logger.info("successNumber:" +String.valueOf(successNumber));
         logger.info("failNumber:" +String.valueOf(failNumber));

+ 2 - 0
master/src/main/java/com/ruoyi/project/plant/mapper/TStaffmgrMapper.java

@@ -49,6 +49,8 @@ public interface TStaffmgrMapper
      */
     @DataScope(deptAlias = "d")
     public List<TStaffmgr> selectTStaffmgrList(TStaffmgr tStaffmgr);
+    @DataScope(deptAlias = "d")
+    public List<TStaffmgr> selectAllTStaffmgrList(TStaffmgr tStaffmgr);
 
     /**
      * 查询人员管理列表

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

@@ -47,6 +47,7 @@ public interface ITStaffmgrService
      * @return 人员管理集合
      */
     public List<TStaffmgr> selectTStaffmgrList(TStaffmgr tStaffmgr);
+    public List<TStaffmgr> selectAllTStaffmgrList(TStaffmgr tStaffmgr);
 
     /**
      * 定时任务查询人员管理列表

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

@@ -61,6 +61,11 @@ public class TStaffmgrServiceImpl implements ITStaffmgrService
     {
         return tStaffmgrMapper.selectTStaffmgrList(tStaffmgr);
     }
+    @Override
+    public List<TStaffmgr> selectAllTStaffmgrList(TStaffmgr tStaffmgr)
+    {
+        return tStaffmgrMapper.selectAllTStaffmgrList(tStaffmgr);
+    }
 
     /**
      * 定时任务查询人员管理列表

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

@@ -60,6 +60,74 @@
     </select>
 
     <select id="selectTStaffmgrList" parameterType="TStaffmgr" resultMap="TStaffmgrResult">
+        <include refid="selectTStaffmgrVo"/>
+        Left join SYS_DICT_DATA s0 on d.UNIT = s0.DICT_VALUE and s0.DICT_TYPE ='STAFF_UNIT'
+        LEFT JOIN SYS_DICT_DATA s on d.ACTUALPOST = s.DICT_VALUE and s.DICT_TYPE = 'ACTUALPOST'
+        LEFT JOIN SYS_DICT_DATA s1 on d.team = s1.DICT_VALUE and s1.DICT_TYPE = 'TEAM_DIVIDE'
+        <where>
+            <if test="name != null  and name != ''"> and name like concat(concat('%', #{name}), '%')</if>
+            <if test="sex != null  and sex != ''"> and sex = #{sex}</if>
+            <if test="unit != null  and unit != ''"> and unit = #{unit}</if>
+            <if test="specialDuty != null  and specialDuty != ''"> and special_duty like concat(concat('%', #{specialDuty}), '%')</if>
+            <if test="units != null  and units != ''">
+                and
+                unit in
+                <foreach collection="units.split(',')" item="item" index="index"
+                         open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="team != null  and team != ''"> and team = #{team}</if>
+            <if test="teams != null  and teams != ''">
+                and
+                team in
+                <foreach collection="teams.split(',')" item="item" index="index"
+                         open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="actualpost != null  and actualpost != ''"> and actualpost = #{actualpost}</if>
+            <if test="actualposts != null  and actualposts != ''">
+                and
+                actualpost in
+                <foreach collection="actualposts.split(',')" item="item" index="index"
+                         open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+
+            </if>
+            <if test="education != null  and education != ''"> and education = #{education}</if>
+            <if test="educations != null  and educations != ''">
+                and
+                education in
+                <foreach collection="educations.split(',')" item="item" index="index"
+                         open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="enAbility != null  and enAbility != ''"> and en_ability = #{enAbility}</if>
+            <if test="enAbilitys != null  and enAbilitys != ''">
+                and
+                en_ability in
+                <foreach collection="enAbilitys.split(',')" item="item" index="index"
+                         open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="haveEmail != null  and haveEmail != ''"> and mail IS NOT NULL</if>
+            <if test="skillevaluation != null"> and team = 10
+                or team = 12
+                or team = 14
+                or team = 16
+            </if>
+            and d.del_flag = 0
+        </where>
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+        ORDER BY s0.DICT_SORT, s1.DICT_SORT ,s.DICT_SORT
+    </select>
+
+    <select id="selectAllTStaffmgrList" parameterType="TStaffmgr" resultMap="TStaffmgrResult">
         <include refid="selectTStaffmgrVo"/>
         Left join SYS_DICT_DATA s0 on d.UNIT = s0.DICT_VALUE and s0.DICT_TYPE ='STAFF_UNIT'
         LEFT JOIN SYS_DICT_DATA s on d.ACTUALPOST = s.DICT_VALUE and s.DICT_TYPE = 'ACTUALPOST'

BIN
master/src/main/resources/static/template/plant/targetlist.xlsx


+ 7 - 0
ui/src/api/plant/staffmgr.js

@@ -33,6 +33,13 @@ export function listStaffmgr(query) {
     params: query
   })
 }
+export function listAllStaffmgr(query) {
+  return request({
+    url: '/plant/staffmgr/getAllList',
+    method: 'get',
+    params: query
+  })
+}
 
 // 查询人员管理列表
 export function listStaffmgrAll(query) {

+ 11 - 3
ui/src/views/plant/targetmeasures/index.vue

@@ -12,7 +12,7 @@
       <el-form-item :label="$t('负责人')" prop="responsible">
         <el-select v-model="queryParams.responsible" filterable :placeholder="$t('请选择')+$t('负责人')">
           <el-option
-            v-for="dict in responsibleOptions"
+            v-for="dict in responsibleOptions2"
             :key="dict.staffid"
             :label="dict.name"
             :value="dict.staffid">
@@ -292,7 +292,7 @@
 <script>
   import { getTargetmeasures, delTargetmeasures, addTargetmeasures, updateTargetmeasures, exportTargetmeasures, importTemplate} from "@/api/plant/targetmeasures";
   import { listMeasures, getTargetlist } from "@/api/plant/targetlist";
-  import { listStaffmgr } from "@/api/plant/staffmgr";
+  import {listAllStaffmgr, listStaffmgr} from "@/api/plant/staffmgr";
   import { treeselect } from "@/api/system/dept";
   import { getToken } from "@/utils/auth";
   import {allFileList, delCommonfile } from "@/api/common/commonfile";
@@ -327,6 +327,7 @@
         targetactionList: [],
         // 人员字典
         responsibleOptions: [],
+        responsibleOptions2: [],
         principalOptions: [],
         // 弹出层标题
         title: "",
@@ -437,6 +438,7 @@
         this.clientHeight = document.body.clientHeight -250
       })
       this.getResponsible();
+      this.getResponsible2();
       this.getPrincipal();
       this.getTreeselect();
     },
@@ -451,7 +453,7 @@
             if (value.responsible != null) {
               let responsibles = value.responsible.split(",");
               responsibles.forEach(function (id, index) {
-                _this.responsibleOptions.forEach(function (item) {
+                _this.responsibleOptions2.forEach(function (item) {
                   if (item.staffid === id) {
                     if (index === 0) {
                       responsiblesName = item.name
@@ -481,6 +483,12 @@
           this.getList();
         });
       },
+      getResponsible2() {
+        listAllStaffmgr(this.staffmgrQueryParams).then(response => {
+          this.responsibleOptions2 = response.rows;
+          this.getList();
+        });
+      },
       getPrincipal() {
         listStaffmgr(this.staffmgrPrincipal).then(response => {
           this.principalOptions = response.rows;