袁野 1 year ago
parent 38dd67f618
commit 95f98b2a21
  1. 2
      hai-bweb/src/main/java/com/bweb/controller/HighTestController.java
  2. 1
      hai-cweb/src/main/java/com/cweb/controller/CmsContentController.java
  3. 98
      hai-cweb/src/main/java/com/cweb/controller/HighGasController.java
  4. 12
      hai-order/src/main/java/com/web/controller/OrderPayController.java
  5. 250
      hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java
  6. 4
      hai-service/src/main/java/com/hai/config/CommonSysConfig.java
  7. 149
      hai-service/src/main/java/com/hai/config/DianConfig.java
  8. 2
      hai-service/src/main/java/com/hai/entity/HighGasChannelConfig.java
  9. 1
      hai-service/src/main/java/com/hai/enum_type/GasChannel.java
  10. 1
      hai-service/src/main/java/com/hai/enum_type/MerchantStoreSourceType.java
  11. 6
      hai-service/src/main/java/com/hai/order/service/impl/OrderPayBeforeServiceImpl.java
  12. 11
      hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java
  13. 6
      hai-service/src/main/java/com/hai/pay/channel/huipay/config/HuiConfig.java
  14. 6
      hai-service/src/main/java/com/hai/service/HighGasService.java
  15. 68
      hai-service/src/main/java/com/hai/service/impl/HighGasDiscountOilPriceServiceImpl.java
  16. 115
      hai-service/src/main/java/com/hai/service/impl/HighGasServiceImpl.java
  17. 5
      hai-service/src/main/resources/dev/commonConfig.properties
  18. 6
      hai-service/src/main/resources/prod-9401/commonConfig.properties
  19. 6
      hai-service/src/main/resources/prod/commonConfig.properties

File diff suppressed because one or more lines are too long

@ -67,7 +67,6 @@ public class CmsContentController {
SessionObject sessionObject = userCenter.getSessionObjectByCms(request); SessionObject sessionObject = userCenter.getSessionObjectByCms(request);
HighUserModel userInfoModel = new HighUserModel(); HighUserModel userInfoModel = new HighUserModel();
System.out.println("sessionObject============" + sessionObject);
if (sessionObject != null) { if (sessionObject != null) {
// 用户 // 用户

@ -11,6 +11,7 @@ import com.hai.common.utils.CoordCommonUtil;
import com.hai.common.utils.PageUtil; import com.hai.common.utils.PageUtil;
import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.CommonSysConst; import com.hai.config.CommonSysConst;
import com.hai.config.DianConfig;
import com.hai.config.TuanYouConfig; import com.hai.config.TuanYouConfig;
import com.hai.dao.HighGasOrderPushMapper; import com.hai.dao.HighGasOrderPushMapper;
import com.hai.entity.*; import com.hai.entity.*;
@ -169,7 +170,7 @@ public class HighGasController {
} }
} }
} else if (MapUtils.getInteger(map, "source_type").equals(2)) { } else if (MapUtils.getInteger(map, "source_type").equals(2)|| MapUtils.getInteger(map, "source_type").equals(6)) {
// 查询是否配置了【油站的】优惠比例 // 查询是否配置了【油站的】优惠比例
HighTyAgentPrice tyAgentPrice = tyAgentPriceService.getDetail(1, MapUtils.getLong(map, "id"), MapUtils.getString(map, "oil_no")); HighTyAgentPrice tyAgentPrice = tyAgentPriceService.getDetail(1, MapUtils.getLong(map, "id"), MapUtils.getString(map, "oil_no"));
if (tyAgentPrice != null) { if (tyAgentPrice != null) {
@ -452,6 +453,101 @@ public class HighGasController {
return ResponseMsgUtil.success(jsonObject.get("result")); return ResponseMsgUtil.success(jsonObject.get("result"));
} }
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, jsonObject.getString("message")); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, jsonObject.getString("message"));
} else if (store.getSourceType().equals(MerchantStoreSourceType.type6.getNumber())) {
JSONObject jsonObject = DianConfig.getGasInfoByGasId(storeKey);
if (jsonObject != null && jsonObject.getString("code").equals("200")) {
JSONArray object = jsonObject.getJSONArray("result");
JSONObject data = JSONObject.parseObject(JSONObject.toJSONString(object.get(0)));
JSONObject result = new JSONObject();
result.put("gasLogoSmall" , data.getString("tupian"));
result.put("gasAddress" , data.getString("dizhi"));
result.put("gasName" , data.getString("mingcheng"));
result.put("gasAddress" , data.getString("dizhi"));
result.put("goodsId", store.getId());
result.put("gasId", data.getString("jyzid"));
result.put("gasAddressLatitude", data.getString("lat"));
result.put("gasAddressLongitude", data.getString("lng"));
// 原始油品价格
JSONArray originalOilPriceList = data.getJSONArray("oilPriceList");
JSONArray gasGunList = data.getJSONArray("gasGunList");
// 新油品价格
JSONArray newOilPriceList = new JSONArray();
JSONArray newGunList = new JSONArray();
for (Object gunObject: gasGunList) {
JSONObject gun = JSON.parseObject(JSONObject.toJSONString(gunObject), JSONObject.class);
gun.put("gunNo" , gun.getString("youqiang"));
gun.put("oilNo" , gun.getString("youhao"));
gun.put("oilNoName" , gun.getString("youhao") + "#");
newGunList.add(gun);
}
// 处理油品价格
for (Object oilPriceObject : originalOilPriceList) {
JSONObject price = JSON.parseObject(JSONObject.toJSONString(oilPriceObject), JSONObject.class);
price.put("oilTypeName" , price.getString("oiltype").equals("1") ? "汽油": "柴油");
price.put("oilNoName" , price.getString("youhao") + "#");
price.put("priceOfficial" , price.getString("priceGun"));
price.put("oilNo" , price.getString("youhao"));
price.put("oilType" , price.getString("oiltype"));
// 查询油站油品状态
HighGasOilPrice oilNo = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(store.getId(), price.getString("youhao"));
if (oilNo != null && !oilNo.getStatus().equals(GasOilPriceStatusEnum.status1.getStatus())) {
continue;
}
// 查询是否配置了【油站的】优惠比例
HighTyAgentPrice tyAgentPrice = tyAgentPriceService.getDetail(1, store.getId(), price.getString("youhao"));
if (tyAgentPrice != null) {
// 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = tyAgentPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
// 油品国标价 * 最终优惠比例
price.put("priceVip", price.getBigDecimal("priceGun").multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
} else {
// 查询是否配置了【油品】优惠比例
HighGasDiscountOilPrice gasDiscountOilPrice = gasDiscountOilPriceService.getDetailByOilNo(price.getString("youhao"));
if (gasDiscountOilPrice != null) {
// 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = gasDiscountOilPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
// 油品国标价 * 最终优惠比例
price.put("priceVip", price.getBigDecimal("priceGun").multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
}
}
// 查询是否配置了【代理商油站】优惠比例
if (isTyAgent != null && isTyAgent == true) {
HighTyAgentPrice agentPrice = tyAgentPriceService.getDetail(2, store.getId(), price.getString("youhao"));
if (agentPrice != null) {
// 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = agentPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
// 油品国标价 * 最终优惠比例
price.put("priceVip", price.getBigDecimal("priceGun").multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
}
}
newOilPriceList.add(price);
}
result.put("oilPriceList" , newOilPriceList);
result.put("gasGunList" , newGunList);
if (StringUtils.isNotBlank(longitude) && StringUtils.isNotBlank(latitude)) {
// 距离
double distance = CoordCommonUtil.getDistance(Double.valueOf(result.get("gasAddressLatitude").toString()), Double.valueOf(result.get("gasAddressLongitude").toString()), Double.valueOf(latitude), Double.valueOf(longitude));
result.put("distance", Math.round(distance/100d)/10d);
} else {
result.put("distance", null);
}
return ResponseMsgUtil.success(result);
}
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, jsonObject.getString("message"));
} }
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到加油站"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到加油站");

