Merge branch 'master' into pre

dev-discount
胡锐 2 years ago
commit 2d00072777
  1. 3
      hai-bweb/src/main/java/com/bweb/excelListener/ImportRechargeOrderListener.java
  2. 3
      hai-cweb/src/main/java/com/cweb/controller/pay/CzOrderController.java
  3. 6
      hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java
  4. 6
      hai-service/src/main/java/com/hai/config/CommonSysConfig.java
  5. 12
      hai-service/src/main/java/com/hai/config/HuiLianTongConfig.java
  6. 5
      hai-service/src/main/java/com/hai/config/RechargeConfig.java
  7. 2
      hai-service/src/main/java/com/hai/service/impl/HltUnionCardVipServiceImpl.java
  8. 43
      hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java

@ -40,7 +40,7 @@ public class ImportRechargeOrderListener extends AnalysisEventListener<ExportOut
OutRechargeOrder rechargeOrder = outRechargeOrderService.findByOrderNo(data.getOrderNo());
if (rechargeOrder.getRechargeStatus() != 201 || rechargeOrder.getRechargeType() != 2) {
if (rechargeOrder.getRechargeStatus() != 203 || rechargeOrder.getRechargeType() != 2) {
data.setErrorMessage("当前订单状态错误。");
errorData.add(data);
return;
@ -56,7 +56,6 @@ public class ImportRechargeOrderListener extends AnalysisEventListener<ExportOut
errorData.add(data);
return;
}
}

