Commit 33fd03e7 by levphon

工单标准接口-短信异步修改

1 parent 7c387159
package cn.com.glsx.stdinterface.modules.service;
import cn.com.glsx.stdinterface.common.exception.StdInterfaceException;
import cn.com.glsx.stdinterface.modules.util.RopHttpUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
......@@ -34,6 +34,7 @@ public class MessageService {
* @param type 类型
* @param context 发送内容
*/
@Async
public void sendMessage(String phone, String source, String type, String context) {
MultiValueMap<String, String> params = new LinkedMultiValueMap<>(4);
try {
......@@ -46,10 +47,14 @@ public class MessageService {
log.info("发送短信结果{}", post);
} catch (Exception e) {
e.printStackTrace();
log.info("发送短信异常,{}", e.getMessage());
throw new StdInterfaceException("4444444", e.getMessage());
log.error("发送短信到{}异常,{}", phone, e.getMessage());
//throw new StdInterfaceException("444444", e.getMessage());
}
}
public static void main(String[] args) {
MessageService messageService = new MessageService();
messageService.sendMessage("18682185876", "eshield_workOrder_warm", "1", "this is a test!");
}
}
......@@ -41,7 +41,6 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -1285,7 +1284,6 @@ public class WorkOrderService {
* @param workOrder
* @param vehicle
*/
@Async
public void finishedNotifyTarget(WorkOrder workOrder, Vehicle vehicle) {
String receiveNumbers = workOrder.getNotifyTarget();
if (StringUtils.isNullOrEmpty(receiveNumbers)) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!