Commit 553d6227 by tang

垃圾通道来回修改,推广方式更改

parent 00b763b3
...@@ -51,6 +51,7 @@ public static final String QUICK_WEB_PAY = "/quick/web/pay"; ...@@ -51,6 +51,7 @@ public static final String QUICK_WEB_PAY = "/quick/web/pay";
public static final String NO_INTEGRAL_QUICK_PAY_URL = "/quick/pay"; // 无积分快捷支付 public static final String NO_INTEGRAL_QUICK_PAY_URL = "/quick/pay"; // 无积分快捷支付
public static final String NO_INTEGRAL_ORDER_QUERY_URL = "/order/query"; // 查询订单 public static final String NO_INTEGRAL_ORDER_QUERY_URL = "/order/query"; // 查询订单
public static final String NOTIFY_CALLBACK_URL = "http://youkapay.com/youka-api/api/pay/notifyQuickPay"; public static final String NOTIFY_CALLBACK_URL = "http://youkapay.com/youka-api/api/pay/notifyQuickPay";
public static final String NO_INTEGRAL_QUICK_WAP_PAY_URL = "/quick/pay/v2"; // 无积分快捷支付
public static final String EXTRA_RATE = "200"; // 附加手续费(单位:分) public static final String EXTRA_RATE = "200"; // 附加手续费(单位:分)
...@@ -114,6 +115,7 @@ public static final String QUICK_WEB_PAY = "/quick/web/pay"; ...@@ -114,6 +115,7 @@ public static final String QUICK_WEB_PAY = "/quick/web/pay";
public static final long hours = 24; public static final long hours = 24;
public static final SimpleDateFormat YYYYMMDD_HHMMSS = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//HH:mm:ss 24小时制 public static final SimpleDateFormat YYYYMMDD_HHMMSS = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//HH:mm:ss 24小时制
public static final SimpleDateFormat YYYYMMDDHHMM = new SimpleDateFormat("yyyyMMddhhmm"); public static final SimpleDateFormat YYYYMMDDHHMM = new SimpleDateFormat("yyyyMMddhhmm");
public static final SimpleDateFormat HHMMSS = new SimpleDateFormat("HH:mm:ss");
/** /**
* 系统公共 * 系统公共
*/ */
...@@ -167,6 +169,8 @@ public static final String QUICK_WEB_PAY = "/quick/web/pay"; ...@@ -167,6 +169,8 @@ public static final String QUICK_WEB_PAY = "/quick/web/pay";
*/ */
public static final String STATUS_CODE_6001 = "6001"; public static final String STATUS_CODE_6001 = "6001";
public static final String STATUS_CODE_6001_DESC = "订单号不存在"; public static final String STATUS_CODE_6001_DESC = "订单号不存在";
public static final String STATUS_CODE_6002 = "6002";
public static final String STATUS_CODE_6002_DESC = "交易时间为09:00:00-22:00:00";
/** /**
......
...@@ -8,6 +8,7 @@ import com.thinkgem.jeesite.modules.commonError.MyException; ...@@ -8,6 +8,7 @@ import com.thinkgem.jeesite.modules.commonError.MyException;
import com.thinkgem.jeesite.modules.pay.entity.BalanceEntity; import com.thinkgem.jeesite.modules.pay.entity.BalanceEntity;
import com.thinkgem.jeesite.modules.pay.entity.OrderEntity; import com.thinkgem.jeesite.modules.pay.entity.OrderEntity;
import com.thinkgem.jeesite.modules.pay.juhezhong.dto.PayBackDto; import com.thinkgem.jeesite.modules.pay.juhezhong.dto.PayBackDto;
import com.thinkgem.jeesite.modules.pay.juhezhong.utils.DateUtil;
import com.thinkgem.jeesite.modules.pay.service.PayApiService; import com.thinkgem.jeesite.modules.pay.service.PayApiService;
import com.thinkgem.jeesite.modules.sys.entity.Dict; import com.thinkgem.jeesite.modules.sys.entity.Dict;
import com.thinkgem.jeesite.modules.sys.entity.DictPayChannel; import com.thinkgem.jeesite.modules.sys.entity.DictPayChannel;
...@@ -63,11 +64,15 @@ public class PayApiController { ...@@ -63,11 +64,15 @@ public class PayApiController {
public Response quickPay(JuHeZhongPayRequest request) { public Response quickPay(JuHeZhongPayRequest request) {
Response resp = new Response(); Response resp = new Response();
try { try {
//非交易时间直接返回
if (!DateUtil.checkTimeIsDuration()) {
throw new MyException(ComCode.STATUS_CODE_6002_DESC);
}
PayBackDto payBackDto = payService.quickPay(request); PayBackDto payBackDto = payService.quickPay(request);
if ((payBackDto.getUrl() != null && !"".equals(payBackDto.getUrl())) || "0".equals(payBackDto.getIsUrl())) { if ((payBackDto.getUrl() != null && !"".equals(payBackDto.getUrl())) || "0".equals(payBackDto.getIsUrl())) {
resp.setStatus(ComCode.STATUS_CODE_2000); resp.setStatus(ComCode.STATUS_CODE_2000);
resp.setMessage(ComCode.STATUS_CODE_2000_DESC); resp.setMessage(ComCode.STATUS_CODE_2000_DESC);
logger.debug("快捷支付返回URL: {}", payBackDto.getUrl());
resp.setData(payBackDto); resp.setData(payBackDto);
} else { } else {
resp.setStatus(ComCode.STATUS_CODE_9998); resp.setStatus(ComCode.STATUS_CODE_9998);
...@@ -388,7 +393,7 @@ public class PayApiController { ...@@ -388,7 +393,7 @@ public class PayApiController {
String orderId = request.getParameter("dsorderid"); String orderId = request.getParameter("dsorderid");
String code = request.getParameter("respCode"); String code = request.getParameter("respCode");
if ("00".equals(code)) { if ("00".equals(code)) {
logger.debug("orderId: {}",orderId); logger.debug("orderId: {}", orderId);
OrderEntity orderEntity = new OrderEntity(); OrderEntity orderEntity = new OrderEntity();
orderEntity.setPayCode(orderId); orderEntity.setPayCode(orderId);
...@@ -577,7 +582,7 @@ public class PayApiController { ...@@ -577,7 +582,7 @@ public class PayApiController {
value[0] = ov.toString(); value[0] = ov.toString();
} }
for (int k = 0; k < value.length; k++) { for (int k = 0; k < value.length; k++) {
logger.debug("参数名: {} , 参数值: {}",ok,value[k]); logger.debug("参数名: {} , 参数值: {}", ok, value[k]);
} }
} }
} }
......
...@@ -109,6 +109,20 @@ private Long timestamp; ...@@ -109,6 +109,20 @@ private Long timestamp;
*/ */
private String productName; private String productName;
/**
* 手续费率 例:0.005 千5
* webPay 必传
*/
private String userRate;
public String getUserRate(){
return userRate;
}
public void setUserRate(String userRate){
this.userRate = userRate;
}
public String getUserId ( ) { public String getUserId ( ) {
return userId; return userId;
} }
......
...@@ -142,6 +142,13 @@ public JSONObject quickWebPay ( JuhezhongDto dto ) throws Exception { ...@@ -142,6 +142,13 @@ public JSONObject quickWebPay ( JuhezhongDto dto ) throws Exception {
String respStr = HttpUtil.post(ComCode.HOST + ComCode.NO_INTEGRAL_QUICK_PAY_URL, params); String respStr = HttpUtil.post(ComCode.HOST + ComCode.NO_INTEGRAL_QUICK_PAY_URL, params);
return JSONObject.parseObject(respStr); return JSONObject.parseObject(respStr);
} }
/**
* 快捷B支付接口(老)6-29停用
* @param dto
* @return
* @throws Exception
*/
public JSONObject quickPay(JuhezhongDto dto) throws Exception { public JSONObject quickPay(JuhezhongDto dto) throws Exception {
Map<String, Object> params = Bean2Map.Entity2Map(dto); Map<String, Object> params = Bean2Map.Entity2Map(dto);
String signBefore = SignUtils.signBefore(params); String signBefore = SignUtils.signBefore(params);
...@@ -151,6 +158,21 @@ public JSONObject quickWebPay ( JuhezhongDto dto ) throws Exception { ...@@ -151,6 +158,21 @@ public JSONObject quickWebPay ( JuhezhongDto dto ) throws Exception {
return JSONObject.parseObject(respStr); return JSONObject.parseObject(respStr);
} }
/**
* 积分快捷(wap)6-29 新接口,需要返回url,异步消息并不能代表成功,只能设置订单状态为支付中
* @param dto
* @return
* @throws Exception
*/
public JSONObject quickPayWap(JuhezhongDto dto) throws Exception {
Map<String, Object> params = Bean2Map.Entity2Map(dto);
String signBefore = SignUtils.signBefore(params);
String sign = SignUtils.sign(signBefore, ComCode.MERCHANT_SECRET);
params.put("sign", sign);
String respStr = HttpUtil.post(ComCode.HOST + ComCode.NO_INTEGRAL_QUICK_WAP_PAY_URL, params);
return JSONObject.parseObject(respStr);
}
public JSONObject quickPay(JSONObject dto)throws Exception{ public JSONObject quickPay(JSONObject dto)throws Exception{
String signBefore = SignUtils.signBefore(dto); String signBefore = SignUtils.signBefore(dto);
System.out.println(signBefore); System.out.println(signBefore);
...@@ -161,6 +183,16 @@ public JSONObject quickWebPay ( JuhezhongDto dto ) throws Exception { ...@@ -161,6 +183,16 @@ public JSONObject quickWebPay ( JuhezhongDto dto ) throws Exception {
return JSONObject.parseObject(respStr); return JSONObject.parseObject(respStr);
} }
public JSONObject quickPayWap(JSONObject dto)throws Exception{
String signBefore = SignUtils.signBefore(dto);
System.out.println(signBefore);
String sign = SignUtils.sign(signBefore, ComCode.MERCHANT_SECRET);
System.out.println("sign:"+sign);
dto.put("sign", sign);
String respStr = HttpUtil.post(ComCode.HOST + ComCode.NO_INTEGRAL_QUICK_WAP_PAY_URL, dto);
return JSONObject.parseObject(respStr);
}
/** /**
* 查询订单状态 * 查询订单状态
* *
......
package com.thinkgem.jeesite.modules.pay.juhezhong.utils; package com.thinkgem.jeesite.modules.pay.juhezhong.utils;
import com.thinkgem.jeesite.common.constant.ComCode;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date; import java.util.Date;
/** /**
* @author lsw * @author lsw
* @date 2016年1月3日
* @version 1.0 * @version 1.0
* @date 2016年1月3日
* @desc 日期工具类 * @desc 日期工具类
*/ */
public class DateUtil { public class DateUtil {
...@@ -24,11 +27,12 @@ public class DateUtil { ...@@ -24,11 +27,12 @@ public class DateUtil {
/** /**
* 装字符串格式化成指定日期时间 * 装字符串格式化成指定日期时间
*
* @param value * @param value
* @param fmt * @param fmt
* @return * @return
*/ */
public static Date string2Date(String value,String fmt){ public static Date string2Date(String value, String fmt) {
try { try {
return new SimpleDateFormat(fmt).parse(value); return new SimpleDateFormat(fmt).parse(value);
} catch (ParseException e) { } catch (ParseException e) {
...@@ -36,4 +40,55 @@ public class DateUtil { ...@@ -36,4 +40,55 @@ public class DateUtil {
return new Date(); return new Date();
} }
/**
* 检验当前时间是否在一个区间范围内
* @return
*/
public static boolean checkTimeIsDuration() {
Boolean flag = false;
String now = ComCode.HHMMSS.format(new Date());
Date time;
try {
time = ComCode.HHMMSS.parse(now);
Date start = ComCode.HHMMSS.parse("09:00:00");
Date end = ComCode.HHMMSS.parse("22:00:00");
if (isInTimeDuration(time, start, end)) {
flag = true;
}
} catch (ParseException e) {
e.printStackTrace();
}
return flag;
}
/**
* 判断当前时间是否在[startTime, endTime]区间
*
* @param nowTime 当前时间
* @param startTime 开始时间
* @param endTime 结束时间
* @return
*/
public static boolean isInTimeDuration(Date nowTime, Date startTime, Date endTime) {
//首先判断是否与收尾时间相同,相同直接返回
if (nowTime.getTime() == startTime.getTime()
|| nowTime.getTime() == endTime.getTime()) {
return true;
}
Calendar date = Calendar.getInstance();
date.setTime(nowTime);
Calendar begin = Calendar.getInstance();
begin.setTime(startTime);
Calendar end = Calendar.getInstance();
end.setTime(endTime);
if (date.after(begin) && date.before(end)) {
return true;
} else {
return false;
}
}
} }
\ No newline at end of file
...@@ -24,6 +24,11 @@ public class TimingService { ...@@ -24,6 +24,11 @@ public class TimingService {
payApiService.updateOrders(); payApiService.updateOrders();
} }
@Scheduled(cron = "20 0/2 * * * ? ")
public void updateOrdersHL4(){
payApiService.updateOrdersHL4();
}
@Scheduled(cron = "0 0/5 * * * ? ") @Scheduled(cron = "0 0/5 * * * ? ")
public void updateUserGrade(){ public void updateUserGrade(){
userApiService.updateUserLevel(); userApiService.updateUserLevel();
......
...@@ -114,6 +114,9 @@ ...@@ -114,6 +114,9 @@
card_code card_code
FROM youka_orders FROM youka_orders
WHERE pay_status = 1 WHERE pay_status = 1
<if test="payChannel != null and payChannel != ''">
AND pay_channel = #{payChannel}
</if>
<if test="endTime != null and endTime != ''"> <if test="endTime != null and endTime != ''">
AND create_date &lt;= #{endTime} AND create_date &lt;= #{endTime}
</if> </if>
......
...@@ -59,7 +59,7 @@ function validPhone(ele){ ...@@ -59,7 +59,7 @@ function validPhone(ele){
if(validCode){ if(validCode){
validCode = false; validCode = false;
$.ajax({ $.ajax({
url: 'http://youkapay.com:8080/youka-api/api/user/getIdentifyCode', url: 'http://youkapay.com/youka-api/api/user/getIdentifyCode',
data: content, data: content,
dataType: 'json', dataType: 'json',
type: 'POST', type: 'POST',
...@@ -131,7 +131,7 @@ $("#submit").on("click",function(){ ...@@ -131,7 +131,7 @@ $("#submit").on("click",function(){
console.info(content) console.info(content)
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
url: 'http://youkapay.com:8080/youka-api/api/user/signUp', url: 'http://youkapay.com/youka-api/api/user/signUp',
data: content, data: content,
dataType: 'json', dataType: 'json',
success:function(data){ success:function(data){
...@@ -139,17 +139,18 @@ $("#submit").on("click",function(){ ...@@ -139,17 +139,18 @@ $("#submit").on("click",function(){
if(data.status == '2000'){ if(data.status == '2000'){
//跳转到市场 //跳转到市场
// window.location = "apk下载地址"; // window.location = "apk下载地址";
var user = navigator.userAgent; window.location.href="http://youkapay.com/youka-api/static/share/spread.html";
if (user.match(/(iphone os)/i)) { // var user = navigator.userAgent;
console.log("isphone"); // if (user.match(/(iphone os)/i)) {
window.location.href = 'https://www.pgyer.com/7aJ3' // console.log("isphone");
// window.location.href='https://appsto.re/cn/KG6P2.i' // window.location.href = 'https://www.pgyer.com/7aJ3'
}else if(user.match(/ipad/i)){ // // window.location.href='https://appsto.re/cn/KG6P2.i'
console.log("isipad"); // }else if(user.match(/ipad/i)){
}else if(user.match(/(midp|ucweb|android|windows ce|windows mobile)/i)){ // console.log("isipad");
console.log("android"); // }else if(user.match(/(midp|ucweb|android|windows ce|windows mobile)/i)){
// window.location.href='http://tstatics.iyuwan.com/files/apk/201605/Iyuwan.apk' // console.log("android");
}; // // window.location.href='http://tstatics.iyuwan.com/files/apk/201605/Iyuwan.apk'
// };
}else{ }else{
$("#registError").removeClass("none"); $("#registError").removeClass("none");
$("#registFail").html(data.message); $("#registFail").html(data.message);
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width">
<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="js/getQueryStringByName.js"></script>
<!--
<script type="text/javascript" src="js/sha1.js"></script>
<script type="text/javascript" src="js/DES.js"></script>
-->
<script type="text/javascript" src="js/md5.js"></script>
<script type="text/javascript" src="js/base64.js"></script>
<link rel="stylesheet" href="css/style.css">
<title>优卡生活</title>
<style>
button{
background: none;
outline: none;
border: none;
color: #FFFFFF;
display: block;
width: 50%;
height: 0;
padding: 10%;
line-height: 0px;
border-radius: 20px;
font-size: 25px;
}
#ios{
background:#FFBB2C;
}
#android{
background:#33FF33;
}
.containter{
position:absolute;
width:100%;
top:20%;
left:50%;
transform:translate(-50%);
}
</style>
</head>
<body>
<div align="center" class="containter">
<button onclick="window.open('https://www.pgyer.com/7aJ3')" id="ios">IOS 下载</button>
<br>
<button onclick="window.open('https://www.pgyer.com/7aJ3')" id="android">安卓下载</button>
</div>
</body>
</html>
\ No newline at end of file
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