Kaynağa Gözat

-修改申请单对应人员管理
-修改待办邮件发送逻辑
-修改单元查询

jiangbiao 2 yıl önce
ebeveyn
işleme
9a0ad4a9a3

+ 4 - 2
master/src/main/java/com/ruoyi/framework/task/TodoTask.java

@@ -25,14 +25,16 @@ public class TodoTask extends BaseController {
     public void execute() {
         List<SysUser> sysUsers = sysUserService.selectAllUser();
         IMailService mailService = (IMailService) SpringContextUtils.getBean("mailService");
-        sysUsers.forEach(item -> {
+        for (SysUser item : sysUsers) {
             try {
                 ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
                 List<Task> taskList = processEngine.getTaskService()//获取任务service
                         .createTaskQuery()//创建查询对象
+                        .processDefinitionId("reserveInvoice")//根据任务流程id查询
                         .taskCandidateOrAssigned(item.getUserId().toString())
                         //                .taskAssignee(getUserId().toString())
                         .orderByTaskCreateTime().desc().list();//参与者,组任务查询
+                logger.info("==========================任务列表:{}",taskList);
                 String username = item.getNickName();
                 String loginName = item.getUserName();
                 String usernameEN = PinyinHelper.convertToPinyinString(username, " ", PinyinFormat.WITHOUT_TONE);
@@ -69,6 +71,6 @@ public class TodoTask extends BaseController {
                 }
             } catch (Exception ignored) {
             }
-        });
+        }
     }
 }

+ 13 - 1
master/src/main/java/com/ruoyi/project/plant/domain/TStaffmgr.java

@@ -1,12 +1,13 @@
 package com.ruoyi.project.plant.domain;
 
-import java.util.Date;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ruoyi.framework.aspectj.lang.annotation.Excel;
 import com.ruoyi.framework.web.domain.BaseEntity;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 
+import java.util.Date;
+
 /**
  * 人员管理对象 t_staffmgr
  *
@@ -131,6 +132,17 @@ public class TStaffmgr extends BaseEntity
     private String leftYear;
     /** 是否退休 */
     private Integer isRetire;
+
+    private String region;
+
+    public String getRegion() {
+        return region;
+    }
+
+    public void setRegion(String region) {
+        this.region = region;
+    }
+
     public Date getLeftDate() {
         return leftDate;
     }

+ 20 - 21
master/src/main/java/com/ruoyi/project/system/controller/SysPlantController.java

@@ -1,34 +1,26 @@
 package com.ruoyi.project.system.controller;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
 import com.alibaba.fastjson.JSON;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.ruoyi.common.utils.ServletUtils;
 import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.common.utils.spring.SpringUtils;
-import com.ruoyi.framework.security.LoginUser;
-import com.ruoyi.framework.security.service.TokenService;
-import com.ruoyi.project.system.domain.SysUser;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
-import com.ruoyi.project.system.domain.SysPlant;
-import com.ruoyi.project.system.service.ISysPlantService;
+import com.ruoyi.framework.security.LoginUser;
+import com.ruoyi.framework.security.service.TokenService;
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.project.system.domain.SysPlant;
+import com.ruoyi.project.system.domain.SysUser;
+import com.ruoyi.project.system.service.ISysPlantService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
 
 /**
  * 装置管理Controller
@@ -53,6 +45,13 @@ public class SysPlantController extends BaseController
         return AjaxResult.success(list);
     }
 
+    @GetMapping("/listSysPlantByParentId")
+    public AjaxResult listSysPlantByParentId(SysPlant sysPlant)
+    {
+        List<SysPlant> list = sysPlantService.selectSysPlantByParentId(sysPlant);
+        return AjaxResult.success(list);
+    }
+
     /**
      * 查询装置管理列表
      */

+ 22 - 0
master/src/main/java/com/ruoyi/project/system/controller/SysUserController.java

