From 124e90aae300909031a91c29bc6c05ad38731f61 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Fri, 17 Sep 2021 17:53:58 +0800 Subject: [PATCH 1/2] =?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 --- .../bweb/controller/TuanYouController.java | 54 ++++++++++++++ .../cweb/controller/HighTestController.java | 50 +++++++++++-- .../src/main/resources/pre/application.yml | 44 ++++++++++++ .../src/main/resources/pre/config.properties | 0 .../src/main/resources/pre/logback.xml | 72 +++++++++++++++++++ 5 files changed, 216 insertions(+), 4 deletions(-) create mode 100644 hai-bweb/src/main/java/com/bweb/controller/TuanYouController.java create mode 100644 hai-schedule/src/main/resources/pre/application.yml create mode 100644 hai-schedule/src/main/resources/pre/config.properties create mode 100644 hai-schedule/src/main/resources/pre/logback.xml diff --git a/hai-bweb/src/main/java/com/bweb/controller/TuanYouController.java b/hai-bweb/src/main/java/com/bweb/controller/TuanYouController.java new file mode 100644 index 00000000..94d60111 --- /dev/null +++ b/hai-bweb/src/main/java/com/bweb/controller/TuanYouController.java @@ -0,0 +1,54 @@ +package com.bweb.controller; + +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.MD5Util; +import com.hai.common.utils.ResponseMsgUtil; +import com.hai.config.TuanYouConfig; +import com.hai.entity.SecUser; +import com.hai.model.ResponseData; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * @author hurui + * @version 1.0 + * @ClassName TuanYouController + * @description: TODO + * @date 2021/9/17 17:52 + */ +@Controller +@RequestMapping(value = "/tuanYou") +@Api(value="用户管理") +public class TuanYouController { + + private static Logger log = LoggerFactory.getLogger(TuanYouController.class); + + @RequestMapping(value="/getTuanYouAccount",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询团油账户余额") + public ResponseData getTuanYouAccount() { + try { + + return ResponseMsgUtil.success(TuanYouConfig.queryCompanyAccountInfo2JD()); + + } catch (Exception e) { + log.error("getUserByTelephone",e); + return ResponseMsgUtil.exception(e); + } + } + +} 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 92b99104..8a54ca2f 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java @@ -11,6 +11,7 @@ import com.hai.config.CommonSysConst; import com.hai.config.HuiLianTongConfig; import com.hai.config.QianZhuConfig; import com.hai.config.TuanYouConfig; +import com.hai.dao.HighGasOrderPushMapper; import com.hai.entity.*; import com.hai.model.HighMerchantModel; import com.hai.model.HighMerchantStoreModel; @@ -26,6 +27,7 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import java.math.BigDecimal; import java.util.*; /** @@ -49,6 +51,11 @@ public class HighTestController { @Resource private HighGasOilPriceService highGasOilPriceService; + @Resource + private HighOrderService highOrderService; + + @Resource + private HighGasOrderPushMapper highGasOrderPushMapper; @RequestMapping(value = "/initTYMerchantStore", method = RequestMethod.GET) @ResponseBody @@ -160,12 +167,47 @@ public class HighTestController { return ResponseMsgUtil.success("初始化完成"); } - @RequestMapping(value = "/test1", method = RequestMethod.GET) + @RequestMapping(value = "/queryCompanyAccountInfo2JD", method = RequestMethod.GET) @ResponseBody - @ApiOperation(value = "测试") - public ResponseData test1() { + @ApiOperation(value = "查询团油账户") + public ResponseData queryCompanyAccountInfo2JD() { try { - return ResponseMsgUtil.success(QianZhuConfig.payKfcOrder("20210725184842879067286")); + /*HighOrder order = highOrderService.getOrderByOrderNo("HF2021091414532044405"); + for (HighChildOrder highChildOrder : order.getHighChildOrderList()) { + HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreById(highChildOrder.getGoodsId()); + // 推送团油订单 + Map paramMap = new HashMap<>(); + paramMap.put("gasId", store.getStoreKey()); + paramMap.put("oilNo", highChildOrder.getGasOilNo()); + paramMap.put("gunNo", highChildOrder.getGasGunNo()); + BigDecimal priceGun = highChildOrder.getGasPriceGun(); + BigDecimal priceVip = highChildOrder.getGasPriceVip(); + paramMap.put("priceGun", priceGun); // 枪单价 + paramMap.put("priceVip", priceVip); // 优惠价 + paramMap.put("driverPhone", order.getMemPhone()); + paramMap.put("thirdSerialNo", order.getOrderNo()); + paramMap.put("refuelingAmount", highChildOrder.getTotalPrice()); + + // 油品类型 1:汽油:2:柴油;3:天然气 + if (highChildOrder.getGasOilType() == 1) { + paramMap.put("accountNo", CommonSysConst.getSysConfig().getTuanYouGasolineAccount()); + } else if (highChildOrder.getGasOilType() == 2) { + paramMap.put("accountNo", CommonSysConst.getSysConfig().getTuanYouDieselAccount()); + } + JSONObject orderPushObject = TuanYouConfig.refuelingOrderPush(paramMap); + // 推送团油订单记录 + HighGasOrderPush highGasOrderPush = new HighGasOrderPush(); + highGasOrderPush.setCreateTime(new Date()); + highGasOrderPush.setCode(orderPushObject.getString("code")); + highGasOrderPush.setRequestContent(JSONObject.toJSONString(paramMap)); + highGasOrderPush.setReturnContent(orderPushObject.toJSONString()); + highGasOrderPushMapper.insert(highGasOrderPush); + + if (orderPushObject != null && orderPushObject.getString("code").equals("200")) { + highChildOrder.setGasOrderNo(orderPushObject.getJSONObject("result").getString("orderNo")); + } + }*/ + return ResponseMsgUtil.success(TuanYouConfig.queryCompanyAccountInfo2JD()); } catch (Exception e) { log.error("HighOrderController --> getOrderById() error!", e); return ResponseMsgUtil.exception(e); diff --git a/hai-schedule/src/main/resources/pre/application.yml b/hai-schedule/src/main/resources/pre/application.yml new file mode 100644 index 00000000..ff2ce013 --- /dev/null +++ b/hai-schedule/src/main/resources/pre/application.yml @@ -0,0 +1,44 @@ +server: + port: 9303 + servlet: + context-path: /schedule + +#配置是否为debug模式,debug模式下,不开启权限校验 +debug: false + +#datasource数据源设置 +spring: + datasource: + url: jdbc:mysql://139.159.177.244:3306/hsg_pre?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8 + username: root + password: HF123456. + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.jdbc.Driver + filters: stat + maxActive: 10 + initialSize: 5 + maxWait: 60000 + minIdle: 5 + timeBetweenEvictionRunsMillis: 60000 + minEvictableIdleTimeMillis: 300000 + validationQuery: select 'x' + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + poolPreparedStatements: true + maxOpenPreparedStatements: 20 + #配置日期返回至前台为时间戳 + jackson: + serialization: + write-dates-as-timestamps: true +mybatis: + mapperLocations: + - classpath*:sqlmap*/*.xml + type-aliases-package: + org.springboot.sample.entity + +pagehelper: + helperDialect: mysql + reasonable: true + supportMethodsArguments: true + params: count=countSql diff --git a/hai-schedule/src/main/resources/pre/config.properties b/hai-schedule/src/main/resources/pre/config.properties new file mode 100644 index 00000000..e69de29b diff --git a/hai-schedule/src/main/resources/pre/logback.xml b/hai-schedule/src/main/resources/pre/logback.xml new file mode 100644 index 00000000..a7602e3d --- /dev/null +++ b/hai-schedule/src/main/resources/pre/logback.xml @@ -0,0 +1,72 @@ + + + + + %d %p (%file:%line\)- %m%n + UTF-8 + + + + log/base.log + + log/base.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + log/dao.log + + log/dao.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + log/error.log + + log/error.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + + + + + + + + + + + + From 0fb3e26e1be8f013d36ddf3b06a48ddded774722 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Fri, 17 Sep 2021 17:56:46 +0800 Subject: [PATCH 2/2] =?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 --- .../com/cweb/controller/HighTestController.java | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) 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 63f4ade6..a6fb15a4 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java @@ -9,15 +9,11 @@ import com.hai.common.exception.SysCode; import com.hai.common.pay.util.XmlUtil; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.utils.*; -<<<<<<< HEAD -import com.hai.config.*; -======= import com.hai.config.CommonSysConst; import com.hai.config.HuiLianTongConfig; import com.hai.config.QianZhuConfig; import com.hai.config.TuanYouConfig; import com.hai.dao.HighGasOrderPushMapper; ->>>>>>> pre import com.hai.entity.*; import com.hai.model.HighMerchantModel; import com.hai.model.HighMerchantStoreModel; @@ -43,14 +39,10 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; -<<<<<<< HEAD import javax.net.ssl.SSLContext; import java.io.FileInputStream; import java.math.BigDecimal; import java.security.KeyStore; -======= -import java.math.BigDecimal; ->>>>>>> pre import java.util.*; /** @@ -78,11 +70,10 @@ public class HighTestController { private HighOrderService highOrderService; @Resource -<<<<<<< HEAD private HighProfitSharingRecordService highProfitSharingRecordService; -======= + + @Resource private HighGasOrderPushMapper highGasOrderPushMapper; ->>>>>>> pre @RequestMapping(value = "/initTYMerchantStore", method = RequestMethod.GET) @ResponseBody