Browse Source

Merge remote-tracking branch 'origin/feature/0427-school' into feature/0427-school

zouxuan 2 years ago
parent
commit
92c28a0eef

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/IndexBaseMonthDataDao.java

@@ -449,4 +449,6 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
     List<DecimalMapDto> indexCoop(@Param("organIds") List<Integer> organIds, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
     List<DecimalMapDto> indexImportCoop(@Param("organIds") List<Integer> organIds, @Param("startTime") String startTime, @Param("endTime") String endTime);
+
+    IndexErrInfoDto getSchoolPatrolError(@Param("organIdList") Set<Integer> organIdList, @Param("tenantId") Integer tenantId);
 }

+ 8 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexBaseMonthDataServiceImpl.java

@@ -776,7 +776,14 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 				noClassMusicGroupStudentInfo.setDesc(IndexErrorType.NO_CLASS_MUSIC_GROUP_STUDENT_ERROR.getMsg());
 				oneChild.add(noClassMusicGroupStudentInfo);
 			});
-			future1.join();future2.join();future3.join();
+            //学校巡堂
+            CompletableFuture future4 = this.async(()-> {
+                IndexErrInfoDto schoolPatrolError = indexBaseMonthDataDao.getSchoolPatrolError(organIdList,tenantId);
+                schoolPatrolError.setErrorType(IndexErrorType.SCHOOL_PATROL);
+                schoolPatrolError.setDesc(IndexErrorType.SCHOOL_PATROL.getMsg());
+                oneChild.add(schoolPatrolError);
+            });
+			future1.join();future2.join();future3.join();future4.join();
 			one.setNum(oneChild.stream().mapToInt(IndexErrInfoDto::getNum).sum());
 			one.setResult(oneChild);
 			all.add(one);

+ 8 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysNewsInformationServiceImpl.java

@@ -3,9 +3,12 @@ package com.ym.mec.biz.service.impl;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.google.gson.JsonObject;
+import com.ym.mec.biz.dal.dao.ClassGroupDao;
 import com.ym.mec.biz.dal.dao.MusicGroupDao;
 import com.ym.mec.biz.dal.dao.MusicGroupQuitDao;
 import com.ym.mec.biz.dal.dao.SysNewsInformationDao;
+import com.ym.mec.biz.dal.entity.ClassGroup;
+import com.ym.mec.biz.dal.entity.ClassGroupDto;
 import com.ym.mec.biz.dal.entity.SysNewsInformation;
 import com.ym.mec.biz.dal.school.dto.NewsInformationDto;
 import com.ym.mec.biz.service.SysNewsInformationService;
@@ -15,6 +18,7 @@ import org.apache.commons.beanutils.BeanUtils;
 import org.apache.commons.collections.CollectionUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -45,6 +49,9 @@ public class SysNewsInformationServiceImpl extends ServiceImpl<SysNewsInformatio
     @Resource
     private MusicGroupDao musicGroupDao;
 
+    @Autowired
+    private ClassGroupDao classGroupDao;
+
     @Override
     public List<NewsInformationDto> queryPage(Integer type,Integer coopId) throws Exception {
         List<SysNewsInformation> dtos = this.lambdaQuery()
@@ -66,7 +73,7 @@ public class SysNewsInformationServiceImpl extends ServiceImpl<SysNewsInformatio
                                 informationDto.setRedPointFlag(musicGroupQuitDao.countRedPointBySchool(musicGroupIds));
                                 break;
                             case SITE_MANAGE:
-                                //todo 场地管理
+                                informationDto.setRedPointFlag(classGroupDao.teachingPointRemind(coopId)>0);
                                 break;
                         }
                     }

+ 18 - 0
mec-biz/src/main/resources/config/mybatis/IndexBaseMonthDataMapper.xml

@@ -2213,4 +2213,22 @@
 		</if>
 		group by co.id_
 	</select>
+
+	<select id="getSchoolPatrolError" resultType="com.ym.mec.biz.dal.entity.IndexErrInfoDto">
+        select count(cpe.id_) as num
+        from course_patrol_evaluation cpe
+        left join cooperation_organ co on co.id_ = cpe.cooperation_organ_id_
+        <where>
+            cpe.handle_status_ = false and cpe.evaluate_status_ = 'UNQUALIFIED'
+            <if test="organIdList != null and organIdList.size() != 0">
+                and co.organ_id_ in
+                <foreach collection="organIdList" open="(" close=")" item="item" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="tenantId != null">
+                and co.tenant_id_ = #{tenantId}
+            </if>
+        </where>
+    </select>
 </mapper>

+ 2 - 2
mec-biz/src/main/resources/config/mybatis/SchoolStaffMapper.xml

@@ -31,7 +31,7 @@
             </if>
             <if test="param.keyword != null and param.keyword != ''">
                 and (t2.id_ like concat('%', #{param.keyword}, '%')
-                    or t2.real_name_ like concat('%', #{param.keyword}, '%')
+                    or t2.username_ like concat('%', #{param.keyword}, '%')
                     or t2.phone_ like concat('%', #{param.keyword}, '%')
                     )
             </if>
@@ -39,7 +39,7 @@
                 and t1.tenant_id_ = #{param.tenantId}
             </if>
             <if test="param.organId != null and param.organId != ''">
-                and find_in_set(#{param.organId}, t1.organ_id_list_)
+                and find_in_set(t1.organ_id_list_,#{param.organId})
             </if>
             <if test="param.coopStatus != null">
                 and co.is_enable_ = #{param.coopStatus}

+ 1 - 1
mec-common/common-core/src/main/java/com/ym/mec/common/exception/BizException.java

@@ -4,7 +4,7 @@ import com.ym.mec.util.string.MessageFormatter;
 
 public class BizException extends RuntimeException {
 
-	private int code = 200;
+	private int code = 500;
 	/**
 	 * 
 	 */

+ 10 - 0
mec-web/src/main/java/com/ym/mec/web/controller/SchoolMessageController.java

@@ -60,6 +60,16 @@ public class SchoolMessageController extends BaseController {
                 "{\"value\":\"系统消息\",\"key\":\"SYSTEM\"},"));
     }
 
+    @ApiOperation("一键已读")
+    @PostMapping("batchSetRead")
+    public Object batchSetRead() {
+        int status = 1;
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed(HttpStatus.FORBIDDEN, "请登录");
+        }
+        return sysMessageService.updateStatus(sysUser.getId(), status,"SCHOOL") > 0 ? succeed() : failed();
+    }
     @ApiOperation("设置已读")
     @PostMapping("setRead")
     public Object setRead(Long id) {