|  |  |  | 
|---|
|  |  |  | import cc.mrbird.febs.pay.util.WeixinServiceUtil; | 
|---|
|  |  |  | import cn.hutool.core.collection.CollUtil; | 
|---|
|  |  |  | import cn.hutool.core.text.StrFormatter; | 
|---|
|  |  |  | import cn.hutool.core.util.IdUtil; | 
|---|
|  |  |  | import cn.hutool.core.util.ObjectUtil; | 
|---|
|  |  |  | import cn.hutool.core.util.StrUtil; | 
|---|
|  |  |  | import cn.hutool.extra.spring.SpringUtil; | 
|---|
|  |  |  | import cn.hutool.http.HttpRequest; | 
|---|
|  |  |  | import cn.hutool.http.HttpResponse; | 
|---|
|  |  |  | import cn.hutool.json.JSONObject; | 
|---|
|  |  |  | import cn.hutool.json.JSONUtil; | 
|---|
|  |  |  | import com.alibaba.fastjson.JSON; | 
|---|
|  |  |  | import com.baomidou.dynamic.datasource.toolkit.Base64; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.extension.exceptions.ApiException; | 
|---|
|  |  |  | import lombok.RequiredArgsConstructor; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.apache.commons.collections.CollectionUtils; | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.io.*; | 
|---|
|  |  |  | import java.math.BigDecimal; | 
|---|
|  |  |  | import java.net.*; | 
|---|
|  |  |  | import java.nio.charset.Charset; | 
|---|
|  |  |  | import java.util.ArrayList; | 
|---|
|  |  |  | import java.util.HashMap; | 
|---|
|  |  |  | 
|---|
|  |  |  | orderStateMsgVo.setTemplate_id(info.getTemplateId());//订阅消息模板id | 
|---|
|  |  |  | orderStateMsgVo.setPage(info.getPage()); | 
|---|
|  |  |  | Map<String, WxTemplateData> m = new HashMap<>(4); | 
|---|
|  |  |  | m.put("character_string2", new WxTemplateData(info.getOrderNo())); | 
|---|
|  |  |  | m.put("thing11", new WxTemplateData(info.getGoodsName())); | 
|---|
|  |  |  | m.put("amount1", new WxTemplateData(info.getAmount())); | 
|---|
|  |  |  | m.put("character_string9", new WxTemplateData(info.getTakeCode())); | 
|---|
|  |  |  | m.put("thing19", new WxTemplateData(info.getAddressArea())); | 
|---|
|  |  |  | m.put("phone_number18", new WxTemplateData(info.getLeaderPhone())); | 
|---|
|  |  |  | m.put("thing3", new WxTemplateData(info.getGoodsName())); | 
|---|
|  |  |  | m.put("thing15", new WxTemplateData(info.getRemark())); | 
|---|
|  |  |  | orderStateMsgVo.setData(m); | 
|---|
|  |  |  | String s = JSONUtil.toJsonStr(orderStateMsgVo); | 
|---|
|  |  |  | log.info(s); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public List<String> getTemplateId() { | 
|---|
|  |  |  | List<String> wxTemplates = new ArrayList<>(); | 
|---|
|  |  |  | List<DataDictionaryCustom> wxTemplateList = dataDictionaryCustomMapper.selectDicByType(DataDictionaryEnum.WX_TEMPLATE_ID_ONE.getType()); | 
|---|
|  |  |  | public List<HashMap<String, String>> getTemplateId() { | 
|---|
|  |  |  | List<HashMap<String, String>> wxTemplates = new ArrayList<>(); | 
|---|
|  |  |  | List<DataDictionaryCustom> wxTemplateList = dataDictionaryCustomMapper.selectDicByType(DataDictionaryEnum.WX_TEMPLATE_ID_THREE.getType()); | 
|---|
|  |  |  | if(CollUtil.isNotEmpty(wxTemplateList)){ | 
|---|
|  |  |  | for(DataDictionaryCustom dic : wxTemplateList){ | 
|---|
|  |  |  | wxTemplates.add(dic.getValue()); | 
|---|
|  |  |  | HashMap<String, String> objectObjectHashMap = new HashMap<>(); | 
|---|
|  |  |  | objectObjectHashMap.put("name",dic.getCode()); | 
|---|
|  |  |  | objectObjectHashMap.put("value",dic.getValue()); | 
|---|
|  |  |  | wxTemplates.add(objectObjectHashMap); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return wxTemplates; | 
|---|