Parcourir la source

Merge remote-tracking branch 'origin/master'

zouxuan il y a 4 ans
Parent
commit
000dbafddf

+ 11 - 0
cms/src/main/java/com/ym/mec/cms/controller/queryinfo/NewsInformationQueryInfo.java

@@ -27,6 +27,9 @@ public class NewsInformationQueryInfo extends QueryInfo {
 	@ApiModelProperty(value = "租客编号", required = false)
 	private Integer tenantId;
 	
+	@ApiModelProperty(value = "声部编号", required = false)
+	private Integer subjectId;
+	
 	private String clientName;
 	
 	private Date date;
@@ -94,4 +97,12 @@ public class NewsInformationQueryInfo extends QueryInfo {
 	public void setClientName(String clientName) {
 		this.clientName = clientName;
 	}
+
+	public Integer getSubjectId() {
+		return subjectId;
+	}
+
+	public void setSubjectId(Integer subjectId) {
+		this.subjectId = subjectId;
+	}
 }

+ 20 - 0
cms/src/main/java/com/ym/mec/cms/dal/entity/SysNewsInformation.java

@@ -72,6 +72,10 @@ public class SysNewsInformation {
 	private String attribute1;
 	
 	private String attribute2;
+	
+	private String subjectIdList;
+	
+	private String subjectName;
 
 	public String getLinkUrl() {
 		return linkUrl;
@@ -233,6 +237,22 @@ public class SysNewsInformation {
 		this.offlineTime = offlineTime;
 	}
 
+	public String getSubjectIdList() {
+		return subjectIdList;
+	}
+
+	public void setSubjectIdList(String subjectIdList) {
+		this.subjectIdList = subjectIdList;
+	}
+
+	public String getSubjectName() {
+		return subjectName;
+	}
+
+	public void setSubjectName(String subjectName) {
+		this.subjectName = subjectName;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 48 - 33
cms/src/main/resources/config/mybatis/SysNewsInformationMapper.xml

@@ -27,36 +27,41 @@
 		<result column="tenant_id_" property="tenantId" />
 		<result column="attribute1_" property="attribute1" />
 		<result column="attribute2_" property="attribute2" />
+		<result column="subject_id_list_" property="subjectIdList" />
+		<result column="subject_name_" property="subjectName" />
 	</resultMap>
 	
 	<sql id="queryCondition">
 		<where>
-			del_flag_=0 
+			sni.del_flag_=0 
 			<if test="type != null">
-				and type_ = #{type}
+				and sni.type_ = #{type}
 			</if>
 			<if test="subType != null">
-				and sub_type_ = #{subType}
+				and sni.sub_type_ = #{subType}
 			</if>
 			<if test="tenantId != null">
-				and tenant_id_ = #{tenantId}
+				and sni.tenant_id_ = #{tenantId}
 			</if>
 			<if test="status != null">
-				and status_ = #{status, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+				and sni.status_ = #{status, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
 			</if>
 			<if test="title != null">
-				and title_ like '%' #{title} '%'
+				and sni.title_ like '%' #{title} '%'
 			</if>
 			<if test="search != null">
-				and title_ like '%' #{search} '%'
+				and sni.title_ like '%' #{search} '%'
+			</if>
+			<if test="subjectId != null">
+				and find_in_set(#{subjectId},sni.subject_id_list_)
 			</if>
 			<if test="clientName != 'manage'">
 				<choose>
 					<when test="memo != null and memo != ''">
-						and memo_ = #{memo}
+						and sni.memo_ = #{memo}
 					</when>
 					<otherwise>
-						and (memo_ is null or memo_ = '')
+						and (sni.memo_ is null or sni.memo_ = '')
 					</otherwise>
 				</choose>
 			</if>
@@ -75,8 +80,8 @@
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.cms.dal.entity.SysNewsInformation" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO sys_news_information (id_,title_,content_,cover_image_,video_cover_image_,type_,online_time_,offline_time_,sub_type_,status_,create_time_,update_time_,link_url_,href_target_,order_,del_flag_,memo_,tenant_id_,attribute1_,attribute2_)
-		VALUES(#{id},#{title},#{content},#{coverImage},#{videoCoverImage},#{type},#{onlineTime},#{offlineTime},#{subType},#{status, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},now(),now(),#{linkUrl},#{hrefTarget},#{order},0,#{memo},#{tenantId},#{attribute1},#{attribute2})
+		INSERT INTO sys_news_information (id_,title_,content_,cover_image_,video_cover_image_,type_,online_time_,offline_time_,sub_type_,status_,create_time_,update_time_,link_url_,href_target_,order_,del_flag_,memo_,tenant_id_,attribute1_,attribute2_,subject_id_list_)
+		VALUES(#{id},#{title},#{content},#{coverImage},#{videoCoverImage},#{type},#{onlineTime},#{offlineTime},#{subType},#{status, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},now(),now(),#{linkUrl},#{hrefTarget},#{order},0,#{memo},#{tenantId},#{attribute1},#{attribute2},#{subjectIdList})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -137,6 +142,9 @@
 			<if test="attribute2 != null">
 				attribute2_ = #{attribute2},
 			</if>
+			<if test="subjectIdList != null">
+				subject_id_list_ = #{subjectIdList},
+			</if>
 		</set>
 		WHERE id_ = #{id}
 	</update>
@@ -148,15 +156,16 @@
 	
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="SysNewsInformation" parameterType="map">
-		SELECT * FROM sys_news_information
+		SELECT sni.*,GROUP_CONCAT(s.name_) subject_name_ FROM sys_news_information sni left join subject s on find_in_set(s.id_,sni.subject_id_list_)
 		<include refid="queryCondition" />
-		order by status_ desc,order_ desc,update_time_ desc
+		group by sni.id_
+		order by sni.status_ desc,sni.order_ desc,sni.update_time_ desc
 		<include refid="global.limit"/>
 	</select>
 	
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM sys_news_information
+		SELECT COUNT(sni.id_) FROM sys_news_information sni
 		<include refid="queryCondition" />
 	</select>
 	
@@ -177,69 +186,75 @@
 	<!-- 分页查询 -->
 	<select id="queryHomePage" resultMap="SysNewsInformation"
 		parameterType="map">
-		SELECT * FROM sys_news_information where del_flag_=0
+		SELECT sni.*,GROUP_CONCAT(s.name_) subject_name_ FROM sys_news_information sni where sni.del_flag_=0
 		<if test="type != null">
-			and type_ = #{type}
+			and sni.type_ = #{type}
 		</if>
 		<if test="subType != null">
-			and sub_type_ = #{subType}
+			and sni.sub_type_ = #{subType}
 		</if>
 		<if test="status != null">
-			and status_ = #{status,
+			and sni.status_ = #{status,
 			typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
 		</if>
 		<if test="title != null">
-			and title_ like '%' #{title} '%'
+			and sni.title_ like '%' #{title} '%'
 		</if>
 		<if test="search != null">
-			and title_ like '%' #{search} '%'
+			and sni.title_ like '%' #{search} '%'
 		</if>
 		<if test="tenantId != null">
-			and tenant_id_ = #{tenantId}
+			and sni.tenant_id_ = #{tenantId}
 		</if>
+			<if test="subjectId != null">
+				and find_in_set(#{subjectId},sni.subject_id_list_)
+			</if>
 		<if test="clientName != 'manage'">
 			<choose>
 				<when test="memo != null and memo != ''">
-					and memo_ = #{memo}
+					and sni.memo_ = #{memo}
 				</when>
 				<otherwise>
-					and (memo_ is null or memo_ = '')
+					and (sni.memo_ is null or sni.memo_ = '')
 				</otherwise>
 			</choose>
 		</if>
-		order by status_ desc,order_ desc,update_time_ desc
+		order by sni.status_ desc,sni.order_ desc,sni.update_time_ desc
 		<include refid="global.limit" />
 	</select>
 
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryHomeCount" resultType="int">
-		SELECT COUNT(*) FROM sys_news_information where del_flag_=0
+		SELECT COUNT(sni.id_) FROM sys_news_information sni where sni.del_flag_=0
 		<if test="type != null">
-			and type_ = #{type}
+			and sni.type_ = #{type}
 		</if>
 		<if test="subType != null">
-			and sub_type_ = #{subType}
+			and sni.sub_type_ = #{subType}
 		</if>
 		<if test="status != null">
-			and status_ = #{status,
+			and sni.status_ = #{status,
 			typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
 		</if>
 		<if test="title != null">
-			and title_ like '%' #{title} '%'
+			and sni.title_ like '%' #{title} '%'
 		</if>
 		<if test="search != null">
-			and title_ like '%' #{search} '%'
+			and sni.title_ like '%' #{search} '%'
 		</if>
 		<if test="tenantId != null">
-			and tenant_id_ = #{tenantId}
+			and sni.tenant_id_ = #{tenantId}
 		</if>
+			<if test="subjectId != null">
+				and find_in_set(#{subjectId},sni.subject_id_list_)
+			</if>
 		<if test="clientName != 'manage'">
 			<choose>
 				<when test="memo != null and memo != ''">
-					and memo_ = #{memo}
+					and sni.memo_ = #{memo}
 				</when>
 				<otherwise>
-					and (memo_ is null or memo_ = '')
+					and (sni.memo_ is null or sni.memo_ = '')
 				</otherwise>
 			</choose>
 		</if>

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/InspectionItemPlanDao.java

@@ -16,4 +16,11 @@ public interface InspectionItemPlanDao extends BaseDAO<Long, InspectionItemPlan>
      * @return
      */
     List<InspectionItemPlan> getStartPlan(@Param("planStart") Date planStart);
+
+    /**
+     * 更新推送状态
+     * @param ids
+     * @return
+     */
+    int updatePushedStatus(@Param("ids") List<Long> ids);
 }

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

@@ -101,6 +101,8 @@ public interface StudentDao extends com.ym.mec.common.dal.BaseDAO<Integer, Stude
                                                            @Param("nextMonday") String nextMonday,
                                                            @Param("studentIds") List<Integer> studentIds);
 
+    List<StudentServeCourseDto> getNoCourseBeServeStudentInfo(@Param("noCourseStudentIds") List<Integer> noCourseStudentIds);
+
     /**
      * @param monday:
      * @return java.util.List<com.ym.mec.biz.dal.dto.StudentServeDto>

+ 14 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/InspectionItemPlan.java

@@ -101,6 +101,12 @@ public class InspectionItemPlan {
     private Integer status;
 
     /**
+     * 是否已推送
+     */
+    @ApiModelProperty(value = "是否已推送 0 未推送 1 已推送")
+    private Integer isPushed;
+
+    /**
      * 创建时间
      */
     @ApiModelProperty(value = "创建时间")
@@ -313,4 +319,12 @@ public class InspectionItemPlan {
     public void setRealName(String realName) {
         this.realName = realName;
     }
+
+    public Integer getIsPushed() {
+        return isPushed;
+    }
+
+    public void setIsPushed(Integer isPushed) {
+        this.isPushed = isPushed;
+    }
 }

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/MessageTypeEnum.java

@@ -162,7 +162,8 @@ public enum MessageTypeEnum implements BaseEnum<String, MessageTypeEnum> {
     SMS_PAYMENT_CREATE("SMS_PAYMENT_CREATE","缴费项目创建提醒"),
     SMS_GOODS_REPERTORY_WARN("SMS_GOODS_REPERTORY_WARN","商品库存预警"),
     SMS_REPAIR_SEND_COMPLETED("SMS_REPAIR_SEND_COMPLETED","乐器维修完成邮寄"),
-    SMS_MUSIC_GROUP_PARENT_MEETING_NOTICE("SMS_MUSIC_GROUP_PARENT_MEETING_NOTICE","乐团家长会通知");
+    SMS_MUSIC_GROUP_PARENT_MEETING_NOTICE("SMS_MUSIC_GROUP_PARENT_MEETING_NOTICE","乐团家长会通知"),
+    SMS_INSPECTION_NOTICE("SMS_INSPECTION_NOTICE","巡查日程提醒");
 
 
 

+ 17 - 14
mec-biz/src/main/java/com/ym/mec/biz/service/impl/InspectionItemPlanServiceImpl.java

@@ -21,10 +21,7 @@ import com.ym.mec.biz.dal.entity.InspectionItemPlan;
 import com.ym.mec.biz.service.InspectionItemPlanService;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
 @Service
@@ -148,18 +145,24 @@ public class InspectionItemPlanServiceImpl extends BaseServiceImpl<Long, Inspect
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public List<InspectionItemPlan> pushNotice() {
         List<InspectionItemPlan> startPlans = inspectionItemPlanDao.getStartPlan(new Date());
-        Map<Integer, List<InspectionItemPlan>> userPlanMap = startPlans.stream().collect(Collectors.groupingBy(InspectionItemPlan::getUserId));
-        userPlanMap.forEach((userId, plans) -> {
-            //push
-//            Map<Integer, String> userMap = new HashMap<>(1);
-//            userMap.put(userId, userId.toString());
-//            sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG,
-//                    MessageTypeEnum.STUDENT_SMS_PAYMENT_SUCCESS, userMap, null, 0, "1", "STUDENT",
-//                    studentRegistration.getName(), studentPaymentOrder.getActualAmount());
-
-        });
+        Set<Integer> userIds = startPlans.stream().map(InspectionItemPlan::getUserId).collect(Collectors.toSet());
+        List<Long> ids = startPlans.stream().map(InspectionItemPlan::getId).collect(Collectors.toList());
+
+        inspectionItemPlanDao.updatePushedStatus(ids);
+
+        //发送推送信息
+        Map<Integer, String> userMap = new HashMap<>();
+        for (Integer userId : userIds) {
+            userMap.put(userId, userId.toString());
+        }
+
+        String baseApiUrl = sysConfigDao.findConfigValue(SysConfigService.EDU_TEACHER_BASE_URL);
+        String pushUrl = baseApiUrl + "/#/musicInspection";
+        sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.SMS_INSPECTION_NOTICE,
+                userMap, null, 0, "8?" + pushUrl, "EDU_TEACHER");
         return startPlans;
     }
 }

+ 42 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServeServiceImpl.java

@@ -342,6 +342,14 @@ public class StudentServeServiceImpl implements StudentServeService {
         }
         Map<Integer, List<StudentServeCourseDto>> studentCourseMap = studentFutureCourseInfo.stream().collect(Collectors.groupingBy(StudentServeCourseDto::getStudentId));
 
+        Set<Integer> haveCourseBeServeStudentIds = studentCourseMap.keySet();
+        List<Integer> allServeStudentIds = studentDao.getServeStudentIds();
+        Set<Integer> noCourseServeStudentIds = allServeStudentIds.stream().filter(id -> !haveCourseBeServeStudentIds.contains(id)).collect(Collectors.toSet());
+        List<StudentServeCourseDto> noCourseBeServeStudentInfo = new ArrayList<>();
+        if(!CollectionUtils.isEmpty(noCourseServeStudentIds)){
+            noCourseBeServeStudentInfo = studentDao.getNoCourseBeServeStudentInfo(new ArrayList<>(noCourseServeStudentIds));
+        }
+
         List<StudentExtracurricularExercisesSituation> results=new ArrayList<>();
 
         for (Map.Entry<Integer, List<StudentServeCourseDto>> studentCourseMapEntry : studentCourseMap.entrySet()) {
@@ -496,6 +504,40 @@ public class StudentServeServiceImpl implements StudentServeService {
             }
         }
 
+        Map<Integer, Set<String>> noCourseStudentMusicIdsMap = noCourseBeServeStudentInfo.stream().collect(Collectors.groupingBy(StudentServeCourseDto::getStudentId, Collectors.mapping(StudentServeCourseDto::getMusicGroupId, Collectors.toSet())));
+        Map<Integer, List<StudentServeCourseDto>> noCourseStudentCourseMap = noCourseBeServeStudentInfo.stream().collect(Collectors.groupingBy(StudentServeCourseDto::getStudentId));
+        for (Map.Entry<Integer, Set<String>> noCourseStudentMusicIdsMapEntry : noCourseStudentMusicIdsMap.entrySet()) {
+            Map<Integer, Integer> teacherNumMap = new HashMap<>();
+            for (String groupId : noCourseStudentMusicIdsMapEntry.getValue()) {
+                Integer teacherId = null;
+                List<BaseMapDto<Integer, Integer>> studentTeacherIdList = courseScheduleStudentPaymentDao.getStudentClassGroupBishopTeacherMap(null, groupId);
+                if(!CollectionUtils.isEmpty(studentTeacherIdList)){
+                    teacherId = studentTeacherIdList.get(0).getValue();
+                }
+                teacherId = Objects.isNull(teacherId)?noCourseStudentCourseMap.get(noCourseStudentMusicIdsMapEntry.getKey()).get(0).getLeadTeacherId():teacherId;
+                if(Objects.isNull(teacherId)){
+                    continue;
+                }
+
+                if(!teacherNumMap.containsKey(teacherId)){
+                    teacherNumMap.put(teacherId, 1);
+                }else{
+                    teacherNumMap.put(teacherId, teacherNumMap.get(teacherId)+1);
+                }
+
+            }
+
+            for (Map.Entry<Integer, Integer> teacherNumMapEntry : teacherNumMap.entrySet()) {
+                StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(noCourseStudentMusicIdsMapEntry.getKey(),
+                        teacherNumMapEntry.getKey(),
+                        nowDate.get(DateUtil.weekFields.weekOfYear()),
+                        DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"), DateUtil.stringToDate(sunDayDate.toString(), "yyyy-MM-dd"),
+                        "EXERCISE", null);
+                studentExtracurricularExercisesSituation.setExpectExercisesNum(teacherNumMapEntry.getValue());
+                results.add(studentExtracurricularExercisesSituation);
+            }
+        }
+
         if(!CollectionUtils.isEmpty(results)){
 
             if(CollectionUtils.isEmpty(studentIds)){

+ 16 - 4
mec-biz/src/main/resources/config/mybatis/InspectionItemPlanMapper.xml

@@ -32,7 +32,7 @@
         music_group_id_, school_gps_, submited_gps_, submited_time_, memo_, conclusion_status_, status_, create_time_,
         update_time_
     </sql>
-    <select id="get" parameterType="java.lang.Long" resultMap="InspectionItemPlan" >
+    <select id="get" parameterType="java.lang.Long" resultMap="InspectionItemPlan">
         <!--@mbg.generated-->
         select
         <include refid="Base_Column_List"/>
@@ -113,7 +113,8 @@
 
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="InspectionItemPlan" parameterType="map">
-        SELECT iip.*,su.real_name_ realName,o.name_ organName,co.name_ cooperationName,mg.name_ musicGroupName FROM inspection_item_plan iip
+        SELECT iip.*,su.real_name_ realName,o.name_ organName,co.name_ cooperationName,mg.name_ musicGroupName FROM
+        inspection_item_plan iip
         LEFT JOIN sys_user su ON su.id_ = iip.user_id_
         LEFT JOIN organization o ON o.id_=iip.organ_id_
         LEFT JOIN cooperation_organ co ON co.id_=iip.cooperation_organ_id_
@@ -172,6 +173,17 @@
     </sql>
 
     <select id="getStartPlan" resultMap="InspectionItemPlan">
-        SELECT * FROM inspection_item WHERE plan_start_ >= #{planStart}
-    </select>
+        <![CDATA[
+        SELECT *
+        FROM inspection_item_plan
+        WHERE plan_start_ <= #{planStart}
+          AND is_pushed_ = 0
+        ]]></select>
+
+    <update id="updatePushedStatus">
+        UPDATE inspection_item_plan SET is_pushed_ = 1 WHERE id_ IN
+        <foreach collection="ids" item="id" open="(" close=")" separator=",">
+            #{id}
+        </foreach>
+    </update>
 </mapper>

+ 23 - 0
mec-biz/src/main/resources/config/mybatis/StudentMapper.xml

@@ -515,6 +515,29 @@
         ORDER BY cssp.user_id_,course_start_time_
     </select>
 
+    <select id="getNoCourseBeServeStudentInfo" resultMap="StudentServeCourseDto">
+        SELECT
+            sr.user_id_ student_id_,
+            stu.teacher_id_ lead_teacher_id_,
+            'MUSIC' group_type_,
+            sr.music_group_id_
+        FROM
+            student_registration sr
+            LEFT JOIN student stu ON sr.user_id_ = stu.user_id_
+            LEFT JOIN music_group mg ON sr.music_group_id_ = mg.id_
+        WHERE
+            mg.del_flag_ = 0
+            AND mg.organ_id_ IS NOT NULL
+            AND mg.status_ = 'PROGRESS'
+            AND sr.music_group_status_ = 'NORMAL'
+            <if test="noCourseStudentIds!=null and noCourseStudentIds.size()>0">
+                AND sr.user_id_ IN
+                <foreach collection="noCourseStudentIds" item="noCourseStudentId" open="(" close=")" separator=",">
+                    #{noCourseStudentId}
+                </foreach>
+            </if>
+    </select>
+
     <select id="getStudentNames" resultType="string">
         SELECT username_ FROM sys_user WHERE id_ IN
         <foreach collection="studentIds" item="studentId" separator="," open="(" close=")">

+ 4 - 0
mec-client-api/src/main/java/com/ym/mec/task/TaskRemoteService.java

@@ -149,4 +149,8 @@ public interface TaskRemoteService {
 	//首页数据统计
 	@GetMapping("task/countIndexBaseData")
 	void countIndexBaseData();
+
+	//巡查日程提醒
+	@GetMapping("task/inspectionPlan")
+	void inspectionPlan();
 }

+ 5 - 0
mec-client-api/src/main/java/com/ym/mec/task/fallback/TaskRemoteServiceFallback.java

@@ -190,4 +190,9 @@ public class TaskRemoteServiceFallback implements TaskRemoteService {
 	public void countIndexBaseData() {
 		logger.info("首页数据统计失败");
 	}
+
+	@Override
+	public void inspectionPlan() {
+		logger.info("巡查日程提醒提送失败");
+	}
 }

+ 19 - 0
mec-task/src/main/java/com/ym/mec/task/jobs/InspectionPlanTask.java

@@ -0,0 +1,19 @@
+package com.ym.mec.task.jobs;
+
+import com.ym.mec.task.TaskRemoteService;
+import com.ym.mec.task.core.BaseTask;
+import com.ym.mec.task.core.TaskException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class InspectionPlanTask extends BaseTask {
+
+	@Autowired
+	private TaskRemoteService taskRemoteService;
+
+	@Override
+	public void execute() throws TaskException {
+		taskRemoteService.inspectionPlan();
+	}
+}

+ 5 - 0
mec-web/src/main/java/com/ym/mec/web/controller/InspectionItemController.java

@@ -2,6 +2,7 @@ package com.ym.mec.web.controller;
 
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.auth.api.entity.SysUserRole;
 import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.InspectionItem;
@@ -67,6 +68,10 @@ public class InspectionItemController extends BaseController {
                 }
             }
         }
+        List<Integer> userRole = employeeDao.queryUserRole(sysUser.getId());
+        if (!userRole.contains(SysUserRole.SECTION_MANAGER) && !sysUser.getIsSuperAdmin()) {
+            queryInfo.setUserId(sysUser.getId());
+        }
         return succeed(inspectionItemService.getPageList(queryInfo));
     }
 }

+ 2 - 1
mec-web/src/main/java/com/ym/mec/web/controller/InspectionItemPlanConclusionController.java

@@ -63,13 +63,14 @@ public class InspectionItemPlanConclusionController extends BaseController {
             conclusions.get(0).forEach((key, vak) -> {
                 bodyList.add(key);
             });
+
             String[] body = bodyList.toArray(new String[bodyList.size()]);
 
             String[] header = {"老师", "老师是否提前准备板书(本课内容、作业)", "老师是否佩戴工牌", "老师是否仪容仪表整洁", "老师是否携带乐器", "老师是否携带教学资料、设备", "老师是否合理安排学员座位", "乐器箱包、书包是否摆放整齐", "课堂纪律是否保持良好", "老师是否全程站立教学", "老师是否全程使用节拍器或教学音频", "是否发现学员需要更换新乐器", "老师是否将上课照片/视频发送到声部群", "老师是否保持教室环境卫生", "老师是否关好所有电源、门窗", "老师是否有序组织学员放学"};
             HSSFWorkbook workbook = POIUtil.exportExcel(header, body, conclusions);
 
             response.setContentType("application/octet-stream");
-            response.setHeader("Content-Disposition", "attachment;filename=cooperationOrgan-" + DateUtil.getDate(new Date()) + ".xls");
+            response.setHeader("Content-Disposition", "attachment;filename=inspectionItemPlanConclusion-" + DateUtil.getDate(new Date()) + ".xls");
             response.flushBuffer();
             outputStream = response.getOutputStream();
             workbook.write(outputStream);

+ 8 - 0
mec-web/src/main/java/com/ym/mec/web/controller/TaskController.java

@@ -91,6 +91,9 @@ public class TaskController extends BaseController {
 	@Autowired
 	private IndexBaseMonthDataService indexBaseMonthDataService;
 
+	@Autowired
+	private InspectionItemPlanService inspectionItemPlanService;
+
 	@GetMapping(value = "/autoAffirmReceiveTask")
 	// 自动确认收货
 	public void affirmReceive(){
@@ -325,4 +328,9 @@ public class TaskController extends BaseController {
 	public void countIndexBaseData(String month){
 		indexBaseMonthDataService.indexBaseDataTask(month);
 	}
+
+	@GetMapping("/inspectionPlan")
+	public void inspectionPlan(){
+		inspectionItemPlanService.pushNotice();
+	}
 }