Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/master'

Joburgess 4 anni fa
parent
commit
57119e31f6

+ 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>

+ 4 - 10
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/InspectionItemPlanDao.java

@@ -10,17 +10,11 @@ import java.util.List;
 public interface InspectionItemPlanDao extends BaseDAO<Long, InspectionItemPlan> {
 
     /**
-     * 获取开始的巡查日程
+     * 获取当天的巡查计划
      *
-     * @param planStart
+     * @param startTime
+     * @param endTime
      * @return
      */
-    List<InspectionItemPlan> getStartPlan(@Param("planStart") Date planStart);
-
-    /**
-     * 更新推送状态
-     * @param ids
-     * @return
-     */
-    int updatePushedStatus(@Param("ids") List<Long> ids);
+    List<InspectionItemPlan> getStartPlan(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
 }

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupDao.java

@@ -328,6 +328,7 @@ public interface MusicGroupDao extends BaseDAO<String, MusicGroup> {
 
     /**
      * 根据分部和教务老师查询乐团列表
+     *
      * @param educationId
      * @param organIds
      * @return
@@ -336,8 +337,17 @@ public interface MusicGroupDao extends BaseDAO<String, MusicGroup> {
 
     /**
      * 获取乐团的教学点
+     *
      * @param id
      * @return
      */
     School getMusicGroupSchool(@Param("id") String id);
+
+    /**
+     * 获取乐团主管进行中的乐团
+     *
+     * @param eduTeacherId
+     * @return
+     */
+    List<MusicGroup> getByEduTeacher(@Param("organId") Integer organId, @Param("eduTeacherId") Integer eduTeacherId, @Param("search") String search);
 }

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

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

+ 0 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/impl/FinancialExpenditureServiceImpl.java

@@ -64,11 +64,6 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
 			if(collect == null || collect.size() == 0){
 				continue;
 			}
-			List<String> list = financialExpenditureDao.countBydingTalk(collect);
-			if(list != null && list.size() > 0){
-				throw new BizException("导入数据错误  重复的钉钉流程编号:{}",list.get(0));
-			}
-
 			valueIsNull: for (int j = 0; j < sheet.size(); j++) {
 				int rowNum = j + 2;
 				Map<String, Object> row = sheet.get(j);

+ 6 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/InspectionItemPlanServiceImpl.java

@@ -92,6 +92,7 @@ public class InspectionItemPlanServiceImpl extends BaseServiceImpl<Long, Inspect
         School school = musicGroupDao.getMusicGroupSchool(inspectionItemPlan.getMusicGroupId());
 
         inspectionItemPlan.setOrganId(inspectionItem.getOrganId());
+        inspectionItemPlan.setCooperationOrganId(school.getCooperationOrganId());
         inspectionItemPlan.setInspectionId(inspectionItem.getInspectionId());
         inspectionItemPlan.setSchoolGps(school.getLongitudeLatitude());
         inspectionItemPlan.setSubmitedGps("");
@@ -134,6 +135,7 @@ public class InspectionItemPlanServiceImpl extends BaseServiceImpl<Long, Inspect
         if (oldPlan.getStatus().equals(0)) { //未提交的修改
             School school = musicGroupDao.getMusicGroupSchool(inspectionItemPlan.getMusicGroupId());
             inspectionItemPlan.setInspectionId(inspectionItem.getInspectionId());
+            inspectionItemPlan.setCooperationOrganId(school.getCooperationOrganId());
             inspectionItemPlan.setSchoolGps(school.getLongitudeLatitude());
             inspectionItemPlan.setSubmitedGps("");
             inspectionItemPlan.setMemo("");
@@ -147,12 +149,13 @@ public class InspectionItemPlanServiceImpl extends BaseServiceImpl<Long, Inspect
     @Override
     @Transactional(rollbackFor = Exception.class)
     public List<InspectionItemPlan> pushNotice() {
-        List<InspectionItemPlan> startPlans = inspectionItemPlanDao.getStartPlan(new Date());
+        Date nowDate = new Date();
+        Date startTime = DateUtil.getFirstDayOfMonth(nowDate);
+        Date endTime = DateUtil.getLastTimeWithDay(DateUtil.getLastDayOfMonth(nowDate));
+        List<InspectionItemPlan> startPlans = inspectionItemPlanDao.getStartPlan(startTime,endTime);
         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) {

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

@@ -176,14 +176,7 @@
         <![CDATA[
         SELECT *
         FROM inspection_item_plan
-        WHERE plan_start_ <= #{planStart}
-          AND is_pushed_ = 0
+        WHERE plan_start_ >= #{startTime}
+        AND plan_start_ <= #{endTime}
         ]]></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>

+ 7 - 0
mec-biz/src/main/resources/config/mybatis/MusicGroupMapper.xml

@@ -646,4 +646,11 @@
         LEFT JOIN school s ON s.id_=mg.school_id_
         WHERE mg.id_ = #{id}
     </select>
+    <select id="getByEduTeacher" resultMap="MusicGroup">
+        SELECT * FROM music_group WHERE organ_id_ = #{organId}
+        AND educational_teacher_id_ = #{eduTeacherId} AND status_ = 'PROGRESS'
+        <if test="search != null">
+            AND name_ LIKE CONCAT('%',#{search},'%')
+        </if>
+    </select>
 </mapper>

+ 12 - 5
mec-biz/src/main/resources/config/mybatis/MusicGroupQuitMapper.xml

@@ -13,8 +13,13 @@
         <result column="create_time_" property="createTime"/>
         <result column="reason_" property="reason"/>
         <result column="user_comment_" property="userComment"/>
-        <result column="status_" property="status"
-                typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="status_" property="status" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <association property="musicGroup" javaType="com.ym.mec.biz.dal.entity.MusicGroup">
+            <result column="music_group_name_" property="name"/>
+        </association>
+        <association property="user" javaType="com.ym.mec.auth.api.entity.SysUser">
+            <result column="username_" property="username"/>
+        </association>
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
@@ -34,8 +39,6 @@
     <!-- 向数据库增加一条记录 -->
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupQuit"
             useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-        <!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval
-            AS ID FROM DUAL </selectKey> -->
         INSERT INTO music_group_quit
         (id_,user_id_,music_group_id_,join_date_,quit_date_,create_time_,reason_,user_comment_,status_)
         VALUES(#{id},#{userId},#{musicGroupId},#{joinDate},#{quitDate},#{createTime},#{reason},#{userComment},
@@ -87,7 +90,11 @@
 
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="MusicGroupQuit" parameterType="map">
-        SELECT * FROM music_group_quit ORDER BY id_
+        SELECT mgq.*,mg.name_ music_group_name_,su.username_
+        FROM music_group_quit mgq
+        LEFT JOIN sys_user su ON su.id_ = mgq.user_id_
+        LEFT JOIN music_group mg ON mg.id_ = mgq.music_group_id_
+        ORDER BY id_
         <include refid="global.limit"/>
     </select>
 

+ 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);

+ 17 - 0
mec-web/src/main/java/com/ym/mec/web/controller/InspectionItemPlanController.java

@@ -3,9 +3,11 @@ 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.biz.dal.dao.EmployeeDao;
+import com.ym.mec.biz.dal.dao.MusicGroupDao;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.Inspection;
 import com.ym.mec.biz.dal.entity.InspectionItemPlan;
+import com.ym.mec.biz.dal.entity.MusicGroup;
 import com.ym.mec.biz.dal.page.InspectionItemPlanQueryInfo;
 import com.ym.mec.biz.service.InspectionItemPlanService;
 import com.ym.mec.common.controller.BaseController;
@@ -33,6 +35,8 @@ public class InspectionItemPlanController extends BaseController {
     private SysUserFeignService sysUserFeignService;
     @Autowired
     private EmployeeDao employeeDao;
+    @Autowired
+    private MusicGroupDao musicGroupDao;
 
     @ApiOperation(value = "添加巡查任务事项日程")
     @PostMapping("/add")
@@ -101,4 +105,17 @@ public class InspectionItemPlanController extends BaseController {
         inspectionItemPlanService.update(inspectionItemPlan);
         return succeed(inspectionItemPlan);
     }
+
+
+    @ApiOperation(value = "获取乐团主管的乐团")
+    @GetMapping("/getMusicGroup")
+    @PreAuthorize("@pcs.hasPermissions('inspectionItemPlan/getMusicGroup')")
+    public HttpResponseResult<List<MusicGroup>> getMusicGroup(Integer organId, String search) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        return succeed(musicGroupDao.getByEduTeacher(organId, sysUser.getId(), search));
+    }
+
 }

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

@@ -329,6 +329,7 @@ public class TaskController extends BaseController {
 		indexBaseMonthDataService.indexBaseDataTask(month);
 	}
 
+	//乐团巡查计划当日9:00
 	@GetMapping("/inspectionPlan")
 	public void inspectionPlan(){
 		inspectionItemPlanService.pushNotice();