提交代码

dev-discount
胡锐 3 years ago
parent 4a81bfeab2
commit da705b10bd
  1. 136
      hai-bweb/src/main/java/com/bweb/controller/HighGasChannelConfigController.java
  2. 16
      hai-bweb/src/main/java/com/bweb/controller/HighGasController.java
  3. 9
      hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java
  4. 7
      hai-cweb/src/main/java/com/cweb/controller/HighGasController.java
  5. 2
      hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
  6. 104
      hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java
  7. 11
      hai-service/src/main/java/com/hai/config/CommonSysConfig.java
  8. 121
      hai-service/src/main/java/com/hai/config/ShellGroupService.java
  9. 160
      hai-service/src/main/java/com/hai/dao/BsTripartiteReqLogMapper.java
  10. 7
      hai-service/src/main/java/com/hai/dao/BsTripartiteReqLogMapperExt.java
  11. 380
      hai-service/src/main/java/com/hai/dao/BsTripartiteReqLogSqlProvider.java
  12. 142
      hai-service/src/main/java/com/hai/dao/HighGasChannelConfigMapper.java
  13. 7
      hai-service/src/main/java/com/hai/dao/HighGasChannelConfigMapperExt.java
  14. 388
      hai-service/src/main/java/com/hai/dao/HighGasChannelConfigSqlProvider.java
  15. 232
      hai-service/src/main/java/com/hai/entity/BsTripartiteReqLog.java
  16. 953
      hai-service/src/main/java/com/hai/entity/BsTripartiteReqLogExample.java
  17. 297
      hai-service/src/main/java/com/hai/entity/HighGasChannelConfig.java
  18. 1264
      hai-service/src/main/java/com/hai/entity/HighGasChannelConfigExample.java
  19. 46
      hai-service/src/main/java/com/hai/enum_type/GasChannel.java
  20. 42
      hai-service/src/main/java/com/hai/enum_type/GasChannelPayPlatformType.java
  21. 2
      hai-service/src/main/java/com/hai/enum_type/MerchantStoreSourceType.java
  22. 36
      hai-service/src/main/java/com/hai/enum_type/TripartiteReqLogReqType.java
  23. 41
      hai-service/src/main/java/com/hai/enum_type/TripartiteReqLogType.java
  24. 22
      hai-service/src/main/java/com/hai/service/BsTripartiteReqLogService.java
  25. 26
      hai-service/src/main/java/com/hai/service/HighGasChannelConfigService.java
  26. 8
      hai-service/src/main/java/com/hai/service/HighGasOilGunNoService.java
  27. 13
      hai-service/src/main/java/com/hai/service/HighGasService.java
  28. 7
      hai-service/src/main/java/com/hai/service/HighMerchantService.java
  29. 7
      hai-service/src/main/java/com/hai/service/HighMerchantStoreService.java
  30. 36
      hai-service/src/main/java/com/hai/service/impl/BsTripartiteReqLogServiceImpl.java
  31. 48
      hai-service/src/main/java/com/hai/service/impl/HighGasChannelConfigServiceImpl.java
  32. 6
      hai-service/src/main/java/com/hai/service/impl/HighGasDiscountOilPriceServiceImpl.java
  33. 11
      hai-service/src/main/java/com/hai/service/impl/HighGasOilGunNoServiceImpl.java
  34. 232
      hai-service/src/main/java/com/hai/service/impl/HighGasServiceImpl.java
  35. 11
      hai-service/src/main/java/com/hai/service/impl/HighMerchantServiceImpl.java
  36. 20
      hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreServiceImpl.java
  37. 20
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java
  38. 59
      hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java
  39. 7
      hai-service/src/main/resources/dev/commonConfig.properties
  40. 1
      hai-service/src/main/resources/pre/commonConfig.properties
  41. 1
      hai-service/src/main/resources/prod-9401/commonConfig.properties
  42. 1
      hai-service/src/main/resources/prod/commonConfig.properties

