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

加入定时任务配置功能

java110 лет назад: 5
Родитель
Сommit
7d69e821c3

+ 0 - 4
docs/document/_sidebar.md

@@ -25,14 +25,10 @@
 * Api开放接口
 
   * [用户类接口](api/user/index.md)
-  * [用户注册](api/user/register.md)
-  * [用户登录](api/user/login.md)
   * [游客登记](api/user/saveVisit.md)
   * [访客登记变更](api/user/updateVisit.md)
   * [访客记录查询](api/user/listVisits.md)
   * [上传业主照片](api/user/uploadOwnerPhoto.md)
-  * [用户校验登录](api/user/checkLogin.md)
-  * [用户退出登录](api/user/logout.md)
   * [保存商户](api/store/saveStore.md)
   * [删除用户权限](api/privilege/deleteStaffPrivilege.md)
   * [查询已入驻的小区](api/community/queryMyCommunity.md)

+ 74 - 0
java110-bean/src/main/java/com/java110/dto/task/TaskTemplateDto.java

@@ -0,0 +1,74 @@
+package com.java110.dto.task;
+
+import com.java110.dto.PageDto;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @ClassName FloorDto
+ * @Description 定时任务数据层封装
+ * @Author wuxw
+ * @Date 2019/4/24 8:52
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+public class TaskTemplateDto extends PageDto implements Serializable {
+
+    private String templateId;
+    private String templateName;
+    private String templateDesc;
+    private String classBean;
+
+    private Date createTime;
+
+    private String statusCd = "0";
+
+    public String getTemplateId() {
+        return templateId;
+    }
+
+    public void setTemplateId(String templateId) {
+        this.templateId = templateId;
+    }
+
+    public String getTemplateName() {
+        return templateName;
+    }
+
+    public void setTemplateName(String templateName) {
+        this.templateName = templateName;
+    }
+
+    public String getTemplateDesc() {
+        return templateDesc;
+    }
+
+    public void setTemplateDesc(String templateDesc) {
+        this.templateDesc = templateDesc;
+    }
+
+    public String getClassBean() {
+        return classBean;
+    }
+
+    public void setClassBean(String classBean) {
+        this.classBean = classBean;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getStatusCd() {
+        return statusCd;
+    }
+
+    public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+}

+ 93 - 0
java110-bean/src/main/java/com/java110/dto/task/TaskTemplateSpecDto.java

@@ -0,0 +1,93 @@
+package com.java110.dto.task;
+
+import com.java110.dto.PageDto;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @ClassName FloorDto
+ * @Description 定时任务数据层封装
+ * @Author wuxw
+ * @Date 2019/4/24 8:52
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+public class TaskTemplateSpecDto extends PageDto implements Serializable {
+
+    private String specId;
+    private String templateId;
+    private String specCd;
+    private String specName;
+    private String specDesc;
+    private String isShow;
+
+    private Date createTime;
+
+    private String statusCd = "0";
+
+
+    public String getSpecId() {
+        return specId;
+    }
+
+    public void setSpecId(String specId) {
+        this.specId = specId;
+    }
+
+    public String getTemplateId() {
+        return templateId;
+    }
+
+    public void setTemplateId(String templateId) {
+        this.templateId = templateId;
+    }
+
+    public String getSpecCd() {
+        return specCd;
+    }
+
+    public void setSpecCd(String specCd) {
+        this.specCd = specCd;
+    }
+
+    public String getSpecName() {
+        return specName;
+    }
+
+    public void setSpecName(String specName) {
+        this.specName = specName;
+    }
+
+    public String getSpecDesc() {
+        return specDesc;
+    }
+
+    public void setSpecDesc(String specDesc) {
+        this.specDesc = specDesc;
+    }
+
+    public String getIsShow() {
+        return isShow;
+    }
+
+    public void setIsShow(String isShow) {
+        this.isShow = isShow;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getStatusCd() {
+        return statusCd;
+    }
+
+    public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+}

+ 31 - 0
java110-core/src/main/java/com/java110/core/smo/task/ITaskInnerServiceSMO.java

@@ -2,6 +2,9 @@ package com.java110.core.smo.task;
 
 import com.java110.core.feign.FeignConfiguration;
 import com.java110.dto.task.TaskDto;
+import com.java110.dto.task.TaskTemplateDto;
+import com.java110.dto.task.TaskTemplateSpecDto;
+import com.java110.utils.util.BeanConvertUtil;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -39,4 +42,32 @@ public interface ITaskInnerServiceSMO {
      */
     @RequestMapping(value = "/queryTasksCount", method = RequestMethod.POST)
     int queryTasksCount(@RequestBody TaskDto taskDto);
+
+
+    /**
+     * <p>查询任务模板楼信息</p>
+     *
+     *
+     * @param taskTemplateDto  模板对象
+     * @return TaskDto 对象数据
+     */
+    @RequestMapping(value = "/queryTaskTemplate", method = RequestMethod.POST)
+    List<TaskTemplateDto> queryTaskTemplate(@RequestBody TaskTemplateDto taskTemplateDto);
+
+    /**
+     * 查询<p>任务模板</p>总记录数
+     *
+     * @param taskTemplateDto 模板对象
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryTaskTemplateCount", method = RequestMethod.POST)
+    int queryTaskTemplateCount(@RequestBody TaskTemplateDto taskTemplateDto);
+
+
+
+     int queryTaskTemplateSpecCount(@RequestBody TaskTemplateSpecDto taskTemplateSpecDto);
+
+
+
+     List<TaskTemplateSpecDto> queryTaskTemplateSpec(@RequestBody TaskTemplateSpecDto taskTemplateSpecDto);
 }

+ 249 - 154
java110-db/src/main/resources/mapper/job/TaskServiceDaoImplMapper.xml

@@ -5,183 +5,278 @@
 <mapper namespace="taskServiceDaoImpl">
 
     <!-- 保存定时任务信息 add by wuxw 2018-07-03 -->
-       <insert id="saveBusinessTaskInfo" parameterType="Map">
-           insert into business_task(
-operate,task_cron,create_time,task_name,state,b_id,template_id,task_id
-) values (
-#{operate},#{taskCron},#{createTime},#{taskName},#{state},#{bId},#{templateId},#{taskId}
-)
-       </insert>
-
-
-       <!-- 查询定时任务信息(Business) add by wuxw 2018-07-03 -->
-       <select id="getBusinessTaskInfo" parameterType="Map" resultType="Map">
-           select  t.operate,t.task_cron,t.task_cron taskCron,t.create_time,t.create_time createTime,t.task_name,t.task_name taskName,t.state,t.b_id,t.b_id bId,t.template_id,t.template_id templateId,t.task_id,t.task_id taskId 
-from business_task t 
-where 1 =1 
-<if test="operate !=null and operate != ''">
-   and t.operate= #{operate}
-</if> 
-<if test="taskCron !=null and taskCron != ''">
-   and t.task_cron= #{taskCron}
-</if> 
-<if test="createTime !=null and createTime != ''">
-   and t.create_time= #{createTime}
-</if> 
-<if test="taskName !=null and taskName != ''">
-   and t.task_name= #{taskName}
-</if> 
-<if test="state !=null and state != ''">
-   and t.state= #{state}
-</if> 
-<if test="bId !=null and bId != ''">
-   and t.b_id= #{bId}
-</if> 
-<if test="templateId !=null and templateId != ''">
-   and t.template_id= #{templateId}
-</if> 
-<if test="taskId !=null and taskId != ''">
-   and t.task_id= #{taskId}
-</if> 
-
-       </select>
+    <insert id="saveBusinessTaskInfo" parameterType="Map">
+        insert into business_task(
+        operate,task_cron,create_time,task_name,state,b_id,template_id,task_id
+        ) values (
+        #{operate},#{taskCron},#{createTime},#{taskName},#{state},#{bId},#{templateId},#{taskId}
+        )
+    </insert>
 
 
+    <!-- 查询定时任务信息(Business) add by wuxw 2018-07-03 -->
+    <select id="getBusinessTaskInfo" parameterType="Map" resultType="Map">
+        select t.operate,t.task_cron,t.task_cron taskCron,t.create_time,t.create_time createTime,t.task_name,t.task_name
+        taskName,t.state,t.b_id,t.b_id bId,t.template_id,t.template_id templateId,t.task_id,t.task_id taskId
+        from business_task t
+        where 1 =1
+        <if test="operate !=null and operate != ''">
+            and t.operate= #{operate}
+        </if>
+        <if test="taskCron !=null and taskCron != ''">
+            and t.task_cron= #{taskCron}
+        </if>
+        <if test="createTime !=null and createTime != ''">
+            and t.create_time= #{createTime}
+        </if>
+        <if test="taskName !=null and taskName != ''">
+            and t.task_name= #{taskName}
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="templateId !=null and templateId != ''">
+            and t.template_id= #{templateId}
+        </if>
+        <if test="taskId !=null and taskId != ''">
+            and t.task_id= #{taskId}
+        </if>
 
+    </select>
 
 
     <!-- 保存定时任务信息至 instance表中 add by wuxw 2018-07-03 -->
     <insert id="saveTaskInfoInstance" parameterType="Map">
         insert into task(
-task_cron,create_time,task_name,status_cd,state,b_id,template_id,task_id
-) select t.task_cron,t.create_time,t.task_name,'0',t.state,t.b_id,t.template_id,t.task_id from business_task t where 1=1
-   and t.operate= 'ADD'
-<if test="taskCron !=null and taskCron != ''">
-   and t.task_cron= #{taskCron}
-</if> 
-<if test="createTime !=null and createTime != ''">
-   and t.create_time= #{createTime}
-</if> 
-<if test="taskName !=null and taskName != ''">
-   and t.task_name= #{taskName}
-</if> 
-<if test="state !=null and state != ''">
-   and t.state= #{state}
-</if> 
-<if test="bId !=null and bId != ''">
-   and t.b_id= #{bId}
-</if> 
-<if test="templateId !=null and templateId != ''">
-   and t.template_id= #{templateId}
-</if> 
-<if test="taskId !=null and taskId != ''">
-   and t.task_id= #{taskId}
-</if> 
+        task_cron,create_time,task_name,status_cd,state,b_id,template_id,task_id
+        ) select t.task_cron,t.create_time,t.task_name,'0',t.state,t.b_id,t.template_id,t.task_id from business_task t
+        where 1=1
+        and t.operate= 'ADD'
+        <if test="taskCron !=null and taskCron != ''">
+            and t.task_cron= #{taskCron}
+        </if>
+        <if test="createTime !=null and createTime != ''">
+            and t.create_time= #{createTime}
+        </if>
+        <if test="taskName !=null and taskName != ''">
+            and t.task_name= #{taskName}
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="templateId !=null and templateId != ''">
+            and t.template_id= #{templateId}
+        </if>
+        <if test="taskId !=null and taskId != ''">
+            and t.task_id= #{taskId}
+        </if>
 
     </insert>
 
 
-
     <!-- 查询定时任务信息 add by wuxw 2018-07-03 -->
     <select id="getTaskInfo" parameterType="Map" resultType="Map">
-        select  t.task_cron,t.task_cron taskCron,t.create_time,t.create_time createTime,t.task_name,t.task_name taskName,t.status_cd,t.status_cd statusCd,t.state,t.b_id,t.b_id bId,t.template_id,t.template_id templateId,t.task_id,t.task_id taskId 
-from task t 
-where 1 =1 
-<if test="taskCron !=null and taskCron != ''">
-   and t.task_cron= #{taskCron}
-</if> 
-<if test="createTime !=null and createTime != ''">
-   and t.create_time= #{createTime}
-</if> 
-<if test="taskName !=null and taskName != ''">
-   and t.task_name= #{taskName}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="state !=null and state != ''">
-   and t.state= #{state}
-</if> 
-<if test="bId !=null and bId != ''">
-   and t.b_id= #{bId}
-</if> 
-<if test="templateId !=null and templateId != ''">
-   and t.template_id= #{templateId}
-</if> 
-<if test="taskId !=null and taskId != ''">
-   and t.task_id= #{taskId}
-</if> 
-order by t.create_time desc
-<if test="page != -1 and page != null ">
-   limit #{page}, #{row}
-</if> 
+        select t.task_cron,t.task_cron taskCron,t.create_time,t.create_time createTime,t.task_name,t.task_name
+        taskName,t.status_cd,t.status_cd statusCd,t.state,t.b_id,t.b_id bId,t.template_id,t.template_id
+        templateId,t.task_id,t.task_id taskId
+        from task t
+        where 1 =1
+        <if test="taskCron !=null and taskCron != ''">
+            and t.task_cron= #{taskCron}
+        </if>
+        <if test="createTime !=null and createTime != ''">
+            and t.create_time= #{createTime}
+        </if>
+        <if test="taskName !=null and taskName != ''">
+            and t.task_name= #{taskName}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="templateId !=null and templateId != ''">
+            and t.template_id= #{templateId}
+        </if>
+        <if test="taskId !=null and taskId != ''">
+            and t.task_id= #{taskId}
+        </if>
+        order by t.create_time desc
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
 
     </select>
 
 
-
-
     <!-- 修改定时任务信息 add by wuxw 2018-07-03 -->
     <update id="updateTaskInfoInstance" parameterType="Map">
-        update  task t set t.status_cd = #{statusCd}
-<if test="newBId != null and newBId != ''">
-,t.b_id = #{newBId}
-</if> 
-<if test="taskCron !=null and taskCron != ''">
-, t.task_cron= #{taskCron}
-</if> 
-<if test="createTime !=null and createTime != ''">
-, t.create_time= #{createTime}
-</if> 
-<if test="taskName !=null and taskName != ''">
-, t.task_name= #{taskName}
-</if> 
-<if test="state !=null and state != ''">
-, t.state= #{state}
-</if> 
-<if test="templateId !=null and templateId != ''">
-, t.template_id= #{templateId}
-</if> 
- where 1=1 <if test="bId !=null and bId != ''">
-and t.b_id= #{bId}
-</if> 
-<if test="taskId !=null and taskId != ''">
-and t.task_id= #{taskId}
-</if> 
+        update task t set t.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,t.b_id = #{newBId}
+        </if>
+        <if test="taskCron !=null and taskCron != ''">
+            , t.task_cron= #{taskCron}
+        </if>
+        <if test="createTime !=null and createTime != ''">
+            , t.create_time= #{createTime}
+        </if>
+        <if test="taskName !=null and taskName != ''">
+            , t.task_name= #{taskName}
+        </if>
+        <if test="state !=null and state != ''">
+            , t.state= #{state}
+        </if>
+        <if test="templateId !=null and templateId != ''">
+            , t.template_id= #{templateId}
+        </if>
+        where 1=1
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="taskId !=null and taskId != ''">
+            and t.task_id= #{taskId}
+        </if>
 
     </update>
 
     <!-- 查询定时任务数量 add by wuxw 2018-07-03 -->
-     <select id="queryTasksCount" parameterType="Map" resultType="Map">
-        select  count(1) count 
-from task t 
-where 1 =1 
-<if test="taskCron !=null and taskCron != ''">
-   and t.task_cron= #{taskCron}
-</if> 
-<if test="createTime !=null and createTime != ''">
-   and t.create_time= #{createTime}
-</if> 
-<if test="taskName !=null and taskName != ''">
-   and t.task_name= #{taskName}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="state !=null and state != ''">
-   and t.state= #{state}
-</if> 
-<if test="bId !=null and bId != ''">
-   and t.b_id= #{bId}
-</if> 
-<if test="templateId !=null and templateId != ''">
-   and t.template_id= #{templateId}
-</if> 
-<if test="taskId !=null and taskId != ''">
-   and t.task_id= #{taskId}
-</if> 
-
-
-     </select>
+    <select id="queryTasksCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from task t
+        where 1 =1
+        <if test="taskCron !=null and taskCron != ''">
+            and t.task_cron= #{taskCron}
+        </if>
+        <if test="createTime !=null and createTime != ''">
+            and t.create_time= #{createTime}
+        </if>
+        <if test="taskName !=null and taskName != ''">
+            and t.task_name= #{taskName}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="templateId !=null and templateId != ''">
+            and t.template_id= #{templateId}
+        </if>
+        <if test="taskId !=null and taskId != ''">
+            and t.task_id= #{taskId}
+        </if>
+
+
+    </select>
+
+
+    <!-- 查询定时任务数量 add by wuxw 2018-07-03 -->
+    <select id="queryTaskTemplateCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from task_template t
+        where 1 =1
+        <if test="templateId !=null and templateId != ''">
+            and t.template_id= #{templateId}
+        </if>
+        <if test="templateName !=null and templateName != ''">
+            and t.template_name= #{templateName}
+        </if>
+        <if test="className !=null and className != ''">
+            and t.class_bean= #{className}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+
+    </select>
+
+
+    <!-- 查询定时任务信息 add by wuxw 2018-07-03 -->
+    <select id="getTaskInfo" parameterType="Map" resultType="Map">
+        select t.template_id templateId,t.template_name templateName,t.template_desc templateDesc,t.create_time createTime,t.class_bean classBean
+        from task_template t
+        where 1 =1
+        <if test="templateId !=null and templateId != ''">
+            and t.template_id= #{templateId}
+        </if>
+        <if test="templateName !=null and templateName != ''">
+            and t.template_name= #{templateName}
+        </if>
+        <if test="className !=null and className != ''">
+            and t.class_bean= #{className}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        order by t.create_time desc
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
+
+    </select>
+
+
+    <!-- 查询定时任务数量 add by wuxw 2018-07-03 -->
+    <select id="queryTaskTemplateSpecCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from task_template_spec t
+        where 1 =1
+        <if test="templateId !=null and templateId != ''">
+            and t.template_id= #{templateId}
+        </if>
+        <if test="specCd !=null and specCd != ''">
+            and t.spec_cd= #{specCd}
+        </if>
+        <if test="isShow !=null and isShow != ''">
+            and t.is_show= #{isShow}
+        </if>
+        <if test="specDesc !=null and specDesc != ''">
+            and t.spec_desc= #{specDesc}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+
+    </select>
+
+
+    <!-- 查询定时任务信息 add by wuxw 2018-07-03 -->
+    <select id="getTaskTemplateSpecInfo" parameterType="Map" resultType="Map">
+        select t.template_id templateId,t.spec_id specId,t.spec_cd specCd,t.create_time createTime,t.spec_name specName,
+        t.spec_desc specDesc,t.is_show isShow
+        from task_template_spec t
+        where 1 =1
+        <if test="templateId !=null and templateId != ''">
+            and t.template_id= #{templateId}
+        </if>
+        <if test="specCd !=null and specCd != ''">
+            and t.spec_cd= #{specCd}
+        </if>
+        <if test="isShow !=null and isShow != ''">
+            and t.is_show= #{isShow}
+        </if>
+        <if test="specDesc !=null and specDesc != ''">
+            and t.spec_desc= #{specDesc}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+
+    </select>
+
 
 </mapper>

+ 8 - 0
java110-utils/src/main/java/com/java110/utils/constant/ServiceCodeTaskConstant.java

@@ -26,6 +26,14 @@ public class ServiceCodeTaskConstant {
      * 查询 定时任务
      */
     public static final String LIST_TASKS = "task.listTasks";
+    /**
+     * 查询 定时任务模板
+     */
+    public static final String LIST_TASK_TEMPLATE = "task.listTaskTemplate";
 
+    /**
+     * 查询 定时任务模板规格
+     */
+    public static final String LIST_TASK_TEMPLATE_SPEC = "task.listTaskTemplateSpec";
 
 }

+ 83 - 0
service-api/src/main/java/com/java110/api/listener/task/ListTaskTemplateListener.java

@@ -0,0 +1,83 @@
+package com.java110.api.listener.task;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.api.listener.AbstractServiceApiListener;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.core.event.service.api.ServiceDataFlowEvent;
+import com.java110.core.smo.task.ITaskInnerServiceSMO;
+import com.java110.dto.task.TaskDto;
+import com.java110.dto.task.TaskTemplateDto;
+import com.java110.result.ResultVo;
+import com.java110.utils.constant.ServiceCodeTaskConstant;
+import com.java110.utils.util.BeanConvertUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 查询任务模板
+ */
+@Java110Listener("listTasksListener")
+public class ListTaskTemplateListener extends AbstractServiceApiListener {
+
+    @Autowired
+    private ITaskInnerServiceSMO taskInnerServiceSMOImpl;
+
+    @Override
+    public String getServiceCode() {
+        return ServiceCodeTaskConstant.LIST_TASK_TEMPLATE;
+    }
+
+    @Override
+    public HttpMethod getHttpMethod() {
+        return HttpMethod.GET;
+    }
+
+
+    @Override
+    public int getOrder() {
+        return DEFAULT_ORDER;
+    }
+
+
+    public ITaskInnerServiceSMO getTaskInnerServiceSMOImpl() {
+        return taskInnerServiceSMOImpl;
+    }
+
+    public void setTaskInnerServiceSMOImpl(ITaskInnerServiceSMO taskInnerServiceSMOImpl) {
+        this.taskInnerServiceSMOImpl = taskInnerServiceSMOImpl;
+    }
+
+    @Override
+    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+        super.validatePageInfo(reqJson);
+    }
+
+    @Override
+    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+
+        TaskTemplateDto taskTemplateDto = BeanConvertUtil.covertBean(reqJson, TaskTemplateDto.class);
+
+        int count = taskInnerServiceSMOImpl.queryTaskTemplateCount(taskTemplateDto);
+
+        List<TaskTemplateDto> taskTemplateDtos = null;
+
+        if (count > 0) {
+            taskTemplateDtos = taskInnerServiceSMOImpl.queryTaskTemplate(taskTemplateDto);
+        } else {
+            taskTemplateDtos = new ArrayList<>();
+        }
+
+        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, taskTemplateDtos);
+
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+        context.setResponseEntity(responseEntity);
+
+    }
+}

