初始化

This commit is contained in:
谢洪龙 2017-08-23 12:24:08 +08:00
commit cfd92a4384
156 changed files with 3026 additions and 0 deletions

19
nb-configuration.xml Normal file
View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-shared-configuration>
<!--
This file contains additional configuration written by modules in the NetBeans IDE.
The configuration is intended to be shared among all the users of project and
therefore it is assumed to be part of version control checkout.
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
-->
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
<!--
Properties that influence various parts of the IDE, especially code formatting and the like.
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
That way multiple projects can share the same settings (useful for formatting rules for example).
Any value defined here will override the pom.xml file value but is only applicable to the current project.
-->
<org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>1.6-web</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>
<org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>Tomcat</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>
</properties>
</project-shared-configuration>

244
pom.xml Normal file
View File

@ -0,0 +1,244 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ifish</groupId>
<artifactId>quartzProEnglish</artifactId>
<version>1.0</version>
<packaging>war</packaging>
<name>quartzProEnglish</name>
<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.sun.xml.ws/jaxws-tools -->
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-tools</artifactId>
<version>2.2.10</version>
<type>pom</type>
</dependency>
<!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20170516</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.mina/mina-core -->
<dependency>
<groupId>org.apache.mina</groupId>
<artifactId>mina-core</artifactId>
<version>2.0.16</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.quartz-scheduler/quartz -->
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>org.csource</groupId>
<artifactId>fastdfs-client-java</artifactId>
<version>1.25</version>
<scope>system</scope>
<systemPath>${basedir}/src/main/webapp/WEB-INF/lib/fastdfs-client-java-1.25.jar</systemPath>
</dependency>
<dependency>
<groupId>cn.jpush.api</groupId>
<artifactId>jpush-client</artifactId>
<version>3.2.17</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.5</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.28</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
<version>1.8.4.RELEASE</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
<version>2.4.2</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.9.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>c3p0</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.1.2</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk15</classifier>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-context -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.3.9.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-beans -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>4.3.9.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-core -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>4.3.9.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-web -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.3.9.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-webmvc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.3.8.RELEASE</version>
<type>jar</type>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>4.3.9.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.4</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis-spring -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>cn.jpush.api</groupId>
<artifactId>jiguang-common</artifactId>
<version>1.0.3</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.6.Final</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.3</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.13</version>
<type>jar</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<compilerArguments>
<endorseddirs>${endorsed.dir}</endorseddirs>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${endorsed.dir}</outputDirectory>
<silent>true</silent>
<artifactItems>
<artifactItem>
<groupId>javax</groupId>
<artifactId>javaee-endorsed-api</artifactId>
<version>6.0</version>
<type>jar</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

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

View File

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

View File

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

View File

@ -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<String, String> redisTemplate(RedisConnectionFactory cf) {
RedisTemplate<String, String> redis = new RedisTemplate<String, String>();
redis.setConnectionFactory(cf);
return redis;
}
@Bean
public StringRedisTemplate stringRedisTemplate(RedisConnectionFactory cf) {
StringRedisTemplate redis = new StringRedisTemplate();
redis.setConnectionFactory(cf);
return redis;
}
}

View File

@ -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 {
}

View File

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

View File

