Просмотр исходного кода

Merge remote-tracking branch 'origin/master'

zouxuan 4 лет назад
Родитель
Сommit
55fc5f519a

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

@@ -2,7 +2,18 @@ package com.ym.mec.biz.dal.dao;
 
 import com.ym.mec.biz.dal.entity.InspectionItemPlan;
 import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Date;
+import java.util.List;
 
 public interface InspectionItemPlanDao extends BaseDAO<Long, InspectionItemPlan> {
 
+    /**
+     * 获取开始的巡查日程
+     *
+     * @param planStart
+     * @return
+     */
+    List<InspectionItemPlan> getStartPlan(@Param("planStart") Date planStart);
 }

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

@@ -127,6 +127,9 @@ public class InspectionItemPlan {
     @ApiModelProperty(value = "打卡范围")
     private Integer attendanceRange;
 
+    @ApiModelProperty(value = "乐团主管名字")
+    private String realName;
+
     public Long getId() {
         return id;
     }
@@ -302,4 +305,12 @@ public class InspectionItemPlan {
     public void setAttendanceRange(Integer attendanceRange) {
         this.attendanceRange = attendanceRange;
     }
+
+    public String getRealName() {
+        return realName;
+    }
+
+    public void setRealName(String realName) {
+        this.realName = realName;
+    }
 }

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/InspectionItemPlanService.java

@@ -5,6 +5,8 @@ import com.ym.mec.biz.dal.page.InspectionItemPlanQueryInfo;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
 
+import java.util.List;
+
 public interface InspectionItemPlanService extends BaseService<Long, InspectionItemPlan> {
 
     /**
@@ -26,6 +28,13 @@ public interface InspectionItemPlanService extends BaseService<Long, InspectionI
      * @return
      */
     InspectionItemPlan updatePlan(InspectionItemPlan inspectionItemPlan);
+
+
+    /**
+     * 推送有开始的巡查日程
+     * @return
+     */
+    List<InspectionItemPlan> pushNotice();
 }
 
 

+ 23 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/InspectionItemPlanServiceImpl.java

@@ -5,12 +5,15 @@ import com.ym.mec.biz.dal.dto.CheckItemDto;
 import com.ym.mec.biz.dal.entity.Inspection;
 import com.ym.mec.biz.dal.entity.InspectionItem;
 import com.ym.mec.biz.dal.entity.School;
+import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.dal.page.InspectionItemPlanQueryInfo;
 import com.ym.mec.biz.service.SysConfigService;
+import com.ym.mec.biz.service.SysMessageService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import com.ym.mec.util.date.DateUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -19,7 +22,9 @@ 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.stream.Collectors;
 
 @Service
@@ -37,6 +42,8 @@ public class InspectionItemPlanServiceImpl extends BaseServiceImpl<Long, Inspect
     private InspectionItemPlanConclusionDao inspectionItemPlanConclusionDao;
     @Autowired
     private SysConfigDao sysConfigDao;
+    @Autowired
+    private SysMessageService sysMessageService;
 
     @Override
     public BaseDAO<Long, InspectionItemPlan> getDAO() {
@@ -139,6 +146,22 @@ public class InspectionItemPlanServiceImpl extends BaseServiceImpl<Long, Inspect
         inspectionItemPlanDao.update(inspectionItemPlan);
         return inspectionItemPlan;
     }
+
+    @Override
+    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());
+
+        });
+        return startPlans;
+    }
 }
 
 

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

@@ -11,7 +11,7 @@
         <result column="item_" property="item" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="times_" property="times"/>
         <result column="planned_times_" property="plannedTimes"/>
-        <result column="submitted_times" property="submittedTimes"/>
+        <result column="submitted_times_" property="submittedTimes"/>
         <result column="memo_" property="memo"/>
         <result column="operation_" property="operation"/>
         <result column="create_time_" property="createTime"/>
@@ -22,7 +22,7 @@
     </resultMap>
     <sql id="Base_Column_List">
         <!--@mbg.generated-->
-        id_, inspection_id_, organ_id_, user_id_, item_, times_, planned_times_, submitted_times,
+        id_, inspection_id_, organ_id_, user_id_, item_, times_, planned_times_, submitted_times_,
         memo_, operation_, create_time_, update_time_
     </sql>
     <select id="get" parameterType="java.lang.Long" resultMap="InspectionItem">
