This commit is contained in:
毕彦兵
2025-12-18 14:48:05 +08:00
parent 6cd3268908
commit ee3cfe3bcd
67 changed files with 108 additions and 5 deletions

View File

View File

View File

View File

View File

0
ct/src/main/java/com/ruoyi/ct/domain/Agent.java Executable file → Normal file
View File

0
ct/src/main/java/com/ruoyi/ct/domain/AgentAccount.java Executable file → Normal file
View File

View File

View File

0
ct/src/main/java/com/ruoyi/ct/domain/AgentOrder.java Executable file → Normal file
View File

0
ct/src/main/java/com/ruoyi/ct/domain/ApiLog.java Executable file → Normal file
View File

0
ct/src/main/java/com/ruoyi/ct/domain/Good.java Executable file → Normal file
View File

View File

View File

View File

0
ct/src/main/java/com/ruoyi/ct/domain/bo/AgentBo.java Executable file → Normal file
View File

View File

0
ct/src/main/java/com/ruoyi/ct/domain/bo/ApiLogBo.java Executable file → Normal file
View File

0
ct/src/main/java/com/ruoyi/ct/domain/bo/GoodBo.java Executable file → Normal file
View File

View File

View File

View File

View File

0
ct/src/main/java/com/ruoyi/ct/domain/vo/AgentVo.java Executable file → Normal file
View File

0
ct/src/main/java/com/ruoyi/ct/domain/vo/ApiLogVo.java Executable file → Normal file
View File

0
ct/src/main/java/com/ruoyi/ct/domain/vo/GoodVo.java Executable file → Normal file
View File

View File

View File

View File

0
ct/src/main/java/com/ruoyi/ct/mapper/AgentMapper.java Executable file → Normal file
View File

View File

0
ct/src/main/java/com/ruoyi/ct/mapper/ApiLogMapper.java Executable file → Normal file
View File

0
ct/src/main/java/com/ruoyi/ct/mapper/GoodMapper.java Executable file → Normal file
View File

View File

@@ -25,6 +25,11 @@ public interface CTService {
String county, String serialNumber, String number, String logiRemark, String pageUrl,
String remark, String installAddress, String ynumber2, String images, String deliveryMethod, String sn) throws Exception;
CTResponse<String> saveOrder(String name, String idCard, String contactMobile, String installedAddress,
String saleId, String storeId, String personnelId, String province, String city,
String county, String serialNumber, String number, String logiRemark, String pageUrl,
String remark, String installAddress, String ynumber2, String images, String sn, String ip, boolean isIPV4) throws Exception;
CTResponse<String> uploadFile(String serialNumber, String name, String idCard, String type, String msgId, String img) throws Exception;
CTResponse<String> updateOrder(String name, String orderNum) throws Exception;

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

@@ -170,6 +170,8 @@ public class CTServiceImpl implements CTService {
body.put("saleId", saleId);
body.put("page", page);
body.put("pageSize", pageSize);
System.out.println("body = " + body);
log.error("body:"+JSONUtil.toJsonStr(body));
requestBody.setEncryption(JSONUtil.toJsonStr(body), publicKey);
HttpResponse httpResponse = HttpRequest.post(url)
.header("token", token)
@@ -264,6 +266,80 @@ public class CTServiceImpl implements CTService {
return null;
}
/**
* 线上下单
*/
@Override
public CTResponse<String> saveOrder(String name, String idCard, String contactMobile,
String installedAddress, String saleId, String storeId,
String personnelId, String province, String city,
String county, String serialNumber, String number,
String logiRemark, String pageUrl, String remark,
String installAddress, String ynumber2, String images, String sn, String ip, boolean isIPV4) throws Exception {
CTRequestBody requestBody = checkToken();
if (ObjectUtil.isNotNull(requestBody)) {
log.error(sn+" ------------------检查接口登录状态完成-------------------");
requestBody.setInterfaceName("SaveOrder");
Map<String, Object> body = new HashMap<>();
body.put("name", name);
body.put("idCard", idCard);
body.put("contactMobile", contactMobile);
body.put("installedAddress", installedAddress);
body.put("saleId", saleId);
body.put("storeId", storeId);
body.put("personnelId", personnelId);
body.put("province", province);
body.put("city", city);
body.put("county", county);
body.put("serialNumber", serialNumber);
body.put("number", number);
body.put("logiRemark", logiRemark);
body.put("pageUrl", pageUrl);
body.put("remark", remark);
body.put("installAddress", installAddress);
// body.put("ynumber2", ynumber2);
// body.put("images", images);
requestBody.setEncryption(JSONUtil.toJsonStr(body), publicKey);
log.error(sn+" 加密前数据:"+body);
log.error(sn+" 加密后数据:"+requestBody.toMap());
HttpResponse httpResponse = HttpRequest.post(url)
.header("token", token)
.form(requestBody.toMap())
.execute();
// log.error("body:"+httpResponse.body());
if (httpResponse.isOk()) {
if (ObjectUtil.isNotNull(httpResponse.body()) && ObjectUtil.isNull(JSONUtil.toBean(httpResponse.body(), JSONObject.class).getStr("status"))) {
// 其他异常状态如504等
log.error(sn+" ------------------下单异常------------------- ");
log.error(sn+" 请求电信异常,状态码:"+httpResponse.getStatus());
log.error(sn+" 返回:"+httpResponse.body());
LambdaQueryWrapper<AgentOrder> lqw = new LambdaQueryWrapper<>();
lqw.eq(AgentOrder::getSerialNumber, serialNumber);
lqw.last("limit 1");
AgentOrderVo agentOrderVo = agentOrderMapper.selectVoOne(lqw);
AgentOrder agentOrder = new AgentOrder();
agentOrder.setId(agentOrderVo.getId());
agentOrder.setStatus("-2");
agentOrder.setHasError(1);
agentOrderMapper.updateById(agentOrder);
log.error(sn+" --------------------------------------------");
throw new CTNetException();
}
CTResponse<String> response = JSONUtil.toBean(httpResponse.body(), CTResponse.class);
return response;
} else {
// 返回的不是200或者没有返回
log.error(sn+" ------------------下单异常-------------------");
log.error(sn+" 请求电信异常,状态码:"+httpResponse.getStatus());
log.error(sn+" 返回:"+httpResponse.body());
log.error(sn+" --------------------------------------------");
}
return null;
}
log.error("token error");
return null;
}
/**
* 线下下单
*/

View File