袁野 4 weeks ago
parent 639b38f89b
commit f979a2f1cd
  1. 2
      hai-bweb/src/main/java/com/bweb/controller/HighTestController.java
  2. 6
      hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java
  3. 2
      hai-service/src/main/java/com/hai/order/model/ExportOrderMobileModel.java
  4. 15
      hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java
  5. 5
      hai-service/src/main/java/com/hai/service/HighGasService.java
  6. 107
      hai-service/src/main/java/com/hai/service/impl/HighGasServiceImpl.java
  7. 32
      hai-user/src/main/java/com/web/controller/WechatController.java
  8. 77
      v1/src/main/java/com/v1/controller/business/RefuelOnlineController.java

File diff suppressed because one or more lines are too long

@ -147,12 +147,12 @@ public class HighGasSchedule {
// } // }
// } // }
// } // }
/*
@Scheduled(cron = "5 0 0 * * ?") // 每日凌晨00:00:5执行一次 @Scheduled(cron = "5 0 0 * * ?") // 每日凌晨00:00:5执行一次
public void getJiaHaoYouAllStation() throws Exception { public void getJiaHaoYouAllStation() throws Exception {
// gasService.getJiaHaoYouAllStation(); gasService.getJiaHaoYouAllStation();
} }
*/
// @Scheduled(cron = "5 0 0 * * ?") // 每日凌晨00:00:5执行一次 // @Scheduled(cron = "5 0 0 * * ?") // 每日凌晨00:00:5执行一次
// public void getPayloAllStation() throws Exception { // public void getPayloAllStation() throws Exception {

@ -36,7 +36,6 @@ public class ExportOrderMobileModel {
@ExcelProperty("充值子订单号") @ExcelProperty("充值子订单号")
private String childOrderNo; private String childOrderNo;
@ColumnWidth(15) @ColumnWidth(15)
@ExcelProperty("充值平台") @ExcelProperty("充值平台")
private String rechargePlatform; private String rechargePlatform;
@ -61,7 +60,6 @@ public class ExportOrderMobileModel {
@ExcelProperty("订单状态") @ExcelProperty("订单状态")
private String orderStatus; private String orderStatus;
@ColumnWidth(15) @ColumnWidth(15)
@ExcelProperty("创建时间") @ExcelProperty("创建时间")
private Date createTime; private Date createTime;

@ -295,11 +295,7 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
} 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())) { } else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE21.getNumber())) {
etcTrain etcTrain(order);
(order);
} }
} }
} }
@ -490,14 +486,7 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
// 支付给千猪 // 支付给千猪
QianZhuConfig.payKfcOrder(channelOrderNo); QianZhuConfig.payKfcOrder(channelOrderNo);
// 推送订单记录
// HighGasOrderPush highGasOrderPush = new HighGasOrderPush();
// highGasOrderPush.setType(OrderPushType.type3.getType());
// highGasOrderPush.setOrderNo(order.getOrderNo());
// highGasOrderPush.setCreateTime(new Date());
// highGasOrderPush.setRequestContent(order.getOrderNo());
// highGasOrderPush.setReturnContent(object.toJSONString());
// highGasOrderPushMapper.insert(highGasOrderPush);
} }
/** /**

@ -26,6 +26,11 @@ public interface HighGasService {
* 获取渠道商点点网络全量加油站 * 获取渠道商点点网络全量加油站
*/ */
void getDianAllStation() throws Exception; void getDianAllStation() throws Exception;
/**
* 团油
* 获取团游全量加油站
*/
void getGasInfoList() throws Exception;
/** /**
* *

@ -473,6 +473,113 @@ public class HighGasServiceImpl implements HighGasService {
@Override @Override
public void getDianAllStation() throws Exception { public void getDianAllStation() throws Exception {
HighMerchantModel merchant = highMerchantService.getMerchantById(39L);
JSONObject jsonObject = DianConfig.getGasInfoAll();
JSONArray resultObject = jsonObject.getObject("result", JSONArray.class);
for (int i = 0; i < resultObject.size();i++) {
Object objectData = resultObject.get(i);
JSONObject object = JSONObject.parseObject(JSONObject.toJSONString(objectData));
HighMerchantStore highMerchantStore;
HighGasOilPrice highGasOilPrice;
HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreByKey(object.getString("jyzid"));
SecRegion region = commonService.getRegionsByName(object.getString("province"));
if (store != null) {
store.setType(1);
store.setSourceType(6);
store.setMerchantId(merchant.getId());
store.setCompanyId(merchant.getCompanyId());
store.setStoreKey(object.getString("jyzid"));
store.setStoreName(object.getString("mingcheng"));
store.setStoreLogo(object.getString("tupian"));
store.setRegionId(region.getRegionId());
store.setRegionName(object.getString("province"));
store.setAddress(object.getString("dizhi"));
store.setLongitude(object.getString("lng"));
store.setLatitude(object.getString("lat"));
store.setStatus(object.getInteger("zhuangtai"));
store.setPrestoreType(0);
store.setOperatorId(0L);
store.setOperatorName("系统创建");
store.setUpdateTime(new Date());
store.setExt1(object.getString("gasSourceId"));
highMerchantStoreService.updateMerchantStoreDetail(store);
JSONArray oilPriceList = object.getJSONArray("oilPriceList");
for (Object oilPrice : oilPriceList) {
JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice));
// 查询门店油号
highGasOilPrice = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(store.getId(), oilPriceObject.getString("youhao"));
if (highGasOilPrice == null) {
highGasOilPrice = new HighGasOilPrice();
highGasOilPrice.setMerchantStoreId(store.getId());
highGasOilPrice.setOilNo(oilPriceObject.getString("youhao"));
highGasOilPrice.setOilNoName(oilPriceObject.getString("youhao") + "#");
highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip"));
highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun"));
highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceGun"));
highGasOilPrice.setOilType(oilPriceObject.getInteger("oiltype"));
highGasOilPrice.setOilTypeName(oilPriceObject.getString("oiltype").equals("1") ? "汽油": "柴油");
highGasOilPrice.setStatus(GasOilPriceStatusEnum.status1.getStatus());
} else {
highGasOilPrice.setMerchantStoreId(store.getId());
highGasOilPrice.setOilNo(oilPriceObject.getString("youhao"));
highGasOilPrice.setOilNoName( oilPriceObject.getString("youhao") + "#");
highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip"));
highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun"));
highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceGun"));
highGasOilPrice.setOilType(oilPriceObject.getInteger("oiltype"));
highGasOilPrice.setOilTypeName(oilPriceObject.getString("oiltype").equals("1") ? "汽油": "柴油");
}
highGasOilPriceService.editGasOilPrice(highGasOilPrice);
}
} else {
highMerchantStore = new HighMerchantStore();
highMerchantStore.setType(1);
highMerchantStore.setSourceType(6);
highMerchantStore.setMerchantId(merchant.getId());
highMerchantStore.setCompanyId(merchant.getCompanyId());
highMerchantStore.setStoreKey(object.getString("jyzid"));
highMerchantStore.setStoreName(object.getString("mingcheng"));
highMerchantStore.setStoreLogo(object.getString("tupian"));
highMerchantStore.setRegionId(region.getRegionId());
highMerchantStore.setRegionName(object.getString("province"));
highMerchantStore.setAddress(object.getString("dizhi"));
highMerchantStore.setLongitude(object.getString("lng"));
highMerchantStore.setLatitude(object.getString("lat"));
highMerchantStore.setStatus(1);
highMerchantStore.setPrestoreType(0);
highMerchantStore.setOperatorId(0L);
highMerchantStore.setOperatorName("系统创建");
highMerchantStore.setCreateTime(new Date());
highMerchantStore.setUpdateTime(new Date());
highMerchantStore.setExt1(object.getString("gasSourceId"));
HighMerchantStoreModel merchantStoreModel = new HighMerchantStoreModel();
BeanUtils.copyProperties(highMerchantStore, merchantStoreModel);
highMerchantStoreService.insertMerchantStore(merchantStoreModel);
JSONArray oilPriceList = object.getJSONArray("oilPriceList");
for (Object oilPrice : oilPriceList) {
JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice));
highGasOilPrice = new HighGasOilPrice();
highGasOilPrice.setMerchantStoreId(merchantStoreModel.getId());
highGasOilPrice.setOilNo(oilPriceObject.getString("youhao"));
highGasOilPrice.setOilNoName(oilPriceObject.getString("youhao") + "#");
highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip"));
highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun"));
highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceGun"));
highGasOilPrice.setOilType(oilPriceObject.getInteger("oiltype"));
highGasOilPrice.setOilTypeName(oilPriceObject.getString("oiltype").equals("1") ? "汽油": "柴油");
highGasOilPriceService.editGasOilPrice(highGasOilPrice);
}
}
}
}
@Override
public void getGasInfoList() throws Exception {
HighMerchantModel merchant = highMerchantService.getMerchantById(39L); HighMerchantModel merchant = highMerchantService.getMerchantById(39L);
if (merchant == null) { if (merchant == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户");

@ -1,19 +1,20 @@
package com.web.controller; package com.web.controller;
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.*; import com.hai.common.utils.*;
import com.hai.enum_type.LoginPlatform; import com.hai.enum_type.LoginPlatform;
import com.hai.enum_type.RedisFileFolder;
import com.hai.model.ResponseData; import com.hai.model.ResponseData;
import com.hai.service.HighUserService; import com.hai.service.HighUserService;
import com.web.type.LoginType;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@ -68,4 +69,27 @@ public class WechatController {
} }
} }
@RequestMapping(value = "/phone", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "【H5】手机号登录")
public ResponseData phone(
@RequestParam(value = "phone", required = false) String phone ,
HttpServletRequest request, HttpServletResponse response) {
try {
// 客户端
LoginPlatform platform = LoginPlatform.getDataByType("H5");
if (platform == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知客户端");
}
return ResponseMsgUtil.success(userService.loginAndRegister(platform, phone, null , null, request, response));
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
} }

@ -116,59 +116,54 @@ public class RefuelOnlineController {
List<ApiMchStoreModel> apiMchStoreModels; List<ApiMchStoreModel> apiMchStoreModels;
apiMchStoreModels = (List<ApiMchStoreModel>) redisUtil.get("stationStoreApi"); apiMchStoreModels = new ArrayList<>();
Map<String, Object> mapProduct = new HashMap<>();
mapProduct.put("mchId" , object.getString("merchId"));
mapProduct.put("productType" , OrderProductType.PRODUCT_TYPE6.getNumber());
if (apiMchStoreModels == null) { List<ApiMchProduct> apiMchProducts = apiMchProductService.getListMchProduct(mapProduct);
apiMchStoreModels = new ArrayList<>();
Map<String, Object> mapProduct = new HashMap<>();
mapProduct.put("mchId" , object.getString("merchId"));
mapProduct.put("productType" , OrderProductType.PRODUCT_TYPE6.getNumber());
List<ApiMchProduct> apiMchProducts = apiMchProductService.getListMchProduct(mapProduct); Map<String, Object> mapMerchant = new HashMap<>();;
Map<Long, BigDecimal> discountMap = new HashMap<>();
List<HighMerchantStore> merchantStores = new ArrayList<>();
Map<String, Object> mapMerchant = new HashMap<>();; for (ApiMchProduct mchProduct : apiMchProducts) {
Map<Long, BigDecimal> discountMap = new HashMap<>(); mapMerchant.put("merchantId" , mchProduct.getMerchantId());
List<HighMerchantStore> merchantStores = new ArrayList<>(); discountMap.put(mchProduct.getMerchantId() , mchProduct.getDiscount());
merchantStores.addAll(highMerchantStoreService.getMerchantStoreList(mapMerchant));
for (ApiMchProduct mchProduct : apiMchProducts) { }
mapMerchant.put("merchantId" , mchProduct.getMerchantId());
discountMap.put(mchProduct.getMerchantId() , mchProduct.getDiscount());
merchantStores.addAll(highMerchantStoreService.getMerchantStoreList(mapMerchant));
}
for (HighMerchantStore merchantStore : merchantStores) { for (HighMerchantStore merchantStore : merchantStores) {
ApiMchStoreModel apiMchStoreModel = new ApiMchStoreModel(); ApiMchStoreModel apiMchStoreModel = new ApiMchStoreModel();
apiMchStoreModel.setAddress(merchantStore.getAddress()); apiMchStoreModel.setAddress(merchantStore.getAddress());
apiMchStoreModel.setStoreCode(merchantStore.getId().toString()); apiMchStoreModel.setStoreCode(merchantStore.getId().toString());
apiMchStoreModel.setLatitude(merchantStore.getLatitude()); apiMchStoreModel.setLatitude(merchantStore.getLatitude());
apiMchStoreModel.setLongitude(merchantStore.getLongitude()); apiMchStoreModel.setLongitude(merchantStore.getLongitude());
apiMchStoreModel.setStoreName(merchantStore.getStoreName()); apiMchStoreModel.setStoreName(merchantStore.getStoreName());
apiMchStoreModel.setRegionName(merchantStore.getRegionName()); apiMchStoreModel.setRegionName(merchantStore.getRegionName());
List<HighGasOilPrice> gasOilPrices = gasOilPriceService.getGasOilPriceByStore(merchantStore.getId()); List<HighGasOilPrice> gasOilPrices = gasOilPriceService.getGasOilPriceByStore(merchantStore.getId());
List<ApiGasOliPriceModel> list = new ArrayList<>(); List<ApiGasOliPriceModel> list = new ArrayList<>();
for (HighGasOilPrice gasOilPrice : gasOilPrices) { for (HighGasOilPrice gasOilPrice : gasOilPrices) {
ApiGasOliPriceModel gasOliPriceModel = new ApiGasOliPriceModel(); ApiGasOliPriceModel gasOliPriceModel = new ApiGasOliPriceModel();
gasOliPriceModel.setPriceCost(apiCommonConfig.computationPriceCost(discountMap.get(merchantStore.getMerchantId()), gasOilPrice.getPriceGun())); gasOliPriceModel.setPriceCost(apiCommonConfig.computationPriceCost(discountMap.get(merchantStore.getMerchantId()), gasOilPrice.getPriceGun()));
gasOliPriceModel.setPriceGun(gasOilPrice.getPriceGun()); gasOliPriceModel.setPriceGun(gasOilPrice.getPriceGun());
gasOliPriceModel.setPriceOfficial(gasOilPrice.getPriceOfficial()); gasOliPriceModel.setPriceOfficial(gasOilPrice.getPriceOfficial());
gasOliPriceModel.setOilNo(gasOilPrice.getOilNo()); gasOliPriceModel.setOilNo(gasOilPrice.getOilNo());
gasOliPriceModel.setOilNoName(gasOilPrice.getOilNoName()); gasOliPriceModel.setOilNoName(gasOilPrice.getOilNoName());
gasOliPriceModel.setOilType(gasOilPrice.getOilType()); gasOliPriceModel.setOilType(gasOilPrice.getOilType());
gasOliPriceModel.setOilTypeName(gasOilPrice.getOilTypeName()); gasOliPriceModel.setOilTypeName(gasOilPrice.getOilTypeName());
gasOliPriceModel.setGasOliNo(apiCommonConfig.assemblyGasOilGunNo(gasOilPrice.getId())); gasOliPriceModel.setGasOliNo(apiCommonConfig.assemblyGasOilGunNo(gasOilPrice.getId()));
list.add(gasOliPriceModel); list.add(gasOliPriceModel);
}
apiMchStoreModel.setApiGasOliPriceModels(list);
apiMchStoreModels.add(apiMchStoreModel);
} }
redisUtil.set("stationStoreApi", apiMchStoreModels); apiMchStoreModel.setApiGasOliPriceModels(list);
apiMchStoreModels.add(apiMchStoreModel);
} }

Loading…
Cancel
Save