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

fix 短信发送bug

release_toaliyun_real
xiaohanzi 5 лет назад
Родитель
Сommit
f11f134c52
4 измененных файлов: 45 добавлений и 3 удалений
  1. +9
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponPresentController.java
  2. +3
    -3
      mallinkService/src/main/java/com/iformall/domain/po/msg/WxMsgRecord.java
  3. +3
    -0
      mallinkService/src/main/java/com/iformall/service/WxCouponPresentService.java
  4. +30
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponPresentServiceImpl.java

+ 9
- 0
mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponPresentController.java Просмотреть файл

@@ -132,5 +132,14 @@ public class WxCouponPresentController extends BaseController {
wxCouponPresentService.add(wxCouponPresent, list, phoneSet,EnumPayWay.PAY_WAY_WECHAT);
return new ResultData();
}
@ApiOperation("新增接口")
@PostMapping("ttttttt")
@SystemControllerLog(description = "新增")
public ResultData tttttt(@RequestBody WxCouponPresent wxCouponPresent) {
//只需要给一端发就可以了。默认给微信小程序发
wxCouponPresentService.tttttttttttttt();
return new ResultData();
}

}

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

@@ -58,8 +58,8 @@ public class WxMsgRecord extends BaseMsg {
}

public TenantEntity getTenantInfo() {
return new TenantEntity() {{
setTenantId(tenantId);
}};
TenantEntity tenantEntity = new TenantEntity();
tenantEntity.setTenantId(tenantId);
return tenantEntity;
}
}

+ 3
- 0
mallinkService/src/main/java/com/iformall/service/WxCouponPresentService.java Просмотреть файл

@@ -20,5 +20,8 @@ public interface WxCouponPresentService {
WxCouponPresent findById(Long id);

ResultData add(WxCouponPresent wxCouponPresent, List<WxCouponPassword> list, Set<String> phoneSet,EnumPayWay payWay);
void tttttttttttttt();

}

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

@@ -15,6 +15,8 @@ import com.iformall.mapper.WxCouponPresentMapper;
import com.iformall.mq.MqBaseProducer;
import com.iformall.service.WxAppinfoService;
import com.iformall.service.WxCouponPresentService;
import com.iformall.service.msg.impl.SendSmsServiceImpl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -103,4 +105,32 @@ public class WxCouponPresentServiceImpl implements WxCouponPresentService {
logger.info("系统发卡发送短信结束");
logger.info("》》》》》》》》》》》");
}

@Autowired
private SendSmsServiceImpl sendSmsService;
@Override
public void tttttttttttttt() {
WxCouponPassword couponPassword = wxCouponPasswordMapper.selectById(483888264577998850L);
TenantEntity tenantEntity = new TenantEntity();
tenantEntity.setTenantId("789");
Map<String, String> msgReplaceMap = new HashMap();
msgReplaceMap.put("id", couponPassword.getId().toString());
msgReplaceMap.put("app", "富茂链客");
msgReplaceMap.put("title", "饼干消费卡");
msgReplaceMap.put("pw", couponPassword.getPassword());
WxMsgRecord wxMsgRecord = new WxMsgRecord();
wxMsgRecord.setMsgType(EnumMsgRecordType.SMS.getCode());
wxMsgRecord.setModelType(EnumMsgModel.COUPON_CARD_SEND.getCode());
wxMsgRecord.setReceiver("18600671341");
wxMsgRecord.updateTenantInfo(tenantEntity);
wxMsgRecord.setDynamicContentMap(msgReplaceMap);
try {
sendSmsService.send(wxMsgRecord);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}

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