@@ -27,7 +27,9 @@ import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
 import java.io.IOException;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 /**
@@ -70,6 +72,26 @@ public class SysUserController extends BaseController
         return list;
     }
 
+    @GetMapping("/listUserByMgrRegion")
+    public List<Map<String,Object>> listUserByMgrRegion(TStaffmgr tStaffmgr)
+    {
+        List<Map<String,Object>> list = userService.selectUserByMgrRegion(tStaffmgr);
+        Map<String, Object> map = new HashMap<>();
+        StringBuilder userId= new StringBuilder();
+        StringBuilder nickName= new StringBuilder();
+        for (Map<String, Object> user : list) {
+            if("芳烃抽提".equals(user.get("REGION"))||"汽油加氢".equals((user.get("REGION")))){
+                userId.append(user.get("USER_ID").toString()).append(",");
+                nickName.append(user.get("NICK_NAME").toString()).append(",");
+            }
+        }
+        if (StringUtils.isNotEmpty(userId.toString())&&StringUtils.isNotEmpty(nickName.toString())) {
+            map.put("USER_ID", userId.substring(0, userId.length()-1));
+            map.put("NICK_NAME", nickName.substring(0, nickName.length()-1));
+        }
+        return list;
+    }
+
     @Log(title = "用户管理", businessType = BusinessType.EXPORT)
     @PreAuthorize("@ss.hasPermi('system:user:export')")
     @GetMapping("/export")

+ 3 - 1
master/src/main/java/com/ruoyi/project/system/mapper/SysPlantMapper.java

@@ -1,9 +1,10 @@
 package com.ruoyi.project.system.mapper;
 
-import java.util.List;
 import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
 import com.ruoyi.project.system.domain.SysPlant;
 
+import java.util.List;
+
 /**
  * 装置管理Mapper接口
  *
@@ -65,6 +66,7 @@ public interface SysPlantMapper
 
     List<SysPlant> selectMySysPlantList(SysPlant sysPlant);
     List<SysPlant> selectMySysPlantList3(SysPlant sysPlant);
+    List<SysPlant> selectSysPlantByParentId(SysPlant sysPlant);
 
     List<SysPlant> selectSysPlantByDeptId(Long deptId);
 }

+ 4 - 0
master/src/main/java/com/ruoyi/project/system/mapper/SysUserMapper.java

@@ -6,6 +6,7 @@ import com.ruoyi.project.system.domain.SysUser;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 用户表 数据层
@@ -42,6 +43,9 @@ public interface SysUserMapper
     @DataScope(deptAlias = "d")
     public List<SysUser> selectUserPost(TStaffmgr tStaffmgr);
 
+    @DataScope(deptAlias = "d")
+    public List<Map<String,Object>> selectUserByMgrRegion(TStaffmgr tStaffmgr);
+
     public List<SysUser> selectUserListByRoleAndDept(SysUser sysUser);
 
     /**

+ 3 - 1
master/src/main/java/com/ruoyi/project/system/service/ISysPlantService.java

@@ -1,8 +1,9 @@
 package com.ruoyi.project.system.service;
 
-import java.util.List;
 import com.ruoyi.project.system.domain.SysPlant;
 
+import java.util.List;
+
 /**
  * 装置管理Service接口
  *
@@ -64,6 +65,7 @@ public interface ISysPlantService
     List<SysPlant> selectSysMyPlantList(SysPlant sysPlant);
 
     List<SysPlant> selectSysMyPlantList3(SysPlant sysPlant);
+    List<SysPlant> selectSysPlantByParentId(SysPlant sysPlant);
 
     List<SysPlant> selectSysPlantByDeptId(Long deptId);
 }

+ 3 - 0
master/src/main/java/com/ruoyi/project/system/service/ISysUserService.java

@@ -5,6 +5,7 @@ import com.ruoyi.project.system.domain.SysUser;
 import com.ruoyi.project.system.domain.SysUserRole;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 用户 业务层
@@ -43,6 +44,8 @@ public interface ISysUserService
 
     public List<SysUser> selectUserPost(TStaffmgr tStaffmgr);
 
+    public List<Map<String,Object>> selectUserByMgrRegion(TStaffmgr tStaffmgr);
+
     /**
      * 通过用户名查询用户
      *

+ 5 - 0
master/src/main/java/com/ruoyi/project/system/service/impl/SysPlantServiceImpl.java

@@ -106,6 +106,11 @@ public class SysPlantServiceImpl implements ISysPlantService
         return sysPlantMapper.selectMySysPlantList3(sysPlant);
     }
 
+    @Override
+    public List<SysPlant> selectSysPlantByParentId(SysPlant sysPlant) {
+        return sysPlantMapper.selectSysPlantByParentId(sysPlant);
+    }
+
     @Override
     public List<SysPlant> selectSysPlantByDeptId(Long deptId) {
         return sysPlantMapper.selectSysPlantByDeptId(deptId);

+ 6 - 0
master/src/main/java/com/ruoyi/project/system/service/impl/SysUserServiceImpl.java

@@ -19,6 +19,7 @@ import org.springframework.transaction.annotation.Transactional;
 import javax.annotation.Resource;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 用户 业务层处理
@@ -101,6 +102,11 @@ public class SysUserServiceImpl implements ISysUserService
         return userMapper.selectUserPost(tStaffmgr);
     }
 
+    @Override
+    public List<Map<String,Object>> selectUserByMgrRegion(TStaffmgr tStaffmgr) {
+        return userMapper.selectUserByMgrRegion(tStaffmgr);
+    }
+
     /**
      * 通过用户名查询用户
      *

+ 6 - 2
master/src/main/resources/mybatis/plant/TStaffmgrMapper.xml

@@ -33,10 +33,11 @@
         <result property="specialDuty"    column="special_duty"    />
         <result property="leftDate"    column="left_date"    />
         <result property="isRetire"    column="is_retire"    />
+        <result property="region"    column="region"    />
     </resultMap>
 
     <sql id="selectTStaffmgrVo">
-         select d.id, d.plant_code,d.left_date, d.staffid, d.name, d.photo, d.sex, d.birthday, d.unit, d.team, d.actualpost, d.contact, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.education, d.en_ability, d.accident_num, d.mail, d.skill_score, d.p_id , d.special_duty, s.dept_name from t_staffmgr d
+         select d.id, d.plant_code,d.left_date, d.staffid, d.name, d.photo, d.sex, d.birthday, d.unit, d.team, d.actualpost, d.contact, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.education, d.en_ability, d.accident_num, d.mail, d.skill_score, d.p_id , d.special_duty, d.region, s.dept_name from t_staffmgr d
       left join sys_dept s on s.dept_id = d.dept_id
     </sql>
 
@@ -45,7 +46,7 @@
         select d.id, s.DICT_LABEL,d.plant_code, d.staffid, d.name, d.photo, d.sex, d.birthday, d.unit,
                d.team, d.actualpost, d.contact, d.del_flag, d.creater_code, d.createdate, d.updater_code,
                d.updatedate, d.dept_id, d.remarks, d.education, d.en_ability, d.accident_num, d.mail,
-               d.skill_score, d.p_id , d.special_duty, s.dept_name
+               d.skill_score, d.p_id , d.special_duty,d.region, s.dept_name
 
         from t_staffmgr d
         left join sys_dept s on s.dept_id = d.dept_id
@@ -318,6 +319,7 @@
             <if test="photo != null">photo,</if>
             <if test="pId != null">p_id,</if>
             <if test="specialDuty != null">special_duty,</if>
+            <if test="region != null">region,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -345,6 +347,7 @@
             <if test="photo != null">#{photo},</if>
             <if test="pId != null">#{pId},</if>
             <if test="specialDuty != null">#{specialDuty},</if>
+            <if test="region != null">#{region},</if>
         </trim>
     </insert>
 
@@ -369,6 +372,7 @@
             <if test="createrCode != null">creater_code = #{createrCode},</if>
             <if test="createdate != null">createdate = #{createdate},</if>
             <if test="updaterCode != null">updater_code = #{updaterCode},</if>
+            <if test="region != null">region = #{region},</if>
             <if test="updatedate != null">updatedate = #{updatedate},</if>
             <if test="deptId != null">dept_id = #{deptId},</if>
             <if test="remarks != null">remarks = #{remarks},</if>

+ 8 - 0
master/src/main/resources/mybatis/system/SysPlantMapper.xml

@@ -80,6 +80,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where sd.DEPT_ID = #{deptId} or FIND_IN_SET(#{deptId}, sd.ancestors) > 0
     </select>
 
+    <select id="selectSysPlantByParentId" parameterType="SysPlant" resultMap="SysPlantResult">
+        SELECT
+            sp.NAME
+        FROM
+            SYS_PLANT sp
+        where  sp.PARENT_ID=#{parentId}
+    </select>
+
 
     <select id="selectSysPlantById" parameterType="Long" resultMap="SysPlantResult">
         select t.plant_id, t.parent_id, t.name, t.order_num, t.del_flag, t.cname, t.dept_code, t.remarks, t.p_type, p.name as parent_name

+ 25 - 0
master/src/main/resources/mybatis/system/SysUserMapper.xml

@@ -69,6 +69,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		${params.dataScope}
 	</select>
 
+	<select id="selectUserByMgrRegion" parameterType="tStaffmgr" resultType="map">
+		SELECT
+		a.region,
+		listagg ( b.NICK_NAME, ',' ) within GROUP ( ORDER BY a.region ) nickName,
+		listagg ( b.user_id, ',' ) within GROUP ( ORDER BY a.region ) userId
+		FROM
+		T_STAFFMGR a
+		LEFT JOIN SYS_USER b ON a.STAFFID = b.STAFFID
+		LEFT JOIN sys_dept d ON a.dept_id = d.dept_id
+		<where>
+			(
+			a.region = '芳烃抽提'
+			OR a.region = '汽油加氢'
+			OR a.region = '压缩'
+			OR a.region = '分离'
+			OR a.region = '裂解'
+			)
+			AND a.DEL_FLAG = 0
+			AND b.USER_ID IS NOT NULL
+		</where>
+		${params.dataScope}
+		GROUP BY
+		a.region
+	</select>
+
 	<select id="selectAllUser" resultType="SysUser">
 		select * from sys_user u where u.del_flag = '0'
 	</select>

+ 8 - 0
ui/src/api/system/plant.js

@@ -9,6 +9,14 @@ export function listPlant(query) {
   })
 }
 
+export function listSysPlantByParentId(query) {
+  return request({
+    url: '/system/plant/listSysPlantByParentId',
+    method: 'get',
+    params: query
+  })
+}
+
 // 查询装置管理列表
 export function mylistPlant(query) {
   return request({

+ 8 - 0
ui/src/api/system/user.js

@@ -18,6 +18,14 @@ export function listUserPost(query) {
   })
 }
 
+
+export function listUserByMgrRegion(query) {
+  return request({
+    url: 'system/user/listUserByMgrRegion',
+    method: 'get',
+    params: query
+  })
+}
 // 查询用户详细
 export function getUser(userId) {
   return request({

+ 10 - 9
ui/src/views/apply/lock/lock-eu.vue

@@ -8,7 +8,7 @@
         </th>
       </tr>
       <tr>
-        <td v-for="(item) in data">
+        <td v-for="(item) in data" :class="status1.includes(item.id) ? 'grey' : (status2.includes(item.id) ? 'green':(status3.includes(item.id) ? 'yellow':'red'))">
           <el-popover
             placement="bottom"
             trigger="click">
@@ -16,8 +16,8 @@
             <el-button type="danger" round @click="changeColor(4)">状态2</el-button>
             <el-button type="warning" round @click="changeColor(3)">状态3</el-button>
             <el-button type="success" round @click="changeColor(2)">状态4</el-button>
-            <el-button slot="reference" type="text" size="100%" @click="openDialog(item.id)"
-                       :class="status1.includes(item.id) ? 'grey' : (status2.includes(item.id) ? 'green':(status3.includes(item.id) ? 'yellow':'red'))">
+            <el-button slot="reference" type="text"  @click="openDialog(item.id)"
+                      style="color: #fff" >
               <i class="el-icon-timer" v-if="status1.includes(item.id)"/>
               <i class="el-icon-lock" v-else-if="status2.includes(item.id)"/>
               <i class="el-icon-circle-close" v-else-if="status3.includes(item.id)"/>
@@ -57,7 +57,7 @@ export default {
       status4: [2, 7, 8, 9],
       visible: false,
       height: document.body.clientHeight - 155,
-      colspan:10
+      colspan:35
     }
   },
   created() {
@@ -135,7 +135,7 @@ tr {
 }
 
 td {
-  width: 10%;
+  width: 3.5%;
   height: 100px;
   border: 1px solid #d0d0d0;
   border-collapse: collapse;
@@ -154,18 +154,19 @@ el-button {
 }
 
 .green {
-  color: #67C23A;
+  color: #fff;
+  background-color:#67C23A;
 }
 
 .red {
-  color: #F56C6C;
+  background-color: #F56C6C;
 }
 
 .yellow {
-  color: #E6A23C;
+  background-color: #E6A23C;
 }
 
 .grey {
-  color: #909399;
+  background-color: #909399;
 }
 </style>

+ 11 - 10
ui/src/views/apply/offlinevalve/index.vue

@@ -213,9 +213,9 @@
           <el-select v-model="form.unit" placeholder="请选择单元" clearable size="small" filterable style="width: 100%">
             <el-option
               v-for="dict in unitOptions"
-              :key="dict.dictLabel"
-              :label="dict.dictLabel"
-              :value="dict.dictLabel"
+              :key="dict.name"
+              :label="dict.name"
+              :value="dict.name"
             ></el-option>
           </el-select>
         </el-form-item>
@@ -239,9 +239,9 @@
           <el-select v-model="form.confirmer" placeholder="请选择临时措施确认人" clearable size="small" filterable style="width: 100%">
             <el-option
               v-for="item in confirmerList"
-              :key="item.regionalHead"
-              :label="item.regionalHeadName"
-              :value="item.regionalHead"
+              :key="item.USERID"
+              :label="item.NICKNAME"
+              :value="item.USERID"
             ></el-option>
           </el-select>
         </el-form-item>
@@ -401,9 +401,10 @@ import {getToken} from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import {allSafetyvavle} from "@/api/reliability/safetyvavle";
-import {listPostUser, listUserPost} from "@/api/system/user";
+import {listPostUser, listUserByMgrRegion, listUserPost} from "@/api/system/user";
 import OfflinevalveDetail from "@/views/approve/approveDetail/offlinevalve-detail";
 import {listRegionalHead} from "@/api/invoice/device";
+import {listSysPlantByParentId} from "@/api/system/plant";
 
 export default {
   name: "Offlinevalve",
@@ -555,8 +556,8 @@ export default {
     }).then(response => {
       this.executorList = response;
     });
-    listRegionalHead().then(response => {
-      this.confirmerList = response.data;
+    listUserByMgrRegion().then(response => {
+      this.confirmerList = response;
     });
     //设置表格高度对应屏幕高度
     this.$nextTick(() => {
@@ -567,7 +568,7 @@ export default {
     allSafetyvavle().then(res => {
       this.safetyvavleList = res.data
     });
-    this.getDicts("UNIT").then(response => {
+    listSysPlantByParentId({parentId:6}).then(response => {
       this.unitOptions = response.data;
     });
     this.getDicts("apply_status").then(response => {

+ 3 - 3
ui/src/views/apply/safetychange/index.vue

@@ -406,7 +406,7 @@ 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 {listPostUser, listUserPost} from "@/api/system/user";
+import {listPostUser, listUserByMgrRegion, listUserPost} from "@/api/system/user";
 import SafetychangeDetail from "@/views/approve/approveDetail/safetychange-detail";
 import {listRegionalHead} from "@/api/invoice/device";
 
@@ -568,8 +568,8 @@ export default {
     }).then(response => {
       this.executorList = response;
     });
-    listRegionalHead().then(response => {
-      this.safaerList = response.data;
+    listUserByMgrRegion().then(response => {
+      this.safaerList = response;
     });
   },
   methods: {

+ 19 - 1
ui/src/views/plant/staffmgr/index.vue

@@ -436,6 +436,18 @@
               </el-date-picker>
             </el-form-item>
           </el-col>
+          <el-col :span="12"  v-else>
+            <el-form-item :label="$t('负责区域')" prop="region">
+              <el-select v-model="form.region" :placeholder="$t('请选择') + $t('负责区域')">
+                <el-option
+                  v-for="dict in regionOptions"
+                  :key="dict.dictValue"
+                  :label="dict.dictLabel"
+                  :value="dict.dictValue"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
         </el-row>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -676,6 +688,8 @@
         enAbilityOptions: [],
         // 特殊职能字典
         specialDutyOptions: [],
+        //负责区域字典
+        regionOptions: [],
         //照片url
         photoUrl: '',
         //新增不可上传照片
@@ -858,6 +872,9 @@
       this.getDicts("SPECIAL_DUTY").then(response => {
         this.specialDutyOptions = response.data;
       });
+      this.getDicts("region_type").then(response => {
+        this.regionOptions = response.data;
+      });
     },
     methods: {
       /** 查询人员管理列表 */
@@ -967,7 +984,8 @@
           remarks: null,
           photo: null,
           pId: null,
-          specialDuty: null
+          specialDuty: null,
+          region:null
         };
         this.resetForm("form");
       },