dev-discount
袁野 3 years ago
parent fd23ccaeb7
commit cd9dcee25a
  1. 2
      hai-cweb/src/main/java/com/cweb/controller/OutRechargeOrderController.java
  2. 3
      hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java
  3. 1
      hai-service/src/main/java/com/hai/config/CommonSysConfig.java
  4. 2
      hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java
  5. 33
      hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java
  6. 3
      hai-service/src/main/java/com/hai/service/pay/impl/RechargeOrderServiceImpl.java
  7. 3
      hai-service/src/main/resources/dev/commonConfig.properties

@ -475,7 +475,7 @@ public class OutRechargeOrderController {
outRechargeOrderService.goldPayOrder(userInfoModel.getHighUser().getId(), order.getId()); outRechargeOrderService.goldPayOrder(userInfoModel.getHighUser().getId(), order.getId());
if (order.getRechargeType() == 1) { if (order.getRechargeType() == 1) {
outRechargeOrderService.getMobile(order.getRechargeContent() , order.getPayPrice().intValue());
} }
return ResponseMsgUtil.success("支付成功"); return ResponseMsgUtil.success("支付成功");

@ -386,6 +386,9 @@ public class UnionPayController {
order.setPaySerialNo(body.getString("wtorderid")); // 支付流水号 order.setPaySerialNo(body.getString("wtorderid")); // 支付流水号
order.setPayRealPrice(order.getPayPrice()); // 实付金额 order.setPayRealPrice(order.getPayPrice()); // 实付金额
if (order.getRechargeType() == 1) {
outRechargeOrderService.getMobile(order.getRechargeContent() , order.getPayPrice().intValue());
}
order.setStatus(2); order.setStatus(2);
order.setPayType(4); order.setPayType(4);
order.setPayTime(new Date()); // 支付时间 order.setPayTime(new Date()); // 支付时间

@ -61,6 +61,7 @@ public class CommonSysConfig {
private String CzNotifyUrl; private String CzNotifyUrl;
private String CzAppKey; private String CzAppKey;
private String CzUrl; private String CzUrl;
private String CzAppSecret;
public String getTuanYouUrl() { public String getTuanYouUrl() {
return tuanYouUrl; return tuanYouUrl;

@ -151,7 +151,7 @@ public interface OutRechargeOrderService {
* @Param [java.lang.String] * @Param [java.lang.String]
* @return com.alibaba.fastjson.JSONObject * @return com.alibaba.fastjson.JSONObject
*/ */
JSONObject getMobile(String phone) throws Exception; JSONObject getMobile(String phone , Integer amount) throws Exception;
} }

@ -5,9 +5,13 @@ import com.alibaba.fastjson.JSONObject;
import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode; import com.hai.common.exception.SysCode;
import com.hai.common.pay.util.sdk.WXPayConstants;
import com.hai.common.utils.DateUtil; import com.hai.common.utils.DateUtil;
import com.hai.common.utils.HttpsUtils; import com.hai.common.utils.HttpsUtils;
import com.hai.common.utils.IDGenerator;
import com.hai.common.utils.WxUtils; import com.hai.common.utils.WxUtils;
import com.hai.config.CommonSysConfig;
import com.hai.config.CommonSysConst;
import com.hai.config.HuiLianTongUnionCardConfig; import com.hai.config.HuiLianTongUnionCardConfig;
import com.hai.dao.HighGasOrderPushMapper; import com.hai.dao.HighGasOrderPushMapper;
import com.hai.dao.OutRechargeOrderMapper; import com.hai.dao.OutRechargeOrderMapper;
@ -52,6 +56,9 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
@Resource @Resource
private HighUserService highUserService; private HighUserService highUserService;
@Resource
private OutRechargeOrderService outRechargeOrderService;
@Override @Override
public List<OutRechargeOrder> getListRechargeOrder(Map<String, String> map) { public List<OutRechargeOrder> getListRechargeOrder(Map<String, String> map) {
OutRechargeOrderExample example = new OutRechargeOrderExample(); OutRechargeOrderExample example = new OutRechargeOrderExample();
@ -314,6 +321,9 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
} }
order.setPaySerialNo(consumptionResult.getString("orderId")); // 支付流水号 order.setPaySerialNo(consumptionResult.getString("orderId")); // 支付流水号
order.setPayRealPrice(order.getPayPrice()); // 实付金额 order.setPayRealPrice(order.getPayPrice()); // 实付金额
if (order.getRechargeType() == 1) {
outRechargeOrderService.getMobile(order.getRechargeContent() , order.getPayPrice().intValue());
}
order.setStatus(2); order.setStatus(2);
order.setPayType(2); order.setPayType(2);
order.setPayTime(new Date()); // 支付时间 order.setPayTime(new Date()); // 支付时间
@ -351,22 +361,23 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
} }
@Override @Override
public JSONObject getMobile(String phone) throws Exception { public JSONObject getMobile(String phone , Integer amount) throws Exception {
String timestamp = String.valueOf(System.currentTimeMillis());
Map<String , Object> map = new HashMap<>(); Map<String , Object> map = new HashMap<>();
map.put("mobile" , "18090580471"); map.put("mobile" , phone);
map.put("amount" , "0.01"); map.put("amount" , amount);
map.put("out_order_id" , "CZ20220110895732352345"); map.put("out_order_id" , "CZ" + DateUtil.date2String(new Date(),"yyyyMMddHHmmss") + IDGenerator.nextId(5));
map.put("app_key" , "kg5n9br7evt4q8lp"); map.put("app_key" , CommonSysConst.getSysConfig().getCzAppKey());
map.put("timestamp" , DateUtil.date2String(new Date(),"yyyyMMddHHmmss")); map.put("timestamp" , timestamp.substring(0,timestamp.length()-3));
map.put("is_fast" , "1"); map.put("is_fast" , "1");
map.put("notify_url" , "https://hsgcs.dctpay.com/crest/czOrder/orderRefundNotify"); map.put("notify_url" , CommonSysConst.getSysConfig().getCzNotifyUrl());
StringBuilder signStr = new StringBuilder(WxUtils.generateSignature(map)); String signStr = WxUtils.generateSignatureAppSecret(map, CommonSysConst.getSysConfig().getTelApiSecret() , WXPayConstants.SignType.MD5);
map.put("sign" , WxUtils.MD5(String.valueOf(signStr.append("key=kg5n9br7evt4q8lp")),true)); map.put("sign" , signStr);
JSONObject object = HttpsUtils.doPost("https://hfcs.dmjvip.com/index.php/third/mobile/createOrder" , map); return HttpsUtils.doPost(CommonSysConst.getSysConfig().getCzUrl() , map);
return object;
} }
} }