@ -278,7 +278,8 @@ public class CzOrderController {
Date rechargeTime = rechargeOrder.getCreateTimed();
Date currentTime = new Date();
int hours = (int) ((rechargeTime.getTime() - currentTime.getTime()) / (1000 * 60 * 60));
// 当前时间减去充值时间
int hours = (int) ((currentTime.getTime() - rechargeTime.getTime()) / (1000 * 60 * 60));
// 判断快充 并且 充值时间小于6
if (rechargeOrder.getRechargeType() == 1 && hours < 6) {

@ -95,16 +95,16 @@ public class HighOrderSchedule {
@Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次
public void initRechargeOrder() {
Map<String, Object> map = new HashMap<>();
map.put("status" , String.valueOf(102));
map.put("payStatus" , String.valueOf(102));
map.put("rechargeStatus" , String.valueOf(204));
List<OutRechargeOrder> orderList = outRechargeOrderService.getListRechargeOrder(map);
if (orderList != null && orderList.size() > 0) {
System.out.println("订单数量------------------------------------------------------------------------------" + orderList.size());
if (orderList.size() > 0) {
for (OutRechargeOrder order : orderList) {
try {
// 查询充值子订单
Map<String, Object> childOrderMap = new HashMap<>();
childOrderMap.put("parent_order_id" , order.getId());
childOrderMap.put("status" , 102);

@ -61,7 +61,7 @@ public class CommonSysConfig {
private String czOrderNotify;
private String lyApiKey;
private String lyNotifyUrl;
private String LyNotifyUrl;
private String lyMemberId;
private String LyPostUrl;
@ -467,10 +467,10 @@ public class CommonSysConfig {
}
public String getLyNotifyUrl() {
return lyNotifyUrl;
return LyNotifyUrl;
}
public void setLyNotifyUrl(String lyNotifyUrl) {
this.lyNotifyUrl = lyNotifyUrl;
LyNotifyUrl = lyNotifyUrl;
}
}

@ -13,6 +13,7 @@ import com.hai.dao.HighGasOrderPushMapper;
import com.hai.entity.HighCouponCodeOther;
import com.hai.entity.HighGasOrderPush;
import com.hai.entity.HighUserCoupon;
import com.hai.enum_type.OrderPushType;
import org.apache.commons.collections4.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
@ -136,6 +137,7 @@ public class HuiLianTongConfig {
JSONObject object1 = HttpsUtils.doHuiLianTongPost(CommonSysConst.getSysConfig().getHuiliantongUrl() + "/coupon/api/coupon_corp/couJointDist?" + paramStr);
new Thread(() -> {
try {
if (object1 != null && object1.getString("result").equals("success")) {
JSONArray dataArray = object1.getJSONArray("data");
for (Object data : dataArray) {
@ -150,12 +152,14 @@ public class HuiLianTongConfig {
mapPost.put("couTypeCode" , dataObject.getString("couTypeCode"));
mapPost.put("validStartDate" , dataObject.getDate("validStartDate"));
mapPost.put("validEndDate" , dataObject.getDate("validEndDate"));
try {
HuiLianTongUnionCardConfig.syncPayOrder(mapPost);
} catch (Exception e) {
e.printStackTrace();
JSONObject o = HuiLianTongUnionCardConfig.syncPayOrder(mapPost);
System.out.println("订单同步请求参数---------" + mapPost);
System.out.println("订单同步请求结果---------" + o);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}).start();

@ -63,7 +63,7 @@ public class RechargeConfig {
paramMap.put("out_trade_num" , object.getString("out_trade_num"));
paramMap.put("product_id" , object.getString("product_id"));
paramMap.put("mobile" , object.getString("mobile"));
paramMap.put("notify_url" , CommonSysConst.getSysConfig().getLyNotifyUrl());
paramMap.put("notify_url" , object.getString("notifyUrl"));
paramMap.put("userid" , CommonSysConst.getSysConfig().getLyMemberId());
paramMap.put("sign", WxUtils.generateSignatureLy(paramMap , CommonSysConst.getSysConfig().getLyApiKey() , WXPayConstants.SignType.MD5));
return HttpsUtils.doPost(CommonSysConst.getSysConfig().getLyPostUrl()+ "index/recharge", paramMap);
@ -108,8 +108,7 @@ public class RechargeConfig {
map.put("app_key" , CommonSysConst.getSysConfig().getJjAppKey());
map.put("timestamp" , timestamp.substring(0,timestamp.length()-3));
map.put("is_fast" , object.getString("is_fast"));
map.put("notify_url" , CommonSysConst.getSysConfig().getJjNotifyUrl());
map.put("notify_url" , object.getString("notifyUrl"));
String signStr = WxUtils.generateSignatureAppSecret(map, CommonSysConst.getSysConfig().getJjAppSecret() , WXPayConstants.SignType.MD5);
map.put("sign" , signStr);

@ -199,7 +199,7 @@ public class HltUnionCardVipServiceImpl implements HltUnionCardVipService {
HuiLianTongUnionCardConfig.submitSms(phone , "“E信通春节关怀”3张4元话费券、99折加油券已到账,打开“嗨森逛”微信小程序>我的>我的优惠券即可直接使用,到账之日起1月内(30天)有效。");
} else {
if (equityLevel == 1) {
HuiLianTongUnionCardConfig.submitSms(phone , "“E信通会员专属”3张4元话费券、2张96折加油券已到账,打开“嗨森逛”微信小程序>我的>我的优惠券即可直接使用,到账之日起1月内(30天)有效。");
HuiLianTongUnionCardConfig.submitSms(phone , "“E信通会员专属”3张4元话费券、2张99折加油券已到账,打开“嗨森逛”微信小程序>我的>我的优惠券即可直接使用,到账之日起1月内(30天)有效。");
} else {
HuiLianTongUnionCardConfig.submitSms(phone , "“工会卡用户专属”2元话费券、2张96折加油券已到账,打开“嗨森逛”微信小程序>我的>我的优惠券即可直接使用,到账之日起1月内(30天)有效。");
}

@ -587,6 +587,7 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
public void rechargeOrderToRefund(Long orderId) throws Exception {
OutRechargeOrder order = outRechargeOrderService.findByOrderId(orderId);
System.out.println("发起退款------------------------------------------------------------------------------" + orderId);
// 101.待支付 102.已支付 100.已完成 104.已取消 105.已退款
if (order.getPayStatus() != 102) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法退款,订单不处于已支付状态");
@ -597,10 +598,8 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法退款,订单处于充值中状态");
}
// 1:支付宝 2:微信 3:汇联通工会卡 4:银联 5:银联分期
if (order.getPayType() == null) {
// 退还积分
if (order.getIntegralNum() != null) {
if (order.getIntegralNum().compareTo(new BigDecimal(0)) > 0) {
highUserService.goldHandle(order.getUserId(), order.getIntegralNum().intValue(), 1, 3, order.getId());
if (order.getPayRealPrice().compareTo(new BigDecimal(0)) == 0) {
order.setPayStatus(105);
@ -609,7 +608,6 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
outRechargeOrderService.updateOrder(order);
}
}
} else {
// 微信退款
if (order.getPayType() == 2) {
Map<String, String> param = new HashMap<>();
@ -679,7 +677,6 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
order.setRefundFee(order.getPayRealPrice());
outRechargeOrderService.updateOrder(order);
}
}
if (order.getMemDiscountId() != null) {
@ -755,21 +752,46 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
outRechargeChildOrderService.updateOrder(childOrder);
type = childOrder.getRechargePlatform();
} else {
// 查询充值子订单
Map<String, Object> childOrderMap103 = new HashMap<>();
childOrderMap.put("parent_order_id", outRechargeOrder.getId());
childOrderMap.put("status", 103);
List<OutRechargeChildOrder> childOrderList103 = outRechargeChildOrderService.getListRechargeChildOrder(childOrderMap103);
if (childOrderList103.size() > 0) {
type = childOrderList103.get(0).getRechargePlatform();
}
}
if (type == 2) {
type = 1;
} else {
type++;
}
JSONObject object = new JSONObject();
String orderNo = "CZ" + DateUtil.date2String(new Date(), "yyyyMMddHHmmss") + IDGenerator.nextId(5);
String[] rechargePlatform = outRechargePrice.getRechargePlatform().split("-");
String string = outRechargePrice.getRechargePlatform().substring(1,outRechargePrice.getRechargePlatform().length()-1);
String[] rechargePlatform = string.split("-");
if (string.length() == 1) {
type = Integer.parseInt(string);
}
for (String s : rechargePlatform) {
// 尖椒充值
if (s.equals("1") && (type == 2 || type == 0)) {
if (s.equals("1") && type == 1) {
object.put("out_order_id", orderNo);
object.put("amount", outRechargePrice.getRechargePrice());
object.put("mobile", outRechargeOrder.getRechargeContent());
if (outRechargePrice.getRechargeType() == 1) {
object.put("notifyUrl", CommonSysConst.getSysConfig().getJjNotifyUrl());
System.out.println("outRechargeOrder-----------------------------------------------------------------------------------------------------------------------------------------------------" + outRechargePrice.getRechargeType());
if (outRechargeOrder.getRechargeType() == 1) {
object.put("is_fast", 1);
}
JSONObject returnObject = RechargeConfig.rechargeOrderByJj(object);
@ -782,11 +804,14 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
rechargePlatformType = 1;
break;
}
if (s.equals("2") && (type == 1 || type == 0)) {
// 龙阅充值
if (s.equals("2") && type == 2) {
object.put("out_trade_num", orderNo);
object.put("product_id", outRechargePrice.getGoodsId());
object.put("mobile", outRechargeOrder.getRechargeContent());
object.put("notifyUrl", CommonSysConst.getSysConfig().getLyNotifyUrl());
JSONObject returnObject = RechargeConfig.rechargeOrderByLy(object);
System.out.println("龙阅请求回调地址---------------------" + CommonSysConst.getSysConfig().getLyNotifyUrl());
object.put("return_content", returnObject);
if (returnObject != null && returnObject.getLong("errno") == 0) {
childOrder.setStatus(102);

Loading…
Cancel
Save