提交代码

master
胡锐 5 months ago
parent 83b0537dfa
commit cac57f0474
  1. 96
      bweb/src/main/java/com/bweb/controller/BsGasChannelConfigController.java
  2. 4
      bweb/src/main/java/com/bweb/controller/BsMerchantAccountController.java
  3. 2
      bweb/src/main/java/com/bweb/controller/SecUserController.java
  4. 18
      cweb/src/main/java/com/cweb/controller/BsGasController.java
  5. 53
      cweb/src/main/java/com/cweb/controller/order/OrderPayController.java
  6. 266
      service/src/main/java/com/hfkj/channel/gas/newlink/NewLinkGasService.java
  7. 209
      service/src/main/java/com/hfkj/channel/gas/newlink/NewLinkRequestService.java
  8. 130
      service/src/main/java/com/hfkj/dao/BsGasChannelConfigMapper.java
  9. 7
      service/src/main/java/com/hfkj/dao/BsGasChannelConfigMapperExt.java
  10. 346
      service/src/main/java/com/hfkj/dao/BsGasChannelConfigSqlProvider.java
  11. 52
      service/src/main/java/com/hfkj/dao/BsGasOilGunNoMapperExt.java
  12. 21
      service/src/main/java/com/hfkj/dao/BsGasOilPriceMapper.java
  13. 14
      service/src/main/java/com/hfkj/dao/BsGasOilPriceSqlProvider.java
  14. 72
      service/src/main/java/com/hfkj/dao/BsGasOrderMapper.java
  15. 42
      service/src/main/java/com/hfkj/dao/BsGasOrderSqlProvider.java
  16. 245
      service/src/main/java/com/hfkj/entity/BsGasChannelConfig.java
  17. 1063
      service/src/main/java/com/hfkj/entity/BsGasChannelConfigExample.java
  18. 16
      service/src/main/java/com/hfkj/entity/BsGasOilPrice.java
  19. 60
      service/src/main/java/com/hfkj/entity/BsGasOilPriceExample.java
  20. 48
      service/src/main/java/com/hfkj/entity/BsGasOrder.java
  21. 190
      service/src/main/java/com/hfkj/entity/BsGasOrderExample.java
  22. 4
      service/src/main/java/com/hfkj/service/agent/impl/BsAgentStaffServiceImpl.java
  23. 17
      service/src/main/java/com/hfkj/service/gas/BsGasOilGunNoService.java
  24. 7
      service/src/main/java/com/hfkj/service/gas/BsGasOilPriceService.java
  25. 20
      service/src/main/java/com/hfkj/service/gas/impl/BsGasOilGunNoServiceImpl.java
  26. 7
      service/src/main/java/com/hfkj/service/gas/impl/BsGasOilPriceServiceImpl.java
  27. 2
      service/src/main/java/com/hfkj/service/gas/impl/BsGasStaffServiceImpl.java
  28. 9
      service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantServiceImpl.java
  29. 28
      service/src/main/java/com/hfkj/service/order/BsGasChannelConfigService.java
  30. 10
      service/src/main/java/com/hfkj/service/order/OrderCreateService.java
  31. 44
      service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java
  32. 17
      service/src/main/java/com/hfkj/service/order/OrderRefundBusiness.java
  33. 57
      service/src/main/java/com/hfkj/service/order/impl/BsGasChannelConfigServiceImpl.java
  34. 11
      service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java
  35. 73
      service/src/main/java/com/hfkj/service/order/impl/BsOrderSettleServiceImpl.java
  36. 16
      service/src/main/java/com/hfkj/sysenum/MerchantSourceTypeEnum.java

