瀏覽代碼

列表修改

anderx 2 年之前
父節點
當前提交
1e859a52f2

+ 3 - 3
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java

@@ -52,16 +52,16 @@ public class SysDept extends BaseEntity
     /** 父部门名称 */
     private String parentName;
     /** 最大时长 */
-    private Integer maxDuration;
+    private Double maxDuration;
 
     /** 子部门 */
     private List<SysDept> children = new ArrayList<SysDept>();
 
-    public Integer getMaxDuration() {
+    public Double getMaxDuration() {
         return maxDuration;
     }
 
-    public void setMaxDuration(Integer maxDuration) {
+    public void setMaxDuration(Double maxDuration) {
         this.maxDuration = maxDuration;
     }
 

+ 3 - 1
ruoyi-system/src/main/java/com/ruoyi/project/service/impl/ProjectStaffRecordServiceImpl.java

@@ -55,10 +55,12 @@ public class ProjectStaffRecordServiceImpl implements ProjectStaffRecordService
     @Override
     public AjaxResult add(ProjectStaffRecord in) {
         Long userId = SecurityUtils.getUserId();
-        String username = SecurityUtils.getLoginUser().getUser().getNickName();
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+        String username = user.getNickName();
         in.setAid(userId);
         in.setName(username);
         if(in.getProcessStatus()>1)in.setProcessStatus(1);
+        Double maxDuration= user.getDept().getMaxDuration();
         boolean flag=false;
         if (SecurityUtils.hashRoles(UserRolesType.INSPECTORS.getCode())){
             in.setProcessStatus(2);

+ 2 - 1
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -42,6 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<result property="leader"    column="leader"      />
 		<result property="ancestors"    column="ancestors"      />
         <result property="status"    column="dept_status" />
+        <result property="maxDuration"    column="max_duration" />
     </resultMap>
 
     <resultMap id="RoleResult" type="SysRole">
@@ -55,7 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 	<sql id="selectUserVo">
         select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
-        d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,d.ancestors,
+        d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,d.ancestors,d.max_duration,
         r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
         from sys_user u
 		    left join sys_dept d on u.dept_id = d.dept_id