| @@ -262,9 +262,8 @@ public class WxWeappInfoController extends BaseController { | |||
| JSONArray keyidlist = verify_success.getJSONArray("keyword_id_list"); | |||
| String customParam = verify_success.getString("custom_param"); | |||
| logger.info(customParam); | |||
| JSONObject customParamObj = JSON.parseObject(customParam); | |||
| List<Integer> keyArr = getIdList(keyidlist); | |||
| WxMaTemplateAddResult ret = maService.getTemplateService().addTemplate(id, keyArr); | |||
| logger.info(ret.toString()); | |||
| if(appinfo != null) { | |||
| // wx_template_msg | |||
| WxTemplateMsg templateMsgQ = new WxTemplateMsg(); | |||
| @@ -272,12 +271,13 @@ public class WxWeappInfoController extends BaseController { | |||
| templateMsgQ.setType(EnumTemplateType.VERIFY_SUCCESS.getCode()); | |||
| WxTemplateMsg templateMsg = templateMsgService.getByObj(templateMsgQ); | |||
| if(templateMsg != null) { | |||
| templateMsg.setTemplateId(ret.getTemplateId()); | |||
| templateMsg.setCustomParam(customParam); | |||
| templateMsg.setCustomParam(customParamObj.toJSONString()); | |||
| templateMsgService.saveOrUpdate(templateMsg); | |||
| } else { | |||
| WxMaTemplateAddResult ret = maService.getTemplateService().addTemplate(id, keyArr); | |||
| logger.info(ret.toString()); | |||
| templateMsgQ.setTemplateId(ret.getTemplateId()); | |||
| templateMsgQ.setCustomParam(customParam); | |||
| templateMsgQ.setCustomParam(customParamObj.toJSONString()); | |||
| templateMsgService.saveOrUpdate(templateMsgQ); | |||
| } | |||
| } | |||
| @@ -287,9 +287,8 @@ public class WxWeappInfoController extends BaseController { | |||
| keyidlist = verify_fail.getJSONArray("keyword_id_list"); | |||
| customParam = verify_fail.getString("custom_param"); | |||
| logger.info(customParam); | |||
| customParamObj = JSON.parseObject(customParam); | |||
| List<Integer> keyArr1 = getIdList(keyidlist); | |||
| ret = maService.getTemplateService().addTemplate(id, keyArr1); | |||
| logger.info(ret.toString()); | |||
| if(appinfo != null) { | |||
| // wx_template_msg | |||
| WxTemplateMsg templateMsgQ = new WxTemplateMsg(); | |||
| @@ -297,12 +296,13 @@ public class WxWeappInfoController extends BaseController { | |||
| templateMsgQ.setType(EnumTemplateType.VERIFY_FAIL.getCode()); | |||
| WxTemplateMsg templateMsg = templateMsgService.getByObj(templateMsgQ); | |||
| if(templateMsg != null) { | |||
| templateMsg.setTemplateId(ret.getTemplateId()); | |||
| templateMsg.setCustomParam(customParam); | |||
| templateMsg.setCustomParam(customParamObj.toJSONString()); | |||
| templateMsgService.saveOrUpdate(templateMsg); | |||
| } else { | |||
| WxMaTemplateAddResult ret = maService.getTemplateService().addTemplate(id, keyArr1); | |||
| logger.info(ret.toString()); | |||
| templateMsgQ.setTemplateId(ret.getTemplateId()); | |||
| templateMsgQ.setCustomParam(customParam); | |||
| templateMsgQ.setCustomParam(customParamObj.toJSONString()); | |||
| templateMsgService.saveOrUpdate(templateMsgQ); | |||
| } | |||
| } | |||
| @@ -313,9 +313,9 @@ public class WxWeappInfoController extends BaseController { | |||
| keyidlist = press_success.getJSONArray("keyword_id_list"); | |||
| customParam = press_success.getString("custom_param"); | |||
| logger.info(customParam); | |||
| customParamObj = JSON.parseObject(customParam); | |||
| List<Integer> keyArr2 = getIdList(keyidlist); | |||
| ret = maService.getTemplateService().addTemplate(id, keyArr2); | |||
| logger.info(ret.toString()); | |||
| if(appinfo != null) { | |||
| // wx_template_msg | |||
| WxTemplateMsg templateMsgQ = new WxTemplateMsg(); | |||
| @@ -323,12 +323,13 @@ public class WxWeappInfoController extends BaseController { | |||
| templateMsgQ.setType(EnumTemplateType.PRESS_SUCCESS.getCode()); | |||
| WxTemplateMsg templateMsg = templateMsgService.getByObj(templateMsgQ); | |||
| if(templateMsg != null) { | |||
| templateMsg.setTemplateId(ret.getTemplateId()); | |||
| templateMsg.setCustomParam(customParam); | |||
| templateMsg.setCustomParam(customParamObj.toJSONString()); | |||
| templateMsgService.saveOrUpdate(templateMsg); | |||
| } else { | |||
| WxMaTemplateAddResult ret = maService.getTemplateService().addTemplate(id, keyArr2); | |||
| logger.info(ret.toString()); | |||
| templateMsgQ.setTemplateId(ret.getTemplateId()); | |||
| templateMsgQ.setCustomParam(customParam); | |||
| templateMsgQ.setCustomParam(customParamObj.toJSONString()); | |||
| templateMsgService.saveOrUpdate(templateMsgQ); | |||
| } | |||
| } | |||