Merge branch '2.0-dev' of http://gitea.dctpay.com/hurui/hai-server into 2.0-dev

new-dev
胡锐 2 years ago
commit 76e47530dd
  1. 2
      hai-bweb/src/main/java/com/bweb/controller/HighGasController.java
  2. 2
      hai-bweb/src/main/java/com/bweb/controller/HighTestController.java
  3. 3
      hai-cweb/src/main/java/com/cweb/controller/CommonController.java
  4. 18
      hai-cweb/src/main/java/com/cweb/controller/Goods/ShoppingCartController.java
  5. 2
      hai-schedule/src/main/java/com/hai/schedule/HighIntegralSchedule.java
  6. 6
      hai-service/src/main/java/com/hai/entity/HighGoldRec.java
  7. 10
      hai-service/src/main/java/com/hai/goods/service/ShoppingCartService.java
  8. 24
      hai-service/src/main/java/com/hai/goods/service/impl/ShoppingCartServiceImpl.java
  9. 2
      hai-service/src/main/java/com/hai/openApi/config/PriceComputeConfig.java
  10. 10
      hai-service/src/main/java/com/hai/openApi/service/ApiOrderService.java
  11. 43
      hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderServiceImpl.java
  12. 3
      hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java
  13. 10
      hai-service/src/main/java/com/hai/order/service/impl/OrderRefundServiceImpl.java
  14. 6
      hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java
  15. 2
      hai-service/src/main/java/com/hai/service/CommonService.java
  16. 2
      hai-service/src/main/java/com/hai/service/HighActivityUserLotteryNumService.java
  17. 10
      hai-service/src/main/java/com/hai/service/HighGoldRecService.java
  18. 2
      hai-service/src/main/java/com/hai/service/HighUserService.java
  19. 14
      hai-service/src/main/java/com/hai/service/impl/ApiMerchantsServiceImpl.java
  20. 6
      hai-service/src/main/java/com/hai/service/impl/BsDistributionUserRelServiceImpl.java
  21. 9
      hai-service/src/main/java/com/hai/service/impl/BsOrderRebateServiceImpl.java
  22. 26
      hai-service/src/main/java/com/hai/service/impl/CommonServiceImpl.java
  23. 6
      hai-service/src/main/java/com/hai/service/impl/HighActivityUserLotteryNumServiceImpl.java
  24. 36
      hai-service/src/main/java/com/hai/service/impl/HighGoldRecServiceImpl.java
  25. 3
      hai-service/src/main/java/com/hai/service/impl/HighGoodsTypeServiceImpl.java
  26. 12
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java
  27. 3
      hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java
  28. 2
      hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java
  29. 2
      hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java
  30. 4
      hai-service/src/main/resources/prod-9401/commonConfig.properties
  31. 4
      hai-service/src/main/resources/prod/commonConfig.properties
  32. 133
      v1/src/main/java/com/v1/controller/WxMsgController.java
  33. 8
      v1/src/main/java/com/v1/controller/business/ApiMerchantsController.java
  34. 51
      v1/src/main/java/com/v1/controller/business/GzSinopecController.java
  35. 8
      v1/src/main/java/com/v1/controller/business/KfcController.java
  36. 4
      v1/src/main/java/com/v1/controller/business/MemberProductsController.java
  37. 4
      v1/src/main/java/com/v1/controller/business/MobileRechargeController.java
  38. 146
      v1/src/main/java/com/v1/controller/business/OrderRebateController.java
  39. 4
      v1/src/main/java/com/v1/controller/business/RefuelOnlineController.java
  40. 8
      v1/src/main/java/com/v1/controller/business/StarbucksController.java
  41. 95
      v1/src/main/java/com/v1/controller/orderController.java

