From e88b3ed4812875827ab57b35d689d48aa0286018 Mon Sep 17 00:00:00 2001 From: = <=> Date: Sun, 25 Jul 2021 00:47:57 +0800 Subject: [PATCH] =?UTF-8?q?'=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/dev/application.yml | 2 +- .../cweb/controller/HighGasController.java | 5 + .../cweb/controller/HighTestController.java | 175 +++++++++--------- .../cweb/controller/pay/OrderController.java | 4 +- .../com/cweb/controller/tPigController.java | 8 +- .../src/main/resources/dev/application.yml | 2 +- .../com/hai/schedule/HighGasSchedule.java | 142 ++++++++++++++ .../java/com/hai/config/QianZhuConfig.java | 2 +- .../service/impl/BsCompanyServiceImpl.java | 2 +- .../service/impl/HighMerchantServiceImpl.java | 2 +- .../service/impl/HighQzOrderServiceImpl.java | 6 +- .../resources/dev/commonConfig.properties | 3 +- .../resources/prod/commonConfig.properties | 2 +- 13 files changed, 248 insertions(+), 107 deletions(-) create mode 100644 hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java diff --git a/hai-bweb/src/main/resources/dev/application.yml b/hai-bweb/src/main/resources/dev/application.yml index e83dfb66..3b6bb9fa 100644 --- a/hai-bweb/src/main/resources/dev/application.yml +++ b/hai-bweb/src/main/resources/dev/application.yml @@ -9,7 +9,7 @@ debug: false #datasource数据源设置 spring: datasource: - url: jdbc:mysql://47.108.227.41:3306/hfkj?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false + url: jdbc:mysql://139.159.177.244:3306/hfkj?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false username: root password: HF123456. type: com.alibaba.druid.pool.DruidDataSource diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java b/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java index b47f6043..91678a09 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java @@ -13,7 +13,9 @@ import com.hai.config.TuanYouConfig; import com.hai.dao.HighGasOrderPushMapper; import com.hai.entity.HighGasOrderPush; import com.hai.entity.HighOrder; +import com.hai.entity.SecRegion; import com.hai.model.ResponseData; +import com.hai.service.CommonService; import com.hai.service.HighGasOilPriceService; import com.hai.service.HighOrderService; import io.swagger.annotations.Api; @@ -42,6 +44,9 @@ public class HighGasController { @Resource private HighOrderService highOrderService; + @Resource + private CommonService commonService; + @Resource private HighGasOrderPushMapper highGasOrderPushMapper; diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java b/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java index 88c15993..18e7beb9 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java @@ -50,96 +50,59 @@ public class HighTestController { @RequestMapping(value = "/initTYMerchantStore", method = RequestMethod.GET) @ResponseBody - @ApiOperation(value = "根据") - public ResponseData initTYMerchantStore(@RequestParam(name = "merchantId", required = true) Long merchantId) { - try { + @ApiOperation(value = "初始化") + public ResponseData initTYMerchantStore(@RequestParam(name = "merchantId", required = true) Long merchantId) throws Exception { - HighMerchantModel merchant = highMerchantService.getMerchantById(merchantId); - if (merchant == null) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); - } + HighMerchantModel merchant = highMerchantService.getMerchantById(merchantId); + if (merchant == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); + } + JSONObject jsonObjectP = TuanYouConfig.queryGasInfoListByPage(1, 1000); + JSONObject resultObjectP = jsonObjectP.getObject("result", JSONObject.class); - JSONObject jsonObject = TuanYouConfig.queryGasInfoListByPage(1, 10); + for (int i = 1; i < resultObjectP.getInteger("totalPageNum").intValue();i++) { + JSONObject jsonObject = TuanYouConfig.queryGasInfoListByPage(i, 1000); JSONObject resultObject = jsonObject.getObject("result", JSONObject.class); JSONArray jsonArray = resultObject.getJSONArray("gasInfoList"); HighMerchantStore highMerchantStore; HighGasOilPrice highGasOilPrice; for (Object gasObject : jsonArray) { JSONObject object = JSONObject.parseObject(JSONObject.toJSONString(gasObject)); - if (object.getInteger("gasStatus") == 1) { - HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreByKey(object.getString("gasId")); - if (store != null) { - store.setType(1); - store.setMerchantId(merchant.getId()); - store.setCompanyId(merchant.getCompanyId()); - store.setStoreKey(object.getString("gasId")); - store.setStoreName(object.getString("gasName")); - store.setStoreLogo(object.getString("gasLogoSmall")); - store.setRegionId(object.getLong("provinceCode")); - store.setRegionName(object.getString("provinceName")); - store.setAddress(object.getString("gasAddress")); - store.setLongitude(object.getString("gasAddressLongitude")); - store.setLatitude(object.getString("gasAddressLatitude")); - 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.getInteger("oilNo")); - if(highGasOilPrice == null) { - highGasOilPrice.setMerchantStoreId(store.getId()); - highGasOilPrice.setOilNo(oilPriceObject.getInteger("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")); - highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); - } else { - highGasOilPrice.setMerchantStoreId(store.getId()); - highGasOilPrice.setOilNo(oilPriceObject.getInteger("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")); - highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); - } - highGasOilPriceService.editGasOilPrice(highGasOilPrice); - } - } else { - highMerchantStore = new HighMerchantStore(); - highMerchantStore.setType(1); - highMerchantStore.setMerchantId(merchant.getId()); - highMerchantStore.setCompanyId(merchant.getCompanyId()); - highMerchantStore.setStoreKey(object.getString("gasId")); - highMerchantStore.setStoreName(object.getString("gasName")); - highMerchantStore.setStoreLogo(object.getString("gasLogoSmall")); - highMerchantStore.setRegionId(object.getLong("provinceCode")); - highMerchantStore.setRegionName(object.getString("provinceName")); - highMerchantStore.setAddress(object.getString("gasAddress")); - highMerchantStore.setLongitude(object.getString("gasAddressLongitude")); - highMerchantStore.setLatitude(object.getString("gasAddressLatitude")); - highMerchantStore.setStatus(1); - 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()); + HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreByKey(object.getString("gasId")); + if (store != null) { + store.setType(1); + store.setMerchantId(merchant.getId()); + store.setCompanyId(merchant.getCompanyId()); + store.setStoreKey(object.getString("gasId")); + store.setStoreName(object.getString("gasName")); + store.setStoreLogo(object.getString("gasLogoSmall")); + store.setRegionId(object.getLong("provinceCode")); + store.setRegionName(object.getString("provinceName")); + store.setAddress(object.getString("gasAddress")); + store.setLongitude(object.getString("gasAddressLongitude")); + store.setLatitude(object.getString("gasAddressLatitude")); + 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.getInteger("oilNo")); + if (highGasOilPrice == null) { + highGasOilPrice.setMerchantStoreId(store.getId()); + highGasOilPrice.setOilNo(oilPriceObject.getInteger("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")); + highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); + } else { + highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setOilNo(oilPriceObject.getInteger("oilNo")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); @@ -147,20 +110,52 @@ public class HighTestController { highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); - highGasOilPriceService.editGasOilPrice(highGasOilPrice); } + highGasOilPriceService.editGasOilPrice(highGasOilPrice); + } + } else { + highMerchantStore = new HighMerchantStore(); + highMerchantStore.setType(1); + highMerchantStore.setMerchantId(merchant.getId()); + highMerchantStore.setCompanyId(merchant.getCompanyId()); + highMerchantStore.setStoreKey(object.getString("gasId")); + highMerchantStore.setStoreName(object.getString("gasName")); + highMerchantStore.setStoreLogo(object.getString("gasLogoSmall")); + highMerchantStore.setRegionId(object.getLong("provinceCode")); + highMerchantStore.setRegionName(object.getString("provinceName")); + highMerchantStore.setAddress(object.getString("gasAddress")); + highMerchantStore.setLongitude(object.getString("gasAddressLongitude")); + highMerchantStore.setLatitude(object.getString("gasAddressLatitude")); + highMerchantStore.setStatus(1); + 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.getInteger("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")); + highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); + highGasOilPriceService.editGasOilPrice(highGasOilPrice); } } } - return ResponseMsgUtil.success(jsonArray); - } catch (Exception e) { - log.error("HighOrderController --> getOrderById() error!", e); - return ResponseMsgUtil.exception(e); } + return ResponseMsgUtil.success("初始化完成"); } - - @RequestMapping(value = "/test1", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "测试") @@ -177,7 +172,7 @@ public class HighTestController { @ApiOperation(value = "测试") public ResponseData test2() { try { - return ResponseMsgUtil.success(QianZhuConfig.getMobileOrderByOrderNo("20210724151253346003684")); + return ResponseMsgUtil.success(QianZhuConfig.getMobileOrderByOrderNo("20210724214153991091751")); } catch (Exception e) { log.error("HighOrderController --> getOrderById() error!", e); return ResponseMsgUtil.exception(e); diff --git a/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java b/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java index 1fe6dc2d..c4babf63 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java @@ -262,8 +262,8 @@ public class OrderController { //微信支付 String nonce_str = MD5Util.MD5Encode(String.valueOf(ThreadLocalRandom.current().nextInt(10000)), "UTF-8"); - // int total_fee = MathUtils.objectConvertBigDecimal(map.get("payPrice")).multiply(new BigDecimal("100")).intValue(); - int total_fee = 1; + int total_fee = MathUtils.objectConvertBigDecimal(map.get("payPrice")).multiply(new BigDecimal("100")).intValue(); + // int total_fee = 1; WeChatPayReqInfo weChatPayReqInfo = new WeChatPayReqInfo(); weChatPayReqInfo.setAppid(SysConst.getSysConfig().getWxMchAppId()); //公众号id weChatPayReqInfo.setMch_id(SysConst.getSysConfig().getWxMchId()); //商户号 diff --git a/hai-cweb/src/main/java/com/cweb/controller/tPigController.java b/hai-cweb/src/main/java/com/cweb/controller/tPigController.java index 6a1519aa..d93ff84f 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/tPigController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/tPigController.java @@ -34,8 +34,6 @@ public class tPigController { @Autowired private UserCenter userCenter; - - @RequestMapping(value = "/getTPigKFCToken", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "【小程序】KFC获取千猪Token") @@ -47,7 +45,7 @@ public class tPigController { String url = ""; if (token.getBoolean("success")) { JSONObject data = token.getJSONObject("data"); - url = "https://m-test.qianzhu8.com/kfc/?platformId=" + CommonSysConst.getSysConfig().getQinzhuPlatformId() + "&token=" + data.getString("accessToken"); + url = "https://qz.dctpay.com/kfc/?platformId=" + CommonSysConst.getSysConfig().getQinzhuPlatformId() + "&token=" + data.getString("accessToken"); } return ResponseMsgUtil.success(url); @@ -67,7 +65,7 @@ public class tPigController { String url = ""; if (token.getBoolean("success")) { JSONObject data = token.getJSONObject("data"); - url = "https://m-test.qianzhu8.com/cinema/?platformId=" + CommonSysConst.getSysConfig().getQinzhuPlatformId() + "&token=" + data.getString("accessToken"); + url = "https://qz.dctpay.com/cinema/?platformId="+CommonSysConst.getSysConfig().getQinzhuPlatformId()+"&token="+data.getString("accessToken"); } return ResponseMsgUtil.success(url); @@ -87,7 +85,7 @@ public class tPigController { String url = ""; if (token.getBoolean("success")) { JSONObject data = token.getJSONObject("data"); - url = "https://m.qianzhu8.com/mobile/?platformId=" + CommonSysConst.getSysConfig().getQinzhuPlatformId() + "&token=" + data.getString("accessToken"); + url = "https://qz.dctpay.com/mobile/?platformId="+CommonSysConst.getSysConfig().getQinzhuPlatformId()+"&token=" + data.getString("accessToken"); } return ResponseMsgUtil.success(url); } catch (Exception e) { diff --git a/hai-cweb/src/main/resources/dev/application.yml b/hai-cweb/src/main/resources/dev/application.yml index 6799d4af..eed35273 100644 --- a/hai-cweb/src/main/resources/dev/application.yml +++ b/hai-cweb/src/main/resources/dev/application.yml @@ -9,7 +9,7 @@ debug: false #datasource数据源设置 spring: datasource: - url: jdbc:mysql://47.108.227.41:3306/hfkj?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false + url: jdbc:mysql://139.159.177.244:3306/hfkj?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false username: root password: HF123456. type: com.alibaba.druid.pool.DruidDataSource diff --git a/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java b/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java new file mode 100644 index 00000000..26511f9a --- /dev/null +++ b/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java @@ -0,0 +1,142 @@ +package com.hai.schedule; + +import com.alibaba.fastjson.JSONArray; +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.config.TuanYouConfig; +import com.hai.entity.HighGasOilPrice; +import com.hai.entity.HighMerchantStore; +import com.hai.model.HighMerchantModel; +import com.hai.model.HighMerchantStoreModel; +import com.hai.service.HighGasOilPriceService; +import com.hai.service.HighMerchantService; +import com.hai.service.HighMerchantStoreService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.BeanUtils; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.Scheduled; + +import javax.annotation.Resource; +import java.util.Date; + +@Configuration +public class HighGasSchedule { + + private static final Logger log = LoggerFactory.getLogger(HighGasSchedule.class); + + @Resource + private HighMerchantService highMerchantService; + + @Resource + private HighMerchantStoreService highMerchantStoreService; + + @Resource + private HighGasOilPriceService highGasOilPriceService; + + @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++) { + JSONObject jsonObject = TuanYouConfig.queryGasInfoListByPage(i, 1000); + JSONObject resultObject = jsonObject.getObject("result", JSONObject.class); + JSONArray jsonArray = resultObject.getJSONArray("gasInfoList"); + HighMerchantStore highMerchantStore; + HighGasOilPrice highGasOilPrice; + for (Object gasObject : jsonArray) { + JSONObject object = JSONObject.parseObject(JSONObject.toJSONString(gasObject)); + HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreByKey(object.getString("gasId")); + if (store != null) { + store.setType(1); + store.setMerchantId(merchant.getId()); + store.setCompanyId(merchant.getCompanyId()); + store.setStoreKey(object.getString("gasId")); + store.setStoreName(object.getString("gasName")); + store.setStoreLogo(object.getString("gasLogoSmall")); + store.setRegionId(object.getLong("provinceCode")); + store.setRegionName(object.getString("provinceName")); + store.setAddress(object.getString("gasAddress")); + store.setLongitude(object.getString("gasAddressLongitude")); + store.setLatitude(object.getString("gasAddressLatitude")); + 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.getInteger("oilNo")); + if (highGasOilPrice == null) { + highGasOilPrice.setMerchantStoreId(store.getId()); + highGasOilPrice.setOilNo(oilPriceObject.getInteger("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")); + highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); + } else { + highGasOilPrice.setMerchantStoreId(store.getId()); + highGasOilPrice.setOilNo(oilPriceObject.getInteger("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")); + highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); + } + highGasOilPriceService.editGasOilPrice(highGasOilPrice); + } + } else { + highMerchantStore = new HighMerchantStore(); + highMerchantStore.setType(1); + highMerchantStore.setMerchantId(merchant.getId()); + highMerchantStore.setCompanyId(merchant.getCompanyId()); + highMerchantStore.setStoreKey(object.getString("gasId")); + highMerchantStore.setStoreName(object.getString("gasName")); + highMerchantStore.setStoreLogo(object.getString("gasLogoSmall")); + highMerchantStore.setRegionId(object.getLong("provinceCode")); + highMerchantStore.setRegionName(object.getString("provinceName")); + highMerchantStore.setAddress(object.getString("gasAddress")); + highMerchantStore.setLongitude(object.getString("gasAddressLongitude")); + highMerchantStore.setLatitude(object.getString("gasAddressLatitude")); + highMerchantStore.setStatus(1); + 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.getInteger("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")); + highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); + highGasOilPriceService.editGasOilPrice(highGasOilPrice); + } + } + } + } + } +} diff --git a/hai-service/src/main/java/com/hai/config/QianZhuConfig.java b/hai-service/src/main/java/com/hai/config/QianZhuConfig.java index a54dd5fb..9c943301 100644 --- a/hai-service/src/main/java/com/hai/config/QianZhuConfig.java +++ b/hai-service/src/main/java/com/hai/config/QianZhuConfig.java @@ -139,7 +139,7 @@ public class QianZhuConfig { contentMap.put("orderNo", orderNo); Map map = new HashMap<>(); map.put("platformId", "10458"); - map.put("action", "mobileOrders.pay"); + map.put("action", "mobileOrders.getByOrderNo"); map.put("version", "1.0"); map.put("content", JSON.toJSONString(contentMap)); map.put("traceId", WxUtils.makeNonStr()); diff --git a/hai-service/src/main/java/com/hai/service/impl/BsCompanyServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/BsCompanyServiceImpl.java index 83116e60..3b434f32 100644 --- a/hai-service/src/main/java/com/hai/service/impl/BsCompanyServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/BsCompanyServiceImpl.java @@ -97,7 +97,7 @@ public class BsCompanyServiceImpl implements BsCompanyService { @Override public List getCompany(Map map) { BsCompanyExample example = new BsCompanyExample(); - example.createCriteria().andStatusNotEqualTo(0); + example.createCriteria().andIdNotEqualTo(1L).andIdNotEqualTo(2L).andStatusNotEqualTo(0); return bsCompanyMapper.selectByExample(example); } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighMerchantServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighMerchantServiceImpl.java index 711cb97e..008c1732 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighMerchantServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighMerchantServiceImpl.java @@ -125,7 +125,7 @@ public class HighMerchantServiceImpl implements HighMerchantService { } // todo - if (MapUtils.getBoolean(map, "ext1") == true) { + if (MapUtils.getBoolean(map, "ext1") != null && MapUtils.getBoolean(map, "ext1") == true) { criteria.andExt1IsNull(); } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighQzOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighQzOrderServiceImpl.java index 4b44edfb..42fad488 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighQzOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighQzOrderServiceImpl.java @@ -29,7 +29,7 @@ public class HighQzOrderServiceImpl implements HighQzOrderService { @Override public HighOrder assemblyQzOrder(String orderNo,String orderType) throws Exception { - HighOrder highOrder = new HighOrder(); + HighOrder highOrder = null; JSONObject orderDetail = null; if (orderType.equals("KFC")) { orderDetail = QianZhuConfig.getKfcOrderByOrderNo(orderNo); @@ -44,6 +44,7 @@ public class HighQzOrderServiceImpl implements HighQzOrderService { } if (orderDetail != null && orderDetail.getBoolean("success") == true) { + highOrder = new HighOrder(); JSONObject data = orderDetail.getJSONObject("data"); HighOrder order = highOrderService.getOrderByOrderNo(orderNo); if (order != null) { @@ -152,9 +153,10 @@ public class HighQzOrderServiceImpl implements HighQzOrderService { highChildOrder.setPraiseStatus(0); // 计算原始价格 highOrder.setTotalPrice(highChildOrder.getGoodsPrice().multiply(new BigDecimal(highChildOrder.getSaleCount().toString()))); + highOrder.getHighChildOrderList().add(highChildOrder); } + highOrderService.insertOrder(highOrder); } - highOrderService.insertOrder(highOrder); return highOrder; } } diff --git a/hai-service/src/main/resources/dev/commonConfig.properties b/hai-service/src/main/resources/dev/commonConfig.properties index 46cc1bb4..4103099f 100644 --- a/hai-service/src/main/resources/dev/commonConfig.properties +++ b/hai-service/src/main/resources/dev/commonConfig.properties @@ -5,10 +5,9 @@ tuanYouDieselAccount=9b115eao4400 tuanYouGasolineAccount=9b115e5g4400 qinzhuUrl=https://live-test.qianzhu8.com -qinzhuMobileUrl=https://live-test.qianzhu8.com qinzhuPlatformId=10376 qinzhuSecret=ktxb49sh2jfhgn8g - +qianzhuOrderNotify=https://hsgcs.dctpay.com/crest/qianzhu/orderNotify wx_cert=/home/project/wx_cert/ diff --git a/hai-service/src/main/resources/prod/commonConfig.properties b/hai-service/src/main/resources/prod/commonConfig.properties index ecb1b746..9a3f8ebe 100644 --- a/hai-service/src/main/resources/prod/commonConfig.properties +++ b/hai-service/src/main/resources/prod/commonConfig.properties @@ -4,7 +4,7 @@ tuanYouAppSecret=f9811df6791d309bf48f4a8db9edaa45 tuanYouDieselAccount=9hp52qgg4400 tuanYouGasolineAccount=9hp52qf04400 -qinzhuUrl=https://live-test.qianzhu8.com/ +qinzhuUrl=https://live.qianzhu8.com/ qinzhuPlatformId=10458 qinzhuSecret=nnl3gg4ss0pka11t qianzhuOrderNotify=https://hsg.dctpay.com/crest/qianzhu/orderNotify