Commit 021df1c2 by Java-聂换换

HL2通道支付

parent fc5b0eaa
...@@ -17,9 +17,9 @@ public class ComCode { ...@@ -17,9 +17,9 @@ public class ComCode {
* juhezhong相关参数 * juhezhong相关参数
*/ */
public static final String HOST = "http://pay.hezhongpay.com"; // 请求地址 public static final String HOST = "http://pay.hezhongpay.com"; // 请求地址
public static final String MERCHANT_ID = "100532502195879"; // 商户号 public static final String MERCHANT_ID = Global.getConfig("pay.merchant_id"); // 商户号
public static final String MERCHANT_KEY = "670993bf-dd22-4464-9d81-69595d36b794";//"670993bf-dd22-4464-9d81-69595d36b794"; // 商户key public static final String MERCHANT_KEY = Global.getConfig("pay.merchant.key");//"670993bf-dd22-4464-9d81-69595d36b794"; // 商户key
public static final String MERCHANT_SECRET = "289ada73-27db-49e0-b2ad-3ae1613a665a";//"289ada73-27db-49e0-b2ad-3ae1613a665a"; // 商户sescet public static final String MERCHANT_SECRET = Global.getConfig("pay.merchant.secret");//"289ada73-27db-49e0-b2ad-3ae1613a665a"; // 商户sescet
public static final String MERCHANT_REG_URL = "/api/quick/merchant/apply"; // 注册商户 public static final String MERCHANT_REG_URL = "/api/quick/merchant/apply"; // 注册商户
public static final String ORDER_QUERY_URL = "/order/query"; // 查询订单 public static final String ORDER_QUERY_URL = "/order/query"; // 查询订单
public static final String SETTLE_UPDATE_URL = "/api/quick/settle/card/update"; // 修改结算卡信息 public static final String SETTLE_UPDATE_URL = "/api/quick/settle/card/update"; // 修改结算卡信息
...@@ -31,15 +31,31 @@ public class ComCode { ...@@ -31,15 +31,31 @@ public class ComCode {
public static final String EXTRA_RATE = "200"; // 附加手续费(单位:分) public static final String EXTRA_RATE = "200"; // 附加手续费(单位:分)
public static final String INTEGRAL_MERCHANT_ID = "100532502191215"; // 商户号 public static final String INTEGRAL_MERCHANT_ID = Global.getConfig("pay.integral.merchant_id"); // 商户号
public static final String INTEGRAL_MERCHANT_KEY = "781ed0d6-9657-404c-9f91-79eff2e0b782";//"670993bf-dd22-4464-9d81-69595d36b794"; // 商户key public static final String INTEGRAL_MERCHANT_KEY = Global.getConfig("pay.integral.merchant.key");//"670993bf-dd22-4464-9d81-69595d36b794"; // 商户key
public static final String INTEGRAL_MERCHANT_SECRET = "0033fc8d-161b-4e97-87de-efed7a34bdea";//"289ada73-27db-49e0-b2ad-3ae1613a665a"; // 商户sescet public static final String INTEGRAL_MERCHANT_SECRET = Global.getConfig("pay.integral.merchant.secret");//"289ada73-27db-49e0-b2ad-3ae1613a665a"; // 商户sescet
public static final String INTEGRAL_QUICK_PAY_URL = "/quick/pay"; // 积分快捷支付 public static final String INTEGRAL_QUICK_PAY_URL = "/quick/pay"; // 积分快捷支付
public static final String INTEGRAL_ORDER_QUERY_URL = "/order/query"; // 积分查询订单 public static final String INTEGRAL_ORDER_QUERY_URL = "/order/query"; // 积分查询订单
//快捷处理 //快捷处理
public static final String INTEGRAL_MERCHANT_REG_URL ="/api/quick/pay/handle"; public static final String INTEGRAL_MERCHANT_REG_URL ="/api/quick/pay/handle";
public static final String JFEN_MERCHANT_ID = Global.getConfig("pay.jfen.merchant_id"); // 商户号
public static final String JFEN_MERCHANT_KEY = Global.getConfig("pay.jfen.merchant.key");//"670993bf-dd22-4464-9d81-69595d36b794"; // 商户key
public static final String JFEN_MERCHANT_SECRET = Global.getConfig("pay.jfen.merchant.secret");//"289ada73-27db-49e0-b2ad-3ae1613a665a"; // 商户sescet
//商户入网
public static final String JFEN_MICRO_HANDLE_URL="/merchant/handle";
//快捷处理订单
public static final String JFEN_QUICK_PAY_URL="/api/quick/pay/handle";
//银联二维码接口
public static final String JFEN_UNION_PAY_URL = "/union/qrcode";
//封顶快捷处理
public static final String JFEN_PEAK_QUICK_PAY_URL="/peak/quick/pay/handle";
/** /**
* duolabao相关参数 * duolabao相关参数
* *
...@@ -123,4 +139,12 @@ public class ComCode { ...@@ -123,4 +139,12 @@ public class ComCode {
*/ */
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 = "订单号不存在";
/**
* payChannel 通道
*/
public static final String PAYCHANNEL_HL1 = "quick_no_integral";
public static final String PAYCHANNEL_HL2 = "quick_jfen";
public static final String PAYCHANNEL_HL3 = "quick_integral";
} }
...@@ -9,6 +9,10 @@ import com.thinkgem.jeesite.modules.pay.service.PayApiService; ...@@ -9,6 +9,10 @@ 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.service.DictService; import com.thinkgem.jeesite.modules.sys.service.DictService;
import com.thinkgem.jeesite.modules.user.bean.JuHeZhongPayRequest; import com.thinkgem.jeesite.modules.user.bean.JuHeZhongPayRequest;
import com.thinkgem.jeesite.modules.user.bean.UserRequest;
import com.thinkgem.jeesite.modules.user.entity.CardEntity;
import com.thinkgem.jeesite.modules.user.entity.CardSwpaccidEntity;
import com.thinkgem.jeesite.modules.user.service.UserApiService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpRequest; import org.springframework.http.HttpRequest;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
...@@ -34,6 +38,9 @@ public class PayApiController { ...@@ -34,6 +38,9 @@ public class PayApiController {
@Autowired @Autowired
private DictService dictService; private DictService dictService;
@Autowired
private UserApiService userApiService;
/** /**
* 快捷支付 * 快捷支付
* *
...@@ -44,6 +51,7 @@ public class PayApiController { ...@@ -44,6 +51,7 @@ public class PayApiController {
public Response quickPay(JuHeZhongPayRequest request) { public Response quickPay(JuHeZhongPayRequest request) {
Response resp = new Response(); Response resp = new Response();
try { try {
PayBackDto payBackDto = payService.quickPay(request); PayBackDto payBackDto = payService.quickPay(request);
if(payBackDto.getUrl()!=null && !"".equals(payBackDto.getUrl())){ if(payBackDto.getUrl()!=null && !"".equals(payBackDto.getUrl())){
resp.setStatus(ComCode.STATUS_CODE_2000); resp.setStatus(ComCode.STATUS_CODE_2000);
...@@ -57,7 +65,7 @@ public class PayApiController { ...@@ -57,7 +65,7 @@ public class PayApiController {
} catch (MyException e){ } catch (MyException e){
resp.setStatus(ComCode.STATUS_CODE_9998); resp.setStatus(ComCode.STATUS_CODE_9998);
resp.setMessage(ComCode.STATUS_CODE_9998_DESC); resp.setMessage(e.getMessage());
resp.setError(e.getMessage()); resp.setError(e.getMessage());
}catch (Exception e) { }catch (Exception e) {
...@@ -69,6 +77,39 @@ public class PayApiController { ...@@ -69,6 +77,39 @@ public class PayApiController {
return resp; return resp;
} }
/**
* 开卡
*
* @param request
* @return
*/
@PostMapping("/openCard")
public Response openCard(UserRequest request) {
Response resp = new Response();
if(ComCode.PAYCHANNEL_HL2.equals(request.getPayChannel())){
return payService.openCardJFen(request);
}
resp.setMessage("没有该渠道");
resp.setStatus(ComCode.STATUS_CODE_9998);
return resp;
}
/**
* 发送验证码
*
* @param request
* @return
*/
@PostMapping("/sendMessagePay")
public Response sendMessagePay(JuHeZhongPayRequest request) {
Response resp = new Response();
if(ComCode.PAYCHANNEL_HL2.equals(request.getPayChannel())){
return payService.sendMessageJFen(request);
}
resp.setMessage("没有该渠道");
resp.setStatus(ComCode.STATUS_CODE_9998);
return resp;
}
/** /**
* 回调 * 回调
...@@ -139,6 +180,71 @@ public class PayApiController { ...@@ -139,6 +180,71 @@ public class PayApiController {
/** /**
* 回调
* @param request
* @param response
*/
@RequestMapping("/openCardCallback")
public void openCardCallback(HttpServletRequest request, HttpServletResponse response) {
System.out.println("。。。。。。openCardCallback回调。。。。。");
Map map=request.getParameterMap();
Set keSet=map.entrySet();
for(Iterator itr = keSet.iterator(); itr.hasNext();){
Map.Entry me=(Map.Entry)itr.next();
Object ok=me.getKey(); //获取参数名
Object ov=me.getValue(); //获取参数值
System.out.println(ok+"="+ok.toString());
System.out.println(ov+"="+ov.toString());
String[] value=new String[1];
if(ov instanceof String[]){
value=(String[])ov;
}else{
value[0]=ov.toString();
}
for(int k=0;k <value.length;k++){
System.out.println(ok+"="+value[k]);
}
}
//设置编码
try {
request.setCharacterEncoding("UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
String swpaccid=request.getParameter("swpaccid");
String cardNo = request.getParameter("cardNo");
String phone=request.getParameter("phone");
String code = request.getParameter("code");
if("0000".equals(code)){
CardEntity cardEntity = new CardEntity();
cardEntity.setCardNo(cardNo);
cardEntity.setCardMobile(phone);
cardEntity = userApiService.getCardByCardNo(cardNo);
CardSwpaccidEntity cardSwpaccidEntity = new CardSwpaccidEntity();
cardSwpaccidEntity.setPayMethod("quick");
cardSwpaccidEntity.setPayChannel(ComCode.PAYCHANNEL_HL2);
cardSwpaccidEntity.setSwpaccid(swpaccid);
cardSwpaccidEntity.setCardCode(cardEntity.getCode());
userApiService.addSwpaccid(cardSwpaccidEntity);
//返回true 收到请求,停止通知
PrintWriter write= null;
try {
write = response.getWriter();
} catch (IOException e) {
e.printStackTrace();
}
write.print("true");
write.flush();
write.close();
}
}
/**
* 获取支付的结果 * 获取支付的结果
* @param orderEntity * @param orderEntity
* @return * @return
......
...@@ -4,6 +4,7 @@ import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao; ...@@ -4,6 +4,7 @@ import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
import com.thinkgem.jeesite.modules.pay.entity.BenefitEntity; import com.thinkgem.jeesite.modules.pay.entity.BenefitEntity;
import com.thinkgem.jeesite.modules.pay.entity.OrderEntity; import com.thinkgem.jeesite.modules.pay.entity.OrderEntity;
import com.thinkgem.jeesite.modules.pay.entity.UserRateEntity; import com.thinkgem.jeesite.modules.pay.entity.UserRateEntity;
import com.thinkgem.jeesite.modules.user.entity.CardEntity;
import java.util.List; import java.util.List;
...@@ -19,6 +20,7 @@ public interface PayApiDao { ...@@ -19,6 +20,7 @@ public interface PayApiDao {
void saveBenefitInfo(BenefitEntity benefitEntity); void saveBenefitInfo(BenefitEntity benefitEntity);
void updateOrderStatus(OrderEntity orderEntity); void updateOrderStatus(OrderEntity orderEntity);
int updateOrderTradeNo(OrderEntity orderEntity);
OrderEntity getOrder(OrderEntity orderEntity); OrderEntity getOrder(OrderEntity orderEntity);
...@@ -31,4 +33,5 @@ public interface PayApiDao { ...@@ -31,4 +33,5 @@ public interface PayApiDao {
// 查询状态为支付中的状态 // 查询状态为支付中的状态
List<OrderEntity> getOrderListTimeing(OrderEntity orderEntity); List<OrderEntity> getOrderListTimeing(OrderEntity orderEntity);
} }
...@@ -22,6 +22,10 @@ public class OrderEntity extends BaseEntity implements Serializable { ...@@ -22,6 +22,10 @@ public class OrderEntity extends BaseEntity implements Serializable {
private String createDate; private String createDate;
private String startTime;
private String endTime;
public OrderEntity() { public OrderEntity() {
} }
...@@ -155,4 +159,20 @@ public class OrderEntity extends BaseEntity implements Serializable { ...@@ -155,4 +159,20 @@ public class OrderEntity extends BaseEntity implements Serializable {
public void setPayMethodName(String payMethodName) { public void setPayMethodName(String payMethodName) {
this.payMethodName = payMethodName; this.payMethodName = payMethodName;
} }
public String getStartTime() {
return startTime;
}
public void setStartTime(String startTime) {
this.startTime = startTime;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
} }
...@@ -11,13 +11,15 @@ public class RateEntity extends BaseEntity implements Serializable { ...@@ -11,13 +11,15 @@ public class RateEntity extends BaseEntity implements Serializable {
private String balance; // 结算 private String balance; // 结算
private String singleLimit; // 单笔限额 private String singleLimit; // 单笔限额
private String dayLimit; // 当天额度 private String dayLimit; // 当天额度
private String payChannel;// HL3通道的汇率编码 private String payChannel;// 通道
private String img; // 图标 private String img; // 图标
private String payMethodLabel;// 支付方式名称 private String payMethodLabel;// 支付方式名称
private String serviceType;
private String rateType;
public RateEntity() { public RateEntity() {
} }
...@@ -99,4 +101,21 @@ public class RateEntity extends BaseEntity implements Serializable { ...@@ -99,4 +101,21 @@ public class RateEntity extends BaseEntity implements Serializable {
public void setPayChannel(String payChannel) { public void setPayChannel(String payChannel) {
this.payChannel = payChannel; this.payChannel = payChannel;
} }
public String getServiceType() {
return serviceType;
}
public void setServiceType(String serviceType) {
this.serviceType = serviceType;
}
public String getRateType() {
return rateType;
}
public void setRateType(String rateType) {
this.rateType = rateType;
}
} }
...@@ -8,6 +8,9 @@ package com.thinkgem.jeesite.modules.pay.juhezhong.dto; ...@@ -8,6 +8,9 @@ package com.thinkgem.jeesite.modules.pay.juhezhong.dto;
public class PayBackDto { public class PayBackDto {
private String url; // 支付url private String url; // 支付url
private String message; private String message;
private String payChannel;//
private String isUrl = "1";// 是否是返回的url 1是 0否
public String getUrl() { public String getUrl() {
return url; return url;
...@@ -24,4 +27,20 @@ public class PayBackDto { ...@@ -24,4 +27,20 @@ public class PayBackDto {
public void setMessage(String message) { public void setMessage(String message) {
this.message = message; this.message = message;
} }
public String getPayChannel() {
return payChannel;
}
public void setPayChannel(String payChannel) {
this.payChannel = payChannel;
}
public String getIsUrl() {
return isUrl;
}
public void setIsUrl(String isUrl) {
this.isUrl = isUrl;
}
} }
package com.thinkgem.jeesite.modules.pay.juhezhong.dto;
/**
* Created by lishi on 2017/11/21.
*/
public class QrCodeDto extends CommonDto {
private String terminalId;//付款码
private String subMchId="";//子商户号
private String bankSettNo="";//联行号
private String acctName="";//收款人姓名
private String acctNo="";//收款人账号
private String idNo="";//证件号码
public String getSubMchId() {
return subMchId;
}
public void setSubMchId(String subMchId) {
this.subMchId = subMchId;
}
public String getBankSettNo() {
return bankSettNo;
}
public void setBankSettNo(String bankSettNo) {
this.bankSettNo = bankSettNo;
}
public String getAcctName() {
return acctName;
}
public void setAcctName(String acctName) {
this.acctName = acctName;
}
public String getAcctNo() {
return acctNo;
}
public void setAcctNo(String acctNo) {
this.acctNo = acctNo;
}
public String getIdNo() {
return idNo;
}
public void setIdNo(String idNo) {
this.idNo = idNo;
}
public String getTerminalId() {
return terminalId;
}
public void setTerminalId(String terminalId) {
this.terminalId = terminalId;
}
}
...@@ -12,13 +12,16 @@ import com.thinkgem.jeesite.modules.pay.juhezhong.utils.HttpUtil; ...@@ -12,13 +12,16 @@ import com.thinkgem.jeesite.modules.pay.juhezhong.utils.HttpUtil;
import com.thinkgem.jeesite.modules.pay.juhezhong.utils.*; import com.thinkgem.jeesite.modules.pay.juhezhong.utils.*;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.Map; import java.util.Map;
@Transactional
@Service @Service
@Lazy(false)
@Transactional
public class JuHeZhongPayIntegralService { public class JuHeZhongPayIntegralService {
private Logger logger = LoggerFactory.getLogger(Logger.class); private Logger logger = LoggerFactory.getLogger(Logger.class);
...@@ -32,7 +35,7 @@ public class JuHeZhongPayIntegralService { ...@@ -32,7 +35,7 @@ public class JuHeZhongPayIntegralService {
* @throws Exception * @throws Exception
*/ */
public JSONObject query(CommonDto dto) throws Exception { public JSONObject query(CommonDto dto) throws Exception {
dto.setMerchantId(ComCode.MERCHANT_ID); dto.setMerchantId(ComCode.INTEGRAL_MERCHANT_ID);
dto.setMerchantKey(ComCode.INTEGRAL_MERCHANT_KEY); dto.setMerchantKey(ComCode.INTEGRAL_MERCHANT_KEY);
Map<String, Object> params = Bean2Map.Entity2Map(dto); Map<String, Object> params = Bean2Map.Entity2Map(dto);
String signBefore = SignUtils.signBefore(params); String signBefore = SignUtils.signBefore(params);
...@@ -66,7 +69,7 @@ public class JuHeZhongPayIntegralService { ...@@ -66,7 +69,7 @@ public class JuHeZhongPayIntegralService {
// JSONObject jsonObject = juHeZhongPayIntegralService.quickPayHandle(dto); // JSONObject jsonObject = juHeZhongPayIntegralService.quickPayHandle(dto);
// System.out.println(jsonObject.toJSONString()); // System.out.println(jsonObject.toJSONString());
JuHeZhongPayIntegralService juHeZhongPayIntegralService = new JuHeZhongPayIntegralService(); // JuHeZhongPayIntegralService juHeZhongPayIntegralService = new JuHeZhongPayIntegralService();
// JSONObject dto = new JSONObject(); // JSONObject dto = new JSONObject();
// //
// dto.put("orderId", MakeOrderNum.makeOrderNum());//标识请求唯一(非订单号) // dto.put("orderId", MakeOrderNum.makeOrderNum());//标识请求唯一(非订单号)
...@@ -93,18 +96,18 @@ public class JuHeZhongPayIntegralService { ...@@ -93,18 +96,18 @@ public class JuHeZhongPayIntegralService {
// String sign = SignUtils.sign(signBefore, ComCode.INTEGRAL_MERCHANT_SECRET); // String sign = SignUtils.sign(signBefore, ComCode.INTEGRAL_MERCHANT_SECRET);
//B105004538 //B105004538
//
JSONObject dto = new JSONObject(); // JSONObject dto = new JSONObject();
//
dto.put("serviceType", 10);// 服务类型 // dto.put("serviceType", 10);// 服务类型
dto.put("merchantId",ComCode.INTEGRAL_MERCHANT_ID);//商户号 // dto.put("merchantId",ComCode.INTEGRAL_MERCHANT_ID);//商户号
dto.put("orderId", IdGen.randomBase62(64));//订单号 // dto.put("orderId", IdGen.randomBase62(64));//订单号
//
// 李波的交通银行卡subMchId 403196720 // // 李波的交通银行卡subMchId 403196720
dto.put("subMchId", "403196720");//由系统分配的商户号 // dto.put("subMchId", "403196720");//由系统分配的商户号
dto.put("merchantKey", ComCode.INTEGRAL_MERCHANT_KEY);//商户key // dto.put("merchantKey", ComCode.INTEGRAL_MERCHANT_KEY);//商户key
dto.put("timestamp", System.currentTimeMillis());//时间戳 // dto.put("timestamp", System.currentTimeMillis());//时间戳
JSONObject jsonObject = juHeZhongPayIntegralService.quickPayHandle(dto); // JSONObject jsonObject = juHeZhongPayIntegralService.quickPayHandle(dto);
// JSONObject dto = new JSONObject(); // JSONObject dto = new JSONObject();
...@@ -144,7 +147,7 @@ public class JuHeZhongPayIntegralService { ...@@ -144,7 +147,7 @@ public class JuHeZhongPayIntegralService {
// dto.put("timestamp", System.currentTimeMillis());//时间戳 // dto.put("timestamp", System.currentTimeMillis());//时间戳
// System.out.println(dto.toJSONString()); // System.out.println(dto.toJSONString());
// JSONObject jsonObject = juHeZhongPayIntegralService.quickPayHandle(dto); // JSONObject jsonObject = juHeZhongPayIntegralService.quickPayHandle(dto);
System.out.println(jsonObject.toJSONString()); // System.out.println(jsonObject.toJSONString());
} }
......
...@@ -10,6 +10,7 @@ import com.thinkgem.jeesite.modules.pay.juhezhong.utils.Bean2Map; ...@@ -10,6 +10,7 @@ import com.thinkgem.jeesite.modules.pay.juhezhong.utils.Bean2Map;
import com.thinkgem.jeesite.modules.pay.juhezhong.utils.HttpUtil; import com.thinkgem.jeesite.modules.pay.juhezhong.utils.HttpUtil;
import com.thinkgem.jeesite.modules.pay.juhezhong.utils.SignUtils; import com.thinkgem.jeesite.modules.pay.juhezhong.utils.SignUtils;
import com.thinkgem.jeesite.modules.user.bean.JuHeZhongPayRequest; import com.thinkgem.jeesite.modules.user.bean.JuHeZhongPayRequest;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -19,7 +20,8 @@ import java.util.Map; ...@@ -19,7 +20,8 @@ import java.util.Map;
* 首页通知 * 首页通知
*/ */
@Service @Service
@Transactional(readOnly = true) @Lazy(false)
@Transactional
public class JuHeZhongPayService { public class JuHeZhongPayService {
/** /**
......
package com.thinkgem.jeesite.modules.pay.service;
import com.alibaba.fastjson.JSONObject;
import com.thinkgem.jeesite.common.constant.ComCode;
import com.thinkgem.jeesite.modules.pay.dao.PayApiDao;
import com.thinkgem.jeesite.modules.pay.entity.BenefitEntity;
import com.thinkgem.jeesite.modules.pay.entity.OrderEntity;
import com.thinkgem.jeesite.modules.pay.juhezhong.dto.QuickDto;
import com.thinkgem.jeesite.modules.pay.juhezhong.service.JuHeZhongPayIntegralService;
import com.thinkgem.jeesite.modules.pay.juhezhong.service.JuHeZhongPayService;
import com.thinkgem.jeesite.modules.user.service.UserApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service
@Lazy(false)
public class TimingService {
@Autowired
private PayApiService payApiService;
@Autowired
private JuHeZhongPayService juHeZhongPayService;
@Autowired
private JuHeZhongPayIntegralService juHeZhongPayIntegralService;
@Scheduled(cron = "0 0 0/1 * * ?")
public void updateOrders(){
payApiService.updateOrderTiming();
payApiService.updateOrders();
}
}
...@@ -6,7 +6,11 @@ public class JuHeZhongPayRequest extends Request { ...@@ -6,7 +6,11 @@ public class JuHeZhongPayRequest extends Request {
private String amount; // 金额 private String amount; // 金额
private String cardCode; // 支付卡code private String cardCode; // 支付卡code
private String subject; // 商品名称 private String subject; // 商品名称
private String payChannel; // 渠道 目前合众支付接口仅传入quick_no_integral quick_integral private String payChannel; // 渠道 目前合众支付接口仅传入quick_no_integral ComCode.PAYCHANNEL_HL3
private String payMethod;//
private String passwd;// 验证码
private String payNo;// 订单号
public String getAmount() { public String getAmount() {
return amount; return amount;
...@@ -39,4 +43,28 @@ public class JuHeZhongPayRequest extends Request { ...@@ -39,4 +43,28 @@ public class JuHeZhongPayRequest extends Request {
public void setPayChannel(String payChannel) { public void setPayChannel(String payChannel) {
this.payChannel = payChannel; this.payChannel = payChannel;
} }
public String getPayMethod() {
return payMethod;
}
public void setPayMethod(String payMethod) {
this.payMethod = payMethod;
}
public String getPasswd() {
return passwd;
}
public void setPasswd(String passwd) {
this.passwd = passwd;
}
public String getPayNo() {
return payNo;
}
public void setPayNo(String payNo) {
this.payNo = payNo;
}
} }
...@@ -83,4 +83,19 @@ public interface UserApiDao { ...@@ -83,4 +83,19 @@ public interface UserApiDao {
Level getLevelByUserLevel(UserRequest request); Level getLevelByUserLevel(UserRequest request);
void addUserSubmchid(UserSubMchId userSubMchId);
UserSubMchId getUserSubmchid(UserSubMchId userSubMchId);
public int updateUserSubmchid(UserSubMchId userSubMchId);
public CardEntity getCardByCardNo(CardEntity cardEntity);
public int addSwpaccid(CardSwpaccidEntity entity);
public CardSwpaccidEntity getSwpaccid(CardSwpaccidEntity cardSwpaccidEntity);
CardEntity getCardInfoSwpaccid(Request request);
} }
...@@ -37,6 +37,8 @@ public class CardEntity extends BaseEntity implements Serializable { ...@@ -37,6 +37,8 @@ public class CardEntity extends BaseEntity implements Serializable {
private String supportPayChannel; private String supportPayChannel;
private String swpaccid; // HL2通道 开卡唯一标识
public CardEntity() { public CardEntity() {
} }
...@@ -221,4 +223,12 @@ public class CardEntity extends BaseEntity implements Serializable { ...@@ -221,4 +223,12 @@ public class CardEntity extends BaseEntity implements Serializable {
public void setSupportPayChannel(String supportPayChannel) { public void setSupportPayChannel(String supportPayChannel) {
this.supportPayChannel = supportPayChannel; this.supportPayChannel = supportPayChannel;
} }
public String getSwpaccid() {
return swpaccid;
}
public void setSwpaccid(String swpaccid) {
this.swpaccid = swpaccid;
}
} }
package com.thinkgem.jeesite.modules.user.entity;
public class CardSwpaccidEntity {
private String cardCode;
private String payMethod; // 支付方式
private String payChannel;// 通道
private String swpaccid;
public String getCardCode() {
return cardCode;
}
public void setCardCode(String cardCode) {
this.cardCode = cardCode;
}
public String getPayMethod() {
return payMethod;
}
public void setPayMethod(String payMethod) {
this.payMethod = payMethod;
}
public String getPayChannel() {
return payChannel;
}
public void setPayChannel(String payChannel) {
this.payChannel = payChannel;
}
public String getSwpaccid() {
return swpaccid;
}
public void setSwpaccid(String swpaccid) {
this.swpaccid = swpaccid;
}
}
package com.thinkgem.jeesite.modules.user.entity;
public class UserSubMchId {
private String userCode;
private String submchid;
private String payChannel;
public String getUserCode() {
return userCode;
}
public void setUserCode(String userCode) {
this.userCode = userCode;
}
public String getSubmchid() {
return submchid;
}
public void setSubmchid(String submchid) {
this.submchid = submchid;
}
public String getPayChannel() {
return payChannel;
}
public void setPayChannel(String payChannel) {
this.payChannel = payChannel;
}
}
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
user_code, user_code,
pay_no, pay_no,
pay_code, pay_code,
pay_method,
pay_channel, pay_channel,
pay_status, pay_status,
amount, amount,
...@@ -17,7 +18,7 @@ ...@@ -17,7 +18,7 @@
card_code, card_code,
create_by, create_by,
update_by update_by
) VALUES (#{code}, #{userCode}, #{payNo}, #{payCode}, #{payChannel}, #{payStatus}, #{amount}, #{subject}, #{tradeNo}, #{payType}, #{cardCode}, #{createdUser}, #{modifiedUser}) ) VALUES (#{code}, #{userCode}, #{payNo}, #{payCode},#{payMethod}, #{payChannel}, #{payStatus}, #{amount}, #{subject}, #{tradeNo}, #{payType}, #{cardCode}, #{createdUser}, #{modifiedUser})
</insert> </insert>
<update id="updateOrderStatus"> <update id="updateOrderStatus">
UPDATE youka_orders UPDATE youka_orders
...@@ -25,6 +26,13 @@ ...@@ -25,6 +26,13 @@
WHERE pay_code = #{payCode} WHERE pay_code = #{payCode}
</update> </update>
<update id="updateOrderTradeNo">
UPDATE youka_orders
SET trade_no = #{tradeNo}
WHERE pay_code = #{payCode}
</update>
<select id="getCDEUsers" resultType="com.thinkgem.jeesite.modules.pay.entity.UserRateEntity"> <select id="getCDEUsers" resultType="com.thinkgem.jeesite.modules.pay.entity.UserRateEntity">
SELECT SELECT
yu.code AS userCode, yu.code AS userCode,
...@@ -69,6 +77,7 @@ ...@@ -69,6 +77,7 @@
pay_no, pay_no,
pay_code, pay_code,
pay_channel, pay_channel,
pay_method,
pay_status, pay_status,
amount, amount,
subject, subject,
...@@ -95,9 +104,16 @@ ...@@ -95,9 +104,16 @@
card_code card_code
FROM youka_orders FROM youka_orders
WHERE pay_status = 1 WHERE pay_status = 1
AND create_date &lt;= #{create} <if test="endTime != null and endTime != ''">
AND create_date &lt;= #{endTime}
</if>
<if test="startTime != null and startTime != ''">
AND create_date >= #{startTime}
</if>
AND del_flag = 0 AND del_flag = 0
</select> </select>
<select id="getBenefitSum" resultType="com.thinkgem.jeesite.modules.pay.entity.BenefitEntity"> <select id="getBenefitSum" resultType="com.thinkgem.jeesite.modules.pay.entity.BenefitEntity">
SELECT SELECT
SUM(amount) AS amount SUM(amount) AS amount
......
...@@ -286,6 +286,47 @@ ...@@ -286,6 +286,47 @@
LIMIT 1 LIMIT 1
</select> </select>
<select id="getCardInfoSwpaccid" resultType="com.thinkgem.jeesite.modules.user.entity.CardEntity">
SELECT
yc.id,
yc.code,
yc.user_code AS userCode,
yc.card_type AS cardType,
yc.card_no AS cardNo,
yc.card_mobile AS cardMobile,
yc.belong_bank AS belongBank,
yb.bank_name AS bankName,
yb.bank_short AS bankShort,
yb.support_pay_channel AS supportPayChannel,
yc.card_bank AS cardBank,
yc.card_place AS cardPlace,
yc.is_debit AS isDebit,
yc.sub_merchant_id AS subMerchantId,
yc.card_src AS cardSrc,
yc.type,
yc.status,
yc.province,
yc.city,
yc.create_date AS created,
yc.create_by AS createdUser,
yc.update_date AS modified,
yc.update_by AS modifiedUser,
yc.del_flag AS delFlag,
ycs.swpaccid
FROM
youka_cards yc
LEFT JOIN youka_bank yb ON yc.belong_bank = yb.bank_code
LEFT JOIN youka_card_swpaccid ON ycs.card_code = yc.code
WHERE
yc.user_code = #{subMerchantCode}
AND yc.code = #{cardCode}
AND yc.del_flag = '0'
AND ycs.pay_method = #{payMethod}
AND ycs.pay_channel = #{payChannel}
LIMIT 1
</select>
<update id="removeCards"> <update id="removeCards">
UPDATE UPDATE
youka_cards youka_cards
...@@ -425,6 +466,7 @@ ...@@ -425,6 +466,7 @@
yr.pay_method AS payMethod, yr.pay_method AS payMethod,
yr.pay_channel AS payChannel, yr.pay_channel AS payChannel,
yr.rate, yr.rate,
yr.rate_type,
yr.balance, yr.balance,
yr.single_limit AS singleLimit, yr.single_limit AS singleLimit,
yr.day_limit AS dayLimit, yr.day_limit AS dayLimit,
...@@ -695,5 +737,89 @@ ...@@ -695,5 +737,89 @@
WHERE WHERE
yl.`level` = #{level} yl.`level` = #{level}
</select> </select>
<insert id="addUserSubmchid">
insert into youka_user_submchid(
user_code,
pay_channel,
submchid
) VALUES(
#{userCode},
#{payChannel},
#{submchid}
)
</insert>
<update id="updateUserSubmchid">
UPDATE youka_user_submchid SET submchid = #{submchid}
WHERE user_code = #{userCode}
AND pay_channel = #{payChannel}
</update>
<select id="getUserSubmchid" resultType="com.thinkgem.jeesite.modules.user.entity.UserSubMchId">
SELECT
user_code,
pay_channel,
submchid
FROM youka_user_submchid
WHERE user_code = #{userCode}
AND pay_channel = #{payChannel}
</select>
<select id="getDebitCardByUserCode" resultType="com.thinkgem.jeesite.modules.user.entity.CardEntity">
SELECT
yc.id,
yc.code,
yc.user_code AS userCode,
yc.card_type AS cardType,
yc.card_no AS cardNo,
yc.card_mobile AS cardMobile,
yc.belong_bank AS belongBank,
yc.card_bank AS cardBank,
yc.card_place AS cardPlace,
yc.is_debit AS isDebit,
yc.sub_merchant_id AS subMerchantId,
yc.card_src AS cardSrc,
yc.type,
yc.status,
yc.province,
yc.city,
yc.create_date AS created,
yc.create_by AS createdUser,
yc.update_date AS modified,
yc.update_by AS modifiedUser,
yc.del_flag AS delFlag
FROM
youka_cards yc
WHERE
yc.card_no = #{cardNo}
</select>
<insert id="addSwpaccid">
INSERT INTO youka_card_swpaccid(
card_code,
pay_method,
pay_channel,
swpaccid
)VALUES(
#{cardCode},
#{payMethod},
#{payChannel},
#{swpaccid}
)
</insert>
<select id="getSwpaccid" resultType="com.thinkgem.jeesite.modules.user.entity.CardSwpaccidEntity">
SELECT
card_code,
pay_method,
pay_channel,
swpaccid
FROM youka_card_swpaccid
WHEN card_code = #{cardCode}
AND pay_method = #{payMethod}
AND pay_channel = #{payChannel}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -109,7 +109,22 @@ logo.bank.url=https://apimg.alipay.com/combo.png?d=cashier&t= ...@@ -109,7 +109,22 @@ logo.bank.url=https://apimg.alipay.com/combo.png?d=cashier&t=
## 快捷支付相关 ## 快捷支付相关
pay.y = 0 pay.y = 0
## 无积分
pay.settle.type = 177631 pay.settle.type = 177631
pay.merchant_id = 100532502195879
pay.merchant.key = 670993bf-dd22-4464-9d81-69595d36b794
pay.merchant.secret = 289ada73-27db-49e0-b2ad-3ae1613a665a
## 积分 对应通道C-HL3
pay.integral.merchant_id = 100532502191215
pay.integral.merchant.key = 781ed0d6-9657-404c-9f91-79eff2e0b782
pay.integral.merchant.secret = 0033fc8d-161b-4e97-87de-efed7a34bdea
## jfen 对应通道C-HL2
pay.jfen.merchant_id = 100532502198424
pay.jfen.merchant.key = 260a7539-6a2b-410d-aeec-9897ccee92a1
pay.jfen.merchant.secret = 9ad18861-24b3-4904-a2c3-c4401f6f60f3
## 短信相关 ## 短信相关
message.username = 710047 message.username = 710047
......
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