@ -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();;
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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<String> androidUser = new ArrayList<String>();
List<String> iosUser = new ArrayList<String>();
List<Map> androidlist = new ArrayList<Map>();
List<Map> ioslist = new ArrayList<Map>();
//更新提醒过的用户
while (result.next()) {
Integer deviceId = result.getInt("device_id");
Integer userId = result.getInt("user_id");
String loginType = result.getString("login_type");
String showName = result.getString("show_name");
prest.setString(1, "1");
prest.setInt(2, userId);
prest.setInt(3, deviceId);
prest.addBatch();
//推送参数
Map<String, String> pushMap = new HashMap<String, String>();
pushMap.put("device_id", deviceId.toString());
pushMap.put("device_name", showName);
pushMap.put("timestamp", IfishUtil.format2(new Date()));
pushMap.put("msg_type", PushTypeEnum.remind_water.getKey());
//极光
if (loginType.toLowerCase().equals(PhoneTypeEnum.android.getKey())) {
androidUser.add(userId.toString());
androidlist.add(pushMap);
} else if (loginType.toLowerCase().equals(PhoneTypeEnum.ios.getKey())) {
iosUser.add(userId.toString());
ioslist.add(pushMap);
}
}
//发送云信消息
// if (ids.size() > 0) {
// neteaseIM.sendBatchMsg("ifish", JSONArray.fromObject(ids).toString(), "【换水提醒】您的水族箱需要换水啦~您可以在水箱设置中更改提醒设置");
// }
//极光推送
Integer iosSize = iosUser.size();
Integer androidSize = androidUser.size();
if (iosSize > 0) {
push(PhoneTypeEnum.ios, iosUser.toArray(new String[iosSize]), ioslist);
}
if (androidSize > 0) {
push(PhoneTypeEnum.android, androidUser.toArray(new String[androidSize]), androidlist);
}
//批量提交
prest.executeBatch();
//云信一分钟访问不超过120次
Thread.sleep(600);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
if (result != null) {
try {
result.close();
result = null;
} catch (SQLException e) {
e.printStackTrace();
}
}
if (stmt != null) {
try {
stmt.close();
stmt = null;
} catch (SQLException e) {
e.printStackTrace();
}
}
if (prest != null) {
try {
prest.close();
prest = null;
} catch (SQLException e) {
e.printStackTrace();
}
}
if (connection != null) {
try {
connection.close();
connection = null;
} catch (SQLException e) {
e.printStackTrace();
}
}
}
}
/**
* 推送提醒
*
* @param type
* @param ids
*/
public void push(PhoneTypeEnum type, String[] ids, List<Map> list) {
try {
//推送IOS
if (type.equals(PhoneTypeEnum.ios)) {
System.out.println(new Date() + "ios推送" + ids.length + "");
jPushNotifcation(list, ids, type.getKey());
} else {
System.out.println(new Date() + "android推送" + ids.length + "");
jPushNotifcation(list, ids, type.getKey());
}
} catch (Exception e) {
e.printStackTrace();
}
}
@Autowired
private JiGuangPush jiGuangPush;
@Autowired
private PushMessageHelperI pushMessageHelperI;
/**
* 极光推送(换水提醒)
*
* @param pushMap
* @param userId
* @param loginType
* @return
*/
public boolean jPushNotifcation(List<Map> list, String[] userId, String loginType) {
try {
if (loginType != null) {
//推送消息类型
String msgType = PushTypeEnum.remind_water.getKey();
String title = "WATER CHANGE NOTIEC";
String content = "Your aquarium need change it water !";
boolean result = false;
if (loginType.equals("ios")) {
result = jiGuangPush.pushMessageByIOS(title, content, userId);
} else if (loginType.equals("android")) {
result = jiGuangPush.pushMessageByAndroid(title, content, userId, null);
}
for (int i = 0; i < userId.length; i++) {
//推送记录
Tbl_Push_List pushList = new Tbl_Push_List();
pushList.setUserId(Integer.valueOf(userId[i]));
pushList.setDeviceId(Integer.valueOf(list.get(i).get("device_id").toString()));
pushList.setPhoneType(loginType);
pushList.setShowName(list.get(i).get("showName").toString());
pushList.setPushType(msgType);
pushList.setPushTitle(title);
pushList.setPushContext(content);
pushList.setJpushStatus(result ? "1" : "0");
pushList.setCreateTime(new Date());
pushMessageHelperI.save(pushList);
return true;
}
}
} catch (Exception e) {
throw new RuntimeException();
}
return false;
}
}

View File

@ -0,0 +1,52 @@
/*
* 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.jpush;
import cn.jiguang.common.resp.APIConnectionException;
import cn.jiguang.common.resp.APIRequestException;
import cn.jpush.api.JPushClient;
import cn.jpush.api.push.PushResult;
import com.google.gson.JsonObject;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author Administrator
*/
public class JPushNotification {
protected final Logger LOG = LoggerFactory.getLogger(JPushNotification.class);
JPushClient jpushClient = null;
public JPushNotification(String appKey, String masterSecret, boolean productionModel) {
jpushClient = new JPushClient(masterSecret, appKey, productionModel, 86400);
}
public void sendIosNotification(String[] alias, String title, String body, Map<String, String> extras) {
try {
JsonObject json = new JsonObject();
json.addProperty("title", title);
json.addProperty("body", body);
PushResult result = jpushClient.sendIosNotificationWithAlias(json, extras, alias);
} catch (APIConnectionException e) {
LOG.error("Connection error. Should retry later. ", e);
} catch (APIRequestException e) {
LOG.error("Error Message: " + e.getMessage());
}
}
/*public void sendAndroidNotification(String[] alias,String title,String alert,Map<String,String> map) {
try {
PushResult result = jpushClient.sendAndroidNotificationWithAlias(title ,alert, map, alias);
} catch (APIConnectionException e) {
LOG.error("Connection error. Should retry later. ", e);
} catch (APIRequestException e) {
LOG.error("Error Message: " + e.getMessage());
}
}*/
}

View File

@ -0,0 +1,96 @@
/*
* 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.jpush;
import cn.jpush.api.JPushClient;
import cn.jpush.api.push.PushResult;
import cn.jpush.api.push.model.Message;
import cn.jpush.api.push.model.Options;
import cn.jpush.api.push.model.Platform;
import cn.jpush.api.push.model.PushPayload;
import cn.jpush.api.push.model.audience.Audience;
import cn.jpush.api.push.model.audience.AudienceTarget;
import cn.jpush.api.push.model.notification.IosNotification;
import cn.jpush.api.push.model.notification.Notification;
import java.util.Map;
import org.springframework.stereotype.Component;
/**
*
* @author Administrator
*/
@Component
public class JiGuangPush {
private static JPushClient jPushClient = null;
//正式
// private static final String masterSecret = "60162c8cf195ce9f4dc76629";
// private static final String appKey = "d970d5e193cb2a0bbe41653c";
//测试
private final static String masterSecret = "4f759a0609dcd9d2edb06125";
private final static String appKey = "6e5e9d757570859b3f274bb8";
static {
jPushClient = new JPushClient(masterSecret, appKey);
}
/**
* 向安卓手机推送一条信息
*
* @param message
* @return
*/
public boolean pushMessageByAndroid(String title, String message, String[] userId, Map map) {
try {
PushPayload payload = PushPayload.newBuilder()
.setPlatform(Platform.android())
.setAudience(Audience.newBuilder().addAudienceTarget(AudienceTarget.alias(userId)).build())
.setNotification(Notification.android(title, message, map))
.setMessage(Message.newBuilder().setTitle(title).setMsgContent(message).addExtras(map).build())
.build();
PushResult result = jPushClient.sendPush(payload);
if (result.msg_id > 0 && result.isResultOK()) {
return true;
}
} catch (Exception e) {
}
return false;
}
/**
* 向苹果手机推送一条信息
*
* @param title
* @param message
* @param userId
* @param map
* @return
*/
public boolean pushMessageByIOS(String title, String message, String[] userId) {
try {
PushPayload payload = PushPayload.newBuilder()
.setPlatform(Platform.ios())
.setAudience(Audience.newBuilder().addAudienceTarget(AudienceTarget.alias(userId)).build())
.setNotification(Notification.newBuilder().addPlatformNotification(IosNotification.newBuilder().setSound("happy").setAlert(message).build()).build())
.setMessage(Message.newBuilder().setTitle(title).setMsgContent(message).build())
.setOptions(Options.newBuilder().setApnsProduction(false).build())
.build();
PushResult result = jPushClient.sendPush(payload);
if (result.msg_id > 0 && result.isResultOK()) {
return true;
}
} catch (Exception e) {
String b = e.getMessage();
String a = "";
}
return false;
}
}

