From cac57f0474fa44244e9639fcef04d60b32ca5b96 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Thu, 11 Jul 2024 11:00:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BsGasChannelConfigController.java | 96 ++ .../BsMerchantAccountController.java | 4 +- .../bweb/controller/SecUserController.java | 2 +- .../com/cweb/controller/BsGasController.java | 18 + .../controller/order/OrderPayController.java | 53 +- .../gas/newlink/NewLinkGasService.java | 266 +++++ .../gas/newlink/NewLinkRequestService.java | 209 ++++ .../hfkj/dao/BsGasChannelConfigMapper.java | 130 ++ .../hfkj/dao/BsGasChannelConfigMapperExt.java | 7 + .../dao/BsGasChannelConfigSqlProvider.java | 346 ++++++ .../com/hfkj/dao/BsGasOilGunNoMapperExt.java | 54 +- .../com/hfkj/dao/BsGasOilPriceMapper.java | 21 +- .../hfkj/dao/BsGasOilPriceSqlProvider.java | 14 + .../java/com/hfkj/dao/BsGasOrderMapper.java | 72 +- .../com/hfkj/dao/BsGasOrderSqlProvider.java | 42 + .../com/hfkj/entity/BsGasChannelConfig.java | 245 ++++ .../entity/BsGasChannelConfigExample.java | 1063 +++++++++++++++++ .../java/com/hfkj/entity/BsGasOilPrice.java | 16 + .../com/hfkj/entity/BsGasOilPriceExample.java | 60 + .../main/java/com/hfkj/entity/BsGasOrder.java | 48 + .../com/hfkj/entity/BsGasOrderExample.java | 190 +++ .../agent/impl/BsAgentStaffServiceImpl.java | 4 +- .../service/gas/BsGasOilGunNoService.java | 17 + .../service/gas/BsGasOilPriceService.java | 7 + .../gas/impl/BsGasOilGunNoServiceImpl.java | 20 + .../gas/impl/BsGasOilPriceServiceImpl.java | 7 + .../gas/impl/BsGasStaffServiceImpl.java | 2 +- .../merchant/impl/BsMerchantServiceImpl.java | 9 +- .../order/BsGasChannelConfigService.java | 28 + .../service/order/OrderCreateService.java | 10 + .../service/order/OrderPaySuccessService.java | 44 +- .../service/order/OrderRefundBusiness.java | 17 +- .../impl/BsGasChannelConfigServiceImpl.java | 57 + .../order/impl/BsOrderServiceImpl.java | 11 +- .../order/impl/BsOrderSettleServiceImpl.java | 73 +- .../hfkj/sysenum/MerchantSourceTypeEnum.java | 16 + 36 files changed, 3188 insertions(+), 90 deletions(-) create mode 100644 bweb/src/main/java/com/bweb/controller/BsGasChannelConfigController.java create mode 100644 service/src/main/java/com/hfkj/channel/gas/newlink/NewLinkGasService.java create mode 100644 service/src/main/java/com/hfkj/channel/gas/newlink/NewLinkRequestService.java create mode 100644 service/src/main/java/com/hfkj/dao/BsGasChannelConfigMapper.java create mode 100644 service/src/main/java/com/hfkj/dao/BsGasChannelConfigMapperExt.java create mode 100644 service/src/main/java/com/hfkj/dao/BsGasChannelConfigSqlProvider.java create mode 100644 service/src/main/java/com/hfkj/entity/BsGasChannelConfig.java create mode 100644 service/src/main/java/com/hfkj/entity/BsGasChannelConfigExample.java create mode 100644 service/src/main/java/com/hfkj/service/order/BsGasChannelConfigService.java create mode 100644 service/src/main/java/com/hfkj/service/order/impl/BsGasChannelConfigServiceImpl.java diff --git a/bweb/src/main/java/com/bweb/controller/BsGasChannelConfigController.java b/bweb/src/main/java/com/bweb/controller/BsGasChannelConfigController.java new file mode 100644 index 0000000..92ca28d --- /dev/null +++ b/bweb/src/main/java/com/bweb/controller/BsGasChannelConfigController.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); + } + } + + +} diff --git a/bweb/src/main/java/com/bweb/controller/BsMerchantAccountController.java b/bweb/src/main/java/com/bweb/controller/BsMerchantAccountController.java index d4c0dfd..ab07b63 100644 --- a/bweb/src/main/java/com/bweb/controller/BsMerchantAccountController.java +++ b/bweb/src/main/java/com/bweb/controller/BsMerchantAccountController.java @@ -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, diff --git a/bweb/src/main/java/com/bweb/controller/SecUserController.java b/bweb/src/main/java/com/bweb/controller/SecUserController.java index bfc7ac3..1dec257 100644 --- a/bweb/src/main/java/com/bweb/controller/SecUserController.java +++ b/bweb/src/main/java/com/bweb/controller/SecUserController.java @@ -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()); diff --git a/cweb/src/main/java/com/cweb/controller/BsGasController.java b/cweb/src/main/java/com/cweb/controller/BsGasController.java index a53ae30..77842ff 100644 --- a/cweb/src/main/java/com/cweb/controller/BsGasController.java +++ b/cweb/src/main/java/com/cweb/controller/BsGasController.java @@ -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 diff --git a/cweb/src/main/java/com/cweb/controller/order/OrderPayController.java b/cweb/src/main/java/com/cweb/controller/order/OrderPayController.java index 56227a2..7611ce0 100644 --- a/cweb/src/main/java/com/cweb/controller/order/OrderPayController.java +++ b/cweb/src/main/java/com/cweb/controller/order/OrderPayController.java @@ -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 preorder = HuiPayService.preorder(merPay.getChannelMerNo(), merPay.getChannelMerKey(), body.getString("openId"), merPay.getLedgerAccountFlag(), order); - + Map 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)); diff --git a/service/src/main/java/com/hfkj/channel/gas/newlink/NewLinkGasService.java b/service/src/main/java/com/hfkj/channel/gas/newlink/NewLinkGasService.java new file mode 100644 index 0000000..33e5885 --- /dev/null +++ b/service/src/main/java/com/hfkj/channel/gas/newlink/NewLinkGasService.java @@ -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 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> splitNList = splitList(gasDataList, 200); + // 记录单个任务的执行次数 + CountDownLatch countDownLatch = new CountDownLatch(splitNList.size()); + // 对拆分的集合进行批量处理, 先拆分的集合, 再多线程执行 + for (List 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 gasOilPriceList = gasOilPriceService.getGasOilPriceList(merchant.getId()); + BsGasOilPrice oilPriceExample = new BsGasOilPrice(); + oilPriceExample.setStatus(GasOilPriceStatusEnum.status2.getNumber()); + gasOilPriceService.batchUpdate(merchant.getMerNo(), oilPriceExample); + + // 查询油站抢号 + List 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 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 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 泛型对象 + * @param resList 需要拆分的集合 + * @param subListLength 每个子集合的元素个数 + * @return 返回拆分后的各个集合组成的列表 + **/ + public static List> splitList(List resList, int subListLength) { + if (CollectionUtils.isEmpty(resList) || subListLength <= 0) { + return new ArrayList<>(); + } + List> 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 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 itemList = new ArrayList<>(last); + for (int i = 0; i < last; i++) { + itemList.add(resList.get(pre * subListLength + i)); + } + ret.add(itemList); + } + } + return ret; + } +} diff --git a/service/src/main/java/com/hfkj/channel/gas/newlink/NewLinkRequestService.java b/service/src/main/java/com/hfkj/channel/gas/newlink/NewLinkRequestService.java new file mode 100644 index 0000000..873f1d2 --- /dev/null +++ b/service/src/main/java/com/hfkj/channel/gas/newlink/NewLinkRequestService.java @@ -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 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 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 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 map) throws Exception { + Map paramMap = new HashMap<>(); + paramMap.put("app_key", APP_KEY); + paramMap.put("timestamp", System.currentTimeMillis()); + for (Map.Entry 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 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 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 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 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 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 data, String key){ + Set 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(); + } + + + +} diff --git a/service/src/main/java/com/hfkj/dao/BsGasChannelConfigMapper.java b/service/src/main/java/com/hfkj/dao/BsGasChannelConfigMapper.java new file mode 100644 index 0000000..e4ac633 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsGasChannelConfigMapper.java @@ -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 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); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsGasChannelConfigMapperExt.java b/service/src/main/java/com/hfkj/dao/BsGasChannelConfigMapperExt.java new file mode 100644 index 0000000..8fa0ac2 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsGasChannelConfigMapperExt.java @@ -0,0 +1,7 @@ +package com.hfkj.dao; + +/** + * mapper扩展类 + */ +public interface BsGasChannelConfigMapperExt { +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsGasChannelConfigSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsGasChannelConfigSqlProvider.java new file mode 100644 index 0000000..89081ac --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsGasChannelConfigSqlProvider.java @@ -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 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 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 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 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()); + } + } +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsGasOilGunNoMapperExt.java b/service/src/main/java/com/hfkj/dao/BsGasOilGunNoMapperExt.java index ec54f96..21afd17 100644 --- a/service/src/main/java/com/hfkj/dao/BsGasOilGunNoMapperExt.java +++ b/service/src/main/java/com/hfkj/dao/BsGasOilGunNoMapperExt.java @@ -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 { -} \ No newline at end of file + + @Insert({ + "", + }) + void batchInsert(@Param(value = "list") List list); + + @Update({ + "", + }) + void batchUpdate(@Param(value = "list") List list); +} diff --git a/service/src/main/java/com/hfkj/dao/BsGasOilPriceMapper.java b/service/src/main/java/com/hfkj/dao/BsGasOilPriceMapper.java index 3c7ee68..59419be 100644 --- a/service/src/main/java/com/hfkj/dao/BsGasOilPriceMapper.java +++ b/service/src/main/java/com/hfkj/dao/BsGasOilPriceMapper.java @@ -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},", diff --git a/service/src/main/java/com/hfkj/dao/BsGasOilPriceSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsGasOilPriceSqlProvider.java index ad7980a..bb6bc2e 100644 --- a/service/src/main/java/com/hfkj/dao/BsGasOilPriceSqlProvider.java +++ b/service/src/main/java/com/hfkj/dao/BsGasOilPriceSqlProvider.java @@ -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}"); } diff --git a/service/src/main/java/com/hfkj/dao/BsGasOrderMapper.java b/service/src/main/java/com/hfkj/dao/BsGasOrderMapper.java index f9d703b..5570093 100644 --- a/service/src/main/java/com/hfkj/dao/BsGasOrderMapper.java +++ b/service/src/main/java/com/hfkj/dao/BsGasOrderMapper.java @@ -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},", diff --git a/service/src/main/java/com/hfkj/dao/BsGasOrderSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsGasOrderSqlProvider.java index 4995a36..3ec71d3 100644 --- a/service/src/main/java/com/hfkj/dao/BsGasOrderSqlProvider.java +++ b/service/src/main/java/com/hfkj/dao/BsGasOrderSqlProvider.java @@ -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}"); } diff --git a/service/src/main/java/com/hfkj/entity/BsGasChannelConfig.java b/service/src/main/java/com/hfkj/entity/BsGasChannelConfig.java new file mode 100644 index 0000000..75e61d7 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsGasChannelConfig.java @@ -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(); + } +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/entity/BsGasChannelConfigExample.java b/service/src/main/java/com/hfkj/entity/BsGasChannelConfigExample.java new file mode 100644 index 0000000..01aca6c --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsGasChannelConfigExample.java @@ -0,0 +1,1063 @@ +package com.hfkj.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class BsGasChannelConfigExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public BsGasChannelConfigExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getLimit() { + return limit; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public Long getOffset() { + return offset; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andGasChannelTypeIsNull() { + addCriterion("gas_channel_type is null"); + return (Criteria) this; + } + + public Criteria andGasChannelTypeIsNotNull() { + addCriterion("gas_channel_type is not null"); + return (Criteria) this; + } + + public Criteria andGasChannelTypeEqualTo(Integer value) { + addCriterion("gas_channel_type =", value, "gasChannelType"); + return (Criteria) this; + } + + public Criteria andGasChannelTypeNotEqualTo(Integer value) { + addCriterion("gas_channel_type <>", value, "gasChannelType"); + return (Criteria) this; + } + + public Criteria andGasChannelTypeGreaterThan(Integer value) { + addCriterion("gas_channel_type >", value, "gasChannelType"); + return (Criteria) this; + } + + public Criteria andGasChannelTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("gas_channel_type >=", value, "gasChannelType"); + return (Criteria) this; + } + + public Criteria andGasChannelTypeLessThan(Integer value) { + addCriterion("gas_channel_type <", value, "gasChannelType"); + return (Criteria) this; + } + + public Criteria andGasChannelTypeLessThanOrEqualTo(Integer value) { + addCriterion("gas_channel_type <=", value, "gasChannelType"); + return (Criteria) this; + } + + public Criteria andGasChannelTypeIn(List values) { + addCriterion("gas_channel_type in", values, "gasChannelType"); + return (Criteria) this; + } + + public Criteria andGasChannelTypeNotIn(List values) { + addCriterion("gas_channel_type not in", values, "gasChannelType"); + return (Criteria) this; + } + + public Criteria andGasChannelTypeBetween(Integer value1, Integer value2) { + addCriterion("gas_channel_type between", value1, value2, "gasChannelType"); + return (Criteria) this; + } + + public Criteria andGasChannelTypeNotBetween(Integer value1, Integer value2) { + addCriterion("gas_channel_type not between", value1, value2, "gasChannelType"); + return (Criteria) this; + } + + public Criteria andChannelTypeIsNull() { + addCriterion("channel_type is null"); + return (Criteria) this; + } + + public Criteria andChannelTypeIsNotNull() { + addCriterion("channel_type is not null"); + return (Criteria) this; + } + + public Criteria andChannelTypeEqualTo(Integer value) { + addCriterion("channel_type =", value, "channelType"); + return (Criteria) this; + } + + public Criteria andChannelTypeNotEqualTo(Integer value) { + addCriterion("channel_type <>", value, "channelType"); + return (Criteria) this; + } + + public Criteria andChannelTypeGreaterThan(Integer value) { + addCriterion("channel_type >", value, "channelType"); + return (Criteria) this; + } + + public Criteria andChannelTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("channel_type >=", value, "channelType"); + return (Criteria) this; + } + + public Criteria andChannelTypeLessThan(Integer value) { + addCriterion("channel_type <", value, "channelType"); + return (Criteria) this; + } + + public Criteria andChannelTypeLessThanOrEqualTo(Integer value) { + addCriterion("channel_type <=", value, "channelType"); + return (Criteria) this; + } + + public Criteria andChannelTypeIn(List values) { + addCriterion("channel_type in", values, "channelType"); + return (Criteria) this; + } + + public Criteria andChannelTypeNotIn(List values) { + addCriterion("channel_type not in", values, "channelType"); + return (Criteria) this; + } + + public Criteria andChannelTypeBetween(Integer value1, Integer value2) { + addCriterion("channel_type between", value1, value2, "channelType"); + return (Criteria) this; + } + + public Criteria andChannelTypeNotBetween(Integer value1, Integer value2) { + addCriterion("channel_type not between", value1, value2, "channelType"); + return (Criteria) this; + } + + public Criteria andChannelMerNoIsNull() { + addCriterion("channel_mer_no is null"); + return (Criteria) this; + } + + public Criteria andChannelMerNoIsNotNull() { + addCriterion("channel_mer_no is not null"); + return (Criteria) this; + } + + public Criteria andChannelMerNoEqualTo(String value) { + addCriterion("channel_mer_no =", value, "channelMerNo"); + return (Criteria) this; + } + + public Criteria andChannelMerNoNotEqualTo(String value) { + addCriterion("channel_mer_no <>", value, "channelMerNo"); + return (Criteria) this; + } + + public Criteria andChannelMerNoGreaterThan(String value) { + addCriterion("channel_mer_no >", value, "channelMerNo"); + return (Criteria) this; + } + + public Criteria andChannelMerNoGreaterThanOrEqualTo(String value) { + addCriterion("channel_mer_no >=", value, "channelMerNo"); + return (Criteria) this; + } + + public Criteria andChannelMerNoLessThan(String value) { + addCriterion("channel_mer_no <", value, "channelMerNo"); + return (Criteria) this; + } + + public Criteria andChannelMerNoLessThanOrEqualTo(String value) { + addCriterion("channel_mer_no <=", value, "channelMerNo"); + return (Criteria) this; + } + + public Criteria andChannelMerNoLike(String value) { + addCriterion("channel_mer_no like", value, "channelMerNo"); + return (Criteria) this; + } + + public Criteria andChannelMerNoNotLike(String value) { + addCriterion("channel_mer_no not like", value, "channelMerNo"); + return (Criteria) this; + } + + public Criteria andChannelMerNoIn(List values) { + addCriterion("channel_mer_no in", values, "channelMerNo"); + return (Criteria) this; + } + + public Criteria andChannelMerNoNotIn(List values) { + addCriterion("channel_mer_no not in", values, "channelMerNo"); + return (Criteria) this; + } + + public Criteria andChannelMerNoBetween(String value1, String value2) { + addCriterion("channel_mer_no between", value1, value2, "channelMerNo"); + return (Criteria) this; + } + + public Criteria andChannelMerNoNotBetween(String value1, String value2) { + addCriterion("channel_mer_no not between", value1, value2, "channelMerNo"); + return (Criteria) this; + } + + public Criteria andChannelMerKeyIsNull() { + addCriterion("channel_mer_key is null"); + return (Criteria) this; + } + + public Criteria andChannelMerKeyIsNotNull() { + addCriterion("channel_mer_key is not null"); + return (Criteria) this; + } + + public Criteria andChannelMerKeyEqualTo(String value) { + addCriterion("channel_mer_key =", value, "channelMerKey"); + return (Criteria) this; + } + + public Criteria andChannelMerKeyNotEqualTo(String value) { + addCriterion("channel_mer_key <>", value, "channelMerKey"); + return (Criteria) this; + } + + public Criteria andChannelMerKeyGreaterThan(String value) { + addCriterion("channel_mer_key >", value, "channelMerKey"); + return (Criteria) this; + } + + public Criteria andChannelMerKeyGreaterThanOrEqualTo(String value) { + addCriterion("channel_mer_key >=", value, "channelMerKey"); + return (Criteria) this; + } + + public Criteria andChannelMerKeyLessThan(String value) { + addCriterion("channel_mer_key <", value, "channelMerKey"); + return (Criteria) this; + } + + public Criteria andChannelMerKeyLessThanOrEqualTo(String value) { + addCriterion("channel_mer_key <=", value, "channelMerKey"); + return (Criteria) this; + } + + public Criteria andChannelMerKeyLike(String value) { + addCriterion("channel_mer_key like", value, "channelMerKey"); + return (Criteria) this; + } + + public Criteria andChannelMerKeyNotLike(String value) { + addCriterion("channel_mer_key not like", value, "channelMerKey"); + return (Criteria) this; + } + + public Criteria andChannelMerKeyIn(List values) { + addCriterion("channel_mer_key in", values, "channelMerKey"); + return (Criteria) this; + } + + public Criteria andChannelMerKeyNotIn(List values) { + addCriterion("channel_mer_key not in", values, "channelMerKey"); + return (Criteria) this; + } + + public Criteria andChannelMerKeyBetween(String value1, String value2) { + addCriterion("channel_mer_key between", value1, value2, "channelMerKey"); + return (Criteria) this; + } + + public Criteria andChannelMerKeyNotBetween(String value1, String value2) { + addCriterion("channel_mer_key not between", value1, value2, "channelMerKey"); + return (Criteria) this; + } + + public Criteria andLedgerAccountFlagIsNull() { + addCriterion("ledger_account_flag is null"); + return (Criteria) this; + } + + public Criteria andLedgerAccountFlagIsNotNull() { + addCriterion("ledger_account_flag is not null"); + return (Criteria) this; + } + + public Criteria andLedgerAccountFlagEqualTo(Boolean value) { + addCriterion("ledger_account_flag =", value, "ledgerAccountFlag"); + return (Criteria) this; + } + + public Criteria andLedgerAccountFlagNotEqualTo(Boolean value) { + addCriterion("ledger_account_flag <>", value, "ledgerAccountFlag"); + return (Criteria) this; + } + + public Criteria andLedgerAccountFlagGreaterThan(Boolean value) { + addCriterion("ledger_account_flag >", value, "ledgerAccountFlag"); + return (Criteria) this; + } + + public Criteria andLedgerAccountFlagGreaterThanOrEqualTo(Boolean value) { + addCriterion("ledger_account_flag >=", value, "ledgerAccountFlag"); + return (Criteria) this; + } + + public Criteria andLedgerAccountFlagLessThan(Boolean value) { + addCriterion("ledger_account_flag <", value, "ledgerAccountFlag"); + return (Criteria) this; + } + + public Criteria andLedgerAccountFlagLessThanOrEqualTo(Boolean value) { + addCriterion("ledger_account_flag <=", value, "ledgerAccountFlag"); + return (Criteria) this; + } + + public Criteria andLedgerAccountFlagIn(List values) { + addCriterion("ledger_account_flag in", values, "ledgerAccountFlag"); + return (Criteria) this; + } + + public Criteria andLedgerAccountFlagNotIn(List values) { + addCriterion("ledger_account_flag not in", values, "ledgerAccountFlag"); + return (Criteria) this; + } + + public Criteria andLedgerAccountFlagBetween(Boolean value1, Boolean value2) { + addCriterion("ledger_account_flag between", value1, value2, "ledgerAccountFlag"); + return (Criteria) this; + } + + public Criteria andLedgerAccountFlagNotBetween(Boolean value1, Boolean value2) { + addCriterion("ledger_account_flag not between", value1, value2, "ledgerAccountFlag"); + return (Criteria) this; + } + + public Criteria andLedgerAccountDataIsNull() { + addCriterion("ledger_account_data is null"); + return (Criteria) this; + } + + public Criteria andLedgerAccountDataIsNotNull() { + addCriterion("ledger_account_data is not null"); + return (Criteria) this; + } + + public Criteria andLedgerAccountDataEqualTo(String value) { + addCriterion("ledger_account_data =", value, "ledgerAccountData"); + return (Criteria) this; + } + + public Criteria andLedgerAccountDataNotEqualTo(String value) { + addCriterion("ledger_account_data <>", value, "ledgerAccountData"); + return (Criteria) this; + } + + public Criteria andLedgerAccountDataGreaterThan(String value) { + addCriterion("ledger_account_data >", value, "ledgerAccountData"); + return (Criteria) this; + } + + public Criteria andLedgerAccountDataGreaterThanOrEqualTo(String value) { + addCriterion("ledger_account_data >=", value, "ledgerAccountData"); + return (Criteria) this; + } + + public Criteria andLedgerAccountDataLessThan(String value) { + addCriterion("ledger_account_data <", value, "ledgerAccountData"); + return (Criteria) this; + } + + public Criteria andLedgerAccountDataLessThanOrEqualTo(String value) { + addCriterion("ledger_account_data <=", value, "ledgerAccountData"); + return (Criteria) this; + } + + public Criteria andLedgerAccountDataLike(String value) { + addCriterion("ledger_account_data like", value, "ledgerAccountData"); + return (Criteria) this; + } + + public Criteria andLedgerAccountDataNotLike(String value) { + addCriterion("ledger_account_data not like", value, "ledgerAccountData"); + return (Criteria) this; + } + + public Criteria andLedgerAccountDataIn(List values) { + addCriterion("ledger_account_data in", values, "ledgerAccountData"); + return (Criteria) this; + } + + public Criteria andLedgerAccountDataNotIn(List values) { + addCriterion("ledger_account_data not in", values, "ledgerAccountData"); + return (Criteria) this; + } + + public Criteria andLedgerAccountDataBetween(String value1, String value2) { + addCriterion("ledger_account_data between", value1, value2, "ledgerAccountData"); + return (Criteria) this; + } + + public Criteria andLedgerAccountDataNotBetween(String value1, String value2) { + addCriterion("ledger_account_data not between", value1, value2, "ledgerAccountData"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("`status` is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("`status` is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Integer value) { + addCriterion("`status` =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Integer value) { + addCriterion("`status` <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Integer value) { + addCriterion("`status` >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("`status` >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Integer value) { + addCriterion("`status` <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Integer value) { + addCriterion("`status` <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("`status` not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Integer value1, Integer value2) { + addCriterion("`status` between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Integer value1, Integer value2) { + addCriterion("`status` not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andExt1IsNull() { + addCriterion("ext_1 is null"); + return (Criteria) this; + } + + public Criteria andExt1IsNotNull() { + addCriterion("ext_1 is not null"); + return (Criteria) this; + } + + public Criteria andExt1EqualTo(String value) { + addCriterion("ext_1 =", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotEqualTo(String value) { + addCriterion("ext_1 <>", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThan(String value) { + addCriterion("ext_1 >", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThanOrEqualTo(String value) { + addCriterion("ext_1 >=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThan(String value) { + addCriterion("ext_1 <", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThanOrEqualTo(String value) { + addCriterion("ext_1 <=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Like(String value) { + addCriterion("ext_1 like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotLike(String value) { + addCriterion("ext_1 not like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1In(List values) { + addCriterion("ext_1 in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotIn(List values) { + addCriterion("ext_1 not in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Between(String value1, String value2) { + addCriterion("ext_1 between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotBetween(String value1, String value2) { + addCriterion("ext_1 not between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt2IsNull() { + addCriterion("ext_2 is null"); + return (Criteria) this; + } + + public Criteria andExt2IsNotNull() { + addCriterion("ext_2 is not null"); + return (Criteria) this; + } + + public Criteria andExt2EqualTo(String value) { + addCriterion("ext_2 =", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotEqualTo(String value) { + addCriterion("ext_2 <>", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThan(String value) { + addCriterion("ext_2 >", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThanOrEqualTo(String value) { + addCriterion("ext_2 >=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThan(String value) { + addCriterion("ext_2 <", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThanOrEqualTo(String value) { + addCriterion("ext_2 <=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Like(String value) { + addCriterion("ext_2 like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotLike(String value) { + addCriterion("ext_2 not like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2In(List values) { + addCriterion("ext_2 in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotIn(List values) { + addCriterion("ext_2 not in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Between(String value1, String value2) { + addCriterion("ext_2 between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotBetween(String value1, String value2) { + addCriterion("ext_2 not between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt3IsNull() { + addCriterion("ext_3 is null"); + return (Criteria) this; + } + + public Criteria andExt3IsNotNull() { + addCriterion("ext_3 is not null"); + return (Criteria) this; + } + + public Criteria andExt3EqualTo(String value) { + addCriterion("ext_3 =", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotEqualTo(String value) { + addCriterion("ext_3 <>", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThan(String value) { + addCriterion("ext_3 >", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThanOrEqualTo(String value) { + addCriterion("ext_3 >=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThan(String value) { + addCriterion("ext_3 <", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThanOrEqualTo(String value) { + addCriterion("ext_3 <=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Like(String value) { + addCriterion("ext_3 like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotLike(String value) { + addCriterion("ext_3 not like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3In(List values) { + addCriterion("ext_3 in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotIn(List values) { + addCriterion("ext_3 not in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Between(String value1, String value2) { + addCriterion("ext_3 between", value1, value2, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotBetween(String value1, String value2) { + addCriterion("ext_3 not between", value1, value2, "ext3"); + return (Criteria) this; + } + } + + /** + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/entity/BsGasOilPrice.java b/service/src/main/java/com/hfkj/entity/BsGasOilPrice.java index e30fa4f..9b635af 100644 --- a/service/src/main/java/com/hfkj/entity/BsGasOilPrice.java +++ b/service/src/main/java/com/hfkj/entity/BsGasOilPrice.java @@ -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); diff --git a/service/src/main/java/com/hfkj/entity/BsGasOilPriceExample.java b/service/src/main/java/com/hfkj/entity/BsGasOilPriceExample.java index babb67b..359e110 100644 --- a/service/src/main/java/com/hfkj/entity/BsGasOilPriceExample.java +++ b/service/src/main/java/com/hfkj/entity/BsGasOilPriceExample.java @@ -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 values) { + addCriterion("price_cost in", values, "priceCost"); + return (Criteria) this; + } + + public Criteria andPriceCostNotIn(List 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; diff --git a/service/src/main/java/com/hfkj/entity/BsGasOrder.java b/service/src/main/java/com/hfkj/entity/BsGasOrder.java index aefbcd3..4f7a3e5 100644 --- a/service/src/main/java/com/hfkj/entity/BsGasOrder.java +++ b/service/src/main/java/com/hfkj/entity/BsGasOrder.java @@ -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); diff --git a/service/src/main/java/com/hfkj/entity/BsGasOrderExample.java b/service/src/main/java/com/hfkj/entity/BsGasOrderExample.java index 930f7aa..53a1a5a 100644 --- a/service/src/main/java/com/hfkj/entity/BsGasOrderExample.java +++ b/service/src/main/java/com/hfkj/entity/BsGasOrderExample.java @@ -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 values) { + addCriterion("gas_price_cost in", values, "gasPriceCost"); + return (Criteria) this; + } + + public Criteria andGasPriceCostNotIn(List 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 values) { + addCriterion("abnormal in", values, "abnormal"); + return (Criteria) this; + } + + public Criteria andAbnormalNotIn(List 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 values) { + addCriterion("abnormal_content in", values, "abnormalContent"); + return (Criteria) this; + } + + public Criteria andAbnormalContentNotIn(List 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; diff --git a/service/src/main/java/com/hfkj/service/agent/impl/BsAgentStaffServiceImpl.java b/service/src/main/java/com/hfkj/service/agent/impl/BsAgentStaffServiceImpl.java index d4e34f3..f31c352 100644 --- a/service/src/main/java/com/hfkj/service/agent/impl/BsAgentStaffServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/agent/impl/BsAgentStaffServiceImpl.java @@ -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) { diff --git a/service/src/main/java/com/hfkj/service/gas/BsGasOilGunNoService.java b/service/src/main/java/com/hfkj/service/gas/BsGasOilGunNoService.java index e49bee8..3fdf43b 100644 --- a/service/src/main/java/com/hfkj/service/gas/BsGasOilGunNoService.java +++ b/service/src/main/java/com/hfkj/service/gas/BsGasOilGunNoService.java @@ -18,6 +18,23 @@ public interface BsGasOilGunNoService { */ void editData(BsGasOilGunNo data); + /** + * 清除缓存 + * @param merNo + */ + void cleanCache(String merNo); + + /** + * 批量增加 + * @param dataList + */ + void batchInsert(List dataList); + + /** + * + */ + void batchUpdate(List dataList); + /** * 删除 * @param gunNoId diff --git a/service/src/main/java/com/hfkj/service/gas/BsGasOilPriceService.java b/service/src/main/java/com/hfkj/service/gas/BsGasOilPriceService.java index efaf58e..c5241df 100644 --- a/service/src/main/java/com/hfkj/service/gas/BsGasOilPriceService.java +++ b/service/src/main/java/com/hfkj/service/gas/BsGasOilPriceService.java @@ -18,6 +18,13 @@ public interface BsGasOilPriceService { */ void editData(BsGasOilPrice data); + /** + * 批量修改 + * @param merNo + * @param gasOilPrice + */ + void batchUpdate(String merNo,BsGasOilPrice gasOilPrice); + /** * 编辑价格 * @param data diff --git a/service/src/main/java/com/hfkj/service/gas/impl/BsGasOilGunNoServiceImpl.java b/service/src/main/java/com/hfkj/service/gas/impl/BsGasOilGunNoServiceImpl.java index b14e725..a8fbe5b 100644 --- a/service/src/main/java/com/hfkj/service/gas/impl/BsGasOilGunNoServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/gas/impl/BsGasOilGunNoServiceImpl.java @@ -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 dataList) { + if (!dataList.isEmpty()) { + gasOilGunNoMapper.batchInsert(dataList); + } + } + + @Override + public void batchUpdate(List dataList) { + if (!dataList.isEmpty()) { + gasOilGunNoMapper.batchUpdate(dataList); + } + } + @Override public void delete(Long gunNoId) { BsGasOilGunNo oilGunNo = getDetail(gunNoId); diff --git a/service/src/main/java/com/hfkj/service/gas/impl/BsGasOilPriceServiceImpl.java b/service/src/main/java/com/hfkj/service/gas/impl/BsGasOilPriceServiceImpl.java index f80c41d..8111c67 100644 --- a/service/src/main/java/com/hfkj/service/gas/impl/BsGasOilPriceServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/gas/impl/BsGasOilPriceServiceImpl.java @@ -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); diff --git a/service/src/main/java/com/hfkj/service/gas/impl/BsGasStaffServiceImpl.java b/service/src/main/java/com/hfkj/service/gas/impl/BsGasStaffServiceImpl.java index b36d450..097b684 100644 --- a/service/src/main/java/com/hfkj/service/gas/impl/BsGasStaffServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/gas/impl/BsGasStaffServiceImpl.java @@ -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()); diff --git a/service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantServiceImpl.java b/service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantServiceImpl.java index c67dc11..2cac416 100644 --- a/service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantServiceImpl.java @@ -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); } diff --git a/service/src/main/java/com/hfkj/service/order/BsGasChannelConfigService.java b/service/src/main/java/com/hfkj/service/order/BsGasChannelConfigService.java new file mode 100644 index 0000000..370875d --- /dev/null +++ b/service/src/main/java/com/hfkj/service/order/BsGasChannelConfigService.java @@ -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); + +} diff --git a/service/src/main/java/com/hfkj/service/order/OrderCreateService.java b/service/src/main/java/com/hfkj/service/order/OrderCreateService.java index 0dda60c..978ec8b 100644 --- a/service/src/main/java/com/hfkj/service/order/OrderCreateService.java +++ b/service/src/main/java/com/hfkj/service/order/OrderCreateService.java @@ -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()); diff --git a/service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java b/service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java index 2759d2a..0594ec3 100644 --- a/service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java +++ b/service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java @@ -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 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 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 ); - } } } diff --git a/service/src/main/java/com/hfkj/service/order/OrderRefundBusiness.java b/service/src/main/java/com/hfkj/service/order/OrderRefundBusiness.java index aaeec52..9627ebe 100644 --- a/service/src/main/java/com/hfkj/service/order/OrderRefundBusiness.java +++ b/service/src/main/java/com/hfkj/service/order/OrderRefundBusiness.java @@ -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) {} } } diff --git a/service/src/main/java/com/hfkj/service/order/impl/BsGasChannelConfigServiceImpl.java b/service/src/main/java/com/hfkj/service/order/impl/BsGasChannelConfigServiceImpl.java new file mode 100644 index 0000000..f775275 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/order/impl/BsGasChannelConfigServiceImpl.java @@ -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 list = gasChannelConfigMapper.selectByExample(example); + if (!list.isEmpty()) { + BsGasChannelConfig gasChannelConfig = list.get(0); + // 存入缓存 + redisUtil.set(CACHE_KEY+gasChannelConfig.getChannelType(), gasChannelConfig); + return gasChannelConfig; + } + return null; + } +} diff --git a/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java b/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java index 3090751..5ba9902 100644 --- a/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java @@ -369,11 +369,14 @@ public class BsOrderServiceImpl implements BsOrderService { System.out.println("业务处理异常"); } - // 分账业务 try { - Message 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 rocketMsg = MessageBuilder.withPayload(order).build(); + rocketMQTemplate.syncSend(OrderTopic.ORDER_TOPIC_PROFIT_SHARING.getTopic(), rocketMsg,1000); + } } catch (Exception e) { System.out.println("分账处理异常"); } diff --git a/service/src/main/java/com/hfkj/service/order/impl/BsOrderSettleServiceImpl.java b/service/src/main/java/com/hfkj/service/order/impl/BsOrderSettleServiceImpl.java index b2f2217..6b8b44f 100644 --- a/service/src/main/java/com/hfkj/service/order/impl/BsOrderSettleServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/order/impl/BsOrderSettleServiceImpl.java @@ -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 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 diff --git a/service/src/main/java/com/hfkj/sysenum/MerchantSourceTypeEnum.java b/service/src/main/java/com/hfkj/sysenum/MerchantSourceTypeEnum.java index f9c556c..fbb8663 100644 --- a/service/src/main/java/com/hfkj/sysenum/MerchantSourceTypeEnum.java +++ b/service/src/main/java/com/hfkj/sysenum/MerchantSourceTypeEnum.java @@ -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())) {