Преглед на файлове

Merge branch 'master' of https://git.coding.net/aft/AFT

yee преди 8 години
родител
ревизия
0c4e61159e
променени са 31 файла, в които са добавени 2104 реда и са изтрити 102 реда
  1. 1 1
      generatorConfig.xml
  2. 3 1
      schema/20170821-alert.sql
  3. 33 0
      schema/20170822-init-branch-office.sql
  4. 5 3
      src/main/java/com/goafanti/app/controller/AppApiController.java
  5. 3 2
      src/main/java/com/goafanti/common/controller/WebpageController.java
  6. 76 0
      src/main/java/com/goafanti/common/dao/BranchOfficeInfoMapper.java
  7. 4 0
      src/main/java/com/goafanti/common/enums/UserType.java
  8. 4 4
      src/main/java/com/goafanti/common/mapper/AchievementMapper.xml
  9. 333 0
      src/main/java/com/goafanti/common/mapper/BranchOfficeInfoMapper.xml
  10. 16 7
      src/main/java/com/goafanti/common/mapper/NewsMapper.xml
  11. 51 21
      src/main/java/com/goafanti/common/mapper/NewsMapperExt.xml
  12. 189 0
      src/main/java/com/goafanti/common/model/BranchOfficeInfo.java
  13. 801 0
      src/main/java/com/goafanti/common/model/BranchOfficeInfoExample.java
  14. 13 0
      src/main/java/com/goafanti/common/model/News.java
  15. 1 0
      src/main/java/com/goafanti/core/cache/serializer/FastJsonRedisSerializer.java
  16. 182 0
      src/main/java/com/goafanti/easemob/EasemobUtils.java
  17. 81 0
      src/main/java/com/goafanti/easemob/bo/EasemobInfo.java
  18. 151 0
      src/main/java/com/goafanti/easemob/queue/EasemobRedisQueue.java
  19. 19 0
      src/main/java/com/goafanti/easemob/queue/EasemobRedisQueueListener.java
  20. 5 0
      src/main/java/com/goafanti/easemob/queue/RedisQueueListener.java
  21. 14 1
      src/main/java/com/goafanti/news/bo/InputNews.java
  22. 9 7
      src/main/java/com/goafanti/news/controller/NewsController.java
  23. 11 7
      src/main/java/com/goafanti/news/service/NewsService.java
  24. 32 3
      src/main/java/com/goafanti/user/controller/UserApiController.java
  25. 5 1
      src/main/resources/props/config_dev.properties
  26. 29 25
      src/main/resources/props/config_local.properties
  27. 2 2
      src/main/resources/props/config_prod.properties
  28. 5 1
      src/main/resources/props/config_test.properties
  29. 14 3
      src/main/resources/spring/spring-shiro.xml
  30. 1 2
      src/main/webapp/WEB-INF/views/portal/index.html
  31. 11 11
      src/main/webapp/WEB-INF/views/portal/residentIntegration/index.html

+ 1 - 1
generatorConfig.xml

@@ -8,6 +8,6 @@
     <javaModelGenerator targetPackage="com.goafanti.common.model" targetProject="AFT" />
     <sqlMapGenerator targetPackage="com.goafanti.common.mapper" targetProject="AFT" />
     <javaClientGenerator targetPackage="com.goafanti.common.dao" targetProject="AFT" type="XMLMAPPER" />
-    <table schema="aft" tableName="country_code"/>
+    <table schema="aft" tableName="branch_office_info"/>
   </context>
 </generatorConfiguration>

+ 3 - 1
schema/20170821-alert.sql

@@ -1,2 +1,4 @@
 alter table achievement add column jmrh_flag int(1) default 0 comment '是否属于军民融合';
-alter table news add column jmrh_flag int(1) default 0 comment '是否属于军民融合';
+alter table news add column jmrh_flag int(1) default 0 comment '是否属于军民融合';
+alter table news add column province_id int(4) default 0 comment '新闻发布省份';
+update news set province_id = 11;

+ 33 - 0
schema/20170822-init-branch-office.sql

@@ -0,0 +1,33 @@
+#创建分公司管理表
+create table branch_office_info(
+	id int(4) primary key auto_increment,
+	name varchar(32) comment '分公司名字',
+	website varchar(32) not null comment '分公司网络地址',
+	contact_number varchar(11) comment '联系号码',
+	contact_address varchar(64) comment '联系地址',
+	logo_img varchar(64) comment 'LOGO图片',
+	qr_img varchar(64) comment '二维码图片',
+	province_id int(4) not null comment '所属省份'
+);
+#初始化数据
+insert into branch_office_info values(1,'南昌科德','nckd.jishutao.com',null,null,null,null,26);
+insert into branch_office_info values(2,'福州科宇','fzky.jishutao.com',null,null,null,null,25);
+insert into branch_office_info values(3,'贵州科德','gzkd.jishutao.com',null,null,null,null,6);
+insert into branch_office_info values(4,'大连科德','dlkd.jishutao.com',null,null,null,null,28);
+insert into branch_office_info values(5,'广州科中','gzkz.jishutao.com',null,null,null,null,12);
+insert into branch_office_info values(6,'河南科德','hnkd.jishutao.com',null,null,null,null,9);
+insert into branch_office_info values(7,'昆明科道','kmkd.jishutao.com',null,null,null,null,7);
+insert into branch_office_info values(8,'石家庄科中','sjzkz.jishutao.com',null,null,null,null,19);
+insert into branch_office_info values(9,'青岛科德','qdkd.jishutao.com',null,null,null,null,27);
+insert into branch_office_info values(10,'长春科德','cckd.jishutao.com',null,null,null,null,29);
+insert into branch_office_info values(11,'广州科丰','gzkf.jishutao.com',null,null,null,null,12);
+insert into branch_office_info values(12,'北京科德','bjkd.jishutao.com',null,null,null,null,1);
+insert into branch_office_info values(13,'山东科德','sdkd.jishutao.com',null,null,null,null,27);
+insert into branch_office_info values(14,'江苏科德','jskd.jishutao.com',null,null,null,null,22);
+insert into branch_office_info values(15,'武汉科汇','whkh.jishutao.com',null,null,null,null,10);
+insert into branch_office_info values(16,'合肥科稻','hfkd.jishutao.com',null,null,null,null,24);
+insert into branch_office_info values(17,'成都科德','cdkd.jishutao.com',null,null,null,null,5);
+insert into branch_office_info values(18,'内蒙古科发','nmgkf.jishutao.com',null,null,null,null,21);
+insert into branch_office_info values(19,'南宁科发','nnkf.jishutao.com',null,null,null,null,13);
+insert into branch_office_info values(20,'沈阳科德','sykd.jishutao.com',null,null,null,null,28);
+insert into branch_office_info values(21,'湖南科德','www.jishutao.com',null,null,null,null,11);

+ 5 - 3
src/main/java/com/goafanti/app/controller/AppApiController.java

