提交代码

master
胡锐 7 months ago
parent 21c1e8c1c2
commit 83ddfe933f
  1. 2
      bweb/src/main/java/com/bweb/controller/BsAgentPriceController.java
  2. 2
      bweb/src/main/java/com/bweb/controller/BsDeviceController.java
  3. 5
      bweb/src/main/java/com/bweb/controller/BsDiscountController.java
  4. 8
      bweb/src/main/java/com/bweb/controller/BsDiscountStockController.java
  5. 2
      bweb/src/main/java/com/bweb/controller/BsGasClassGroupController.java
  6. 2
      bweb/src/main/java/com/bweb/controller/BsGasOilGunNoController.java
  7. 2
      bweb/src/main/java/com/bweb/controller/BsGasOilPriceController.java
  8. 2
      bweb/src/main/java/com/bweb/controller/BsGasOilPriceTaskController.java
  9. 79
      bweb/src/main/java/com/bweb/controller/BsGasOrderController.java
  10. 7
      bweb/src/main/java/com/bweb/controller/BsGasStaffController.java
  11. 126
      bweb/src/main/java/com/bweb/controller/BsMerchantAccountController.java
  12. 1
      bweb/src/main/java/com/bweb/controller/BsMerchantController.java
  13. 4
      bweb/src/main/java/com/bweb/controller/BsMerchantPayConfigController.java
  14. 2
      bweb/src/main/java/com/bweb/controller/BsMerchantQrCodeController.java
  15. 3
      bweb/src/main/java/com/bweb/controller/BsMerchantUserController.java
  16. 3
      cweb/src/main/java/com/cweb/controller/BsMerchantUserController.java
  17. 6
      cweb/src/main/java/com/cweb/controller/order/BsOrderController.java
  18. 6
      cweb/src/main/java/com/cweb/controller/order/OrderPayController.java
  19. 119
      service/src/main/java/com/hfkj/common/utils/BankNumberUtil.java
  20. 42
      service/src/main/java/com/hfkj/dao/BsGasOrderMapperExt.java
  21. 122
      service/src/main/java/com/hfkj/dao/BsMerchantAccountMapper.java
  22. 7
      service/src/main/java/com/hfkj/dao/BsMerchantAccountMapperExt.java
  23. 159
      service/src/main/java/com/hfkj/dao/BsMerchantAccountRecordMapper.java
  24. 7
      service/src/main/java/com/hfkj/dao/BsMerchantAccountRecordMapperExt.java
  25. 444
      service/src/main/java/com/hfkj/dao/BsMerchantAccountRecordSqlProvider.java
  26. 318
      service/src/main/java/com/hfkj/dao/BsMerchantAccountSqlProvider.java
  27. 214
      service/src/main/java/com/hfkj/entity/BsMerchantAccount.java
  28. 924
      service/src/main/java/com/hfkj/entity/BsMerchantAccountExample.java
  29. 358
      service/src/main/java/com/hfkj/entity/BsMerchantAccountRecord.java
  30. 1504
      service/src/main/java/com/hfkj/entity/BsMerchantAccountRecordExample.java
  31. 3
      service/src/main/java/com/hfkj/service/agent/impl/BsAgentMerServiceImpl.java
  32. 7
      service/src/main/java/com/hfkj/service/gas/BsGasOrderService.java
  33. 2
      service/src/main/java/com/hfkj/service/gas/impl/BsGasClassGroupTaskServiceImpl.java
  34. 1
      service/src/main/java/com/hfkj/service/gas/impl/BsGasOilPriceServiceImpl.java
  35. 30
      service/src/main/java/com/hfkj/service/gas/impl/BsGasOrderServiceImpl.java
  36. 2
      service/src/main/java/com/hfkj/service/gas/impl/BsGasServiceImpl.java
  37. 2
      service/src/main/java/com/hfkj/service/gas/impl/BsGasStaffServiceImpl.java
  38. 36
      service/src/main/java/com/hfkj/service/merchant/BsMerchantAccountRecordService.java
  39. 51
      service/src/main/java/com/hfkj/service/merchant/BsMerchantAccountService.java
  40. 2
      service/src/main/java/com/hfkj/service/merchant/BsMerchantPayConfigService.java
  41. 2
      service/src/main/java/com/hfkj/service/merchant/BsMerchantQrCodeService.java
  42. 2
      service/src/main/java/com/hfkj/service/merchant/BsMerchantService.java
  43. 2
      service/src/main/java/com/hfkj/service/merchant/BsMerchantUserService.java
  44. 83
      service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantAccountRecordServiceImpl.java
  45. 214
      service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantAccountServiceImpl.java
  46. 4
      service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantPayConfigServiceImpl.java
  47. 4
      service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantQrCodeServiceImpl.java
  48. 24
      service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantServiceImpl.java
  49. 4
      service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantUserServiceImpl.java
  50. 4
      service/src/main/java/com/hfkj/service/order/OrderCreateService.java
  51. 19
      service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java
  52. 12
      service/src/main/java/com/hfkj/service/order/OrderRefundBusiness.java
  53. 3
      service/src/main/java/com/hfkj/service/order/impl/BsOrderRefundServiceImpl.java
  54. 2
      service/src/main/java/com/hfkj/service/order/impl/BsOrderSettleServiceImpl.java
  55. 2
      service/src/main/java/com/hfkj/service/sec/impl/SecUserServiceImpl.java
  56. 35
      service/src/main/java/com/hfkj/sysenum/merchant/MerchantAccountRecordSourceTypeEnum.java
  57. 28
      service/src/main/java/com/hfkj/sysenum/merchant/MerchantAccountRecordTypeEnum.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;

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

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

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

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

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

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

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