@ -74,6 +74,9 @@ public class RechargeOrderServiceImpl implements PayService {
order.setPaySerialNo(map.get("transaction_id")); // 支付流水号 order.setPaySerialNo(map.get("transaction_id")); // 支付流水号
order.setPayRealPrice(new BigDecimal(map.get("total_fee")).divide(new BigDecimal("100"))); // 实付金额 order.setPayRealPrice(new BigDecimal(map.get("total_fee")).divide(new BigDecimal("100"))); // 实付金额
order.setPayTime(new Date()); // 支付时间 order.setPayTime(new Date()); // 支付时间
if (order.getRechargeType() == 1) {
outRechargeOrderService.getMobile(order.getRechargeContent() , order.getPayPrice().intValue());
}
order.setStatus(2); // 订单状态 : 1.待支付 2.已支付 3.已完成 4.已取消 5.已退款 order.setStatus(2); // 订单状态 : 1.待支付 2.已支付 3.已完成 4.已取消 5.已退款
outRechargeOrderService.updateOrder(order); outRechargeOrderService.updateOrder(order);

@ -54,4 +54,5 @@ TelMemberId=d13091df65d64aafbf0f35d2093157b7
// Mobile // Mobile
CzNotifyUrl = https://hsgcs.dctpay.com/crest/czOrder/orderRefundNotify CzNotifyUrl = https://hsgcs.dctpay.com/crest/czOrder/orderRefundNotify
CzAppKey = kg5n9br7evt4q8lp CzAppKey = kg5n9br7evt4q8lp
CzUrl = https://hfcs.dmjvip.com/index.php/third/mobile/createOrder CzUrl = https://hfcs.dmjvip.com/index.php/third/mobile/createOrder
CzAppSecret = xkf9eoq2cjh6uvzp0mtrga134lnibdw8

Loading…
Cancel
Save