+ 83 - 0
service-api/src/main/java/com/java110/api/listener/task/ListTaskTemplateSpecListener.java

@@ -0,0 +1,83 @@
+package com.java110.api.listener.task;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.api.listener.AbstractServiceApiListener;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.core.event.service.api.ServiceDataFlowEvent;
+import com.java110.core.smo.task.ITaskInnerServiceSMO;
+import com.java110.dto.task.TaskTemplateDto;
+import com.java110.dto.task.TaskTemplateSpecDto;
+import com.java110.result.ResultVo;
+import com.java110.utils.constant.ServiceCodeTaskConstant;
+import com.java110.utils.util.BeanConvertUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 查询任务模板属性
+ */
+@Java110Listener("listTasksListener")
+public class ListTaskTemplateSpecListener extends AbstractServiceApiListener {
+
+    @Autowired
+    private ITaskInnerServiceSMO taskInnerServiceSMOImpl;
+
+    @Override
+    public String getServiceCode() {
+        return ServiceCodeTaskConstant.LIST_TASK_TEMPLATE_SPEC;
+    }
+
+    @Override
+    public HttpMethod getHttpMethod() {
+        return HttpMethod.GET;
+    }
+
+
+    @Override
+    public int getOrder() {
+        return DEFAULT_ORDER;
+    }
+
+
+    public ITaskInnerServiceSMO getTaskInnerServiceSMOImpl() {
+        return taskInnerServiceSMOImpl;
+    }
+
+    public void setTaskInnerServiceSMOImpl(ITaskInnerServiceSMO taskInnerServiceSMOImpl) {
+        this.taskInnerServiceSMOImpl = taskInnerServiceSMOImpl;
+    }
+
+    @Override
+    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+        super.validatePageInfo(reqJson);
+    }
+
+    @Override
+    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+
+        TaskTemplateSpecDto taskTemplateSpecDto = BeanConvertUtil.covertBean(reqJson, TaskTemplateSpecDto.class);
+
+        int count = taskInnerServiceSMOImpl.queryTaskTemplateSpecCount(taskTemplateSpecDto);
+
+        List<TaskTemplateSpecDto> taskTemplateSpecDtos = null;
+
+        if (count > 0) {
+            taskTemplateSpecDtos = taskInnerServiceSMOImpl.queryTaskTemplateSpec(taskTemplateSpecDto);
+        } else {
+            taskTemplateSpecDtos = new ArrayList<>();
+        }
+
+        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, taskTemplateSpecDtos);
+
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+        context.setResponseEntity(responseEntity);
+
+    }
+}

