Pārlūkot izejas kodu

考情监考-大屏报表修改

wangliang 2 gadi atpakaļ
vecāks
revīzija
baedb4f239

+ 8 - 2
themis-admin/src/main/java/com/qmth/themis/admin/api/TBUserController.java

@@ -569,7 +569,7 @@ public class TBUserController {
                         @ApiParam(value = "姓名", required = false) @RequestParam(required = false) String name,
                         @ApiParam(value = "角色", required = false) @RequestParam(required = false) String roleCode,
                         @ApiParam(value = "是否启用", required = false) @RequestParam(required = false) Integer enable,
-                        @ApiParam(value = "机构名称", required = false) @RequestParam(required = false) String orgName,
+                        @ApiParam(value = "机构id", required = false) @RequestParam(required = false) String orgId,
                         @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) int pageNumber,
                         @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) int pageSize) {
         TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
@@ -577,7 +577,13 @@ public class TBUserController {
         if (authDto.getRoleCodes().toString().contains(RoleEnum.SUPER_ADMIN.name())) {
             roleCode = Objects.isNull(roleCode) ? RoleEnum.ADMIN.name() : roleCode;
         }
-        IPage<TBUserDto> tbUserIPage = tbUserService.userQuery(new Page<>(pageNumber, pageSize), id, loginName, name, roleCode, enable, tbUser.getOrgId(), orgName);
+        Long orgIdNew = null;
+        if (Objects.isNull(orgId)) {
+            orgIdNew = tbUser.getOrgId();
+        } else {
+            orgIdNew = Long.parseLong(orgId);
+        }
+        IPage<TBUserDto> tbUserIPage = tbUserService.userQuery(new Page<>(pageNumber, pageSize), id, loginName, name, roleCode, enable, orgIdNew);
         tbUserIPage.getRecords().forEach(s -> {
             if (Objects.nonNull(s.getRoleNameStr())) {
                 s.setRoleName(Arrays.asList(s.getRoleNameStr().split(",")));

+ 1 - 2
themis-business/src/main/java/com/qmth/themis/business/dao/TBUserMapper.java

@@ -29,8 +29,7 @@ public interface TBUserMapper extends CustomBaseMapper<TBUser> {
      * @param role
      * @param enable
      * @param orgId
-     * @param orgName
      * @return
      */
-    IPage<TBUserDto> userQuery(IPage<Map> iPage, @Param("id") Long id, @Param("loginName") String loginName, @Param("name") String name, @Param("role") String role, @Param("enable") Integer enable, @Param("orgId") Long orgId, @Param("orgName") String orgName);
+    IPage<TBUserDto> userQuery(IPage<Map> iPage, @Param("id") Long id, @Param("loginName") String loginName, @Param("name") String name, @Param("role") String role, @Param("enable") Integer enable, @Param("orgId") Long orgId);
 }

+ 1 - 2
themis-business/src/main/java/com/qmth/themis/business/service/TBUserService.java

@@ -26,8 +26,7 @@ public interface TBUserService extends IService<TBUser> {
      * @param role
      * @param enable
      * @param orgId
-     * @param orgName
      * @return
      */
-    IPage<TBUserDto> userQuery(IPage<Map> iPage, Long id, String loginName, String name, String role, Integer enable, Long orgId, String orgName);
+    IPage<TBUserDto> userQuery(IPage<Map> iPage, Long id, String loginName, String name, String role, Integer enable, Long orgId);
 }

+ 2 - 3
themis-business/src/main/java/com/qmth/themis/business/service/impl/TBUserServiceImpl.java

@@ -34,11 +34,10 @@ public class TBUserServiceImpl extends ServiceImpl<TBUserMapper, TBUser> impleme
      * @param role
      * @param enable
      * @param orgId
-     * @param orgName
      * @return
      */
     @Override
-    public IPage<TBUserDto> userQuery(IPage<Map> iPage, Long id, String loginName, String name, String role, Integer enable, Long orgId, String orgName) {
-        return tbUserMapper.userQuery(iPage, id, loginName, name, role, enable, orgId, orgName);
+    public IPage<TBUserDto> userQuery(IPage<Map> iPage, Long id, String loginName, String name, String role, Integer enable, Long orgId) {
+        return tbUserMapper.userQuery(iPage, id, loginName, name, role, enable, orgId);
     }
 }

+ 7 - 7
themis-business/src/main/java/com/qmth/themis/business/service/impl/TIeReportServiceImpl.java

@@ -404,15 +404,15 @@ public class TIeReportServiceImpl implements TIeReportService {
         List<TimeOnlineDataResult> timeOnlineDataResultList = tOeExamRecordMapper.getTimeOnlineData(tbUser.getOrgId(), timeData, currentDate, interval, scaleSize);
         if (!CollectionUtils.isEmpty(timeOnlineDataResultList) && !CollectionUtils.isEmpty(timeScaleDataResultList)
                 && timeOnlineDataResultList.size() == timeScaleDataResultList.size()) {
-            int beforeOnlineCount = 0;
-            TimeScaleDataResult beforeScale = null;
+//            int beforeOnlineCount = 0;
+//            TimeScaleDataResult beforeScale = null;
             for (int i = 0; i < timeOnlineDataResultList.size(); i++) {
                 TimeOnlineDataResult t = timeOnlineDataResultList.get(i);
-                if (i > 0) {
-                    beforeScale = timeScaleDataResultList.get(i - 1);
-                    beforeOnlineCount = beforeScale.getOnlineCount();
-                }
-                int onlineCount = t.getOnlineCount() + beforeOnlineCount - t.getOfflineCount();
+//                if (i > 0) {
+//                    beforeScale = timeScaleDataResultList.get(i - 1);
+//                    beforeOnlineCount = beforeScale.getOnlineCount();
+//                }
+                int onlineCount = t.getOnlineCount() - t.getOfflineCount();
                 onlineCount = onlineCount < 0 ? 0 : onlineCount;
                 timeScaleDataResultList.get(i).setOnlineCount(onlineCount);
             }

+ 0 - 3
themis-business/src/main/resources/mapper/TBUserMapper.xml

@@ -54,9 +54,6 @@
                 <if test="orgId != null and orgId != ''">
                     and tbu.org_id = #{orgId}
                 </if>
-                <if test="orgName != null and orgName != ''">
-                    and tbo.name like concat('%', #{orgName}, '%')
-                </if>
             </where> group by tbu.org_id,tbu.id,tbu.mobile_number,tbu.login_name,tbu.name,tbu.enable) t
             <where>
                 t.roleCodeStr <![CDATA[ <> ]]> 'SUPER_ADMIN'

+ 2 - 2
themis-business/src/main/resources/mapper/TIeInvigilateWarnInfoMapper.xml

@@ -87,9 +87,9 @@
         <if test="orgId != null">
             and h.org_id=#{orgId}
         </if>
-        limit #{conut}
+        order by t.create_time desc limit #{conut}
         ) tem
-        LEFT JOIN t_e_exam_student f ON tem.examStudentId = f.id order by tem.createTime desc
+        LEFT JOIN t_e_exam_student f ON tem.examStudentId = f.id
     </select>
 
     <select id="findWarnAndExceptionInfo" resultType="java.lang.Integer">

+ 8 - 13
themis-business/src/main/resources/mapper/TOeExamRecordMapper.xml

@@ -1042,7 +1042,7 @@
     <select id="getWarnDistribution"
             resultType="com.qmth.themis.business.bean.admin.ExaminationMonitorWarnDistributionBean">
         select
-        tiiwi.info as type,
+        if(tiiwi.info is not null,substring_index(substring_index(tiiwi.info,'】',1),'【',-1),null) as type,
         count(tiiwi.exam_record_id) as warnCount
         from
         t_ie_invigilate_warn_info tiiwi
@@ -1077,6 +1077,7 @@
         </if>
         and (toer.STATUS = 'FIRST_PREPARE' or toer.STATUS = 'ANSWERING'
         or toer.STATUS = 'BREAK_OFF' or toer.STATUS = 'RESUME_PREPARE')
+        and tir.country != '0' and tir.province != '0'
         group by
         tir.country,
         tir.province;
@@ -1110,6 +1111,7 @@
         or toer.STATUS = 'ANSWERING'
         or toer.STATUS = 'BREAK_OFF'
         or toer.STATUS = 'RESUME_PREPARE')
+        and tir.country != '0' and tir.province != '0'
         group by
         tir.country,
         tir.province
@@ -1135,6 +1137,7 @@
         or toer.STATUS = 'ANSWERING'
         or toer.STATUS = 'BREAK_OFF'
         or toer.STATUS = 'RESUME_PREPARE')
+        and tir.country != '0' and tir.province != '0'
         group by
         tir.country,
         tir.province) t
@@ -1645,13 +1648,9 @@
         <if test="orgId != null and orgId != ''">
             and tee.org_id = #{orgId}
         </if>
-        and (teesol.create_time <![CDATA[ >= ]]> unix_timestamp(date_sub(#{currentDate}, interval #{scaleSize} minute))
-        * 1000
+        and (teesol.create_time >= unix_timestamp(date_sub(#{currentDate}, interval #{interval} day)) * 1000
         and teesol.create_time <![CDATA[ <= ]]> unix_timestamp(#{currentDate}) * 1000)
-        and teesol.`type` = 'ON_LINE') t
-        where
-        (t.createTime <![CDATA[ >= ]]> #{item} and t.createTime <![CDATA[ < ]]> date_add(#{item}, interval #{interval}
-        minute))
+        and teesol.`type` = 'ON_LINE') t where t.createTime <![CDATA[ <= ]]> #{item}
         union all
         select
         t.hour,
@@ -1673,12 +1672,8 @@
         <if test="orgId != null and orgId != ''">
             and tee.org_id = #{orgId}
         </if>
-        and (teesol.create_time <![CDATA[ >= ]]> unix_timestamp(date_sub(#{currentDate}, interval #{scaleSize} minute))
-        * 1000
+        and (teesol.create_time >= unix_timestamp(date_sub(#{currentDate}, interval #{interval} day)) * 1000
         and teesol.create_time <![CDATA[ <= ]]> unix_timestamp(#{currentDate}) * 1000)
-        and teesol.`type` = 'OFF_LINE') t
-        where
-        (t.createTime <![CDATA[ >= ]]> #{item} and t.createTime <![CDATA[ < ]]> date_add(#{item}, interval #{interval}
-        minute))
+        and teesol.`type` = 'OFF_LINE') t where t.createTime <![CDATA[ <= ]]> #{item}
     </sql>
 </mapper>