@@ -4,6 +4,7 @@ import java.util.HashMap;
 import java.util.Map;
 
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
 
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -36,12 +37,13 @@ public class AppApiController extends BaseApiController {
 	private DemandService				demandService;
 
 	@RequestMapping(value = "/index", method = RequestMethod.GET)
-	public Result index() {
+	public Result index(HttpServletRequest request) {
 		Map<String, Object> result = new HashMap<>();
+		String domainName = request.getServerName();
 		result.put("banners", bannersService.findPortalBanners(BannersType.APP.getKey()));
 		result.put("activities", activityService.findPortalList(0, 3, null));
-		result.put("policies", newsService.findNewsList(0, NewsType.GJZC.getCode(), 3));
-		result.put("news", newsService.findNewsList(0, NewsType.JTDT.getCode(), 5));
+		result.put("policies", newsService.findNewsList(0, NewsType.GJZC.getCode(), 3,domainName));
+		result.put("news", newsService.findNewsList(0, NewsType.JTDT.getCode(), 5,domainName));
 		return res().data(result);
 	}
 	

+ 3 - 2
src/main/java/com/goafanti/common/controller/WebpageController.java

@@ -54,8 +54,9 @@ public class WebpageController extends BaseController {
 		if (!banners.isEmpty()) {
 			modelview.addObject("banner", banners.get(0));
 		}
-		modelview.addObject("zfwl", newsService.findIndexNewsList(0, NewsType.ZFWL.getCode(), 2));
-		modelview.addObject("jtdt", newsService.findIndexNewsList(0, NewsType.JTDT.getCode(), 4));
+		String domainName = request.getServerName();
+		modelview.addObject("zfwl", newsService.findIndexNewsList(0, NewsType.ZFWL.getCode(), 2,domainName));
+		modelview.addObject("jtdt", newsService.findIndexNewsList(0, NewsType.JTDT.getCode(), 4,domainName));
 		return modelview;
 	}
 

+ 76 - 0
src/main/java/com/goafanti/common/dao/BranchOfficeInfoMapper.java

@@ -0,0 +1,76 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.BranchOfficeInfo;
+import com.goafanti.common.model.BranchOfficeInfoExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface BranchOfficeInfoMapper {
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table branch_office_info
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	long countByExample(BranchOfficeInfoExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table branch_office_info
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	int deleteByExample(BranchOfficeInfoExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table branch_office_info
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	int deleteByPrimaryKey(Integer id);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table branch_office_info
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	int insert(BranchOfficeInfo record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table branch_office_info
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	int insertSelective(BranchOfficeInfo record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table branch_office_info
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	List<BranchOfficeInfo> selectByExample(BranchOfficeInfoExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table branch_office_info
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	BranchOfficeInfo selectByPrimaryKey(Integer id);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table branch_office_info
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	int updateByExampleSelective(@Param("record") BranchOfficeInfo record,
+			@Param("example") BranchOfficeInfoExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table branch_office_info
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	int updateByExample(@Param("record") BranchOfficeInfo record, @Param("example") BranchOfficeInfoExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table branch_office_info
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	int updateByPrimaryKeySelective(BranchOfficeInfo record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table branch_office_info
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	int updateByPrimaryKey(BranchOfficeInfo record);
+}

+ 4 - 0
src/main/java/com/goafanti/common/enums/UserType.java

@@ -21,6 +21,10 @@ public enum UserType {
 		}
 	}
 
+	public static boolean isPersonal(Integer code) {
+		return PERSONAL == getStatus(code);
+	}
+
 	public static UserType getStatus(Integer code) {
 		if (containsType(code)) {
 			return status.get(code);

+ 4 - 4
src/main/java/com/goafanti/common/mapper/AchievementMapper.xml

@@ -1393,7 +1393,7 @@
 	from 
 		achievement t 
 	where 
-		jmrh_flag = 1 and data_category = 0
+		jmrh_flag = 1 and data_category = 0 and audit_status = 3
 	order by 
 		create_time desc
 	limit 5;
@@ -1404,7 +1404,7 @@
 	from 
 		achievement t 
 	where 
-		jmrh_flag = 1 and data_category = 1
+		jmrh_flag = 1 and data_category = 1 and audit_status = 3
 	order by 
 		create_time desc
 	limit 5;
@@ -1421,9 +1421,9 @@
 	left join 
 		field_glossory d on a.field_a = d.id
 	where 
-		jmrh_flag = 1 and data_category = 2
+		jmrh_flag = 1 and data_category = 1 and audit_status = 3
 	order by 
-		a.create_time desc
+		a.create_time asc
 	limit 5;
   </select>
 </mapper>

+ 333 - 0
src/main/java/com/goafanti/common/mapper/BranchOfficeInfoMapper.xml

@@ -0,0 +1,333 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.goafanti.common.dao.BranchOfficeInfoMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.BranchOfficeInfo">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Aug 22 09:20:20 CST 2017.
+    -->
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="name" jdbcType="VARCHAR" property="name" />
+    <result column="website" jdbcType="VARCHAR" property="website" />
+    <result column="contact_number" jdbcType="VARCHAR" property="contactNumber" />
+    <result column="contact_address" jdbcType="VARCHAR" property="contactAddress" />
+    <result column="logo_img" jdbcType="VARCHAR" property="logoImg" />
+    <result column="qr_img" jdbcType="VARCHAR" property="qrImg" />
+    <result column="province_id" jdbcType="INTEGER" property="provinceId" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Aug 22 09:20:20 CST 2017.
+    -->
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Aug 22 09:20:20 CST 2017.
+    -->
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Aug 22 09:20:20 CST 2017.
+    -->
+    id, name, website, contact_number, contact_address, logo_img, qr_img, province_id
+  </sql>
+  <select id="selectByExample" parameterType="com.goafanti.common.model.BranchOfficeInfoExample" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Aug 22 09:20:20 CST 2017.
+    -->
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from branch_office_info
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Aug 22 09:20:20 CST 2017.
+    -->
+    select 
+    <include refid="Base_Column_List" />
+    from branch_office_info
+    where id = #{id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Aug 22 09:20:20 CST 2017.
+    -->
+    delete from branch_office_info
+    where id = #{id,jdbcType=INTEGER}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.goafanti.common.model.BranchOfficeInfoExample">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Aug 22 09:20:20 CST 2017.
+    -->
+    delete from branch_office_info
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.BranchOfficeInfo">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Aug 22 09:20:20 CST 2017.
+    -->
+    insert into branch_office_info (id, name, website, 
+      contact_number, contact_address, logo_img, 
+      qr_img, province_id)
+    values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{website,jdbcType=VARCHAR}, 
+      #{contactNumber,jdbcType=VARCHAR}, #{contactAddress,jdbcType=VARCHAR}, #{logoImg,jdbcType=VARCHAR}, 
+      #{qrImg,jdbcType=VARCHAR}, #{provinceId,jdbcType=INTEGER})
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.BranchOfficeInfo">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Aug 22 09:20:20 CST 2017.
+    -->
+    insert into branch_office_info
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="name != null">
+        name,
+      </if>
+      <if test="website != null">
+        website,
+      </if>
+      <if test="contactNumber != null">
+        contact_number,
+      </if>
+      <if test="contactAddress != null">
+        contact_address,
+      </if>
+      <if test="logoImg != null">
+        logo_img,
+      </if>
+      <if test="qrImg != null">
+        qr_img,
+      </if>
+      <if test="provinceId != null">
+        province_id,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=INTEGER},
+      </if>
+      <if test="name != null">
+        #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="website != null">
+        #{website,jdbcType=VARCHAR},
+      </if>
+      <if test="contactNumber != null">
+        #{contactNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="contactAddress != null">
+        #{contactAddress,jdbcType=VARCHAR},
+      </if>
+      <if test="logoImg != null">
+        #{logoImg,jdbcType=VARCHAR},
+      </if>
+      <if test="qrImg != null">
+        #{qrImg,jdbcType=VARCHAR},
+      </if>
+      <if test="provinceId != null">
+        #{provinceId,jdbcType=INTEGER},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.goafanti.common.model.BranchOfficeInfoExample" resultType="java.lang.Long">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Aug 22 09:20:20 CST 2017.
+    -->
+    select count(*) from branch_office_info
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Aug 22 09:20:20 CST 2017.
+    -->
+    update branch_office_info
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=INTEGER},
+      </if>
+      <if test="record.name != null">
+        name = #{record.name,jdbcType=VARCHAR},
+      </if>
+      <if test="record.website != null">
+        website = #{record.website,jdbcType=VARCHAR},
+      </if>
+      <if test="record.contactNumber != null">
+        contact_number = #{record.contactNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="record.contactAddress != null">
+        contact_address = #{record.contactAddress,jdbcType=VARCHAR},
+      </if>
+      <if test="record.logoImg != null">
+        logo_img = #{record.logoImg,jdbcType=VARCHAR},
+      </if>
+      <if test="record.qrImg != null">
+        qr_img = #{record.qrImg,jdbcType=VARCHAR},
+      </if>
+      <if test="record.provinceId != null">
+        province_id = #{record.provinceId,jdbcType=INTEGER},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Aug 22 09:20:20 CST 2017.
+    -->
+    update branch_office_info
+    set id = #{record.id,jdbcType=INTEGER},
+      name = #{record.name,jdbcType=VARCHAR},
+      website = #{record.website,jdbcType=VARCHAR},
+      contact_number = #{record.contactNumber,jdbcType=VARCHAR},
+      contact_address = #{record.contactAddress,jdbcType=VARCHAR},
+      logo_img = #{record.logoImg,jdbcType=VARCHAR},
+      qr_img = #{record.qrImg,jdbcType=VARCHAR},
+      province_id = #{record.provinceId,jdbcType=INTEGER}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.BranchOfficeInfo">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Aug 22 09:20:20 CST 2017.
+    -->
+    update branch_office_info
+    <set>
+      <if test="name != null">
+        name = #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="website != null">
+        website = #{website,jdbcType=VARCHAR},
+      </if>
+      <if test="contactNumber != null">
+        contact_number = #{contactNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="contactAddress != null">
+        contact_address = #{contactAddress,jdbcType=VARCHAR},
+      </if>
+      <if test="logoImg != null">
+        logo_img = #{logoImg,jdbcType=VARCHAR},
+      </if>
+      <if test="qrImg != null">
+        qr_img = #{qrImg,jdbcType=VARCHAR},
+      </if>
+      <if test="provinceId != null">
+        province_id = #{provinceId,jdbcType=INTEGER},
+      </if>
+    </set>
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.BranchOfficeInfo">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Aug 22 09:20:20 CST 2017.
+    -->
+    update branch_office_info
+    set name = #{name,jdbcType=VARCHAR},
+      website = #{website,jdbcType=VARCHAR},
+      contact_number = #{contactNumber,jdbcType=VARCHAR},
+      contact_address = #{contactAddress,jdbcType=VARCHAR},
+      logo_img = #{logoImg,jdbcType=VARCHAR},
+      qr_img = #{qrImg,jdbcType=VARCHAR},
+      province_id = #{provinceId,jdbcType=INTEGER}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+</mapper>

+ 16 - 7
src/main/java/com/goafanti/common/mapper/NewsMapper.xml

@@ -14,13 +14,14 @@
     <result column="source_url" jdbcType="VARCHAR" property="sourceUrl" />
     <result column="summary" jdbcType="VARCHAR" property="summary" />
     <result column="jmrh_flag" jdbcType="INTEGER" property="jmrhFlag" />
+    <result column="province_id" jdbcType="INTEGER" property="provinceId" /> 
   </resultMap>
   <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.goafanti.common.model.News">
     <result column="content" jdbcType="LONGVARCHAR" property="content" />
   </resultMap>
   <sql id="Base_Column_List">
     id, create_time, edit_time, title, title_img, author, type, hot, source, source_url, 
-    summary,jmrh_flag
+    summary,jmrh_flag,province_id
   </sql>
   <sql id="Blob_Column_List">
     content
@@ -41,13 +42,13 @@
     insert into news (id, create_time, edit_time, 
       title, title_img, author, 
       type, hot, source, 
-      source_url, summary, content,jmrh_flag
+      source_url, summary, content,jmrh_flag,province_id
       )
     values (#{id,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{editTime,jdbcType=TIMESTAMP}, 
       #{title,jdbcType=VARCHAR}, #{titleImg,jdbcType=VARCHAR}, #{author,jdbcType=VARCHAR}, 
       #{type,jdbcType=INTEGER}, #{hot,jdbcType=INTEGER}, #{source,jdbcType=VARCHAR}, 
       #{sourceUrl,jdbcType=VARCHAR}, #{summary,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARCHAR},
-      #{jmrhFlag,jdbcType=INTEGER}
+      #{jmrhFlag,jdbcType=INTEGER}, #{provinceId,jdbcType=INTEGER}
       )
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.News">
@@ -90,7 +91,10 @@
         content,
       </if>
       <if test="jmrhFlag != null">
-      	jmrhFlag,
+      	jmrh_flag,
+      </if>
+      <if test="provinceId != null">
+      	province_id,
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -131,7 +135,10 @@
         #{content,jdbcType=LONGVARCHAR},
       </if>
        <if test="jmrhFlag != null">
-        #{content,jdbcType=INTEGER},
+        #{jmrhFlag,jdbcType=INTEGER},
+      </if>
+      <if test="provinceId != null">
+        #{provinceId,jdbcType=INTEGER},
       </if>
     </trim>
   </insert>
@@ -190,7 +197,8 @@
       source_url = #{sourceUrl,jdbcType=VARCHAR},
       summary = #{summary,jdbcType=VARCHAR},
       content = #{content,jdbcType=LONGVARCHAR},
-      jmrh_flag = #{jmrhFlag,jdbcType=INTEGER}
+      jmrh_flag = #{jmrhFlag,jdbcType=INTEGER},
+      province_id = #{provinceId,jdbcType=INTEGER}
     where id = #{id,jdbcType=BIGINT}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.News">
@@ -205,7 +213,8 @@
       source = #{source,jdbcType=VARCHAR},
       source_url = #{sourceUrl,jdbcType=VARCHAR},
       summary = #{summary,jdbcType=VARCHAR},
-       jmrh_flag = #{jmrhFlag,jdbcType=INTEGER}
+      jmrh_flag = #{jmrhFlag,jdbcType=INTEGER},
+      province_id = #{provinceId,jdbcType=INTEGER}
     where id = #{id,jdbcType=BIGINT}
   </update>
   

+ 51 - 21
src/main/java/com/goafanti/common/mapper/NewsMapperExt.xml

@@ -14,24 +14,49 @@
 	<sql id="Summary_Column_List">
 		id, create_time, title, title_img, type, hot, summary, source
 	</sql>
-	<select id="findList" resultMap="SummaryResultMap">
+	<select id="findList" resultType="com.goafanti.news.bo.NewsSummary">
 		select
-		<include refid="Summary_Column_List" />
-		from news where 1=1
-		<if test=" type != null">
-			and type = #{type,jdbcType=INTEGER}
+			a.id,
+			a.create_time as createTime,
+			a.title,
+			a.title_img as titleImg,
+			a.type,
+			a.hot,
+			a.summary,
+			a.source
+		from news a
+		join branch_office_info b
+		on a.province_id = b.province_id
+		where 1=1
+		<if test="type != null">
+			and a.type = #{type,jdbcType=INTEGER}
+		</if>
+		<if test="website != null">
+			and b.website = #{website,jdbcType=VARCHAR}
 		</if>
-		order by id desc
+		order by create_time desc
 		limit #{pageNo,jdbcType=INTEGER}, #{pageSize,jdbcType=INTEGER}
 	</select>
 	
 	<select id="findIndexNewsList" resultMap="SummaryResultMap">
 		select
-		<include refid="Summary_Column_List" />
-		from news
-		where hot = 1 
+			a.id,
+			a.create_time as createTime,
+			a.title,
+			a.title_img as titleImg,
+			a.type,
+			a.hot,
+			a.summary,
+			a.source
+		from news a
+		join branch_office_info b
+		on a.province_id = b.province_id
+		where a.hot = 1 
 		<if test=" type != null">
-			and type = #{type,jdbcType=INTEGER}
+			and a.type = #{type,jdbcType=INTEGER}
+		</if>
+		<if test="website != null">
+			and b.website = #{website,jdbcType=VARCHAR}
 		</if>
 		order by create_time desc
 		limit #{pageNo,jdbcType=INTEGER}, #{pageSize,jdbcType=INTEGER}
@@ -116,19 +141,24 @@
   
   <select id="findPortalList" resultType="com.goafanti.news.bo.NewsPortalList">
 		select
-			id, 
-			create_time as createTime, 
-			title , 
-			title_img as titleImg, 
-			type, 
-			hot, 
-			summary,
-			source,
-			content
-		from news
+			a.id,
+			a.create_time as createTime,
+			a.title,
+			a.title_img as titleImg,
+			a.type,
+			a.hot,
+			a.summary,
+			a.source,
+			a.content
+		from news a
+		join branch_office_info b
+		on a.province_id = b.province_id
 		where 1 =1
 		<if test="type != null and type != 0" >
-			and type = #{type,jdbcType=INTEGER}
+			and a.type = #{type,jdbcType=INTEGER}
+		</if>
+		<if test="website != null">
+			and b.website = #{website,jdbcType=VARCHAR}
 		</if>
 		order by create_time desc
 		limit #{pageNo,jdbcType=INTEGER}, #{pageSize,jdbcType=INTEGER}

+ 189 - 0
src/main/java/com/goafanti/common/model/BranchOfficeInfo.java

@@ -0,0 +1,189 @@
+package com.goafanti.common.model;
+
+public class BranchOfficeInfo {
+
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column branch_office_info.id
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	private Integer id;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column branch_office_info.name
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	private String name;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column branch_office_info.website
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	private String website;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column branch_office_info.contact_number
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	private String contactNumber;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column branch_office_info.contact_address
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	private String contactAddress;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column branch_office_info.logo_img
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	private String logoImg;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column branch_office_info.qr_img
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	private String qrImg;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column branch_office_info.province_id
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	private Integer provinceId;
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column branch_office_info.id
+	 * @return  the value of branch_office_info.id
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	public Integer getId() {
+		return id;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column branch_office_info.id
+	 * @param id  the value for branch_office_info.id
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	public void setId(Integer id) {
+		this.id = id;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column branch_office_info.name
+	 * @return  the value of branch_office_info.name
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	public String getName() {
+		return name;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column branch_office_info.name
+	 * @param name  the value for branch_office_info.name
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column branch_office_info.website
+	 * @return  the value of branch_office_info.website
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	public String getWebsite() {
+		return website;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column branch_office_info.website
+	 * @param website  the value for branch_office_info.website
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	public void setWebsite(String website) {
+		this.website = website;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column branch_office_info.contact_number
+	 * @return  the value of branch_office_info.contact_number
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	public String getContactNumber() {
+		return contactNumber;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column branch_office_info.contact_number
+	 * @param contactNumber  the value for branch_office_info.contact_number
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	public void setContactNumber(String contactNumber) {
+		this.contactNumber = contactNumber;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column branch_office_info.contact_address
+	 * @return  the value of branch_office_info.contact_address
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	public String getContactAddress() {
+		return contactAddress;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column branch_office_info.contact_address
+	 * @param contactAddress  the value for branch_office_info.contact_address
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	public void setContactAddress(String contactAddress) {
+		this.contactAddress = contactAddress;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column branch_office_info.logo_img
+	 * @return  the value of branch_office_info.logo_img
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	public String getLogoImg() {
+		return logoImg;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column branch_office_info.logo_img
+	 * @param logoImg  the value for branch_office_info.logo_img
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	public void setLogoImg(String logoImg) {
+		this.logoImg = logoImg;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column branch_office_info.qr_img
+	 * @return  the value of branch_office_info.qr_img
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	public String getQrImg() {
+		return qrImg;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column branch_office_info.qr_img
+	 * @param qrImg  the value for branch_office_info.qr_img
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	public void setQrImg(String qrImg) {
+		this.qrImg = qrImg;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column branch_office_info.province_id
+	 * @return  the value of branch_office_info.province_id
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	public Integer getProvinceId() {
+		return provinceId;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column branch_office_info.province_id
+	 * @param provinceId  the value for branch_office_info.province_id
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	public void setProvinceId(Integer provinceId) {
+		this.provinceId = provinceId;
+	}
+}

+ 801 - 0
src/main/java/com/goafanti/common/model/BranchOfficeInfoExample.java

@@ -0,0 +1,801 @@
+package com.goafanti.common.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class BranchOfficeInfoExample {
+    /**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database table branch_office_info
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	protected String orderByClause;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database table branch_office_info
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	protected boolean distinct;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database table branch_office_info
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	protected List<Criteria> oredCriteria;
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table branch_office_info
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	public BranchOfficeInfoExample() {
+		oredCriteria = new ArrayList<Criteria>();
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table branch_office_info
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	public void setOrderByClause(String orderByClause) {
+		this.orderByClause = orderByClause;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table branch_office_info
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	public String getOrderByClause() {
+		return orderByClause;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table branch_office_info
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	public void setDistinct(boolean distinct) {
+		this.distinct = distinct;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table branch_office_info
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	public boolean isDistinct() {
+		return distinct;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table branch_office_info
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	public List<Criteria> getOredCriteria() {
+		return oredCriteria;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table branch_office_info
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	public void or(Criteria criteria) {
+		oredCriteria.add(criteria);
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table branch_office_info
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	public Criteria or() {
+		Criteria criteria = createCriteriaInternal();
+		oredCriteria.add(criteria);
+		return criteria;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table branch_office_info
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	public Criteria createCriteria() {
+		Criteria criteria = createCriteriaInternal();
+		if (oredCriteria.size() == 0) {
+			oredCriteria.add(criteria);
+		}
+		return criteria;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table branch_office_info
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	protected Criteria createCriteriaInternal() {
+		Criteria criteria = new Criteria();
+		return criteria;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table branch_office_info
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	public void clear() {
+		oredCriteria.clear();
+		orderByClause = null;
+		distinct = false;
+	}
+
+	/**
+	 * This class was generated by MyBatis Generator. This class corresponds to the database table branch_office_info
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	protected abstract static class GeneratedCriteria {
+		protected List<Criterion> criteria;
+
+		protected GeneratedCriteria() {
+			super();
+			criteria = new ArrayList<Criterion>();
+		}
+
+		public boolean isValid() {
+			return criteria.size() > 0;
+		}
+
+		public List<Criterion> getAllCriteria() {
+			return criteria;
+		}
+
+		public List<Criterion> getCriteria() {
+			return criteria;
+		}
+
+		protected void addCriterion(String condition) {
+			if (condition == null) {
+				throw new RuntimeException("Value for condition cannot be null");
+			}
+			criteria.add(new Criterion(condition));
+		}
+
+		protected void addCriterion(String condition, Object value, String property) {
+			if (value == null) {
+				throw new RuntimeException("Value for " + property + " cannot be null");
+			}
+			criteria.add(new Criterion(condition, value));
+		}
+
+		protected void addCriterion(String condition, Object value1, Object value2, String property) {
+			if (value1 == null || value2 == null) {
+				throw new RuntimeException("Between values for " + property + " cannot be null");
+			}
+			criteria.add(new Criterion(condition, value1, value2));
+		}
+
+		public Criteria andIdIsNull() {
+			addCriterion("id is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdIsNotNull() {
+			addCriterion("id is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdEqualTo(Integer value) {
+			addCriterion("id =", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdNotEqualTo(Integer value) {
+			addCriterion("id <>", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdGreaterThan(Integer value) {
+			addCriterion("id >", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdGreaterThanOrEqualTo(Integer value) {
+			addCriterion("id >=", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdLessThan(Integer value) {
+			addCriterion("id <", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdLessThanOrEqualTo(Integer value) {
+			addCriterion("id <=", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdIn(List<Integer> values) {
+			addCriterion("id in", values, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdNotIn(List<Integer> values) {
+			addCriterion("id not in", values, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdBetween(Integer value1, Integer value2) {
+			addCriterion("id between", value1, value2, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdNotBetween(Integer value1, Integer value2) {
+			addCriterion("id not between", value1, value2, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameIsNull() {
+			addCriterion("name is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameIsNotNull() {
+			addCriterion("name is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameEqualTo(String value) {
+			addCriterion("name =", value, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameNotEqualTo(String value) {
+			addCriterion("name <>", value, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameGreaterThan(String value) {
+			addCriterion("name >", value, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameGreaterThanOrEqualTo(String value) {
+			addCriterion("name >=", value, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameLessThan(String value) {
+			addCriterion("name <", value, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameLessThanOrEqualTo(String value) {
+			addCriterion("name <=", value, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameLike(String value) {
+			addCriterion("name like", value, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameNotLike(String value) {
+			addCriterion("name not like", value, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameIn(List<String> values) {
+			addCriterion("name in", values, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameNotIn(List<String> values) {
+			addCriterion("name not in", values, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameBetween(String value1, String value2) {
+			addCriterion("name between", value1, value2, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameNotBetween(String value1, String value2) {
+			addCriterion("name not between", value1, value2, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andWebsiteIsNull() {
+			addCriterion("website is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andWebsiteIsNotNull() {
+			addCriterion("website is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andWebsiteEqualTo(String value) {
+			addCriterion("website =", value, "website");
+			return (Criteria) this;
+		}
+
+		public Criteria andWebsiteNotEqualTo(String value) {
+			addCriterion("website <>", value, "website");
+			return (Criteria) this;
+		}
+
+		public Criteria andWebsiteGreaterThan(String value) {
+			addCriterion("website >", value, "website");
+			return (Criteria) this;
+		}
+
+		public Criteria andWebsiteGreaterThanOrEqualTo(String value) {
+			addCriterion("website >=", value, "website");
+			return (Criteria) this;
+		}
+
+		public Criteria andWebsiteLessThan(String value) {
+			addCriterion("website <", value, "website");
+			return (Criteria) this;
+		}
+
+		public Criteria andWebsiteLessThanOrEqualTo(String value) {
+			addCriterion("website <=", value, "website");
+			return (Criteria) this;
+		}
+
+		public Criteria andWebsiteLike(String value) {
+			addCriterion("website like", value, "website");
+			return (Criteria) this;
+		}
+
+		public Criteria andWebsiteNotLike(String value) {
+			addCriterion("website not like", value, "website");
+			return (Criteria) this;
+		}
+
+		public Criteria andWebsiteIn(List<String> values) {
+			addCriterion("website in", values, "website");
+			return (Criteria) this;
+		}
+
+		public Criteria andWebsiteNotIn(List<String> values) {
+			addCriterion("website not in", values, "website");
+			return (Criteria) this;
+		}
+
+		public Criteria andWebsiteBetween(String value1, String value2) {
+			addCriterion("website between", value1, value2, "website");
+			return (Criteria) this;
+		}
+
+		public Criteria andWebsiteNotBetween(String value1, String value2) {
+			addCriterion("website not between", value1, value2, "website");
+			return (Criteria) this;
+		}
+
+		public Criteria andContactNumberIsNull() {
+			addCriterion("contact_number is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andContactNumberIsNotNull() {
+			addCriterion("contact_number is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andContactNumberEqualTo(String value) {
+			addCriterion("contact_number =", value, "contactNumber");
+			return (Criteria) this;
+		}
+
+		public Criteria andContactNumberNotEqualTo(String value) {
+			addCriterion("contact_number <>", value, "contactNumber");
+			return (Criteria) this;
+		}
+
+		public Criteria andContactNumberGreaterThan(String value) {
+			addCriterion("contact_number >", value, "contactNumber");
+			return (Criteria) this;
+		}
+
+		public Criteria andContactNumberGreaterThanOrEqualTo(String value) {
+			addCriterion("contact_number >=", value, "contactNumber");
+			return (Criteria) this;
+		}
+
+		public Criteria andContactNumberLessThan(String value) {
+			addCriterion("contact_number <", value, "contactNumber");
+			return (Criteria) this;
+		}
+
+		public Criteria andContactNumberLessThanOrEqualTo(String value) {
+			addCriterion("contact_number <=", value, "contactNumber");
+			return (Criteria) this;
+		}
+
+		public Criteria andContactNumberLike(String value) {
+			addCriterion("contact_number like", value, "contactNumber");
+			return (Criteria) this;
+		}
+
+		public Criteria andContactNumberNotLike(String value) {
+			addCriterion("contact_number not like", value, "contactNumber");
+			return (Criteria) this;
+		}
+
+		public Criteria andContactNumberIn(List<String> values) {
+			addCriterion("contact_number in", values, "contactNumber");
+			return (Criteria) this;
+		}
+
+		public Criteria andContactNumberNotIn(List<String> values) {
+			addCriterion("contact_number not in", values, "contactNumber");
+			return (Criteria) this;
+		}
+
+		public Criteria andContactNumberBetween(String value1, String value2) {
+			addCriterion("contact_number between", value1, value2, "contactNumber");
+			return (Criteria) this;
+		}
+
+		public Criteria andContactNumberNotBetween(String value1, String value2) {
+			addCriterion("contact_number not between", value1, value2, "contactNumber");
+			return (Criteria) this;
+		}
+
+		public Criteria andContactAddressIsNull() {
+			addCriterion("contact_address is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andContactAddressIsNotNull() {
+			addCriterion("contact_address is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andContactAddressEqualTo(String value) {
+			addCriterion("contact_address =", value, "contactAddress");
+			return (Criteria) this;
+		}
+
+		public Criteria andContactAddressNotEqualTo(String value) {
+			addCriterion("contact_address <>", value, "contactAddress");
+			return (Criteria) this;
+		}
+
+		public Criteria andContactAddressGreaterThan(String value) {
+			addCriterion("contact_address >", value, "contactAddress");
+			return (Criteria) this;
+		}
+
+		public Criteria andContactAddressGreaterThanOrEqualTo(String value) {
+			addCriterion("contact_address >=", value, "contactAddress");
+			return (Criteria) this;
+		}
+
+		public Criteria andContactAddressLessThan(String value) {
+			addCriterion("contact_address <", value, "contactAddress");
+			return (Criteria) this;
+		}
+
+		public Criteria andContactAddressLessThanOrEqualTo(String value) {
+			addCriterion("contact_address <=", value, "contactAddress");
+			return (Criteria) this;
+		}
+
+		public Criteria andContactAddressLike(String value) {
+			addCriterion("contact_address like", value, "contactAddress");
+			return (Criteria) this;
+		}
+
+		public Criteria andContactAddressNotLike(String value) {
+			addCriterion("contact_address not like", value, "contactAddress");
+			return (Criteria) this;
+		}
+
+		public Criteria andContactAddressIn(List<String> values) {
+			addCriterion("contact_address in", values, "contactAddress");
+			return (Criteria) this;
+		}
+
+		public Criteria andContactAddressNotIn(List<String> values) {
+			addCriterion("contact_address not in", values, "contactAddress");
+			return (Criteria) this;
+		}
+
+		public Criteria andContactAddressBetween(String value1, String value2) {
+			addCriterion("contact_address between", value1, value2, "contactAddress");
+			return (Criteria) this;
+		}
+
+		public Criteria andContactAddressNotBetween(String value1, String value2) {
+			addCriterion("contact_address not between", value1, value2, "contactAddress");
+			return (Criteria) this;
+		}
+
+		public Criteria andLogoImgIsNull() {
+			addCriterion("logo_img is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andLogoImgIsNotNull() {
+			addCriterion("logo_img is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andLogoImgEqualTo(String value) {
+			addCriterion("logo_img =", value, "logoImg");
+			return (Criteria) this;
+		}
+
+		public Criteria andLogoImgNotEqualTo(String value) {
+			addCriterion("logo_img <>", value, "logoImg");
+			return (Criteria) this;
+		}
+
+		public Criteria andLogoImgGreaterThan(String value) {
+			addCriterion("logo_img >", value, "logoImg");
+			return (Criteria) this;
+		}
+
+		public Criteria andLogoImgGreaterThanOrEqualTo(String value) {
+			addCriterion("logo_img >=", value, "logoImg");
+			return (Criteria) this;
+		}
+
+		public Criteria andLogoImgLessThan(String value) {
+			addCriterion("logo_img <", value, "logoImg");
+			return (Criteria) this;
+		}
+
+		public Criteria andLogoImgLessThanOrEqualTo(String value) {
+			addCriterion("logo_img <=", value, "logoImg");
+			return (Criteria) this;
+		}
+
+		public Criteria andLogoImgLike(String value) {
+			addCriterion("logo_img like", value, "logoImg");
+			return (Criteria) this;
+		}
+
+		public Criteria andLogoImgNotLike(String value) {
+			addCriterion("logo_img not like", value, "logoImg");
+			return (Criteria) this;
+		}
+
+		public Criteria andLogoImgIn(List<String> values) {
+			addCriterion("logo_img in", values, "logoImg");
+			return (Criteria) this;
+		}
+
+		public Criteria andLogoImgNotIn(List<String> values) {
+			addCriterion("logo_img not in", values, "logoImg");
+			return (Criteria) this;
+		}
+
+		public Criteria andLogoImgBetween(String value1, String value2) {
+			addCriterion("logo_img between", value1, value2, "logoImg");
+			return (Criteria) this;
+		}
+
+		public Criteria andLogoImgNotBetween(String value1, String value2) {
+			addCriterion("logo_img not between", value1, value2, "logoImg");
+			return (Criteria) this;
+		}
+
+		public Criteria andQrImgIsNull() {
+			addCriterion("qr_img is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andQrImgIsNotNull() {
+			addCriterion("qr_img is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andQrImgEqualTo(String value) {
+			addCriterion("qr_img =", value, "qrImg");
+			return (Criteria) this;
+		}
+
+		public Criteria andQrImgNotEqualTo(String value) {
+			addCriterion("qr_img <>", value, "qrImg");
+			return (Criteria) this;
+		}
+
+		public Criteria andQrImgGreaterThan(String value) {
+			addCriterion("qr_img >", value, "qrImg");
+			return (Criteria) this;
+		}
+
+		public Criteria andQrImgGreaterThanOrEqualTo(String value) {
+			addCriterion("qr_img >=", value, "qrImg");
+			return (Criteria) this;
+		}
+
+		public Criteria andQrImgLessThan(String value) {
+			addCriterion("qr_img <", value, "qrImg");
+			return (Criteria) this;
+		}
+
+		public Criteria andQrImgLessThanOrEqualTo(String value) {
+			addCriterion("qr_img <=", value, "qrImg");
+			return (Criteria) this;
+		}
+
+		public Criteria andQrImgLike(String value) {
+			addCriterion("qr_img like", value, "qrImg");
+			return (Criteria) this;
+		}
+
+		public Criteria andQrImgNotLike(String value) {
+			addCriterion("qr_img not like", value, "qrImg");
+			return (Criteria) this;
+		}
+
+		public Criteria andQrImgIn(List<String> values) {
+			addCriterion("qr_img in", values, "qrImg");
+			return (Criteria) this;
+		}
+
+		public Criteria andQrImgNotIn(List<String> values) {
+			addCriterion("qr_img not in", values, "qrImg");
+			return (Criteria) this;
+		}
+
+		public Criteria andQrImgBetween(String value1, String value2) {
+			addCriterion("qr_img between", value1, value2, "qrImg");
+			return (Criteria) this;
+		}
+
+		public Criteria andQrImgNotBetween(String value1, String value2) {
+			addCriterion("qr_img not between", value1, value2, "qrImg");
+			return (Criteria) this;
+		}
+
+		public Criteria andProvinceIdIsNull() {
+			addCriterion("province_id is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andProvinceIdIsNotNull() {
+			addCriterion("province_id is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andProvinceIdEqualTo(Integer value) {
+			addCriterion("province_id =", value, "provinceId");
+			return (Criteria) this;
+		}
+
+		public Criteria andProvinceIdNotEqualTo(Integer value) {
+			addCriterion("province_id <>", value, "provinceId");
+			return (Criteria) this;
+		}
+
+		public Criteria andProvinceIdGreaterThan(Integer value) {
+			addCriterion("province_id >", value, "provinceId");
+			return (Criteria) this;
+		}
+
+		public Criteria andProvinceIdGreaterThanOrEqualTo(Integer value) {
+			addCriterion("province_id >=", value, "provinceId");
+			return (Criteria) this;
+		}
+
+		public Criteria andProvinceIdLessThan(Integer value) {
+			addCriterion("province_id <", value, "provinceId");
+			return (Criteria) this;
+		}
+
+		public Criteria andProvinceIdLessThanOrEqualTo(Integer value) {
+			addCriterion("province_id <=", value, "provinceId");
+			return (Criteria) this;
+		}
+
+		public Criteria andProvinceIdIn(List<Integer> values) {
+			addCriterion("province_id in", values, "provinceId");
+			return (Criteria) this;
+		}
+
+		public Criteria andProvinceIdNotIn(List<Integer> values) {
+			addCriterion("province_id not in", values, "provinceId");
+			return (Criteria) this;
+		}
+
+		public Criteria andProvinceIdBetween(Integer value1, Integer value2) {
+			addCriterion("province_id between", value1, value2, "provinceId");
+			return (Criteria) this;
+		}
+
+		public Criteria andProvinceIdNotBetween(Integer value1, Integer value2) {
+			addCriterion("province_id not between", value1, value2, "provinceId");
+			return (Criteria) this;
+		}
+	}
+
+	/**
+	 * This class was generated by MyBatis Generator. This class corresponds to the database table branch_office_info
+	 * @mbg.generated  Tue Aug 22 09:20:20 CST 2017
+	 */
+	public static class Criterion {
+		private String condition;
+		private Object value;
+		private Object secondValue;
+		private boolean noValue;
+		private boolean singleValue;
+		private boolean betweenValue;
+		private boolean listValue;
+		private String typeHandler;
+
+		public String getCondition() {
+			return condition;
+		}
+
+		public Object getValue() {
+			return value;
+		}
+
+		public Object getSecondValue() {
+			return secondValue;
+		}
+
+		public boolean isNoValue() {
+			return noValue;
+		}
+
+		public boolean isSingleValue() {
+			return singleValue;
+		}
+
+		public boolean isBetweenValue() {
+			return betweenValue;
+		}
+
+		public boolean isListValue() {
+			return listValue;
+		}
+
+		public String getTypeHandler() {
+			return typeHandler;
+		}
+
+		protected Criterion(String condition) {
+			super();
+			this.condition = condition;
+			this.typeHandler = null;
+			this.noValue = true;
+		}
+
+		protected Criterion(String condition, Object value, String typeHandler) {
+			super();
+			this.condition = condition;
+			this.value = value;
+			this.typeHandler = typeHandler;
+			if (value instanceof List<?>) {
+				this.listValue = true;
+			} else {
+				this.singleValue = true;
+			}
+		}
+
+		protected Criterion(String condition, Object value) {
+			this(condition, value, null);
+		}
+
+		protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
+			super();
+			this.condition = condition;
+			this.value = value;
+			this.secondValue = secondValue;
+			this.typeHandler = typeHandler;
+			this.betweenValue = true;
+		}
+
+		protected Criterion(String condition, Object value, Object secondValue) {
+			this(condition, value, secondValue, null);
+		}
+	}
+
+	/**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table branch_office_info
+     *
+     * @mbg.generated do_not_delete_during_merge Tue Aug 22 09:15:13 CST 2017
+     */
+    public static class Criteria extends GeneratedCriteria {
+
+        protected Criteria() {
+            super();
+        }
+    }
+}

+ 13 - 0
src/main/java/com/goafanti/common/model/News.java

@@ -74,6 +74,11 @@ public class News {
 	 */
 	private Integer jmrhFlag;
 	
+	/**
+	 *  新闻发布省份
+	 */
+	private Integer provinceId;
+	
 	@JsonFormat(shape = Shape.STRING)
 	public Long getId() {
 		return id;
@@ -179,6 +184,14 @@ public class News {
 		this.jmrhFlag = jmrhFlag;
 	}
 
+	public Integer getProvinceId() {
+		return provinceId;
+	}
+
+	public void setProvinceId(Integer provinceId) {
+		this.provinceId = provinceId;
+	}
+
 	public String getCreateTimeFormattedDate() {
 		if (this.createTime == null) {
 			return null;

+ 1 - 0
src/main/java/com/goafanti/core/cache/serializer/FastJsonRedisSerializer.java

@@ -23,6 +23,7 @@ public class FastJsonRedisSerializer implements RedisSerializer<Object> {
 		pc.addAccept("com.goafanti.news.bo.NewsPortalList");
 		pc.addAccept("com.goafanti.common.model.Activity");
 		pc.addAccept("com.goafanti.portal.bo.InternationalListBo");
+		pc.addAccept("com.goafanti.easemob.bo.EasemobInfo");
 	}
 
 	@Override

+ 182 - 0
src/main/java/com/goafanti/easemob/EasemobUtils.java

@@ -0,0 +1,182 @@
+package com.goafanti.easemob;
+
+import java.io.IOException;
+import java.util.Optional;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.methods.HttpUriRequest;
+import org.apache.http.client.methods.HttpRequestBase;
+import org.apache.http.concurrent.FutureCallback;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.nio.client.CloseableHttpAsyncClient;
+import org.apache.http.impl.nio.client.HttpAsyncClients;
+import org.apache.http.util.EntityUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.DisposableBean;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.HttpMethod;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.goafanti.easemob.bo.EasemobInfo;
+import com.goafanti.easemob.queue.EasemobRedisQueue;
+
+public class EasemobUtils implements InitializingBean, DisposableBean {
+	private static final String				UTF_8	= "UTF-8";
+	private static final Logger				logger	= LoggerFactory.getLogger(EasemobUtils.class);
+	private static final Optional<Integer>	UN_AUTH	= Optional.of(401);
+
+	@Value(value = "${easemob.client.url}")
+	private String							clientUrl;
+	@Value(value = "${easemob.client.id}")
+	private String							clientId;
+	@Value(value = "${easemob.client.secret}")
+	private String							clientSecret;
+
+	private String							token;
+
+	@Autowired
+	private EasemobRedisQueue				jedisQueue;
+
+	private void auth() {
+		JSONObject jo = new JSONObject();
+		jo.put("grant_type", "client_credentials");
+		jo.put("client_id", clientId);
+		jo.put("client_secret", clientSecret);
+		JSONObject res = send(
+				new EasemobInfo().uri("/token").data(jo.toJSONString()).method(HttpMethod.POST).withAuth(false));
+		if (res != null) {
+			token = res.getString("access_token");
+		}
+	}
+
+	private HttpUriRequest buildRequest(EasemobInfo info) {
+		HttpUriRequest req = null;
+		switch (info.getMethod()) {
+		case POST:
+			req = new HttpPost(clientUrl + info.getUri());
+			((HttpPost) req).setEntity(new StringEntity(info.getData(), UTF_8));
+			break;
+		default:
+			req = new HttpGet(clientUrl + info.getUri());
+			break;
+		}
+		if (info.isWithAuth()) {
+			req.addHeader("Authorization", "Bearer " + token);
+		}
+		((HttpRequestBase) req).setConfig(RequestConfig.custom().setConnectTimeout(10000)
+				.setConnectionRequestTimeout(10000).setSocketTimeout(10000).build());
+		req.addHeader("Content-Type", "application/json");
+		return req;
+	}
+
+	public JSONObject send(EasemobInfo info) {
+		HttpUriRequest req = buildRequest(info);
+		CloseableHttpAsyncClient httpclient = HttpAsyncClients.createDefault();
+		httpclient.start();
+		logger.debug(req.toString());
+		Future<HttpResponse> future = httpclient.execute(req, null);
+		try {
+			HttpResponse response = future.get();
+			if (info.isWithAuth() && isUnauth(response)) {
+				auth();
+			} else {
+				HttpEntity entity = response.getEntity();
+				if (entity != null) {
+					try {
+						String resStr = EntityUtils.toString(entity, UTF_8);
+						logger.debug(resStr);
+						return (JSONObject) JSON.parse(resStr);
+					} catch (Exception e) {
+						logger.error(e.getMessage(), e);
+					}
+				}
+			}
+		} catch (InterruptedException | ExecutionException e) {
+			logger.error(e.getMessage(), e);
+		} finally {
+			try {
+				httpclient.close();
+			} catch (IOException e) {
+			}
+		}
+		return info.getTryCount() > 1 ? null : send(info.tryCount(info.getTryCount() + 1));
+	}
+
+	public void sendLater(EasemobInfo info) {
+		jedisQueue.pushFromTail(info);
+	}
+
+	public void sendAsync(EasemobInfo info) {
+		HttpUriRequest req = buildRequest(info);
+		CloseableHttpAsyncClient httpclient = HttpAsyncClients.createDefault();
+		httpclient.start();
+		logger.debug(req.toString());
+		httpclient.execute(req, new FutureCallback<HttpResponse>() {
+			@Override
+			public void failed(Exception ex) {
+				sendLater(info.tryCount(info.getTryCount() + 1));
+				close();
+			}
+
+			@Override
+			public void completed(HttpResponse result) {
+				if (info.isWithAuth() && isUnauth(result)) {
+					auth();
+				} else {
+					HttpEntity entity = result.getEntity();
+					if (entity != null) {
+						try {
+							logger.debug(EntityUtils.toString(entity, UTF_8));
+						} catch (Exception e) {
+							logger.error(e.getMessage(), e);
+						}
+					}
+				}
+				try {
+					httpclient.close();
+				} catch (IOException e) {
+				}
+				close();
+			}
+
+			@Override
+			public void cancelled() {
+				close();
+				logger.debug(req.toString() + "cancelled!");
+			}
+
+			private void close() {
+				try {
+					httpclient.close();
+				} catch (IOException e) {
+				}
+			}
+		});
+	}
+
+	private boolean isUnauth(HttpResponse response) {
+		return UN_AUTH
+				.equals(Optional.ofNullable(response).map(res -> res.getStatusLine()).map(sl -> sl.getStatusCode()));
+	}
+
+	@Override
+	public void destroy() throws Exception {
+		logger.debug("消息系统关闭");
+	}
+
+	@Override
+	public void afterPropertiesSet() throws Exception {
+		auth();
+	}
+
+}

+ 81 - 0
src/main/java/com/goafanti/easemob/bo/EasemobInfo.java

@@ -0,0 +1,81 @@
+package com.goafanti.easemob.bo;
+
+import org.springframework.http.HttpMethod;
+
+public class EasemobInfo {
+	private String		uri;
+
+	private String		data;
+
+	private HttpMethod	method;
+
+	private int			tryCount	= 0;
+
+	private boolean		withAuth	= true;
+
+	public String getUri() {
+		return uri;
+	}
+
+	public void setUri(String uri) {
+		this.uri = uri;
+	}
+
+	public String getData() {
+		return data;
+	}
+
+	public void setData(String data) {
+		this.data = data;
+	}
+
+	public int getTryCount() {
+		return tryCount;
+	}
+
+	public void setTryCount(int tryCount) {
+		this.tryCount = tryCount;
+	}
+
+	public HttpMethod getMethod() {
+		return method;
+	}
+
+	public void setMethod(HttpMethod method) {
+		this.method = method;
+	}
+
+	public boolean isWithAuth() {
+		return withAuth;
+	}
+
+	public void setWithAuth(boolean withAuth) {
+		this.withAuth = withAuth;
+	}
+
+	public EasemobInfo uri(String uri) {
+		this.uri = uri;
+		return this;
+	}
+
+	public EasemobInfo method(HttpMethod method) {
+		this.method = method;
+		return this;
+	}
+
+	public EasemobInfo tryCount(int tryCount) {
+		this.tryCount = tryCount;
+		return this;
+	}
+
+	public EasemobInfo data(String data) {
+		this.data = data;
+		return this;
+	}
+
+	public EasemobInfo withAuth(boolean withAuth) {
+		this.withAuth = withAuth;
+		return this;
+	}
+
+}

+ 151 - 0
src/main/java/com/goafanti/easemob/queue/EasemobRedisQueue.java

@@ -0,0 +1,151 @@
+package com.goafanti.easemob.queue;
+
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+import org.springframework.beans.factory.DisposableBean;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.data.redis.connection.RedisConnection;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
+import org.springframework.data.redis.core.BoundListOperations;
+import org.springframework.data.redis.core.RedisConnectionUtils;
+import org.springframework.data.redis.core.RedisTemplate;
+
+import com.goafanti.easemob.bo.EasemobInfo;
+
+public class EasemobRedisQueue implements InitializingBean, DisposableBean {
+	private RedisTemplate<String, Object>		redisTemplate;
+	private String								key;
+	private RedisConnectionFactory				factory;
+	private RedisConnection						connection;
+	private BoundListOperations<String, Object>	listOperations;
+
+	private Lock								lock	= new ReentrantLock();
+
+	private RedisQueueListener<EasemobInfo>	listener;
+	private Thread								listenerThread;
+
+	private boolean								isClosed;
+
+	public void setRedisTemplate(RedisTemplate<String, Object> redisTemplate) {
+		this.redisTemplate = redisTemplate;
+	}
+
+	public void setListener(RedisQueueListener<EasemobInfo> listener) {
+		this.listener = listener;
+	}
+
+	public void setKey(String key) {
+		this.key = key;
+	}
+
+	@Override
+	public void afterPropertiesSet() throws Exception {
+		factory = redisTemplate.getConnectionFactory();
+		connection = RedisConnectionUtils.getConnection(factory);
+
+		listOperations = redisTemplate.boundListOps(key);
+		if (listener != null) {
+			listenerThread = new ListenerThread();
+			listenerThread.setDaemon(true);
+			listenerThread.start();
+		}
+	}
+
+	/**
+	 * blocking remove and get last item from queue:BRPOP
+	 * 
+	 * @return
+	 */
+	public Object takeFromTail(int timeout) throws InterruptedException {
+		lock.lockInterruptibly();
+		try {
+			return listOperations.rightPop(timeout, TimeUnit.SECONDS);
+		} finally {
+			lock.unlock();
+		}
+	}
+
+	public Object takeFromTail() throws InterruptedException {
+		return takeFromTail(0);
+	}
+
+	/**
+	 * 从队列的头,插入
+	 */
+	public void pushFromHead(Object value) {
+		listOperations.leftPush(value);
+	}
+
+	public void pushFromTail(Object value) {
+		listOperations.rightPush(value);
+	}
+
+	/**
+	 * noblocking
+	 * 
+	 * @return null if no item in queue
+	 */
+	public Object removeFromHead() {
+		return listOperations.leftPop();
+	}
+
+	public Object removeFromTail() {
+		return listOperations.rightPop();
+	}
+
+	/**
+	 * blocking remove and get first item from queue:BLPOP
+	 * 
+	 * @return
+	 */
+	public Object takeFromHead(int timeout) throws InterruptedException {
+		lock.lockInterruptibly();
+		try {
+			return listOperations.leftPop(timeout, TimeUnit.SECONDS);
+		} finally {
+			lock.unlock();
+		}
+	}
+
+	public Object takeFromHead() throws InterruptedException {
+		return takeFromHead(0);
+	}
+
+	@Override
+	public void destroy() throws Exception {
+		if (isClosed) {
+			return;
+		}
+		shutdown();
+		RedisConnectionUtils.releaseConnection(connection, factory);
+	}
+
+	private void shutdown() {
+		try {
+			listenerThread.interrupt();
+		} catch (Exception e) {
+		}
+	}
+
+	private class ListenerThread extends Thread {
+		@Override
+		public void run() {
+			try {
+				while (true) {
+					Object value = takeFromHead();
+					// 逐个执行
+					if (value != null) {
+						try {
+							listener.onMessage((EasemobInfo) value);
+						} catch (Exception e) {
+						}
+					}
+				}
+			} catch (InterruptedException e) {
+			}
+		}
+	}
+
+}

+ 19 - 0
src/main/java/com/goafanti/easemob/queue/EasemobRedisQueueListener.java

@@ -0,0 +1,19 @@
+package com.goafanti.easemob.queue;
+
+import org.springframework.beans.factory.annotation.Autowired;
+
+import com.goafanti.easemob.EasemobUtils;
+import com.goafanti.easemob.bo.EasemobInfo;
+
+public class EasemobRedisQueueListener implements RedisQueueListener<EasemobInfo> {
+	@Autowired
+	EasemobUtils easemobUtils;
+
+	@Override
+	public void onMessage(EasemobInfo value) {
+		if (value.getTryCount() < 3) {
+			easemobUtils.sendAsync(value);
+		}
+	}
+
+}

+ 5 - 0
src/main/java/com/goafanti/easemob/queue/RedisQueueListener.java

@@ -0,0 +1,5 @@
+package com.goafanti.easemob.queue;
+
+public interface RedisQueueListener<T> {
+	public void onMessage(T value);
+}

+ 14 - 1
src/main/java/com/goafanti/news/bo/InputNews.java

@@ -39,7 +39,11 @@ public class InputNews {
 	@Max(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
     private Integer jmrhFlag;
-    
+	
+	@Max(value = 34, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer provinceId;
+	
 	private String	content;
 
 	public Long getId() {
@@ -129,4 +133,13 @@ public class InputNews {
 	public void setJmrhFlag(Integer jmrhFlag) {
 		this.jmrhFlag = jmrhFlag;
 	}
+
+	public Integer getProvinceId() {
+		return provinceId;
+	}
+
+	public void setProvinceId(Integer provinceId) {
+		this.provinceId = provinceId;
+	}
+
 }

+ 9 - 7
src/main/java/com/goafanti/news/controller/NewsController.java

@@ -41,11 +41,12 @@ public class NewsController extends BaseController {
 		if (StringUtils.equals(noCache, "clear")) {
 			newsService.cleanList();
 		}
-		modelview.addObject("kjkx", newsService.findNewsList(0, NewsType.KJZX.getCode(), 2));
-		modelview.addObject("jtdt", newsService.findNewsList(0, NewsType.JTDT.getCode(), 2));
-		modelview.addObject("zfwl", newsService.findNewsList(0, NewsType.ZFWL.getCode(), 3));
-		modelview.addObject("gjzc", newsService.findNewsList(0, NewsType.GJZC.getCode(), 3));
-		modelview.addObject("dfzc", newsService.findNewsList(0, NewsType.DFZC.getCode(), 3));
+		String domainName = request.getServerName();
+		modelview.addObject("kjkx", newsService.findNewsList(0, NewsType.KJZX.getCode(), 2,domainName));
+		modelview.addObject("jtdt", newsService.findNewsList(0, NewsType.JTDT.getCode(), 2,domainName));
+		modelview.addObject("zfwl", newsService.findNewsList(0, NewsType.ZFWL.getCode(), 3,domainName));
+		modelview.addObject("gjzc", newsService.findNewsList(0, NewsType.GJZC.getCode(), 3,domainName));
+		modelview.addObject("dfzc", newsService.findNewsList(0, NewsType.DFZC.getCode(), 3,domainName));
 		handleBanners(modelview, BannersType.CE_YUAN_DI);
 		return modelview;
 	}
@@ -73,14 +74,15 @@ public class NewsController extends BaseController {
 	 */
 	@RequestMapping(value = "/portal/news/list", method = RequestMethod.GET)
 	@ResponseBody
-	public Result portalNewsList(Integer type, String pageSize, String pageNo, String noCache) {
+	public Result portalNewsList(Integer type, String pageSize, String pageNo, String noCache,HttpServletRequest request) {
 		Result res = new Result();
 		if (StringUtils.equals(noCache, "clear")) {
 			newsService.cleanPortalList();
 		}
+		String domainName = request.getServerName();
 		Integer pN = getPageNo(pageNo);
 		Integer pS = getPageSize(pageSize);
-		res.setData(newsService.findPortalList(pS, (pN - 1) * pS, type));
+		res.setData(newsService.findPortalList(pS, (pN - 1) * pS, type,domainName));
 		return res;
 	}
 

+ 11 - 7
src/main/java/com/goafanti/news/service/NewsService.java

@@ -5,6 +5,8 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import javax.servlet.http.HttpServletRequest;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -33,12 +35,13 @@ public class NewsService extends BaseMybatisDao<NewsMapper> {
 
 	private static final Logger	logger	= LoggerFactory.getLogger(NewsService.class);
 	
-	@Cacheable(value = "IndexNewsListCache", key = "'NewsList:Page:'+#pageNo+'Type:'+#type+'Size:'+#pageSize")
-	public List<NewsSummary> findIndexNewsList(Integer pageNo, Integer type, Integer pageSize) {
+	@Cacheable(value = "IndexNewsListCache", key = "'NewsList:Page:'+#pageNo+'Type:'+#type+'Size:'+#pageSize+'domainName:'+#domainName")
+	public List<NewsSummary> findIndexNewsList(Integer pageNo, Integer type, Integer pageSize,String domainName) {
 		Map<String, Object> params = new HashMap<String, Object>();
 		params.put("type", type);
 		params.put("pageSize", pageSize);
 		params.put("pageNo", pageNo);
+		params.put("website", domainName);
 		return newsMapper.findIndexNewsList(params);
 	}
 
@@ -52,12 +55,13 @@ public class NewsService extends BaseMybatisDao<NewsMapper> {
 		return newsMapper.selectByPrimaryKey(id);
 	}
 
-	@Cacheable(value = "NewsListCache", key = "'NewsList:Page:'+#pageNo+'Type:'+#type+'Size:'+#pageSize")
-	public List<NewsSummary> findNewsList(Integer pageNo, Integer type, Integer pageSize) {
+	@Cacheable(value = "NewsListCache", key = "'NewsList:Page:'+#pageNo+'Type:'+#type+'Size:'+#pageSize+'domainName:'+#domainName")
+	public List<NewsSummary> findNewsList(Integer pageNo, Integer type, Integer pageSize,String domainName) {
 		Map<String, Object> params = new HashMap<String, Object>();
 		params.put("type", type);
 		params.put("pageSize", pageSize);
 		params.put("pageNo", pageNo);
+		params.put("website", domainName);
 		return newsMapper.findList(params);
 	}
 
@@ -140,13 +144,13 @@ public class NewsService extends BaseMybatisDao<NewsMapper> {
 		return newsMapper.batchDeleteByPrimaryKey(id);
 	}
 	
-	@Cacheable(value = "NewsPortalListCache", key = "'NewsPortalList:Page:'+#pageNo+'Type:'+#type+'Size:'+#pageSize")
-	public List<NewsPortalList> findPortalList(Integer pSize, Integer pNo, Integer type) {
+	@Cacheable(value = "NewsPortalListCache", key = "'NewsPortalList:Page:'+#pageNo+'Type:'+#type+'Size:'+#pageSize+'domainName:'+#domainName")
+	public List<NewsPortalList> findPortalList(Integer pSize, Integer pNo, Integer type,String domainName) {
 		Map<String, Object> params = new HashMap<String, Object>();
 		params.put("type", type);
-		
 		params.put("pageSize", pSize);
 		params.put("pageNo", pNo);
+		params.put("website", domainName);
 		return newsMapper.findPortalList(params);
 	}
 	

+ 32 - 3
src/main/java/com/goafanti/user/controller/UserApiController.java

@@ -10,7 +10,10 @@ import javax.servlet.http.HttpServletRequest;
 import javax.validation.Valid;
 
 import org.apache.commons.lang3.StringUtils;
+import org.apache.shiro.crypto.hash.SimpleHash;
 import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpMethod;
 import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
@@ -18,6 +21,7 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.bind.annotation.RestController;
 
+import com.alibaba.fastjson.JSONObject;
 import com.goafanti.cognizance.bo.InputOrgHumanResource;
 import com.goafanti.cognizance.service.OrgRatepayService;
 import com.goafanti.common.bo.Result;
@@ -53,6 +57,8 @@ import com.goafanti.common.utils.PasswordUtil;
 import com.goafanti.common.utils.TimeUtils;
 import com.goafanti.common.utils.VerifyCodeUtils;
 import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.easemob.EasemobUtils;
+import com.goafanti.easemob.bo.EasemobInfo;
 import com.goafanti.techproject.service.TechWebsiteService;
 import com.goafanti.user.bo.InputOrgPro;
 import com.goafanti.user.bo.InputOrganizationTech;
@@ -109,6 +115,9 @@ public class UserApiController extends BaseApiController {
 	@Resource
 	private OrgRatepayService				orgRatepayService;
 
+	@Autowired
+	private EasemobUtils					easemobUtils;
+
 	private static final Integer			STEP_ONE			= 1;
 
 	// private static final Integer STEP_TWO = 2;
@@ -425,9 +434,8 @@ public class UserApiController extends BaseApiController {
 					OrgProFields.getFieldDesc(bindingResult.getFieldError().getField())));
 			return res;
 		}
-		
-		
-		if (StringUtils.isBlank(pro.getCompanyName())){
+
+		if (StringUtils.isBlank(pro.getCompanyName())) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到单位名称", "单位名称"));
 			return res;
 		}
@@ -877,4 +885,25 @@ public class UserApiController extends BaseApiController {
 		return res;
 	}
 
+	/**
+	 * 获取环信登录账号,如果未注册则先注册
+	 */
+	@RequestMapping(value = "/easemob", method = RequestMethod.GET)
+	public Result getEasemob() {
+		User u = TokenManager.getUserToken();
+		if (u != null) {
+			JSONObject res = easemobUtils.send(new EasemobInfo().uri("/users/" + u.getNumber()).method(HttpMethod.GET));
+			JSONObject resultObj = new JSONObject();
+			resultObj.put("password", new SimpleHash("md5", u.getId(), null, 1).toHex());
+			resultObj.put("username", String.valueOf(u.getNumber()));
+			resultObj.put("nickname", StringUtils.isBlank(u.getNickname()) ? "技淘用户" + u.getNumber() : u.getNickname());
+			if (res == null || StringUtils.equals("service_resource_not_found", (CharSequence) res.get("error"))) {
+				easemobUtils.sendLater(
+						new EasemobInfo().uri("/users/").data(resultObj.toJSONString()).method(HttpMethod.POST));
+			}
+			return res().data(resultObj);
+		} else {
+			return res().error(buildError("user only", "必须是登录会员才能访问。"));
+		}
+	}
 }

+ 5 - 1
src/main/resources/props/config_dev.properties

@@ -71,4 +71,8 @@ portal.host=//afts.hnzhiming.com/portal/1.0.11
 
 patentTemplate=SMS_72005286
 
-avatar.upload.host=//afts.hnzhiming.com/upload
+avatar.upload.host=//afts.hnzhiming.com/upload
+
+easemob.client.url=https://a1.easemob.com/1117170814115609/jitao
+easemob.client.id=YXA6RUDGkIDSEeemq9_4PWzcNA
+easemob.client.secret=YXA61NHE0renI5N8gEgizoI5ivM9SYE

+ 29 - 25
src/main/resources/props/config_local.properties

@@ -1,41 +1,41 @@
 #Driver
 jdbc.driverClassName=com.mysql.jdbc.Driver
-#\u6570\u636e\u5e93\u94fe\u63a5\uff0c
-jdbc.url=jdbc:mysql://127.0.0.1:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
-#\u5e10\u53f7
+#\u6570\u636E\u5E93\u94FE\u63A5\uFF0C
+jdbc.url=jdbc:mysql://127.0.0.1:3306/aft_dev?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+#\u5E10\u53F7
 jdbc.username=root
-#\u5bc6\u7801
+#\u5BC6\u7801
 jdbc.password=123456
-#\u68c0\u6d4b\u6570\u636e\u5e93\u94fe\u63a5\u662f\u5426\u6709\u6548\uff0c\u5fc5\u987b\u914d\u7f6e
+#\u68C0\u6D4B\u6570\u636E\u5E93\u94FE\u63A5\u662F\u5426\u6709\u6548\uFF0C\u5FC5\u987B\u914D\u7F6E
 jdbc.validationQuery=SELECT 'x'
-#\u521d\u59cb\u8fde\u63a5\u6570
+#\u521D\u59CB\u8FDE\u63A5\u6570
 jdbc.initialSize=3
-#\u6700\u5927\u8fde\u63a5\u6c60\u6570\u91cf
+#\u6700\u5927\u8FDE\u63A5\u6C60\u6570\u91CF
 jdbc.maxActive=20
-#\u53bb\u6389\uff0c\u914d\u7f6e\u6587\u4ef6\u5bf9\u5e94\u53bb\u6389
+#\u53BB\u6389\uFF0C\u914D\u7F6E\u6587\u4EF6\u5BF9\u5E94\u53BB\u6389
 #jdbc.maxIdle=20
-#\u914d\u7f6e0,\u5f53\u7ebf\u7a0b\u6c60\u6570\u91cf\u4e0d\u8db3\uff0c\u81ea\u52a8\u8865\u5145\u3002
+#\u914D\u7F6E0,\u5F53\u7EBF\u7A0B\u6C60\u6570\u91CF\u4E0D\u8DB3\uFF0C\u81EA\u52A8\u8865\u5145\u3002
 jdbc.minIdle=0
-#\u83b7\u53d6\u94fe\u63a5\u8d85\u65f6\u65f6\u95f4\u4e3a1\u5206\u949f\uff0c\u5355\u4f4d\u4e3a\u6beb\u79d2\u3002
+#\u83B7\u53D6\u94FE\u63A5\u8D85\u65F6\u65F6\u95F4\u4E3A1\u5206\u949F\uFF0C\u5355\u4F4D\u4E3A\u6BEB\u79D2\u3002
 jdbc.maxWait=120000
-#\u83b7\u53d6\u94fe\u63a5\u7684\u65f6\u5019\uff0c\u4e0d\u6821\u9a8c\u662f\u5426\u53ef\u7528\uff0c\u5f00\u542f\u4f1a\u6709\u635f\u6027\u80fd\u3002
+#\u83B7\u53D6\u94FE\u63A5\u7684\u65F6\u5019\uFF0C\u4E0D\u6821\u9A8C\u662F\u5426\u53EF\u7528\uFF0C\u5F00\u542F\u4F1A\u6709\u635F\u6027\u80FD\u3002
 jdbc.testOnBorrow=false
-#\u5f52\u8fd8\u94fe\u63a5\u5230\u8fde\u63a5\u6c60\u7684\u65f6\u5019\u6821\u9a8c\u94fe\u63a5\u662f\u5426\u53ef\u7528\u3002
+#\u5F52\u8FD8\u94FE\u63A5\u5230\u8FDE\u63A5\u6C60\u7684\u65F6\u5019\u6821\u9A8C\u94FE\u63A5\u662F\u5426\u53EF\u7528\u3002
 jdbc.testOnReturn=false
-#\u6b64\u9879\u914d\u7f6e\u4e3atrue\u5373\u53ef\uff0c\u4e0d\u5f71\u54cd\u6027\u80fd\uff0c\u5e76\u4e14\u4fdd\u8bc1\u5b89\u5168\u6027\u3002\u610f\u4e49\u4e3a\uff1a\u7533\u8bf7\u8fde\u63a5\u7684\u65f6\u5019\u68c0\u6d4b\uff0c\u5982\u679c\u7a7a\u95f2\u65f6\u95f4\u5927\u4e8etimeBetweenEvictionRunsMillis\uff0c\u6267\u884cvalidationQuery\u68c0\u6d4b\u8fde\u63a5\u662f\u5426\u6709\u6548\u3002
+#\u6B64\u9879\u914D\u7F6E\u4E3Atrue\u5373\u53EF\uFF0C\u4E0D\u5F71\u54CD\u6027\u80FD\uFF0C\u5E76\u4E14\u4FDD\u8BC1\u5B89\u5168\u6027\u3002\u610F\u4E49\u4E3A\uFF1A\u7533\u8BF7\u8FDE\u63A5\u7684\u65F6\u5019\u68C0\u6D4B\uFF0C\u5982\u679C\u7A7A\u95F2\u65F6\u95F4\u5927\u4E8EtimeBetweenEvictionRunsMillis\uFF0C\u6267\u884CvalidationQuery\u68C0\u6D4B\u8FDE\u63A5\u662F\u5426\u6709\u6548\u3002
 jdbc.testWhileIdle=true
-#1.Destroy\u7ebf\u7a0b\u4f1a\u68c0\u6d4b\u8fde\u63a5\u7684\u95f4\u9694\u65f6\u95f4
-#2.testWhileIdle\u7684\u5224\u65ad\u4f9d\u636e
+#1.Destroy\u7EBF\u7A0B\u4F1A\u68C0\u6D4B\u8FDE\u63A5\u7684\u95F4\u9694\u65F6\u95F4
+#2.testWhileIdle\u7684\u5224\u65AD\u4F9D\u636E
 jdbc.timeBetweenEvictionRunsMillis=60000
-#\u4e00\u4e2a\u94fe\u63a5\u751f\u5b58\u7684\u65f6\u95f4\uff08\u4e4b\u524d\u7684\u503c\uff1a25200000\uff0c\u8fd9\u4e2a\u65f6\u95f4\u6709\u70b9BT\uff0c\u8fd9\u4e2a\u7ed3\u679c\u4e0d\u77e5\u9053\u662f\u600e\u4e48\u6765\u7684\uff0c\u6362\u7b97\u540e\u7684\u7ed3\u679c\u662f\uff1a25200000/1000/60/60 = 7\u4e2a\u5c0f\u65f6\uff09
+#\u4E00\u4E2A\u94FE\u63A5\u751F\u5B58\u7684\u65F6\u95F4\uFF08\u4E4B\u524D\u7684\u503C\uFF1A25200000\uFF0C\u8FD9\u4E2A\u65F6\u95F4\u6709\u70B9BT\uFF0C\u8FD9\u4E2A\u7ED3\u679C\u4E0D\u77E5\u9053\u662F\u600E\u4E48\u6765\u7684\uFF0C\u6362\u7B97\u540E\u7684\u7ED3\u679C\u662F\uFF1A25200000/1000/60/60 = 7\u4E2A\u5C0F\u65F6\uFF09
 jdbc.minEvictableIdleTimeMillis=300000
-#\u94fe\u63a5\u4f7f\u7528\u8d85\u8fc7\u65f6\u95f4\u9650\u5236\u662f\u5426\u56de\u6536
+#\u94FE\u63A5\u4F7F\u7528\u8D85\u8FC7\u65F6\u95F4\u9650\u5236\u662F\u5426\u56DE\u6536
 jdbc.removeAbandoned=true
-#\u8d85\u8fc7\u65f6\u95f4\u9650\u5236\u65f6\u95f4\uff08\u5355\u4f4d\u79d2\uff09\uff0c\u76ee\u524d\u4e3a5\u5206\u949f\uff0c\u5982\u679c\u6709\u4e1a\u52a1\u5904\u7406\u65f6\u95f4\u8d85\u8fc75\u5206\u949f\uff0c\u53ef\u4ee5\u9002\u5f53\u8c03\u6574\u3002
+#\u8D85\u8FC7\u65F6\u95F4\u9650\u5236\u65F6\u95F4\uFF08\u5355\u4F4D\u79D2\uFF09\uFF0C\u76EE\u524D\u4E3A5\u5206\u949F\uFF0C\u5982\u679C\u6709\u4E1A\u52A1\u5904\u7406\u65F6\u95F4\u8D85\u8FC75\u5206\u949F\uFF0C\u53EF\u4EE5\u9002\u5F53\u8C03\u6574\u3002
 jdbc.removeAbandonedTimeout=300
-#\u94fe\u63a5\u56de\u6536\u7684\u65f6\u5019\u63a7\u5236\u53f0\u6253\u5370\u4fe1\u606f\uff0c\u6d4b\u8bd5\u73af\u5883\u53ef\u4ee5\u52a0\u4e0atrue\uff0c\u7ebf\u4e0a\u73af\u5883false\u3002\u4f1a\u5f71\u54cd\u6027\u80fd\u3002
+#\u94FE\u63A5\u56DE\u6536\u7684\u65F6\u5019\u63A7\u5236\u53F0\u6253\u5370\u4FE1\u606F\uFF0C\u6D4B\u8BD5\u73AF\u5883\u53EF\u4EE5\u52A0\u4E0Atrue\uFF0C\u7EBF\u4E0A\u73AF\u5883false\u3002\u4F1A\u5F71\u54CD\u6027\u80FD\u3002
 jdbc.logAbandoned=true
-#\u7edf\u8ba1\u76d1\u63a7
+#\u7EDF\u8BA1\u76D1\u63A7
 jdbc.filters=stat
 
 logging.level.com.goafanti=DEBUG
@@ -43,7 +43,7 @@ logging.level.com.goafanti=DEBUG
 jedis.host=127.0.0.1
 jedis.port=6379
 jedis.timeout=5000
-jedis.password=aft123456
+jedis.password=123456
 
 pwd.hash_algorithm_name=md5
 pwd.hash_iterations=2
@@ -53,7 +53,7 @@ session.validate.timespan=18000000
 
 app.name=AFT
 
-static.host=//sb.jishutao.com/1.0.40
+static.host=//afts.hnzhiming.com/1.0.41
 
 upload.path=/Users/xiaolong/Sites/upload
 upload.private.path=/Users/xiaolong/Sites/doc
@@ -61,7 +61,7 @@ upload.private.path=/Users/xiaolong/Sites/doc
 accessKey=LTAIqTgQLLwz252Z
 accessSecret=ICGuiUnqzaar7urw4zecVcJrJ1MHg9
 
-avatar.host=//sf.jishutao.com
+avatar.host=//afts.hnzhiming.com
 
 aesSecretKey=aft1234567890123
 
@@ -69,8 +69,12 @@ template.cacheable=false
 
 mobileCodeTemplate=SMS_37845022
 
-portal.host=//sf.jishutao.com/portal/1.0.9
+portal.host=//afts.hnzhiming.com/portal/1.0.11
 
 patentTemplate=SMS_72005286
 
-avatar.upload.host=//sf.jishutao.com/upload
+avatar.upload.host=//afts.hnzhiming.com/upload
+
+easemob.client.url=https://a1.easemob.com/1117170814115609/jitao
+easemob.client.id=YXA6RUDGkIDSEeemq9_4PWzcNA
+easemob.client.secret=YXA61NHE0renI5N8gEgizoI5ivM9SYE

+ 2 - 2
src/main/resources/props/config_prod.properties

@@ -51,12 +51,12 @@ session.validate.timespan=18000000
 
 app.name=AFT
 
-static.host=//afts.hnzhiming.com/1.0.31
+static.host=//sf.jishutao.com/1.0.40
 
 template.cacheable=true
 
 mobileCodeTemplate=SMS_37845022
 
-portal.host=//afts.hnzhiming.com/portal/1.0.0
+portal.host=//sf.jishutao.com/portal/1.0.10
 
 patentTemplate=SMS_72005286

+ 5 - 1
src/main/resources/props/config_test.properties

@@ -73,4 +73,8 @@ portal.host=//aftts.hnzhiming.com/portal/1.0.8
 
 patentTemplate=SMS_72005286
 
-avatar.upload.host=//aftts.hnzhiming.com/upload
+avatar.upload.host=//aftts.hnzhiming.com/upload
+
+easemob.client.url=https://a1.easemob.com/1117170814115609/jitao
+easemob.client.id=YXA6RUDGkIDSEeemq9_4PWzcNA
+easemob.client.secret=YXA61NHE0renI5N8gEgizoI5ivM9SYE

+ 14 - 3
src/main/resources/spring/spring-shiro.xml

@@ -29,9 +29,20 @@
 	<bean id="redisTemplate" class="com.goafanti.core.cache.template.FastJsonRedisTemplate">
 		<constructor-arg index="0" ref="redisConnectionFactory" />
 	</bean>
-
-	<bean id="sessionRedisTemplate"
-		class="com.goafanti.core.shiro.cache.template.SessionRedisTemplate">
+	
+    <bean id="jedisQueueListener" class="com.goafanti.easemob.queue.EasemobRedisQueueListener"/>  
+    
+    
+    <bean id="jedisQueue" class="com.goafanti.easemob.queue.EasemobRedisQueue" destroy-method="destroy">  
+        <property name="redisTemplate" ref="redisTemplate"></property>  
+        <property name="key" value="easemob:queue"></property>  
+        <property name="listener" ref="jedisQueueListener"></property>  
+    </bean> 
+    
+    <bean id="easemobUtils" class="com.goafanti.easemob.EasemobUtils"/>
+      
+
+	<bean id="sessionRedisTemplate" class="com.goafanti.core.shiro.cache.template.SessionRedisTemplate">
 		<constructor-arg index="0" ref="redisConnectionFactory" />
 	</bean>
 

Файловите разлики са ограничени, защото са твърде много
+ 1 - 2
src/main/webapp/WEB-INF/views/portal/index.html


+ 11 - 11
src/main/webapp/WEB-INF/views/portal/residentIntegration/index.html

@@ -74,14 +74,11 @@
 			<div class="patent_bottom">
 				<div class="col-xs-6 bg-left">
 					<ul>
-						<li th:each="it: ${jmrhTechnologyList}">
+						<li th:each="it: ${jmrhProjectList}">
 							<a th:href="${basePath+ '/portal/detail/achievementDetail.html?id=' + it.id +'&type=' + it.ownerType}">
 								<span class="note" th:text="${it.name}"></span>
-								<span th:if="${it.maturity == '1'}" class="node" >正在研发</span>
-								<span th:if="${it.maturity == '2'}" class="node" >已有样品</span>
-								<span th:if="${it.maturity == '3'}" class="node" >通过小试</span>
-								<span th:if="${it.maturity == '4'}" class="node" >通过中试</span>
-								<span th:if="${it.maturity == '5'}" class="node" >可以量产</span>
+								<span class="node" th:text="${it.industry}"></span>
+						   <!-- <span class="note" th:text="${it.residenceCity}"></span> -->
 							</a>
 						</li>
 					</ul>
@@ -97,11 +94,14 @@
 				<div class="col-xs-6 imgt"><img th:src="${portalHost + '/img/cicm_3.png'}"/></div>
 				<div class="col-xs-6 bg-right">
 					<ul>
-						<li th:each="it: ${jmrhProjectList}">
+						<li th:each="it: ${jmrhTechnologyList}">
 							<a th:href="${basePath+ '/portal/detail/achievementDetail.html?id=' + it.id +'&type=' + it.ownerType}">
-								<span class="note" th:text="${it.name}"></span>
-								<span class="node" th:text="${it.industry}"></span>
-<!-- 								<span class="note" th:text="${it.residenceCity}"></span> -->
+							<span class="note" th:text="${it.name}"></span>
+								<span th:if="${it.maturity == '1'}" class="node" >正在研发</span>
+								<span th:if="${it.maturity == '2'}" class="node" >已有样品</span>
+								<span th:if="${it.maturity == '3'}" class="node" >通过小试</span>
+								<span th:if="${it.maturity == '4'}" class="node" >通过中试</span>
+								<span th:if="${it.maturity == '5'}" class="node" >可以量产</span>
 							</a>
 						</li>
 					</ul>
@@ -215,7 +215,7 @@
 			</ul>
 		</div>
 	</div>
-	    <div class="policy">
+	    <div class="policy" style="display:none">
         <div class="div_title">
             <img src="../../img/policy_ico.png">
             <h2>政策法规</h2>