rk
17 小时以前 931e45f5f78494c7af4cab75053da49b57f22fbe
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/third/EmayService.java
@@ -6,15 +6,23 @@
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 {
@@ -89,4 +97,24 @@
   }
   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();
      }
   }
}