@ -0,0 +1,136 @@
package com.bweb.controller;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.pay.util.XmlUtil;
import com.hai.common.pay.util.sdk.WXPayConstants;
import com.hai.common.utils.HttpsUtils;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.common.utils.WxUtils;
import com.hai.entity.HighGasChannelConfig;
import com.hai.entity.HighMerchantTripartitePlatform;
import com.hai.enum_type.GasChannel;
import com.hai.enum_type.GasChannelPayPlatformType;
import com.hai.model.ResponseData;
import com.hai.model.WxSharingReceiversVO;
import com.hai.service.HighGasChannelConfigService;
import com.hai.service.HighMerchantTripartitePlatformService;
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 javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
import java.util.SortedMap;
@Controller
@RequestMapping(value = "/gasChannelConfig")
@Api(value = "加油站渠道商配置")
public class HighGasChannelConfigController {
private static Logger log = LoggerFactory.getLogger(HighGasChannelConfigController.class);
@Resource
private HighGasChannelConfigService gasChannelConfigService;
@RequestMapping(value="/editTripartitePlatform",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "编辑第三方平台")
public ResponseData editTripartitePlatform(@RequestBody JSONObject body) {
try {
if (body == null
|| body.getInteger("channelId") == null
|| body.getInteger("payPlatformType") == null
|| StringUtils.isBlank(body.getString("payPlatformMerName"))
|| StringUtils.isBlank(body.getString("payPlatformMerNo"))
|| body.getBoolean("profitSharingStatus") == null
) {
log.error("HighGasChannelConfigController -> editTripartitePlatform() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
if (body.getBoolean("profitSharingStatus") == true &&
(body.getBigDecimal("profitSharingRatio") == null ||
StringUtils.isBlank(body.getString("profitSharingReceiversNo")) ||
StringUtils.isBlank(body.getString("profitSharingReceiversName")))) {
log.error("HighGasChannelConfigController -> editTripartitePlatform() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 查询平台
HighGasChannelConfig platform = gasChannelConfigService.getConfig(
GasChannel.getChannelByType(body.getInteger("channelId")),
GasChannelPayPlatformType.getPlatformByType(body.getInteger("payPlatformType")));
if (platform == null) {
platform = new HighGasChannelConfig();
}
platform.setChannelId(body.getInteger("channelId"));
platform.setChannelName(GasChannel.getChannelByType(body.getInteger("channelId")).getName());
platform.setPayPlatformType(body.getInteger("payPlatformType"));
platform.setPayPlatformMerName(body.getString("payPlatformMerName"));
platform.setPayPlatformMerNo(body.getString("payPlatformMerNo"));
platform.setProfitSharingStatus(body.getBoolean("profitSharingStatus"));
platform.setProfitSharingRatio(body.getBigDecimal("profitSharingRatio"));
platform.setProfitSharingReceiversNo(body.getString("profitSharingReceiversNo"));
platform.setProfitSharingReceiversName(body.getString("profitSharingReceiversName"));
// 微信平台 增加分账关系
if (platform.getPayPlatformType().equals(1) && platform.getProfitSharingStatus().equals(true)) {
WxSharingReceiversVO receiversVO = new WxSharingReceiversVO();
receiversVO.setAccount(platform.getProfitSharingReceiversNo());
receiversVO.setType("MERCHANT_ID");
receiversVO.setName(platform.getProfitSharingReceiversName());
receiversVO.setRelation_type("SERVICE_PROVIDER");
Map<String , String> map = new HashMap<>();
map.put("mch_id" , "1289663601"); // 服务商
map.put("sub_mch_id" , platform.getPayPlatformMerNo());
map.put("appid" , "wxa075e8509802f826");
map.put("nonce_str" , WxUtils.makeNonStr());
map.put("sign_type" , "HMAC-SHA256");
map.put("receiver" , JSONObject.toJSONString(receiversVO));
String sign = WxUtils.generateSignature(map, "Skufk5oi85wDFGl888i6wsRSTkdd5df5" , WXPayConstants.SignType.HMACSHA256);
map.put("sign" , sign);
String notifyXml = HttpsUtils.postData("https://api.mch.weixin.qq.com/pay/profitsharingaddreceiver", WxUtils.mapToXml(map));
SortedMap<String, String> postData = XmlUtil.parseXmlToTreeMap(notifyXml, "UTF-8");
if (!postData.get("result_code").equals("SUCCESS")) {
log.error("HighMerchantController -> editTripartitePlatform() error!", postData.get("err_code_des"));
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, postData.get("err_code_des"));
}
}
gasChannelConfigService.editConfig(platform);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighGasChannelConfigController -> editTripartitePlatform() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getDetail",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询详情")
public ResponseData getDetail(@RequestParam(value = "channelId" , required = true) Integer channelId,
@RequestParam(value = "payPlatformType" , required = true) Integer payPlatformType,
HttpServletRequest request) {
try {
return ResponseMsgUtil.success(gasChannelConfigService.getConfig(GasChannel.getChannelByType(channelId), GasChannelPayPlatformType.getPlatformByType(payPlatformType)));
} catch (Exception e) {
log.error("HighGasChannelConfigController -> getDetail() error!",e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -14,6 +14,7 @@ import com.hai.common.utils.DateUtil;
import com.hai.common.utils.PageUtil;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.HuiLianTongUnionCardConfig;
import com.hai.config.ShellGroupService;
import com.hai.config.TuanYouConfig;
import com.hai.config.WxOrderConfig;
import com.hai.entity.*;
@ -69,6 +70,9 @@ public class HighGasController {
@Resource
private RedisTemplate redisTemplate;
@Resource
private ShellGroupService shellGroupService;
@RequestMapping(value="/getMerGasStatistical",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "查询商户油站统计")
@ -764,7 +768,7 @@ public class HighGasController {
}
// 来源类型 1:平台自建 2:团油
if (store.getSourceType().equals(1)) {
if (store.getSourceType().equals(MerchantStoreSourceType.type1.getNumber())) {
if (order.getPayType() == 2) {
OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund(order.getPaySerialNo(), order.getPayRealPrice(), order.getAccountMerchantNum(), order.getPayRealPrice());
@ -818,7 +822,7 @@ public class HighGasController {
order.setRefundContent(body.getString("refundContent"));
highOrderService.updateOrderDetail(order);
} else if (store.getSourceType().equals(2)) {
} else if (store.getSourceType().equals(MerchantStoreSourceType.type2.getNumber())) {
JSONObject object = TuanYouConfig.refuelingOrderRefund(order.getMemPhone(), order.getOrderNo(), body.getString("refundContent"));
if (object == null || !object.getString("code").equals("200")) {
log.error("HighOrderController --> refuelingOrderRefund() error!", "提交退款审核失败," + object.getString("message"));
@ -826,6 +830,14 @@ public class HighGasController {
}
order.setOrderStatus(6);
highOrderService.updateOrderDetail(order);
} else if (store.getSourceType().equals(MerchantStoreSourceType.type3.getNumber())) {
JSONObject object = shellGroupService.gasSyncRefund(order.getPayTime(), order.getOrderNo());
if (!object.getString("status").equals("SUCCESS")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "退款失败,原因:" + object.getString("message"));
}
order.setOrderStatus(6);
highOrderService.updateOrderDetail(order);
}
}
return ResponseMsgUtil.success("操作成功");

@ -11,6 +11,7 @@ import com.hai.common.exception.SysCode;
import com.hai.common.security.SessionObject;
import com.hai.common.security.UserCenter;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.CommonSysConst;
import com.hai.entity.BsCompany;
import com.hai.entity.HighMerchant;
import com.hai.entity.HighMerchantStore;
@ -122,6 +123,10 @@ public class HighMerchantStoreController {
highMerchantStore.setBrandName(commonService.getDictionaryCodeName("MERCHANT_STORE_BRANCH", highMerchantStore.getBrandId().toString()));
}
// 加油站没有设置图片的情况,默认设置
if (highMerchantStore.getType().equals(1) && StringUtils.isBlank(highMerchantStore.getStoreLogo())) {
highMerchantStore.setStoreLogo(CommonSysConst.getSysConfig().getGasDefaultOilStationImg());
}
highMerchantStore.setCreateTime(new Date());
highMerchantStore.setUpdateTime(new Date());
highMerchantStore.setStatus(1); // 状态:0:删除,1:正常
@ -233,6 +238,10 @@ public class HighMerchantStoreController {
store.setBrandId(highMerchantStore.getBrandId());
store.setBrandName(commonService.getDictionaryCodeName("MERCHANT_STORE_BRANCH", highMerchantStore.getBrandId().toString()));
}
// 加油站没有设置图片的情况,默认设置
if (highMerchantStore.getType().equals(1) && StringUtils.isBlank(highMerchantStore.getStoreLogo())) {
store.setStoreLogo(CommonSysConst.getSysConfig().getGasDefaultOilStationImg());
}
store.setType(highMerchantStore.getType());
store.setStoreLogo(highMerchantStore.getStoreLogo());
store.setStoreName(highMerchantStore.getStoreName());

@ -15,6 +15,7 @@ import com.hai.config.TuanYouConfig;
import com.hai.dao.HighGasOrderPushMapper;
import com.hai.entity.*;
import com.hai.enum_type.GasOilPriceStatusEnum;
import com.hai.enum_type.MerchantStoreSourceType;
import com.hai.enum_type.OrderPushType;
import com.hai.model.HighMerchantStoreModel;
import com.hai.model.ResponseData;
@ -276,7 +277,7 @@ public class HighGasController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到加油站");
}
// 来源类型 1:平台自建 2:团油
if (store.getSourceType().equals(1)) {
if (store.getSourceType().equals(1) || store.getSourceType().equals(3)) {
Map<String, Object> param = new HashMap<>();
param.put("provinceName", null);
param.put("provinceCode", null);
@ -470,7 +471,7 @@ public class HighGasController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知来源的加油站");
}
// 来源类型 1:平台自建 2:团油
if (store.getSourceType().equals(1)) {
if (store.getSourceType().equals(MerchantStoreSourceType.type1.getNumber()) || store.getSourceType().equals(MerchantStoreSourceType.type3.getNumber())) {
Map<String, Object> param = new HashMap<>();
param.put("provinceName", null);
param.put("provinceCode", null);
@ -560,7 +561,7 @@ public class HighGasController {
return ResponseMsgUtil.success(param);
} else if (store.getSourceType().equals(2)) {
} else if (store.getSourceType().equals(MerchantStoreSourceType.type2.getNumber())) {
JSONObject jsonObject = TuanYouConfig.queryGasInfoByGasId(MapUtils.getString(station, "storeKey"));
if (jsonObject != null && jsonObject.getString("code").equals("200")) {
JSONObject result = jsonObject.getJSONObject("result");

File diff suppressed because one or more lines are too long

@ -19,8 +19,7 @@ import com.hai.common.security.UserCenter;
import com.hai.common.utils.*;
import com.hai.config.*;
import com.hai.entity.*;
import com.hai.enum_type.GoodsType;
import com.hai.enum_type.PayType;
import com.hai.enum_type.*;
import com.hai.model.*;
import com.hai.service.*;
import com.wechat.pay.contrib.apache.httpclient.WechatPayHttpClientBuilder;
@ -87,6 +86,9 @@ public class OrderController {
@Resource
private HighMerchantStoreService merchantStoreService;
@Resource
private HighMerchantAccountService merchantAccountService;
@Resource
private HighMerchantTripartitePlatformService tripartitePlatformService;
@ -111,6 +113,8 @@ public class OrderController {
@Resource
private SecConfigService configService;
@Resource
private HighGasChannelConfigService gasChannelConfigService;
/**
*
* @Title: orderToPay
@ -201,7 +205,7 @@ public class OrderController {
String profitSharing = "N";
BigDecimal profitSharingRatio = new BigDecimal("1");
//微信支付
// 微信支付
String nonce_str = MD5Util.MD5Encode(String.valueOf(ThreadLocalRandom.current().nextInt(10000)), "UTF-8");
int total_fee = MathUtils.objectConvertBigDecimal(map.get("payPrice")).multiply(new BigDecimal("100")).intValue();
WeChatPayReqInfo weChatPayReqInfo = new WeChatPayReqInfo();
@ -217,32 +221,65 @@ public class OrderController {
weChatPayReqInfo.setSub_mch_id(SysConst.getSysConfig().getWxGzSubMchId());//商户号
} else if (order.getHighChildOrderList().get(0).getGoodsType() == 3) {
SecConfig wxMerNumber = configService.findByCodeType("OIL_WX_MER");
if (wxMerNumber == null) {
weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1624126902); // 浩联商户号
} else {
weChatPayReqInfo.setSub_mch_id(wxMerNumber.getCodeValue());
}
profitSharing = "N";
// 查询油站
HighMerchantStoreModel store = merchantStoreService.getMerchantStoreById(order.getHighChildOrderList().get(0).getGoodsId());
if (store != null && store.getSourceType().equals(1)) {
// 预存类型 0:非预存 1:预存门店
if (store.getPrestoreType().equals(0)) {
profitSharing = "N";
// 第三方平台
HighMerchantTripartitePlatform merTripartitePlatform = tripartitePlatformService.getDetail(store.getMerchantId(), 1);
if (merTripartitePlatform != null) {
weChatPayReqInfo.setSub_mch_id(merTripartitePlatform.getPlatformMerNumber());
// 是否分账
profitSharing = merTripartitePlatform.getProfitSharingStatus().equals(true)?"Y":"N";
if (store == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的加油站");
}
if (store.getSourceType().equals(MerchantStoreSourceType.type1.getNumber())) {
// 查询支付配置
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type1,GasChannelPayPlatformType.type1 );
if (gasChannelConfig == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
}
weChatPayReqInfo.setSub_mch_id(gasChannelConfig.getPayPlatformMerNo());
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true)?"Y":"N";
if (store.getSourceType().equals(1)) {
// 预存类型 0:非预存 1:预存门店
if (store.getPrestoreType().equals(0)) {
// 第三方平台
HighMerchantTripartitePlatform merTripartitePlatform = tripartitePlatformService.getDetail(store.getMerchantId(), 1);
if (merTripartitePlatform != null) {
weChatPayReqInfo.setSub_mch_id(merTripartitePlatform.getPlatformMerNumber());
// 是否分账
profitSharing = merTripartitePlatform.getProfitSharingStatus().equals(true)?"Y":"N";
}
}
}
if (store.getPrestoreType().equals(1)) {
profitSharing = "N";
} else if (store.getSourceType().equals(MerchantStoreSourceType.type2.getNumber())) {
// 查询支付配置
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type2,GasChannelPayPlatformType.type1 );
if (gasChannelConfig == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
}
weChatPayReqInfo.setSub_mch_id(gasChannelConfig.getPayPlatformMerNo());
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true)?"Y":"N";
} else if (store.getSourceType().equals(MerchantStoreSourceType.type3.getNumber())) {
// 查询支付配置
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type3,GasChannelPayPlatformType.type1 );
if (gasChannelConfig == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
}
weChatPayReqInfo.setSub_mch_id(gasChannelConfig.getPayPlatformMerNo());
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true)?"Y":"N";
} else if (store.getSourceType().equals(MerchantStoreSourceType.type4.getNumber())) {
// 查询支付配置
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type4,GasChannelPayPlatformType.type1 );
if (gasChannelConfig == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
}
weChatPayReqInfo.setSub_mch_id(gasChannelConfig.getPayPlatformMerNo());
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true)?"Y":"N";
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
}
} else {
//子商户号
@ -360,12 +397,27 @@ public class OrderController {
if (account.getInteger("energyType") == childOrder.getGasOilType()) {
// 支付金额 大于 团油账号余额
if(order.getPayPrice().compareTo(account.getBigDecimal("accountBalance")) == 1){
log.error("OrderController --> orderToPay() ERROR", "无法进行支付,请联系平台客服");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法进行支付,请联系平台客服");
log.error("OrderController --> orderToPay() ERROR", "暂时无法进行支付,请联系平台客服");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "暂时无法进行支付,请联系平台客服");
}
}
}
}
// 来源类型 1:平台自建 2:团油
if (store.getSourceType().equals(MerchantStoreSourceType.type3.getNumber())) {
BigDecimal account = new BigDecimal("0");
// 查询账号余额
HighMerchantAccount merAccount = merchantAccountService.getStoreAccountDetail(store.getMerchantId());
if (merAccount != null) {
account = merAccount.getAmounts().subtract(merchantAccountService.countMerGasOilAmount(store.getMerchantId()));
}
// 客户加油金额 大于 商户账号余额
if(order.getTotalPrice().compareTo(account) == 1) {
log.error("OrderController --> orderToPay() ERROR", "暂时无法进行支付,请联系平台客服");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "暂时无法进行支付,请联系平台客服");
}
}
}
}

@ -12,6 +12,9 @@ public class CommonSysConfig {
// 嗨森逛域名
private String hsgDomainName;
// 加油站默认图片
private String gasDefaultOilStationImg;
private String tuanYouUrl;
private String tuanYouAppKey;
private String tuanYouAppSecret;
@ -585,4 +588,12 @@ public class CommonSysConfig {
public void setCyPostUrl(String cyPostUrl) {
CyPostUrl = cyPostUrl;
}
public String getGasDefaultOilStationImg() {
return gasDefaultOilStationImg;
}
public void setGasDefaultOilStationImg(String gasDefaultOilStationImg) {
this.gasDefaultOilStationImg = gasDefaultOilStationImg;
}
}

@ -8,20 +8,25 @@ import com.hai.common.pay.util.sdk.WXPayConstants;
import com.hai.common.utils.DateUtil;
import com.hai.common.utils.HttpsUtils;
import com.hai.common.utils.MD5Util;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.hai.enum_type.TripartiteReqLogReqType;
import com.hai.enum_type.TripartiteReqLogType;
import com.hai.service.BsTripartiteReqLogService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.util.*;
/**
* 壳牌接口服务
*/
@Component
public class ShellGroupService {
private static Logger log = LoggerFactory.getLogger(ShellGroupService.class);
@Resource
private BsTripartiteReqLogService reqLogService;
/**
* 查询全量加油站
@ -29,12 +34,12 @@ public class ShellGroupService {
* @param pageSize 每页数据量最大值50
* @return
*/
public static JSONObject gasPageQueryAllStation(Integer pageNum,Integer pageSize) throws Exception {
public JSONObject gasPageQueryAllStation(Integer pageNum,Integer pageSize) throws Exception {
Map<String, Object> param = new HashMap<>();
param.put("platMerchantId", CommonSysConst.getSysConfig().getShellPlatMerchantId());
param.put("pageNo", pageNum);
param.put("pageSize", pageSize);
return request("gasPageQueryAllStation", param);
return request(System.currentTimeMillis()+"","gasPageQueryAllStation", param);
}
/**
@ -42,12 +47,12 @@ public class ShellGroupService {
* @param stationCode 油站编码
* @return
*/
public static JSONObject gasStationQueryDetail(String stationCode) {
public JSONObject gasStationQueryDetail(String stationCode) {
try {
Map<String, Object> param = new HashMap<>();
param.put("platMerchantId", CommonSysConst.getSysConfig().getShellPlatMerchantId());
param.put("stationCode", stationCode);
return request("gasPageQueryAllStation", param);
return request(System.currentTimeMillis()+"","gasPageQueryAllStation", param);
} catch (Exception e) {
e.printStackTrace();
}
@ -57,15 +62,22 @@ public class ShellGroupService {
/**
* 同步油站付款
* @param stationCode 油站编码
* @param orderNo 订单号
* @param stationCode 油站编码
* @param finishTime 完成时间
* @param oilPrice 油品金额
* @param oilCode 油品编码
* @param oilGun 油枪
* @param channelSettlementAmount 加油金额
* @return
*/
public static JSONObject gasSyncPayment(String stationCode,
Date finishTime,
BigDecimal amount,
String code,
String oilGun,
BigDecimal channelSettlementAmount) {
public JSONObject gasSyncPayment(String orderNo,
String stationCode,
Date finishTime,
BigDecimal oilPrice,
String oilCode,
String oilGun,
BigDecimal channelSettlementAmount) {
try {
@ -76,12 +88,12 @@ public class ShellGroupService {
param.put("finishTime", DateUtil.date2String(finishTime, "yyyy-MM-dd HH:mm:ss"));
Map<String, Object> tradeOilOrder = new HashMap<>();
tradeOilOrder.put("amount", amount);
tradeOilOrder.put("code", code);
tradeOilOrder.put("amount", oilPrice);
tradeOilOrder.put("code", oilCode);
tradeOilOrder.put("oilGun", oilGun);
tradeOilOrder.put("channelSettlementAmount", channelSettlementAmount);
param.put("tradeOilOrder", tradeOilOrder);
return request("gas_sync_payment_notify", param);
param.put("tradeOilOrder", JSONObject.toJSONString(tradeOilOrder));
return request(orderNo, "gas_sync_payment_notify", param);
} catch (Exception e) {
e.printStackTrace();
}
@ -94,19 +106,13 @@ public class ShellGroupService {
* @param tradeNo 交易流水号
* @return
*/
public static JSONObject gasSyncRefund(Date finishTime,String tradeNo) {
try {
Map<String, Object> param = new HashMap<>();
param.put("platMerchantId", CommonSysConst.getSysConfig().getShellPlatMerchantId());
param.put("finishTime", DateUtil.date2String(finishTime, "yyyy-MM-dd HH:mm:ss"));
param.put("tradeNo", tradeNo);
param.put("sign", MD5Util.encode(generateSignature(param, CommonSysConst.getSysConfig().getShellPlatMerchantKey()).getBytes()));
// 请求接口
return request("gas_sync_refund_notify", param);
} catch (Exception e) {
e.printStackTrace();
}
return null;
public JSONObject gasSyncRefund(Date finishTime,String tradeNo) throws Exception {
Map<String, Object> param = new HashMap<>();
param.put("platMerchantId", CommonSysConst.getSysConfig().getShellPlatMerchantId());
param.put("finishTime", DateUtil.date2String(finishTime, "yyyy-MM-dd HH:mm:ss"));
param.put("tradeNo", tradeNo);
// 请求接口
return request(tradeNo,"gas_sync_refund_notify", param);
}
/**
@ -115,9 +121,9 @@ public class ShellGroupService {
* @return
* @throws Exception
*/
private static JSONObject request(String service,Map<String,Object> map) throws Exception {
private JSONObject request(String logSerialNo, String service, Map<String,Object> map) throws Exception {
Map<String, Object> param = new HashMap<>();
param.put("merchantOrderNo", System.currentTimeMillis());
param.put("merchantOrderNo", logSerialNo);
param.put("partnerId", CommonSysConst.getSysConfig().getShellGroupPartnerId());
param.put("service", service);
param.put("version", "1.0.0");
@ -126,10 +132,19 @@ public class ShellGroupService {
for (Map.Entry<String, Object> entry : map.entrySet()) {
param.put(entry.getKey(), entry.getValue());
}
param.put("sign", MD5Util.encode(generateSignature(param, CommonSysConst.getSysConfig().getShellPlatMerchantKey()).getBytes()));
param.put("sign", MD5Util.encode(generateSignature(param, CommonSysConst.getSysConfig().getShellPlatMerchantKey()).getBytes()).toLowerCase());
// 请求接口
JSONObject object = HttpsUtils.doPost(CommonSysConst.getSysConfig().getShellGroupUrl(), param);
reqLogService.insert(
TripartiteReqLogType.type2,
logSerialNo,
TripartiteReqLogReqType.type1,
CommonSysConst.getSysConfig().getShellGroupUrl(),
this.generateParam(param),
object.toString()
);
if (object == null || !object.getString("status").equals("SUCCESS")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object == null?"请求失败":object.getString("message"));
}
@ -142,21 +157,43 @@ public class ShellGroupService {
* @param key 秘钥app_secret
* @return 加密结果
*/
public static String generateSignature(final Map<String, Object> data, String key){
public static String generateSignature(final Map<String, Object> data, String key) {
Set<String> keySet = data.keySet();
String[] keyArray = keySet.toArray(new String[keySet.size()]);
Arrays.sort(keyArray);
StringBuilder sb = new StringBuilder();
sb.append(key);
for (String k : keyArray) {
if (k.equals(WXPayConstants.FIELD_SIGN)) {
continue;
if (data.get(k) != null) {
if (StringUtils.isBlank(sb.toString())) {
sb.append(k).append("=").append(data.get(k));
} else {
sb.append("&").append(k).append("=").append(data.get(k));
}
}
if (data.get(k) != null) // 参数值为空,则不参与签名
sb.append(k).append(data.get(k));
}
sb.append(key);
return sb.toString();
}
/**
* 生成参数
* @param data 数据
* @return 加密结果
*/
public static String generateParam(final Map<String, Object> data) {
Set<String> keySet = data.keySet();
String[] keyArray = keySet.toArray(new String[keySet.size()]);
StringBuilder sb = new StringBuilder();
for (String k : keyArray) {
if (data.get(k) != null) {
if (StringUtils.isBlank(sb.toString())) {
sb.append(k).append("=").append(data.get(k));
} else {
sb.append("&").append(k).append("=").append(data.get(k));
}
}
}
return sb.toString();
}
}

@ -0,0 +1,160 @@
package com.hai.dao;
import com.hai.entity.BsTripartiteReqLog;
import com.hai.entity.BsTripartiteReqLogExample;
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 BsTripartiteReqLogMapper extends BsTripartiteReqLogMapperExt {
@SelectProvider(type=BsTripartiteReqLogSqlProvider.class, method="countByExample")
long countByExample(BsTripartiteReqLogExample example);
@DeleteProvider(type=BsTripartiteReqLogSqlProvider.class, method="deleteByExample")
int deleteByExample(BsTripartiteReqLogExample example);
@Delete({
"delete from bs_tripartite_req_log",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_tripartite_req_log (log_type, log_type_name, ",
"log_serial_no, request_type, ",
"request_url, request_content, ",
"create_time, ext_1, ",
"ext_2, ext_3, response_content)",
"values (#{logType,jdbcType=INTEGER}, #{logTypeName,jdbcType=VARCHAR}, ",
"#{logSerialNo,jdbcType=VARCHAR}, #{requestType,jdbcType=INTEGER}, ",
"#{requestUrl,jdbcType=VARCHAR}, #{requestContent,jdbcType=VARCHAR}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR}, #{responseContent,jdbcType=LONGVARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsTripartiteReqLog record);
@InsertProvider(type=BsTripartiteReqLogSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(BsTripartiteReqLog record);
@SelectProvider(type=BsTripartiteReqLogSqlProvider.class, method="selectByExampleWithBLOBs")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="log_type", property="logType", jdbcType=JdbcType.INTEGER),
@Result(column="log_type_name", property="logTypeName", jdbcType=JdbcType.VARCHAR),
@Result(column="log_serial_no", property="logSerialNo", jdbcType=JdbcType.VARCHAR),
@Result(column="request_type", property="requestType", jdbcType=JdbcType.INTEGER),
@Result(column="request_url", property="requestUrl", jdbcType=JdbcType.VARCHAR),
@Result(column="request_content", property="requestContent", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", 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),
@Result(column="response_content", property="responseContent", jdbcType=JdbcType.LONGVARCHAR)
})
List<BsTripartiteReqLog> selectByExampleWithBLOBs(BsTripartiteReqLogExample example);
@SelectProvider(type=BsTripartiteReqLogSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="log_type", property="logType", jdbcType=JdbcType.INTEGER),
@Result(column="log_type_name", property="logTypeName", jdbcType=JdbcType.VARCHAR),
@Result(column="log_serial_no", property="logSerialNo", jdbcType=JdbcType.VARCHAR),
@Result(column="request_type", property="requestType", jdbcType=JdbcType.INTEGER),
@Result(column="request_url", property="requestUrl", jdbcType=JdbcType.VARCHAR),
@Result(column="request_content", property="requestContent", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", 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<BsTripartiteReqLog> selectByExample(BsTripartiteReqLogExample example);
@Select({
"select",
"id, log_type, log_type_name, log_serial_no, request_type, request_url, request_content, ",
"create_time, ext_1, ext_2, ext_3, response_content",
"from bs_tripartite_req_log",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="log_type", property="logType", jdbcType=JdbcType.INTEGER),
@Result(column="log_type_name", property="logTypeName", jdbcType=JdbcType.VARCHAR),
@Result(column="log_serial_no", property="logSerialNo", jdbcType=JdbcType.VARCHAR),
@Result(column="request_type", property="requestType", jdbcType=JdbcType.INTEGER),
@Result(column="request_url", property="requestUrl", jdbcType=JdbcType.VARCHAR),
@Result(column="request_content", property="requestContent", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", 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),
@Result(column="response_content", property="responseContent", jdbcType=JdbcType.LONGVARCHAR)
})
BsTripartiteReqLog selectByPrimaryKey(Long id);
@UpdateProvider(type=BsTripartiteReqLogSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") BsTripartiteReqLog record, @Param("example") BsTripartiteReqLogExample example);
@UpdateProvider(type=BsTripartiteReqLogSqlProvider.class, method="updateByExampleWithBLOBs")
int updateByExampleWithBLOBs(@Param("record") BsTripartiteReqLog record, @Param("example") BsTripartiteReqLogExample example);
@UpdateProvider(type=BsTripartiteReqLogSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") BsTripartiteReqLog record, @Param("example") BsTripartiteReqLogExample example);
@UpdateProvider(type=BsTripartiteReqLogSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(BsTripartiteReqLog record);
@Update({
"update bs_tripartite_req_log",
"set log_type = #{logType,jdbcType=INTEGER},",
"log_type_name = #{logTypeName,jdbcType=VARCHAR},",
"log_serial_no = #{logSerialNo,jdbcType=VARCHAR},",
"request_type = #{requestType,jdbcType=INTEGER},",
"request_url = #{requestUrl,jdbcType=VARCHAR},",
"request_content = #{requestContent,jdbcType=VARCHAR},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR},",
"response_content = #{responseContent,jdbcType=LONGVARCHAR}",
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKeyWithBLOBs(BsTripartiteReqLog record);
@Update({
"update bs_tripartite_req_log",
"set log_type = #{logType,jdbcType=INTEGER},",
"log_type_name = #{logTypeName,jdbcType=VARCHAR},",
"log_serial_no = #{logSerialNo,jdbcType=VARCHAR},",
"request_type = #{requestType,jdbcType=INTEGER},",
"request_url = #{requestUrl,jdbcType=VARCHAR},",
"request_content = #{requestContent,jdbcType=VARCHAR},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR}",
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(BsTripartiteReqLog record);
}

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

@ -0,0 +1,380 @@
package com.hai.dao;
import com.hai.entity.BsTripartiteReqLog;
import com.hai.entity.BsTripartiteReqLogExample.Criteria;
import com.hai.entity.BsTripartiteReqLogExample.Criterion;
import com.hai.entity.BsTripartiteReqLogExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class BsTripartiteReqLogSqlProvider {
public String countByExample(BsTripartiteReqLogExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("bs_tripartite_req_log");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(BsTripartiteReqLogExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("bs_tripartite_req_log");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(BsTripartiteReqLog record) {
SQL sql = new SQL();
sql.INSERT_INTO("bs_tripartite_req_log");
if (record.getLogType() != null) {
sql.VALUES("log_type", "#{logType,jdbcType=INTEGER}");
}
if (record.getLogTypeName() != null) {
sql.VALUES("log_type_name", "#{logTypeName,jdbcType=VARCHAR}");
}
if (record.getLogSerialNo() != null) {
sql.VALUES("log_serial_no", "#{logSerialNo,jdbcType=VARCHAR}");
}
if (record.getRequestType() != null) {
sql.VALUES("request_type", "#{requestType,jdbcType=INTEGER}");
}
if (record.getRequestUrl() != null) {
sql.VALUES("request_url", "#{requestUrl,jdbcType=VARCHAR}");
}
if (record.getRequestContent() != null) {
sql.VALUES("request_content", "#{requestContent,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.VALUES("create_time", "#{createTime,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}");
}
if (record.getResponseContent() != null) {
sql.VALUES("response_content", "#{responseContent,jdbcType=LONGVARCHAR}");
}
return sql.toString();
}
public String selectByExampleWithBLOBs(BsTripartiteReqLogExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("log_type");
sql.SELECT("log_type_name");
sql.SELECT("log_serial_no");
sql.SELECT("request_type");
sql.SELECT("request_url");
sql.SELECT("request_content");
sql.SELECT("create_time");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
sql.SELECT("response_content");
sql.FROM("bs_tripartite_req_log");
applyWhere(sql, example, false);
if (example != null && example.getOrderByClause() != null) {
sql.ORDER_BY(example.getOrderByClause());
}
return sql.toString();
}
public String selectByExample(BsTripartiteReqLogExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("log_type");
sql.SELECT("log_type_name");
sql.SELECT("log_serial_no");
sql.SELECT("request_type");
sql.SELECT("request_url");
sql.SELECT("request_content");
sql.SELECT("create_time");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
sql.FROM("bs_tripartite_req_log");
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) {
BsTripartiteReqLog record = (BsTripartiteReqLog) parameter.get("record");
BsTripartiteReqLogExample example = (BsTripartiteReqLogExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("bs_tripartite_req_log");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getLogType() != null) {
sql.SET("log_type = #{record.logType,jdbcType=INTEGER}");
}
if (record.getLogTypeName() != null) {
sql.SET("log_type_name = #{record.logTypeName,jdbcType=VARCHAR}");
}
if (record.getLogSerialNo() != null) {
sql.SET("log_serial_no = #{record.logSerialNo,jdbcType=VARCHAR}");
}
if (record.getRequestType() != null) {
sql.SET("request_type = #{record.requestType,jdbcType=INTEGER}");
}
if (record.getRequestUrl() != null) {
sql.SET("request_url = #{record.requestUrl,jdbcType=VARCHAR}");
}
if (record.getRequestContent() != null) {
sql.SET("request_content = #{record.requestContent,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{record.createTime,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}");
}
if (record.getResponseContent() != null) {
sql.SET("response_content = #{record.responseContent,jdbcType=LONGVARCHAR}");
}
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByExampleWithBLOBs(Map<String, Object> parameter) {
SQL sql = new SQL();
sql.UPDATE("bs_tripartite_req_log");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("log_type = #{record.logType,jdbcType=INTEGER}");
sql.SET("log_type_name = #{record.logTypeName,jdbcType=VARCHAR}");
sql.SET("log_serial_no = #{record.logSerialNo,jdbcType=VARCHAR}");
sql.SET("request_type = #{record.requestType,jdbcType=INTEGER}");
sql.SET("request_url = #{record.requestUrl,jdbcType=VARCHAR}");
sql.SET("request_content = #{record.requestContent,jdbcType=VARCHAR}");
sql.SET("create_time = #{record.createTime,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}");
sql.SET("response_content = #{record.responseContent,jdbcType=LONGVARCHAR}");
BsTripartiteReqLogExample example = (BsTripartiteReqLogExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByExample(Map<String, Object> parameter) {
SQL sql = new SQL();
sql.UPDATE("bs_tripartite_req_log");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("log_type = #{record.logType,jdbcType=INTEGER}");
sql.SET("log_type_name = #{record.logTypeName,jdbcType=VARCHAR}");
sql.SET("log_serial_no = #{record.logSerialNo,jdbcType=VARCHAR}");
sql.SET("request_type = #{record.requestType,jdbcType=INTEGER}");
sql.SET("request_url = #{record.requestUrl,jdbcType=VARCHAR}");
sql.SET("request_content = #{record.requestContent,jdbcType=VARCHAR}");
sql.SET("create_time = #{record.createTime,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}");
BsTripartiteReqLogExample example = (BsTripartiteReqLogExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(BsTripartiteReqLog record) {
SQL sql = new SQL();
sql.UPDATE("bs_tripartite_req_log");
if (record.getLogType() != null) {
sql.SET("log_type = #{logType,jdbcType=INTEGER}");
}
if (record.getLogTypeName() != null) {
sql.SET("log_type_name = #{logTypeName,jdbcType=VARCHAR}");
}
if (record.getLogSerialNo() != null) {
sql.SET("log_serial_no = #{logSerialNo,jdbcType=VARCHAR}");
}
if (record.getRequestType() != null) {
sql.SET("request_type = #{requestType,jdbcType=INTEGER}");
}
if (record.getRequestUrl() != null) {
sql.SET("request_url = #{requestUrl,jdbcType=VARCHAR}");
}
if (record.getRequestContent() != null) {
sql.SET("request_content = #{requestContent,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{createTime,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}");
}
if (record.getResponseContent() != null) {
sql.SET("response_content = #{responseContent,jdbcType=LONGVARCHAR}");
}
sql.WHERE("id = #{id,jdbcType=BIGINT}");
return sql.toString();
}
protected void applyWhere(SQL sql, BsTripartiteReqLogExample 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,142 @@
package com.hai.dao;
import com.hai.entity.HighGasChannelConfig;
import com.hai.entity.HighGasChannelConfigExample;
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 HighGasChannelConfigMapper extends HighGasChannelConfigMapperExt {
@SelectProvider(type=HighGasChannelConfigSqlProvider.class, method="countByExample")
long countByExample(HighGasChannelConfigExample example);
@DeleteProvider(type=HighGasChannelConfigSqlProvider.class, method="deleteByExample")
int deleteByExample(HighGasChannelConfigExample example);
@Delete({
"delete from high_gas_channel_config",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into high_gas_channel_config (channel_id, channel_name, ",
"pay_platform_type, pay_platform_mer_name, ",
"pay_platform_mer_no, profit_sharing_status, ",
"profit_sharing_receivers_no, profit_sharing_ratio, ",
"profit_sharing_receivers_name, `status`, ",
"create_time, update_time, ",
"ext_1, ext_2, ext_3)",
"values (#{channelId,jdbcType=INTEGER}, #{channelName,jdbcType=VARCHAR}, ",
"#{payPlatformType,jdbcType=INTEGER}, #{payPlatformMerName,jdbcType=VARCHAR}, ",
"#{payPlatformMerNo,jdbcType=VARCHAR}, #{profitSharingStatus,jdbcType=BIT}, ",
"#{profitSharingReceiversNo,jdbcType=VARCHAR}, #{profitSharingRatio,jdbcType=DECIMAL}, ",
"#{profitSharingReceiversName,jdbcType=VARCHAR}, #{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(HighGasChannelConfig record);
@InsertProvider(type=HighGasChannelConfigSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(HighGasChannelConfig record);
@SelectProvider(type=HighGasChannelConfigSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="channel_id", property="channelId", jdbcType=JdbcType.INTEGER),
@Result(column="channel_name", property="channelName", jdbcType=JdbcType.VARCHAR),
@Result(column="pay_platform_type", property="payPlatformType", jdbcType=JdbcType.INTEGER),
@Result(column="pay_platform_mer_name", property="payPlatformMerName", jdbcType=JdbcType.VARCHAR),
@Result(column="pay_platform_mer_no", property="payPlatformMerNo", jdbcType=JdbcType.VARCHAR),
@Result(column="profit_sharing_status", property="profitSharingStatus", jdbcType=JdbcType.BIT),
@Result(column="profit_sharing_receivers_no", property="profitSharingReceiversNo", jdbcType=JdbcType.VARCHAR),
@Result(column="profit_sharing_ratio", property="profitSharingRatio", jdbcType=JdbcType.DECIMAL),
@Result(column="profit_sharing_receivers_name", property="profitSharingReceiversName", jdbcType=JdbcType.VARCHAR),
@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<HighGasChannelConfig> selectByExample(HighGasChannelConfigExample example);
@Select({
"select",
"id, channel_id, channel_name, pay_platform_type, pay_platform_mer_name, pay_platform_mer_no, ",
"profit_sharing_status, profit_sharing_receivers_no, profit_sharing_ratio, profit_sharing_receivers_name, ",
"`status`, create_time, update_time, ext_1, ext_2, ext_3",
"from high_gas_channel_config",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="channel_id", property="channelId", jdbcType=JdbcType.INTEGER),
@Result(column="channel_name", property="channelName", jdbcType=JdbcType.VARCHAR),
@Result(column="pay_platform_type", property="payPlatformType", jdbcType=JdbcType.INTEGER),
@Result(column="pay_platform_mer_name", property="payPlatformMerName", jdbcType=JdbcType.VARCHAR),
@Result(column="pay_platform_mer_no", property="payPlatformMerNo", jdbcType=JdbcType.VARCHAR),
@Result(column="profit_sharing_status", property="profitSharingStatus", jdbcType=JdbcType.BIT),
@Result(column="profit_sharing_receivers_no", property="profitSharingReceiversNo", jdbcType=JdbcType.VARCHAR),
@Result(column="profit_sharing_ratio", property="profitSharingRatio", jdbcType=JdbcType.DECIMAL),
@Result(column="profit_sharing_receivers_name", property="profitSharingReceiversName", jdbcType=JdbcType.VARCHAR),
@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)
})
HighGasChannelConfig selectByPrimaryKey(Long id);
@UpdateProvider(type=HighGasChannelConfigSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") HighGasChannelConfig record, @Param("example") HighGasChannelConfigExample example);
@UpdateProvider(type=HighGasChannelConfigSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") HighGasChannelConfig record, @Param("example") HighGasChannelConfigExample example);
@UpdateProvider(type=HighGasChannelConfigSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(HighGasChannelConfig record);
@Update({
"update high_gas_channel_config",
"set channel_id = #{channelId,jdbcType=INTEGER},",
"channel_name = #{channelName,jdbcType=VARCHAR},",
"pay_platform_type = #{payPlatformType,jdbcType=INTEGER},",
"pay_platform_mer_name = #{payPlatformMerName,jdbcType=VARCHAR},",
"pay_platform_mer_no = #{payPlatformMerNo,jdbcType=VARCHAR},",
"profit_sharing_status = #{profitSharingStatus,jdbcType=BIT},",
"profit_sharing_receivers_no = #{profitSharingReceiversNo,jdbcType=VARCHAR},",
"profit_sharing_ratio = #{profitSharingRatio,jdbcType=DECIMAL},",
"profit_sharing_receivers_name = #{profitSharingReceiversName,jdbcType=VARCHAR},",
"`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(HighGasChannelConfig record);
}

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

@ -0,0 +1,388 @@
package com.hai.dao;
import com.hai.entity.HighGasChannelConfig;
import com.hai.entity.HighGasChannelConfigExample.Criteria;
import com.hai.entity.HighGasChannelConfigExample.Criterion;
import com.hai.entity.HighGasChannelConfigExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class HighGasChannelConfigSqlProvider {
public String countByExample(HighGasChannelConfigExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("high_gas_channel_config");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(HighGasChannelConfigExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("high_gas_channel_config");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(HighGasChannelConfig record) {
SQL sql = new SQL();
sql.INSERT_INTO("high_gas_channel_config");
if (record.getChannelId() != null) {
sql.VALUES("channel_id", "#{channelId,jdbcType=INTEGER}");
}
if (record.getChannelName() != null) {
sql.VALUES("channel_name", "#{channelName,jdbcType=VARCHAR}");
}
if (record.getPayPlatformType() != null) {
sql.VALUES("pay_platform_type", "#{payPlatformType,jdbcType=INTEGER}");
}
if (record.getPayPlatformMerName() != null) {
sql.VALUES("pay_platform_mer_name", "#{payPlatformMerName,jdbcType=VARCHAR}");
}
if (record.getPayPlatformMerNo() != null) {
sql.VALUES("pay_platform_mer_no", "#{payPlatformMerNo,jdbcType=VARCHAR}");
}
if (record.getProfitSharingStatus() != null) {
sql.VALUES("profit_sharing_status", "#{profitSharingStatus,jdbcType=BIT}");
}
if (record.getProfitSharingReceiversNo() != null) {
sql.VALUES("profit_sharing_receivers_no", "#{profitSharingReceiversNo,jdbcType=VARCHAR}");
}
if (record.getProfitSharingRatio() != null) {
sql.VALUES("profit_sharing_ratio", "#{profitSharingRatio,jdbcType=DECIMAL}");
}
if (record.getProfitSharingReceiversName() != null) {
sql.VALUES("profit_sharing_receivers_name", "#{profitSharingReceiversName,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.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(HighGasChannelConfigExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("channel_id");
sql.SELECT("channel_name");
sql.SELECT("pay_platform_type");
sql.SELECT("pay_platform_mer_name");
sql.SELECT("pay_platform_mer_no");
sql.SELECT("profit_sharing_status");
sql.SELECT("profit_sharing_receivers_no");
sql.SELECT("profit_sharing_ratio");
sql.SELECT("profit_sharing_receivers_name");
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("high_gas_channel_config");
applyWhere(sql, example, false);
if (example != null && example.getOrderByClause() != null) {
sql.ORDER_BY(example.getOrderByClause());
}
return sql.toString();
}
public String updateByExampleSelective(Map<String, Object> parameter) {
HighGasChannelConfig record = (HighGasChannelConfig) parameter.get("record");
HighGasChannelConfigExample example = (HighGasChannelConfigExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("high_gas_channel_config");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getChannelId() != null) {
sql.SET("channel_id = #{record.channelId,jdbcType=INTEGER}");
}
if (record.getChannelName() != null) {
sql.SET("channel_name = #{record.channelName,jdbcType=VARCHAR}");
}
if (record.getPayPlatformType() != null) {
sql.SET("pay_platform_type = #{record.payPlatformType,jdbcType=INTEGER}");
}
if (record.getPayPlatformMerName() != null) {
sql.SET("pay_platform_mer_name = #{record.payPlatformMerName,jdbcType=VARCHAR}");
}
if (record.getPayPlatformMerNo() != null) {
sql.SET("pay_platform_mer_no = #{record.payPlatformMerNo,jdbcType=VARCHAR}");
}
if (record.getProfitSharingStatus() != null) {
sql.SET("profit_sharing_status = #{record.profitSharingStatus,jdbcType=BIT}");
}
if (record.getProfitSharingReceiversNo() != null) {
sql.SET("profit_sharing_receivers_no = #{record.profitSharingReceiversNo,jdbcType=VARCHAR}");
}
if (record.getProfitSharingRatio() != null) {
sql.SET("profit_sharing_ratio = #{record.profitSharingRatio,jdbcType=DECIMAL}");
}
if (record.getProfitSharingReceiversName() != null) {
sql.SET("profit_sharing_receivers_name = #{record.profitSharingReceiversName,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.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("high_gas_channel_config");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("channel_id = #{record.channelId,jdbcType=INTEGER}");
sql.SET("channel_name = #{record.channelName,jdbcType=VARCHAR}");
sql.SET("pay_platform_type = #{record.payPlatformType,jdbcType=INTEGER}");
sql.SET("pay_platform_mer_name = #{record.payPlatformMerName,jdbcType=VARCHAR}");
sql.SET("pay_platform_mer_no = #{record.payPlatformMerNo,jdbcType=VARCHAR}");
sql.SET("profit_sharing_status = #{record.profitSharingStatus,jdbcType=BIT}");
sql.SET("profit_sharing_receivers_no = #{record.profitSharingReceiversNo,jdbcType=VARCHAR}");
sql.SET("profit_sharing_ratio = #{record.profitSharingRatio,jdbcType=DECIMAL}");
sql.SET("profit_sharing_receivers_name = #{record.profitSharingReceiversName,jdbcType=VARCHAR}");
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}");
HighGasChannelConfigExample example = (HighGasChannelConfigExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(HighGasChannelConfig record) {
SQL sql = new SQL();
sql.UPDATE("high_gas_channel_config");
if (record.getChannelId() != null) {
sql.SET("channel_id = #{channelId,jdbcType=INTEGER}");
}
if (record.getChannelName() != null) {
sql.SET("channel_name = #{channelName,jdbcType=VARCHAR}");
}
if (record.getPayPlatformType() != null) {
sql.SET("pay_platform_type = #{payPlatformType,jdbcType=INTEGER}");
}
if (record.getPayPlatformMerName() != null) {
sql.SET("pay_platform_mer_name = #{payPlatformMerName,jdbcType=VARCHAR}");
}
if (record.getPayPlatformMerNo() != null) {
sql.SET("pay_platform_mer_no = #{payPlatformMerNo,jdbcType=VARCHAR}");
}
if (record.getProfitSharingStatus() != null) {
sql.SET("profit_sharing_status = #{profitSharingStatus,jdbcType=BIT}");
}
if (record.getProfitSharingReceiversNo() != null) {
sql.SET("profit_sharing_receivers_no = #{profitSharingReceiversNo,jdbcType=VARCHAR}");
}
if (record.getProfitSharingRatio() != null) {
sql.SET("profit_sharing_ratio = #{profitSharingRatio,jdbcType=DECIMAL}");
}
if (record.getProfitSharingReceiversName() != null) {
sql.SET("profit_sharing_receivers_name = #{profitSharingReceiversName,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.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, HighGasChannelConfigExample 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,232 @@
package com.hai.entity;
import java.io.Serializable;
import java.util.Date;
/**
* bs_tripartite_req_log
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class BsTripartiteReqLog implements Serializable {
/**
* 主键
*/
private Long id;
/**
* 日志类型
*/
private Integer logType;
/**
* 日志类型名称
*/
private String logTypeName;
/**
* 日志编号
*/
private String logSerialNo;
/**
* 请求类型
*/
private Integer requestType;
/**
* 请求URL
*/
private String requestUrl;
/**
* 请求参数
*/
private String requestContent;
/**
* 创建时间
*/
private Date createTime;
private String ext1;
private String ext2;
private String ext3;
/**
* 响应内容
*/
private String responseContent;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Integer getLogType() {
return logType;
}
public void setLogType(Integer logType) {
this.logType = logType;
}
public String getLogTypeName() {
return logTypeName;
}
public void setLogTypeName(String logTypeName) {
this.logTypeName = logTypeName;
}
public String getLogSerialNo() {
return logSerialNo;
}
public void setLogSerialNo(String logSerialNo) {
this.logSerialNo = logSerialNo;
}
public Integer getRequestType() {
return requestType;
}
public void setRequestType(Integer requestType) {
this.requestType = requestType;
}
public String getRequestUrl() {
return requestUrl;
}
public void setRequestUrl(String requestUrl) {
this.requestUrl = requestUrl;
}
public String getRequestContent() {
return requestContent;
}
public void setRequestContent(String requestContent) {
this.requestContent = requestContent;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
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;
}
public String getResponseContent() {
return responseContent;
}
public void setResponseContent(String responseContent) {
this.responseContent = responseContent;
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
BsTripartiteReqLog other = (BsTripartiteReqLog) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getLogType() == null ? other.getLogType() == null : this.getLogType().equals(other.getLogType()))
&& (this.getLogTypeName() == null ? other.getLogTypeName() == null : this.getLogTypeName().equals(other.getLogTypeName()))
&& (this.getLogSerialNo() == null ? other.getLogSerialNo() == null : this.getLogSerialNo().equals(other.getLogSerialNo()))
&& (this.getRequestType() == null ? other.getRequestType() == null : this.getRequestType().equals(other.getRequestType()))
&& (this.getRequestUrl() == null ? other.getRequestUrl() == null : this.getRequestUrl().equals(other.getRequestUrl()))
&& (this.getRequestContent() == null ? other.getRequestContent() == null : this.getRequestContent().equals(other.getRequestContent()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (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()))
&& (this.getResponseContent() == null ? other.getResponseContent() == null : this.getResponseContent().equals(other.getResponseContent()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getLogType() == null) ? 0 : getLogType().hashCode());
result = prime * result + ((getLogTypeName() == null) ? 0 : getLogTypeName().hashCode());
result = prime * result + ((getLogSerialNo() == null) ? 0 : getLogSerialNo().hashCode());
result = prime * result + ((getRequestType() == null) ? 0 : getRequestType().hashCode());
result = prime * result + ((getRequestUrl() == null) ? 0 : getRequestUrl().hashCode());
result = prime * result + ((getRequestContent() == null) ? 0 : getRequestContent().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().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());
result = prime * result + ((getResponseContent() == null) ? 0 : getResponseContent().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(", logType=").append(logType);
sb.append(", logTypeName=").append(logTypeName);
sb.append(", logSerialNo=").append(logSerialNo);
sb.append(", requestType=").append(requestType);
sb.append(", requestUrl=").append(requestUrl);
sb.append(", requestContent=").append(requestContent);
sb.append(", createTime=").append(createTime);
sb.append(", ext1=").append(ext1);
sb.append(", ext2=").append(ext2);
sb.append(", ext3=").append(ext3);
sb.append(", responseContent=").append(responseContent);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

@ -0,0 +1,953 @@
package com.hai.entity;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class BsTripartiteReqLogExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
private Integer limit;
private Long offset;
public BsTripartiteReqLogExample() {
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 andLogTypeIsNull() {
addCriterion("log_type is null");
return (Criteria) this;
}
public Criteria andLogTypeIsNotNull() {
addCriterion("log_type is not null");
return (Criteria) this;
}
public Criteria andLogTypeEqualTo(Integer value) {
addCriterion("log_type =", value, "logType");
return (Criteria) this;
}
public Criteria andLogTypeNotEqualTo(Integer value) {
addCriterion("log_type <>", value, "logType");
return (Criteria) this;
}
public Criteria andLogTypeGreaterThan(Integer value) {
addCriterion("log_type >", value, "logType");
return (Criteria) this;
}
public Criteria andLogTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("log_type >=", value, "logType");
return (Criteria) this;
}
public Criteria andLogTypeLessThan(Integer value) {
addCriterion("log_type <", value, "logType");
return (Criteria) this;
}
public Criteria andLogTypeLessThanOrEqualTo(Integer value) {
addCriterion("log_type <=", value, "logType");
return (Criteria) this;
}
public Criteria andLogTypeIn(List<Integer> values) {
addCriterion("log_type in", values, "logType");
return (Criteria) this;
}
public Criteria andLogTypeNotIn(List<Integer> values) {
addCriterion("log_type not in", values, "logType");
return (Criteria) this;
}
public Criteria andLogTypeBetween(Integer value1, Integer value2) {
addCriterion("log_type between", value1, value2, "logType");
return (Criteria) this;
}
public Criteria andLogTypeNotBetween(Integer value1, Integer value2) {
addCriterion("log_type not between", value1, value2, "logType");
return (Criteria) this;
}
public Criteria andLogTypeNameIsNull() {
addCriterion("log_type_name is null");
return (Criteria) this;
}
public Criteria andLogTypeNameIsNotNull() {
addCriterion("log_type_name is not null");
return (Criteria) this;
}
public Criteria andLogTypeNameEqualTo(String value) {
addCriterion("log_type_name =", value, "logTypeName");
return (Criteria) this;
}
public Criteria andLogTypeNameNotEqualTo(String value) {
addCriterion("log_type_name <>", value, "logTypeName");
return (Criteria) this;
}
public Criteria andLogTypeNameGreaterThan(String value) {
addCriterion("log_type_name >", value, "logTypeName");
return (Criteria) this;
}
public Criteria andLogTypeNameGreaterThanOrEqualTo(String value) {
addCriterion("log_type_name >=", value, "logTypeName");
return (Criteria) this;
}
public Criteria andLogTypeNameLessThan(String value) {
addCriterion("log_type_name <", value, "logTypeName");
return (Criteria) this;
}
public Criteria andLogTypeNameLessThanOrEqualTo(String value) {
addCriterion("log_type_name <=", value, "logTypeName");
return (Criteria) this;
}
public Criteria andLogTypeNameLike(String value) {
addCriterion("log_type_name like", value, "logTypeName");
return (Criteria) this;
}
public Criteria andLogTypeNameNotLike(String value) {
addCriterion("log_type_name not like", value, "logTypeName");
return (Criteria) this;
}
public Criteria andLogTypeNameIn(List<String> values) {
addCriterion("log_type_name in", values, "logTypeName");
return (Criteria) this;
}
public Criteria andLogTypeNameNotIn(List<String> values) {
addCriterion("log_type_name not in", values, "logTypeName");
return (Criteria) this;
}
public Criteria andLogTypeNameBetween(String value1, String value2) {
addCriterion("log_type_name between", value1, value2, "logTypeName");
return (Criteria) this;
}
public Criteria andLogTypeNameNotBetween(String value1, String value2) {
addCriterion("log_type_name not between", value1, value2, "logTypeName");
return (Criteria) this;
}
public Criteria andLogSerialNoIsNull() {
addCriterion("log_serial_no is null");
return (Criteria) this;
}
public Criteria andLogSerialNoIsNotNull() {
addCriterion("log_serial_no is not null");
return (Criteria) this;
}
public Criteria andLogSerialNoEqualTo(String value) {
addCriterion("log_serial_no =", value, "logSerialNo");
return (Criteria) this;
}
public Criteria andLogSerialNoNotEqualTo(String value) {
addCriterion("log_serial_no <>", value, "logSerialNo");
return (Criteria) this;
}
public Criteria andLogSerialNoGreaterThan(String value) {
addCriterion("log_serial_no >", value, "logSerialNo");
return (Criteria) this;
}
public Criteria andLogSerialNoGreaterThanOrEqualTo(String value) {
addCriterion("log_serial_no >=", value, "logSerialNo");
return (Criteria) this;
}
public Criteria andLogSerialNoLessThan(String value) {
addCriterion("log_serial_no <", value, "logSerialNo");
return (Criteria) this;
}
public Criteria andLogSerialNoLessThanOrEqualTo(String value) {
addCriterion("log_serial_no <=", value, "logSerialNo");
return (Criteria) this;
}
public Criteria andLogSerialNoLike(String value) {
addCriterion("log_serial_no like", value, "logSerialNo");
return (Criteria) this;
}
public Criteria andLogSerialNoNotLike(String value) {
addCriterion("log_serial_no not like", value, "logSerialNo");
return (Criteria) this;
}
public Criteria andLogSerialNoIn(List<String> values) {
addCriterion("log_serial_no in", values, "logSerialNo");
return (Criteria) this;
}
public Criteria andLogSerialNoNotIn(List<String> values) {
addCriterion("log_serial_no not in", values, "logSerialNo");
return (Criteria) this;
}
public Criteria andLogSerialNoBetween(String value1, String value2) {
addCriterion("log_serial_no between", value1, value2, "logSerialNo");
return (Criteria) this;
}
public Criteria andLogSerialNoNotBetween(String value1, String value2) {
addCriterion("log_serial_no not between", value1, value2, "logSerialNo");
return (Criteria) this;
}
public Criteria andRequestTypeIsNull() {
addCriterion("request_type is null");
return (Criteria) this;
}
public Criteria andRequestTypeIsNotNull() {
addCriterion("request_type is not null");
return (Criteria) this;
}
public Criteria andRequestTypeEqualTo(Integer value) {
addCriterion("request_type =", value, "requestType");
return (Criteria) this;
}
public Criteria andRequestTypeNotEqualTo(Integer value) {
addCriterion("request_type <>", value, "requestType");
return (Criteria) this;
}
public Criteria andRequestTypeGreaterThan(Integer value) {
addCriterion("request_type >", value, "requestType");
return (Criteria) this;
}
public Criteria andRequestTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("request_type >=", value, "requestType");
return (Criteria) this;
}
public Criteria andRequestTypeLessThan(Integer value) {
addCriterion("request_type <", value, "requestType");
return (Criteria) this;
}
public Criteria andRequestTypeLessThanOrEqualTo(Integer value) {
addCriterion("request_type <=", value, "requestType");
return (Criteria) this;
}
public Criteria andRequestTypeIn(List<Integer> values) {
addCriterion("request_type in", values, "requestType");
return (Criteria) this;
}
public Criteria andRequestTypeNotIn(List<Integer> values) {
addCriterion("request_type not in", values, "requestType");
return (Criteria) this;
}
public Criteria andRequestTypeBetween(Integer value1, Integer value2) {
addCriterion("request_type between", value1, value2, "requestType");
return (Criteria) this;
}
public Criteria andRequestTypeNotBetween(Integer value1, Integer value2) {
addCriterion("request_type not between", value1, value2, "requestType");
return (Criteria) this;
}
public Criteria andRequestUrlIsNull() {
addCriterion("request_url is null");
return (Criteria) this;
}
public Criteria andRequestUrlIsNotNull() {
addCriterion("request_url is not null");
return (Criteria) this;
}
public Criteria andRequestUrlEqualTo(String value) {
addCriterion("request_url =", value, "requestUrl");
return (Criteria) this;
}
public Criteria andRequestUrlNotEqualTo(String value) {
addCriterion("request_url <>", value, "requestUrl");
return (Criteria) this;
}
public Criteria andRequestUrlGreaterThan(String value) {
addCriterion("request_url >", value, "requestUrl");
return (Criteria) this;
}
public Criteria andRequestUrlGreaterThanOrEqualTo(String value) {
addCriterion("request_url >=", value, "requestUrl");
return (Criteria) this;
}
public Criteria andRequestUrlLessThan(String value) {
addCriterion("request_url <", value, "requestUrl");
return (Criteria) this;
}
public Criteria andRequestUrlLessThanOrEqualTo(String value) {
addCriterion("request_url <=", value, "requestUrl");
return (Criteria) this;
}
public Criteria andRequestUrlLike(String value) {
addCriterion("request_url like", value, "requestUrl");
return (Criteria) this;
}
public Criteria andRequestUrlNotLike(String value) {
addCriterion("request_url not like", value, "requestUrl");
return (Criteria) this;
}
public Criteria andRequestUrlIn(List<String> values) {
addCriterion("request_url in", values, "requestUrl");
return (Criteria) this;
}
public Criteria andRequestUrlNotIn(List<String> values) {
addCriterion("request_url not in", values, "requestUrl");
return (Criteria) this;
}
public Criteria andRequestUrlBetween(String value1, String value2) {
addCriterion("request_url between", value1, value2, "requestUrl");
return (Criteria) this;
}
public Criteria andRequestUrlNotBetween(String value1, String value2) {
addCriterion("request_url not between", value1, value2, "requestUrl");
return (Criteria) this;
}
public Criteria andRequestContentIsNull() {
addCriterion("request_content is null");
return (Criteria) this;
}
public Criteria andRequestContentIsNotNull() {
addCriterion("request_content is not null");
return (Criteria) this;
}
public Criteria andRequestContentEqualTo(String value) {
addCriterion("request_content =", value, "requestContent");
return (Criteria) this;
}
public Criteria andRequestContentNotEqualTo(String value) {
addCriterion("request_content <>", value, "requestContent");
return (Criteria) this;
}
public Criteria andRequestContentGreaterThan(String value) {
addCriterion("request_content >", value, "requestContent");
return (Criteria) this;
}
public Criteria andRequestContentGreaterThanOrEqualTo(String value) {
addCriterion("request_content >=", value, "requestContent");
return (Criteria) this;
}
public Criteria andRequestContentLessThan(String value) {
addCriterion("request_content <", value, "requestContent");
return (Criteria) this;
}
public Criteria andRequestContentLessThanOrEqualTo(String value) {
addCriterion("request_content <=", value, "requestContent");
return (Criteria) this;
}
public Criteria andRequestContentLike(String value) {
addCriterion("request_content like", value, "requestContent");
return (Criteria) this;
}
public Criteria andRequestContentNotLike(String value) {
addCriterion("request_content not like", value, "requestContent");
return (Criteria) this;
}
public Criteria andRequestContentIn(List<String> values) {
addCriterion("request_content in", values, "requestContent");
return (Criteria) this;
}
public Criteria andRequestContentNotIn(List<String> values) {
addCriterion("request_content not in", values, "requestContent");
return (Criteria) this;
}
public Criteria andRequestContentBetween(String value1, String value2) {
addCriterion("request_content between", value1, value2, "requestContent");
return (Criteria) this;
}
public Criteria andRequestContentNotBetween(String value1, String value2) {
addCriterion("request_content not between", value1, value2, "requestContent");
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 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,297 @@
package com.hai.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* high_gas_channel_config
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class HighGasChannelConfig implements Serializable {
/**
* 主键
*/
private Long id;
/**
* 渠道id 1自建站 2团油 3加好油 4金猪加油
*/
private Integer channelId;
/**
* 渠道名称
*/
private String channelName;
/**
* 平台类型 1微信
*/
private Integer payPlatformType;
/**
* 商户名称
*/
private String payPlatformMerName;
/**
* 商户号
*/
private String payPlatformMerNo;
/**
* 是否分账
*/
private Boolean profitSharingStatus;
/**
* 分账接收方账户
*/
private String profitSharingReceiversNo;
/**
* 分账比率
*/
private BigDecimal profitSharingRatio;
/**
* 分账接收方名称
*/
private String profitSharingReceiversName;
/**
* 状态 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 Integer getChannelId() {
return channelId;
}
public void setChannelId(Integer channelId) {
this.channelId = channelId;
}
public String getChannelName() {
return channelName;
}
public void setChannelName(String channelName) {
this.channelName = channelName;
}
public Integer getPayPlatformType() {
return payPlatformType;
}
public void setPayPlatformType(Integer payPlatformType) {
this.payPlatformType = payPlatformType;
}
public String getPayPlatformMerName() {
return payPlatformMerName;
}
public void setPayPlatformMerName(String payPlatformMerName) {
this.payPlatformMerName = payPlatformMerName;
}
public String getPayPlatformMerNo() {
return payPlatformMerNo;
}
public void setPayPlatformMerNo(String payPlatformMerNo) {
this.payPlatformMerNo = payPlatformMerNo;
}
public Boolean getProfitSharingStatus() {
return profitSharingStatus;
}
public void setProfitSharingStatus(Boolean profitSharingStatus) {
this.profitSharingStatus = profitSharingStatus;
}
public String getProfitSharingReceiversNo() {
return profitSharingReceiversNo;
}
public void setProfitSharingReceiversNo(String profitSharingReceiversNo) {
this.profitSharingReceiversNo = profitSharingReceiversNo;
}
public BigDecimal getProfitSharingRatio() {
return profitSharingRatio;
}
public void setProfitSharingRatio(BigDecimal profitSharingRatio) {
this.profitSharingRatio = profitSharingRatio;
}
public String getProfitSharingReceiversName() {
return profitSharingReceiversName;
}
public void setProfitSharingReceiversName(String profitSharingReceiversName) {
this.profitSharingReceiversName = profitSharingReceiversName;
}
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;
}
HighGasChannelConfig other = (HighGasChannelConfig) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getChannelId() == null ? other.getChannelId() == null : this.getChannelId().equals(other.getChannelId()))
&& (this.getChannelName() == null ? other.getChannelName() == null : this.getChannelName().equals(other.getChannelName()))
&& (this.getPayPlatformType() == null ? other.getPayPlatformType() == null : this.getPayPlatformType().equals(other.getPayPlatformType()))
&& (this.getPayPlatformMerName() == null ? other.getPayPlatformMerName() == null : this.getPayPlatformMerName().equals(other.getPayPlatformMerName()))
&& (this.getPayPlatformMerNo() == null ? other.getPayPlatformMerNo() == null : this.getPayPlatformMerNo().equals(other.getPayPlatformMerNo()))
&& (this.getProfitSharingStatus() == null ? other.getProfitSharingStatus() == null : this.getProfitSharingStatus().equals(other.getProfitSharingStatus()))
&& (this.getProfitSharingReceiversNo() == null ? other.getProfitSharingReceiversNo() == null : this.getProfitSharingReceiversNo().equals(other.getProfitSharingReceiversNo()))
&& (this.getProfitSharingRatio() == null ? other.getProfitSharingRatio() == null : this.getProfitSharingRatio().equals(other.getProfitSharingRatio()))
&& (this.getProfitSharingReceiversName() == null ? other.getProfitSharingReceiversName() == null : this.getProfitSharingReceiversName().equals(other.getProfitSharingReceiversName()))
&& (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 + ((getChannelId() == null) ? 0 : getChannelId().hashCode());
result = prime * result + ((getChannelName() == null) ? 0 : getChannelName().hashCode());
result = prime * result + ((getPayPlatformType() == null) ? 0 : getPayPlatformType().hashCode());
result = prime * result + ((getPayPlatformMerName() == null) ? 0 : getPayPlatformMerName().hashCode());
result = prime * result + ((getPayPlatformMerNo() == null) ? 0 : getPayPlatformMerNo().hashCode());
result = prime * result + ((getProfitSharingStatus() == null) ? 0 : getProfitSharingStatus().hashCode());
result = prime * result + ((getProfitSharingReceiversNo() == null) ? 0 : getProfitSharingReceiversNo().hashCode());
result = prime * result + ((getProfitSharingRatio() == null) ? 0 : getProfitSharingRatio().hashCode());
result = prime * result + ((getProfitSharingReceiversName() == null) ? 0 : getProfitSharingReceiversName().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(", channelId=").append(channelId);
sb.append(", channelName=").append(channelName);
sb.append(", payPlatformType=").append(payPlatformType);
sb.append(", payPlatformMerName=").append(payPlatformMerName);
sb.append(", payPlatformMerNo=").append(payPlatformMerNo);
sb.append(", profitSharingStatus=").append(profitSharingStatus);
sb.append(", profitSharingReceiversNo=").append(profitSharingReceiversNo);
sb.append(", profitSharingRatio=").append(profitSharingRatio);
sb.append(", profitSharingReceiversName=").append(profitSharingReceiversName);
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,46 @@
package com.hai.enum_type;
import java.util.Objects;
/**
* 加油站渠道商
*/
public enum GasChannel {
type1(1 , "自建站"),
type2(2 , "团油"),
type3(3 , "加好油"),
type4(4 , "金猪加油"),
;
private Integer type;
private String name;
GasChannel(int type , String name) {
this.type = type;
this.name = name;
}
public static GasChannel getChannelByType(Integer type) {
for (GasChannel ele : values()) {
if(Objects.equals(type,ele.getType())) return ele;
}
return null;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

@ -0,0 +1,42 @@
package com.hai.enum_type;
import java.util.Objects;
/**
* 渠道商支付平台类型
*/
public enum GasChannelPayPlatformType {
type1(1 , "微信"),
;
private Integer type;
private String name;
GasChannelPayPlatformType(int type , String name) {
this.type = type;
this.name = name;
}
public static GasChannelPayPlatformType getPlatformByType(Integer type) {
for (GasChannelPayPlatformType ele : values()) {
if(Objects.equals(type,ele.getType())) return ele;
}
return null;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

@ -7,6 +7,8 @@ package com.hai.enum_type;
public enum MerchantStoreSourceType {
type1(1, "平台自建"),
type2(2, "团油门店"),
type3(3, "加好油"),
type4(4, "金猪加油"),
;
private Integer number;

@ -0,0 +1,36 @@
package com.hai.enum_type;
/**
* 三方日志 - 请求类型
*/
public enum TripartiteReqLogReqType {
type1(1, "请求"),
type2(2, "响应"),
;
private Integer type;
private String name;
TripartiteReqLogReqType(Integer type, String name) {
this.type = type;
this.name = name;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

@ -0,0 +1,41 @@
package com.hai.enum_type;
/**
* 三方日志 - 日志类型
*/
public enum TripartiteReqLogType {
type1(1, "团油"),
type2(2, "壳牌"),
type3(3, "汇联通工会卡"),
type4(4, "贵州中石化"),
type5(5, "千猪肯德基"),
type6(6, "千猪星巴克"),
type7(7, "千猪话费"),
;
private Integer type;
private String name;
TripartiteReqLogType(Integer type,String name) {
this.type = type;
this.name = name;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

@ -0,0 +1,22 @@
package com.hai.service;
import com.hai.enum_type.TripartiteReqLogReqType;
import com.hai.enum_type.TripartiteReqLogType;
/**
* 三方请求日志
*/
public interface BsTripartiteReqLogService {
/**
* 插入日志
* @param logType 日志类型
* @param logSerialNo 日志编号
* @param reqType 请求类型
* @param reqUrl 请求url
* @param reqContent 请求内容
* @param respContent 响应内容
*/
void insert(TripartiteReqLogType logType, String logSerialNo, TripartiteReqLogReqType reqType, String reqUrl, String reqContent, String respContent);
}

@ -0,0 +1,26 @@
package com.hai.service;
import com.hai.entity.HighGasChannelConfig;
import com.hai.enum_type.GasChannel;
import com.hai.enum_type.GasChannelPayPlatformType;
/**
* 加油站 渠道商配置
*/
public interface HighGasChannelConfigService {
/**
* 编辑配置
* @param gasChannelConfig
*/
void editConfig(HighGasChannelConfig gasChannelConfig);
/**
* 查询配置
* @param channelId 渠道id
* @param payPlatformType 支付平台类型
* @return
*/
HighGasChannelConfig getConfig(GasChannel channelId, GasChannelPayPlatformType payPlatformType);
}

@ -22,6 +22,14 @@ public interface HighGasOilGunNoService {
*/
HighGasOilGunNo getGunNoById(Long id);
/**
* 根据门店和抢号查询
* @param storeId
* @param gunNo
* @return
*/
HighGasOilGunNo getDetailByStoreAndGunNo(Long storeId, Integer gunNo);
/**
* 查询抢号列表
* @param oilPriceId

@ -0,0 +1,13 @@
package com.hai.service;
/**
* 加油站服务
*/
public interface HighGasService {
/**
* 获取渠道商加好油全量加油站
*/
void getJiaHaoYouAllStation() throws Exception;
}

@ -46,6 +46,13 @@ public interface HighMerchantService {
*/
HighMerchant getDetailById(Long id);
/**
* 根据key 查询
* @param key
* @return
*/
HighMerchantModel getDetailByKey(String key);
/**
* 查询列表
* @param map

@ -63,6 +63,13 @@ public interface HighMerchantStoreService {
*/
HighMerchantStoreModel getMerchantStoreByKey(String storeKey);
/**
*
* @param storeKey
* @return
*/
HighMerchantStore getMerStoreDetailByKey(String storeKey);
/**
* 根据查询
* @param id

@ -0,0 +1,36 @@
package com.hai.service.impl;
import com.hai.dao.BsTripartiteReqLogMapper;
import com.hai.entity.BsTripartiteReqLog;
import com.hai.enum_type.TripartiteReqLogReqType;
import com.hai.enum_type.TripartiteReqLogType;
import com.hai.service.BsTripartiteReqLogService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
@Service("tripartiteReqLogService")
public class BsTripartiteReqLogServiceImpl implements BsTripartiteReqLogService {
@Resource
private BsTripartiteReqLogMapper tripartiteReqLogMapper;
@Override
@Transactional(propagation = Propagation.NOT_SUPPORTED, isolation = Isolation.READ_UNCOMMITTED)
public void insert(TripartiteReqLogType logType, String logSerialNo, TripartiteReqLogReqType reqType, String reqUrl, String reqContent, String respContent) {
BsTripartiteReqLog log = new BsTripartiteReqLog();
log.setLogType(logType.getType());
log.setLogTypeName(logType.getName());
log.setLogSerialNo(logSerialNo);
log.setRequestType(reqType.getType());
log.setRequestUrl(reqUrl);
log.setRequestContent(reqContent);
log.setResponseContent(respContent);
log.setCreateTime(new Date());
tripartiteReqLogMapper.insert(log);
}
}

@ -0,0 +1,48 @@
package com.hai.service.impl;
import com.hai.dao.HighGasChannelConfigMapper;
import com.hai.entity.HighGasChannelConfig;
import com.hai.entity.HighGasChannelConfigExample;
import com.hai.enum_type.GasChannel;
import com.hai.enum_type.GasChannelPayPlatformType;
import com.hai.service.HighGasChannelConfigService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
@Service("gasChannelConfigService")
public class HighGasChannelConfigServiceImpl implements HighGasChannelConfigService {
@Resource
private HighGasChannelConfigMapper gasChannelConfigMapper;
@Override
public void editConfig(HighGasChannelConfig gasChannelConfig) {
if (gasChannelConfig.getId() == null) {
gasChannelConfig.setStatus(1);
gasChannelConfig.setCreateTime(new Date());
gasChannelConfig.setUpdateTime(new Date());
gasChannelConfigMapper.insert(gasChannelConfig);
} else {
gasChannelConfig.setUpdateTime(new Date());
gasChannelConfigMapper.updateByPrimaryKey(gasChannelConfig);
}
}
@Override
public HighGasChannelConfig getConfig(GasChannel channelId, GasChannelPayPlatformType payPlatformType) {
HighGasChannelConfigExample example = new HighGasChannelConfigExample();
example.createCriteria()
.andChannelIdEqualTo(channelId.getType())
.andPayPlatformTypeEqualTo(payPlatformType.getType())
.andStatusEqualTo(1);
List<HighGasChannelConfig> list = gasChannelConfigMapper.selectByExample(example);
if (list.size() > 0) {
return list.get(0);
}
return null;
}
}

@ -11,6 +11,7 @@ import com.hai.entity.HighGasDiscountOilPrice;
import com.hai.entity.HighGasDiscountOilPriceExample;
import com.hai.entity.HighGasOilPrice;
import com.hai.entity.HighTyAgentPrice;
import com.hai.enum_type.MerchantStoreSourceType;
import com.hai.model.GasPayPriceModel;
import com.hai.model.HighMerchantStoreModel;
import com.hai.service.*;
@ -154,7 +155,8 @@ public class HighGasDiscountOilPriceServiceImpl implements HighGasDiscountOilPri
GasPayPriceModel payPriceModel = new GasPayPriceModel();
// 1:平台自建 2:团油 3: 壳牌
if (store.getSourceType().equals(1)) {
if (store.getSourceType().equals(MerchantStoreSourceType.type1.getNumber())
|| store.getSourceType().equals(MerchantStoreSourceType.type3.getNumber())) {
// 嗨森逛平台价 国标价 * 折扣
BigDecimal pricePlatform = priceGun.multiply(discount).setScale(2, BigDecimal.ROUND_HALF_UP);
@ -207,7 +209,7 @@ public class HighGasDiscountOilPriceServiceImpl implements HighGasDiscountOilPri
// 支付价格 加油金额 - 本次优惠
payPriceModel.setPayPrice(oilingPrice.subtract(payPriceModel.getTotalPreferences()));
} else if (store.getSourceType().equals(2)) {
} else if (store.getSourceType().equals(MerchantStoreSourceType.type2.getNumber())) {
// 查询油站油品价格
JSONObject oilPriceObject = TuanYouConfig.queryCompanyPriceDetail(store.getStoreKey(), oilNo);
if (oilPriceObject == null) {

@ -32,6 +32,17 @@ public class HighGasOilGunNoServiceImpl implements HighGasOilGunNoService {
return gasOilGunNoMapper.selectByPrimaryKey(id);
}
@Override
public HighGasOilGunNo getDetailByStoreAndGunNo(Long storeId, Integer gunNo) {
HighGasOilGunNoExample example = new HighGasOilGunNoExample();
example.createCriteria().andStoreIdEqualTo(storeId).andGunNoEqualTo(gunNo).andStatusEqualTo(1);
List<HighGasOilGunNo> list = gasOilGunNoMapper.selectByExample(example);
if (list.size() > 0) {
return list.get(0);
}
return null;
}
@Override
public List<HighGasOilGunNo> getGunNoListByOilPrice(Long oilPriceId) {
HighGasOilGunNoExample example = new HighGasOilGunNoExample();

@ -0,0 +1,232 @@
package com.hai.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hai.config.CommonSysConst;
import com.hai.config.ShellGroupService;
import com.hai.entity.HighGasOilGunNo;
import com.hai.entity.HighGasOilPrice;
import com.hai.entity.HighMerchantStore;
import com.hai.enum_type.MerchantStoreSourceType;
import com.hai.model.HighMerchantModel;
import com.hai.model.HighMerchantStoreModel;
import com.hai.service.*;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Date;
@Service("gasService")
public class HighGasServiceImpl implements HighGasService {
@Resource
private ShellGroupService shellGroupService;
@Resource
private HighMerchantService highMerchantService;
@Resource
private HighMerchantStoreService highMerchantStoreService;
@Resource
private HighGasOilPriceService highGasOilPriceService;
@Resource
private HighGasOilGunNoService gasOilGunNoService;
@Override
public void getJiaHaoYouAllStation() throws Exception {
HighMerchantModel merchant = highMerchantService.getDetailByKey("HF0801103821");
JSONObject pObject = shellGroupService.gasPageQueryAllStation(1, 50);
JSONObject pageInfo = JSON.parseObject(pObject.getString("pageInfo"), JSONObject.class);
// 总页数
Integer totalPageNo = pageInfo.getBigDecimal("totalCount").divide(pageInfo.getBigDecimal("pageSize"),0, BigDecimal.ROUND_CEILING).intValue();
for (int pageNum = 1; pageNum <= totalPageNo; pageNum++) {
// 查询加油站列表
JSONObject respObject = shellGroupService.gasPageQueryAllStation(pageNum, 50);
JSONArray stationArray = JSONObject.parseObject(respObject.getString("infoList"), JSONArray.class);
for (Object stationObject : stationArray) {
JSONObject station = (JSONObject) stationObject;
// 查询油站
HighMerchantStore store = highMerchantStoreService.getMerStoreDetailByKey(station.getString("stationCode"));
if (store != null) {
store.setPrestoreType(0);
store.setMerchantId(merchant.getId());
store.setCompanyId(merchant.getCompanyId());
store.setStoreKey(station.getString("stationCode"));
store.setStoreName(station.getString("stationName"));
store.setStoreLogo(CommonSysConst.getSysConfig().getGasDefaultOilStationImg());
store.setRegionId(station.getLong("provinceId"));
store.setRegionName(station.getString("provinceName"));
store.setAddress(station.getString("stationAddress"));
store.setLongitude(station.getString("longitude"));
store.setLatitude(station.getString("latitude"));
store.setStatus(station.getString("status").equals("ABLE")?1:2);
store.setOperatorId(0L);
store.setOperatorName("系统创建");
store.setUpdateTime(new Date());
highMerchantStoreService.updateMerchantStoreDetail(store);
JSONArray oilPriceList = station.getJSONArray("oilPriceList");
for (Object oilPrice : oilPriceList) {
JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice));
// 查询门店油号
HighGasOilPrice highGasOilPrice = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(store.getId(), oilPriceObject.getInteger("goodsCode"));
if (highGasOilPrice == null) {
highGasOilPrice = new HighGasOilPrice();
highGasOilPrice.setMerchantStoreId(store.getId());
highGasOilPrice.setOilNo(oilPriceObject.getInteger("goodsCode"));
highGasOilPrice.setOilNoName(oilPriceObject.getString("goodsCode") + "#");
highGasOilPrice.setGasStationDrop(oilPriceObject.getJSONObject("listedPrice").getBigDecimal("amount").subtract(oilPriceObject.getJSONObject("goodsPrice").getBigDecimal("amount")));
highGasOilPrice.setPriceVip(oilPriceObject.getJSONObject("goodsPrice").getBigDecimal("amount"));
highGasOilPrice.setPriceGun(oilPriceObject.getJSONObject("goodsPrice").getBigDecimal("amount"));
highGasOilPrice.setPriceOfficial(oilPriceObject.getJSONObject("listedPrice").getBigDecimal("amount"));
// 油品类型 1:汽油:2:柴油;3:天然气
if (oilPriceObject.getString("goodsGroupType").equals("GASOLINE")) {
highGasOilPrice.setOilType(1);
highGasOilPrice.setOilTypeName("汽油");
} else if (oilPriceObject.getString("goodsGroupType").equals("DIESEL_OIL")) {
highGasOilPrice.setOilType(2);
highGasOilPrice.setOilTypeName("柴油");
} else if (oilPriceObject.getString("goodsGroupType").equals("NATURAL_GAS")) {
highGasOilPrice.setOilType(3);
highGasOilPrice.setOilTypeName("天然气");
}
highGasOilPriceService.editGasOilPrice(highGasOilPrice);
JSONArray oilGunNoList = oilPriceObject.getJSONArray("oilGunNoList");
for (Object o : oilGunNoList) {
HighGasOilGunNo gasOilGunNo = gasOilGunNoService.getDetailByStoreAndGunNo(highGasOilPrice.getMerchantStoreId(), Integer.parseInt(o.toString()));
if (gasOilGunNo == null) {
gasOilGunNo = new HighGasOilGunNo();
gasOilGunNo.setGasOilPriceId(highGasOilPrice.getId());
gasOilGunNo.setStoreId(highGasOilPrice.getMerchantStoreId());
gasOilGunNo.setOilNo(highGasOilPrice.getOilNo());
gasOilGunNo.setOilNoName(highGasOilPrice.getOilNoName());
gasOilGunNo.setOilType(highGasOilPrice.getOilType());
gasOilGunNo.setOilTypeName(highGasOilPrice.getOilTypeName());
gasOilGunNo.setGunNo(Integer.parseInt(o.toString()));
gasOilGunNo.setStatus(1);
gasOilGunNoService.editGunNo(gasOilGunNo);
}
}
} else {
highGasOilPrice.setMerchantStoreId(store.getId());
highGasOilPrice.setOilNo(oilPriceObject.getInteger("goodsCode"));
highGasOilPrice.setOilNoName(oilPriceObject.getString("goodsCode") + "#");
highGasOilPrice.setGasStationDrop(oilPriceObject.getJSONObject("listedPrice").getBigDecimal("amount").subtract(oilPriceObject.getJSONObject("goodsPrice").getBigDecimal("amount")));
highGasOilPrice.setPriceVip(oilPriceObject.getJSONObject("goodsPrice").getBigDecimal("amount"));
highGasOilPrice.setPriceGun(oilPriceObject.getJSONObject("goodsPrice").getBigDecimal("amount"));
highGasOilPrice.setPriceOfficial(oilPriceObject.getJSONObject("listedPrice").getBigDecimal("amount"));
// 油品类型 1:汽油:2:柴油;3:天然气
if (oilPriceObject.getString("goodsGroupType").equals("GASOLINE")) {
highGasOilPrice.setOilType(1);
highGasOilPrice.setOilTypeName("汽油");
} else if (oilPriceObject.getString("goodsGroupType").equals("DIESEL_OIL")) {
highGasOilPrice.setOilType(2);
highGasOilPrice.setOilTypeName("柴油");
} else if (oilPriceObject.getString("goodsGroupType").equals("NATURAL_GAS")) {
highGasOilPrice.setOilType(3);
highGasOilPrice.setOilTypeName("天然气");
}
highGasOilPriceService.editGasOilPrice(highGasOilPrice);
JSONArray oilGunNoList = oilPriceObject.getJSONArray("oilGunNoList");
for (Object o : oilGunNoList) {
HighGasOilGunNo gasOilGunNo = gasOilGunNoService.getDetailByStoreAndGunNo(highGasOilPrice.getMerchantStoreId(), Integer.parseInt(o.toString()));
if (gasOilGunNo == null) {
gasOilGunNo = new HighGasOilGunNo();
gasOilGunNo.setGasOilPriceId(highGasOilPrice.getId());
gasOilGunNo.setStoreId(highGasOilPrice.getMerchantStoreId());
gasOilGunNo.setOilNo(highGasOilPrice.getOilNo());
gasOilGunNo.setOilNoName(highGasOilPrice.getOilNoName());
gasOilGunNo.setOilType(highGasOilPrice.getOilType());
gasOilGunNo.setOilTypeName(highGasOilPrice.getOilTypeName());
gasOilGunNo.setGunNo(Integer.parseInt(o.toString()));
gasOilGunNo.setStatus(1);
gasOilGunNoService.editGunNo(gasOilGunNo);
}
}
}
}
} else {
store = new HighMerchantStore();
store.setPrestoreType(0);
store.setType(1);
store.setSourceType(MerchantStoreSourceType.type3.getNumber());
store.setMerchantId(merchant.getId());
store.setCompanyId(merchant.getCompanyId());
store.setStoreKey(station.getString("stationCode"));
store.setStoreName(station.getString("stationName"));
store.setStoreLogo(CommonSysConst.getSysConfig().getGasDefaultOilStationImg());
store.setRegionId(station.getLong("provinceId"));
store.setRegionName(station.getString("provinceName"));
store.setAddress(station.getString("stationAddress"));
store.setLongitude(station.getString("longitude"));
store.setLatitude(station.getString("latitude"));
store.setStatus(station.getString("status").equals("ABLE")?1:2);
store.setOperatorId(0L);
store.setOperatorName("系统创建");
store.setCreateTime(new Date());
store.setUpdateTime(new Date());
HighMerchantStoreModel merchantStoreModel = new HighMerchantStoreModel();
BeanUtils.copyProperties(store, merchantStoreModel);
highMerchantStoreService.insertMerchantStore(merchantStoreModel);
JSONArray oilPriceList = station.getJSONArray("oilPriceList");
for (Object oilPrice : oilPriceList) {
JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice));
HighGasOilPrice highGasOilPrice = new HighGasOilPrice();
highGasOilPrice.setMerchantStoreId(merchantStoreModel.getId());
highGasOilPrice.setOilNo(oilPriceObject.getInteger("goodsCode"));
highGasOilPrice.setOilNoName(oilPriceObject.getString("goodsCode") + "#");
highGasOilPrice.setPreferentialMargin(new BigDecimal("0"));
highGasOilPrice.setGasStationDrop(oilPriceObject.getJSONObject("listedPrice").getBigDecimal("amount").subtract(oilPriceObject.getJSONObject("goodsPrice").getBigDecimal("amount")));
highGasOilPrice.setPriceVip(oilPriceObject.getJSONObject("goodsPrice").getBigDecimal("amount"));
highGasOilPrice.setPriceGun(oilPriceObject.getJSONObject("goodsPrice").getBigDecimal("amount"));
highGasOilPrice.setPriceOfficial(oilPriceObject.getJSONObject("listedPrice").getBigDecimal("amount"));
// 油品类型 1:汽油:2:柴油;3:天然气
if (oilPriceObject.getString("goodsGroupType").equals("GASOLINE")) {
highGasOilPrice.setOilType(1);
highGasOilPrice.setOilTypeName("汽油");
} else if (oilPriceObject.getString("goodsGroupType").equals("DIESEL_OIL")) {
highGasOilPrice.setOilType(2);
highGasOilPrice.setOilTypeName("柴油");
} else if (oilPriceObject.getString("goodsGroupType").equals("NATURAL_GAS")) {
highGasOilPrice.setOilType(3);
highGasOilPrice.setOilTypeName("天然气");
}
highGasOilPriceService.editGasOilPrice(highGasOilPrice);
JSONArray oilGunNoList = oilPriceObject.getJSONArray("oilGunNoList");
for (Object o : oilGunNoList) {
HighGasOilGunNo gasOilGunNo = new HighGasOilGunNo();
gasOilGunNo.setGasOilPriceId(highGasOilPrice.getId());
gasOilGunNo.setStoreId(highGasOilPrice.getMerchantStoreId());
gasOilGunNo.setOilNo(highGasOilPrice.getOilNo());
gasOilGunNo.setOilNoName(highGasOilPrice.getOilNoName());
gasOilGunNo.setOilType(highGasOilPrice.getOilType());
gasOilGunNo.setOilTypeName(highGasOilPrice.getOilTypeName());
gasOilGunNo.setGunNo(Integer.parseInt(o.toString()));
gasOilGunNo.setStatus(1);
gasOilGunNoService.editGunNo(gasOilGunNo);
}
}
}
}
}
}
}

@ -99,6 +99,17 @@ public class HighMerchantServiceImpl implements HighMerchantService {
return highMerchantMapper.selectByPrimaryKey(id);
}
@Override
public HighMerchantModel getDetailByKey(String key) {
HighMerchantExample example = new HighMerchantExample();
example.createCriteria().andMerchantKeyEqualTo(key).andStatusEqualTo(1);
List<HighMerchant> list = highMerchantMapper.selectByExample(example);
if (list.size() > 0) {
return getMerchantById(list.get(0).getId());
}
return null;
}
@Override
public List<HighMerchant> getMerchantList(Map<String, Object> map) {
HighMerchantExample example = new HighMerchantExample();

@ -45,10 +45,11 @@ public class HighMerchantStoreServiceImpl implements HighMerchantStoreService {
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void insertMerchantStore(HighMerchantStoreModel highMerchantStore) throws Exception {
highMerchantStoreMapper.insert(highMerchantStore);
Long storeKey = 11000000 + highMerchantStore.getId();
highMerchantStore.setStoreKey(storeKey.toString());
highMerchantStoreMapper.updateByPrimaryKey(highMerchantStore);
if (StringUtils.isBlank(highMerchantStore.getStoreKey())) {
Long storeKey = 11000000 + highMerchantStore.getId();
highMerchantStore.setStoreKey(storeKey.toString());
highMerchantStoreMapper.updateByPrimaryKey(highMerchantStore);
}
highMerchantStore.setSecUser(new SecUser());
highMerchantStore.getSecUser().setUserName(highMerchantStore.getStoreName());
highMerchantStore.getSecUser().setLoginName(highMerchantStore.getStoreKey());
@ -165,6 +166,17 @@ public class HighMerchantStoreServiceImpl implements HighMerchantStoreService {
return null;
}
@Override
public HighMerchantStore getMerStoreDetailByKey(String storeKey) {
HighMerchantStoreExample example = new HighMerchantStoreExample();
example.createCriteria().andStoreKeyEqualTo(storeKey);
List<HighMerchantStore> list = highMerchantStoreMapper.selectByExample(example);
if (list.size() > 0) {
return list.get(0);
}
return null;
}
@Override
public HighMerchantStore getDetailById(Long id) {
return highMerchantStoreMapper.selectByPrimaryKey(id);

@ -79,7 +79,6 @@ public class HighOrderServiceImpl implements HighOrderService {
@Resource
private ApiProductService apiProductService;
@Resource
private HighCouponService highCouponService;
@ -149,7 +148,6 @@ public class HighOrderServiceImpl implements HighOrderService {
@Resource
private MqttProviderConfig mqttProviderConfig;
@Resource
private BaiduVoiceService baiduVoiceService;
@ -162,10 +160,12 @@ public class HighOrderServiceImpl implements HighOrderService {
@Resource
private ApiOrderRecordService apiOrderRecordService;
@Resource
private ApiMemberProductService apiMemberProductService;
@Resource
private ShellGroupService shellGroupService;
@Override
@Transactional(
isolation = Isolation.SERIALIZABLE,
@ -408,7 +408,7 @@ public class HighOrderServiceImpl implements HighOrderService {
HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreById(highChildOrder.getGoodsId());
// 来源类型 1:平台自建 2:团油
if (store.getSourceType().equals(1)) {
if (store.getSourceType().equals(MerchantStoreSourceType.type1.getNumber())) {
// 预存类型 0:非预存 1:预存门店
if (store.getPrestoreType() != null && store.getPrestoreType().equals(1)) {
@ -424,7 +424,7 @@ public class HighOrderServiceImpl implements HighOrderService {
// 扣预存款
this.redisTemplate.boundListOps(MsgTopic.MerStoreAccount.getName()).leftPush(pushParam);
}
} else if (store.getSourceType().equals(2)) {
} else if (store.getSourceType().equals(MerchantStoreSourceType.type2.getNumber())) {
// 推送团油订单
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("gasId", store.getStoreKey());
@ -458,6 +458,16 @@ public class HighOrderServiceImpl implements HighOrderService {
if (orderPushObject != null && orderPushObject.getString("code").equals("200")) {
highChildOrder.setGasOrderNo(orderPushObject.getJSONObject("result").getString("orderNo"));
}
} else if (store.getSourceType().equals(MerchantStoreSourceType.type3.getNumber())) {
// 推送壳牌
JSONObject syncPayment = shellGroupService.gasSyncPayment(highOrder.getOrderNo(),
store.getStoreKey(),
highOrder.getPayTime(),
highChildOrder.getGasPriceGun(),
highChildOrder.getGasOilNo(),
highChildOrder.getGasGunNo(),
highOrder.getTotalPrice());
}
}

@ -125,6 +125,9 @@ public class GoodsOrderServiceImpl implements PayService {
@Resource
private BaiduVoiceService baiduVoiceService;
@Resource
private HighGasChannelConfigService gasChannelConfigService;
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void paySuccess(Map<String, String> map, String payType) throws Exception {
@ -440,15 +443,37 @@ public class GoodsOrderServiceImpl implements PayService {
new Thread(() -> {
try {
Thread.sleep(120*1000);
BigDecimal rake = order.getProfitSharingRatio().divide(new BigDecimal("100"));
// 计算微信收取的手续费 支付金额 * 0.002 注:如果与两个相邻数字的距离相等,则为上舍入的舍入模式。
BigDecimal wxHandlingFee = order.getPayRealPrice().multiply(new BigDecimal("0.002")).setScale(2,BigDecimal.ROUND_HALF_DOWN);
BigDecimal price = order.getPayRealPrice().subtract(wxHandlingFee);
HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreById(order.getHighChildOrderList().get(0).getGoodsId());
if (store != null) {
HighGasChannelConfig gasChannelConfig;
if (store.getSourceType().equals(MerchantStoreSourceType.type1.getNumber())) {
gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type1,GasChannelPayPlatformType.type1 );
} else if (store.getSourceType().equals(MerchantStoreSourceType.type2.getNumber())) {
gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type2,GasChannelPayPlatformType.type1 );
} else if (store.getSourceType().equals(MerchantStoreSourceType.type3.getNumber())) {
gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type3,GasChannelPayPlatformType.type1 );
} else if (store.getSourceType().equals(MerchantStoreSourceType.type4.getNumber())) {
gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type4,GasChannelPayPlatformType.type1 );
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置分账参数");
}
BigDecimal rake = order.getProfitSharingRatio().divide(new BigDecimal("100"));
// 计算分账金额 手续费后的价格 * 0.05 注:如果与两个相邻数字的距离相等,则为上舍入的舍入模式。
BigDecimal profitSharingAmount = price.multiply(rake).setScale(2,BigDecimal.ROUND_DOWN);
this.wxGasProfitsharing(order.getExt1(), order.getAccountMerchantNum(), order.getPaySerialNo(),order.getOrderNo(),profitSharingAmount);
// 计算微信收取的手续费 支付金额 * 0.002 注:如果与两个相邻数字的距离相等,则为上舍入的舍入模式。
BigDecimal wxHandlingFee = order.getPayRealPrice().multiply(new BigDecimal("0.002")).setScale(2,BigDecimal.ROUND_HALF_DOWN);
BigDecimal price = order.getPayRealPrice().subtract(wxHandlingFee);
// 计算分账金额 手续费后的价格 * 0.05 注:如果与两个相邻数字的距离相等,则为上舍入的舍入模式。
BigDecimal profitSharingAmount = price.multiply(rake).setScale(2,BigDecimal.ROUND_DOWN);
this.wxGasProfitsharing(order.getExt1(), order.getAccountMerchantNum(),gasChannelConfig.getProfitSharingReceiversNo(), gasChannelConfig.getProfitSharingReceiversName(), order.getPaySerialNo(),order.getOrderNo(),profitSharingAmount);
}
} catch (InterruptedException e) {
e.printStackTrace();
}
@ -476,25 +501,13 @@ public class GoodsOrderServiceImpl implements PayService {
}
}
public static void main(String[] args) {
BigDecimal totalPrice = new BigDecimal("100");
BigDecimal wxHandlingFee = totalPrice.multiply(new BigDecimal("0.002")).setScale(2,BigDecimal.ROUND_HALF_DOWN);
System.out.println("手续费:" + wxHandlingFee);
BigDecimal price = totalPrice.subtract(wxHandlingFee);
System.out.println("扣除手机费后的价格:" + price);
BigDecimal profitSharingAmount = price.multiply(new BigDecimal("0.05")).setScale(2,BigDecimal.ROUND_DOWN);
System.out.println("实际分账价格:" + profitSharingAmount);
}
public void wxGasProfitsharing(String appid, String subMchId, String transaction_id,String out_order_no, BigDecimal amount) {
public void wxGasProfitsharing(String appid, String subMchId, String receiversAccount, String receiversAccountName,String transaction_id,String out_order_no, BigDecimal amount) {
try {
Map<String,String> param = new LinkedHashMap<>();
param.put("appid", appid);
param.put("mch_id", "1289663601");
param.put("sub_mch_id" , subMchId); // 渝北区浩联物资经营部
param.put("sub_mch_id" , subMchId);
param.put("transaction_id" , transaction_id);
param.put("out_order_no" , out_order_no);
param.put("nonce_str" , WxUtils.makeNonStr());
@ -505,9 +518,9 @@ public class GoodsOrderServiceImpl implements PayService {
List<Map<String,Object>> receiversList = new ArrayList<>();
Map<String,Object> receiversMap = new LinkedHashMap<>();
receiversMap.put("type", "MERCHANT_ID");
receiversMap.put("account", "1603942866");
receiversMap.put("account", receiversAccount);
receiversMap.put("amount", porofitSharingAmount.multiply(new BigDecimal("100")).intValue());
receiversMap.put("description", "分给商户【惠昕石化】");
receiversMap.put("description", "分给商户:" + receiversAccountName);
receiversList.add(receiversMap);
param.put("receivers" , JSONObject.toJSONString(receiversList));
String signStr = WxUtils.generateSignature(param, "Skufk5oi85wDFGl888i6wsRSTkdd5df5" , WXPayConstants.SignType.HMACSHA256);

@ -1,4 +1,5 @@
hsgDomainName=https://hsgcs.dctpay.com
gasDefaultOilStationImg=https://hsgcs.dctpay.com/filesystem/default/default_oil_station.jpg
# TuanYou configuration parameters
tuanYouUrl=https://test05-motorcade-hcs.czb365.com
tuanYouAppKey=231599775566496
@ -8,9 +9,9 @@ tuanYouGasolineAccount=c009bic04400
#
shellGroupUrl=http://openapi.ngrok.xinyebang.cn/gateway.html
shellGroupPartnerId=123
shellPlatMerchantId=123
shellPlatMerchantKey=123
shellGroupPartnerId=S0302207281600105753
shellPlatMerchantId=S0302206141000105717
shellPlatMerchantKey=wqisfmkzea6mwd7ogbyh3488jv0hqhdj
# ????
qinzhuUrl=https://live-test.qianzhu8.com

@ -1,4 +1,5 @@
hsgDomainName=https://hsg.dctpay.com
gasDefaultOilStationImg=https://hsgcs.dctpay.com/filesystem/default/default_oil_station.jpg
tuanYouUrl=https://hcs.czb365.com
tuanYouAppKey=210091174083104

@ -1,4 +1,5 @@
hsgDomainName=https://hsg.dctpay.com
gasDefaultOilStationImg=https://hsg.dctpay.com/filesystem/default/default_oil_station.jpg
tuanYouUrl=https://hcs.czb365.com
tuanYouAppKey=210091174083104

@ -1,4 +1,5 @@
hsgDomainName=https://hsg.dctpay.com
gasDefaultOilStationImg=https://hsgcs.dctpay.com/filesystem/default/default_oil_station.jpg
tuanYouUrl=https://hcs.czb365.com
tuanYouAppKey=210091174083104

Loading…
Cancel
Save