@ -281,6 +281,16 @@ public class OrderPayController {
weChatPayReqInfo.setSub_mch_id(gasChannelConfig.getPayPlatformMerNo()); weChatPayReqInfo.setSub_mch_id(gasChannelConfig.getPayPlatformMerNo());
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N"; profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N";
} else if (store.getSourceType().equals(MerchantStoreSourceType.type6.getNumber())) {
// 查询支付配置
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type2, GasChannelPayPlatformType.type1);
if (gasChannelConfig == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
}
weChatPayReqInfo.setSub_mch_id(gasChannelConfig.getPayPlatformMerNo());
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N";
} else { } else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
} }
@ -325,8 +335,6 @@ public class OrderPayController {
payMap.put("api_key", SysConst.getSysConfig().getWxPayApiKey()); payMap.put("api_key", SysConst.getSysConfig().getWxPayApiKey());
payMap.put("unified_order_url", SysConst.getSysConfig().getWxPayUnifiedOrderUrl()); payMap.put("unified_order_url", SysConst.getSysConfig().getWxPayUnifiedOrderUrl());
sortedMap = wechatPayUtil.goWechatPay(weChatPayReqInfo, payMap); sortedMap = wechatPayUtil.goWechatPay(weChatPayReqInfo, payMap);
order.setAccountMerchantNum(weChatPayReqInfo.getSub_mch_id()); order.setAccountMerchantNum(weChatPayReqInfo.getSub_mch_id());

@ -5,10 +5,8 @@ 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.config.PayloService;
import com.hai.config.TuanYouConfig; import com.hai.config.TuanYouConfig;
import com.hai.entity.HighGasOilPrice; import com.hai.entity.HighGasOilPrice;
import com.hai.entity.HighGasOilPriceOfficial;
import com.hai.entity.HighMerchantStore; import com.hai.entity.HighMerchantStore;
import com.hai.enum_type.GasOilPriceStatusEnum; import com.hai.enum_type.GasOilPriceStatusEnum;
import com.hai.model.HighMerchantModel; import com.hai.model.HighMerchantModel;
@ -39,137 +37,131 @@ public class HighGasSchedule {
@Resource @Resource
private HighGasService gasService; private HighGasService gasService;
@Scheduled(cron = "0 0 1 * * ?") //每日凌晨1点执行一次
public void certification() throws Exception {
HighMerchantModel merchant = highMerchantService.getMerchantById(39L);
if (merchant == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户");
}
JSONObject jsonObjectP = TuanYouConfig.queryGasInfoListByPage(1, 1000);
JSONObject resultObjectP = jsonObjectP.getObject("result", JSONObject.class);
for (int i = 1; i <= resultObjectP.getInteger("totalPageNum").intValue();i++) { // @Scheduled(cron = "0 0 1 * * ?") //每日凌晨1点执行一次
JSONObject jsonObject = TuanYouConfig.queryGasInfoListByPage(i, 1000); // public void certification() throws Exception {
JSONObject resultObject = jsonObject.getObject("result", JSONObject.class); // HighMerchantModel merchant = highMerchantService.getMerchantById(63L);
JSONArray jsonArray = resultObject.getJSONArray("gasInfoList"); // if (merchant == null) {
HighMerchantStore highMerchantStore; // throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户");
HighGasOilPrice highGasOilPrice; // }
for (Object gasObject : jsonArray) { // JSONObject jsonObjectP = TuanYouConfig.queryGasInfoListByPage(1, 1000);
JSONObject object = JSONObject.parseObject(JSONObject.toJSONString(gasObject)); // JSONObject resultObjectP = jsonObjectP.getObject("result", JSONObject.class);
HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreByKey(object.getString("gasId")); //
if (store != null) { // for (int i = 1; i <= resultObjectP.getInteger("totalPageNum").intValue();i++) {
store.setType(1); // JSONObject jsonObject = TuanYouConfig.queryGasInfoListByPage(i, 1000);
store.setSourceType(2); // JSONObject resultObject = jsonObject.getObject("result", JSONObject.class);
store.setMerchantId(merchant.getId()); // JSONArray jsonArray = resultObject.getJSONArray("gasInfoList");
store.setCompanyId(merchant.getCompanyId()); // HighMerchantStore highMerchantStore;
store.setStoreKey(object.getString("gasId")); // HighGasOilPrice highGasOilPrice;
store.setStoreName(object.getString("gasName")); // for (Object gasObject : jsonArray) {
store.setStoreLogo(object.getString("gasLogoSmall")); // JSONObject object = JSONObject.parseObject(JSONObject.toJSONString(gasObject));
store.setRegionId(object.getLong("provinceCode")); // HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreByKey(object.getString("gasId"));
store.setRegionName(object.getString("provinceName")); // if (store != null) {
store.setAddress(object.getString("gasAddress")); // store.setType(1);
store.setLongitude(object.getString("gasAddressLongitude")); // store.setSourceType(2);
store.setLatitude(object.getString("gasAddressLatitude")); // store.setMerchantId(merchant.getId());
store.setStatus(object.getInteger("gasStatus")); // store.setCompanyId(merchant.getCompanyId());
store.setPrestoreType(0); // store.setStoreKey(object.getString("gasId"));
store.setOperatorId(0L); // store.setStoreName(object.getString("gasName"));
store.setOperatorName("系统创建"); // store.setStoreLogo(object.getString("gasLogoSmall"));
store.setUpdateTime(new Date()); // store.setRegionId(object.getLong("provinceCode"));
store.setExt1(object.getString("gasSourceId")); // store.setRegionName(object.getString("provinceName"));
highMerchantStoreService.updateMerchantStoreDetail(store); // store.setAddress(object.getString("gasAddress"));
// store.setLongitude(object.getString("gasAddressLongitude"));
JSONArray oilPriceList = object.getJSONArray("oilPriceList"); // store.setLatitude(object.getString("gasAddressLatitude"));
for (Object oilPrice : oilPriceList) { // store.setStatus(object.getInteger("gasStatus"));
JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); // store.setPrestoreType(0);
// 查询门店油号 // store.setOperatorId(0L);
highGasOilPrice = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(store.getId(), oilPriceObject.getString("oilNo")); // store.setOperatorName("系统创建");
if (highGasOilPrice == null) { // store.setUpdateTime(new Date());
highGasOilPrice = new HighGasOilPrice(); // store.setExt1(object.getString("gasSourceId"));
highGasOilPrice.setMerchantStoreId(store.getId()); // highMerchantStoreService.updateMerchantStoreDetail(store);
highGasOilPrice.setOilNo(oilPriceObject.getString("oilNo")); //
highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); // JSONArray oilPriceList = object.getJSONArray("oilPriceList");
highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); // for (Object oilPrice : oilPriceList) {
highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); // JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice));
highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); // // 查询门店油号
highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); // highGasOilPrice = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(store.getId(), oilPriceObject.getString("oilNo"));
highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); // if (highGasOilPrice == null) {
highGasOilPrice.setStatus(GasOilPriceStatusEnum.status1.getStatus()); // highGasOilPrice = new HighGasOilPrice();
} else { // highGasOilPrice.setMerchantStoreId(store.getId());
highGasOilPrice.setMerchantStoreId(store.getId()); // highGasOilPrice.setOilNo(oilPriceObject.getString("oilNo"));
highGasOilPrice.setOilNo(oilPriceObject.getString("oilNo")); // highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName"));
highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); // highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip"));
highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); // highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun"));
highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); // highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial"));
highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); // highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType"));
highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); // highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName"));
highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); // highGasOilPrice.setStatus(GasOilPriceStatusEnum.status1.getStatus());
} // } else {
highGasOilPriceService.editGasOilPrice(highGasOilPrice); // highGasOilPrice.setMerchantStoreId(store.getId());
} // highGasOilPrice.setOilNo(oilPriceObject.getString("oilNo"));
} else { // highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName"));
highMerchantStore = new HighMerchantStore(); // highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip"));
highMerchantStore.setType(1); // highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun"));
highMerchantStore.setSourceType(2); // highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial"));
highMerchantStore.setMerchantId(merchant.getId()); // highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType"));
highMerchantStore.setCompanyId(merchant.getCompanyId()); // highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName"));
highMerchantStore.setStoreKey(object.getString("gasId")); // }
highMerchantStore.setStoreName(object.getString("gasName")); // highGasOilPriceService.editGasOilPrice(highGasOilPrice);
highMerchantStore.setStoreLogo(object.getString("gasLogoSmall")); // }
highMerchantStore.setRegionId(object.getLong("provinceCode")); // } else {
highMerchantStore.setRegionName(object.getString("provinceName")); // highMerchantStore = new HighMerchantStore();
highMerchantStore.setAddress(object.getString("gasAddress")); // highMerchantStore.setType(1);
highMerchantStore.setLongitude(object.getString("gasAddressLongitude")); // highMerchantStore.setSourceType(2);
highMerchantStore.setLatitude(object.getString("gasAddressLatitude")); // highMerchantStore.setMerchantId(merchant.getId());
highMerchantStore.setStatus(1); // highMerchantStore.setCompanyId(merchant.getCompanyId());
highMerchantStore.setPrestoreType(0); // highMerchantStore.setStoreKey(object.getString("jyzid"));
highMerchantStore.setOperatorId(0L); // highMerchantStore.setStoreName(object.getString("mingcheng"));
highMerchantStore.setOperatorName("系统创建"); // highMerchantStore.setStoreLogo(object.getString("tupian"));
highMerchantStore.setCreateTime(new Date()); // highMerchantStore.setRegionName(object.getString("province"));
highMerchantStore.setUpdateTime(new Date()); // highMerchantStore.setAddress(object.getString("dizhi"));
highMerchantStore.setExt1(object.getString("gasSourceId")); // highMerchantStore.setLongitude(object.getString("gasAddressLongitude"));
HighMerchantStoreModel merchantStoreModel = new HighMerchantStoreModel(); // highMerchantStore.setLatitude(object.getString("gasAddressLatitude"));
BeanUtils.copyProperties(highMerchantStore, merchantStoreModel); // highMerchantStore.setStatus(1);
highMerchantStoreService.insertMerchantStore(merchantStoreModel); // highMerchantStore.setPrestoreType(0);
// highMerchantStore.setOperatorId(0L);
JSONArray oilPriceList = object.getJSONArray("oilPriceList"); // highMerchantStore.setOperatorName("系统创建");
for (Object oilPrice : oilPriceList) { // highMerchantStore.setCreateTime(new Date());
JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); // highMerchantStore.setUpdateTime(new Date());
highGasOilPrice = new HighGasOilPrice(); // highMerchantStore.setExt1(object.getString("gasSourceId"));
highGasOilPrice.setMerchantStoreId(merchantStoreModel.getId()); // HighMerchantStoreModel merchantStoreModel = new HighMerchantStoreModel();
highGasOilPrice.setOilNo(oilPriceObject.getString("oilNo")); // BeanUtils.copyProperties(highMerchantStore, merchantStoreModel);
highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); // highMerchantStoreService.insertMerchantStore(merchantStoreModel);
highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); //
highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); // JSONArray oilPriceList = object.getJSONArray("oilPriceList");
highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); // for (Object oilPrice : oilPriceList) {
highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); // JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice));
highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); // highGasOilPrice = new HighGasOilPrice();
highGasOilPriceService.editGasOilPrice(highGasOilPrice); // highGasOilPrice.setMerchantStoreId(merchantStoreModel.getId());
} // highGasOilPrice.setOilNo(oilPriceObject.getString("oilNo"));
} // highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName"));
} // highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip"));
} // highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun"));
} // highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial"));
// highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType"));
@Scheduled(cron = "5 0 0 * * ?") // 每日凌晨00:00:5执行一次 // highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName"));
public void getJiaHaoYouAllStation() throws Exception { // highGasOilPriceService.editGasOilPrice(highGasOilPrice);
gasService.getJiaHaoYouAllStation(); // }
} // }
// }
// }
// }
// @Scheduled(cron = "5 0 0 * * ?") // 每日凌晨00:00:5执行一次
// public void getJiaHaoYouAllStation() throws Exception {
// gasService.getJiaHaoYouAllStation();
// }
// @Scheduled(cron = "5 0 0 * * ?") // 每日凌晨00:00:5执行一次
// public void getPayloAllStation() throws Exception {
// gasService.getPayloAllStation();
// }
@Scheduled(cron = "5 0 0 * * ?") // 每日凌晨00:00:5执行一次 @Scheduled(cron = "5 0 0 * * ?") // 每日凌晨00:00:5执行一次
public void getPayloAllStation() throws Exception { public void getDianAllStation() throws Exception {
gasService.getPayloAllStation(); gasService.getDianAllStation();
} }
/* @Scheduled(cron = "0 1 0 * * ?") //每日凌晨12点01分执行一次
public void getJinZhuAllStation() throws Exception {
gasService.getJinZhuAllStation();
}*/
/* @Scheduled(cron = "0 30 7 * * ?") //每日7点1分执行一次
public void refreshPriceOfficial() throws Exception {
gasOilPriceOfficialService.refreshPriceOfficial();
gasOilPriceOfficialService.refreshGasPriceOfficial(null, null);
}*/
} }

