记得上下班打卡 | git大法好,push需谨慎

Commit 3880fe93 authored by jiangxiulong's avatar jiangxiulong

快递

parent 789624c1
......@@ -79,6 +79,7 @@ public class KylinTableStatusConst {
/**
* 快递
*/
public static final Integer ORDER_EXPRESS_STATUS1 = 1; // 申请
public static final Integer ORDER_EXPRESS_STATUS2 = 2; // 取消
public static final Integer ORDER_EXPRESS_STATUS1 = 1; // 申请 顺丰返回失败
public static final Integer ORDER_EXPRESS_STATUS2 = 2; // 申请 顺丰返回成功 或 通过主动再查询更新
public static final Integer ORDER_EXPRESS_STATUS3 = 3; // 取消
}
......@@ -31,13 +31,6 @@ public class PerformancesExpressController extends BaseController {
private String prefix = "zhengzai/kylin/performancesExpress";
/*@Value("${liquidnet.shunfeng.url}")
public String url;
@Value("${liquidnet.shunfeng.sk}")
private String sk;
@Value("${liquidnet.shunfeng.appid}")
private String appid;*/
@Autowired
private PerformancesExpressServiceImpl performancesExpressServiceImpl;
......
......@@ -126,7 +126,7 @@
},
{
field: '',
title: '收用户',
title: '收用户',
formatter: function(value, row, index) {
var expressContacts = row.expressContacts;
var expressAddress = row.expressAddress;
......
......@@ -46,16 +46,14 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinOrderExpres
private String jCompany;
@Value("${liquidnet.shunfeng.jContact}")
private String jContact;
@Value("${liquidnet.shunfeng.jMobile}")
private String jMobile;
@Value("${liquidnet.shunfeng.jTel}")
private String jTel;
@Value("${liquidnet.shunfeng.jProvince}")
private String jProvince;
@Value("${liquidnet.shunfeng.jCity}")
private String jCity;
@Value("${liquidnet.shunfeng.jAddress}")
private String jAddress;
@Value("${liquidnet.shunfeng.payMethod}")
private Integer payMethod;
@Value("${liquidnet.shunfeng.expressType}")
private Integer expressType;
@Value("${liquidnet.shunfeng.depositumInfo}")
......@@ -99,38 +97,56 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinOrderExpres
public ResponseDto placeOrder(PerformanceExpressSearchAdminParam performanceExpressSearchAdminParam) {
List<String> ids = performanceExpressSearchAdminParam.getIds();
for (String orderTicketsId : ids) {
// 已经存在未取消的下单数据过滤掉
KylinOrderExpress orderExpressInfo = kylinOrderExpressMapper.selectOne(
new QueryWrapper<KylinOrderExpress>().eq("order_express_id", orderTicketsId)
.ne("express_status", KylinTableStatusConst.ORDER_EXPRESS_STATUS3)
);
if (null != orderExpressInfo) {
continue;
}
KylinOrderTickets orderInfo = kylinOrderTicketsMapper.selectOne(
new QueryWrapper<KylinOrderTickets>().eq("order_tickets_id", orderTicketsId)
);
HashMap<String, Object> hBody = new HashMap<>();
// 生成预快递单 防止因失败没办法再次发起也不能主动获取数据
KylinOrderExpress kylinOrderExpressPre = new KylinOrderExpress();
String orderExpressId = IDGenerator.nextSnowId();
kylinOrderExpressPre.setExpressStatus(KylinTableStatusConst.ORDER_EXPRESS_STATUS1);
kylinOrderExpressPre.setOrderExpressId(orderExpressId);
kylinOrderExpressPre.setOrderTicketsId(orderTicketsId);
// 防止重复前面加上 "NEW" 因取消后再发起订单号也不能一致所有后面做补位操作
Integer placeCount = kylinOrderExpressMapper.selectCount(
new QueryWrapper<KylinOrderExpress>()
.eq("order_tickets_id", orderTicketsId)
);
String codeNum = StringUtils.leftPad(String.valueOf(placeCount), 3, "0");
String OrderExpressCode = "NEW" + orderInfo.getOrderCode().concat(codeNum);
kylinOrderExpressPre.setOrderExpressCode(OrderExpressCode);
kylinOrderExpressPre.setExpressType(expressType);
kylinOrderExpressPre.setCreatedAt(DateUtil.getNowTime());
kylinOrderExpressMapper.insert(kylinOrderExpressPre);
// 请求下单数据
HashMap<String, Object> hBody = new HashMap<>();
hBody.put("custid", custid);
hBody.put("jCompany", jCompany);
hBody.put("jContact", jContact);
// hBody.put("jTel", "010");
hBody.put("jMobile", jMobile);
hBody.put("jTel", jTel);
hBody.put("jProvince", jProvince);
hBody.put("jCity", jCity);
hBody.put("jAddress", jAddress);
hBody.put("payMethod", payMethod);// 运费付款方式:0-寄付月结;1-寄付现结;2-收方付;3-第三方付;
hBody.put("payMethod", 0);// 运费付款方式:0-寄付月结;1-寄付现结;2-收方付;3-第三方付;
hBody.put("expressType", expressType);// 顺丰特快
hBody.put("depositumInfo", depositumInfo);
Integer placeCount = kylinOrderExpressMapper.selectCount(
new QueryWrapper<KylinOrderExpress>()
.eq("order_tickets_id", orderTicketsId)
);
String codeNum = StringUtils.leftPad(String.valueOf(placeCount), 3, "0");
String OrderExpressCode = "NEW"+orderInfo.getOrderCode().concat(codeNum);
hBody.put("orderId", OrderExpressCode);
hBody.put("depositumNo", orderInfo.getNumber());
hBody.put("dContact", orderInfo.getExpressContacts());
hBody.put("dMobile", orderInfo.getExpressPhone());
// hBody.put("dProvince", "北京");
// hBody.put("dCity", "北京市");
hBody.put("dAddress", orderInfo.getExpressAddress());
// 时间戳
......@@ -146,13 +162,8 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinOrderExpres
} else {
HashMap hashMapResult = (HashMap) hashMap.get("result");
KylinOrderExpress kylinOrderExpress = new KylinOrderExpress();
String orderExpressId = IDGenerator.nextSnowId();
kylinOrderExpress.setExpressStatus(KylinTableStatusConst.ORDER_EXPRESS_STATUS1);
kylinOrderExpress.setOrderExpressId(orderExpressId);
kylinOrderExpress.setOrderTicketsId(orderTicketsId);
kylinOrderExpress.setOrderExpressCode(OrderExpressCode);
kylinOrderExpress.setExpressStatus(KylinTableStatusConst.ORDER_EXPRESS_STATUS2);
kylinOrderExpress.setMailno((String) hashMapResult.get("mailno"));
kylinOrderExpress.setExpressType(expressType);
kylinOrderExpress.setFilterResult(hashMapResult.get("filter_result").toString());
kylinOrderExpress.setRemark((String) hashMapResult.get("remark"));
kylinOrderExpress.setOrigincode((String) hashMapResult.get("origincode"));
......@@ -160,8 +171,11 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinOrderExpres
kylinOrderExpress.setPrintIcon((String) hashMapResult.get("printIcon"));
kylinOrderExpress.setPrintFlag((String) hashMapResult.get("printFlag"));
kylinOrderExpress.setTwoDimensionCode((String) hashMapResult.get("twoDimensionCode"));
kylinOrderExpress.setCreatedAt(DateUtil.getNowTime());
kylinOrderExpressMapper.insert(kylinOrderExpress);
kylinOrderExpress.setUpdatedAt(DateUtil.getNowTime());
kylinOrderExpressMapper.update(
kylinOrderExpress
, new UpdateWrapper<KylinOrderExpress>().in("order_express_id", orderExpressId)
);
}
}
return ResponseDto.success();
......@@ -171,8 +185,8 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinOrderExpres
List<String> ids = performanceExpressSearchAdminParam.getIds();
for (String orderTicketsId : ids) {
KylinOrderExpress orderExpressInfo = kylinOrderExpressMapper.selectOne(
new QueryWrapper<KylinOrderExpress>().eq("order_tickets_id", orderTicketsId)
.ne("express_status", KylinTableStatusConst.ORDER_EXPRESS_STATUS2)
new QueryWrapper<KylinOrderExpress>().eq("order_express_id", orderTicketsId)
.ne("express_status", KylinTableStatusConst.ORDER_EXPRESS_STATUS3)
);
if (null != orderExpressInfo) {
HashMap<String, Object> hBody = new HashMap<>();
......@@ -190,7 +204,7 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinOrderExpres
return ResponseDto.failure(msg);
} else {
KylinOrderExpress kylinOrderExpress = new KylinOrderExpress();
kylinOrderExpress.setExpressStatus(KylinTableStatusConst.ORDER_EXPRESS_STATUS2);
kylinOrderExpress.setExpressStatus(KylinTableStatusConst.ORDER_EXPRESS_STATUS3);
kylinOrderExpress.setUpdatedAt(DateUtil.getNowTime());
kylinOrderExpressMapper.update(
kylinOrderExpress
......@@ -207,21 +221,14 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinOrderExpres
for (String orderTicketsId : ids) {
KylinOrderExpress orderExpressInfo = kylinOrderExpressMapper.selectOne(
new QueryWrapper<KylinOrderExpress>().eq("order_tickets_id", orderTicketsId)
.ne("express_status", KylinTableStatusConst.ORDER_EXPRESS_STATUS2)
.ne("express_status", KylinTableStatusConst.ORDER_EXPRESS_STATUS3)
);
if (null != orderExpressInfo) {
KylinOrderTickets orderInfo = kylinOrderTicketsMapper.selectOne(
new QueryWrapper<KylinOrderTickets>().eq("order_tickets_id", orderTicketsId)
);
Integer placeCount = kylinOrderExpressMapper.selectCount(
new QueryWrapper<KylinOrderExpress>()
.eq("order_tickets_id", orderTicketsId)
);
String codeNum = StringUtils.leftPad(String.valueOf(placeCount), 3, "0");
String OrderExpressCode = "NEW"+orderInfo.getOrderCode().concat(codeNum);
HashMap<String, Object> hBody = new HashMap<>();
hBody.put("orderId", OrderExpressCode);
hBody.put("orderId", orderExpressInfo.getOrderExpressCode());
hBody.put("searchType", 1); //查询类型:1,正向单查询,传入的orderid为正向定单号,2,退货单查询,传入的orderid为退货原始订单号
// 时间戳
......@@ -237,13 +244,8 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinOrderExpres
} else {
HashMap hashMapResult = (HashMap) hashMap.get("result");
KylinOrderExpress kylinOrderExpress = new KylinOrderExpress();
String orderExpressId = IDGenerator.nextSnowId();
kylinOrderExpress.setExpressStatus(KylinTableStatusConst.ORDER_EXPRESS_STATUS1);
kylinOrderExpress.setOrderExpressId(orderExpressId);
kylinOrderExpress.setOrderTicketsId(orderTicketsId);
kylinOrderExpress.setOrderExpressCode(OrderExpressCode);
kylinOrderExpress.setExpressStatus(KylinTableStatusConst.ORDER_EXPRESS_STATUS2);
kylinOrderExpress.setMailno((String) hashMapResult.get("mailno"));
kylinOrderExpress.setExpressType(expressType);
kylinOrderExpress.setFilterResult(hashMapResult.get("filter_result").toString());
kylinOrderExpress.setRemark((String) hashMapResult.get("remark"));
kylinOrderExpress.setOrigincode((String) hashMapResult.get("origincode"));
......@@ -251,8 +253,11 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinOrderExpres
kylinOrderExpress.setPrintIcon((String) hashMapResult.get("printIcon"));
kylinOrderExpress.setPrintFlag((String) hashMapResult.get("printFlag"));
kylinOrderExpress.setTwoDimensionCode((String) hashMapResult.get("twoDimensionCode"));
kylinOrderExpress.setCreatedAt(DateUtil.getNowTime());
kylinOrderExpressMapper.insert(kylinOrderExpress);
kylinOrderExpress.setUpdatedAt(DateUtil.getNowTime());
kylinOrderExpressMapper.update(
kylinOrderExpress
, new UpdateWrapper<KylinOrderExpress>().in("order_express_id", orderExpressInfo.getOrderExpressId())
);
}
}
}
......
......@@ -45,14 +45,13 @@ liquidnet:
appid: ${liquidnet.client.admin.shunfeng.appid}
custid: ${liquidnet.client.admin.shunfeng.custid}
jCompany: 北京正在映画互联网有限公司
jContact: 姜秀龙
jMobile: 15811009011
jContact: 摩登天空票务部
jTel: 4001680650
jProvince: 北京
jCity: 北京市
jAddress: 朝阳区广渠路1号北京市商业储运公司3-12号 摩登天空
payMethod: 0
expressType: 1
depositumInfo: 演出票
expressType: 1 # 默认顺丰特快
depositumInfo: 演出纸质票
# 开发环境配置
server:
......
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