c70ccaa730e61f92cd6302a65a68714cc6efed8d.svn-base 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504
  1. package com.chinacreator.process.job;
  2. import com.chinacreator.common.exception.BusinessException;
  3. import com.chinacreator.common.util.DESUtil;
  4. import com.chinacreator.common.util.MD5;
  5. import com.chinacreator.common.util.URLUtil;
  6. import com.chinacreator.process.bean.*;
  7. import com.chinacreator.process.dao.*;
  8. import com.chinacreator.process.service.*;
  9. import com.chinacreator.process.util.JsonUtil;
  10. import com.chinacreator.video.queue.MessageService;
  11. import com.chinacreator.video.queue.bean.MessagePipe;
  12. import org.apache.commons.lang.StringUtils;
  13. import org.apache.log4j.Logger;
  14. import org.quartz.DisallowConcurrentExecution;
  15. import org.quartz.PersistJobDataAfterExecution;
  16. import org.springframework.beans.factory.annotation.Autowired;
  17. import java.net.URLEncoder;
  18. import java.text.SimpleDateFormat;
  19. import java.util.ArrayList;
  20. import java.util.Date;
  21. import java.util.HashMap;
  22. import java.util.List;
  23. import java.util.Map;
  24. import java.util.UUID;
  25. import java.util.concurrent.CountDownLatch;
  26. import java.util.concurrent.ExecutorService;
  27. import java.util.concurrent.LinkedBlockingQueue;
  28. import java.util.concurrent.ThreadPoolExecutor;
  29. import java.util.concurrent.TimeUnit;
  30. /**
  31. * 生成活动关系后实时赠送会员JOB
  32. * @author xu.zhou 20210610
  33. * 队列名称:order
  34. */
  35. @PersistJobDataAfterExecution
  36. @DisallowConcurrentExecution
  37. public class ReciveSendVipMQJob {
  38. private Logger logger = Logger.getLogger(ReciveSendVipMQJob.class);
  39. @Autowired
  40. private MessageService messageService;
  41. @Autowired
  42. private DictionaryDao dictionaryDao;
  43. @Autowired
  44. private OrderSendVipDao orderSendVipDao;
  45. @Autowired
  46. private CPDao cpDao;
  47. public void doProcess() throws Exception {
  48. String mqname = "ordersendvip";
  49. logger.info("接收"+mqname+"订购队列JOB启动");
  50. if (dictionaryDao.getValue("recivemq").equals("0")) {
  51. long beginTime = System.currentTimeMillis();
  52. //获取队列数据
  53. List<MessagePipe> list = messageService.reciveBatchMessage("ordersendvip", 500);
  54. logger.info("接收"+mqname+"订购队列花费时间:" + (System.currentTimeMillis() - beginTime)+",获取数据条数:"+(list == null ? "0" : list.size()));
  55. if(list != null && list.size()>0){
  56. CountDownLatch threadSignal = new CountDownLatch(list.size());
  57. ExecutorService executorService = new ThreadPoolExecutor(15, 20, 10L, TimeUnit.MINUTES, new LinkedBlockingQueue<Runnable>(), new ThreadPoolExecutor.CallerRunsPolicy());
  58. for (MessagePipe messagePipe : list) {
  59. OrderBean orderBean = null;
  60. String srcmqname = "";
  61. try {
  62. orderBean = transBean(messagePipe.getBody().get("data").toString());
  63. srcmqname = messagePipe.getBody().get("mqname").toString();
  64. ReciveSendVipService service = new ReciveSendVipService(orderBean,dictionaryDao, cpDao, orderSendVipDao,threadSignal, srcmqname);
  65. executorService.execute(service);
  66. } catch (Exception e) {
  67. e.printStackTrace();
  68. logger.error("ReciveSendVipMQJob执行出错:" + (orderBean == null ? "解析失败" : orderBean.getUserid()) + "=>" + e);
  69. }
  70. }
  71. executorService.shutdown();
  72. try {
  73. executorService.awaitTermination(5L, TimeUnit.MINUTES);
  74. } catch (InterruptedException e) {
  75. e.printStackTrace();
  76. }
  77. }
  78. logger.info(Thread.currentThread().getName()+","+mqname+"定时任务完成,耗时:"+(System.currentTimeMillis()-beginTime)/1000+" 秒");
  79. } else {
  80. logger.info("停止接收队列消息");
  81. }
  82. }
  83. private OrderBean transBean(String jsonStr) {
  84. //String jsonStr = JsonUtil.objectToJson(body);
  85. return (OrderBean) JsonUtil.jsonToBean(jsonStr, OrderBean.class);
  86. }
  87. }
  88. class ReciveSendVipService implements Runnable {
  89. private Logger sendviplog = Logger.getLogger("ordersendvip");
  90. private OrderBean orderBean;
  91. private DictionaryDao dictionaryDao;
  92. private CPDao cpDao;
  93. private OrderSendVipDao orderSendVipDao;
  94. private CountDownLatch threadSignal;
  95. private String mqname;
  96. public ReciveSendVipService(OrderBean _orderBean,DictionaryDao _dictionaryDao, CPDao _cpDao, OrderSendVipDao _orderSendVipDao, CountDownLatch _threadSignal, String _mqname){
  97. this.orderBean = _orderBean;
  98. this.dictionaryDao = _dictionaryDao;
  99. this.cpDao = _cpDao;
  100. this.orderSendVipDao = _orderSendVipDao;
  101. this.threadSignal = _threadSignal;
  102. //this.totalSize = _totalSize;
  103. this.mqname = _mqname;
  104. }
  105. public void run() {
  106. Map logMap = new HashMap();
  107. logMap.put("data", JsonUtil.objectToJson(orderBean));
  108. logMap.put("mqname", mqname);
  109. long startime = System.currentTimeMillis();
  110. //LogBean logBean = new LogBean();
  111. try {
  112. //赠送多个会员改造
  113. String userid = orderBean.getUserid();
  114. String cpid = orderBean.getCpid();
  115. String spid = orderBean.getSpid();
  116. //获取所有赠送配置
  117. List<HashMap> confList = orderSendVipDao.qryOrderSendvipAllConf(cpid, spid);
  118. if(confList != null && confList.size() > 0){
  119. sendviplog.info("confList=>"+confList);
  120. List<HashMap> orderList = orderSendVipDao.findOrderRel(userid, spid);
  121. if(orderList != null && orderList.size()>0){
  122. HashMap orderMap = orderList.get(0);
  123. if ("2".equals(orderMap.get("STATUS"))){
  124. throw new BusinessException("5005", "订购关系已失效");
  125. }
  126. //可能一次要赠送多个会员
  127. for(HashMap confMap : confList){
  128. //验证是否可以赠送会员
  129. if(valisendvip(orderBean, confMap, orderMap)){
  130. //调接口赠送会员
  131. sendVipByConf( orderBean, confMap, orderMap, logMap);
  132. }
  133. }
  134. //调置执行无异常
  135. logMap.put("resultcode", "0");
  136. logMap.put("errorinfo", "ok");
  137. }else{
  138. throw new BusinessException("5007", "赠送会员查无订购关系");
  139. }
  140. }else{
  141. throw new BusinessException("5008", "无有效赠送会员配置信息");
  142. }
  143. } catch (Exception e) {
  144. if (e instanceof BusinessException) {
  145. logMap.put("resultcode", ((BusinessException) e).getCode());
  146. logMap.put("errorinfo", e.getMessage());
  147. }else{
  148. logMap.put("errorinfo","系统错误,"+e.getMessage());
  149. logMap.put("resultcode", "8000");
  150. e.printStackTrace();
  151. sendviplog.error("执行出错:" + orderBean.getUserid() + "," + mqname + "=>" + e);
  152. }
  153. } finally {
  154. threadSignal.countDown();
  155. //设置调用时长
  156. logMap.put("times", (System.currentTimeMillis()-startime));
  157. //输出日志
  158. sendviplog.info(logMap);
  159. }
  160. }
  161. /**
  162. * 调接口送会员
  163. *
  164. * @param
  165. * @return
  166. * @throws Exception
  167. */
  168. private String invokeVip(OrderBean orderBean) throws Exception {
  169. String result = "";
  170. try {
  171. String vipurl = this.dictionaryDao.getValue("joinActivityUrl");
  172. String timestamp = (System.currentTimeMillis() / 1000) + "";
  173. String userid = orderBean.getUserid();
  174. String channel = orderBean.getChannel();
  175. String usertype = "4"; //会员账号类型 4:手机号
  176. String userval = userid;
  177. String pwd = "";
  178. CPInfo cpinfo = cpDao.findById(orderBean.getCpid());
  179. if (cpinfo != null) {
  180. pwd = cpinfo.getNetpwd();
  181. }
  182. userid = DESUtil.encode(userid, pwd);
  183. String signature = MD5.MD5Encode(userid + userval + pwd + timestamp);
  184. signature = signature.toLowerCase();
  185. vipurl = vipurl + "?userid=" + URLEncoder.encode(userid, "utf-8") + "&usertype=" + usertype + "&userval=" + userval + "&channel=" + channel + "&timestamp="
  186. + timestamp + "&signature=" + signature + "&activetype=" + orderBean.getActiveType();
  187. sendviplog.info("vipurl: " + vipurl);
  188. result = URLUtil.get(vipurl, 30 * 1000); //调赠送会员接口,超时时间设置为10秒
  189. sendviplog.info("赠送会员结果=> userid: " + userval + ", spid: " + orderBean.getSpid() + " , result: " + result);
  190. } catch (Exception e) {
  191. e.printStackTrace();
  192. sendviplog.error("userid: " + orderBean.getUserid() + "领取方式赠送会员出现异常," + e,e);
  193. if (e.getMessage() != null && e.getMessage().indexOf("TimeoutException") != -1) {//超时异常
  194. throw new BusinessException("9070", "赠送会员超时", new String[0]);
  195. } else {
  196. throw new BusinessException("9002", "赠送会员未成功," + e.getMessage(), new String[0]);
  197. }
  198. }
  199. return result;
  200. }
  201. /**
  202. * 调直充接口送会员
  203. * @param
  204. * @return
  205. * @throws Exception
  206. */
  207. private String invokeVipByZc(OrderBean orderBean, HashMap confmp) throws Exception {
  208. String result = "";
  209. try {
  210. String basevipurl = this.dictionaryDao.getValue("giveVipUrl");
  211. String vipurl = basevipurl;
  212. String apptype = "2";
  213. String orderid = UUID.randomUUID().toString().replaceAll("-", "").substring(0, 16);
  214. String timestamp = System.currentTimeMillis() + "";
  215. String userid = orderBean.getUserid();
  216. String channel = orderBean.getSpid(); //渠道传SPID
  217. String usertype = "4"; //会员账号类型 4:手机号
  218. String userval = userid;
  219. String vipid = confmp.get("VIPID").toString();
  220. String viptype = confmp.get("VIPTYPE").toString();
  221. String pwd = confmp.get("VIPPWD").toString();
  222. String vipval = "1";
  223. String signature = MD5.MD5Encode(orderid+channel+vipid+userval+pwd+timestamp);
  224. signature = signature.toLowerCase();
  225. //直充接口新参数
  226. //产品名称
  227. String productName = URLEncoder.encode(confmp.get("PRODUCTNAME") == null ? "" : confmp.get("PRODUCTNAME").toString(),"utf-8");
  228. //产品ID
  229. String productId = confmp.get("PRODUCTID") == null ? "" : confmp.get("PRODUCTID").toString();
  230. //订购状态,0订购,1退订
  231. String orderType = orderBean.getOrderType();
  232. String province = orderBean.getProvince();
  233. String area = orderBean.getArea();
  234. vipurl = vipurl + "?userval=" + URLEncoder.encode(userval,"utf-8") + "&usertype=" + usertype + "&channel=" + channel + "&timestamp="
  235. + timestamp + "&signature=" + signature + "&orderid=" + orderid + "&viptype=" + viptype + "&vipid=" + vipid + "&vipval="+vipval + "&apptype=" + apptype
  236. + "&productName="+productName + "&productId=" + productId + "&orderType=" + orderType + "&province=" + URLEncoder.encode(province,"utf-8") + "&area=" + URLEncoder.encode(area,"utf-8");
  237. sendviplog.info("vipurl: " + vipurl);
  238. //第一次直充会员
  239. result = URLUtil.get(vipurl, 30 * 1000); //调赠送会员接口,超时时间设置为10秒
  240. sendviplog.info("直充会员结果=> userid: " + userval + ", spid: " + orderBean.getSpid() + " , result: " + result);
  241. } catch (Exception e) {
  242. e.printStackTrace();
  243. sendviplog.error("userid: " + orderBean.getUserid() + "直充方式赠送会员出现异常," + e, e);
  244. if (e.getMessage() != null && e.getMessage().indexOf("TimeoutException") != -1) {//超时异常
  245. throw new BusinessException("9070", "赠送会员超时", new String[0]);
  246. } else {
  247. throw new BusinessException("9002", "赠送会员未成功," + e.getMessage(), new String[0]);
  248. }
  249. }
  250. return result;
  251. }
  252. /**
  253. * 判断是否要赠送会员
  254. * @param orderBean
  255. * @param confList
  256. * @param orderMap
  257. * @return
  258. */
  259. private boolean valisendvip(OrderBean orderBean, HashMap confMap, HashMap orderMap ) throws Exception{
  260. //是否可以赠送会员
  261. boolean hassend = false;
  262. try {
  263. //复合产品,生成活动关系时是每个子业务一条活动关系,验证的是子产品的SPID,不处理
  264. if (!StringUtils.isEmpty(orderBean.getFhcpid()) && !StringUtils.isEmpty(orderBean.getFhspid())) {
  265. throw new BusinessException("5005", "复合产品不参与赠送会员");
  266. }
  267. //验证开始
  268. String userid = orderBean.getUserid();
  269. String cpid = orderBean.getCpid();
  270. String spid = orderBean.getSpid();
  271. //List<HashMap> confList = orderSendVipDao.qryOrderSendvipAllConf(cpid, spid);
  272. //当前时间
  273. SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
  274. String currtime = sdf.format(new Date()); //当前时间
  275. String orderchannel = orderBean.getOrderchannel();
  276. //手厅传的渠道标识与订购疯关系表不相同
  277. String channel = orderBean.getChannel();
  278. //子渠道标识
  279. String subchannel = orderBean.getSubchannel();
  280. //订购时间
  281. String ordertime = orderMap.get("ORDERTIME").toString();
  282. if(!StringUtils.isEmpty(orderchannel) && !StringUtils.isEmpty(channel)
  283. && !orderchannel.equals(orderMap.get("ORDERCHANNEL"))
  284. && !channel.equals(orderMap.get("ORDERCHANNEL"))){
  285. throw new BusinessException("5005", "渠道与订购关系表的渠道不一致,orderchannel=>"+orderchannel);
  286. }
  287. //赠送允许渠道
  288. String confChannel = confMap.get("CHANNEL").toString().trim();
  289. //活动开始时间
  290. String starttime = (String)confMap.get("STARTTIME");
  291. //活动结束时间
  292. String endtime = (String)confMap.get("ENDTIME");
  293. //会员类型,1走会员领取接口,0走会员直充接口
  294. String sendtype = confMap.get("SENDTYPE").toString().trim();
  295. //配置的子渠道
  296. String subchannelconf = (String)confMap.get("SUBCHANNEL");
  297. //订购渠道与配置渠道相同,或者配置渠道不限制
  298. if (confChannel.equals(orderchannel) || confChannel.equals(channel) || "*".equals(confChannel)
  299. //配置渠道以指定字符开头且订购渠道是以指定渠道开头,芒果16元
  300. || (confChannel.indexOf("*") != -1 && orderchannel != null && orderchannel.indexOf(confChannel.split("\\*")[0]) == 0)
  301. || (confChannel.indexOf("*") != -1 && channel != null && channel.indexOf(confChannel.split("\\*")[0]) == 0)) {
  302. /****
  303. * SENDTYPE会员类型,1走会员领取接口,0走会员直充接口
  304. * 走会员领取接口,有子渠道配置,且SENDTYPE不为1或者主渠道配置为*或者配置的子渠道与订购关系的子渠道不匹配
  305. * 20220325,xu.zhou,赠送配置到子渠道级别
  306. */
  307. if(!StringUtils.isEmpty(subchannelconf) && //有子渠道配置
  308. (
  309. !"1".equals(confMap.get("SENDTYPE")) || //不是领取会员
  310. confChannel.indexOf("*") != -1 || //渠道配置有模糊匹配
  311. !subchannelconf.equals(subchannel) //与订购关系的子渠道不相同
  312. )
  313. ){
  314. //走会员领取接口,有配置限制子渠道,且订购关系表子渠道为空或者子渠道标识与配置的子渠道标识不相同,不自动送会员
  315. throw new BusinessException("5005", "子渠道标识验证未通过,subchannel=>"+subchannel);
  316. }
  317. /**************************判断时间是否合法开始************************/
  318. //开始时间和结束时间都不为空且当前时间包含在两者之间
  319. if (!StringUtils.isEmpty(starttime) && !StringUtils.isEmpty(endtime)
  320. && Long.parseLong(currtime) >= Long.parseLong(starttime.trim())
  321. && Long.parseLong(currtime) <= Long.parseLong(endtime.trim())){
  322. hassend = true;
  323. //开始时间不为空,结束时间为空,当前时间大于或等于开始时间
  324. }else if (!StringUtils.isEmpty(starttime) && StringUtils.isEmpty(endtime)
  325. && Long.parseLong(currtime) >= Long.parseLong(starttime.trim())){
  326. hassend = true;
  327. //开始时间为空,结束时间不为空,当前时间小于或等于结束时间
  328. }else if (StringUtils.isEmpty(starttime) && !StringUtils.isEmpty(endtime)
  329. && Long.parseLong(currtime) <= Long.parseLong(endtime.trim())){
  330. hassend = true;
  331. //开始时间为空且结束时间也为空
  332. }else if (StringUtils.isEmpty(starttime) && StringUtils.isEmpty(endtime)){
  333. hassend = true;
  334. }
  335. if(!hassend){
  336. throw new BusinessException("5005", "时间验证未通过");
  337. }
  338. /**************************判断时间是否合法结束************************/
  339. //如果上面的条件都匹配,再判断是否有订购类型限制,只有走直充的才要判断订购退订限制
  340. if(hassend && "0".equals(sendtype)){
  341. //还原标识为false
  342. hassend = false;
  343. //订购状态,0订购,1退订,*不限制,为空时只允许订购, SENDTYPE为0时有效
  344. String ordertype = (String)confMap.get("ORDERTYPE");
  345. if (StringUtils.isEmpty(ordertype)){//配置为空,只允许订购赠送会员
  346. if("0".equals(orderBean.getOrderType())){ //订购
  347. hassend = true;
  348. }
  349. } else if("*".equals(ordertype)){ //订购退订都允许赠送会员
  350. hassend = true;
  351. } else {//有限制订购或退订赠送会员
  352. if(ordertype.equals(orderBean.getOrderType())){//订购状态与配置相同
  353. hassend = true;
  354. }
  355. }
  356. }if(hassend && "1".equals(sendtype) && !"0".equals(orderBean.getOrderType())){//领取会员、非订购操作
  357. hassend = false;
  358. throw new BusinessException("5005", "只有订购操作的才能领取会员");
  359. }
  360. }else{
  361. throw new BusinessException("5005", "渠道验证未通过");
  362. }
  363. } catch (Exception e) {
  364. if (e instanceof BusinessException) {
  365. sendviplog.info("判断是否赠送会员未通过验证,"+orderBean+", "+confMap+", 原因:"+((BusinessException)e).getMessage());
  366. }else{
  367. e.printStackTrace();
  368. sendviplog.error(orderBean+",判断是否赠送会员出现异常,"+e.getMessage(), e);
  369. throw new BusinessException("8000", "判断是否赠送会员出现异常,"+e.getMessage(), new String[0]);
  370. }
  371. }
  372. return hassend;
  373. }
  374. /**
  375. * 根据赠送配置进行会员赠送
  376. * @param orderBean
  377. * @param confMap //赠送配置
  378. * @param orderMap //订购关系
  379. * @param logMap //日志记录
  380. */
  381. private void sendVipByConf(OrderBean orderBean, HashMap confMap, HashMap orderMap, Map logMap) throws Exception{
  382. HashMap sendResMap = new HashMap();
  383. String resultcode = "-1";
  384. String errorinfo = "";
  385. String sendno = ""; //赠送记录表的ID,用于更新数据
  386. try {
  387. String confid = confMap.get("ID").toString();//配置表ID
  388. sendResMap.put("confid", confid);
  389. String orderchannel = orderBean.getOrderchannel();
  390. //手厅传的渠道标识与订购疯关系表不相同
  391. String channel = orderBean.getChannel();
  392. String subchannel = orderBean.getSubchannel();
  393. long startime = System.currentTimeMillis();
  394. //logMap.put("data", orderBean);
  395. sendno = orderSendVipDao.getNo();
  396. //logMap.put("sendno", sendno);
  397. HashMap<String, String> params = new HashMap<String, String>();
  398. params.put("ID", sendno);
  399. params.put("USERID", orderBean.getUserid());
  400. params.put("CPID", orderBean.getCpid());
  401. params.put("SPID", orderBean.getSpid());
  402. //params.put("SENDMONTH", sendmonth);
  403. params.put("RESULTCODE", "2");
  404. params.put("RESULTINFO", "赠送中");
  405. params.put("ORDERTIME", orderMap.get("ORDERTIME").toString());
  406. //新增配置表ID
  407. params.put("CONFID", confid);
  408. //如果orderchannel为空,取channel
  409. params.put("ORDERCHANNEL", ((orderchannel != null && !"".equals(orderchannel)) ? orderchannel : channel));
  410. params.put("SUBCHANNEL", (!StringUtils.isEmpty(subchannel)) ? subchannel : "");
  411. sendviplog.info("sendVip入库参数=>"+params);
  412. //添加赠送数据到记录表
  413. orderSendVipDao.addSendvipRec(params);
  414. //会员类型,1走会员领取接口,0走会员直充接口
  415. String sendtype = confMap.get("SENDTYPE").toString();
  416. String result = "";
  417. if("0".equals(sendtype)){ //0走会员直充接口
  418. result = invokeVipByZc(orderBean, confMap);
  419. }else if("1".equals(sendtype)){ //1走会员领取接口
  420. result = invokeVip(orderBean);
  421. }
  422. sendResMap.put("result", result);
  423. if (result != null && !"".equals(result)) {
  424. Map<?, ?> map = JsonUtil.jsonToMap(result);
  425. resultcode = (String) map.get("resultcode");
  426. errorinfo = (String) map.get("errorinfo");
  427. }
  428. } catch (Exception e) {
  429. if (e instanceof BusinessException) {
  430. resultcode = ((BusinessException) e).getCode();
  431. errorinfo = e.getMessage();
  432. }else{
  433. e.printStackTrace();
  434. resultcode = "8000";
  435. errorinfo = "赠送会员出现异常,"+e.getMessage();
  436. }
  437. } finally{
  438. try {
  439. //更新赠送会员结果
  440. if (errorinfo != null && errorinfo.length() > 500) {
  441. errorinfo = errorinfo.substring(0, 500);
  442. }
  443. boolean updRes = orderSendVipDao.updatePush(sendno, resultcode, errorinfo);
  444. sendviplog.info("updRes=>" + updRes);
  445. sendResMap.put("updRes", updRes);
  446. } catch (Exception e2) {
  447. // e2.printStackTrace();
  448. errorinfo = "更新领取结果出现异常," + e2.getMessage();
  449. sendviplog.error(sendno+errorinfo,e2);
  450. sendResMap.put("updRes", "更新领取结果出现异常," + e2.getMessage());
  451. }
  452. sendResMap.put("resultcode", resultcode);
  453. sendResMap.put("errorinfo", errorinfo);
  454. if(logMap.get("sendResList") == null){
  455. List sendResList = new ArrayList();
  456. sendResList.add(sendResMap);
  457. logMap.put("sendResList", sendResList);
  458. }else{
  459. List sendResList = (List)logMap.get("sendResList");
  460. sendResList.add(sendResMap);
  461. logMap.put("sendResList", sendResList);
  462. }
  463. }
  464. }
  465. }