@@ -41,7 +41,7 @@
             useGeneratedKeys="true">
         <!--@mbg.generated-->
         insert into inspection_item (inspection_id_, organ_id_, user_id_, item_, times_, planned_times_,
-        submitted_times, memo_, operation_, create_time_, update_time_)
+        submitted_times_, memo_, operation_, create_time_, update_time_)
         values (#{inspectionId}, #{organId}, #{userId}, #{item,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
         #{times}, #{plannedTimes},
         #{submittedTimes}, #{memo}, #{operation}, #{createTime}, #{updateTime})
@@ -69,7 +69,7 @@
                 planned_times_ = #{plannedTimes},
             </if>
             <if test="submittedTimes != null">
-                submitted_times = #{submittedTimes},
+                submitted_times_ = #{submittedTimes},
             </if>
             <if test="memo != null">
                 memo_ = #{memo},

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

@@ -24,6 +24,7 @@
         <result column="cooperationName" property="cooperationName"/>
         <result column="musicGroupName" property="musicGroupName"/>
         <result column="organName" property="organName"/>
+        <result column="realName" property="realName"/>
     </resultMap>
     <sql id="Base_Column_List">
         <!--@mbg.generated-->
@@ -112,7 +113,8 @@
 
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="InspectionItemPlan" parameterType="map">
-        SELECT iip.*,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_
         LEFT JOIN music_group mg ON mg.id_ = iip.music_group_id_
@@ -146,7 +148,7 @@
                 AND iip.music_group_id_ = #{musicGroupId}
             </if>
             <if test="conclusionStatus != null">
-                AND iip.conclusion_status = #{conclusionStatus}
+                AND iip.conclusion_status_ = #{conclusionStatus}
             </if>
             <if test="status !=null">
                 AND iip.status_ = #{status}
@@ -168,4 +170,8 @@
             </if>
         </where>
     </sql>
+
+    <select id="getStartPlan" resultMap="InspectionItemPlan">
+        SELECT * FROM inspection_item WHERE plan_start_ >= #{planStart}
+    </select>
 </mapper>

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

@@ -14,7 +14,7 @@
         <result column="update_time_" property="updateTime"/>
         <result column="organName" property="organName"/>
         <result column="userName" property="userName"/>
-        <collection property="inspectionItems" ofType="com.ym.mec.biz.dal.entity.InspectionItem" resultMap="com.ym.mec.biz.dal.dao.InspectionItemDao.InspectionItem"/>
+        <collection property="inspectionItems" columnPrefix="ie_" ofType="com.ym.mec.biz.dal.entity.InspectionItem" resultMap="com.ym.mec.biz.dal.dao.InspectionItemDao.InspectionItem"/>
     </resultMap>
     <sql id="Base_Column_List">
         <!--@mbg.generated-->
@@ -105,7 +105,10 @@
         </where>
     </sql>
     <select id="getInfo" resultMap="Inspection">
-        SELECT i.*,ii.*, o.name_ organName,su.real_name_ userName FROM inspection i
+        SELECT i.*,ii.id_ ie_id_,ii.inspection_id_ ie_inspection_id_,ii.organ_id_ ie_organ_id_,ii.user_id_ ie_user_id_,
+        ii.item_ ie_item_,ii.times_ ie_times_,ii.planned_times_ ie_planned_times_,ii.submitted_times_ ie_submitted_times_,
+        ii.memo_ ie_memo_,ii.operation_ ie_operation_,ii.create_time_ ie_create_time_,ii.update_time_ ie_update_time_,
+        o.name_ organName,su.real_name_ userName FROM inspection i
         LEFT JOIN organization o ON o.id_ = i.organ_id_
         LEFT JOIN sys_user su ON su.id_ = i.user_id_
         LEFT JOIN inspection_item ii ON ii.inspection_id_ = i.id_

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

@@ -85,4 +85,20 @@ public class InspectionItemPlanController extends BaseController {
         }
         return succeed(inspectionItemPlanService.queryPage(queryInfo));
     }
+
+
+    @ApiOperation(value = "修改处理信息")
+    @PostMapping("/updateMemo")
+    @PreAuthorize("@pcs.hasPermissions('inspectionItemPlan/updateMemo')")
+    public HttpResponseResult<InspectionItemPlan> updateMemo(Long id, String memo) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        InspectionItemPlan inspectionItemPlan = inspectionItemPlanService.get(id);
+        inspectionItemPlan.setMemo(memo);
+        inspectionItemPlan.setUpdateTime(new Date());
+        inspectionItemPlanService.update(inspectionItemPlan);
+        return succeed(inspectionItemPlan);
+    }
 }