View File

@ -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.mapper;
import com.ifish.bean.Tbl_Push_List;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
/**
*
* @author Administrator
*/
public interface Tbl_Push_List_Mapper {
/**
* 插入一条推送信息
*
* @param tbl_Push_List
* @return
*/
@Insert("INSERT INTO TBL_PUSH_LIST(user_id,device_id,show_name,phone_type,push_type,push_title,push_context,create_time,push_link,jpush_status,google_status,report_id,mcu_count,modular_count,router_count,server_count,server_try_count) VALUES (#{push.userId},#{push.deviceId},#{push.showName},#{push.phoneType},"
+ "#{push.pushType},#{push.pushTitle},#{push.pushContext},NOW(),#{push.pushLink},#{push.jpushStatus},#{push.googleStatus},#{push.reportId},#{push.mcuCount},#{push.modularCount},#{push.routerCount},#{push.serverCount},#{push.serverTryCount})")
Integer saveTbl_Push_List(@Param("push") Tbl_Push_List tbl_Push_List);
}

View File

@ -0,0 +1,42 @@
/*
* 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.mapper;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
/**
*
* @author Administrator
*/
public class Tbl_Push_List_MapperSql {
public String getPushList(@Param("userid") Integer userId, @Param("pushtype") String pushType, @Param("pagesize") Integer pageSize, @Param("first") Integer firstResult) {
StringBuilder sb = new StringBuilder();
sb.append("SELECT push_id,user_id,device_id,show_name,phone_type,push_type,push_title,push_context,create_time,push_link,jpush_status,google_status FROM TBL_PUSH_LIST WHERE ");
sb.append("user_id = #{userid} ");
if (StringUtils.isNotBlank(pushType)) {
sb.append("AND push_type = #{pushtype} ");
}
sb.append("ORDER BY push_id DESC LIMIT ").append(firstResult).append(",").append(pageSize);
return sb.toString();
}
public String getPushListCount(@Param("userid") Integer userId, @Param("pushtype") String pushType) {
StringBuilder sb = new StringBuilder();
sb.append("SELECT count(1) FROM TBL_PUSH_LIST WHERE ");
sb.append("user_id = #{userid} ");
if (StringUtils.isNotBlank(pushType)) {
sb.append("AND push_type = #{pushtype} ");
}
return sb.toString();
}
}

View File

@ -0,0 +1,24 @@
/*
* 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.mapper;
import org.apache.ibatis.annotations.Select;
/**
*
* @author Administrator
*/
public interface Tbl_Tmp_Push_Remind_Mapper {
/**
* 查询需要推送信息的用户总数
*
* @return
*/
@Select("select count(1) as countRow from tbl_tmp_push_remind where is_push='0'")
Integer getUserCountByPush();
}

View File

