袁野 6 months ago
parent 79522213c2
commit 0885e9ad54
  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. 95
      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.ResponseData;
import com.hai.model.UserInfoModel;
import com.hai.service.CommonService;
import com.hai.service.HighDiscountPackageDetailsService;
import com.hai.service.HighDiscountPackageService;
import com.hai.service.SecConfigService;
import com.hai.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
@ -49,6 +46,9 @@ public class EtcCustomerController {
@Resource
private SecConfigService secConfigService;
@Resource
private HighOrderService highOrderService;
@Resource
private HighDiscountPackageService highDiscountPackageService;
@ -395,7 +395,7 @@ public class EtcCustomerController {
@RequestMapping(value = "/getEquity", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "签约银行卡代扣")
@ApiOperation(value = "获取优惠券包")
public ResponseData getEquity() {
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)
@ResponseBody
@ApiOperation(value = "查询商品列表")
public ResponseData getListGoodsDetail(
public ResponseData getListGoodsDetailByHome(
@RequestParam(value = "goodsTypeId", required = false) String goodsTypeId,
@RequestParam(value = "title", required = false) String title,
@RequestParam(value = "companyId", required = false) Long companyId

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

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

@ -149,5 +149,6 @@ public interface OrderCreateHandleService {
HighChildOrder cpPetroCoupon(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;
}
@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);
} else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE20.getNumber())) {
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.setSecUserId(childOrder.getId());
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 {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知业务类型");

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

@ -31,6 +31,7 @@ public enum OrderProductType {
PRODUCT_TYPE18(18, "中石油卡券" , "orderLogo/coupon.png", "PETRO_COUPON"),
PRODUCT_TYPE19(19, "重庆中石油卡券" , "orderLogo/coupon.png", "CQ_PETRO_COUPON"),
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_TYPE102(102, "门店活动" , "orderLogo/store_activity.png", "STORE_ACTIVITY"),
;

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

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

@ -472,6 +472,8 @@ public class HighOrderServiceImpl implements HighOrderService {
return order;
}
@Override
public HighOrder getOrderByOrderNo(String orderNo) {
HighOrderExample example = new HighOrderExample();
@ -484,6 +486,33 @@ public class HighOrderServiceImpl implements HighOrderService {
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
public List<HighOrderData> getOrderBList(Map<String, Object> map) {
return highOrderMapperExt.selectOrderDataList(map);

@ -102,6 +102,9 @@ public class AuthConfig implements WebMvcConfigurer {
.excludePathPatterns("/refuelOnline/*")
.excludePathPatterns("/apiCoupon/*")
.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.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.utils.RedisUtil;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.*;
import com.hai.model.ResponseData;
@ -60,12 +61,17 @@ public class RefuelOnlineController {
@Resource
private ApiCommonConfig apiCommonConfig;
@Resource
private RedisUtil redisUtil;
@RequestMapping(value = "/getStationStore", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "获取油站门店")
public ResponseData getStationStore(@RequestBody JSONObject object , HttpServletRequest request ) {
try {
String ip = "";
// 有的user可能使用代理,为处理用户使用代理的情况,使用x-forwarded-for
if (request.getHeader("x-forwarded-for") == null) {
@ -82,10 +88,10 @@ public class RefuelOnlineController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR);
}
if (!apiIpAddressService.validationIpAddressLegal(object.getString("merchId") , ip)) {
log.error("getRechargeProduct error!", "非法ip地址,请联系管理人员!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!");
}
// if (!apiIpAddressService.validationIpAddressLegal(object.getString("merchId") , ip)) {
// log.error("getRechargeProduct error!", "非法ip地址,请联系管理人员!");
// throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!");
// }
ApiMerchants apiMerchants = apiMerchantsService.findByMchId(object.getString("merchId"));
@ -108,55 +114,64 @@ public class RefuelOnlineController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY);
}
Map<String, Object> mapProduct = new HashMap<>();
mapProduct.put("mchId" , object.getString("merchId"));
mapProduct.put("productType" , OrderProductType.PRODUCT_TYPE6.getNumber());
List<ApiMchStoreModel> apiMchStoreModels;
List<ApiMchProduct> apiMchProducts = apiMchProductService.getListMchProduct(mapProduct);
apiMchStoreModels = (List<ApiMchStoreModel>) redisUtil.get("stationStoreApi");
Map<String, Object> mapMerchant = new HashMap<>();;
Map<Long, BigDecimal> discountMap = new HashMap<>();
List<HighMerchantStore> merchantStores = new ArrayList<>();
if (apiMchStoreModels == null) {
apiMchStoreModels = new ArrayList<>();
Map<String, Object> mapProduct = new HashMap<>();
mapProduct.put("mchId" , object.getString("merchId"));
mapProduct.put("productType" , OrderProductType.PRODUCT_TYPE6.getNumber());
for (ApiMchProduct mchProduct : apiMchProducts) {
mapMerchant.put("merchantId" , mchProduct.getMerchantId());
discountMap.put(mchProduct.getMerchantId() , mchProduct.getDiscount());
merchantStores.addAll(highMerchantStoreService.getMerchantStoreList(mapMerchant));
}
List<ApiMchProduct> apiMchProducts = apiMchProductService.getListMchProduct(mapProduct);
Map<String, Object> mapMerchant = new HashMap<>();;
Map<Long, BigDecimal> discountMap = new HashMap<>();
List<HighMerchantStore> merchantStores = new ArrayList<>();
for (ApiMchProduct mchProduct : apiMchProducts) {
mapMerchant.put("merchantId" , mchProduct.getMerchantId());
discountMap.put(mchProduct.getMerchantId() , mchProduct.getDiscount());
merchantStores.addAll(highMerchantStoreService.getMerchantStoreList(mapMerchant));
}
List<ApiMchStoreModel> apiMchStoreModels = new ArrayList<>();
for (HighMerchantStore merchantStore : merchantStores) {
ApiMchStoreModel apiMchStoreModel = new ApiMchStoreModel();
apiMchStoreModel.setAddress(merchantStore.getAddress());
apiMchStoreModel.setStoreCode(merchantStore.getId().toString());
apiMchStoreModel.setLatitude(merchantStore.getLatitude());
apiMchStoreModel.setLongitude(merchantStore.getLongitude());
apiMchStoreModel.setStoreName(merchantStore.getStoreName());
apiMchStoreModel.setRegionName(merchantStore.getRegionName());
List<HighGasOilPrice> gasOilPrices = gasOilPriceService.getGasOilPriceByStore(merchantStore.getId());
for (HighMerchantStore merchantStore : merchantStores) {
ApiMchStoreModel apiMchStoreModel = new ApiMchStoreModel();
apiMchStoreModel.setAddress(merchantStore.getAddress());
apiMchStoreModel.setStoreCode(merchantStore.getId().toString());
apiMchStoreModel.setLatitude(merchantStore.getLatitude());
apiMchStoreModel.setLongitude(merchantStore.getLongitude());
apiMchStoreModel.setStoreName(merchantStore.getStoreName());
apiMchStoreModel.setRegionName(merchantStore.getRegionName());
List<HighGasOilPrice> gasOilPrices = gasOilPriceService.getGasOilPriceByStore(merchantStore.getId());
List<ApiGasOliPriceModel> list = new ArrayList<>();
for (HighGasOilPrice gasOilPrice : gasOilPrices) {
ApiGasOliPriceModel gasOliPriceModel = new ApiGasOliPriceModel();
gasOliPriceModel.setPriceCost(apiCommonConfig.computationPriceCost(discountMap.get(merchantStore.getMerchantId()), gasOilPrice.getPriceGun()));
gasOliPriceModel.setPriceGun(gasOilPrice.getPriceGun());
gasOliPriceModel.setPriceOfficial(gasOilPrice.getPriceOfficial());
gasOliPriceModel.setOilNo(gasOilPrice.getOilNo());
gasOliPriceModel.setOilNoName(gasOilPrice.getOilNoName());
gasOliPriceModel.setOilType(gasOilPrice.getOilType());
gasOliPriceModel.setOilTypeName(gasOilPrice.getOilTypeName());
gasOliPriceModel.setGasOliNo(apiCommonConfig.assemblyGasOilGunNo(gasOilPrice.getId()));
list.add(gasOliPriceModel);
List<ApiGasOliPriceModel> list = new ArrayList<>();
for (HighGasOilPrice gasOilPrice : gasOilPrices) {
ApiGasOliPriceModel gasOliPriceModel = new ApiGasOliPriceModel();
gasOliPriceModel.setPriceCost(apiCommonConfig.computationPriceCost(discountMap.get(merchantStore.getMerchantId()), gasOilPrice.getPriceGun()));
gasOliPriceModel.setPriceGun(gasOilPrice.getPriceGun());
gasOliPriceModel.setPriceOfficial(gasOilPrice.getPriceOfficial());
gasOliPriceModel.setOilNo(gasOilPrice.getOilNo());
gasOliPriceModel.setOilNoName(gasOilPrice.getOilNoName());
gasOliPriceModel.setOilType(gasOilPrice.getOilType());
gasOliPriceModel.setOilTypeName(gasOilPrice.getOilTypeName());
gasOliPriceModel.setGasOliNo(apiCommonConfig.assemblyGasOilGunNo(gasOilPrice.getId()));
list.add(gasOliPriceModel);
}
apiMchStoreModel.setApiGasOliPriceModels(list);
apiMchStoreModels.add(apiMchStoreModel);
}
apiMchStoreModel.setApiGasOliPriceModels(list);
apiMchStoreModels.add(apiMchStoreModel);
redisUtil.set("stationStoreApi", apiMchStoreModels);
}
return ResponseMsgUtil.success(apiMchStoreModels);
} catch (Exception e) {

@ -73,6 +73,9 @@ public class orderController {
public ResponseData createOrder(@RequestBody JSONObject object , HttpServletRequest request ) {
try {
System.out.println("请求订单内容======================================================");
System.out.println(object);
String ip;
// 有的user可能使用代理,为处理用户使用代理的情况,使用x-forwarded-for
if (request.getHeader("x-forwarded-for") == null) {

Loading…
Cancel
Save