@ -138,4 +138,8 @@ public class CommonSysConfig {
private String blxPostUrl; private String blxPostUrl;
private String diandianwPostUrl;
private String diandianwAppid;
private String diandianwAppSecret;
} }

@ -0,0 +1,149 @@
package com.hai.config;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.utils.HttpsUtils;
import com.hai.common.utils.MD5Util;
import org.apache.commons.codec.binary.Base64;
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.spec.SecretKeySpec;
import java.nio.charset.StandardCharsets;
import java.security.SecureRandom;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
public class DianConfig {
private static final String ALGORITHMS = "AES/ECB/PKCS5Padding";
/**
* 静态常量
*/
private static final String AES = "AES";
/**
* @Author Sum1Dream
* @Name getGasInfoAll
* @Description // 获取(全量)油站信息
* @Date 14:47 2023/10/11
* @return com.alibaba.fastjson.JSONObject
*/
public static JSONObject getGasInfoAll() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("jyzid" , "ALL");
JSONObject paramMap = new JSONObject();
paramMap.put("appid", CommonSysConst.getSysConfig().getDiandianwAppid());
paramMap.put("postInfo", aesEncrypt(jsonObject.toJSONString() , CommonSysConst.getSysConfig().getDiandianwAppSecret()));
return HttpsUtils.doGet(CommonSysConst.getSysConfig().getDiandianwPostUrl()+"/otherUnit/Interface_getJyzInfoAll.html" , paramMap);
}
/**
* @Author Sum1Dream
* @Name getGasInfoByGasId
* @Description // 根据油站 id 拉取最新的油站数据
* @Date 16:40 2023/10/11
* @Param gasId
* @return com.alibaba.fastjson.JSONObject
*/
public static JSONObject getGasInfoByGasId(String gasId) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("jyzid" , gasId);
JSONObject paramMap = new JSONObject();
paramMap.put("appid", CommonSysConst.getSysConfig().getDiandianwAppid());
paramMap.put("postInfo", aesEncrypt(jsonObject.toJSONString() , CommonSysConst.getSysConfig().getDiandianwAppSecret()));
return HttpsUtils.doGet(CommonSysConst.getSysConfig().getDiandianwPostUrl()+"otherUnit/Interface_getJyzInfoById.html" , paramMap);
}
/**
* @Author Sum1Dream
* @Name refuelingOrderPush
* @Description // 推送订单
* @Date 15:29 2023/10/12
* @Param object
* @return com.alibaba.fastjson.JSONObject
*/
public static JSONObject refuelingOrderPush(JSONObject object) {
JSONObject paramMap = new JSONObject();
paramMap.put("appid", CommonSysConst.getSysConfig().getDiandianwAppid());
paramMap.put("postInfo", aesEncrypt(object.toJSONString() , CommonSysConst.getSysConfig().getDiandianwAppSecret()));
return HttpsUtils.doGet(CommonSysConst.getSysConfig().getDiandianwPostUrl()+"otherUnit/Interface_nl_orderPush.html" , paramMap);
}
/**
* @Author Sum1Dream
* @Name queryCompanyPriceDetail
* @Description //
* @Date 16:28 2023/10/12
* @Param gasId
* @Param oilNo
* @return com.alibaba.fastjson.JSONObject
*/
public static JSONObject queryCompanyPriceDetail(String gasId , String oilNo) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("jyzid" , gasId);
jsonObject.put("youhao" , oilNo);
JSONObject paramMap = new JSONObject();
paramMap.put("appid", CommonSysConst.getSysConfig().getDiandianwAppid());
paramMap.put("postInfo", aesEncrypt(jsonObject.toJSONString() , CommonSysConst.getSysConfig().getDiandianwAppSecret()));
return HttpsUtils.doGet(CommonSysConst.getSysConfig().getDiandianwPostUrl()+"otherUnit/Interface_getPriceInfoById.html" , paramMap);
}
/**
* @Author Sum1Dream
* @ClassName DianConfig
* @Description // 5.根据订单 ID 查询订单结果
* @Date 2023/10/16 15:25
**/
public static JSONObject getOrderDetail( String orderNo) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("orderid" , orderNo);
JSONObject paramMap = new JSONObject();
paramMap.put("appid", CommonSysConst.getSysConfig().getDiandianwAppid());
paramMap.put("postInfo", aesEncrypt(jsonObject.toJSONString() , CommonSysConst.getSysConfig().getDiandianwAppSecret()));
return HttpsUtils.doGet(CommonSysConst.getSysConfig().getDiandianwPostUrl()+"otherUnit/Interface_getOrderResultById.html" , paramMap);
}
public static JSONObject orderRefund( String orderNo) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("orderid" , orderNo);
JSONObject paramMap = new JSONObject();
paramMap.put("appid", CommonSysConst.getSysConfig().getDiandianwAppid());
paramMap.put("postInfo", aesEncrypt(jsonObject.toJSONString() , CommonSysConst.getSysConfig().getDiandianwAppSecret()));
return HttpsUtils.doGet(CommonSysConst.getSysConfig().getDiandianwPostUrl()+"otherUnit/Interface_nl_orderRefund.html" , paramMap);
}
/**
* 将字符串AES加密为base 64 code
*
* @param content 待加密的内容
* @return 加密后的base 64 code
*/
public static String aesEncrypt(String content, String key) {
try {
// 创建密码器
// 密钥 AES加解密要求key必须要128个比特位(这里需要长度为16,否则会报错)
KeyGenerator kgen = KeyGenerator.getInstance("AES");
kgen.init(128);
// 初始化为加密模式的密码器
Cipher cipher = Cipher.getInstance(ALGORITHMS);
cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(key.getBytes(), DianConfig.AES));
byte[] bytes = cipher.doFinal(content.getBytes(StandardCharsets.UTF_8));
System.out.println();
// 使用base64解码
return Base64.encodeBase64String(bytes);
} catch (Exception e) {
System.err.println(e.getMessage() + e);
}
return null;
}
}