+ 43 - 12
service-job/src/main/java/com/java110/job/dao/ITaskServiceDao.java

@@ -2,11 +2,6 @@ package com.java110.job.dao;
 
 
 import com.java110.utils.exception.DAOException;
-import com.java110.entity.merchant.BoMerchant;
-import com.java110.entity.merchant.BoMerchantAttr;
-import com.java110.entity.merchant.Merchant;
-import com.java110.entity.merchant.MerchantAttr;
-
 
 import java.util.List;
 import java.util.Map;
@@ -15,23 +10,24 @@ import java.util.Map;
  * 定时任务组件内部之间使用,没有给外围系统提供服务能力
  * 定时任务服务接口类,要求全部以字符串传输,方便微服务化
  * 新建客户,修改客户,删除客户,查询客户等功能
- *
+ * <p>
  * Created by wuxw on 2016/12/27.
  */
 public interface ITaskServiceDao {
 
     /**
      * 保存 定时任务信息
+     *
      * @param businessTaskInfo 定时任务信息 封装
      * @throws DAOException 操作数据库异常
      */
     void saveBusinessTaskInfo(Map businessTaskInfo) throws DAOException;
 
 
-
     /**
      * 查询定时任务信息(business过程)
      * 根据bId 查询定时任务信息
+     *
      * @param info bId 信息
      * @return 定时任务信息
      * @throws DAOException DAO异常
@@ -39,21 +35,19 @@ public interface ITaskServiceDao {
     List<Map> getBusinessTaskInfo(Map info) throws DAOException;
 
 
-
-
     /**
      * 保存 定时任务信息 Business数据到 Instance中
+     *
      * @param info
      * @throws DAOException DAO异常
      */
     void saveTaskInfoInstance(Map info) throws DAOException;
 
 
-
-
     /**
      * 查询定时任务信息(instance过程)
      * 根据bId 查询定时任务信息
+     *
      * @param info bId 信息
      * @return 定时任务信息
      * @throws DAOException DAO异常
@@ -61,9 +55,9 @@ public interface ITaskServiceDao {
     List<Map> getTaskInfo(Map info) throws DAOException;
 
 
-
     /**
      * 修改定时任务信息
+     *
      * @param info 修改信息
      * @throws DAOException DAO异常
      */
@@ -78,4 +72,41 @@ public interface ITaskServiceDao {
      */
     int queryTasksCount(Map info);
 
+
+    /**
+     * 查询定时任务模板总数
+     *
+     * @param info 定时任务信息
+     * @return 定时任务数量
+     */
+    int queryTaskTemplateCount(Map info);
+
+    /**
+     * 查询定时任务信息(instance过程)
+     * 根据bId 查询定时任务信息
+     *
+     * @param info bId 信息
+     * @return 定时任务信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getTaskTemplateInfo(Map info) throws DAOException;
+
+
+    /**
+     * 查询定时任务数量
+     *
+     * @param info 定时任务信息
+     * @return 定时任务数量
+     */
+    public int queryTaskTemplateSpecCount(Map info);
+
+    /**
+     * 查询定时任务信息(instance)
+     *
+     * @param info bId 信息
+     * @return List<Map>
+     * @throws DAOException DAO异常
+     */
+    public List<Map> getTaskTemplateSpecInfo(Map info) throws DAOException;
+
 }

+ 65 - 0
service-job/src/main/java/com/java110/job/dao/impl/TaskServiceDaoImpl.java

@@ -126,5 +126,70 @@ public class TaskServiceDaoImpl extends BaseServiceDao implements ITaskServiceDa
         return Integer.parseInt(businessTaskInfos.get(0).get("count").toString());
     }
 
