he2802 3 年 前
コミット
76c5635d39

+ 4 - 0
zhongzheng-common/src/main/java/com/zhongzheng/common/core/domain/entity/SysUser.java

@@ -153,6 +153,10 @@ public class SysUser implements Serializable
     @TableField(exist = false)
     private Long[] postIds;
 
+    /** 角色名称 */
+    @TableField(exist = false)
+    private String roleName;
+
     public SysUser(Long userId)
     {
         this.userId = userId;

+ 33 - 0
zhongzheng-common/src/main/java/com/zhongzheng/common/utils/DateUtils.java

@@ -202,4 +202,37 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
         return localDate+randomNumeric;
     }
 
+    public static String secToTime(int time) {
+        String timeStr = null;
+        int hour = 0;
+        int minute = 0;
+        int second = 0;
+        if (time <= 0)
+            return "00:00";
+        else {
+            minute = time / 60;
+            if (minute < 60) {
+                second = time % 60;
+                timeStr = unitFormat(minute) + ":" + unitFormat(second);
+            } else {
+                hour = minute / 60;
+                if (hour > 99)
+                    return "99:59:59";
+                minute = minute % 60;
+                second = time - hour * 3600 - minute * 60;
+                timeStr = unitFormat(hour) + ":" + unitFormat(minute) + ":" + unitFormat(second);
+            }
+        }
+        return timeStr;
+    }
+
+    public static String unitFormat(int i) {
+        String retStr = null;
+        if (i >= 0 && i < 10)
+            retStr = "0" + Integer.toString(i);
+        else
+            retStr = "" + i;
+        return retStr;
+    }
+
 }

+ 2 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java

@@ -583,7 +583,8 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                 userPeriodExportVo.setStudyStatusTxt("未做题");
             }
         }else {
-            userPeriodExportVo.setStudyTimeLongTxt((classPeriodSectionVo.getStudyEndTime().longValue()-classPeriodSectionVo.getStudyStartTime().longValue())+"秒");
+            long second = classPeriodSectionVo.getStudyEndTime().longValue()-classPeriodSectionVo.getStudyStartTime().longValue();
+            userPeriodExportVo.setStudyTimeLongTxt(DateUtils.secToTime((int)second));
             if(!isExam){
                 userPeriodExportVo.setStudyStatusTxt("完成");
             }else{

+ 7 - 0
zhongzheng-system/src/main/resources/mapper/modules/system/SysUserMapper.xml

@@ -97,7 +97,14 @@
         u.code from
         sys_user u
         left join sys_dept d on u.dept_id = d.dept_id
+        <if test="roleName != null and roleName != ''">
+            left join sys_user_role ur on ur.user_id = u.user_id
+            left join sys_role r on ur.role_id = r.role_id
+        </if>
         where u.del_flag = '0'
+        <if test="roleName != null and roleName != ''">
+            AND r.role_name = #{roleName}
+        </if>
         <if test="userName != null and userName != ''">
             AND u.user_name like concat('%', #{userName}, '%')
         </if>