This commit is contained in:
韩鹏辉
2024-01-22 17:26:28 +08:00
parent 4b5761d924
commit ea12afcbdf
9 changed files with 67 additions and 18 deletions

View File

@@ -1,6 +1,6 @@
spring:
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
password: prodCZGmysqlroot@123
driver-class-name: com.mysql.jdbc.Driver

View File

@@ -1,14 +1,17 @@
# 测试服务器上的数据库连接
spring:
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
password: CZGmysqlroot@123
password: mysqlroot@123
driver-class-name: com.mysql.jdbc.Driver
parameter:
domain: https://wxgzh.sxczgkj.cn
domain: https://p40312246f.goho.co
swagger:
### 生产环境不允许访问swagger
production: true
hf:
pay:
callBack: https://p40312246f.goho.co/wap/notify/hfCallBack

View File

@@ -5,7 +5,7 @@ spring:
profiles:
### 将一些固定的配置放到下级文件夹下的yml文件中
include: common, ryx, ys
active: dev
active: prod
mvc:
view:
prefix: /WEB-INF/jsp/

View File

@@ -613,6 +613,10 @@ public class DateUtils {
private final static SimpleDateFormat sdfTimes = 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() {
return sdfTimes.format(new Date());
}
@@ -625,6 +629,11 @@ public class DateUtils {
}
}
public static String convertString(String str){
StringBuilder stringBuilder=new StringBuilder();
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 {
System.out.println(DateUtils.parse("20230707172528","yyyyMMddHHmmss"));
System.out.println(DateUtils.convertDateByString("20240121141246"));
//List<String> last6Months = getLast6Months();
// List<String> last6Months = new ArrayList<>();
// last6Months.add("2019-11");

View File

@@ -315,10 +315,10 @@ public class HfPayServiceImpl implements PayService {
MsgException.check(true, "商户信息不完整");
}
String order_amt = changeY2F(order.getConsumeFee());
Map<String, Object> refundParams = new HashMap<String, Object>();
String refundNo = "adapay_refund_order_" + SnowFlakeUtil.nextId();
refundParams.put("refund_amt", order.getConsumeFee());
String refundNo = "HF_refund_order_" + SnowFlakeUtil.nextId();
refundParams.put("refund_amt", order_amt);
refundParams.put("refund_order_no", refundNo);
refundParams.put("notify_url", callBack);
Map<String, Object> adapay = null;
@@ -328,6 +328,8 @@ public class HfPayServiceImpl implements PayService {
result.put("code", ResultCode.FAIL.code());
try {
init(hfInfo.getLive_api_key(), hfInfo.getTest_api_key(), hfInfo.getPriv_key());
log.info("request:{}",refundParams.toString());
adapay = Refund.create(order.getTransNo(), refundParams);
log.info("payment result=" + JSON.toJSONString(adapay));
if ("pending".equals(adapay.get("status"))) {
@@ -431,7 +433,7 @@ public class HfPayServiceImpl implements PayService {
log.error("====================>【汇付】支付成功回调订单号查询,查询的订单为空:订单号:{}<====================", orderNo);
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.setTransNo(data.get("id").toString());
order.setThirdTransNo(data.get("id").toString());
@@ -466,6 +468,11 @@ public class HfPayServiceImpl implements PayService {
case "payment.close.failed":
break;
case "refund.succeeded":
break;
case "refund.failed":
break;

View File

@@ -2170,9 +2170,10 @@ public class MerchantOrderServiceImpl extends ServiceImpl<MerchantOrderMapper, M
@Transactional(rollbackFor = Exception.class,propagation = Propagation.NOT_SUPPORTED)
public void updateOrderAndCreateProfit(MerchantOrder order) {
Integer row = queueDataService.newQueueData(order.getOrderNumber());
log.info("orderNumber:{}",order.getOrderNumber());
if(row > 0){
// 活动营销反积分
setActivityMarketAmt(order,null);
// setActivityMarketAmt(order,null);
// 更新订单状态
updateMerchantOrder(order);
// 推送消息
@@ -2184,11 +2185,11 @@ public class MerchantOrderServiceImpl extends ServiceImpl<MerchantOrderMapper, M
// 发送mqtt消息
rabbitTemplate.convertAndSend("payCallback",JSON.toJSONString(order));
// 更新商品兑换状态
updateGoodExchange(order);
// updateGoodExchange(order);
//订单分账
// merchantOrderSplitService.checkMerchantOrderSplit(order);
// 添加判断BST是否满足条件返积分
userIntegralService.bstOrderIntegralReward(order);
// userIntegralService.bstOrderIntegralReward(order);
try {
MerchantBaseInfo mbi = merchantBaseInfoService.getMerchantBaseInfoByMerchantCode(order.getMerchantCode());
@@ -2460,6 +2461,7 @@ public class MerchantOrderServiceImpl extends ServiceImpl<MerchantOrderMapper, M
}
private void updateMerchantOrder(MerchantOrder order){
log.info("{}更新订单状态",order.getOrderNumber());
if(!"0".equals(order.getStatus())){
order.setStatus("1");
}

View File

@@ -1,7 +1,7 @@
spring:
datasource:
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
password: prodCZGmysqlroot@123
driver-class-name: com.mysql.jdbc.Driver

View File

@@ -1,7 +1,7 @@
spring:
datasource:
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
password: CZGmysqlroot@123
password: mysqlroot@123
driver-class-name: com.mysql.jdbc.Driver

View File

@@ -9,7 +9,7 @@ spring:
allow-bean-definition-overriding: true
profiles:
include: common, ryx, ys
active: dev
active: prod
datasource:
url: jdbc:mysql://60.205.224.68:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
username: root
@@ -43,5 +43,5 @@ filepath: E:\\project\\chaozhanggui\\v1.0.3\\files\\
hf:
pay:
callBack: https://p40312246f.goho.co/wap/notify/hfCallBack
callBack: https://ky.sxczgkj.cn/wap/notify/hfCallBack
environment: