提交
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
spring:
|
spring:
|
||||||
datasource:
|
datasource:
|
||||||
url: jdbc:mysql://rm-bp1uo9iq250st2e69.mysql.rds.aliyuncs.com:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
|
url: jdbc:mysql://rm-bp1uo9iq250st2e691o.mysql.rds.aliyuncs.com:3306/chaozhanggui?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useJDBCCompliantTimezoneShift=true&serverTimezone=CTT&useSSL=false
|
||||||
username: root
|
username: root
|
||||||
password: prodCZGmysqlroot@123
|
password: prodCZGmysqlroot@123
|
||||||
driver-class-name: com.mysql.jdbc.Driver
|
driver-class-name: com.mysql.jdbc.Driver
|
||||||
|
|||||||
@@ -1,14 +1,17 @@
|
|||||||
# 测试服务器上的数据库连接
|
# 测试服务器上的数据库连接
|
||||||
spring:
|
spring:
|
||||||
datasource:
|
datasource:
|
||||||
url: jdbc:mysql://127.0.0.1:3306/ysk_test?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
|
url: jdbc:mysql://101.37.12.135:3306/ysk_test?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
|
||||||
username: ysk_test
|
username: ysk_test
|
||||||
password: CZGmysqlroot@123
|
password: mysqlroot@123
|
||||||
driver-class-name: com.mysql.jdbc.Driver
|
driver-class-name: com.mysql.jdbc.Driver
|
||||||
|
|
||||||
parameter:
|
parameter:
|
||||||
domain: https://wxgzh.sxczgkj.cn
|
domain: https://p40312246f.goho.co
|
||||||
|
|
||||||
swagger:
|
swagger:
|
||||||
### 生产环境不允许访问swagger
|
### 生产环境不允许访问swagger
|
||||||
production: true
|
production: true
|
||||||
|
hf:
|
||||||
|
pay:
|
||||||
|
callBack: https://p40312246f.goho.co/wap/notify/hfCallBack
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ spring:
|
|||||||
profiles:
|
profiles:
|
||||||
### 将一些固定的配置放到下级文件夹下的yml文件中
|
### 将一些固定的配置放到下级文件夹下的yml文件中
|
||||||
include: common, ryx, ys
|
include: common, ryx, ys
|
||||||
active: dev
|
active: prod
|
||||||
mvc:
|
mvc:
|
||||||
view:
|
view:
|
||||||
prefix: /WEB-INF/jsp/
|
prefix: /WEB-INF/jsp/
|
||||||
|
|||||||
@@ -613,6 +613,10 @@ public class DateUtils {
|
|||||||
private final static SimpleDateFormat sdfTimes = new SimpleDateFormat("yyyyMMddHHmmss");
|
private final static SimpleDateFormat sdfTimes = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||||
private final static SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
private final static SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private final static SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
public static String getSdfTimes() {
|
public static String getSdfTimes() {
|
||||||
return sdfTimes.format(new Date());
|
return sdfTimes.format(new Date());
|
||||||
}
|
}
|
||||||
@@ -625,6 +629,11 @@ public class DateUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static String convertString(String str){
|
public static String convertString(String str){
|
||||||
StringBuilder stringBuilder=new StringBuilder();
|
StringBuilder stringBuilder=new StringBuilder();
|
||||||
stringBuilder.append(str.substring(0,4));
|
stringBuilder.append(str.substring(0,4));
|
||||||
@@ -637,10 +646,38 @@ public class DateUtils {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static Date convertDate1(String date) {
|
||||||
|
try {
|
||||||
|
return sdf1.parse(date);
|
||||||
|
} catch (ParseException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static Date convertDateByString(String str){
|
||||||
|
StringBuilder sb=new StringBuilder();
|
||||||
|
sb.append(str.substring(0,4));
|
||||||
|
sb.append("-");
|
||||||
|
sb.append(str.substring(4,6));
|
||||||
|
sb.append("-");
|
||||||
|
sb.append(str.substring(6,8));
|
||||||
|
sb.append(" ");
|
||||||
|
sb.append(str.substring(8,10));
|
||||||
|
sb.append(":");
|
||||||
|
sb.append(str.substring(10,12));
|
||||||
|
sb.append(":");
|
||||||
|
sb.append(str.substring(12,14));
|
||||||
|
|
||||||
|
return convertDate1(sb.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void main(String[] args) throws ParseException {
|
public static void main(String[] args) throws ParseException {
|
||||||
|
|
||||||
|
|
||||||
System.out.println(DateUtils.parse("20230707172528","yyyyMMddHHmmss"));
|
System.out.println(DateUtils.convertDateByString("20240121141246"));
|
||||||
//List<String> last6Months = getLast6Months();
|
//List<String> last6Months = getLast6Months();
|
||||||
// List<String> last6Months = new ArrayList<>();
|
// List<String> last6Months = new ArrayList<>();
|
||||||
// last6Months.add("2019-11");
|
// last6Months.add("2019-11");
|
||||||
|
|||||||
@@ -315,10 +315,10 @@ public class HfPayServiceImpl implements PayService {
|
|||||||
MsgException.check(true, "商户信息不完整");
|
MsgException.check(true, "商户信息不完整");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String order_amt = changeY2F(order.getConsumeFee());
|
||||||
Map<String, Object> refundParams = new HashMap<String, Object>();
|
Map<String, Object> refundParams = new HashMap<String, Object>();
|
||||||
String refundNo = "adapay_refund_order_" + SnowFlakeUtil.nextId();
|
String refundNo = "HF_refund_order_" + SnowFlakeUtil.nextId();
|
||||||
refundParams.put("refund_amt", order.getConsumeFee());
|
refundParams.put("refund_amt", order_amt);
|
||||||
refundParams.put("refund_order_no", refundNo);
|
refundParams.put("refund_order_no", refundNo);
|
||||||
refundParams.put("notify_url", callBack);
|
refundParams.put("notify_url", callBack);
|
||||||
Map<String, Object> adapay = null;
|
Map<String, Object> adapay = null;
|
||||||
@@ -328,6 +328,8 @@ public class HfPayServiceImpl implements PayService {
|
|||||||
result.put("code", ResultCode.FAIL.code());
|
result.put("code", ResultCode.FAIL.code());
|
||||||
try {
|
try {
|
||||||
init(hfInfo.getLive_api_key(), hfInfo.getTest_api_key(), hfInfo.getPriv_key());
|
init(hfInfo.getLive_api_key(), hfInfo.getTest_api_key(), hfInfo.getPriv_key());
|
||||||
|
|
||||||
|
log.info("request:{}",refundParams.toString());
|
||||||
adapay = Refund.create(order.getTransNo(), refundParams);
|
adapay = Refund.create(order.getTransNo(), refundParams);
|
||||||
log.info("payment result=" + JSON.toJSONString(adapay));
|
log.info("payment result=" + JSON.toJSONString(adapay));
|
||||||
if ("pending".equals(adapay.get("status"))) {
|
if ("pending".equals(adapay.get("status"))) {
|
||||||
@@ -431,7 +433,7 @@ public class HfPayServiceImpl implements PayService {
|
|||||||
log.error("====================>【汇付】支付成功回调订单号查询,查询的订单为空:订单号:{}<====================", orderNo);
|
log.error("====================>【汇付】支付成功回调订单号查询,查询的订单为空:订单号:{}<====================", orderNo);
|
||||||
return YsConfig.RESULT_SUCCESS_CODE;
|
return YsConfig.RESULT_SUCCESS_CODE;
|
||||||
}
|
}
|
||||||
Date payDate = new Date(Long.valueOf(data.get("created_time").toString()) * 1000);
|
Date payDate = DateUtils.convertDateByString(data.get("created_time").toString());
|
||||||
order.setTransDt(payDate);
|
order.setTransDt(payDate);
|
||||||
order.setTransNo(data.get("id").toString());
|
order.setTransNo(data.get("id").toString());
|
||||||
order.setThirdTransNo(data.get("id").toString());
|
order.setThirdTransNo(data.get("id").toString());
|
||||||
@@ -466,6 +468,11 @@ public class HfPayServiceImpl implements PayService {
|
|||||||
case "payment.close.failed":
|
case "payment.close.failed":
|
||||||
break;
|
break;
|
||||||
case "refund.succeeded":
|
case "refund.succeeded":
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "refund.failed":
|
case "refund.failed":
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -2170,9 +2170,10 @@ public class MerchantOrderServiceImpl extends ServiceImpl<MerchantOrderMapper, M
|
|||||||
@Transactional(rollbackFor = Exception.class,propagation = Propagation.NOT_SUPPORTED)
|
@Transactional(rollbackFor = Exception.class,propagation = Propagation.NOT_SUPPORTED)
|
||||||
public void updateOrderAndCreateProfit(MerchantOrder order) {
|
public void updateOrderAndCreateProfit(MerchantOrder order) {
|
||||||
Integer row = queueDataService.newQueueData(order.getOrderNumber());
|
Integer row = queueDataService.newQueueData(order.getOrderNumber());
|
||||||
|
log.info("orderNumber:{}",order.getOrderNumber());
|
||||||
if(row > 0){
|
if(row > 0){
|
||||||
// 活动营销反积分
|
// 活动营销反积分
|
||||||
setActivityMarketAmt(order,null);
|
// setActivityMarketAmt(order,null);
|
||||||
// 更新订单状态
|
// 更新订单状态
|
||||||
updateMerchantOrder(order);
|
updateMerchantOrder(order);
|
||||||
// 推送消息
|
// 推送消息
|
||||||
@@ -2184,11 +2185,11 @@ public class MerchantOrderServiceImpl extends ServiceImpl<MerchantOrderMapper, M
|
|||||||
// 发送mqtt消息
|
// 发送mqtt消息
|
||||||
rabbitTemplate.convertAndSend("payCallback",JSON.toJSONString(order));
|
rabbitTemplate.convertAndSend("payCallback",JSON.toJSONString(order));
|
||||||
// 更新商品兑换状态
|
// 更新商品兑换状态
|
||||||
updateGoodExchange(order);
|
// updateGoodExchange(order);
|
||||||
//订单分账
|
//订单分账
|
||||||
// merchantOrderSplitService.checkMerchantOrderSplit(order);
|
// merchantOrderSplitService.checkMerchantOrderSplit(order);
|
||||||
// 添加判断BST是否满足条件返积分
|
// 添加判断BST是否满足条件返积分
|
||||||
userIntegralService.bstOrderIntegralReward(order);
|
// userIntegralService.bstOrderIntegralReward(order);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
MerchantBaseInfo mbi = merchantBaseInfoService.getMerchantBaseInfoByMerchantCode(order.getMerchantCode());
|
MerchantBaseInfo mbi = merchantBaseInfoService.getMerchantBaseInfoByMerchantCode(order.getMerchantCode());
|
||||||
@@ -2460,6 +2461,7 @@ public class MerchantOrderServiceImpl extends ServiceImpl<MerchantOrderMapper, M
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateMerchantOrder(MerchantOrder order){
|
private void updateMerchantOrder(MerchantOrder order){
|
||||||
|
log.info("{}更新订单状态",order.getOrderNumber());
|
||||||
if(!"0".equals(order.getStatus())){
|
if(!"0".equals(order.getStatus())){
|
||||||
order.setStatus("1");
|
order.setStatus("1");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
spring:
|
spring:
|
||||||
datasource:
|
datasource:
|
||||||
druid:
|
druid:
|
||||||
url: jdbc:mysql://rm-bp1uo9iq250st2e69.mysql.rds.aliyuncs.com:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
|
url: jdbc:mysql://rm-bp1uo9iq250st2e691o.mysql.rds.aliyuncs.com:3306/chaozhanggui?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useJDBCCompliantTimezoneShift=true&serverTimezone=CTT&useSSL=false
|
||||||
username: root
|
username: root
|
||||||
password: prodCZGmysqlroot@123
|
password: prodCZGmysqlroot@123
|
||||||
driver-class-name: com.mysql.jdbc.Driver
|
driver-class-name: com.mysql.jdbc.Driver
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
spring:
|
spring:
|
||||||
datasource:
|
datasource:
|
||||||
druid:
|
druid:
|
||||||
url: jdbc:mysql://127.0.0.1:3306/ysk_test?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
|
url: jdbc:mysql://101.37.12.135:3306/ysk_test?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
|
||||||
username: ysk_test
|
username: ysk_test
|
||||||
password: CZGmysqlroot@123
|
password: mysqlroot@123
|
||||||
driver-class-name: com.mysql.jdbc.Driver
|
driver-class-name: com.mysql.jdbc.Driver
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ spring:
|
|||||||
allow-bean-definition-overriding: true
|
allow-bean-definition-overriding: true
|
||||||
profiles:
|
profiles:
|
||||||
include: common, ryx, ys
|
include: common, ryx, ys
|
||||||
active: dev
|
active: prod
|
||||||
datasource:
|
datasource:
|
||||||
url: jdbc:mysql://60.205.224.68:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
|
url: jdbc:mysql://60.205.224.68:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
|
||||||
username: root
|
username: root
|
||||||
@@ -43,5 +43,5 @@ filepath: E:\\project\\chaozhanggui\\v1.0.3\\files\\
|
|||||||
|
|
||||||
hf:
|
hf:
|
||||||
pay:
|
pay:
|
||||||
callBack: https://p40312246f.goho.co/wap/notify/hfCallBack
|
callBack: https://ky.sxczgkj.cn/wap/notify/hfCallBack
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
Reference in New Issue
Block a user