Commit 85f20b69 by 伍思炜

预制卡下单反馈异常修复

parent 7583a635
......@@ -125,23 +125,23 @@ public class GetPhoneCodeController extends BaseController {
sent.put("code", 200);
try {
if (username.equals("admin")) {
sent.put("message", "操作成功");
sent.put("message", "");
//sent.put("code", 200);
} else {
if (user.getPhone().length() == 11) {
saveAuthCodeUtil.saveAuthCode(user.getPhone(), verificationCode); //临时保存数据库
SendSmsAndMail.sendSms(user.getPhone(), verificationCode, "", "7");
sent.put("message", "操作成功");
sent.put("message", "");
//sent.put("code", 200);
} else {
log.info("当前用户手机号码不合法!");
sent.put("message", "操作成功");
sent.put("message", "");
}
}
} catch (Exception e) {
log.info("错误信息:{}", e.getMessage());
sent.put("code", 400);
sent.put("message", "手机短信发送失败");
sent.put("message", "系统出现异常请联系管理员");
}
return sent;
......
......@@ -321,6 +321,6 @@ public class sendSms {
@Test
public void send() throws Exception {
System.out.println(intelligenceSendOrders.queryStatus("220118142900fuqyug2w"));
System.out.println(intelligenceSendOrders.queryStatus("220210115950awrtwart"));
}
}
......@@ -27,14 +27,15 @@ import com.winsun.smsUtils.SendSmsAndMail;
import com.winsun.utils.Constant;
import com.winsun.utils.*;
import com.winsun.utils.ExportExcel;
import kong.unirest.HttpResponse;
import kong.unirest.Unirest;
import kong.unirest.UnirestParsingException;
import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
......@@ -339,21 +340,27 @@ public class OrderController extends BaseController {
map1.put("address", order.getAddress());
String result = "";
// 发送智能平台参数
result = sendOrder(map1);
HttpResponse<String> result = sendOrder(map1);
JSONObject resultDataJson = JSONObject.fromObject(result);
//String orderNum = resultDataJson.getString("orderNum");
String orderNum = resultDataJson.getString("orderNumber");
Order updateOrder = new Order();
updateOrder.setId(order.getId());
order.setUpdateTime(new Date());
if (result.getStatus() != 200){
updateOrder.setOrderStatus("待处理");
updateOrder.setMsg(result.getBody());
orderMapper.updateById(updateOrder);
}
//JSONObject resultDataJson = JSONObject.fromObject(result);
//String orderNum = resultDataJson.getString("orderNum");
String orderNum = result.getBody();
if (Is.isNoEmpty(orderNum)) {
updateOrder.setOrderStatus("审核中");
updateOrder.setOrderId(orderNum);
} else {
updateOrder.setOrderStatus("异常单");
String msg = resultDataJson.getString("msg");
String msg = result.getParsingError().toString();
updateOrder.setMsg(msg);
try {
// 添加操作记录
......@@ -1809,21 +1816,27 @@ public class OrderController extends BaseController {
map1.put("address", orderData.getAddress());
String result = "";
result = sendOrder(map1);
HttpResponse<String> result = sendOrder(map1);
JSONObject resultDataJson = JSONObject.fromObject(result);
String orderNum = resultDataJson.getString("orderNum");
Order order = new Order();
order.setId(id);
order.setId(order.getId());
order.setUpdateTime(new Date());
if (result.getStatus() != 200){
order.setOrderStatus("待处理");
order.setMsg(result.getBody());
orderMapper.updateById(order);
}
//JSONObject resultDataJson = JSONObject.fromObject(result);
//String orderNum = resultDataJson.getString("orderNum");
String orderNum = result.getBody();
if (Is.isNoEmpty(orderNum)) {
order.setSendType("快递");
order.setOrderStatus("审核中");
order.setOrderId(orderNum);
} else {
order.setOrderStatus("异常单");
String msg = resultDataJson.getString("msg");
String msg = result.getParsingError().toString();
order.setMsg(msg);
try {
orderMapper.inserOrderHis(id, "审核失败", new Date(), "智能平台审核");
......@@ -2216,9 +2229,9 @@ public class OrderController extends BaseController {
}
// 预实名接口发起
public String sendOrder(Map<String, Object> map) {
public kong.unirest.HttpResponse<String> sendOrder(Map<String, Object> map) {
String str = "";
kong.unirest.HttpResponse<String> response = null;
try {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmssSSS");
......@@ -2243,13 +2256,13 @@ public class OrderController extends BaseController {
map.put("imgUrl3", (String) map.get("idCardUrl3"));
map.put("imgUrl4", (String) map.get("idCardUrl4"));
//str = sendAitransOrder(map, 0);
kong.unirest.HttpResponse<String> response = sendAitransOrder(map, 0);
str = response.getBody();
response = sendAitransOrder(map, 0);
//str = response.getBody();
} catch (Exception e) {
e.printStackTrace();
}
return str;
return response;
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment