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

2.0-dev
胡锐 6 months ago
commit 57a7ab3ea6
  1. 2
      hai-bweb/src/main/java/com/bweb/controller/HighTestController.java
  2. 34
      hai-cweb/src/main/java/com/cweb/controller/Etc/EtcCustomerController.java
  3. 2
      hai-cweb/src/main/java/com/cweb/controller/Goods/GoodsController.java
  4. 3
      hai-order/src/main/java/com/web/controller/business/GoodsOrderController.java
  5. 1
      hai-service/src/main/java/com/hai/config/EtcService.java
  6. 1
      hai-service/src/main/java/com/hai/order/service/OrderCreateHandleService.java
  7. 29
      hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java
  8. 14
      hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java
  9. 6
      hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java
  10. 1
      hai-service/src/main/java/com/hai/order/type/OrderChildGoodsType.java
  11. 1
      hai-service/src/main/java/com/hai/order/type/OrderProductType.java
  12. 1
      hai-service/src/main/java/com/hai/service/HighOrderService.java
  13. 1
      hai-service/src/main/java/com/hai/service/impl/HighGasServiceImpl.java
  14. 29
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java
  15. 3
      v1/src/main/java/com/v1/config/AuthConfig.java
  16. 25
      v1/src/main/java/com/v1/controller/business/RefuelOnlineController.java
  17. 3
      v1/src/main/java/com/v1/controller/orderController.java

File diff suppressed because one or more lines are too long

@ -14,10 +14,7 @@ import com.hai.etc.EtcCustMsgService;
import com.hai.model.HighUserModel; import com.hai.model.HighUserModel;
import com.hai.model.ResponseData; import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel; import com.hai.model.UserInfoModel;
import com.hai.service.CommonService; import com.hai.service.*;
import com.hai.service.HighDiscountPackageDetailsService;
import com.hai.service.HighDiscountPackageService;
import com.hai.service.SecConfigService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -49,6 +46,9 @@ public class EtcCustomerController {
@Resource @Resource
private SecConfigService secConfigService; private SecConfigService secConfigService;
@Resource
private HighOrderService highOrderService;
@Resource @Resource
private HighDiscountPackageService highDiscountPackageService; private HighDiscountPackageService highDiscountPackageService;
@ -395,7 +395,7 @@ public class EtcCustomerController {
@RequestMapping(value = "/getEquity", method = RequestMethod.POST) @RequestMapping(value = "/getEquity", method = RequestMethod.POST)
@ResponseBody @ResponseBody
@ApiOperation(value = "签约银行卡代扣") @ApiOperation(value = "获取优惠券包")
public ResponseData getEquity() { public ResponseData getEquity() {
try { try {
@ -421,6 +421,30 @@ public class EtcCustomerController {
} }
@RequestMapping(value = "/getEtcTrain", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询是否需要支付货车推广费用")
public ResponseData getEtcTrain( HttpServletRequest request
) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject();
Map<String, Object> mapUser = new HashMap<>();
mapUser.put("userId" , userInfoModel.getHighUser().getPhone());
mapUser.put("status" , "2,3");
HighOrder order = highOrderService.getOrderByMap(mapUser);
return ResponseMsgUtil.success(order == null);
} catch (Exception e) {
log.error("BsMsgController --> getMsgByList() error!", e);
return ResponseMsgUtil.exception(e);
}
}

@ -130,7 +130,7 @@ public class GoodsController {
@RequestMapping(value = "/getListGoodsDetailByHome", method = RequestMethod.GET) @RequestMapping(value = "/getListGoodsDetailByHome", method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "查询商品列表") @ApiOperation(value = "查询商品列表")
public ResponseData getListGoodsDetail( public ResponseData getListGoodsDetailByHome(
@RequestParam(value = "goodsTypeId", required = false) String goodsTypeId, @RequestParam(value = "goodsTypeId", required = false) String goodsTypeId,
@RequestParam(value = "title", required = false) String title, @RequestParam(value = "title", required = false) String title,
@RequestParam(value = "companyId", required = false) Long companyId @RequestParam(value = "companyId", required = false) Long companyId

@ -152,9 +152,6 @@ public class GoodsOrderController {
} }
} }
@RequestMapping(value="/getGoodsOrderDetail",method = RequestMethod.GET) @RequestMapping(value="/getGoodsOrderDetail",method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "查询订单详情") @ApiOperation(value = "查询订单详情")

@ -82,6 +82,7 @@ public class EtcService {
vehInfoListObject.put("vehPlateColor" , etcCarMsg.getVehPlateColor()); vehInfoListObject.put("vehPlateColor" , etcCarMsg.getVehPlateColor());
vehInfoListObject.put("vehType" , etcCarMsg.getVehType()); vehInfoListObject.put("vehType" , etcCarMsg.getVehType());
vehInfoListObject.put("wheelsNum" , etcCarMsg.getWheelsNum()); vehInfoListObject.put("wheelsNum" , etcCarMsg.getWheelsNum());
vehInfoListObject.put("axlesNum" , etcCarMsg.getAxlesNum());
vehInfoListObject.put("drivLicMainFro" , convertToBase64(etcCarMsg.getDrivlicMainFro())); vehInfoListObject.put("drivLicMainFro" , convertToBase64(etcCarMsg.getDrivlicMainFro()));
vehInfoListObject.put("drivLicSubFro" , convertToBase64(etcCarMsg.getDrivlicSubFro())); vehInfoListObject.put("drivLicSubFro" , convertToBase64(etcCarMsg.getDrivlicSubFro()));
vehInfoListObject.put("headStockPhoto" , convertToBase64(etcCarMsg.getHeadStockPhoto())); vehInfoListObject.put("headStockPhoto" , convertToBase64(etcCarMsg.getHeadStockPhoto()));

@ -149,5 +149,6 @@ public interface OrderCreateHandleService {
HighChildOrder cpPetroCoupon(HighOrder order , CreateOrderChildModel createOrderChildModel) throws Exception; HighChildOrder cpPetroCoupon(HighOrder order , CreateOrderChildModel createOrderChildModel) throws Exception;
HighChildOrder etcUser(HighOrder order , CreateOrderChildModel createOrderChildModel) throws Exception; HighChildOrder etcUser(HighOrder order , CreateOrderChildModel createOrderChildModel) throws Exception;
HighChildOrder etcTrain(HighOrder order , CreateOrderChildModel createOrderChildModel) throws Exception;
} }

@ -1420,4 +1420,33 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
return childOrder; return childOrder;
} }
@Override
public HighChildOrder etcTrain(HighOrder order, CreateOrderChildModel createOrderChildModel) throws Exception {
HighChildOrder childOrder = new HighChildOrder();
childOrder.setOrderNo(order.getOrderNo());
childOrder.setMemId(order.getMemId());
childOrder.setMemName(order.getMemName());
childOrder.setMemPhone(order.getMemPhone());
childOrder.setChildOrderNo(OrderUtil.generateChildOrderNo());
childOrder.setGoodsType(OrderChildGoodsType.TYPE21.getNumber());
childOrder.setGoodsId(createOrderChildModel.getGoodsId());
childOrder.setSkuId(createOrderChildModel.getSkuId());
childOrder.setGoodsName("ETC货车办理");
childOrder.setGoodsSpecName("ETC货车办理");
childOrder.setGoodsPrice(createOrderChildModel.getGoodsPrice());
childOrder.setGoodsActualPrice(childOrder.getGoodsPrice());
childOrder.setSaleCount(createOrderChildModel.getSaleCount());
childOrder.setGiveawayType(false);
childOrder.setChildOrderStatus(OrderChildStatus.STATUS1.getNumber());
childOrder.setTotalPrice(childOrder.getGoodsPrice());
childOrder.setTotalActualPrice(childOrder.getGoodsPrice());
childOrder.setTotalDeductionPrice(childOrder.getTotalPrice().subtract(childOrder.getTotalActualPrice()));
childOrder.setPraiseStatus(0);
childOrder.setCreateTime(new Date());
return childOrder;
}
} }

@ -294,6 +294,12 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
cpPetroCoupon(order , childOrder); cpPetroCoupon(order , childOrder);
} else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE20.getNumber())) { } else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE20.getNumber())) {
etcUser(order); etcUser(order);
} else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE21.getNumber())) {
etcTrain
(order);
} }
} }
} }
@ -837,4 +843,12 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
} }
private void etcTrain(HighOrder order) throws Exception {
// 赠送优惠券
highDiscountPackageService.giveAway(order.getHighChildOrderList().get(0).getSkuId() , order.getMemPhone() , 2 , order.getMemId().toString());
}
} }

@ -399,6 +399,12 @@ public class OrderServiceImpl implements OrderService {
order.setProductType(OrderProductType.PRODUCT_TYPE20.getNumber()); order.setProductType(OrderProductType.PRODUCT_TYPE20.getNumber());
order.setSecUserId(childOrder.getId()); order.setSecUserId(childOrder.getId());
order.setTitle("ETC用户办理"); order.setTitle("ETC用户办理");
} else if (child.getGoodsType().equals(OrderChildGoodsType.TYPE21.getNumber())) {
HighChildOrder childOrder = orderCreateHandleService.etcTrain(order , child);
childOrderList.add(childOrder);
order.setProductType(OrderProductType.PRODUCT_TYPE21.getNumber());
order.setSecUserId(childOrder.getId());
order.setTitle("ETC货车办理");
} }
else { else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知业务类型"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知业务类型");

@ -28,6 +28,7 @@ public enum OrderChildGoodsType {
TYPE18(18, "中石油卡券"), TYPE18(18, "中石油卡券"),
TYPE19(19, "重庆中石油卡券"), TYPE19(19, "重庆中石油卡券"),
TYPE20(20, "ETC用户办理"), TYPE20(20, "ETC用户办理"),
TYPE21(21, "ETC货车推广"),
; ;
private Integer number; private Integer number;

@ -31,6 +31,7 @@ public enum OrderProductType {
PRODUCT_TYPE18(18, "中石油卡券" , "orderLogo/coupon.png", "PETRO_COUPON"), PRODUCT_TYPE18(18, "中石油卡券" , "orderLogo/coupon.png", "PETRO_COUPON"),
PRODUCT_TYPE19(19, "重庆中石油卡券" , "orderLogo/coupon.png", "CQ_PETRO_COUPON"), PRODUCT_TYPE19(19, "重庆中石油卡券" , "orderLogo/coupon.png", "CQ_PETRO_COUPON"),
PRODUCT_TYPE20(20, "ETC用户办理" , "orderLogo/coupon.png", "ETC_USER"), PRODUCT_TYPE20(20, "ETC用户办理" , "orderLogo/coupon.png", "ETC_USER"),
PRODUCT_TYPE21(21, "ETC货车办理" , "orderLogo/coupon.png", "ETC_TRAIN"),
PRODUCT_TYPE101(101, "惠支付" , "orderLogo/pay.png", "PAY"), PRODUCT_TYPE101(101, "惠支付" , "orderLogo/pay.png", "PAY"),
PRODUCT_TYPE102(102, "门店活动" , "orderLogo/store_activity.png", "STORE_ACTIVITY"), PRODUCT_TYPE102(102, "门店活动" , "orderLogo/store_activity.png", "STORE_ACTIVITY"),
; ;

@ -100,6 +100,7 @@ public interface HighOrderService {
* @Date 2021/3/27 0:38 * @Date 2021/3/27 0:38
**/ **/
HighOrder getOrderByOrderNo(String orderNo); HighOrder getOrderByOrderNo(String orderNo);
HighOrder getOrderByMap(Map<String , Object> map);
/** /**
* @Author 袁野 * @Author 袁野

@ -831,7 +831,6 @@ public class HighGasServiceImpl implements HighGasService {
Map<String, Object> param = new HashMap<>(); Map<String, Object> param = new HashMap<>();
param.put("sourceType", 2); param.put("sourceType", 2);
param.put("regionId", "500000"); param.put("regionId", "500000");
param.put("storeName", "壳牌");
param.put("status", 1); param.put("status", 1);
List<HighMerchantStore> merchantStoreList = merchantStoreService.getMerchantStoreList(param); List<HighMerchantStore> merchantStoreList = merchantStoreService.getMerchantStoreList(param);

@ -472,6 +472,8 @@ public class HighOrderServiceImpl implements HighOrderService {
return order; return order;
} }
@Override @Override
public HighOrder getOrderByOrderNo(String orderNo) { public HighOrder getOrderByOrderNo(String orderNo) {
HighOrderExample example = new HighOrderExample(); HighOrderExample example = new HighOrderExample();
@ -484,6 +486,33 @@ public class HighOrderServiceImpl implements HighOrderService {
return null; return null;
} }
@Override
public HighOrder getOrderByMap(Map<String, Object> map) {
HighOrderExample example = new HighOrderExample();
HighOrderExample.Criteria criteria = example.createCriteria();
if (MapUtils.getLong(map, "memId") != null) {
criteria.andMemIdEqualTo(MapUtils.getLong(map, "memId"));
}
if (StringUtils.isNotBlank(MapUtils.getString(map, "status"))) {
String[] statuses = MapUtils.getString(map, "status").split(",");
List<Integer> list = new ArrayList<>();
for (String status : statuses) {
list.add(Integer.parseInt(status));
}
criteria.andOrderStatusIn(list);
}
List<HighOrder> list = highOrderMapper.selectByExample(example);
if (!list.isEmpty()) {
return list.get(0);
}
return null;
}
@Override @Override
public List<HighOrderData> getOrderBList(Map<String, Object> map) { public List<HighOrderData> getOrderBList(Map<String, Object> map) {
return highOrderMapperExt.selectOrderDataList(map); return highOrderMapperExt.selectOrderDataList(map);

@ -102,6 +102,9 @@ public class AuthConfig implements WebMvcConfigurer {
.excludePathPatterns("/refuelOnline/*") .excludePathPatterns("/refuelOnline/*")
.excludePathPatterns("/apiCoupon/*") .excludePathPatterns("/apiCoupon/*")
.excludePathPatterns("/apiMerchants/*") .excludePathPatterns("/apiMerchants/*")
.excludePathPatterns("/kfc/*")
.excludePathPatterns("/starbucks/*")
.excludePathPatterns("/memberRecharge/*")
; ;
} }

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode; import com.hai.common.exception.SysCode;
import com.hai.common.utils.RedisUtil;
import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.*; import com.hai.entity.*;
import com.hai.model.ResponseData; import com.hai.model.ResponseData;
@ -60,12 +61,17 @@ public class RefuelOnlineController {
@Resource @Resource
private ApiCommonConfig apiCommonConfig; private ApiCommonConfig apiCommonConfig;
@Resource
private RedisUtil redisUtil;
@RequestMapping(value = "/getStationStore", method = RequestMethod.POST) @RequestMapping(value = "/getStationStore", method = RequestMethod.POST)
@ResponseBody @ResponseBody
@ApiOperation(value = "获取油站门店") @ApiOperation(value = "获取油站门店")
public ResponseData getStationStore(@RequestBody JSONObject object , HttpServletRequest request ) { public ResponseData getStationStore(@RequestBody JSONObject object , HttpServletRequest request ) {
try { try {
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) {
@ -82,10 +88,10 @@ public class RefuelOnlineController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR);
} }
if (!apiIpAddressService.validationIpAddressLegal(object.getString("merchId") , ip)) { // if (!apiIpAddressService.validationIpAddressLegal(object.getString("merchId") , ip)) {
log.error("getRechargeProduct error!", "非法ip地址,请联系管理人员!"); // log.error("getRechargeProduct error!", "非法ip地址,请联系管理人员!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!"); // throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!");
} // }
ApiMerchants apiMerchants = apiMerchantsService.findByMchId(object.getString("merchId")); ApiMerchants apiMerchants = apiMerchantsService.findByMchId(object.getString("merchId"));
@ -108,6 +114,12 @@ public class RefuelOnlineController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY); throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY);
} }
List<ApiMchStoreModel> apiMchStoreModels;
apiMchStoreModels = (List<ApiMchStoreModel>) redisUtil.get("stationStoreApi");
if (apiMchStoreModels == null) {
apiMchStoreModels = new ArrayList<>();
Map<String, Object> mapProduct = new HashMap<>(); Map<String, Object> mapProduct = new HashMap<>();
mapProduct.put("mchId" , object.getString("merchId")); mapProduct.put("mchId" , object.getString("merchId"));
mapProduct.put("productType" , OrderProductType.PRODUCT_TYPE6.getNumber()); mapProduct.put("productType" , OrderProductType.PRODUCT_TYPE6.getNumber());
@ -124,7 +136,7 @@ public class RefuelOnlineController {
merchantStores.addAll(highMerchantStoreService.getMerchantStoreList(mapMerchant)); merchantStores.addAll(highMerchantStoreService.getMerchantStoreList(mapMerchant));
} }
List<ApiMchStoreModel> apiMchStoreModels = new ArrayList<>();
for (HighMerchantStore merchantStore : merchantStores) { for (HighMerchantStore merchantStore : merchantStores) {
ApiMchStoreModel apiMchStoreModel = new ApiMchStoreModel(); ApiMchStoreModel apiMchStoreModel = new ApiMchStoreModel();
@ -156,6 +168,9 @@ public class RefuelOnlineController {
apiMchStoreModel.setApiGasOliPriceModels(list); apiMchStoreModel.setApiGasOliPriceModels(list);
apiMchStoreModels.add(apiMchStoreModel); apiMchStoreModels.add(apiMchStoreModel);
} }
redisUtil.set("stationStoreApi", apiMchStoreModels);
}
return ResponseMsgUtil.success(apiMchStoreModels); return ResponseMsgUtil.success(apiMchStoreModels);

@ -73,6 +73,9 @@ public class orderController {
public ResponseData createOrder(@RequestBody JSONObject object , HttpServletRequest request ) { public ResponseData createOrder(@RequestBody JSONObject object , HttpServletRequest request ) {
try { try {
System.out.println("请求订单内容======================================================");
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) {

Loading…
Cancel
Save