@ -0,0 +1,90 @@
/*
* 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.util;
import com.ifish.enums.SubDirectoryEnum;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.util.Properties;
/**
*
* @author Administrator
*/
public class IfishFilePath {
/**
* 图片头地址
*/
public static String link_img_head;
//图片上传格式
public static String check_style;
public static String AppKeyFormal;
public static String MasterSecretFormal;
public static String AppKey;
public static String MasterSecret;
static {
Properties prop = new Properties();
InputStream in = IfishFilePath.class.getResourceAsStream("/property.properties");
try {
prop.load(in);
//利用反射机制给属性赋值
Field[] fields = IfishFilePath.class.getDeclaredFields();
for (Field field : fields) {
String name = field.getName();
//获取property.properties的值
String value = prop.getProperty(name).trim();
//判断这个值希望塞入的变量类型并进行转换
Object value1 = getValue(value, field);
//转换完成后塞入此变量
field.set(IfishFilePath.class, value1);
}
in.close();
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 验证图片格式
*/
public static String checkImgName(String fileName) {
//对格式进行验证
int index = fileName.lastIndexOf(".");
String extEndName = fileName.substring(++index, fileName.length());
if (check_style.indexOf(extEndName.toUpperCase()) == -1) {
return null;
}
//返回格式.png
return "." + extEndName;
}
/**
* 获取图片链接地址
*
* @param type
* @return
*/
public static String getPath(SubDirectoryEnum pictureEnum, String fileName) {
return link_img_head + pictureEnum.getKey() + fileName;
}
private static Object getValue(String value, Field field) {
if (field.getType().equals(int.class)) {
return Integer.valueOf(value);
} else if (field.getType().equals(boolean.class)) {
return Boolean.valueOf(value);
}
return value;
}
}

View File

@ -0,0 +1,466 @@
/*
* 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.util;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.UnsupportedEncodingException;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.type.JavaType;
import org.springframework.web.multipart.MultipartFile;
/**
*
* @author Administrator
*/
public class IfishUtil {
private static final String formatDate = "yyyy-MM-dd HH:mm:ss";
private static final String formatDate3 = "MM-dd HH:mm";
private static final String formatDate2 = "yyyy-MM-dd HH:mm";
private static final String formatDate1 = "yyyy-MM-dd";
/**
* 测试缓存时间一分钟单位
*/
public static final int CacheTime_Test_SECONDS = 60;
/**
* 缓存时间一秒单位
*/
public static final int CacheTime_SECONDS = 1;
/**
* 缓存时间一分钟单位
*/
public static final int CacheTime_MINUTES = 1;
/**
* 缓存时间一小时单位小时
*/
public static final int CacheTime_HOURS = 1;
/**
* 缓存时间一天单位
*/
public static final int CacheTime_DAYS = 1;
/**
* 是否在线上运行,true在线上false在测试环境
*
* @return
*/
public static boolean isOnLine() {
if (IfishFilePath.link_img_head.contains("ifish7")) {
return true;
} else {
return false;
}
}
/**
* Object转Json
*/
public static String ObjectToJson(Object value) {
try {
if (value == null) {
return null;
}
ObjectMapper mapper = new ObjectMapper();
String js = mapper.writeValueAsString(value);
return js;
} catch (Exception ex) {
System.out.println("【异常信息】 >>> " + ex.toString());
return "Error";
}
}
/**
* Json转ObjectList
*
* @param json 需要转换的JSON字符串
* @param bean JavaBean,
* @return 拿到结果需要强转一次因为你拿到的是Object, 例如这样调用和强转 List&lt;School&gt; lst
* =(List&lt;School&gt;)StringUtil.JsonToObjectList(value, School.class);
*/
public static Object JsonToList(String json, Class<?> bean) throws Exception {
ObjectMapper mapper = new ObjectMapper();
JavaType javaType = mapper.getTypeFactory().constructParametricType(List.class, bean);
return mapper.readValue(json, javaType);
}
/**
* Json转ObjectJavaBean
*
* @param json 需要转换的JSON字符串
* @param bean JavaBean,
* @return 拿到结果需要强转一次因为你拿到的是Object, 例如这样调用和强转 School lst
* =(School)StringUtil.JsonToObjectList(value, School.class);
*/
public static Object JsonToBean(String json, Class<?> bean) throws Exception {
ObjectMapper mapper = new ObjectMapper();
JavaType javaType = mapper.getTypeFactory().uncheckedSimpleType(bean);
return mapper.readValue(json, javaType);
}
/**
* 将json格式的字符串解析成Map对象
*/
public static Map<String, Map<String, String>> JsonToMap(String json) {
try {
ObjectMapper mapper = new ObjectMapper();
Map<String, Map<String, String>> maps = mapper.readValue(json, Map.class);
return maps;
} catch (Exception e) {
System.out.println("【异常信息】 >>> " + e.toString());
return null;
}
}
public static Map<String, Map> JsonToMapContainMap(String json) {
try {
ObjectMapper mapper = new ObjectMapper();
Map<String, Map> maps = mapper.readValue(json, Map.class);
return maps;
} catch (Exception e) {
System.out.println("【异常信息】 >>> " + e.toString());
return null;
}
}
public static Map JsonToRealMap(String json) {
try {
ObjectMapper mapper = new ObjectMapper();
Map maps = mapper.readValue(json, Map.class);
return maps;
} catch (Exception e) {
System.out.println("【异常信息】 >>> " + e.toString());
return null;
}
}
//返回时分秒的时间字符串
public static String TimestampToStringAndSecond(Object timestamp) {
DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
return (format.format(timestamp));
} catch (Exception e) {
System.out.println("【isGaokaoYearExpire 异常】:" + e);
return "";
}
}
//返回时分秒的时间字符串
public static String TimestampToStringAndSecond(Object timestamp, String geshi) {
DateFormat format = new SimpleDateFormat(geshi);
try {
return (format.format(timestamp));
} catch (Exception e) {
System.out.println("【isGaokaoYearExpire 异常】:" + e);
return "";
}
}
/**
* 返回当前日期yyyy-MM-dd
*
* @return
* @throws ParseException
*/
public static Date getCurDate() {
DateFormat df = DateFormat.getDateInstance();
try {
return df.parse(df.format(new Date()));
} catch (ParseException e) {
}
return null;
}
/**
* 格式化日期yyyy-MM-dd HH:mm:ss
*
* @param date
* @return
*/
public static String format(Date date) {
SimpleDateFormat format = new SimpleDateFormat(formatDate);
return format.format(date);
}
/**
* 格式化日期
*
* @param date
* @return
*/
public static String format1(Date date) {
SimpleDateFormat format = new SimpleDateFormat(formatDate1);
return format.format(date);
}
/**
* 格式化日期
*
* @param date
* @return
*/
public static String format2(Date date) {
SimpleDateFormat format = new SimpleDateFormat(formatDate2);
return format.format(date);
}
/**
* 格式化日期
*
* @param date
* @return
*/
public static String format3(Date date) {
SimpleDateFormat format = new SimpleDateFormat(formatDate3);
return format.format(date);
}
/**
* 字符串转换成日期
*
* @param str
* @return date
*/
public static Date StrToDate(String str) {
SimpleDateFormat format = new SimpleDateFormat(formatDate1);
Date date = null;
try {
date = format.parse(str);
} catch (ParseException e) {
e.printStackTrace();
}
return date;
}
/**
* 随机生成字母与数字组合
*
* @param length
* @return
*/
public static String getCharAndNumr(int length) {
String val = "";
Random random = new Random();
for (int i = 0; i < length; i++) {
// 输出字母还是数字
String charOrNum = random.nextInt(2) % 2 == 0 ? "char" : "num";
// 字符串
if ("char".equalsIgnoreCase(charOrNum)) {
// 取得大写字母还是小写字母
int choice = random.nextInt(2) % 2 == 0 ? 65 : 97;
val += (char) (choice + random.nextInt(26));
// 数字
} else if ("num".equalsIgnoreCase(charOrNum)) {
val += String.valueOf(random.nextInt(10));
}
}
return val;
}
/**
* 返回json数据
*
* @param str
* @return
*/
public static Map<String, Object> returnJson(String key, Object value) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("result", key);
if (value.equals("")) {
map.put("data", null);
} else {
map.put("data", value);
}
return map;
}
/**
* 返回json数据
*
* @param str
* @return
*/
public static Map<String, Object> toJson(String key, Object value) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("result", key);
if (value.equals("")) {
map.put("data", null);
} else {
map.put("data", value);
}
return map;
}
/**
* 上传图片文件
*
* @param fileUpload
* @param path
* @return
*/
public static String uploadFile(MultipartFile fileUpload, String path) {
//根据时间得文件名
Calendar calendar = Calendar.getInstance();
String fileName = String.valueOf(calendar.getTimeInMillis());
//保存文件
if (fileUpload == null) {
return "base/default.png";
}
if (!fileUpload.isEmpty()) {
try {
if (!fileUpload.getOriginalFilename().equals("")) {
File picFile = new File(path, fileName + ".png");
//不存在则创建
if (!picFile.exists()) {
picFile.mkdirs();
}
//保存
fileUpload.transferTo(picFile);
}
return "share/" + fileName + ".png";
} catch (Exception e) {
throw new RuntimeException(e);
}
}
return "";
}
/**
* 生成微信分享页面
*
* @param title
* @param base64
* @return
*/
public static String getHtmlFile(String title, String pngName, String modelFile, String filePath) {
try {
if (pngName != null && !pngName.equals("")) {
//读取模板文件
FileInputStream fileinputstream = new FileInputStream(filePath + modelFile);
int lenght = fileinputstream.available();
byte bytes[] = new byte[lenght];
fileinputstream.read(bytes);
fileinputstream.close();
String templateContent = new String(bytes);
//替换掉模板中相应的地方
templateContent = templateContent.replaceAll("###title###", title);
templateContent = templateContent.replaceAll("###fileName###", pngName);
//根据时间得文件名
Calendar calendar = Calendar.getInstance();
String fileName = String.valueOf(calendar.getTimeInMillis());
fileName = fileName + ".html";
//建立文件输出流
FileOutputStream fileoutputstream = new FileOutputStream(filePath + fileName);
byte tag_bytes[] = templateContent.getBytes();
fileoutputstream.write(tag_bytes);
fileoutputstream.close();
return fileName;
}
} catch (Exception e) {
throw new RuntimeException(e);
}
return "";
}
/**
* 随即区间整数
*
* @param min
* @param max
* @return
*/
public static int getRandom(int min, int max) {
int r = new Random().nextInt(max - min);
return r + min;
}
/**
* URL 解码
*
* @return String
* @author lifq
* @date 2015-3-17 下午04:09:51
*/
public static String getURLDecoderString(String str) {
String result = "";
if (null == str) {
return "";
}
try {
result = java.net.URLDecoder.decode(str, "GBK");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return result;
}
/**
* URL 转码
*
* @return String
* @author lifq
* @date 2015-3-17 下午04:10:28
*/
public static String getURLEncoderString(String str) {
String result = "";
if (null == str) {
return "";
}
try {
result = java.net.URLEncoder.encode(str, "GBK");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return result;
}
/**
* 正则表达式截取字符串
*
* @param str
* @param regex
* @return
*/
public static String regex(String str, String regex) {
Matcher matcher = Pattern.compile(regex).matcher(str);
if (matcher.find()) {
return matcher.group(0);
} else {
return "";
}
}
public static String regexToChinese(String str) {
String regex = "([\\u4e00-\\u9fa5]+)";
return regex(str, regex);
}
/**
* 验证当前系统是windows(本地返回true)还是unix(服务器返回false)
*
* @return
*/
public static boolean IsWinOrUnix() {
String os = System.getProperty("os.name");//获取当前操作系统
return os.toLowerCase().startsWith("win");
}
}

View File

@ -0,0 +1,32 @@
c3p0.driverClassName=com.mysql.jdbc.Driver
c3p0.url=jdbc\:mysql\://localhost\:3306/myfishdb?characterEncoding\=UTF-8
c3p0.username=ifish
c3p0.password=ifish7pwd
#c3p0.username=root
#c3p0.password=123456
c3p0.autoCommitOnClose=true
c3p0.initialPoolSize=50
c3p0.minPoolSize=50
c3p0.maxPoolSize=100
c3p0.acquireIncrement=3
c3p0.checkoutTimeout=5000
c3p0.maxIdleTime=7200
c3p0.idleConnectionTestPeriod=18000
#c3p0.maxIdleTimeExcessConnections=1800
#c3p0.automaticTestTable=C3P0TestTable
#c3p0.testConnectionOnCheckout=false
#c3p0.testConnectionOnCheckin=false
#org.hibernate.dialect.MySQLInnoDBDialect
hibernate.dialect=org.hibernate.dialect.MySQLDialect
hibernate.show_sql=false
hibernate.format_sql=true
hibernate.hbm2ddl.auto=false
hibernate.jdbc.batch_size=50
hibernate.query.substitutions=true 1,false 0
hibernate.cache.use_second_level_cache=false
hibernate.cache.use_query_cache=false
hibernate.cache.region.factory_class=org.hibernate.cache.ehcache.EhCacheRegionFactory

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true">
<!-- 尽量别用绝对路径,如果带参数不同容器路径解释可能不同 -->
<property name="LOG_HOME" value="/logs" />
<appender name="Console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{50} %msg%n</pattern>
</encoder>
</appender>
<!-- 按照每天生成日志文件 -->
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_HOME}/quartzPro/localhost.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<FileNamePattern>${LOG_HOME}/quartzPro/%d{yyyy-MM-dd}.log</FileNamePattern>
<MaxHistory>30</MaxHistory>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss} 【%-5level】 【%logger{50}】 %msg%n</pattern>
<charset>UTF-8</charset>
</encoder>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>WARN</level>
</filter>
</appender>
<!-- 将级别为“info”及大于“info”的日志信息传递给root处理本身并不打印 -->
<root level="INFO">
<!-- root将级别为“INFO”及大于“INFO”的日志信息交给已经配置好的名为“Console”的appender处理“Console”appender将信息打印到Console -->
<appender-ref ref="file" />
<!-- 标识这个appender将会添加到这个logger -->
<!-- <appender-ref ref="File" /> -->
</root>
</configuration>

