Commit 3820e3a7 authored by 周健威's avatar 周健威

Merge remote-tracking branch 'origin/base-modify' into base-modify

parents 155d2d35 46b4b41d
...@@ -62,6 +62,7 @@ public class BaseUserMemberExportBiz extends BaseBiz<BaseUserMemberExportMapper, ...@@ -62,6 +62,7 @@ public class BaseUserMemberExportBiz extends BaseBiz<BaseUserMemberExportMapper,
userMemberDTO.setRentFreeDays(userMemberSaveDTO.getRentFreeDays()); userMemberDTO.setRentFreeDays(userMemberSaveDTO.getRentFreeDays());
userMemberDTO.setMemberName(userMemberSaveDTO.getMemberName()); userMemberDTO.setMemberName(userMemberSaveDTO.getMemberName());
userMemberDTO.setIsBind(1); userMemberDTO.setIsBind(1);
userMemberDTO.setBuyCount(0);
try { try {
baseUserMemberBiz.updUserMemberByUserId(userMemberDTO); baseUserMemberBiz.updUserMemberByUserId(userMemberDTO);
} catch (Exception e) { } catch (Exception e) {
...@@ -126,6 +127,7 @@ public class BaseUserMemberExportBiz extends BaseBiz<BaseUserMemberExportMapper, ...@@ -126,6 +127,7 @@ public class BaseUserMemberExportBiz extends BaseBiz<BaseUserMemberExportMapper,
userMemberDTO.setRentFreeDays(Integer.valueOf(rentFreeDays)); userMemberDTO.setRentFreeDays(Integer.valueOf(rentFreeDays));
userMemberDTO.setIsBind(1); userMemberDTO.setIsBind(1);
userMemberDTO.setMemberName(memberName); userMemberDTO.setMemberName(memberName);
userMemberDTO.setBuyCount(0);
try { try {
baseUserMemberBiz.updUserMemberByUserId(userMemberDTO); baseUserMemberBiz.updUserMemberByUserId(userMemberDTO);
} catch (Exception e) { } catch (Exception e) {
......
package com.xxfc.platform.universal.biz; package com.xxfc.platform.universal.biz;
import cn.hutool.core.text.UnicodeUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.alipay.api.AlipayApiException; import com.alipay.api.AlipayApiException;
...@@ -279,12 +280,14 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> { ...@@ -279,12 +280,14 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
//实例化客户端 //实例化客户端
AlipayClient alipayClient = new DefaultAlipayClient(SystemConfig.ALIPAY_PAY_BASE_URL + "/gateway.do", AlipayClient alipayClient = new DefaultAlipayClient(SystemConfig.ALIPAY_PAY_BASE_URL + "/gateway.do",
SystemConfig.ALIPAY_APPID, SystemConfig.ALIPAY_PRIVATE_KEY, AlipayConstants.FORMAT_JSON, SystemConfig.ALIPAY_APPID, SystemConfig.ALIPAY_PRIVATE_KEY, AlipayConstants.FORMAT_JSON,
"utf-8", SystemConfig.ALIPAY_PUBLIC_KEY, AlipayConstants.SIGN_TYPE_RSA2); AlipayConstants.CHARSET_UTF8, SystemConfig.ALIPAY_PUBLIC_KEY, AlipayConstants.SIGN_TYPE_RSA2);
orderPayVo.setNotifyUrl(notifyUrl); orderPayVo.setNotifyUrl(notifyUrl);
try { try {
if (orderPayVo.getPayWay() == 2) { //支付宝APP支付 if (orderPayVo.getPayWay() == 2) { //支付宝APP支付
log.info("=============支付宝APP支付================");
return appOrderPay(alipayClient, orderPayVo); return appOrderPay(alipayClient, orderPayVo);
} else { //预授权 } else { //预授权
log.info("=============支付宝预授权支付================");
return fundAuthOrderAppFreeze(alipayClient, orderPayVo); return fundAuthOrderAppFreeze(alipayClient, orderPayVo);
} }
} catch (Exception e) { } catch (Exception e) {
...@@ -298,20 +301,31 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> { ...@@ -298,20 +301,31 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
BigDecimal realAmount = new BigDecimal(orderPayVo.getAmount().toString()).divide(new BigDecimal("100"), 2, BigDecimal.ROUND_UP); BigDecimal realAmount = new BigDecimal(orderPayVo.getAmount().toString()).divide(new BigDecimal("100"), 2, BigDecimal.ROUND_UP);
AlipayTradeAppPayRequest request = new AlipayTradeAppPayRequest(); AlipayTradeAppPayRequest request = new AlipayTradeAppPayRequest();
//SDK已经封装掉了公共参数,这里只需要传入业务参数。以下方法为sdk的model入参方式(model和biz_content同时存在的情况下取biz_content)。 //SDK已经封装掉了公共参数,这里只需要传入业务参数。以下方法为sdk的model入参方式(model和biz_content同时存在的情况下取biz_content)。
request.setBizContent("{" +
"\"timeout_express\":\"30m\"," +
"\"total_amount\":\"" + realAmount.toString() + "\"," +
"\"subject\":\"" + orderPayVo.getSubject() + "\"," +
"\"body\":\"" + orderPayVo.getBody() + "\"," +
"\"out_trade_no\":\"" + orderPayVo.getTradeNo() + "\"" +
" }");
request.setNotifyUrl(orderPayVo.getNotifyUrl());
try { try {
//这里和普通的接口调用不同,使用的是sdkExecute //这里和普通的接口调用不同,使用的是sdkExecute
// request.setBizContent("{" +
// "\"timeout_express\":\"30m\"," +
// "\"product_code\":\"QUICK_MSECURITY_PAY\"," +
// "\"total_amount\":\"" + realAmount.toString() + "\"," +
// "\"subject\":\"" + orderPayVo.getSubject() + "\"," +
// "\"body\":\"" + orderPayVo.getBody() + "\"," +
// "\"out_trade_no\":\"" + orderPayVo.getTradeNo() + "\"" +
// "}");
AlipayTradeAppPayModel model = new AlipayTradeAppPayModel();
//model.setBody("我是测试数据");
model.setSubject(orderPayVo.getSubject());
model.setOutTradeNo(orderPayVo.getTradeNo());
model.setTimeoutExpress("30m");
model.setTotalAmount(realAmount.toString());
model.setProductCode("QUICK_MSECURITY_PAY");
request.setBizModel(model);
request.setNotifyUrl(orderPayVo.getNotifyUrl());
log.info("请求参数:param = {}", request.getBizModel().toString());
AlipayTradeAppPayResponse response = alipayClient.sdkExecute(request); AlipayTradeAppPayResponse response = alipayClient.sdkExecute(request);
log.info(response.getBody());//就是orderString 可以直接给客户端请求,无需再做处理。 log.info(UnicodeUtil.toUnicode(response.getBody()));//就是orderString 可以直接给客户端请求,无需再做处理。
return response.getBody(); return UnicodeUtil.toUnicode(response.getBody());
} catch (AlipayApiException e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
return null; return null;
......
...@@ -16,13 +16,15 @@ import org.apache.http.HttpResponse; ...@@ -16,13 +16,15 @@ import org.apache.http.HttpResponse;
import org.apache.http.util.EntityUtils; import org.apache.http.util.EntityUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.task.TaskExecutor;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.*; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
...@@ -207,7 +209,7 @@ public class TrafficViolationsService { ...@@ -207,7 +209,7 @@ public class TrafficViolationsService {
* @throws SQLException * @throws SQLException
*/ */
@Scheduled(cron = "0 0 0 0/7 * ?") @Scheduled(cron = "0 0 0 0/7 * ?")
private void updateLicensePlateType() throws SQLException { public void updateLicensePlateType() throws SQLException {
List<LicensePlateType> licensePlateTypes = licensePlateTypeBiz.selectListAll(); List<LicensePlateType> licensePlateTypes = licensePlateTypeBiz.selectListAll();
licensePlateTypeBiz.updateLicensePlateType(licensePlateTypes); licensePlateTypeBiz.updateLicensePlateType(licensePlateTypes);
} }
......
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