Prechádzať zdrojové kódy

Merge remote-tracking branch 'origin/master'

zouxuan 4 rokov pred
rodič
commit
85682d89f8

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

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

+ 4 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/impl/InspectionItemPlanServiceImpl.java

@@ -149,12 +149,11 @@ 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 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServeServiceImpl.java

@@ -444,7 +444,7 @@ public class StudentServeServiceImpl implements StudentServeService {
                 Map<Integer, Integer> teacherNumMap = new HashMap<>();
                 for (String groupId : groupCourseInfo.keySet()) {
                     Integer teacherId = null;
-                    List<BaseMapDto<Integer, Integer>> studentTeacherIdList = courseScheduleStudentPaymentDao.getStudentClassGroupBishopTeacherMap(null, groupId);
+                    List<BaseMapDto<Integer, Integer>> studentTeacherIdList = courseScheduleStudentPaymentDao.getStudentClassGroupBishopTeacherMap(Arrays.asList(studentCourseMapEntry.getKey()), groupId);
                     if(!CollectionUtils.isEmpty(studentTeacherIdList)){
                         teacherId = studentTeacherIdList.get(0).getValue();
                     }
@@ -510,7 +510,7 @@ public class StudentServeServiceImpl implements StudentServeService {
             Map<Integer, Integer> teacherNumMap = new HashMap<>();
             for (String groupId : noCourseStudentMusicIdsMapEntry.getValue()) {
                 Integer teacherId = null;
-                List<BaseMapDto<Integer, Integer>> studentTeacherIdList = courseScheduleStudentPaymentDao.getStudentClassGroupBishopTeacherMap(null, groupId);
+                List<BaseMapDto<Integer, Integer>> studentTeacherIdList = courseScheduleStudentPaymentDao.getStudentClassGroupBishopTeacherMap(Arrays.asList(noCourseStudentMusicIdsMapEntry.getKey()), groupId);
                 if(!CollectionUtils.isEmpty(studentTeacherIdList)){
                     teacherId = studentTeacherIdList.get(0).getValue();
                 }

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

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