'提交代码'

dev-discount
胡锐 3 years ago
parent fe430eb040
commit 124e90aae3
  1. 54
      hai-bweb/src/main/java/com/bweb/controller/TuanYouController.java
  2. 50
      hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
  3. 44
      hai-schedule/src/main/resources/pre/application.yml
  4. 0
      hai-schedule/src/main/resources/pre/config.properties
  5. 72
      hai-schedule/src/main/resources/pre/logback.xml

@ -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);
}
}
}

@ -11,6 +11,7 @@ import com.hai.config.CommonSysConst;
import com.hai.config.HuiLianTongConfig; import com.hai.config.HuiLianTongConfig;
import com.hai.config.QianZhuConfig; import com.hai.config.QianZhuConfig;
import com.hai.config.TuanYouConfig; import com.hai.config.TuanYouConfig;
import com.hai.dao.HighGasOrderPushMapper;
import com.hai.entity.*; import com.hai.entity.*;
import com.hai.model.HighMerchantModel; import com.hai.model.HighMerchantModel;
import com.hai.model.HighMerchantStoreModel; import com.hai.model.HighMerchantStoreModel;
@ -26,6 +27,7 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.*; import java.util.*;
/** /**
@ -49,6 +51,11 @@ public class HighTestController {
@Resource @Resource
private HighGasOilPriceService highGasOilPriceService; private HighGasOilPriceService highGasOilPriceService;
@Resource
private HighOrderService highOrderService;
@Resource
private HighGasOrderPushMapper highGasOrderPushMapper;
@RequestMapping(value = "/initTYMerchantStore", method = RequestMethod.GET) @RequestMapping(value = "/initTYMerchantStore", method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ -160,12 +167,47 @@ public class HighTestController {
return ResponseMsgUtil.success("初始化完成"); return ResponseMsgUtil.success("初始化完成");
} }
@RequestMapping(value = "/test1", method = RequestMethod.GET) @RequestMapping(value = "/queryCompanyAccountInfo2JD", method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "测试") @ApiOperation(value = "查询团油账户")
public ResponseData test1() { public ResponseData queryCompanyAccountInfo2JD() {
try { try {
return ResponseMsgUtil.success(QianZhuConfig.payKfcOrder("20210725184842879067286")); /*HighOrder order = highOrderService.getOrderByOrderNo("HF2021091414532044405");
for (HighChildOrder highChildOrder : order.getHighChildOrderList()) {
HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreById(highChildOrder.getGoodsId());
// 推送团油订单
Map<String, Object> 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) { } catch (Exception e) {
log.error("HighOrderController --> getOrderById() error!", e); log.error("HighOrderController --> getOrderById() error!", e);
return ResponseMsgUtil.exception(e); return ResponseMsgUtil.exception(e);

@ -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

@ -0,0 +1,72 @@
<configuration>
<!-- %m输出的信息,%p日志级别,%t线程名,%d日期,%c类的全名,,,, -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d %p (%file:%line\)- %m%n</pattern>
<charset>UTF-8</charset>
</encoder>
</appender>
<appender name="baselog"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/base.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/base.log.%d.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 64 MB -->
<maxFileSize>64 MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>
%d %p (%file:%line\)- %m%n
</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
</appender>
<appender name="daolog"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/dao.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/dao.log.%d.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 64 MB -->
<maxFileSize>64 MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>
%d %p (%file:%line\)- %m%n
</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
</appender>
<appender name="errorlog"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/error.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/error.log.%d.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 64 MB -->
<maxFileSize>64 MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>
%d %p (%file:%line\)- %m%n
</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
</appender>
<root level="DEBUG">
<appender-ref ref="STDOUT" />
</root>
<logger name="com.hai" level="DEBUG">
<appender-ref ref="baselog" />
</logger>
<logger name="com.hai.dao" level="DEBUG">
<appender-ref ref="daolog" />
</logger>
<logger name="com.hai" level="ERROR">
<appender-ref ref="errorlog" />
</logger>
</configuration>
Loading…
Cancel
Save