Просмотр исходного кода

Merge branch 'release_real_202010' of https://git.malls.iformall.com/server/formallProject into release_real_202010

release_toaliyun_real
xiaohanzi 5 лет назад
Родитель
Сommit
92ed7fe617
6 измененных файлов: 37 добавлений и 34 удалений
  1. +2
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxTemplateMsg.java
  2. +0
    -5
      mallinkService/src/main/java/com/iformall/mapper/WxTemplateMsgMapper.java
  3. +2
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java
  4. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxOrderPressServiceImpl.java
  5. +27
    -25
      mallinkService/src/main/java/com/iformall/service/msg/impl/SendSmartAppMsgServiceImpl.java
  6. +5
    -1
      mallinkService/src/main/resources/mapper/WxTemplateMsgMapper.xml

+ 2
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxTemplateMsg.java Просмотреть файл

@@ -24,5 +24,7 @@ public class WxTemplateMsg extends TenantEntity {
private Date createDate; private Date createDate;
@io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate")
private Date updateDate; private Date updateDate;
@io.swagger.annotations.ApiModelProperty(value="消息开关(0/1)",name="onOff")
private Integer onOff;


} }

+ 0
- 5
mallinkService/src/main/java/com/iformall/mapper/WxTemplateMsgMapper.java Просмотреть файл

@@ -7,10 +7,5 @@ import com.iformall.domain.po.WxTemplateMsg;
public interface WxTemplateMsgMapper extends CommonMapper<WxTemplateMsg, Long> { public interface WxTemplateMsgMapper extends CommonMapper<WxTemplateMsg, Long> {


List<WxTemplateMsg> findList(WxTemplateMsg wxTemplateMsg); List<WxTemplateMsg> findList(WxTemplateMsg wxTemplateMsg);


} }

+ 2
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java Просмотреть файл

@@ -980,7 +980,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
)); ));


try { try {
mqBaseProducer.sendMessage(smartAppMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode());
//mqBaseProducer.sendMessage(smartAppMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode());
} catch (Exception e) { } catch (Exception e) {
logger.error("支付通知发送失败: " + e.getMessage()); logger.error("支付通知发送失败: " + e.getMessage());
throw new MallinkException(ErrorCode.TEMPLATE_SEND_FAILED); throw new MallinkException(ErrorCode.TEMPLATE_SEND_FAILED);
@@ -1014,7 +1014,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
)); ));


try { try {
mqBaseProducer.sendMessage(smartAppMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode());
// mqBaseProducer.sendMessage(smartAppMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode());
} catch (Exception e) { } catch (Exception e) {
logger.error("支付通知发送失败: " + e.getMessage()); logger.error("支付通知发送失败: " + e.getMessage());
throw new MallinkException(ErrorCode.TEMPLATE_SEND_FAILED); throw new MallinkException(ErrorCode.TEMPLATE_SEND_FAILED);


+ 1
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxOrderPressServiceImpl.java Просмотреть файл

@@ -244,7 +244,7 @@ public class WxOrderPressServiceImpl implements WxOrderPressService {
)); ));