@ -20,7 +20,7 @@ public class HighGasChannelConfig implements Serializable {
private Long id; private Long id;
/** /**
* 渠道id 1自建站 2团油 3加好油 4金猪加油 * 渠道id 1自建站 2团油 3加好油 4金猪加油 6:点点网络
*/ */
private Integer channelId; private Integer channelId;

@ -11,6 +11,7 @@ public enum GasChannel {
type3(3 , "加好油"), type3(3 , "加好油"),
type4(4 , "金猪加油"), type4(4 , "金猪加油"),
type5(5 , "paylo系统"), type5(5 , "paylo系统"),
type6(6 , "点点网络"),
; ;
private Integer type; private Integer type;

@ -12,6 +12,7 @@ public enum MerchantStoreSourceType {
type3(3, "加好油", "重庆壳牌"), type3(3, "加好油", "重庆壳牌"),
type4(4, "金猪加油", "金猪加油"), type4(4, "金猪加油", "金猪加油"),
type5(5, "paylo", "四川壳牌"), type5(5, "paylo", "四川壳牌"),
type6(6, "点点网络", "团油"),
; ;
private Integer number; private Integer number;

@ -83,6 +83,12 @@ public class OrderPayBeforeServiceImpl implements OrderPayBeforeService {
if (gasChannelConfig == null) { if (gasChannelConfig == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
} }
} else if (store.getSourceType().equals(MerchantStoreSourceType.type6.getNumber())) {
// 查询支付配置
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type6,GasChannelPayPlatformType.type1 );
if (gasChannelConfig == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
}
} else { } else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
} }

