commit cfd92a43842b903e46774b9e28454d1ce09b5d4f
Author: 谢洪龙 <599179587@qq.com>
Date: Wed Aug 23 12:24:08 2017 +0800
初始化
diff --git a/nb-configuration.xml b/nb-configuration.xml
new file mode 100644
index 0000000..99174dc
--- /dev/null
+++ b/nb-configuration.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+ 1.6-web
+ Tomcat
+
+
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..91e626f
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,244 @@
+
+ 4.0.0
+
+ com.ifish
+ quartzProEnglish
+ 1.0
+ war
+
+ quartzProEnglish
+
+
+ ${project.build.directory}/endorsed
+ UTF-8
+
+
+
+
+ ch.qos.logback
+ logback-core
+ 1.1.2
+
+
+
+ ch.qos.logback
+ logback-classic
+ 1.1.2
+
+
+
+ com.sun.xml.ws
+ jaxws-tools
+ 2.2.10
+ pom
+
+
+
+ org.json
+ json
+ 20170516
+
+
+
+ org.apache.mina
+ mina-core
+ 2.0.16
+
+
+
+ org.quartz-scheduler
+ quartz
+ 2.3.0
+
+
+
+ org.csource
+ fastdfs-client-java
+ 1.25
+ system
+ ${basedir}/src/main/webapp/WEB-INF/lib/fastdfs-client-java-1.25.jar
+
+
+ cn.jpush.api
+ jpush-client
+ 3.2.17
+
+
+ org.apache.commons
+ commons-lang3
+ 3.5
+ jar
+
+
+ org.codehaus.jackson
+ jackson-mapper-asl
+ 1.9.13
+ jar
+
+
+ com.alibaba
+ fastjson
+ 1.2.28
+ jar
+
+
+ org.springframework.data
+ spring-data-redis
+ 1.8.4.RELEASE
+ jar
+
+
+ org.apache.commons
+ commons-pool2
+ 2.4.2
+ jar
+
+
+ redis.clients
+ jedis
+ 2.9.0
+ jar
+
+
+ c3p0
+ c3p0
+ 0.9.1.2
+ jar
+
+
+ net.sf.json-lib
+ json-lib
+ 2.4
+ jdk15
+
+
+ javax
+ javaee-web-api
+ 6.0
+ provided
+
+
+
+ org.springframework
+ spring-context
+ 4.3.9.RELEASE
+
+
+
+ org.springframework
+ spring-beans
+ 4.3.9.RELEASE
+
+
+
+ org.springframework
+ spring-core
+ 4.3.9.RELEASE
+
+
+
+ org.springframework
+ spring-web
+ 4.3.9.RELEASE
+
+
+
+ org.springframework
+ spring-webmvc
+ 4.3.8.RELEASE
+ jar
+
+
+
+ org.springframework
+ spring-jdbc
+ 4.3.9.RELEASE
+
+
+
+ org.mybatis
+ mybatis
+ 3.4.4
+
+
+
+ org.mybatis
+ mybatis-spring
+ 1.3.1
+
+
+ cn.jpush.api
+ jiguang-common
+ 1.0.3
+
+
+ io.netty
+ netty-all
+ 4.1.6.Final
+ compile
+
+
+ com.google.code.gson
+ gson
+ 2.3
+
+
+ org.slf4j
+ slf4j-api
+ 1.7.13
+ jar
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 2.3.2
+
+ 1.6
+ 1.6
+
+ ${endorsed.dir}
+
+
+
+
+ org.apache.maven.plugins
+ maven-war-plugin
+ 2.1.1
+
+ false
+
+
+
+ org.apache.maven.plugins
+ maven-dependency-plugin
+ 2.1
+
+
+ validate
+
+ copy
+
+
+ ${endorsed.dir}
+ true
+
+
+ javax
+ javaee-endorsed-api
+ 6.0
+ jar
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/ifish/bean/Tbl_Push_List.java b/src/main/java/com/ifish/bean/Tbl_Push_List.java
new file mode 100644
index 0000000..8bfa849
--- /dev/null
+++ b/src/main/java/com/ifish/bean/Tbl_Push_List.java
@@ -0,0 +1,465 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.ifish.bean;
+
+import java.util.Date;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * 推送详情表(tbl_push_list)
+ *
+ * @author bianj
+ * @version 1.0.0 2017-07-03
+ */
+@Entity
+@Table(name = "tbl_push_list")
+public class Tbl_Push_List implements java.io.Serializable {
+
+ /**
+ * 版本号
+ */
+ private static final long serialVersionUID = -7760764975977010045L;
+
+ /**
+ * ID
+ */
+ @Id
+ @Column(name = "push_id", unique = true, nullable = false, length = 10)
+ private Integer pushId;
+
+ /**
+ * 用户Id
+ */
+ @Column(name = "user_id", nullable = true, length = 10)
+ private Integer userId;
+
+ /**
+ * 设备Id
+ */
+ @Column(name = "device_id", nullable = true, length = 10)
+ private Integer deviceId;
+
+ /**
+ * 显示名称
+ */
+ @Column(name = "show_name", nullable = true, length = 20)
+ private String showName;
+
+ /**
+ * 推送手机类型
+ */
+ @Column(name = "phone_type", nullable = true, length = 20)
+ private String phoneType;
+
+ /**
+ * 推送消息类型
+ * 1."remove_device","解绑通知";2."wendu_warn","温度预警;3."qu_reply","问题反馈";4."app_update","IOS更新推送";5."remind_water","换水提醒";6."offline_push","离线通知";7."send_report","看护报告";8."shops_push","看护通知";9."all_push","所有用户推送"
+ */
+ @Column(name = "push_type", nullable = true, length = 20)
+ private String pushType;
+
+ /**
+ * 推送标题
+ */
+ @Column(name = "push_title", nullable = true, length = 100)
+ private String pushTitle;
+
+ /**
+ * 推送内容
+ */
+ @Column(name = "push_context", nullable = true, length = 200)
+ private String pushContext;
+
+ /**
+ * 创建时间
+ */
+ @Column(name = "create_time", nullable = true)
+ private Date createTime;
+
+ /**
+ * 链接
+ */
+ @Column(name = "push_link", nullable = false, length = 100)
+ private String pushLink;
+
+ /**
+ * 极光推送状态
+ */
+ @Column(name = "jpush_status", nullable = true, length = 1)
+ private String jpushStatus;
+
+ /**
+ * 谷歌推送状态
+ */
+ @Column(name = "google_status", nullable = true, length = 1)
+ private String googleStatus;
+
+ /**
+ * 看护报告Id
+ */
+ @Column(name = "report_id", nullable = true, length = 10)
+ private Integer reportId;
+
+ /**
+ * MCU启动次数
+ */
+ @Column(name = "mcu_count", nullable = true, length = 10)
+ private Integer mcuCount;
+
+ /**
+ * 模块启动次数
+ */
+ @Column(name = "modular_count", nullable = true, length = 10)
+ private Integer modularCount;
+
+ /**
+ * 连接路由器次数
+ */
+ @Column(name = "router_count", nullable = true, length = 10)
+ private Integer routerCount;
+
+ /**
+ * 成功连接服务器次数
+ */
+ @Column(name = "server_count", nullable = true, length = 10)
+ private Integer serverCount;
+
+ /**
+ * 尝试连接服务器次数
+ */
+ @Column(name = "server_try_count", nullable = true, length = 10)
+ private Integer serverTryCount;
+
+ /**
+ * 获取ID
+ *
+ * @return ID
+ */
+ public Integer getPushId() {
+ return this.pushId;
+ }
+
+ /**
+ * 设置ID
+ *
+ * @param pushId ID
+ */
+ public void setPushId(Integer pushId) {
+ this.pushId = pushId;
+ }
+
+ /**
+ * 获取用户Id
+ *
+ * @return 用户Id
+ */
+ public Integer getUserId() {
+ return this.userId;
+ }
+
+ /**
+ * 设置用户Id
+ *
+ * @param userId 用户Id
+ */
+ public void setUserId(Integer userId) {
+ this.userId = userId;
+ }
+
+ /**
+ * 获取设备Id
+ *
+ * @return 设备Id
+ */
+ public Integer getDeviceId() {
+ return this.deviceId;
+ }
+
+ /**
+ * 设置设备Id
+ *
+ * @param deviceId 设备Id
+ */
+ public void setDeviceId(Integer deviceId) {
+ this.deviceId = deviceId;
+ }
+
+ /**
+ * 获取显示名称
+ *
+ * @return 显示名称
+ */
+ public String getShowName() {
+ return this.showName;
+ }
+
+ /**
+ * 设置显示名称
+ *
+ * @param showName 显示名称
+ */
+ public void setShowName(String showName) {
+ this.showName = showName;
+ }
+
+ /**
+ * 获取推送手机类型
+ *
+ * @return 推送手机类型
+ */
+ public String getPhoneType() {
+ return this.phoneType;
+ }
+
+ /**
+ * 设置推送手机类型
+ *
+ * @param phoneType 推送手机类型
+ */
+ public void setPhoneType(String phoneType) {
+ this.phoneType = phoneType;
+ }
+
+ /**
+ * 获取推送消息类型
+ * 1."remove_device","解绑通知";2."wendu_warn","温度预警;3."qu_reply","问题反馈";4."app_update","IOS更新推送";5."remind_water","换水提醒";6."offline_push","离线通知";7."send_report","看护报告";8."shops_push","看护通知";9."all_push","所有用户推送"
+ *
+ * @return 推送消息类型 1."remove_device"
+ */
+ public String getPushType() {
+ return this.pushType;
+ }
+
+ /**
+ * 设置推送消息类型
+ * 1."remove_device","解绑通知";2."wendu_warn","温度预警;3."qu_reply","问题反馈";4."app_update","IOS更新推送";5."remind_water","换水提醒";6."offline_push","离线通知";7."send_report","看护报告";8."shops_push","看护通知";9."all_push","所有用户推送"
+ *
+ * @param pushType 推送消息类型
+ * 1."remove_device","解绑通知";2."wendu_warn","温度预警;3."qu_reply","问题反馈";4."app_update","IOS更新推送";5."remind_water","换水提醒";6."offline_push","离线通知";7."send_report","看护报告";8."shops_push","看护通知";9."all_push","所有用户推送"
+ */
+ public void setPushType(String pushType) {
+ this.pushType = pushType;
+ }
+
+ /**
+ * 获取推送标题
+ *
+ * @return 推送标题
+ */
+ public String getPushTitle() {
+ return this.pushTitle;
+ }
+
+ /**
+ * 设置推送标题
+ *
+ * @param pushTitle 推送标题
+ */
+ public void setPushTitle(String pushTitle) {
+ this.pushTitle = pushTitle;
+ }
+
+ /**
+ * 获取推送内容
+ *
+ * @return 推送内容
+ */
+ public String getPushContext() {
+ return this.pushContext;
+ }
+
+ /**
+ * 设置推送内容
+ *
+ * @param pushContext 推送内容
+ */
+ public void setPushContext(String pushContext) {
+ this.pushContext = pushContext;
+ }
+
+ /**
+ * 获取创建时间
+ *
+ * @return 创建时间
+ */
+ public Date getCreateTime() {
+ return this.createTime;
+ }
+
+ /**
+ * 设置创建时间
+ *
+ * @param createTime 创建时间
+ */
+ public void setCreateTime(Date createTime) {
+ this.createTime = createTime;
+ }
+
+ /**
+ * 获取链接
+ *
+ * @return 链接
+ */
+ public String getPushLink() {
+ return this.pushLink;
+ }
+
+ /**
+ * 设置链接
+ *
+ * @param pushLink 链接
+ */
+ public void setPushLink(String pushLink) {
+ this.pushLink = pushLink;
+ }
+
+ /**
+ * 获取极光推送状态
+ *
+ * @return 极光推送状态
+ */
+ public String getJpushStatus() {
+ return this.jpushStatus;
+ }
+
+ /**
+ * 设置极光推送状态
+ *
+ * @param jpushStatus 极光推送状态
+ */
+ public void setJpushStatus(String jpushStatus) {
+ this.jpushStatus = jpushStatus;
+ }
+
+ /**
+ * 获取谷歌推送状态
+ *
+ * @return 谷歌推送状态
+ */
+ public String getGoogleStatus() {
+ return this.googleStatus;
+ }
+
+ /**
+ * 设置谷歌推送状态
+ *
+ * @param googleStatus 谷歌推送状态
+ */
+ public void setGoogleStatus(String googleStatus) {
+ this.googleStatus = googleStatus;
+ }
+
+ /**
+ * 获取看护报告Id
+ *
+ * @return 看护报告Id
+ */
+ public Integer getReportId() {
+ return this.reportId;
+ }
+
+ /**
+ * 设置看护报告Id
+ *
+ * @param reportId 看护报告Id
+ */
+ public void setReportId(Integer reportId) {
+ this.reportId = reportId;
+ }
+
+ /**
+ * 获取MCU启动次数
+ *
+ * @return MCU启动次数
+ */
+ public Integer getMcuCount() {
+ return this.mcuCount;
+ }
+
+ /**
+ * 设置MCU启动次数
+ *
+ * @param mcuCount MCU启动次数
+ */
+ public void setMcuCount(Integer mcuCount) {
+ this.mcuCount = mcuCount;
+ }
+
+ /**
+ * 获取模块启动次数
+ *
+ * @return 模块启动次数
+ */
+ public Integer getModularCount() {
+ return this.modularCount;
+ }
+
+ /**
+ * 设置模块启动次数
+ *
+ * @param modularCount 模块启动次数
+ */
+ public void setModularCount(Integer modularCount) {
+ this.modularCount = modularCount;
+ }
+
+ /**
+ * 获取连接路由器次数
+ *
+ * @return 连接路由器次数
+ */
+ public Integer getRouterCount() {
+ return this.routerCount;
+ }
+
+ /**
+ * 设置连接路由器次数
+ *
+ * @param routerCount 连接路由器次数
+ */
+ public void setRouterCount(Integer routerCount) {
+ this.routerCount = routerCount;
+ }
+
+ /**
+ * 获取成功连接服务器次数
+ *
+ * @return 成功连接服务器次数
+ */
+ public Integer getServerCount() {
+ return this.serverCount;
+ }
+
+ /**
+ * 设置成功连接服务器次数
+ *
+ * @param serverCount 成功连接服务器次数
+ */
+ public void setServerCount(Integer serverCount) {
+ this.serverCount = serverCount;
+ }
+
+ /**
+ * 获取尝试连接服务器次数
+ *
+ * @return 尝试连接服务器次数
+ */
+ public Integer getServerTryCount() {
+ return this.serverTryCount;
+ }
+
+ /**
+ * 设置尝试连接服务器次数
+ *
+ * @param serverTryCount 尝试连接服务器次数
+ */
+ public void setServerTryCount(Integer serverTryCount) {
+ this.serverTryCount = serverTryCount;
+ }
+}
diff --git a/src/main/java/com/ifish/bean/Tbl_Tmp_Push_Remind.java b/src/main/java/com/ifish/bean/Tbl_Tmp_Push_Remind.java
new file mode 100644
index 0000000..e9e15a3
--- /dev/null
+++ b/src/main/java/com/ifish/bean/Tbl_Tmp_Push_Remind.java
@@ -0,0 +1,271 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.ifish.bean;
+
+import java.util.Date;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * 换水提醒推送表(tbl_tmp_push_remind)
+ *
+ * @author bianj
+ * @version 1.0.0 2017-08-04
+ */
+@Entity
+@Table(name = "tbl_tmp_push_remind")
+public class Tbl_Tmp_Push_Remind implements java.io.Serializable {
+
+ /**
+ * 版本号
+ */
+ private static final long serialVersionUID = 5004756571958151712L;
+
+ /**
+ * 推送id
+ */
+ @Id
+ @Column(name = "push_id", unique = true, nullable = false, length = 10)
+ private Integer pushId;
+
+ /**
+ * 设备Id
+ */
+ @Id
+ @Column(name = "device_id", unique = true, nullable = false, length = 10)
+ private Integer deviceId;
+
+ /**
+ * 用户Id
+ */
+ @Id
+ @Column(name = "user_id", unique = true, nullable = false, length = 10)
+ private Integer userId;
+
+ /**
+ * 手机号码
+ */
+ @Column(name = "phone_number", nullable = true, length = 10)
+ private Integer phoneNumber;
+
+ /**
+ * 设备MAC
+ */
+ @Column(name = "mac_address", nullable = true, length = 50)
+ private String macAddress;
+
+ /**
+ * 显示名称
+ */
+ @Column(name = "show_name", nullable = true, length = 50)
+ private String showName;
+
+ /**
+ * 推送手机类型
+ */
+ @Column(name = "login_type", nullable = true, length = 10)
+ private String loginType;
+
+ /**
+ * 提醒日期
+ */
+ @Column(name = "remind_date", nullable = true)
+ private Date remindDate;
+
+ /**
+ * 周期
+ */
+ @Column(name = "remind_cycle", nullable = false, length = 10)
+ private Integer remindCycle;
+
+ /**
+ * 是否推送
+ */
+ @Column(name = "is_push", nullable = false, length = 1)
+ private String isPush;
+
+ /**
+ * 获取推送id
+ *
+ * @return 推送id
+ */
+ public Integer getPushId() {
+ return this.pushId;
+ }
+
+ /**
+ * 设置推送id
+ *
+ * @param pushId 推送id
+ */
+ public void setPushId(Integer pushId) {
+ this.pushId = pushId;
+ }
+
+ /**
+ * 获取设备Id
+ *
+ * @return 设备Id
+ */
+ public Integer getDeviceId() {
+ return this.deviceId;
+ }
+
+ /**
+ * 设置设备Id
+ *
+ * @param deviceId 设备Id
+ */
+ public void setDeviceId(Integer deviceId) {
+ this.deviceId = deviceId;
+ }
+
+ /**
+ * 获取用户Id
+ *
+ * @return 用户Id
+ */
+ public Integer getUserId() {
+ return this.userId;
+ }
+
+ /**
+ * 设置用户Id
+ *
+ * @param userId 用户Id
+ */
+ public void setUserId(Integer userId) {
+ this.userId = userId;
+ }
+
+ /**
+ * 获取手机号码
+ *
+ * @return 手机号码
+ */
+ public Integer getPhoneNumber() {
+ return this.phoneNumber;
+ }
+
+ /**
+ * 设置手机号码
+ *
+ * @param phoneNumber 手机号码
+ */
+ public void setPhoneNumber(Integer phoneNumber) {
+ this.phoneNumber = phoneNumber;
+ }
+
+ /**
+ * 获取设备MAC
+ *
+ * @return 设备MAC
+ */
+ public String getMacAddress() {
+ return this.macAddress;
+ }
+
+ /**
+ * 设置设备MAC
+ *
+ * @param macAddress 设备MAC
+ */
+ public void setMacAddress(String macAddress) {
+ this.macAddress = macAddress;
+ }
+
+ /**
+ * 获取显示名称
+ *
+ * @return 显示名称
+ */
+ public String getShowName() {
+ return this.showName;
+ }
+
+ /**
+ * 设置显示名称
+ *
+ * @param showName 显示名称
+ */
+ public void setShowName(String showName) {
+ this.showName = showName;
+ }
+
+ /**
+ * 获取推送手机类型
+ *
+ * @return 推送手机类型
+ */
+ public String getLoginType() {
+ return this.loginType;
+ }
+
+ /**
+ * 设置推送手机类型
+ *
+ * @param loginType 推送手机类型
+ */
+ public void setLoginType(String loginType) {
+ this.loginType = loginType;
+ }
+
+ /**
+ * 获取提醒日期
+ *
+ * @return 提醒日期
+ */
+ public Date getRemindDate() {
+ return this.remindDate;
+ }
+
+ /**
+ * 设置提醒日期
+ *
+ * @param remindDate 提醒日期
+ */
+ public void setRemindDate(Date remindDate) {
+ this.remindDate = remindDate;
+ }
+
+ /**
+ * 获取周期
+ *
+ * @return 周期
+ */
+ public Integer getRemindCycle() {
+ return this.remindCycle;
+ }
+
+ /**
+ * 设置周期
+ *
+ * @param remindCycle 周期
+ */
+ public void setRemindCycle(Integer remindCycle) {
+ this.remindCycle = remindCycle;
+ }
+
+ /**
+ * 获取是否推送
+ *
+ * @return 是否推送
+ */
+ public String getIsPush() {
+ return this.isPush;
+ }
+
+ /**
+ * 设置是否推送
+ *
+ * @param isPush 是否推送
+ */
+ public void setIsPush(String isPush) {
+ this.isPush = isPush;
+ }
+}
diff --git a/src/main/java/com/ifish/config/MybatisConfig.java b/src/main/java/com/ifish/config/MybatisConfig.java
new file mode 100644
index 0000000..235479f
--- /dev/null
+++ b/src/main/java/com/ifish/config/MybatisConfig.java
@@ -0,0 +1,86 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.ifish.config;
+
+import javax.sql.DataSource;
+import org.mybatis.spring.SqlSessionFactoryBean;
+import org.mybatis.spring.mapper.MapperScannerConfigurer;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.jdbc.datasource.DataSourceTransactionManager;
+import org.springframework.jdbc.datasource.DriverManagerDataSource;
+import org.springframework.transaction.PlatformTransactionManager;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+/**
+ *
+ * @author Administrator
+ */
+@Configuration
+@EnableTransactionManagement
+public class MybatisConfig {
+
+ @Bean
+ public DataSource dataSource() {
+// try {
+// ComboPooledDataSource datasourc = new ComboPooledDataSource();
+// datasourc.setDriverClass(JdbcProperties.driverClassName);
+// datasourc.setJdbcUrl(JdbcProperties.url);
+// datasourc.setUser(JdbcProperties.username);
+// datasourc.setPassword(JdbcProperties.password);
+// datasourc.setAutoCommitOnClose(JdbcProperties.autoCommitOnClose);
+// datasourc.setInitialPoolSize(JdbcProperties.initialPoolSize);
+// datasourc.setMinPoolSize(JdbcProperties.minPoolSize);
+// datasourc.setMaxPoolSize(JdbcProperties.maxPoolSize);
+// datasourc.setAcquireIncrement(JdbcProperties.acquireIncrement);
+// datasourc.setCheckoutTimeout(JdbcProperties.checkoutTimeout);
+// datasourc.setMaxIdleTime(JdbcProperties.maxIdleTime);
+// datasourc.setIdleConnectionTestPeriod(JdbcProperties.idleConnectionTestPeriod);
+// return datasourc;
+// } catch (Exception e) {
+//
+// }
+ DriverManagerDataSource dataSource = new DriverManagerDataSource();
+ dataSource.setDriverClassName("com.mysql.jdbc.Driver");
+ //线上生产数据库连接
+ dataSource.setUsername("ifish");
+ dataSource.setPassword("ifish7pwd");
+ dataSource.setUrl("jdbc:mysql://localhost:3306/myfishdbenglish?characterEncoding=UTF-8");
+ return dataSource;
+ }
+
+ @Bean(name = "sqlSessionFactory")
+ public SqlSessionFactoryBean sqlSessionFactory() {
+ SqlSessionFactoryBean ssfb = new SqlSessionFactoryBean();
+ ssfb.setDataSource(dataSource());
+ ssfb.setTypeAliasesPackage("com.ifish.bean");
+ try {
+ org.apache.ibatis.session.Configuration configuration = new org.apache.ibatis.session.Configuration();
+ configuration.setMapUnderscoreToCamelCase(true);
+ ssfb.setConfiguration(configuration);
+
+ } catch (Exception e) {
+ }
+
+ return ssfb;
+ }
+
+ @Bean
+ public MapperScannerConfigurer mpperScannnerConfigurer() {
+ MapperScannerConfigurer msc = new MapperScannerConfigurer();
+ msc.setSqlSessionFactoryBeanName("sqlSessionFactory");
+ msc.setBasePackage("com.ifish.mapper");
+ return msc;
+ }
+
+ @Bean
+ PlatformTransactionManager transactionManager() {
+ DataSourceTransactionManager transactionManager = new DataSourceTransactionManager();
+ transactionManager.setDataSource(dataSource());
+ return transactionManager;
+ }
+
+}
diff --git a/src/main/java/com/ifish/config/RedisConfig.java b/src/main/java/com/ifish/config/RedisConfig.java
new file mode 100644
index 0000000..854c01c
--- /dev/null
+++ b/src/main/java/com/ifish/config/RedisConfig.java
@@ -0,0 +1,59 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.ifish.config;
+
+import com.ifish.util.IfishFilePath;
+import com.ifish.util.IfishUtil;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
+import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.core.StringRedisTemplate;
+
+/**
+ *
+ * @author Administrator
+ */
+@Configuration
+public class RedisConfig {
+
+ @Bean
+ public RedisConnectionFactory redisCF() {
+ JedisConnectionFactory cf = new JedisConnectionFactory();
+
+// //获取当前操作系统(servers_os为服务器设置的属性JAVA_OPTS=%JAVA_OPTS% -Dservers_os=online84)
+// String servers_os = System.getProperty("servers_os") == null ? "" : System.getProperty("servers_os");
+ if (IfishUtil.isOnLine()) {
+ //站点线上服务器
+ cf.setHostName("120.55.190.56");
+ cf.setPort(3796);
+ cf.setPassword("ifish7myredis");
+ } else {
+ //站点测试服务器
+ cf.setHostName("139.196.24.156");
+ cf.setPort(3796);
+ cf.setPassword("ifish7myredis");
+// FileUtil.writeLinesByLog("测试缓存连接");
+ }
+
+ return cf;
+ }
+
+ @Bean
+ public RedisTemplate redisTemplate(RedisConnectionFactory cf) {
+ RedisTemplate redis = new RedisTemplate();
+ redis.setConnectionFactory(cf);
+ return redis;
+ }
+
+ @Bean
+ public StringRedisTemplate stringRedisTemplate(RedisConnectionFactory cf) {
+ StringRedisTemplate redis = new StringRedisTemplate();
+ redis.setConnectionFactory(cf);
+ return redis;
+ }
+}
diff --git a/src/main/java/com/ifish/config/RootConfig.java b/src/main/java/com/ifish/config/RootConfig.java
new file mode 100644
index 0000000..32edde0
--- /dev/null
+++ b/src/main/java/com/ifish/config/RootConfig.java
@@ -0,0 +1,28 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.ifish.config;
+
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.ComponentScan.Filter;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.FilterType;
+import org.springframework.context.annotation.Import;
+import org.springframework.context.annotation.ImportResource;
+import org.springframework.web.servlet.config.annotation.EnableWebMvc;
+
+/**
+ *
+ * @author Administrator
+ */
+@Configuration
+//@Import(MybatisConfig.class) //导入数据库文件配置
+@ImportResource("classpath:quartz.xml")
+@ComponentScan(basePackages = {"com.ifish.*"},
+ excludeFilters = {
+ @Filter(type = FilterType.ANNOTATION, value = EnableWebMvc.class)})
+public class RootConfig {
+
+}
diff --git a/src/main/java/com/ifish/config/WebAppInitializer.java b/src/main/java/com/ifish/config/WebAppInitializer.java
new file mode 100644
index 0000000..91d343f
--- /dev/null
+++ b/src/main/java/com/ifish/config/WebAppInitializer.java
@@ -0,0 +1,54 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.ifish.config;
+
+import javax.servlet.Filter;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.support.FileSystemXmlApplicationContext;
+import org.springframework.web.filter.CharacterEncodingFilter;
+import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
+
+/**
+ *
+ * @author Administrator
+ */
+public class WebAppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
+
+ @Override
+ protected Class>[] getRootConfigClasses() {
+ return new Class>[]{RootConfig.class, MybatisConfig.class};//applicationContext().getClass()
+ }
+
+ @Override
+ protected Class>[] getServletConfigClasses() {
+ return new Class>[]{WebConfig.class};
+ }
+
+ @Override
+ protected String[] getServletMappings() {
+ return new String[]{"/"};
+ }
+
+ @Override
+ protected Filter[] getServletFilters() {
+ return null;
+ }
+
+ @Bean
+ public ApplicationContext applicationContext() {
+ ApplicationContext ct = new FileSystemXmlApplicationContext(this.getClass().getClassLoader().getResource("quartz.xml").getFile());
+ return ct;
+ }
+
+ @Bean
+ public Filter characterEncodingFilter() {
+ CharacterEncodingFilter filter = new CharacterEncodingFilter();
+ filter.setEncoding("UTF-8");
+ filter.setForceEncoding(true);
+ return filter;
+ }
+}
diff --git a/src/main/java/com/ifish/config/WebConfig.java b/src/main/java/com/ifish/config/WebConfig.java
new file mode 100644
index 0000000..361b0ae
--- /dev/null
+++ b/src/main/java/com/ifish/config/WebConfig.java
@@ -0,0 +1,56 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.ifish.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.ViewResolver;
+import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
+import org.springframework.web.servlet.config.annotation.EnableWebMvc;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
+import org.springframework.web.servlet.view.InternalResourceViewResolver;
+
+/**
+ *
+ * @author Administrator
+ */
+@Configuration
+/**
+ * 启动SpringMVC
+ */
+@EnableWebMvc
+/**
+ * 启动组件扫描器,com.mymvc.controller是包
+ */
+@ComponentScan("com.ifish.controller")
+public class WebConfig extends WebMvcConfigurerAdapter {
+
+ /**
+ * 配置视图解析器
+ *
+ * @return
+ */
+ @Bean
+ public ViewResolver viewResolver() {
+ InternalResourceViewResolver resolver = new InternalResourceViewResolver();
+ resolver.setPrefix("/WEB-INF/views/");
+ resolver.setSuffix(".jsp");
+ resolver.setExposeContextBeansAsAttributes(true);
+ return resolver;
+ }
+
+ /**
+ * 配置静态资源的处理
+ *
+ * @param configurer
+ */
+ @Override
+ public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
+ configurer.enable();;
+ }
+
+}
diff --git a/src/main/java/com/ifish/controller/Index.java b/src/main/java/com/ifish/controller/Index.java
new file mode 100644
index 0000000..63c9b31
--- /dev/null
+++ b/src/main/java/com/ifish/controller/Index.java
@@ -0,0 +1,27 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.ifish.controller;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.servlet.ModelAndView;
+
+/**
+ *
+ * @author Administrator
+ */
+@Controller
+public class Index {
+
+ @RequestMapping(value = {"/", "/index", ""}, method = RequestMethod.GET)
+ public ModelAndView index() {
+ ModelAndView mv = new ModelAndView();
+ mv.setViewName("index");
+ return mv;
+ }
+
+}
diff --git a/src/main/java/com/ifish/enums/PhoneTypeEnum.java b/src/main/java/com/ifish/enums/PhoneTypeEnum.java
new file mode 100644
index 0000000..e5d16a0
--- /dev/null
+++ b/src/main/java/com/ifish/enums/PhoneTypeEnum.java
@@ -0,0 +1,29 @@
+package com.ifish.enums;
+
+public enum PhoneTypeEnum {
+ ios("ios","ios"),
+ android("android","安卓");
+
+ private PhoneTypeEnum(String key,String value){
+ this.key = key;
+ this.value = value;
+ }
+
+ private String key;
+ private String value;
+
+
+ public String getKey() {
+ return key;
+ }
+ public void setKey(String key) {
+ this.key = key;
+ }
+ public String getValue() {
+ return value;
+ }
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+}
diff --git a/src/main/java/com/ifish/enums/PushTypeEnum.java b/src/main/java/com/ifish/enums/PushTypeEnum.java
new file mode 100644
index 0000000..e9d153e
--- /dev/null
+++ b/src/main/java/com/ifish/enums/PushTypeEnum.java
@@ -0,0 +1,39 @@
+package com.ifish.enums;
+
+public enum PushTypeEnum {
+ remove_device("remove_device", "OUT OF CONTROL"),//解绑通知
+ wendu_warn("wendu_warn", "TEMPERTURE WARNING"),//温度预警
+ qu_reply("qu_reply", "问题反馈"),
+ app_update("app_update", "UPDATE NOTICE"),//IOS更新推送
+ remind_water("remind_water", "WATER CHANGE NOTIEC"),//换水提醒
+ offline_push("offline_push", "OFF-LINE NOTICE"),//离线通知
+ send_report("send_report", "看护报告"),
+ shops_push("shops_push", "看护通知"),
+ all_push("all_push", "所有用户推送"),
+ pinglun_push("pinglun_push", "直播间评论");
+
+ private PushTypeEnum(String key, String value) {
+ this.key = key;
+ this.value = value;
+ }
+
+ private String key;
+ private String value;
+
+ public String getKey() {
+ return key;
+ }
+
+ public void setKey(String key) {
+ this.key = key;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+}
diff --git a/src/main/java/com/ifish/enums/SubDirectoryEnum.java b/src/main/java/com/ifish/enums/SubDirectoryEnum.java
new file mode 100644
index 0000000..2715c25
--- /dev/null
+++ b/src/main/java/com/ifish/enums/SubDirectoryEnum.java
@@ -0,0 +1,45 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.ifish.enums;
+
+/**
+ *
+ * @author Administrator
+ */
+public enum SubDirectoryEnum {
+ headImage("app/", "头像"),
+ banner("banner/", "banner图"),
+ look("look/", "看护报告"),
+ ueditorHtml("ueditorHtml/", "后台生成的网页"),
+ adInfo("Img/adInfo/", "广告图片"),
+ information("Img/information/", "资讯图片"),
+ ifishGoods("Img/goods/", "商品图片"),
+ ifishCommodity("Img/commodity/", "商家商品介绍图");
+
+ private SubDirectoryEnum(String key, String value) {
+ this.key = key;
+ this.value = value;
+ }
+
+ private String key;
+ private String value;
+
+ public String getKey() {
+ return key;
+ }
+
+ public void setKey(String key) {
+ this.key = key;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+}
diff --git a/src/main/java/com/ifish/helper/PushMessageHelper.java b/src/main/java/com/ifish/helper/PushMessageHelper.java
new file mode 100644
index 0000000..3cb4488
--- /dev/null
+++ b/src/main/java/com/ifish/helper/PushMessageHelper.java
@@ -0,0 +1,36 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.ifish.helper;
+
+import com.ifish.bean.Tbl_Push_List;
+import com.ifish.mapper.Tbl_Push_List_Mapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ *
+ * @author Administrator
+ */
+@Component
+public class PushMessageHelper implements PushMessageHelperI {
+
+ @Autowired
+ private Tbl_Push_List_Mapper tbl_Push_List_Mapper;
+
+ @Override
+ public Tbl_Push_List save(Tbl_Push_List pushList) {
+ try {
+ int i = tbl_Push_List_Mapper.saveTbl_Push_List(pushList);
+ if (i > 0) {
+ return pushList;
+ } else {
+ return null;
+ }
+ } catch (Exception e) {
+ return null;
+ }
+ }
+}
diff --git a/src/main/java/com/ifish/helper/PushMessageHelperI.java b/src/main/java/com/ifish/helper/PushMessageHelperI.java
new file mode 100644
index 0000000..75db91c
--- /dev/null
+++ b/src/main/java/com/ifish/helper/PushMessageHelperI.java
@@ -0,0 +1,17 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.ifish.helper;
+
+import com.ifish.bean.Tbl_Push_List;
+
+/**
+ *
+ * @author Administrator
+ */
+public interface PushMessageHelperI {
+
+ Tbl_Push_List save(Tbl_Push_List pushList);
+}
diff --git a/src/main/java/com/ifish/job/job.java b/src/main/java/com/ifish/job/job.java
new file mode 100644
index 0000000..fc4a525
--- /dev/null
+++ b/src/main/java/com/ifish/job/job.java
@@ -0,0 +1,232 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.ifish.job;
+
+import com.ifish.bean.Tbl_Push_List;
+import com.ifish.enums.PhoneTypeEnum;
+import com.ifish.enums.PushTypeEnum;
+import com.ifish.helper.PushMessageHelperI;
+import com.ifish.jpush.JPushNotification;
+import com.ifish.jpush.JiGuangPush;
+import com.ifish.mapper.Tbl_Tmp_Push_Remind_Mapper;
+import com.ifish.util.IfishUtil;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ *
+ * @author Administrator
+ */
+public class job {
+
+ private Connection connection = null;
+ private Statement stmt = null;
+ private PreparedStatement prest = null;
+
+ /**
+ * 查询需要推送的用户并且推送完修改为下一次提醒日期
+ */
+ public void pushRemind() {
+ System.out.println(new Date() + "开始任务");
+ try {
+ Class.forName("com.mysql.jdbc.Driver");
+ connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/myfishdb?characterEncoding=UTF-8", "ifish", "ifish7pwd");
+ stmt = connection.createStatement();
+ prest = connection.prepareStatement("update tbl_tmp_push_remind set is_push=? where user_id=? and device_id=?");
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ }
+ //结果集
+ ResultSet result = null;
+ try {
+ //推送提醒数
+ int rowCount = 0;
+ //按分页来获取数据
+ int pageNo = 0;
+ //云信限制每次最多500条
+ int pageSize = 500;
+ //查询总共需要推送的用户数
+ String countSql = "select count(1) as countRow from tbl_tmp_push_remind where is_push='0'";
+ result = stmt.executeQuery(countSql);
+ if (result.next()) {
+ rowCount = result.getInt("countRow");
+ pageNo = (rowCount + pageSize - 1) / pageSize;
+ }
+ System.out.println(pageNo);
+ for (int i = 0; i < pageNo; i++) {
+ result = stmt.executeQuery("select device_id,user_id,show_name,login_type from tbl_tmp_push_remind where is_push='0' limit 0," + pageSize);
+ //推送的用户
+ List androidUser = new ArrayList();
+ List iosUser = new ArrayList();
+ List