dev-discount
袁野 3 years ago
parent cd9dcee25a
commit 3298aa2a82
  1. 2
      hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
  2. 2
      hai-cweb/src/main/java/com/cweb/controller/OutRechargeOrderController.java
  3. 2
      hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java
  4. 2
      hai-service/src/main/java/com/hai/service/HighTestService.java
  5. 2
      hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java
  6. 17
      hai-service/src/main/java/com/hai/service/impl/HighTestServiceImpl.java
  7. 6
      hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java
  8. 2
      hai-service/src/main/java/com/hai/service/pay/impl/RechargeOrderServiceImpl.java

File diff suppressed because one or more lines are too long

@ -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()); outRechargeOrderService.getMobile(order.getRechargeContent() , order.getPayPrice().intValue() , order.getOrderNo());
} }
return ResponseMsgUtil.success("支付成功"); return ResponseMsgUtil.success("支付成功");

@ -387,7 +387,7 @@ 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) { if (order.getRechargeType() == 1) {
outRechargeOrderService.getMobile(order.getRechargeContent() , order.getPayPrice().intValue()); outRechargeOrderService.getMobile(order.getRechargeContent() , order.getPayPrice().intValue() , order.getOrderNo());
} }
order.setStatus(2); order.setStatus(2);
order.setPayType(4); order.setPayType(4);

@ -40,6 +40,6 @@ public interface HighTestService {
* @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 , String orderNo) throws Exception;
} }

@ -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 , Integer amount) throws Exception; JSONObject getMobile(String phone , Integer amount , String orderNo) throws Exception;
} }

@ -7,6 +7,7 @@ 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.pay.util.sdk.WXPayConstants;
import com.hai.common.utils.*; import com.hai.common.utils.*;
import com.hai.config.CommonSysConst;
import com.hai.dao.HighUserEtcMapper; import com.hai.dao.HighUserEtcMapper;
import com.hai.entity.HighDiscountAgentCode; import com.hai.entity.HighDiscountAgentCode;
import com.hai.entity.HighUser; import com.hai.entity.HighUser;
@ -137,23 +138,23 @@ public class HighTestServiceImpl implements HighTestService {
} }
@Override @Override
public JSONObject getMobile(String phone) throws Exception { public JSONObject getMobile(String phone , Integer amount , String orderNo) throws Exception {
String timestamp = String.valueOf(System.currentTimeMillis()); 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" , "30"); map.put("amount" , amount);
map.put("out_order_id" , "CZ" + DateUtil.date2String(new Date(),"yyyyMMddHHmmss") + IDGenerator.nextId(5)); map.put("out_order_id" , orderNo);
map.put("app_key" , "eaomqcbpdz7yjfih"); map.put("app_key" , CommonSysConst.getSysConfig().getCzAppKey());
map.put("timestamp" , timestamp.substring(0,timestamp.length()-3)); 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());
String signStr = WxUtils.generateSignatureAppSecret(map, "xkf9eoq2cjh6uvzp0mtrga134lnibdw8" , WXPayConstants.SignType.MD5); String signStr = WxUtils.generateSignatureAppSecret(map, CommonSysConst.getSysConfig().getTelApiSecret() , WXPayConstants.SignType.MD5);
map.put("sign" , signStr); map.put("sign" , signStr);
return HttpsUtils.doPost("https://hfcs.dmjvip.com/index.php/third/mobile/createOrder" , map); return HttpsUtils.doPost(CommonSysConst.getSysConfig().getCzUrl() , map);
} }
} }

@ -322,7 +322,7 @@ 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) { if (order.getRechargeType() == 1) {
outRechargeOrderService.getMobile(order.getRechargeContent() , order.getPayPrice().intValue()); outRechargeOrderService.getMobile(order.getRechargeContent() , order.getPayPrice().intValue() , order.getOrderNo());
} }
order.setStatus(2); order.setStatus(2);
order.setPayType(2); order.setPayType(2);
@ -361,14 +361,14 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
} }
@Override @Override
public JSONObject getMobile(String phone , Integer amount) throws Exception { public JSONObject getMobile(String phone , Integer amount , String orderNo) throws Exception {
String timestamp = String.valueOf(System.currentTimeMillis()); String timestamp = String.valueOf(System.currentTimeMillis());
Map<String , Object> map = new HashMap<>(); Map<String , Object> map = new HashMap<>();
map.put("mobile" , phone); map.put("mobile" , phone);
map.put("amount" , amount); map.put("amount" , amount);
map.put("out_order_id" , "CZ" + DateUtil.date2String(new Date(),"yyyyMMddHHmmss") + IDGenerator.nextId(5)); map.put("out_order_id" , orderNo);
map.put("app_key" , CommonSysConst.getSysConfig().getCzAppKey()); map.put("app_key" , CommonSysConst.getSysConfig().getCzAppKey());
map.put("timestamp" , timestamp.substring(0,timestamp.length()-3)); map.put("timestamp" , timestamp.substring(0,timestamp.length()-3));
map.put("is_fast" , "1"); map.put("is_fast" , "1");

@ -75,7 +75,7 @@ public class RechargeOrderServiceImpl implements PayService {
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) { if (order.getRechargeType() == 1) {
outRechargeOrderService.getMobile(order.getRechargeContent() , order.getPayPrice().intValue()); outRechargeOrderService.getMobile(order.getRechargeContent() , order.getPayPrice().intValue() , order.getOrderNo());
} }
order.setStatus(2); // 订单状态 : 1.待支付 2.已支付 3.已完成 4.已取消 5.已退款 order.setStatus(2); // 订单状态 : 1.待支付 2.已支付 3.已完成 4.已取消 5.已退款
outRechargeOrderService.updateOrder(order); outRechargeOrderService.updateOrder(order);

Loading…
Cancel
Save