@ -0,0 +1,96 @@
package com.bweb.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.BsGasChannelConfig;
import com.hfkj.model.ResponseData;
import com.hfkj.service.order.BsGasChannelConfigService;
import com.hfkj.sysenum.MerchantSourceTypeEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
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.*;
import javax.annotation.Resource;
@Controller
@RequestMapping(value = "/gasChannelConfig")
@Api(value = "加油渠道配置")
public class BsGasChannelConfigController {
private static Logger log = LoggerFactory.getLogger(BsGasChannelConfigController.class);
@Resource
private BsGasChannelConfigService gasChannelConfigService;
@RequestMapping(value = "/editConfig", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "编辑配置")
public ResponseData editConfig(@RequestBody BsGasChannelConfig body) {
try {
if (body == null
|| body.getGasChannelType() == null
|| StringUtils.isBlank(body.getChannelMerNo())
|| StringUtils.isBlank(body.getChannelMerKey())
|| body.getLedgerAccountFlag() == null
) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 查询配置
BsGasChannelConfig config = gasChannelConfigService.getDetail(MerchantSourceTypeEnum.type2);
if (config == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
if(body.getLedgerAccountFlag().equals(true)) {
if (StringUtils.isBlank(body.getLedgerAccountData())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
JSONArray ledgerAccountArray = JSONArray.parseArray(body.getLedgerAccountData());
for (Object obj : ledgerAccountArray) {
JSONObject ledgerAccount = (JSONObject) obj;
if (StringUtils.isBlank(ledgerAccount.getString("receiverMerNo"))
|| StringUtils.isBlank(ledgerAccount.getString("receiverMerName"))
|| ledgerAccount.getBigDecimal("receiverRatio") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
}
config.setLedgerAccountData(body.getLedgerAccountData());
} else {
config.setLedgerAccountData(null);
}
config.setChannelMerNo(body.getChannelMerNo());
config.setChannelMerKey(body.getChannelMerKey());
config.setLedgerAccountFlag(body.getLedgerAccountFlag());
gasChannelConfigService.editData(config);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("BsGasChannelConfigController --> editConfig() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/queryConfig", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取配置")
public ResponseData queryConfig(@RequestParam(name = "gasChannelType", required = true) Integer gasChannelType) {
try {
return ResponseMsgUtil.success(gasChannelConfigService.getDetail(MerchantSourceTypeEnum.getDataByType(gasChannelType)));
} catch (Exception e) {
log.error("BsGasChannelConfigController --> queryConfig() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -83,8 +83,8 @@ public class BsMerchantAccountController {
@RequestMapping(value = "/getMerList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询商户列表")
public ResponseData getMerList(@RequestParam(value = "merNo", required = false) Long merNo,
@RequestParam(value = "merName", required = false) Long merName,
public ResponseData getMerList(@RequestParam(value = "merNo", required = false) String merNo,
@RequestParam(value = "merName", required = false) String merName,
@RequestParam(value = "provinceCode", required = false) Long provinceCode,
@RequestParam(value = "cityCode", required = false) Long cityCode,
@RequestParam(value = "areaCode", required = false) Long areaCode,

@ -60,7 +60,7 @@ public class SecUserController {
}
} else {
secUser = new SecUser();
secUser.setPassword(MD5Util.encode("123456".getBytes()));
secUser.setPassword(MD5Util.encode("123654".getBytes()));
secUser.setObjectType(SecUserObjectTypeEnum.type1.getCode());
secUser.setStatus(SecUserStatusEnum.status1.getCode());

@ -2,6 +2,7 @@ package com.cweb.controller;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hfkj.channel.gas.newlink.NewLinkGasService;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
@ -34,6 +35,23 @@ public class BsGasController {
private BsGasService gasService;
@Resource
private BsAgentPriceService agentPriceService;
@Resource
private NewLinkGasService newLinkGasService;
@RequestMapping(value="/refresh",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "refresh")
public ResponseData refresh() {
try {
newLinkGasService.refresh();
return ResponseMsgUtil.success("");
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/oilPriceCompute",method = RequestMethod.GET)
@ResponseBody

@ -7,14 +7,19 @@ import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.DateUtil;
import com.hfkj.common.utils.RandomUtils;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.BsGasChannelConfig;
import com.hfkj.entity.BsMerchant;
import com.hfkj.entity.BsMerchantPayConfig;
import com.hfkj.entity.BsOrderSettle;
import com.hfkj.model.ResponseData;
import com.hfkj.model.order.OrderModel;
import com.hfkj.pay.HuiPayService;
import com.hfkj.service.merchant.BsMerchantPayConfigService;
import com.hfkj.service.merchant.BsMerchantService;
import com.hfkj.service.order.BsGasChannelConfigService;
import com.hfkj.service.order.BsOrderService;
import com.hfkj.service.order.BsOrderSettleService;
import com.hfkj.sysenum.MerchantSourceTypeEnum;
import com.hfkj.sysenum.order.OrderPayTypeEnum;
import com.hfkj.sysenum.order.OrderSettleLedgerStatusEnum;
import com.hfkj.sysenum.order.OrderStatusEnum;
@ -47,9 +52,13 @@ public class OrderPayController {
@Resource
private BsOrderService orderService;
@Resource
private BsMerchantService merchantService;
@Resource
private BsMerchantPayConfigService merPayConfigService;
@Resource
private BsOrderSettleService orderSettleService;
@Resource
private BsGasChannelConfigService gasChannelConfigService;
@RequestMapping(value="/wechat",method = RequestMethod.POST)
@ResponseBody
@ -71,26 +80,50 @@ public class OrderPayController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "交易订单不处于待支付");
}
String merNo = order.getOrderChildList().get(0).getMerNo();
// 查询平台
BsMerchantPayConfig merPay = merPayConfigService.getConfig(merNo);
if (merPay == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "商户未配置支付");
// 查询商户
BsMerchant merchant = merchantService.getMerchant(merNo);
if (merchant == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户");
}
String payMerNo = "";
String payMerKey = "";
Boolean ledgerAccountFlag = false;
if (merchant.getSourceType().equals(MerchantSourceTypeEnum.type1.getNumber())) {
// 查询平台
BsMerchantPayConfig merPay = merPayConfigService.getConfig(merNo);
if (merPay == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "商户未配置支付");
}
payMerNo = merPay.getChannelMerNo();
payMerKey = merPay.getChannelMerKey();
ledgerAccountFlag = merPay.getLedgerAccountFlag();
} else if (merchant.getSourceType().equals(MerchantSourceTypeEnum.type2.getNumber())) {
// 查询渠道支付配置
BsGasChannelConfig payConfig = gasChannelConfigService.getDetail(MerchantSourceTypeEnum.type2);
if (payConfig == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "商户未配置支付");
}
payMerNo = payConfig.getChannelMerNo();
payMerKey = payConfig.getChannelMerKey();
ledgerAccountFlag = payConfig.getLedgerAccountFlag();
}
order.setPayType(OrderPayTypeEnum.type1.getCode());
// 请求支付渠道
Map<Object, Object> preorder = HuiPayService.preorder(merPay.getChannelMerNo(), merPay.getChannelMerKey(), body.getString("openId"), merPay.getLedgerAccountFlag(), order);
Map<Object, Object> preorder = HuiPayService.preorder(payMerNo, payMerKey, body.getString("openId"), ledgerAccountFlag, order);
// 交易入账
BsOrderSettle orderSettle = orderSettleService.getData(order.getOrderNo());
if (orderSettle == null) {
orderSettle = new BsOrderSettle();
}
orderSettle.setMerNo(merPay.getMerNo());
orderSettle.setMerNo(merNo);
orderSettle.setOrderNo(order.getOrderNo());
orderSettle.setSettleMerNo(merPay.getChannelMerNo());
orderSettle.setSettleMerKey(merPay.getChannelMerKey());
orderSettle.setSettleMerNo(payMerNo);
orderSettle.setSettleMerKey(payMerKey);
orderSettle.setSettleAmount(order.getPayRealPrice());
orderSettle.setLedgerFlag(merPay.getLedgerAccountFlag());
orderSettle.setLedgerFlag(ledgerAccountFlag);
if (orderSettle.getLedgerFlag()) {
orderSettle.setLedgerAmount(order.getPayRealPrice());
orderSettle.setLedgerOrderNo("L"+ DateUtil.date2String(new Date(), "yyMMddHHmmss") + RandomUtils.number(3, false));

@ -0,0 +1,266 @@
package com.hfkj.channel.gas.newlink;
import com.alibaba.excel.util.CollectionUtils;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.entity.BsGasOilGunNo;
import com.hfkj.entity.BsGasOilPrice;
import com.hfkj.entity.BsGasOilPriceExample;
import com.hfkj.entity.BsMerchant;
import com.hfkj.service.gas.BsGasOilGunNoService;
import com.hfkj.service.gas.BsGasOilPriceService;
import com.hfkj.service.gas.BsGasService;
import com.hfkj.service.gas.impl.BsGasOilGunNoServiceImpl;
import com.hfkj.service.merchant.BsMerchantService;
import com.hfkj.sysenum.MerchantSourceTypeEnum;
import com.hfkj.sysenum.MerchantStatusEnum;
import com.hfkj.sysenum.gas.GasOilNoEnum;
import com.hfkj.sysenum.gas.GasOilPriceStatusEnum;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.util.StringUtil;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
* @className: NewLinkGasService
* @author: HuRui
* @date: 2024/7/8
**/
@Component
public class NewLinkGasService {
@Resource
private BsMerchantService merchantService;
@Resource
private BsGasService gasService;
@Resource
private BsGasOilPriceService gasOilPriceService;
@Resource
private BsGasOilGunNoService gasOilGunNoService;
public void refresh() throws Exception {
// 最新全量加油站数据
List<Object> gasDataList = new ArrayList<>();
// 初始化页数
Integer totalPageNum = 3;
for (int pageIndex = 1; pageIndex <= totalPageNum;pageIndex++) {
// 查询油站
JSONObject object = NewLinkRequestService.queryGasInfoListByPage(pageIndex, 3000);
// 总页数
totalPageNum = object.getJSONObject("result").getInteger("totalPageNum");
// 加入全量数据集合
gasDataList.addAll(object.getJSONObject("result").getJSONArray("gasInfoList"));
}
// 设备核心数目
int processorsNum = Runtime.getRuntime().availableProcessors();
Long startTime = System.currentTimeMillis();
System.out.println("本次更新任务开始");
// 初始化线程池
ThreadPoolExecutor threadPool = new ThreadPoolExecutor(
processorsNum * 2,
processorsNum * 2,
4,
TimeUnit.SECONDS,
new ArrayBlockingQueue(processorsNum * 2 * 10),
new ThreadPoolExecutor.DiscardPolicy());
// 大集合拆分成N个小集合,然后用多线程去处理数据,确保不会因为数据量过大导致执行过慢
List<List<Object>> splitNList = splitList(gasDataList, 200);
// 记录单个任务的执行次数
CountDownLatch countDownLatch = new CountDownLatch(splitNList.size());
// 对拆分的集合进行批量处理, 先拆分的集合, 再多线程执行
for (List<Object> singleList : splitNList) {
// 线程池执行
threadPool.execute(new Thread(new Runnable(){
@Override
public void run() {
//模拟执行时间
System.out.println("当前线程:"+Thread.currentThread().getName());
try {
for (Object obj : singleList) {
try {
//组装要执行的批量更新数据
JSONObject gasData = (JSONObject) obj;
// 查询商户
BsMerchant merchant = merchantService.getMerchant(gasData.getString("gasId"));
if (merchant == null) {
merchant = new BsMerchant();
merchant.setStatus(MerchantStatusEnum.status1.getNumber());
}
merchant.setSourceType(MerchantSourceTypeEnum.type2.getNumber());
merchant.setProvinceCode(gasData.getLong("provinceCode"));
merchant.setProvinceName(gasData.getString("provinceName"));
merchant.setCityCode(gasData.getLong("cityCode"));
merchant.setCityName(gasData.getString("cityName"));
merchant.setAreaCode(gasData.getLong("countyCode"));
merchant.setAreaName(gasData.getString("countyName"));
merchant.setMerNo(gasData.getString("gasId"));
merchant.setMerName(gasData.getString("gasName"));
merchant.setMerLogo(gasData.getString("gasLogoBig"));
merchant.setAddress(gasData.getString("gasAddress"));
merchant.setLongitude(gasData.getString("gasAddressLongitude"));
merchant.setLatitude(gasData.getString("gasAddressLatitude"));
merchant.setContactsName(merchant.getMerName());
merchant.setContactsTel(merchant.getMerNo());
merchant.setMerLabel(StringUtils.join(gasData.getJSONArray("gasFeatureList"),","));
if (merchant.getId() == null) {
merchantService.createMerchant(merchant);
} else {
merchantService.updateMerchant(merchant);
}
// 查询油站油价
List<BsGasOilPrice> gasOilPriceList = gasOilPriceService.getGasOilPriceList(merchant.getId());
BsGasOilPrice oilPriceExample = new BsGasOilPrice();
oilPriceExample.setStatus(GasOilPriceStatusEnum.status2.getNumber());
gasOilPriceService.batchUpdate(merchant.getMerNo(), oilPriceExample);
// 查询油站抢号
List<BsGasOilGunNo> oilGunNoList = gasOilGunNoService.getOilGunNoList(merchant.getMerNo());
for (BsGasOilGunNo gunNo : oilGunNoList) {
gunNo.setStatus(0);
}
JSONArray oilPriceList = gasData.getJSONArray("oilPriceList");
for (Object oilPrice : oilPriceList) {
JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice));
// 查询油站油价
List<BsGasOilPrice> oilPriceCollect = gasOilPriceList.stream().filter(o -> o.getOilNo().equals(oilPriceObject.getString("oilNo"))).collect(Collectors.toList());
BsGasOilPrice gasOilPrice = null;
if (oilPriceCollect.isEmpty()) {
gasOilPrice = new BsGasOilPrice();
gasOilPrice.setMerId(merchant.getId());
gasOilPrice.setMerNo(merchant.getMerNo());
gasOilPrice.setOilType(oilPriceObject.getInteger("oilType"));
gasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName"));
gasOilPrice.setOilNo(oilPriceObject.getString("oilNo"));
gasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName"));
gasOilPrice.setStatus(GasOilPriceStatusEnum.status1.getNumber());
} else {
gasOilPrice = oilPriceCollect.get(0);
gasOilPrice.setStatus(GasOilPriceStatusEnum.status1.getNumber());
}
// 平台优惠
gasOilPrice.setPreferentialMargin(new BigDecimal("0"));
// 国标价 - 油站价 = 油站直降
gasOilPrice.setGasStationDrop(oilPriceObject.getBigDecimal("priceOfficial").subtract(oilPriceObject.getBigDecimal("priceGun")));
gasOilPrice.setPriceCost(oilPriceObject.getBigDecimal("priceVip"));
gasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceGun"));
gasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun"));
gasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial"));
gasOilPriceService.editOilPrice(gasOilPrice);
for (Object gunNo : gasData.getJSONArray("gasGunList")) {
JSONObject gunNoObject = (JSONObject) gunNo;
// 查询抢号
List<BsGasOilGunNo> gunNoCollect = oilGunNoList.stream()
.filter(o -> o.getOilNo().equals(gunNoObject.getString("oilNo")) && o.getGunNo().equals(gunNoObject.getString("gunNo")))
.collect(Collectors.toList());
// 如果没有找到抢号就新增一个
BsGasOilGunNo gasOilGunNo = null;
if (gunNoCollect.isEmpty()) {
gasOilGunNo = new BsGasOilGunNo();
gasOilGunNo.setGasOilPriceId(gasOilPrice.getId());
gasOilGunNo.setMerId(gasOilPrice.getMerId());
gasOilGunNo.setMerNo(gasOilPrice.getMerNo());
gasOilGunNo.setOilNo(gasOilPrice.getOilNo());
gasOilGunNo.setOilNoName(gasOilPrice.getOilNoName());
gasOilGunNo.setOilType(gasOilPrice.getOilType());
gasOilGunNo.setOilTypeName(gasOilPrice.getOilTypeName());
gasOilGunNo.setGunNo(gunNoObject.getString("gunNo"));
gasOilGunNo.setStatus(1);
gasOilGunNo.setCreateTime(new Date());
oilGunNoList.add(gasOilGunNo);
} else {
gasOilGunNo = gunNoCollect.get(0);
gasOilGunNo.setStatus(1);
}
}
}
// 添加
gasOilGunNoService.batchInsert(oilGunNoList.stream().filter(o-> o.getId() == null).collect(Collectors.toList()));
// 更新
gasOilGunNoService.batchUpdate(oilGunNoList.stream().filter(o-> o.getId() != null && o.getStatus().equals(0)).collect(Collectors.toList()));
// 删除缓存
gasOilGunNoService.cleanCache(merchant.getMerNo());
// 清除油站缓存
gasService.clean(merchant.getMerNo());
} catch (Exception e) {
System.out.println("更新油站失败");
}
}
} catch (Exception e) {
System.out.println("更新油站出现异常");
System.out.println(e.getMessage());
} finally {
// 任务个数 - 1, 直至为0时唤醒await()
countDownLatch.countDown();
}
}
}));
}
try {
// 让当前线程处于阻塞状态,直到锁存器计数为零
countDownLatch.await();
} catch (Exception e) {
System.out.println("系统出现异常");
}
Long endTime = System.currentTimeMillis();
Long useTime = endTime - startTime;
System.out.println("本次更新任务结束,共计用时"+useTime+"毫秒");
}
/**
* 拆分集合
*
* @param <T> 泛型对象
* @param resList 需要拆分的集合
* @param subListLength 每个子集合的元素个数
* @return 返回拆分后的各个集合组成的列表
**/
public static <T> List<List<T>> splitList(List<T> resList, int subListLength) {
if (CollectionUtils.isEmpty(resList) || subListLength <= 0) {
return new ArrayList<>();
}
List<List<T>> ret = new ArrayList<>();
int size = resList.size();
if (size <= subListLength) {
// 数据量不足 subListLength 指定的大小
ret.add(resList);
} else {
int pre = size / subListLength;
int last = size % subListLength;
// 前面pre个集合,每个大小都是 subListLength 个元素
for (int i = 0; i < pre; i++) {
List<T> itemList = new ArrayList<>(subListLength);
for (int j = 0; j < subListLength; j++) {
itemList.add(resList.get(i * subListLength + j));
}
ret.add(itemList);
}
// last的进行处理
if (last > 0) {
List<T> itemList = new ArrayList<>(last);
for (int i = 0; i < last; i++) {
itemList.add(resList.get(pre * subListLength + i));
}
ret.add(itemList);
}
}
return ret;
}
}

@ -0,0 +1,209 @@
package com.hfkj.channel.gas.newlink;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.common.pay.util.sdk.WXPayConstants;
import com.hfkj.common.utils.HttpsUtils;
import com.hfkj.common.utils.MD5Util;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.*;
/**
* 团游能链渠道服务请求
* @author hurui
*/
public class NewLinkRequestService {
private static final Logger log = LoggerFactory.getLogger(NewLinkRequestService.class);
private static final String REQ_URL = "https://hcs.czb365.com";
private static final String APP_KEY = "305490138943968";
private static final String APP_SECRET = "dbf7dca3de20c2f2a41fd64cfb682be8";
/**
* 分页获取(全量)油站信息
* @param pageIndex 页数
* @param pageSize 单页数据量最大 3000
* @return 请求结果
* @throws Exception
*/
public static JSONObject queryGasInfoListByPage(Integer pageIndex,Integer pageSize) throws Exception {
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("app_key", APP_KEY);
paramMap.put("timestamp", System.currentTimeMillis());
paramMap.put("pageIndex", pageIndex);
paramMap.put("pageSize", pageSize);
paramMap.put("sign", MD5Util.encode(generateTuanYouSignature(paramMap, APP_SECRET).getBytes()).toLowerCase());
return HttpsUtils.doPost(REQ_URL+"/services/vp/openapi/queryGasInfoListByPage", JSON.toJSONString(paramMap));
}
/**
* 根据油站 id 拉取最新的油站数据
* @param gasId 油站 ID
* @return 请求结果
* @throws Exception
*/
public static JSONObject queryGasInfoByGasId(String gasId) throws Exception {
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("app_key", APP_KEY);
paramMap.put("timestamp", System.currentTimeMillis());
paramMap.put("gasId", gasId);
paramMap.put("sign", MD5Util.encode(generateTuanYouSignature(paramMap, APP_SECRET).getBytes()).toLowerCase());
return HttpsUtils.doPost(REQ_URL+"/services/vp/openapi/queryGasInfoByGasId", JSON.toJSONString(paramMap));
}
/**
* 查询油站某油号实时价格
* @param gasId 加油站id
* @param oilNo 油号id
* @return 请求结果
* @throws Exception
*/
public static JSONObject queryCompanyPriceDetail(String gasId,String oilNo) throws Exception {
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("app_key", APP_KEY);
paramMap.put("timestamp", System.currentTimeMillis());
paramMap.put("gasId", gasId);
paramMap.put("oilNo", oilNo);
paramMap.put("sign", MD5Util.encode(generateTuanYouSignature(paramMap,APP_SECRET).getBytes()).toLowerCase());
return HttpsUtils.doPost(REQ_URL+"/services/vp/openapi/queryCompanyPriceDetail", JSON.toJSONString(paramMap));
}
/**
* 推送订单
* @param map
* @return 请求结果
* @throws Exception
*/
public static JSONObject refuelingOrderPush(Map<String,Object> map) throws Exception {
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("app_key", APP_KEY);
paramMap.put("timestamp", System.currentTimeMillis());
for (Map.Entry<String, Object> entry : map.entrySet()) {
paramMap.put(entry.getKey(), entry.getValue().toString());
}
paramMap.put("sign", MD5Util.encode(generateTuanYouSignature(paramMap, APP_SECRET).getBytes()).toLowerCase());
return HttpsUtils.doPost(REQ_URL+"/services/vp/openapi/refuelingOrderPush", JSON.toJSONString(paramMap));
}
/**
* 订单退款
* @param driverPhone 司机手机号
* @param thirdSerialNo 三方订单号
* @param refundReason 退款原因
* @return 请求结果
* @throws Exception
*/
public static JSONObject refuelingOrderRefund(String driverPhone,String thirdSerialNo,String refundReason) throws Exception {
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("app_key", APP_KEY);
paramMap.put("timestamp", System.currentTimeMillis());
paramMap.put("driverPhone", driverPhone);
paramMap.put("thirdSerialNo", thirdSerialNo);
paramMap.put("refundReason", refundReason);
paramMap.put("sign", MD5Util.encode(generateTuanYouSignature(paramMap, APP_SECRET).getBytes()).toLowerCase());
return HttpsUtils.doPost(REQ_URL+"/services/vp/openapi/refuelingOrderRefund", JSON.toJSONString(paramMap));
}
/**
* queryCompanyAccountBalance
* @return 企业余额查询多能源类型
* @throws Exception
*/
public static JSONObject queryCompanyAccountInfo2JD() throws Exception {
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("app_key", APP_KEY);
paramMap.put("timestamp", System.currentTimeMillis());
paramMap.put("companyCode", APP_KEY);
paramMap.put("sign", MD5Util.encode(generateTuanYouSignature(paramMap,APP_SECRET).getBytes()).toLowerCase());
return HttpsUtils.doPost(REQ_URL+"/services/vp/openapi/queryCompanyAccountInfo2JD", JSON.toJSONString(paramMap));
}
/**
* 订单结果查询
* @param thirdSerialNo 三方订单号
* @return 请求结果
* @throws Exception
*/
public static JSONObject queryThirdOrderDetail(String thirdSerialNo) throws Exception {
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("app_key", APP_KEY);
paramMap.put("timestamp", System.currentTimeMillis());
paramMap.put("companyCode", APP_KEY);
paramMap.put("thirdSerialNo", thirdSerialNo);
paramMap.put("sign", MD5Util.encode(generateTuanYouSignature(paramMap,APP_SECRET).getBytes()).toLowerCase());
return HttpsUtils.doPost(REQ_URL+"/services/vp/openapi/queryThirdOrderDetail", JSON.toJSONString(paramMap));
}
/**
* 订单列表查询
* @param companyCode 公司 code AppKey
* @param startTime 查询开始时间 2018-11-30 12:28:55
* @param endTime 查询结束时间 2018-11-30 16:28
* @param page 页码缺省默认 1
* @param rows 每页记录行数缺省默认 20最大值 200
* @param orderPayFlag 订单状态 未支付:1, 已支付:3, 退款中:5, 已退款:6,退款失败:7;
* @return
* @throws Exception
*/
public static JSONObject queryOrderInfoList(String companyCode,String startTime,String endTime,Integer page,Integer rows,Integer orderPayFlag) throws Exception {
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("app_key", APP_KEY);
paramMap.put("timestamp", System.currentTimeMillis());
paramMap.put("companyCode", companyCode);
paramMap.put("startTime", startTime);
paramMap.put("endTime", endTime);
if (page != null) {
paramMap.put("page", page);
}
if (rows != null) {
paramMap.put("rows", rows);
}
if (orderPayFlag != null) {
paramMap.put("orderPayFlag", orderPayFlag);
}
paramMap.put("sign", MD5Util.encode(generateTuanYouSignature(paramMap,APP_SECRET).getBytes()).toLowerCase());
return HttpsUtils.doPost(REQ_URL+"/services/vp/openapi/queryOrderInfoList", JSON.toJSONString(paramMap));
}
/**
* 上汽油站下单结果查询
* @param thirdSerialNo 三方订单号
* @return
* @throws Exception
*/
public static JSONObject loopShangQiOrder(String thirdSerialNo) throws Exception {
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("app_key", APP_KEY);
paramMap.put("timestamp", System.currentTimeMillis());
paramMap.put("thirdSerialNo", thirdSerialNo);
paramMap.put("sign", MD5Util.encode(generateTuanYouSignature(paramMap, APP_SECRET).getBytes()).toLowerCase());
return HttpsUtils.doPost(REQ_URL+"/services/vp/openapi/loopShangQiOrder", JSON.toJSONString(paramMap));
}
/**
* 生成签名
* @param data 数据
* @param key 秘钥app_secret
* @return 加密结果
*/
public static String generateTuanYouSignature(final Map<String, Object> data, String key){
Set<String> keySet = data.keySet();
String[] keyArray = keySet.toArray(new String[keySet.size()]);
Arrays.sort(keyArray);
StringBuilder sb = new StringBuilder();
sb.append(key);
for (String k : keyArray) {
if (k.equals(WXPayConstants.FIELD_SIGN)) {
continue;
}
if (data.get(k) != null) // 参数值为空,则不参与签名
sb.append(k).append(data.get(k));
}
sb.append(key);
return sb.toString();
}
}

@ -0,0 +1,130 @@
package com.hfkj.dao;
import com.hfkj.entity.BsGasChannelConfig;
import com.hfkj.entity.BsGasChannelConfigExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;
import org.springframework.stereotype.Repository;
/**
*
* 代码由工具生成,请勿修改!!!
* 如果需要扩展请在其父类进行扩展
*
**/
@Repository
public interface BsGasChannelConfigMapper extends BsGasChannelConfigMapperExt {
@SelectProvider(type=BsGasChannelConfigSqlProvider.class, method="countByExample")
long countByExample(BsGasChannelConfigExample example);
@DeleteProvider(type=BsGasChannelConfigSqlProvider.class, method="deleteByExample")
int deleteByExample(BsGasChannelConfigExample example);
@Delete({
"delete from bs_gas_channel_config",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_gas_channel_config (gas_channel_type, channel_type, ",
"channel_mer_no, channel_mer_key, ",
"ledger_account_flag, ledger_account_data, ",
"create_time, update_time, ",
"`status`, ext_1, ext_2, ",
"ext_3)",
"values (#{gasChannelType,jdbcType=INTEGER}, #{channelType,jdbcType=INTEGER}, ",
"#{channelMerNo,jdbcType=VARCHAR}, #{channelMerKey,jdbcType=VARCHAR}, ",
"#{ledgerAccountFlag,jdbcType=BIT}, #{ledgerAccountData,jdbcType=VARCHAR}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{status,jdbcType=INTEGER}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ",
"#{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsGasChannelConfig record);
@InsertProvider(type=BsGasChannelConfigSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(BsGasChannelConfig record);
@SelectProvider(type=BsGasChannelConfigSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="gas_channel_type", property="gasChannelType", jdbcType=JdbcType.INTEGER),
@Result(column="channel_type", property="channelType", jdbcType=JdbcType.INTEGER),
@Result(column="channel_mer_no", property="channelMerNo", jdbcType=JdbcType.VARCHAR),
@Result(column="channel_mer_key", property="channelMerKey", jdbcType=JdbcType.VARCHAR),
@Result(column="ledger_account_flag", property="ledgerAccountFlag", jdbcType=JdbcType.BIT),
@Result(column="ledger_account_data", property="ledgerAccountData", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
List<BsGasChannelConfig> selectByExample(BsGasChannelConfigExample example);
@Select({
"select",
"id, gas_channel_type, channel_type, channel_mer_no, channel_mer_key, ledger_account_flag, ",
"ledger_account_data, create_time, update_time, `status`, ext_1, ext_2, ext_3",
"from bs_gas_channel_config",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="gas_channel_type", property="gasChannelType", jdbcType=JdbcType.INTEGER),
@Result(column="channel_type", property="channelType", jdbcType=JdbcType.INTEGER),
@Result(column="channel_mer_no", property="channelMerNo", jdbcType=JdbcType.VARCHAR),
@Result(column="channel_mer_key", property="channelMerKey", jdbcType=JdbcType.VARCHAR),
@Result(column="ledger_account_flag", property="ledgerAccountFlag", jdbcType=JdbcType.BIT),
@Result(column="ledger_account_data", property="ledgerAccountData", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
BsGasChannelConfig selectByPrimaryKey(Long id);
@UpdateProvider(type=BsGasChannelConfigSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") BsGasChannelConfig record, @Param("example") BsGasChannelConfigExample example);
@UpdateProvider(type=BsGasChannelConfigSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") BsGasChannelConfig record, @Param("example") BsGasChannelConfigExample example);
@UpdateProvider(type=BsGasChannelConfigSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(BsGasChannelConfig record);
@Update({
"update bs_gas_channel_config",
"set gas_channel_type = #{gasChannelType,jdbcType=INTEGER},",
"channel_type = #{channelType,jdbcType=INTEGER},",
"channel_mer_no = #{channelMerNo,jdbcType=VARCHAR},",
"channel_mer_key = #{channelMerKey,jdbcType=VARCHAR},",
"ledger_account_flag = #{ledgerAccountFlag,jdbcType=BIT},",
"ledger_account_data = #{ledgerAccountData,jdbcType=VARCHAR},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=TIMESTAMP},",
"`status` = #{status,jdbcType=INTEGER},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR}",
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(BsGasChannelConfig record);
}

@ -0,0 +1,7 @@
package com.hfkj.dao;
/**
* mapper扩展类
*/
public interface BsGasChannelConfigMapperExt {
}

@ -0,0 +1,346 @@
package com.hfkj.dao;
import com.hfkj.entity.BsGasChannelConfig;
import com.hfkj.entity.BsGasChannelConfigExample.Criteria;
import com.hfkj.entity.BsGasChannelConfigExample.Criterion;
import com.hfkj.entity.BsGasChannelConfigExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class BsGasChannelConfigSqlProvider {
public String countByExample(BsGasChannelConfigExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("bs_gas_channel_config");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(BsGasChannelConfigExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("bs_gas_channel_config");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(BsGasChannelConfig record) {
SQL sql = new SQL();
sql.INSERT_INTO("bs_gas_channel_config");
if (record.getGasChannelType() != null) {
sql.VALUES("gas_channel_type", "#{gasChannelType,jdbcType=INTEGER}");
}
if (record.getChannelType() != null) {
sql.VALUES("channel_type", "#{channelType,jdbcType=INTEGER}");
}
if (record.getChannelMerNo() != null) {
sql.VALUES("channel_mer_no", "#{channelMerNo,jdbcType=VARCHAR}");
}
if (record.getChannelMerKey() != null) {
sql.VALUES("channel_mer_key", "#{channelMerKey,jdbcType=VARCHAR}");
}
if (record.getLedgerAccountFlag() != null) {
sql.VALUES("ledger_account_flag", "#{ledgerAccountFlag,jdbcType=BIT}");
}
if (record.getLedgerAccountData() != null) {
sql.VALUES("ledger_account_data", "#{ledgerAccountData,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
if (record.getExt1() != null) {
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}");
}
return sql.toString();
}
public String selectByExample(BsGasChannelConfigExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("gas_channel_type");
sql.SELECT("channel_type");
sql.SELECT("channel_mer_no");
sql.SELECT("channel_mer_key");
sql.SELECT("ledger_account_flag");
sql.SELECT("ledger_account_data");
sql.SELECT("create_time");
sql.SELECT("update_time");
sql.SELECT("`status`");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
sql.FROM("bs_gas_channel_config");
applyWhere(sql, example, false);
if (example != null && example.getOrderByClause() != null) {
sql.ORDER_BY(example.getOrderByClause());
}
return sql.toString();
}
public String updateByExampleSelective(Map<String, Object> parameter) {
BsGasChannelConfig record = (BsGasChannelConfig) parameter.get("record");
BsGasChannelConfigExample example = (BsGasChannelConfigExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("bs_gas_channel_config");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getGasChannelType() != null) {
sql.SET("gas_channel_type = #{record.gasChannelType,jdbcType=INTEGER}");
}
if (record.getChannelType() != null) {
sql.SET("channel_type = #{record.channelType,jdbcType=INTEGER}");
}
if (record.getChannelMerNo() != null) {
sql.SET("channel_mer_no = #{record.channelMerNo,jdbcType=VARCHAR}");
}
if (record.getChannelMerKey() != null) {
sql.SET("channel_mer_key = #{record.channelMerKey,jdbcType=VARCHAR}");
}
if (record.getLedgerAccountFlag() != null) {
sql.SET("ledger_account_flag = #{record.ledgerAccountFlag,jdbcType=BIT}");
}
if (record.getLedgerAccountData() != null) {
sql.SET("ledger_account_data = #{record.ledgerAccountData,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
}
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByExample(Map<String, Object> parameter) {
SQL sql = new SQL();
sql.UPDATE("bs_gas_channel_config");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("gas_channel_type = #{record.gasChannelType,jdbcType=INTEGER}");
sql.SET("channel_type = #{record.channelType,jdbcType=INTEGER}");
sql.SET("channel_mer_no = #{record.channelMerNo,jdbcType=VARCHAR}");
sql.SET("channel_mer_key = #{record.channelMerKey,jdbcType=VARCHAR}");
sql.SET("ledger_account_flag = #{record.ledgerAccountFlag,jdbcType=BIT}");
sql.SET("ledger_account_data = #{record.ledgerAccountData,jdbcType=VARCHAR}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
BsGasChannelConfigExample example = (BsGasChannelConfigExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(BsGasChannelConfig record) {
SQL sql = new SQL();
sql.UPDATE("bs_gas_channel_config");
if (record.getGasChannelType() != null) {
sql.SET("gas_channel_type = #{gasChannelType,jdbcType=INTEGER}");
}
if (record.getChannelType() != null) {
sql.SET("channel_type = #{channelType,jdbcType=INTEGER}");
}
if (record.getChannelMerNo() != null) {
sql.SET("channel_mer_no = #{channelMerNo,jdbcType=VARCHAR}");
}
if (record.getChannelMerKey() != null) {
sql.SET("channel_mer_key = #{channelMerKey,jdbcType=VARCHAR}");
}
if (record.getLedgerAccountFlag() != null) {
sql.SET("ledger_account_flag = #{ledgerAccountFlag,jdbcType=BIT}");
}
if (record.getLedgerAccountData() != null) {
sql.SET("ledger_account_data = #{ledgerAccountData,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}");
}
sql.WHERE("id = #{id,jdbcType=BIGINT}");
return sql.toString();
}
protected void applyWhere(SQL sql, BsGasChannelConfigExample example, boolean includeExamplePhrase) {
if (example == null) {
return;
}
String parmPhrase1;
String parmPhrase1_th;
String parmPhrase2;
String parmPhrase2_th;
String parmPhrase3;
String parmPhrase3_th;
if (includeExamplePhrase) {
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
} else {
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
}
StringBuilder sb = new StringBuilder();
List<Criteria> oredCriteria = example.getOredCriteria();
boolean firstCriteria = true;
for (int i = 0; i < oredCriteria.size(); i++) {
Criteria criteria = oredCriteria.get(i);
if (criteria.isValid()) {
if (firstCriteria) {
firstCriteria = false;
} else {
sb.append(" or ");
}
sb.append('(');
List<Criterion> criterions = criteria.getAllCriteria();
boolean firstCriterion = true;
for (int j = 0; j < criterions.size(); j++) {
Criterion criterion = criterions.get(j);
if (firstCriterion) {
firstCriterion = false;
} else {
sb.append(" and ");
}
if (criterion.isNoValue()) {
sb.append(criterion.getCondition());
} else if (criterion.isSingleValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j));
} else {
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler()));
}
} else if (criterion.isBetweenValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j));
} else {
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler()));
}
} else if (criterion.isListValue()) {
sb.append(criterion.getCondition());
sb.append(" (");
List<?> listItems = (List<?>) criterion.getValue();
boolean comma = false;
for (int k = 0; k < listItems.size(); k++) {
if (comma) {
sb.append(", ");
} else {
comma = true;
}
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase3, i, j, k));
} else {
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler()));
}
}
sb.append(')');
}
}
sb.append(')');
}
}
if (sb.length() > 0) {
sql.WHERE(sb.toString());
}
}
}

@ -1,7 +1,59 @@
package com.hfkj.dao;
import com.hfkj.entity.BsGasOilGunNo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import java.util.List;
/**
* mapper扩展类
*/
public interface BsGasOilGunNoMapperExt {
@Insert({
"<script>" +
"insert into bs_gas_oil_gun_no (gas_oil_price_id, mer_id, ",
"mer_no, oil_type, ",
"oil_type_name, oil_no, ",
"oil_no_name, gun_no, ",
"`status`, create_time, ",
"ext_1, ext_2, ext_3)",
"values " +
"<foreach collection='list' item='item' separator=','>",
" (#{item.gasOilPriceId}, #{item.merId}, ",
" #{item.merNo}, #{item.oilType}, ",
" #{item.oilTypeName}, #{item.oilNo}, ",
" #{item.oilNoName}, #{item.gunNo}, ",
" #{item.status}, #{item.createTime}, ",
" #{item.ext1}, #{item.ext2}, #{item.ext3})" +
"</foreach>" +
"</script>",
})
void batchInsert(@Param(value = "list") List<BsGasOilGunNo> list);
@Update({
"<script>" +
"<foreach collection='list' item='item' separator=';'>",
" update bs_gas_oil_gun_no",
" set" +
" gas_oil_price_id = #{item.gasOilPriceId},",
" mer_id = #{item.merId},",
" mer_no = #{item.merNo},",
" oil_type = #{item.oilType},",
" oil_type_name = #{item.oilTypeName},",
" oil_no = #{item.oilNo},",
" oil_no_name = #{item.oilNoName},",
" gun_no = #{item.gunNo},",
" `status` = #{item.status},",
" create_time = #{item.createTime},",
" ext_1 = #{item.ext1},",
" ext_2 = #{item.ext2},",
" ext_3 = #{item.ext3}",
" where id = #{item.id}",
"</foreach>" +
"</script>",
})
void batchUpdate(@Param(value = "list") List<BsGasOilGunNo> list);
}

@ -44,17 +44,19 @@ public interface BsGasOilPriceMapper extends BsGasOilPriceMapperExt {
"oil_no, oil_no_name, ",
"preferential_margin, gas_station_drop, ",
"price_official, price_gun, ",
"price_vip, create_time, ",
"update_time, `status`, ",
"ext_1, ext_2, ext_3)",
"price_vip, price_cost, ",
"create_time, update_time, ",
"`status`, ext_1, ext_2, ",
"ext_3)",
"values (#{merId,jdbcType=BIGINT}, #{merNo,jdbcType=VARCHAR}, ",
"#{oilType,jdbcType=INTEGER}, #{oilTypeName,jdbcType=VARCHAR}, ",
"#{oilNo,jdbcType=VARCHAR}, #{oilNoName,jdbcType=VARCHAR}, ",
"#{preferentialMargin,jdbcType=DECIMAL}, #{gasStationDrop,jdbcType=DECIMAL}, ",
"#{priceOfficial,jdbcType=DECIMAL}, #{priceGun,jdbcType=DECIMAL}, ",
"#{priceVip,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"#{priceVip,jdbcType=DECIMAL}, #{priceCost,jdbcType=DECIMAL}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{status,jdbcType=INTEGER}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ",
"#{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsGasOilPrice record);
@ -77,6 +79,7 @@ public interface BsGasOilPriceMapper extends BsGasOilPriceMapperExt {
@Result(column="price_official", property="priceOfficial", jdbcType=JdbcType.DECIMAL),
@Result(column="price_gun", property="priceGun", jdbcType=JdbcType.DECIMAL),
@Result(column="price_vip", property="priceVip", jdbcType=JdbcType.DECIMAL),
@Result(column="price_cost", property="priceCost", jdbcType=JdbcType.DECIMAL),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@ -89,8 +92,8 @@ public interface BsGasOilPriceMapper extends BsGasOilPriceMapperExt {
@Select({
"select",
"id, mer_id, mer_no, oil_type, oil_type_name, oil_no, oil_no_name, preferential_margin, ",
"gas_station_drop, price_official, price_gun, price_vip, create_time, update_time, ",
"`status`, ext_1, ext_2, ext_3",
"gas_station_drop, price_official, price_gun, price_vip, price_cost, create_time, ",
"update_time, `status`, ext_1, ext_2, ext_3",
"from bs_gas_oil_price",
"where id = #{id,jdbcType=BIGINT}"
})
@ -107,6 +110,7 @@ public interface BsGasOilPriceMapper extends BsGasOilPriceMapperExt {
@Result(column="price_official", property="priceOfficial", jdbcType=JdbcType.DECIMAL),
@Result(column="price_gun", property="priceGun", jdbcType=JdbcType.DECIMAL),
@Result(column="price_vip", property="priceVip", jdbcType=JdbcType.DECIMAL),
@Result(column="price_cost", property="priceCost", jdbcType=JdbcType.DECIMAL),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@ -138,6 +142,7 @@ public interface BsGasOilPriceMapper extends BsGasOilPriceMapperExt {
"price_official = #{priceOfficial,jdbcType=DECIMAL},",
"price_gun = #{priceGun,jdbcType=DECIMAL},",
"price_vip = #{priceVip,jdbcType=DECIMAL},",
"price_cost = #{priceCost,jdbcType=DECIMAL},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=TIMESTAMP},",
"`status` = #{status,jdbcType=INTEGER},",

@ -72,6 +72,10 @@ public class BsGasOilPriceSqlProvider {
sql.VALUES("price_vip", "#{priceVip,jdbcType=DECIMAL}");
}
if (record.getPriceCost() != null) {
sql.VALUES("price_cost", "#{priceCost,jdbcType=DECIMAL}");
}
if (record.getCreateTime() != null) {
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
}
@ -117,6 +121,7 @@ public class BsGasOilPriceSqlProvider {
sql.SELECT("price_official");
sql.SELECT("price_gun");
sql.SELECT("price_vip");
sql.SELECT("price_cost");
sql.SELECT("create_time");
sql.SELECT("update_time");
sql.SELECT("`status`");
@ -188,6 +193,10 @@ public class BsGasOilPriceSqlProvider {
sql.SET("price_vip = #{record.priceVip,jdbcType=DECIMAL}");
}
if (record.getPriceCost() != null) {
sql.SET("price_cost = #{record.priceCost,jdbcType=DECIMAL}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
}
@ -232,6 +241,7 @@ public class BsGasOilPriceSqlProvider {
sql.SET("price_official = #{record.priceOfficial,jdbcType=DECIMAL}");
sql.SET("price_gun = #{record.priceGun,jdbcType=DECIMAL}");
sql.SET("price_vip = #{record.priceVip,jdbcType=DECIMAL}");
sql.SET("price_cost = #{record.priceCost,jdbcType=DECIMAL}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
@ -292,6 +302,10 @@ public class BsGasOilPriceSqlProvider {
sql.SET("price_vip = #{priceVip,jdbcType=DECIMAL}");
}
if (record.getPriceCost() != null) {
sql.SET("price_cost = #{priceCost,jdbcType=DECIMAL}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
}

@ -52,18 +52,20 @@ public interface BsGasOrderMapper extends BsGasOrderMapperExt {
"gas_oil_no, gas_gun_no, ",
"gas_oil_type, gas_price_official, ",
"gas_price_gun, gas_price_vip, ",
"gas_price_platform, gas_oil_liters, ",
"gas_discount, gas_oil_subsidy, ",
"gas_liters_preferences, gas_price_preferences, ",
"gas_class_group_id, gas_class_group_name, ",
"gas_class_group_task_id, gas_staff_id, ",
"gas_staff_name, pay_type, ",
"pay_serial_no, pay_channel_order_no, ",
"`status`, create_time, ",
"cancel_time, pay_time, ",
"refund_time, refund_remarks, ",
"ext_1, ext_2, ext_3, ",
"ext_4, ext_5, ext_6)",
"gas_price_platform, gas_price_cost, ",
"gas_oil_liters, gas_discount, ",
"gas_oil_subsidy, gas_liters_preferences, ",
"gas_price_preferences, gas_class_group_id, ",
"gas_class_group_name, gas_class_group_task_id, ",
"gas_staff_id, gas_staff_name, ",
"pay_type, pay_serial_no, ",
"pay_channel_order_no, `status`, ",
"create_time, cancel_time, ",
"pay_time, refund_time, ",
"refund_remarks, abnormal, ",
"abnormal_content, ext_1, ",
"ext_2, ext_3, ext_4, ",
"ext_5, ext_6)",
"values (#{orderNo,jdbcType=VARCHAR}, #{orderChildNo,jdbcType=VARCHAR}, ",
"#{channelType,jdbcType=INTEGER}, #{channelOrderNo,jdbcType=VARCHAR}, ",
"#{agentId,jdbcType=BIGINT}, #{agentName,jdbcType=VARCHAR}, ",
@ -77,18 +79,20 @@ public interface BsGasOrderMapper extends BsGasOrderMapperExt {
"#{gasOilNo,jdbcType=VARCHAR}, #{gasGunNo,jdbcType=VARCHAR}, ",
"#{gasOilType,jdbcType=INTEGER}, #{gasPriceOfficial,jdbcType=DECIMAL}, ",
"#{gasPriceGun,jdbcType=DECIMAL}, #{gasPriceVip,jdbcType=DECIMAL}, ",
"#{gasPricePlatform,jdbcType=DECIMAL}, #{gasOilLiters,jdbcType=DECIMAL}, ",
"#{gasDiscount,jdbcType=DECIMAL}, #{gasOilSubsidy,jdbcType=DECIMAL}, ",
"#{gasLitersPreferences,jdbcType=DECIMAL}, #{gasPricePreferences,jdbcType=DECIMAL}, ",
"#{gasClassGroupId,jdbcType=BIGINT}, #{gasClassGroupName,jdbcType=VARCHAR}, ",
"#{gasClassGroupTaskId,jdbcType=BIGINT}, #{gasStaffId,jdbcType=BIGINT}, ",
"#{gasStaffName,jdbcType=VARCHAR}, #{payType,jdbcType=INTEGER}, ",
"#{paySerialNo,jdbcType=VARCHAR}, #{payChannelOrderNo,jdbcType=VARCHAR}, ",
"#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{cancelTime,jdbcType=TIMESTAMP}, #{payTime,jdbcType=TIMESTAMP}, ",
"#{refundTime,jdbcType=TIMESTAMP}, #{refundRemarks,jdbcType=VARCHAR}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR}, ",
"#{ext4,jdbcType=VARCHAR}, #{ext5,jdbcType=VARCHAR}, #{ext6,jdbcType=VARCHAR})"
"#{gasPricePlatform,jdbcType=DECIMAL}, #{gasPriceCost,jdbcType=DECIMAL}, ",
"#{gasOilLiters,jdbcType=DECIMAL}, #{gasDiscount,jdbcType=DECIMAL}, ",
"#{gasOilSubsidy,jdbcType=DECIMAL}, #{gasLitersPreferences,jdbcType=DECIMAL}, ",
"#{gasPricePreferences,jdbcType=DECIMAL}, #{gasClassGroupId,jdbcType=BIGINT}, ",
"#{gasClassGroupName,jdbcType=VARCHAR}, #{gasClassGroupTaskId,jdbcType=BIGINT}, ",
"#{gasStaffId,jdbcType=BIGINT}, #{gasStaffName,jdbcType=VARCHAR}, ",
"#{payType,jdbcType=INTEGER}, #{paySerialNo,jdbcType=VARCHAR}, ",
"#{payChannelOrderNo,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{cancelTime,jdbcType=TIMESTAMP}, ",
"#{payTime,jdbcType=TIMESTAMP}, #{refundTime,jdbcType=TIMESTAMP}, ",
"#{refundRemarks,jdbcType=VARCHAR}, #{abnormal,jdbcType=BIT}, ",
"#{abnormalContent,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR}, #{ext4,jdbcType=VARCHAR}, ",
"#{ext5,jdbcType=VARCHAR}, #{ext6,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsGasOrder record);
@ -128,6 +132,7 @@ public interface BsGasOrderMapper extends BsGasOrderMapperExt {
@Result(column="gas_price_gun", property="gasPriceGun", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_price_vip", property="gasPriceVip", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_price_platform", property="gasPricePlatform", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_price_cost", property="gasPriceCost", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_oil_liters", property="gasOilLiters", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_discount", property="gasDiscount", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_oil_subsidy", property="gasOilSubsidy", jdbcType=JdbcType.DECIMAL),
@ -147,6 +152,8 @@ public interface BsGasOrderMapper extends BsGasOrderMapperExt {
@Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="refund_remarks", property="refundRemarks", jdbcType=JdbcType.VARCHAR),
@Result(column="abnormal", property="abnormal", jdbcType=JdbcType.BIT),
@Result(column="abnormal_content", property="abnormalContent", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR),
@ -163,11 +170,12 @@ public interface BsGasOrderMapper extends BsGasOrderMapperExt {
"mer_address, total_deduction_price, deduction_coupon_price, deduction_oil_price, ",
"pay_integral, payable_price, actual_pay_price, gas_refuel_price, gas_oil_no, ",
"gas_gun_no, gas_oil_type, gas_price_official, gas_price_gun, gas_price_vip, ",
"gas_price_platform, gas_oil_liters, gas_discount, gas_oil_subsidy, gas_liters_preferences, ",
"gas_price_preferences, gas_class_group_id, gas_class_group_name, gas_class_group_task_id, ",
"gas_staff_id, gas_staff_name, pay_type, pay_serial_no, pay_channel_order_no, ",
"`status`, create_time, cancel_time, pay_time, refund_time, refund_remarks, ext_1, ",
"ext_2, ext_3, ext_4, ext_5, ext_6",
"gas_price_platform, gas_price_cost, gas_oil_liters, gas_discount, gas_oil_subsidy, ",
"gas_liters_preferences, gas_price_preferences, gas_class_group_id, gas_class_group_name, ",
"gas_class_group_task_id, gas_staff_id, gas_staff_name, pay_type, pay_serial_no, ",
"pay_channel_order_no, `status`, create_time, cancel_time, pay_time, refund_time, ",
"refund_remarks, abnormal, abnormal_content, ext_1, ext_2, ext_3, ext_4, ext_5, ",
"ext_6",
"from bs_gas_order",
"where id = #{id,jdbcType=BIGINT}"
})
@ -201,6 +209,7 @@ public interface BsGasOrderMapper extends BsGasOrderMapperExt {
@Result(column="gas_price_gun", property="gasPriceGun", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_price_vip", property="gasPriceVip", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_price_platform", property="gasPricePlatform", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_price_cost", property="gasPriceCost", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_oil_liters", property="gasOilLiters", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_discount", property="gasDiscount", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_oil_subsidy", property="gasOilSubsidy", jdbcType=JdbcType.DECIMAL),
@ -220,6 +229,8 @@ public interface BsGasOrderMapper extends BsGasOrderMapperExt {
@Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="refund_remarks", property="refundRemarks", jdbcType=JdbcType.VARCHAR),
@Result(column="abnormal", property="abnormal", jdbcType=JdbcType.BIT),
@Result(column="abnormal_content", property="abnormalContent", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR),
@ -268,6 +279,7 @@ public interface BsGasOrderMapper extends BsGasOrderMapperExt {
"gas_price_gun = #{gasPriceGun,jdbcType=DECIMAL},",
"gas_price_vip = #{gasPriceVip,jdbcType=DECIMAL},",
"gas_price_platform = #{gasPricePlatform,jdbcType=DECIMAL},",
"gas_price_cost = #{gasPriceCost,jdbcType=DECIMAL},",
"gas_oil_liters = #{gasOilLiters,jdbcType=DECIMAL},",
"gas_discount = #{gasDiscount,jdbcType=DECIMAL},",
"gas_oil_subsidy = #{gasOilSubsidy,jdbcType=DECIMAL},",
@ -287,6 +299,8 @@ public interface BsGasOrderMapper extends BsGasOrderMapperExt {
"pay_time = #{payTime,jdbcType=TIMESTAMP},",
"refund_time = #{refundTime,jdbcType=TIMESTAMP},",
"refund_remarks = #{refundRemarks,jdbcType=VARCHAR},",
"abnormal = #{abnormal,jdbcType=BIT},",
"abnormal_content = #{abnormalContent,jdbcType=VARCHAR},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR},",

@ -140,6 +140,10 @@ public class BsGasOrderSqlProvider {
sql.VALUES("gas_price_platform", "#{gasPricePlatform,jdbcType=DECIMAL}");
}
if (record.getGasPriceCost() != null) {
sql.VALUES("gas_price_cost", "#{gasPriceCost,jdbcType=DECIMAL}");
}
if (record.getGasOilLiters() != null) {
sql.VALUES("gas_oil_liters", "#{gasOilLiters,jdbcType=DECIMAL}");
}
@ -216,6 +220,14 @@ public class BsGasOrderSqlProvider {
sql.VALUES("refund_remarks", "#{refundRemarks,jdbcType=VARCHAR}");
}
if (record.getAbnormal() != null) {
sql.VALUES("abnormal", "#{abnormal,jdbcType=BIT}");
}
if (record.getAbnormalContent() != null) {
sql.VALUES("abnormal_content", "#{abnormalContent,jdbcType=VARCHAR}");
}
if (record.getExt1() != null) {
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}");
}
@ -278,6 +290,7 @@ public class BsGasOrderSqlProvider {
sql.SELECT("gas_price_gun");
sql.SELECT("gas_price_vip");
sql.SELECT("gas_price_platform");
sql.SELECT("gas_price_cost");
sql.SELECT("gas_oil_liters");
sql.SELECT("gas_discount");
sql.SELECT("gas_oil_subsidy");
@ -297,6 +310,8 @@ public class BsGasOrderSqlProvider {
sql.SELECT("pay_time");
sql.SELECT("refund_time");
sql.SELECT("refund_remarks");
sql.SELECT("abnormal");
sql.SELECT("abnormal_content");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
@ -436,6 +451,10 @@ public class BsGasOrderSqlProvider {
sql.SET("gas_price_platform = #{record.gasPricePlatform,jdbcType=DECIMAL}");
}
if (record.getGasPriceCost() != null) {
sql.SET("gas_price_cost = #{record.gasPriceCost,jdbcType=DECIMAL}");
}
if (record.getGasOilLiters() != null) {
sql.SET("gas_oil_liters = #{record.gasOilLiters,jdbcType=DECIMAL}");
}
@ -512,6 +531,14 @@ public class BsGasOrderSqlProvider {
sql.SET("refund_remarks = #{record.refundRemarks,jdbcType=VARCHAR}");
}
if (record.getAbnormal() != null) {
sql.SET("abnormal = #{record.abnormal,jdbcType=BIT}");
}
if (record.getAbnormalContent() != null) {
sql.SET("abnormal_content = #{record.abnormalContent,jdbcType=VARCHAR}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
}
@ -573,6 +600,7 @@ public class BsGasOrderSqlProvider {
sql.SET("gas_price_gun = #{record.gasPriceGun,jdbcType=DECIMAL}");
sql.SET("gas_price_vip = #{record.gasPriceVip,jdbcType=DECIMAL}");
sql.SET("gas_price_platform = #{record.gasPricePlatform,jdbcType=DECIMAL}");
sql.SET("gas_price_cost = #{record.gasPriceCost,jdbcType=DECIMAL}");
sql.SET("gas_oil_liters = #{record.gasOilLiters,jdbcType=DECIMAL}");
sql.SET("gas_discount = #{record.gasDiscount,jdbcType=DECIMAL}");
sql.SET("gas_oil_subsidy = #{record.gasOilSubsidy,jdbcType=DECIMAL}");
@ -592,6 +620,8 @@ public class BsGasOrderSqlProvider {
sql.SET("pay_time = #{record.payTime,jdbcType=TIMESTAMP}");
sql.SET("refund_time = #{record.refundTime,jdbcType=TIMESTAMP}");
sql.SET("refund_remarks = #{record.refundRemarks,jdbcType=VARCHAR}");
sql.SET("abnormal = #{record.abnormal,jdbcType=BIT}");
sql.SET("abnormal_content = #{record.abnormalContent,jdbcType=VARCHAR}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
@ -720,6 +750,10 @@ public class BsGasOrderSqlProvider {
sql.SET("gas_price_platform = #{gasPricePlatform,jdbcType=DECIMAL}");
}
if (record.getGasPriceCost() != null) {
sql.SET("gas_price_cost = #{gasPriceCost,jdbcType=DECIMAL}");
}
if (record.getGasOilLiters() != null) {
sql.SET("gas_oil_liters = #{gasOilLiters,jdbcType=DECIMAL}");
}
@ -796,6 +830,14 @@ public class BsGasOrderSqlProvider {
sql.SET("refund_remarks = #{refundRemarks,jdbcType=VARCHAR}");
}
if (record.getAbnormal() != null) {
sql.SET("abnormal = #{abnormal,jdbcType=BIT}");
}
if (record.getAbnormalContent() != null) {
sql.SET("abnormal_content = #{abnormalContent,jdbcType=VARCHAR}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}");
}

@ -0,0 +1,245 @@
package com.hfkj.entity;
import java.io.Serializable;
import java.util.Date;
/**
* bs_gas_channel_config
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class BsGasChannelConfig implements Serializable {
private Long id;
/**
* 油站渠道
*/
private Integer gasChannelType;
/**
* 支付渠道类型
*/
private Integer channelType;
/**
* 支付渠道商户号
*/
private String channelMerNo;
/**
* 支付渠道商户秘钥
*/
private String channelMerKey;
/**
* 是否分账 0
*/
private Boolean ledgerAccountFlag;
/**
* 分账接收方数据
*/
private String ledgerAccountData;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改时间
*/
private Date updateTime;
/**
* 状态 1正常 2停用
*/
private Integer status;
private String ext1;
private String ext2;
private String ext3;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Integer getGasChannelType() {
return gasChannelType;
}
public void setGasChannelType(Integer gasChannelType) {
this.gasChannelType = gasChannelType;
}
public Integer getChannelType() {
return channelType;
}
public void setChannelType(Integer channelType) {
this.channelType = channelType;
}
public String getChannelMerNo() {
return channelMerNo;
}
public void setChannelMerNo(String channelMerNo) {
this.channelMerNo = channelMerNo;
}
public String getChannelMerKey() {
return channelMerKey;
}
public void setChannelMerKey(String channelMerKey) {
this.channelMerKey = channelMerKey;
}
public Boolean getLedgerAccountFlag() {
return ledgerAccountFlag;
}
public void setLedgerAccountFlag(Boolean ledgerAccountFlag) {
this.ledgerAccountFlag = ledgerAccountFlag;
}
public String getLedgerAccountData() {
return ledgerAccountData;
}
public void setLedgerAccountData(String ledgerAccountData) {
this.ledgerAccountData = ledgerAccountData;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getExt1() {
return ext1;
}
public void setExt1(String ext1) {
this.ext1 = ext1;
}
public String getExt2() {
return ext2;
}
public void setExt2(String ext2) {
this.ext2 = ext2;
}
public String getExt3() {
return ext3;
}
public void setExt3(String ext3) {
this.ext3 = ext3;
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
BsGasChannelConfig other = (BsGasChannelConfig) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getGasChannelType() == null ? other.getGasChannelType() == null : this.getGasChannelType().equals(other.getGasChannelType()))
&& (this.getChannelType() == null ? other.getChannelType() == null : this.getChannelType().equals(other.getChannelType()))
&& (this.getChannelMerNo() == null ? other.getChannelMerNo() == null : this.getChannelMerNo().equals(other.getChannelMerNo()))
&& (this.getChannelMerKey() == null ? other.getChannelMerKey() == null : this.getChannelMerKey().equals(other.getChannelMerKey()))
&& (this.getLedgerAccountFlag() == null ? other.getLedgerAccountFlag() == null : this.getLedgerAccountFlag().equals(other.getLedgerAccountFlag()))
&& (this.getLedgerAccountData() == null ? other.getLedgerAccountData() == null : this.getLedgerAccountData().equals(other.getLedgerAccountData()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1()))
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2()))
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getGasChannelType() == null) ? 0 : getGasChannelType().hashCode());
result = prime * result + ((getChannelType() == null) ? 0 : getChannelType().hashCode());
result = prime * result + ((getChannelMerNo() == null) ? 0 : getChannelMerNo().hashCode());
result = prime * result + ((getChannelMerKey() == null) ? 0 : getChannelMerKey().hashCode());
result = prime * result + ((getLedgerAccountFlag() == null) ? 0 : getLedgerAccountFlag().hashCode());
result = prime * result + ((getLedgerAccountData() == null) ? 0 : getLedgerAccountData().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode());
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode());
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", gasChannelType=").append(gasChannelType);
sb.append(", channelType=").append(channelType);
sb.append(", channelMerNo=").append(channelMerNo);
sb.append(", channelMerKey=").append(channelMerKey);
sb.append(", ledgerAccountFlag=").append(ledgerAccountFlag);
sb.append(", ledgerAccountData=").append(ledgerAccountData);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", status=").append(status);
sb.append(", ext1=").append(ext1);
sb.append(", ext2=").append(ext2);
sb.append(", ext3=").append(ext3);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

@ -74,6 +74,11 @@ public class BsGasOilPrice implements Serializable {
*/
private BigDecimal priceVip;
/**
* 成本价
*/
private BigDecimal priceCost;
/**
* 创建时间
*/
@ -193,6 +198,14 @@ public class BsGasOilPrice implements Serializable {
this.priceVip = priceVip;
}
public BigDecimal getPriceCost() {
return priceCost;
}
public void setPriceCost(BigDecimal priceCost) {
this.priceCost = priceCost;
}
public Date getCreateTime() {
return createTime;
}
@ -265,6 +278,7 @@ public class BsGasOilPrice implements Serializable {
&& (this.getPriceOfficial() == null ? other.getPriceOfficial() == null : this.getPriceOfficial().equals(other.getPriceOfficial()))
&& (this.getPriceGun() == null ? other.getPriceGun() == null : this.getPriceGun().equals(other.getPriceGun()))
&& (this.getPriceVip() == null ? other.getPriceVip() == null : this.getPriceVip().equals(other.getPriceVip()))
&& (this.getPriceCost() == null ? other.getPriceCost() == null : this.getPriceCost().equals(other.getPriceCost()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
@ -289,6 +303,7 @@ public class BsGasOilPrice implements Serializable {
result = prime * result + ((getPriceOfficial() == null) ? 0 : getPriceOfficial().hashCode());
result = prime * result + ((getPriceGun() == null) ? 0 : getPriceGun().hashCode());
result = prime * result + ((getPriceVip() == null) ? 0 : getPriceVip().hashCode());
result = prime * result + ((getPriceCost() == null) ? 0 : getPriceCost().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
@ -316,6 +331,7 @@ public class BsGasOilPrice implements Serializable {
sb.append(", priceOfficial=").append(priceOfficial);
sb.append(", priceGun=").append(priceGun);
sb.append(", priceVip=").append(priceVip);
sb.append(", priceCost=").append(priceCost);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", status=").append(status);

@ -886,6 +886,66 @@ public class BsGasOilPriceExample {
return (Criteria) this;
}
public Criteria andPriceCostIsNull() {
addCriterion("price_cost is null");
return (Criteria) this;
}
public Criteria andPriceCostIsNotNull() {
addCriterion("price_cost is not null");
return (Criteria) this;
}
public Criteria andPriceCostEqualTo(BigDecimal value) {
addCriterion("price_cost =", value, "priceCost");
return (Criteria) this;
}
public Criteria andPriceCostNotEqualTo(BigDecimal value) {
addCriterion("price_cost <>", value, "priceCost");
return (Criteria) this;
}
public Criteria andPriceCostGreaterThan(BigDecimal value) {
addCriterion("price_cost >", value, "priceCost");
return (Criteria) this;
}
public Criteria andPriceCostGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("price_cost >=", value, "priceCost");
return (Criteria) this;
}
public Criteria andPriceCostLessThan(BigDecimal value) {
addCriterion("price_cost <", value, "priceCost");
return (Criteria) this;
}
public Criteria andPriceCostLessThanOrEqualTo(BigDecimal value) {
addCriterion("price_cost <=", value, "priceCost");
return (Criteria) this;
}
public Criteria andPriceCostIn(List<BigDecimal> values) {
addCriterion("price_cost in", values, "priceCost");
return (Criteria) this;
}
public Criteria andPriceCostNotIn(List<BigDecimal> values) {
addCriterion("price_cost not in", values, "priceCost");
return (Criteria) this;
}
public Criteria andPriceCostBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("price_cost between", value1, value2, "priceCost");
return (Criteria) this;
}
public Criteria andPriceCostNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("price_cost not between", value1, value2, "priceCost");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;

@ -159,6 +159,11 @@ public class BsGasOrder implements Serializable {
*/
private BigDecimal gasPricePlatform;
/**
* 加油站成本价
*/
private BigDecimal gasPriceCost;
/**
* 加油站加油升数
*/
@ -260,6 +265,16 @@ public class BsGasOrder implements Serializable {
*/
private String refundRemarks;
/**
* 异常状态 0正常 1异常
*/
private Boolean abnormal;
/**
* 异常内容
*/
private String abnormalContent;
private String ext1;
private String ext2;
@ -506,6 +521,14 @@ public class BsGasOrder implements Serializable {
this.gasPricePlatform = gasPricePlatform;
}
public BigDecimal getGasPriceCost() {
return gasPriceCost;
}
public void setGasPriceCost(BigDecimal gasPriceCost) {
this.gasPriceCost = gasPriceCost;
}
public BigDecimal getGasOilLiters() {
return gasOilLiters;
}
@ -658,6 +681,22 @@ public class BsGasOrder implements Serializable {
this.refundRemarks = refundRemarks;
}
public Boolean getAbnormal() {
return abnormal;
}
public void setAbnormal(Boolean abnormal) {
this.abnormal = abnormal;
}
public String getAbnormalContent() {
return abnormalContent;
}
public void setAbnormalContent(String abnormalContent) {
this.abnormalContent = abnormalContent;
}
public String getExt1() {
return ext1;
}
@ -747,6 +786,7 @@ public class BsGasOrder implements Serializable {
&& (this.getGasPriceGun() == null ? other.getGasPriceGun() == null : this.getGasPriceGun().equals(other.getGasPriceGun()))
&& (this.getGasPriceVip() == null ? other.getGasPriceVip() == null : this.getGasPriceVip().equals(other.getGasPriceVip()))
&& (this.getGasPricePlatform() == null ? other.getGasPricePlatform() == null : this.getGasPricePlatform().equals(other.getGasPricePlatform()))
&& (this.getGasPriceCost() == null ? other.getGasPriceCost() == null : this.getGasPriceCost().equals(other.getGasPriceCost()))
&& (this.getGasOilLiters() == null ? other.getGasOilLiters() == null : this.getGasOilLiters().equals(other.getGasOilLiters()))
&& (this.getGasDiscount() == null ? other.getGasDiscount() == null : this.getGasDiscount().equals(other.getGasDiscount()))
&& (this.getGasOilSubsidy() == null ? other.getGasOilSubsidy() == null : this.getGasOilSubsidy().equals(other.getGasOilSubsidy()))
@ -766,6 +806,8 @@ public class BsGasOrder implements Serializable {
&& (this.getPayTime() == null ? other.getPayTime() == null : this.getPayTime().equals(other.getPayTime()))
&& (this.getRefundTime() == null ? other.getRefundTime() == null : this.getRefundTime().equals(other.getRefundTime()))
&& (this.getRefundRemarks() == null ? other.getRefundRemarks() == null : this.getRefundRemarks().equals(other.getRefundRemarks()))
&& (this.getAbnormal() == null ? other.getAbnormal() == null : this.getAbnormal().equals(other.getAbnormal()))
&& (this.getAbnormalContent() == null ? other.getAbnormalContent() == null : this.getAbnormalContent().equals(other.getAbnormalContent()))
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1()))
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2()))
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3()))
@ -807,6 +849,7 @@ public class BsGasOrder implements Serializable {
result = prime * result + ((getGasPriceGun() == null) ? 0 : getGasPriceGun().hashCode());
result = prime * result + ((getGasPriceVip() == null) ? 0 : getGasPriceVip().hashCode());
result = prime * result + ((getGasPricePlatform() == null) ? 0 : getGasPricePlatform().hashCode());
result = prime * result + ((getGasPriceCost() == null) ? 0 : getGasPriceCost().hashCode());
result = prime * result + ((getGasOilLiters() == null) ? 0 : getGasOilLiters().hashCode());
result = prime * result + ((getGasDiscount() == null) ? 0 : getGasDiscount().hashCode());
result = prime * result + ((getGasOilSubsidy() == null) ? 0 : getGasOilSubsidy().hashCode());
@ -826,6 +869,8 @@ public class BsGasOrder implements Serializable {
result = prime * result + ((getPayTime() == null) ? 0 : getPayTime().hashCode());
result = prime * result + ((getRefundTime() == null) ? 0 : getRefundTime().hashCode());
result = prime * result + ((getRefundRemarks() == null) ? 0 : getRefundRemarks().hashCode());
result = prime * result + ((getAbnormal() == null) ? 0 : getAbnormal().hashCode());
result = prime * result + ((getAbnormalContent() == null) ? 0 : getAbnormalContent().hashCode());
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode());
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode());
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode());
@ -870,6 +915,7 @@ public class BsGasOrder implements Serializable {
sb.append(", gasPriceGun=").append(gasPriceGun);
sb.append(", gasPriceVip=").append(gasPriceVip);
sb.append(", gasPricePlatform=").append(gasPricePlatform);
sb.append(", gasPriceCost=").append(gasPriceCost);
sb.append(", gasOilLiters=").append(gasOilLiters);
sb.append(", gasDiscount=").append(gasDiscount);
sb.append(", gasOilSubsidy=").append(gasOilSubsidy);
@ -889,6 +935,8 @@ public class BsGasOrder implements Serializable {
sb.append(", payTime=").append(payTime);
sb.append(", refundTime=").append(refundTime);
sb.append(", refundRemarks=").append(refundRemarks);
sb.append(", abnormal=").append(abnormal);
sb.append(", abnormalContent=").append(abnormalContent);
sb.append(", ext1=").append(ext1);
sb.append(", ext2=").append(ext2);
sb.append(", ext3=").append(ext3);

@ -1976,6 +1976,66 @@ public class BsGasOrderExample {
return (Criteria) this;
}
public Criteria andGasPriceCostIsNull() {
addCriterion("gas_price_cost is null");
return (Criteria) this;
}
public Criteria andGasPriceCostIsNotNull() {
addCriterion("gas_price_cost is not null");
return (Criteria) this;
}
public Criteria andGasPriceCostEqualTo(BigDecimal value) {
addCriterion("gas_price_cost =", value, "gasPriceCost");
return (Criteria) this;
}
public Criteria andGasPriceCostNotEqualTo(BigDecimal value) {
addCriterion("gas_price_cost <>", value, "gasPriceCost");
return (Criteria) this;
}
public Criteria andGasPriceCostGreaterThan(BigDecimal value) {
addCriterion("gas_price_cost >", value, "gasPriceCost");
return (Criteria) this;
}
public Criteria andGasPriceCostGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("gas_price_cost >=", value, "gasPriceCost");
return (Criteria) this;
}
public Criteria andGasPriceCostLessThan(BigDecimal value) {
addCriterion("gas_price_cost <", value, "gasPriceCost");
return (Criteria) this;
}
public Criteria andGasPriceCostLessThanOrEqualTo(BigDecimal value) {
addCriterion("gas_price_cost <=", value, "gasPriceCost");
return (Criteria) this;
}
public Criteria andGasPriceCostIn(List<BigDecimal> values) {
addCriterion("gas_price_cost in", values, "gasPriceCost");
return (Criteria) this;
}
public Criteria andGasPriceCostNotIn(List<BigDecimal> values) {
addCriterion("gas_price_cost not in", values, "gasPriceCost");
return (Criteria) this;
}
public Criteria andGasPriceCostBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("gas_price_cost between", value1, value2, "gasPriceCost");
return (Criteria) this;
}
public Criteria andGasPriceCostNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("gas_price_cost not between", value1, value2, "gasPriceCost");
return (Criteria) this;
}
public Criteria andGasOilLitersIsNull() {
addCriterion("gas_oil_liters is null");
return (Criteria) this;
@ -3166,6 +3226,136 @@ public class BsGasOrderExample {
return (Criteria) this;
}
public Criteria andAbnormalIsNull() {
addCriterion("abnormal is null");
return (Criteria) this;
}
public Criteria andAbnormalIsNotNull() {
addCriterion("abnormal is not null");
return (Criteria) this;
}
public Criteria andAbnormalEqualTo(Boolean value) {
addCriterion("abnormal =", value, "abnormal");
return (Criteria) this;
}
public Criteria andAbnormalNotEqualTo(Boolean value) {
addCriterion("abnormal <>", value, "abnormal");
return (Criteria) this;
}
public Criteria andAbnormalGreaterThan(Boolean value) {
addCriterion("abnormal >", value, "abnormal");
return (Criteria) this;
}
public Criteria andAbnormalGreaterThanOrEqualTo(Boolean value) {
addCriterion("abnormal >=", value, "abnormal");
return (Criteria) this;
}
public Criteria andAbnormalLessThan(Boolean value) {
addCriterion("abnormal <", value, "abnormal");
return (Criteria) this;
}
public Criteria andAbnormalLessThanOrEqualTo(Boolean value) {
addCriterion("abnormal <=", value, "abnormal");
return (Criteria) this;
}
public Criteria andAbnormalIn(List<Boolean> values) {
addCriterion("abnormal in", values, "abnormal");
return (Criteria) this;
}
public Criteria andAbnormalNotIn(List<Boolean> values) {
addCriterion("abnormal not in", values, "abnormal");
return (Criteria) this;
}
public Criteria andAbnormalBetween(Boolean value1, Boolean value2) {
addCriterion("abnormal between", value1, value2, "abnormal");
return (Criteria) this;
}
public Criteria andAbnormalNotBetween(Boolean value1, Boolean value2) {
addCriterion("abnormal not between", value1, value2, "abnormal");
return (Criteria) this;
}
public Criteria andAbnormalContentIsNull() {
addCriterion("abnormal_content is null");
return (Criteria) this;
}
public Criteria andAbnormalContentIsNotNull() {
addCriterion("abnormal_content is not null");
return (Criteria) this;
}
public Criteria andAbnormalContentEqualTo(String value) {
addCriterion("abnormal_content =", value, "abnormalContent");
return (Criteria) this;
}
public Criteria andAbnormalContentNotEqualTo(String value) {
addCriterion("abnormal_content <>", value, "abnormalContent");
return (Criteria) this;
}
public Criteria andAbnormalContentGreaterThan(String value) {
addCriterion("abnormal_content >", value, "abnormalContent");
return (Criteria) this;
}
public Criteria andAbnormalContentGreaterThanOrEqualTo(String value) {
addCriterion("abnormal_content >=", value, "abnormalContent");
return (Criteria) this;
}
public Criteria andAbnormalContentLessThan(String value) {
addCriterion("abnormal_content <", value, "abnormalContent");
return (Criteria) this;
}
public Criteria andAbnormalContentLessThanOrEqualTo(String value) {
addCriterion("abnormal_content <=", value, "abnormalContent");
return (Criteria) this;
}
public Criteria andAbnormalContentLike(String value) {
addCriterion("abnormal_content like", value, "abnormalContent");
return (Criteria) this;
}
public Criteria andAbnormalContentNotLike(String value) {
addCriterion("abnormal_content not like", value, "abnormalContent");
return (Criteria) this;
}
public Criteria andAbnormalContentIn(List<String> values) {
addCriterion("abnormal_content in", values, "abnormalContent");
return (Criteria) this;
}
public Criteria andAbnormalContentNotIn(List<String> values) {
addCriterion("abnormal_content not in", values, "abnormalContent");
return (Criteria) this;
}
public Criteria andAbnormalContentBetween(String value1, String value2) {
addCriterion("abnormal_content between", value1, value2, "abnormalContent");
return (Criteria) this;
}
public Criteria andAbnormalContentNotBetween(String value1, String value2) {
addCriterion("abnormal_content not between", value1, value2, "abnormalContent");
return (Criteria) this;
}
public Criteria andExt1IsNull() {
addCriterion("ext_1 is null");
return (Criteria) this;

@ -61,7 +61,7 @@ public class BsAgentStaffServiceImpl implements BsAgentStaffService {
secUser.setAvatar(agentStaff.getAvatar());
secUser.setUserName(agentStaff.getName());
secUser.setLoginName(agentStaff.getTelephone());
secUser.setPassword(MD5Util.encode("123456".getBytes()));
secUser.setPassword(MD5Util.encode("123654".getBytes()));
secUser.setStatus(1);
secUser.setRoleId(6L);
secUser.setObjectType(SecUserObjectTypeEnum.type5.getCode());
@ -122,7 +122,7 @@ public class BsAgentStaffServiceImpl implements BsAgentStaffService {
if (account == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到工作人员账户信息");
}
account.setPassword(MD5Util.encode("123456".getBytes()));
account.setPassword(MD5Util.encode("123654".getBytes()));
userService.editUser(account);
} catch (Exception e) {

@ -18,6 +18,23 @@ public interface BsGasOilGunNoService {
*/
void editData(BsGasOilGunNo data);
/**
* 清除缓存
* @param merNo
*/
void cleanCache(String merNo);
/**
* 批量增加
* @param dataList
*/
void batchInsert(List<BsGasOilGunNo> dataList);
/**
*
*/
void batchUpdate(List<BsGasOilGunNo> dataList);
/**
* 删除
* @param gunNoId

@ -18,6 +18,13 @@ public interface BsGasOilPriceService {
*/
void editData(BsGasOilPrice data);
/**
* 批量修改
* @param merNo
* @param gasOilPrice
*/
void batchUpdate(String merNo,BsGasOilPrice gasOilPrice);
/**
* 编辑价格
* @param data

@ -12,6 +12,7 @@ import com.hfkj.service.gas.BsGasService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@ -45,6 +46,25 @@ public class BsGasOilGunNoServiceImpl implements BsGasOilGunNoService {
joinCache(data.getMerNo());
}
@Override
public void cleanCache(String merNo) {
redisUtil.del(GAS_OIL_NO_KEY + merNo);
}
@Override
public void batchInsert(List<BsGasOilGunNo> dataList) {
if (!dataList.isEmpty()) {
gasOilGunNoMapper.batchInsert(dataList);
}
}
@Override
public void batchUpdate(List<BsGasOilGunNo> dataList) {
if (!dataList.isEmpty()) {
gasOilGunNoMapper.batchUpdate(dataList);
}
}
@Override
public void delete(Long gunNoId) {
BsGasOilGunNo oilGunNo = getDetail(gunNoId);

@ -50,6 +50,13 @@ public class BsGasOilPriceServiceImpl implements BsGasOilPriceService {
}
}
@Override
public void batchUpdate(String merNo, BsGasOilPrice gasOilPrice) {
BsGasOilPriceExample example = new BsGasOilPriceExample();
example.createCriteria().andMerNoEqualTo(merNo);
gasOilPriceMapper.updateByExampleSelective(gasOilPrice, example);
}
@Override
public void editOilPrice(BsGasOilPrice data) {
editData(data);

@ -80,7 +80,7 @@ public class BsGasStaffServiceImpl implements BsGasStaffService {
secUser.setAvatar(gasStaff.getAvatar());
secUser.setUserName(gasStaff.getName());
secUser.setLoginName(gasStaff.getTelephone());
secUser.setPassword(MD5Util.encode("123456".getBytes()));
secUser.setPassword(MD5Util.encode("123654".getBytes()));
secUser.setStatus(1);
secUser.setRoleId(4L);
secUser.setObjectType(SecUserObjectTypeEnum.type3.getCode());

@ -67,8 +67,6 @@ public class BsMerchantServiceImpl implements BsMerchantService {
@Transactional(propagation= Propagation.REQUIRES_NEW,rollbackFor= {RuntimeException.class})
public void createMerchant(BsMerchant merchant) throws Exception {
editData(merchant);
merchant.setMerNo(""+(10000 + merchant.getId()));
editData(merchant);
if (secUserService.getDetailByLoginName(merchant.getContactsTel()) != null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "手机号已存在,请更换");
@ -76,6 +74,9 @@ public class BsMerchantServiceImpl implements BsMerchantService {
// 自建站
if (merchant.getSourceType().equals(MerchantSourceTypeEnum.type1.getNumber())) {
merchant.setMerNo(""+(10000 + merchant.getId()));
editData(merchant);
BsMerchantAccount account = new BsMerchantAccount();
account.setMerId(merchant.getId());
account.setMerNo(merchant.getMerNo());
@ -87,7 +88,7 @@ public class BsMerchantServiceImpl implements BsMerchantService {
SecUser secUser = new SecUser();
secUser.setUserName(merchant.getMerName());
secUser.setLoginName(merchant.getContactsTel());
secUser.setPassword(MD5Util.encode("123456".getBytes()));
secUser.setPassword(MD5Util.encode("123654".getBytes()));
secUser.setObjectType(SecUserObjectTypeEnum.type2.getCode());
secUser.setObjectId(merchant.getId());
secUser.setRoleId(3L);
@ -124,7 +125,7 @@ public class BsMerchantServiceImpl implements BsMerchantService {
if (secUser == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知商户登录账户");
}
secUser.setPassword(MD5Util.encode("123456".getBytes()));
secUser.setPassword(MD5Util.encode("123654".getBytes()));
secUserService.editUser(secUser);
}

@ -0,0 +1,28 @@
package com.hfkj.service.order;
import com.hfkj.entity.BsGasChannelConfig;
import com.hfkj.sysenum.MerchantSourceTypeEnum;
import com.hfkj.sysenum.order.OrderPayChannelEnum;
import com.hfkj.sysenum.order.OrderPayTypeEnum;
/**
* @className: BsGasChannelConfigService
* @author: HuRui
* @date: 2024/7/10
**/
public interface BsGasChannelConfigService {
/**
* 编辑数据
* @param gasChannelConfig
*/
void editData(BsGasChannelConfig gasChannelConfig);
/**
* 查询详情
* @param gasSourceType
* @return
*/
BsGasChannelConfig getDetail(MerchantSourceTypeEnum gasSourceType);
}

@ -60,6 +60,15 @@ public class OrderCreateService {
if (gasOilType == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知油品类型");
}
// 汽油限制加油金额
if ("1".equals(gasOilType.getExt1())) {
SecDictionary priceLimit = secDictionaryService.getDictionary("GAS_REFUEL_PRICE_LIMIT", "1");
if (priceLimit!=null) {
if (orderChild.getProductPrice().compareTo(new BigDecimal(priceLimit.getCodeName())) > 0) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "加油单笔限制" + priceLimit.getCodeName()+"元");
}
}
}
// 查询油站
BsMerchant merchant = merchantService.getMerchant(orderChild.getMerNo());
if (merchant == null) {
@ -73,6 +82,7 @@ public class OrderCreateService {
GasPayPriceModel priceModel = gasService.refuelPriceCompute(orderChild.getProductPrice(), merchant.getMerNo(), orderChild.getGasOilNo(), orderChild.getAgentMerId());
BsGasOrder gasOrder = new BsGasOrder();
gasOrder.setAbnormal(false);
gasOrder.setMerNo(merchant.getMerNo());
gasOrder.setChannelType(merchant.getSourceType());
gasOrder.setOrderNo(orderChild.getOrderNo());

@ -1,13 +1,19 @@
package com.hfkj.service.order;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.channel.gas.newlink.NewLinkGasService;
import com.hfkj.channel.gas.newlink.NewLinkRequestService;
import com.hfkj.entity.BsGasOrder;
import com.hfkj.entity.BsMerchantUser;
import com.hfkj.entity.BsOrderChild;
import com.hfkj.entity.SecDictionary;
import com.hfkj.model.order.OrderModel;
import com.hfkj.service.BsDeviceService;
import com.hfkj.service.CommonService;
import com.hfkj.service.merchant.BsMerchantAccountService;
import com.hfkj.service.merchant.BsMerchantUserService;
import com.hfkj.service.gas.BsGasOrderService;
import com.hfkj.service.sec.SecDictionaryService;
import com.hfkj.sysenum.MerchantSourceTypeEnum;
import com.hfkj.sysenum.gas.OrderOilStatus;
import com.hfkj.sysenum.merchant.MerchantAccountRecordSourceTypeEnum;
@ -30,6 +36,8 @@ import java.util.Map;
public class OrderPaySuccessService {
Logger log = LoggerFactory.getLogger(OrderPaySuccessService.class);
@Resource
private SecDictionaryService dictionaryService;
@Resource
private BsOrderService orderService;
@Resource
private BsGasOrderService gasOrderService;
@ -39,6 +47,7 @@ public class OrderPaySuccessService {
private BsDeviceService deviceService;
@Resource
private BsMerchantAccountService merchantAccountService;
/**
* 订单业务处理
* @param order
@ -74,11 +83,42 @@ public class OrderPaySuccessService {
gasOrderService.updateGasOrder(gasOrder);
if (gasOrder.getChannelType().equals(MerchantSourceTypeEnum.type1.getNumber())) {
// 自建站
Map<String,Object> consumeMap = new HashMap<>();
consumeMap.put("sourceType", MerchantAccountRecordSourceTypeEnum.type2.getType());
consumeMap.put("sourceId", gasOrder.getId());
consumeMap.put("sourceOrderNo", gasOrder.getOrderNo());
merchantAccountService.consume(gasOrder.getMerNo(), gasOrder.getGasRefuelPrice(), consumeMap);
// 打印小票
if (gasOrder.getChannelType().equals(MerchantSourceTypeEnum.type1.getNumber())) {
deviceService.printGasOrder(gasOrder.getMerId(), gasOrder, false );
}
} else if (gasOrder.getChannelType().equals(MerchantSourceTypeEnum.type2.getNumber())) {
// 能链【团油】
Map<String, Object> param = new HashMap<>();
param.put("gasId", gasOrder.getMerNo());
param.put("oilNo", gasOrder.getGasOilNo());
param.put("gunNo", gasOrder.getGasGunNo());
param.put("priceGun", gasOrder.getGasPriceGun()); // 油站价
param.put("priceVip", gasOrder.getGasPriceCost()); // 成本价
param.put("driverPhone", gasOrder.getUserPhone());
param.put("thirdSerialNo", gasOrder.getOrderNo());
param.put("refuelingAmount", gasOrder.getGasRefuelPrice());
// 查询账户
SecDictionary newLinkAccount = dictionaryService.getDictionary("NEW_LINK_ACCOUNT", "" + gasOrder.getGasOilType());
if (newLinkAccount != null) {
param.put("accountNo", newLinkAccount.getCodeName());
}
JSONObject pushResult = NewLinkRequestService.refuelingOrderPush(param);
if (pushResult != null && pushResult.getString("code").equals("200")) {
gasOrder.setChannelOrderNo(pushResult.getJSONObject("result").getString("orderNo"));
} else {
gasOrder.setAbnormal(true);
gasOrder.setAbnormalContent(pushResult.getString("message"));
}
gasOrderService.updateGasOrder(gasOrder);
}
if (StringUtils.isNotBlank(gasOrder.getUserPhone())) {
@ -100,10 +140,6 @@ public class OrderPaySuccessService {
// TODO 赠送积分
}
// 打印小票
if (gasOrder.getChannelType().equals(MerchantSourceTypeEnum.type1.getNumber())) {
deviceService.printGasOrder(gasOrder.getMerId(), gasOrder, false );
}
}
}

@ -1,5 +1,7 @@
package com.hfkj.service.order;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.channel.gas.newlink.NewLinkRequestService;
import com.hfkj.entity.BsGasOrder;
import com.hfkj.entity.BsMerchantAccount;
import com.hfkj.entity.BsOrderChild;
@ -7,6 +9,7 @@ import com.hfkj.entity.BsOrderRefund;
import com.hfkj.model.order.OrderChildModel;
import com.hfkj.service.gas.BsGasOrderService;
import com.hfkj.service.merchant.BsMerchantAccountService;
import com.hfkj.sysenum.MerchantSourceTypeEnum;
import com.hfkj.sysenum.gas.OrderOilStatus;
import com.hfkj.sysenum.merchant.MerchantAccountRecordSourceTypeEnum;
import org.springframework.stereotype.Component;
@ -44,8 +47,18 @@ public class OrderRefundBusiness {
gasOrderService.updateGasOrder(gasOrder);
try {
// 退回商户额度
merchantAccountService.refund(gasOrder.getMerNo(), gasOrder.getGasRefuelPrice(), refund);
if (gasOrder.getChannelType().equals(MerchantSourceTypeEnum.type1.getNumber())) {
// 退回商户额度
merchantAccountService.refund(gasOrder.getMerNo(), gasOrder.getGasRefuelPrice(), refund);
} else if (gasOrder.getChannelType().equals(MerchantSourceTypeEnum.type2.getNumber())) {
JSONObject object = NewLinkRequestService.refuelingOrderRefund(gasOrder.getUserPhone(), gasOrder.getOrderNo(), refund.getRefundRemark());
if (object == null || !object.getString("code").equals("200")) {
gasOrder.setAbnormal(true);
gasOrder.setAbnormalContent("渠道退款失败!");
gasOrderService.updateGasOrder(gasOrder);
}
}
} catch (Exception e) {}
}
}

@ -0,0 +1,57 @@
package com.hfkj.service.order.impl;
import com.hfkj.common.utils.RedisUtil;
import com.hfkj.dao.BsGasChannelConfigMapper;
import com.hfkj.entity.BsGasChannelConfig;
import com.hfkj.entity.BsGasChannelConfigExample;
import com.hfkj.service.order.BsGasChannelConfigService;
import com.hfkj.sysenum.MerchantSourceTypeEnum;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
/**
* @className: BsGasChannelConfigServiceImpl
* @author: HuRui
* @date: 2024/7/10
**/
@Service("")
public class BsGasChannelConfigServiceImpl implements BsGasChannelConfigService {
@Resource
private BsGasChannelConfigMapper gasChannelConfigMapper;
private final static String CACHE_KEY = "GAS_CHANNEL_CONFIG:";
@Resource
private RedisUtil redisUtil;
@Override
public void editData(BsGasChannelConfig gasChannelConfig) {
gasChannelConfig.setUpdateTime(new Date());
if (gasChannelConfig.getId() == null) {
gasChannelConfig.setCreateTime(new Date());
gasChannelConfigMapper.insert(gasChannelConfig);
} else {
gasChannelConfigMapper.updateByPrimaryKey(gasChannelConfig);
}
// 存入缓存
redisUtil.set(CACHE_KEY+gasChannelConfig.getChannelType(), gasChannelConfig);
}
@Override
public BsGasChannelConfig getDetail(MerchantSourceTypeEnum gasSourceType) {
Object obj = redisUtil.get(CACHE_KEY + gasSourceType);
if (obj != null) {
return (BsGasChannelConfig) obj;
}
BsGasChannelConfigExample example = new BsGasChannelConfigExample();
example.createCriteria().andGasChannelTypeEqualTo(gasSourceType.getNumber());
List<BsGasChannelConfig> list = gasChannelConfigMapper.selectByExample(example);
if (!list.isEmpty()) {
BsGasChannelConfig gasChannelConfig = list.get(0);
// 存入缓存
redisUtil.set(CACHE_KEY+gasChannelConfig.getChannelType(), gasChannelConfig);
return gasChannelConfig;
}
return null;
}
}

@ -369,11 +369,14 @@ public class BsOrderServiceImpl implements BsOrderService {
System.out.println("业务处理异常");
}
// 分账业务
try {
Message<OrderModel> rocketMsg = MessageBuilder.withPayload(order).build();
rocketMQTemplate.syncSend(OrderTopic.ORDER_TOPIC_PROFIT_SHARING.getTopic(), rocketMsg,1000);
// 查询订单结算
BsOrderSettle orderSettle = orderSettleService.getData(order.getOrderNo());
if (orderSettle != null && orderSettle.getLedgerFlag().equals(true)) {
// 分账业务
Message<OrderModel> rocketMsg = MessageBuilder.withPayload(order).build();
rocketMQTemplate.syncSend(OrderTopic.ORDER_TOPIC_PROFIT_SHARING.getTopic(), rocketMsg,1000);
}
} catch (Exception e) {
System.out.println("分账处理异常");
}

@ -3,14 +3,14 @@ package com.hfkj.service.order.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.dao.BsOrderSettleMapper;
import com.hfkj.entity.BsMerchantPayConfig;
import com.hfkj.entity.BsOrderSettle;
import com.hfkj.entity.BsOrderSettleExample;
import com.hfkj.entity.BsOrderSettleLedger;
import com.hfkj.entity.*;
import com.hfkj.pay.HuiPayService;
import com.hfkj.service.merchant.BsMerchantPayConfigService;
import com.hfkj.service.merchant.BsMerchantService;
import com.hfkj.service.order.BsGasChannelConfigService;
import com.hfkj.service.order.BsOrderSettleLedgerService;
import com.hfkj.service.order.BsOrderSettleService;
import com.hfkj.sysenum.MerchantSourceTypeEnum;
import com.hfkj.sysenum.order.OrderSettleLedgerStatusEnum;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
@ -33,9 +33,13 @@ public class BsOrderSettleServiceImpl implements BsOrderSettleService {
@Resource
private BsOrderSettleMapper orderSettleMapper;
@Resource
private BsMerchantService merchantService;
@Resource
private BsOrderSettleLedgerService orderSettleLedgerService;
@Resource
private BsMerchantPayConfigService merchantPayConfigService;
@Resource
private BsGasChannelConfigService gasChannelConfigService;
@Override
public void editData(BsOrderSettle data) {
@ -61,25 +65,51 @@ public class BsOrderSettleServiceImpl implements BsOrderSettleService {
@Override
public void separate(BsOrderSettle orderSettle) {
// 查询商户配置
BsMerchantPayConfig payConfig = merchantPayConfigService.getConfig(orderSettle.getMerNo());
if (payConfig != null && StringUtils.isNotBlank(payConfig.getLedgerAccountData())) {
// 查询商户
BsMerchant merchant = merchantService.getMerchant(orderSettle.getMerNo());
if (merchant != null) {
List<BsOrderSettleLedger> settleLedgerList = new ArrayList<>();
// 分账接收方数据
JSONArray ledgerAccountData = JSONArray.parseArray(payConfig.getLedgerAccountData());
for (Object obj : ledgerAccountData) {
JSONObject ledgerAccount = (JSONObject) obj;
BsOrderSettleLedger settleLedger = new BsOrderSettleLedger();
settleLedger.setOrderSettleId(orderSettle.getId());
settleLedger.setSharingAmount(orderSettle.getSettleAmount());
settleLedger.setRatio(ledgerAccount.getBigDecimal("receiverRatio"));
settleLedger.setReceiverMerNo(ledgerAccount.getString("receiverMerNo"));
settleLedger.setReceiverMerName(ledgerAccount.getString("receiverMerName"));
settleLedger.setReceiverAmount(settleLedger.getSharingAmount().multiply(settleLedger.getRatio().divide(new BigDecimal("100"))));
settleLedger.setStatus(0);
orderSettleLedgerService.editData(settleLedger);
if (merchant.getSourceType().equals(MerchantSourceTypeEnum.type1.getNumber())) {
// 查询商户配置
BsMerchantPayConfig payConfig = merchantPayConfigService.getConfig(orderSettle.getMerNo());
if (payConfig != null && StringUtils.isNotBlank(payConfig.getLedgerAccountData())) {
// 分账接收方数据
JSONArray ledgerAccountData = JSONArray.parseArray(payConfig.getLedgerAccountData());
for (Object obj : ledgerAccountData) {
JSONObject ledgerAccount = (JSONObject) obj;
BsOrderSettleLedger settleLedger = new BsOrderSettleLedger();
settleLedger.setOrderSettleId(orderSettle.getId());
settleLedger.setSharingAmount(orderSettle.getSettleAmount());
settleLedger.setRatio(ledgerAccount.getBigDecimal("receiverRatio"));
settleLedger.setReceiverMerNo(ledgerAccount.getString("receiverMerNo"));
settleLedger.setReceiverMerName(ledgerAccount.getString("receiverMerName"));
settleLedger.setReceiverAmount(settleLedger.getSharingAmount().multiply(settleLedger.getRatio().divide(new BigDecimal("100"))));
settleLedger.setStatus(0);
orderSettleLedgerService.editData(settleLedger);
settleLedgerList.add(settleLedger);
}
}
settleLedgerList.add(settleLedger);
} else if (merchant.getSourceType().equals(MerchantSourceTypeEnum.type2.getNumber())) {
// 查询商户配置
BsGasChannelConfig gasChannelConfig = gasChannelConfigService.getDetail(MerchantSourceTypeEnum.type2);
if (gasChannelConfig != null && StringUtils.isNotBlank(gasChannelConfig.getLedgerAccountData())) {
// 分账接收方数据
JSONArray ledgerAccountData = JSONArray.parseArray(gasChannelConfig.getLedgerAccountData());
for (Object obj : ledgerAccountData) {
JSONObject ledgerAccount = (JSONObject) obj;
BsOrderSettleLedger settleLedger = new BsOrderSettleLedger();
settleLedger.setOrderSettleId(orderSettle.getId());
settleLedger.setSharingAmount(orderSettle.getSettleAmount());
settleLedger.setRatio(ledgerAccount.getBigDecimal("receiverRatio"));
settleLedger.setReceiverMerNo(ledgerAccount.getString("receiverMerNo"));
settleLedger.setReceiverMerName(ledgerAccount.getString("receiverMerName"));
settleLedger.setReceiverAmount(settleLedger.getSharingAmount().multiply(settleLedger.getRatio().divide(new BigDecimal("100"))));
settleLedger.setStatus(0);
orderSettleLedgerService.editData(settleLedger);
settleLedgerList.add(settleLedger);
}
}
}
// 请求分账
@ -89,7 +119,6 @@ public class BsOrderSettleServiceImpl implements BsOrderSettleService {
editData(orderSettle);
}
}
}
@Override

@ -11,7 +11,14 @@ import java.util.Objects;
**/
@Getter
public enum MerchantSourceTypeEnum {
/**
* 自建站
*/
type1(1, "自建站"),
/**
* 能链团油
*/
type2(2, "能链【团油】"),
;
private Integer number;
@ -23,6 +30,15 @@ public enum MerchantSourceTypeEnum {
this.name = name;
}
public static MerchantSourceTypeEnum getDataByType(Integer type) {
for (MerchantSourceTypeEnum ele : values()) {
if (Objects.equals(type,ele.getNumber())) {
return ele;
}
}
return null;
}
public static String getNameByType(Integer type) {
for (MerchantSourceTypeEnum ele : values()) {
if (Objects.equals(type,ele.getNumber())) {

Loading…
Cancel
Save