提交代码

dev
胡锐 5 months ago
parent fa93ea3404
commit b3482bf70f
  1. 12
      bweb/src/main/java/com/bweb/controller/BsDiscountController.java
  2. 6
      bweb/src/main/java/com/bweb/controller/BsGasOilPriceTaskController.java
  3. 2
      bweb/src/main/java/com/bweb/controller/BsMerchantController.java
  4. 2
      cweb/src/main/java/com/cweb/config/AuthConfig.java
  5. 22
      cweb/src/main/java/com/cweb/controller/BsUserController.java
  6. 2
      cweb/src/main/java/com/cweb/controller/order/GasOrderController.java
  7. 12
      cweb/src/main/java/com/cweb/controller/order/OrderPayController.java
  8. 5
      service/pom.xml
  9. 182
      service/src/main/java/com/hfkj/common/alipay/AlipayRequest.java
  10. 49
      service/src/main/java/com/hfkj/common/alipay/AlipayUtils.java
  11. 3
      service/src/main/java/com/hfkj/common/alipay/AliyunService.java
  12. 134
      service/src/main/java/com/hfkj/dao/BsOrderSettleLedgerMapper.java
  13. 7
      service/src/main/java/com/hfkj/dao/BsOrderSettleLedgerMapperExt.java
  14. 360
      service/src/main/java/com/hfkj/dao/BsOrderSettleLedgerSqlProvider.java
  15. 133
      service/src/main/java/com/hfkj/dao/BsOrderSettleMapper.java
  16. 7
      service/src/main/java/com/hfkj/dao/BsOrderSettleMapperExt.java
  17. 360
      service/src/main/java/com/hfkj/dao/BsOrderSettleSqlProvider.java
  18. 265
      service/src/main/java/com/hfkj/entity/BsOrderSettle.java
  19. 1134
      service/src/main/java/com/hfkj/entity/BsOrderSettleExample.java
  20. 265
      service/src/main/java/com/hfkj/entity/BsOrderSettleLedger.java
  21. 1114
      service/src/main/java/com/hfkj/entity/BsOrderSettleLedgerExample.java
  22. 7
      service/src/main/java/com/hfkj/pay/HuiPayService.java
  23. 8
      service/src/main/java/com/hfkj/service/gas/BsGasOilGunNoService.java
  24. 6
      service/src/main/java/com/hfkj/service/gas/impl/BsGasOilGunNoServiceImpl.java
  25. 2
      service/src/main/java/com/hfkj/service/gas/impl/BsGasOrderServiceImpl.java
  26. 20
      service/src/main/java/com/hfkj/service/gas/impl/BsGasServiceImpl.java
  27. 4
      service/src/main/java/com/hfkj/service/impl/BsDiscountServiceImpl.java
  28. 6
      service/src/main/java/com/hfkj/service/order/OrderCreateService.java
  29. 1
      service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java
  30. 24
      service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java
  31. 2
      service/src/main/java/com/hfkj/service/sec/impl/SecUserLoginLogServiceImpl.java
  32. 2
      service/src/main/java/com/hfkj/service/user/impl/BsUserLoginLogServiceImpl.java
  33. 42
      service/src/main/java/com/hfkj/sysenum/order/OrderSettleLedgerStatusEnum.java

@ -13,6 +13,7 @@ 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;
@ -40,6 +41,8 @@ public class BsDiscountController {
private BsDiscountService discountService;
@Resource
private BsMerchantService merchantService;
@Resource
private UserCenter userCenter;
@RequestMapping(value="/editDiscount",method = RequestMethod.POST)
@ResponseBody
@ -231,8 +234,15 @@ public class BsDiscountController {
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
try {
SecUserSessionObject userInfoModel = userCenter.getSessionModel(SecUserSessionObject.class);
Map<String,Object> param = new HashMap<>();
param.put("merNo", merNo);
if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type1.getCode())) {
param.put("merNo", merNo);
} else if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())
|| userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type3.getCode())) {
param.put("merNo", userInfoModel.getMerchant().getMerNo());
}
param.put("discountName", discountName);
param.put("discountType", discountType);
param.put("status", status);

@ -206,7 +206,6 @@ public class BsGasOilPriceTaskController {
try {
SecUserSessionObject userInfoModel = userCenter.getSessionModel(SecUserSessionObject.class);
if (userInfoModel == null) {
log.error("HighGasController -> disabledOil() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_LOGIN_NOT, "");
}
@ -219,8 +218,9 @@ public class BsGasOilPriceTaskController {
if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type1.getCode())) {
} else if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) {
param.put("merId", userInfoModel.getAccount().getId());
} else if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())
|| userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type3.getCode())) {
param.put("merId", userInfoModel.getMerchant().getId());
}
param.put("oilType", oilType);
param.put("oilNo", oilNo);

@ -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.sysenum.MerchantSourceTypeEnum;
import com.hfkj.sysenum.MerchantStatusEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -103,6 +104,7 @@ public class BsMerchantController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的省级");
}
merchant.setSourceType(MerchantSourceTypeEnum.type1.getNumber());
merchant.setProvinceCode(provinceRegion.getRegionId());
merchant.setProvinceName(provinceRegion.getRegionName());
merchant.setCityCode(cityRegion.getRegionId());