View File

@ -0,0 +1,16 @@
#\u6b63\u5f0f\u73af\u5883\u6781\u5149AppKey
AppKeyFormal=123
#\u6b63\u5f0f\u73af\u5883\u6781\u5149Master Secret
MasterSecretFormal=123
#\u6d4b\u8bd5\u73af\u5883\u6781\u5149AppKey
AppKey=6e5e9d757570859b3f274bb8
#\u6d4b\u8bd5\u73af\u5883\u6781\u5149Master Secret
MasterSecret=4f759a0609dcd9d2edb06125
#\u672c\u5730
#link_img_head=http://192.168.61.128:81/
#\u6d4b\u8bd5\u73af\u5883
link_img_head=http://139.196.24.156:83/
#\u6b63\u5f0f\u73af\u5883
#link_img_head=https://app.ifish7.com/
#\u56fe\u7247\u683c\u5f0f\u9a8c\u8bc1
check_style=GIF,PNG,BMP,JPG,JPEG

View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.0.xsd"
default-lazy-init="true">
<!-- 启动触发器的配置开始 -->
<bean name="startQuertz" lazy-init="false" autowire="no"
class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="myJobTrigger" />
</list>
</property>
<property name="quartzProperties">
<props>
<prop key="org.quartz.scheduler.skipUpdateCheck">true</prop>
</props>
</property>
</bean>
<!-- 启动触发器的配置结束 -->
<!-- quartz-2.x的配置 -->
<bean id="myJobTrigger"
class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail">
<ref bean="myJobDetail" />
</property>
<property name="cronExpression">
<!--每天10点开始推送 -->
<value>0 0 10 * * ?</value>
</property>
</bean>
<!-- 调度的配置结束 -->
<!-- job的配置开始 -->
<bean id="myJobDetail"
class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject">
<ref bean="myJob" />
</property>
<property name="targetMethod">
<value>pushRemind</value>
</property>
</bean>
<!-- job的配置结束 -->
<!-- 工作的bean -->
<bean id="myJob" class=" com.ifish.job.job" />
<!-- 注册识别注解 -->
<context:annotation-config />
<!-- 导入外部的properties文件-->
<context:property-placeholder location="classpath*:jPpush.properties" ignore-unresolvable="true"/>
<!-- 极光推送 -->
<bean id="jPushNotification2" class="com.ifish.jpush.JPushNotification">
<constructor-arg index="0">
<!-- appKey -->
<value>${jpush.ios.appKey}</value>
</constructor-arg>
<constructor-arg index="1">
<!-- secret -->
<value>${jpush.ios.secret}</value>
</constructor-arg>
<constructor-arg index="2">
<!-- production -->
<value>${jpush.ios.productionMode}</value>
</constructor-arg>
</bean>
</beans>

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="/quartzProEnglish"/>

