v2
This commit is contained in:
@@ -23,6 +23,11 @@
|
||||
<artifactId>ruoyi-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-system</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
||||
BIN
ct/src/main/.DS_Store
vendored
Normal file
BIN
ct/src/main/.DS_Store
vendored
Normal file
Binary file not shown.
9
ct/src/main/java/com/ruoyi/ct/CTNetException.java
Normal file
9
ct/src/main/java/com/ruoyi/ct/CTNetException.java
Normal file
@@ -0,0 +1,9 @@
|
||||
package com.ruoyi.ct;
|
||||
|
||||
public class CTNetException extends Exception {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public CTNetException() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,34 @@
|
||||
package com.ruoyi.ct.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.io.InputStream;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.alibaba.excel.ExcelReader;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.ruoyi.common.core.domain.CTResponse;
|
||||
import com.ruoyi.common.excel.ExcelResult;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.ct.domain.Bill;
|
||||
import com.ruoyi.ct.domain.bo.AgentAccountGoodBo;
|
||||
import com.ruoyi.ct.domain.vo.AgentAccountGoodVo;
|
||||
import com.ruoyi.ct.service.CTService;
|
||||
import com.ruoyi.ct.service.IAgentAccountGoodService;
|
||||
import com.ruoyi.system.domain.SysConfig;
|
||||
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
@@ -19,7 +40,6 @@ import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import com.ruoyi.common.core.validate.QueryGroup;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.ct.domain.vo.AgentOrderVo;
|
||||
import com.ruoyi.ct.domain.bo.AgentOrderBo;
|
||||
import com.ruoyi.ct.service.IAgentOrderService;
|
||||
@@ -37,8 +57,19 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
||||
@RequestMapping("/ct/agentOrder")
|
||||
public class AgentOrderController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private final IAgentOrderService iAgentOrderService;
|
||||
|
||||
@Resource
|
||||
private IAgentAccountGoodService iAgentAccountGoodService;
|
||||
|
||||
@Resource
|
||||
private CTService ctService;
|
||||
|
||||
@Lazy
|
||||
@Resource
|
||||
private ISysConfigService sysConfigService;
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
*/
|
||||
@@ -71,6 +102,147 @@ public class AgentOrderController extends BaseController {
|
||||
return R.ok(iAgentOrderService.queryById(id));
|
||||
}
|
||||
|
||||
@SaCheckPermission("ct:agentOrder:query")
|
||||
@GetMapping("/syncOrder/{id}")
|
||||
public R<JSONObject> syncOrder(@PathVariable Long id) {
|
||||
AgentOrderVo agentOrderVo = iAgentOrderService.queryById(id);
|
||||
if (ObjectUtil.isNotNull(agentOrderVo)) {
|
||||
try {
|
||||
System.out.println("agentOrderVo = " + agentOrderVo);
|
||||
CTResponse<String> response = ctService.updateOrder(agentOrderVo.getName(), agentOrderVo.getOrderNum());
|
||||
if (ObjectUtils.isNotNull(response) && response.isSuccess()) {
|
||||
AgentOrderBo agentOrderBo = new AgentOrderBo();
|
||||
agentOrderBo.setId(agentOrderVo.getId());
|
||||
JSONObject data = response.getDecryptData();
|
||||
agentOrderBo.setOrderStatus(data.getStr("status"));
|
||||
// agentOrderBo.setExpressNum(data.getStr("expressNum"));
|
||||
|
||||
if (ObjectUtils.isNotNull(data.getBeanList("expressRoutes", JSONObject.class))) {
|
||||
agentOrderBo.setExpressRoutes(data.getBeanList("expressRoutes", JSONObject.class).toString());
|
||||
}
|
||||
if (ObjectUtils.isNotNull(data.getBeanList("routeArr", JSONObject.class))) {
|
||||
agentOrderBo.setRouteArr(data.getBeanList("routeArr", JSONObject.class).toString());
|
||||
}
|
||||
|
||||
agentOrderBo.setUpdateTime(new Date());
|
||||
boolean needStatistic = false;
|
||||
if (Objects.equals(agentOrderBo.getOrderStatus(), "S1013")) {
|
||||
agentOrderBo.setStatus("1");
|
||||
agentOrderBo.setActiveTime(new Date());
|
||||
needStatistic = true;
|
||||
} else if (Objects.equals(agentOrderBo.getOrderStatus(), "S1014")) {
|
||||
agentOrderBo.setStatus("10");
|
||||
needStatistic = true;
|
||||
}
|
||||
iAgentOrderService.updateByBo(agentOrderBo);
|
||||
if (needStatistic && agentOrderVo.getOrderType() == 1) {
|
||||
// H5 下单需要更新统计
|
||||
AgentAccountGoodBo agentAccountGoodBo = new AgentAccountGoodBo();
|
||||
AgentAccountGoodVo agentAccountGoodVo = iAgentAccountGoodService.getByGoodAndAccount(agentAccountGoodBo.getSaleId(), agentOrderVo.getAgentAccountId());
|
||||
iAgentOrderService.updateCount(agentAccountGoodVo);
|
||||
}
|
||||
return R.ok(data);
|
||||
} else {
|
||||
System.out.println("同步订单异常:"+agentOrderVo.getSerialNumber()+","+response.getMessage());
|
||||
return R.fail("查询失败,电信返回异常");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.out.println("同步订单异常:"+agentOrderVo.getSerialNumber());
|
||||
return R.fail("查询失败,返回数据处理异常");
|
||||
}
|
||||
}
|
||||
return R.fail("查询失败,ID错误");
|
||||
}
|
||||
|
||||
@SaCheckPermission("ct:agentOrder:query")
|
||||
@GetMapping("/syncErrorOrder/{id}")
|
||||
public R<JSONObject> syncErrorOrder(@PathVariable Long id) {
|
||||
AgentOrderVo vo = iAgentOrderService.queryById(id);
|
||||
if (ObjectUtil.isNotNull(vo)) {
|
||||
try {
|
||||
CTResponse<String> response = ctService.updateOrderNum(vo.getSerialNumber());
|
||||
if (ObjectUtils.isNotNull(response) && response.isSuccess()) {
|
||||
JSONObject data = response.getDecryptData();
|
||||
if (ObjectUtils.isNotNull(data) && ObjectUtils.isNotNull(data.getStr("freightVendor"))) {
|
||||
AgentOrderBo agentOrderBo = new AgentOrderBo();
|
||||
agentOrderBo.setId(vo.getId());
|
||||
agentOrderBo.setExpressNum(data.getStr("freightCode"));
|
||||
agentOrderBo.setExpressVendor(data.getStr("freightVendor"));
|
||||
iAgentOrderService.updateByBo(agentOrderBo);
|
||||
return R.ok(data);
|
||||
}
|
||||
return R.ok("查询失败,返回数据处理异常", data);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return R.fail("查询失败,返回数据处理异常");
|
||||
}
|
||||
}
|
||||
return R.fail("查询失败,ID错误");
|
||||
}
|
||||
|
||||
@SaCheckPermission("ct:agentOrder:query")
|
||||
@GetMapping("/syncOffer/{id}")
|
||||
public R<JSONArray> syncOffer(@PathVariable Long id) {
|
||||
AgentOrderVo vo = iAgentOrderService.queryById(id);
|
||||
if (ObjectUtil.isNotNull(vo)) {
|
||||
try {
|
||||
String offerIds = "";
|
||||
SysConfig sysConfig50 = sysConfigService.selectConfig("offerId50");
|
||||
SysConfig sysConfig100 = sysConfigService.selectConfig("offerId100");
|
||||
String offerId50 = sysConfig50.getConfigValue();
|
||||
String offerId100 = sysConfig100.getConfigValue();
|
||||
offerIds = offerId50 + "," + offerId100;
|
||||
CTResponse<JSONArray> response = ctService.syncOffer(vo.getOrderNum(), offerIds, vo.getPersonnelId());
|
||||
JSONArray data = response.getData();
|
||||
if (ObjectUtils.isNotNull(data) && data.size() < 2) {
|
||||
AgentOrderBo bo = new AgentOrderBo();
|
||||
bo.setId(vo.getId());
|
||||
bo.setIsRecharge(1);
|
||||
bo.setRechargeTime(new Date());
|
||||
bo.setUpdateTime(new Date());
|
||||
if (!data.contains(offerId50)) {
|
||||
bo.setChargeTitle(sysConfig50.getConfigName());
|
||||
} else if (!data.contains(offerId100)) {
|
||||
bo.setChargeTitle(sysConfig100.getConfigName());
|
||||
}
|
||||
iAgentOrderService.updateByBo(bo);
|
||||
return R.ok();
|
||||
} else {
|
||||
return R.ok("查询失败,返回数据处理异常", data);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return R.fail("查询失败,返回数据处理异常");
|
||||
}
|
||||
}
|
||||
return R.fail("查询失败,ID错误");
|
||||
}
|
||||
|
||||
@SaCheckPermission("ct:agentOrder:query")
|
||||
@GetMapping("/syncExpress/{id}")
|
||||
public R<JSONObject> syncExpress(@PathVariable Long id) {
|
||||
AgentOrderVo vo = iAgentOrderService.queryById(id);
|
||||
if (ObjectUtil.isNotNull(vo)) {
|
||||
try {
|
||||
CTResponse<String> response = ctService.updateExpress(vo.getOrderNum());
|
||||
if (ObjectUtils.isNotNull(response) && response.isSuccess()) {
|
||||
JSONObject data = response.getDecryptData();
|
||||
if (ObjectUtils.isNotNull(data) && ObjectUtils.isNotNull(data.getStr("freightVendor"))) {
|
||||
AgentOrderBo agentOrderBo = new AgentOrderBo();
|
||||
agentOrderBo.setId(vo.getId());
|
||||
agentOrderBo.setExpressNum(data.getStr("freightCode"));
|
||||
agentOrderBo.setExpressVendor(data.getStr("freightVendor"));
|
||||
iAgentOrderService.updateByBo(agentOrderBo);
|
||||
return R.ok(data);
|
||||
}
|
||||
return R.ok("查询失败,返回数据处理异常", data);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return R.fail("查询失败,返回数据处理异常");
|
||||
}
|
||||
}
|
||||
return R.fail("查询失败,ID错误");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增订单
|
||||
*/
|
||||
@@ -79,6 +251,7 @@ public class AgentOrderController extends BaseController {
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody AgentOrderBo bo) {
|
||||
bo.setSerialNumber(UUID.randomUUID().toString().replace("-", ""));
|
||||
return toAjax(iAgentOrderService.insertByBo(bo));
|
||||
}
|
||||
|
||||
@@ -105,4 +278,5 @@ public class AgentOrderController extends BaseController {
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(iAgentOrderService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -175,4 +175,9 @@ public class AgentOrder extends BaseEntity {
|
||||
|
||||
private String uploadMsgId;
|
||||
|
||||
private Date activeTime;
|
||||
|
||||
private Date rechargeTime;
|
||||
|
||||
private Integer hasError;
|
||||
}
|
||||
|
||||
194
ct/src/main/java/com/ruoyi/ct/domain/Bill.java
Normal file
194
ct/src/main/java/com/ruoyi/ct/domain/Bill.java
Normal file
@@ -0,0 +1,194 @@
|
||||
package com.ruoyi.ct.domain;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Bill {
|
||||
private String a0;
|
||||
private String a1;
|
||||
private String a3;
|
||||
private String a4;
|
||||
@ExcelProperty(value = "结算账期")
|
||||
private String a;
|
||||
@ExcelProperty(value = "原始账期")
|
||||
private String b;
|
||||
@ExcelProperty(value = "渠道名称")
|
||||
private String c;
|
||||
@ExcelProperty(value = "父代理商名称")
|
||||
private String d;
|
||||
@ExcelProperty(value = "父代理商编码")
|
||||
private String e;
|
||||
@ExcelProperty(value = "代理商名称")
|
||||
private String f;
|
||||
@ExcelProperty(value = "代理商编码")
|
||||
private String g;
|
||||
@ExcelProperty(value = "网点名称")
|
||||
private String h;
|
||||
@ExcelProperty(value = "网点编码")
|
||||
private String i;
|
||||
@ExcelProperty(value = "套餐名称")
|
||||
private String j;
|
||||
@ExcelProperty(value = "套餐编码")
|
||||
private String k;
|
||||
@ExcelProperty(value = "设备号")
|
||||
private String l;
|
||||
@ExcelProperty(value = "资产ID")
|
||||
private String m;
|
||||
@ExcelProperty(value = "类型")
|
||||
private String n;
|
||||
@ExcelProperty(value = "金额(元)")
|
||||
private String o;
|
||||
@ExcelProperty(value = "原始清单ID")
|
||||
private String p;
|
||||
@ExcelProperty(value = "不含税价(元)")
|
||||
private String q;
|
||||
@ExcelProperty(value = "酬金结算比例")
|
||||
private String r;
|
||||
@ExcelProperty(value = "酬金比例单位")
|
||||
private String s;
|
||||
@ExcelProperty(value = "有效计算金额(元)")
|
||||
private String t;
|
||||
@ExcelProperty(value = "结算频率")
|
||||
private String u;
|
||||
@ExcelProperty(value = "受理员工")
|
||||
private String v;
|
||||
@ExcelProperty(value = "受理员工工号")
|
||||
private String w;
|
||||
@ExcelProperty(value = "促销员工")
|
||||
private String x;
|
||||
@ExcelProperty(value = "促销员工工号")
|
||||
private String y;
|
||||
@ExcelProperty(value = "发展区局")
|
||||
private String z;
|
||||
@ExcelProperty(value = "设备区局")
|
||||
private String aa;
|
||||
@ExcelProperty(value = "行政分局")
|
||||
private String ab;
|
||||
@ExcelProperty(value = "佣金策略")
|
||||
private String ac;
|
||||
@ExcelProperty(value = "佣金结算说明")
|
||||
private String ad;
|
||||
@ExcelProperty(value = "销售策略名称")
|
||||
private String ae;
|
||||
@ExcelProperty(value = "销售策略编码")
|
||||
private String af;
|
||||
@ExcelProperty(value = "产品名称")
|
||||
private String ag;
|
||||
@ExcelProperty(value = "产品编码")
|
||||
private String ah;
|
||||
@ExcelProperty(value = "入网日期")
|
||||
private String ai;
|
||||
@ExcelProperty(value = "完工日期")
|
||||
private String aj;
|
||||
@ExcelProperty(value = "设备状态")
|
||||
private String ak;
|
||||
@ExcelProperty(value = "佣金类型")
|
||||
private String al;
|
||||
@ExcelProperty(value = "清单状态")
|
||||
private String am;
|
||||
@ExcelProperty(value = "清单编号")
|
||||
private String an;
|
||||
@ExcelProperty(value = "报账单号")
|
||||
private String ao;
|
||||
@ExcelProperty(value = "结算标志")
|
||||
private String ap;
|
||||
@ExcelProperty(value = "结算人")
|
||||
private String aq;
|
||||
@ExcelProperty(value = "结算时间")
|
||||
private String ar;
|
||||
@ExcelProperty(value = "是否调账")
|
||||
private String as;
|
||||
@ExcelProperty(value = "调整原因")
|
||||
private String at;
|
||||
@ExcelProperty(value = "集团渠道编码")
|
||||
private String au;
|
||||
@ExcelProperty(value = "集团渠道类型第一级")
|
||||
private String av;
|
||||
@ExcelProperty(value = "集团渠道类型第二级")
|
||||
private String aw;
|
||||
@ExcelProperty(value = "集团渠道类型第三级")
|
||||
private String ax;
|
||||
@ExcelProperty(value = "融合类型")
|
||||
private String ay;
|
||||
@ExcelProperty(value = "折扣率")
|
||||
private String az;
|
||||
@ExcelProperty(value = "客户类型")
|
||||
private String ba;
|
||||
@ExcelProperty(value = "维系月份")
|
||||
private String bb;
|
||||
@ExcelProperty(value = "派单渠道")
|
||||
private String bc;
|
||||
@ExcelProperty(value = "维系类型")
|
||||
private String bd;
|
||||
@ExcelProperty(value = "维系路径")
|
||||
private String be;
|
||||
@ExcelProperty(value = "供应商名称")
|
||||
private String bf;
|
||||
@ExcelProperty(value = "供应商编码")
|
||||
private String bg;
|
||||
@ExcelProperty(value = "预算责任中心名称")
|
||||
private String bh;
|
||||
@ExcelProperty(value = "预算责任中心编码")
|
||||
private String bi;
|
||||
@ExcelProperty(value = "成本中心名称")
|
||||
private String bj;
|
||||
@ExcelProperty(value = "成本中心编码")
|
||||
private String bk;
|
||||
@ExcelProperty(value = "用途名称")
|
||||
private String bl;
|
||||
@ExcelProperty(value = "用途编码")
|
||||
private String bm;
|
||||
@ExcelProperty(value = "经济事项名称")
|
||||
private String bn;
|
||||
@ExcelProperty(value = "经济事项编码")
|
||||
private String bo;
|
||||
@ExcelProperty(value = "开账账期")
|
||||
private String bp;
|
||||
@ExcelProperty(value = "网格内外标志")
|
||||
private String bq;
|
||||
@ExcelProperty(value = "安装地址")
|
||||
private String br;
|
||||
@ExcelProperty(value = "客户等级")
|
||||
private String bs;
|
||||
@ExcelProperty(value = "是否摊销")
|
||||
private String bt;
|
||||
@ExcelProperty(value = "代催员工")
|
||||
private String bu;
|
||||
@ExcelProperty(value = "销账本金")
|
||||
private String bv;
|
||||
@ExcelProperty(value = "销账违约金")
|
||||
private String bw;
|
||||
@ExcelProperty(value = "调整本金")
|
||||
private String bx;
|
||||
@ExcelProperty(value = "调整违约金")
|
||||
private String by;
|
||||
@ExcelProperty(value = "销账月")
|
||||
private String bz;
|
||||
@ExcelProperty(value = "展示字段1")
|
||||
private String ca;
|
||||
@ExcelProperty(value = "展示字段1描述")
|
||||
private String cb;
|
||||
@ExcelProperty(value = "展示字段2")
|
||||
private String cc;
|
||||
@ExcelProperty(value = "展示字段2描述")
|
||||
private String cd;
|
||||
@ExcelProperty(value = "展示字段3")
|
||||
private String ce;
|
||||
@ExcelProperty(value = "展示字段3描述")
|
||||
private String cf;
|
||||
@ExcelProperty(value = "展示字段4")
|
||||
private String cg;
|
||||
@ExcelProperty(value = "展示字段4描述")
|
||||
private String ch;
|
||||
@ExcelProperty(value = "展示字段5")
|
||||
private String ci;
|
||||
@ExcelProperty(value = "展示字段5描述")
|
||||
private String cj;
|
||||
@ExcelProperty(value = "佣金政策编号")
|
||||
private String ck;
|
||||
@ExcelProperty(value = "佣金政策名称")
|
||||
private String cl;
|
||||
@ExcelProperty(value = "工单(主单)编号")
|
||||
private String cm;
|
||||
}
|
||||
@@ -23,7 +23,7 @@ public class Good extends BaseEntity {
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
@@ -36,20 +36,24 @@ public class Good extends BaseEntity {
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
private String saleId;
|
||||
/**
|
||||
* 电信ID
|
||||
*/
|
||||
private String personnelId;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
@@ -24,31 +24,31 @@ public class AgentOrderBo extends BaseEntity {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@NotNull(message = "不能为空", groups = { EditGroup.class })
|
||||
// @NotNull(message = "不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 代理商ID
|
||||
*/
|
||||
@NotNull(message = "代理商ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
// @NotNull(message = "代理商ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long agentId;
|
||||
|
||||
/**
|
||||
* 代理商名称
|
||||
*/
|
||||
@NotBlank(message = "代理商名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
// @NotBlank(message = "代理商名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String agentName;
|
||||
|
||||
/**
|
||||
* 代理商账号ID
|
||||
*/
|
||||
@NotNull(message = "代理商账号ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
// @NotNull(message = "代理商账号ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long agentAccountId;
|
||||
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
@NotBlank(message = "商品ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
// @NotBlank(message = "商品ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String saleId;
|
||||
private String title;
|
||||
private String content;
|
||||
@@ -56,69 +56,63 @@ public class AgentOrderBo extends BaseEntity {
|
||||
/**
|
||||
* 厅店ID,默认13
|
||||
*/
|
||||
@NotBlank(message = "厅店ID,默认13不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
// @NotBlank(message = "厅店ID,默认13不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String storeId;
|
||||
|
||||
/**
|
||||
* 代理商电信ID
|
||||
*/
|
||||
@NotBlank(message = "代理商电信ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
// @NotBlank(message = "代理商电信ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String personnelId;
|
||||
|
||||
/**
|
||||
* 用户姓名
|
||||
*/
|
||||
@NotBlank(message = "姓名不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
// @NotBlank(message = "姓名不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 用户身份证号
|
||||
*/
|
||||
@NotBlank(message = "身份证号不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
@Pattern(regexp = "([1-9]\\d{5})(19\\d{2}|20\\d{2})(0[1-9]|1[0-2])(0[1-9]|[1-2]\\d|3[0-1])\\d{3}([0-9]|X|x)", message = "身份证号码错误", groups = { AddGroup.class, EditGroup.class })
|
||||
// @NotBlank(message = "身份证号不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
// @Pattern(regexp = "([1-9]\\d{5})(19\\d{2}|20\\d{2})(0[1-9]|1[0-2])(0[1-9]|[1-2]\\d|3[0-1])\\d{3}([0-9]|X|x)", message = "身份证号码错误", groups = { AddGroup.class, EditGroup.class })
|
||||
private String idCard;
|
||||
|
||||
/**
|
||||
* 用户联系电话
|
||||
*/
|
||||
@NotBlank(message = "联系电话不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
@Pattern(regexp = "1[3-9]\\d{9}", message = "联系电话错误", groups = { AddGroup.class, EditGroup.class })
|
||||
// @NotBlank(message = "联系电话不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
// @Pattern(regexp = "1[3-9]\\d{9}", message = "联系电话错误", groups = { AddGroup.class, EditGroup.class })
|
||||
private String contactMobile;
|
||||
|
||||
/**
|
||||
* 收货地址
|
||||
*/
|
||||
@NotBlank(message = "收货地址不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String installedAddress;
|
||||
|
||||
/**
|
||||
* 省
|
||||
*/
|
||||
@NotBlank(message = "省不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String province;
|
||||
|
||||
/**
|
||||
* 市
|
||||
*/
|
||||
@NotBlank(message = "市不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String city;
|
||||
|
||||
/**
|
||||
* 区
|
||||
*/
|
||||
@NotBlank(message = "区不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String county;
|
||||
|
||||
/**
|
||||
* 下单流水号
|
||||
*/
|
||||
@NotBlank(message = "下单流水号不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String serialNumber;
|
||||
|
||||
/**
|
||||
* 入网号码
|
||||
*/
|
||||
@NotBlank(message = "入网号码不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String number;
|
||||
|
||||
/**
|
||||
@@ -129,7 +123,6 @@ public class AgentOrderBo extends BaseEntity {
|
||||
/**
|
||||
* 业务办理页面url
|
||||
*/
|
||||
@NotBlank(message = "业务办理页面url不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String pageUrl;
|
||||
|
||||
/**
|
||||
@@ -215,4 +208,10 @@ public class AgentOrderBo extends BaseEntity {
|
||||
private Integer frontFace;
|
||||
|
||||
private String uploadMsgId;
|
||||
|
||||
private Date activeTime;
|
||||
|
||||
private Date rechargeTime;
|
||||
|
||||
private Integer hasError;
|
||||
}
|
||||
|
||||
@@ -44,6 +44,12 @@ public class GoodBo extends BaseEntity {
|
||||
@NotBlank(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String saleId;
|
||||
|
||||
/**
|
||||
* 电信ID
|
||||
*/
|
||||
@NotBlank(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String personnelId;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
|
||||
@@ -74,4 +74,6 @@ public class AgentAccountGoodVo implements Serializable {
|
||||
private String imageIds;
|
||||
private String remark;
|
||||
|
||||
// private AgentVo agentVo;
|
||||
|
||||
}
|
||||
|
||||
@@ -248,4 +248,13 @@ public class AgentOrderVo implements Serializable {
|
||||
private Integer frontFace;
|
||||
|
||||
private String uploadMsgId;
|
||||
|
||||
@ExcelProperty(value = "激活时间")
|
||||
private Date activeTime;
|
||||
|
||||
@ExcelProperty(value = "首冲时间")
|
||||
private Date rechargeTime;
|
||||
|
||||
@ExcelProperty(value = "是否异常订单")
|
||||
private Integer hasError;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ public class GoodVo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Long id;
|
||||
@@ -40,10 +40,15 @@ public class GoodVo implements Serializable {
|
||||
private String content;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
@ExcelProperty(value = "saleId")
|
||||
private String saleId;
|
||||
/**
|
||||
* 电信ID
|
||||
*/
|
||||
@ExcelProperty(value = "电信ID")
|
||||
private String personnelId;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
@@ -52,31 +57,31 @@ public class GoodVo implements Serializable {
|
||||
private String status;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private String remark;
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.ruoyi.ct.service;
|
||||
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.ruoyi.common.core.domain.CTRequestBody;
|
||||
import com.ruoyi.common.core.domain.CTResponse;
|
||||
import com.ruoyi.ct.domain.bo.AgentOrderBo;
|
||||
|
||||
@@ -11,23 +12,25 @@ import java.util.List;
|
||||
public interface CTService {
|
||||
|
||||
boolean getToken();
|
||||
boolean checkToken();
|
||||
CTRequestBody checkToken();
|
||||
List<JSONObject> selectNumber(String personnelId, String saleId, String page, String pageSize) 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) throws Exception;
|
||||
String remark, String installAddress, String ynumber2, String images, 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 deliveryMethod) throws Exception;
|
||||
String remark, String installAddress, String ynumber2, String images, String deliveryMethod, String sn) 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;
|
||||
|
||||
CTResponse<String> updateOrderNum(String serialNumber) throws Exception;
|
||||
|
||||
CTResponse<String> updateExpress(String orderNum) throws Exception;
|
||||
|
||||
CTResponse<JSONArray> syncOffer(String orderNum, String offerIds, String salesNumber) throws Exception;
|
||||
|
||||
@@ -58,4 +58,6 @@ public interface IAgentOrderService {
|
||||
void updateCount(AgentAccountGoodVo agentAccountGoodVo);
|
||||
|
||||
AgentOrderVo queryBySerialNumber(String serialNumber);
|
||||
|
||||
AgentOrderVo queryByNumber(String number);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.ruoyi.ct.domain.vo.AgentVo;
|
||||
import com.ruoyi.ct.mapper.AgentMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.ct.domain.bo.AgentAccountGoodBo;
|
||||
@@ -30,6 +32,7 @@ import java.util.Collection;
|
||||
public class AgentAccountGoodServiceImpl implements IAgentAccountGoodService {
|
||||
|
||||
private final AgentAccountGoodMapper baseMapper;
|
||||
private final AgentMapper agentMapper;
|
||||
|
||||
/**
|
||||
* 查询代理商商品
|
||||
@@ -46,6 +49,10 @@ public class AgentAccountGoodServiceImpl implements IAgentAccountGoodService {
|
||||
public TableDataInfo<AgentAccountGoodVo> queryPageList(AgentAccountGoodBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<AgentAccountGood> lqw = buildQueryWrapper(bo);
|
||||
Page<AgentAccountGoodVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
// for (AgentAccountGoodVo agentAccountGoodVo : result.getRecords()) {
|
||||
// AgentVo agentVo = agentMapper.selectVoById(agentAccountGoodVo.getAgentId());
|
||||
// agentAccountGoodVo.setAgentVo(agentVo);
|
||||
// }
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
|
||||
@@ -56,6 +56,14 @@ public class AgentOrderServiceImpl implements IAgentOrderService {
|
||||
return baseMapper.selectVoOne(lqw);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AgentOrderVo queryByNumber(String number) {
|
||||
LambdaQueryWrapper<AgentOrder> lqw = new LambdaQueryWrapper<>();
|
||||
lqw.eq(AgentOrder::getNumber, number);
|
||||
lqw.last("limit 1");
|
||||
return baseMapper.selectVoOne(lqw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
*/
|
||||
@@ -112,9 +120,14 @@ public class AgentOrderServiceImpl implements IAgentOrderService {
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatusCd()), AgentOrder::getStatusCd, bo.getStatusCd());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getRouteArr()), AgentOrder::getRouteArr, bo.getRouteArr());
|
||||
lqw.eq(ObjectUtils.isNotNull(bo.getIsRecharge()), AgentOrder::getIsRecharge, bo.getIsRecharge());
|
||||
lqw.eq(ObjectUtils.isNotNull(bo.getHasError()), AgentOrder::getHasError, bo.getHasError());
|
||||
lqw.eq(ObjectUtils.isNotNull(bo.getIsExpress()), AgentOrder::getIsExpress, bo.getIsExpress());
|
||||
lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null,
|
||||
AgentOrder::getCreateTime ,params.get("beginCreateTime"), params.get("endCreateTime"));
|
||||
lqw.between(params.get("beginActiveTime") != null && params.get("endActiveTime") != null,
|
||||
AgentOrder::getActiveTime ,params.get("beginActiveTime"), params.get("endActiveTime"));
|
||||
lqw.between(params.get("beginRechargeTime") != null && params.get("endRechargeTime") != null,
|
||||
AgentOrder::getRechargeTime ,params.get("beginRechargeTime"), params.get("endRechargeTime"));
|
||||
lqw.orderByDesc(AgentOrder::getCreateTime);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@@ -7,9 +7,13 @@ import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.ruoyi.common.core.domain.CTRequestBody;
|
||||
import com.ruoyi.common.core.domain.CTResponse;
|
||||
import com.ruoyi.ct.domain.bo.AgentOrderBo;
|
||||
import com.ruoyi.ct.CTNetException;
|
||||
import com.ruoyi.ct.domain.AgentOrder;
|
||||
import com.ruoyi.ct.domain.vo.AgentOrderVo;
|
||||
import com.ruoyi.ct.mapper.AgentOrderMapper;
|
||||
import com.ruoyi.ct.service.CTService;
|
||||
import com.ruoyi.common.utils.redis.RedisUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -51,7 +55,9 @@ public class CTServiceImpl implements CTService {
|
||||
|
||||
private String url;
|
||||
|
||||
private CTRequestBody requestBody;
|
||||
// private CTRequestBody requestBody;
|
||||
|
||||
private final AgentOrderMapper agentOrderMapper;
|
||||
|
||||
/**
|
||||
* 电信返回:
|
||||
@@ -111,7 +117,7 @@ public class CTServiceImpl implements CTService {
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean checkToken() {
|
||||
public CTRequestBody checkToken() {
|
||||
try {
|
||||
token = RedisUtils.getCacheObject(tokenKey);
|
||||
System.out.println("token = " + token);
|
||||
@@ -120,7 +126,7 @@ public class CTServiceImpl implements CTService {
|
||||
// 缓存中没有token,需要重新获取
|
||||
if (!getToken()) {
|
||||
// 没有获取到token,提示稍后再试
|
||||
return false;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,13 +138,13 @@ public class CTServiceImpl implements CTService {
|
||||
// 缓存中没有token,需要重新获取
|
||||
if (!getToken()) {
|
||||
// 没有获取到token,提示稍后再试
|
||||
return false;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
url = String.format("%sdqServer/api_out/xt/v1/extInterface", host);
|
||||
requestBody = new CTRequestBody();
|
||||
CTRequestBody requestBody = new CTRequestBody();
|
||||
requestBody.setAppId(appId);
|
||||
return true;
|
||||
return requestBody;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -156,7 +162,8 @@ public class CTServiceImpl implements CTService {
|
||||
*/
|
||||
@Override
|
||||
public List<JSONObject> selectNumber(String personnelId, String saleId, String page, String pageSize) throws Exception {
|
||||
if (checkToken()) {
|
||||
CTRequestBody requestBody = checkToken();
|
||||
if (ObjectUtil.isNotNull(requestBody)) {
|
||||
requestBody.setInterfaceName("SelectNumber");
|
||||
Map<String, Object> body = new HashMap<>();
|
||||
body.put("personnelId", personnelId);
|
||||
@@ -183,17 +190,21 @@ 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) throws Exception {
|
||||
if (checkToken()) {
|
||||
String installAddress, String ynumber2, String images, String sn) 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);
|
||||
@@ -212,33 +223,60 @@ public class CTServiceImpl implements CTService {
|
||||
body.put("installAddress", installAddress);
|
||||
// body.put("ynumber2", ynumber2);
|
||||
// body.put("images", images);
|
||||
log.info("body:" + body);
|
||||
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());
|
||||
// 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+" --------------------------------------------");
|
||||
}
|
||||
log.error("response status:"+httpResponse.getStatus());
|
||||
log.error("request error");
|
||||
return null;
|
||||
}
|
||||
log.error("token error");
|
||||
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 deliveryMethod) throws Exception {
|
||||
if (checkToken()) {
|
||||
String installAddress, String ynumber2, String images, String deliveryMethod, String sn) throws Exception {
|
||||
CTRequestBody requestBody = checkToken();
|
||||
if (ObjectUtil.isNotNull(requestBody)) {
|
||||
log.error(sn+" ------------------检查接口登录状态完成-------------------");
|
||||
requestBody.setInterfaceName("SaveOrder");
|
||||
Map<String, Object> body = new HashMap<>();
|
||||
|
||||
@@ -261,19 +299,43 @@ public class CTServiceImpl implements CTService {
|
||||
body.put("installAddress", installAddress);
|
||||
// body.put("ynumber2", ynumber2);
|
||||
// body.put("images", images);
|
||||
log.info("body:" + body);
|
||||
// log.info("body:" + body);
|
||||
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());
|
||||
// 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+" --------------------------------------------");
|
||||
}
|
||||
log.error("response status:"+httpResponse.getStatus());
|
||||
log.error("request error");
|
||||
return null;
|
||||
}
|
||||
log.error("token error");
|
||||
@@ -282,7 +344,8 @@ public class CTServiceImpl implements CTService {
|
||||
|
||||
@Override
|
||||
public CTResponse<String> uploadFile(String serialNumber, String name, String idCard, String type, String msgId, String img) throws Exception {
|
||||
if (checkToken()) {
|
||||
CTRequestBody requestBody = checkToken();
|
||||
if (ObjectUtil.isNotNull(requestBody)) {
|
||||
requestBody.setInterfaceName("UploadFile");
|
||||
requestBody.setFileBase64(img);
|
||||
Map<String, Object> body = new HashMap<>();
|
||||
@@ -295,8 +358,11 @@ public class CTServiceImpl implements CTService {
|
||||
if (ObjectUtil.isNotNull(msgId)) {
|
||||
body.put("msgId", msgId);
|
||||
}
|
||||
log.info("body:" + body);
|
||||
log.error("body:" + body);
|
||||
requestBody.setEncryption(JSONUtil.toJsonStr(body), publicKey);
|
||||
log.error("body appid:" + requestBody.getAppId());
|
||||
log.error("body interface name:" + requestBody.getInterfaceName());
|
||||
log.error("body encryption:" + requestBody.getEncryption());
|
||||
HttpResponse httpResponse = HttpRequest.post(url)
|
||||
.header("token", token)
|
||||
.form(requestBody.toMap())
|
||||
@@ -316,7 +382,8 @@ public class CTServiceImpl implements CTService {
|
||||
|
||||
@Override
|
||||
public CTResponse<String> updateOrder(String name, String orderNum) throws Exception {
|
||||
if (checkToken()) {
|
||||
CTRequestBody requestBody = checkToken();
|
||||
if (ObjectUtil.isNotNull(requestBody)) {
|
||||
requestBody.setInterfaceName("QueryOrder");
|
||||
Map<String, Object> body = new HashMap<>();
|
||||
|
||||
@@ -352,9 +419,48 @@ public class CTServiceImpl implements CTService {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CTResponse<String> updateOrderNum(String serialNumber) throws Exception {
|
||||
CTRequestBody requestBody = checkToken();
|
||||
if (ObjectUtil.isNotNull(requestBody)) {
|
||||
requestBody.setInterfaceName("QueryOrderResult");
|
||||
Map<String, Object> body = new HashMap<>();
|
||||
|
||||
body.put("serialNumber", serialNumber);
|
||||
|
||||
log.info("body:" + body);
|
||||
System.out.println("body = " + body);
|
||||
requestBody.setEncryption(JSONUtil.toJsonStr(body), publicKey);
|
||||
HttpResponse httpResponse = HttpRequest.post(url)
|
||||
.header("token", token)
|
||||
.form(requestBody.toMap())
|
||||
.execute();
|
||||
log.error("body:"+httpResponse.body());
|
||||
System.out.println("httpResponse.body() = " + httpResponse.body());
|
||||
if (httpResponse.isOk()) {
|
||||
CTResponse<String> response = JSONUtil.toBean(httpResponse.body(), CTResponse.class);
|
||||
|
||||
try {
|
||||
String data = response.getData();
|
||||
response.setDecryptData(JSONUtil.parseObj(decrypt(data, publicKey)));
|
||||
return response;
|
||||
} catch (Exception e) {
|
||||
response.setDecryptData(JSONUtil.parseObj(httpResponse.body()).getJSONObject("data"));
|
||||
return response;
|
||||
}
|
||||
|
||||
}
|
||||
log.error("response status:"+httpResponse.getStatus());
|
||||
log.error("request error");
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CTResponse<String> updateExpress(String orderNum) throws Exception {
|
||||
if (checkToken()) {
|
||||
CTRequestBody requestBody = checkToken();
|
||||
if (ObjectUtil.isNotNull(requestBody)) {
|
||||
requestBody.setInterfaceName("QueryOrderResult");
|
||||
Map<String, Object> body = new HashMap<>();
|
||||
|
||||
@@ -391,7 +497,8 @@ public class CTServiceImpl implements CTService {
|
||||
|
||||
@Override
|
||||
public CTResponse<JSONArray> syncOffer(String orderNum, String offerIds, String salesNumber) throws Exception {
|
||||
if (checkToken()) {
|
||||
CTRequestBody requestBody = checkToken();
|
||||
if (ObjectUtil.isNotNull(requestBody)) {
|
||||
requestBody.setInterfaceName("QueryNumberOffer");
|
||||
Map<String, Object> body = new HashMap<>();
|
||||
|
||||
|
||||
@@ -63,7 +63,8 @@ public class GoodServiceImpl implements IGoodService {
|
||||
LambdaQueryWrapper<Good> lqw = Wrappers.lambdaQuery();
|
||||
lqw.like(StringUtils.isNotBlank(bo.getName()), Good::getName, bo.getName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContent()), Good::getContent, bo.getContent());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSaleId()), Good::getSaleId, bo.getSaleId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getSaleId()), Good::getSaleId, bo.getSaleId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getPersonnelId()), Good::getPersonnelId, bo.getPersonnelId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), Good::getStatus, bo.getStatus());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
BIN
ct/src/main/resources/bill.xlsx
Normal file
BIN
ct/src/main/resources/bill.xlsx
Normal file
Binary file not shown.
Reference in New Issue
Block a user