@ -378,6 +378,17 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
order.getPayablePrice(), order.getPayablePrice(),
order.getTotalDeductionPrice() order.getTotalDeductionPrice()
); );
} else if (gasOrder.getChannelType().equals(MerchantStoreSourceType.type6.getNumber())) {
JSONObject object = new JSONObject();
object.put("jyzid" , store.getStoreKey());
object.put("total" , order.getTotalPrice());
object.put("youhao" , gasOrder.getGasOilNo());
object.put("youqiang" , gasOrder.getGasGunNo());
object.put("mobile" , order.getMemPhone());
object.put("orderid" , order.getOrderNo());
object.put("priceGun", gasOrder.getGasPriceGun()); // 枪单价
object.put("priceVip", gasOrder.getGasPriceVip()); // 优惠价
DianConfig.refuelingOrderPush(object);
} }
} }
} }

@ -41,9 +41,11 @@ public class HuiConfig {
// 渝北区浩联物资经营部 // 渝北区浩联物资经营部
public final static String hlMerNo = "2023090816465844909"; public final static String hlMerNo = "2023090816465844909";
public final static String yFMerNo = "2023101109385455305";
// 渝北区浩联物资经营部 // 渝北区浩联物资经营部
public final static String hlKey = "ZatCMLMSZxnkc2rk7dtpTORMLcKetcKt"; public final static String hlKey = "ZatCMLMSZxnkc2rk7dtpTORMLcKetcKt";
public final static String yFKey = "plfJ6Ohgj4OmPblknuMzoSeT8cvI5dTR";
public final static String hlSubAppid = "wx8d49e2f83025229d"; public final static String hlSubAppid = "wx8d49e2f83025229d";
@ -56,9 +58,9 @@ public class HuiConfig {
* @return java.util.SortedMap<java.lang.Object,java.lang.Object> * @return java.util.SortedMap<java.lang.Object,java.lang.Object>
*/ */
public SortedMap<Object,Object> preorder(JSONObject object) throws Exception { public SortedMap<Object,Object> preorder(JSONObject object) throws Exception {
object.put("merchantNo" , hlMerNo); object.put("merchantNo" , yFMerNo);
object.put("subAppid" , hlSubAppid); object.put("subAppid" , hlSubAppid);
object.put("sign" , SignatureUtil.createSign(object , hlKey)); object.put("sign" , SignatureUtil.createSign(object , yFKey));
JSONObject jsonObject = HttpsUtils.doPost(postUrl + "trade/preorder", object, new HashMap<>()); JSONObject jsonObject = HttpsUtils.doPost(postUrl + "trade/preorder", object, new HashMap<>());
// 签名校验 // 签名校验

@ -21,6 +21,12 @@ public interface HighGasService {
*/ */
void getPayloAllStation() throws Exception; void getPayloAllStation() throws Exception;
/**
* 团油
* 获取渠道商点点网络全量加油站
*/
void getDianAllStation() throws Exception;
/** /**
* *
* 获取渠道商金猪加油全量加油站 * 获取渠道商金猪加油全量加油站

@ -5,6 +5,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.config.DianConfig;
import com.hai.config.TuanYouConfig; import com.hai.config.TuanYouConfig;
import com.hai.dao.HighGasDiscountOilPriceMapper; import com.hai.dao.HighGasDiscountOilPriceMapper;
import com.hai.entity.*; import com.hai.entity.*;
@ -154,6 +155,7 @@ public class HighGasDiscountOilPriceServiceImpl implements HighGasDiscountOilPri
|| store.getSourceType().equals(MerchantStoreSourceType.type3.getNumber()) || store.getSourceType().equals(MerchantStoreSourceType.type3.getNumber())
|| store.getSourceType().equals(MerchantStoreSourceType.type4.getNumber()) || store.getSourceType().equals(MerchantStoreSourceType.type4.getNumber())
|| store.getSourceType().equals(MerchantStoreSourceType.type5.getNumber()) || store.getSourceType().equals(MerchantStoreSourceType.type5.getNumber())
|| store.getSourceType().equals(MerchantStoreSourceType.type6.getNumber())
) { ) {
// 嗨森逛平台价 油枪价 * 折扣 // 嗨森逛平台价 油枪价 * 折扣
@ -271,6 +273,72 @@ public class HighGasDiscountOilPriceServiceImpl implements HighGasDiscountOilPri
// 本次优惠 // 本次优惠
payPriceModel.setTotalPreferences(payPriceModel.getOilLiters().multiply(payPriceModel.getLitersPreferences()).setScale(2, BigDecimal.ROUND_DOWN)); payPriceModel.setTotalPreferences(payPriceModel.getOilLiters().multiply(payPriceModel.getLitersPreferences()).setScale(2, BigDecimal.ROUND_DOWN));
// 支付价格
payPriceModel.setPayPrice(oilingPrice.subtract(payPriceModel.getTotalPreferences()));
} else if (store.getSourceType().equals(MerchantStoreSourceType.type6.getNumber())) {
// 查询油站油品价格
JSONObject oilPriceObject = DianConfig.queryCompanyPriceDetail(store.getStoreKey(), oilNo);
if (oilPriceObject == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油站价格");
}
JSONObject priceDetail = oilPriceObject.getJSONObject("result");
if (priceDetail == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油站价格");
}
// 团油枪价
priceGun = priceDetail.getBigDecimal("priceGun");
// 团油优惠价
priceVip = priceDetail.getBigDecimal("priceVip");
// 嗨森逛平台价 国标价 * 折扣
BigDecimal pricePlatform = priceGun.multiply(discount).setScale(2, BigDecimal.ROUND_HALF_UP);
// 加油金额
payPriceModel.setOilingPrice(oilingPrice);
// 团油枪价
payPriceModel.setPriceGun(priceGun);
// 团油优惠价
payPriceModel.setPriceVip(priceVip);
// 团油国标价
payPriceModel.setPriceOfficial(priceOfficial);
// 油站直降
payPriceModel.setGasStationDrop(gasStationDrop);
// 平台补贴
payPriceModel.setPreferentialMargin(gasOilPrice.getPreferentialMargin());
// 平台价
payPriceModel.setPricePlatform(pricePlatform);
// 加油升数,计算方式:加油金额 / 枪价
payPriceModel.setOilLiters(oilingPrice.divide(priceGun, 2, BigDecimal.ROUND_HALF_DOWN));
// 平台折扣,我们平台或者代理商设置的折扣
payPriceModel.setDiscount(discount.compareTo(new BigDecimal("1.00")) == 0 ? new BigDecimal("1.00") : discount);
// 加油补贴, 计算方式:团油枪价 - 团油VIP价
// payPriceModel.setOilSubsidy(priceGun.subtract(priceVip));
// 折扣,1 -平台折扣
BigDecimal decimal1 = new BigDecimal("1").subtract(discount);
// 价格差价 团油枪价 - 团油VIP价
BigDecimal oilPriceDifferences = priceGun.subtract(priceVip);
// 每升优惠 团油枪价 *(1-平台折扣)+(国标价-团油VIP价 )
payPriceModel.setLitersPreferences(priceGun.multiply(decimal1).setScale(2, BigDecimal.ROUND_HALF_UP).add(oilPriceDifferences));
// 优惠价格 团油枪价 * 平台折扣 -(国标价-团油VIP价 )
payPriceModel.setPricePreferences(pricePlatform.subtract(oilPriceDifferences));
// 本次优惠
payPriceModel.setTotalPreferences(payPriceModel.getOilLiters().multiply(payPriceModel.getLitersPreferences()).setScale(2, BigDecimal.ROUND_DOWN));
// 支付价格 // 支付价格
payPriceModel.setPayPrice(oilingPrice.subtract(payPriceModel.getTotalPreferences())); payPriceModel.setPayPrice(oilingPrice.subtract(payPriceModel.getTotalPreferences()));
} }

@ -6,11 +6,10 @@ 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.config.CommonSysConst; import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.JinZhuJiaYouService; import com.hai.config.*;
import com.hai.config.PayloService;
import com.hai.config.ShellGroupService;
import com.hai.entity.*; import com.hai.entity.*;
import com.hai.enum_type.GasOilPriceStatusEnum;
import com.hai.enum_type.JinZhuJiaYouOilNo; import com.hai.enum_type.JinZhuJiaYouOilNo;
import com.hai.enum_type.MerchantStoreSourceType; import com.hai.enum_type.MerchantStoreSourceType;
import com.hai.model.HighMerchantModel; import com.hai.model.HighMerchantModel;
@ -460,6 +459,114 @@ public class HighGasServiceImpl implements HighGasService {
} }
} }
@Override
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 @Override
public void getJinZhuAllStation() throws Exception { public void getJinZhuAllStation() throws Exception {
HighMerchantModel merchant = highMerchantService.getDetailByKey("HF0802153624"); HighMerchantModel merchant = highMerchantService.getDetailByKey("HF0802153624");

@ -138,3 +138,8 @@ filesystem=https://hsgcs.dctpay.com/filesystem/
# #
blxPostUrl=https://vertical-formats-gateway.blx.bodata.cn:18443 blxPostUrl=https://vertical-formats-gateway.blx.bodata.cn:18443
#DianDian
diandianwPostUrl=http://test.diandianw.cn/youdianyou_test/
diandianwAppid=10071000470d6z3rs80fc537qp7ipr4s
diandianwAppSecret=syz5cfetikr4by6gzxndpubtf6ht6zs5

@ -122,3 +122,9 @@ filesystem=https://hsg.dctpay.com/filesystem/
blxPostUrl=https://gateway.vf.bilinxing.com blxPostUrl=https://gateway.vf.bilinxing.com
#DianDian
diandianwPostUrl=http://www.diandianw.cn/youdianyou/
diandianwAppid=1016145002rmz7dkti3f5oqh1razswc0
diandianwAppSecret=msk48q5jinmpsfdgpcyryx6lhkoiii4s

@ -128,3 +128,9 @@ filesystem=https://hsg.dctpay.com/filesystem/
blxPostUrl=https://gateway.vf.bilinxing.com blxPostUrl=https://gateway.vf.bilinxing.com
#DianDian
diandianwPostUrl=http://www.diandianw.cn/youdianyou/
diandianwAppid=1016145002rmz7dkti3f5oqh1razswc0
diandianwAppSecret=msk48q5jinmpsfdgpcyryx6lhkoiii4s
Loading…
Cancel
Save