try { try {
mqBaseProducer.sendMessage(smartAppMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode());
// mqBaseProducer.sendMessage(smartAppMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode());
} catch (Exception e) { } catch (Exception e) {
logger.error("砍价成功通知发送失败: " + e.getMessage()); logger.error("砍价成功通知发送失败: " + e.getMessage());
throw new MallinkException(ErrorCode.TEMPLATE_SEND_FAILED); throw new MallinkException(ErrorCode.TEMPLATE_SEND_FAILED);


+ 27
- 25
mallinkService/src/main/java/com/iformall/service/msg/impl/SendSmartAppMsgServiceImpl.java Просмотреть файл

@@ -76,22 +76,22 @@ public class SendSmartAppMsgServiceImpl implements MsgSendService {
// throw new MallinkException(ErrorCode.TEMPLATE_NOT_FOUND); // throw new MallinkException(ErrorCode.TEMPLATE_NOT_FOUND);
return; return;
} }
JSONObject customParam = JSON.parseObject(msg.getCustomParam());
String url = customParam.getString("url");
String emphasis = customParam.getString("emphasis");
// build template data list
List<String> dataList = smartAppMsg.getDataList();
JSONArray indexArr = customParam.getJSONArray("index");
List<WxMaSubscribeMessage.Data> dataTempList = new ArrayList<>();
for(int i=0;i<indexArr.size();i++) {
String key = indexArr.getString(i);
String value = dataList.get(i);
WxMaSubscribeMessage.Data templateData = new WxMaSubscribeMessage.Data(key, value);
dataTempList.add(templateData);
}
if(0 == msg.getOnOff().intValue()){
JSONObject customParam = JSON.parseObject(msg.getCustomParam());
// String url = customParam.getString("url");
// String emphasis = customParam.getString("emphasis");
// build template data list
List<String> dataList = smartAppMsg.getDataList();
JSONArray indexArr = customParam.getJSONArray("index");
List<WxMaSubscribeMessage.Data> dataTempList = new ArrayList<>();
for(int i=0;i<indexArr.size();i++) {
String key = indexArr.getString(i);
String value = dataList.get(i);
WxMaSubscribeMessage.Data templateData = new WxMaSubscribeMessage.Data(key, value);
dataTempList.add(templateData);
}


// List<WxMaTemplateData> dataTempList = new ArrayList<>(); // List<WxMaTemplateData> dataTempList = new ArrayList<>();
// for(int i=0;i<indexArr.size();i++) { // for(int i=0;i<indexArr.size();i++) {
@@ -112,15 +112,17 @@ public class SendSmartAppMsgServiceImpl implements MsgSendService {
// .build(); // .build();
// wxMaService.getMsgService().sendTemplateMsg(templateMessage); // wxMaService.getMsgService().sendTemplateMsg(templateMessage);


subscribeMessage = WxMaSubscribeMessage.builder()
.templateId(msg.getTemplateId())
.toUser(smartAppMsg.getTo())
.lang(WxMaConstants.MiniprogramLang.ZH_CN)
.miniprogramState(WxMaConstants.MiniprogramState.FORMAL)
.page(smartAppMsg.getGotopage())
.data(dataTempList)
.build();
subscribeMessage = WxMaSubscribeMessage.builder()
.templateId(msg.getTemplateId())
.toUser(smartAppMsg.getTo())
.lang(WxMaConstants.MiniprogramLang.ZH_CN)
.miniprogramState(WxMaConstants.MiniprogramState.FORMAL)
.page(smartAppMsg.getGotopage())
.data(dataTempList)
.build();

wxMaService.getMsgService().sendSubscribeMsg(subscribeMessage);
}


wxMaService.getMsgService().sendSubscribeMsg(subscribeMessage);
} }
} }

+ 5
- 1
mallinkService/src/main/resources/mapper/WxTemplateMsgMapper.xml Просмотреть файл

@@ -9,10 +9,11 @@
<result column="type" jdbcType="INTEGER" property="type"/> <result column="type" jdbcType="INTEGER" property="type"/>
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
<result column="on_off" jdbcType="INTEGER" property="onOff"/>
</resultMap> </resultMap>


<sql id="allColumns"> <sql id="allColumns">
`id`,`tenant_id`,`parent_tenant_id`,`template_id`,`type`,`create_date`,`update_date`
`id`,`tenant_id`,`parent_tenant_id`,`template_id`,`type`,`create_date`,`update_date`,`on_off`
</sql> </sql>


<sql id="dynamicWhereConditions"> <sql id="dynamicWhereConditions">
@@ -44,6 +45,9 @@
<if test=" null != updateDate "> <if test=" null != updateDate ">
and `update_date` = #{updateDate} and `update_date` = #{updateDate}
</if> </if>
<if test=" null != onOff ">
and `on_off` = #{onOff}
</if>
<if test=" null != ids "> <if test=" null != ids ">
and id in and id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">


Загрузка…
Отмена
Сохранить