Browse Source

Merge branch 'dev_wx_msg' into dev_temp

dev_shibei_match
wxz 5 years ago
parent
commit
dc925559e4
  1. 6
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/WxmpResiUserSubscribeDao.java
  2. 4
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/WxmpWorkUserSubscribeDao.java
  3. 4
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java
  4. 13
      epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/WxmpResiUserSubscribeDao.xml
  5. 20
      epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/WxmpWorkUserSubscribeDao.xml

6
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/WxmpResiUserSubscribeDao.java

@ -66,8 +66,10 @@ public interface WxmpResiUserSubscribeDao extends BaseDao<WxmpResiUserSubscribeE
*/
int clearResiSubscribeCount(@Param("openId") String openId, @Param("templateId") String templateId, @Param("customerId") String customerId,@Param("userId") String userId);
WxmpResiUserSubscribeEntity getWxResiSubscribe(@Param("userId") String userId, @Param("customerId") String customerId,
@Param("templateId") String templateId);
WxmpResiUserSubscribeEntity getWxResiSubscribe(@Param("userId") String userId,
@Param("customerId") String customerId,
@Param("templateId") String templateId,
@Param("openId") String openId);
void incrSubscribeCount(@Param("incr") int incr,
@Param("userId") String userId,

4
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/WxmpWorkUserSubscribeDao.java

@ -68,7 +68,9 @@ public interface WxmpWorkUserSubscribeDao extends BaseDao<WxmpWorkUserSubscribeE
WxmpWorkUserSubscribeEntity getWxWorkSubscribe(@Param("userId") String userId,
@Param("customerId") String customerId,
@Param("templateId") String templateId);
@Param("templateId") String templateId,
@Param("openId") String openId
);
void incrSubscribeCount(@Param("incr") int incr,
@Param("userId") String userId,

4
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java

@ -497,7 +497,7 @@ public class WxmpMessageServiceImpl implements WxmpMessageService {
private void saveWxResiSubscribe(String customerId, String templateId, String wxSubscribeStatus, String userId,
String openId, String wxAlwaysVisit) {
WxmpResiUserSubscribeEntity wxResiSubscribe = wxmpResiUserSubscribeDao.getWxResiSubscribe(userId, customerId, templateId);
WxmpResiUserSubscribeEntity wxResiSubscribe = wxmpResiUserSubscribeDao.getWxResiSubscribe(userId, customerId, templateId, openId);
if (wxResiSubscribe == null) {
WxmpResiUserSubscribeEntity insert = new WxmpResiUserSubscribeEntity();
insert.setCount(WxMsgTemplateSubscribeStatus.SUBSCRIBE.equals(wxSubscribeStatus) ? 1 : 0);
@ -529,7 +529,7 @@ public class WxmpMessageServiceImpl implements WxmpMessageService {
*/
private void saveWxWorkSubscribe(String customerId, String templateId, String wxSubscribeStatus, String userId,
String openId, String wxAlwaysVisit) {
WxmpWorkUserSubscribeEntity wxWorkSubscribe = wxmpWorkUserSubscribeDao.getWxWorkSubscribe(userId, customerId, templateId);
WxmpWorkUserSubscribeEntity wxWorkSubscribe = wxmpWorkUserSubscribeDao.getWxWorkSubscribe(userId, customerId, templateId, openId);
if (wxWorkSubscribe == null) {
WxmpWorkUserSubscribeEntity insert = new WxmpWorkUserSubscribeEntity();
insert.setCount(WxMsgTemplateSubscribeStatus.SUBSCRIBE.equals(wxSubscribeStatus) ? 1 : 0);

13
epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/WxmpResiUserSubscribeDao.xml

@ -17,7 +17,8 @@
<update id="decreaseResiSubscribeCount">
update Wxmp_Resi_User_Subscribe
set count = if(count <![CDATA[<]]> 1, 0, count - ${num} )
set count = if(count <![CDATA[<]]> 1, 0, count - ${num} ),
UPDATED_TIME = now()
where
del_flag = 0
and customer_id = #{customerId}
@ -28,7 +29,8 @@
<update id="clearResiSubscribeCount" parameterType="String">
update Wxmp_Resi_User_Subscribe
set count = 0
set count = 0,
UPDATED_TIME = now()
where
del_flag = 0
and customer_id = #{customerId}
@ -41,7 +43,8 @@
<update id="incrSubscribeCount">
update wxmp_resi_user_subscribe
set COUNT=COUNT + #{incr},
WX_SUBSCRIBE_STATUS = 'subscribe'
WX_SUBSCRIBE_STATUS = 'subscribe',
UPDATED_TIME = now()
where USER_ID = #{userId}
and CUSTOMER_ID = #{customerId}
and TEMPLATE_ID = #{templateId}
@ -52,7 +55,8 @@
<update id="unSubscribe">
update wxmp_resi_user_subscribe
set WX_SUBSCRIBE_STATUS = 'unsubscribe',
COUNT = 0
COUNT = 0,
UPDATED_TIME = now()
where USER_ID = #{userId}
and CUSTOMER_ID = #{customerId}
and TEMPLATE_ID = #{templateId}
@ -77,6 +81,7 @@
where USER_ID = #{userId}
and CUSTOMER_ID = #{customerId}
and TEMPLATE_ID = #{templateId}
and WX_OPEN_ID = #{openId}
</select>
</mapper>

20
epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/WxmpWorkUserSubscribeDao.xml

@ -5,7 +5,8 @@
<update id="incrSubscribeCount">
update wxmp_work_user_subscribe
set COUNT=COUNT + #{incr},
WX_SUBSCRIBE_STATUS = 'subscribe'
WX_SUBSCRIBE_STATUS = 'subscribe',
UPDATED_TIME = now()
where USER_ID = #{userId}
and CUSTOMER_ID = #{customerId}
and TEMPLATE_ID = #{templateId}
@ -26,7 +27,8 @@
<update id="decreaseWorkSubscribeCount">
update Wxmp_Work_User_Subscribe
set count = if(count &lt; 1, 0, count - ${num} )
set count = if(count &lt; 1, 0, count - ${num} ),
UPDATED_TIME = now()
where
del_flag =0
and customer_id = #{customerId}
@ -36,7 +38,7 @@
</update>
<update id="clearWorkSubscribeCount" parameterType="String">
update Wxmp_Work_User_Subscribe
set count = 0
set count = 0, UPDATED_TIME = now()
where
del_flag =0
and customer_id = #{customerId}
@ -48,7 +50,8 @@
<update id="unSubscribe">
update wxmp_work_user_subscribe
set WX_SUBSCRIBE_STATUS = 'unsubscribe',
COUNT = 0
COUNT = 0,
UPDATED_TIME = now()
where USER_ID = #{userId}
and CUSTOMER_ID = #{customerId}
and TEMPLATE_ID = #{templateId}
@ -69,9 +72,10 @@
created_time,
updated_by,
updated_time
from wxmp_work_user_subscribe
where USER_ID = #{userId}
and CUSTOMER_ID = #{customerId}
and TEMPLATE_ID = #{templateId}
from wxmp_work_user_subscribe
where USER_ID = #{userId}
and CUSTOMER_ID = #{customerId}
and TEMPLATE_ID = #{templateId}
and WX_OPEN_ID = #{openId}
</select>
</mapper>

Loading…
Cancel
Save