@ -89,6 +89,8 @@ public class AuthConfig implements WebMvcConfigurer {
.excludePathPatterns("/sms/*")
.excludePathPatterns("/gas/*")
.excludePathPatterns("/order/*")
.excludePathPatterns("/gasOrder/*")
.excludePathPatterns("/pay/*")
.excludePathPatterns("/user/*")
.excludePathPatterns("/notify/*")
;

@ -1,6 +1,9 @@
package com.cweb.controller;
import com.alibaba.fastjson.JSONObject;
import com.alipay.api.request.AlipaySystemOauthTokenRequest;
import com.alipay.api.response.AlipaySystemOauthTokenResponse;
import com.hfkj.common.alipay.AlipayUtils;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
@ -158,4 +161,23 @@ public class BsUserController {
}
}
@RequestMapping(value="/getAlipayUserId",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取支付宝用户id")
public ResponseData getAlipayUserId(@RequestParam(value = "code", required = true) String code) {
try {
AlipaySystemOauthTokenRequest request = new AlipaySystemOauthTokenRequest();
request.setGrantType("authorization_code");
request.setCode(code);
AlipaySystemOauthTokenResponse response = AlipayUtils.initClient().certificateExecute(request);
if(response.isSuccess()){
return ResponseMsgUtil.success(response);
}
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "获取失败");
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -46,7 +46,7 @@ public class GasOrderController {
Map<String,Object> param = new HashMap<>();
param.put("userId", userSession.getUser().getId());
param.put("orderNo", orderNo);
param.put("orderStatus", orderStatus);
param.put("status", orderStatus);
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(gasOrderService.getGasOrderList(param)));

@ -7,6 +7,7 @@ import com.hfkj.common.exception.SysCode;
import com.hfkj.common.security.UserCenter;
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;
@ -74,8 +75,15 @@ public class OrderPayController {
}
order.setPayType(OrderPayTypeEnum.type1.getCode());
// 请求支付渠道
Map<Object, Object> preorder = HuiPayService.preorder(merPay.getChannelMerNo(), merPay.getChannelMerKey(), body.getString("userId"), order);
Map<Object, Object> preorder = HuiPayService.preorder(merPay.getChannelMerNo(), merPay.getChannelMerKey(), body.getString("userId"), merPay.getLedgerAccountFlag(), order);
// 交易入账
BsOrderSettle orderSettle = new BsOrderSettle();
orderSettle.setOrderNo(order.getOrderNo());
orderSettle.setSettleMerNo(merPay.getChannelMerNo());
orderSettle.setSettleMerKey(merPay.getChannelMerKey());
orderSettle.setSettleAmount(order.getPayRealPrice());
orderSettle.setLedgerFlag(merPay.getLedgerAccountFlag());
return ResponseMsgUtil.success(preorder);
} catch (Exception e) {
@ -111,7 +119,7 @@ public class OrderPayController {
}
order.setPayType(OrderPayTypeEnum.type2.getCode());
// 请求支付渠道
Map<Object, Object> preorder = HuiPayService.preorder(merPay.getChannelMerNo(), merPay.getChannelMerKey(), body.getString("userId"), order);
Map<Object, Object> preorder = HuiPayService.preorder(merPay.getChannelMerNo(), merPay.getChannelMerKey(), body.getString("userId"), merPay.getLedgerAccountFlag(), order);
return ResponseMsgUtil.success(preorder);
} catch (Exception e) {

@ -260,6 +260,11 @@
<artifactId>rocketmq-spring-boot-starter</artifactId>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>com.alipay.sdk</groupId>
<artifactId>alipay-sdk-java</artifactId>
<version>4.39.104.ALL</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>

@ -0,0 +1,182 @@
package com.hfkj.common.alipay;
import com.alipay.api.AlipayClient;
import com.alipay.api.FileItem;
import com.alipay.api.domain.ZftSubMerchantOrder;
import com.alipay.api.request.AntMerchantExpandIndirectImageUploadRequest;
import com.alipay.api.request.AntMerchantExpandIndirectZftConsultRequest;
import com.alipay.api.request.AntMerchantExpandIndirectZftSettlementmodifyRequest;
import com.alipay.api.request.AntMerchantExpandIndirectZftorderQueryRequest;
import com.alipay.api.response.AntMerchantExpandIndirectImageUploadResponse;
import com.alipay.api.response.AntMerchantExpandIndirectZftConsultResponse;
import com.alipay.api.response.AntMerchantExpandIndirectZftSettlementmodifyResponse;
import com.alipay.api.response.AntMerchantExpandIndirectZftorderQueryResponse;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
/**
* 支付业务请求
* @className: MerchantRequest
* @author: HuRui
* @date: 2023/2/17
**/
public class AlipayRequest {
private static Logger log = LoggerFactory.getLogger(AlipayRequest.class);
/**
* 商户创建预校验咨询
* @param bizContent 进件参数
* @return
* @throws Exception
*/
public static void merchantIndirectConsult(String bizContent) {
log.info("========== START 商户创建预校验咨询 ==========");
log.info("请求参数:" + bizContent);
try {
AlipayClient alipayClient = AlipayUtils.initClient();
AntMerchantExpandIndirectZftConsultRequest request = new AntMerchantExpandIndirectZftConsultRequest();
request.setBizContent(bizContent);
AntMerchantExpandIndirectZftConsultResponse response = alipayClient.certificateExecute(request);
log.info("响应参数:" + response);
if (response.isSuccess() != true || response.getAccountAudit() != true || response.getRiskAudit() != true) {
throw new Exception(response.getSubMsg());
}
} catch (Exception e) {
log.info("出现异常:" + e);
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, e.getMessage());
} finally {
log.info("========== END 商户创建预校验咨询 ==========");
}
}
/**
* 商户创建
* @param bizContent 进件参数
* @return 申请单号
* @throws Exception
*/
public static String merchantIndirectCreate(String bizContent) {
log.info("========== START 商户创建 ==========");
log.info("请求参数:" + bizContent);
try {
AlipayClient alipayClient = AlipayUtils.initClient();
AntMerchantExpandIndirectZftConsultRequest request = new AntMerchantExpandIndirectZftConsultRequest();
request.setBizContent(bizContent);
AntMerchantExpandIndirectZftConsultResponse response = alipayClient.certificateExecute(request);
log.info("响应参数:" + response);
if (response.isSuccess()) {
return response.getOrderId();
}
throw new Exception(response.getSubMsg());
} catch (Exception e) {
log.info("出现异常:" + e);
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, e.getMessage());
} finally {
log.info("========== END 商户创建 ==========");
}
}
/**
* 商户入驻进度查询
* @param bizContent 进件参数
* @return 申请单号
* @throws Exception
*/
public static List<ZftSubMerchantOrder> merchantIndirectQuery(String bizContent) {
log.info("========== START 商户入驻进度查询 ==========");
log.info("请求参数:" + bizContent);
try {
AlipayClient alipayClient = AlipayUtils.initClient();
AntMerchantExpandIndirectZftorderQueryRequest request = new AntMerchantExpandIndirectZftorderQueryRequest();
request.setBizContent(bizContent);
AntMerchantExpandIndirectZftorderQueryResponse response = alipayClient.certificateExecute(request);
log.info("响应参数:" + response);
if (response.isSuccess()) {
return response.getOrders();
}
throw new Exception(response.getSubMsg());
} catch (Exception e) {
log.info("出现异常:" + e);
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, e.getMessage());
} finally {
log.info("========== END 商户入驻进度查询 ==========");
}
}
/**
* 商户结算信息修改
* @param bizContent 参数
* @return
* @throws Exception
*/
public static String merchantIndirectSettlementModify(String bizContent) {
log.info("========== START 商户结算信息修改 ==========");
log.info("请求参数:" + bizContent);
try {
AlipayClient alipayClient = AlipayUtils.initClient();
AntMerchantExpandIndirectZftSettlementmodifyRequest request = new AntMerchantExpandIndirectZftSettlementmodifyRequest ();
request.setBizContent(bizContent);
AntMerchantExpandIndirectZftSettlementmodifyResponse response = alipayClient.certificateExecute(request);
log.info("响应参数:" + response);
if (response.isSuccess()) {
return response.getOrderId();
}
throw new Exception(response.getSubMsg());
} catch (Exception e) {
log.info("出现异常:" + e);
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, e.getMessage());
} finally {
log.info("========== END 商户结算信息修改 ==========");
}
}
/**
* 图片上传
* @param fileUrl 本地路径
* @return
* @throws Exception
*/
public static String imageUpload(String fileUrl) {
log.info("========== START 图片上传 ==========");
log.info("请求参数:" + fileUrl);
try {
AlipayClient alipayClient = AlipayUtils.initClient();
// 读取本地文件
FileItem imageContent = new FileItem(fileUrl);
// 截取文件格式
String imageType = StringUtils.substringAfterLast(fileUrl, ".");
AntMerchantExpandIndirectImageUploadRequest request = new AntMerchantExpandIndirectImageUploadRequest();
request.setImageContent(imageContent);
request.setImageType(imageType);
AntMerchantExpandIndirectImageUploadResponse response = alipayClient.certificateExecute(request);
log.info("响应参数:" + response);
if (response.isSuccess()) {
return response.getImageId();
}
throw new Exception(response.getSubMsg());
} catch (Exception e) {
log.info("出现异常:" + e);
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, e.getMessage());
} finally {
log.info("========== END 图片上传 ==========");
}
}
}

