|  |  |  | 
|---|
|  |  |  | import cn.emay.sdk.core.dto.sms.response.SmsResponse; | 
|---|
|  |  |  | import com.alibaba.fastjson.JSONObject; | 
|---|
|  |  |  | import com.doumee.biz.system.SystemDictDataBiz; | 
|---|
|  |  |  | import com.doumee.core.constants.ResponseStatus; | 
|---|
|  |  |  | import com.doumee.core.exception.BusinessException; | 
|---|
|  |  |  | import com.doumee.core.haikang.model.HKConstants; | 
|---|
|  |  |  | import com.doumee.core.haikang.model.param.BaseResponse; | 
|---|
|  |  |  | import com.doumee.core.haikang.service.HKService; | 
|---|
|  |  |  | import com.doumee.core.utils.Constants; | 
|---|
|  |  |  | import com.doumee.dao.business.model.InterfaceLog; | 
|---|
|  |  |  | import com.doumee.service.business.InterfaceLogService; | 
|---|
|  |  |  | import org.apache.commons.lang3.StringUtils; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.context.annotation.Lazy; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import javax.annotation.PostConstruct; | 
|---|
|  |  |  | import java.util.Date; | 
|---|
|  |  |  | import java.util.HashMap; | 
|---|
|  |  |  | import java.util.Map; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Service | 
|---|
|  |  |  | public class EmayService { | 
|---|
|  |  |  | 
|---|
|  |  |  | this.client = client; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | @Lazy | 
|---|
|  |  |  | private InterfaceLogService interfaceLogService  ; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | @Lazy | 
|---|
|  |  |  | private SystemDictDataBiz  systemDictDataBiz; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private   void saveInterfaceLog(String path,String name,String req ,String res) { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public  void sendSmsByHk(String phone,String content){ | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | Map<String,Object> map = new HashMap<>(); | 
|---|
|  |  |  | map.put("phoneNo",phone.split(",")); | 
|---|
|  |  |  | map.put("content",content); | 
|---|
|  |  |  | BaseResponse result = HKService.sendSms(map); | 
|---|
|  |  |  | if(result !=null){ | 
|---|
|  |  |  | if(!StringUtils.equals(result.getCode(),HKConstants.RESPONSE_SUCCEE)){ | 
|---|
|  |  |  | throw  new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),result.getMsg()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | throw  new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,短信发送失败,请稍后重试!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | e.printStackTrace(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|