Przeglądaj źródła

消息推送后台修复

Michael 8 lat temu
rodzic
commit
8af42f42fc

+ 1 - 1
GeneratorConfig.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
 <generatorConfiguration>
-  <classPathEntry location="E:/mysql-connector-java-5.1.40.jar" />
+  <classPathEntry location="E:/mysql-connector-java-5.1.44.jar" />
   <context id="context1">	
     <jdbcConnection connectionURL="jdbc:mysql://192.168.1.213:3306/aft" 
     	driverClass="com.mysql.jdbc.Driver" password="123456" userId="dev" />

+ 8 - 8
src/main/java/com/goafanti/admin/controller/AdminMessageController.java

@@ -65,7 +65,7 @@ public class AdminMessageController extends CertifyApiController{
 	 * @throws ParseException 
 	 */
 	@RequestMapping(value = "/createSystemMessage", method = RequestMethod.POST)
-	public Result createSystemMessage(String userIds,String adminIds,String companyIds,String societyTags,String provinceIds,String cityIds,String areaIds,
+	public Result createSystemMessage(String personalUserIds,String organizationUserIds, String adminIds,String companyIds,String societyTags,String provinceIds,String cityIds,String areaIds,
 			String roles,String industryIds,String title,String body,Integer subject,Integer targetType,String createTime,Integer isDraft) throws ParseException{
 		Result res = new Result();
 		if(null == targetType){
@@ -84,10 +84,10 @@ public class AdminMessageController extends CertifyApiController{
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"", "必须说明是否为草稿"));
 			return res;
 		}
-		checkParam(userIds,adminIds,companyIds,societyTags,provinceIds,cityIds,areaIds,roles,industryIds);
+		checkParam(personalUserIds,organizationUserIds,adminIds,companyIds,societyTags,provinceIds,cityIds,areaIds,roles,industryIds);
 		Map<Integer,String> targetMap = new HashMap<Integer, String>();
-		if(targetType == ConsumerType.PERSON_CUSTOMER_RETAIL.getTypeCode()) targetMap.put(targetType, userIds);
-		if(targetType == ConsumerType.ORGANIZATION_CUSTOMER_RETAIL.getTypeCode()) targetMap.put(targetType, userIds);
+		if(targetType == ConsumerType.PERSON_CUSTOMER_RETAIL.getTypeCode()) targetMap.put(targetType, personalUserIds);
+		if(targetType == ConsumerType.ORGANIZATION_CUSTOMER_RETAIL.getTypeCode()) targetMap.put(targetType, organizationUserIds);
 		if(targetType == ConsumerType.USER_RETAIL.getTypeCode()) targetMap.put(targetType, adminIds);
 		if(targetType == ConsumerType.SOCIETY_TAG.getTypeCode()) targetMap.put(targetType, societyTags);
 		if(targetType == ConsumerType.LOCATION.getTypeCode()){
@@ -130,7 +130,7 @@ public class AdminMessageController extends CertifyApiController{
 	@RequestMapping(value = "/createRecommendMessage", method = RequestMethod.POST)
 	public Result createRecommendMessage(String projectIds,String personalAchievementIds,String organizationAchievementIds,
 			String personalDemandIds,String organizationDemandIds, String expertIds, String newsIds,Integer sourceType,
-			String userIds,String societyTags,String provinceIds,String cityIds,String areaIds,String industryIds,Integer targetType,Integer isDraft){
+			String personalUserIds,String organizationUserIds,String societyTags,String provinceIds,String cityIds,String areaIds,String industryIds,Integer targetType,Integer isDraft){
 		Result res = new Result();
 		if(null == sourceType){
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"", "必须指定推荐类型"));
@@ -145,7 +145,7 @@ public class AdminMessageController extends CertifyApiController{
 			return res;
 		}
 		checkParam(projectIds,projectIds,personalAchievementIds,organizationAchievementIds,personalDemandIds,organizationDemandIds,
-				expertIds,newsIds,userIds,provinceIds,cityIds,areaIds,industryIds);
+				expertIds,newsIds,personalUserIds,organizationUserIds,provinceIds,cityIds,areaIds,industryIds);
 		Map<Integer,String> sourceMap = new HashMap<Integer, String>();
 		if(sourceType == RecommendType.TECH_SERVICE.getTypeCode()) sourceMap.put(sourceType, projectIds);
 		if(sourceType == RecommendType.PERSON_ACHIEVEMENT.getTypeCode()) sourceMap.put(sourceType, personalAchievementIds);
@@ -159,8 +159,8 @@ public class AdminMessageController extends CertifyApiController{
 			return res;
 		}
 		Map<Integer,String> targetMap = new HashMap<Integer, String>();
-		if(targetType == ConsumerType.PERSON_CUSTOMER_RETAIL.getTypeCode()) targetMap.put(targetType, userIds);
-		if(targetType == ConsumerType.ORGANIZATION_CUSTOMER_RETAIL.getTypeCode()) targetMap.put(targetType, userIds);
+		if(targetType == ConsumerType.PERSON_CUSTOMER_RETAIL.getTypeCode()) targetMap.put(targetType, personalUserIds);
+		if(targetType == ConsumerType.ORGANIZATION_CUSTOMER_RETAIL.getTypeCode()) targetMap.put(targetType, organizationUserIds);
 		if(targetType == ConsumerType.SOCIETY_TAG.getTypeCode()) targetMap.put(targetType, societyTags);
 		if(targetType == ConsumerType.LOCATION.getTypeCode()){
 			 targetMap.put(targetType, ConsumerType.LOCATION.getTypeName());

+ 14 - 14
src/main/java/com/goafanti/common/dao/JpushEasemobAccountMapper.java

@@ -9,72 +9,72 @@ public interface JpushEasemobAccountMapper {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table jpush_easemob_account
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	long countByExample(JpushEasemobAccountExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table jpush_easemob_account
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	int deleteByExample(JpushEasemobAccountExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table jpush_easemob_account
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
-	int deleteByPrimaryKey(String uuid);
+	int deleteByPrimaryKey(Integer id);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table jpush_easemob_account
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	int insert(JpushEasemobAccount record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table jpush_easemob_account
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	int insertSelective(JpushEasemobAccount record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table jpush_easemob_account
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	List<JpushEasemobAccount> selectByExample(JpushEasemobAccountExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table jpush_easemob_account
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
-	JpushEasemobAccount selectByPrimaryKey(String uuid);
+	JpushEasemobAccount selectByPrimaryKey(Integer id);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table jpush_easemob_account
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	int updateByExampleSelective(@Param("record") JpushEasemobAccount record,
 			@Param("example") JpushEasemobAccountExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table jpush_easemob_account
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	int updateByExample(@Param("record") JpushEasemobAccount record,
 			@Param("example") JpushEasemobAccountExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table jpush_easemob_account
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	int updateByPrimaryKeySelective(JpushEasemobAccount record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table jpush_easemob_account
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	int updateByPrimaryKey(JpushEasemobAccount record);
-	
+
 	/**
 	 * 根据用户查询
 	 * @param uid

+ 48 - 31
src/main/java/com/goafanti/common/mapper/JpushEasemobAccountMapper.xml

@@ -5,9 +5,10 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Dec 21 08:23:35 CST 2017.
+      This element was generated on Mon Dec 25 14:46:37 CST 2017.
     -->
-    <id column="uuid" jdbcType="VARCHAR" property="uuid" />
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="uuid" jdbcType="VARCHAR" property="uuid" />
     <result column="registration_id" jdbcType="VARCHAR" property="registrationId" />
     <result column="uid" jdbcType="VARCHAR" property="uid" />
     <result column="tag" jdbcType="VARCHAR" property="tag" />
@@ -20,7 +21,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Dec 21 08:23:35 CST 2017.
+      This element was generated on Mon Dec 25 14:46:37 CST 2017.
     -->
     <where>
       <foreach collection="oredCriteria" item="criteria" separator="or">
@@ -54,7 +55,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Dec 21 08:23:35 CST 2017.
+      This element was generated on Mon Dec 25 14:46:37 CST 2017.
     -->
     <where>
       <foreach collection="example.oredCriteria" item="criteria" separator="or">
@@ -88,15 +89,15 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Dec 21 08:23:35 CST 2017.
+      This element was generated on Mon Dec 25 14:46:37 CST 2017.
     -->
-    uuid, registration_id, uid, tag, group_id, last_login_time, easemob_name, easemob_pass
+    id, uuid, registration_id, uid, tag, group_id, last_login_time, easemob_name, easemob_pass
   </sql>
   <select id="selectByExample" parameterType="com.goafanti.common.model.JpushEasemobAccountExample" resultMap="BaseResultMap">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Dec 21 08:23:35 CST 2017.
+      This element was generated on Mon Dec 25 14:46:37 CST 2017.
     -->
     select
     <if test="distinct">
@@ -111,31 +112,31 @@
       order by ${orderByClause}
     </if>
   </select>
-  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+  <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 Thu Dec 21 08:23:35 CST 2017.
+      This element was generated on Mon Dec 25 14:46:37 CST 2017.
     -->
     select 
     <include refid="Base_Column_List" />
     from jpush_easemob_account
-    where uuid = #{uuid,jdbcType=VARCHAR}
+    where id = #{id,jdbcType=INTEGER}
   </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+  <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 Thu Dec 21 08:23:35 CST 2017.
+      This element was generated on Mon Dec 25 14:46:37 CST 2017.
     -->
     delete from jpush_easemob_account
-    where uuid = #{uuid,jdbcType=VARCHAR}
+    where id = #{id,jdbcType=INTEGER}
   </delete>
   <delete id="deleteByExample" parameterType="com.goafanti.common.model.JpushEasemobAccountExample">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Dec 21 08:23:35 CST 2017.
+      This element was generated on Mon Dec 25 14:46:37 CST 2017.
     -->
     delete from jpush_easemob_account
     <if test="_parameter != null">
@@ -146,23 +147,28 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Dec 21 08:23:35 CST 2017.
+      This element was generated on Mon Dec 25 14:46:37 CST 2017.
     -->
-    insert into jpush_easemob_account (uuid, registration_id, uid, 
-      tag, group_id, last_login_time, 
-      easemob_name, easemob_pass)
-    values (#{uuid,jdbcType=VARCHAR}, #{registrationId,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, 
-      #{tag,jdbcType=VARCHAR}, #{groupId,jdbcType=VARCHAR}, #{lastLoginTime,jdbcType=TIMESTAMP}, 
-      #{easemobName,jdbcType=VARCHAR}, #{easemobPass,jdbcType=VARCHAR})
+    insert into jpush_easemob_account (id, uuid, registration_id, 
+      uid, tag, group_id, 
+      last_login_time, easemob_name, easemob_pass
+      )
+    values (#{id,jdbcType=INTEGER}, #{uuid,jdbcType=VARCHAR}, #{registrationId,jdbcType=VARCHAR}, 
+      #{uid,jdbcType=VARCHAR}, #{tag,jdbcType=VARCHAR}, #{groupId,jdbcType=VARCHAR}, 
+      #{lastLoginTime,jdbcType=TIMESTAMP}, #{easemobName,jdbcType=VARCHAR}, #{easemobPass,jdbcType=VARCHAR}
+      )
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.JpushEasemobAccount">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Dec 21 08:23:35 CST 2017.
+      This element was generated on Mon Dec 25 14:46:37 CST 2017.
     -->
     insert into jpush_easemob_account
     <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
       <if test="uuid != null">
         uuid,
       </if>
@@ -189,6 +195,9 @@
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=INTEGER},
+      </if>
       <if test="uuid != null">
         #{uuid,jdbcType=VARCHAR},
       </if>
@@ -219,7 +228,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Dec 21 08:23:35 CST 2017.
+      This element was generated on Mon Dec 25 14:46:37 CST 2017.
     -->
     select count(*) from jpush_easemob_account
     <if test="_parameter != null">
@@ -230,10 +239,13 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Dec 21 08:23:35 CST 2017.
+      This element was generated on Mon Dec 25 14:46:37 CST 2017.
     -->
     update jpush_easemob_account
     <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=INTEGER},
+      </if>
       <if test="record.uuid != null">
         uuid = #{record.uuid,jdbcType=VARCHAR},
       </if>
@@ -267,10 +279,11 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Dec 21 08:23:35 CST 2017.
+      This element was generated on Mon Dec 25 14:46:37 CST 2017.
     -->
     update jpush_easemob_account
-    set uuid = #{record.uuid,jdbcType=VARCHAR},
+    set id = #{record.id,jdbcType=INTEGER},
+      uuid = #{record.uuid,jdbcType=VARCHAR},
       registration_id = #{record.registrationId,jdbcType=VARCHAR},
       uid = #{record.uid,jdbcType=VARCHAR},
       tag = #{record.tag,jdbcType=VARCHAR},
@@ -286,10 +299,13 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Dec 21 08:23:35 CST 2017.
+      This element was generated on Mon Dec 25 14:46:37 CST 2017.
     -->
     update jpush_easemob_account
     <set>
+      <if test="uuid != null">
+        uuid = #{uuid,jdbcType=VARCHAR},
+      </if>
       <if test="registrationId != null">
         registration_id = #{registrationId,jdbcType=VARCHAR},
       </if>
@@ -312,23 +328,24 @@
         easemob_pass = #{easemobPass,jdbcType=VARCHAR},
       </if>
     </set>
-    where uuid = #{uuid,jdbcType=VARCHAR}
+    where id = #{id,jdbcType=INTEGER}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.JpushEasemobAccount">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Dec 21 08:23:35 CST 2017.
+      This element was generated on Mon Dec 25 14:46:37 CST 2017.
     -->
     update jpush_easemob_account
-    set registration_id = #{registrationId,jdbcType=VARCHAR},
+    set uuid = #{uuid,jdbcType=VARCHAR},
+      registration_id = #{registrationId,jdbcType=VARCHAR},
       uid = #{uid,jdbcType=VARCHAR},
       tag = #{tag,jdbcType=VARCHAR},
       group_id = #{groupId,jdbcType=VARCHAR},
       last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
       easemob_name = #{easemobName,jdbcType=VARCHAR},
       easemob_pass = #{easemobPass,jdbcType=VARCHAR}
-    where uuid = #{uuid,jdbcType=VARCHAR}
+    where id = #{id,jdbcType=INTEGER}
   </update>
   <select id="selectSynAccByUid" parameterType="java.lang.String" resultMap="BaseResultMap">
   	select 

+ 47 - 24
src/main/java/com/goafanti/common/model/JpushEasemobAccount.java

@@ -5,50 +5,73 @@ import java.util.Date;
 public class JpushEasemobAccount {
 
 	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column jpush_easemob_account.id
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
+	 */
+	private Integer id;
+	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column jpush_easemob_account.uuid
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	private String uuid;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column jpush_easemob_account.registration_id
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	private String registrationId;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column jpush_easemob_account.uid
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	private String uid;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column jpush_easemob_account.tag
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	private String tag;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column jpush_easemob_account.group_id
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	private String groupId;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column jpush_easemob_account.last_login_time
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	private Date lastLoginTime;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column jpush_easemob_account.easemob_name
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	private String easemobName;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column jpush_easemob_account.easemob_pass
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	private String easemobPass;
 
 	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column jpush_easemob_account.id
+	 * @return  the value of jpush_easemob_account.id
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
+	 */
+	public Integer getId() {
+		return id;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column jpush_easemob_account.id
+	 * @param id  the value for jpush_easemob_account.id
+	 * @mbg.generated  Mon Dec 25 14:46:37 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 jpush_easemob_account.uuid
 	 * @return  the value of jpush_easemob_account.uuid
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	public String getUuid() {
 		return uuid;
@@ -57,7 +80,7 @@ public class JpushEasemobAccount {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column jpush_easemob_account.uuid
 	 * @param uuid  the value for jpush_easemob_account.uuid
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	public void setUuid(String uuid) {
 		this.uuid = uuid;
@@ -66,7 +89,7 @@ public class JpushEasemobAccount {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column jpush_easemob_account.registration_id
 	 * @return  the value of jpush_easemob_account.registration_id
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	public String getRegistrationId() {
 		return registrationId;
@@ -75,7 +98,7 @@ public class JpushEasemobAccount {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column jpush_easemob_account.registration_id
 	 * @param registrationId  the value for jpush_easemob_account.registration_id
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	public void setRegistrationId(String registrationId) {
 		this.registrationId = registrationId;
@@ -84,7 +107,7 @@ public class JpushEasemobAccount {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column jpush_easemob_account.uid
 	 * @return  the value of jpush_easemob_account.uid
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	public String getUid() {
 		return uid;
@@ -93,7 +116,7 @@ public class JpushEasemobAccount {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column jpush_easemob_account.uid
 	 * @param uid  the value for jpush_easemob_account.uid
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	public void setUid(String uid) {
 		this.uid = uid;
@@ -102,7 +125,7 @@ public class JpushEasemobAccount {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column jpush_easemob_account.tag
 	 * @return  the value of jpush_easemob_account.tag
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	public String getTag() {
 		return tag;
@@ -111,7 +134,7 @@ public class JpushEasemobAccount {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column jpush_easemob_account.tag
 	 * @param tag  the value for jpush_easemob_account.tag
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	public void setTag(String tag) {
 		this.tag = tag;
@@ -120,7 +143,7 @@ public class JpushEasemobAccount {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column jpush_easemob_account.group_id
 	 * @return  the value of jpush_easemob_account.group_id
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	public String getGroupId() {
 		return groupId;
@@ -129,7 +152,7 @@ public class JpushEasemobAccount {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column jpush_easemob_account.group_id
 	 * @param groupId  the value for jpush_easemob_account.group_id
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	public void setGroupId(String groupId) {
 		this.groupId = groupId;
@@ -138,7 +161,7 @@ public class JpushEasemobAccount {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column jpush_easemob_account.last_login_time
 	 * @return  the value of jpush_easemob_account.last_login_time
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	public Date getLastLoginTime() {
 		return lastLoginTime;
@@ -147,7 +170,7 @@ public class JpushEasemobAccount {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column jpush_easemob_account.last_login_time
 	 * @param lastLoginTime  the value for jpush_easemob_account.last_login_time
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	public void setLastLoginTime(Date lastLoginTime) {
 		this.lastLoginTime = lastLoginTime;
@@ -156,7 +179,7 @@ public class JpushEasemobAccount {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column jpush_easemob_account.easemob_name
 	 * @return  the value of jpush_easemob_account.easemob_name
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	public String getEasemobName() {
 		return easemobName;
@@ -165,7 +188,7 @@ public class JpushEasemobAccount {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column jpush_easemob_account.easemob_name
 	 * @param easemobName  the value for jpush_easemob_account.easemob_name
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	public void setEasemobName(String easemobName) {
 		this.easemobName = easemobName;
@@ -174,7 +197,7 @@ public class JpushEasemobAccount {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column jpush_easemob_account.easemob_pass
 	 * @return  the value of jpush_easemob_account.easemob_pass
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	public String getEasemobPass() {
 		return easemobPass;
@@ -183,7 +206,7 @@ public class JpushEasemobAccount {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column jpush_easemob_account.easemob_pass
 	 * @param easemobPass  the value for jpush_easemob_account.easemob_pass
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	public void setEasemobPass(String easemobPass) {
 		this.easemobPass = easemobPass;

+ 76 - 16
src/main/java/com/goafanti/common/model/JpushEasemobAccountExample.java

@@ -7,23 +7,23 @@ import java.util.List;
 public class JpushEasemobAccountExample {
     /**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table jpush_easemob_account
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	protected String orderByClause;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table jpush_easemob_account
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	protected boolean distinct;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table jpush_easemob_account
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	protected List<Criteria> oredCriteria;
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table jpush_easemob_account
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	public JpushEasemobAccountExample() {
 		oredCriteria = new ArrayList<Criteria>();
@@ -31,7 +31,7 @@ public class JpushEasemobAccountExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table jpush_easemob_account
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	public void setOrderByClause(String orderByClause) {
 		this.orderByClause = orderByClause;
@@ -39,7 +39,7 @@ public class JpushEasemobAccountExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table jpush_easemob_account
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	public String getOrderByClause() {
 		return orderByClause;
@@ -47,7 +47,7 @@ public class JpushEasemobAccountExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table jpush_easemob_account
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	public void setDistinct(boolean distinct) {
 		this.distinct = distinct;
@@ -55,7 +55,7 @@ public class JpushEasemobAccountExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table jpush_easemob_account
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	public boolean isDistinct() {
 		return distinct;
@@ -63,7 +63,7 @@ public class JpushEasemobAccountExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table jpush_easemob_account
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	public List<Criteria> getOredCriteria() {
 		return oredCriteria;
@@ -71,7 +71,7 @@ public class JpushEasemobAccountExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table jpush_easemob_account
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	public void or(Criteria criteria) {
 		oredCriteria.add(criteria);
@@ -79,7 +79,7 @@ public class JpushEasemobAccountExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table jpush_easemob_account
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	public Criteria or() {
 		Criteria criteria = createCriteriaInternal();
@@ -89,7 +89,7 @@ public class JpushEasemobAccountExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table jpush_easemob_account
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	public Criteria createCriteria() {
 		Criteria criteria = createCriteriaInternal();
@@ -101,7 +101,7 @@ public class JpushEasemobAccountExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table jpush_easemob_account
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	protected Criteria createCriteriaInternal() {
 		Criteria criteria = new Criteria();
@@ -110,7 +110,7 @@ public class JpushEasemobAccountExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table jpush_easemob_account
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	public void clear() {
 		oredCriteria.clear();
@@ -120,7 +120,7 @@ public class JpushEasemobAccountExample {
 
 	/**
 	 * This class was generated by MyBatis Generator. This class corresponds to the database table jpush_easemob_account
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	protected abstract static class GeneratedCriteria {
 		protected List<Criterion> criteria;
@@ -163,6 +163,66 @@ public class JpushEasemobAccountExample {
 			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 andUuidIsNull() {
 			addCriterion("uuid is null");
 			return (Criteria) this;
@@ -716,7 +776,7 @@ public class JpushEasemobAccountExample {
 
 	/**
 	 * This class was generated by MyBatis Generator. This class corresponds to the database table jpush_easemob_account
-	 * @mbg.generated  Thu Dec 21 08:23:35 CST 2017
+	 * @mbg.generated  Mon Dec 25 14:46:37 CST 2017
 	 */
 	public static class Criterion {
 		private String condition;

+ 1 - 1
src/main/java/com/goafanti/message/enums/ConsumerType.java

@@ -24,7 +24,7 @@ public enum ConsumerType {
 	/** 个人客户 **/
 	PERSON_CUSTOMER_RETAIL(61,"PERSON_CUSTOMER_RETAIL"),
 	/** 单位客户 **/
-	ORGANIZATION_CUSTOMER_RETAIL(61,"ORGANIZATION_CUSTOMER_RETAIL"),
+	ORGANIZATION_CUSTOMER_RETAIL(62,"ORGANIZATION_CUSTOMER_RETAIL"),
 	/** 没有定义 **/
 	NO_DEFINITION(null,"NO_DEFINITION");
 	private ConsumerType(Integer typeCode, String typeName) {

+ 1 - 1
src/main/java/com/goafanti/message/service/MessageService.java

@@ -89,7 +89,7 @@ public interface MessageService {
 	 * @param easemobPass 环信密码
 	 * @return
 	 */
-	public int addJpushEasemobAccount(String uuid,String easemobName,String easemobPass);
+	public int addJpushEasemobAccount(String uuid,String uid,String easemobName,String easemobPass);
 	
 	/**
 	 * 更新

+ 20 - 14
src/main/java/com/goafanti/message/service/impl/MessageServiceImpl.java

@@ -44,9 +44,10 @@ public class MessageServiceImpl  extends BaseMybatisDao<MessageFromSystemMapper>
 	private JpushEasemobAccountMapper jpushEasemobAccountMapper;
 	@Override
 	public String selectSendUser(Map<Integer, String> selectMap,Integer type) {
-		if(selectMap.containsKey(ConsumerType.PERSON_CUSTOMER_RETAIL.getTypeCode())
-				|| selectMap.containsKey(ConsumerType.ORGANIZATION_CUSTOMER_RETAIL.getTypeCode())){ //客户散户
-			return selectMap.get(ConsumerType.CUSTOMER_RETAIL.getTypeCode());
+		if(selectMap.containsKey(ConsumerType.PERSON_CUSTOMER_RETAIL.getTypeCode())){ //客户散户
+			return selectMap.get(ConsumerType.PERSON_CUSTOMER_RETAIL.getTypeCode());
+		}else if(selectMap.containsKey(ConsumerType.ORGANIZATION_CUSTOMER_RETAIL.getTypeCode())){
+			return selectMap.get(ConsumerType.ORGANIZATION_CUSTOMER_RETAIL.getTypeCode());
 		}else if(selectMap.containsKey(ConsumerType.USER_RETAIL.getTypeCode())){
 			return selectMap.get(ConsumerType.USER_RETAIL.getTypeCode()); //用户散户
 		}else if(selectMap.containsKey(ConsumerType.SOCIETY_TAG.getTypeCode())){ // 社会标签
@@ -215,16 +216,21 @@ public class MessageServiceImpl  extends BaseMybatisDao<MessageFromSystemMapper>
 				message.setResourceId(mfs.getResourceId());
 				messageTarget.add(message);
 				//插入消息推送表
-				if(subject == SubjectType.KE_HU.getTypeCode()){ //只推客户
+				if(subject == SubjectType.KE_HU.getTypeCode()||subject == SubjectType.TUI_JIAN.getTypeCode()){ //只推客户
 					MessageProducer mp = null;
-					String[] cids = selectSendUser(targetMap,targetType).split(",");
-					for(String cid : cids){
-						mp = new MessageProducer();
-						mp.setId(UUID.randomUUID().toString());
-						mp.setConsumerId(cid);
-						mp.setCreateTime(createTime);
-						mp.setMessageId(messageId);
-						producerTarget.add(mp);
+					String tmp = selectSendUser(targetMap,targetType);
+					String[] cids = null;
+					if(tmp != null){
+						cids = tmp.split(",");
+						System.out.println("cids=="+cids);
+						for(String cid : cids){
+							mp = new MessageProducer();
+							mp.setId(UUID.randomUUID().toString());
+							mp.setConsumerId(cid);
+							mp.setCreateTime(createTime);
+							mp.setMessageId(messageId);
+							producerTarget.add(mp);
+						}
 					}
 				}
 			}
@@ -367,9 +373,9 @@ public class MessageServiceImpl  extends BaseMybatisDao<MessageFromSystemMapper>
 	}
 
 	@Override
-	public int addJpushEasemobAccount(String uuid,String easemobName,String easemobPass) {
+	public int addJpushEasemobAccount(String uuid,String uid,String easemobName,String easemobPass) {
 		JpushEasemobAccount jea = new  JpushEasemobAccount();
-		jea.setUid(TokenManager.getUserId());
+		jea.setUid(uid);
 		jea.setUuid(uuid);
 		jea.setEasemobName(easemobName);
 		jea.setEasemobPass(easemobPass);

+ 5 - 3
src/main/java/com/goafanti/user/controller/UserRegisterController.java

@@ -104,6 +104,7 @@ public class UserRegisterController extends BaseController {
 			us.setUpdateTime(now.getTime());
 			us.setPassword(passwordUtil.getEncryptPwd(us));
 			us.setLvl(0);
+			us.setNickname(companyName);
 			us.setSource(AFTConstants.USER_SOURCE_REGISTER);
 			us.setIsMember(AFTConstants.NO);
 			us.setStatus(AFTConstants.USER_STATUS_NORMAL);
@@ -119,12 +120,13 @@ public class UserRegisterController extends BaseController {
 			*/
 			us.setAid("2");//ID为"2"的管理员
 			userService.insertRegister(us,companyName,contacts);
+			registerEasemobAfterRegister(uuid,us.getId());//开通环信账号
 		}
-		registerEasemobAfterRegister(uuid);//开通环信账号
+		
 		return res;
 	}
 	
-	private void registerEasemobAfterRegister(String uuid){
+	private void registerEasemobAfterRegister(String uuid,String uid){
 		User u = TokenManager.getUserToken();
 		if(u != null){
 			JSONObject resultObj = new JSONObject();
@@ -136,7 +138,7 @@ public class UserRegisterController extends BaseController {
 			easemobUtils.sendLater(
 					new EasemobInfo().uri("/users/").data(resultObj.toJSONString()).method(HttpMethod.POST));
 			//绑定账号
-			messageService.addJpushEasemobAccount(uuid,easemobName,easemobPass);
+			messageService.addJpushEasemobAccount(uuid,uid,easemobName,easemobPass);
 			
 		}
 	}