|
@@ -15,7 +15,9 @@ import java.util.Map;
|
|
import cn.superdesk.libs.common.json.JsonUtils;
|
|
import cn.superdesk.libs.common.json.JsonUtils;
|
|
import com.palmnest.application.dto.*;
|
|
import com.palmnest.application.dto.*;
|
|
import com.palmnest.model.dinner.*;
|
|
import com.palmnest.model.dinner.*;
|
|
|
|
+import com.palmnest.model.estateserve.WxPublicno;
|
|
import com.palmnest.service.dinner.manager.*;
|
|
import com.palmnest.service.dinner.manager.*;
|
|
|
|
+import com.palmnest.service.notice.WxPubManager;
|
|
import net.sf.json.JsonConfig;
|
|
import net.sf.json.JsonConfig;
|
|
import net.sf.json.util.JSONUtils;
|
|
import net.sf.json.util.JSONUtils;
|
|
|
|
|
|
@@ -115,7 +117,7 @@ public class PlaceAnOrderServiceImpl implements PlaceAnOrderService{
|
|
private SmsAuthCodeManager smsAuthCodeManager;
|
|
private SmsAuthCodeManager smsAuthCodeManager;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
- private MobileConfigManager mobileConfigManager;
|
|
|
|
|
|
+ private WxPubManager wxPubManager;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private ScWxuserManager scWxuserManager;
|
|
private ScWxuserManager scWxuserManager;
|
|
@@ -141,7 +143,6 @@ public class PlaceAnOrderServiceImpl implements PlaceAnOrderService{
|
|
public static final String wxMessageUrl = PropertiesKit.readPropertiesValue("wxMessageUrl", "wechat.properties");
|
|
public static final String wxMessageUrl = PropertiesKit.readPropertiesValue("wxMessageUrl", "wechat.properties");
|
|
|
|
|
|
public static final String wxTempUrl = PropertiesKit.readPropertiesValue("wxTempUrl", "wechat.properties");
|
|
public static final String wxTempUrl = PropertiesKit.readPropertiesValue("wxTempUrl", "wechat.properties");
|
|
- private String wxMessageConfigUrl = PropertiesKit.readPropertiesValue("wxMessageConfigUrl", "wechat.properties");
|
|
|
|
/**
|
|
/**
|
|
* 获取能够订餐的用户
|
|
* 获取能够订餐的用户
|
|
* @return
|
|
* @return
|
|
@@ -1687,21 +1688,29 @@ public class PlaceAnOrderServiceImpl implements PlaceAnOrderService{
|
|
Map<Integer,String> resMap = orderDinnerSetManager.findUserByOrgIds(orgIds,openId);
|
|
Map<Integer,String> resMap = orderDinnerSetManager.findUserByOrgIds(orgIds,openId);
|
|
for (Integer org : resMap.keySet()){
|
|
for (Integer org : resMap.keySet()){
|
|
String userIds = resMap.get(org);
|
|
String userIds = resMap.get(org);
|
|
- tempMsg(org,userIds,content,url);
|
|
|
|
|
|
+ tempMsg(org,userIds,content,url,tomorrow);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private void tempMsg(Integer org,String userIds,String content,String url){
|
|
|
|
- WxMessageConfigVo vo = smsAuthCodeManager.getWxMessageConfig(org,CodeConstants.BOOK_DINNER_TASK);
|
|
|
|
- if(null == vo){
|
|
|
|
|
|
+ private void tempMsg(Integer org,String userIds,String content,String url,String date){
|
|
|
|
+ WxPublicno no = wxPubManager.getPublicByOrgId(org.toString());
|
|
|
|
+ if(null == no){
|
|
tempMsg1(org,userIds,content,url);//基础推送,平台推送,积余不需要这个模板,换
|
|
tempMsg1(org,userIds,content,url);//基础推送,平台推送,积余不需要这个模板,换
|
|
}else{
|
|
}else{
|
|
- tempMsg2(org,userIds,url,vo);//模板库发送
|
|
|
|
|
|
+ //根据公众号id获取模板信息
|
|
|
|
+ WxMessageConfigVo vo = smsAuthCodeManager.getWxMessageConfig(no.getId(),CodeConstants.BOOK_DINNER_TASK);
|
|
|
|
+ LOG.info("tempMsg-vo:"+JsonUtils.toJson(vo));
|
|
|
|
+ if(null == vo){
|
|
|
|
+ tempMsg1(org,userIds,content,url);//基础推送,平台推送,积余不需要这个模板,换
|
|
|
|
+ }else{
|
|
|
|
+ tempMsg2(org,userIds,url,vo,date);//模板库发送
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
public String sendMessageTemp(WechatMessageDto dto) {
|
|
public String sendMessageTemp(WechatMessageDto dto) {
|
|
- if(null == dto || null == dto.getOrgId() || null == dto.getType() || StringUtils.isEmpty(dto.getBusinessCode()) || StringUtils.isEmpty(dto.getType())){
|
|
|
|
|
|
+ LOG.info("sendMessageTemp-dto:"+JsonUtils.toJson(dto));
|
|
|
|
+ if(null == dto || null == dto.getOrgId() || null == dto.getType() || StringUtils.isEmpty(dto.getBusinessCode())){
|
|
return "参数为空";
|
|
return "参数为空";
|
|
}
|
|
}
|
|
if(StringUtils.isEmpty(wxTempUrl)){
|
|
if(StringUtils.isEmpty(wxTempUrl)){
|
|
@@ -1715,9 +1724,10 @@ public class PlaceAnOrderServiceImpl implements PlaceAnOrderService{
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
- private void tempMsg2(Integer org,String userIds,String url,WxMessageConfigVo vo){
|
|
|
|
|
|
+ private void tempMsg2(Integer org,String userIds,String url,WxMessageConfigVo vo,String date){
|
|
Map<String,String> paramMap=new HashMap<String, String>();
|
|
Map<String,String> paramMap=new HashMap<String, String>();
|
|
paramMap.put("[PARAM_URL]", url);
|
|
paramMap.put("[PARAM_URL]", url);
|
|
|
|
+ paramMap.put("[PARAM_DATE]", date);
|
|
WechatMessageDto msgDto=new WechatMessageDto();
|
|
WechatMessageDto msgDto=new WechatMessageDto();
|
|
msgDto.setOrgId(org);
|
|
msgDto.setOrgId(org);
|
|
msgDto.setBusinessCode(vo.getBusinessCode());
|
|
msgDto.setBusinessCode(vo.getBusinessCode());
|