@ -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<String,Object> 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<String,Object> 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);

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

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

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

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

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

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

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

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

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

@ -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;
/**
* 需要传入一个前缀689中的一个
* 其中6类型18类型29类型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();
}
}
}

@ -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 {
}
@Select("<script>" +
" SELECT" +
" count( 1 ) totalCount," +
" case when sum( gas_refuel_price ) then sum( gas_refuel_price ) else 0 end totalRefuelPrice, " +
" case when sum( gas_oil_liters ) then sum( gas_oil_liters ) else 0 end totalOilLiters " +
" FROM" +
" bs_gas_order" +
" where 1 = 1" +
" <if test='param.merId != null'> and mer_id = #{param.merId} </if>" +
" <if test='param.merNo != null'> and mer_no = #{param.merNo} </if>" +
" <if test='param.merName != null'> and mer_name like concat('%',#{param.merName},'%') </if>" +
" <if test='param.orderNo != null'> and order_no like concat('%',#{param.orderNo},'%') </if>" +
" <if test='param.orderChildNo != null'> and order_child_no like concat('%',#{param.orderChildNo},'%') </if>" +
" <if test='param.channelOrderNo != null'> and channel_order_no like concat('%',#{param.channelOrderNo},'%') </if>" +
" <if test='param.payType != null'> and pay_type = #{param.payType} </if>" +
" <if test='param.paySerialNo != null'> and pay_serial_no like concat('%',#{param.paySerialNo},'%') </if>" +
" <if test='param.userPhone != null'> and user_phone = #{param.userPhone} </if>" +
" <if test='param.gasOilType != null'> and gas_oil_type = #{param.gasOilType} </if>" +
" <if test='param.gasStaffId != null'> and gas_staff_id = #{param.gasStaffId} </if>" +
" <if test='param.gasStaffName != null'> and gas_staff_name like concat('%',#{param.gasStaffName},'%') </if>" +
" <if test='param.agentId != null'> and agent_id = #{param.agentId} </if>" +
" <if test='param.agentStaffId != null'> and agent_staff_id = #{param.agentStaffId} </if>" +
" <if test='param.status != null'> and status = #{param.status} </if>" +
" <if test='param.gasClassGroupId != null'> and gas_class_group_id = #{param.gasClassGroupId} </if>" +
" <if test='param.gasClassGroupTaskId != null'> and gas_class_group_task_id = #{param.gasClassGroupTaskId} </if>" +
" <if test='param.gasOilNo != null'> and gas_oil_no = #{param.gasOilNo} </if>" +
" <if test='param.createTimeS != null'><![CDATA[ and create_time >= #{param.createTimeS} ]]></if>" +
" <if test='param.createTimeE != null'><![CDATA[ and create_time <= #{param.createTimeE} ]]></if>" +
" <if test='param.payTimeS != null'><![CDATA[ and pay_time >= #{param.payTimeS} ]]></if>" +
" <if test='param.payTimeE != null'><![CDATA[ and pay_time <= #{param.payTimeE} ]]></if>" +
" <if test='param.refundTimeS != null'><![CDATA[ and refund_time >= #{param.refundTimeS} ]]></if>" +
" <if test='param.refundTimeE != null'><![CDATA[ and refund_time <= #{param.refundTimeE} ]]></if>" +
"</script>")
Map<String,Object> selectGasOrderCount(@Param("param") Map<String,Object> param);
}

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

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

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

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

@ -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<String, Object> 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<String, Object> 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<Criteria> oredCriteria = example.getOredCriteria();
boolean firstCriteria = true;
for (int i = 0; i < oredCriteria.size(); i++) {
Criteria criteria = oredCriteria.get(i);
if (criteria.isValid()) {
if (firstCriteria) {
firstCriteria = false;
} else {
sb.append(" or ");
}
sb.append('(');
List<Criterion> criterions = criteria.getAllCriteria();
boolean firstCriterion = true;
for (int j = 0; j < criterions.size(); j++) {
Criterion criterion = criterions.get(j);
if (firstCriterion) {
firstCriterion = false;
} else {
sb.append(" and ");
}
if (criterion.isNoValue()) {
sb.append(criterion.getCondition());
} else if (criterion.isSingleValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j));
} else {
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler()));
}
} else if (criterion.isBetweenValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j));
} else {
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler()));
}
} else if (criterion.isListValue()) {
sb.append(criterion.getCondition());
sb.append(" (");
List<?> listItems = (List<?>) criterion.getValue();
boolean comma = false;
for (int k = 0; k < listItems.size(); k++) {
if (comma) {
sb.append(", ");
} else {
comma = true;
}
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase3, i, j, k));
} else {
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler()));
}
}
sb.append(')');
}
}
sb.append(')');
}
}
if (sb.length() > 0) {
sql.WHERE(sb.toString());
}
}
}

@ -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<String, Object> 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<String, Object> 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<Criteria> oredCriteria = example.getOredCriteria();
boolean firstCriteria = true;
for (int i = 0; i < oredCriteria.size(); i++) {
Criteria criteria = oredCriteria.get(i);
if (criteria.isValid()) {
if (firstCriteria) {
firstCriteria = false;
} else {
sb.append(" or ");
}
sb.append('(');
List<Criterion> criterions = criteria.getAllCriteria();
boolean firstCriterion = true;
for (int j = 0; j < criterions.size(); j++) {
Criterion criterion = criterions.get(j);
if (firstCriterion) {
firstCriterion = false;
} else {
sb.append(" and ");
}
if (criterion.isNoValue()) {
sb.append(criterion.getCondition());
} else if (criterion.isSingleValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j));
} else {
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler()));
}
} else if (criterion.isBetweenValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j));
} else {
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler()));
}
} else if (criterion.isListValue()) {
sb.append(criterion.getCondition());
sb.append(" (");
List<?> listItems = (List<?>) criterion.getValue();
boolean comma = false;
for (int k = 0; k < listItems.size(); k++) {
if (comma) {
sb.append(", ");
} else {
comma = true;
}
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase3, i, j, k));
} else {
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler()));
}
}
sb.append(')');
}
}
sb.append(')');
}
}
if (sb.length() > 0) {
sql.WHERE(sb.toString());
}
}
}

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

@ -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<Criteria> oredCriteria;
private Integer limit;
private Long offset;
public BsMerchantAccountExample() {
oredCriteria = new ArrayList<Criteria>();
}
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<Criteria> 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<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> 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<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> 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<Long> values) {
addCriterion("mer_id in", values, "merId");
return (Criteria) this;
}
public Criteria andMerIdNotIn(List<Long> 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<String> values) {
addCriterion("mer_no in", values, "merNo");
return (Criteria) this;
}
public Criteria andMerNoNotIn(List<String> 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<BigDecimal> values) {
addCriterion("amount in", values, "amount");
return (Criteria) this;
}
public Criteria andAmountNotIn(List<BigDecimal> 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<BigDecimal> values) {
addCriterion("amount_consume in", values, "amountConsume");
return (Criteria) this;
}
public Criteria andAmountConsumeNotIn(List<BigDecimal> 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<Integer> values) {
addCriterion("`status` in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<Integer> 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<Date> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Date> 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<Date> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Date> 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<String> values) {
addCriterion("ext_1 in", values, "ext1");
return (Criteria) this;
}
public Criteria andExt1NotIn(List<String> 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<String> values) {
addCriterion("ext_2 in", values, "ext2");
return (Criteria) this;
}
public Criteria andExt2NotIn(List<String> 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<String> values) {
addCriterion("ext_3 in", values, "ext3");
return (Criteria) this;
}
public Criteria andExt3NotIn(List<String> 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);
}
}
}

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

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

@ -53,6 +53,13 @@ public interface BsGasOrderService {
*/
BsGasOrder getDetailByPayChannelOrderNo(String payChannelOrderNo);
/**
* 查询加油订单统计
* @param param
* @return
*/
Map<String,Object> getGasOrderCount(Map<String,Object> param);
/**
* 查询油站订单列表
* @param param

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

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

@ -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<String, Object> getGasOrderCount(Map<String, Object> 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<BsGasOrder> getGasOrderList(Map<String, Object> 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")+"%");
}

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

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

@ -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<BsMerchantAccountRecord> getList(Map<String,Object> param);
}

@ -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<String, Object> otherParam) throws Exception;
/**
* 退款
* @param merNo
* @param amount
* @param orderRefund
*/
void refund(String merNo, BigDecimal amount, BsOrderRefund orderRefund) throws Exception;
}

