md
This commit is contained in:
parent
80910dbac6
commit
951686b39b
@ -23,6 +23,7 @@ import com.xdadan.erp.oms.common.core.domain.AjaxResult;
|
|||||||
import com.xdadan.erp.oms.common.core.redis.RedissonService;
|
import com.xdadan.erp.oms.common.core.redis.RedissonService;
|
||||||
import com.xdadan.erp.oms.common.enums.BusinessType;
|
import com.xdadan.erp.oms.common.enums.BusinessType;
|
||||||
import com.xdadan.erp.oms.common.utils.DateUtils;
|
import com.xdadan.erp.oms.common.utils.DateUtils;
|
||||||
|
import com.xdadan.erp.oms.domain.EmisSmsSendRecord;
|
||||||
import com.xdadan.erp.oms.domain.exception.EmisBizError;
|
import com.xdadan.erp.oms.domain.exception.EmisBizError;
|
||||||
import com.xdadan.erp.oms.domain.vo.AddressParseResult;
|
import com.xdadan.erp.oms.domain.vo.AddressParseResult;
|
||||||
import com.xdadan.erp.oms.service.*;
|
import com.xdadan.erp.oms.service.*;
|
||||||
@ -78,7 +79,6 @@ public class Oms2cCommonController extends BaseController
|
|||||||
@Autowired
|
@Autowired
|
||||||
private WxMaService wxMaService;
|
private WxMaService wxMaService;
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private OmsBaseService omsBaseService;
|
private OmsBaseService omsBaseService;
|
||||||
|
|
||||||
@ -290,21 +290,17 @@ public class Oms2cCommonController extends BaseController
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Log(title = "发送小程序通知", businessType = BusinessType.OTHER)
|
@Log(title = "发送小程序通知", businessType = BusinessType.OTHER)
|
||||||
@RequestMapping(value = "/sendWxSappNotifyToUser")
|
@RequestMapping(value = "/sendWxSappNotify")
|
||||||
public AjaxResult sendWxSappNotifyToUser(String billCode,String openId,String tplId,String paramStr)
|
public AjaxResult sendWxSappNotify(String billCode)
|
||||||
{
|
{
|
||||||
WxMaSubscribeMessage wxMaSubscribeMessage = WxMaSubscribeMessage.builder()
|
log.error("==>sendWxSappNotify start billCode:"+billCode;
|
||||||
.toUser(openId)
|
try{
|
||||||
.templateId(tplId)
|
EmisSmsSendRecord emisSmsSendRecord=new EmisSmsSendRecord();
|
||||||
.page("pages/post/query?billCode="+billCode)
|
emisSmsSendRecord.setBillCode(billCode);
|
||||||
.build();
|
omsBaseService.autoDoWxSappNotifySend(emisSmsSendRecord);
|
||||||
JSONObject jObjParam = JSONObject.parseObject(paramStr);
|
}catch(Exception ex){
|
||||||
|
ex.printStackTrace();
|
||||||
jObjParam.forEach( (k,v)-> { wxMaSubscribeMessage.addData(new WxMaSubscribeMessage.MsgData(k, (String)v));} );
|
log.error("==>sendWxSappNotify exception:"+ex.getMessage());
|
||||||
try {
|
|
||||||
wxMaService.getMsgService().sendSubscribeMsg(wxMaSubscribeMessage);
|
|
||||||
} catch (WxErrorException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return AjaxResult.success("发送成功");
|
return AjaxResult.success("发送成功");
|
||||||
@ -322,7 +318,8 @@ public class Oms2cCommonController extends BaseController
|
|||||||
// 加锁查询
|
// 加锁查询
|
||||||
redissonService.lock(lockKey,300);
|
redissonService.lock(lockKey,300);
|
||||||
try{
|
try{
|
||||||
omsBaseService.autoDoWxSappNotifySend();
|
EmisSmsSendRecord emisSmsSendRecord=new EmisSmsSendRecord();
|
||||||
|
omsBaseService.autoDoWxSappNotifySend(emisSmsSendRecord);
|
||||||
}catch(Exception ex){
|
}catch(Exception ex){
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
log.error("triggerSendWxSappNotify exception:"+ex.getMessage());
|
log.error("triggerSendWxSappNotify exception:"+ex.getMessage());
|
||||||
|
|||||||
@ -29,7 +29,7 @@ public interface EmisSmsSendRecordMapper extends BaseMapper<EmisSmsSendRecord>
|
|||||||
* 查询列表
|
* 查询列表
|
||||||
* @return 集合
|
* @return 集合
|
||||||
*/
|
*/
|
||||||
public List<EmisSmsSendRecord> selectWxSappNotifyList();
|
public List<EmisSmsSendRecord> selectWxSappNotifyList(EmisSmsSendRecord emisSmsSendRecord);
|
||||||
|
|
||||||
|
|
||||||
public int updateWxSappNotifyStatus(EmisSmsSendRecord emisSmsSendRecord);
|
public int updateWxSappNotifyStatus(EmisSmsSendRecord emisSmsSendRecord);
|
||||||
|
|||||||
@ -67,9 +67,9 @@ public class OmsBaseService {
|
|||||||
/**
|
/**
|
||||||
* 通知发送发送
|
* 通知发送发送
|
||||||
*/
|
*/
|
||||||
public void autoDoWxSappNotifySend() {
|
public void autoDoWxSappNotifySend(EmisSmsSendRecord emisSmsSendRecord) {
|
||||||
|
|
||||||
List<EmisSmsSendRecord> list = emisSmsSendRecordMapper.selectWxSappNotifyList();
|
List<EmisSmsSendRecord> list = emisSmsSendRecordMapper.selectWxSappNotifyList(emisSmsSendRecord);
|
||||||
if(!CollectionUtil.isEmpty(list)){
|
if(!CollectionUtil.isEmpty(list)){
|
||||||
for(EmisSmsSendRecord dt:list){
|
for(EmisSmsSendRecord dt:list){
|
||||||
log.error("===>Start 发送微信通知:"+dt.getBillCode()+","+dt.getPhone()+" :smsType:"+dt.getSmsType());
|
log.error("===>Start 发送微信通知:"+dt.getBillCode()+","+dt.getPhone()+" :smsType:"+dt.getSmsType());
|
||||||
|
|||||||
@ -36,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
del_flag='0' and wx_notify_status='0'
|
del_flag='0' and wx_notify_status='0'
|
||||||
and create_time <![CDATA[ > ]]> DATE_SUB(CURDATE(), INTERVAL 30 DAY)
|
and create_time <![CDATA[ > ]]> DATE_SUB(CURDATE(), INTERVAL 30 DAY)
|
||||||
and create_time <![CDATA[ < ]]> SUBDATE(now(),INTERVAL 2 hour)
|
and create_time <![CDATA[ < ]]> SUBDATE(now(),INTERVAL 2 hour)
|
||||||
|
<if test="billCode != null and billCode != ''"> and bill_code = #{billCode}</if>
|
||||||
</where>
|
</where>
|
||||||
order by create_time desc
|
order by create_time desc
|
||||||
limit 300
|
limit 300
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user