Commit c16ecb8c by 伍思炜

临时提交,修改智能平台

parent c6a6c89c
...@@ -4,13 +4,13 @@ import com.alibaba.fastjson.JSONArray; ...@@ -4,13 +4,13 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper; import com.baomidou.mybatisplus.mapper.Wrapper;
import com.winsun.outSideSystem.IntelligenceSendOrders;
import com.winsun.utils.CheckPwd; import com.winsun.utils.CheckPwd;
import com.winsun.auth.core.common.model.ResponseData; import com.winsun.auth.core.common.model.ResponseData;
import com.winsun.bean.*; import com.winsun.bean.*;
import com.winsun.constant.Constant; import com.winsun.constant.Constant;
import com.winsun.constant.OrderStatus; import com.winsun.constant.OrderStatus;
import com.winsun.mapper.*; import com.winsun.mapper.*;
import com.winsun.outSideSystem.IntelligenceSendOrder;
import com.winsun.utils.*; import com.winsun.utils.*;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -78,7 +78,7 @@ public class DankuanController { ...@@ -78,7 +78,7 @@ public class DankuanController {
@Autowired @Autowired
private IntelligenceSendOrder intelligenceSendOrder; private IntelligenceSendOrders intelligenceSendOrders;
@Autowired @Autowired
private RegularMapper regularMapper; private RegularMapper regularMapper;
...@@ -251,7 +251,7 @@ public class DankuanController { ...@@ -251,7 +251,7 @@ public class DankuanController {
if (webOrderAmount.equals("0") || product.getProductIntroductionPic3().equals("1")) { if (webOrderAmount.equals("0") || product.getProductIntroductionPic3().equals("1")) {
res = createOrder(productId, orderView, partner, filePath, "未下单", sell); res = createOrder(productId, orderView, partner, filePath, "未下单", sell);
Map<String, Object> map = orderMapper.selectKdOrder(orderSeq); Map<String, Object> map = orderMapper.selectKdOrder(orderSeq);
intelligenceSendOrder.singleBroadSendOrder(map); intelligenceSendOrders.singleBroadSendOrder(map);
Order order = (Order) res.getData(); Order order = (Order) res.getData();
orderV.setOrderRf2(order.getId()); orderV.setOrderRf2(order.getId());
} else { } else {
...@@ -402,7 +402,7 @@ public class DankuanController { ...@@ -402,7 +402,7 @@ public class DankuanController {
log.info("------------单宽提交智能平台--------------"); log.info("------------单宽提交智能平台--------------");
// 提交智能平台 // 提交智能平台
log.info(JSONObject.toJSONString(stringObjectMap)); log.info(JSONObject.toJSONString(stringObjectMap));
intelligenceSendOrder.singleBroadSendOrder(stringObjectMap); intelligenceSendOrders.singleBroadSendOrder(stringObjectMap);
} }
} }
......
...@@ -760,7 +760,7 @@ public class RongHeController { ...@@ -760,7 +760,7 @@ public class RongHeController {
* @version 1.0 * @version 1.0
* @exception: * @exception:
*/ */
private static JSONObject getOrderInfo(Map<String, Object> schoolMap, OrderView orderView, String currentTimeStr, String productId, String saleId1, String saleId2, String ORDERSEQ, String UPTRANSEQ, String ORDERAMOUNT, String ORDERREQTRANSEQ) throws Exception { /* private static JSONObject getOrderInfo(Map<String, Object> schoolMap, OrderView orderView, String currentTimeStr, String productId, String saleId1, String saleId2, String ORDERSEQ, String UPTRANSEQ, String ORDERAMOUNT, String ORDERREQTRANSEQ) throws Exception {
List<NameValuePair> qParams = new ArrayList<NameValuePair>(); List<NameValuePair> qParams = new ArrayList<NameValuePair>();
RequestConfig defaultRequestConfig = RequestConfig.custom().setSocketTimeout(500000) RequestConfig defaultRequestConfig = RequestConfig.custom().setSocketTimeout(500000)
.setConnectTimeout(500000).setConnectionRequestTimeout(500000).build(); .setConnectTimeout(500000).setConnectionRequestTimeout(500000).build();
...@@ -787,10 +787,10 @@ public class RongHeController { ...@@ -787,10 +787,10 @@ public class RongHeController {
qParams.add(new BasicNameValuePair("transactType", "新宽旧移"));// 办理类型,必填[新宽新移][新宽旧移][旧宽新移][旧宽旧移] qParams.add(new BasicNameValuePair("transactType", "新宽旧移"));// 办理类型,必填[新宽新移][新宽旧移][旧宽新移][旧宽旧移]
signMap.put("transactType", "新宽旧移"); signMap.put("transactType", "新宽旧移");
/* */ *//* *//*
qParams.add(new BasicNameValuePair("ctNumber", orderView.getOrderPhone()));// 电信号码,办理类型,若选择[新宽旧移]或[旧宽旧移],此项必填 qParams.add(new BasicNameValuePair("ctNumber", orderView.getOrderPhone()));// 电信号码,办理类型,若选择[新宽旧移]或[旧宽旧移],此项必填
signMap.put("ctNumber", orderView.getOrderPhone()); signMap.put("ctNumber", orderView.getOrderPhone());
/* */ *//* *//*
qParams.add(new BasicNameValuePair("addressProvince", "广东省"));// 报装地址-省 办理类型,若选择[新宽新移][新宽旧移],此项必填 qParams.add(new BasicNameValuePair("addressProvince", "广东省"));// 报装地址-省 办理类型,若选择[新宽新移][新宽旧移],此项必填
signMap.put("addressProvince", "广东省"); signMap.put("addressProvince", "广东省");
...@@ -1122,7 +1122,7 @@ public class RongHeController { ...@@ -1122,7 +1122,7 @@ public class RongHeController {
httpPost.releaseConnection(); httpPost.releaseConnection();
} }
return resultDataJson; return resultDataJson;
} }*/
} }
...@@ -8,6 +8,7 @@ import com.winsun.bean.*; ...@@ -8,6 +8,7 @@ import com.winsun.bean.*;
import com.winsun.constant.OrderStatus; import com.winsun.constant.OrderStatus;
import com.winsun.mapper.*; import com.winsun.mapper.*;
import com.winsun.outSideSystem.IntelligenceSendOrder; import com.winsun.outSideSystem.IntelligenceSendOrder;
import com.winsun.outSideSystem.IntelligenceSendOrders;
import com.winsun.smsUtils.SendSmsAndMail; import com.winsun.smsUtils.SendSmsAndMail;
import com.winsun.utils.PicturesUtil; import com.winsun.utils.PicturesUtil;
import com.winsun.utils.RandomUtil; import com.winsun.utils.RandomUtil;
...@@ -60,6 +61,8 @@ public class SingleBroadToIntegrateController { ...@@ -60,6 +61,8 @@ public class SingleBroadToIntegrateController {
@Autowired @Autowired
private IntelligenceSendOrder intelligenceSendOrder; private IntelligenceSendOrder intelligenceSendOrder;
@Autowired
private IntelligenceSendOrders intelligenceSendOrders;
/** /**
* 查询订单信息 * 查询订单信息
...@@ -346,9 +349,11 @@ public class SingleBroadToIntegrateController { ...@@ -346,9 +349,11 @@ public class SingleBroadToIntegrateController {
if (toIntegrateOrderParam.getRhTime() == null || StringUtils.isBlank(toIntegrateOrderParam.getRhTime())) { if (toIntegrateOrderParam.getRhTime() == null || StringUtils.isBlank(toIntegrateOrderParam.getRhTime())) {
Wrapper<Order> wrapper = new EntityWrapper<>(); Wrapper<Order> wrapper = new EntityWrapper<>();
wrapper.eq("id", uuid); wrapper.eq("id", uuid);
//Map<String, Object> orderMap = orderMapper.selectForId(order.getId());
new Thread(() -> { new Thread(() -> {
try { try {
intelligenceSendOrder.integrateSendOrder(order, true); intelligenceSendOrder.integrateSendOrder(order, true);
//intelligenceSendOrders.integrateSendOrder(orderMap, true);
}catch(Exception e) { }catch(Exception e) {
e.printStackTrace(); e.printStackTrace();
log.info("融合下单失败!"); log.info("融合下单失败!");
......
package com.winsun.controller;
import com.alibaba.druid.support.json.JSONUtils;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.winsun.bean.AttributeList;
import com.winsun.bean.Order;
import com.winsun.constant.Constant;
import com.winsun.mapper.OrderMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
public class TestController {
@Autowired
private OrderMapper orderMapper;
@RequestMapping(value = "testPost", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ResponseBody
public String testPost(@RequestBody JSONObject requestBean) {
Order order = new Order();
order.setOrderId((String) requestBean.get("orderId"));
order = orderMapper.selectOne(order);
Map<Object, Object> imgUrlMap = new HashMap<>();
imgUrlMap.put("身份证正面", order.getIdCardz() != null ? Constant.SYSTEMURL + order.getIdCardz().replace("manager", "app") : "");
imgUrlMap.put("身份证反面", order.getIdCardf() != null ? Constant.SYSTEMURL + order.getIdCardf().replace("manager", "app") : "");
imgUrlMap.put("手持身份证", order.getIdCardzs() != null ? Constant.SYSTEMURL + order.getIdCardzs().replace("manager", "app") : "null");
imgUrlMap.put("学生证", order.getStudenCard() != null ? Constant.SYSTEMURL + order.getStudenCard().replace("manager", "app") : "");
String imgUrlJSON = JSONUtils.toJSONString(imgUrlMap);
return imgUrlJSON;
}
}
\ No newline at end of file
...@@ -120,9 +120,17 @@ spring: ...@@ -120,9 +120,17 @@ spring:
exprie: 600 exprie: 600
prohibition: 600 prohibition: 600
datasource: datasource:
url: jdbc:mysql://172.18.101.171:3306/school_center?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true #url: jdbc:mysql://172.18.101.171:3306/school_center?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true
username: yzzx url: jdbc:mysql://localhost:3306/school_center?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true
password: yzzx123!@# #username: yzzx
username: root
#password: yzzx123!@#
password: root
druid:
WebStatFilter:
enabled: false
StatViewServlet:
enabled: false
dynamic: dynamic:
primary: master primary: master
p6spy: true p6spy: true
......
...@@ -95,12 +95,15 @@ spring: ...@@ -95,12 +95,15 @@ spring:
prohibition: 600 prohibition: 600
datasource: datasource:
# 由于父框架的问题,这里本来不应该这样写的 # 由于父框架的问题,这里本来不应该这样写的
url: jdbc:mysql://172.18.101.171:3306/school_center?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true #url: jdbc:mysql://172.18.101.171:3306/school_center?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true
username: yzzx url: jdbc:mysql://localhost:3306/school_center?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true
password: yzzx123!@# #username: yzzx
username: root
#password: yzzx123!@#
password: root
db-name: guns #用来搜集数据库的所有表 db-name: guns #用来搜集数据库的所有表
filters: wall,mergeStat filters: wall,mergeStat
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.jdbc.Driver
max-active: 20 max-active: 20
dynamic: dynamic:
primary: master primary: master
......
...@@ -2,7 +2,6 @@ package com.winsun.user; ...@@ -2,7 +2,6 @@ package com.winsun.user;
import com.winsun.base.AppApplicationBaseIT; import com.winsun.base.AppApplicationBaseIT;
import com.winsun.item.modular.system.dao.UserMapper; import com.winsun.item.modular.system.dao.UserMapper;
import com.winsun.outSideSystem.IntelligenceSendOrder;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.junit.Test; import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -18,8 +17,8 @@ public class UserTestHelper extends AppApplicationBaseIT { ...@@ -18,8 +17,8 @@ public class UserTestHelper extends AppApplicationBaseIT {
@Autowired @Autowired
private UserMapper mapper; private UserMapper mapper;
@Autowired /*@Autowired
private IntelligenceSendOrder intelligenceSendOrder; private IntelligenceSendOrder intelligenceSendOrder;*/
@Test @Test
public void decryptPwd() { public void decryptPwd() {
// final String account = "18028801118"; // final String account = "18028801118";
......
...@@ -34,6 +34,14 @@ spring: ...@@ -34,6 +34,14 @@ spring:
password: yzzx123!@# password: yzzx123!@#
# username: ENC(z8WG0Zar99IzLr3L9Z3mOw==) # username: ENC(z8WG0Zar99IzLr3L9Z3mOw==)
# password: ENC(r4U47DSf9LNRyoH/G6GxfA2w1JTZOwr7MREDyGA0PWM=) # password: ENC(r4U47DSf9LNRyoH/G6GxfA2w1JTZOwr7MREDyGA0PWM=)
# druid:
# stat-view-servlet:
# enabled: false
# web-stat-filter:
# enabled: false
# filter:
# config:
# enabled: false
zuul: zuul:
ribbon: ribbon:
eager-load: eager-load:
......
...@@ -406,6 +406,10 @@ public class PackageNewClothes { ...@@ -406,6 +406,10 @@ public class PackageNewClothes {
return ResponseData.error("您的身份证输入有误,请重新输入!"); return ResponseData.error("您的身份证输入有误,请重新输入!");
} }
if (StringUtils.isBlank(cardAddress)) {
return ResponseData.error("身份证地址不能为空");
}
/** /**
* 详细地址验证 * 详细地址验证
*/ */
......
...@@ -123,6 +123,11 @@ spring: ...@@ -123,6 +123,11 @@ spring:
exprie: 600 exprie: 600
prohibition: 600 prohibition: 600
datasource: datasource:
druid:
WebStatFilter:
enabled: false
StatViewServlet:
enabled: false
dynamic: dynamic:
primary: master primary: master
p6spy: true p6spy: true
...@@ -131,9 +136,12 @@ spring: ...@@ -131,9 +136,12 @@ spring:
max-active: 30 max-active: 30
datasource: datasource:
master: master:
url: jdbc:mysql://172.18.101.171:3306/school_center?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true #url: jdbc:mysql://172.18.101.171:3306/school_center?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true
username: yzzx url: jdbc:mysql://localhost:3306/school_center?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true
password: yzzx123!@# #username: yzzx
username: root
#password: yzzx123!@#
password: root
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
devtools: devtools:
restart: restart:
......
...@@ -120,6 +120,11 @@ spring: ...@@ -120,6 +120,11 @@ spring:
exprie: 600 exprie: 600
prohibition: 600 prohibition: 600
datasource: datasource:
druid:
WebStatFilter:
enabled: false
StatViewServlet:
enabled: false
dynamic: dynamic:
primary: master primary: master
p6spy: true p6spy: true
...@@ -128,9 +133,12 @@ spring: ...@@ -128,9 +133,12 @@ spring:
max-active: 30 max-active: 30
datasource: datasource:
master: master:
url: jdbc:mysql://172.18.101.171:3306/school_center?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true #url: jdbc:mysql://172.18.101.171:3306/school_center?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true
username: yzzx url: jdbc:mysql://localhost:3306/school_center?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true
password: yzzx123!@# #username: yzzx
username: root
#password: yzzx123!@#
password: root
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
devtools: devtools:
restart: restart:
......
...@@ -27,7 +27,7 @@ public class ImgController { ...@@ -27,7 +27,7 @@ public class ImgController {
request.getServletPath(); request.getServletPath();
String imgurl= FilePath.BACKGROUNDIMG.getValue()+"/"+request.getServletPath(); String imgurl= FilePath.BACKGROUNDIMG.getValue()+"/"+request.getServletPath();
imgurl = imgurl.replace("//", "/"); imgurl = imgurl.replace("//", "/");
File file = new File(imgurl); File file = new File(imgurl);
FileInputStream inputStream = null; FileInputStream inputStream = null;
try { try {
......
...@@ -27,6 +27,7 @@ import com.winsun.smsUtils.SendSmsAndMail; ...@@ -27,6 +27,7 @@ import com.winsun.smsUtils.SendSmsAndMail;
import com.winsun.utils.Constant; import com.winsun.utils.Constant;
import com.winsun.utils.*; import com.winsun.utils.*;
import com.winsun.utils.ExportExcel; import com.winsun.utils.ExportExcel;
import kong.unirest.Unirest;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONArray; import net.sf.json.JSONArray;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
...@@ -56,6 +57,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -56,6 +57,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.ResourceAccessException; import org.springframework.web.client.ResourceAccessException;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import sun.misc.BASE64Encoder;
import javax.net.ssl.SSLHandshakeException; import javax.net.ssl.SSLHandshakeException;
import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
...@@ -83,6 +85,15 @@ public class OrderController extends BaseController { ...@@ -83,6 +85,15 @@ public class OrderController extends BaseController {
private final String GATEWAY = "http://localhost:10001/"; private final String GATEWAY = "http://localhost:10001/";
final String publicKey =
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAok8DnvM2OBwtzNoJb4nA" +
"jn4lgCkSxLyRw5lLiUfsi+40h00CGAC1arvbinTTbtrSnm4YDYlaJwveiOeDKdk0" +
"f2Yglb/8loEbNTqb1OqNxUeM1wYLRBXvAkkZ5fZllajWzFMkoNU/JQ4+T8sMATxm" +
"1d1XRcgM6zlgVwX6siDoLZ5Dm23CTS7SXhyMLtS9cgLefHcOckPQyXoB/IJqb0K1" +
"P0Sk0PE1OSRzpsI9JVzhsSW164fwYpxEbygj9O9JAmAszixwItt2j5zLJ6zRnK3R" +
"OrcAVMN/vpXTN2dCLGZXQrsTK9sAWASzIWTiQRzmnwxsQY7y4u2h+k41n8Z5tw03" +
"wwIDAQAB";
/** /**
* 导入 * 导入
*/ */
...@@ -319,6 +330,7 @@ public class OrderController extends BaseController { ...@@ -319,6 +330,7 @@ public class OrderController extends BaseController {
result = sendOrder(map1); result = sendOrder(map1);
JSONObject resultDataJson = JSONObject.fromObject(result); JSONObject resultDataJson = JSONObject.fromObject(result);
//String orderNum = resultDataJson.getString("orderNum");
String orderNum = resultDataJson.getString("orderNumber"); String orderNum = resultDataJson.getString("orderNumber");
Order updateOrder = new Order(); Order updateOrder = new Order();
updateOrder.setId(order.getId()); updateOrder.setId(order.getId());
...@@ -1774,7 +1786,7 @@ public class OrderController extends BaseController { ...@@ -1774,7 +1786,7 @@ public class OrderController extends BaseController {
result = sendOrder(map1); result = sendOrder(map1);
JSONObject resultDataJson = JSONObject.fromObject(result); JSONObject resultDataJson = JSONObject.fromObject(result);
String orderNum = resultDataJson.getString("orderNumber"); String orderNum = resultDataJson.getString("orderNum");
Order order = new Order(); Order order = new Order();
order.setId(id); order.setId(id);
order.setUpdateTime(new Date()); order.setUpdateTime(new Date());
...@@ -2204,7 +2216,7 @@ public class OrderController extends BaseController { ...@@ -2204,7 +2216,7 @@ public class OrderController extends BaseController {
map.put("imgUrl3", (String) map.get("idCardUrl3")); map.put("imgUrl3", (String) map.get("idCardUrl3"));
map.put("imgUrl4", (String) map.get("idCardUrl4")); map.put("imgUrl4", (String) map.get("idCardUrl4"));
str = sendAitransOrder(map, 0); str = sendAitransOrder(map, 0);
//ResponseEntity<String> response = sendAitransOrder2(map, 0); //kong.unirest.HttpResponse<String> response = sendAitransOrder2(map, 0);
//str = response.getBody(); //str = response.getBody();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
...@@ -2213,8 +2225,14 @@ public class OrderController extends BaseController { ...@@ -2213,8 +2225,14 @@ public class OrderController extends BaseController {
return str; return str;
} }
/**
* @param map
* @param count
* @return
* @throws Exception
*/
// 保存卡品认证信息 // 保存卡品认证信息
public ResponseEntity<String> sendAitransOrder2(Map<String, Object> map, int count) throws NoSuchAlgorithmException, UnsupportedEncodingException { public kong.unirest.HttpResponse<String> sendAitransOrder2(Map<String, Object> map, int count) throws Exception {
log.info("移动下单前已有参数:" + JSONObject.fromObject(map).toString()); log.info("移动下单前已有参数:" + JSONObject.fromObject(map).toString());
Map<String, String> return_data = new HashMap<>(); Map<String, String> return_data = new HashMap<>();
return_data.put("code", ""); return_data.put("code", "");
...@@ -2234,6 +2252,10 @@ public class OrderController extends BaseController { ...@@ -2234,6 +2252,10 @@ public class OrderController extends BaseController {
attachment.put("身份证照4", map.get("imgUrl4")); attachment.put("身份证照4", map.get("imgUrl4"));
order_data.put("附件", attachment); order_data.put("附件", attachment);
order_data.put("代理商账号", "hyoujian");
order_data.put("使用人姓名", "黄友健");
order_data.put("使用人证件号", "440802199006080830");
Map<String, Object> customerInformation = new HashMap<>(); //客户信息 Map<String, Object> customerInformation = new HashMap<>(); //客户信息
customerInformation.put("联系人", (String) map.get("userName")); customerInformation.put("联系人", (String) map.get("userName"));
customerInformation.put("客户证件号码", (String) map.get("idCard")); customerInformation.put("客户证件号码", (String) map.get("idCard"));
...@@ -2259,7 +2281,7 @@ public class OrderController extends BaseController { ...@@ -2259,7 +2281,7 @@ public class OrderController extends BaseController {
invoiceInformation.put("电子邮箱", ""); //若发票投递方式为不需要,可以不填值,但必须有参数 invoiceInformation.put("电子邮箱", ""); //若发票投递方式为不需要,可以不填值,但必须有参数
order_data.put("发票信息", invoiceInformation); order_data.put("发票信息", invoiceInformation);
order_data.put("接口下单账号", "xyzx"); //接口下单账号 order_data.put("接口下单账号", "xiaoyuan"); //接口下单账号
HashMap<String, Object> orderingProducts = new HashMap<>(); //订购产品 HashMap<String, Object> orderingProducts = new HashMap<>(); //订购产品
orderingProducts.put("产品SKU", ""); orderingProducts.put("产品SKU", "");
...@@ -2308,28 +2330,32 @@ public class OrderController extends BaseController { ...@@ -2308,28 +2330,32 @@ public class OrderController extends BaseController {
String order_dataJSON = com.alibaba.fastjson.JSONObject.toJSONString(order_data); String order_dataJSON = com.alibaba.fastjson.JSONObject.toJSONString(order_data);
ResponseEntity<String> responese = null; // 获得md5串
String sign = MD5Util.MD5Encode(order_dataJSON, "Utf-8");
// 获得小写md5串
sign = sign.toLowerCase();
// RSA加密
byte[] encodedData = RSAUtils.encryptByPublicKey(sign, publicKey);
sign = (new BASE64Encoder()).encodeBuffer(encodedData);
//去除换行
sign = sign.replaceAll("\\r|\\n", "");
log.info("移动下单接口中的携带的签名:" + sign);
kong.unirest.HttpResponse<String> responese = null;
try { try {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
headers.add("Content-Type", "application/json;charset=utf-8");
//签名
/*
headers.add("Hmac", znptSignUtils.macSHA1(order_dataJSON));*/
org.springframework.http.HttpEntity<Object> httpEntity = new org.springframework.http.HttpEntity<>(order_dataJSON, headers);
RestTemplate restTemplate = new RestTemplate();
restTemplate.setMessageConverters(Collections.singletonList(new StringHttpMessageConverter(Charset.forName("UTF-8"))));
log.info("提交参数:" + order_dataJSON); log.info("提交参数:" + order_dataJSON);
com.winsun.constant.Constant.trustEveryone(); com.winsun.constant.Constant.trustEveryone();
responese = restTemplate.postForEntity("http://localhost:11092/ciop/testPost"/*"https://faas.mini189.cn/function/id-generator-snowflake"+".dev-fn"*/, httpEntity, String.class); responese = Unirest.post("https://applet.mini189.cn/dev/generate")
.header("Content-Type", "application/json;charset=UTF-8")
.header("X-Sign", sign)
.asString();
log.info("移动下单接口,返回信息:" + responese); log.info("移动下单接口,返回信息:" + responese);
System.out.println(responese);
} catch (ResourceAccessException e) { } catch (ResourceAccessException e) {
count++; count++;
if (count < 20) { if (count < 20) {
responese = sendAitransOrder2(map, count); responese = sendAitransOrder2(map, count);
} else { } else {
log.error("单宽带(预付费、移动、融合、续约、增值)下单接口异常尝试20次失误。请检查接口"); log.error("移动(预付费、移动、融合、续约、增值)下单接口异常尝试20次失误。请检查接口");
} }
} catch (Exception e) { } catch (Exception e) {
log.error("[HTTP] [CREATE_ORDER] 预付费下单接口异常"); log.error("[HTTP] [CREATE_ORDER] 预付费下单接口异常");
......
...@@ -120,9 +120,17 @@ spring: ...@@ -120,9 +120,17 @@ spring:
exprie: 600 exprie: 600
prohibition: 600 prohibition: 600
datasource: datasource:
url: jdbc:mysql://172.18.101.171:3306/school_center?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true #url: jdbc:mysql://172.18.101.171:3306/school_center?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true
username: yzzx url: jdbc:mysql://localhost:3306/school_center?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true
password: yzzx123!@# #username: yzzx
username: root
#password: yzzx123!@#
password: root
druid:
WebStatFilter:
enabled: false
StatViewServlet:
enabled: false
dynamic: dynamic:
primary: master primary: master
p6spy: true p6spy: true
......
...@@ -10,7 +10,7 @@ import com.winsun.constant.Constant; ...@@ -10,7 +10,7 @@ import com.winsun.constant.Constant;
import com.winsun.mapper.OrderMapper; import com.winsun.mapper.OrderMapper;
import com.winsun.mapper.OrderViewMapper; import com.winsun.mapper.OrderViewMapper;
import com.winsun.mapper.UniversityInfoMapper; import com.winsun.mapper.UniversityInfoMapper;
import com.winsun.outSideSystem.IntelligenceSendOrder; import com.winsun.outSideSystem.IntelligenceSendOrders;
import com.winsun.utils.BeanUtil; import com.winsun.utils.BeanUtil;
import com.winsun.utils.MD5Utils; import com.winsun.utils.MD5Utils;
import com.winsun.utils.MyBatisPlusUpdateUtils; import com.winsun.utils.MyBatisPlusUpdateUtils;
...@@ -51,8 +51,10 @@ public class RhZhiNenTask { ...@@ -51,8 +51,10 @@ public class RhZhiNenTask {
private OrderViewMapper orderViewMapper; private OrderViewMapper orderViewMapper;
@Autowired @Autowired
private OrderMapper orderMapper; private OrderMapper orderMapper;
/*@Autowired
private IntelligenceSendOrder intelligenceSendOrder;*/
@Autowired @Autowired
private IntelligenceSendOrder intelligenceSendOrder; private IntelligenceSendOrders intelligenceSendOrders;
/** /**
* 下发智能平台订单 -- 单宽 * 下发智能平台订单 -- 单宽
...@@ -67,7 +69,7 @@ public class RhZhiNenTask { ...@@ -67,7 +69,7 @@ public class RhZhiNenTask {
// 发送下单请求 // 发送下单请求
for(int i = 0; i < orders.size(); ++i) { for(int i = 0; i < orders.size(); ++i) {
intelligenceSendOrder.singleBroadSendOrder(orders.get(i)); intelligenceSendOrders.singleBroadSendOrder(orders.get(i));
} }
}catch(Exception e) { }catch(Exception e) {
...@@ -98,30 +100,22 @@ public class RhZhiNenTask { ...@@ -98,30 +100,22 @@ public class RhZhiNenTask {
log.info("更新待受理订单数:" + updateNum); log.info("更新待受理订单数:" + updateNum);
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
// 查询未下单并且融合时间为今天的订单 // 查询未下单并且融合时间为今天的订单
Wrapper<Order> wrapper = new EntityWrapper<>(); String leftTime = sdf.format(calendar.getTime());
wrapper.in("user_type", "3,10");
wrapper.eq("order_status", "未下单");
wrapper.ge("rh_time", sdf.format(calendar.getTime()));
calendar.add(Calendar.DATE, 1); calendar.add(Calendar.DATE, 1);
wrapper.le("rh_time", sdf.format(calendar.getTime())); String rightTime = sdf.format(calendar.getTime());
List<Order> orders = orderMapper.selectList(wrapper); List<Map<String, Object>> orders = orderMapper.selectRHList(leftTime, rightTime);
Map<String, Object> map = new HashMap<>();
// 发送下单请求 // 发送下单请求
for(int i = 0; i < orders.size(); ++i) { for(int i = 0; i < orders.size(); ++i) {
intelligenceSendOrder.integrateSendOrder(orders.get(i), false); intelligenceSendOrders.integrateSendOrder(orders.get(i), false);
} }
// 无融合时间下单 // 无融合时间下单
wrapper = new EntityWrapper<>(); List<Map<String, Object>> noRhOrders = orderMapper.selectNotRHList();
wrapper.in("user_type", "3,10");
wrapper.eq("order_status", "未下单");
wrapper.isNull("rh_time");
List<Order> noRhOrders = orderMapper.selectList(wrapper);
// 发送下单请求 // 发送下单请求
for(int i = 0; i < noRhOrders.size(); ++i) { for(int i = 0; i < noRhOrders.size(); ++i) {
intelligenceSendOrder.integrateSendOrder(noRhOrders.get(i), true); intelligenceSendOrders.integrateSendOrder(noRhOrders.get(i), true);
} }
}catch(Exception e) { }catch(Exception e) {
...@@ -136,7 +130,7 @@ public class RhZhiNenTask { ...@@ -136,7 +130,7 @@ public class RhZhiNenTask {
//每五分钟调用一次 //每五分钟调用一次
// @Scheduled(cron = "0 0/5 0 * * ? ") // @Scheduled(cron = "0 0/5 0 * * ? ")
//@Scheduled(fixedRate=1000*60) //@Scheduled(fixedRate=1000*60)
@PostMapping("/rhZhiNenTask") /* @PostMapping("/rhZhiNenTask")
public void general() throws Exception { public void general() throws Exception {
Wrapper<Order> wrapper = new EntityWrapper<>(); Wrapper<Order> wrapper = new EntityWrapper<>();
...@@ -285,7 +279,7 @@ public class RhZhiNenTask { ...@@ -285,7 +279,7 @@ public class RhZhiNenTask {
qParams.add(new BasicNameValuePair("transactType", "新宽旧移"));// 办理类型,必填[新宽新移][新宽旧移][旧宽新移][旧宽旧移] qParams.add(new BasicNameValuePair("transactType", "新宽旧移"));// 办理类型,必填[新宽新移][新宽旧移][旧宽新移][旧宽旧移]
signMap.put("transactType", "新宽旧移"); signMap.put("transactType", "新宽旧移");
/* if(orderMap.get("webOrderAmount").toString().equals("0")){ *//* if(orderMap.get("webOrderAmount").toString().equals("0")){
qParams.add(new BasicNameValuePair("ctNumber", (String) order.get("businessNumber")));// 电信号码,办理类型,若选择[新宽旧移]或[旧宽旧移],此项必填 qParams.add(new BasicNameValuePair("ctNumber", (String) order.get("businessNumber")));// 电信号码,办理类型,若选择[新宽旧移]或[旧宽旧移],此项必填
signMap.put("ctNumber", (String) order.get("businessNumber")); signMap.put("ctNumber", (String) order.get("businessNumber"));
...@@ -297,7 +291,7 @@ public class RhZhiNenTask { ...@@ -297,7 +291,7 @@ public class RhZhiNenTask {
qParams.add(new BasicNameValuePair("ctNumber", (String) order.get("businessNumber")));// 电信号码,办理类型,若选择[新宽旧移]或[旧宽旧移],此项必填 qParams.add(new BasicNameValuePair("ctNumber", (String) order.get("businessNumber")));// 电信号码,办理类型,若选择[新宽旧移]或[旧宽旧移],此项必填
signMap.put("ctNumber", (String) order.get("businessNumber")); signMap.put("ctNumber", (String) order.get("businessNumber"));
*/ *//*
qParams.add(new BasicNameValuePair("addressProvince", "广东省"));// 报装地址-省 办理类型,若选择[新宽新移][新宽旧移],此项必填 qParams.add(new BasicNameValuePair("addressProvince", "广东省"));// 报装地址-省 办理类型,若选择[新宽新移][新宽旧移],此项必填
signMap.put("addressProvince", "广东省"); signMap.put("addressProvince", "广东省");
...@@ -661,7 +655,7 @@ public class RhZhiNenTask { ...@@ -661,7 +655,7 @@ public class RhZhiNenTask {
if (StringUtils.isNotBlank(orderNum)) { if (StringUtils.isNotBlank(orderNum)) {
queryOrderJsonObject = getQueryOrderInfo(orderNum, currentTimeStr); queryOrderJsonObject = getQueryOrderInfo(orderNum, currentTimeStr);
log.info("----------调用查询智能订单接口并返回参数信息:" + queryOrderJsonObject); log.info("----------调用查询智能订单接口并返回参数信息:" + queryOrderJsonObject);
/* 5、插入数据到数据库 */ *//* 5、插入数据到数据库 *//*
String state = queryOrderJsonObject.getString("state"); String state = queryOrderJsonObject.getString("state");
String order_id = queryOrderJsonObject.getString("bizEntity"); String order_id = queryOrderJsonObject.getString("bizEntity");
String th_status = queryOrderJsonObject.getString("stateName"); String th_status = queryOrderJsonObject.getString("stateName");
...@@ -686,7 +680,7 @@ public class RhZhiNenTask { ...@@ -686,7 +680,7 @@ public class RhZhiNenTask {
if (StringUtils.isNotBlank(orderNum)) { if (StringUtils.isNotBlank(orderNum)) {
queryOrderJsonObject = getQueryOrderInfo(orderNum, currentTimeStr); queryOrderJsonObject = getQueryOrderInfo(orderNum, currentTimeStr);
log.info("----------调用查询智能订单接口并返回参数信息:" + queryOrderJsonObject); log.info("----------调用查询智能订单接口并返回参数信息:" + queryOrderJsonObject);
/* 5、更新数据库 */ *//* 5、更新数据库 *//*
String state = queryOrderJsonObject.getString("state"); String state = queryOrderJsonObject.getString("state");
HashMap<String, Object> hashMap = new HashMap<>(); HashMap<String, Object> hashMap = new HashMap<>();
hashMap.put("order_id",orderNum); hashMap.put("order_id",orderNum);
...@@ -711,9 +705,9 @@ public class RhZhiNenTask { ...@@ -711,9 +705,9 @@ public class RhZhiNenTask {
} }
} }
} }*/
private String QueOrderNum(String orderNum) { /*private String QueOrderNum(String orderNum) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
if (orderNum.equals("12")) { if (orderNum.equals("12")) {
return "1"; // 待提交 return "1"; // 待提交
...@@ -731,9 +725,9 @@ public class RhZhiNenTask { ...@@ -731,9 +725,9 @@ public class RhZhiNenTask {
return "2"; // 待受理(未受理、未受理【待跟进】、待疑难支撑审核、待分局审核、待分销商审核) return "2"; // 待受理(未受理、未受理【待跟进】、待疑难支撑审核、待分局审核、待分销商审核)
} }
} }*/
private net.sf.json.JSONObject getQueryOrderInfo(String orderNum, String currentTimeStr) throws Exception { /*private net.sf.json.JSONObject getQueryOrderInfo(String orderNum, String currentTimeStr) throws Exception {
List<NameValuePair> qParams = new ArrayList<NameValuePair>(); List<NameValuePair> qParams = new ArrayList<NameValuePair>();
RequestConfig defaultRequestConfig = RequestConfig.custom().setSocketTimeout(50000) RequestConfig defaultRequestConfig = RequestConfig.custom().setSocketTimeout(50000)
.setConnectTimeout(50000).setConnectionRequestTimeout(50000).build(); .setConnectTimeout(50000).setConnectionRequestTimeout(50000).build();
...@@ -782,7 +776,7 @@ public class RhZhiNenTask { ...@@ -782,7 +776,7 @@ public class RhZhiNenTask {
httpPost.releaseConnection(); httpPost.releaseConnection();
} }
return resultDataJson; return resultDataJson;
} }*/
private static JSONObject getSaleId(String productId, String currentTimeStr) throws Exception { private static JSONObject getSaleId(String productId, String currentTimeStr) throws Exception {
List<NameValuePair> qParams = new ArrayList<NameValuePair>(); List<NameValuePair> qParams = new ArrayList<NameValuePair>();
......
...@@ -125,6 +125,11 @@ spring: ...@@ -125,6 +125,11 @@ spring:
password: yzzx123!@# password: yzzx123!@#
filters: wall,mergeStat filters: wall,mergeStat
max-active: 20 max-active: 20
druid:
WebStatFilter:
enabled: false
StatViewServlet:
enabled: false
devtools: devtools:
restart: restart:
enabled: false enabled: false
......
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