View File

@ -0,0 +1,17 @@
<%--
Document : index
Created on : 2017-8-7, 9:33:31
Author : Administrator
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>访问正常</title>
</head>
<body>
<h1>访问正常</h1>
</body>
</html>

View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,32 @@
c3p0.driverClassName=com.mysql.jdbc.Driver
c3p0.url=jdbc\:mysql\://localhost\:3306/myfishdb?characterEncoding\=UTF-8
c3p0.username=ifish
c3p0.password=ifish7pwd
#c3p0.username=root
#c3p0.password=123456
c3p0.autoCommitOnClose=true
c3p0.initialPoolSize=50
c3p0.minPoolSize=50
c3p0.maxPoolSize=100
c3p0.acquireIncrement=3
c3p0.checkoutTimeout=5000
c3p0.maxIdleTime=7200
c3p0.idleConnectionTestPeriod=18000
#c3p0.maxIdleTimeExcessConnections=1800
#c3p0.automaticTestTable=C3P0TestTable
#c3p0.testConnectionOnCheckout=false
#c3p0.testConnectionOnCheckin=false
#org.hibernate.dialect.MySQLInnoDBDialect
hibernate.dialect=org.hibernate.dialect.MySQLDialect
hibernate.show_sql=false
hibernate.format_sql=true
hibernate.hbm2ddl.auto=false
hibernate.jdbc.batch_size=50
hibernate.query.substitutions=true 1,false 0
hibernate.cache.use_second_level_cache=false
hibernate.cache.use_query_cache=false
hibernate.cache.region.factory_class=org.hibernate.cache.ehcache.EhCacheRegionFactory

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true">
<!-- 尽量别用绝对路径,如果带参数不同容器路径解释可能不同 -->
<property name="LOG_HOME" value="/logs" />
<appender name="Console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{50} %msg%n</pattern>
</encoder>
</appender>
<!-- 按照每天生成日志文件 -->
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_HOME}/quartzPro/localhost.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<FileNamePattern>${LOG_HOME}/quartzPro/%d{yyyy-MM-dd}.log</FileNamePattern>
<MaxHistory>30</MaxHistory>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss} 【%-5level】 【%logger{50}】 %msg%n</pattern>
<charset>UTF-8</charset>
</encoder>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>WARN</level>
</filter>
</appender>
<!-- 将级别为“info”及大于“info”的日志信息传递给root处理本身并不打印 -->
<root level="INFO">
<!-- root将级别为“INFO”及大于“INFO”的日志信息交给已经配置好的名为“Console”的appender处理“Console”appender将信息打印到Console -->
<appender-ref ref="file" />
<!-- 标识这个appender将会添加到这个logger -->
<!-- <appender-ref ref="File" /> -->
</root>
</configuration>

View File

@ -0,0 +1,16 @@
#\u6b63\u5f0f\u73af\u5883\u6781\u5149AppKey
AppKeyFormal=123
#\u6b63\u5f0f\u73af\u5883\u6781\u5149Master Secret
MasterSecretFormal=123
#\u6d4b\u8bd5\u73af\u5883\u6781\u5149AppKey
AppKey=6e5e9d757570859b3f274bb8
#\u6d4b\u8bd5\u73af\u5883\u6781\u5149Master Secret
MasterSecret=4f759a0609dcd9d2edb06125
#\u672c\u5730
#link_img_head=http://192.168.61.128:81/
#\u6d4b\u8bd5\u73af\u5883
link_img_head=http://139.196.24.156:83/
#\u6b63\u5f0f\u73af\u5883
#link_img_head=https://app.ifish7.com/
#\u56fe\u7247\u683c\u5f0f\u9a8c\u8bc1
check_style=GIF,PNG,BMP,JPG,JPEG

74
target/classes/quartz.xml Normal file
View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.0.xsd"
default-lazy-init="true">
<!-- 启动触发器的配置开始 -->
<bean name="startQuertz" lazy-init="false" autowire="no"
class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="myJobTrigger" />
</list>
</property>
<property name="quartzProperties">
<props>
<prop key="org.quartz.scheduler.skipUpdateCheck">true</prop>
</props>
</property>
</bean>
<!-- 启动触发器的配置结束 -->
<!-- quartz-2.x的配置 -->
<bean id="myJobTrigger"
class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail">
<ref bean="myJobDetail" />
</property>
<property name="cronExpression">
<!--每天10点开始推送 -->
<value>0 0 10 * * ?</value>
</property>
</bean>
<!-- 调度的配置结束 -->
<!-- job的配置开始 -->
<bean id="myJobDetail"
class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject">
<ref bean="myJob" />
</property>
<property name="targetMethod">
<value>pushRemind</value>
</property>
</bean>
<!-- job的配置结束 -->
<!-- 工作的bean -->
<bean id="myJob" class=" com.ifish.job.job" />
<!-- 注册识别注解 -->
<context:annotation-config />
<!-- 导入外部的properties文件-->
<context:property-placeholder location="classpath*:jPpush.properties" ignore-unresolvable="true"/>
<!-- 极光推送 -->
<bean id="jPushNotification2" class="com.ifish.jpush.JPushNotification">
<constructor-arg index="0">
<!-- appKey -->
<value>${jpush.ios.appKey}</value>
</constructor-arg>
<constructor-arg index="1">
<!-- secret -->
<value>${jpush.ios.secret}</value>
</constructor-arg>
<constructor-arg index="2">
<!-- production -->
<value>${jpush.ios.productionMode}</value>
</constructor-arg>
</bean>
</beans>

Binary file not shown.

View File

@ -0,0 +1,5 @@
#Generated by Maven
#Mon Aug 07 14:22:13 CST 2017
version=1.0
groupId=com.ifish
artifactId=quartzProEnglish

