Showing
11 changed files
with
207 additions
and
168 deletions
@@ -87,7 +87,6 @@ | @@ -87,7 +87,6 @@ | ||
87 | <value>/UnionShareRest/queryUnionShareOrders</value> | 87 | <value>/UnionShareRest/queryUnionShareOrders</value> |
88 | <value>/UnionShareRest/mqUnionShareOrder</value> | 88 | <value>/UnionShareRest/mqUnionShareOrder</value> |
89 | <value>/UnionShareRest/mqUnionSettleUpdate</value> | 89 | <value>/UnionShareRest/mqUnionSettleUpdate</value> |
90 | - <value>/UnionShareRest/agreeContract</value> | ||
91 | <value>/UnionShareRest/bindBankCard</value> | 90 | <value>/UnionShareRest/bindBankCard</value> |
92 | <value>/UnionShareRest/getBankList</value> | 91 | <value>/UnionShareRest/getBankList</value> |
93 | <value>/UnionShareRest/getBankCard</value> | 92 | <value>/UnionShareRest/getBankCard</value> |
@@ -98,6 +97,8 @@ | @@ -98,6 +97,8 @@ | ||
98 | <value>/UnionShareRest/cancelUserBanks</value> | 97 | <value>/UnionShareRest/cancelUserBanks</value> |
99 | <value>/UnionShareRest/refuseApply</value> | 98 | <value>/UnionShareRest/refuseApply</value> |
100 | <value>/UnionShareRest/agreeApply</value> | 99 | <value>/UnionShareRest/agreeApply</value> |
100 | + <value>/UnionShareRest/userApply</value> | ||
101 | + <value>/UnionShareRest/checkApply</value> | ||
101 | 102 | ||
102 | </list> | 103 | </list> |
103 | </property> | 104 | </property> |
@@ -16,6 +16,8 @@ public interface UnionShareUserApplyMapper { | @@ -16,6 +16,8 @@ public interface UnionShareUserApplyMapper { | ||
16 | int insertSelective(UnionShareUserApply record); | 16 | int insertSelective(UnionShareUserApply record); |
17 | 17 | ||
18 | UnionShareUserApply selectByPrimaryKey(Integer id); | 18 | UnionShareUserApply selectByPrimaryKey(Integer id); |
19 | + UnionShareUserApply selectOneByUid(UnionShareUserApply record); | ||
20 | + int selectCountByUid(UnionShareUserApply record); | ||
19 | List<UnionShareUserApply> selectByIds(@Param("ids")Set<Integer> ids); | 21 | List<UnionShareUserApply> selectByIds(@Param("ids")Set<Integer> ids); |
20 | 22 | ||
21 | int updateByPrimaryKeySelective(UnionShareUserApply record); | 23 | int updateByPrimaryKeySelective(UnionShareUserApply record); |
@@ -9,7 +9,7 @@ public class UnionShareUser { | @@ -9,7 +9,7 @@ public class UnionShareUser { | ||
9 | 9 | ||
10 | private Integer updateTime; | 10 | private Integer updateTime; |
11 | private Integer createTime; | 11 | private Integer createTime; |
12 | - private Integer contractStatus; | 12 | + private Integer applyId; |
13 | private Integer status; | 13 | private Integer status; |
14 | 14 | ||
15 | private String imageUrl; | 15 | private String imageUrl; |
@@ -72,12 +72,12 @@ public class UnionShareUser { | @@ -72,12 +72,12 @@ public class UnionShareUser { | ||
72 | this.createTime = createTime; | 72 | this.createTime = createTime; |
73 | } | 73 | } |
74 | 74 | ||
75 | - public Integer getContractStatus() { | ||
76 | - return contractStatus; | 75 | + public Integer getApplyId() { |
76 | + return applyId; | ||
77 | } | 77 | } |
78 | 78 | ||
79 | - public void setContractStatus(Integer contractStatus) { | ||
80 | - this.contractStatus = contractStatus; | 79 | + public void setApplyId(Integer applyId) { |
80 | + this.applyId = applyId; | ||
81 | } | 81 | } |
82 | 82 | ||
83 | public Integer getStatus() { | 83 | public Integer getStatus() { |
@@ -97,7 +97,7 @@ public class UnionShareUser { | @@ -97,7 +97,7 @@ public class UnionShareUser { | ||
97 | ", createTime=" + createTime + | 97 | ", createTime=" + createTime + |
98 | ", updateTime=" + updateTime + | 98 | ", updateTime=" + updateTime + |
99 | ", status=" + status + | 99 | ", status=" + status + |
100 | - ", contractStatus=" + contractStatus + | 100 | + ", applyId=" + applyId + |
101 | ", imageUrl='" + imageUrl + '\'' + | 101 | ", imageUrl='" + imageUrl + '\'' + |
102 | ", shareId='" + shareId + '\'' + | 102 | ", shareId='" + shareId + '\'' + |
103 | '}'; | 103 | '}'; |
@@ -8,11 +8,7 @@ public class UnionShareUserApply { | @@ -8,11 +8,7 @@ public class UnionShareUserApply { | ||
8 | private String name; | 8 | private String name; |
9 | private String mobile; | 9 | private String mobile; |
10 | 10 | ||
11 | - private Byte socialMediaType; | ||
12 | - | ||
13 | - private String socialMediaAccount; | ||
14 | - | ||
15 | - private Integer socialMediaFans; | 11 | + private String socialMedia; |
16 | 12 | ||
17 | private Byte status; | 13 | private Byte status; |
18 | 14 | ||
@@ -54,28 +50,12 @@ public class UnionShareUserApply { | @@ -54,28 +50,12 @@ public class UnionShareUserApply { | ||
54 | this.mobile = mobile; | 50 | this.mobile = mobile; |
55 | } | 51 | } |
56 | 52 | ||
57 | - public Byte getSocialMediaType() { | ||
58 | - return socialMediaType; | ||
59 | - } | ||
60 | - | ||
61 | - public void setSocialMediaType(Byte socialMediaType) { | ||
62 | - this.socialMediaType = socialMediaType; | ||
63 | - } | ||
64 | - | ||
65 | - public String getSocialMediaAccount() { | ||
66 | - return socialMediaAccount; | ||
67 | - } | ||
68 | - | ||
69 | - public void setSocialMediaAccount(String socialMediaAccount) { | ||
70 | - this.socialMediaAccount = socialMediaAccount == null ? null : socialMediaAccount.trim(); | ||
71 | - } | ||
72 | - | ||
73 | - public Integer getSocialMediaFans() { | ||
74 | - return socialMediaFans; | 53 | + public String getSocialMedia() { |
54 | + return socialMedia; | ||
75 | } | 55 | } |
76 | 56 | ||
77 | - public void setSocialMediaFans(Integer socialMediaFans) { | ||
78 | - this.socialMediaFans = socialMediaFans; | 57 | + public void setSocialMedia(String socialMedia) { |
58 | + this.socialMedia = socialMedia; | ||
79 | } | 59 | } |
80 | 60 | ||
81 | public Byte getStatus() { | 61 | public Byte getStatus() { |
@@ -6,16 +6,14 @@ | @@ -6,16 +6,14 @@ | ||
6 | <result column="uid" property="uid" jdbcType="INTEGER" /> | 6 | <result column="uid" property="uid" jdbcType="INTEGER" /> |
7 | <result column="name" property="name" jdbcType="VARCHAR" /> | 7 | <result column="name" property="name" jdbcType="VARCHAR" /> |
8 | <result column="mobile" property="mobile" jdbcType="VARCHAR" /> | 8 | <result column="mobile" property="mobile" jdbcType="VARCHAR" /> |
9 | - <result column="social_media_type" property="socialMediaType" jdbcType="TINYINT" /> | ||
10 | - <result column="social_media_account" property="socialMediaAccount" jdbcType="VARCHAR" /> | ||
11 | - <result column="social_media_fans" property="socialMediaFans" jdbcType="INTEGER" /> | 9 | + <result column="social_media" property="socialMedia" jdbcType="VARCHAR" /> |
12 | <result column="status" property="status" jdbcType="TINYINT" /> | 10 | <result column="status" property="status" jdbcType="TINYINT" /> |
13 | <result column="del_flag" property="delFlag" jdbcType="TINYINT" /> | 11 | <result column="del_flag" property="delFlag" jdbcType="TINYINT" /> |
14 | <result column="create_time" property="createTime" jdbcType="INTEGER" /> | 12 | <result column="create_time" property="createTime" jdbcType="INTEGER" /> |
15 | <result column="check_time" property="checkTime" jdbcType="INTEGER" /> | 13 | <result column="check_time" property="checkTime" jdbcType="INTEGER" /> |
16 | </resultMap> | 14 | </resultMap> |
17 | <sql id="Base_Column_List" > | 15 | <sql id="Base_Column_List" > |
18 | - id, uid, name, mobile, social_media_type, social_media_account, social_media_fans, status, | 16 | + id, uid, name, mobile, social_media, status, |
19 | del_flag, create_time, check_time | 17 | del_flag, create_time, check_time |
20 | </sql> | 18 | </sql> |
21 | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" > | 19 | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" > |
@@ -24,6 +22,23 @@ | @@ -24,6 +22,23 @@ | ||
24 | from union_share_user_apply | 22 | from union_share_user_apply |
25 | where id = #{id,jdbcType=INTEGER} | 23 | where id = #{id,jdbcType=INTEGER} |
26 | </select> | 24 | </select> |
25 | + <select id="selectCountByUid" resultType="java.lang.Integer" parameterType="com.yoho.unions.dal.model.UnionShareUserApply" > | ||
26 | + select count(1) from union_share_user_apply | ||
27 | + where uid = #{uid,jdbcType=INTEGER} | ||
28 | + <if test="status != null"> | ||
29 | + and status = #{status,jdbcType=TINYINT} | ||
30 | + </if> | ||
31 | + </select> | ||
32 | + <select id="selectOneByUid" resultMap="BaseResultMap" parameterType="com.yoho.unions.dal.model.UnionShareUserApply" > | ||
33 | + select | ||
34 | + <include refid="Base_Column_List" /> | ||
35 | + from union_share_user_apply | ||
36 | + where uid = #{uid,jdbcType=INTEGER} | ||
37 | + <if test="status != null"> | ||
38 | + and status = #{status,jdbcType=TINYINT} | ||
39 | + </if> | ||
40 | + limit 1 | ||
41 | + </select> | ||
27 | <select id="selectByIds" resultMap="BaseResultMap" > | 42 | <select id="selectByIds" resultMap="BaseResultMap" > |
28 | select | 43 | select |
29 | <include refid="Base_Column_List" /> | 44 | <include refid="Base_Column_List" /> |
@@ -36,7 +51,7 @@ | @@ -36,7 +51,7 @@ | ||
36 | <select id="selectByCondition" | 51 | <select id="selectByCondition" |
37 | resultType="com.yoho.service.model.union.response.UnionShareUserApplyListBo" | 52 | resultType="com.yoho.service.model.union.response.UnionShareUserApplyListBo" |
38 | parameterType="com.yoho.service.model.union.request.UnionShareUserApplyListReqBo"> | 53 | parameterType="com.yoho.service.model.union.request.UnionShareUserApplyListReqBo"> |
39 | - select id, uid, name,mobile, social_media_type socialMediaType, social_media_account socialMediaAccount, social_media_fans socialMediaFans, status, | 54 | + select id, uid, name,mobile, social_media socialMedia, status, |
40 | del_flag delFlag, create_time createTime, check_time checkTime | 55 | del_flag delFlag, create_time createTime, check_time checkTime |
41 | from union_share_user_apply | 56 | from union_share_user_apply |
42 | where del_flag=1 | 57 | where del_flag=1 |
@@ -49,15 +64,6 @@ | @@ -49,15 +64,6 @@ | ||
49 | <if test="mobile != null"> | 64 | <if test="mobile != null"> |
50 | and mobile = #{mobile} | 65 | and mobile = #{mobile} |
51 | </if> | 66 | </if> |
52 | - <if test="socialMediaType != null"> | ||
53 | - and social_media_type = #{socialMediaType} | ||
54 | - </if> | ||
55 | - <if test="socialMediaAccount != null"> | ||
56 | - and social_media_account = #{socialMediaAccount} | ||
57 | - </if> | ||
58 | - <if test="socialMediaFans != null"> | ||
59 | - and social_media_fans = #{socialMediaFans} | ||
60 | - </if> | ||
61 | <if test="status != null"> | 67 | <if test="status != null"> |
62 | and status = #{status} | 68 | and status = #{status} |
63 | </if> | 69 | </if> |
@@ -86,15 +92,6 @@ | @@ -86,15 +92,6 @@ | ||
86 | <if test="mobile != null"> | 92 | <if test="mobile != null"> |
87 | and mobile = #{mobile} | 93 | and mobile = #{mobile} |
88 | </if> | 94 | </if> |
89 | - <if test="socialMediaType != null"> | ||
90 | - and social_media_type = #{socialMediaType} | ||
91 | - </if> | ||
92 | - <if test="socialMediaAccount != null"> | ||
93 | - and social_media_account = #{socialMediaAccount} | ||
94 | - </if> | ||
95 | - <if test="socialMediaFans != null"> | ||
96 | - and social_media_fans = #{socialMediaFans} | ||
97 | - </if> | ||
98 | <if test="status != null"> | 95 | <if test="status != null"> |
99 | and status = #{status} | 96 | and status = #{status} |
100 | </if> | 97 | </if> |
@@ -111,11 +108,11 @@ | @@ -111,11 +108,11 @@ | ||
111 | </delete> | 108 | </delete> |
112 | <insert id="insert" parameterType="com.yoho.unions.dal.model.UnionShareUserApply" > | 109 | <insert id="insert" parameterType="com.yoho.unions.dal.model.UnionShareUserApply" > |
113 | insert into union_share_user_apply (id, uid, name, mobile, | 110 | insert into union_share_user_apply (id, uid, name, mobile, |
114 | - social_media_type, social_media_account, social_media_fans, | 111 | + social_media, |
115 | status, del_flag, create_time, | 112 | status, del_flag, create_time, |
116 | check_time) | 113 | check_time) |
117 | values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}, | 114 | values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}, |
118 | - #{socialMediaType,jdbcType=TINYINT}, #{socialMediaAccount,jdbcType=VARCHAR}, #{socialMediaFans,jdbcType=INTEGER}, | 115 | + #{socialMedia,jdbcType=VARCHAR}, |
119 | #{status,jdbcType=TINYINT}, #{delFlag,jdbcType=TINYINT}, #{createTime,jdbcType=INTEGER}, | 116 | #{status,jdbcType=TINYINT}, #{delFlag,jdbcType=TINYINT}, #{createTime,jdbcType=INTEGER}, |
120 | #{checkTime,jdbcType=INTEGER}) | 117 | #{checkTime,jdbcType=INTEGER}) |
121 | </insert> | 118 | </insert> |
@@ -134,14 +131,8 @@ | @@ -134,14 +131,8 @@ | ||
134 | <if test="mobile != null" > | 131 | <if test="mobile != null" > |
135 | mobile, | 132 | mobile, |
136 | </if> | 133 | </if> |
137 | - <if test="socialMediaType != null" > | ||
138 | - social_media_type, | ||
139 | - </if> | ||
140 | - <if test="socialMediaAccount != null" > | ||
141 | - social_media_account, | ||
142 | - </if> | ||
143 | - <if test="socialMediaFans != null" > | ||
144 | - social_media_fans, | 134 | + <if test="socialMedia != null" > |
135 | + social_media, | ||
145 | </if> | 136 | </if> |
146 | <if test="status != null" > | 137 | <if test="status != null" > |
147 | status, | 138 | status, |
@@ -169,14 +160,8 @@ | @@ -169,14 +160,8 @@ | ||
169 | <if test="mobile != null" > | 160 | <if test="mobile != null" > |
170 | #{mobile,jdbcType=VARCHAR}, | 161 | #{mobile,jdbcType=VARCHAR}, |
171 | </if> | 162 | </if> |
172 | - <if test="socialMediaType != null" > | ||
173 | - #{socialMediaType,jdbcType=TINYINT}, | ||
174 | - </if> | ||
175 | - <if test="socialMediaAccount != null" > | ||
176 | - #{socialMediaAccount,jdbcType=VARCHAR}, | ||
177 | - </if> | ||
178 | - <if test="socialMediaFans != null" > | ||
179 | - #{socialMediaFans,jdbcType=INTEGER}, | 163 | + <if test="socialMedia != null" > |
164 | + #{socialMedia,jdbcType=VARCHAR}, | ||
180 | </if> | 165 | </if> |
181 | <if test="status != null" > | 166 | <if test="status != null" > |
182 | #{status,jdbcType=TINYINT}, | 167 | #{status,jdbcType=TINYINT}, |
@@ -204,14 +189,8 @@ | @@ -204,14 +189,8 @@ | ||
204 | <if test="mobile != null" > | 189 | <if test="mobile != null" > |
205 | mobile = #{mobile,jdbcType=VARCHAR}, | 190 | mobile = #{mobile,jdbcType=VARCHAR}, |
206 | </if> | 191 | </if> |
207 | - <if test="socialMediaType != null" > | ||
208 | - social_media_type = #{socialMediaType,jdbcType=TINYINT}, | ||
209 | - </if> | ||
210 | - <if test="socialMediaAccount != null" > | ||
211 | - social_media_account = #{socialMediaAccount,jdbcType=VARCHAR}, | ||
212 | - </if> | ||
213 | - <if test="socialMediaFans != null" > | ||
214 | - social_media_fans = #{socialMediaFans,jdbcType=INTEGER}, | 192 | + <if test="socialMedia != null" > |
193 | + social_media = #{socialMedia,jdbcType=VARCHAR}, | ||
215 | </if> | 194 | </if> |
216 | <if test="status != null" > | 195 | <if test="status != null" > |
217 | status = #{status,jdbcType=TINYINT}, | 196 | status = #{status,jdbcType=TINYINT}, |
@@ -245,9 +224,7 @@ | @@ -245,9 +224,7 @@ | ||
245 | set uid = #{uid,jdbcType=INTEGER}, | 224 | set uid = #{uid,jdbcType=INTEGER}, |
246 | name = #{name,jdbcType=VARCHAR}, | 225 | name = #{name,jdbcType=VARCHAR}, |
247 | mobile = #{mobile,jdbcType=VARCHAR}, | 226 | mobile = #{mobile,jdbcType=VARCHAR}, |
248 | - social_media_type = #{socialMediaType,jdbcType=TINYINT}, | ||
249 | - social_media_account = #{socialMediaAccount,jdbcType=VARCHAR}, | ||
250 | - social_media_fans = #{socialMediaFans,jdbcType=INTEGER}, | 227 | + social_media = #{socialMedia,jdbcType=VARCHAR}, |
251 | status = #{status,jdbcType=TINYINT}, | 228 | status = #{status,jdbcType=TINYINT}, |
252 | del_flag = #{delFlag,jdbcType=TINYINT}, | 229 | del_flag = #{delFlag,jdbcType=TINYINT}, |
253 | create_time = #{createTime,jdbcType=INTEGER}, | 230 | create_time = #{createTime,jdbcType=INTEGER}, |
@@ -6,12 +6,12 @@ | @@ -6,12 +6,12 @@ | ||
6 | <result column="uid" property="uid" jdbcType="INTEGER" /> | 6 | <result column="uid" property="uid" jdbcType="INTEGER" /> |
7 | <result column="union_type" property="unionType" jdbcType="VARCHAR" /> | 7 | <result column="union_type" property="unionType" jdbcType="VARCHAR" /> |
8 | <result column="status" property="status" jdbcType="INTEGER" /> | 8 | <result column="status" property="status" jdbcType="INTEGER" /> |
9 | - <result column="contract_status" property="contractStatus" jdbcType="INTEGER" /> | 9 | + <result column="apply_id" property="applyId" jdbcType="INTEGER" /> |
10 | <result column="create_time" property="createTime" jdbcType="INTEGER" /> | 10 | <result column="create_time" property="createTime" jdbcType="INTEGER" /> |
11 | <result column="update_time" property="updateTime" jdbcType="INTEGER" /> | 11 | <result column="update_time" property="updateTime" jdbcType="INTEGER" /> |
12 | </resultMap> | 12 | </resultMap> |
13 | <sql id="Base_Column_List" > | 13 | <sql id="Base_Column_List" > |
14 | - id, uid, union_type, update_time,create_time,status,contract_status | 14 | + id, uid, union_type, update_time,create_time,status,apply_id |
15 | </sql> | 15 | </sql> |
16 | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" > | 16 | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" > |
17 | select | 17 | select |
@@ -35,9 +35,9 @@ | @@ -35,9 +35,9 @@ | ||
35 | </delete> | 35 | </delete> |
36 | <insert id="insert" parameterType="com.yoho.unions.dal.model.UnionShareUser" > | 36 | <insert id="insert" parameterType="com.yoho.unions.dal.model.UnionShareUser" > |
37 | insert into union_share_user (id, uid, union_type, | 37 | insert into union_share_user (id, uid, union_type, |
38 | - update_time,create_time,status,contract_status) | 38 | + update_time,create_time,status,apply_id) |
39 | values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=INTEGER}, #{unionType,jdbcType=VARCHAR}, | 39 | values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=INTEGER}, #{unionType,jdbcType=VARCHAR}, |
40 | - #{updateTime,jdbcType=INTEGER}),#{createTime,jdbcType=INTEGER}),#{status,jdbcType=INTEGER}),#{contractStatus,jdbcType=INTEGER}) | 40 | + #{updateTime,jdbcType=INTEGER}),#{createTime,jdbcType=INTEGER}),#{status,jdbcType=INTEGER}),#{applyId,jdbcType=INTEGER}) |
41 | </insert> | 41 | </insert> |
42 | <select id="selectByUids" resultMap="BaseResultMap"> | 42 | <select id="selectByUids" resultMap="BaseResultMap"> |
43 | select | 43 | select |
@@ -69,8 +69,8 @@ | @@ -69,8 +69,8 @@ | ||
69 | <if test="status != null" > | 69 | <if test="status != null" > |
70 | status, | 70 | status, |
71 | </if> | 71 | </if> |
72 | - <if test="contractStatus != null" > | ||
73 | - contract_status, | 72 | + <if test="applyId != null" > |
73 | + apply_id, | ||
74 | </if> | 74 | </if> |
75 | </trim> | 75 | </trim> |
76 | <trim prefix="values (" suffix=")" suffixOverrides="," > | 76 | <trim prefix="values (" suffix=")" suffixOverrides="," > |
@@ -92,8 +92,8 @@ | @@ -92,8 +92,8 @@ | ||
92 | <if test="status != null" > | 92 | <if test="status != null" > |
93 | #{status,jdbcType=INTEGER}, | 93 | #{status,jdbcType=INTEGER}, |
94 | </if> | 94 | </if> |
95 | - <if test="contractStatus != null" > | ||
96 | - #{contractStatus,jdbcType=INTEGER}, | 95 | + <if test="applyId != null" > |
96 | + #{applyId,jdbcType=INTEGER}, | ||
97 | </if> | 97 | </if> |
98 | </trim> | 98 | </trim> |
99 | </insert> | 99 | </insert> |
@@ -115,8 +115,8 @@ | @@ -115,8 +115,8 @@ | ||
115 | <if test="status != null" > | 115 | <if test="status != null" > |
116 | status = #{status,jdbcType=INTEGER}, | 116 | status = #{status,jdbcType=INTEGER}, |
117 | </if> | 117 | </if> |
118 | - <if test="contractStatus != null" > | ||
119 | - contract_status = #{contractStatus,jdbcType=INTEGER}, | 118 | + <if test="applyId != null" > |
119 | + apply_id = #{applyId,jdbcType=INTEGER}, | ||
120 | </if> | 120 | </if> |
121 | </set> | 121 | </set> |
122 | where id = #{id,jdbcType=INTEGER} | 122 | where id = #{id,jdbcType=INTEGER} |
@@ -136,8 +136,8 @@ | @@ -136,8 +136,8 @@ | ||
136 | <if test="status != null" > | 136 | <if test="status != null" > |
137 | status = #{status,jdbcType=INTEGER}, | 137 | status = #{status,jdbcType=INTEGER}, |
138 | </if> | 138 | </if> |
139 | - <if test="contractStatus != null" > | ||
140 | - contract_status = #{contractStatus,jdbcType=INTEGER}, | 139 | + <if test="applyId != null" > |
140 | + apply_id = #{applyId,jdbcType=INTEGER}, | ||
141 | </if> | 141 | </if> |
142 | </set> | 142 | </set> |
143 | where uid = #{uid,jdbcType=INTEGER} | 143 | where uid = #{uid,jdbcType=INTEGER} |
@@ -152,7 +152,7 @@ | @@ -152,7 +152,7 @@ | ||
152 | update_time = #{updateTime,jdbcType=INTEGER}, | 152 | update_time = #{updateTime,jdbcType=INTEGER}, |
153 | create_time = #{createTime,jdbcType=INTEGER}, | 153 | create_time = #{createTime,jdbcType=INTEGER}, |
154 | status = #{status,jdbcType=INTEGER}, | 154 | status = #{status,jdbcType=INTEGER}, |
155 | - contract_status = #{contractStatus,jdbcType=INTEGER} | 155 | + apply_id = #{applyId,jdbcType=INTEGER} |
156 | where id = #{id,jdbcType=INTEGER} | 156 | where id = #{id,jdbcType=INTEGER} |
157 | </update> | 157 | </update> |
158 | </mapper> | 158 | </mapper> |
@@ -3,10 +3,7 @@ package com.yoho.unions.server.restapi; | @@ -3,10 +3,7 @@ package com.yoho.unions.server.restapi; | ||
3 | import com.alibaba.fastjson.JSONArray; | 3 | import com.alibaba.fastjson.JSONArray; |
4 | import com.yoho.core.common.utils.JsonUtil; | 4 | import com.yoho.core.common.utils.JsonUtil; |
5 | import com.yoho.service.model.union.bo.*; | 5 | import com.yoho.service.model.union.bo.*; |
6 | -import com.yoho.service.model.union.request.UnionShareOrderReqBO; | ||
7 | -import com.yoho.service.model.union.request.UnionShareOrderSearchReqBO; | ||
8 | -import com.yoho.service.model.union.request.UnionShareUserApplyListReqBo; | ||
9 | -import com.yoho.service.model.union.request.UnionShareUserBankListReqBo; | 6 | +import com.yoho.service.model.union.request.*; |
10 | import com.yoho.service.model.union.response.*; | 7 | import com.yoho.service.model.union.response.*; |
11 | import com.yoho.unions.common.ApiResponse; | 8 | import com.yoho.unions.common.ApiResponse; |
12 | import com.yoho.unions.dal.model.UnionShareOrders; | 9 | import com.yoho.unions.dal.model.UnionShareOrders; |
@@ -81,16 +78,27 @@ public class UnionShareRest { | @@ -81,16 +78,27 @@ public class UnionShareRest { | ||
81 | return new UnionResponse(200, "queryUnionTypeByUid success",unionShareUser); | 78 | return new UnionResponse(200, "queryUnionTypeByUid success",unionShareUser); |
82 | } | 79 | } |
83 | /** | 80 | /** |
84 | - * 同意协议 | 81 | + * 申请 |
82 | + * @return | ||
83 | + */ | ||
84 | + @RequestMapping("/userApply") | ||
85 | + @ResponseBody | ||
86 | + public UnionResponse userApply(@RequestBody UnionShareUserApplyReqBo req){ | ||
87 | + log.info("UnionShareRest.userApply,req is {}",req); | ||
88 | + int result = unionShareService.userApply(req); | ||
89 | + return new UnionResponse(200, "userApply success",result); | ||
90 | + } | ||
91 | + /** | ||
92 | + * 是否存在申请中的请求 | ||
85 | * @param uid | 93 | * @param uid |
86 | * @return | 94 | * @return |
87 | */ | 95 | */ |
88 | - @RequestMapping("/agreeContract") | 96 | + @RequestMapping("/checkApply") |
89 | @ResponseBody | 97 | @ResponseBody |
90 | - public UnionResponse agreeContract(@RequestBody int uid){ | ||
91 | - log.info("UnionShareRest.agreeContract uid is {}", uid); | ||
92 | - int result = unionShareService.agreeContract(uid); | ||
93 | - return new UnionResponse(200, "agreeContract success",result>0?"Y":"N"); | 98 | + public UnionResponse checkApply(@RequestBody int uid){ |
99 | + log.info("UnionShareRest.checkApply uid is {}", uid); | ||
100 | + boolean result = unionShareService.hasApply(uid); | ||
101 | + return new UnionResponse(200, "checkApply success",result); | ||
94 | } | 102 | } |
95 | 103 | ||
96 | /** | 104 | /** |
@@ -2,10 +2,7 @@ package com.yoho.unions.server.service; | @@ -2,10 +2,7 @@ package com.yoho.unions.server.service; | ||
2 | 2 | ||
3 | import com.alibaba.fastjson.JSONArray; | 3 | import com.alibaba.fastjson.JSONArray; |
4 | import com.yoho.service.model.union.bo.*; | 4 | import com.yoho.service.model.union.bo.*; |
5 | -import com.yoho.service.model.union.request.UnionShareOrderReqBO; | ||
6 | -import com.yoho.service.model.union.request.UnionShareOrderSearchReqBO; | ||
7 | -import com.yoho.service.model.union.request.UnionShareUserApplyListReqBo; | ||
8 | -import com.yoho.service.model.union.request.UnionShareUserBankListReqBo; | 5 | +import com.yoho.service.model.union.request.*; |
9 | import com.yoho.service.model.union.response.PageResponseBO; | 6 | import com.yoho.service.model.union.response.PageResponseBO; |
10 | import com.yoho.service.model.union.response.PageUnionShareOrderRspBO; | 7 | import com.yoho.service.model.union.response.PageUnionShareOrderRspBO; |
11 | import com.yoho.service.model.union.response.UnionShareUserApplyListBo; | 8 | import com.yoho.service.model.union.response.UnionShareUserApplyListBo; |
@@ -52,11 +49,18 @@ public interface IUnionShareService { | @@ -52,11 +49,18 @@ public interface IUnionShareService { | ||
52 | UnionShareUserBo queryUnionTypeByUid(int uid); | 49 | UnionShareUserBo queryUnionTypeByUid(int uid); |
53 | 50 | ||
54 | /** | 51 | /** |
55 | - * 同意协议 | 52 | + * 申请 |
53 | + * @param req | ||
54 | + * @return | ||
55 | + */ | ||
56 | + int userApply(UnionShareUserApplyReqBo req); | ||
57 | + | ||
58 | + /** | ||
59 | + * 是否存在申请中的请求 | ||
56 | * @param uid | 60 | * @param uid |
57 | * @return | 61 | * @return |
58 | */ | 62 | */ |
59 | - int agreeContract(int uid); | 63 | + boolean hasApply(int uid); |
60 | 64 | ||
61 | /** | 65 | /** |
62 | * 查询绑定银行卡 | 66 | * 查询绑定银行卡 |
1 | package com.yoho.unions.server.service.impl; | 1 | package com.yoho.unions.server.service.impl; |
2 | 2 | ||
3 | import com.alibaba.fastjson.JSONObject; | 3 | import com.alibaba.fastjson.JSONObject; |
4 | +import com.yoho.core.common.utils.JsonUtil; | ||
5 | +import com.yoho.service.model.union.bo.SocialMediaBo; | ||
4 | import com.yoho.service.model.union.request.UnionShareUserApplyListReqBo; | 6 | import com.yoho.service.model.union.request.UnionShareUserApplyListReqBo; |
5 | import com.yoho.service.model.union.response.UnionShareUserApplyListBo; | 7 | import com.yoho.service.model.union.response.UnionShareUserApplyListBo; |
6 | import com.yoho.unions.common.enums.SocialMediaTypeEnum; | 8 | import com.yoho.unions.common.enums.SocialMediaTypeEnum; |
@@ -33,9 +35,24 @@ public class UnionShareApplyExportImpl implements IBusinessExportService { | @@ -33,9 +35,24 @@ public class UnionShareApplyExportImpl implements IBusinessExportService { | ||
33 | req.setQueryAll(true); | 35 | req.setQueryAll(true); |
34 | List<UnionShareUserApplyListBo> applys=this.unionShareUserApplyMapper.selectByCondition(req); | 36 | List<UnionShareUserApplyListBo> applys=this.unionShareUserApplyMapper.selectByCondition(req); |
35 | for(UnionShareUserApplyListBo bo:applys){ | 37 | for(UnionShareUserApplyListBo bo:applys){ |
36 | - bo.setSocialMediaType(null==bo.getSocialMediaType()?null: SocialMediaTypeEnum.getNameByType(Integer.parseInt(bo.getSocialMediaType()))); | 38 | + covertSocialMedia(bo); |
37 | } | 39 | } |
38 | return applys; | 40 | return applys; |
39 | 41 | ||
40 | } | 42 | } |
43 | + | ||
44 | + private void covertSocialMedia(UnionShareUserApplyListBo bo) { | ||
45 | + if (null == bo.getSocialMedia()) { | ||
46 | + return; | ||
47 | + } | ||
48 | + List<SocialMediaBo> socialMediaBos = JsonUtil.jsonToList(bo.getSocialMedia(), SocialMediaBo.class); | ||
49 | + StringBuilder socialMediaBuilder = new StringBuilder(); | ||
50 | + socialMediaBos.forEach(s->{ | ||
51 | + socialMediaBuilder.append(SocialMediaTypeEnum.getNameByType(s.getSocialMediaType())); | ||
52 | + socialMediaBuilder.append("("+s.getSocialMediaAccount()+"):"); | ||
53 | + socialMediaBuilder.append(s.getSocialMediaFans()); | ||
54 | + socialMediaBuilder.append("\n\r"); | ||
55 | + }); | ||
56 | + bo.setSocialMedia(socialMediaBuilder.toString()); | ||
57 | + } | ||
41 | } | 58 | } |
@@ -3,15 +3,13 @@ package com.yoho.unions.server.service.impl; | @@ -3,15 +3,13 @@ package com.yoho.unions.server.service.impl; | ||
3 | import com.alibaba.fastjson.JSONArray; | 3 | import com.alibaba.fastjson.JSONArray; |
4 | import com.alibaba.fastjson.JSONException; | 4 | import com.alibaba.fastjson.JSONException; |
5 | import com.alibaba.fastjson.JSONObject; | 5 | import com.alibaba.fastjson.JSONObject; |
6 | +import com.yoho.core.common.utils.JsonUtil; | ||
6 | import com.yoho.core.config.ConfigReader; | 7 | import com.yoho.core.config.ConfigReader; |
7 | import com.yoho.core.rabbitmq.YhProducer; | 8 | import com.yoho.core.rabbitmq.YhProducer; |
8 | import com.yoho.error.ServiceError; | 9 | import com.yoho.error.ServiceError; |
9 | import com.yoho.error.exception.ServiceException; | 10 | import com.yoho.error.exception.ServiceException; |
10 | import com.yoho.service.model.union.bo.*; | 11 | import com.yoho.service.model.union.bo.*; |
11 | -import com.yoho.service.model.union.request.UnionShareOrderReqBO; | ||
12 | -import com.yoho.service.model.union.request.UnionShareOrderSearchReqBO; | ||
13 | -import com.yoho.service.model.union.request.UnionShareUserApplyListReqBo; | ||
14 | -import com.yoho.service.model.union.request.UnionShareUserBankListReqBo; | 12 | +import com.yoho.service.model.union.request.*; |
15 | import com.yoho.service.model.union.response.*; | 13 | import com.yoho.service.model.union.response.*; |
16 | import com.yoho.unions.common.enums.*; | 14 | import com.yoho.unions.common.enums.*; |
17 | import com.yoho.unions.common.redis.RedisHashCache; | 15 | import com.yoho.unions.common.redis.RedisHashCache; |
@@ -26,7 +24,6 @@ import com.yoho.unions.server.service.IUnionShareService; | @@ -26,7 +24,6 @@ import com.yoho.unions.server.service.IUnionShareService; | ||
26 | import com.yoho.unions.utils.DateUtils; | 24 | import com.yoho.unions.utils.DateUtils; |
27 | import com.yoho.unions.utils.ImagesHelper; | 25 | import com.yoho.unions.utils.ImagesHelper; |
28 | import org.apache.commons.collections.CollectionUtils; | 26 | import org.apache.commons.collections.CollectionUtils; |
29 | -import org.apache.commons.lang3.ArrayUtils; | ||
30 | import org.apache.commons.lang3.StringUtils; | 27 | import org.apache.commons.lang3.StringUtils; |
31 | import org.slf4j.Logger; | 28 | import org.slf4j.Logger; |
32 | import org.slf4j.LoggerFactory; | 29 | import org.slf4j.LoggerFactory; |
@@ -290,7 +287,7 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport | @@ -290,7 +287,7 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport | ||
290 | } | 287 | } |
291 | List<UnionShareUserApplyListBo> applys=this.unionShareUserApplyMapper.selectByCondition(parm); | 288 | List<UnionShareUserApplyListBo> applys=this.unionShareUserApplyMapper.selectByCondition(parm); |
292 | for(UnionShareUserApplyListBo bo:applys){ | 289 | for(UnionShareUserApplyListBo bo:applys){ |
293 | - bo.setSocialMediaType(null==bo.getSocialMediaType()?null:SocialMediaTypeEnum.getNameByType(Integer.parseInt(bo.getSocialMediaType()))); | 290 | + covertSocialMedia(bo); |
294 | } | 291 | } |
295 | PageResponseBO<UnionShareUserApplyListBo> result=new PageResponseBO<>(); | 292 | PageResponseBO<UnionShareUserApplyListBo> result=new PageResponseBO<>(); |
296 | result.setList(applys); | 293 | result.setList(applys); |
@@ -299,6 +296,21 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport | @@ -299,6 +296,21 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport | ||
299 | result.setTotal(total); | 296 | result.setTotal(total); |
300 | return result; | 297 | return result; |
301 | } | 298 | } |
299 | + | ||
300 | + private void covertSocialMedia(UnionShareUserApplyListBo bo) { | ||
301 | + if (null != bo.getSocialMedia()) { | ||
302 | + List<SocialMediaBo> socialMediaBos = JsonUtil.jsonToList(bo.getSocialMedia(), SocialMediaBo.class); | ||
303 | + StringBuilder socialMediaBuilder = new StringBuilder(); | ||
304 | + socialMediaBos.forEach(s->{ | ||
305 | + socialMediaBuilder.append(SocialMediaTypeEnum.getNameByType(s.getSocialMediaType())); | ||
306 | + socialMediaBuilder.append("("+s.getSocialMediaAccount()+"):"); | ||
307 | + socialMediaBuilder.append(s.getSocialMediaFans()); | ||
308 | + socialMediaBuilder.append("<br>"); | ||
309 | + }); | ||
310 | + bo.setSocialMedia(socialMediaBuilder.toString()); | ||
311 | + } | ||
312 | + } | ||
313 | + | ||
302 | /** | 314 | /** |
303 | * 拒绝用户申请 | 315 | * 拒绝用户申请 |
304 | * @param req | 316 | * @param req |
@@ -306,8 +318,10 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport | @@ -306,8 +318,10 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport | ||
306 | */ | 318 | */ |
307 | @Override | 319 | @Override |
308 | public int refuseApply(IdOrIdsBo req){ | 320 | public int refuseApply(IdOrIdsBo req){ |
321 | + logger.info("refuseApply,req is {}", req); | ||
309 | UnionShareUserApply unionShareUserApply = unionShareUserApplyMapper.selectByPrimaryKey(req.getId()); | 322 | UnionShareUserApply unionShareUserApply = unionShareUserApplyMapper.selectByPrimaryKey(req.getId()); |
310 | if (unionShareUserApply == null || unionShareUserApply.getStatus() > 1) { | 323 | if (unionShareUserApply == null || unionShareUserApply.getStatus() > 1) { |
324 | + logger.info("refuseApply end,selectByPrimaryKey null,req is {}", req); | ||
311 | return 0; | 325 | return 0; |
312 | } | 326 | } |
313 | UnionShareUserApply updateReq = new UnionShareUserApply(); | 327 | UnionShareUserApply updateReq = new UnionShareUserApply(); |
@@ -326,11 +340,13 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport | @@ -326,11 +340,13 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport | ||
326 | */ | 340 | */ |
327 | @Override | 341 | @Override |
328 | public int agreeApply(IdOrIdsBo req){ | 342 | public int agreeApply(IdOrIdsBo req){ |
329 | - | 343 | + logger.info("agreeApply,req is {}", req); |
330 | if (req.getId() != null) { | 344 | if (req.getId() != null) { |
345 | + logger.info("agreeApply,id opt,req is {}", req); | ||
331 | //单个操作 | 346 | //单个操作 |
332 | UnionShareUserApply unionShareUserApply = unionShareUserApplyMapper.selectByPrimaryKey(req.getId()); | 347 | UnionShareUserApply unionShareUserApply = unionShareUserApplyMapper.selectByPrimaryKey(req.getId()); |
333 | if (unionShareUserApply == null || unionShareUserApply.getStatus() > 1) { | 348 | if (unionShareUserApply == null || unionShareUserApply.getStatus() > 1) { |
349 | + logger.info("agreeApply,selectByPrimaryKey null,req is {}", req); | ||
334 | return 0; | 350 | return 0; |
335 | } | 351 | } |
336 | UnionShareUserApply updateReq = new UnionShareUserApply(); | 352 | UnionShareUserApply updateReq = new UnionShareUserApply(); |
@@ -340,11 +356,12 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport | @@ -340,11 +356,12 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport | ||
340 | int result=unionShareUserApplyMapper.updateByPrimaryKeySelective(updateReq); | 356 | int result=unionShareUserApplyMapper.updateByPrimaryKeySelective(updateReq); |
341 | if (result > 0) { | 357 | if (result > 0) { |
342 | // 绑定unionType | 358 | // 绑定unionType |
343 | - relateUnionType(unionShareUserApply.getUid()); | 359 | + relateUnionType(unionShareUserApply.getUid(),updateReq.getId()); |
344 | } | 360 | } |
345 | redisHashCache.delete(ShareOrdersKeyEnum.UNION_TYPE.getPreKey(),unionShareUserApply.getUid()); | 361 | redisHashCache.delete(ShareOrdersKeyEnum.UNION_TYPE.getPreKey(),unionShareUserApply.getUid()); |
346 | return result; | 362 | return result; |
347 | } else { | 363 | } else { |
364 | + logger.info("agreeApply,ids opt,req is {}", req); | ||
348 | //批量操作 | 365 | //批量操作 |
349 | Set<Integer> idSet = Arrays.stream(req.getIds().split(",")).map(s->{ | 366 | Set<Integer> idSet = Arrays.stream(req.getIds().split(",")).map(s->{ |
350 | Integer skn = null; | 367 | Integer skn = null; |
@@ -358,24 +375,45 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport | @@ -358,24 +375,45 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport | ||
358 | int currentTimeSecond = DateUtil.getCurrentTimeSecond(); | 375 | int currentTimeSecond = DateUtil.getCurrentTimeSecond(); |
359 | int result=unionShareUserApplyMapper.updateStatus(idSet,1,2, currentTimeSecond); | 376 | int result=unionShareUserApplyMapper.updateStatus(idSet,1,2, currentTimeSecond); |
360 | if (result == 0) { | 377 | if (result == 0) { |
378 | + logger.info("agreeApply,updateStatus null,req is {}", req); | ||
361 | return 0; | 379 | return 0; |
362 | } | 380 | } |
363 | List<UnionShareUserApply> unionShareUserApplies = unionShareUserApplyMapper.selectByIds(idSet); | 381 | List<UnionShareUserApply> unionShareUserApplies = unionShareUserApplyMapper.selectByIds(idSet); |
364 | if (CollectionUtils.isEmpty(unionShareUserApplies)) { | 382 | if (CollectionUtils.isEmpty(unionShareUserApplies)) { |
383 | + logger.info("agreeApply,selectByIds null,req is {}", req); | ||
365 | return 0; | 384 | return 0; |
366 | } | 385 | } |
367 | unionShareUserApplies.forEach(u->{ | 386 | unionShareUserApplies.forEach(u->{ |
368 | if (u.getCheckTime() != currentTimeSecond) { | 387 | if (u.getCheckTime() != currentTimeSecond) { |
369 | return; | 388 | return; |
370 | } | 389 | } |
371 | - relateUnionType(u.getUid()); | 390 | + try { |
391 | + relateUnionType(u.getUid(),u.getId()); | ||
392 | + } catch (Exception e) { | ||
393 | + logger.error("relateUnionType error ,uid is {}",u.getUid()); | ||
394 | + } | ||
372 | redisHashCache.delete(ShareOrdersKeyEnum.UNION_TYPE.getPreKey(),u.getUid()); | 395 | redisHashCache.delete(ShareOrdersKeyEnum.UNION_TYPE.getPreKey(),u.getUid()); |
373 | }); | 396 | }); |
374 | return result; | 397 | return result; |
375 | } | 398 | } |
376 | } | 399 | } |
377 | 400 | ||
378 | - public void relateUnionType(int uid) { | 401 | + public void relateUnionType(int uid,int applyId) { |
402 | + logger.info("relateUnionType,uid is {}", uid); | ||
403 | + UnionShareUser unionShareUser1 = unionShareUserMapper.selectByUid(uid); | ||
404 | + if (null != unionShareUser1) { | ||
405 | + logger.info("relateUnionType,uid is {},has unionType,record is {}", uid,unionShareUser1); | ||
406 | + //用户已绑定生成unionType | ||
407 | + //todo 直接返回成功 | ||
408 | + //是否删除:1-正常,0-删除 | ||
409 | + if (unionShareUser1.getStatus() == 0) { | ||
410 | + //todo 目前没有删除操作,不会存在这个情况 | ||
411 | + } | ||
412 | + if (unionShareUser1.getApplyId() == null || unionShareUser1.getApplyId() == 0) { | ||
413 | + | ||
414 | + } | ||
415 | + return; | ||
416 | + } | ||
379 | //生成unionType | 417 | //生成unionType |
380 | MktMarketingUrl unionDepartmentUrl = buildMktMarketingUrl(uid); | 418 | MktMarketingUrl unionDepartmentUrl = buildMktMarketingUrl(uid); |
381 | mktMarketingUrlDAO.insertSelective(unionDepartmentUrl); | 419 | mktMarketingUrlDAO.insertSelective(unionDepartmentUrl); |
@@ -385,10 +423,12 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport | @@ -385,10 +423,12 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport | ||
385 | unionShareUser.setUnionType(unionDepartmentUrl.getUnionType().toString()); | 423 | unionShareUser.setUnionType(unionDepartmentUrl.getUnionType().toString()); |
386 | unionShareUser.setCreateTime(DateUtil.getCurrentTimeSecond()); | 424 | unionShareUser.setCreateTime(DateUtil.getCurrentTimeSecond()); |
387 | unionShareUser.setUpdateTime(unionShareUser.getCreateTime()); | 425 | unionShareUser.setUpdateTime(unionShareUser.getCreateTime()); |
426 | + unionShareUser.setApplyId(applyId); | ||
388 | unionShareUserMapper.insertSelective(unionShareUser); | 427 | unionShareUserMapper.insertSelective(unionShareUser); |
389 | } | 428 | } |
390 | 429 | ||
391 | public MktMarketingUrl buildMktMarketingUrl(int uid) { | 430 | public MktMarketingUrl buildMktMarketingUrl(int uid) { |
431 | + logger.info("buildMktMarketingUrl,uid is {}", uid); | ||
392 | MktMarketingUrl mktMarketingUrl = new MktMarketingUrl(); | 432 | MktMarketingUrl mktMarketingUrl = new MktMarketingUrl(); |
393 | mktMarketingUrl.setChannelType(1);//渠道类型:0-机构 1-个人 | 433 | mktMarketingUrl.setChannelType(1);//渠道类型:0-机构 1-个人 |
394 | mktMarketingUrl.setPayChannel(1); | 434 | mktMarketingUrl.setPayChannel(1); |
@@ -424,19 +464,22 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport | @@ -424,19 +464,22 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport | ||
424 | logger.info("UnionShareServiceImpl :: queryUnionTypeByUid get redis cache ,uid is {},cacheResult is {}",uid,cacheResult); | 464 | logger.info("UnionShareServiceImpl :: queryUnionTypeByUid get redis cache ,uid is {},cacheResult is {}",uid,cacheResult); |
425 | return cacheResult; | 465 | return cacheResult; |
426 | } | 466 | } |
427 | - //获取数据库 | ||
428 | - UnionShareUser unionShareUser = unionShareUserMapper.selectByUid(uid); | ||
429 | - if (null == unionShareUser){ | ||
430 | - return null; | ||
431 | - } | ||
432 | UnionShareUserBo bo = new UnionShareUserBo(); | 467 | UnionShareUserBo bo = new UnionShareUserBo(); |
433 | - BeanUtils.copyProperties(unionShareUser,bo); | ||
434 | - //是否已同意协议:1-同意,0-未同意 | ||
435 | - bo.setContractAgree(1==unionShareUser.getContractStatus()); | 468 | + if (uid == 0) { |
469 | + //获取数据库 | ||
470 | + UnionShareUser unionShareUser = unionShareUserMapper.selectByUid(uid); | ||
471 | + if (null != unionShareUser && unionShareUser.getStatus() == 1) { | ||
472 | + BeanUtils.copyProperties(unionShareUser, bo); | ||
473 | + } | ||
474 | + | ||
475 | + //是否存在申请中的请求 | ||
476 | + bo.setHasApply(hasApply(uid)); | ||
477 | + } | ||
478 | + | ||
436 | //设置返回文案 | 479 | //设置返回文案 |
437 | - bo.setShareId(configReader.getString(UNION_SHAREID, "")); | ||
438 | - bo.setImageUrl(configReader.getString(UNION_CPS_IMAGEURL, "")); | ||
439 | - bo.setApplyImageUrl(configReader.getString(UNION_CPS_APPLY_IMAGEURL, "")); | 480 | + bo.setShareId(configReader.getString(UNION_SHAREID, ""));//列表分享的活动id |
481 | + bo.setImageUrl(configReader.getString(UNION_CPS_IMAGEURL, ""));//分享banner | ||
482 | + bo.setApplyImageUrl(configReader.getString(UNION_CPS_APPLY_IMAGEURL, ""));//申请banner | ||
440 | 483 | ||
441 | //设置缓存 | 484 | //设置缓存 |
442 | addToRedis(ShareOrdersKeyEnum.UNION_TYPE, uid, bo, key); | 485 | addToRedis(ShareOrdersKeyEnum.UNION_TYPE, uid, bo, key); |
@@ -444,22 +487,47 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport | @@ -444,22 +487,47 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport | ||
444 | } | 487 | } |
445 | 488 | ||
446 | /** | 489 | /** |
447 | - * 同意协议 | ||
448 | - * @param uid | 490 | + * 是否存在申请中的请求 |
491 | + * */ | ||
492 | + @Override | ||
493 | + public boolean hasApply(int uid) { | ||
494 | + UnionShareUserApply record = new UnionShareUserApply(); | ||
495 | + record.setUid(uid); | ||
496 | + record.setStatus((byte)1); | ||
497 | + int count = unionShareUserApplyMapper.selectCountByUid(record); | ||
498 | + if (count > 0) { | ||
499 | + return true; | ||
500 | + } | ||
501 | + return false; | ||
502 | + } | ||
503 | + | ||
504 | + | ||
505 | + /** | ||
506 | + * 申请 | ||
507 | + * @param req | ||
449 | * @return | 508 | * @return |
450 | */ | 509 | */ |
451 | @Override | 510 | @Override |
452 | - public int agreeContract(int uid){ | ||
453 | - logger.info("agreeContract,uid is {}",uid); | ||
454 | - if (uid < 1) { | ||
455 | - return 0; | 511 | + public int userApply(UnionShareUserApplyReqBo req){ |
512 | + if (req.getUid() == null) { | ||
513 | + throw new ServiceException(ServiceError.USER_ID_ERROR); | ||
456 | } | 514 | } |
457 | - UnionShareUser updateReq = new UnionShareUser(); | ||
458 | - updateReq.setUid(uid); | ||
459 | - updateReq.setUpdateTime(DateUtil.getCurrentTimeSecond()); | ||
460 | - updateReq.setContractStatus(1);//是否已同意协议:1-同意,0-未同意 | ||
461 | - int result = unionShareUserMapper.updateByUid(updateReq); | ||
462 | - redisHashCache.delete(ShareOrdersKeyEnum.UNION_TYPE.getPreKey(),uid); | 515 | + UnionShareUser unionShareUser = unionShareUserMapper.selectByUid(req.getUid()); |
516 | + if (unionShareUser != null) { | ||
517 | + //已是联盟用户 | ||
518 | + throw new ServiceException(ServiceError.UNION_HAS_UNIONTYPE_ERROR); | ||
519 | + } | ||
520 | + if (hasApply(req.getUid())) { | ||
521 | + //已有申请中的 | ||
522 | + throw new ServiceException(ServiceError.UNION_HAS_APPLY_ERROR); | ||
523 | + } | ||
524 | + //申请 | ||
525 | + UnionShareUserApply unionShareUserApply = new UnionShareUserApply(); | ||
526 | + BeanUtils.copyProperties(req,unionShareUserApply); | ||
527 | + unionShareUserApply.setStatus((byte) 1); | ||
528 | + unionShareUserApply.setCreateTime(DateUtil.getCurrentTimeSecond()); | ||
529 | + unionShareUserApply.setSocialMedia(JsonUtil.objectToJSON(req.getSocialMediaList())); | ||
530 | + int result = unionShareUserApplyMapper.insertSelective(unionShareUserApply); | ||
463 | return result; | 531 | return result; |
464 | } | 532 | } |
465 | /** | 533 | /** |
@@ -19,12 +19,6 @@ | @@ -19,12 +19,6 @@ | ||
19 | <input class="easyui-textbox" id="name" name="name"/> | 19 | <input class="easyui-textbox" id="name" name="name"/> |
20 | <label>手机:</label> | 20 | <label>手机:</label> |
21 | <input class="easyui-textbox" id="mobile" name="mobile"/> | 21 | <input class="easyui-textbox" id="mobile" name="mobile"/> |
22 | - <label>社交媒体:</label> | ||
23 | - <input class="easyui-combobox" id="socialMediaType" name="socialMediaType"> | ||
24 | - </input> | ||
25 | - <label>社交媒体账号:</label> | ||
26 | - <input class="easyui-textbox" id="socialMediaAccount" name="socialMediaAccount"> | ||
27 | - </input> | ||
28 | <label>状态:</label> | 22 | <label>状态:</label> |
29 | <input class="easyui-combobox" id="status" name="status" | 23 | <input class="easyui-combobox" id="status" name="status" |
30 | data-options="valueField: 'value', | 24 | data-options="valueField: 'value', |
@@ -64,7 +58,7 @@ | @@ -64,7 +58,7 @@ | ||
64 | var checkedItems = []; | 58 | var checkedItems = []; |
65 | $(function () { | 59 | $(function () { |
66 | 60 | ||
67 | - var _socialMediaTypeSelector = $("#socialMediaType"); | 61 | + /* var _socialMediaTypeSelector = $("#socialMediaType"); |
68 | $.ajax({ | 62 | $.ajax({ |
69 | type: 'POST', | 63 | type: 'POST', |
70 | url: contextPath + "/UnionShareRest/getSocialMediaBasicParams", | 64 | url: contextPath + "/UnionShareRest/getSocialMediaBasicParams", |
@@ -88,7 +82,7 @@ | @@ -88,7 +82,7 @@ | ||
88 | $.messager.alert("失败", "加载所属业务,请刷新页面重试", "error"); | 82 | $.messager.alert("失败", "加载所属业务,请刷新页面重试", "error"); |
89 | return false; | 83 | return false; |
90 | } | 84 | } |
91 | - }); | 85 | + });*/ |
92 | 86 | ||
93 | $("#userApplyTable").myDatagrid({ | 87 | $("#userApplyTable").myDatagrid({ |
94 | fit: true, | 88 | fit: true, |
@@ -132,17 +126,7 @@ | @@ -132,17 +126,7 @@ | ||
132 | align: "center" | 126 | align: "center" |
133 | }, { | 127 | }, { |
134 | title: "社交媒体", | 128 | title: "社交媒体", |
135 | - field: "socialMediaType", | ||
136 | - width: 200, | ||
137 | - align: "center" | ||
138 | - }, { | ||
139 | - title: "社交媒体账号", | ||
140 | - field: "socialMediaAccount", | ||
141 | - width: 200, | ||
142 | - align: "center" | ||
143 | - }, { | ||
144 | - title: "社交媒体粉丝数", | ||
145 | - field: "socialMediaFans", | 129 | + field: "socialMedia", |
146 | width: 200, | 130 | width: 200, |
147 | align: "center" | 131 | align: "center" |
148 | }, { | 132 | }, { |
@@ -307,8 +291,6 @@ | @@ -307,8 +291,6 @@ | ||
307 | var param = { | 291 | var param = { |
308 | uid:$("#uid").val(), | 292 | uid:$("#uid").val(), |
309 | name:$("#name").val(), | 293 | name:$("#name").val(), |
310 | - socialMediaType:$("#socialMediaType").combobox('getValue'), | ||
311 | - socialMediaAccount:$("#socialMediaAccount").val(), | ||
312 | status:$("#status").combobox('getValue'), | 294 | status:$("#status").combobox('getValue'), |
313 | mobile:$("#mobile").val() | 295 | mobile:$("#mobile").val() |
314 | }; | 296 | }; |
-
Please register or login to post a comment