From 83ddfe933f6cf49fccc5eaa58b7c07b4d8f13ad7 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Wed, 3 Jul 2024 14:13:38 +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 --- .../controller/BsAgentPriceController.java | 2 +- .../bweb/controller/BsDeviceController.java | 2 +- .../bweb/controller/BsDiscountController.java | 5 +- .../controller/BsDiscountStockController.java | 8 - .../controller/BsGasClassGroupController.java | 2 +- .../controller/BsGasOilGunNoController.java | 2 +- .../controller/BsGasOilPriceController.java | 2 +- .../BsGasOilPriceTaskController.java | 2 +- .../bweb/controller/BsGasOrderController.java | 79 +- .../bweb/controller/BsGasStaffController.java | 7 - .../BsMerchantAccountController.java | 126 ++ .../bweb/controller/BsMerchantController.java | 1 + .../BsMerchantPayConfigController.java | 4 +- .../BsMerchantQrCodeController.java | 2 +- .../controller/BsMerchantUserController.java | 3 +- .../controller/BsMerchantUserController.java | 3 +- .../controller/order/BsOrderController.java | 6 +- .../controller/order/OrderPayController.java | 6 +- .../com/hfkj/common/utils/BankNumberUtil.java | 119 ++ .../com/hfkj/dao/BsGasOrderMapperExt.java | 42 +- .../com/hfkj/dao/BsMerchantAccountMapper.java | 122 ++ .../hfkj/dao/BsMerchantAccountMapperExt.java | 7 + .../dao/BsMerchantAccountRecordMapper.java | 159 ++ .../dao/BsMerchantAccountRecordMapperExt.java | 7 + .../BsMerchantAccountRecordSqlProvider.java | 444 +++++ .../dao/BsMerchantAccountSqlProvider.java | 318 ++++ .../com/hfkj/entity/BsMerchantAccount.java | 214 +++ .../hfkj/entity/BsMerchantAccountExample.java | 924 ++++++++++ .../hfkj/entity/BsMerchantAccountRecord.java | 358 ++++ .../BsMerchantAccountRecordExample.java | 1504 +++++++++++++++++ .../agent/impl/BsAgentMerServiceImpl.java | 3 +- .../hfkj/service/gas/BsGasOrderService.java | 7 + .../impl/BsGasClassGroupTaskServiceImpl.java | 2 +- .../gas/impl/BsGasOilPriceServiceImpl.java | 1 - .../gas/impl/BsGasOrderServiceImpl.java | 30 + .../service/gas/impl/BsGasServiceImpl.java | 2 +- .../gas/impl/BsGasStaffServiceImpl.java | 2 +- .../BsMerchantAccountRecordService.java | 36 + .../merchant/BsMerchantAccountService.java | 51 + .../BsMerchantPayConfigService.java | 2 +- .../BsMerchantQrCodeService.java | 2 +- .../{ => merchant}/BsMerchantService.java | 2 +- .../{ => merchant}/BsMerchantUserService.java | 2 +- .../BsMerchantAccountRecordServiceImpl.java | 83 + .../impl/BsMerchantAccountServiceImpl.java | 214 +++ .../impl/BsMerchantPayConfigServiceImpl.java | 4 +- .../impl/BsMerchantQrCodeServiceImpl.java | 4 +- .../impl/BsMerchantServiceImpl.java | 24 +- .../impl/BsMerchantUserServiceImpl.java | 4 +- .../service/order/OrderCreateService.java | 4 +- .../service/order/OrderPaySuccessService.java | 19 +- .../service/order/OrderRefundBusiness.java | 12 + .../order/impl/BsOrderRefundServiceImpl.java | 3 +- .../order/impl/BsOrderSettleServiceImpl.java | 2 +- .../service/sec/impl/SecUserServiceImpl.java | 2 +- .../MerchantAccountRecordSourceTypeEnum.java | 35 + .../MerchantAccountRecordTypeEnum.java | 28 + 57 files changed, 4987 insertions(+), 73 deletions(-) create mode 100644 bweb/src/main/java/com/bweb/controller/BsMerchantAccountController.java create mode 100644 service/src/main/java/com/hfkj/common/utils/BankNumberUtil.java create mode 100644 service/src/main/java/com/hfkj/dao/BsMerchantAccountMapper.java create mode 100644 service/src/main/java/com/hfkj/dao/BsMerchantAccountMapperExt.java create mode 100644 service/src/main/java/com/hfkj/dao/BsMerchantAccountRecordMapper.java create mode 100644 service/src/main/java/com/hfkj/dao/BsMerchantAccountRecordMapperExt.java create mode 100644 service/src/main/java/com/hfkj/dao/BsMerchantAccountRecordSqlProvider.java create mode 100644 service/src/main/java/com/hfkj/dao/BsMerchantAccountSqlProvider.java create mode 100644 service/src/main/java/com/hfkj/entity/BsMerchantAccount.java create mode 100644 service/src/main/java/com/hfkj/entity/BsMerchantAccountExample.java create mode 100644 service/src/main/java/com/hfkj/entity/BsMerchantAccountRecord.java create mode 100644 service/src/main/java/com/hfkj/entity/BsMerchantAccountRecordExample.java create mode 100644 service/src/main/java/com/hfkj/service/merchant/BsMerchantAccountRecordService.java create mode 100644 service/src/main/java/com/hfkj/service/merchant/BsMerchantAccountService.java rename service/src/main/java/com/hfkj/service/{ => merchant}/BsMerchantPayConfigService.java (92%) rename service/src/main/java/com/hfkj/service/{ => merchant}/BsMerchantQrCodeService.java (97%) rename service/src/main/java/com/hfkj/service/{ => merchant}/BsMerchantService.java (97%) rename service/src/main/java/com/hfkj/service/{ => merchant}/BsMerchantUserService.java (94%) create mode 100644 service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantAccountRecordServiceImpl.java create mode 100644 service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantAccountServiceImpl.java rename service/src/main/java/com/hfkj/service/{ => merchant}/impl/BsMerchantPayConfigServiceImpl.java (94%) rename service/src/main/java/com/hfkj/service/{ => merchant}/impl/BsMerchantQrCodeServiceImpl.java (98%) rename service/src/main/java/com/hfkj/service/{ => merchant}/impl/BsMerchantServiceImpl.java (86%) rename service/src/main/java/com/hfkj/service/{ => merchant}/impl/BsMerchantUserServiceImpl.java (95%) create mode 100644 service/src/main/java/com/hfkj/sysenum/merchant/MerchantAccountRecordSourceTypeEnum.java create mode 100644 service/src/main/java/com/hfkj/sysenum/merchant/MerchantAccountRecordTypeEnum.java diff --git a/bweb/src/main/java/com/bweb/controller/BsAgentPriceController.java b/bweb/src/main/java/com/bweb/controller/BsAgentPriceController.java index 4fcd3ee..46e73ac 100644 --- a/bweb/src/main/java/com/bweb/controller/BsAgentPriceController.java +++ b/bweb/src/main/java/com/bweb/controller/BsAgentPriceController.java @@ -13,7 +13,7 @@ import com.hfkj.entity.BsGasOilPrice; import com.hfkj.entity.BsMerchant; import com.hfkj.model.ResponseData; import com.hfkj.model.SecUserSessionObject; -import com.hfkj.service.BsMerchantService; +import com.hfkj.service.merchant.BsMerchantService; import com.hfkj.service.agent.BsAgentMerService; import com.hfkj.service.agent.BsAgentPriceService; import com.hfkj.service.gas.BsGasOilPriceService; diff --git a/bweb/src/main/java/com/bweb/controller/BsDeviceController.java b/bweb/src/main/java/com/bweb/controller/BsDeviceController.java index ec9377a..f0d3452 100644 --- a/bweb/src/main/java/com/bweb/controller/BsDeviceController.java +++ b/bweb/src/main/java/com/bweb/controller/BsDeviceController.java @@ -13,7 +13,7 @@ import com.hfkj.entity.*; import com.hfkj.model.ResponseData; import com.hfkj.model.SecUserSessionObject; import com.hfkj.service.BsDeviceService; -import com.hfkj.service.BsMerchantService; +import com.hfkj.service.merchant.BsMerchantService; import com.hfkj.sysenum.DeviceTypeEnum; import com.hfkj.sysenum.SecUserObjectTypeEnum; import io.swagger.annotations.Api; diff --git a/bweb/src/main/java/com/bweb/controller/BsDiscountController.java b/bweb/src/main/java/com/bweb/controller/BsDiscountController.java index acfee96..f6ff9f3 100644 --- a/bweb/src/main/java/com/bweb/controller/BsDiscountController.java +++ b/bweb/src/main/java/com/bweb/controller/BsDiscountController.java @@ -8,15 +8,12 @@ import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.SysCode; import com.hfkj.common.security.UserCenter; import com.hfkj.common.utils.ResponseMsgUtil; -import com.hfkj.config.SpPrinterConfig; -import com.hfkj.entity.BsDevice; import com.hfkj.entity.BsDiscount; import com.hfkj.entity.BsMerchant; import com.hfkj.model.ResponseData; import com.hfkj.model.SecUserSessionObject; -import com.hfkj.service.BsDeviceService; import com.hfkj.service.BsDiscountService; -import com.hfkj.service.BsMerchantService; +import com.hfkj.service.merchant.BsMerchantService; import com.hfkj.sysenum.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; diff --git a/bweb/src/main/java/com/bweb/controller/BsDiscountStockController.java b/bweb/src/main/java/com/bweb/controller/BsDiscountStockController.java index d78114e..90c3a03 100644 --- a/bweb/src/main/java/com/bweb/controller/BsDiscountStockController.java +++ b/bweb/src/main/java/com/bweb/controller/BsDiscountStockController.java @@ -7,19 +7,11 @@ 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.BsDiscount; -import com.hfkj.entity.BsDiscountStockCode; -import com.hfkj.entity.BsMerchant; import com.hfkj.model.ResponseData; -import com.hfkj.service.BsDiscountService; import com.hfkj.service.BsDiscountStockBatchService; import com.hfkj.service.BsDiscountStockCodeService; -import com.hfkj.service.BsMerchantService; -import com.hfkj.sysenum.DiscountStatusEnum; -import com.hfkj.sysenum.DiscountTypeEnum; 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; diff --git a/bweb/src/main/java/com/bweb/controller/BsGasClassGroupController.java b/bweb/src/main/java/com/bweb/controller/BsGasClassGroupController.java index e8c2fe2..995218a 100644 --- a/bweb/src/main/java/com/bweb/controller/BsGasClassGroupController.java +++ b/bweb/src/main/java/com/bweb/controller/BsGasClassGroupController.java @@ -14,7 +14,7 @@ import com.hfkj.entity.BsGasStaff; import com.hfkj.entity.BsMerchant; import com.hfkj.model.ResponseData; import com.hfkj.model.SecUserSessionObject; -import com.hfkj.service.BsMerchantService; +import com.hfkj.service.merchant.BsMerchantService; import com.hfkj.service.gas.BsGasClassGroupService; import com.hfkj.service.gas.BsGasClassGroupTaskService; import com.hfkj.service.gas.BsGasStaffService; diff --git a/bweb/src/main/java/com/bweb/controller/BsGasOilGunNoController.java b/bweb/src/main/java/com/bweb/controller/BsGasOilGunNoController.java index 1efd43e..84a2173 100644 --- a/bweb/src/main/java/com/bweb/controller/BsGasOilGunNoController.java +++ b/bweb/src/main/java/com/bweb/controller/BsGasOilGunNoController.java @@ -13,7 +13,7 @@ import com.hfkj.model.ResponseData; import com.hfkj.model.SecUserSessionObject; import com.hfkj.service.gas.BsGasOilGunNoService; import com.hfkj.service.gas.BsGasOilPriceService; -import com.hfkj.service.BsMerchantService; +import com.hfkj.service.merchant.BsMerchantService; import com.hfkj.service.gas.BsGasService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; diff --git a/bweb/src/main/java/com/bweb/controller/BsGasOilPriceController.java b/bweb/src/main/java/com/bweb/controller/BsGasOilPriceController.java index f3cdf24..e25c53d 100644 --- a/bweb/src/main/java/com/bweb/controller/BsGasOilPriceController.java +++ b/bweb/src/main/java/com/bweb/controller/BsGasOilPriceController.java @@ -12,7 +12,7 @@ import com.hfkj.entity.*; import com.hfkj.model.ResponseData; import com.hfkj.model.SecUserSessionObject; import com.hfkj.service.gas.BsGasOilPriceService; -import com.hfkj.service.BsMerchantService; +import com.hfkj.service.merchant.BsMerchantService; import com.hfkj.service.CommonService; import com.hfkj.service.gas.BsGasService; import com.hfkj.sysenum.gas.GasOilPriceStatusEnum; diff --git a/bweb/src/main/java/com/bweb/controller/BsGasOilPriceTaskController.java b/bweb/src/main/java/com/bweb/controller/BsGasOilPriceTaskController.java index 09addd9..a02f4b3 100644 --- a/bweb/src/main/java/com/bweb/controller/BsGasOilPriceTaskController.java +++ b/bweb/src/main/java/com/bweb/controller/BsGasOilPriceTaskController.java @@ -15,7 +15,7 @@ import com.hfkj.entity.SecRegion; import com.hfkj.model.ResponseData; import com.hfkj.model.SecUserSessionObject; import com.hfkj.service.gas.BsGasOilPriceTaskService; -import com.hfkj.service.BsMerchantService; +import com.hfkj.service.merchant.BsMerchantService; import com.hfkj.service.CommonService; import com.hfkj.sysenum.gas.GasOilPriceTaskExecutionTypeEnum; import com.hfkj.sysenum.gas.GasTaskPriceTypeEnum; diff --git a/bweb/src/main/java/com/bweb/controller/BsGasOrderController.java b/bweb/src/main/java/com/bweb/controller/BsGasOrderController.java index e28490f..61462c7 100644 --- a/bweb/src/main/java/com/bweb/controller/BsGasOrderController.java +++ b/bweb/src/main/java/com/bweb/controller/BsGasOrderController.java @@ -44,12 +44,82 @@ public class BsGasOrderController { @Resource private BsDeviceService deviceService; + @RequestMapping(value="/countOilData",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "统计加油数据") + public ResponseData countOilData(@RequestParam(name = "merId", required = false) Long merId, + @RequestParam(name = "merName", required = false) String merName, + @RequestParam(name = "userPhone", required = false) String userPhone, + @RequestParam(name = "gasStaffName", required = false) String gasStaffName, + @RequestParam(name = "orderNo", required = false) String orderNo, + @RequestParam(name = "payType", required = false) String payType, + @RequestParam(name = "paySerialNo", required = false) String paySerialNo, + @RequestParam(name = "status", required = false) Integer status, + @RequestParam(name = "createTimeS", required = false) Long createTimeS, + @RequestParam(name = "createTimeE", required = false) Long createTimeE, + @RequestParam(name = "payTimeS", required = false) Long payTimeS, + @RequestParam(name = "payTimeE", required = false) Long payTimeE, + @RequestParam(name = "refundTimeS", required = false) Long refundTimeS, + @RequestParam(name = "refundTimeE", required = false) Long refundTimeE, + @RequestParam(name = "gasClassGroupId", required = false) Long gasClassGroupId, + @RequestParam(name = "gasClassGroupTaskId", required = false) Long gasClassGroupTaskId, + @RequestParam(name = "gasOilNo", required = false) String gasOilNo, + @RequestParam(name = "agentId", required = false) Long agentId, + @RequestParam(name = "agentStaffId", required = false) Long agentStaffId) { + try { + SecUserSessionObject sessionObject = userCenter.getSessionModel(SecUserSessionObject.class); + Map param = new HashMap<>(); + param.put("orderNo", orderNo); + param.put("payType", payType); + param.put("paySerialNo", paySerialNo); + param.put("userPhone", userPhone); + param.put("status", status); + param.put("createTimeS", createTimeS); + param.put("createTimeE", createTimeE); + param.put("payTimeS", payTimeS); + param.put("payTimeE", payTimeE); + param.put("refundTimeS", refundTimeS); + param.put("refundTimeE", refundTimeE); + param.put("gasClassGroupId", gasClassGroupId); + param.put("gasClassGroupTaskId", gasClassGroupTaskId); + param.put("gasStaffName", gasStaffName); + param.put("gasOilNo", gasOilNo); + + if (sessionObject.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type1.getCode())) { + param.put("merId", merId); + param.put("merName", merName); + param.put("agentId", agentId); + param.put("agentStaffId", agentStaffId); + } else if (sessionObject.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) { + param.put("merId", sessionObject.getMerchant().getId()); + } else if (sessionObject.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type3.getCode())) { + param.put("gasStaffId", sessionObject.getAccount().getObjectId()); + } else if (sessionObject.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type4.getCode())) { + param.put("agentId", sessionObject.getAccount().getObjectId()); + param.put("agentStaffId", agentStaffId); + } else if (sessionObject.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type5.getCode())) { + param.put("agentStaffId", sessionObject.getAccount().getObjectId()); + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, ""); + } + return ResponseMsgUtil.success(gasOrderService.getGasOrderCount(param)); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + @RequestMapping(value="/queryOilOrderList",method = RequestMethod.GET) @ResponseBody - @ApiOperation(value = "查询用户加油订单") + @ApiOperation(value = "查询加油订单") public ResponseData queryOilOrderList(@RequestParam(name = "merId", required = false) Long merId, @RequestParam(name = "merName", required = false) String merName, + @RequestParam(name = "userPhone", required = false) String userPhone, + @RequestParam(name = "gasStaffName", required = false) String gasStaffName, @RequestParam(name = "orderNo", required = false) String orderNo, + @RequestParam(name = "payType", required = false) String payType, + @RequestParam(name = "paySerialNo", required = false) String paySerialNo, @RequestParam(name = "status", required = false) Integer status, @RequestParam(name = "createTimeS", required = false) Long createTimeS, @RequestParam(name = "createTimeE", required = false) Long createTimeE, @@ -57,6 +127,7 @@ public class BsGasOrderController { @RequestParam(name = "payTimeE", required = false) Long payTimeE, @RequestParam(name = "refundTimeS", required = false) Long refundTimeS, @RequestParam(name = "refundTimeE", required = false) Long refundTimeE, + @RequestParam(name = "gasOilNo", required = false) String gasOilNo, @RequestParam(name = "gasClassGroupId", required = false) Long gasClassGroupId, @RequestParam(name = "gasClassGroupTaskId", required = false) Long gasClassGroupTaskId, @RequestParam(name = "agentId", required = false) Long agentId, @@ -67,6 +138,10 @@ public class BsGasOrderController { SecUserSessionObject sessionObject = userCenter.getSessionModel(SecUserSessionObject.class); Map param = new HashMap<>(); param.put("orderNo", orderNo); + param.put("payType", payType); + param.put("paySerialNo", paySerialNo); + param.put("paySerialNo", paySerialNo); + param.put("userPhone", userPhone); param.put("status", status); param.put("createTimeS", createTimeS); param.put("createTimeE", createTimeE); @@ -76,6 +151,8 @@ public class BsGasOrderController { param.put("refundTimeE", refundTimeE); param.put("gasClassGroupId", gasClassGroupId); param.put("gasClassGroupTaskId", gasClassGroupTaskId); + param.put("gasStaffName", gasStaffName); + param.put("gasOilNo", gasOilNo); if (sessionObject.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type1.getCode())) { param.put("merId", merId); diff --git a/bweb/src/main/java/com/bweb/controller/BsGasStaffController.java b/bweb/src/main/java/com/bweb/controller/BsGasStaffController.java index 886e6f3..daa0e9d 100644 --- a/bweb/src/main/java/com/bweb/controller/BsGasStaffController.java +++ b/bweb/src/main/java/com/bweb/controller/BsGasStaffController.java @@ -9,32 +9,25 @@ import com.hfkj.common.exception.ErrorCode; import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.SysCode; import com.hfkj.common.security.AESEncodeUtil; -import com.hfkj.common.security.SessionObject; import com.hfkj.common.security.UserCenter; import com.hfkj.common.utils.DateUtil; import com.hfkj.common.utils.IDGenerator; import com.hfkj.common.utils.ResponseMsgUtil; -import com.hfkj.config.CommonSysConst; import com.hfkj.entity.BsGasStaff; -import com.hfkj.entity.BsMerchant; import com.hfkj.model.ResponseData; import com.hfkj.model.SecUserSessionObject; -import com.hfkj.service.BsMerchantService; import com.hfkj.service.CommonService; import com.hfkj.service.gas.BsGasStaffService; import com.hfkj.sysenum.SecUserObjectTypeEnum; -import com.hfkj.sysenum.gas.GasStaffStatus; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; -import org.apache.ibatis.annotations.Param; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; -import java.net.URLEncoder; import java.util.Date; import java.util.HashMap; import java.util.Map; diff --git a/bweb/src/main/java/com/bweb/controller/BsMerchantAccountController.java b/bweb/src/main/java/com/bweb/controller/BsMerchantAccountController.java new file mode 100644 index 0000000..2970c1e --- /dev/null +++ b/bweb/src/main/java/com/bweb/controller/BsMerchantAccountController.java @@ -0,0 +1,126 @@ +package com.bweb.controller; + +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +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.BsGasOilGunNo; +import com.hfkj.entity.BsGasOilPrice; +import com.hfkj.entity.BsMerchant; +import com.hfkj.model.ResponseData; +import com.hfkj.service.merchant.BsMerchantAccountRecordService; +import com.hfkj.service.merchant.BsMerchantAccountService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @className: BsMerchantAccountController + * @author: HuRui + * @date: 2024/7/2 + **/ +@Controller +@RequestMapping(value = "/merchantAccount") +@Api(value = "商户管理") +public class BsMerchantAccountController { + private static Logger log = LoggerFactory.getLogger(BsMerchantAccountController.class); + @Resource + private BsMerchantAccountService merchantAccountService; + @Resource + private BsMerchantAccountRecordService merchantAccountRecordService; + + @RequestMapping(value = "/getAccount", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询账户") + public ResponseData getAccount(@RequestParam(value = "merNo", required = true) String merNo) { + try { + // 查询账户 + return ResponseMsgUtil.success(merchantAccountService.getAccount(merNo)); + + } catch (Exception e) { + log.error("BsMerchantAccountController --> getAccount() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + + @RequestMapping(value = "/recharge", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "充值") + public ResponseData recharge(@RequestBody JSONObject body) { + try { + if (body == null + || StringUtils.isBlank(body.getString("merNo")) + || body.getBigDecimal("amount") == null + ) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + // 账户充值 + merchantAccountService.recharge(body.getString("merNo"), body.getBigDecimal("amount")); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("BsMerchantAccountController --> recharge() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/consume", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "consume") + public ResponseData consume(@RequestBody JSONObject body) { + try { + if (body == null + || StringUtils.isBlank(body.getString("merNo")) + || body.getBigDecimal("amount") == null + ) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + // 账户充值 + merchantAccountService.consume(body.getString("merNo"), body.getBigDecimal("amount"), new HashMap<>()); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("BsMerchantAccountController --> recharge() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + + @RequestMapping(value = "/getRecordList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "记录列表") + public ResponseData getRecordList(@RequestParam(value = "merNo", required = true) Long merNo, + @RequestParam(value = "pageNum", required = true) Integer pageNum, + @RequestParam(value = "pageSize", required = true) Integer pageSize) { + try { + + Map param = new HashMap<>(); + param.put("merNo", merNo); + + PageHelper.startPage(pageNum,pageSize); + return ResponseMsgUtil.success(new PageInfo<>(merchantAccountRecordService.getList(param))); + + } catch (Exception e) { + log.error("BsMerchantAccountController --> getRecordList() error!", e); + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/bweb/src/main/java/com/bweb/controller/BsMerchantController.java b/bweb/src/main/java/com/bweb/controller/BsMerchantController.java index fdcb985..6e07f69 100644 --- a/bweb/src/main/java/com/bweb/controller/BsMerchantController.java +++ b/bweb/src/main/java/com/bweb/controller/BsMerchantController.java @@ -13,6 +13,7 @@ import com.hfkj.model.ResponseData; import com.hfkj.service.*; import com.hfkj.service.gas.BsGasOilGunNoService; import com.hfkj.service.gas.BsGasOilPriceService; +import com.hfkj.service.merchant.BsMerchantService; import com.hfkj.sysenum.MerchantSourceTypeEnum; import com.hfkj.sysenum.MerchantStatusEnum; import io.swagger.annotations.Api; diff --git a/bweb/src/main/java/com/bweb/controller/BsMerchantPayConfigController.java b/bweb/src/main/java/com/bweb/controller/BsMerchantPayConfigController.java index 503d7e5..a8f5bb3 100644 --- a/bweb/src/main/java/com/bweb/controller/BsMerchantPayConfigController.java +++ b/bweb/src/main/java/com/bweb/controller/BsMerchantPayConfigController.java @@ -9,8 +9,8 @@ import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.entity.BsMerchant; import com.hfkj.entity.BsMerchantPayConfig; import com.hfkj.model.ResponseData; -import com.hfkj.service.BsMerchantPayConfigService; -import com.hfkj.service.BsMerchantService; +import com.hfkj.service.merchant.BsMerchantPayConfigService; +import com.hfkj.service.merchant.BsMerchantService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; diff --git a/bweb/src/main/java/com/bweb/controller/BsMerchantQrCodeController.java b/bweb/src/main/java/com/bweb/controller/BsMerchantQrCodeController.java index 9c06492..8d4f99a 100644 --- a/bweb/src/main/java/com/bweb/controller/BsMerchantQrCodeController.java +++ b/bweb/src/main/java/com/bweb/controller/BsMerchantQrCodeController.java @@ -6,7 +6,7 @@ import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.SysCode; import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.model.ResponseData; -import com.hfkj.service.BsMerchantQrCodeService; +import com.hfkj.service.merchant.BsMerchantQrCodeService; import com.hfkj.sysenum.MerchantQrCodeStatusEnum; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; diff --git a/bweb/src/main/java/com/bweb/controller/BsMerchantUserController.java b/bweb/src/main/java/com/bweb/controller/BsMerchantUserController.java index 09da791..ec1e055 100644 --- a/bweb/src/main/java/com/bweb/controller/BsMerchantUserController.java +++ b/bweb/src/main/java/com/bweb/controller/BsMerchantUserController.java @@ -7,10 +7,9 @@ import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.SysCode; import com.hfkj.common.security.UserCenter; import com.hfkj.common.utils.ResponseMsgUtil; -import com.hfkj.entity.BsMerchantUser; import com.hfkj.model.ResponseData; import com.hfkj.model.SecUserSessionObject; -import com.hfkj.service.BsMerchantUserService; +import com.hfkj.service.merchant.BsMerchantUserService; import com.hfkj.sysenum.SecUserObjectTypeEnum; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; diff --git a/cweb/src/main/java/com/cweb/controller/BsMerchantUserController.java b/cweb/src/main/java/com/cweb/controller/BsMerchantUserController.java index 9a72f28..00902c0 100644 --- a/cweb/src/main/java/com/cweb/controller/BsMerchantUserController.java +++ b/cweb/src/main/java/com/cweb/controller/BsMerchantUserController.java @@ -4,12 +4,11 @@ import com.hfkj.common.exception.ErrorCode; import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.SysCode; import com.hfkj.common.security.UserCenter; -import com.hfkj.common.utils.HttpsUtils; import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.entity.BsMerchantUser; import com.hfkj.model.ResponseData; import com.hfkj.model.UserSessionObject; -import com.hfkj.service.BsMerchantUserService; +import com.hfkj.service.merchant.BsMerchantUserService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; diff --git a/cweb/src/main/java/com/cweb/controller/order/BsOrderController.java b/cweb/src/main/java/com/cweb/controller/order/BsOrderController.java index 5bb5ecc..80ddcfd 100644 --- a/cweb/src/main/java/com/cweb/controller/order/BsOrderController.java +++ b/cweb/src/main/java/com/cweb/controller/order/BsOrderController.java @@ -1,8 +1,6 @@ package com.cweb.controller.order; import com.alibaba.fastjson.JSONObject; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; import com.hfkj.common.exception.ErrorCode; import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.SysCode; @@ -13,7 +11,7 @@ import com.hfkj.model.ResponseData; import com.hfkj.model.UserSessionObject; import com.hfkj.model.order.OrderChildModel; import com.hfkj.model.order.OrderModel; -import com.hfkj.service.BsMerchantService; +import com.hfkj.service.merchant.BsMerchantService; import com.hfkj.service.order.BsOrderService; import com.hfkj.sysenum.order.OrderChildProductTypeEnum; import io.swagger.annotations.Api; @@ -25,8 +23,6 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; -import java.util.HashMap; -import java.util.Map; @Controller @RequestMapping(value = "/order") 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 1f13425..56227a2 100644 --- a/cweb/src/main/java/com/cweb/controller/order/OrderPayController.java +++ b/cweb/src/main/java/com/cweb/controller/order/OrderPayController.java @@ -4,19 +4,15 @@ 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.security.UserCenter; import com.hfkj.common.utils.DateUtil; import com.hfkj.common.utils.RandomUtils; import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.entity.BsMerchantPayConfig; import com.hfkj.entity.BsOrderSettle; import com.hfkj.model.ResponseData; -import com.hfkj.model.UserSessionObject; -import com.hfkj.model.order.OrderChildModel; import com.hfkj.model.order.OrderModel; import com.hfkj.pay.HuiPayService; -import com.hfkj.service.BsMerchantPayConfigService; -import com.hfkj.service.order.BsOrderChildService; +import com.hfkj.service.merchant.BsMerchantPayConfigService; import com.hfkj.service.order.BsOrderService; import com.hfkj.service.order.BsOrderSettleService; import com.hfkj.sysenum.order.OrderPayTypeEnum; diff --git a/service/src/main/java/com/hfkj/common/utils/BankNumberUtil.java b/service/src/main/java/com/hfkj/common/utils/BankNumberUtil.java new file mode 100644 index 0000000..419a92d --- /dev/null +++ b/service/src/main/java/com/hfkj/common/utils/BankNumberUtil.java @@ -0,0 +1,119 @@ +package com.hfkj.common.utils; + +import com.hfkj.common.exception.AppException; +import org.apache.commons.lang3.StringUtils; + +public class BankNumberUtil { + private static int i = 0; + + /** + * 需要传入一个前缀:6、8、9中的一个。 + * 其中:6:类型1,8:类型2,9:类型3 【根据自己的业务定义】 + * 其他则会返回异常 + * @param prefix + * @return + */ + public synchronized static String getBrankNumber(String prefix) { + if(StringUtils.isNotBlank(prefix)){ + if("6".indexOf(prefix)>=0&&prefix.length()==1){ + String st = "610"+prefix+getUnixTime(); + return st+getBankCardCheckCode(st); + } else if("8".indexOf(prefix)>=0&&prefix.length()==1){ + String st = "810"+prefix+getUnixTime(); + return st+getBankCardCheckCode(st); + }else{ + System.out.println("银行卡号前缀有误"); + } + } else { + System.out.println("银行卡号去前缀不能是空"); + } + return null; + } + + /*** + * 获取当前系统时间戳 并截取 + * @return + */ + private synchronized static String getUnixTime(){ + try { + Thread.sleep(10);//线程同步执行,休眠10毫秒 防止卡号重复 + + } catch (InterruptedException e) { + e.printStackTrace(); + } + + i++;i=i>100?i%10:i; + + return ((System.currentTimeMillis()/100)+"").substring(1)+(i%10); + + } + + /** + + * 校验银行卡卡号 + + * @param cardId + + * @return + + */ + + public static boolean checkBankCard(String cardId) { + char bit = getBankCardCheckCode(cardId.substring(0, cardId.length() - 1)); + if(bit == 'N'){ + return false; + } + return cardId.charAt(cardId.length() - 1) == bit; + } + + /** + + * 从不含校验位的银行卡卡号采用 Luhm 校验算法获得校验位 + + * @param nonCheckCodeCardId + + * @return + + */ + + public static char getBankCardCheckCode(String nonCheckCodeCardId){ + if(nonCheckCodeCardId == null || nonCheckCodeCardId.trim().length() == 0 + + || !nonCheckCodeCardId.matches("\\d+")) { +//如果传的不是数据返回N + return 'N'; + } + + char[] chs = nonCheckCodeCardId.trim().toCharArray(); + + int luhmSum = 0; + + for(int i = chs.length - 1, j = 0; i >= 0; i--, j++) { + int k = chs[i] - '0'; + + if(j % 2 == 0) { + k *= 2; + + k = k / 10 + k % 10; + + } + + luhmSum += k; + + } + + return (luhmSum % 10 == 0) ? '0' : (char)((10 - luhmSum % 10) + '0'); + + } + + public static void main(String[] args) { + try { + for (int i = 0; i <= 100;i++) { + System.out.println(getBrankNumber("8")); + } + } catch (AppException e) { + e.printStackTrace(); + } + + } +} diff --git a/service/src/main/java/com/hfkj/dao/BsGasOrderMapperExt.java b/service/src/main/java/com/hfkj/dao/BsGasOrderMapperExt.java index 0ab60a6..93075ef 100644 --- a/service/src/main/java/com/hfkj/dao/BsGasOrderMapperExt.java +++ b/service/src/main/java/com/hfkj/dao/BsGasOrderMapperExt.java @@ -1,7 +1,47 @@ package com.hfkj.dao; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.Map; + /** * mapper扩展类 */ public interface BsGasOrderMapperExt { -} \ No newline at end of file + + @Select("") + Map selectGasOrderCount(@Param("param") Map param); +} diff --git a/service/src/main/java/com/hfkj/dao/BsMerchantAccountMapper.java b/service/src/main/java/com/hfkj/dao/BsMerchantAccountMapper.java new file mode 100644 index 0000000..a046fe5 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsMerchantAccountMapper.java @@ -0,0 +1,122 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsMerchantAccount; +import com.hfkj.entity.BsMerchantAccountExample; +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 BsMerchantAccountMapper extends BsMerchantAccountMapperExt { + @SelectProvider(type=BsMerchantAccountSqlProvider.class, method="countByExample") + long countByExample(BsMerchantAccountExample example); + + @DeleteProvider(type=BsMerchantAccountSqlProvider.class, method="deleteByExample") + int deleteByExample(BsMerchantAccountExample example); + + @Delete({ + "delete from bs_merchant_account", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into bs_merchant_account (mer_id, mer_no, ", + "amount, amount_consume, ", + "`status`, create_time, ", + "update_time, ext_1, ", + "ext_2, ext_3)", + "values (#{merId,jdbcType=BIGINT}, #{merNo,jdbcType=VARCHAR}, ", + "#{amount,jdbcType=DECIMAL}, #{amountConsume,jdbcType=DECIMAL}, ", + "#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", + "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(BsMerchantAccount record); + + @InsertProvider(type=BsMerchantAccountSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(BsMerchantAccount record); + + @SelectProvider(type=BsMerchantAccountSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR), + @Result(column="amount", property="amount", jdbcType=JdbcType.DECIMAL), + @Result(column="amount_consume", property="amountConsume", jdbcType=JdbcType.DECIMAL), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @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(BsMerchantAccountExample example); + + @Select({ + "select", + "id, mer_id, mer_no, amount, amount_consume, `status`, create_time, update_time, ", + "ext_1, ext_2, ext_3", + "from bs_merchant_account", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR), + @Result(column="amount", property="amount", jdbcType=JdbcType.DECIMAL), + @Result(column="amount_consume", property="amountConsume", jdbcType=JdbcType.DECIMAL), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @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) + }) + BsMerchantAccount selectByPrimaryKey(Long id); + + @UpdateProvider(type=BsMerchantAccountSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") BsMerchantAccount record, @Param("example") BsMerchantAccountExample example); + + @UpdateProvider(type=BsMerchantAccountSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") BsMerchantAccount record, @Param("example") BsMerchantAccountExample example); + + @UpdateProvider(type=BsMerchantAccountSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(BsMerchantAccount record); + + @Update({ + "update bs_merchant_account", + "set mer_id = #{merId,jdbcType=BIGINT},", + "mer_no = #{merNo,jdbcType=VARCHAR},", + "amount = #{amount,jdbcType=DECIMAL},", + "amount_consume = #{amountConsume,jdbcType=DECIMAL},", + "`status` = #{status,jdbcType=INTEGER},", + "create_time = #{createTime,jdbcType=TIMESTAMP},", + "update_time = #{updateTime,jdbcType=TIMESTAMP},", + "ext_1 = #{ext1,jdbcType=VARCHAR},", + "ext_2 = #{ext2,jdbcType=VARCHAR},", + "ext_3 = #{ext3,jdbcType=VARCHAR}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(BsMerchantAccount record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsMerchantAccountMapperExt.java b/service/src/main/java/com/hfkj/dao/BsMerchantAccountMapperExt.java new file mode 100644 index 0000000..b4f23e2 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsMerchantAccountMapperExt.java @@ -0,0 +1,7 @@ +package com.hfkj.dao; + +/** + * mapper扩展类 + */ +public interface BsMerchantAccountMapperExt { +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsMerchantAccountRecordMapper.java b/service/src/main/java/com/hfkj/dao/BsMerchantAccountRecordMapper.java new file mode 100644 index 0000000..d6b6d99 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsMerchantAccountRecordMapper.java @@ -0,0 +1,159 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsMerchantAccountRecord; +import com.hfkj.entity.BsMerchantAccountRecordExample; +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 BsMerchantAccountRecordMapper extends BsMerchantAccountRecordMapperExt { + @SelectProvider(type=BsMerchantAccountRecordSqlProvider.class, method="countByExample") + long countByExample(BsMerchantAccountRecordExample example); + + @DeleteProvider(type=BsMerchantAccountRecordSqlProvider.class, method="deleteByExample") + int deleteByExample(BsMerchantAccountRecordExample example); + + @Delete({ + "delete from bs_merchant_account_record", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into bs_merchant_account_record (merchant_account_id, mer_no, ", + "`type`, transaction_amount, ", + "before_amount, after_amount, ", + "source_type, source_id, ", + "source_order_no, source_content, ", + "`status`, create_time, ", + "op_user_type, op_user_id, ", + "op_user_name, op_user_phone, ", + "ext_1, ext_2, ext_3)", + "values (#{merchantAccountId,jdbcType=BIGINT}, #{merNo,jdbcType=VARCHAR}, ", + "#{type,jdbcType=INTEGER}, #{transactionAmount,jdbcType=DECIMAL}, ", + "#{beforeAmount,jdbcType=DECIMAL}, #{afterAmount,jdbcType=DECIMAL}, ", + "#{sourceType,jdbcType=INTEGER}, #{sourceId,jdbcType=BIGINT}, ", + "#{sourceOrderNo,jdbcType=VARCHAR}, #{sourceContent,jdbcType=VARCHAR}, ", + "#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{opUserType,jdbcType=INTEGER}, #{opUserId,jdbcType=BIGINT}, ", + "#{opUserName,jdbcType=VARCHAR}, #{opUserPhone,jdbcType=VARCHAR}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(BsMerchantAccountRecord record); + + @InsertProvider(type=BsMerchantAccountRecordSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(BsMerchantAccountRecord record); + + @SelectProvider(type=BsMerchantAccountRecordSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="merchant_account_id", property="merchantAccountId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR), + @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), + @Result(column="transaction_amount", property="transactionAmount", jdbcType=JdbcType.DECIMAL), + @Result(column="before_amount", property="beforeAmount", jdbcType=JdbcType.DECIMAL), + @Result(column="after_amount", property="afterAmount", jdbcType=JdbcType.DECIMAL), + @Result(column="source_type", property="sourceType", jdbcType=JdbcType.INTEGER), + @Result(column="source_id", property="sourceId", jdbcType=JdbcType.BIGINT), + @Result(column="source_order_no", property="sourceOrderNo", jdbcType=JdbcType.VARCHAR), + @Result(column="source_content", property="sourceContent", jdbcType=JdbcType.VARCHAR), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="op_user_type", property="opUserType", jdbcType=JdbcType.INTEGER), + @Result(column="op_user_id", property="opUserId", jdbcType=JdbcType.BIGINT), + @Result(column="op_user_name", property="opUserName", jdbcType=JdbcType.VARCHAR), + @Result(column="op_user_phone", property="opUserPhone", 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) + }) + List selectByExample(BsMerchantAccountRecordExample example); + + @Select({ + "select", + "id, merchant_account_id, mer_no, `type`, transaction_amount, before_amount, ", + "after_amount, source_type, source_id, source_order_no, source_content, `status`, ", + "create_time, op_user_type, op_user_id, op_user_name, op_user_phone, ext_1, ext_2, ", + "ext_3", + "from bs_merchant_account_record", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="merchant_account_id", property="merchantAccountId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR), + @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), + @Result(column="transaction_amount", property="transactionAmount", jdbcType=JdbcType.DECIMAL), + @Result(column="before_amount", property="beforeAmount", jdbcType=JdbcType.DECIMAL), + @Result(column="after_amount", property="afterAmount", jdbcType=JdbcType.DECIMAL), + @Result(column="source_type", property="sourceType", jdbcType=JdbcType.INTEGER), + @Result(column="source_id", property="sourceId", jdbcType=JdbcType.BIGINT), + @Result(column="source_order_no", property="sourceOrderNo", jdbcType=JdbcType.VARCHAR), + @Result(column="source_content", property="sourceContent", jdbcType=JdbcType.VARCHAR), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="op_user_type", property="opUserType", jdbcType=JdbcType.INTEGER), + @Result(column="op_user_id", property="opUserId", jdbcType=JdbcType.BIGINT), + @Result(column="op_user_name", property="opUserName", jdbcType=JdbcType.VARCHAR), + @Result(column="op_user_phone", property="opUserPhone", 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) + }) + BsMerchantAccountRecord selectByPrimaryKey(Long id); + + @UpdateProvider(type=BsMerchantAccountRecordSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") BsMerchantAccountRecord record, @Param("example") BsMerchantAccountRecordExample example); + + @UpdateProvider(type=BsMerchantAccountRecordSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") BsMerchantAccountRecord record, @Param("example") BsMerchantAccountRecordExample example); + + @UpdateProvider(type=BsMerchantAccountRecordSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(BsMerchantAccountRecord record); + + @Update({ + "update bs_merchant_account_record", + "set merchant_account_id = #{merchantAccountId,jdbcType=BIGINT},", + "mer_no = #{merNo,jdbcType=VARCHAR},", + "`type` = #{type,jdbcType=INTEGER},", + "transaction_amount = #{transactionAmount,jdbcType=DECIMAL},", + "before_amount = #{beforeAmount,jdbcType=DECIMAL},", + "after_amount = #{afterAmount,jdbcType=DECIMAL},", + "source_type = #{sourceType,jdbcType=INTEGER},", + "source_id = #{sourceId,jdbcType=BIGINT},", + "source_order_no = #{sourceOrderNo,jdbcType=VARCHAR},", + "source_content = #{sourceContent,jdbcType=VARCHAR},", + "`status` = #{status,jdbcType=INTEGER},", + "create_time = #{createTime,jdbcType=TIMESTAMP},", + "op_user_type = #{opUserType,jdbcType=INTEGER},", + "op_user_id = #{opUserId,jdbcType=BIGINT},", + "op_user_name = #{opUserName,jdbcType=VARCHAR},", + "op_user_phone = #{opUserPhone,jdbcType=VARCHAR},", + "ext_1 = #{ext1,jdbcType=VARCHAR},", + "ext_2 = #{ext2,jdbcType=VARCHAR},", + "ext_3 = #{ext3,jdbcType=VARCHAR}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(BsMerchantAccountRecord record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsMerchantAccountRecordMapperExt.java b/service/src/main/java/com/hfkj/dao/BsMerchantAccountRecordMapperExt.java new file mode 100644 index 0000000..df46d32 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsMerchantAccountRecordMapperExt.java @@ -0,0 +1,7 @@ +package com.hfkj.dao; + +/** + * mapper扩展类 + */ +public interface BsMerchantAccountRecordMapperExt { +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsMerchantAccountRecordSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsMerchantAccountRecordSqlProvider.java new file mode 100644 index 0000000..f381013 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsMerchantAccountRecordSqlProvider.java @@ -0,0 +1,444 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsMerchantAccountRecord; +import com.hfkj.entity.BsMerchantAccountRecordExample.Criteria; +import com.hfkj.entity.BsMerchantAccountRecordExample.Criterion; +import com.hfkj.entity.BsMerchantAccountRecordExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class BsMerchantAccountRecordSqlProvider { + + public String countByExample(BsMerchantAccountRecordExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("bs_merchant_account_record"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(BsMerchantAccountRecordExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("bs_merchant_account_record"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(BsMerchantAccountRecord record) { + SQL sql = new SQL(); + sql.INSERT_INTO("bs_merchant_account_record"); + + if (record.getMerchantAccountId() != null) { + sql.VALUES("merchant_account_id", "#{merchantAccountId,jdbcType=BIGINT}"); + } + + if (record.getMerNo() != null) { + sql.VALUES("mer_no", "#{merNo,jdbcType=VARCHAR}"); + } + + if (record.getType() != null) { + sql.VALUES("`type`", "#{type,jdbcType=INTEGER}"); + } + + if (record.getTransactionAmount() != null) { + sql.VALUES("transaction_amount", "#{transactionAmount,jdbcType=DECIMAL}"); + } + + if (record.getBeforeAmount() != null) { + sql.VALUES("before_amount", "#{beforeAmount,jdbcType=DECIMAL}"); + } + + if (record.getAfterAmount() != null) { + sql.VALUES("after_amount", "#{afterAmount,jdbcType=DECIMAL}"); + } + + if (record.getSourceType() != null) { + sql.VALUES("source_type", "#{sourceType,jdbcType=INTEGER}"); + } + + if (record.getSourceId() != null) { + sql.VALUES("source_id", "#{sourceId,jdbcType=BIGINT}"); + } + + if (record.getSourceOrderNo() != null) { + sql.VALUES("source_order_no", "#{sourceOrderNo,jdbcType=VARCHAR}"); + } + + if (record.getSourceContent() != null) { + sql.VALUES("source_content", "#{sourceContent,jdbcType=VARCHAR}"); + } + + if (record.getStatus() != null) { + sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getOpUserType() != null) { + sql.VALUES("op_user_type", "#{opUserType,jdbcType=INTEGER}"); + } + + if (record.getOpUserId() != null) { + sql.VALUES("op_user_id", "#{opUserId,jdbcType=BIGINT}"); + } + + if (record.getOpUserName() != null) { + sql.VALUES("op_user_name", "#{opUserName,jdbcType=VARCHAR}"); + } + + if (record.getOpUserPhone() != null) { + sql.VALUES("op_user_phone", "#{opUserPhone,jdbcType=VARCHAR}"); + } + + 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(BsMerchantAccountRecordExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("merchant_account_id"); + sql.SELECT("mer_no"); + sql.SELECT("`type`"); + sql.SELECT("transaction_amount"); + sql.SELECT("before_amount"); + sql.SELECT("after_amount"); + sql.SELECT("source_type"); + sql.SELECT("source_id"); + sql.SELECT("source_order_no"); + sql.SELECT("source_content"); + sql.SELECT("`status`"); + sql.SELECT("create_time"); + sql.SELECT("op_user_type"); + sql.SELECT("op_user_id"); + sql.SELECT("op_user_name"); + sql.SELECT("op_user_phone"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("bs_merchant_account_record"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + BsMerchantAccountRecord record = (BsMerchantAccountRecord) parameter.get("record"); + BsMerchantAccountRecordExample example = (BsMerchantAccountRecordExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("bs_merchant_account_record"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getMerchantAccountId() != null) { + sql.SET("merchant_account_id = #{record.merchantAccountId,jdbcType=BIGINT}"); + } + + if (record.getMerNo() != null) { + sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}"); + } + + if (record.getType() != null) { + sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); + } + + if (record.getTransactionAmount() != null) { + sql.SET("transaction_amount = #{record.transactionAmount,jdbcType=DECIMAL}"); + } + + if (record.getBeforeAmount() != null) { + sql.SET("before_amount = #{record.beforeAmount,jdbcType=DECIMAL}"); + } + + if (record.getAfterAmount() != null) { + sql.SET("after_amount = #{record.afterAmount,jdbcType=DECIMAL}"); + } + + if (record.getSourceType() != null) { + sql.SET("source_type = #{record.sourceType,jdbcType=INTEGER}"); + } + + if (record.getSourceId() != null) { + sql.SET("source_id = #{record.sourceId,jdbcType=BIGINT}"); + } + + if (record.getSourceOrderNo() != null) { + sql.SET("source_order_no = #{record.sourceOrderNo,jdbcType=VARCHAR}"); + } + + if (record.getSourceContent() != null) { + sql.SET("source_content = #{record.sourceContent,jdbcType=VARCHAR}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getOpUserType() != null) { + sql.SET("op_user_type = #{record.opUserType,jdbcType=INTEGER}"); + } + + if (record.getOpUserId() != null) { + sql.SET("op_user_id = #{record.opUserId,jdbcType=BIGINT}"); + } + + if (record.getOpUserName() != null) { + sql.SET("op_user_name = #{record.opUserName,jdbcType=VARCHAR}"); + } + + if (record.getOpUserPhone() != null) { + sql.SET("op_user_phone = #{record.opUserPhone,jdbcType=VARCHAR}"); + } + + 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_merchant_account_record"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("merchant_account_id = #{record.merchantAccountId,jdbcType=BIGINT}"); + sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}"); + sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); + sql.SET("transaction_amount = #{record.transactionAmount,jdbcType=DECIMAL}"); + sql.SET("before_amount = #{record.beforeAmount,jdbcType=DECIMAL}"); + sql.SET("after_amount = #{record.afterAmount,jdbcType=DECIMAL}"); + sql.SET("source_type = #{record.sourceType,jdbcType=INTEGER}"); + sql.SET("source_id = #{record.sourceId,jdbcType=BIGINT}"); + sql.SET("source_order_no = #{record.sourceOrderNo,jdbcType=VARCHAR}"); + sql.SET("source_content = #{record.sourceContent,jdbcType=VARCHAR}"); + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + sql.SET("op_user_type = #{record.opUserType,jdbcType=INTEGER}"); + sql.SET("op_user_id = #{record.opUserId,jdbcType=BIGINT}"); + sql.SET("op_user_name = #{record.opUserName,jdbcType=VARCHAR}"); + sql.SET("op_user_phone = #{record.opUserPhone,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}"); + + BsMerchantAccountRecordExample example = (BsMerchantAccountRecordExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(BsMerchantAccountRecord record) { + SQL sql = new SQL(); + sql.UPDATE("bs_merchant_account_record"); + + if (record.getMerchantAccountId() != null) { + sql.SET("merchant_account_id = #{merchantAccountId,jdbcType=BIGINT}"); + } + + if (record.getMerNo() != null) { + sql.SET("mer_no = #{merNo,jdbcType=VARCHAR}"); + } + + if (record.getType() != null) { + sql.SET("`type` = #{type,jdbcType=INTEGER}"); + } + + if (record.getTransactionAmount() != null) { + sql.SET("transaction_amount = #{transactionAmount,jdbcType=DECIMAL}"); + } + + if (record.getBeforeAmount() != null) { + sql.SET("before_amount = #{beforeAmount,jdbcType=DECIMAL}"); + } + + if (record.getAfterAmount() != null) { + sql.SET("after_amount = #{afterAmount,jdbcType=DECIMAL}"); + } + + if (record.getSourceType() != null) { + sql.SET("source_type = #{sourceType,jdbcType=INTEGER}"); + } + + if (record.getSourceId() != null) { + sql.SET("source_id = #{sourceId,jdbcType=BIGINT}"); + } + + if (record.getSourceOrderNo() != null) { + sql.SET("source_order_no = #{sourceOrderNo,jdbcType=VARCHAR}"); + } + + if (record.getSourceContent() != null) { + sql.SET("source_content = #{sourceContent,jdbcType=VARCHAR}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{status,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getOpUserType() != null) { + sql.SET("op_user_type = #{opUserType,jdbcType=INTEGER}"); + } + + if (record.getOpUserId() != null) { + sql.SET("op_user_id = #{opUserId,jdbcType=BIGINT}"); + } + + if (record.getOpUserName() != null) { + sql.SET("op_user_name = #{opUserName,jdbcType=VARCHAR}"); + } + + if (record.getOpUserPhone() != null) { + sql.SET("op_user_phone = #{opUserPhone,jdbcType=VARCHAR}"); + } + + 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, BsMerchantAccountRecordExample 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/BsMerchantAccountSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsMerchantAccountSqlProvider.java new file mode 100644 index 0000000..20b6394 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsMerchantAccountSqlProvider.java @@ -0,0 +1,318 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsMerchantAccount; +import com.hfkj.entity.BsMerchantAccountExample.Criteria; +import com.hfkj.entity.BsMerchantAccountExample.Criterion; +import com.hfkj.entity.BsMerchantAccountExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class BsMerchantAccountSqlProvider { + + public String countByExample(BsMerchantAccountExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("bs_merchant_account"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(BsMerchantAccountExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("bs_merchant_account"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(BsMerchantAccount record) { + SQL sql = new SQL(); + sql.INSERT_INTO("bs_merchant_account"); + + if (record.getMerId() != null) { + sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}"); + } + + if (record.getMerNo() != null) { + sql.VALUES("mer_no", "#{merNo,jdbcType=VARCHAR}"); + } + + if (record.getAmount() != null) { + sql.VALUES("amount", "#{amount,jdbcType=DECIMAL}"); + } + + if (record.getAmountConsume() != null) { + sql.VALUES("amount_consume", "#{amountConsume,jdbcType=DECIMAL}"); + } + + if (record.getStatus() != null) { + sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); + } + + 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(BsMerchantAccountExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("mer_id"); + sql.SELECT("mer_no"); + sql.SELECT("amount"); + sql.SELECT("amount_consume"); + sql.SELECT("`status`"); + sql.SELECT("create_time"); + sql.SELECT("update_time"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("bs_merchant_account"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + BsMerchantAccount record = (BsMerchantAccount) parameter.get("record"); + BsMerchantAccountExample example = (BsMerchantAccountExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("bs_merchant_account"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getMerId() != null) { + sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); + } + + if (record.getMerNo() != null) { + sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}"); + } + + if (record.getAmount() != null) { + sql.SET("amount = #{record.amount,jdbcType=DECIMAL}"); + } + + if (record.getAmountConsume() != null) { + sql.SET("amount_consume = #{record.amountConsume,jdbcType=DECIMAL}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + } + + 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.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_merchant_account"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); + sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}"); + sql.SET("amount = #{record.amount,jdbcType=DECIMAL}"); + sql.SET("amount_consume = #{record.amountConsume,jdbcType=DECIMAL}"); + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + + BsMerchantAccountExample example = (BsMerchantAccountExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(BsMerchantAccount record) { + SQL sql = new SQL(); + sql.UPDATE("bs_merchant_account"); + + if (record.getMerId() != null) { + sql.SET("mer_id = #{merId,jdbcType=BIGINT}"); + } + + if (record.getMerNo() != null) { + sql.SET("mer_no = #{merNo,jdbcType=VARCHAR}"); + } + + if (record.getAmount() != null) { + sql.SET("amount = #{amount,jdbcType=DECIMAL}"); + } + + if (record.getAmountConsume() != null) { + sql.SET("amount_consume = #{amountConsume,jdbcType=DECIMAL}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{status,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); + } + + 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, BsMerchantAccountExample 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/entity/BsMerchantAccount.java b/service/src/main/java/com/hfkj/entity/BsMerchantAccount.java new file mode 100644 index 0000000..e89de62 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsMerchantAccount.java @@ -0,0 +1,214 @@ +package com.hfkj.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * bs_merchant_account + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class BsMerchantAccount implements Serializable { + private Long id; + + /** + * 商户id + */ + private Long merId; + + /** + * 商户编号 + */ + private String merNo; + + /** + * 余额 + */ + private BigDecimal amount; + + /** + * 消费金额 + */ + private BigDecimal amountConsume; + + /** + * 状态 0:删除 1:正常 + */ + private Integer status; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 修改时间 + */ + private Date updateTime; + + 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 Long getMerId() { + return merId; + } + + public void setMerId(Long merId) { + this.merId = merId; + } + + public String getMerNo() { + return merNo; + } + + public void setMerNo(String merNo) { + this.merNo = merNo; + } + + public BigDecimal getAmount() { + return amount; + } + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + public BigDecimal getAmountConsume() { + return amountConsume; + } + + public void setAmountConsume(BigDecimal amountConsume) { + this.amountConsume = amountConsume; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + 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 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; + } + BsMerchantAccount other = (BsMerchantAccount) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId())) + && (this.getMerNo() == null ? other.getMerNo() == null : this.getMerNo().equals(other.getMerNo())) + && (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount())) + && (this.getAmountConsume() == null ? other.getAmountConsume() == null : this.getAmountConsume().equals(other.getAmountConsume())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) + && (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 + ((getMerId() == null) ? 0 : getMerId().hashCode()); + result = prime * result + ((getMerNo() == null) ? 0 : getMerNo().hashCode()); + result = prime * result + ((getAmount() == null) ? 0 : getAmount().hashCode()); + result = prime * result + ((getAmountConsume() == null) ? 0 : getAmountConsume().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().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(", merId=").append(merId); + sb.append(", merNo=").append(merNo); + sb.append(", amount=").append(amount); + sb.append(", amountConsume=").append(amountConsume); + sb.append(", status=").append(status); + sb.append(", createTime=").append(createTime); + sb.append(", updateTime=").append(updateTime); + 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/BsMerchantAccountExample.java b/service/src/main/java/com/hfkj/entity/BsMerchantAccountExample.java new file mode 100644 index 0000000..960f992 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsMerchantAccountExample.java @@ -0,0 +1,924 @@ +package com.hfkj.entity; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class BsMerchantAccountExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public BsMerchantAccountExample() { + 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 andMerIdIsNull() { + addCriterion("mer_id is null"); + return (Criteria) this; + } + + public Criteria andMerIdIsNotNull() { + addCriterion("mer_id is not null"); + return (Criteria) this; + } + + public Criteria andMerIdEqualTo(Long value) { + addCriterion("mer_id =", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotEqualTo(Long value) { + addCriterion("mer_id <>", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdGreaterThan(Long value) { + addCriterion("mer_id >", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdGreaterThanOrEqualTo(Long value) { + addCriterion("mer_id >=", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdLessThan(Long value) { + addCriterion("mer_id <", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdLessThanOrEqualTo(Long value) { + addCriterion("mer_id <=", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdIn(List values) { + addCriterion("mer_id in", values, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotIn(List values) { + addCriterion("mer_id not in", values, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdBetween(Long value1, Long value2) { + addCriterion("mer_id between", value1, value2, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotBetween(Long value1, Long value2) { + addCriterion("mer_id not between", value1, value2, "merId"); + return (Criteria) this; + } + + public Criteria andMerNoIsNull() { + addCriterion("mer_no is null"); + return (Criteria) this; + } + + public Criteria andMerNoIsNotNull() { + addCriterion("mer_no is not null"); + return (Criteria) this; + } + + public Criteria andMerNoEqualTo(String value) { + addCriterion("mer_no =", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotEqualTo(String value) { + addCriterion("mer_no <>", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoGreaterThan(String value) { + addCriterion("mer_no >", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoGreaterThanOrEqualTo(String value) { + addCriterion("mer_no >=", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLessThan(String value) { + addCriterion("mer_no <", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLessThanOrEqualTo(String value) { + addCriterion("mer_no <=", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLike(String value) { + addCriterion("mer_no like", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotLike(String value) { + addCriterion("mer_no not like", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoIn(List values) { + addCriterion("mer_no in", values, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotIn(List values) { + addCriterion("mer_no not in", values, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoBetween(String value1, String value2) { + addCriterion("mer_no between", value1, value2, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotBetween(String value1, String value2) { + addCriterion("mer_no not between", value1, value2, "merNo"); + return (Criteria) this; + } + + public Criteria andAmountIsNull() { + addCriterion("amount is null"); + return (Criteria) this; + } + + public Criteria andAmountIsNotNull() { + addCriterion("amount is not null"); + return (Criteria) this; + } + + public Criteria andAmountEqualTo(BigDecimal value) { + addCriterion("amount =", value, "amount"); + return (Criteria) this; + } + + public Criteria andAmountNotEqualTo(BigDecimal value) { + addCriterion("amount <>", value, "amount"); + return (Criteria) this; + } + + public Criteria andAmountGreaterThan(BigDecimal value) { + addCriterion("amount >", value, "amount"); + return (Criteria) this; + } + + public Criteria andAmountGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("amount >=", value, "amount"); + return (Criteria) this; + } + + public Criteria andAmountLessThan(BigDecimal value) { + addCriterion("amount <", value, "amount"); + return (Criteria) this; + } + + public Criteria andAmountLessThanOrEqualTo(BigDecimal value) { + addCriterion("amount <=", value, "amount"); + return (Criteria) this; + } + + public Criteria andAmountIn(List values) { + addCriterion("amount in", values, "amount"); + return (Criteria) this; + } + + public Criteria andAmountNotIn(List values) { + addCriterion("amount not in", values, "amount"); + return (Criteria) this; + } + + public Criteria andAmountBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("amount between", value1, value2, "amount"); + return (Criteria) this; + } + + public Criteria andAmountNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("amount not between", value1, value2, "amount"); + return (Criteria) this; + } + + public Criteria andAmountConsumeIsNull() { + addCriterion("amount_consume is null"); + return (Criteria) this; + } + + public Criteria andAmountConsumeIsNotNull() { + addCriterion("amount_consume is not null"); + return (Criteria) this; + } + + public Criteria andAmountConsumeEqualTo(BigDecimal value) { + addCriterion("amount_consume =", value, "amountConsume"); + return (Criteria) this; + } + + public Criteria andAmountConsumeNotEqualTo(BigDecimal value) { + addCriterion("amount_consume <>", value, "amountConsume"); + return (Criteria) this; + } + + public Criteria andAmountConsumeGreaterThan(BigDecimal value) { + addCriterion("amount_consume >", value, "amountConsume"); + return (Criteria) this; + } + + public Criteria andAmountConsumeGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("amount_consume >=", value, "amountConsume"); + return (Criteria) this; + } + + public Criteria andAmountConsumeLessThan(BigDecimal value) { + addCriterion("amount_consume <", value, "amountConsume"); + return (Criteria) this; + } + + public Criteria andAmountConsumeLessThanOrEqualTo(BigDecimal value) { + addCriterion("amount_consume <=", value, "amountConsume"); + return (Criteria) this; + } + + public Criteria andAmountConsumeIn(List values) { + addCriterion("amount_consume in", values, "amountConsume"); + return (Criteria) this; + } + + public Criteria andAmountConsumeNotIn(List values) { + addCriterion("amount_consume not in", values, "amountConsume"); + return (Criteria) this; + } + + public Criteria andAmountConsumeBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("amount_consume between", value1, value2, "amountConsume"); + return (Criteria) this; + } + + public Criteria andAmountConsumeNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("amount_consume not between", value1, value2, "amountConsume"); + 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 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 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/BsMerchantAccountRecord.java b/service/src/main/java/com/hfkj/entity/BsMerchantAccountRecord.java new file mode 100644 index 0000000..93c64b9 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsMerchantAccountRecord.java @@ -0,0 +1,358 @@ +package com.hfkj.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * bs_merchant_account_record + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class BsMerchantAccountRecord implements Serializable { + private Long id; + + /** + * 商户账户id + */ + private Long merchantAccountId; + + /** + * 商户编号 + */ + private String merNo; + + /** + * 类型 1:进账 2:出账 + */ + private Integer type; + + /** + * 交易金额 + */ + private BigDecimal transactionAmount; + + /** + * 变更前金额 + */ + private BigDecimal beforeAmount; + + /** + * 变更后金额 + */ + private BigDecimal afterAmount; + + /** + * 来源类型 1. 充值金额 2. 订单扣除 + */ + private Integer sourceType; + + /** + * 来源id + */ + private Long sourceId; + + /** + * 来源订单号 + */ + private String sourceOrderNo; + + /** + * 来源内容 + */ + private String sourceContent; + + /** + * 状态 0:删除 1:正常 + */ + private Integer status; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 操作人类型 1:管理员 2:客户 + */ + private Integer opUserType; + + /** + * 操作人id + */ + private Long opUserId; + + /** + * 操作人名称 + */ + private String opUserName; + + /** + * 操作人电话 + */ + private String opUserPhone; + + 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 Long getMerchantAccountId() { + return merchantAccountId; + } + + public void setMerchantAccountId(Long merchantAccountId) { + this.merchantAccountId = merchantAccountId; + } + + public String getMerNo() { + return merNo; + } + + public void setMerNo(String merNo) { + this.merNo = merNo; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public BigDecimal getTransactionAmount() { + return transactionAmount; + } + + public void setTransactionAmount(BigDecimal transactionAmount) { + this.transactionAmount = transactionAmount; + } + + public BigDecimal getBeforeAmount() { + return beforeAmount; + } + + public void setBeforeAmount(BigDecimal beforeAmount) { + this.beforeAmount = beforeAmount; + } + + public BigDecimal getAfterAmount() { + return afterAmount; + } + + public void setAfterAmount(BigDecimal afterAmount) { + this.afterAmount = afterAmount; + } + + public Integer getSourceType() { + return sourceType; + } + + public void setSourceType(Integer sourceType) { + this.sourceType = sourceType; + } + + public Long getSourceId() { + return sourceId; + } + + public void setSourceId(Long sourceId) { + this.sourceId = sourceId; + } + + public String getSourceOrderNo() { + return sourceOrderNo; + } + + public void setSourceOrderNo(String sourceOrderNo) { + this.sourceOrderNo = sourceOrderNo; + } + + public String getSourceContent() { + return sourceContent; + } + + public void setSourceContent(String sourceContent) { + this.sourceContent = sourceContent; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Integer getOpUserType() { + return opUserType; + } + + public void setOpUserType(Integer opUserType) { + this.opUserType = opUserType; + } + + public Long getOpUserId() { + return opUserId; + } + + public void setOpUserId(Long opUserId) { + this.opUserId = opUserId; + } + + public String getOpUserName() { + return opUserName; + } + + public void setOpUserName(String opUserName) { + this.opUserName = opUserName; + } + + public String getOpUserPhone() { + return opUserPhone; + } + + public void setOpUserPhone(String opUserPhone) { + this.opUserPhone = opUserPhone; + } + + 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; + } + BsMerchantAccountRecord other = (BsMerchantAccountRecord) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getMerchantAccountId() == null ? other.getMerchantAccountId() == null : this.getMerchantAccountId().equals(other.getMerchantAccountId())) + && (this.getMerNo() == null ? other.getMerNo() == null : this.getMerNo().equals(other.getMerNo())) + && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) + && (this.getTransactionAmount() == null ? other.getTransactionAmount() == null : this.getTransactionAmount().equals(other.getTransactionAmount())) + && (this.getBeforeAmount() == null ? other.getBeforeAmount() == null : this.getBeforeAmount().equals(other.getBeforeAmount())) + && (this.getAfterAmount() == null ? other.getAfterAmount() == null : this.getAfterAmount().equals(other.getAfterAmount())) + && (this.getSourceType() == null ? other.getSourceType() == null : this.getSourceType().equals(other.getSourceType())) + && (this.getSourceId() == null ? other.getSourceId() == null : this.getSourceId().equals(other.getSourceId())) + && (this.getSourceOrderNo() == null ? other.getSourceOrderNo() == null : this.getSourceOrderNo().equals(other.getSourceOrderNo())) + && (this.getSourceContent() == null ? other.getSourceContent() == null : this.getSourceContent().equals(other.getSourceContent())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (this.getOpUserType() == null ? other.getOpUserType() == null : this.getOpUserType().equals(other.getOpUserType())) + && (this.getOpUserId() == null ? other.getOpUserId() == null : this.getOpUserId().equals(other.getOpUserId())) + && (this.getOpUserName() == null ? other.getOpUserName() == null : this.getOpUserName().equals(other.getOpUserName())) + && (this.getOpUserPhone() == null ? other.getOpUserPhone() == null : this.getOpUserPhone().equals(other.getOpUserPhone())) + && (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 + ((getMerchantAccountId() == null) ? 0 : getMerchantAccountId().hashCode()); + result = prime * result + ((getMerNo() == null) ? 0 : getMerNo().hashCode()); + result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); + result = prime * result + ((getTransactionAmount() == null) ? 0 : getTransactionAmount().hashCode()); + result = prime * result + ((getBeforeAmount() == null) ? 0 : getBeforeAmount().hashCode()); + result = prime * result + ((getAfterAmount() == null) ? 0 : getAfterAmount().hashCode()); + result = prime * result + ((getSourceType() == null) ? 0 : getSourceType().hashCode()); + result = prime * result + ((getSourceId() == null) ? 0 : getSourceId().hashCode()); + result = prime * result + ((getSourceOrderNo() == null) ? 0 : getSourceOrderNo().hashCode()); + result = prime * result + ((getSourceContent() == null) ? 0 : getSourceContent().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + result = prime * result + ((getOpUserType() == null) ? 0 : getOpUserType().hashCode()); + result = prime * result + ((getOpUserId() == null) ? 0 : getOpUserId().hashCode()); + result = prime * result + ((getOpUserName() == null) ? 0 : getOpUserName().hashCode()); + result = prime * result + ((getOpUserPhone() == null) ? 0 : getOpUserPhone().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(", merchantAccountId=").append(merchantAccountId); + sb.append(", merNo=").append(merNo); + sb.append(", type=").append(type); + sb.append(", transactionAmount=").append(transactionAmount); + sb.append(", beforeAmount=").append(beforeAmount); + sb.append(", afterAmount=").append(afterAmount); + sb.append(", sourceType=").append(sourceType); + sb.append(", sourceId=").append(sourceId); + sb.append(", sourceOrderNo=").append(sourceOrderNo); + sb.append(", sourceContent=").append(sourceContent); + sb.append(", status=").append(status); + sb.append(", createTime=").append(createTime); + sb.append(", opUserType=").append(opUserType); + sb.append(", opUserId=").append(opUserId); + sb.append(", opUserName=").append(opUserName); + sb.append(", opUserPhone=").append(opUserPhone); + 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/BsMerchantAccountRecordExample.java b/service/src/main/java/com/hfkj/entity/BsMerchantAccountRecordExample.java new file mode 100644 index 0000000..a30fea1 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsMerchantAccountRecordExample.java @@ -0,0 +1,1504 @@ +package com.hfkj.entity; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class BsMerchantAccountRecordExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public BsMerchantAccountRecordExample() { + 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 andMerchantAccountIdIsNull() { + addCriterion("merchant_account_id is null"); + return (Criteria) this; + } + + public Criteria andMerchantAccountIdIsNotNull() { + addCriterion("merchant_account_id is not null"); + return (Criteria) this; + } + + public Criteria andMerchantAccountIdEqualTo(Long value) { + addCriterion("merchant_account_id =", value, "merchantAccountId"); + return (Criteria) this; + } + + public Criteria andMerchantAccountIdNotEqualTo(Long value) { + addCriterion("merchant_account_id <>", value, "merchantAccountId"); + return (Criteria) this; + } + + public Criteria andMerchantAccountIdGreaterThan(Long value) { + addCriterion("merchant_account_id >", value, "merchantAccountId"); + return (Criteria) this; + } + + public Criteria andMerchantAccountIdGreaterThanOrEqualTo(Long value) { + addCriterion("merchant_account_id >=", value, "merchantAccountId"); + return (Criteria) this; + } + + public Criteria andMerchantAccountIdLessThan(Long value) { + addCriterion("merchant_account_id <", value, "merchantAccountId"); + return (Criteria) this; + } + + public Criteria andMerchantAccountIdLessThanOrEqualTo(Long value) { + addCriterion("merchant_account_id <=", value, "merchantAccountId"); + return (Criteria) this; + } + + public Criteria andMerchantAccountIdIn(List values) { + addCriterion("merchant_account_id in", values, "merchantAccountId"); + return (Criteria) this; + } + + public Criteria andMerchantAccountIdNotIn(List values) { + addCriterion("merchant_account_id not in", values, "merchantAccountId"); + return (Criteria) this; + } + + public Criteria andMerchantAccountIdBetween(Long value1, Long value2) { + addCriterion("merchant_account_id between", value1, value2, "merchantAccountId"); + return (Criteria) this; + } + + public Criteria andMerchantAccountIdNotBetween(Long value1, Long value2) { + addCriterion("merchant_account_id not between", value1, value2, "merchantAccountId"); + return (Criteria) this; + } + + public Criteria andMerNoIsNull() { + addCriterion("mer_no is null"); + return (Criteria) this; + } + + public Criteria andMerNoIsNotNull() { + addCriterion("mer_no is not null"); + return (Criteria) this; + } + + public Criteria andMerNoEqualTo(String value) { + addCriterion("mer_no =", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotEqualTo(String value) { + addCriterion("mer_no <>", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoGreaterThan(String value) { + addCriterion("mer_no >", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoGreaterThanOrEqualTo(String value) { + addCriterion("mer_no >=", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLessThan(String value) { + addCriterion("mer_no <", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLessThanOrEqualTo(String value) { + addCriterion("mer_no <=", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLike(String value) { + addCriterion("mer_no like", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotLike(String value) { + addCriterion("mer_no not like", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoIn(List values) { + addCriterion("mer_no in", values, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotIn(List values) { + addCriterion("mer_no not in", values, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoBetween(String value1, String value2) { + addCriterion("mer_no between", value1, value2, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotBetween(String value1, String value2) { + addCriterion("mer_no not between", value1, value2, "merNo"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("`type` is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("`type` is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(Integer value) { + addCriterion("`type` =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(Integer value) { + addCriterion("`type` <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(Integer value) { + addCriterion("`type` >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("`type` >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(Integer value) { + addCriterion("`type` <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(Integer value) { + addCriterion("`type` <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("`type` in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("`type` not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(Integer value1, Integer value2) { + addCriterion("`type` between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(Integer value1, Integer value2) { + addCriterion("`type` not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTransactionAmountIsNull() { + addCriterion("transaction_amount is null"); + return (Criteria) this; + } + + public Criteria andTransactionAmountIsNotNull() { + addCriterion("transaction_amount is not null"); + return (Criteria) this; + } + + public Criteria andTransactionAmountEqualTo(BigDecimal value) { + addCriterion("transaction_amount =", value, "transactionAmount"); + return (Criteria) this; + } + + public Criteria andTransactionAmountNotEqualTo(BigDecimal value) { + addCriterion("transaction_amount <>", value, "transactionAmount"); + return (Criteria) this; + } + + public Criteria andTransactionAmountGreaterThan(BigDecimal value) { + addCriterion("transaction_amount >", value, "transactionAmount"); + return (Criteria) this; + } + + public Criteria andTransactionAmountGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("transaction_amount >=", value, "transactionAmount"); + return (Criteria) this; + } + + public Criteria andTransactionAmountLessThan(BigDecimal value) { + addCriterion("transaction_amount <", value, "transactionAmount"); + return (Criteria) this; + } + + public Criteria andTransactionAmountLessThanOrEqualTo(BigDecimal value) { + addCriterion("transaction_amount <=", value, "transactionAmount"); + return (Criteria) this; + } + + public Criteria andTransactionAmountIn(List values) { + addCriterion("transaction_amount in", values, "transactionAmount"); + return (Criteria) this; + } + + public Criteria andTransactionAmountNotIn(List values) { + addCriterion("transaction_amount not in", values, "transactionAmount"); + return (Criteria) this; + } + + public Criteria andTransactionAmountBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("transaction_amount between", value1, value2, "transactionAmount"); + return (Criteria) this; + } + + public Criteria andTransactionAmountNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("transaction_amount not between", value1, value2, "transactionAmount"); + return (Criteria) this; + } + + public Criteria andBeforeAmountIsNull() { + addCriterion("before_amount is null"); + return (Criteria) this; + } + + public Criteria andBeforeAmountIsNotNull() { + addCriterion("before_amount is not null"); + return (Criteria) this; + } + + public Criteria andBeforeAmountEqualTo(BigDecimal value) { + addCriterion("before_amount =", value, "beforeAmount"); + return (Criteria) this; + } + + public Criteria andBeforeAmountNotEqualTo(BigDecimal value) { + addCriterion("before_amount <>", value, "beforeAmount"); + return (Criteria) this; + } + + public Criteria andBeforeAmountGreaterThan(BigDecimal value) { + addCriterion("before_amount >", value, "beforeAmount"); + return (Criteria) this; + } + + public Criteria andBeforeAmountGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("before_amount >=", value, "beforeAmount"); + return (Criteria) this; + } + + public Criteria andBeforeAmountLessThan(BigDecimal value) { + addCriterion("before_amount <", value, "beforeAmount"); + return (Criteria) this; + } + + public Criteria andBeforeAmountLessThanOrEqualTo(BigDecimal value) { + addCriterion("before_amount <=", value, "beforeAmount"); + return (Criteria) this; + } + + public Criteria andBeforeAmountIn(List values) { + addCriterion("before_amount in", values, "beforeAmount"); + return (Criteria) this; + } + + public Criteria andBeforeAmountNotIn(List values) { + addCriterion("before_amount not in", values, "beforeAmount"); + return (Criteria) this; + } + + public Criteria andBeforeAmountBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("before_amount between", value1, value2, "beforeAmount"); + return (Criteria) this; + } + + public Criteria andBeforeAmountNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("before_amount not between", value1, value2, "beforeAmount"); + return (Criteria) this; + } + + public Criteria andAfterAmountIsNull() { + addCriterion("after_amount is null"); + return (Criteria) this; + } + + public Criteria andAfterAmountIsNotNull() { + addCriterion("after_amount is not null"); + return (Criteria) this; + } + + public Criteria andAfterAmountEqualTo(BigDecimal value) { + addCriterion("after_amount =", value, "afterAmount"); + return (Criteria) this; + } + + public Criteria andAfterAmountNotEqualTo(BigDecimal value) { + addCriterion("after_amount <>", value, "afterAmount"); + return (Criteria) this; + } + + public Criteria andAfterAmountGreaterThan(BigDecimal value) { + addCriterion("after_amount >", value, "afterAmount"); + return (Criteria) this; + } + + public Criteria andAfterAmountGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("after_amount >=", value, "afterAmount"); + return (Criteria) this; + } + + public Criteria andAfterAmountLessThan(BigDecimal value) { + addCriterion("after_amount <", value, "afterAmount"); + return (Criteria) this; + } + + public Criteria andAfterAmountLessThanOrEqualTo(BigDecimal value) { + addCriterion("after_amount <=", value, "afterAmount"); + return (Criteria) this; + } + + public Criteria andAfterAmountIn(List values) { + addCriterion("after_amount in", values, "afterAmount"); + return (Criteria) this; + } + + public Criteria andAfterAmountNotIn(List values) { + addCriterion("after_amount not in", values, "afterAmount"); + return (Criteria) this; + } + + public Criteria andAfterAmountBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("after_amount between", value1, value2, "afterAmount"); + return (Criteria) this; + } + + public Criteria andAfterAmountNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("after_amount not between", value1, value2, "afterAmount"); + return (Criteria) this; + } + + public Criteria andSourceTypeIsNull() { + addCriterion("source_type is null"); + return (Criteria) this; + } + + public Criteria andSourceTypeIsNotNull() { + addCriterion("source_type is not null"); + return (Criteria) this; + } + + public Criteria andSourceTypeEqualTo(Integer value) { + addCriterion("source_type =", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeNotEqualTo(Integer value) { + addCriterion("source_type <>", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeGreaterThan(Integer value) { + addCriterion("source_type >", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("source_type >=", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeLessThan(Integer value) { + addCriterion("source_type <", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeLessThanOrEqualTo(Integer value) { + addCriterion("source_type <=", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeIn(List values) { + addCriterion("source_type in", values, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeNotIn(List values) { + addCriterion("source_type not in", values, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeBetween(Integer value1, Integer value2) { + addCriterion("source_type between", value1, value2, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeNotBetween(Integer value1, Integer value2) { + addCriterion("source_type not between", value1, value2, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceIdIsNull() { + addCriterion("source_id is null"); + return (Criteria) this; + } + + public Criteria andSourceIdIsNotNull() { + addCriterion("source_id is not null"); + return (Criteria) this; + } + + public Criteria andSourceIdEqualTo(Long value) { + addCriterion("source_id =", value, "sourceId"); + return (Criteria) this; + } + + public Criteria andSourceIdNotEqualTo(Long value) { + addCriterion("source_id <>", value, "sourceId"); + return (Criteria) this; + } + + public Criteria andSourceIdGreaterThan(Long value) { + addCriterion("source_id >", value, "sourceId"); + return (Criteria) this; + } + + public Criteria andSourceIdGreaterThanOrEqualTo(Long value) { + addCriterion("source_id >=", value, "sourceId"); + return (Criteria) this; + } + + public Criteria andSourceIdLessThan(Long value) { + addCriterion("source_id <", value, "sourceId"); + return (Criteria) this; + } + + public Criteria andSourceIdLessThanOrEqualTo(Long value) { + addCriterion("source_id <=", value, "sourceId"); + return (Criteria) this; + } + + public Criteria andSourceIdIn(List values) { + addCriterion("source_id in", values, "sourceId"); + return (Criteria) this; + } + + public Criteria andSourceIdNotIn(List values) { + addCriterion("source_id not in", values, "sourceId"); + return (Criteria) this; + } + + public Criteria andSourceIdBetween(Long value1, Long value2) { + addCriterion("source_id between", value1, value2, "sourceId"); + return (Criteria) this; + } + + public Criteria andSourceIdNotBetween(Long value1, Long value2) { + addCriterion("source_id not between", value1, value2, "sourceId"); + return (Criteria) this; + } + + public Criteria andSourceOrderNoIsNull() { + addCriterion("source_order_no is null"); + return (Criteria) this; + } + + public Criteria andSourceOrderNoIsNotNull() { + addCriterion("source_order_no is not null"); + return (Criteria) this; + } + + public Criteria andSourceOrderNoEqualTo(String value) { + addCriterion("source_order_no =", value, "sourceOrderNo"); + return (Criteria) this; + } + + public Criteria andSourceOrderNoNotEqualTo(String value) { + addCriterion("source_order_no <>", value, "sourceOrderNo"); + return (Criteria) this; + } + + public Criteria andSourceOrderNoGreaterThan(String value) { + addCriterion("source_order_no >", value, "sourceOrderNo"); + return (Criteria) this; + } + + public Criteria andSourceOrderNoGreaterThanOrEqualTo(String value) { + addCriterion("source_order_no >=", value, "sourceOrderNo"); + return (Criteria) this; + } + + public Criteria andSourceOrderNoLessThan(String value) { + addCriterion("source_order_no <", value, "sourceOrderNo"); + return (Criteria) this; + } + + public Criteria andSourceOrderNoLessThanOrEqualTo(String value) { + addCriterion("source_order_no <=", value, "sourceOrderNo"); + return (Criteria) this; + } + + public Criteria andSourceOrderNoLike(String value) { + addCriterion("source_order_no like", value, "sourceOrderNo"); + return (Criteria) this; + } + + public Criteria andSourceOrderNoNotLike(String value) { + addCriterion("source_order_no not like", value, "sourceOrderNo"); + return (Criteria) this; + } + + public Criteria andSourceOrderNoIn(List values) { + addCriterion("source_order_no in", values, "sourceOrderNo"); + return (Criteria) this; + } + + public Criteria andSourceOrderNoNotIn(List values) { + addCriterion("source_order_no not in", values, "sourceOrderNo"); + return (Criteria) this; + } + + public Criteria andSourceOrderNoBetween(String value1, String value2) { + addCriterion("source_order_no between", value1, value2, "sourceOrderNo"); + return (Criteria) this; + } + + public Criteria andSourceOrderNoNotBetween(String value1, String value2) { + addCriterion("source_order_no not between", value1, value2, "sourceOrderNo"); + return (Criteria) this; + } + + public Criteria andSourceContentIsNull() { + addCriterion("source_content is null"); + return (Criteria) this; + } + + public Criteria andSourceContentIsNotNull() { + addCriterion("source_content is not null"); + return (Criteria) this; + } + + public Criteria andSourceContentEqualTo(String value) { + addCriterion("source_content =", value, "sourceContent"); + return (Criteria) this; + } + + public Criteria andSourceContentNotEqualTo(String value) { + addCriterion("source_content <>", value, "sourceContent"); + return (Criteria) this; + } + + public Criteria andSourceContentGreaterThan(String value) { + addCriterion("source_content >", value, "sourceContent"); + return (Criteria) this; + } + + public Criteria andSourceContentGreaterThanOrEqualTo(String value) { + addCriterion("source_content >=", value, "sourceContent"); + return (Criteria) this; + } + + public Criteria andSourceContentLessThan(String value) { + addCriterion("source_content <", value, "sourceContent"); + return (Criteria) this; + } + + public Criteria andSourceContentLessThanOrEqualTo(String value) { + addCriterion("source_content <=", value, "sourceContent"); + return (Criteria) this; + } + + public Criteria andSourceContentLike(String value) { + addCriterion("source_content like", value, "sourceContent"); + return (Criteria) this; + } + + public Criteria andSourceContentNotLike(String value) { + addCriterion("source_content not like", value, "sourceContent"); + return (Criteria) this; + } + + public Criteria andSourceContentIn(List values) { + addCriterion("source_content in", values, "sourceContent"); + return (Criteria) this; + } + + public Criteria andSourceContentNotIn(List values) { + addCriterion("source_content not in", values, "sourceContent"); + return (Criteria) this; + } + + public Criteria andSourceContentBetween(String value1, String value2) { + addCriterion("source_content between", value1, value2, "sourceContent"); + return (Criteria) this; + } + + public Criteria andSourceContentNotBetween(String value1, String value2) { + addCriterion("source_content not between", value1, value2, "sourceContent"); + 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 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 andOpUserTypeIsNull() { + addCriterion("op_user_type is null"); + return (Criteria) this; + } + + public Criteria andOpUserTypeIsNotNull() { + addCriterion("op_user_type is not null"); + return (Criteria) this; + } + + public Criteria andOpUserTypeEqualTo(Integer value) { + addCriterion("op_user_type =", value, "opUserType"); + return (Criteria) this; + } + + public Criteria andOpUserTypeNotEqualTo(Integer value) { + addCriterion("op_user_type <>", value, "opUserType"); + return (Criteria) this; + } + + public Criteria andOpUserTypeGreaterThan(Integer value) { + addCriterion("op_user_type >", value, "opUserType"); + return (Criteria) this; + } + + public Criteria andOpUserTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("op_user_type >=", value, "opUserType"); + return (Criteria) this; + } + + public Criteria andOpUserTypeLessThan(Integer value) { + addCriterion("op_user_type <", value, "opUserType"); + return (Criteria) this; + } + + public Criteria andOpUserTypeLessThanOrEqualTo(Integer value) { + addCriterion("op_user_type <=", value, "opUserType"); + return (Criteria) this; + } + + public Criteria andOpUserTypeIn(List values) { + addCriterion("op_user_type in", values, "opUserType"); + return (Criteria) this; + } + + public Criteria andOpUserTypeNotIn(List values) { + addCriterion("op_user_type not in", values, "opUserType"); + return (Criteria) this; + } + + public Criteria andOpUserTypeBetween(Integer value1, Integer value2) { + addCriterion("op_user_type between", value1, value2, "opUserType"); + return (Criteria) this; + } + + public Criteria andOpUserTypeNotBetween(Integer value1, Integer value2) { + addCriterion("op_user_type not between", value1, value2, "opUserType"); + return (Criteria) this; + } + + public Criteria andOpUserIdIsNull() { + addCriterion("op_user_id is null"); + return (Criteria) this; + } + + public Criteria andOpUserIdIsNotNull() { + addCriterion("op_user_id is not null"); + return (Criteria) this; + } + + public Criteria andOpUserIdEqualTo(Long value) { + addCriterion("op_user_id =", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdNotEqualTo(Long value) { + addCriterion("op_user_id <>", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdGreaterThan(Long value) { + addCriterion("op_user_id >", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("op_user_id >=", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdLessThan(Long value) { + addCriterion("op_user_id <", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdLessThanOrEqualTo(Long value) { + addCriterion("op_user_id <=", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdIn(List values) { + addCriterion("op_user_id in", values, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdNotIn(List values) { + addCriterion("op_user_id not in", values, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdBetween(Long value1, Long value2) { + addCriterion("op_user_id between", value1, value2, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdNotBetween(Long value1, Long value2) { + addCriterion("op_user_id not between", value1, value2, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserNameIsNull() { + addCriterion("op_user_name is null"); + return (Criteria) this; + } + + public Criteria andOpUserNameIsNotNull() { + addCriterion("op_user_name is not null"); + return (Criteria) this; + } + + public Criteria andOpUserNameEqualTo(String value) { + addCriterion("op_user_name =", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameNotEqualTo(String value) { + addCriterion("op_user_name <>", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameGreaterThan(String value) { + addCriterion("op_user_name >", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameGreaterThanOrEqualTo(String value) { + addCriterion("op_user_name >=", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameLessThan(String value) { + addCriterion("op_user_name <", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameLessThanOrEqualTo(String value) { + addCriterion("op_user_name <=", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameLike(String value) { + addCriterion("op_user_name like", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameNotLike(String value) { + addCriterion("op_user_name not like", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameIn(List values) { + addCriterion("op_user_name in", values, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameNotIn(List values) { + addCriterion("op_user_name not in", values, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameBetween(String value1, String value2) { + addCriterion("op_user_name between", value1, value2, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameNotBetween(String value1, String value2) { + addCriterion("op_user_name not between", value1, value2, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserPhoneIsNull() { + addCriterion("op_user_phone is null"); + return (Criteria) this; + } + + public Criteria andOpUserPhoneIsNotNull() { + addCriterion("op_user_phone is not null"); + return (Criteria) this; + } + + public Criteria andOpUserPhoneEqualTo(String value) { + addCriterion("op_user_phone =", value, "opUserPhone"); + return (Criteria) this; + } + + public Criteria andOpUserPhoneNotEqualTo(String value) { + addCriterion("op_user_phone <>", value, "opUserPhone"); + return (Criteria) this; + } + + public Criteria andOpUserPhoneGreaterThan(String value) { + addCriterion("op_user_phone >", value, "opUserPhone"); + return (Criteria) this; + } + + public Criteria andOpUserPhoneGreaterThanOrEqualTo(String value) { + addCriterion("op_user_phone >=", value, "opUserPhone"); + return (Criteria) this; + } + + public Criteria andOpUserPhoneLessThan(String value) { + addCriterion("op_user_phone <", value, "opUserPhone"); + return (Criteria) this; + } + + public Criteria andOpUserPhoneLessThanOrEqualTo(String value) { + addCriterion("op_user_phone <=", value, "opUserPhone"); + return (Criteria) this; + } + + public Criteria andOpUserPhoneLike(String value) { + addCriterion("op_user_phone like", value, "opUserPhone"); + return (Criteria) this; + } + + public Criteria andOpUserPhoneNotLike(String value) { + addCriterion("op_user_phone not like", value, "opUserPhone"); + return (Criteria) this; + } + + public Criteria andOpUserPhoneIn(List values) { + addCriterion("op_user_phone in", values, "opUserPhone"); + return (Criteria) this; + } + + public Criteria andOpUserPhoneNotIn(List values) { + addCriterion("op_user_phone not in", values, "opUserPhone"); + return (Criteria) this; + } + + public Criteria andOpUserPhoneBetween(String value1, String value2) { + addCriterion("op_user_phone between", value1, value2, "opUserPhone"); + return (Criteria) this; + } + + public Criteria andOpUserPhoneNotBetween(String value1, String value2) { + addCriterion("op_user_phone not between", value1, value2, "opUserPhone"); + 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/service/agent/impl/BsAgentMerServiceImpl.java b/service/src/main/java/com/hfkj/service/agent/impl/BsAgentMerServiceImpl.java index af502d2..c38a1ea 100644 --- a/service/src/main/java/com/hfkj/service/agent/impl/BsAgentMerServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/agent/impl/BsAgentMerServiceImpl.java @@ -6,7 +6,7 @@ import com.hfkj.common.exception.SysCode; import com.hfkj.dao.BsAgentMerMapper; import com.hfkj.entity.*; import com.hfkj.model.AgentMerAllot; -import com.hfkj.service.BsMerchantService; +import com.hfkj.service.merchant.BsMerchantService; import com.hfkj.service.agent.BsAgentMerService; import com.hfkj.service.agent.BsAgentService; import com.hfkj.service.agent.BsAgentStaffService; @@ -18,7 +18,6 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.util.*; import java.util.stream.Collectors; -import java.util.stream.IntStream; import java.util.stream.LongStream; /** diff --git a/service/src/main/java/com/hfkj/service/gas/BsGasOrderService.java b/service/src/main/java/com/hfkj/service/gas/BsGasOrderService.java index 1bfef59..e2d5891 100644 --- a/service/src/main/java/com/hfkj/service/gas/BsGasOrderService.java +++ b/service/src/main/java/com/hfkj/service/gas/BsGasOrderService.java @@ -53,6 +53,13 @@ public interface BsGasOrderService { */ BsGasOrder getDetailByPayChannelOrderNo(String payChannelOrderNo); + /** + * 查询加油订单统计 + * @param param + * @return + */ + Map getGasOrderCount(Map param); + /** * 查询油站订单列表 * @param param diff --git a/service/src/main/java/com/hfkj/service/gas/impl/BsGasClassGroupTaskServiceImpl.java b/service/src/main/java/com/hfkj/service/gas/impl/BsGasClassGroupTaskServiceImpl.java index fbf7867..6b4a9c7 100644 --- a/service/src/main/java/com/hfkj/service/gas/impl/BsGasClassGroupTaskServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/gas/impl/BsGasClassGroupTaskServiceImpl.java @@ -11,7 +11,7 @@ import com.hfkj.entity.*; import com.hfkj.model.GasClassGroupTaskDataCount; import com.hfkj.model.GasClassGroupTaskOilCount; import com.hfkj.service.BsDeviceService; -import com.hfkj.service.BsMerchantService; +import com.hfkj.service.merchant.BsMerchantService; import com.hfkj.service.gas.BsGasClassGroupService; import com.hfkj.service.gas.BsGasClassGroupTaskService; import com.hfkj.sysenum.DeviceTypeEnum; 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 7d7013e..f80c41d 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 @@ -4,7 +4,6 @@ import com.hfkj.common.utils.RedisUtil; import com.hfkj.dao.BsGasOilPriceMapper; import com.hfkj.entity.BsGasOilPrice; import com.hfkj.entity.BsGasOilPriceExample; -import com.hfkj.service.BsMerchantService; import com.hfkj.service.gas.BsGasOilGunNoService; import com.hfkj.service.gas.BsGasOilPriceService; import com.hfkj.service.gas.BsGasService; diff --git a/service/src/main/java/com/hfkj/service/gas/impl/BsGasOrderServiceImpl.java b/service/src/main/java/com/hfkj/service/gas/impl/BsGasOrderServiceImpl.java index e0f78b0..4da4b33 100644 --- a/service/src/main/java/com/hfkj/service/gas/impl/BsGasOrderServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/gas/impl/BsGasOrderServiceImpl.java @@ -1,5 +1,6 @@ package com.hfkj.service.gas.impl; +import com.hfkj.common.utils.DateUtil; import com.hfkj.dao.BsGasOrderMapper; import com.hfkj.entity.BsGasOrder; import com.hfkj.entity.BsGasOrderExample; @@ -82,6 +83,31 @@ public class BsGasOrderServiceImpl implements BsGasOrderService { return null; } + @Override + public Map getGasOrderCount(Map param) { + if (MapUtils.getLong(param, "createTimeS") != null) { + param.put("createTimeS", DateUtil.date2String(new Date(MapUtils.getLong(param, "createTimeS")), DateUtil.Y_M_D_HMS)); + } + if (MapUtils.getLong(param, "createTimeE") != null) { + param.put("createTimeE", DateUtil.date2String(new Date(MapUtils.getLong(param, "createTimeE")), DateUtil.Y_M_D_HMS)); + } + + if (MapUtils.getLong(param, "payTimeS") != null) { + param.put("payTimeS", DateUtil.date2String(new Date(MapUtils.getLong(param, "payTimeS")), DateUtil.Y_M_D_HMS)); + } + if (MapUtils.getLong(param, "payTimeE") != null) { + param.put("payTimeE", DateUtil.date2String(new Date(MapUtils.getLong(param, "payTimeE")), DateUtil.Y_M_D_HMS)); + } + + if (MapUtils.getLong(param, "refundTimeS") != null) { + param.put("refundTimeS", DateUtil.date2String(new Date(MapUtils.getLong(param, "refundTimeS")), DateUtil.Y_M_D_HMS)); + } + if (MapUtils.getLong(param, "refundTimeE") != null) { + param.put("refundTimeE", DateUtil.date2String(new Date(MapUtils.getLong(param, "refundTimeE")), DateUtil.Y_M_D_HMS)); + } + return gasOrderMapper.selectGasOrderCount(param); + } + @Override public List getGasOrderList(Map param) { BsGasOrderExample example = new BsGasOrderExample(); @@ -123,6 +149,10 @@ public class BsGasOrderServiceImpl implements BsGasOrderService { criteria.andGasOilTypeEqualTo(MapUtils.getInteger(param, "gasOilType")); } + if (StringUtils.isNotBlank(MapUtils.getString(param, "paySerialNo"))) { + criteria.andPaySerialNoLike("%"+MapUtils.getString(param, "paySerialNo")+"%"); + } + if (StringUtils.isNotBlank(MapUtils.getString(param, "gasStaffName"))) { criteria.andGasStaffNameLike("%"+MapUtils.getString(param, "gasStaffName")+"%"); } diff --git a/service/src/main/java/com/hfkj/service/gas/impl/BsGasServiceImpl.java b/service/src/main/java/com/hfkj/service/gas/impl/BsGasServiceImpl.java index edf1060..17ca727 100644 --- a/service/src/main/java/com/hfkj/service/gas/impl/BsGasServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/gas/impl/BsGasServiceImpl.java @@ -16,7 +16,7 @@ import com.hfkj.service.agent.BsAgentPriceService; import com.hfkj.service.gas.BsGasOilGunNoService; import com.hfkj.service.gas.BsGasOilPriceService; import com.hfkj.service.gas.BsGasService; -import com.hfkj.service.BsMerchantService; +import com.hfkj.service.merchant.BsMerchantService; import com.hfkj.sysenum.agent.AgentPriceTypeEnum; import com.hfkj.sysenum.gas.GasOilPriceStatusEnum; import org.springframework.beans.BeanUtils; 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 ce092cf..b36d450 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 @@ -11,7 +11,7 @@ import com.hfkj.entity.BsGasStaff; import com.hfkj.entity.BsGasStaffExample; import com.hfkj.entity.BsMerchant; import com.hfkj.entity.SecUser; -import com.hfkj.service.BsMerchantService; +import com.hfkj.service.merchant.BsMerchantService; import com.hfkj.service.gas.BsGasStaffService; import com.hfkj.service.sec.SecUserService; import com.hfkj.sysenum.SecUserObjectTypeEnum; diff --git a/service/src/main/java/com/hfkj/service/merchant/BsMerchantAccountRecordService.java b/service/src/main/java/com/hfkj/service/merchant/BsMerchantAccountRecordService.java new file mode 100644 index 0000000..9e01c7e --- /dev/null +++ b/service/src/main/java/com/hfkj/service/merchant/BsMerchantAccountRecordService.java @@ -0,0 +1,36 @@ +package com.hfkj.service.merchant; + +import com.hfkj.entity.BsMerchantAccountRecord; + +import java.util.List; +import java.util.Map; + +/** + * @className: BsMerchantAccountRecordService + * @author: HuRui + * @date: 2024/7/2 + **/ +public interface BsMerchantAccountRecordService { + + /** + * 创建 + * @param data + */ + void create(BsMerchantAccountRecord data); + + /** + * 查询详情 + * @param id + * @return + */ + BsMerchantAccountRecord getDetail(Long id); + + /** + * 查询列表 + * @param param + * @return + */ + List getList(Map param); +} + + diff --git a/service/src/main/java/com/hfkj/service/merchant/BsMerchantAccountService.java b/service/src/main/java/com/hfkj/service/merchant/BsMerchantAccountService.java new file mode 100644 index 0000000..d7925c8 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/merchant/BsMerchantAccountService.java @@ -0,0 +1,51 @@ +package com.hfkj.service.merchant; + +import com.hfkj.entity.BsMerchantAccount; +import com.hfkj.entity.BsOrderRefund; + +import java.math.BigDecimal; +import java.util.Map; + +/** + * @className: BsMerchantAccountService + * @author: HuRui + * @date: 2024/7/2 + **/ +public interface BsMerchantAccountService { + + /** + * 修改数据 + * @param account + */ + void editData(BsMerchantAccount account); + + /** + * 查询账户 + * @param merNo 商户号 + */ + BsMerchantAccount getAccount(String merNo); + + /** + * 充值 + * @param merNo 商户号 + * @param amount 金额 + */ + void recharge(String merNo, BigDecimal amount) throws Exception; + + /** + * 扣除 + * @param merNo 商户号 + * @param amount 金额 + * @param otherParam 其他参数 + */ + void consume(String merNo, BigDecimal amount, Map otherParam) throws Exception; + + /** + * 退款 + * @param merNo + * @param amount + * @param orderRefund + */ + void refund(String merNo, BigDecimal amount, BsOrderRefund orderRefund) throws Exception; +} + diff --git a/service/src/main/java/com/hfkj/service/BsMerchantPayConfigService.java b/service/src/main/java/com/hfkj/service/merchant/BsMerchantPayConfigService.java similarity index 92% rename from service/src/main/java/com/hfkj/service/BsMerchantPayConfigService.java rename to service/src/main/java/com/hfkj/service/merchant/BsMerchantPayConfigService.java index feb531e..bd8ceea 100644 --- a/service/src/main/java/com/hfkj/service/BsMerchantPayConfigService.java +++ b/service/src/main/java/com/hfkj/service/merchant/BsMerchantPayConfigService.java @@ -1,4 +1,4 @@ -package com.hfkj.service; +package com.hfkj.service.merchant; import com.hfkj.entity.BsMerchantPayConfig; diff --git a/service/src/main/java/com/hfkj/service/BsMerchantQrCodeService.java b/service/src/main/java/com/hfkj/service/merchant/BsMerchantQrCodeService.java similarity index 97% rename from service/src/main/java/com/hfkj/service/BsMerchantQrCodeService.java rename to service/src/main/java/com/hfkj/service/merchant/BsMerchantQrCodeService.java index eb23185..d543a8c 100644 --- a/service/src/main/java/com/hfkj/service/BsMerchantQrCodeService.java +++ b/service/src/main/java/com/hfkj/service/merchant/BsMerchantQrCodeService.java @@ -1,4 +1,4 @@ -package com.hfkj.service; +package com.hfkj.service.merchant; import com.google.zxing.WriterException; import com.hfkj.entity.BsMerchant; diff --git a/service/src/main/java/com/hfkj/service/BsMerchantService.java b/service/src/main/java/com/hfkj/service/merchant/BsMerchantService.java similarity index 97% rename from service/src/main/java/com/hfkj/service/BsMerchantService.java rename to service/src/main/java/com/hfkj/service/merchant/BsMerchantService.java index c835619..b4515d9 100644 --- a/service/src/main/java/com/hfkj/service/BsMerchantService.java +++ b/service/src/main/java/com/hfkj/service/merchant/BsMerchantService.java @@ -1,4 +1,4 @@ -package com.hfkj.service; +package com.hfkj.service.merchant; import com.hfkj.entity.BsMerchant; import com.hfkj.sysenum.MerchantStatusEnum; diff --git a/service/src/main/java/com/hfkj/service/BsMerchantUserService.java b/service/src/main/java/com/hfkj/service/merchant/BsMerchantUserService.java similarity index 94% rename from service/src/main/java/com/hfkj/service/BsMerchantUserService.java rename to service/src/main/java/com/hfkj/service/merchant/BsMerchantUserService.java index 3bbadb7..038649d 100644 --- a/service/src/main/java/com/hfkj/service/BsMerchantUserService.java +++ b/service/src/main/java/com/hfkj/service/merchant/BsMerchantUserService.java @@ -1,4 +1,4 @@ -package com.hfkj.service; +package com.hfkj.service.merchant; import com.hfkj.entity.BsMerchant; import com.hfkj.entity.BsMerchantUser; diff --git a/service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantAccountRecordServiceImpl.java b/service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantAccountRecordServiceImpl.java new file mode 100644 index 0000000..868a04b --- /dev/null +++ b/service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantAccountRecordServiceImpl.java @@ -0,0 +1,83 @@ +package com.hfkj.service.merchant.impl; + +import com.hfkj.common.security.UserCenter; +import com.hfkj.dao.BsMerchantAccountRecordMapper; +import com.hfkj.entity.BsMerchantAccountRecord; +import com.hfkj.entity.BsMerchantAccountRecordExample; +import com.hfkj.model.SecUserSessionObject; +import com.hfkj.model.UserSessionObject; +import com.hfkj.service.merchant.BsMerchantAccountRecordService; +import com.hfkj.service.merchant.BsMerchantAccountService; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * @className: merchantAccountRecordServiceImpl + * @author: HuRui + * @date: 2024/7/2 + **/ +@Service("merchantAccountRecord") +public class BsMerchantAccountRecordServiceImpl implements BsMerchantAccountRecordService { + @Resource + private BsMerchantAccountRecordMapper merchantAccountRecordMapper; + @Resource + private UserCenter userCenter; + @Override + public void create(BsMerchantAccountRecord data) { + data.setOpUserType(0); + data.setOpUserId(0L); + data.setOpUserName("未知"); + data.setOpUserPhone("未知"); + + try { + SecUserSessionObject secUserSessionObject = userCenter.getSessionModel(SecUserSessionObject.class); + if (secUserSessionObject != null) { + data.setOpUserType(1); + data.setOpUserId(secUserSessionObject.getAccount().getId()); + data.setOpUserName(secUserSessionObject.getAccount().getUserName()); + data.setOpUserPhone(secUserSessionObject.getAccount().getTelephone()); + } + } catch (Exception e) { + System.out.println("获取管理员信息失败"); + } + + try { + UserSessionObject userModel = userCenter.getSessionModel(UserSessionObject.class); + if (userModel != null) { + data.setOpUserType(2); + data.setOpUserId(userModel.getUser().getId()); + data.setOpUserName(userModel.getUser().getUserName()); + data.setOpUserPhone(userModel.getUser().getPhone()); + } + } catch (Exception e) { + System.out.println("获取客户信息失败"); + } + data.setStatus(1); + data.setCreateTime(new Date()); + merchantAccountRecordMapper.insert(data); + } + + @Override + public BsMerchantAccountRecord getDetail(Long id) { + return merchantAccountRecordMapper.selectByPrimaryKey(id); + } + + @Override + public List getList(Map param) { + BsMerchantAccountRecordExample example = new BsMerchantAccountRecordExample(); + BsMerchantAccountRecordExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(0); + + if (StringUtils.isNotBlank(MapUtils.getString(param, "merNo"))) { + criteria.andMerNoEqualTo(MapUtils.getString(param, "merNo")); + } + + example.setOrderByClause("create_time desc"); + return merchantAccountRecordMapper.selectByExample(example); + } +} diff --git a/service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantAccountServiceImpl.java b/service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantAccountServiceImpl.java new file mode 100644 index 0000000..4d58470 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantAccountServiceImpl.java @@ -0,0 +1,214 @@ +package com.hfkj.service.merchant.impl; + +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.security.UserCenter; +import com.hfkj.common.utils.DateUtil; +import com.hfkj.dao.BsMerchantAccountMapper; +import com.hfkj.entity.BsMerchantAccount; +import com.hfkj.entity.BsMerchantAccountExample; +import com.hfkj.entity.BsMerchantAccountRecord; +import com.hfkj.entity.BsOrderRefund; +import com.hfkj.service.merchant.BsMerchantAccountRecordService; +import com.hfkj.service.merchant.BsMerchantAccountService; +import com.hfkj.sysenum.merchant.MerchantAccountRecordSourceTypeEnum; +import com.hfkj.sysenum.merchant.MerchantAccountRecordTypeEnum; +import org.apache.commons.collections4.MapUtils; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * @className: BsMerchantAccountServiceImpl + * @author: HuRui + * @date: 2024/7/2 + **/ +@Service("merchantAccountService") +public class BsMerchantAccountServiceImpl implements BsMerchantAccountService { + @Resource + private BsMerchantAccountMapper merchantAccountMapper; + @Resource + private BsMerchantAccountRecordService merchantAccountRecordService; + @Resource + private RedisTemplate redisTemplate; + @Resource + private UserCenter userCenter; + private final String LOCK_KEY = "MERCHANT_ACCOUNT_LOCK_"; + @Override + public void editData(BsMerchantAccount account) { + account.setUpdateTime(new Date()); + if (account.getId() == null) { + account.setAmount(new BigDecimal(0)); + account.setAmountConsume(new BigDecimal(0)); + account.setStatus(1); + account.setCreateTime(new Date()); + merchantAccountMapper.insert(account); + } else { + merchantAccountMapper.updateByPrimaryKey(account); + } + } + + @Override + public BsMerchantAccount getAccount(String merNo) { + BsMerchantAccountExample example = new BsMerchantAccountExample(); + example.createCriteria().andMerNoEqualTo(merNo); + List list = merchantAccountMapper.selectByExample(example); + if (!list.isEmpty()) { + return list.get(0); + } + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到账户"); + } + + @Override + public void recharge(String merNo, BigDecimal amount) throws Exception{ + // 锁编号 + String lockKey = LOCK_KEY+merNo; + // 获取锁 + Boolean lock = redisTemplate.opsForValue().setIfAbsent(lockKey, ""); + if (Boolean.TRUE.equals(lock)) { + try { + // 获取锁成功 + // 查询账户 + BsMerchantAccount merAccount = getAccount(merNo); + // 变更前金额 + BigDecimal beforeAmount = merAccount.getAmount(); + // 计算金额 + merAccount.setAmount(merAccount.getAmount().add(amount)); + editData(merAccount); + // 变更后金额 + BigDecimal afterAmount = merAccount.getAmount(); + + BsMerchantAccountRecord record = new BsMerchantAccountRecord(); + record.setMerchantAccountId(merAccount.getId()); + record.setMerNo(merAccount.getMerNo()); + record.setType(MerchantAccountRecordTypeEnum.type1.getType()); + record.setTransactionAmount(amount); + record.setBeforeAmount(beforeAmount); + record.setAfterAmount(afterAmount); + record.setSourceType(MerchantAccountRecordSourceTypeEnum.type1.getType()); + try { + record.setSourceOrderNo(DateUtil.date2String(new Date(), "yyyyMMddHHmmss")); + } catch (Exception e) { + e.printStackTrace(); + } + record.setSourceContent("充值金额:" + record.getTransactionAmount()); + merchantAccountRecordService.create(record); + // 释放锁 + redisTemplate.delete(lockKey); + + } catch (Exception e) { + e.printStackTrace(); + // 释放锁 + redisTemplate.delete(lockKey); + } + } else { + Thread.sleep(100); + recharge(merNo, amount); + } + } + + @Override + public void consume(String merNo, BigDecimal amount, Map otherParam) throws Exception { + // 锁编号 + String lockKey = LOCK_KEY+merNo; + // 获取锁 + Boolean lock = redisTemplate.opsForValue().setIfAbsent(lockKey, ""); + if (Boolean.TRUE.equals(lock)) { + try { + // 获取锁成功 + /* // 余额 是否小于 消费余额 + if (merAccount.getAmount().compareTo(amount) == -1) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "余额不足"); + }*/ + // 查询车队油卡 + BsMerchantAccount merAccount = getAccount(merNo); + // 变更前金额 + BigDecimal beforeAmount = merAccount.getAmount(); + // 计算消费后金额 + merAccount.setAmount(merAccount.getAmount().subtract(amount)); + // 累积消费金额 + merAccount.setAmountConsume(merAccount.getAmountConsume().add(amount)); + editData(merAccount); + // 变更后金额 + BigDecimal afterAmount = merAccount.getAmount(); + + BsMerchantAccountRecord record = new BsMerchantAccountRecord(); + record.setMerchantAccountId(merAccount.getId()); + record.setMerNo(merAccount.getMerNo()); + record.setType(MerchantAccountRecordTypeEnum.type2.getType()); + record.setTransactionAmount(amount); + record.setBeforeAmount(beforeAmount); + record.setAfterAmount(afterAmount); + record.setSourceType(MapUtils.getInteger(otherParam, "sourceType")); + record.setSourceId(MapUtils.getLong(otherParam, "sourceId")); + record.setSourceOrderNo(MapUtils.getString(otherParam, "sourceOrderNo")); + record.setSourceContent(MapUtils.getString(otherParam, "sourceContent")); + merchantAccountRecordService.create(record); + // 释放锁 + redisTemplate.delete(lockKey); + + } catch (Exception e) { + e.printStackTrace(); + // 释放锁 + redisTemplate.delete(lockKey); + } + } else { + Thread.sleep(100); + consume(merNo, amount, otherParam); + } + } + + @Override + public void refund(String merNo, BigDecimal amount, BsOrderRefund orderRefund) throws Exception { + // 锁编号 + String lockKey = LOCK_KEY+merNo; + // 获取锁 + Boolean lock = redisTemplate.opsForValue().setIfAbsent(lockKey, ""); + if (Boolean.TRUE.equals(lock)) { + try { + // 获取锁成功 + // 查询车队油卡 + BsMerchantAccount merAccount = getAccount(merNo); + // 变更前金额 + BigDecimal beforeAmount = merAccount.getAmount(); + // 计算退款后的金额 + merAccount.setAmount(merAccount.getAmount().add(amount)); + // 累积消费金额 + merAccount.setAmountConsume(merAccount.getAmountConsume().subtract(amount)); + editData(merAccount); + // 变更后金额 + BigDecimal afterAmount = merAccount.getAmount(); + + BsMerchantAccountRecord record = new BsMerchantAccountRecord(); + record.setMerchantAccountId(merAccount.getId()); + record.setMerNo(merAccount.getMerNo()); + record.setType(MerchantAccountRecordTypeEnum.type1.getType()); + record.setTransactionAmount(amount); + record.setBeforeAmount(beforeAmount); + record.setAfterAmount(afterAmount); + record.setSourceType(MerchantAccountRecordSourceTypeEnum.type3.getType()); + record.setSourceId(orderRefund.getId()); + record.setSourceOrderNo(orderRefund.getRefundOrderNo()); + merchantAccountRecordService.create(record); + // 释放锁 + redisTemplate.delete(lockKey); + + } catch (Exception e) { + e.printStackTrace(); + // 释放锁 + redisTemplate.delete(lockKey); + } + } else { + Thread.sleep(100); + refund(merNo, amount, orderRefund); + } + } + + +} diff --git a/service/src/main/java/com/hfkj/service/impl/BsMerchantPayConfigServiceImpl.java b/service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantPayConfigServiceImpl.java similarity index 94% rename from service/src/main/java/com/hfkj/service/impl/BsMerchantPayConfigServiceImpl.java rename to service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantPayConfigServiceImpl.java index 5171d2c..e07adf6 100644 --- a/service/src/main/java/com/hfkj/service/impl/BsMerchantPayConfigServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantPayConfigServiceImpl.java @@ -1,10 +1,10 @@ -package com.hfkj.service.impl; +package com.hfkj.service.merchant.impl; import com.hfkj.common.utils.RedisUtil; import com.hfkj.dao.BsMerchantPayConfigMapper; import com.hfkj.entity.BsMerchantPayConfig; import com.hfkj.entity.BsMerchantPayConfigExample; -import com.hfkj.service.BsMerchantPayConfigService; +import com.hfkj.service.merchant.BsMerchantPayConfigService; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.Date; diff --git a/service/src/main/java/com/hfkj/service/impl/BsMerchantQrCodeServiceImpl.java b/service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantQrCodeServiceImpl.java similarity index 98% rename from service/src/main/java/com/hfkj/service/impl/BsMerchantQrCodeServiceImpl.java rename to service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantQrCodeServiceImpl.java index 67e8d69..921b192 100644 --- a/service/src/main/java/com/hfkj/service/impl/BsMerchantQrCodeServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantQrCodeServiceImpl.java @@ -1,4 +1,4 @@ -package com.hfkj.service.impl; +package com.hfkj.service.merchant.impl; import com.hfkj.common.QRCodeGenerator; import com.hfkj.common.exception.ErrorCode; @@ -10,7 +10,7 @@ import com.hfkj.dao.BsMerchantQrCodeMapper; import com.hfkj.entity.BsMerchant; import com.hfkj.entity.BsMerchantQrCode; import com.hfkj.entity.BsMerchantQrCodeExample; -import com.hfkj.service.BsMerchantQrCodeService; +import com.hfkj.service.merchant.BsMerchantQrCodeService; import com.hfkj.sysenum.MerchantQrCodeStatusEnum; import com.hfkj.sysenum.MerchantQrCodeTypeEnum; import org.springframework.stereotype.Service; diff --git a/service/src/main/java/com/hfkj/service/impl/BsMerchantServiceImpl.java b/service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantServiceImpl.java similarity index 86% rename from service/src/main/java/com/hfkj/service/impl/BsMerchantServiceImpl.java rename to service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantServiceImpl.java index 4841ffb..5e4e04e 100644 --- a/service/src/main/java/com/hfkj/service/impl/BsMerchantServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantServiceImpl.java @@ -1,4 +1,4 @@ -package com.hfkj.service.impl; +package com.hfkj.service.merchant.impl; import com.hfkj.common.exception.ErrorCode; import com.hfkj.common.exception.ErrorHelp; @@ -7,12 +7,16 @@ import com.hfkj.common.utils.MD5Util; import com.hfkj.common.utils.RedisUtil; import com.hfkj.dao.BsMerchantMapper; import com.hfkj.entity.BsMerchant; +import com.hfkj.entity.BsMerchantAccount; import com.hfkj.entity.BsMerchantExample; import com.hfkj.entity.SecUser; -import com.hfkj.service.BsMerchantQrCodeService; -import com.hfkj.service.BsMerchantService; +import com.hfkj.service.merchant.BsMerchantAccountRecordService; +import com.hfkj.service.merchant.BsMerchantAccountService; +import com.hfkj.service.merchant.BsMerchantQrCodeService; +import com.hfkj.service.merchant.BsMerchantService; import com.hfkj.service.gas.BsGasService; import com.hfkj.service.sec.SecUserService; +import com.hfkj.sysenum.MerchantSourceTypeEnum; import com.hfkj.sysenum.MerchantStatusEnum; import com.hfkj.sysenum.SecUserObjectTypeEnum; import org.apache.commons.collections4.MapUtils; @@ -22,8 +26,8 @@ import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.math.BigDecimal; import java.util.*; -import java.util.stream.Collectors; /** * @className: BsMerchantServiceImpl @@ -40,6 +44,8 @@ public class BsMerchantServiceImpl implements BsMerchantService { @Resource private BsMerchantQrCodeService merchantQrCodeService; @Resource + private BsMerchantAccountService merchantAccountService; + @Resource private RedisUtil redisUtil; @Resource private BsGasService gasService; @@ -62,6 +68,16 @@ public class BsMerchantServiceImpl implements BsMerchantService { public void createMerchant(BsMerchant merchant) throws Exception { editData(merchant); + // 自建站 + if (merchant.getSourceType().equals(MerchantSourceTypeEnum.type1.getNumber())) { + BsMerchantAccount account = new BsMerchantAccount(); + account.setMerId(merchant.getId()); + account.setMerNo(merchant.getMerNo()); + account.setAmount(new BigDecimal("0")); + account.setAmountConsume(new BigDecimal("0")); + merchantAccountService.editData(account); + } + merchant.setMerNo(""+(10000 + merchant.getId())); editData(merchant); diff --git a/service/src/main/java/com/hfkj/service/impl/BsMerchantUserServiceImpl.java b/service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantUserServiceImpl.java similarity index 95% rename from service/src/main/java/com/hfkj/service/impl/BsMerchantUserServiceImpl.java rename to service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantUserServiceImpl.java index a9d1c49..46ef187 100644 --- a/service/src/main/java/com/hfkj/service/impl/BsMerchantUserServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantUserServiceImpl.java @@ -1,9 +1,9 @@ -package com.hfkj.service.impl; +package com.hfkj.service.merchant.impl; import com.hfkj.dao.BsMerchantUserMapper; import com.hfkj.entity.BsMerchantUser; import com.hfkj.entity.BsMerchantUserExample; -import com.hfkj.service.BsMerchantUserService; +import com.hfkj.service.merchant.BsMerchantUserService; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; 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 5d4cdd8..0dda60c 100644 --- a/service/src/main/java/com/hfkj/service/order/OrderCreateService.java +++ b/service/src/main/java/com/hfkj/service/order/OrderCreateService.java @@ -3,11 +3,10 @@ package com.hfkj.service.order; import com.hfkj.common.exception.ErrorCode; import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.SysCode; -import com.hfkj.common.security.AESEncodeUtil; import com.hfkj.entity.*; import com.hfkj.model.GasPayPriceModel; import com.hfkj.model.order.OrderChildModel; -import com.hfkj.service.BsMerchantService; +import com.hfkj.service.merchant.BsMerchantService; import com.hfkj.service.agent.BsAgentMerService; import com.hfkj.service.gas.BsGasClassGroupTaskService; import com.hfkj.service.gas.BsGasOrderService; @@ -16,7 +15,6 @@ import com.hfkj.service.gas.BsGasStaffService; import com.hfkj.service.sec.SecDictionaryService; import com.hfkj.sysenum.MerchantStatusEnum; import com.hfkj.sysenum.gas.OrderOilStatus; -import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; 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 b242da7..23dee95 100644 --- a/service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java +++ b/service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java @@ -5,10 +5,12 @@ import com.hfkj.entity.BsMerchantUser; import com.hfkj.entity.BsOrderChild; import com.hfkj.model.order.OrderModel; import com.hfkj.service.BsDeviceService; -import com.hfkj.service.BsMerchantUserService; +import com.hfkj.service.merchant.BsMerchantAccountService; +import com.hfkj.service.merchant.BsMerchantUserService; import com.hfkj.service.gas.BsGasOrderService; import com.hfkj.sysenum.MerchantSourceTypeEnum; import com.hfkj.sysenum.gas.OrderOilStatus; +import com.hfkj.sysenum.merchant.MerchantAccountRecordSourceTypeEnum; import com.hfkj.sysenum.order.OrderChildProductTypeEnum; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; @@ -16,6 +18,8 @@ import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; import javax.annotation.Resource; +import java.util.HashMap; +import java.util.Map; /** * @className: OrderPaySuccessService @@ -33,6 +37,8 @@ public class OrderPaySuccessService { private BsMerchantUserService merchantUserService; @Resource private BsDeviceService deviceService; + @Resource + private BsMerchantAccountService merchantAccountService; /** * 订单业务处理 * @param order @@ -54,7 +60,7 @@ public class OrderPaySuccessService { * 加油业务 * @param order */ - public void oilHandle(OrderModel order) { + public void oilHandle(OrderModel order) throws Exception { // 查询加油订单 BsGasOrder gasOrder = gasOrderService.getDetailByOrderNo(order.getOrderNo()); if (gasOrder != null) { @@ -69,6 +75,14 @@ public class OrderPaySuccessService { gasOrder.setPayChannelOrderNo(order.getPayChannelOrderNo()); 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 (StringUtils.isNotBlank(gasOrder.getUserPhone())) { // 查询商户会员 BsMerchantUser merchantUser = merchantUserService.getUser(gasOrder.getMerNo(), gasOrder.getUserPhone()); @@ -88,6 +102,7 @@ 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 7e8fd23..aaeec52 100644 --- a/service/src/main/java/com/hfkj/service/order/OrderRefundBusiness.java +++ b/service/src/main/java/com/hfkj/service/order/OrderRefundBusiness.java @@ -1,15 +1,20 @@ package com.hfkj.service.order; import com.hfkj.entity.BsGasOrder; +import com.hfkj.entity.BsMerchantAccount; import com.hfkj.entity.BsOrderChild; 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.gas.OrderOilStatus; +import com.hfkj.sysenum.merchant.MerchantAccountRecordSourceTypeEnum; import org.springframework.stereotype.Component; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.util.HashMap; +import java.util.Map; /** * 退款业务 @@ -22,6 +27,8 @@ public class OrderRefundBusiness { @Resource private BsGasOrderService gasOrderService; + @Resource + private BsMerchantAccountService merchantAccountService; /** * 加油订单业务 @@ -35,6 +42,11 @@ public class OrderRefundBusiness { gasOrder.setRefundTime(refund.getFinishTime()); gasOrder.setRefundRemarks(refund.getRefundRemark()); gasOrderService.updateGasOrder(gasOrder); + + try { + // 退回商户额度 + merchantAccountService.refund(gasOrder.getMerNo(), gasOrder.getGasRefuelPrice(), refund); + } catch (Exception e) {} } } diff --git a/service/src/main/java/com/hfkj/service/order/impl/BsOrderRefundServiceImpl.java b/service/src/main/java/com/hfkj/service/order/impl/BsOrderRefundServiceImpl.java index 421b753..311b620 100644 --- a/service/src/main/java/com/hfkj/service/order/impl/BsOrderRefundServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/order/impl/BsOrderRefundServiceImpl.java @@ -12,7 +12,7 @@ import com.hfkj.entity.*; import com.hfkj.model.order.OrderChildModel; import com.hfkj.model.order.OrderModel; import com.hfkj.pay.HuiPayService; -import com.hfkj.service.BsMerchantService; +import com.hfkj.service.merchant.BsMerchantService; import com.hfkj.service.order.*; import com.hfkj.sysenum.order.OrderChildStatusEnum; import com.hfkj.sysenum.order.OrderPayChannelEnum; @@ -28,7 +28,6 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.math.BigDecimal; import java.util.Date; -import java.util.HashMap; import java.util.List; import java.util.Map; 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 963b89e..b2f2217 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 @@ -8,7 +8,7 @@ import com.hfkj.entity.BsOrderSettle; import com.hfkj.entity.BsOrderSettleExample; import com.hfkj.entity.BsOrderSettleLedger; import com.hfkj.pay.HuiPayService; -import com.hfkj.service.BsMerchantPayConfigService; +import com.hfkj.service.merchant.BsMerchantPayConfigService; import com.hfkj.service.order.BsOrderSettleLedgerService; import com.hfkj.service.order.BsOrderSettleService; import com.hfkj.sysenum.order.OrderSettleLedgerStatusEnum; diff --git a/service/src/main/java/com/hfkj/service/sec/impl/SecUserServiceImpl.java b/service/src/main/java/com/hfkj/service/sec/impl/SecUserServiceImpl.java index 22a71be..35dad5c 100644 --- a/service/src/main/java/com/hfkj/service/sec/impl/SecUserServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/sec/impl/SecUserServiceImpl.java @@ -11,7 +11,7 @@ import com.hfkj.dao.SecUserMapper; import com.hfkj.entity.*; import com.hfkj.model.MenuTreeModel; import com.hfkj.model.SecUserSessionObject; -import com.hfkj.service.BsMerchantService; +import com.hfkj.service.merchant.BsMerchantService; import com.hfkj.service.gas.BsGasStaffService; import com.hfkj.service.sec.SecMenuService; import com.hfkj.service.sec.SecRoleService; diff --git a/service/src/main/java/com/hfkj/sysenum/merchant/MerchantAccountRecordSourceTypeEnum.java b/service/src/main/java/com/hfkj/sysenum/merchant/MerchantAccountRecordSourceTypeEnum.java new file mode 100644 index 0000000..1df767f --- /dev/null +++ b/service/src/main/java/com/hfkj/sysenum/merchant/MerchantAccountRecordSourceTypeEnum.java @@ -0,0 +1,35 @@ +package com.hfkj.sysenum.merchant; + +import lombok.Getter; + +/** + * 油卡记录 + * @author hurui + */ +@Getter +public enum MerchantAccountRecordSourceTypeEnum { + /** + * 充值 + */ + type1(1 , "充值金额"), + + /** + * 订单扣除 + */ + type2(2 , "订单扣除"), + + /** + * 订单退款 + */ + type3(3 , "订单退款"), + ; + + private Integer type; + private String name; + + MerchantAccountRecordSourceTypeEnum(int type , String name) { + this.type = type; + this.name = name; + } + +} diff --git a/service/src/main/java/com/hfkj/sysenum/merchant/MerchantAccountRecordTypeEnum.java b/service/src/main/java/com/hfkj/sysenum/merchant/MerchantAccountRecordTypeEnum.java new file mode 100644 index 0000000..f1a0da6 --- /dev/null +++ b/service/src/main/java/com/hfkj/sysenum/merchant/MerchantAccountRecordTypeEnum.java @@ -0,0 +1,28 @@ +package com.hfkj.sysenum.merchant; + +import lombok.Getter; + +/** + * 油卡记录 + * @author hurui + */ +@Getter +public enum MerchantAccountRecordTypeEnum { + /** + * 进账 + */ + type1(1 , "进账"), + /** + * 支出 + */ + type2(2 , "支出"), + ; + + private Integer type; + private String name; + + MerchantAccountRecordTypeEnum(int type , String name) { + this.type = type; + this.name = name; + } +}