Binary file not shown.

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="/quartzProEnglish"/>

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="/quartzProEnglish"/>

View File

@ -0,0 +1,32 @@
c3p0.driverClassName=com.mysql.jdbc.Driver
c3p0.url=jdbc\:mysql\://localhost\:3306/myfishdb?characterEncoding\=UTF-8
c3p0.username=ifish
c3p0.password=ifish7pwd
#c3p0.username=root
#c3p0.password=123456
c3p0.autoCommitOnClose=true
c3p0.initialPoolSize=50
c3p0.minPoolSize=50
c3p0.maxPoolSize=100
c3p0.acquireIncrement=3
c3p0.checkoutTimeout=5000
c3p0.maxIdleTime=7200
c3p0.idleConnectionTestPeriod=18000
#c3p0.maxIdleTimeExcessConnections=1800
#c3p0.automaticTestTable=C3P0TestTable
#c3p0.testConnectionOnCheckout=false
#c3p0.testConnectionOnCheckin=false
#org.hibernate.dialect.MySQLInnoDBDialect
hibernate.dialect=org.hibernate.dialect.MySQLDialect
hibernate.show_sql=false
hibernate.format_sql=true
hibernate.hbm2ddl.auto=false
hibernate.jdbc.batch_size=50
hibernate.query.substitutions=true 1,false 0
hibernate.cache.use_second_level_cache=false
hibernate.cache.use_query_cache=false
hibernate.cache.region.factory_class=org.hibernate.cache.ehcache.EhCacheRegionFactory

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true">
<!-- 尽量别用绝对路径,如果带参数不同容器路径解释可能不同 -->
<property name="LOG_HOME" value="/logs" />
<appender name="Console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{50} %msg%n</pattern>
</encoder>
</appender>
<!-- 按照每天生成日志文件 -->
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_HOME}/quartzPro/localhost.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<FileNamePattern>${LOG_HOME}/quartzPro/%d{yyyy-MM-dd}.log</FileNamePattern>
<MaxHistory>30</MaxHistory>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss} 【%-5level】 【%logger{50}】 %msg%n</pattern>
<charset>UTF-8</charset>
</encoder>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>WARN</level>
</filter>
</appender>
<!-- 将级别为“info”及大于“info”的日志信息传递给root处理本身并不打印 -->
<root level="INFO">
<!-- root将级别为“INFO”及大于“INFO”的日志信息交给已经配置好的名为“Console”的appender处理“Console”appender将信息打印到Console -->
<appender-ref ref="file" />
<!-- 标识这个appender将会添加到这个logger -->
<!-- <appender-ref ref="File" /> -->
</root>
</configuration>

View File

@ -0,0 +1,16 @@
#\u6b63\u5f0f\u73af\u5883\u6781\u5149AppKey
AppKeyFormal=123
#\u6b63\u5f0f\u73af\u5883\u6781\u5149Master Secret
MasterSecretFormal=123
#\u6d4b\u8bd5\u73af\u5883\u6781\u5149AppKey
AppKey=6e5e9d757570859b3f274bb8
#\u6d4b\u8bd5\u73af\u5883\u6781\u5149Master Secret
MasterSecret=4f759a0609dcd9d2edb06125
#\u672c\u5730
#link_img_head=http://192.168.61.128:81/
#\u6d4b\u8bd5\u73af\u5883
link_img_head=http://139.196.24.156:83/
#\u6b63\u5f0f\u73af\u5883
#link_img_head=https://app.ifish7.com/
#\u56fe\u7247\u683c\u5f0f\u9a8c\u8bc1
check_style=GIF,PNG,BMP,JPG,JPEG

View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.0.xsd"
default-lazy-init="true">
<!-- 启动触发器的配置开始 -->
<bean name="startQuertz" lazy-init="false" autowire="no"
class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="myJobTrigger" />
</list>
</property>
<property name="quartzProperties">
<props>
<prop key="org.quartz.scheduler.skipUpdateCheck">true</prop>
</props>
</property>
</bean>
<!-- 启动触发器的配置结束 -->
<!-- quartz-2.x的配置 -->
<bean id="myJobTrigger"
class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail">
<ref bean="myJobDetail" />
</property>
<property name="cronExpression">
<!--每天10点开始推送 -->
<value>0 0 10 * * ?</value>
</property>
</bean>
<!-- 调度的配置结束 -->
<!-- job的配置开始 -->
<bean id="myJobDetail"
class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject">
<ref bean="myJob" />
</property>
<property name="targetMethod">
<value>pushRemind</value>
</property>
</bean>
<!-- job的配置结束 -->
<!-- 工作的bean -->
<bean id="myJob" class=" com.ifish.job.job" />
<!-- 注册识别注解 -->
<context:annotation-config />
<!-- 导入外部的properties文件-->
<context:property-placeholder location="classpath*:jPpush.properties" ignore-unresolvable="true"/>
<!-- 极光推送 -->
<bean id="jPushNotification2" class="com.ifish.jpush.JPushNotification">
<constructor-arg index="0">
<!-- appKey -->
<value>${jpush.ios.appKey}</value>
</constructor-arg>
<constructor-arg index="1">
<!-- secret -->
<value>${jpush.ios.secret}</value>
</constructor-arg>
<constructor-arg index="2">
<!-- production -->
<value>${jpush.ios.productionMode}</value>
</constructor-arg>
</bean>
</beans>

Some files were not shown because too many files have changed in this diff Show More