@ -0,0 +1,49 @@
package com.hfkj.common.alipay;
import com.alipay.api.AlipayClient;
import com.alipay.api.AlipayConfig;
import com.alipay.api.DefaultAlipayClient;
/**
* 支付宝配置
* @className: AlipayConfig
* @author: HuRui
* @date: 2023/2/13
**/
public class AlipayUtils {
private final static String serverUrl = "https://openapi.alipay.com/gateway.do";
private final static String appId = "2021004149636316";
private final static String APP_PRIVATE_KEY = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCBObA50oioZEmUGTsSPJghAUf/lRT+TC+9HNyu0To3bSkLZSlEide2kszQnJk32+60QM26OudBaUnUCHkzv0++232hKPzSXHVVUykvu74itAtH66YxO2RqLt/OuTRBnFpiYPs0lXEoNeAsUQ92I6TOCrS8db/76Tvuye0nSH5lAJ6mwq8Hgo/+RQNRvIq3RFvWQOMD5lTp2lWsZ7x4FONtSmPCXd4fdYbKd1QrBHMZCQjBAn12YA+X+lmSNlnFo/xOu5rvKwMGJgvFLYxFdNHXgZUZfrjzOKA+sqq8lRfyVo4YHqRDi5bH1Ln2VUqZL9HidIHZx0YSKlfvdeuzR8abAgMBAAECggEAOOpwrLcGy6wIIDuQofKgSoEm9fHyoiJqMFAC/thWXM0uc79lkrNnmBlGLmeasFik5S1Zrzl8W3oFM2dcAqezdutzhMTpvblNUHxlOonlL6G/CjlHJI31JzNoDcPSuUclJAl0+u8LPNul1b8KIU2Hq9xZSFxQZ6KNbBnx4whx6wfZBvV06oy7hu7vfnWvobidooiGAxJuffRKuWQS8w6BPC7h2vz8AbiADHMA1YgCwIwroPbhU8QFY07PGeirAyJnrphZOIKSKwY9m8RK/AyBKL0iDopX/7nhdJ1LEiVbBlw50ej2VMAqfb0bA7z7zhhxwYCi6LN9DZfLQW9/Z3W8mQKBgQDyHdT/tex+s07zg4TUgAmTTqSyqp64j9Qbgdde2tTHUPjmOXXOpL5PvvT6xOu6dTwq5TwwqdsyVLh5T/cnYzqqXaZZzv6iWi1qajbLElf1r7bPquF2KCa0n2ZdxcYBH78bvIIuD7kGfmJDSA5a+1cgHJYZVer7MvYFf2id6H617wKBgQCIoqlgvYzTVDdXevI5LcOr1CfsBsuXoUdc8aUyFa1D6rj41wHXonqtmr/3tlo03HbUAQT0u/CjMf8raoW/2D1Sv7EnL3udb51qzYYj082x0DNUAs9CQq+AO8qhs8h4sXJGki7rjtJUtOfs1VFg84I5Z7IT9xKQMvsp2gmErpTGFQKBgQDIQYBxWEmZqjl9FKUDFjvVSVDULmdFhEEN12EJpbokeYbE9XXJS13Vm74IxGOtP1ZarGwSXAtfH8/NFyT3wQ0+6GK1GY5nPmsd/2f+otd58LImJdKB5kfNUaJboT9aoqVxDYQnEP4aruIbgDfPbN/tQXes0PGgf9AZT/55zVkwpQKBgFD9kkbctKADuHYrU28fOHAe5rcaZA3yNHncZt5kSPsMJC6kS9xE3FERfJ7ZwWi6Edmi7QwgZwhlN2rFzpgkFl15cQnYNH7izT2kq9GK18+BqRswOyh8nMj3KCpnhfo8vI8mUZehZf196kfRPlaooNVkKQN6nc9J2OU68A9s6JTtAoGBAOTabPjBoxWeNQwF2pR4E5SfXaMBKC7a6/+AMn9oUb9lvTPZtxXkIZkvn5iRz2UmrygLw4UCWKC3T7ujFIO0lHWktzVv2qPbINbfW10p0S/ioFvNxzP+ZDfSFrN03Zoh05H+0NXj1e4REMtIrbx5R+sJn6CVftpYfFcQd/lXy8MR";
private final static String APP_CERT_PATH = "/home/project/oil/cert/alipay/appCertPublicKey_2021004149636316.crt";
private final static String ALIPAY_CERT_PATH = "/home/project/oil/cert/alipay/alipayCertPublicKey_RSA2.crt";
private final static String ALIPAY_ROOT_CERT_PATH = "/home/project/oil/cert/alipay/alipayRootCert.crt";
/**
* 初始化客户端请求
* @return
*/
public static AlipayClient initClient() throws Exception {
AlipayConfig alipayConfig = new AlipayConfig();
// 设置网关地址
alipayConfig.setServerUrl(serverUrl);
// 设置应用APPID
alipayConfig.setAppId(appId);
// 设置应用私钥
alipayConfig.setPrivateKey(APP_PRIVATE_KEY);
// 设置应用公钥证书路径
alipayConfig.setAppCertPath(APP_CERT_PATH);
// 设置支付宝公钥证书路径
alipayConfig.setAlipayPublicCertPath(ALIPAY_CERT_PATH);
// 设置支付宝根证书路径
alipayConfig.setRootCertPath(ALIPAY_ROOT_CERT_PATH);
// 设置请求格式,固定值json
alipayConfig.setFormat("json");
// 设置字符集
alipayConfig.setCharset("utf-8");
// 设置签名类型
alipayConfig.setSignType("RSA2");
return new DefaultAlipayClient(alipayConfig);
}
}

@ -1,6 +1,7 @@
package com.hfkj.common.utils;
package com.hfkj.common.alipay;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.common.utils.HttpUtils;
import org.apache.http.HttpResponse;
import org.apache.http.util.EntityUtils;

@ -0,0 +1,134 @@
package com.hfkj.dao;
import com.hfkj.entity.BsOrderSettleLedger;
import com.hfkj.entity.BsOrderSettleLedgerExample;
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 BsOrderSettleLedgerMapper extends BsOrderSettleLedgerMapperExt {
@SelectProvider(type=BsOrderSettleLedgerSqlProvider.class, method="countByExample")
long countByExample(BsOrderSettleLedgerExample example);
@DeleteProvider(type=BsOrderSettleLedgerSqlProvider.class, method="deleteByExample")
int deleteByExample(BsOrderSettleLedgerExample example);
@Delete({
"delete from bs_order_settle_ledger",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_order_settle_ledger (order_settle_id, ratio, ",
"sharing_amount, receiver_mer_no, ",
"receiver_mer_name, receiver_amount, ",
"`status`, create_time, ",
"profit_sharing_time, finish_time, ",
"ext_1, ext_2, ext_3)",
"values (#{orderSettleId,jdbcType=BIGINT}, #{ratio,jdbcType=DECIMAL}, ",
"#{sharingAmount,jdbcType=DECIMAL}, #{receiverMerNo,jdbcType=VARCHAR}, ",
"#{receiverMerName,jdbcType=VARCHAR}, #{receiverAmount,jdbcType=DECIMAL}, ",
"#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{profitSharingTime,jdbcType=TIMESTAMP}, #{finishTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsOrderSettleLedger record);
@InsertProvider(type=BsOrderSettleLedgerSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(BsOrderSettleLedger record);
@SelectProvider(type=BsOrderSettleLedgerSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="order_settle_id", property="orderSettleId", jdbcType=JdbcType.BIGINT),
@Result(column="ratio", property="ratio", jdbcType=JdbcType.DECIMAL),
@Result(column="sharing_amount", property="sharingAmount", jdbcType=JdbcType.DECIMAL),
@Result(column="receiver_mer_no", property="receiverMerNo", jdbcType=JdbcType.VARCHAR),
@Result(column="receiver_mer_name", property="receiverMerName", jdbcType=JdbcType.VARCHAR),
@Result(column="receiver_amount", property="receiverAmount", jdbcType=JdbcType.DECIMAL),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="profit_sharing_time", property="profitSharingTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="finish_time", property="finishTime", 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<BsOrderSettleLedger> selectByExample(BsOrderSettleLedgerExample example);
@Select({
"select",
"id, order_settle_id, ratio, sharing_amount, receiver_mer_no, receiver_mer_name, ",
"receiver_amount, `status`, create_time, profit_sharing_time, finish_time, ext_1, ",
"ext_2, ext_3",
"from bs_order_settle_ledger",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="order_settle_id", property="orderSettleId", jdbcType=JdbcType.BIGINT),
@Result(column="ratio", property="ratio", jdbcType=JdbcType.DECIMAL),
@Result(column="sharing_amount", property="sharingAmount", jdbcType=JdbcType.DECIMAL),
@Result(column="receiver_mer_no", property="receiverMerNo", jdbcType=JdbcType.VARCHAR),
@Result(column="receiver_mer_name", property="receiverMerName", jdbcType=JdbcType.VARCHAR),
@Result(column="receiver_amount", property="receiverAmount", jdbcType=JdbcType.DECIMAL),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="profit_sharing_time", property="profitSharingTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="finish_time", property="finishTime", 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)
})
BsOrderSettleLedger selectByPrimaryKey(Long id);
@UpdateProvider(type=BsOrderSettleLedgerSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") BsOrderSettleLedger record, @Param("example") BsOrderSettleLedgerExample example);
@UpdateProvider(type=BsOrderSettleLedgerSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") BsOrderSettleLedger record, @Param("example") BsOrderSettleLedgerExample example);
@UpdateProvider(type=BsOrderSettleLedgerSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(BsOrderSettleLedger record);
@Update({
"update bs_order_settle_ledger",
"set order_settle_id = #{orderSettleId,jdbcType=BIGINT},",
"ratio = #{ratio,jdbcType=DECIMAL},",
"sharing_amount = #{sharingAmount,jdbcType=DECIMAL},",
"receiver_mer_no = #{receiverMerNo,jdbcType=VARCHAR},",
"receiver_mer_name = #{receiverMerName,jdbcType=VARCHAR},",
"receiver_amount = #{receiverAmount,jdbcType=DECIMAL},",
"`status` = #{status,jdbcType=INTEGER},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"profit_sharing_time = #{profitSharingTime,jdbcType=TIMESTAMP},",
"finish_time = #{finishTime,jdbcType=TIMESTAMP},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR}",
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(BsOrderSettleLedger record);
}

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

@ -0,0 +1,360 @@
package com.hfkj.dao;
import com.hfkj.entity.BsOrderSettleLedger;
import com.hfkj.entity.BsOrderSettleLedgerExample.Criteria;
import com.hfkj.entity.BsOrderSettleLedgerExample.Criterion;
import com.hfkj.entity.BsOrderSettleLedgerExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class BsOrderSettleLedgerSqlProvider {
public String countByExample(BsOrderSettleLedgerExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("bs_order_settle_ledger");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(BsOrderSettleLedgerExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("bs_order_settle_ledger");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(BsOrderSettleLedger record) {
SQL sql = new SQL();
sql.INSERT_INTO("bs_order_settle_ledger");
if (record.getOrderSettleId() != null) {
sql.VALUES("order_settle_id", "#{orderSettleId,jdbcType=BIGINT}");
}
if (record.getRatio() != null) {
sql.VALUES("ratio", "#{ratio,jdbcType=DECIMAL}");
}
if (record.getSharingAmount() != null) {
sql.VALUES("sharing_amount", "#{sharingAmount,jdbcType=DECIMAL}");
}
if (record.getReceiverMerNo() != null) {
sql.VALUES("receiver_mer_no", "#{receiverMerNo,jdbcType=VARCHAR}");
}
if (record.getReceiverMerName() != null) {
sql.VALUES("receiver_mer_name", "#{receiverMerName,jdbcType=VARCHAR}");
}
if (record.getReceiverAmount() != null) {
sql.VALUES("receiver_amount", "#{receiverAmount,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.getProfitSharingTime() != null) {
sql.VALUES("profit_sharing_time", "#{profitSharingTime,jdbcType=TIMESTAMP}");
}
if (record.getFinishTime() != null) {
sql.VALUES("finish_time", "#{finishTime,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(BsOrderSettleLedgerExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("order_settle_id");
sql.SELECT("ratio");
sql.SELECT("sharing_amount");
sql.SELECT("receiver_mer_no");
sql.SELECT("receiver_mer_name");
sql.SELECT("receiver_amount");
sql.SELECT("`status`");
sql.SELECT("create_time");
sql.SELECT("profit_sharing_time");
sql.SELECT("finish_time");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
sql.FROM("bs_order_settle_ledger");
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) {
BsOrderSettleLedger record = (BsOrderSettleLedger) parameter.get("record");
BsOrderSettleLedgerExample example = (BsOrderSettleLedgerExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("bs_order_settle_ledger");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getOrderSettleId() != null) {
sql.SET("order_settle_id = #{record.orderSettleId,jdbcType=BIGINT}");
}
if (record.getRatio() != null) {
sql.SET("ratio = #{record.ratio,jdbcType=DECIMAL}");
}
if (record.getSharingAmount() != null) {
sql.SET("sharing_amount = #{record.sharingAmount,jdbcType=DECIMAL}");
}
if (record.getReceiverMerNo() != null) {
sql.SET("receiver_mer_no = #{record.receiverMerNo,jdbcType=VARCHAR}");
}
if (record.getReceiverMerName() != null) {
sql.SET("receiver_mer_name = #{record.receiverMerName,jdbcType=VARCHAR}");
}
if (record.getReceiverAmount() != null) {
sql.SET("receiver_amount = #{record.receiverAmount,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.getProfitSharingTime() != null) {
sql.SET("profit_sharing_time = #{record.profitSharingTime,jdbcType=TIMESTAMP}");
}
if (record.getFinishTime() != null) {
sql.SET("finish_time = #{record.finishTime,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_order_settle_ledger");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("order_settle_id = #{record.orderSettleId,jdbcType=BIGINT}");
sql.SET("ratio = #{record.ratio,jdbcType=DECIMAL}");
sql.SET("sharing_amount = #{record.sharingAmount,jdbcType=DECIMAL}");
sql.SET("receiver_mer_no = #{record.receiverMerNo,jdbcType=VARCHAR}");
sql.SET("receiver_mer_name = #{record.receiverMerName,jdbcType=VARCHAR}");
sql.SET("receiver_amount = #{record.receiverAmount,jdbcType=DECIMAL}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("profit_sharing_time = #{record.profitSharingTime,jdbcType=TIMESTAMP}");
sql.SET("finish_time = #{record.finishTime,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}");
BsOrderSettleLedgerExample example = (BsOrderSettleLedgerExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(BsOrderSettleLedger record) {
SQL sql = new SQL();
sql.UPDATE("bs_order_settle_ledger");
if (record.getOrderSettleId() != null) {
sql.SET("order_settle_id = #{orderSettleId,jdbcType=BIGINT}");
}
if (record.getRatio() != null) {
sql.SET("ratio = #{ratio,jdbcType=DECIMAL}");
}
if (record.getSharingAmount() != null) {
sql.SET("sharing_amount = #{sharingAmount,jdbcType=DECIMAL}");
}
if (record.getReceiverMerNo() != null) {
sql.SET("receiver_mer_no = #{receiverMerNo,jdbcType=VARCHAR}");
}
if (record.getReceiverMerName() != null) {
sql.SET("receiver_mer_name = #{receiverMerName,jdbcType=VARCHAR}");
}
if (record.getReceiverAmount() != null) {
sql.SET("receiver_amount = #{receiverAmount,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.getProfitSharingTime() != null) {
sql.SET("profit_sharing_time = #{profitSharingTime,jdbcType=TIMESTAMP}");
}
if (record.getFinishTime() != null) {
sql.SET("finish_time = #{finishTime,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, BsOrderSettleLedgerExample 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,133 @@
package com.hfkj.dao;
import com.hfkj.entity.BsOrderSettle;
import com.hfkj.entity.BsOrderSettleExample;
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 BsOrderSettleMapper extends BsOrderSettleMapperExt {
@SelectProvider(type=BsOrderSettleSqlProvider.class, method="countByExample")
long countByExample(BsOrderSettleExample example);
@DeleteProvider(type=BsOrderSettleSqlProvider.class, method="deleteByExample")
int deleteByExample(BsOrderSettleExample example);
@Delete({
"delete from bs_order_settle",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_order_settle (order_no, settle_mer_no, ",
"settle_mer_key, settle_amount, ",
"ledger_flag, ledger_order_no, ",
"ledger_amount, ledger_status, ",
"create_time, update_time, ",
"ext_1, ext_2, ext_3)",
"values (#{orderNo,jdbcType=VARCHAR}, #{settleMerNo,jdbcType=VARCHAR}, ",
"#{settleMerKey,jdbcType=VARCHAR}, #{settleAmount,jdbcType=DECIMAL}, ",
"#{ledgerFlag,jdbcType=BIT}, #{ledgerOrderNo,jdbcType=VARCHAR}, ",
"#{ledgerAmount,jdbcType=DECIMAL}, #{ledgerStatus,jdbcType=INTEGER}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsOrderSettle record);
@InsertProvider(type=BsOrderSettleSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(BsOrderSettle record);
@SelectProvider(type=BsOrderSettleSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="settle_mer_no", property="settleMerNo", jdbcType=JdbcType.VARCHAR),
@Result(column="settle_mer_key", property="settleMerKey", jdbcType=JdbcType.VARCHAR),
@Result(column="settle_amount", property="settleAmount", jdbcType=JdbcType.DECIMAL),
@Result(column="ledger_flag", property="ledgerFlag", jdbcType=JdbcType.BIT),
@Result(column="ledger_order_no", property="ledgerOrderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="ledger_amount", property="ledgerAmount", jdbcType=JdbcType.DECIMAL),
@Result(column="ledger_status", property="ledgerStatus", 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<BsOrderSettle> selectByExample(BsOrderSettleExample example);
@Select({
"select",
"id, order_no, settle_mer_no, settle_mer_key, settle_amount, ledger_flag, ledger_order_no, ",
"ledger_amount, ledger_status, create_time, update_time, ext_1, ext_2, ext_3",
"from bs_order_settle",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="settle_mer_no", property="settleMerNo", jdbcType=JdbcType.VARCHAR),
@Result(column="settle_mer_key", property="settleMerKey", jdbcType=JdbcType.VARCHAR),
@Result(column="settle_amount", property="settleAmount", jdbcType=JdbcType.DECIMAL),
@Result(column="ledger_flag", property="ledgerFlag", jdbcType=JdbcType.BIT),
@Result(column="ledger_order_no", property="ledgerOrderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="ledger_amount", property="ledgerAmount", jdbcType=JdbcType.DECIMAL),
@Result(column="ledger_status", property="ledgerStatus", 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)
})
BsOrderSettle selectByPrimaryKey(Long id);
@UpdateProvider(type=BsOrderSettleSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") BsOrderSettle record, @Param("example") BsOrderSettleExample example);
@UpdateProvider(type=BsOrderSettleSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") BsOrderSettle record, @Param("example") BsOrderSettleExample example);
@UpdateProvider(type=BsOrderSettleSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(BsOrderSettle record);
@Update({
"update bs_order_settle",
"set order_no = #{orderNo,jdbcType=VARCHAR},",
"settle_mer_no = #{settleMerNo,jdbcType=VARCHAR},",
"settle_mer_key = #{settleMerKey,jdbcType=VARCHAR},",
"settle_amount = #{settleAmount,jdbcType=DECIMAL},",
"ledger_flag = #{ledgerFlag,jdbcType=BIT},",
"ledger_order_no = #{ledgerOrderNo,jdbcType=VARCHAR},",
"ledger_amount = #{ledgerAmount,jdbcType=DECIMAL},",
"ledger_status = #{ledgerStatus,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(BsOrderSettle record);
}

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

@ -0,0 +1,360 @@
package com.hfkj.dao;
import com.hfkj.entity.BsOrderSettle;
import com.hfkj.entity.BsOrderSettleExample.Criteria;
import com.hfkj.entity.BsOrderSettleExample.Criterion;
import com.hfkj.entity.BsOrderSettleExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class BsOrderSettleSqlProvider {
public String countByExample(BsOrderSettleExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("bs_order_settle");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(BsOrderSettleExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("bs_order_settle");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(BsOrderSettle record) {
SQL sql = new SQL();
sql.INSERT_INTO("bs_order_settle");
if (record.getOrderNo() != null) {
sql.VALUES("order_no", "#{orderNo,jdbcType=VARCHAR}");
}
if (record.getSettleMerNo() != null) {
sql.VALUES("settle_mer_no", "#{settleMerNo,jdbcType=VARCHAR}");
}
if (record.getSettleMerKey() != null) {
sql.VALUES("settle_mer_key", "#{settleMerKey,jdbcType=VARCHAR}");
}
if (record.getSettleAmount() != null) {
sql.VALUES("settle_amount", "#{settleAmount,jdbcType=DECIMAL}");
}
if (record.getLedgerFlag() != null) {
sql.VALUES("ledger_flag", "#{ledgerFlag,jdbcType=BIT}");
}
if (record.getLedgerOrderNo() != null) {
sql.VALUES("ledger_order_no", "#{ledgerOrderNo,jdbcType=VARCHAR}");
}
if (record.getLedgerAmount() != null) {
sql.VALUES("ledger_amount", "#{ledgerAmount,jdbcType=DECIMAL}");
}
if (record.getLedgerStatus() != null) {
sql.VALUES("ledger_status", "#{ledgerStatus,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(BsOrderSettleExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("order_no");
sql.SELECT("settle_mer_no");
sql.SELECT("settle_mer_key");
sql.SELECT("settle_amount");
sql.SELECT("ledger_flag");
sql.SELECT("ledger_order_no");
sql.SELECT("ledger_amount");
sql.SELECT("ledger_status");
sql.SELECT("create_time");
sql.SELECT("update_time");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
sql.FROM("bs_order_settle");
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) {
BsOrderSettle record = (BsOrderSettle) parameter.get("record");
BsOrderSettleExample example = (BsOrderSettleExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("bs_order_settle");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getOrderNo() != null) {
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}");
}
if (record.getSettleMerNo() != null) {
sql.SET("settle_mer_no = #{record.settleMerNo,jdbcType=VARCHAR}");
}
if (record.getSettleMerKey() != null) {
sql.SET("settle_mer_key = #{record.settleMerKey,jdbcType=VARCHAR}");
}
if (record.getSettleAmount() != null) {
sql.SET("settle_amount = #{record.settleAmount,jdbcType=DECIMAL}");
}
if (record.getLedgerFlag() != null) {
sql.SET("ledger_flag = #{record.ledgerFlag,jdbcType=BIT}");
}
if (record.getLedgerOrderNo() != null) {
sql.SET("ledger_order_no = #{record.ledgerOrderNo,jdbcType=VARCHAR}");
}
if (record.getLedgerAmount() != null) {
sql.SET("ledger_amount = #{record.ledgerAmount,jdbcType=DECIMAL}");
}
if (record.getLedgerStatus() != null) {
sql.SET("ledger_status = #{record.ledgerStatus,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_order_settle");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}");
sql.SET("settle_mer_no = #{record.settleMerNo,jdbcType=VARCHAR}");
sql.SET("settle_mer_key = #{record.settleMerKey,jdbcType=VARCHAR}");
sql.SET("settle_amount = #{record.settleAmount,jdbcType=DECIMAL}");
sql.SET("ledger_flag = #{record.ledgerFlag,jdbcType=BIT}");
sql.SET("ledger_order_no = #{record.ledgerOrderNo,jdbcType=VARCHAR}");
sql.SET("ledger_amount = #{record.ledgerAmount,jdbcType=DECIMAL}");
sql.SET("ledger_status = #{record.ledgerStatus,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}");
BsOrderSettleExample example = (BsOrderSettleExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(BsOrderSettle record) {
SQL sql = new SQL();
sql.UPDATE("bs_order_settle");
if (record.getOrderNo() != null) {
sql.SET("order_no = #{orderNo,jdbcType=VARCHAR}");
}
if (record.getSettleMerNo() != null) {
sql.SET("settle_mer_no = #{settleMerNo,jdbcType=VARCHAR}");
}
if (record.getSettleMerKey() != null) {
sql.SET("settle_mer_key = #{settleMerKey,jdbcType=VARCHAR}");
}
if (record.getSettleAmount() != null) {
sql.SET("settle_amount = #{settleAmount,jdbcType=DECIMAL}");
}
if (record.getLedgerFlag() != null) {
sql.SET("ledger_flag = #{ledgerFlag,jdbcType=BIT}");
}
if (record.getLedgerOrderNo() != null) {
sql.SET("ledger_order_no = #{ledgerOrderNo,jdbcType=VARCHAR}");
}
if (record.getLedgerAmount() != null) {
sql.SET("ledger_amount = #{ledgerAmount,jdbcType=DECIMAL}");
}
if (record.getLedgerStatus() != null) {
sql.SET("ledger_status = #{ledgerStatus,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, BsOrderSettleExample 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,265 @@
package com.hfkj.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* bs_order_settle
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class BsOrderSettle implements Serializable {
/**
* 主键ID
*/
private Long id;
/**
* 订单号
*/
private String orderNo;
/**
* 入账商户号
*/
private String settleMerNo;
/**
* 入账商户key
*/
private String settleMerKey;
/**
* 入账金额
*/
private BigDecimal settleAmount;
/**
* 是否分账 0 1
*/
private Boolean ledgerFlag;
/**
* 分账订单号
*/
private String ledgerOrderNo;
/**
* 分账金额
*/
private BigDecimal ledgerAmount;
/**
* 分账状态 0待处理 1已完成 2处理中 3已受理 4失败
*/
private Integer ledgerStatus;
/**
* 创建时间
*/
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 String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public String getSettleMerNo() {
return settleMerNo;
}
public void setSettleMerNo(String settleMerNo) {
this.settleMerNo = settleMerNo;
}
public String getSettleMerKey() {
return settleMerKey;
}
public void setSettleMerKey(String settleMerKey) {
this.settleMerKey = settleMerKey;
}
public BigDecimal getSettleAmount() {
return settleAmount;
}
public void setSettleAmount(BigDecimal settleAmount) {
this.settleAmount = settleAmount;
}
public Boolean getLedgerFlag() {
return ledgerFlag;
}
public void setLedgerFlag(Boolean ledgerFlag) {
this.ledgerFlag = ledgerFlag;
}
public String getLedgerOrderNo() {
return ledgerOrderNo;
}
public void setLedgerOrderNo(String ledgerOrderNo) {
this.ledgerOrderNo = ledgerOrderNo;
}
public BigDecimal getLedgerAmount() {
return ledgerAmount;
}
public void setLedgerAmount(BigDecimal ledgerAmount) {
this.ledgerAmount = ledgerAmount;
}
public Integer getLedgerStatus() {
return ledgerStatus;
}
public void setLedgerStatus(Integer ledgerStatus) {
this.ledgerStatus = ledgerStatus;
}
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;
}
BsOrderSettle other = (BsOrderSettle) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo()))
&& (this.getSettleMerNo() == null ? other.getSettleMerNo() == null : this.getSettleMerNo().equals(other.getSettleMerNo()))
&& (this.getSettleMerKey() == null ? other.getSettleMerKey() == null : this.getSettleMerKey().equals(other.getSettleMerKey()))
&& (this.getSettleAmount() == null ? other.getSettleAmount() == null : this.getSettleAmount().equals(other.getSettleAmount()))
&& (this.getLedgerFlag() == null ? other.getLedgerFlag() == null : this.getLedgerFlag().equals(other.getLedgerFlag()))
&& (this.getLedgerOrderNo() == null ? other.getLedgerOrderNo() == null : this.getLedgerOrderNo().equals(other.getLedgerOrderNo()))
&& (this.getLedgerAmount() == null ? other.getLedgerAmount() == null : this.getLedgerAmount().equals(other.getLedgerAmount()))
&& (this.getLedgerStatus() == null ? other.getLedgerStatus() == null : this.getLedgerStatus().equals(other.getLedgerStatus()))
&& (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 + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode());
result = prime * result + ((getSettleMerNo() == null) ? 0 : getSettleMerNo().hashCode());
result = prime * result + ((getSettleMerKey() == null) ? 0 : getSettleMerKey().hashCode());
result = prime * result + ((getSettleAmount() == null) ? 0 : getSettleAmount().hashCode());
result = prime * result + ((getLedgerFlag() == null) ? 0 : getLedgerFlag().hashCode());
result = prime * result + ((getLedgerOrderNo() == null) ? 0 : getLedgerOrderNo().hashCode());
result = prime * result + ((getLedgerAmount() == null) ? 0 : getLedgerAmount().hashCode());
result = prime * result + ((getLedgerStatus() == null) ? 0 : getLedgerStatus().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(", orderNo=").append(orderNo);
sb.append(", settleMerNo=").append(settleMerNo);
sb.append(", settleMerKey=").append(settleMerKey);
sb.append(", settleAmount=").append(settleAmount);
sb.append(", ledgerFlag=").append(ledgerFlag);
sb.append(", ledgerOrderNo=").append(ledgerOrderNo);
sb.append(", ledgerAmount=").append(ledgerAmount);
sb.append(", ledgerStatus=").append(ledgerStatus);
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,265 @@
package com.hfkj.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* bs_order_settle_ledger
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class BsOrderSettleLedger implements Serializable {
/**
* 主键ID
*/
private Long id;
/**
* 交易入账记录id
*/
private Long orderSettleId;
/**
* 分账比例 单位%
*/
private BigDecimal ratio;
/**
* 分账金额
*/
private BigDecimal sharingAmount;
/**
* 分账接收方账户编号
*/
private String receiverMerNo;
/**
* 分账接收方账户名称
*/
private String receiverMerName;
/**
* 分账接收金额
*/
private BigDecimal receiverAmount;
/**
* 分账状态 0未分账 1已分账
*/
private Integer status;
/**
* 创建时间
*/
private Date createTime;
/**
* 分账时间
*/
private Date profitSharingTime;
/**
* 完成时间
*/
private Date finishTime;
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 getOrderSettleId() {
return orderSettleId;
}
public void setOrderSettleId(Long orderSettleId) {
this.orderSettleId = orderSettleId;
}
public BigDecimal getRatio() {
return ratio;
}
public void setRatio(BigDecimal ratio) {
this.ratio = ratio;
}
public BigDecimal getSharingAmount() {
return sharingAmount;
}
public void setSharingAmount(BigDecimal sharingAmount) {
this.sharingAmount = sharingAmount;
}
public String getReceiverMerNo() {
return receiverMerNo;
}
public void setReceiverMerNo(String receiverMerNo) {
this.receiverMerNo = receiverMerNo;
}
public String getReceiverMerName() {
return receiverMerName;
}
public void setReceiverMerName(String receiverMerName) {
this.receiverMerName = receiverMerName;
}
public BigDecimal getReceiverAmount() {
return receiverAmount;
}
public void setReceiverAmount(BigDecimal receiverAmount) {
this.receiverAmount = receiverAmount;
}
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 getProfitSharingTime() {
return profitSharingTime;
}
public void setProfitSharingTime(Date profitSharingTime) {
this.profitSharingTime = profitSharingTime;
}
public Date getFinishTime() {
return finishTime;
}
public void setFinishTime(Date finishTime) {
this.finishTime = finishTime;
}
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;
}
BsOrderSettleLedger other = (BsOrderSettleLedger) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getOrderSettleId() == null ? other.getOrderSettleId() == null : this.getOrderSettleId().equals(other.getOrderSettleId()))
&& (this.getRatio() == null ? other.getRatio() == null : this.getRatio().equals(other.getRatio()))
&& (this.getSharingAmount() == null ? other.getSharingAmount() == null : this.getSharingAmount().equals(other.getSharingAmount()))
&& (this.getReceiverMerNo() == null ? other.getReceiverMerNo() == null : this.getReceiverMerNo().equals(other.getReceiverMerNo()))
&& (this.getReceiverMerName() == null ? other.getReceiverMerName() == null : this.getReceiverMerName().equals(other.getReceiverMerName()))
&& (this.getReceiverAmount() == null ? other.getReceiverAmount() == null : this.getReceiverAmount().equals(other.getReceiverAmount()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getProfitSharingTime() == null ? other.getProfitSharingTime() == null : this.getProfitSharingTime().equals(other.getProfitSharingTime()))
&& (this.getFinishTime() == null ? other.getFinishTime() == null : this.getFinishTime().equals(other.getFinishTime()))
&& (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 + ((getOrderSettleId() == null) ? 0 : getOrderSettleId().hashCode());
result = prime * result + ((getRatio() == null) ? 0 : getRatio().hashCode());
result = prime * result + ((getSharingAmount() == null) ? 0 : getSharingAmount().hashCode());
result = prime * result + ((getReceiverMerNo() == null) ? 0 : getReceiverMerNo().hashCode());
result = prime * result + ((getReceiverMerName() == null) ? 0 : getReceiverMerName().hashCode());
result = prime * result + ((getReceiverAmount() == null) ? 0 : getReceiverAmount().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getProfitSharingTime() == null) ? 0 : getProfitSharingTime().hashCode());
result = prime * result + ((getFinishTime() == null) ? 0 : getFinishTime().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(", orderSettleId=").append(orderSettleId);
sb.append(", ratio=").append(ratio);
sb.append(", sharingAmount=").append(sharingAmount);
sb.append(", receiverMerNo=").append(receiverMerNo);
sb.append(", receiverMerName=").append(receiverMerName);
sb.append(", receiverAmount=").append(receiverAmount);
sb.append(", status=").append(status);
sb.append(", createTime=").append(createTime);
sb.append(", profitSharingTime=").append(profitSharingTime);
sb.append(", finishTime=").append(finishTime);
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();
}
}

@ -37,7 +37,7 @@ public class HuiPayService {
* @return
* @throws Exception
*/
public static Map<Object, Object> preorder(String merNo,String merKey,String openId,OrderModel order) throws Exception {
public static Map<Object, Object> preorder(String merNo,String merKey,String openId,boolean profitSharing,OrderModel order) throws Exception {
try {
log.info("=============== start 惠支付 start ==================");
Map<String, Object> param = new HashMap<>();
@ -50,8 +50,8 @@ public class HuiPayService {
param.put("payMode", "ALIPAY");
}
param.put("totalAmount", order.getPayRealPrice());
param.put("profitSharing", "0");
param.put("subject", "购买产品");
param.put("profitSharing", profitSharing?1:0);
param.put("subject", "在线加油");
param.put("userId", openId);
param.put("notifyUrl", CommonSysConst.getSysConfig().getHuiPayPreorderNotifyUrl());
param.put("sign", SignatureUtil.createSign(param, merKey));
@ -61,7 +61,6 @@ public class HuiPayService {
JSONObject response = HttpsUtils.doPost(REQUEST_URL + "trade/preorder", param, new HashMap<>());
log.info("响应参数:" + response.toJSONString());
if (response != null && response.getString("return_code").equals("000000")) {
JSONObject payParam = response.getJSONObject("return_data").getJSONObject("payParam");
SortedMap<Object, Object> sortedMap = new TreeMap<>();

@ -37,6 +37,14 @@ public interface BsGasOilGunNoService {
*/
List<BsGasOilGunNo> getOilGunNoList(String merNo);
/**
* 查询油站枪号列表
* @param merNo
* @param oilNo
* @return
*/
List<BsGasOilGunNo> getOilGunNoList(String merNo,String oilNo);
/**
* 查询详情
* @param merNo 商户号

@ -13,6 +13,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* @className: BsGasOilGunNoServiceImpl
@ -72,6 +73,11 @@ public class BsGasOilGunNoServiceImpl implements BsGasOilGunNoService {
return joinCache(merNo);
}
@Override
public List<BsGasOilGunNo> getOilGunNoList(String merNo, String oilNo) {
return getOilGunNoList(merNo).stream().filter(o->o.getOilNo().equals(oilNo)).collect(Collectors.toList());
}
@Override
public BsGasOilGunNo getDetail(String merNo, String oilNo, String gunNo) {
BsGasOilGunNoExample example = new BsGasOilGunNoExample();

@ -54,7 +54,7 @@ public class BsGasOrderServiceImpl implements BsGasOrderService {
BsGasOrderExample example = new BsGasOrderExample();
example.createCriteria().andOrderNoEqualTo(orderNo);
List<BsGasOrder> list = gasOrderMapper.selectByExample(example);
if (list.size() > 0) {
if (!list.isEmpty()) {
return list.get(0);
}
return null;

@ -59,7 +59,6 @@ public class BsGasServiceImpl implements BsGasService {
if (merchant == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油站");
}
// 优惠比例
BigDecimal discount = new BigDecimal("100");
@ -109,26 +108,17 @@ public class BsGasServiceImpl implements BsGasService {
// 平台价
payPriceModel.setPricePlatform(pricePlatform);
// 加油升数,计算方式:加油金额 /
payPriceModel.setOilLiters(refuelPrice.divide(priceGun, 2, BigDecimal.ROUND_HALF_DOWN));
// 加油升数,计算方式:加油金额 / 国标
payPriceModel.setOilLiters(refuelPrice.divide(priceOfficial, 2, BigDecimal.ROUND_HALF_DOWN));
// 平台折扣,我们平台或者代理商设置的折扣
payPriceModel.setDiscount(discount.compareTo(new BigDecimal("1.00")) == 0 ? new BigDecimal("1.00") : discount);
// 加油补贴, 计算方式:加油站枪价 - 加油站VIP价
// payPriceModel.setOilSubsidy(priceGun.subtract(priceVip));
// 折扣,1 -平台折扣
BigDecimal decimal1 = new BigDecimal("1").subtract(discount);
// 油枪价 - 平台补贴
// BigDecimal price = payPriceModel.getPriceGun().subtract(preferentialMargin);
// 优惠价格 油站VIP价 * 系统折扣
payPriceModel.setPricePreferences(priceVip.multiply(discount).setScale(2, BigDecimal.ROUND_HALF_UP));
// 每升优惠 油站价 - 优惠价格
payPriceModel.setLitersPreferences(payPriceModel.getPriceGun().subtract(payPriceModel.getPricePreferences()));
// 每升优惠 国标价 - 优惠价格
payPriceModel.setLitersPreferences(payPriceModel.getPriceOfficial().subtract(payPriceModel.getPricePreferences()));
// 本次优惠 加油升数 * 每升优惠
payPriceModel.setTotalPreferences(payPriceModel.getOilLiters().multiply(payPriceModel.getLitersPreferences()).setScale(2, BigDecimal.ROUND_HALF_UP));
@ -162,7 +152,7 @@ public class BsGasServiceImpl implements BsGasService {
GasOilPriceModel oilNo = new GasOilPriceModel();
BeanUtils.copyProperties(gasOilPrice, oilNo);
// 查询抢号
oilNo.setGasOilGunNo(gasOilGunNoService.getOilGunNoList(merNo));
oilNo.setGasOilGunNo(gasOilGunNoService.getOilGunNoList(merNo, gasOilPrice.getOilNo()));
oilNoModelList.add(oilNo);
}

@ -129,8 +129,8 @@ public class BsDiscountServiceImpl implements BsDiscountService {
BsDiscountExample example = new BsDiscountExample();
BsDiscountExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(DiscountStatusEnum.status0.getCode());
if (StringUtils.isNotBlank(MapUtils.getString(param, ""))) {
criteria.andMerNoEqualTo(MapUtils.getString(param, ""));
if (StringUtils.isNotBlank(MapUtils.getString(param, "merNo"))) {
criteria.andMerNoEqualTo(MapUtils.getString(param, "merNo"));
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "discountName"))) {

@ -82,6 +82,11 @@ public class OrderCreateService {
gasOrder.setMerAddress(merchant.getAddress());
gasOrder.setStatus(OrderOilStatus.STATUS1.getNumber());
gasOrder.setDeductionCouponPrice(new BigDecimal("0"));
gasOrder.setDeductionOilPrice(priceModel.getTotalPreferences());
gasOrder.setPayablePrice(priceModel.getPayPrice());
gasOrder.setTotalDeductionPrice(gasOrder.getDeductionOilPrice().add(gasOrder.getDeductionCouponPrice()));
// 油价信息
gasOrder.setGasRefuelPrice(orderChild.getProductPrice());
gasOrder.setGasOilNo(orderChild.getGasOilNo());
@ -135,7 +140,6 @@ public class OrderCreateService {
orderChild.setProductSpecName("默认");
orderChild.setProductCount(1);
orderChild.setProductActualPrice(gasOrder.getPayablePrice());
orderChild.setProductTotalPrice(new BigDecimal(orderChild.getProductPrice().toString()).multiply(orderChild.getProductPrice()));
return orderChild;
}

@ -61,6 +61,7 @@ public class OrderPaySuccessService {
gasOrder.setTotalDeductionPrice(order.getDeduction().getTotalDeductionPrice());
gasOrder.setDeductionCouponPrice(order.getDeduction().getCouponDiscountPrice());
gasOrder.setPayIntegral(order.getDeduction().getIntegralDiscountPrice());
gasOrder.setActualPayPrice(order.getPayRealPrice());
gasOrder.setPayType(order.getPayType());
gasOrder.setPayTime(order.getPayTime());
gasOrder.setStatus(OrderOilStatus.STATUS2.getNumber());

@ -1,6 +1,5 @@
package com.hfkj.service.order.impl;
import com.hfkj.common.exception.BaseException;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
@ -8,10 +7,7 @@ import com.hfkj.common.utils.DateUtil;
import com.hfkj.common.utils.RandomUtils;
import com.hfkj.common.utils.RedisUtil;
import com.hfkj.dao.BsOrderMapper;
import com.hfkj.entity.BsOrder;
import com.hfkj.entity.BsOrderChild;
import com.hfkj.entity.BsOrderDeduction;
import com.hfkj.entity.BsOrderExample;
import com.hfkj.entity.*;
import com.hfkj.model.order.OrderChildModel;
import com.hfkj.model.order.OrderModel;
import com.hfkj.mqtopic.OrderTopic;
@ -105,6 +101,13 @@ public class BsOrderServiceImpl implements BsOrderService {
order.setOrderNo(DateUtil.date2String(new Date(), "yyMMddHHmmss") + RandomUtils.number(6, false));
editData(order);
/*****初始化优惠*****/
BsOrderDeduction deduction = order.getDeduction()==null?new BsOrderDeduction():order.getDeduction();
deduction.setOrderId(order.getId());
deduction.setOrderNo(order.getOrderNo());
deduction.setIntegralDiscountPrice(deduction.getIntegralDiscountPrice()==null?0L: deduction.getIntegralDiscountPrice());
/*****初始化优惠*****/
// 订单总金额
BigDecimal totalPrice = new BigDecimal("0");
// 商品总金额
@ -117,9 +120,9 @@ public class BsOrderServiceImpl implements BsOrderService {
child.setChildOrderNo(order.getId()+RandomUtils.number(4, false));
// 提交订单前业务处理
if (child.getProductType().equals(OrderChildProductTypeEnum.type1.getCode())) {
child = orderCreateService.oilHandle(order, null, child);
child = orderCreateService.oilHandle(order, deduction, child);
}
child.setProductTotalPrice(child.getProductPrice().multiply(new BigDecimal(child.getProductCount().toString())));
child.setProductTotalPrice(child.getProductActualPrice().multiply(new BigDecimal(child.getProductCount().toString())));
child.setStatus(OrderChildStatusEnum.status1.getCode());
productTotalPrice = productTotalPrice.add(child.getProductTotalPrice());
@ -130,13 +133,9 @@ public class BsOrderServiceImpl implements BsOrderService {
order.setProductTotalPrice(productTotalPrice);
/************ 交易优惠 **************/
BsOrderDeduction deduction = new BsOrderDeduction();
deduction.setOrderId(order.getId());
deduction.setOrderNo(order.getOrderNo());
deduction.setTotalDeductionPrice(new BigDecimal("0"));
deduction.setCouponDiscountPrice(new BigDecimal("0"));
deduction.setCouponDiscountActualPrice(new BigDecimal("0"));
deduction.setIntegralDiscountPrice(0L);
deduction.setTotalDeductionPrice(deduction.getCouponDiscountActualPrice().add(new BigDecimal(deduction.getIntegralDiscountPrice().toString()).divide(new BigDecimal("100"))));
order.setDeduction(deduction);
/* BsOrderDeduction deduction = order.getDeduction()==null?new BsOrderDeduction():order.getDeduction();
deduction.setOrderId(order.getId());
@ -361,7 +360,6 @@ public class BsOrderServiceImpl implements BsOrderService {
childOrder.setStatus(OrderChildStatusEnum.status2.getCode());
orderChildService.editData(childOrder);
}
// 处理业务
orderPaySuccessService.orderBusHandle(order);
}

@ -1,7 +1,7 @@
package com.hfkj.service.sec.impl;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.common.utils.AliyunService;
import com.hfkj.common.alipay.AliyunService;
import com.hfkj.common.utils.RequestUtils;
import com.hfkj.dao.SecUserLoginLogMapper;
import com.hfkj.entity.SecUser;

@ -1,7 +1,7 @@
package com.hfkj.service.user.impl;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.common.utils.AliyunService;
import com.hfkj.common.alipay.AliyunService;
import com.hfkj.common.utils.RequestUtils;
import com.hfkj.dao.BsUserLoginLogMapper;
import com.hfkj.entity.BsUser;

@ -0,0 +1,42 @@
package com.hfkj.sysenum.order;
import lombok.Getter;
/**
* @className: OrderSettleLedgerStatusEnum
* @author: HuRui
* @date: 2024/6/14
**/
@Getter
public enum OrderSettleLedgerStatusEnum {
/**
* 待处理
*/
status0(0, "待处理"),
/**
* 已完成
*/
status1(1, "已完成"),
/**
* 处理中
*/
status2(2, "处理中"),
/**
* 已受理
*/
status3(3, "已受理"),
/**
* 失败
*/
status4(4, "失败"),
;
private final int code;
private final String name;
OrderSettleLedgerStatusEnum(int code, String name) {
this.code = code;
this.name = name;
}
}
Loading…
Cancel
Save