@ -856,7 +856,7 @@ public class HighGasController {
} else if (order.getPayType() == 3){ } else if (order.getPayType() == 3){
String remark = "订单" + order.getOrderNo() + "退款,退还积分:" + order.getPayGold(); String remark = "订单" + order.getOrderNo() + "退款,退还积分:" + order.getPayGold();
// 积分退款 // 积分退款
highUserService.goldHandle(order.getMemId(), order.getPayGold(),1, 3, order.getId() , remark); highUserService.goldHandle(order.getMemId(), order.getPayGold(),1, 3, order.getId() , remark , order.getOrderNo());
order.setOrderStatus(4); order.setOrderStatus(4);
//order.setRefundTime(new Date()); //order.setRefundTime(new Date());
//order.setRefundPrice(order.getPayRealPrice()); //order.setRefundPrice(order.getPayRealPrice());

File diff suppressed because one or more lines are too long

@ -426,6 +426,7 @@ public class CommonController {
@ApiOperation(value = "获取地图门店") @ApiOperation(value = "获取地图门店")
public ResponseData getMapStore( public ResponseData getMapStore(
@RequestParam(name = "distance", required = true) Double distance, @RequestParam(name = "distance", required = true) Double distance,
@RequestParam(name = "type", required = true) Integer type,
@RequestParam(name = "name", required = false) String name, @RequestParam(name = "name", required = false) String name,
@RequestParam(name = "childId", required = false) Long childId, @RequestParam(name = "childId", required = false) Long childId,
@RequestParam(name = "longitude", required = true) String longitude, @RequestParam(name = "longitude", required = true) String longitude,
@ -433,7 +434,7 @@ public class CommonController {
) { ) {
try { try {
return ResponseMsgUtil.success(commonService.getMapStore(name , childId , latitude , longitude , distance)); return ResponseMsgUtil.success(commonService.getMapStore(name , childId , latitude , longitude , distance , type));
} catch (Exception e) { } catch (Exception e) {
log.error("HighOrderController --> unionStagingPay() error!", e); log.error("HighOrderController --> unionStagingPay() error!", e);

@ -133,6 +133,16 @@ public class ShoppingCartController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "超过最大库存!"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "超过最大库存!");
} }
Map<String, Object> map = new HashMap<>();
map.put("userId", userInfoModel.getHighUser().getId());
map.put("goodsId", shoppingCart.getGoodsId());
map.put("sku", shoppingCart.getSku());
GoodsShoppingCart goodsShoppingCart = shoppingCartService.findShoppingCartByMap(map);
if (goodsShoppingCart == null) {
shoppingCart.setUserId(userInfoModel.getHighUser().getId()); shoppingCart.setUserId(userInfoModel.getHighUser().getId());
shoppingCart.setTitle(goodsDetail.getName()); shoppingCart.setTitle(goodsDetail.getName());
shoppingCart.setImg(sku.getShowImg()); shoppingCart.setImg(sku.getShowImg());
@ -143,8 +153,14 @@ public class ShoppingCartController {
shoppingCart.setUpdateTime(new Date()); shoppingCart.setUpdateTime(new Date());
shoppingCartService.insertShoppingCart(shoppingCart); shoppingCartService.insertShoppingCart(shoppingCart);
} else {
int num = Integer.parseInt(shoppingCart.getNum()) + Integer.parseInt(goodsShoppingCart.getNum());
goodsShoppingCart.setNum(Integer.toString(num));
shoppingCartService.updateShoppingCart(goodsShoppingCart);
}
return ResponseMsgUtil.success("新增成功"); return ResponseMsgUtil.success("成功");
} catch (Exception e) { } catch (Exception e) {
log.error("GoodsDetailController --> insertPrice() error!", e); log.error("GoodsDetailController --> insertPrice() error!", e);

@ -36,7 +36,7 @@ public class HighIntegralSchedule {
for (HighGoldRec goldRec : list) { for (HighGoldRec goldRec : list) {
highUserService.goldHandle(goldRec.getUserId(), goldRec.getGold(), 2, 5, goldRec.getResId() , "积分过期" ); highUserService.goldHandle(goldRec.getUserId(), goldRec.getGold(), 2, 5, goldRec.getResId() , "积分过期" , goldRec.getResOrderNo());
goldRec.setStatus(9); goldRec.setStatus(9);
goldRec.setUpdateTime(new Date()); goldRec.setUpdateTime(new Date());

@ -1,5 +1,7 @@
package com.hai.entity; package com.hai.entity;
import com.hai.model.HighGoldRecModel;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
@ -12,7 +14,7 @@ import java.util.Date;
* 代码由工具生成 * 代码由工具生成
* *
**/ **/
public class HighGoldRec implements Serializable { public class HighGoldRec extends HighGoldRecModel implements Serializable {
/** /**
* 编号 * 编号
*/ */
@ -44,7 +46,7 @@ public class HighGoldRec implements Serializable {
private Date createTime; private Date createTime;
/** /**
* 来源类型1.充值 2.订单 3.退款 * 来源类型1.充值 2.订单 3退款 4积分返利 101:惠支付积分返利 102惠支付门店活动差价返利 103: 积分冻结
*/ */
private Integer resType; private Integer resType;

@ -56,6 +56,16 @@ public interface ShoppingCartService {
*/ */
GoodsShoppingCart findShoppingCartById(Long id); GoodsShoppingCart findShoppingCartById(Long id);
/**
* @Author Sum1Dream
* @Name findShoppingCartByMap
* @Description // 根据map查询购物车
* @Date 14:20 2023/5/5
* @Param [map]
* @Return com.hai.entity.GoodsShoppingCart
*/
GoodsShoppingCart findShoppingCartByMap(Map<String , Object> map);
/** /**
* @Author Sum1Dream * @Author Sum1Dream
* @Name DeleteShoppingCart * @Name DeleteShoppingCart

@ -44,6 +44,30 @@ public class ShoppingCartServiceImpl implements ShoppingCartService {
return shoppingCartMapper.selectByPrimaryKey(id); return shoppingCartMapper.selectByPrimaryKey(id);
} }
@Override
public GoodsShoppingCart findShoppingCartByMap(Map<String, Object> map) {
GoodsShoppingCartExample example = new GoodsShoppingCartExample();
GoodsShoppingCartExample.Criteria criteria = example.createCriteria();
if (MapUtils.getLong(map, "userId") != null) {
criteria.andUserIdEqualTo(MapUtils.getLong(map, "userId"));
}
if (MapUtils.getString(map, "sku") != null) {
criteria.andSkuEqualTo(MapUtils.getString(map, "sku"));
}
if (MapUtils.getLong(map, "goodsId") != null) {
criteria.andGoodsIdEqualTo(MapUtils.getLong(map, "goodsId"));
}
List<GoodsShoppingCart> list = shoppingCartMapper.selectByExample(example);
if (list.size() > 0 ) {
return list.get(0);
}
return null;
}
@Override @Override
public void deleteShoppingCart(Long id) { public void deleteShoppingCart(Long id) {
shoppingCartMapper.deleteByPrimaryKey(id); shoppingCartMapper.deleteByPrimaryKey(id);

@ -31,7 +31,7 @@ public class PriceComputeConfig {
public Boolean mchBalance(ApiMerchants apiMerchants , BigDecimal price , String orderNo) { public Boolean mchBalance(ApiMerchants apiMerchants , BigDecimal price , String orderNo) {
// 当前账号余额是否可以充值当前金额 // 当前账号余额是否可以使用当前金额
if (apiMerchants.getAmounts().compareTo(price) < 0) { if (apiMerchants.getAmounts().compareTo(price) < 0) {
return false; return false;
} }

@ -57,4 +57,14 @@ public interface ApiOrderService {
* @Return com.hai.entity.ApiOrder * @Return com.hai.entity.ApiOrder
*/ */
ApiOrder findByOrderNo(String mchOrderNo , String orderNo); ApiOrder findByOrderNo(String mchOrderNo , String orderNo);
/**
* @Author Sum1Dream
* @Name refund
* @Description // 退款
* @Date 16:24 2023/5/4
* @Param [orderNo]
* @Return void
*/
void refund(String orderNo);
} }

@ -10,6 +10,7 @@ import com.hai.entity.ApiMerchants;
import com.hai.entity.ApiOrder; import com.hai.entity.ApiOrder;
import com.hai.entity.ApiOrderExample; import com.hai.entity.ApiOrderExample;
import com.hai.entity.HighOrder; import com.hai.entity.HighOrder;
import com.hai.enum_type.OrderStatusEnum;
import com.hai.openApi.service.ApiOrderCreateHandleService; import com.hai.openApi.service.ApiOrderCreateHandleService;
import com.hai.openApi.service.ApiOrderService; import com.hai.openApi.service.ApiOrderService;
import com.hai.order.model.CreateOrderChildModel; import com.hai.order.model.CreateOrderChildModel;
@ -18,6 +19,7 @@ import com.hai.order.service.OrderPayBeforeService;
import com.hai.order.service.OrderPayService; import com.hai.order.service.OrderPayService;
import com.hai.order.service.OrderService; import com.hai.order.service.OrderService;
import com.hai.order.type.OrderChildGoodsType; import com.hai.order.type.OrderChildGoodsType;
import com.hai.order.type.OrderPayType;
import com.hai.order.type.OrderProductType; import com.hai.order.type.OrderProductType;
import com.hai.order.type.OrderStatus; import com.hai.order.type.OrderStatus;
import com.hai.order.utils.OrderUtil; import com.hai.order.utils.OrderUtil;
@ -53,8 +55,7 @@ public class ApiOrderServiceImpl implements ApiOrderService {
@Resource @Resource
private OrderPayService orderPayService; private OrderPayService orderPayService;
@Resource
private ApiOrderService apiOrderService;
@Override @Override
@Transactional(rollbackFor=Exception.class,propagation= Propagation.REQUIRES_NEW) @Transactional(rollbackFor=Exception.class,propagation= Propagation.REQUIRES_NEW)
@ -224,7 +225,7 @@ public class ApiOrderServiceImpl implements ApiOrderService {
ApiMerchants apiMerchants = apiMerchantsService.findByMchId(object.getString("merchId")); ApiMerchants apiMerchants = apiMerchantsService.findByMchId(object.getString("merchId"));
ApiOrder apiOrder = apiOrderService.findByOrderNo(object.getString("mchOrderNo") , null); ApiOrder apiOrder = findByOrderNo(object.getString("mchOrderNo") , null);
// 查询订单 // 查询订单
HighOrder order = orderService.getOrderDetailByNo(object.getString("orderNo")); HighOrder order = orderService.getOrderDetailByNo(object.getString("orderNo"));
@ -308,4 +309,40 @@ public class ApiOrderServiceImpl implements ApiOrderService {
return null; return null;
} }
@Override
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void refund(String orderNo) {
HighOrder order = orderService.getOrderDetailByNo(orderNo);
if (order == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的的订单");
}
if (!order.getOrderStatus().equals(OrderStatusEnum.type2.getType())
&& !order.getOrderStatus().equals(OrderStatusEnum.type3.getType())
&& !order.getOrderStatus().equals(OrderStatusEnum.type7.getType())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "订单当前状态无法退款");
}
if (!order.getPayType().equals(OrderPayType.PAY_TYPE9.getNumber())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "支付方式错误");
}
ApiOrder apiOrder = findByOrderNo(null , orderNo);
ApiMerchants merchants = apiMerchantsService.findByMchId(apiOrder.getMchId());
if (apiOrder.getStatus() == 1 || apiOrder.getStatus() == 4 || apiOrder.getStatus() == 5) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "订单当前状态无法退款");
}
apiOrder.setStatus(4);
apiOrder.setUpdateTime(new Date());
apiOrderMapper.updateByPrimaryKey(apiOrder);
Map<String, Object> map = new HashMap<>();
map.put("sourceType", 100);
map.put("sourceContent", "退款金额:" + apiOrder.getCostPrice() + " 元");
apiMerchantsService.recharge(merchants.getId(), apiOrder.getCostPrice(), map);
}
} }

@ -277,7 +277,7 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
// 金币 1:100 // 金币 1:100
Integer goldNum = new BigDecimal(childOrder.getTotalPrice().toString()).multiply(new BigDecimal("100")).intValue(); Integer goldNum = new BigDecimal(childOrder.getTotalPrice().toString()).multiply(new BigDecimal("100")).intValue();
String remark = "订单" + order.getOrderNo() + "积分充值积分:" + goldNum; String remark = "订单" + order.getOrderNo() + "积分充值积分:" + goldNum;
userService.goldHandle(childOrder.getGoodsId(), goldNum, 1, 1, childOrder.getId() , remark); userService.goldHandle(childOrder.getGoodsId(), goldNum, 1, 1, childOrder.getId() , remark , order.getOrderNo());
} }
/** /**
@ -522,6 +522,7 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
goodsOrder.setStatus("1"); goodsOrder.setStatus("1");
goodsOrderExtService.updateGoodsOrder(goodsOrder); goodsOrderExtService.updateGoodsOrder(goodsOrder);
// 赠送卡券or优惠券
List<GoodsPresent> goodsPresents = goodsPresentService.getPresentList(highChildOrder.getGoodsId()); List<GoodsPresent> goodsPresents = goodsPresentService.getPresentList(highChildOrder.getGoodsId());
if (goodsPresents.size() > 0) { if (goodsPresents.size() > 0) {

@ -14,6 +14,7 @@ import com.hai.entity.HighOrder;
import com.hai.entity.HighOrderRefund; import com.hai.entity.HighOrderRefund;
import com.hai.entity.HighOrderRefundExample; import com.hai.entity.HighOrderRefundExample;
import com.hai.model.OrderRefundModel; import com.hai.model.OrderRefundModel;
import com.hai.openApi.service.ApiOrderService;
import com.hai.order.model.RefundPriceModel; import com.hai.order.model.RefundPriceModel;
import com.hai.order.service.OrderRefundService; import com.hai.order.service.OrderRefundService;
import com.hai.order.service.OrderService; import com.hai.order.service.OrderService;
@ -56,6 +57,9 @@ public class OrderRefundServiceImpl implements OrderRefundService {
@Resource @Resource
private HighFleetOilCardService fleetOilCardService; private HighFleetOilCardService fleetOilCardService;
@Resource
private ApiOrderService apiOrderService;
@Override @Override
public void update(HighOrderRefund orderRefund) { public void update(HighOrderRefund orderRefund) {
orderRefundMapper.updateByPrimaryKey(orderRefund); orderRefundMapper.updateByPrimaryKey(orderRefund);
@ -151,7 +155,7 @@ public class OrderRefundServiceImpl implements OrderRefundService {
if (refundIntegral != null && refundIntegral > 0) { if (refundIntegral != null && refundIntegral > 0) {
String remark = "订单" + order.getOrderNo() + "退款,退还积分:" + refundIntegral; String remark = "订单" + order.getOrderNo() + "退款,退还积分:" + refundIntegral;
// 积分退款 // 积分退款
highUserService.goldHandle(order.getMemId(), order.getPayGold(),1, 3, order.getId() , remark); highUserService.goldHandle(order.getMemId(), order.getPayGold(),1, 3, order.getId() , remark , order.getOrderNo());
} }
// 第三方退款 // 第三方退款
@ -220,6 +224,10 @@ public class OrderRefundServiceImpl implements OrderRefundService {
// 油卡退款 // 油卡退款
fleetOilCardService.refund(order.getOrderNo()); fleetOilCardService.refund(order.getOrderNo());
refundPriceModel.setRefundSuccess(true); refundPriceModel.setRefundSuccess(true);
} else if (orderPayType.getNumber().equals(OrderPayType.PAY_TYPE9.getNumber())) {
// 商户退款
apiOrderService.refund(order.getOrderNo());
refundPriceModel.setRefundSuccess(true);
} }
} catch (Exception e) { } catch (Exception e) {

@ -476,7 +476,7 @@ public class OrderServiceImpl implements OrderService {
} }
// 扣除用户积分 // 扣除用户积分
userService.goldHandle(order.getMemId(), createOrderModel.getPayGold(), 2, 2, order.getId(), userService.goldHandle(order.getMemId(), createOrderModel.getPayGold(), 2, 2, order.getId(),
"积分抵扣金额,交易订单:" + order.getOrderNo() + ",使用积分:" + order.getPayGold()); "积分抵扣金额,交易订单:" + order.getOrderNo() + ",使用积分:" + order.getPayGold() , order.getOrderNo());
order.setOrderStatus(OrderStatus.STATUS2.getNumber()); order.setOrderStatus(OrderStatus.STATUS2.getNumber());
order.setPayRealPrice(order.getPayPrice()); order.setPayRealPrice(order.getPayPrice());
@ -488,7 +488,7 @@ public class OrderServiceImpl implements OrderService {
} else { } else {
// 扣除用户积分 // 扣除用户积分
userService.goldHandle(order.getMemId(), createOrderModel.getPayGold(), 2, 2, order.getId(), userService.goldHandle(order.getMemId(), createOrderModel.getPayGold(), 2, 2, order.getId(),
"积分抵扣金额,交易订单:" + order.getOrderNo() + ",使用积分:" + order.getPayGold()); "积分抵扣金额,交易订单:" + order.getOrderNo() + ",使用积分:" + order.getPayGold() , order.getOrderNo());
} }
} }
@ -573,7 +573,7 @@ public class OrderServiceImpl implements OrderService {
if (order.getPayGold() != null && order.getPayGold() > 0) { if (order.getPayGold() != null && order.getPayGold() > 0) {
// 积分返回 // 积分返回
String remark = "订单" + order.getOrderNo() + "取消,退还积分:" + order.getPayGold(); String remark = "订单" + order.getOrderNo() + "取消,退还积分:" + order.getPayGold();
userService.goldHandle(order.getMemId(), order.getPayGold(), 1, 3, order.getId() , remark); userService.goldHandle(order.getMemId(), order.getPayGold(), 1, 3, order.getId() , remark , order.getOrderNo());
} }
for (HighChildOrder childOrder : order.getHighChildOrderList()) { for (HighChildOrder childOrder : order.getHighChildOrderList()) {

@ -336,5 +336,5 @@ public interface CommonService {
*/ */
JSONObject getIndustry(); JSONObject getIndustry();
List<MapStoreModel> getMapStore(String name , Long childId , String latitude , String longitude , Double distance); List<MapStoreModel> getMapStore(String name , Long childId , String latitude , String longitude , Double distance , Integer type);
} }

@ -41,7 +41,7 @@ public interface HighActivityUserLotteryNumService {
/** /**
* *
* 获取抽奖次数 * 免费获取抽奖次数
* @param activityId 活动id * @param activityId 活动id
* @param userId 用户id * @param userId 用户id
* @return * @return

@ -37,6 +37,16 @@ public interface HighGoldRecService {
**/ **/
List<HighGoldRec> getGoldRec(Map<String, Object> map); List<HighGoldRec> getGoldRec(Map<String, Object> map);
/**
* @Author Sum1Dream
* @Name findGoldRec
* @Description // 查询订单数据
* @Date 11:22 2023/5/5
* @Param [map]
* @Return com.hai.entity.HighGoldRec
*/
HighGoldRec findGoldRec(Map<String, Object> map);
/** /**
* @Author Sum1Dream * @Author Sum1Dream
* @name queryGold.java * @name queryGold.java

@ -136,7 +136,7 @@ public interface HighUserService {
* @Description 用户金币充值消费 * @Description 用户金币充值消费
* @Date 2021/3/27 9:51 * @Date 2021/3/27 9:51
**/ **/
void goldHandle(Long userId, Integer goldNum, Integer goldType, Integer resType, Long resId , String remark); void goldHandle(Long userId, Integer goldNum, Integer goldType, Integer resType, Long resId , String remark , String orderNo);
/** /**
* @Author Sum1Dream * @Author Sum1Dream

@ -126,9 +126,15 @@ public class ApiMerchantsServiceImpl implements ApiMerchantsService {
// 查询商户 // 查询商户
ApiMerchants apiMerchants = apiMerchantsMapper.selectByPrimaryKey(merchantId); ApiMerchants apiMerchants = apiMerchantsMapper.selectByPrimaryKey(merchantId);
Long opId = null;
String opName = null;
if (apiMerchants == null) { if (apiMerchants == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户");
} }
if (MapUtils.getInteger(otherParam, "sourceType") == 99) {
// 操作人 // 操作人
UserInfoModel sessionModel = userCenter.getSessionModel(UserInfoModel.class); UserInfoModel sessionModel = userCenter.getSessionModel(UserInfoModel.class);
if (sessionModel == null) { if (sessionModel == null) {
@ -137,6 +143,10 @@ public class ApiMerchantsServiceImpl implements ApiMerchantsService {
if ( sessionModel.getSecRole().getRoleType() != 1) { if ( sessionModel.getSecRole().getRoleType() != 1) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "权限不足"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "权限不足");
} }
opId = sessionModel.getSecUser().getId();
opName = sessionModel.getSecUser().getUserName();
}
if (apiMerchants.getStatus() != 100) { if (apiMerchants.getStatus() != 100) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "商户被禁用"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "商户被禁用");
} }
@ -155,8 +165,8 @@ public class ApiMerchantsServiceImpl implements ApiMerchantsService {
apiAmountRecord.setCreateTime(new Date()); apiAmountRecord.setCreateTime(new Date());
apiAmountRecord.setUpdateTime(new Date()); apiAmountRecord.setUpdateTime(new Date());
apiAmountRecord.setMchId(apiMerchants.getMchId()); apiAmountRecord.setMchId(apiMerchants.getMchId());
apiAmountRecord.setOperatorId(sessionModel.getSecUser().getId()); apiAmountRecord.setOperatorId(opId);
apiAmountRecord.setOperatorName(sessionModel.getSecUser().getUserName()); apiAmountRecord.setOperatorName(opName);
apiAmountRecord.setStatus(100); apiAmountRecord.setStatus(100);
apiAmountRecord.setAmount(amount); apiAmountRecord.setAmount(amount);
apiAmountRecord.setAfterAmount(afterAmount); apiAmountRecord.setAfterAmount(afterAmount);

@ -188,7 +188,9 @@ public class BsDistributionUserRelServiceImpl implements BsDistributionUserRelSe
if (distributionUserRel.getPopularizeUserId() != null) { if (distributionUserRel.getPopularizeUserId() != null) {
bsDistributionRebateMapper.insert(distributionRebate); bsDistributionRebateMapper.insert(distributionRebate);
// 上级返利 // 上级返利
highUserService.goldHandle(distributionUserRel.getPopularizeUserId(), object.getInteger("integralNumFirst"), 1, 4, object.getLong("userId") , user.getName() + "下单:获得返利" + object.getInteger("integralNumFirst")); highUserService.goldHandle(distributionUserRel.getPopularizeUserId(), object.getInteger("integralNumFirst"),
1, 4, object.getLong("userId") ,
user.getName() + "下单:获得返利" + object.getInteger("integralNumFirst") , "");
// 查询下单用户顶级推广员 // 查询下单用户顶级推广员
Map<String , Object> mapTop = new HashMap<>(); Map<String , Object> mapTop = new HashMap<>();
@ -202,7 +204,7 @@ public class BsDistributionUserRelServiceImpl implements BsDistributionUserRelSe
distributionRebate.setType(2); distributionRebate.setType(2);
bsDistributionRebateMapper.insert(distributionRebate); bsDistributionRebateMapper.insert(distributionRebate);
// 顶级返利 // 顶级返利
highUserService.goldHandle(distributionUserRelTop.getPopularizeUserId(), object.getInteger("integralNumSecond"), 1, 4, object.getLong("userId") , user.getName() + "下单:获得返利" + object.getInteger("integralNumSecond")); highUserService.goldHandle(distributionUserRelTop.getPopularizeUserId(), object.getInteger("integralNumSecond"), 1, 4, object.getLong("userId") , user.getName() + "下单:获得返利" + object.getInteger("integralNumSecond") , "");
} }

@ -99,7 +99,7 @@ public class BsOrderRebateServiceImpl implements BsOrderRebateService {
object.put("logoImg" , OrderProductType.getDataByType(highOrder.getProductType()).getImgUrl()); object.put("logoImg" , OrderProductType.getDataByType(highOrder.getProductType()).getImgUrl());
bsDistributionUserRelService.distributionRebate(object); bsDistributionUserRelService.distributionRebate(object);
highUserService.goldHandle(highOrder.getMemId(), integralNum.intValue(), 1, 4, highOrder.getId(), object.getString("remark") + integralNum); highUserService.goldHandle(highOrder.getMemId(), integralNum.intValue(), 1, 4, highOrder.getId(), object.getString("remark") + integralNum , highOrder.getOrderNo());
// 查询积分返利记录 // 查询积分返利记录
BsOrderRebate orderRebate = new BsOrderRebate(); BsOrderRebate orderRebate = new BsOrderRebate();
@ -167,6 +167,11 @@ public class BsOrderRebateServiceImpl implements BsOrderRebateService {
// 积分返利积分 // 积分返利积分
BigDecimal integralNum = jsonObject.getBigDecimal("price").multiply(bsIntegralRebate.getPercentage()).setScale( 0, BigDecimal.ROUND_HALF_UP ); BigDecimal integralNum = jsonObject.getBigDecimal("price").multiply(bsIntegralRebate.getPercentage()).setScale( 0, BigDecimal.ROUND_HALF_UP );
if (integralNum.compareTo(new BigDecimal(0)) < 1) {
integralNum = new BigDecimal(1);
}
if (bsIntegralRebate.getSecondDistribution() !=null || bsIntegralRebate.getFirstDistribution() != null) { if (bsIntegralRebate.getSecondDistribution() !=null || bsIntegralRebate.getFirstDistribution() != null) {
// 1级分销 // 1级分销
BigDecimal integralNumFirst = jsonObject.getBigDecimal("price").multiply(bsIntegralRebate.getFirstDistribution()).setScale( 0, BigDecimal.ROUND_HALF_UP ); BigDecimal integralNumFirst = jsonObject.getBigDecimal("price").multiply(bsIntegralRebate.getFirstDistribution()).setScale( 0, BigDecimal.ROUND_HALF_UP );
@ -187,7 +192,7 @@ public class BsOrderRebateServiceImpl implements BsOrderRebateService {
object.put("logoImg" , OrderProductType.getDataByType(jsonObject.getInteger("productType")).getImgUrl()); object.put("logoImg" , OrderProductType.getDataByType(jsonObject.getInteger("productType")).getImgUrl());
bsDistributionUserRelService.distributionRebate(object); bsDistributionUserRelService.distributionRebate(object);
highUserService.goldHandle(highUser.getId(), integralNum.intValue(), 1, jsonObject.getInteger("productType"), jsonObject.getLong("orderId"), object.getString("remark") + integralNum); highUserService.goldHandle(highUser.getId(), integralNum.intValue(), 1, jsonObject.getInteger("productType"), jsonObject.getLong("orderId"), object.getString("remark") + integralNum , jsonObject.getString("orderNo"));
// 查询积分返利记录 // 查询积分返利记录
BsOrderRebate orderRebate = new BsOrderRebate(); BsOrderRebate orderRebate = new BsOrderRebate();

@ -807,7 +807,7 @@ public class CommonServiceImpl implements CommonService {
} }
@Override @Override
public List<MapStoreModel> getMapStore(String name, Long childId , String latitude , String longitude , Double distance) { public List<MapStoreModel> getMapStore(String name, Long childId , String latitude , String longitude , Double distance , Integer type) {
// 获取支付门店 // 获取支付门店
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
@ -817,6 +817,20 @@ public class CommonServiceImpl implements CommonService {
if (childId != null) { if (childId != null) {
params.put("childId", childId); params.put("childId", childId);
} }
String borderWidth;
String padding;
Double alpha;
// 1:ios 2:安卓
if (type == 2) {
borderWidth = "12";
padding = "14";
alpha = 1.0;
} else {
borderWidth = "10";
padding = null;
alpha = 0.5;
}
List<MapStoreModel> list = new ArrayList<>(); List<MapStoreModel> list = new ArrayList<>();
@ -843,7 +857,7 @@ public class CommonServiceImpl implements CommonService {
storeModel.setRotate(1); storeModel.setRotate(1);
storeModel.setWidth(20); storeModel.setWidth(20);
storeModel.setHeight(20); storeModel.setHeight(20);
storeModel.setAlpha(0.5); storeModel.setAlpha(alpha);
JSONObject callout = new JSONObject(); JSONObject callout = new JSONObject();
@ -852,8 +866,9 @@ public class CommonServiceImpl implements CommonService {
callout.put("color" , "#ffffff"); callout.put("color" , "#ffffff");
callout.put("fontSize" , 14); callout.put("fontSize" , 14);
callout.put("borderRadius" , 15); callout.put("borderRadius" , 15);
callout.put("borderWidth" , "10"); callout.put("borderWidth" , borderWidth);
callout.put("bgColor" , "#e51860"); callout.put("bgColor" , "#e51860");
callout.put("padding" , padding);
callout.put("display" , "ALWAYS"); callout.put("display" , "ALWAYS");
storeModel.setCallout(callout); storeModel.setCallout(callout);
@ -898,7 +913,7 @@ public class CommonServiceImpl implements CommonService {
storeModel.setRotate(1); storeModel.setRotate(1);
storeModel.setWidth(20); storeModel.setWidth(20);
storeModel.setHeight(20); storeModel.setHeight(20);
storeModel.setAlpha(0.5); storeModel.setAlpha(alpha);
JSONObject callout = new JSONObject(); JSONObject callout = new JSONObject();
callout.put("content" , store.getStoreName()); callout.put("content" , store.getStoreName());
@ -906,7 +921,8 @@ public class CommonServiceImpl implements CommonService {
callout.put("color" , "#ffffff"); callout.put("color" , "#ffffff");
callout.put("fontSize" , 14); callout.put("fontSize" , 14);
callout.put("borderRadius" , 15); callout.put("borderRadius" , 15);
callout.put("borderWidth" , "10"); callout.put("borderWidth" , borderWidth);
callout.put("padding" , padding);
callout.put("bgColor" , "#e51860"); callout.put("bgColor" , "#e51860");
callout.put("display" , "ALWAYS"); callout.put("display" , "ALWAYS");

@ -146,11 +146,11 @@ public class HighActivityUserLotteryNumServiceImpl implements HighActivityUserLo
if (secConfig != null) { if (secConfig != null) {
// 判断是否活动为空 // 判断是否活动为空
if (detail == null) { if (detail == null) {
addLotteryNum(activityId , userId , 3); addLotteryNum(activityId , userId , Integer.valueOf(secConfig.getCodeValue()));
return 3; return 1;
} else { } else {
if (!DateUtil.isNow(detail.getUpdateTime())) { if (!DateUtil.isNow(detail.getUpdateTime())) {
detail.setLotteryNum(3); detail.setLotteryNum(Integer.valueOf(secConfig.getCodeValue()));
detail.setUpdateTime(new Date()); detail.setUpdateTime(new Date());
highActivityUserLotteryNumMapper.updateByPrimaryKey(detail); highActivityUserLotteryNumMapper.updateByPrimaryKey(detail);
} }

@ -77,6 +77,42 @@ public class HighGoldRecServiceImpl implements HighGoldRecService {
return list; return list;
} }
@Override
public HighGoldRec findGoldRec(Map<String, Object> map) {
HighGoldRecExample example = new HighGoldRecExample();
HighGoldRecExample.Criteria criteria = example.createCriteria();
if (MapUtils.getLong(map, "userId") != null) {
criteria.andUserIdEqualTo(MapUtils.getLong(map, "userId"));
}
if (MapUtils.getLong(map, "goldType") != null) {
criteria.andGoldTypeEqualTo(MapUtils.getLong(map, "goldType"));
}
if (MapUtils.getLong(map, "resType") != null) {
criteria.andResTypeEqualTo(MapUtils.getInteger(map, "resType"));
}
if (MapUtils.getLong(map, "resId") != null) {
criteria.andResIdEqualTo(MapUtils.getLong(map, "resId"));
}
if (MapUtils.getInteger(map, "status") != null) {
criteria.andStatusEqualTo(MapUtils.getInteger(map, "status"));
} {
criteria.andStatusEqualTo(1);
}
example.setOrderByClause("create_time desc");
List<HighGoldRec> list = highGoldRecMapper.selectByExample(example);
if (list.size() > 0) {
return list.get(0);
}
return null;
}
@Override @Override
public List<Map<Long, Long>> queryGold(Map<String, Object> map) { public List<Map<Long, Long>> queryGold(Map<String, Object> map) {

@ -45,6 +45,9 @@ public class HighGoodsTypeServiceImpl implements HighGoodsTypeService {
}else { }else {
criteria.andParentIdIsNull(); criteria.andParentIdIsNull();
} }
if (MapUtils.getLong(map, "companyId") != null) {
criteria.andCompanyIdEqualTo(MapUtils.getLong(map, "companyId"));
}
criteria.andStatusEqualTo(1); criteria.andStatusEqualTo(1);

@ -325,7 +325,7 @@ public class HighOrderServiceImpl implements HighOrderService {
// 扣除用户积分 // 扣除用户积分
highUserService.goldHandle(highOrder.getMemId(), highOrder.getPayGold(), 2, 2, highOrder.getId(), highUserService.goldHandle(highOrder.getMemId(), highOrder.getPayGold(), 2, 2, highOrder.getId(),
"抵扣积分订单:" + highOrder.getOrderNo() + ",使用积分:" + highOrder.getPayGold()); "抵扣积分订单:" + highOrder.getOrderNo() + ",使用积分:" + highOrder.getPayGold() , highOrder.getOrderNo());
} }
// 积分金额等于应付金额 // 积分金额等于应付金额
@ -562,7 +562,7 @@ public class HighOrderServiceImpl implements HighOrderService {
// 金币 1:100 // 金币 1:100
Integer goldNum = new BigDecimal(highChildOrder.getTotalPrice().toString()).multiply(new BigDecimal("100")).intValue(); Integer goldNum = new BigDecimal(highChildOrder.getTotalPrice().toString()).multiply(new BigDecimal("100")).intValue();
String remark = "订单" + order.getOrderNo() + "积分充值积分:" + goldNum; String remark = "订单" + order.getOrderNo() + "积分充值积分:" + goldNum;
highUserService.goldHandle(highChildOrder.getGoodsId(), goldNum, 1, 1, highChildOrder.getId(), remark); highUserService.goldHandle(highChildOrder.getGoodsId(), goldNum, 1, 1, highChildOrder.getId(), remark , highChildOrder.getChildOrderNo());
} }
/* if (highChildOrder.getGoodsType() == 3) { /* if (highChildOrder.getGoodsType() == 3) {
@ -1103,7 +1103,7 @@ public class HighOrderServiceImpl implements HighOrderService {
if (order.getPayGold() != null) { if (order.getPayGold() != null) {
// 积分返回 // 积分返回
String remark = "订单" + order.getOrderNo() + "取消,退还积分:" + order.getPayGold(); String remark = "订单" + order.getOrderNo() + "取消,退还积分:" + order.getPayGold();
highUserService.goldHandle(order.getMemId(), order.getPayGold(), 1, 3, order.getId() , remark); highUserService.goldHandle(order.getMemId(), order.getPayGold(), 1, 3, order.getId() , remark , order.getOrderNo());
} }
updateOrder(order); updateOrder(order);
@ -1810,7 +1810,7 @@ public class HighOrderServiceImpl implements HighOrderService {
highOrder.setPayPrice(highOrder.getPayPrice().subtract(integralPrice)); highOrder.setPayPrice(highOrder.getPayPrice().subtract(integralPrice));
String remark = "订单" + highOrder.getOrderNo() + "下单,使用积分:" + object.getInteger("integralNum"); String remark = "订单" + highOrder.getOrderNo() + "下单,使用积分:" + object.getInteger("integralNum");
highUserService.goldHandle(highOrder.getMemId(), object.getInteger("integralNum"), 2, 2, highOrder.getId() , remark); highUserService.goldHandle(highOrder.getMemId(), object.getInteger("integralNum"), 2, 2, highOrder.getId() , remark , highOrder.getOrderNo());
} }
// 判断积分支付是否扣完金额 // 判断积分支付是否扣完金额
@ -2104,7 +2104,7 @@ public class HighOrderServiceImpl implements HighOrderService {
// 退还积分 // 退还积分
if (order.getPayGold() != null) { if (order.getPayGold() != null) {
String remark = "订单" + order.getOrderNo() + "退款,退还积分:" + order.getPayGold(); String remark = "订单" + order.getOrderNo() + "退款,退还积分:" + order.getPayGold();
highUserService.goldHandle(order.getMemId(), order.getPayGold(), 1, 3, order.getId() , remark); highUserService.goldHandle(order.getMemId(), order.getPayGold(), 1, 3, order.getId() , remark , order.getOrderNo());
if (order.getPayRealPrice().compareTo(new BigDecimal(0)) == 0) { if (order.getPayRealPrice().compareTo(new BigDecimal(0)) == 0) {
order.setOrderStatus(4); order.setOrderStatus(4);
//order.setRefundTime(new Date()); //order.setRefundTime(new Date());
@ -2188,7 +2188,7 @@ public class HighOrderServiceImpl implements HighOrderService {
if (order.getPayGold() != null) { if (order.getPayGold() != null) {
// 积分返回 // 积分返回
String remark = "订单" + order.getOrderNo() + "取消,退还积分:" + order.getPayGold(); String remark = "订单" + order.getOrderNo() + "取消,退还积分:" + order.getPayGold();
highUserService.goldHandle(order.getMemId(), order.getPayGold(), 1, 3, order.getId() , remark); highUserService.goldHandle(order.getMemId(), order.getPayGold(), 1, 3, order.getId() , remark , order.getOrderNo());
} }
updateOrder(order); updateOrder(order);

@ -334,7 +334,7 @@ public class HighUserServiceImpl implements HighUserService {
@Override @Override
@Transactional(propagation= Propagation.REQUIRED) @Transactional(propagation= Propagation.REQUIRED)
public void goldHandle(Long userId, Integer goldNum, Integer goldType, Integer resType, Long resId , String remark) { public void goldHandle(Long userId, Integer goldNum, Integer goldType, Integer resType, Long resId , String remark , String orderNo) {
// 查询用户信息 // 查询用户信息
HighUser user = highUserMapper.selectByPrimaryKey(userId); HighUser user = highUserMapper.selectByPrimaryKey(userId);
if (user == null) { if (user == null) {
@ -364,6 +364,7 @@ public class HighUserServiceImpl implements HighUserService {
highGoldRec.setResType(resType); highGoldRec.setResType(resType);
highGoldRec.setResId(resId); highGoldRec.setResId(resId);
highGoldRec.setStatus(1); highGoldRec.setStatus(1);
highGoldRec.setResOrderNo(orderNo);
highGoldRec.setRemark(remark); highGoldRec.setRemark(remark);
if (goldNum > 0) { if (goldNum > 0) {
highGoldRecService.insertGoldRec(highGoldRec); highGoldRecService.insertGoldRec(highGoldRec);

@ -227,7 +227,7 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
if (order.getIntegralNum() != null) { if (order.getIntegralNum() != null) {
// 积分返回 // 积分返回
String remark = "话费订单" + order.getOrderNo() + "取消,退还积分:" + order.getIntegralNum().intValue(); String remark = "话费订单" + order.getOrderNo() + "取消,退还积分:" + order.getIntegralNum().intValue();
highUserService.goldHandle(order.getUserId(), order.getIntegralNum().intValue(), 1, 3, order.getId() , remark); highUserService.goldHandle(order.getUserId(), order.getIntegralNum().intValue(), 1, 3, order.getId() , remark , order.getOrderNo());
} }
updateOrder(order); updateOrder(order);

@ -338,7 +338,7 @@ public class GoodsOrderServiceImpl implements PayService {
// 金币 1:100 // 金币 1:100
Integer goldNum = new BigDecimal(highChildOrder.getTotalPrice().toString()).multiply(new BigDecimal("100")).intValue(); Integer goldNum = new BigDecimal(highChildOrder.getTotalPrice().toString()).multiply(new BigDecimal("100")).intValue();
String remark = "订单" + order.getOrderNo() + "积分充值积分:" + goldNum; String remark = "订单" + order.getOrderNo() + "积分充值积分:" + goldNum;
highUserService.goldHandle(highChildOrder.getGoodsId(), goldNum, 1, 1, highChildOrder.getId() , remark); highUserService.goldHandle(highChildOrder.getGoodsId(), goldNum, 1, 1, highChildOrder.getId() , remark , highChildOrder.getChildOrderNo());
} }
/* if (highChildOrder.getGoodsType() == 3) { /* if (highChildOrder.getGoodsType() == 3) {

@ -112,3 +112,7 @@ wxAppSecret=d8d6dcaef77d3b659258a01b5ddba5df
wxH5AppId=wxa075e8509802f826 wxH5AppId=wxa075e8509802f826
wxH5AppSecret=0e606fc1378d35e359fcf3f15570b2c5 wxH5AppSecret=0e606fc1378d35e359fcf3f15570b2c5
#PAY
payPostUrl=https://pay.dctpay.com/crest/
filesystem=https://hsg.dctpay.com/filesystem/

@ -118,3 +118,7 @@ wxAppSecret=d8d6dcaef77d3b659258a01b5ddba5df
wxH5AppId=wxa075e8509802f826 wxH5AppId=wxa075e8509802f826
wxH5AppSecret=0e606fc1378d35e359fcf3f15570b2c5 wxH5AppSecret=0e606fc1378d35e359fcf3f15570b2c5
#PAY
payPostUrl=https://pay.dctpay.com/crest/
filesystem=https://hsg.dctpay.com/filesystem/

@ -147,11 +147,125 @@ public class WxMsgController {
else if ("event".equals(msgType)) { else if ("event".equals(msgType)) {
// 用户关注公众号 // 用户关注公众号
if ("subscribe".equals(event)) { if ("subscribe".equals(event)) {
content = if (eventKey != null && eventKey.length() != 0) {
"您好,感谢关注嗨森逛商城!\n\n" + JSONObject object = weChatQrcodeUtils.paramPars(eventKey);
linkContent + // type = 1 推广扫码
"服务热线:400-023-6806" if (Objects.equals(object.getString("qrscene_type"), WxQrCodeTypeEnum.type1.getType()) || Objects.equals(object.getString("type"), WxQrCodeTypeEnum.type1.getType())) {
; linkContent ="<a data-miniprogram-appid='wx8d49e2f83025229d' data-miniprogram-path='/pages/tabBar/user/user' href='https://mp.weixin.qq.com/s/qKUny68yCU4_6jBdNb1OVg'>扫码领取</a>\n\n";
// todo 推广扫码
}
// type = 2 在线加油门店扫码
if (Objects.equals(object.getString("qrscene_type"), WxQrCodeTypeEnum.type2.getType()) || Objects.equals(object.getString("type"), WxQrCodeTypeEnum.type2.getType())){
// 商户门店
HighMerchantStoreModel store = merchantStoreService.getMerchantStoreByKey(object.getString("code"));
linkContent =
"<a href='"+CommonSysConst.getSysConfig().getHsgDomainName()+"/hsgH5?accountId=000000&gasKey="
+ object.getString("code") + "&staffCode='>欢迎来到" + store.getStoreName()+"</a>"
+ "[哇][哇][哇]\n\n<a href='"
+ CommonSysConst.getSysConfig().getHsgDomainName()
+ "/hsgH5?accountId=000000&gasKey="
+ object.getString("code")
+ "&staffCode='>点击这里一键加油</a>\n\n";
}
// 3:查看视频教程
if (Objects.equals(object.getString("qrscene_type"), WxQrCodeTypeEnum.type3.getType()) || Objects.equals(object.getString("type"), WxQrCodeTypeEnum.type3.getType())){
// 重庆
if ( Objects.equals(object.getString("code"), "1")) {
linkContent =
"加油优惠选我们,你的出行不再忧愁\uD83D\uDC97\n\n"
+ "<a href='https://mp.weixin.qq.com/s/Il-r_ZfTZOQDyQWgfnck1A'>查看中石油操作流程</a>\n\n"
+ "走得更远,看得更美的风景,加油添生活![太阳]\n\n"
+ "好车要好油,优惠更加牛![發]\n\n";
}
// 贵州
if (Objects.equals(object.getString("code"), "2")) {
linkContent =
"加满好油,一路畅游!✨✨\n\n"
+ "<a href='https://mp.weixin.qq.com/s/4kj9XV-K_s88uji3ZrXqgg'>查看中石化操作流程</a>\n\n"
+ "用心为您着想,诚意为您服务。\uD83C\uDF39\n\n"
+ "油客来自五湖四海,在这里祝您一路顺风。\n\n";
}
}
// 4:支付码牌扫码
if (Objects.equals(object.getString("qrscene_type"), WxQrCodeTypeEnum.type4.getType()) || Objects.equals(object.getString("type"), WxQrCodeTypeEnum.type4.getType())){
// 支付码码牌上的二维码
if (Objects.equals(object.getString("codeType"), "PAYMENT_CODE")) {
linkContent =
"点击领取优惠券,享受更多优惠[礼物]\n\n"
+ "<a href='" +
CommonSysConst.getSysConfig().getHsgDomainName() + "/hsgH5?accountId=0000014&key=&code="
+ object.getString("code")
+ "'>立即领取优惠券</a>\n\n";
}
// 支付成功生成的二维码
if (Objects.equals(object.getString("codeType"), "PAYMENT_SUCCESS")) {
linkContent =
"支付分享,享受更高优惠[礼物]\n\n"
+ "<a href='"
+ CommonSysConst.getSysConfig().getHsgDomainName() + "/hsgH5?accountId=0000012&key=&code="
+ object.getString("code")
+ "'>分享好友</a>\n\n";
}
// 扫码分享二维码进入
if (Objects.equals(object.getString("codeType"), "SHARE")) {
linkContent =
"支付分享,享受更高优惠[礼物]\n\n"
+ "<a href='"
+ CommonSysConst.getSysConfig().getHsgDomainName() + "/hsgH5?accountId=0000013&key=&code="
+ object.getString("code")
+ "'>分享好友</a>\n\n";
}
}
// 5:扫码贵州中石化优惠券二维码
if (Objects.equals(object.getString("qrscene_type"), WxQrCodeTypeEnum.type5.getType()) || Objects.equals(object.getString("type"), WxQrCodeTypeEnum.type5.getType())){
mapQrCode.put("type", object.getString("encryptType"));
// 二维码参数
mapQrCode.put("id", object.getString("code"));
// 商户门店
linkContent =
"山高水远,相伴致远[爱心][爱心]\n\n"
+ "<a href='"
+ CommonSysConst.getSysConfig().getHsgDomainName()
+ "/hsgH5?accountId=0000011&key=&code="
+ Base64Util.encode(AESEncodeUtil.aesEncrypt(JSON.toJSONString(mapQrCode)))
+ "'>领取中石化加油券</a>\n\n"
+ "您追求实惠的折扣,我们追求高超的品质\uD83D\uDD16\n\n"
+ "迎南来北往宾朋尊驾,[福]\n\n"
+ "送平安顺遂诚意祝福![福]\n\n";
}
// 6:扫码重庆中石油优惠券二维码
if (Objects.equals(object.getString("qrscene_type"), WxQrCodeTypeEnum.type6.getType()) || Objects.equals(object.getString("type"), WxQrCodeTypeEnum.type6.getType())){
mapQrCode.put("type", object.getString("encryptType"));
// 二维码参数
mapQrCode.put("id", object.getString("code"));
log.info("map参数:" + mapQrCode);
// 商户门店
linkContent =
"加好油,添好运,我们更适意[礼物]\n\n"
+ "<a href='"
+ CommonSysConst.getSysConfig().getHsgDomainName()
+ "/hsgH5?accountId=0000011&key=&code="
+ Base64Util.encode(AESEncodeUtil.aesEncrypt(JSON.toJSONString(mapQrCode)))
+ "'>领取中石油加油券</a>\n\n"
+ "致力于质量与福利,赢得客户心。\n\n"
+ "一路精彩,“油”我相伴!\uD83C\uDF1F\n\n";
}
}
else {
linkContent = "<a href='" + CommonSysConst.getSysConfig().getHsgDomainName() + "/hsgH5'>点击查看更多优惠</a>\n\n";
}
content = linkContent + "服务热线:400-023-6806";
// content =
// "您好,感谢关注嗨森逛商城!\n\n" +
// linkContent +
// "服务热线:400-023-6806"
// ;
} }
// 用户扫码进入公众号 // 用户扫码进入公众号
@ -204,8 +318,7 @@ public class WxMsgController {
linkContent = linkContent =
"点击领取优惠券,享受更多优惠[礼物]\n\n" "点击领取优惠券,享受更多优惠[礼物]\n\n"
+ "<a href='" + + "<a href='" +
"https://hsgcs.dctpay.com" + CommonSysConst.getSysConfig().getHsgDomainName() + "/hsgH5?accountId=0000014&key=&code="
CommonSysConst.getSysConfig().getHsgDomainName()
+ object.getString("code") + object.getString("code")
+ "'>立即领取优惠券</a>\n\n"; + "'>立即领取优惠券</a>\n\n";
@ -217,8 +330,7 @@ public class WxMsgController {
linkContent = linkContent =
"支付分享,享受更高优惠[礼物]\n\n" "支付分享,享受更高优惠[礼物]\n\n"
+ "<a href='" + "<a href='"
+ "https://hsgcs.dctpay.com" + CommonSysConst.getSysConfig().getHsgDomainName() + "/hsgH5?accountId=0000012&key=&code="
+ CommonSysConst.getSysConfig().getHsgDomainName()
+ object.getString("code") + object.getString("code")
+ "'>分享好友</a>\n\n"; + "'>分享好友</a>\n\n";
} }
@ -227,8 +339,7 @@ public class WxMsgController {
linkContent = linkContent =
"支付分享,享受更高优惠[礼物]\n\n" "支付分享,享受更高优惠[礼物]\n\n"
+ "<a href='" + "<a href='"
+ "https://hsgcs.dctpay.com" + CommonSysConst.getSysConfig().getHsgDomainName() + "/hsgH5?accountId=0000013&key=&code="
+ CommonSysConst.getSysConfig().getHsgDomainName()
+ object.getString("code") + object.getString("code")
+ "'>分享好友</a>\n\n"; + "'>分享好友</a>\n\n";
} }

@ -60,7 +60,7 @@ public class ApiMerchantsController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!"); throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!");
} }
if (StringUtils.isBlank(object.getString("apiKey")) || if (
StringUtils.isBlank(object.getString("merchId")) || StringUtils.isBlank(object.getString("merchId")) ||
StringUtils.isBlank(object.getString("timetable")) || StringUtils.isBlank(object.getString("timetable")) ||
StringUtils.isBlank(object.getString("sign")) StringUtils.isBlank(object.getString("sign"))
@ -77,7 +77,7 @@ public class ApiMerchantsController {
} }
Map<String , Object> map = new HashMap<>(); Map<String , Object> map = new HashMap<>();
map.put("apiKey" , object.getString("apiKey")); map.put("apiKey" , apiMerchants.getApiKey());
map.put("timetable" , object.getString("timetable")); map.put("timetable" , object.getString("timetable"));
map.put("merchId" , object.getString("merchId")); map.put("merchId" , object.getString("merchId"));
@ -114,7 +114,7 @@ public class ApiMerchantsController {
ip = request.getHeader("x-forwarded-for"); ip = request.getHeader("x-forwarded-for");
} }
if (StringUtils.isBlank(object.getString("apiKey")) || if (
StringUtils.isBlank(object.getString("merchId")) || StringUtils.isBlank(object.getString("merchId")) ||
StringUtils.isBlank(object.getString("sign")) StringUtils.isBlank(object.getString("sign"))
) { ) {
@ -137,7 +137,7 @@ public class ApiMerchantsController {
Map<String , Object> map = new HashMap<>(); Map<String , Object> map = new HashMap<>();
map.put("apiKey" , object.getString("apiKey")); map.put("apiKey" , apiMerchants.getApiKey());
map.put("merchId" , object.getString("merchId")); map.put("merchId" , object.getString("merchId"));
if (!secConfigService.isSignVerify(map , object.getString("sign"))) { if (!secConfigService.isSignVerify(map , object.getString("sign"))) {

@ -69,7 +69,7 @@ public class GzSinopecController {
} }
if (StringUtils.isBlank(object.getString("apiKey")) || if (
StringUtils.isBlank(object.getString("timetable")) || StringUtils.isBlank(object.getString("timetable")) ||
StringUtils.isBlank(object.getString("merchId")) || StringUtils.isBlank(object.getString("merchId")) ||
StringUtils.isBlank(object.getString("sign")) StringUtils.isBlank(object.getString("sign"))
@ -78,9 +78,16 @@ public class GzSinopecController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR);
} }
ApiMerchants apiMerchants = apiMerchantsService.findByMchId(object.getString("merchId"));
if (apiMerchants == null) {
log.error("getRechargeProduct error!", "帐户错误!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_NOT_EXIST);
}
Map<String , Object> map = new HashMap<>(); Map<String , Object> map = new HashMap<>();
map.put("timetable" , object.getString("timetable")); map.put("timetable" , object.getString("timetable"));
map.put("apiKey" , object.getString("apiKey")); map.put("apiKey" , apiMerchants.getApiKey());
map.put("merchId" , object.getString("merchId")); map.put("merchId" , object.getString("merchId"));
if (!secConfigService.isSignVerify(map , object.getString("sign"))) { if (!secConfigService.isSignVerify(map , object.getString("sign"))) {
@ -88,12 +95,7 @@ public class GzSinopecController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY); throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY);
} }
ApiMerchants apiMerchants = apiMerchantsService.findByMchId(object.getString("merchId"));
if (apiMerchants == null) {
log.error("getRechargeProduct error!", "错误商户,请联系管理人员!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_NOT_EXIST);
}
if (!secConfigService.isConfig(OrderProductType.PRODUCT_TYPE11.getApiCode(), object.getString("merchId"))) { if (!secConfigService.isConfig(OrderProductType.PRODUCT_TYPE11.getApiCode(), object.getString("merchId"))) {
log.error("getAllCities error!", "当前帐户无权限查询!"); log.error("getAllCities error!", "当前帐户无权限查询!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.MERCHANT_NOT_AUTHORIZED, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.MERCHANT_NOT_AUTHORIZED, "");
@ -140,7 +142,7 @@ public class GzSinopecController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "非法ip地址,请联系管理人员!"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "非法ip地址,请联系管理人员!");
} }
if (StringUtils.isBlank(object.getString("apiKey")) || if (
StringUtils.isBlank(object.getString("orderNo")) || StringUtils.isBlank(object.getString("orderNo")) ||
StringUtils.isBlank(object.getString("count")) || StringUtils.isBlank(object.getString("count")) ||
StringUtils.isBlank(object.getString("couTypeCode")) || StringUtils.isBlank(object.getString("couTypeCode")) ||
@ -153,9 +155,16 @@ public class GzSinopecController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR);
} }
ApiMerchants apiMerchants = apiMerchantsService.findByMchId(object.getString("merchId"));
if (apiMerchants == null) {
log.error("getRechargeProduct error!", "错误商户,请联系管理人员!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_NOT_EXIST);
}
Map<String , Object> map = new HashMap<>(); Map<String , Object> map = new HashMap<>();
map.put("timetable" , object.getString("timetable")); map.put("timetable" , object.getString("timetable"));
map.put("apiKey" , object.getString("apiKey")); map.put("apiKey" , apiMerchants.getApiKey());
map.put("orderNo" , object.getString("orderNo")); map.put("orderNo" , object.getString("orderNo"));
map.put("count" , object.getString("count")); map.put("count" , object.getString("count"));
map.put("couTypeCode" , object.getString("couTypeCode")); map.put("couTypeCode" , object.getString("couTypeCode"));
@ -167,12 +176,6 @@ public class GzSinopecController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY); throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY);
} }
ApiMerchants apiMerchants = apiMerchantsService.findByMchId(object.getString("merchId"));
if (apiMerchants == null) {
log.error("getRechargeProduct error!", "错误商户,请联系管理人员!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_NOT_EXIST);
}
if (!secConfigService.isConfig(OrderProductType.PRODUCT_TYPE11.getApiCode(), object.getString("merchId"))) { if (!secConfigService.isConfig(OrderProductType.PRODUCT_TYPE11.getApiCode(), object.getString("merchId"))) {
log.error("getAllCities error!", "当前帐户无权限查询!"); log.error("getAllCities error!", "当前帐户无权限查询!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.MERCHANT_NOT_AUTHORIZED, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.MERCHANT_NOT_AUTHORIZED, "");
@ -237,7 +240,7 @@ public class GzSinopecController {
} }
if (StringUtils.isBlank(object.getString("apiKey")) || if (
StringUtils.isBlank(object.getString("timetable")) || StringUtils.isBlank(object.getString("timetable")) ||
StringUtils.isBlank(object.getString("merchId")) || StringUtils.isBlank(object.getString("merchId")) ||
StringUtils.isBlank(object.getString("couNo")) || StringUtils.isBlank(object.getString("couNo")) ||
@ -247,9 +250,18 @@ public class GzSinopecController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR);
} }
ApiMerchants apiMerchants = apiMerchantsService.findByMchId(object.getString("merchId"));
if (apiMerchants == null) {
log.error("getRechargeProduct error!", "错误商户,请联系管理人员!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_NOT_EXIST);
}
Map<String , Object> map = new HashMap<>(); Map<String , Object> map = new HashMap<>();
map.put("timetable" , object.getString("timetable")); map.put("timetable" , object.getString("timetable"));
map.put("apiKey" , object.getString("apiKey")); map.put("apiKey" , apiMerchants.getApiKey());
map.put("couNo" , object.getString("couNo")); map.put("couNo" , object.getString("couNo"));
map.put("merchId" , object.getString("merchId")); map.put("merchId" , object.getString("merchId"));
@ -258,12 +270,7 @@ public class GzSinopecController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY); throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY);
} }
ApiMerchants apiMerchants = apiMerchantsService.findByMchId(object.getString("merchId"));
if (apiMerchants == null) {
log.error("getRechargeProduct error!", "错误商户,请联系管理人员!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_NOT_EXIST);
}
if (!secConfigService.isConfig(OrderProductType.PRODUCT_TYPE11.getApiCode(), object.getString("merchId"))) { if (!secConfigService.isConfig(OrderProductType.PRODUCT_TYPE11.getApiCode(), object.getString("merchId"))) {
log.error("getAllCities error!", "当前帐户无权限查询!"); log.error("getAllCities error!", "当前帐户无权限查询!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.MERCHANT_NOT_AUTHORIZED, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.MERCHANT_NOT_AUTHORIZED, "");

@ -79,7 +79,7 @@ public class KfcController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!"); throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!");
} }
if (StringUtils.isBlank(object.getString("apiKey")) || if (
StringUtils.isBlank(object.getString("merchId")) || StringUtils.isBlank(object.getString("merchId")) ||
StringUtils.isBlank(object.getString("sign")) StringUtils.isBlank(object.getString("sign"))
) { ) {
@ -100,7 +100,7 @@ public class KfcController {
} }
Map<String , Object> map = new HashMap<>(); Map<String , Object> map = new HashMap<>();
map.put("apiKey" , object.getString("apiKey")); map.put("apiKey" , apiMerchants.getApiKey());
map.put("merchId" , object.getString("merchId")); map.put("merchId" , object.getString("merchId"));
@ -140,7 +140,7 @@ public class KfcController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!"); throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!");
} }
if (StringUtils.isBlank(object.getString("apiKey")) || if (
StringUtils.isBlank(object.getString("storeCode")) || StringUtils.isBlank(object.getString("storeCode")) ||
StringUtils.isBlank(object.getString("merchId")) || StringUtils.isBlank(object.getString("merchId")) ||
StringUtils.isBlank(object.getString("sign")) StringUtils.isBlank(object.getString("sign"))
@ -162,7 +162,7 @@ public class KfcController {
} }
Map<String , Object> map = new HashMap<>(); Map<String , Object> map = new HashMap<>();
map.put("apiKey" , object.getString("apiKey")); map.put("apiKey" , apiMerchants.getApiKey());
map.put("merchId" , object.getString("merchId")); map.put("merchId" , object.getString("merchId"));
map.put("storeCode" , object.getString("storeCode")); map.put("storeCode" , object.getString("storeCode"));

@ -78,7 +78,7 @@ public class MemberProductsController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!"); throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!");
} }
if (StringUtils.isBlank(object.getString("apiKey")) || if (
StringUtils.isBlank(object.getString("merchId")) || StringUtils.isBlank(object.getString("merchId")) ||
StringUtils.isBlank(object.getString("sign")) StringUtils.isBlank(object.getString("sign"))
) { ) {
@ -99,7 +99,7 @@ public class MemberProductsController {
} }
Map<String , Object> map = new HashMap<>(); Map<String , Object> map = new HashMap<>();
map.put("apiKey" , object.getString("apiKey")); map.put("apiKey" , apiMerchants.getApiKey());
map.put("merchId" , object.getString("merchId")); map.put("merchId" , object.getString("merchId"));
if (!secConfigService.isSignVerify(map , object.getString("sign"))) { if (!secConfigService.isSignVerify(map , object.getString("sign"))) {

@ -65,7 +65,7 @@ public class MobileRechargeController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!"); throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!");
} }
if (StringUtils.isBlank(object.getString("apiKey")) || if (
StringUtils.isBlank(object.getString("merchId")) || StringUtils.isBlank(object.getString("merchId")) ||
StringUtils.isBlank(object.getString("sign")) StringUtils.isBlank(object.getString("sign"))
) { ) {
@ -86,7 +86,7 @@ public class MobileRechargeController {
} }
Map<String , Object> map = new HashMap<>(); Map<String , Object> map = new HashMap<>();
map.put("apiKey" , object.getString("apiKey")); map.put("apiKey" , apiMerchants.getApiKey());
map.put("merchId" , object.getString("merchId")); map.put("merchId" , object.getString("merchId"));
if (!secConfigService.isSignVerify(map , object.getString("sign"))) { if (!secConfigService.isSignVerify(map , object.getString("sign"))) {

@ -7,6 +7,7 @@ import com.hai.common.exception.SysCode;
import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.ApiMerchants; import com.hai.entity.ApiMerchants;
import com.hai.entity.HighGoldRec; import com.hai.entity.HighGoldRec;
import com.hai.entity.HighUser;
import com.hai.model.ResponseData; import com.hai.model.ResponseData;
import com.hai.service.*; import com.hai.service.*;
import com.hai.service.impl.OutRechargeOrderServiceImpl; import com.hai.service.impl.OutRechargeOrderServiceImpl;
@ -72,8 +73,15 @@ public class OrderRebateController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!"); throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!");
} }
if (StringUtils.isBlank(object.getString("apiKey")) || if (
StringUtils.isBlank(object.getString("merchId")) || StringUtils.isBlank(object.getString("merchId")) ||
StringUtils.isBlank(object.getString("phone")) ||
StringUtils.isBlank(object.getString("productType")) ||
StringUtils.isBlank(object.getString("orderNo")) ||
StringUtils.isBlank(object.getString("orderId")) ||
StringUtils.isBlank(object.getString("price")) ||
StringUtils.isBlank(object.getString("title")) ||
StringUtils.isBlank(object.getString("createTime")) ||
StringUtils.isBlank(object.getString("sign")) StringUtils.isBlank(object.getString("sign"))
) { ) {
log.error("getRechargeProduct error!", "请求参数校验失败!"); log.error("getRechargeProduct error!", "请求参数校验失败!");
@ -88,7 +96,6 @@ public class OrderRebateController {
} }
Map<String , Object> map = new HashMap<>(); Map<String , Object> map = new HashMap<>();
map.put("apiKey" , object.getString("apiKey"));
map.put("merchId" , object.getString("merchId")); map.put("merchId" , object.getString("merchId"));
map.put("phone" , object.getString("phone")); map.put("phone" , object.getString("phone"));
map.put("productType" , object.getInteger("productType")); map.put("productType" , object.getInteger("productType"));
@ -97,6 +104,7 @@ public class OrderRebateController {
map.put("price" , object.getBigDecimal("price")); map.put("price" , object.getBigDecimal("price"));
map.put("title" , object.getString("title")); map.put("title" , object.getString("title"));
map.put("createTime" , object.getDate("createTime")); map.put("createTime" , object.getDate("createTime"));
map.put("apiKey" , apiMerchants.getApiKey());
if (!secConfigService.isSignVerify(map , object.getString("sign"))) { if (!secConfigService.isSignVerify(map , object.getString("sign"))) {
log.error("getRechargeProduct error!", "签名校验失败!"); log.error("getRechargeProduct error!", "签名校验失败!");
@ -131,11 +139,10 @@ public class OrderRebateController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!"); throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!");
} }
if (StringUtils.isBlank(object.getString("apiKey")) || if (
StringUtils.isBlank(object.getString("merchId")) || StringUtils.isBlank(object.getString("merchId")) ||
StringUtils.isBlank(object.getString("orderId")) ||
StringUtils.isBlank(object.getString("orderNo")) || StringUtils.isBlank(object.getString("orderNo")) ||
StringUtils.isBlank(object.getString("productType")) || StringUtils.isBlank(object.getString("orderId")) ||
StringUtils.isBlank(object.getString("sign")) StringUtils.isBlank(object.getString("sign"))
) { ) {
log.error("getRechargeProduct error!", "请求参数校验失败!"); log.error("getRechargeProduct error!", "请求参数校验失败!");
@ -150,10 +157,9 @@ public class OrderRebateController {
} }
Map<String , Object> map = new HashMap<>(); Map<String , Object> map = new HashMap<>();
map.put("apiKey" , object.getString("apiKey")); map.put("apiKey" , apiMerchants.getApiKey());
map.put("merchId" , object.getString("merchId")); map.put("merchId" , object.getString("merchId"));
map.put("productType" , object.getInteger("productType")); map.put("orderId" , object.getString("orderId"));
map.put("orderId" , object.getLong("orderId"));
map.put("orderNo" , object.getString("orderNo")); map.put("orderNo" , object.getString("orderNo"));
@ -165,16 +171,134 @@ public class OrderRebateController {
Map<String, Object> mapGold = new HashMap<>(); Map<String, Object> mapGold = new HashMap<>();
mapGold.put("goldType", 1); mapGold.put("goldType", 1);
mapGold.put("resType", object.getInteger("productType"));
mapGold.put("resId", object.getLong("orderId")); mapGold.put("resId", object.getLong("orderId"));
List<HighGoldRec> goldRecs = highGoldRecService.getGoldRec(mapGold); List<HighGoldRec> goldRecs = highGoldRecService.getGoldRec(mapGold);
if (goldRecs.size() == 0) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR , "未知订单号");
}
Integer integralNum = 0;
Long userId = null;
for (HighGoldRec goldRec : goldRecs) { for (HighGoldRec goldRec : goldRecs) {
String remark = "订单" + object.getString("orderNo") + "退款,退还积分:" + goldRec.getGold(); userId = goldRec.getUserId();
integralNum += goldRec.getGold();
}
HighUser user = highUserService.findByUserId(userId);
if (integralNum > user.getGold()) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "积分数量不足");
}
String remark = "订单" + object.getString("orderNo") + "退款积分冻结:" + integralNum;
// 积分退款 // 积分退款
highUserService.goldHandle(goldRec.getUserId(), goldRec.getGold(),1, object.getInteger("productType"), object.getLong("orderId") , remark); highUserService.goldHandle(user.getId(), integralNum,2, 103, object.getLong("orderId") , remark , object.getString("orderNo"));
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighOrderController --> getBackendToken() error!", e);
return ResponseMsgUtil.exception(e);
} }
}
@RequestMapping(value = "/refundReturn", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "退款回调")
public ResponseData refundReturn(@RequestBody JSONObject object , HttpServletRequest request ) {
try {
String ip = "";
// 有的user可能使用代理,为处理用户使用代理的情况,使用x-forwarded-for
if (request.getHeader("x-forwarded-for") == null) {
ip = request.getRemoteAddr();
} else {
ip = request.getHeader("x-forwarded-for");
}
if (!apiIpAddressService.validationIpAddressLegal(object.getString("merchId") , ip)) {
log.error("getRechargeProduct error!", "非法ip地址,请联系管理人员!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!");
}
if (
StringUtils.isBlank(object.getString("merchId")) ||
StringUtils.isBlank(object.getString("orderId")) ||
StringUtils.isBlank(object.getString("refundStatus")) ||
StringUtils.isBlank(object.getString("orderNo")) ||
StringUtils.isBlank(object.getString("sign"))
) {
log.error("getRechargeProduct error!", "请求参数校验失败!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR);
}
ApiMerchants apiMerchants = apiMerchantsService.findByMchId(object.getString("merchId"));
if (apiMerchants == null) {
log.error("getRechargeProduct error!", "商户号错误!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_NOT_EXIST);
}
Map<String , Object> map = new HashMap<>();
map.put("apiKey" , apiMerchants.getApiKey());
map.put("merchId" , object.getString("merchId"));
map.put("orderId" , object.getLong("orderId"));
map.put("refundStatus" , object.getString("refundStatus"));
map.put("orderNo" , object.getString("orderNo"));
if (!secConfigService.isSignVerify(map , object.getString("sign"))) {
log.error("getRechargeProduct error!", "签名校验失败!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY);
}
Map<String, Object> mapGold = new HashMap<>();
mapGold.put("goldType", 2);
mapGold.put("resType", 103);
mapGold.put("resId", object.getLong("orderId"));
HighGoldRec goldRecs = highGoldRecService.findGoldRec(mapGold);
if (goldRecs == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR , "未知订单号");
}
if (object.getString("refundStatus").equals("succeed")) {
// 查询是否存在多次退款
Map<String, Object> mapGoldRepeat = new HashMap<>();
mapGoldRepeat.put("goldType", 1);
mapGoldRepeat.put("resType", 3);
mapGoldRepeat.put("resId", object.getLong("orderId"));
List<HighGoldRec> goldRecsRepeat = highGoldRecService.getGoldRec(mapGoldRepeat);
if (goldRecsRepeat.size() > 0) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR , "重复退款");
}
String remark = "订单" + object.getString("orderNo") + "退款成功扣除积分:" + goldRecs.getGold();
goldRecs.setResType(3);
goldRecs.setUpdateTime(new Date());
goldRecs.setRemark(remark);
highGoldRecService.updateGoldRec(goldRecs);
} else {
String remark = "订单" + object.getString("orderNo") + "退款失败,退还积分:" + goldRecs.getGold();
goldRecs.setStatus(0);
goldRecs.setUpdateTime(new Date());
highGoldRecService.updateGoldRec(goldRecs);
// 积分退款
highUserService.goldHandle(goldRecs.getUserId(), goldRecs.getGold(),1, 104, object.getLong("orderId") , remark , object.getString("orderNo"));
}
return ResponseMsgUtil.success("操作成功"); return ResponseMsgUtil.success("操作成功");
} catch (Exception e) { } catch (Exception e) {

@ -74,7 +74,7 @@ public class RefuelOnlineController {
ip = request.getHeader("x-forwarded-for"); ip = request.getHeader("x-forwarded-for");
} }
if (StringUtils.isBlank(object.getString("apiKey")) || if (
StringUtils.isBlank(object.getString("merchId")) || StringUtils.isBlank(object.getString("merchId")) ||
StringUtils.isBlank(object.getString("sign")) StringUtils.isBlank(object.getString("sign"))
) { ) {
@ -100,7 +100,7 @@ public class RefuelOnlineController {
} }
Map<String , Object> map = new HashMap<>(); Map<String , Object> map = new HashMap<>();
map.put("apiKey" , object.getString("apiKey")); map.put("apiKey" , apiMerchants.getApiKey());
map.put("merchId" , object.getString("merchId")); map.put("merchId" , object.getString("merchId"));
if (!secConfigService.isSignVerify(map , object.getString("sign"))) { if (!secConfigService.isSignVerify(map , object.getString("sign"))) {

@ -78,7 +78,7 @@ public class StarbucksController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!"); throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!");
} }
if (StringUtils.isBlank(object.getString("apiKey")) || if (
StringUtils.isBlank(object.getString("merchId")) || StringUtils.isBlank(object.getString("merchId")) ||
StringUtils.isBlank(object.getString("lat")) || StringUtils.isBlank(object.getString("lat")) ||
StringUtils.isBlank(object.getString("lon")) || StringUtils.isBlank(object.getString("lon")) ||
@ -101,7 +101,7 @@ public class StarbucksController {
} }
Map<String , Object> map = new HashMap<>(); Map<String , Object> map = new HashMap<>();
map.put("apiKey" , object.getString("apiKey")); map.put("apiKey" , apiMerchants.getApiKey());
map.put("merchId" , object.getString("merchId")); map.put("merchId" , object.getString("merchId"));
map.put("lat" , object.getString("lat")); map.put("lat" , object.getString("lat"));
map.put("lon" , object.getString("lon")); map.put("lon" , object.getString("lon"));
@ -145,7 +145,7 @@ public class StarbucksController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!"); throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!");
} }
if (StringUtils.isBlank(object.getString("apiKey")) || if (
StringUtils.isBlank(object.getString("merchId")) || StringUtils.isBlank(object.getString("merchId")) ||
StringUtils.isBlank(object.getString("sign")) StringUtils.isBlank(object.getString("sign"))
) { ) {
@ -166,7 +166,7 @@ public class StarbucksController {
} }
Map<String , Object> map = new HashMap<>(); Map<String , Object> map = new HashMap<>();
map.put("apiKey" , object.getString("apiKey")); map.put("apiKey" , apiMerchants.getApiKey());
map.put("merchId" , object.getString("merchId")); map.put("merchId" , object.getString("merchId"));
if (!secConfigService.isSignVerify(map , object.getString("sign"))) { if (!secConfigService.isSignVerify(map , object.getString("sign"))) {

@ -9,11 +9,14 @@ import com.hai.config.WxOrderConfig;
import com.hai.entity.ApiMerchants; import com.hai.entity.ApiMerchants;
import com.hai.entity.ApiOrder; import com.hai.entity.ApiOrder;
import com.hai.entity.ApiProductConfig; import com.hai.entity.ApiProductConfig;
import com.hai.entity.HighOrder;
import com.hai.model.OrderRefundModel; import com.hai.model.OrderRefundModel;
import com.hai.model.ResponseData; import com.hai.model.ResponseData;
import com.hai.openApi.service.ApiOrderService; import com.hai.openApi.service.ApiOrderService;
import com.hai.order.model.RefundPriceModel; import com.hai.order.model.RefundPriceModel;
import com.hai.order.service.OrderService;
import com.hai.order.type.OrderProductType; import com.hai.order.type.OrderProductType;
import com.hai.order.type.OrderRefundOpUserType;
import com.hai.service.*; import com.hai.service.*;
import com.v1.config.ToolConfig; import com.v1.config.ToolConfig;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -51,8 +54,9 @@ public class orderController {
@Autowired @Autowired
private RedisTemplate redisTemplate; private RedisTemplate redisTemplate;
@Resource @Resource
private ApiOrderService orderService; private OrderService orderService;
@Resource @Resource
private ApiIpAddressService apiIpAddressService; private ApiIpAddressService apiIpAddressService;
@ -60,6 +64,9 @@ public class orderController {
@Resource @Resource
private ApiOrderService apiOrderService; private ApiOrderService apiOrderService;
@Resource
private HighOrderService highOrderService;
@RequestMapping(value = "/createOrder", method = RequestMethod.POST) @RequestMapping(value = "/createOrder", method = RequestMethod.POST)
@ResponseBody @ResponseBody
@ApiOperation(value = "创建订单") @ApiOperation(value = "创建订单")
@ -80,7 +87,6 @@ public class orderController {
} }
if ( if (
StringUtils.isBlank(object.getString("apiKey")) ||
StringUtils.isBlank(object.getString("productType")) || StringUtils.isBlank(object.getString("productType")) ||
StringUtils.isBlank(object.getString("timetable")) || StringUtils.isBlank(object.getString("timetable")) ||
StringUtils.isBlank(object.getString("orderNo")) || StringUtils.isBlank(object.getString("orderNo")) ||
@ -108,7 +114,7 @@ public class orderController {
map.put("timetable" , object.getString("timetable")); map.put("timetable" , object.getString("timetable"));
map.put("orderNo" , object.getString("orderNo")); map.put("orderNo" , object.getString("orderNo"));
map.put("productType" , object.getString("productType")); map.put("productType" , object.getString("productType"));
map.put("apiKey" , object.getString("apiKey")); map.put("apiKey" , apiMerchants.getApiKey());
map.put("content" , object.getString("content")); map.put("content" , object.getString("content"));
map.put("merchId" , object.getString("merchId")); map.put("merchId" , object.getString("merchId"));
@ -162,7 +168,7 @@ public class orderController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未填写下单手机号,就餐方式,下单信息,门店编码"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未填写下单手机号,就餐方式,下单信息,门店编码");
} }
} }
return ResponseMsgUtil.success(orderService.createOrder(object)); return ResponseMsgUtil.success(apiOrderService.createOrder(object));
} catch (Exception e) { } catch (Exception e) {
log.error("HighOpenApiController --> createOrder() error!", e); log.error("HighOpenApiController --> createOrder() error!", e);
@ -190,7 +196,6 @@ public class orderController {
} }
if ( if (
StringUtils.isBlank(object.getString("apiKey")) ||
StringUtils.isBlank(object.getString("mchOrderNo")) || StringUtils.isBlank(object.getString("mchOrderNo")) ||
StringUtils.isBlank(object.getString("sign")) || StringUtils.isBlank(object.getString("sign")) ||
StringUtils.isBlank(object.getString("merchId")) StringUtils.isBlank(object.getString("merchId"))
@ -208,7 +213,7 @@ public class orderController {
Map<String , Object> map = new HashMap<>(); Map<String , Object> map = new HashMap<>();
map.put("mchOrderNo" , object.getString("mchOrderNo")); map.put("mchOrderNo" , object.getString("mchOrderNo"));
map.put("apiKey" , object.getString("apiKey")); map.put("apiKey" , apiMerchants.getApiKey());
map.put("merchId" , object.getString("merchId")); map.put("merchId" , object.getString("merchId"));
if (!secConfigService.isSignVerify(map, object.getString("sign"))) { if (!secConfigService.isSignVerify(map, object.getString("sign"))) {
@ -225,7 +230,7 @@ public class orderController {
object.put("orderNo" , apiOrder.getOrderNo()); object.put("orderNo" , apiOrder.getOrderNo());
ApiOrder order = orderService.payOrder(object); ApiOrder order = apiOrderService.payOrder(object);
return ResponseMsgUtil.success(order); return ResponseMsgUtil.success(order);
@ -258,7 +263,6 @@ public class orderController {
} }
if ( if (
StringUtils.isBlank(object.getString("apiKey")) ||
StringUtils.isBlank(object.getString("mchOrderNo")) || StringUtils.isBlank(object.getString("mchOrderNo")) ||
StringUtils.isBlank(object.getString("sign")) || StringUtils.isBlank(object.getString("sign")) ||
StringUtils.isBlank(object.getString("merchId")) StringUtils.isBlank(object.getString("merchId"))
@ -276,7 +280,7 @@ public class orderController {
Map<String , Object> map = new HashMap<>(); Map<String , Object> map = new HashMap<>();
map.put("mchOrderNo" , object.getString("mchOrderNo")); map.put("mchOrderNo" , object.getString("mchOrderNo"));
map.put("apiKey" , object.getString("apiKey")); map.put("apiKey" , apiMerchants.getApiKey());
map.put("merchId" , object.getString("merchId")); map.put("merchId" , object.getString("merchId"));
if (!secConfigService.isSignVerify(map, object.getString("sign"))) { if (!secConfigService.isSignVerify(map, object.getString("sign"))) {
@ -292,14 +296,80 @@ public class orderController {
} }
} }
@RequestMapping(value = "/refund", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "退款")
public ResponseData refund(@RequestBody JSONObject object , HttpServletRequest request) {
try {
String ip = "";
// 有的user可能使用代理,为处理用户使用代理的情况,使用x-forwarded-for
if (request.getHeader("x-forwarded-for") == null) {
ip = request.getRemoteAddr();
} else {
ip = request.getHeader("x-forwarded-for");
}
if (!apiIpAddressService.validationIpAddressLegal(object.getString("merchId") , ip)) {
log.error("getRechargeProduct error!", "非法ip地址,请联系管理人员!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!");
}
if (
StringUtils.isBlank(object.getString("mchOrderNo")) ||
StringUtils.isBlank(object.getString("sign")) ||
StringUtils.isBlank(object.getString("merchId"))
) {
log.error("createOrder error!", "请求参数校验失败!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR);
}
ApiMerchants apiMerchants = apiMerchantsService.findByMchId(object.getString("merchId"));
if (apiMerchants == null) {
log.error("getRechargeProduct error!", "帐户错误!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_NOT_EXIST);
}
Map<String , Object> map = new HashMap<>();
map.put("mchOrderNo" , object.getString("mchOrderNo"));
map.put("apiKey" , apiMerchants.getApiKey());
map.put("merchId" , object.getString("merchId"));
if (!secConfigService.isSignVerify(map, object.getString("sign"))) {
log.error("createOrder error!", "签名校验失败!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY);
}
ApiOrder apiOrder = apiOrderService.findByOrderNo(object.getString("mchOrderNo") , null);
HighOrder order = highOrderService.getOrderByOrderNo(apiOrder.getOrderNo());
if (order.getOrderStatus() != 2) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "订单状态错误");
}
orderService.refundOrder(order, "商户退款退款", OrderRefundOpUserType.TYPE1,
null,
"系统自动退款");
return ResponseMsgUtil.success("退款成功");
} catch (Exception e) {
log.error("HighOpenApiController --> createOrder() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/externalOrderRefund", method = RequestMethod.POST) @RequestMapping(value = "/externalOrderRefund", method = RequestMethod.POST)
@ResponseBody @ResponseBody
@ApiOperation(value = "对外订单退款接口") @ApiOperation(value = "对外订单退款接口")
public ResponseData externalOrderRefund(@RequestBody JSONObject object , HttpServletRequest request) { public ResponseData externalOrderRefund(@RequestBody JSONObject object , HttpServletRequest request) {
try { try {
System.out.println(object);
String ip = ""; String ip = "";
// 有的user可能使用代理,为处理用户使用代理的情况,使用x-forwarded-for // 有的user可能使用代理,为处理用户使用代理的情况,使用x-forwarded-for
if (request.getHeader("x-forwarded-for") == null) { if (request.getHeader("x-forwarded-for") == null) {
@ -314,7 +384,6 @@ public class orderController {
} }
if ( if (
StringUtils.isBlank(object.getString("apiKey")) ||
StringUtils.isBlank(object.getString("paySerialNo")) || StringUtils.isBlank(object.getString("paySerialNo")) ||
StringUtils.isBlank(object.getString("wxMchId")) || StringUtils.isBlank(object.getString("wxMchId")) ||
StringUtils.isBlank(object.getString("refundPrice")) || StringUtils.isBlank(object.getString("refundPrice")) ||
@ -338,7 +407,7 @@ public class orderController {
map.put("wxMchId" , object.getString("wxMchId")); map.put("wxMchId" , object.getString("wxMchId"));
map.put("payRealPrice" , object.getString("payRealPrice")); map.put("payRealPrice" , object.getString("payRealPrice"));
map.put("refundPrice" , object.getString("refundPrice")); map.put("refundPrice" , object.getString("refundPrice"));
map.put("apiKey" , object.getString("apiKey")); map.put("apiKey" , apiMerchants.getApiKey());
map.put("merchId" , object.getString("merchId")); map.put("merchId" , object.getString("merchId"));
if (!secConfigService.isSignVerify(map, object.getString("sign"))) { if (!secConfigService.isSignVerify(map, object.getString("sign"))) {

Loading…
Cancel
Save