@ -1,4 +1,4 @@
package com.hfkj.service;
package com.hfkj.service.merchant;
import com.hfkj.entity.BsMerchantPayConfig;

@ -1,4 +1,4 @@
package com.hfkj.service;
package com.hfkj.service.merchant;
import com.google.zxing.WriterException;
import com.hfkj.entity.BsMerchant;

@ -1,4 +1,4 @@
package com.hfkj.service;
package com.hfkj.service.merchant;
import com.hfkj.entity.BsMerchant;
import com.hfkj.sysenum.MerchantStatusEnum;

@ -1,4 +1,4 @@
package com.hfkj.service;
package com.hfkj.service.merchant;
import com.hfkj.entity.BsMerchant;
import com.hfkj.entity.BsMerchantUser;

@ -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<BsMerchantAccountRecord> getList(Map<String, Object> 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);
}
}

@ -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<String, Object> 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<BsMerchantAccount> 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<String, Object> 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);
}
}
}

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

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

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

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

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

@ -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<String,Object> consumeMap = new HashMap<>();
consumeMap.put("sourceType", MerchantAccountRecordSourceTypeEnum.type2.getType());
consumeMap.put("sourceId", gasOrder.getId());
consumeMap.put("sourceOrderNo", gasOrder.getOrderNo());
merchantAccountService.consume(gasOrder.getMerNo(), gasOrder.getGasRefuelPrice(), consumeMap);
}
if (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 );
}

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

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

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

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

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

@ -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;
}
}
Loading…
Cancel
Save