|
|
@ -21,16 +21,21 @@ import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.enums.EnvEnum; |
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.commons.tools.exception.ValidateException; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.utils.HttpClientManager; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
|
|
|
import com.epmet.constant.WxmpMessageConstant; |
|
|
|
import com.epmet.dao.WxmpResiUserSubscribeDao; |
|
|
|
import com.epmet.dao.WxmpTemplateMsgSubscribeStatusDao; |
|
|
|
import com.epmet.dao.WxmpWorkUserSubscribeDao; |
|
|
|
import com.epmet.dto.form.GetTemplateListFormDTO; |
|
|
|
import com.epmet.dto.form.StaffBasicInfoFormDTO; |
|
|
|
import com.epmet.dto.form.UserBasicInfoFormDTO; |
|
|
|
import com.epmet.dto.form.WxSubscribeMessageFormDTO; |
|
|
|
import com.epmet.dto.result.GetTemplateListResultDTO; |
|
|
|
import com.epmet.entity.WxmpMsgSendRecordEntity; |
|
|
|
import com.epmet.entity.WxmpTemplateMsgSubscribeStatusEntity; |
|
|
|
import com.epmet.exception.WxSubscribeException; |
|
|
@ -288,4 +293,30 @@ public class WxmpMessageServiceImpl implements WxmpMessageService { |
|
|
|
wxmpMsgSendRecordEntity.setResult(status); |
|
|
|
return wxmpMsgSendRecordEntity; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return |
|
|
|
* @Description 居民端、工作端-获取客户小程序模板列表 |
|
|
|
* @author sun |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<GetTemplateListResultDTO> templateList(GetTemplateListFormDTO formDTO) { |
|
|
|
GetTemplateListFormDTO dto = ConvertUtils.sourceToTarget(formDTO, GetTemplateListFormDTO.class); |
|
|
|
String url = "https://epmet-cloud.elinkservice.cn/api/third/personaltemplate/templatelist"; |
|
|
|
//String url = "http://localhost:8080/api/third/personaltemplate/templatelist";
|
|
|
|
String data = HttpClientManager.getInstance().sendPostByJSON(url, JSON.toJSONString(dto)).getData(); |
|
|
|
logger.info("ThirdLoginServiceImpl.getUserWeChat:httpclient->url:"+url+",结果->"+data); |
|
|
|
JSONObject toResult = JSON.parseObject(data); |
|
|
|
Result mapToResult = ConvertUtils.mapToEntity(toResult, Result.class); |
|
|
|
if (null != toResult.get("code")) { |
|
|
|
mapToResult.setCode(((Integer) toResult.get("code")).intValue()); |
|
|
|
} |
|
|
|
if (!mapToResult.success()) { |
|
|
|
logger.error("调用epmet_third服务获取小程序消息订阅模板数据失败"); |
|
|
|
throw new RenException(mapToResult.getCode()); |
|
|
|
} |
|
|
|
List<GetTemplateListResultDTO> resultList = (List<GetTemplateListResultDTO>) mapToResult.getData(); |
|
|
|
return resultList; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|