Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
haifeiWu authored and 吴海飞 committed May 31, 2024
2 parents 580b500 + f55d1cc commit d7d36ef
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 13 deletions.
28 changes: 21 additions & 7 deletions docs/install/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ mkdir $rootDir/mysql -p
mkdir $rootDir/mysql/config -p
mkdir $rootDir/mysql/log -p
mkdir $rootDir/mysql/data -p
mkdir $rootDir/mysql/mysql-files -p

# mkdir $rootDir/activemq -p

Expand Down Expand Up @@ -113,16 +114,29 @@ docker run -p 3306:3306 --name mysql8 --network=jeepay-net \
-v /etc/localtime:/etc/localtime:ro \
-v $rootDir/mysql/log:/var/log/mysql \
-v $rootDir/mysql/data:/var/lib/mysql \
-v $rootDir/mysql/config:/etc/mysql \
-v $rootDir/mysql/mysql-files:/var/lib/mysql-files \
-v $rootDir/mysql/config:/etc/mysql/conf.d \
-e MYSQL_ROOT_PASSWORD=$mysql_pwd \
-d mysql:8.0.25

# 容器重启
docker restart mysql8
-id mysql:8.0.25

# 避免未启动完成或出现错误: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'
echo "等待重启mysql容器....... "
sleep 10
# echo "等待重启mysql容器....... "

while true
do
# docker exec mysql8 mysql | grep '(using password: NO)' 使用这个判断不行, 若没有启动会报错
docker logs mysql8 > /tmp/installmysql.log
logContent=$(cat /tmp/installmysql.log | grep 'MySQL init process done')
if [ ! -n "$logContent" ];then
docker logs mysql8
echo "[3] 等待启动mysql容器....... "
sleep 30
else
echo "[3] mysql启动完成 $logContent"
sleep 10
break
fi
done

echo "[3] 初始化数据导入 ...... "
# 创建数据库 && 导入数据
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ public class AlipayConfig{
public static String SANDBOX_SERVER_URL = "https://openapi-sandbox.dl.alipaydev.com/gateway.do";

public static String PROD_OAUTH_URL = "https://openauth.alipay.com/oauth2/publicAppAuthorize.htm?app_id=%s&scope=auth_base&state=&redirect_uri=%s";
public static String SANDBOX_OAUTH_URL = "https://openapi-sandbox.dl.alipaydev.com/oauth2/publicAppAuthorize.htm?app_id=%s&scope=auth_base&state=&redirect_uri=%s";
public static String SANDBOX_OAUTH_URL = "https://openauth-sandbox.dl.alipaydev.com/oauth2/publicAppAuthorize.htm?app_id=%s&scope=auth_base&state=&redirect_uri=%s";

/** isv获取授权商户URL地址 **/
public static String PROD_APP_TO_APP_AUTH_URL = "https://openauth.alipay.com/oauth2/appToAppAuth.htm?app_id=%s&redirect_uri=%s&state=%s";
public static String SANDBOX_APP_TO_APP_AUTH_URL = "https://openapi-sandbox.dl.alipaydev.com/oauth2/appToAppAuth.htm?app_id=%s&redirect_uri=%s&state=%s";
public static String SANDBOX_APP_TO_APP_AUTH_URL = "https://openauth-sandbox.dl.alipaydev.com/oauth2/appToAppAuth.htm?app_id=%s&redirect_uri=%s&state=%s";


public static String FORMAT = "json";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@ public ChannelRetMsg transfer(TransferOrderRQ bizRQ, TransferOrder transferOrder
TransferBatchesRequest request = new TransferBatchesRequest();
request.setAppid(wxServiceWrapper.getWxPayService().getConfig().getAppId());
request.setOutBatchNo(transferOrder.getTransferId());
request.setBatchName(transferOrder.getAccountName());
if(StringUtils.isNotBlank(transferOrder.getAccountName())){
request.setBatchName(transferOrder.getAccountName());
}else{
request.setBatchName(transferOrder.getTransferDesc());
}
request.setBatchRemark(transferOrder.getTransferDesc());
request.setTotalAmount(transferOrder.getAmount().intValue());
request.setTotalNum(1);
Expand Down Expand Up @@ -194,8 +198,12 @@ public ChannelRetMsg query(TransferOrder transferOrder, MchAppConfigContext mchA

} catch (WxPayException e) {

// 如果查询单号对应的数据不存在,那么数据不存在的原因可能是:(1)付款还在处理中;(2)付款处理失败导致付款订单没有落地,务必再次查询确认此次付款的结果。
if("NOT_FOUND".equalsIgnoreCase(e.getErrCode())){

// NOT_FOUND:那么数据不存在的原因可能是:(1)付款还在处理中;(2)付款处理失败导致付款订单没有落地,务必再次查询确认此次付款的结果。
// INVALID_REQUEST:请等待批次处理完成后再查询明细单据
// SYSTEM_ERROR: 系统错误
// 当出现以上情况时,继续查询,不能直接返回错误信息
if("NOT_FOUND".equalsIgnoreCase(e.getErrCode()) || "INVALID_REQUEST".equalsIgnoreCase(e.getErrCode()) || "SYSTEM_ERROR".equalsIgnoreCase(e.getErrCode())){
return ChannelRetMsg.waiting();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public ResponseEntity doNotify(HttpServletRequest request, @PathVariable("ifCode

}else if(notifyResult.getChannelState() == ChannelRetMsg.ChannelState.CONFIRM_FAIL){
// 转账失败
transferOrderService.updateIng2Fail(transferId, notifyResult.getChannelOrderId(), notifyResult.getChannelUserId(), notifyResult.getChannelErrCode());
transferOrderService.updateIng2Fail(transferId, notifyResult.getChannelOrderId(), notifyResult.getChannelErrCode(), notifyResult.getChannelErrMsg());
payMchNotifyService.transferOrderNotify(transferOrderService.getById(transferId));
}
}
Expand Down

0 comments on commit d7d36ef

Please sign in to comment.