'提交代码'

dev-discount
= 3 years ago
parent 7f380994a4
commit e88b3ed481
  1. 2
      hai-bweb/src/main/resources/dev/application.yml
  2. 5
      hai-cweb/src/main/java/com/cweb/controller/HighGasController.java
  3. 23
      hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
  4. 4
      hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java
  5. 8
      hai-cweb/src/main/java/com/cweb/controller/tPigController.java
  6. 2
      hai-cweb/src/main/resources/dev/application.yml
  7. 142
      hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java
  8. 2
      hai-service/src/main/java/com/hai/config/QianZhuConfig.java
  9. 2
      hai-service/src/main/java/com/hai/service/impl/BsCompanyServiceImpl.java
  10. 2
      hai-service/src/main/java/com/hai/service/impl/HighMerchantServiceImpl.java
  11. 6
      hai-service/src/main/java/com/hai/service/impl/HighQzOrderServiceImpl.java
  12. 3
      hai-service/src/main/resources/dev/commonConfig.properties
  13. 2
      hai-service/src/main/resources/prod/commonConfig.properties

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

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

@ -50,23 +50,24 @@ 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, "未找到商户");
}
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);
@ -91,7 +92,7 @@ public class HighTestController {
JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice));
// 查询门店油号
highGasOilPrice = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(store.getId(), oilPriceObject.getInteger("oilNo"));
if(highGasOilPrice == null) {
if (highGasOilPrice == null) {
highGasOilPrice.setMerchantStoreId(store.getId());
highGasOilPrice.setOilNo(oilPriceObject.getInteger("oilNo"));
highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName"));
@ -152,14 +153,8 @@ public class HighTestController {
}
}
}
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
@ -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);

@ -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()); //商户号

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

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

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

@ -139,7 +139,7 @@ public class QianZhuConfig {
contentMap.put("orderNo", orderNo);
Map<String,Object> 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());

@ -97,7 +97,7 @@ public class BsCompanyServiceImpl implements BsCompanyService {
@Override
public List<BsCompany> getCompany(Map<String, String> map) {
BsCompanyExample example = new BsCompanyExample();
example.createCriteria().andStatusNotEqualTo(0);
example.createCriteria().andIdNotEqualTo(1L).andIdNotEqualTo(2L).andStatusNotEqualTo(0);
return bsCompanyMapper.selectByExample(example);
}

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

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

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

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

Loading…
Cancel
Save