+    /**
+     * 查询定时任务数量
+     * @param info 定时任务信息
+     * @return 定时任务数量
+     */
+    @Override
+    public int queryTaskTemplateCount(Map info) {
+        logger.debug("查询定时任务模板数据 入参 info : {}",info);
+
+        List<Map> businessTaskInfos = sqlSessionTemplate.selectList("taskServiceDaoImpl.queryTaskTemplateCount", info);
+        if (businessTaskInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessTaskInfos.get(0).get("count").toString());
+    }
+
+    /**
+     * 查询定时任务信息(instance)
+     * @param info bId 信息
+     * @return List<Map>
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getTaskTemplateInfo(Map info) throws DAOException {
+        logger.debug("查询定时任务信息 入参 info : {}",info);
+
+        List<Map> businessTaskInfos = sqlSessionTemplate.selectList("taskServiceDaoImpl.getTaskTemplateInfo",info);
+
+        return businessTaskInfos;
+    }
+
+    /**
+     * 查询定时任务数量
+     * @param info 定时任务信息
+     * @return 定时任务数量
+     */
+    @Override
+    public int queryTaskTemplateSpecCount(Map info) {
+        logger.debug("查询定时任务模板数据 入参 info : {}",info);
+
+        List<Map> businessTaskInfos = sqlSessionTemplate.selectList("taskServiceDaoImpl.queryTaskTemplateCount", info);
+        if (businessTaskInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessTaskInfos.get(0).get("count").toString());
+    }
+
+    /**
+     * 查询定时任务信息(instance)
+     * @param info bId 信息
+     * @return List<Map>
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getTaskTemplateSpecInfo(Map info) throws DAOException {
+        logger.debug("查询定时任务信息 入参 info : {}",info);
+
+        List<Map> businessTaskInfos = sqlSessionTemplate.selectList("taskServiceDaoImpl.getTaskTemplateInfo",info);
+
+        return businessTaskInfos;
+    }
+
+
 
 }

+ 65 - 9
service-job/src/main/java/com/java110/job/smo/impl/TaskInnerServiceSMOImpl.java

@@ -1,14 +1,16 @@
 package com.java110.job.smo.impl;
 
 
-import com.java110.job.dao.ITaskServiceDao;
-import com.java110.core.smo.task.ITaskInnerServiceSMO;
-import com.java110.dto.task.TaskDto;
-import com.java110.utils.util.BeanConvertUtil;
 import com.java110.core.base.smo.BaseServiceSMO;
-import com.java110.dto.user.UserDto;
+import com.java110.core.smo.task.ITaskInnerServiceSMO;
 import com.java110.core.smo.user.IUserInnerServiceSMO;
 import com.java110.dto.PageDto;
+import com.java110.dto.task.TaskDto;
+import com.java110.dto.task.TaskTemplateDto;
+import com.java110.dto.task.TaskTemplateSpecDto;
+import com.java110.dto.user.UserDto;
+import com.java110.job.dao.ITaskServiceDao;
+import com.java110.utils.util.BeanConvertUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RestController;
@@ -34,7 +36,7 @@ public class TaskInnerServiceSMOImpl extends BaseServiceSMO implements ITaskInne
     private IUserInnerServiceSMO userInnerServiceSMOImpl;
 
     @Override
-    public List<TaskDto> queryTasks(@RequestBody  TaskDto taskDto) {
+    public List<TaskDto> queryTasks(@RequestBody TaskDto taskDto) {
 
         //校验是否传了 分页信息
 
@@ -63,7 +65,7 @@ public class TaskInnerServiceSMOImpl extends BaseServiceSMO implements ITaskInne
     /**
      * 从用户列表中查询用户,将用户中的信息 刷新到 floor对象中
      *
-     * @param task 小区定时任务信息
+     * @param task  小区定时任务信息
      * @param users 用户列表
      */
     private void refreshTask(TaskDto task, List<UserDto> users) {
@@ -80,7 +82,7 @@ public class TaskInnerServiceSMOImpl extends BaseServiceSMO implements ITaskInne
      * @param tasks 小区楼信息
      * @return 批量userIds 信息
      */
-     private String[] getUserIds(List<TaskDto> tasks) {
+    private String[] getUserIds(List<TaskDto> tasks) {
         List<String> userIds = new ArrayList<String>();
         for (TaskDto task : tasks) {
             userIds.add(task.getTaskId());
@@ -91,7 +93,61 @@ public class TaskInnerServiceSMOImpl extends BaseServiceSMO implements ITaskInne
 
     @Override
     public int queryTasksCount(@RequestBody TaskDto taskDto) {
-        return taskServiceDaoImpl.queryTasksCount(BeanConvertUtil.beanCovertMap(taskDto));    }
+        return taskServiceDaoImpl.queryTasksCount(BeanConvertUtil.beanCovertMap(taskDto));
+    }
+
+
+    @Override
+    public int queryTaskTemplateCount(@RequestBody TaskTemplateDto taskTemplateDto) {
+        return taskServiceDaoImpl.queryTaskTemplateCount(BeanConvertUtil.beanCovertMap(taskTemplateDto));
+    }
+
+
+
+    @Override
+    public List<TaskTemplateDto> queryTaskTemplate(@RequestBody TaskTemplateDto taskTemplateDto) {
+
+        //校验是否传了 分页信息
+
+        int page = taskTemplateDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            taskTemplateDto.setPage((page - 1) * taskTemplateDto.getRow());
+        }
+
+        List<TaskTemplateDto> taskTemplates = BeanConvertUtil.covertBeanList(taskServiceDaoImpl.getTaskTemplateInfo(BeanConvertUtil.beanCovertMap(taskTemplateDto)), TaskTemplateDto.class);
+
+        return taskTemplates;
+    }
+
+
+
+    @Override
+    public int queryTaskTemplateSpecCount(@RequestBody TaskTemplateSpecDto taskTemplateSpecDto) {
+        return taskServiceDaoImpl.queryTaskTemplateSpecCount(BeanConvertUtil.beanCovertMap(taskTemplateSpecDto));
+    }
+
+
+
+    @Override
+    public List<TaskTemplateSpecDto> queryTaskTemplateSpec(@RequestBody TaskTemplateSpecDto taskTemplateSpecDto) {
+
+        //校验是否传了 分页信息
+
+        int page = taskTemplateSpecDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            taskTemplateSpecDto.setPage((page - 1) * taskTemplateSpecDto.getRow());
+        }
+
+        List<TaskTemplateSpecDto> taskTemplates = BeanConvertUtil.covertBeanList(taskServiceDaoImpl.getTaskTemplateSpecInfo(BeanConvertUtil.beanCovertMap(taskTemplateSpecDto)), TaskTemplateSpecDto.class);
+
+        return taskTemplates;
+    }
+
+
+
+
 
     public ITaskServiceDao getTaskServiceDaoImpl() {
         return taskServiceDaoImpl;