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

Commit 46f28e37 authored by jiangxiulong's avatar jiangxiulong

Merge branch 'dev' into test

parents 6afb4341 ab5b0019
...@@ -3,6 +3,7 @@ package com.liquidnet.client.admin.web.controller.zhengzai.kylin; ...@@ -3,6 +3,7 @@ package com.liquidnet.client.admin.web.controller.zhengzai.kylin;
import com.liquidnet.client.admin.common.core.controller.BaseController; import com.liquidnet.client.admin.common.core.controller.BaseController;
import com.liquidnet.client.admin.common.core.page.TableDataInfo; import com.liquidnet.client.admin.common.core.page.TableDataInfo;
import com.liquidnet.client.admin.zhengzai.kylin.service.impl.PerformancesExpressServiceImpl; import com.liquidnet.client.admin.zhengzai.kylin.service.impl.PerformancesExpressServiceImpl;
import com.liquidnet.client.admin.zhengzai.kylin.utils.ShunfengSignUtils;
import com.liquidnet.service.kylin.dao.PerformanceExpressPerformanceListAdminDao; import com.liquidnet.service.kylin.dao.PerformanceExpressPerformanceListAdminDao;
import com.liquidnet.service.kylin.dao.PerformanceExpressPerformanceOrderListAdminDao; import com.liquidnet.service.kylin.dao.PerformanceExpressPerformanceOrderListAdminDao;
import com.liquidnet.service.kylin.dto.param.PerformanceExpressSearchAdminParam; import com.liquidnet.service.kylin.dto.param.PerformanceExpressSearchAdminParam;
...@@ -75,4 +76,23 @@ public class PerformancesExpressController extends BaseController { ...@@ -75,4 +76,23 @@ public class PerformancesExpressController extends BaseController {
return getDataTable(result); return getDataTable(result);
} }
/**
* 下单
*/
@RequiresPermissions("kylin:performancesExpress:placeOrder")
@PostMapping("/placeOrder")
@ResponseBody
public boolean placeOrder() {
// 请求body companyId参数值和APPID一致!!!
String body="{\"dContact\":\"王昆\",\"companyId\":{{APP_ID}},\"jContact\":\"顺丰\",\"jTel\":\"111\",\"jMobile\":null,\"jAddress\":\"马甸\",\"dTel\":\"064756935\",\"dMobile\":null,\"dAddress\":\"北京市朝阳区花家地金兴路1号院5号楼1单元202\",\"custid\":\"7551234567\",\"payMethod\":\"0\",\"expressType\":\"1\",\"packagesNo\":\"1\",\"depositumInfo\":\"TCL空调\",\"depositumNo\":\"1\",\"remark\":null,\"isCollection\":\"1\",\"collectionMoney\":\"10.00\",\"isReceipt\":\"0\",\"receipt\":null}";
// 时间戳
long currentTimeMillis = System.currentTimeMillis();
System.out.println("时间戳:"+currentTimeMillis);
// 生成签名并请求
String result = ShunfengSignUtils.generateSignatureAndRequest(currentTimeMillis + "", body);
System.out.println("响应:"+result);
return true;
}
} }
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<configuration> <configuration>
<!-- 日志存放路径 --> <!-- 日志存放路径 -->
<property name="log.path" value="./logs/client-admin-web" /> <property name="log.path" value="/data/logs/client-admin-web" />
<!-- 日志输出格式 --> <!-- 日志输出格式 -->
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" /> <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
......
...@@ -94,19 +94,17 @@ ...@@ -94,19 +94,17 @@
return $.table.selectDictLabel(orderStatusDic, value); return $.table.selectDictLabel(orderStatusDic, value);
} }
}, },
{
field: 'priceExpress',
title: '快递费'
},
{ {
field: '', field: '',
title: '快递方式', title: '快递',
formatter: function (value, row, index) { formatter: function (value, row, index) {
var expressType = '';
if (row.expressType == 1) { if (row.expressType == 1) {
return "寄付"; expressType = "寄付";
} else { } else {
return "到付"; expressType = "到付";
} }
return '快递方式:'+expressType+'<br>'+'快递费:'+row.priceExpress;
} }
}, },
{ {
...@@ -127,7 +125,7 @@ ...@@ -127,7 +125,7 @@
var expressContacts = row.expressContacts; var expressContacts = row.expressContacts;
var expressAddress = row.expressAddress; var expressAddress = row.expressAddress;
var expressPhone = row.expressPhone; var expressPhone = row.expressPhone;
return '姓名:'+expressContacts+'<br>'+'手机号:'+expressPhone+'<br>'+'地址:'+expressPhone; return '姓名:'+expressContacts+'<br>'+'手机号:'+expressPhone+'<br>'+'地址:'+expressAddress;
} }
}, },
{ {
......
package com.liquidnet.client.admin.zhengzai.kylin.utils;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.springframework.beans.factory.annotation.Value;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
/**
* <p>
* 顺丰
* </p>
*
* @author jiangxiulong
* @since 2021-06-24 8:00 下午
*/
public class ShunfengSignUtils {
/**
* appId
*/
@Value("${liquidnet.shunfeng.appid}")
private static String APP_ID = "";
/**
* sk
*/
@Value("${liquidnet.shunfeng.sk}")
private static String SK = "";
/**
* 签名有效期(可根据实际业务设定)单位:毫秒
*/
private final static Long CHECK_TIME = 600000L;
/**
* 生成签名并请求
* @param timestamp 时间戳
* @param body 请求body
* @return
*/
public static String generateSignatureAndRequest(String timestamp, String body) {
// 生成签名
String sign = genSign(timestamp,body);
System.out.println("签名:"+sign);
CloseableHttpClient client = HttpClients.createDefault();
// 请求下单地址
HttpPost httpPost = new HttpPost("https://butler-dev-ms.sf-express.com/public/order/v1/placeOrder");
// sendAppId(sendAppId需赋值appId)
httpPost.addHeader("sendAppId", APP_ID);
// 时间戳需和获取验签时一致!!!
httpPost.addHeader("timestamp", timestamp);
// 签名
httpPost.addHeader("sign", sign);
httpPost.addHeader("Content-Type", "application/json;charset=utf-8");
// 请求body体需和获取验签时一致且编码UTF8!!!
httpPost.setEntity(new StringEntity(body, "utf-8"));
CloseableHttpResponse response = null;
try {
response = client.execute(httpPost);
if (response.getStatusLine().getStatusCode() == 200) {
System.out.println("发送请求成功");
HttpEntity entity = response.getEntity();
// 发送响应且编码UTF8!!!
return EntityUtils.toString(entity, "utf-8");
}
} catch (Exception e) {
System.out.println("发送请求失败");
e.printStackTrace();
} finally {
if (client != null) {
try {
client.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (response != null) {
try {
response.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return null;
}
/**
* 生成签名
* @param timestamp 时间戳
* @param body 请求body
* @return
*/
private static String genSign(String timestamp, String body) {
if (StringUtils.isEmpty(body)) {
body = "";
}
StringBuffer sb = new StringBuffer();
sb.append(body);
sb.append("&sk=").append(SK);
sb.append("&timestamp=").append(timestamp);
byte[] bytes = DigestUtils.sha512(sb.toString());
return Base64.encodeBase64URLSafeString(bytes);
}
/**
* 接收请求且验签(可在控制层调用此方法)
* @param params 接收请求参数
* @param request 接收请求
* @return
*/
public static boolean receiveRequestAndCheckSign(String params, HttpServletRequest request) {
// 请求方APPID
String sendAppId = request.getHeader("sendAppId");
// 请求方时间戳
String timestamp = request.getHeader("timestamp");
// 请求方签名
String sign = request.getHeader("sign");
if (StringUtils.isBlank(sendAppId)) {
System.out.println("参数sendAppId不能为空");
return false;
}
if (StringUtils.isBlank(timestamp)) {
System.out.println("参数timestamp不能为空");
return false;
}
if (StringUtils.isBlank(sign)) {
System.out.println("参数sign不能为空");
return false;
}
// 校验签名是否过期
long requestTime = Long.parseLong(timestamp);
long now = System.currentTimeMillis();
if (Math.abs(now - requestTime) > CHECK_TIME) {
System.out.println("签名过期!");
return false;
}
// 请求方参数+请求方时间戳+SK 生成签名
String thisSign = ShunfengSignUtils.genSign(timestamp, params);
// 获取的签名和请求方签名比较是否一致
if (!thisSign.equals(sign)) {
System.out.println("签名错误");
return false;
}
return true;
}
}
...@@ -37,7 +37,7 @@ public abstract class DateUtil { ...@@ -37,7 +37,7 @@ public abstract class DateUtil {
yyyyMMddHHmmss("yyyy-MM-dd HH:mm:ss"), yyyyMMddHHmmss("yyyy-MM-dd HH:mm:ss"),
yyyyMMddHHmmssTrim("yyyyMMddHHmmss"), yyyyMMddHHmmssTrim("yyyyMMddHHmmss"),
yyyyMMddHHmmssSSS("yyyyMMddHHmmssSSS"), yyyyMMddHHmmssSSS("yyyyMMddHHmmssSSS"),
yyyyMMddHHmmssSSSUnTrim("yyyyMMddHHmmssSSS"), yyyyMMddHHmmssSSSUnTrim("yyyy-MM-dd HH:mm:ss:SSS"),
yyyyMMddHHmmssS("yyyy-MM-dd HH:mm:ss.S"), yyyyMMddHHmmssS("yyyy-MM-dd HH:mm:ss.S"),
ddHHmmssTrim("ddHHmmss"), ddHHmmssTrim("ddHHmmss"),
yyyy_MM_dd_zh("yyyy年MM月dd日"), yyyy_MM_dd_zh("yyyy年MM月dd日"),
......
...@@ -42,6 +42,6 @@ public class UserPathDto implements Serializable { ...@@ -42,6 +42,6 @@ public class UserPathDto implements Serializable {
instance.params = params.toString().equals("") ? "NanParams" : params.toString(); instance.params = params.toString().equals("") ? "NanParams" : params.toString();
instance.result = result.toString().equals("") ? "NanResults" : result.toString(); instance.result = result.toString().equals("") ? "NanResults" : result.toString();
instance.userAgent = ServletUtils.getRequest().getHeader("User-Agent"); instance.userAgent = ServletUtils.getRequest().getHeader("User-Agent");
return "MDSKY.NOW.ELK." + uid == "UID" ? CurrentUtil.getCliIpAddr() : uid + " = " + JsonUtils.toJson(instance); return "MDSKY.NOW.ELK." + (uid.equals("UID") ? CurrentUtil.getCliIpAddr() : uid )+ " = " + JsonUtils.toJson(instance);
} }
} }
...@@ -61,23 +61,27 @@ server: ...@@ -61,23 +61,27 @@ server:
# 日志配置------------------------------------------------------- # 日志配置-------------------------------------------------------
logging: logging:
# config: ${liquidnet.logfile.config}
file:
name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}.log
max-size: 200MB
pattern:
file: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n'
console: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n'
rolling-file-name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}-%d{yyyy-MM-dd}.%i.log
level: level:
root: info com.ruoyi: debug
#以下是为指定包设置日志级别 org.springframework: warn
com: #logging:
liquidnet: # # config: ${liquidnet.logfile.config}
client: # file:
admin: debug # name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}.log
org: # max-size: 200MB
springframework: warn # pattern:
# file: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n'
# console: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n'
# rolling-file-name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}-%d{yyyy-MM-dd}.%i.log
# level:
# root: info
# #以下是为指定包设置日志级别
# com:
# liquidnet:
# client:
# admin: debug
# org:
# springframework: warn
# ----------------------------------------------------------- # -----------------------------------------------------------
......
...@@ -16,9 +16,9 @@ public class PerformanceExpressPerformanceOrderListAdminDao { ...@@ -16,9 +16,9 @@ public class PerformanceExpressPerformanceOrderListAdminDao {
String userName; String userName;
String userMobile; String userMobile;
String express_contacts; String expressContacts;
String express_address; String expressAddress;
String express_phone; String expressPhone;
Integer expressType; Integer expressType;
......
...@@ -798,6 +798,7 @@ public class DataImpl { ...@@ -798,6 +798,7 @@ public class DataImpl {
} }
roadShowsList.add(roadShows); roadShowsList.add(roadShows);
} }
kylinRoadShowsService.saveBatch(roadShowsList);
return true; return true;
} catch (Exception e) { } catch (Exception e) {
......
...@@ -376,7 +376,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM ...@@ -376,7 +376,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
currentTime = System.currentTimeMillis(); currentTime = System.currentTimeMillis();
AdamAddressesVo addressesVo = orderUtils.getAddress(uid, payOrderParam.getAddressId());//feignAdamBaseClient.queryAddresses(payOrderParam.getAddressId(), uid).getData(); AdamAddressesVo addressesVo = orderUtils.getAddress(uid, payOrderParam.getAddressId());//feignAdamBaseClient.queryAddresses(payOrderParam.getAddressId(), uid).getData();
orderTickets.setExpressContacts(addressesVo.getName()); orderTickets.setExpressContacts(addressesVo.getName());
orderTickets.setExpressAddress(addressesVo.getAddress()); orderTickets.setExpressAddress(addressesVo.getProvince()+addressesVo.getCity()+addressesVo.getCounty()+addressesVo.getAddress());
orderTickets.setExpressPhone(addressesVo.getPhone()); orderTickets.setExpressPhone(addressesVo.getPhone());
orderTickets.setGetTicketType("express"); orderTickets.setGetTicketType("express");
currentTime = System.currentTimeMillis() - currentTime; currentTime = System.currentTimeMillis() - currentTime;
...@@ -412,7 +412,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM ...@@ -412,7 +412,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
//生成订单 order_ticket_relation //生成订单 order_ticket_relation
KylinOrderTicketRelations orderTicketRelations = new KylinOrderTicketRelations(); KylinOrderTicketRelations orderTicketRelations = new KylinOrderTicketRelations();
String orderTicketRelationId = IDGenerator.nextSnowId().toString(); String orderTicketRelationId = IDGenerator.nextSnowId();
orderTicketRelations.setOrderTicketRelationsId(orderTicketRelationId); orderTicketRelations.setOrderTicketRelationsId(orderTicketRelationId);
orderTicketRelations.setOrderId(orderTicketId); orderTicketRelations.setOrderId(orderTicketId);
orderTicketRelations.setTransferId(""); orderTicketRelations.setTransferId("");
...@@ -706,10 +706,9 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM ...@@ -706,10 +706,9 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
map.put("payCode", payResultVo.getCode()); map.put("payCode", payResultVo.getCode());
map.put("updatedAt", DateUtil.Formatter.yyyyMMddHHmmss.format(orderTickets.getUpdatedAt())); map.put("updatedAt", DateUtil.Formatter.yyyyMMddHHmmss.format(orderTickets.getUpdatedAt()));
map.put("changeDate", orderTickets.getUpdatedAt()); map.put("changeDate", orderTickets.getUpdatedAt());
Document doc = mongoTemplate.getCollection(KylinOrderTicketVo.class.getSimpleName()).findOneAndUpdate( mongoTemplate.getCollection(KylinOrderTicketVo.class.getSimpleName()).updateOne(
Query.query(Criteria.where("orderTicketsId").is(payAgainParam.getOrderId())).getQueryObject(), Query.query(Criteria.where("orderTicketsId").is(payAgainParam.getOrderId())).getQueryObject(),
new BasicDBObject("$set", mongoConverter.convertToMongoType(map)), new BasicDBObject("$set", mongoConverter.convertToMongoType(map))
new FindOneAndUpdateOptions().returnDocument(ReturnDocument.BEFORE)
); );
LocalDateTime strTime = orderTicketData.getChangeDate(); LocalDateTime strTime = orderTicketData.getChangeDate();
...@@ -835,7 +834,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM ...@@ -835,7 +834,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
orderTicketEntitiesVo.put("updatedAt", timePay); orderTicketEntitiesVo.put("updatedAt", timePay);
orderTicketEntitiesVo.put("changeDate", now); orderTicketEntitiesVo.put("changeDate", now);
mongoTemplate.getCollection(KylinOrderTicketEntitiesVo.class.getSimpleName()).updateMany( mongoTemplate.getCollection(KylinOrderTicketEntitiesVo.class.getSimpleName()).updateMany(
Query.query(Criteria.where("orderId").is(orderTickets.getOrderTicketsId())).getQueryObject(), Query.query(Criteria.where("orderId").is(orderTicketData.getOrderTicketsId())).getQueryObject(),
new BasicDBObject("$set", mongoConverter.convertToMongoType(orderTicketEntitiesVo)) new BasicDBObject("$set", mongoConverter.convertToMongoType(orderTicketEntitiesVo))
); );
......
...@@ -302,7 +302,7 @@ public class KylinPerformancesServiceImpl extends ServiceImpl<KylinPerformancesM ...@@ -302,7 +302,7 @@ public class KylinPerformancesServiceImpl extends ServiceImpl<KylinPerformancesM
query.fields().exclude("noticeImage"); query.fields().exclude("noticeImage");
query.fields().exclude("ticketTimeList"); query.fields().exclude("ticketTimeList");
Sort sortName = Sort.by(Sort.Direction.ASC, "timeStart"); Sort sortName = Sort.by(Sort.Direction.DESC, "timeStart");
Pageable pageable = PageRequest.of(page - 1, size, sortName); Pageable pageable = PageRequest.of(page - 1, size, sortName);
query.with(pageable); query.with(pageable);
......
...@@ -10,7 +10,7 @@ kylin_order_ticket_status.add=INSERT INTO kylin_order_ticket_status(order_ticket ...@@ -10,7 +10,7 @@ kylin_order_ticket_status.add=INSERT INTO kylin_order_ticket_status(order_ticket
kylin_order_ticket_entities.add=INSERT INTO kylin_order_ticket_entities(order_ticket_entities_id ,order_id ,ticket_id ,user_id ,time_id ,performance_id ,enter_type ,enter_name ,enter_mobile,enter_id_code,`status`,sys_damai,check_client,is_payment,`comment`,created_at,updated_at)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) kylin_order_ticket_entities.add=INSERT INTO kylin_order_ticket_entities(order_ticket_entities_id ,order_id ,ticket_id ,user_id ,time_id ,performance_id ,enter_type ,enter_name ,enter_mobile,enter_id_code,`status`,sys_damai,check_client,is_payment,`comment`,created_at,updated_at)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
# ------------------------再次支付---------------------------- # ------------------------再次支付----------------------------
kylin_order_ticket.payAgain=UPDATE kylin_order_tickets SET order_code = ? , updated_at = ? WHERE order_tickets_id = ? and (updated_at <= ? or created_at = ?) kylin_order_ticket.payAgain=UPDATE kylin_order_tickets SET updated_at = ? , order_code = ? WHERE order_tickets_id = ? and (updated_at <= ? or created_at = ?)
kylin_order_ticket_status.payAgain=UPDATE kylin_order_ticket_status SET updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ?) kylin_order_ticket_status.payAgain=UPDATE kylin_order_ticket_status SET updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ?)
kylin_order_ticket_relation.payAgain=UPDATE kylin_order_ticket_relations SET updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ?) kylin_order_ticket_relation.payAgain=UPDATE kylin_order_ticket_relations SET updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ?)
......
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