Merge branch 'call_credit_dev' of http://139.159.177.244:3000/hurui/hai-server into call_credit_dev

袁野 3 years ago
commit 8588fd1f2a
  1. 19
      hai-bweb/src/main/java/com/bweb/config/RedisConfig.java
  2. 27
      hai-bweb/src/main/java/com/bweb/config/msg/OilPriceTaskMsgListener.java
  3. 59
      hai-bweb/src/main/java/com/bweb/config/msg/RedisKeyExpirationListener.java
  4. 33
      hai-bweb/src/main/java/com/bweb/controller/CommonController.java
  5. 65
      hai-bweb/src/main/java/com/bweb/controller/HighGasController.java
  6. 128
      hai-bweb/src/main/java/com/bweb/controller/HighGasOilPriceTaskController.java
  7. 82
      hai-bweb/src/main/java/com/bweb/controller/HighMerAmountController.java
  8. 1
      hai-bweb/src/main/java/com/bweb/controller/HighMerchantController.java
  9. 23
      hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java
  10. 88
      hai-bweb/src/main/java/com/bweb/controller/HighMerchantTripartitePlatformController.java
  11. 2
      hai-bweb/src/main/java/com/bweb/controller/HighTestController.java
  12. 33
      hai-bweb/src/main/java/com/bweb/controller/OutRechargeOrderController.java
  13. 2
      hai-bweb/src/main/resources/dev/application.yml
  14. 154
      hai-cweb/src/main/java/com/cweb/controller/HighGasController.java
  15. 17
      hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java
  16. 192
      hai-cweb/src/main/java/com/cweb/controller/OutRechargeOrderController.java
  17. 55
      hai-cweb/src/main/java/com/cweb/controller/WechatController.java
  18. 134
      hai-cweb/src/main/java/com/cweb/controller/pay/CzOrderController.java
  19. 29
      hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java
  20. 37
      hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java
  21. 2
      hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java
  22. 56
      hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java
  23. 21
      hai-service/src/main/java/com/hai/common/utils/DateUtil.java
  24. 1
      hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapperExt.java
  25. 43
      hai-service/src/main/java/com/hai/dao/HighGasOilPriceTaskMapper.java
  26. 14
      hai-service/src/main/java/com/hai/dao/HighGasOilPriceTaskSqlProvider.java
  27. 122
      hai-service/src/main/java/com/hai/dao/HighMerchantAccountMapper.java
  28. 38
      hai-service/src/main/java/com/hai/dao/HighMerchantAccountMapperExt.java
  29. 318
      hai-service/src/main/java/com/hai/dao/HighMerchantAccountSqlProvider.java
  30. 130
      hai-service/src/main/java/com/hai/dao/HighMerchantTripartitePlatformMapper.java
  31. 7
      hai-service/src/main/java/com/hai/dao/HighMerchantTripartitePlatformMapperExt.java
  32. 346
      hai-service/src/main/java/com/hai/dao/HighMerchantTripartitePlatformSqlProvider.java
  33. 26
      hai-service/src/main/java/com/hai/dao/HighOrderMapper.java
  34. 130
      hai-service/src/main/java/com/hai/dao/HighOrderSplitAccountsRecordMapper.java
  35. 7
      hai-service/src/main/java/com/hai/dao/HighOrderSplitAccountsRecordMapperExt.java
  36. 346
      hai-service/src/main/java/com/hai/dao/HighOrderSplitAccountsRecordSqlProvider.java
  37. 42
      hai-service/src/main/java/com/hai/dao/HighOrderSqlProvider.java
  38. 10
      hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapperExt.java
  39. 18
      hai-service/src/main/java/com/hai/entity/HighGasOilPriceTask.java
  40. 70
      hai-service/src/main/java/com/hai/entity/HighGasOilPriceTaskExample.java
  41. 214
      hai-service/src/main/java/com/hai/entity/HighMerchantAccount.java
  42. 934
      hai-service/src/main/java/com/hai/entity/HighMerchantAccountExample.java
  43. 246
      hai-service/src/main/java/com/hai/entity/HighMerchantTripartitePlatform.java
  44. 1054
      hai-service/src/main/java/com/hai/entity/HighMerchantTripartitePlatformExample.java
  45. 68
      hai-service/src/main/java/com/hai/entity/HighOrder.java
  46. 190
      hai-service/src/main/java/com/hai/entity/HighOrderExample.java
  47. 246
      hai-service/src/main/java/com/hai/entity/HighOrderSplitAccountsRecord.java
  48. 1044
      hai-service/src/main/java/com/hai/entity/HighOrderSplitAccountsRecordExample.java
  49. 43
      hai-service/src/main/java/com/hai/enum_type/OperatorEnum.java
  50. 2
      hai-service/src/main/java/com/hai/enum_type/OrderPushType.java
  51. 1
      hai-service/src/main/java/com/hai/model/HighMerchantStoreModel.java
  52. 10
      hai-service/src/main/java/com/hai/model/OutOrderModel.java
  53. 17
      hai-service/src/main/java/com/hai/model/OutRechargeOrderDetailModel.java
  54. 11
      hai-service/src/main/java/com/hai/model/UserModel.java
  55. 3
      hai-service/src/main/java/com/hai/msg/entity/MsgTopic.java
  56. 6
      hai-service/src/main/java/com/hai/service/CommonService.java
  57. 6
      hai-service/src/main/java/com/hai/service/HighGasOilPriceTaskService.java
  58. 45
      hai-service/src/main/java/com/hai/service/HighMerchantAccountService.java
  59. 20
      hai-service/src/main/java/com/hai/service/HighMerchantTripartitePlatformService.java
  60. 14
      hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java
  61. 9
      hai-service/src/main/java/com/hai/service/OutRechargePriceService.java
  62. 5
      hai-service/src/main/java/com/hai/service/impl/BsCompanyServiceImpl.java
  63. 9
      hai-service/src/main/java/com/hai/service/impl/CommonServiceImpl.java
  64. 147
      hai-service/src/main/java/com/hai/service/impl/HighGasDiscountOilPriceServiceImpl.java
  65. 109
      hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceTaskServiceImpl.java
  66. 93
      hai-service/src/main/java/com/hai/service/impl/HighMerchantAccountServiceImpl.java
  67. 11
      hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreServiceImpl.java
  68. 42
      hai-service/src/main/java/com/hai/service/impl/HighMerchantTripartitePlatformServiceImpl.java
  69. 2
      hai-service/src/main/java/com/hai/service/impl/HighOilCardRecordServiceImpl.java
  70. 6
      hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java
  71. 3
      hai-service/src/main/java/com/hai/service/impl/HltUnionCardVipServiceImpl.java
  72. 14
      hai-service/src/main/java/com/hai/service/impl/OutRechargeChildOrderServiceImpl.java
  73. 382
      hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java
  74. 20
      hai-service/src/main/java/com/hai/service/impl/OutRechargePriceServiceImpl.java
  75. 65
      hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java
  76. 37
      hai-service/src/main/java/com/hai/service/pay/impl/RechargeOrderServiceImpl.java
  77. 4
      hai-service/src/main/resources/dev/commonConfig.properties
  78. 56
      v1/target/classes/application.yml
  79. BIN
      v1/target/classes/com/V1Application.class
  80. BIN
      v1/target/classes/com/v1/config/AuthConfig$1.class
  81. BIN
      v1/target/classes/com/v1/config/AuthConfig.class
  82. BIN
      v1/target/classes/com/v1/config/ConfigListener.class
  83. BIN
      v1/target/classes/com/v1/config/CorsConfig.class
  84. BIN
      v1/target/classes/com/v1/config/MultipartConfig.class
  85. BIN
      v1/target/classes/com/v1/config/RedisConfig.class
  86. BIN
      v1/target/classes/com/v1/config/SignatureConfig.class
  87. BIN
      v1/target/classes/com/v1/config/SwaggerConfig.class
  88. BIN
      v1/target/classes/com/v1/config/SysConfig.class
  89. BIN
      v1/target/classes/com/v1/config/SysConst.class
  90. 0
      v1/target/classes/config.properties
  91. 72
      v1/target/classes/logback.xml
  92. BIN
      v1/target/hai-v1-1.0-SNAPSHOT.jar
  93. BIN
      v1/target/hai-v1-1.0-SNAPSHOT.jar.original
  94. 4
      v1/target/maven-archiver/pom.properties
  95. 11
      v1/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
  96. 10
      v1/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
  97. 0
      v1/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst

@ -1,14 +1,19 @@
package com.bweb.config;
import com.bweb.config.msg.OilPriceTaskMsgListener;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.hai.msg.entity.MsgTopic;
import org.springframework.cache.annotation.CachingConfigurerSupport;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.MessageListener;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.*;
import org.springframework.data.redis.listener.PatternTopic;
import org.springframework.data.redis.listener.RedisMessageListenerContainer;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
@ -17,6 +22,18 @@ import org.springframework.data.redis.serializer.StringRedisSerializer;
@EnableCaching //开启注解
public class RedisConfig extends CachingConfigurerSupport {
@Bean
public RedisMessageListenerContainer redisMessageListenerContainer(RedisConnectionFactory factory) {
RedisMessageListenerContainer container = new RedisMessageListenerContainer();
container.setConnectionFactory(factory);
//可以添加多个 messageListener
container.addMessageListener(new OilPriceTaskMsgListener(), new PatternTopic(MsgTopic.oilPriceTask.getName()));
return container;
}
/**
* retemplate相关配置
* @param factory
@ -106,4 +123,4 @@ public class RedisConfig extends CachingConfigurerSupport {
public ZSetOperations<String, Object> zSetOperations(RedisTemplate<String, Object> redisTemplate) {
return redisTemplate.opsForZSet();
}
}
}

@ -0,0 +1,27 @@
package com.bweb.config.msg;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.Message;
import org.springframework.data.redis.connection.MessageListener;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.UUID;
@Service(value = "driverLBSMsgListener")
public class OilPriceTaskMsgListener implements MessageListener {
private static Logger logger = LoggerFactory.getLogger(OilPriceTaskMsgListener.class);
private RedisTemplate<String, Object> redisTemplate;
@Override
public void onMessage(Message message, byte[] pattern) {
System.out.println(message);
}
}

@ -0,0 +1,59 @@
package com.bweb.config.msg;
import com.hai.entity.HighGasOilPriceTask;
import com.hai.msg.entity.MsgTopic;
import com.hai.service.HighGasOilPriceTaskService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.redis.connection.Message;
import org.springframework.data.redis.listener.KeyExpirationEventMessageListener;
import org.springframework.data.redis.listener.RedisMessageListenerContainer;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author hurui
* @version 1.0
* @ClassName RedisKeyExpirationListener
* @description: TODO
* @date 2021/8/19 10:00
*/
@Component
public class RedisKeyExpirationListener extends KeyExpirationEventMessageListener {
private static Logger logger = LoggerFactory.getLogger(RedisKeyExpirationListener.class);
@Resource
private HighGasOilPriceTaskService gasOilPriceTaskService;
public RedisKeyExpirationListener(RedisMessageListenerContainer listenerContainer) {
super(listenerContainer);
}
public void onMessage(Message message, byte[] pattern) {
try {
if (message != null && StringUtils.isNotBlank(message.toString())) {
// 加油站价格任务
if (message.toString().contains(MsgTopic.oilPriceTask.getName())) {
// 截取任务id
Long taskId = Long.parseLong(StringUtils.substringAfterLast(message.toString(), MsgTopic.oilPriceTask.getName() + "-"));
if (taskId != null) {
// 查询任务
HighGasOilPriceTask gasOilPriceTask = gasOilPriceTaskService.getDetailById(taskId);
if (gasOilPriceTask != null) {
// 任务处理
gasOilPriceTaskService.businessHandle(gasOilPriceTask);
}
}
}
}
} catch (Exception e) {
logger.error("redis过期事件异常:", e);
}
}
}

@ -38,6 +38,19 @@ public class CommonController {
private SecConfigService secConfigService;
@RequestMapping(value="/getProvinceList",method= RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询省级列表")
public ResponseData getProvinceList(){
try {
return ResponseMsgUtil.success(commonService.getProvinceList());
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getRegionsByParentId",method= RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "分级查询区域信息")
@ -300,5 +313,25 @@ public class CommonController {
}
}
@RequestMapping(value = "/findByLatAndLng", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取定位信息")
public ResponseData findByLatAndLng(
@RequestParam(name = "lng", required = true) String lng,
@RequestParam(name = "lat", required = true) String lat
) {
try {
System.out.println("请求经度==================" + lng);
System.out.println("请求纬度==================" + lat);
JSONObject object = commonService.findByLatAndLng(lng , lat);
System.out.println("请求经纬度========" + object);
return ResponseMsgUtil.success(object);
} catch (Exception e) {
log.error("HighOrderController --> unionStagingPay() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -34,6 +34,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.io.File;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
@ -53,6 +54,9 @@ public class HighGasController {
@Resource
private HighMerchantStoreService merchantStoreService;
@Resource
private HighMerchantAccountService merchantAccountService;
@Resource
private HighUserService highUserService;
@ -65,6 +69,35 @@ public class HighGasController {
@Resource
private RedisTemplate redisTemplate;
@RequestMapping(value="/getMerGasStatistical",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "查询商户油站统计")
public ResponseData getMerGasStatistical() {
try {
UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class);
if (userInfoModel == null || userInfoModel.getMerchant() == null) {
log.error("HighGasController -> getMerGasStatistical() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
BigDecimal account = new BigDecimal("0");
// 查询商户余额
HighMerchantAccount merchantAccount = merchantAccountService.getStoreAccountDetail(userInfoModel.getMerchant().getId());
if (merchantAccount != null) {
account = merchantAccount.getAmounts();
}
Map<String, Object> param = new HashMap<>();
param.put("amount", account.subtract(merchantAccountService.countMerGasOilAmount(userInfoModel.getMerchant().getId())));
param.put("storeList", merchantAccountService.getStoreGasOilAmountByMer(userInfoModel.getMerchant().getId()));
return ResponseMsgUtil.success(param);
} catch (Exception e) {
log.error("HighGasController -> getMerGasStatistical() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getGasStatistical",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "查询油站统计")
@ -157,6 +190,38 @@ public class HighGasController {
}
}
@RequestMapping(value="/getGasSelectList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询油站选择列表")
public ResponseData getGasSelectList() {
try {
UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class);
if (userInfoModel == null) {
log.error("HighGasController -> disabledOil() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
Map<String, Object> param = new HashMap<>();
param.put("type", 1);
param.put("sourceType", 1);
param.put("status", 1);
if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type0.getType())) {
} else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type1.getType())) {
param.put("companyId", userInfoModel.getBsCompany().getId());
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
return ResponseMsgUtil.success(merchantStoreService.getMerchantStoreList(param));
} catch (Exception e) {
log.error("HighGasController -> getGasSelectList() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/exportGasOrder",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "导出油站订单")

@ -6,9 +6,19 @@ import com.github.pagehelper.PageInfo;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.security.UserCenter;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.HighGasOilPriceTask;
import com.hai.entity.HighMerchantStore;
import com.hai.entity.SecDictionary;
import com.hai.entity.SecRegion;
import com.hai.enum_type.GasTaskPriceTypeEnum;
import com.hai.enum_type.UserObjectTypeEnum;
import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel;
import com.hai.service.CommonService;
import com.hai.service.HighGasOilPriceTaskService;
import com.hai.service.HighMerchantStoreService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
@ -18,6 +28,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Controller
@ -30,19 +41,98 @@ public class HighGasOilPriceTaskController {
@Resource
private HighGasOilPriceTaskService gasOilPriceTaskService;
@RequestMapping(value="/addTask",method = RequestMethod.POST)
@Resource
private HighMerchantStoreService merchantStoreService;
@Resource
private CommonService commonService;
@Resource
private UserCenter userCenter;
@RequestMapping(value="/batchAddTask",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "增加任务")
public ResponseData addTask(@RequestBody JSONObject body) {
@ApiOperation(value = "批量增加任务")
public ResponseData batchAddTask(@RequestBody List<HighGasOilPriceTask> taskList) {
try {
if (body.getLong("regionId") == null
|| body.getInteger("oilNo") == null
|| body.getBigDecimal("price") == null
) {
UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class);
if (userInfoModel == null) {
log.error("HighGasDiscountOilPriceController -> updateOilPriceOfficial() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
if (taskList == null || taskList.size() == 0) {
log.error("HighGasDiscountOilPriceController -> updateOilPriceOfficial() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
for (HighGasOilPriceTask task : taskList) {
if (task.getPriceType() == null
|| task.getPrice() == null
|| task.getOilNo() == null
|| task.getExecutionType() == null
) {
log.error("HighGasDiscountOilPriceController -> updateOilPriceOfficial() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 执行方式 1. 立刻执行 2. 定时执行
if (task.getExecutionType().equals(2) && task.getStartTime() == null) {
log.error("HighGasDiscountOilPriceController -> updateOilPriceOfficial() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置执行时间");
}
// 价格类型 1. 国标价 2. 油站价 3. 优惠幅度
if (task.getPriceType().equals(GasTaskPriceTypeEnum.type1.getStatus())) {
if (task.getRegionId() == null) {
log.error("HighGasDiscountOilPriceController -> updateOilPriceOfficial() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置区域");
}
// 加油站
SecRegion region = commonService.getRegionsById(task.getRegionId());
if (region == null) {
log.error("HighGasDiscountOilPriceController -> updateOilPriceOfficial() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到区域");
}
task.setRegionId(region.getRegionId());
task.setRegionName(region.getRegionName());
}
// 价格类型 1. 国标价 2. 油站价 3. 优惠幅度
if (task.getPriceType().equals(GasTaskPriceTypeEnum.type2.getStatus())
|| task.getPriceType().equals(GasTaskPriceTypeEnum.type3.getStatus())) {
if (task.getMerStoreId() == null) {
log.error("HighGasDiscountOilPriceController -> updateOilPriceOfficial() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置加油站");
}
// 加油站
HighMerchantStore store = merchantStoreService.getDetailById(task.getMerStoreId());
if (store == null) {
log.error("HighGasDiscountOilPriceController -> updateOilPriceOfficial() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到加油站");
}
task.setRegionId(store.getRegionId());
task.setRegionName(store.getRegionName());
task.setMerStoreId(store.getId());
task.setMerStoreKey(store.getStoreKey());
task.setMerStoreName(store.getStoreName());
task.setMerStoreAddress(store.getAddress());
}
// 查询油品
SecDictionary oil = commonService.mappingSysCode("GAS_OIL_TYPE", task.getOilNo().toString());
if (oil == null) {
log.error("HighGasDiscountOilPriceController -> updateOilPriceOfficial() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
task.setOilType(Integer.parseInt(oil.getExt1()));
task.setOilTypeName(oil.getExt2());
task.setOilNoName(oil.getCodeName());
task.setOpUserId(userInfoModel.getSecUser().getId());
task.setOpUserName(userInfoModel.getSecUser().getUserName());
}
gasOilPriceTaskService.batchAddTask(taskList);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
@ -91,6 +181,7 @@ public class HighGasOilPriceTaskController {
public ResponseData getTaskList(@RequestParam(name = "regionId", required = false) Integer regionId,
@RequestParam(name = "regionName", required = false) String regionName,
@RequestParam(name = "merStoreId", required = false) Integer merStoreId,
@RequestParam(name = "merStoreKey", required = false) String merStoreKey,
@RequestParam(name = "merStoreName", required = false) String merStoreName,
@RequestParam(name = "oilType", required = false) Integer oilType,
@RequestParam(name = "oilNo", required = false) Integer oilNo,
@ -100,10 +191,31 @@ public class HighGasOilPriceTaskController {
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
try {
UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class);
if (userInfoModel == null) {
log.error("HighGasController -> disabledOil() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
Map<String, Object> param = new HashMap<>();
param.put("regionId", regionId);
param.put("regionName", regionName);
param.put("status", status);
param.put("merStoreId", merStoreId);
param.put("merStoreKey", merStoreKey);
param.put("merStoreName", merStoreName);
if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type0.getType())) {
} else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type1.getType())) {
param.put("regionId", userInfoModel.getBsCompany().getRegionId());
} else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type3.getType())) {
param.put("merStoreId", userInfoModel.getMerchantStore().getId());
}
param.put("oilType", oilType);
param.put("oilNo", oilNo);
param.put("priceType", priceType);
param.put("executionType", executionType);
param.put("status", status);
PageHelper.startPage(pageNum,pageSize);

@ -0,0 +1,82 @@
package com.bweb.controller;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.security.UserCenter;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.HighMerchantStoreAccount;
import com.hai.enum_type.MerStoreAmountSourceTypeEnum;
import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel;
import com.hai.service.HighCompanyTwoPwdService;
import com.hai.service.HighMerchantAccountService;
import com.hai.service.HighMerchantStoreAccountRecordService;
import com.hai.service.HighMerchantStoreAccountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.dao.DeadlockLoserDataAccessException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
@Controller
@RequestMapping(value = "/merAccount")
@Api(value = "商户门店接口")
public class HighMerAmountController {
private static Logger log = LoggerFactory.getLogger(HighMerAmountController.class);
@Resource
private HighMerchantAccountService merchantAccountService;
@Resource
private UserCenter userCenter;
@RequestMapping(value = "/recharge", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "余额充值")
public synchronized ResponseData recharge(@RequestBody JSONObject body) {
try {
UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class);
if (userInfoModel == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, "");
}
if (userInfoModel.getBsCompany() == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, "");
}
if (body.getLong("merId") == null || body.getBigDecimal("amount") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
if (body.getBigDecimal("amount").compareTo(new BigDecimal("0")) == -1) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "充值金额不能小于0");
}
Map<String, Object> map = new HashMap<>();
map.put("sourceType", MerStoreAmountSourceTypeEnum.type1.getType());
map.put("sourceContent", "充值额度:" + body.getBigDecimal("amount") + " 元");
map.put("opUserId", userInfoModel.getSecUser().getId());
map.put("opUserName", userInfoModel.getSecUser().getUserName());
merchantAccountService.recharge(body.getLong("merId"), body.getBigDecimal("amount"), map);
return ResponseMsgUtil.success("操作成功");
} catch (DeadlockLoserDataAccessException deadlockLoserDataAccessException) {
log.error("HighActivityController -> userLottery() error!", "服务器繁忙");
return ResponseMsgUtil.builderResponse(ErrorCode.SERVER_BUSY_ERROR.getCode(),ErrorCode.SERVER_BUSY_ERROR.getMsg(),null);
} catch (Exception e) {
log.error("HighCompanyAmountController --> recharge() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -101,7 +101,6 @@ public class HighMerchantController {
}
}
@RequestMapping(value="/updateMerchant",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "修改商户")

@ -208,14 +208,25 @@ public class HighMerchantStoreController {
log.error("BsStudentController --> addStudent() error!", "未找到门店信息");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到门店信息");
}
BsCompany company = bsCompanyService.getCompanyById(store.getCompanyId());
if (company == null) {
log.error("HighMerchantStoreController -> insertMerchantStore() error!","未找到分公司");
throw ErrorHelp.genException(SysCode.System, ErrorCode.MERCHANT_NOF_FOUND, "");
}
Map<String, SecRegion> regionMap = commonService.getParentInfoByRegionId(highMerchantStore.getRegionId());
// 如果是重庆市的区县,使用重庆市的区域代码
if (regionMap.get("region").getRegionId().intValue() == 500100) {
store.setRegionId(regionMap.get("region").getParentId());
store.setRegionName(regionMap.get("region").getRegionName());
if (highMerchantStore.getType() != null && highMerchantStore.getType().equals(1)) {
highMerchantStore.setRegionId(Long.parseLong(company.getRegionId()));
highMerchantStore.setRegionName(commonService.getRegionName(Long.parseLong(company.getRegionId())));
} else {
store.setRegionId(regionMap.get("region").getRegionId());
store.setRegionName(regionMap.get("region").getRegionName());
// 如果是重庆市的区县,使用重庆市的区域代码
if (regionMap.get("region").getRegionId().intValue() == 500100) {
highMerchantStore.setRegionId(regionMap.get("region").getParentId());
highMerchantStore.setRegionName(regionMap.get("region").getRegionName());
} else {
highMerchantStore.setRegionId(regionMap.get("region").getRegionId());
highMerchantStore.setRegionName(regionMap.get("region").getRegionName());
}
}
if (highMerchantStore.getBrandId() != null) {

@ -0,0 +1,88 @@
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.utils.ResponseMsgUtil;
import com.hai.entity.HighMerchantTripartitePlatform;
import com.hai.model.ResponseData;
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;
@Controller
@RequestMapping(value = "/merchantTripartitePlatform")
@Api(value = "商户第三方平台")
public class HighMerchantTripartitePlatformController {
private static Logger log = LoggerFactory.getLogger(HighMerchantTripartitePlatformController.class);
@Resource
private HighMerchantTripartitePlatformService tripartitePlatformService;
@RequestMapping(value="/editTripartitePlatform",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "编辑第三方平台")
public ResponseData editTripartitePlatform(@RequestBody JSONObject body) {
try {
if (body == null
|| body.getLong("merId") == null
|| body.getInteger("platformType") == null
|| StringUtils.isBlank(body.getString("platformMerName"))
|| StringUtils.isBlank(body.getString("platformMerNumber"))
|| body.getBoolean("profitSharingStatus") == null
) {
log.error("HighMerchantController -> insertMerchantStore() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
if (body.getBoolean("profitSharingStatus") == true && body.getBigDecimal("profitSharingRatio") == null) {
log.error("HighMerchantController -> insertMerchantStore() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
HighMerchantTripartitePlatform platform = tripartitePlatformService.getDetail(body.getLong("merId"), body.getInteger("platformType"));
if (platform == null) {
platform = new HighMerchantTripartitePlatform();
}
platform.setMerId(body.getLong("merId"));
platform.setPlatformType(body.getInteger("platformType"));
platform.setPlatformMerName(body.getString("platformMerName"));
platform.setPlatformMerNumber(body.getString("platformMerNumber"));
platform.setProfitSharingStatus(body.getBoolean("profitSharingStatus"));
platform.setProfitSharingRatio(body.getBigDecimal("profitSharingRatio"));
tripartitePlatformService.editDate(platform);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighMerchantTripartitePlatformController -> editTripartitePlatform() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getDetail",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询详情")
public ResponseData getDetail(@RequestParam(value = "merId" , required = true) Long merId,
@RequestParam(value = "platformType" , required = true) Integer platformType,
HttpServletRequest request) {
try {
return ResponseMsgUtil.success(tripartitePlatformService.getDetail(merId, platformType));
} catch (Exception e) {
log.error("HighMerchantTripartitePlatformController -> getDetail() error!",e);
return ResponseMsgUtil.exception(e);
}
}
}

File diff suppressed because one or more lines are too long

@ -19,6 +19,7 @@ import com.hai.common.utils.WxUtils;
import com.hai.config.HuiLianTongUnionCardConfig;
import com.hai.config.UnionPayConfig;
import com.hai.entity.HighRefundAudit;
import com.hai.entity.OutRechargeChildOrder;
import com.hai.entity.OutRechargeOrder;
import com.hai.entity.OutRechargeOrderRecord;
import com.hai.model.*;
@ -58,16 +59,7 @@ public class OutRechargeOrderController {
private OutRechargeOrderService outRechargeOrderService;
@Resource
private GoodsOrderServiceImpl goodsOrderService;
@Resource
private HighRefundAuditService highRefundAuditService;
@Resource
private HighUserService highUserService;
@Resource
private OutRechargeChildOrderService rechargeOrderRecordService;
private OutRechargeChildOrderService outRechargeChildOrderService;
@RequestMapping(value = "/getOrderById", method = RequestMethod.GET)
@ -84,6 +76,27 @@ public class OutRechargeOrderController {
}
}
@RequestMapping(value = "/getChildOrder", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根据id查询子订单详情")
public ResponseData getChildOrder(@RequestParam(name = "orderId", required = true) Long orderId) {
try {
// 查询充值子订单
Map<String, Object> childOrderMap = new HashMap<>();
childOrderMap.put("parent_order_id" , orderId);
List<OutRechargeChildOrder> childOrderList = outRechargeChildOrderService.getListRechargeChildOrder(childOrderMap);
return ResponseMsgUtil.success(childOrderList);
} catch (Exception e) {
log.error("HighOrderController --> getOrderById() error!", e);
return ResponseMsgUtil.exception(e);
}
}
// @RequestMapping(value="/importRechargeOrder",method = RequestMethod.POST)
// @ResponseBody

@ -9,7 +9,7 @@ debug: false
#datasource数据源设置
spring:
datasource:
url: jdbc:mysql://139.159.177.244:3306/hfkj?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
url: jdbc:mysql://139.159.177.244:3306/hsg_test?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root
password: HF123456.
type: com.alibaba.druid.pool.DruidDataSource

@ -112,32 +112,72 @@ public class HighGasController {
PageInfo<Map<String, Object>> mapPageInfo = PageUtil.initPageInfoObj(pageNum, distance.size(), pageSize, new PageInfo<>(distance));
for (Map<String, Object> map : mapPageInfo.getList()) {
if (StringUtils.isNotBlank(MapUtils.getString(map, "oil_no"))) {
// 查询是否配置了【油站的】优惠比例
HighTyAgentPrice tyAgentPrice = tyAgentPriceService.getDetail(1, MapUtils.getLong(map, "id"), MapUtils.getString(map, "oil_no"));
if (tyAgentPrice != null) {
// 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = tyAgentPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
// 油品国标价 * 最终优惠比例
map.put("price_vip", new BigDecimal(MapUtils.getString(map, "price_gun")).multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
} else {
// 查询是否配置了【油品】优惠比例
HighGasDiscountOilPrice gasDiscountOilPrice = gasDiscountOilPriceService.getDetailByOilNo(MapUtils.getString(map, "oil_no"));
if (gasDiscountOilPrice != null) {
if (MapUtils.getInteger(map, "source_type").equals(1)) {
// 查询是否配置了【油站的】优惠比例
HighTyAgentPrice tyAgentPrice = tyAgentPriceService.getDetail(1, MapUtils.getLong(map, "id"), MapUtils.getString(map, "oil_no"));
if (tyAgentPrice != null) {
// 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = gasDiscountOilPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
// 油品国标价 * 最终优惠比例
map.put("price_vip", new BigDecimal(MapUtils.getString(map, "price_gun")).multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
BigDecimal priceRate = tyAgentPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
// 油枪价 - 优惠幅度
BigDecimal price = new BigDecimal(MapUtils.getString(map, "price_gun")).subtract(new BigDecimal(MapUtils.getString(map, "preferential_margin")));
// (油枪价 - 优惠幅度) * 系统折扣
map.put("price_vip", price.multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
} else {
// 查询是否配置了【油品】优惠比例
HighGasDiscountOilPrice gasDiscountOilPrice = gasDiscountOilPriceService.getDetailByOilNo(MapUtils.getString(map, "oil_no"));
if (gasDiscountOilPrice != null) {
// 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = gasDiscountOilPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
// 油枪价 - 优惠幅度
BigDecimal price = new BigDecimal(MapUtils.getString(map, "price_gun")).subtract(new BigDecimal(MapUtils.getString(map, "preferential_margin")));
// (油枪价 - 优惠幅度) * 系统折扣
map.put("price_vip", price.multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
}
}
}
// 查询是否配置了【代理商】优惠比例
if (isTyAgent != null && isTyAgent == true) {
HighTyAgentPrice agentPrice = tyAgentPriceService.getDetail(2, MapUtils.getLong(map, "id"), MapUtils.getString(map, "oil_no"));
if (agentPrice != null) {
// 查询是否配置了【代理商】优惠比例
if (isTyAgent != null && isTyAgent == true) {
HighTyAgentPrice agentPrice = tyAgentPriceService.getDetail(2, MapUtils.getLong(map, "id"), MapUtils.getString(map, "oil_no"));
if (agentPrice != null) {
// 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = agentPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
// 油枪价 - 优惠幅度
BigDecimal price = new BigDecimal(MapUtils.getString(map, "price_gun")).subtract(new BigDecimal(MapUtils.getString(map, "preferential_margin")));
// (油枪价 - 优惠幅度) * 系统折扣
map.put("price_vip", price.multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
}
}
} else if (MapUtils.getInteger(map, "source_type").equals(2)) {
// 查询是否配置了【油站的】优惠比例
HighTyAgentPrice tyAgentPrice = tyAgentPriceService.getDetail(1, MapUtils.getLong(map, "id"), MapUtils.getString(map, "oil_no"));
if (tyAgentPrice != null) {
// 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = agentPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
BigDecimal priceRate = tyAgentPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
// 油品国标价 * 最终优惠比例
map.put("price_vip", new BigDecimal(MapUtils.getString(map, "price_gun")).multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
} else {
// 查询是否配置了【油品】优惠比例
HighGasDiscountOilPrice gasDiscountOilPrice = gasDiscountOilPriceService.getDetailByOilNo(MapUtils.getString(map, "oil_no"));
if (gasDiscountOilPrice != null) {
// 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = gasDiscountOilPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
// 油品国标价 * 最终优惠比例
map.put("price_vip", new BigDecimal(MapUtils.getString(map, "price_gun")).multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
}
}
// 查询是否配置了【代理商】优惠比例
if (isTyAgent != null && isTyAgent == true) {
HighTyAgentPrice agentPrice = tyAgentPriceService.getDetail(2, MapUtils.getLong(map, "id"), MapUtils.getString(map, "oil_no"));
if (agentPrice != null) {
// 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = agentPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
// 油品国标价 * 最终优惠比例
map.put("price_vip", new BigDecimal(MapUtils.getString(map, "price_gun")).multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
}
}
}
}
@ -271,6 +311,43 @@ public class HighGasController {
oilPriceMap.put("priceVip", oilPrice.getPriceVip());
oilPriceMap.put("priceGun", oilPrice.getPriceGun());
oilPriceMap.put("priceOfficial", oilPrice.getPriceOfficial());
// 查询是否配置了【油站的】优惠比例
HighTyAgentPrice tyAgentPrice = tyAgentPriceService.getDetail(1, store.getId(), oilPrice.getOilNo().toString());
if (tyAgentPrice != null) {
// 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = tyAgentPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
// 油枪价 - 优惠幅度
BigDecimal price = oilPrice.getPriceGun().subtract(oilPrice.getPreferentialMargin());
// (油枪价 - 优惠幅度) * 系统折扣
oilPriceMap.put("priceVip", price.multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
} else {
// 查询是否配置了【油品】优惠比例
HighGasDiscountOilPrice gasDiscountOilPrice = gasDiscountOilPriceService.getDetailByOilNo(oilPrice.getOilNo().toString());
if (gasDiscountOilPrice != null) {
// 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = gasDiscountOilPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
// 油枪价 - 优惠幅度
BigDecimal price = oilPrice.getPriceGun().subtract(oilPrice.getPreferentialMargin());
// (油枪价 - 优惠幅度) * 系统折扣
oilPriceMap.put("priceVip", price.multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
}
}
// 查询是否配置了【代理商】优惠比例
if (isTyAgent != null && isTyAgent == true) {
HighTyAgentPrice agentPrice = tyAgentPriceService.getDetail(2, store.getId(), oilPrice.getOilNo().toString());
if (agentPrice != null) {
// 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = agentPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
// 油枪价 - 优惠幅度
BigDecimal price = oilPrice.getPriceGun().subtract(oilPrice.getPreferentialMargin());
// (油枪价 - 优惠幅度) * 系统折扣
oilPriceMap.put("priceVip", price.multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
}
}
oilPriceMapList.add(oilPriceMap);
}
param.put("oilPriceList", oilPriceMapList);
@ -418,6 +495,43 @@ public class HighGasController {
oilPriceMap.put("priceVip", oilPrice.getPriceVip());
oilPriceMap.put("priceGun", oilPrice.getPriceGun());
oilPriceMap.put("priceOfficial", oilPrice.getPriceOfficial());
// 查询是否配置了【油站的】优惠比例
HighTyAgentPrice tyAgentPrice = tyAgentPriceService.getDetail(1, store.getId(), oilPrice.getOilNo().toString());
if (tyAgentPrice != null) {
// 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = tyAgentPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
// 油枪价 - 优惠幅度
BigDecimal price = oilPrice.getPriceGun().subtract(oilPrice.getPreferentialMargin());
// (油枪价 - 优惠幅度) * 系统折扣
oilPriceMap.put("priceVip", price.multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
} else {
// 查询是否配置了【油品】优惠比例
HighGasDiscountOilPrice gasDiscountOilPrice = gasDiscountOilPriceService.getDetailByOilNo(oilPrice.getOilNo().toString());
if (gasDiscountOilPrice != null) {
// 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = gasDiscountOilPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
// 油枪价 - 优惠幅度
BigDecimal price = oilPrice.getPriceGun().subtract(oilPrice.getPreferentialMargin());
// (油枪价 - 优惠幅度) * 系统折扣
oilPriceMap.put("priceVip", price.multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
}
}
// 查询是否配置了【代理商】优惠比例
if (isTyAgent != null && isTyAgent == true) {
HighTyAgentPrice agentPrice = tyAgentPriceService.getDetail(2, store.getId(), oilPrice.getOilNo().toString());
if (agentPrice != null) {
// 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = agentPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
// 油枪价 - 优惠幅度
BigDecimal price = oilPrice.getPriceGun().subtract(oilPrice.getPreferentialMargin());
// (油枪价 - 优惠幅度) * 系统折扣
oilPriceMap.put("priceVip", price.multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP));
}
}
oilPriceMapList.add(oilPriceMap);
}
param.put("oilPriceList", oilPriceMapList);

@ -55,6 +55,9 @@ public class HighOrderController {
@Autowired
private UserCenter userCenter;
@Resource
private CommonService commonService;
@Resource
private HighOrderService highOrderService;
@ -220,8 +223,18 @@ public class HighOrderController {
log.error("HighOrderController --> addOrder() error!", "参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
if (childOrder.getGoodsPrice().compareTo(new BigDecimal("800")) == 1){
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "加油金额不能超过800元");
// 加油限制
if (childOrder.getGasOilType().equals(1)) {
SecDictionary refuelLimit = commonService.mappingSysName("REFUEL_LIMIT", "汽油");
if (refuelLimit != null && childOrder.getGoodsPrice().compareTo(new BigDecimal(refuelLimit.getCodeValue())) == 1) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "汽油加油金额不能超过" + refuelLimit.getCodeValue()+"元");
}
} else if (childOrder.getGasOilType().equals(2)){
SecDictionary refuelLimit = commonService.mappingSysName("REFUEL_LIMIT", "柴油");
if (refuelLimit != null && childOrder.getGoodsPrice().compareTo(new BigDecimal(refuelLimit.getCodeValue())) == 1) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "柴油加油金额不能超过" + refuelLimit.getCodeValue()+"元");
}
}
if (highOrderService.getGasTheDayOrderNum(userInfoModel.getHighUser().getId()) >= 1) {

@ -6,13 +6,10 @@ import com.github.pagehelper.PageInfo;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.security.AESEncodeUtil;
import com.hai.common.security.SessionObject;
import com.hai.common.security.UserCenter;
import com.hai.common.utils.*;
import com.hai.config.RechargeConfig;
import com.hai.entity.*;
import com.hai.enum_type.DiscountUseScope;
import com.hai.model.*;
import com.hai.service.*;
import io.swagger.annotations.Api;
@ -20,14 +17,13 @@ import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
@Controller
@ -45,20 +41,6 @@ public class OutRechargeOrderController {
@Resource
private OutRechargePriceService outRechargePriceService;
@Resource
private SecConfigService secConfigService;
@Resource
private HighUserPayPasswordService highUserPayPasswordService;
@Resource
private HighDiscountUserRelService highDiscountUserRelService;
@Resource
private BsConfigService bsConfigService;
@Resource
private RechargeConfig rechargeConfig;
@RequestMapping(value="/addOrder",method = RequestMethod.POST)
@ResponseBody
@ -72,169 +54,17 @@ public class OutRechargeOrderController {
if (StringUtils.isBlank(object.getString("rechargeContent")) ||
StringUtils.isBlank(object.getString("regionId")) ||
object.getLong("goodsId") == null
) {
log.error("addOrder error!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
OutRechargeOrder outRechargeOrder = new OutRechargeOrder();
// 产品id
Long goodsId = object.getLong("goodsId");
// 充值内容
String rechargeContent = object.getString("rechargeContent");
// 查询产品详情
OutRechargePriceModel outRechargePrice = outRechargePriceService.findById(goodsId , null);
object.put("userId" , userInfoModel.getHighUser().getId());
object.put("userName" , userInfoModel.getHighUser().getName());
object.put("phone" , userInfoModel.getHighUser().getPhone());
Map<String, Object> listMap = new HashMap<>();
listMap.put("productType", "3");
listMap.put("returnType", 1);
listMap.put("sourceId", goodsId);
// 查询产品积分抵扣比例
BsProductDiscount bsProductDiscount = bsConfigService.getProductDiscountByMap(listMap);
// 判断充值系统是否关闭
if (!secConfigService.isConfig("RECHARGE" , "1")) {
log.error("addOrder error!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.RECHARGE_CLOSE, "");
}
HighDiscountUserRel highDiscountUserRel = null;
// 判断是否有优惠券
if (object.getLong("memDiscountId") != null) {
// 卡优惠券信息
highDiscountUserRel = highDiscountUserRelService.getRelById(object.getLong("memDiscountId"));
if (highDiscountUserRel == null || highDiscountUserRel.getStatus() != 1) {
log.error("HighOrderController --> addOrder() error!", "优惠券状态错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "优惠券状态错误");
}
if (!highDiscountUserRel.getHighDiscount().getUseScope().equals(DiscountUseScope.type1.getType())
&& !highDiscountUserRel.getHighDiscount().getUseScope().equals(DiscountUseScope.type3.getType())) {
log.error("HighOrderController --> addOrder() error!", "无法使用此优惠券");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法使用此优惠券");
}
}
// 优惠券抵扣
if (highDiscountUserRel != null) {
outRechargeOrder.setMemDiscountName(highDiscountUserRel.getHighDiscount().getDiscountName());
// 卡卷类型 1:满减 2:抵扣 3:折扣
if (highDiscountUserRel.getHighDiscount().getDiscountType() == 1) {
// 如果商品支付总额 小于 满减价格
if (outRechargePrice.getPayPrice().compareTo(highDiscountUserRel.getHighDiscount().getDiscountCondition()) > 1) {
log.error("HighOrderController --> addOrder() error!", "订单未达到满减额度");
throw ErrorHelp.genException(SysCode.System, ErrorCode.UN_MEMBER_ERROR, "订单未达到"+highDiscountUserRel.getHighDiscount().getDiscountCondition()+"元,无法使用此优惠券");
}
// 计算支付金额 = 商品支付总额 - 满减额度
BigDecimal payPrice = outRechargePrice.getPayPrice().subtract(highDiscountUserRel.getHighDiscount().getDiscountPrice());
outRechargeOrder.setDiscountDeductionPrice(highDiscountUserRel.getHighDiscount().getDiscountPrice());
// 如果总额小于0
if (payPrice.compareTo(new BigDecimal("0")) < 0) {
outRechargeOrder.setPayRealPrice(new BigDecimal("0"));
} else {
outRechargeOrder.setPayRealPrice(payPrice);
}
}
// 卡卷类型 1:满减 2:抵扣 3:折扣
if (highDiscountUserRel.getHighDiscount().getDiscountType() == 2) {
// 计算支付金额 = 商品支付总额 - 满减额度
BigDecimal payPrice = outRechargePrice.getPayPrice().subtract(highDiscountUserRel.getHighDiscount().getDiscountPrice());
outRechargeOrder.setDiscountDeductionPrice(highDiscountUserRel.getHighDiscount().getDiscountPrice());
// 如果总额小于0
if (payPrice.compareTo(new BigDecimal("0")) < 0) {
outRechargeOrder.setPayRealPrice(new BigDecimal("0"));
} else {
outRechargeOrder.setPayRealPrice(payPrice);
}
}
// 卡卷类型 1:满减 2:抵扣 3:折扣
if (highDiscountUserRel.getHighDiscount().getDiscountType() == 3) {
BigDecimal discountPrice = highDiscountUserRel.getHighDiscount().getDiscountPrice();
// 订单总额 * 折扣
BigDecimal payPrice = outRechargePrice.getPayPrice().multiply(discountPrice);
outRechargeOrder.setDiscountDeductionPrice(outRechargePrice.getPayPrice().subtract(payPrice));
outRechargeOrder.setPayRealPrice(payPrice);
}
}
// 判断积分数量是否大于0
if (object.getLong("integralNum") > 0 && bsProductDiscount.getDiscount().compareTo(new BigDecimal("0")) > 0) {
// 判断用户积分是否够
if (object.getLong("integralNum") > userInfoModel.getHighUser().getGold()) {
log.error("HighOrderController --> addOrder() error!", "积分大于用户积分额度");
throw ErrorHelp.genException(SysCode.System, ErrorCode.UN_MEMBER_ERROR, "用户积分" + userInfoModel.getHighUser().getGold());
}
// 积分抵扣金额
BigDecimal integralDeductionPrice = BigDecimal.valueOf(object.getLong("integralNum") / 100);
// 最高可抵扣金额
BigDecimal maxIntegralDeductionPrice = outRechargeOrder.getPayRealPrice().multiply(bsProductDiscount.getDiscount()).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_DOWN);
// 判读积分是否大于限制额度
if (maxIntegralDeductionPrice.compareTo(integralDeductionPrice) > 0) {
log.error("HighOrderController --> addOrder() error!", "积分大于限制额度");
throw ErrorHelp.genException(SysCode.System, ErrorCode.UN_MEMBER_ERROR, "订单最大抵扣积分数量" + object.getLong("integralNum"));
}
// 判断积分抵扣比例是否为100% 并且积分数量是否可以抵扣最后的支付金额
if (bsProductDiscount.getDiscount().compareTo(new BigDecimal(100)) == 0 && integralDeductionPrice.compareTo(outRechargeOrder.getPayRealPrice()) == 0) {
// 查询用户支付密码
HighUserPayPassword userPayPassword = highUserPayPasswordService.getDetailByUser(userInfoModel.getHighUser().getId());
if (userPayPassword == null) {
log.error("orderToPay error!", "未设置支付密码");
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_SET_USER_PAY_PWD, "");
}
if (StringUtils.isBlank(object.getString("password"))) {
log.error("orderToPay error!", "未输入支付密码");
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_ENTER_USER_PAY_PWD, "");
}
// 校验支付密码
if (!AESEncodeUtil.aesEncrypt(object.getString("password")).equals(userPayPassword.getPassword())) {
log.error("orderToPay error!", "");
throw ErrorHelp.genException(SysCode.System, ErrorCode.USER_PAY_PWD_ERROR, "");
}
}
outRechargeOrder.setIntegralDeductionPrice(integralDeductionPrice);
outRechargeOrder.setPayRealPrice(outRechargeOrder.getPayRealPrice().subtract(outRechargeOrder.getIntegralDeductionPrice()));
}
outRechargeOrder.setUserId(userInfoModel.getHighUser().getId());
outRechargeOrder.setRechargeContent(rechargeContent);
outRechargeOrder.setRegionId(object.getString("regionId"));
outRechargeOrder.setUserName(userInfoModel.getHighUser().getName());
outRechargeOrder.setRechargeType(outRechargePrice.getRechargeType());
outRechargeOrder.setUserPhone(userInfoModel.getHighUser().getPhone());
outRechargeOrder.setOrderNo("RCG" + DateUtil.date2String(new Date(),"yyyyMMddHHmmss") + IDGenerator.nextId(5));
outRechargeOrder.setCreateTimed(new Date());
// 判断积分支付是否扣完金额
if (outRechargeOrder.getPayRealPrice().compareTo(new BigDecimal(0)) == 0) {
// 201:充值中 202:充值成功 203:充值失败 204:未充值
outRechargeOrder.setRechargeStatus(201);
// 101.待支付 102.已支付 100.已完成 104.已取消 105.已退款
outRechargeOrder.setPayStatus(102);
} else {
// 201:充值中 202:充值成功 203:充值失败 204:未充值
outRechargeOrder.setRechargeStatus(204);
// 101.待支付 102.已支付 100.已完成 104.已取消 105.已退款
outRechargeOrder.setPayStatus(101);
}
outRechargeOrderService.insertOrder(outRechargeOrder);
return ResponseMsgUtil.success(outRechargeOrder);
return ResponseMsgUtil.success(outRechargeOrderService.insertOrder(object));
} catch (Exception e) {
log.error("HighOrderController -> addOrder() error!",e);
@ -249,7 +79,15 @@ public class OutRechargeOrderController {
public ResponseData getOrderById(@RequestParam(name = "orderId", required = true) Long orderId) {
try {
return ResponseMsgUtil.success(outRechargeOrderService.findByOrderId(orderId));
OutRechargeOrderDetailModel rechargeOrderDetailModel = new OutRechargeOrderDetailModel();
OutRechargeOrder order = outRechargeOrderService.findByOrderId(orderId);
BeanUtils.copyProperties(order, rechargeOrderDetailModel);
rechargeOrderDetailModel.setOutRechargePrice(outRechargePriceService.findByGoodsId(order.getGoodsId()));
return ResponseMsgUtil.success(rechargeOrderDetailModel);
} catch (Exception e) {
log.error("HighOrderController --> getOrderById() error!", e);
@ -265,7 +103,7 @@ public class OutRechargeOrderController {
OutRechargeOrder outRechargeOrder = outRechargeOrderService.findByOrderId(orderId);
if (outRechargeOrder.getRechargeStatus() == 1) {
if (outRechargeOrder.getPayStatus() == 101 && (outRechargeOrder.getRechargeStatus() != 201 || outRechargeOrder.getRechargeStatus() != 202)) {
outRechargeOrderService.cancelOrder(orderId);
} else {
log.error("orderToPay error!");

@ -75,7 +75,7 @@ public class WechatController {
final WxMaService wxService = WxMaConfiguration.getMaService();
WxMaJscode2SessionResult session = wxService.jsCode2SessionInfo(code);
//保存小程序用户登录的openId及sessionKey信息
redisUtil.hset(WX_OPENID_SESSION_REDIS,session.getOpenid(),session);
redisUtil.hset(WX_OPENID_SESSION_REDIS, session.getOpenid(), session);
JSONObject jo = new JSONObject();
jo.put("openId", session.getOpenid());
return ResponseMsgUtil.success(jo);
@ -88,9 +88,9 @@ public class WechatController {
@ResponseBody
@ApiOperation(value = "小程序根据手机号登录或注册")
public ResponseData loginByPhone(@RequestParam(value = "encryptedData", required = true) String encryptedData,
@RequestParam(value = "iv", required = true) String iv,
@RequestParam(value = "openId", required = true) String openId,
HttpServletRequest request, HttpServletResponse response) {
@RequestParam(value = "iv", required = true) String iv,
@RequestParam(value = "openId", required = true) String openId,
HttpServletRequest request, HttpServletResponse response) {
try {
log.error("origin encryptedData:" + encryptedData + ";iv:" + iv);
//校验openId不能为空
@ -104,10 +104,10 @@ public class WechatController {
}
//请求微信api,获取用户session_key以及openId
Object skObject = redisUtil.hget(WX_OPENID_SESSION_REDIS, openId);
if (skObject == null){
if (skObject == null) {
throw ErrorHelp.genException(SysCode.MiniProgram, ErrorCode.WECHAT_LOGIN_ERROR);
}
WxMaJscode2SessionResult session = (WxMaJscode2SessionResult)skObject;
WxMaJscode2SessionResult session = (WxMaJscode2SessionResult) skObject;
final WxMaService wxService = WxMaConfiguration.getMaService();
WxMaPhoneNumberInfo phoneNoInfo = wxService.getUserService().getPhoneNoInfo(session.getSessionKey(), encryptedData, iv);
@ -145,7 +145,7 @@ public class WechatController {
HighUser detailData = highUserService.getDetailDataByUser(user.getId());
detailData.setPassword(null);
highUserModel.setHighUser(detailData);
SessionObject so = new SessionObject(user.getPhone(), 1 , highUserModel);
SessionObject so = new SessionObject(user.getPhone(), 1, highUserModel);
userCenter.save(request, response, so);
return ResponseMsgUtil.success(so);
@ -177,11 +177,11 @@ public class WechatController {
throw ErrorHelp.genException(SysCode.MiniProgram, ErrorCode.REQ_PARAMS_ERROR, "");
}
//请求微信api,获取用户session_key以及openId
Object skObject = redisUtil.hget(WX_OPENID_SESSION_REDIS,openId);
if (skObject == null){
Object skObject = redisUtil.hget(WX_OPENID_SESSION_REDIS, openId);
if (skObject == null) {
throw ErrorHelp.genException(SysCode.MiniProgram, ErrorCode.WECHAT_LOGIN_ERROR);
}
WxMaJscode2SessionResult session = (WxMaJscode2SessionResult)skObject;
WxMaJscode2SessionResult session = (WxMaJscode2SessionResult) skObject;
final WxMaService wxService = WxMaConfiguration.getMaService();
WxMaUserInfo userInfo = wxService.getUserService().getUserInfo(session.getSessionKey(), encryptedData, iv);
@ -217,7 +217,7 @@ public class WechatController {
log.error("login error!", "未绑定手机号");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未绑定手机号");
}
SessionObject so = new SessionObject(user.getPhone(), 1 , highUserModel);
SessionObject so = new SessionObject(user.getPhone(), 1, highUserModel);
userCenter.save(request, response, so);
return ResponseMsgUtil.success(so);
@ -244,38 +244,27 @@ public class WechatController {
}
}
@RequestMapping(value = "/loginByTel", method = RequestMethod.POST)
@RequestMapping(value = "/loginByTel", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根据手机号码登陆")
public ResponseData loginByTel(@RequestBody JSONObject body,
public ResponseData loginByTel(@RequestParam(value = "phone", required = true) String phone,
HttpServletRequest request, HttpServletResponse response) {
try {
if (body == null
|| StringUtils.isBlank(body.getString("phone"))
|| StringUtils.isBlank(body.getString("smsCode"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 根据手机号查询用户
HighUser user = highUserService.findByPhone(body.getString("phone"));
// 获取手机号验证码
String phoneSmsCode = (String) redisUtil.get("SMS_"+ body.getString("phone"));
HighUser user = highUserService.findByPhone(phone);
// 验证码校验
if (StringUtils.isNotBlank(phoneSmsCode) && Objects.equals(phoneSmsCode,body.getString("smsCode"))) {
// 定义个人所有数据
HighUserModel highUserModel = new HighUserModel();
HighUser detailData = highUserService.getDetailDataByUser(user.getId());
detailData.setPassword(null);
highUserModel.setHighUser(detailData);
SessionObject so = new SessionObject(user.getPhone(), 1 , highUserModel);
userCenter.save(request, response, so);
return ResponseMsgUtil.success(so);
}
// 定义个人所有数据
HighUserModel highUserModel = new HighUserModel();
HighUser detailData = highUserService.getDetailDataByUser(user.getId());
detailData.setPassword(null);
highUserModel.setHighUser(detailData);
SessionObject so = new SessionObject(user.getPhone(), 1, highUserModel);
userCenter.save(request, response, so);
return ResponseMsgUtil.success(so);
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "验证码错误");
} catch (Exception e) {
return ResponseMsgUtil.exception(e);

@ -14,8 +14,10 @@ import com.hai.common.security.UserCenter;
import com.hai.common.utils.*;
import com.hai.config.CommonSysConst;
import com.hai.config.UnionPayConfig;
import com.hai.dao.HighGasOrderPushMapper;
import com.hai.dao.HighGasOrderRefundMapper;
import com.hai.entity.*;
import com.hai.enum_type.OrderPushType;
import com.hai.enum_type.RechargePayType;
import com.hai.model.HighUserModel;
import com.hai.model.ResponseData;
@ -68,9 +70,77 @@ public class CzOrderController {
@Resource
private HighUserCardService highUserCardService;
@Resource
private HighGasOrderPushMapper highGasOrderPushMapper;
@Resource
private WechatPayUtil wechatPayUtil;
@RequestMapping(value = "/rechargeCallback", method = RequestMethod.POST)
@ApiOperation(value = "龙阅充值回调")
@ResponseBody
public void rechargeCallback(
@RequestParam(name = "out_trade_num", required = true) String out_trade_num,
@RequestParam(name = "userid", required = true) Long userid,
@RequestParam(name = "state", required = true) Long state,
@RequestBody String reqBodyStr ,
HttpServletRequest request, HttpServletResponse response) {
try {
// 推送记录
HighGasOrderPush highGasOrderPush = new HighGasOrderPush();
highGasOrderPush.setType(OrderPushType.type2.getType());
highGasOrderPush.setOrderNo(out_trade_num);
highGasOrderPush.setCreateTime(new Date());
highGasOrderPush.setCode(state.toString());
highGasOrderPush.setReturnContent(reqBodyStr);
highGasOrderPushMapper.insert(highGasOrderPush);
OutRechargeChildOrder childOrder = outRechargeChildOrderService.findByOrderNo(out_trade_num);
OutRechargeOrder rechargeOrder = outRechargeOrderService.findByOrderId(childOrder.getParentOrderId());
BsRequestRecord bsRequestRecord = bsRequestRecordService.findRequestRecordByOrderNo(childOrder.getOrderNo());
bsRequestRecord.setReturnContent(reqBodyStr);
bsRequestRecord.setUpdateTime(new Date());
bsRequestRecordService.updateRequestRecord(bsRequestRecord);
// 判断是否充值成功
if (state == 1) {
new Thread(() -> {
HighUser highUser = highUserService.findByUserId(rechargeOrder.getUserId());
WxMsgConfig.rechargedSuccess(
rechargeOrder.getRechargeContent() + "充值成功",
String.valueOf(rechargeOrder.getPayRealPrice()),
rechargeOrder.getOrderNo(),
rechargeOrder.getFinishTime(),
RechargePayType.getNameByType(rechargeOrder.getPayType()),
highUser.getOpenId());
}).start();
childOrder.setStatus(101);
rechargeOrder.setRechargeStatus(202);
rechargeOrder.setPayStatus(100);
outRechargeOrderService.updateOrder(rechargeOrder);
outRechargeChildOrderService.updateOrder(childOrder);
} else {
callbackResult(childOrder , rechargeOrder);
}
response.setCharacterEncoding("UTF-8");
response.setContentType("text/html;charset=utf-8");
PrintWriter writer= response.getWriter();
writer.write("SUCCESS");
} catch (Exception e) {
log.error("WechatPayController --> wechatNotify() error!", e);
}
}
@RequestMapping(value = "/rechargeCallbackByJj", method = RequestMethod.POST)
@ApiOperation(value = "尖椒充值回调")
@ResponseBody
@ -78,6 +148,18 @@ public class CzOrderController {
try {
JSONObject dataObject = JSONObject.parseObject(reqBodyStr, JSONObject.class);
// 推送记录
HighGasOrderPush highGasOrderPush = new HighGasOrderPush();
highGasOrderPush.setType(OrderPushType.type2.getType());
highGasOrderPush.setOrderNo(dataObject.getString("out_order_id"));
highGasOrderPush.setCreateTime(new Date());
highGasOrderPush.setCode(dataObject.getString("status"));
highGasOrderPush.setRequestContent(JSONObject.toJSONString(dataObject));
highGasOrderPush.setReturnContent(dataObject.toJSONString());
highGasOrderPushMapper.insert(highGasOrderPush);
// 1 尖椒 2 龙阅
dataObject.put("orderNo" , dataObject.getString("out_order_id"));
@ -103,6 +185,12 @@ public class CzOrderController {
RechargePayType.getNameByType(rechargeOrder.getPayType()),
highUser.getOpenId());
}).start();
childOrder.setStatus(101);
rechargeOrder.setRechargeStatus(202);
rechargeOrder.setPayStatus(100);
outRechargeOrderService.updateOrder(rechargeOrder);
outRechargeChildOrderService.updateOrder(childOrder);
} else {
callbackResult(childOrder , rechargeOrder);
}
@ -121,23 +209,35 @@ public class CzOrderController {
@RequestMapping(value = "/rechargeCallbackByLy", method = RequestMethod.POST)
@ApiOperation(value = "龙阅充值回调")
@ResponseBody
public void rechargeCallbackByLy(@RequestBody String reqBodyStr, HttpServletRequest request, HttpServletResponse response) {
public void rechargeCallbackByLy(
@RequestParam(name = "out_trade_num", required = true) String out_trade_num,
@RequestParam(name = "userid", required = true) Long userid,
@RequestParam(name = "state", required = true) Long state,
@RequestBody String reqBodyStr ,
HttpServletRequest request, HttpServletResponse response) {
try {
JSONObject dataObject = JSONObject.parseObject(reqBodyStr, JSONObject.class);
// 1 尖椒 2 龙阅
dataObject.put("orderNo" , dataObject.getString("out_trade_num"));
OutRechargeChildOrder childOrder = outRechargeChildOrderService.findByOrderNo(dataObject.getString("out_order_id"));
// 推送记录
HighGasOrderPush highGasOrderPush = new HighGasOrderPush();
highGasOrderPush.setType(OrderPushType.type2.getType());
highGasOrderPush.setOrderNo(out_trade_num);
highGasOrderPush.setCreateTime(new Date());
highGasOrderPush.setCode(state.toString());
highGasOrderPush.setReturnContent(reqBodyStr);
highGasOrderPushMapper.insert(highGasOrderPush);
OutRechargeChildOrder childOrder = outRechargeChildOrderService.findByOrderNo(out_trade_num);
OutRechargeOrder rechargeOrder = outRechargeOrderService.findByOrderId(childOrder.getParentOrderId());
BsRequestRecord bsRequestRecord = bsRequestRecordService.findRequestRecordByOrderNo(childOrder.getOrderNo());
bsRequestRecord.setReturnContent(String.valueOf(dataObject));
bsRequestRecord.setReturnContent(reqBodyStr);
bsRequestRecord.setUpdateTime(new Date());
bsRequestRecordService.updateRequestRecord(bsRequestRecord);
// 判断是否充值成功
if (dataObject.getInteger("status") == 3) {
if (state == 1) {
new Thread(() -> {
HighUser highUser = highUserService.findByUserId(rechargeOrder.getUserId());
WxMsgConfig.rechargedSuccess(
@ -148,6 +248,12 @@ public class CzOrderController {
RechargePayType.getNameByType(rechargeOrder.getPayType()),
highUser.getOpenId());
}).start();
childOrder.setStatus(101);
rechargeOrder.setRechargeStatus(202);
rechargeOrder.setPayStatus(100);
outRechargeOrderService.updateOrder(rechargeOrder);
outRechargeChildOrderService.updateOrder(childOrder);
} else {
callbackResult(childOrder , rechargeOrder);
}
@ -226,9 +332,9 @@ public class CzOrderController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到订单信息");
}
// 订单状态 : 1.待支付 2.已支付 3.已完成 4.已退款 5.已取消
if (order.getRechargeStatus() != 1) {
log.error("orderToPay error!", "无法支付,订单不处于待支付状态");
// 订单状态 : 订单支付状态 : 101.待支付 102.已支付 100.已完成 104.已取消 105.已退款
if (order.getPayStatus() != 101) {
log.error("orderToPayByWx error!", "无法支付,订单不处于待支付状态");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法支付,订单不处于待支付状态");
}
@ -307,8 +413,8 @@ public class CzOrderController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到订单信息");
}
// 订单状态 : 1.待支付 2.已支付 3.已完成 4.已退款 5.已取消
if (order.getRechargeStatus() != 1) {
// 订单状态 : 订单支付状态 : 101.待支付 102.已支付 100.已完成 104.已取消 105.已退款
if (order.getPayStatus() != 101) {
log.error("hltUnionCardPay error!", "无法支付,订单不处于待支付状态");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法支付,订单不处于待支付状态");
}
@ -349,8 +455,8 @@ public class CzOrderController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到订单信息");
}
// 订单状态 : 1.待支付 2.已支付 3.已完成 4.已退款 5.已取消
if (order.getPayStatus() != 1) {
// 订单状态 : 订单支付状态 : 101.待支付 102.已支付 100.已完成 104.已取消 105.已退款
if (order.getPayStatus() != 101) {
log.error("hltUnionCardPay error!", "无法支付,订单不处于待支付状态");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法支付,订单不处于待支付状态");
}

@ -87,6 +87,9 @@ public class OrderController {
@Resource
private HighMerchantStoreService merchantStoreService;
@Resource
private HighMerchantTripartitePlatformService tripartitePlatformService;
@Resource
private HighQzOrderService highQzOrderService;
@ -193,6 +196,8 @@ 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();
@ -211,6 +216,27 @@ public class OrderController {
} else if (order.getHighChildOrderList().get(0).getGoodsType() == 3) {
weChatPayReqInfo.setSub_mch_id("1624126902"); // 浩联商户号
profitSharing = "Y";
// 查询油站
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.getId(), 1);
if (merTripartitePlatform != null) {
weChatPayReqInfo.setSub_mch_id(merTripartitePlatform.getPlatformMerNumber());
if (merTripartitePlatform.getProfitSharingRatio().compareTo(new BigDecimal("0")) == 1) {
profitSharing = merTripartitePlatform.getProfitSharingStatus().equals(true)?"Y":"N";
}
}
}
if (store.getPrestoreType().equals(1)) {
profitSharing = "N";
}
}
} else {
//子商户号
weChatPayReqInfo.setSub_mch_id(SysConst.getSysConfig().getWxSubMchId());
@ -236,6 +262,9 @@ public class OrderController {
payMap.put("unified_order_url",SysConst.getSysConfig().getWxUnifiedOrderUrl());
SortedMap<Object, Object> sortedMap = wechatPayUtil.goWechatPay(weChatPayReqInfo,payMap);
order.setProfitSharingRatio(profitSharingRatio);
order.setProfitSharingStatus(profitSharing.equals("Y")?true:false);
order.setAccountMerchantNum(weChatPayReqInfo.getSub_mch_id());
order.setExt1(weChatPayReqInfo.getSub_appid());
highOrderService.updateOrderDetail(order);
return ResponseMsgUtil.success(sortedMap);

@ -383,27 +383,22 @@ public class UnionPayController {
// 转换成JSON格式
JSONObject body = JSONObject.parseObject(paramsStr.substring(0, paramsStr.length() - 1));
// if (StringUtils.isNotBlank(body.getString("tradetrace"))) {
// OutRechargeOrder order = outRechargeOrderService.findByOrderNo(body.getString("tradetrace"));
// if (order == null) {
// throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到订单信息");
// }
//
// order.setPaySerialNo(body.getString("wtorderid")); // 支付流水号
// order.setPayRealPrice(order.getPayPrice()); // 实付金额
//
// order.setStatus(2);
// order.setPayType(4);
// order.setPayTime(new Date()); // 支付时间
// if (order.getRechargeType() == 1) {
// JSONObject object = outRechargeOrderService.getMobile(order.getRechargeContent() , order.getOrderPrice().intValue() , order.getOrderNo() , order.getRechargeType());
// if (object.getInteger("code") != 200) {
// order.setRechargeStatus(1);
// order.setAbnormalMsg(object.getString("message"));
// }
// }
// outRechargeOrderService.updateOrder(order);
// }
if (StringUtils.isNotBlank(body.getString("tradetrace"))) {
OutRechargeOrder order = outRechargeOrderService.findByOrderNo(body.getString("tradetrace"));
if (order == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到订单信息");
}
order.setPaySerialNo(body.getString("wtorderid")); // 支付流水号
order.setPayRealPrice(order.getPayRealPrice()); // 实付金额
order.setPayStatus(102);
order.setRechargeStatus(204);
order.setPayType(4);
order.setPayTime(new Date()); // 支付时间
outRechargeOrderService.updateOrder(order);
outRechargeOrderService.pollRequest(order);
}
}
BufferedOutputStream out = new BufferedOutputStream(response.getOutputStream());

@ -151,7 +151,7 @@ public class HighGasSchedule {
}
}
@Scheduled(cron = "0 1 7 * * ?") //每日7点1分执行一次
@Scheduled(cron = "0 30 7 * * ?") //每日7点1分执行一次
public void refreshPriceOfficial() throws Exception {
gasOilPriceOfficialService.refreshPriceOfficial();

@ -6,9 +6,11 @@ import com.hai.config.QianZhuConfig;
import com.hai.config.WxOrderConfig;
import com.hai.entity.HighChildOrder;
import com.hai.entity.HighOrder;
import com.hai.entity.OutRechargeChildOrder;
import com.hai.entity.OutRechargeOrder;
import com.hai.model.OrderRefundModel;
import com.hai.service.HighOrderService;
import com.hai.service.OutRechargeChildOrderService;
import com.hai.service.OutRechargeOrderService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -38,6 +40,9 @@ public class HighOrderSchedule {
@Resource
private OutRechargeOrderService outRechargeOrderService;
@Resource
private OutRechargeChildOrderService rechargeChildOrderService;
/**
* @Author 胡锐
* @Description 取消订单 15分钟
@ -79,6 +84,57 @@ public class HighOrderSchedule {
}
}
/**
* @Author Sum1Dream
* @name cancelOrder.java
* @Description // 定时发起
* @Date 14:18 2022/5/31
* @Param []
* @return void
*/
@Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次
public void initRechargeOrder() {
Map<String, String> map = new HashMap<>();
map.put("status" , String.valueOf(102));
map.put("rechargeStatus" , String.valueOf(204));
List<OutRechargeOrder> orderList = outRechargeOrderService.getListRechargeOrder(map);
if (orderList != null && orderList.size() > 0) {
for (OutRechargeOrder order : orderList) {
try {
// 查询充值子订单
Map<String, Object> childOrderMap = new HashMap<>();
childOrderMap.put("parent_order_id" , order.getId());
childOrderMap.put("status" , 102);
List<OutRechargeChildOrder> childOrderList = rechargeChildOrderService.getListRechargeChildOrder(childOrderMap);
if (childOrderList.size() == 0) {
Date rechargeTime = order.getCreateTimed();
Date currentTime = new Date();
int hours = (int) ((currentTime.getTime() - rechargeTime.getTime()) / (1000 * 60 * 60));
// 判断快充 并且 充值时间小于6
if (order.getRechargeType() == 1 && hours < 6) {
outRechargeOrderService.pollRequest(order);
return;
}
// 判断慢充 并且 充值时间小于72
if (order.getRechargeType() == 2 && hours < 72) {
outRechargeOrderService.pollRequest(order);
return;
}
outRechargeOrderService.rechargeOrderToRefund(order.getId());
}
} catch (Exception e) {
log.error("HighCouponSchedule --> expiredCoupon() error!", e);
}
}
}
}
/**
* @Author 胡锐
* @Description 处理话费充值订单

@ -34,6 +34,19 @@ public class DateUtil {
public static final String Y_M = "yyyy-MM";
private static final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
//计算两个时间相差的秒数
public static long getSecondDiff(Date startTime, Date endTime) {
try {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
long eTime = endTime.getTime();
long sTime = startTime.getTime();
long diff = (eTime - sTime) / 1000;
return diff;
} catch (Exception e) {
log.error("getSecondDiff error", e);
}
return 0;
}
public static Integer getThisYear(){
Calendar calendar = Calendar.getInstance();
@ -765,9 +778,11 @@ public class DateUtil {
public static void main(String[] args) throws Exception {
String a = "51130319931105651X";
System.out.println(a.substring(6,10));
System.out.println(a.substring(10,12));
System.out.println(a.substring(12,14));
Date date = new Date();
date.setTime(1653979200000L);
System.out.println(getSecondDiff(new Date(), date));
}
}

@ -22,6 +22,7 @@ public interface HighGasOilPriceMapperExt {
" a.price_gun," +
" a.price_vip," +
" a.price_official," +
" a.preferential_margin," +
" b.* " +
" FROM" +
" high_gas_oil_price a," +

@ -40,25 +40,27 @@ public interface HighGasOilPriceTaskMapper extends HighGasOilPriceTaskMapperExt
@Insert({
"insert into high_gas_oil_price_task (region_id, region_name, ",
"mer_store_id, mer_store_name, ",
"mer_store_address, oil_type, ",
"oil_type_name, oil_no, ",
"oil_no_name, price_type, ",
"price, execution_type, ",
"start_time, `status`, ",
"create_time, update_time, ",
"op_user_id, op_user_name, ",
"ext_1, ext_2, ext_3)",
"mer_store_key, mer_store_id, ",
"mer_store_name, mer_store_address, ",
"oil_type, oil_type_name, ",
"oil_no, oil_no_name, ",
"price_type, price, ",
"execution_type, start_time, ",
"`status`, create_time, ",
"update_time, op_user_id, ",
"op_user_name, ext_1, ",
"ext_2, ext_3)",
"values (#{regionId,jdbcType=BIGINT}, #{regionName,jdbcType=VARCHAR}, ",
"#{merStoreId,jdbcType=BIGINT}, #{merStoreName,jdbcType=VARCHAR}, ",
"#{merStoreAddress,jdbcType=VARCHAR}, #{oilType,jdbcType=INTEGER}, ",
"#{oilTypeName,jdbcType=VARCHAR}, #{oilNo,jdbcType=INTEGER}, ",
"#{oilNoName,jdbcType=VARCHAR}, #{priceType,jdbcType=INTEGER}, ",
"#{price,jdbcType=DECIMAL}, #{executionType,jdbcType=INTEGER}, ",
"#{startTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{opUserId,jdbcType=BIGINT}, #{opUserName,jdbcType=VARCHAR}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"#{merStoreKey,jdbcType=VARCHAR}, #{merStoreId,jdbcType=BIGINT}, ",
"#{merStoreName,jdbcType=VARCHAR}, #{merStoreAddress,jdbcType=VARCHAR}, ",
"#{oilType,jdbcType=INTEGER}, #{oilTypeName,jdbcType=VARCHAR}, ",
"#{oilNo,jdbcType=INTEGER}, #{oilNoName,jdbcType=VARCHAR}, ",
"#{priceType,jdbcType=INTEGER}, #{price,jdbcType=DECIMAL}, ",
"#{executionType,jdbcType=INTEGER}, #{startTime,jdbcType=TIMESTAMP}, ",
"#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{opUserId,jdbcType=BIGINT}, ",
"#{opUserName,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighGasOilPriceTask record);
@ -72,6 +74,7 @@ public interface HighGasOilPriceTaskMapper extends HighGasOilPriceTaskMapperExt
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="region_id", property="regionId", jdbcType=JdbcType.BIGINT),
@Result(column="region_name", property="regionName", jdbcType=JdbcType.VARCHAR),
@Result(column="mer_store_key", property="merStoreKey", jdbcType=JdbcType.VARCHAR),
@Result(column="mer_store_id", property="merStoreId", jdbcType=JdbcType.BIGINT),
@Result(column="mer_store_name", property="merStoreName", jdbcType=JdbcType.VARCHAR),
@Result(column="mer_store_address", property="merStoreAddress", jdbcType=JdbcType.VARCHAR),
@ -96,7 +99,7 @@ public interface HighGasOilPriceTaskMapper extends HighGasOilPriceTaskMapperExt
@Select({
"select",
"id, region_id, region_name, mer_store_id, mer_store_name, mer_store_address, ",
"id, region_id, region_name, mer_store_key, mer_store_id, mer_store_name, mer_store_address, ",
"oil_type, oil_type_name, oil_no, oil_no_name, price_type, price, execution_type, ",
"start_time, `status`, create_time, update_time, op_user_id, op_user_name, ext_1, ",
"ext_2, ext_3",
@ -107,6 +110,7 @@ public interface HighGasOilPriceTaskMapper extends HighGasOilPriceTaskMapperExt
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="region_id", property="regionId", jdbcType=JdbcType.BIGINT),
@Result(column="region_name", property="regionName", jdbcType=JdbcType.VARCHAR),
@Result(column="mer_store_key", property="merStoreKey", jdbcType=JdbcType.VARCHAR),
@Result(column="mer_store_id", property="merStoreId", jdbcType=JdbcType.BIGINT),
@Result(column="mer_store_name", property="merStoreName", jdbcType=JdbcType.VARCHAR),
@Result(column="mer_store_address", property="merStoreAddress", jdbcType=JdbcType.VARCHAR),
@ -142,6 +146,7 @@ public interface HighGasOilPriceTaskMapper extends HighGasOilPriceTaskMapperExt
"update high_gas_oil_price_task",
"set region_id = #{regionId,jdbcType=BIGINT},",
"region_name = #{regionName,jdbcType=VARCHAR},",
"mer_store_key = #{merStoreKey,jdbcType=VARCHAR},",
"mer_store_id = #{merStoreId,jdbcType=BIGINT},",
"mer_store_name = #{merStoreName,jdbcType=VARCHAR},",
"mer_store_address = #{merStoreAddress,jdbcType=VARCHAR},",

@ -36,6 +36,10 @@ public class HighGasOilPriceTaskSqlProvider {
sql.VALUES("region_name", "#{regionName,jdbcType=VARCHAR}");
}
if (record.getMerStoreKey() != null) {
sql.VALUES("mer_store_key", "#{merStoreKey,jdbcType=VARCHAR}");
}
if (record.getMerStoreId() != null) {
sql.VALUES("mer_store_id", "#{merStoreId,jdbcType=BIGINT}");
}
@ -124,6 +128,7 @@ public class HighGasOilPriceTaskSqlProvider {
}
sql.SELECT("region_id");
sql.SELECT("region_name");
sql.SELECT("mer_store_key");
sql.SELECT("mer_store_id");
sql.SELECT("mer_store_name");
sql.SELECT("mer_store_address");
@ -172,6 +177,10 @@ public class HighGasOilPriceTaskSqlProvider {
sql.SET("region_name = #{record.regionName,jdbcType=VARCHAR}");
}
if (record.getMerStoreKey() != null) {
sql.SET("mer_store_key = #{record.merStoreKey,jdbcType=VARCHAR}");
}
if (record.getMerStoreId() != null) {
sql.SET("mer_store_id = #{record.merStoreId,jdbcType=BIGINT}");
}
@ -259,6 +268,7 @@ public class HighGasOilPriceTaskSqlProvider {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("region_id = #{record.regionId,jdbcType=BIGINT}");
sql.SET("region_name = #{record.regionName,jdbcType=VARCHAR}");
sql.SET("mer_store_key = #{record.merStoreKey,jdbcType=VARCHAR}");
sql.SET("mer_store_id = #{record.merStoreId,jdbcType=BIGINT}");
sql.SET("mer_store_name = #{record.merStoreName,jdbcType=VARCHAR}");
sql.SET("mer_store_address = #{record.merStoreAddress,jdbcType=VARCHAR}");
@ -296,6 +306,10 @@ public class HighGasOilPriceTaskSqlProvider {
sql.SET("region_name = #{regionName,jdbcType=VARCHAR}");
}
if (record.getMerStoreKey() != null) {
sql.SET("mer_store_key = #{merStoreKey,jdbcType=VARCHAR}");
}
if (record.getMerStoreId() != null) {
sql.SET("mer_store_id = #{merStoreId,jdbcType=BIGINT}");
}

@ -0,0 +1,122 @@
package com.hai.dao;
import com.hai.entity.HighMerchantAccount;
import com.hai.entity.HighMerchantAccountExample;
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 HighMerchantAccountMapper extends HighMerchantAccountMapperExt {
@SelectProvider(type=HighMerchantAccountSqlProvider.class, method="countByExample")
long countByExample(HighMerchantAccountExample example);
@DeleteProvider(type=HighMerchantAccountSqlProvider.class, method="deleteByExample")
int deleteByExample(HighMerchantAccountExample example);
@Delete({
"delete from high_merchant_account",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into high_merchant_account (mer_id, mer_name, ",
"account_no, amounts, ",
"`status`, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"values (#{merId,jdbcType=BIGINT}, #{merName,jdbcType=VARCHAR}, ",
"#{accountNo,jdbcType=VARCHAR}, #{amounts,jdbcType=DECIMAL}, ",
"#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighMerchantAccount record);
@InsertProvider(type=HighMerchantAccountSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(HighMerchantAccount record);
@SelectProvider(type=HighMerchantAccountSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
@Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR),
@Result(column="account_no", property="accountNo", jdbcType=JdbcType.VARCHAR),
@Result(column="amounts", property="amounts", jdbcType=JdbcType.DECIMAL),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
List<HighMerchantAccount> selectByExample(HighMerchantAccountExample example);
@Select({
"select",
"id, mer_id, mer_name, account_no, amounts, `status`, create_time, update_time, ",
"ext_1, ext_2, ext_3",
"from high_merchant_account",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
@Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR),
@Result(column="account_no", property="accountNo", jdbcType=JdbcType.VARCHAR),
@Result(column="amounts", property="amounts", jdbcType=JdbcType.DECIMAL),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
HighMerchantAccount selectByPrimaryKey(Long id);
@UpdateProvider(type=HighMerchantAccountSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") HighMerchantAccount record, @Param("example") HighMerchantAccountExample example);
@UpdateProvider(type=HighMerchantAccountSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") HighMerchantAccount record, @Param("example") HighMerchantAccountExample example);
@UpdateProvider(type=HighMerchantAccountSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(HighMerchantAccount record);
@Update({
"update high_merchant_account",
"set mer_id = #{merId,jdbcType=BIGINT},",
"mer_name = #{merName,jdbcType=VARCHAR},",
"account_no = #{accountNo,jdbcType=VARCHAR},",
"amounts = #{amounts,jdbcType=DECIMAL},",
"`status` = #{status,jdbcType=INTEGER},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=TIMESTAMP},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR}",
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(HighMerchantAccount record);
}

@ -0,0 +1,38 @@
package com.hai.dao;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
/**
* mapper扩展类
*/
public interface HighMerchantAccountMapperExt {
@Select({"select " +
" case when sum(b.total_price) is not null then sum(b.total_price) ELSE 0 end " +
" from high_child_order a, high_order b" +
" where goods_type = 3 " +
" and a.order_id = b.id" +
" and goods_id in (SELECT id from high_merchant_store where merchant_id = #{merId}) " +
" and b.order_status in (2,3,6,7)"})
BigDecimal countMerGasOilAmount(@Param("merId") Long merId);
@Select({
" SELECT ms.id, ms.store_name, ms.address," +
" (select " +
" case when sum(b.total_price) is not null then sum(b.total_price) else 0 end" +
" from high_child_order a, high_order b" +
" where a.order_id = b.id" +
" and goods_type = 3" +
" and goods_id = ms.id" +
" and b.order_status in (2,3,6,7)) countPrice" +
" from high_merchant_store ms where ms.merchant_id = #{merId}" +
" ORDER BY countPrice desc"
})
List<Map<String, Object>> selectStoreGasOilAmountByMer(@Param("merId") Long merId);
}

@ -0,0 +1,318 @@
package com.hai.dao;
import com.hai.entity.HighMerchantAccount;
import com.hai.entity.HighMerchantAccountExample.Criteria;
import com.hai.entity.HighMerchantAccountExample.Criterion;
import com.hai.entity.HighMerchantAccountExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class HighMerchantAccountSqlProvider {
public String countByExample(HighMerchantAccountExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("high_merchant_account");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(HighMerchantAccountExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("high_merchant_account");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(HighMerchantAccount record) {
SQL sql = new SQL();
sql.INSERT_INTO("high_merchant_account");
if (record.getMerId() != null) {
sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}");
}
if (record.getMerName() != null) {
sql.VALUES("mer_name", "#{merName,jdbcType=VARCHAR}");
}
if (record.getAccountNo() != null) {
sql.VALUES("account_no", "#{accountNo,jdbcType=VARCHAR}");
}
if (record.getAmounts() != null) {
sql.VALUES("amounts", "#{amounts,jdbcType=DECIMAL}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}");
}
return sql.toString();
}
public String selectByExample(HighMerchantAccountExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("mer_id");
sql.SELECT("mer_name");
sql.SELECT("account_no");
sql.SELECT("amounts");
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_merchant_account");
applyWhere(sql, example, false);
if (example != null && example.getOrderByClause() != null) {
sql.ORDER_BY(example.getOrderByClause());
}
return sql.toString();
}
public String updateByExampleSelective(Map<String, Object> parameter) {
HighMerchantAccount record = (HighMerchantAccount) parameter.get("record");
HighMerchantAccountExample example = (HighMerchantAccountExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("high_merchant_account");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getMerId() != null) {
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}");
}
if (record.getMerName() != null) {
sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}");
}
if (record.getAccountNo() != null) {
sql.SET("account_no = #{record.accountNo,jdbcType=VARCHAR}");
}
if (record.getAmounts() != null) {
sql.SET("amounts = #{record.amounts,jdbcType=DECIMAL}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
}
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByExample(Map<String, Object> parameter) {
SQL sql = new SQL();
sql.UPDATE("high_merchant_account");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}");
sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}");
sql.SET("account_no = #{record.accountNo,jdbcType=VARCHAR}");
sql.SET("amounts = #{record.amounts,jdbcType=DECIMAL}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
HighMerchantAccountExample example = (HighMerchantAccountExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(HighMerchantAccount record) {
SQL sql = new SQL();
sql.UPDATE("high_merchant_account");
if (record.getMerId() != null) {
sql.SET("mer_id = #{merId,jdbcType=BIGINT}");
}
if (record.getMerName() != null) {
sql.SET("mer_name = #{merName,jdbcType=VARCHAR}");
}
if (record.getAccountNo() != null) {
sql.SET("account_no = #{accountNo,jdbcType=VARCHAR}");
}
if (record.getAmounts() != null) {
sql.SET("amounts = #{amounts,jdbcType=DECIMAL}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}");
}
sql.WHERE("id = #{id,jdbcType=BIGINT}");
return sql.toString();
}
protected void applyWhere(SQL sql, HighMerchantAccountExample 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,130 @@
package com.hai.dao;
import com.hai.entity.HighMerchantTripartitePlatform;
import com.hai.entity.HighMerchantTripartitePlatformExample;
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 HighMerchantTripartitePlatformMapper extends HighMerchantTripartitePlatformMapperExt {
@SelectProvider(type=HighMerchantTripartitePlatformSqlProvider.class, method="countByExample")
long countByExample(HighMerchantTripartitePlatformExample example);
@DeleteProvider(type=HighMerchantTripartitePlatformSqlProvider.class, method="deleteByExample")
int deleteByExample(HighMerchantTripartitePlatformExample example);
@Delete({
"delete from high_merchant_tripartite_platform",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into high_merchant_tripartite_platform (mer_id, platform_type, ",
"platform_mer_name, platform_mer_number, ",
"profit_sharing_status, profit_sharing_ratio, ",
"`status`, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"values (#{merId,jdbcType=BIGINT}, #{platformType,jdbcType=INTEGER}, ",
"#{platformMerName,jdbcType=VARCHAR}, #{platformMerNumber,jdbcType=VARCHAR}, ",
"#{profitSharingStatus,jdbcType=BIT}, #{profitSharingRatio,jdbcType=DECIMAL}, ",
"#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighMerchantTripartitePlatform record);
@InsertProvider(type=HighMerchantTripartitePlatformSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(HighMerchantTripartitePlatform record);
@SelectProvider(type=HighMerchantTripartitePlatformSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
@Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER),
@Result(column="platform_mer_name", property="platformMerName", jdbcType=JdbcType.VARCHAR),
@Result(column="platform_mer_number", property="platformMerNumber", jdbcType=JdbcType.VARCHAR),
@Result(column="profit_sharing_status", property="profitSharingStatus", jdbcType=JdbcType.BIT),
@Result(column="profit_sharing_ratio", property="profitSharingRatio", jdbcType=JdbcType.DECIMAL),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
List<HighMerchantTripartitePlatform> selectByExample(HighMerchantTripartitePlatformExample example);
@Select({
"select",
"id, mer_id, platform_type, platform_mer_name, platform_mer_number, profit_sharing_status, ",
"profit_sharing_ratio, `status`, create_time, update_time, ext_1, ext_2, ext_3",
"from high_merchant_tripartite_platform",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
@Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER),
@Result(column="platform_mer_name", property="platformMerName", jdbcType=JdbcType.VARCHAR),
@Result(column="platform_mer_number", property="platformMerNumber", jdbcType=JdbcType.VARCHAR),
@Result(column="profit_sharing_status", property="profitSharingStatus", jdbcType=JdbcType.BIT),
@Result(column="profit_sharing_ratio", property="profitSharingRatio", jdbcType=JdbcType.DECIMAL),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
HighMerchantTripartitePlatform selectByPrimaryKey(Long id);
@UpdateProvider(type=HighMerchantTripartitePlatformSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") HighMerchantTripartitePlatform record, @Param("example") HighMerchantTripartitePlatformExample example);
@UpdateProvider(type=HighMerchantTripartitePlatformSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") HighMerchantTripartitePlatform record, @Param("example") HighMerchantTripartitePlatformExample example);
@UpdateProvider(type=HighMerchantTripartitePlatformSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(HighMerchantTripartitePlatform record);
@Update({
"update high_merchant_tripartite_platform",
"set mer_id = #{merId,jdbcType=BIGINT},",
"platform_type = #{platformType,jdbcType=INTEGER},",
"platform_mer_name = #{platformMerName,jdbcType=VARCHAR},",
"platform_mer_number = #{platformMerNumber,jdbcType=VARCHAR},",
"profit_sharing_status = #{profitSharingStatus,jdbcType=BIT},",
"profit_sharing_ratio = #{profitSharingRatio,jdbcType=DECIMAL},",
"`status` = #{status,jdbcType=INTEGER},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=TIMESTAMP},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR}",
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(HighMerchantTripartitePlatform record);
}

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

@ -0,0 +1,346 @@
package com.hai.dao;
import com.hai.entity.HighMerchantTripartitePlatform;
import com.hai.entity.HighMerchantTripartitePlatformExample.Criteria;
import com.hai.entity.HighMerchantTripartitePlatformExample.Criterion;
import com.hai.entity.HighMerchantTripartitePlatformExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class HighMerchantTripartitePlatformSqlProvider {
public String countByExample(HighMerchantTripartitePlatformExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("high_merchant_tripartite_platform");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(HighMerchantTripartitePlatformExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("high_merchant_tripartite_platform");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(HighMerchantTripartitePlatform record) {
SQL sql = new SQL();
sql.INSERT_INTO("high_merchant_tripartite_platform");
if (record.getMerId() != null) {
sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}");
}
if (record.getPlatformType() != null) {
sql.VALUES("platform_type", "#{platformType,jdbcType=INTEGER}");
}
if (record.getPlatformMerName() != null) {
sql.VALUES("platform_mer_name", "#{platformMerName,jdbcType=VARCHAR}");
}
if (record.getPlatformMerNumber() != null) {
sql.VALUES("platform_mer_number", "#{platformMerNumber,jdbcType=VARCHAR}");
}
if (record.getProfitSharingStatus() != null) {
sql.VALUES("profit_sharing_status", "#{profitSharingStatus,jdbcType=BIT}");
}
if (record.getProfitSharingRatio() != null) {
sql.VALUES("profit_sharing_ratio", "#{profitSharingRatio,jdbcType=DECIMAL}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}");
}
return sql.toString();
}
public String selectByExample(HighMerchantTripartitePlatformExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("mer_id");
sql.SELECT("platform_type");
sql.SELECT("platform_mer_name");
sql.SELECT("platform_mer_number");
sql.SELECT("profit_sharing_status");
sql.SELECT("profit_sharing_ratio");
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_merchant_tripartite_platform");
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) {
HighMerchantTripartitePlatform record = (HighMerchantTripartitePlatform) parameter.get("record");
HighMerchantTripartitePlatformExample example = (HighMerchantTripartitePlatformExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("high_merchant_tripartite_platform");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getMerId() != null) {
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}");
}
if (record.getPlatformType() != null) {
sql.SET("platform_type = #{record.platformType,jdbcType=INTEGER}");
}
if (record.getPlatformMerName() != null) {
sql.SET("platform_mer_name = #{record.platformMerName,jdbcType=VARCHAR}");
}
if (record.getPlatformMerNumber() != null) {
sql.SET("platform_mer_number = #{record.platformMerNumber,jdbcType=VARCHAR}");
}
if (record.getProfitSharingStatus() != null) {
sql.SET("profit_sharing_status = #{record.profitSharingStatus,jdbcType=BIT}");
}
if (record.getProfitSharingRatio() != null) {
sql.SET("profit_sharing_ratio = #{record.profitSharingRatio,jdbcType=DECIMAL}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
}
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByExample(Map<String, Object> parameter) {
SQL sql = new SQL();
sql.UPDATE("high_merchant_tripartite_platform");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}");
sql.SET("platform_type = #{record.platformType,jdbcType=INTEGER}");
sql.SET("platform_mer_name = #{record.platformMerName,jdbcType=VARCHAR}");
sql.SET("platform_mer_number = #{record.platformMerNumber,jdbcType=VARCHAR}");
sql.SET("profit_sharing_status = #{record.profitSharingStatus,jdbcType=BIT}");
sql.SET("profit_sharing_ratio = #{record.profitSharingRatio,jdbcType=DECIMAL}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
HighMerchantTripartitePlatformExample example = (HighMerchantTripartitePlatformExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(HighMerchantTripartitePlatform record) {
SQL sql = new SQL();
sql.UPDATE("high_merchant_tripartite_platform");
if (record.getMerId() != null) {
sql.SET("mer_id = #{merId,jdbcType=BIGINT}");
}
if (record.getPlatformType() != null) {
sql.SET("platform_type = #{platformType,jdbcType=INTEGER}");
}
if (record.getPlatformMerName() != null) {
sql.SET("platform_mer_name = #{platformMerName,jdbcType=VARCHAR}");
}
if (record.getPlatformMerNumber() != null) {
sql.SET("platform_mer_number = #{platformMerNumber,jdbcType=VARCHAR}");
}
if (record.getProfitSharingStatus() != null) {
sql.SET("profit_sharing_status = #{profitSharingStatus,jdbcType=BIT}");
}
if (record.getProfitSharingRatio() != null) {
sql.SET("profit_sharing_ratio = #{profitSharingRatio,jdbcType=DECIMAL}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}");
}
sql.WHERE("id = #{id,jdbcType=BIGINT}");
return sql.toString();
}
protected void applyWhere(SQL sql, HighMerchantTripartitePlatformExample 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());
}
}
}

@ -53,8 +53,9 @@ public interface HighOrderMapper extends HighOrderMapperExt {
"finish_time, remarks, ",
"refund_time, refund_price, ",
"refund_content, refusal_refund_content, ",
"Identification_code, ext_1, ",
"ext_2, ext_3)",
"Identification_code, profit_sharing_status, ",
"profit_sharing_ratio, account_merchant_num, ",
"ext_1, ext_2, ext_3)",
"values (#{orderNo,jdbcType=VARCHAR}, #{memDiscountId,jdbcType=BIGINT}, ",
"#{memDiscountName,jdbcType=VARCHAR}, #{memId,jdbcType=BIGINT}, ",
"#{memName,jdbcType=VARCHAR}, #{memPhone,jdbcType=VARCHAR}, ",
@ -69,8 +70,9 @@ public interface HighOrderMapper extends HighOrderMapperExt {
"#{finishTime,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR}, ",
"#{refundTime,jdbcType=TIMESTAMP}, #{refundPrice,jdbcType=DECIMAL}, ",
"#{refundContent,jdbcType=VARCHAR}, #{refusalRefundContent,jdbcType=VARCHAR}, ",
"#{identificationCode,jdbcType=BIGINT}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"#{identificationCode,jdbcType=BIGINT}, #{profitSharingStatus,jdbcType=BIT}, ",
"#{profitSharingRatio,jdbcType=DECIMAL}, #{accountMerchantNum,jdbcType=VARCHAR}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighOrder record);
@ -111,6 +113,9 @@ public interface HighOrderMapper extends HighOrderMapperExt {
@Result(column="refund_content", property="refundContent", jdbcType=JdbcType.VARCHAR),
@Result(column="refusal_refund_content", property="refusalRefundContent", jdbcType=JdbcType.VARCHAR),
@Result(column="Identification_code", property="identificationCode", jdbcType=JdbcType.BIGINT),
@Result(column="profit_sharing_status", property="profitSharingStatus", jdbcType=JdbcType.BIT),
@Result(column="profit_sharing_ratio", property="profitSharingRatio", jdbcType=JdbcType.DECIMAL),
@Result(column="account_merchant_num", property="accountMerchantNum", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
@ -123,7 +128,8 @@ public interface HighOrderMapper extends HighOrderMapperExt {
"mem_card_id, mem_card_type, mem_card_no, pay_model, pay_type, pay_gold, pay_price, ",
"pay_real_price, pay_serial_no, deduction_price, order_status, total_price, create_time, ",
"pay_time, cancel_time, cancel_remarks, finish_time, remarks, refund_time, refund_price, ",
"refund_content, refusal_refund_content, Identification_code, ext_1, ext_2, ext_3",
"refund_content, refusal_refund_content, Identification_code, profit_sharing_status, ",
"profit_sharing_ratio, account_merchant_num, ext_1, ext_2, ext_3",
"from high_order",
"where id = #{id,jdbcType=BIGINT}"
})
@ -158,6 +164,9 @@ public interface HighOrderMapper extends HighOrderMapperExt {
@Result(column="refund_content", property="refundContent", jdbcType=JdbcType.VARCHAR),
@Result(column="refusal_refund_content", property="refusalRefundContent", jdbcType=JdbcType.VARCHAR),
@Result(column="Identification_code", property="identificationCode", jdbcType=JdbcType.BIGINT),
@Result(column="profit_sharing_status", property="profitSharingStatus", jdbcType=JdbcType.BIT),
@Result(column="profit_sharing_ratio", property="profitSharingRatio", jdbcType=JdbcType.DECIMAL),
@Result(column="account_merchant_num", property="accountMerchantNum", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
@ -204,12 +213,13 @@ public interface HighOrderMapper extends HighOrderMapperExt {
"refund_content = #{refundContent,jdbcType=VARCHAR},",
"refusal_refund_content = #{refusalRefundContent,jdbcType=VARCHAR},",
"Identification_code = #{identificationCode,jdbcType=BIGINT},",
"profit_sharing_status = #{profitSharingStatus,jdbcType=BIT},",
"profit_sharing_ratio = #{profitSharingRatio,jdbcType=DECIMAL},",
"account_merchant_num = #{accountMerchantNum,jdbcType=VARCHAR},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR}",
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(HighOrder record);
}
}

@ -0,0 +1,130 @@
package com.hai.dao;
import com.hai.entity.HighOrderSplitAccountsRecord;
import com.hai.entity.HighOrderSplitAccountsRecordExample;
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 HighOrderSplitAccountsRecordMapper extends HighOrderSplitAccountsRecordMapperExt {
@SelectProvider(type=HighOrderSplitAccountsRecordSqlProvider.class, method="countByExample")
long countByExample(HighOrderSplitAccountsRecordExample example);
@DeleteProvider(type=HighOrderSplitAccountsRecordSqlProvider.class, method="deleteByExample")
int deleteByExample(HighOrderSplitAccountsRecordExample example);
@Delete({
"delete from high_order_split_accounts_record",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into high_order_split_accounts_record (order_id, order_no, ",
"`type`, account_no, ",
"rate, split_price, ",
"`status`, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"values (#{orderId,jdbcType=BIGINT}, #{orderNo,jdbcType=INTEGER}, ",
"#{type,jdbcType=INTEGER}, #{accountNo,jdbcType=VARCHAR}, ",
"#{rate,jdbcType=DECIMAL}, #{splitPrice,jdbcType=DECIMAL}, ",
"#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighOrderSplitAccountsRecord record);
@InsertProvider(type=HighOrderSplitAccountsRecordSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(HighOrderSplitAccountsRecord record);
@SelectProvider(type=HighOrderSplitAccountsRecordSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="order_id", property="orderId", jdbcType=JdbcType.BIGINT),
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.INTEGER),
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="account_no", property="accountNo", jdbcType=JdbcType.VARCHAR),
@Result(column="rate", property="rate", jdbcType=JdbcType.DECIMAL),
@Result(column="split_price", property="splitPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
List<HighOrderSplitAccountsRecord> selectByExample(HighOrderSplitAccountsRecordExample example);
@Select({
"select",
"id, order_id, order_no, `type`, account_no, rate, split_price, `status`, create_time, ",
"update_time, ext_1, ext_2, ext_3",
"from high_order_split_accounts_record",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="order_id", property="orderId", jdbcType=JdbcType.BIGINT),
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.INTEGER),
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="account_no", property="accountNo", jdbcType=JdbcType.VARCHAR),
@Result(column="rate", property="rate", jdbcType=JdbcType.DECIMAL),
@Result(column="split_price", property="splitPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
HighOrderSplitAccountsRecord selectByPrimaryKey(Long id);
@UpdateProvider(type=HighOrderSplitAccountsRecordSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") HighOrderSplitAccountsRecord record, @Param("example") HighOrderSplitAccountsRecordExample example);
@UpdateProvider(type=HighOrderSplitAccountsRecordSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") HighOrderSplitAccountsRecord record, @Param("example") HighOrderSplitAccountsRecordExample example);
@UpdateProvider(type=HighOrderSplitAccountsRecordSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(HighOrderSplitAccountsRecord record);
@Update({
"update high_order_split_accounts_record",
"set order_id = #{orderId,jdbcType=BIGINT},",
"order_no = #{orderNo,jdbcType=INTEGER},",
"`type` = #{type,jdbcType=INTEGER},",
"account_no = #{accountNo,jdbcType=VARCHAR},",
"rate = #{rate,jdbcType=DECIMAL},",
"split_price = #{splitPrice,jdbcType=DECIMAL},",
"`status` = #{status,jdbcType=INTEGER},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=TIMESTAMP},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR}",
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(HighOrderSplitAccountsRecord record);
}

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

@ -0,0 +1,346 @@
package com.hai.dao;
import com.hai.entity.HighOrderSplitAccountsRecord;
import com.hai.entity.HighOrderSplitAccountsRecordExample.Criteria;
import com.hai.entity.HighOrderSplitAccountsRecordExample.Criterion;
import com.hai.entity.HighOrderSplitAccountsRecordExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class HighOrderSplitAccountsRecordSqlProvider {
public String countByExample(HighOrderSplitAccountsRecordExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("high_order_split_accounts_record");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(HighOrderSplitAccountsRecordExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("high_order_split_accounts_record");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(HighOrderSplitAccountsRecord record) {
SQL sql = new SQL();
sql.INSERT_INTO("high_order_split_accounts_record");
if (record.getOrderId() != null) {
sql.VALUES("order_id", "#{orderId,jdbcType=BIGINT}");
}
if (record.getOrderNo() != null) {
sql.VALUES("order_no", "#{orderNo,jdbcType=INTEGER}");
}
if (record.getType() != null) {
sql.VALUES("`type`", "#{type,jdbcType=INTEGER}");
}
if (record.getAccountNo() != null) {
sql.VALUES("account_no", "#{accountNo,jdbcType=VARCHAR}");
}
if (record.getRate() != null) {
sql.VALUES("rate", "#{rate,jdbcType=DECIMAL}");
}
if (record.getSplitPrice() != null) {
sql.VALUES("split_price", "#{splitPrice,jdbcType=DECIMAL}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}");
}
return sql.toString();
}
public String selectByExample(HighOrderSplitAccountsRecordExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("order_id");
sql.SELECT("order_no");
sql.SELECT("`type`");
sql.SELECT("account_no");
sql.SELECT("rate");
sql.SELECT("split_price");
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_order_split_accounts_record");
applyWhere(sql, example, false);
if (example != null && example.getOrderByClause() != null) {
sql.ORDER_BY(example.getOrderByClause());
}
return sql.toString();
}
public String updateByExampleSelective(Map<String, Object> parameter) {
HighOrderSplitAccountsRecord record = (HighOrderSplitAccountsRecord) parameter.get("record");
HighOrderSplitAccountsRecordExample example = (HighOrderSplitAccountsRecordExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("high_order_split_accounts_record");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getOrderId() != null) {
sql.SET("order_id = #{record.orderId,jdbcType=BIGINT}");
}
if (record.getOrderNo() != null) {
sql.SET("order_no = #{record.orderNo,jdbcType=INTEGER}");
}
if (record.getType() != null) {
sql.SET("`type` = #{record.type,jdbcType=INTEGER}");
}
if (record.getAccountNo() != null) {
sql.SET("account_no = #{record.accountNo,jdbcType=VARCHAR}");
}
if (record.getRate() != null) {
sql.SET("rate = #{record.rate,jdbcType=DECIMAL}");
}
if (record.getSplitPrice() != null) {
sql.SET("split_price = #{record.splitPrice,jdbcType=DECIMAL}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
}
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByExample(Map<String, Object> parameter) {
SQL sql = new SQL();
sql.UPDATE("high_order_split_accounts_record");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("order_id = #{record.orderId,jdbcType=BIGINT}");
sql.SET("order_no = #{record.orderNo,jdbcType=INTEGER}");
sql.SET("`type` = #{record.type,jdbcType=INTEGER}");
sql.SET("account_no = #{record.accountNo,jdbcType=VARCHAR}");
sql.SET("rate = #{record.rate,jdbcType=DECIMAL}");
sql.SET("split_price = #{record.splitPrice,jdbcType=DECIMAL}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
HighOrderSplitAccountsRecordExample example = (HighOrderSplitAccountsRecordExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(HighOrderSplitAccountsRecord record) {
SQL sql = new SQL();
sql.UPDATE("high_order_split_accounts_record");
if (record.getOrderId() != null) {
sql.SET("order_id = #{orderId,jdbcType=BIGINT}");
}
if (record.getOrderNo() != null) {
sql.SET("order_no = #{orderNo,jdbcType=INTEGER}");
}
if (record.getType() != null) {
sql.SET("`type` = #{type,jdbcType=INTEGER}");
}
if (record.getAccountNo() != null) {
sql.SET("account_no = #{accountNo,jdbcType=VARCHAR}");
}
if (record.getRate() != null) {
sql.SET("rate = #{rate,jdbcType=DECIMAL}");
}
if (record.getSplitPrice() != null) {
sql.SET("split_price = #{splitPrice,jdbcType=DECIMAL}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}");
}
sql.WHERE("id = #{id,jdbcType=BIGINT}");
return sql.toString();
}
protected void applyWhere(SQL sql, HighOrderSplitAccountsRecordExample 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());
}
}
}

@ -144,6 +144,18 @@ public class HighOrderSqlProvider {
sql.VALUES("Identification_code", "#{identificationCode,jdbcType=BIGINT}");
}
if (record.getProfitSharingStatus() != null) {
sql.VALUES("profit_sharing_status", "#{profitSharingStatus,jdbcType=BIT}");
}
if (record.getProfitSharingRatio() != null) {
sql.VALUES("profit_sharing_ratio", "#{profitSharingRatio,jdbcType=DECIMAL}");
}
if (record.getAccountMerchantNum() != null) {
sql.VALUES("account_merchant_num", "#{accountMerchantNum,jdbcType=VARCHAR}");
}
if (record.getExt1() != null) {
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}");
}
@ -195,6 +207,9 @@ public class HighOrderSqlProvider {
sql.SELECT("refund_content");
sql.SELECT("refusal_refund_content");
sql.SELECT("Identification_code");
sql.SELECT("profit_sharing_status");
sql.SELECT("profit_sharing_ratio");
sql.SELECT("account_merchant_num");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
@ -335,6 +350,18 @@ public class HighOrderSqlProvider {
sql.SET("Identification_code = #{record.identificationCode,jdbcType=BIGINT}");
}
if (record.getProfitSharingStatus() != null) {
sql.SET("profit_sharing_status = #{record.profitSharingStatus,jdbcType=BIT}");
}
if (record.getProfitSharingRatio() != null) {
sql.SET("profit_sharing_ratio = #{record.profitSharingRatio,jdbcType=DECIMAL}");
}
if (record.getAccountMerchantNum() != null) {
sql.SET("account_merchant_num = #{record.accountMerchantNum,jdbcType=VARCHAR}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
}
@ -385,6 +412,9 @@ public class HighOrderSqlProvider {
sql.SET("refund_content = #{record.refundContent,jdbcType=VARCHAR}");
sql.SET("refusal_refund_content = #{record.refusalRefundContent,jdbcType=VARCHAR}");
sql.SET("Identification_code = #{record.identificationCode,jdbcType=BIGINT}");
sql.SET("profit_sharing_status = #{record.profitSharingStatus,jdbcType=BIT}");
sql.SET("profit_sharing_ratio = #{record.profitSharingRatio,jdbcType=DECIMAL}");
sql.SET("account_merchant_num = #{record.accountMerchantNum,jdbcType=VARCHAR}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
@ -514,6 +544,18 @@ public class HighOrderSqlProvider {
sql.SET("Identification_code = #{identificationCode,jdbcType=BIGINT}");
}
if (record.getProfitSharingStatus() != null) {
sql.SET("profit_sharing_status = #{profitSharingStatus,jdbcType=BIT}");
}
if (record.getProfitSharingRatio() != null) {
sql.SET("profit_sharing_ratio = #{profitSharingRatio,jdbcType=DECIMAL}");
}
if (record.getAccountMerchantNum() != null) {
sql.SET("account_merchant_num = #{accountMerchantNum,jdbcType=VARCHAR}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}");
}

@ -28,11 +28,11 @@ public interface OutRechargeOrderMapperExt {
"count(1) as count,",
"sum(pay_price) as pay_price,",
"sum(order_price) as order_price,",
"`status`",
"`pay_status`",
"from out_recharge_order",
"where ",
" create_timed between #{finishTimeS} and #{finishTimeE} " ,
"<if test='status != null'> and status = #{status} </if>",
"<if test='status != null'> and pay_status = #{status} </if>",
"GROUP BY day",
"</script>"
})
@ -41,7 +41,7 @@ public interface OutRechargeOrderMapperExt {
@Result(column="day", property="day", jdbcType=JdbcType.TIMESTAMP),
@Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="order_price", property="orderPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="pay_status", property="payStatus", jdbcType=JdbcType.INTEGER),
})
List<OutOrderModel> getListOrderCount(String finishTimeS , String finishTimeE , Integer status);
@ -108,7 +108,7 @@ public interface OutRechargeOrderMapperExt {
List<OutRechargeOrderModel> selectOrderCount(@Param("map") Map<String,Object> map);
@Select({"SELECT * FROM out_recharge_order ho WHERE TIMESTAMPDIFF(MINUTE,ho.create_timed,SYSDATE()) > 15 AND ho.status = 1"})
@Select({"SELECT * FROM out_recharge_order ho WHERE TIMESTAMPDIFF(MINUTE,ho.create_timed,SYSDATE()) > 15 AND ho.pay_status = 101"})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
@ -147,7 +147,7 @@ public interface OutRechargeOrderMapperExt {
@Select(value = {
"<script>",
"select sum(order_price) orderPrice, sum(pay_real_price) payRealPrice , count(*) count ",
"from out_recharge_order where status in (2,3) and Identification_code = #{code}",
"from out_recharge_order where pay_status in (2,3) and Identification_code = #{code}",
"</script>"
})
@Results({

@ -29,6 +29,11 @@ public class HighGasOilPriceTask implements Serializable {
*/
private String regionName;
/**
* 加油站编号
*/
private String merStoreKey;
/**
* 加油站id
*/
@ -75,7 +80,7 @@ public class HighGasOilPriceTask implements Serializable {
private BigDecimal price;
/**
* 执行类型 1. 立刻执行 2. 定时执行
* 执行方式 1. 立刻执行 2. 定时执行
*/
private Integer executionType;
@ -141,6 +146,14 @@ public class HighGasOilPriceTask implements Serializable {
this.regionName = regionName;
}
public String getMerStoreKey() {
return merStoreKey;
}
public void setMerStoreKey(String merStoreKey) {
this.merStoreKey = merStoreKey;
}
public Long getMerStoreId() {
return merStoreId;
}
@ -308,6 +321,7 @@ public class HighGasOilPriceTask implements Serializable {
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getRegionId() == null ? other.getRegionId() == null : this.getRegionId().equals(other.getRegionId()))
&& (this.getRegionName() == null ? other.getRegionName() == null : this.getRegionName().equals(other.getRegionName()))
&& (this.getMerStoreKey() == null ? other.getMerStoreKey() == null : this.getMerStoreKey().equals(other.getMerStoreKey()))
&& (this.getMerStoreId() == null ? other.getMerStoreId() == null : this.getMerStoreId().equals(other.getMerStoreId()))
&& (this.getMerStoreName() == null ? other.getMerStoreName() == null : this.getMerStoreName().equals(other.getMerStoreName()))
&& (this.getMerStoreAddress() == null ? other.getMerStoreAddress() == null : this.getMerStoreAddress().equals(other.getMerStoreAddress()))
@ -336,6 +350,7 @@ public class HighGasOilPriceTask implements Serializable {
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getRegionId() == null) ? 0 : getRegionId().hashCode());
result = prime * result + ((getRegionName() == null) ? 0 : getRegionName().hashCode());
result = prime * result + ((getMerStoreKey() == null) ? 0 : getMerStoreKey().hashCode());
result = prime * result + ((getMerStoreId() == null) ? 0 : getMerStoreId().hashCode());
result = prime * result + ((getMerStoreName() == null) ? 0 : getMerStoreName().hashCode());
result = prime * result + ((getMerStoreAddress() == null) ? 0 : getMerStoreAddress().hashCode());
@ -367,6 +382,7 @@ public class HighGasOilPriceTask implements Serializable {
sb.append(", id=").append(id);
sb.append(", regionId=").append(regionId);
sb.append(", regionName=").append(regionName);
sb.append(", merStoreKey=").append(merStoreKey);
sb.append(", merStoreId=").append(merStoreId);
sb.append(", merStoreName=").append(merStoreName);
sb.append(", merStoreAddress=").append(merStoreAddress);

@ -316,6 +316,76 @@ public class HighGasOilPriceTaskExample {
return (Criteria) this;
}
public Criteria andMerStoreKeyIsNull() {
addCriterion("mer_store_key is null");
return (Criteria) this;
}
public Criteria andMerStoreKeyIsNotNull() {
addCriterion("mer_store_key is not null");
return (Criteria) this;
}
public Criteria andMerStoreKeyEqualTo(String value) {
addCriterion("mer_store_key =", value, "merStoreKey");
return (Criteria) this;
}
public Criteria andMerStoreKeyNotEqualTo(String value) {
addCriterion("mer_store_key <>", value, "merStoreKey");
return (Criteria) this;
}
public Criteria andMerStoreKeyGreaterThan(String value) {
addCriterion("mer_store_key >", value, "merStoreKey");
return (Criteria) this;
}
public Criteria andMerStoreKeyGreaterThanOrEqualTo(String value) {
addCriterion("mer_store_key >=", value, "merStoreKey");
return (Criteria) this;
}
public Criteria andMerStoreKeyLessThan(String value) {
addCriterion("mer_store_key <", value, "merStoreKey");
return (Criteria) this;
}
public Criteria andMerStoreKeyLessThanOrEqualTo(String value) {
addCriterion("mer_store_key <=", value, "merStoreKey");
return (Criteria) this;
}
public Criteria andMerStoreKeyLike(String value) {
addCriterion("mer_store_key like", value, "merStoreKey");
return (Criteria) this;
}
public Criteria andMerStoreKeyNotLike(String value) {
addCriterion("mer_store_key not like", value, "merStoreKey");
return (Criteria) this;
}
public Criteria andMerStoreKeyIn(List<String> values) {
addCriterion("mer_store_key in", values, "merStoreKey");
return (Criteria) this;
}
public Criteria andMerStoreKeyNotIn(List<String> values) {
addCriterion("mer_store_key not in", values, "merStoreKey");
return (Criteria) this;
}
public Criteria andMerStoreKeyBetween(String value1, String value2) {
addCriterion("mer_store_key between", value1, value2, "merStoreKey");
return (Criteria) this;
}
public Criteria andMerStoreKeyNotBetween(String value1, String value2) {
addCriterion("mer_store_key not between", value1, value2, "merStoreKey");
return (Criteria) this;
}
public Criteria andMerStoreIdIsNull() {
addCriterion("mer_store_id is null");
return (Criteria) this;

@ -0,0 +1,214 @@
package com.hai.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* high_merchant_account
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class HighMerchantAccount implements Serializable {
private Long id;
/**
* 商户id
*/
private Long merId;
/**
* 商户名称
*/
private String merName;
/**
* 账户号码
*/
private String accountNo;
/**
* 账户余额
*/
private BigDecimal amounts;
/**
* 状态 0删除 1正常
*/
private Integer status;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改时间
*/
private Date updateTime;
private String ext1;
private String ext2;
private String ext3;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getMerId() {
return merId;
}
public void setMerId(Long merId) {
this.merId = merId;
}
public String getMerName() {
return merName;
}
public void setMerName(String merName) {
this.merName = merName;
}
public String getAccountNo() {
return accountNo;
}
public void setAccountNo(String accountNo) {
this.accountNo = accountNo;
}
public BigDecimal getAmounts() {
return amounts;
}
public void setAmounts(BigDecimal amounts) {
this.amounts = amounts;
}
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;
}
HighMerchantAccount other = (HighMerchantAccount) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId()))
&& (this.getMerName() == null ? other.getMerName() == null : this.getMerName().equals(other.getMerName()))
&& (this.getAccountNo() == null ? other.getAccountNo() == null : this.getAccountNo().equals(other.getAccountNo()))
&& (this.getAmounts() == null ? other.getAmounts() == null : this.getAmounts().equals(other.getAmounts()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1()))
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2()))
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getMerId() == null) ? 0 : getMerId().hashCode());
result = prime * result + ((getMerName() == null) ? 0 : getMerName().hashCode());
result = prime * result + ((getAccountNo() == null) ? 0 : getAccountNo().hashCode());
result = prime * result + ((getAmounts() == null) ? 0 : getAmounts().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode());
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode());
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", merId=").append(merId);
sb.append(", merName=").append(merName);
sb.append(", accountNo=").append(accountNo);
sb.append(", amounts=").append(amounts);
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,934 @@
package com.hai.entity;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class HighMerchantAccountExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
private Integer limit;
private Long offset;
public HighMerchantAccountExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
public void setLimit(Integer limit) {
this.limit = limit;
}
public Integer getLimit() {
return limit;
}
public void setOffset(Long offset) {
this.offset = offset;
}
public Long getOffset() {
return offset;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andMerIdIsNull() {
addCriterion("mer_id is null");
return (Criteria) this;
}
public Criteria andMerIdIsNotNull() {
addCriterion("mer_id is not null");
return (Criteria) this;
}
public Criteria andMerIdEqualTo(Long value) {
addCriterion("mer_id =", value, "merId");
return (Criteria) this;
}
public Criteria andMerIdNotEqualTo(Long value) {
addCriterion("mer_id <>", value, "merId");
return (Criteria) this;
}
public Criteria andMerIdGreaterThan(Long value) {
addCriterion("mer_id >", value, "merId");
return (Criteria) this;
}
public Criteria andMerIdGreaterThanOrEqualTo(Long value) {
addCriterion("mer_id >=", value, "merId");
return (Criteria) this;
}
public Criteria andMerIdLessThan(Long value) {
addCriterion("mer_id <", value, "merId");
return (Criteria) this;
}
public Criteria andMerIdLessThanOrEqualTo(Long value) {
addCriterion("mer_id <=", value, "merId");
return (Criteria) this;
}
public Criteria andMerIdIn(List<Long> values) {
addCriterion("mer_id in", values, "merId");
return (Criteria) this;
}
public Criteria andMerIdNotIn(List<Long> values) {
addCriterion("mer_id not in", values, "merId");
return (Criteria) this;
}
public Criteria andMerIdBetween(Long value1, Long value2) {
addCriterion("mer_id between", value1, value2, "merId");
return (Criteria) this;
}
public Criteria andMerIdNotBetween(Long value1, Long value2) {
addCriterion("mer_id not between", value1, value2, "merId");
return (Criteria) this;
}
public Criteria andMerNameIsNull() {
addCriterion("mer_name is null");
return (Criteria) this;
}
public Criteria andMerNameIsNotNull() {
addCriterion("mer_name is not null");
return (Criteria) this;
}
public Criteria andMerNameEqualTo(String value) {
addCriterion("mer_name =", value, "merName");
return (Criteria) this;
}
public Criteria andMerNameNotEqualTo(String value) {
addCriterion("mer_name <>", value, "merName");
return (Criteria) this;
}
public Criteria andMerNameGreaterThan(String value) {
addCriterion("mer_name >", value, "merName");
return (Criteria) this;
}
public Criteria andMerNameGreaterThanOrEqualTo(String value) {
addCriterion("mer_name >=", value, "merName");
return (Criteria) this;
}
public Criteria andMerNameLessThan(String value) {
addCriterion("mer_name <", value, "merName");
return (Criteria) this;
}
public Criteria andMerNameLessThanOrEqualTo(String value) {
addCriterion("mer_name <=", value, "merName");
return (Criteria) this;
}
public Criteria andMerNameLike(String value) {
addCriterion("mer_name like", value, "merName");
return (Criteria) this;
}
public Criteria andMerNameNotLike(String value) {
addCriterion("mer_name not like", value, "merName");
return (Criteria) this;
}
public Criteria andMerNameIn(List<String> values) {
addCriterion("mer_name in", values, "merName");
return (Criteria) this;
}
public Criteria andMerNameNotIn(List<String> values) {
addCriterion("mer_name not in", values, "merName");
return (Criteria) this;
}
public Criteria andMerNameBetween(String value1, String value2) {
addCriterion("mer_name between", value1, value2, "merName");
return (Criteria) this;
}
public Criteria andMerNameNotBetween(String value1, String value2) {
addCriterion("mer_name not between", value1, value2, "merName");
return (Criteria) this;
}
public Criteria andAccountNoIsNull() {
addCriterion("account_no is null");
return (Criteria) this;
}
public Criteria andAccountNoIsNotNull() {
addCriterion("account_no is not null");
return (Criteria) this;
}
public Criteria andAccountNoEqualTo(String value) {
addCriterion("account_no =", value, "accountNo");
return (Criteria) this;
}
public Criteria andAccountNoNotEqualTo(String value) {
addCriterion("account_no <>", value, "accountNo");
return (Criteria) this;
}
public Criteria andAccountNoGreaterThan(String value) {
addCriterion("account_no >", value, "accountNo");
return (Criteria) this;
}
public Criteria andAccountNoGreaterThanOrEqualTo(String value) {
addCriterion("account_no >=", value, "accountNo");
return (Criteria) this;
}
public Criteria andAccountNoLessThan(String value) {
addCriterion("account_no <", value, "accountNo");
return (Criteria) this;
}
public Criteria andAccountNoLessThanOrEqualTo(String value) {
addCriterion("account_no <=", value, "accountNo");
return (Criteria) this;
}
public Criteria andAccountNoLike(String value) {
addCriterion("account_no like", value, "accountNo");
return (Criteria) this;
}
public Criteria andAccountNoNotLike(String value) {
addCriterion("account_no not like", value, "accountNo");
return (Criteria) this;
}
public Criteria andAccountNoIn(List<String> values) {
addCriterion("account_no in", values, "accountNo");
return (Criteria) this;
}
public Criteria andAccountNoNotIn(List<String> values) {
addCriterion("account_no not in", values, "accountNo");
return (Criteria) this;
}
public Criteria andAccountNoBetween(String value1, String value2) {
addCriterion("account_no between", value1, value2, "accountNo");
return (Criteria) this;
}
public Criteria andAccountNoNotBetween(String value1, String value2) {
addCriterion("account_no not between", value1, value2, "accountNo");
return (Criteria) this;
}
public Criteria andAmountsIsNull() {
addCriterion("amounts is null");
return (Criteria) this;
}
public Criteria andAmountsIsNotNull() {
addCriterion("amounts is not null");
return (Criteria) this;
}
public Criteria andAmountsEqualTo(BigDecimal value) {
addCriterion("amounts =", value, "amounts");
return (Criteria) this;
}
public Criteria andAmountsNotEqualTo(BigDecimal value) {
addCriterion("amounts <>", value, "amounts");
return (Criteria) this;
}
public Criteria andAmountsGreaterThan(BigDecimal value) {
addCriterion("amounts >", value, "amounts");
return (Criteria) this;
}
public Criteria andAmountsGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("amounts >=", value, "amounts");
return (Criteria) this;
}
public Criteria andAmountsLessThan(BigDecimal value) {
addCriterion("amounts <", value, "amounts");
return (Criteria) this;
}
public Criteria andAmountsLessThanOrEqualTo(BigDecimal value) {
addCriterion("amounts <=", value, "amounts");
return (Criteria) this;
}
public Criteria andAmountsIn(List<BigDecimal> values) {
addCriterion("amounts in", values, "amounts");
return (Criteria) this;
}
public Criteria andAmountsNotIn(List<BigDecimal> values) {
addCriterion("amounts not in", values, "amounts");
return (Criteria) this;
}
public Criteria andAmountsBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("amounts between", value1, value2, "amounts");
return (Criteria) this;
}
public Criteria andAmountsNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("amounts not between", value1, value2, "amounts");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("`status` is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("`status` is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(Integer value) {
addCriterion("`status` =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(Integer value) {
addCriterion("`status` <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(Integer value) {
addCriterion("`status` >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(Integer value) {
addCriterion("`status` >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(Integer value) {
addCriterion("`status` <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(Integer value) {
addCriterion("`status` <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<Integer> values) {
addCriterion("`status` in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<Integer> values) {
addCriterion("`status` not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(Integer value1, Integer value2) {
addCriterion("`status` between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(Integer value1, Integer value2) {
addCriterion("`status` not between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Date value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Date value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Date value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Date value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Date> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Date> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Date value1, Date value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("update_time is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(Date value) {
addCriterion("update_time =", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Date value) {
addCriterion("update_time <>", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Date value) {
addCriterion("update_time >", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("update_time >=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Date value) {
addCriterion("update_time <", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
addCriterion("update_time <=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Date> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Date> values) {
addCriterion("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Date value1, Date value2) {
addCriterion("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andExt1IsNull() {
addCriterion("ext_1 is null");
return (Criteria) this;
}
public Criteria andExt1IsNotNull() {
addCriterion("ext_1 is not null");
return (Criteria) this;
}
public Criteria andExt1EqualTo(String value) {
addCriterion("ext_1 =", value, "ext1");
return (Criteria) this;
}
public Criteria andExt1NotEqualTo(String value) {
addCriterion("ext_1 <>", value, "ext1");
return (Criteria) this;
}
public Criteria andExt1GreaterThan(String value) {
addCriterion("ext_1 >", value, "ext1");
return (Criteria) this;
}
public Criteria andExt1GreaterThanOrEqualTo(String value) {
addCriterion("ext_1 >=", value, "ext1");
return (Criteria) this;
}
public Criteria andExt1LessThan(String value) {
addCriterion("ext_1 <", value, "ext1");
return (Criteria) this;
}
public Criteria andExt1LessThanOrEqualTo(String value) {
addCriterion("ext_1 <=", value, "ext1");
return (Criteria) this;
}
public Criteria andExt1Like(String value) {
addCriterion("ext_1 like", value, "ext1");
return (Criteria) this;
}
public Criteria andExt1NotLike(String value) {
addCriterion("ext_1 not like", value, "ext1");
return (Criteria) this;
}
public Criteria andExt1In(List<String> values) {
addCriterion("ext_1 in", values, "ext1");
return (Criteria) this;
}
public Criteria andExt1NotIn(List<String> values) {
addCriterion("ext_1 not in", values, "ext1");
return (Criteria) this;
}
public Criteria andExt1Between(String value1, String value2) {
addCriterion("ext_1 between", value1, value2, "ext1");
return (Criteria) this;
}
public Criteria andExt1NotBetween(String value1, String value2) {
addCriterion("ext_1 not between", value1, value2, "ext1");
return (Criteria) this;
}
public Criteria andExt2IsNull() {
addCriterion("ext_2 is null");
return (Criteria) this;
}
public Criteria andExt2IsNotNull() {
addCriterion("ext_2 is not null");
return (Criteria) this;
}
public Criteria andExt2EqualTo(String value) {
addCriterion("ext_2 =", value, "ext2");
return (Criteria) this;
}
public Criteria andExt2NotEqualTo(String value) {
addCriterion("ext_2 <>", value, "ext2");
return (Criteria) this;
}
public Criteria andExt2GreaterThan(String value) {
addCriterion("ext_2 >", value, "ext2");
return (Criteria) this;
}
public Criteria andExt2GreaterThanOrEqualTo(String value) {
addCriterion("ext_2 >=", value, "ext2");
return (Criteria) this;
}
public Criteria andExt2LessThan(String value) {
addCriterion("ext_2 <", value, "ext2");
return (Criteria) this;
}
public Criteria andExt2LessThanOrEqualTo(String value) {
addCriterion("ext_2 <=", value, "ext2");
return (Criteria) this;
}
public Criteria andExt2Like(String value) {
addCriterion("ext_2 like", value, "ext2");
return (Criteria) this;
}
public Criteria andExt2NotLike(String value) {
addCriterion("ext_2 not like", value, "ext2");
return (Criteria) this;
}
public Criteria andExt2In(List<String> values) {
addCriterion("ext_2 in", values, "ext2");
return (Criteria) this;
}
public Criteria andExt2NotIn(List<String> values) {
addCriterion("ext_2 not in", values, "ext2");
return (Criteria) this;
}
public Criteria andExt2Between(String value1, String value2) {
addCriterion("ext_2 between", value1, value2, "ext2");
return (Criteria) this;
}
public Criteria andExt2NotBetween(String value1, String value2) {
addCriterion("ext_2 not between", value1, value2, "ext2");
return (Criteria) this;
}
public Criteria andExt3IsNull() {
addCriterion("ext_3 is null");
return (Criteria) this;
}
public Criteria andExt3IsNotNull() {
addCriterion("ext_3 is not null");
return (Criteria) this;
}
public Criteria andExt3EqualTo(String value) {
addCriterion("ext_3 =", value, "ext3");
return (Criteria) this;
}
public Criteria andExt3NotEqualTo(String value) {
addCriterion("ext_3 <>", value, "ext3");
return (Criteria) this;
}
public Criteria andExt3GreaterThan(String value) {
addCriterion("ext_3 >", value, "ext3");
return (Criteria) this;
}
public Criteria andExt3GreaterThanOrEqualTo(String value) {
addCriterion("ext_3 >=", value, "ext3");
return (Criteria) this;
}
public Criteria andExt3LessThan(String value) {
addCriterion("ext_3 <", value, "ext3");
return (Criteria) this;
}
public Criteria andExt3LessThanOrEqualTo(String value) {
addCriterion("ext_3 <=", value, "ext3");
return (Criteria) this;
}
public Criteria andExt3Like(String value) {
addCriterion("ext_3 like", value, "ext3");
return (Criteria) this;
}
public Criteria andExt3NotLike(String value) {
addCriterion("ext_3 not like", value, "ext3");
return (Criteria) this;
}
public Criteria andExt3In(List<String> values) {
addCriterion("ext_3 in", values, "ext3");
return (Criteria) this;
}
public Criteria andExt3NotIn(List<String> values) {
addCriterion("ext_3 not in", values, "ext3");
return (Criteria) this;
}
public Criteria andExt3Between(String value1, String value2) {
addCriterion("ext_3 between", value1, value2, "ext3");
return (Criteria) this;
}
public Criteria andExt3NotBetween(String value1, String value2) {
addCriterion("ext_3 not between", value1, value2, "ext3");
return (Criteria) this;
}
}
/**
*/
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

@ -0,0 +1,246 @@
package com.hai.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* high_merchant_tripartite_platform
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class HighMerchantTripartitePlatform implements Serializable {
private Long id;
/**
* 商户id
*/
private Long merId;
/**
* 平台类型 1微信
*/
private Integer platformType;
/**
* 商户名称
*/
private String platformMerName;
/**
* 商户号
*/
private String platformMerNumber;
/**
* 是否分账
*/
private Boolean profitSharingStatus;
/**
* 分账比率
*/
private BigDecimal profitSharingRatio;
/**
* 状态 0删除 1正常
*/
private Integer status;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改时间
*/
private Date updateTime;
private String ext1;
private String ext2;
private String ext3;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getMerId() {
return merId;
}
public void setMerId(Long merId) {
this.merId = merId;
}
public Integer getPlatformType() {
return platformType;
}
public void setPlatformType(Integer platformType) {
this.platformType = platformType;
}
public String getPlatformMerName() {
return platformMerName;
}
public void setPlatformMerName(String platformMerName) {
this.platformMerName = platformMerName;
}
public String getPlatformMerNumber() {
return platformMerNumber;
}
public void setPlatformMerNumber(String platformMerNumber) {
this.platformMerNumber = platformMerNumber;
}
public Boolean getProfitSharingStatus() {
return profitSharingStatus;
}
public void setProfitSharingStatus(Boolean profitSharingStatus) {
this.profitSharingStatus = profitSharingStatus;
}
public BigDecimal getProfitSharingRatio() {
return profitSharingRatio;
}
public void setProfitSharingRatio(BigDecimal profitSharingRatio) {
this.profitSharingRatio = profitSharingRatio;
}
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;
}
HighMerchantTripartitePlatform other = (HighMerchantTripartitePlatform) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId()))
&& (this.getPlatformType() == null ? other.getPlatformType() == null : this.getPlatformType().equals(other.getPlatformType()))
&& (this.getPlatformMerName() == null ? other.getPlatformMerName() == null : this.getPlatformMerName().equals(other.getPlatformMerName()))
&& (this.getPlatformMerNumber() == null ? other.getPlatformMerNumber() == null : this.getPlatformMerNumber().equals(other.getPlatformMerNumber()))
&& (this.getProfitSharingStatus() == null ? other.getProfitSharingStatus() == null : this.getProfitSharingStatus().equals(other.getProfitSharingStatus()))
&& (this.getProfitSharingRatio() == null ? other.getProfitSharingRatio() == null : this.getProfitSharingRatio().equals(other.getProfitSharingRatio()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1()))
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2()))
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getMerId() == null) ? 0 : getMerId().hashCode());
result = prime * result + ((getPlatformType() == null) ? 0 : getPlatformType().hashCode());
result = prime * result + ((getPlatformMerName() == null) ? 0 : getPlatformMerName().hashCode());
result = prime * result + ((getPlatformMerNumber() == null) ? 0 : getPlatformMerNumber().hashCode());
result = prime * result + ((getProfitSharingStatus() == null) ? 0 : getProfitSharingStatus().hashCode());
result = prime * result + ((getProfitSharingRatio() == null) ? 0 : getProfitSharingRatio().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode());
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode());
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", merId=").append(merId);
sb.append(", platformType=").append(platformType);
sb.append(", platformMerName=").append(platformMerName);
sb.append(", platformMerNumber=").append(platformMerNumber);
sb.append(", profitSharingStatus=").append(profitSharingStatus);
sb.append(", profitSharingRatio=").append(profitSharingRatio);
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();
}
}

@ -71,7 +71,7 @@ public class HighOrder implements Serializable {
private Integer payModel;
/**
* 支付方式 1支付宝 2微信 3金币 4汇联通工会卡
* 支付方式 1支付宝 2微信 3金币 4汇联通工会卡 5银联 6银联分期
*/
private Integer payType;
@ -101,7 +101,7 @@ public class HighOrder implements Serializable {
private BigDecimal deductionPrice;
/**
* 订单状态1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消 6.退款中 7.拒绝退款
* 订单状态1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消 6.退款中 7.拒绝退款
*/
private Integer orderStatus;
@ -165,6 +165,21 @@ public class HighOrder implements Serializable {
*/
private Long identificationCode;
/**
* 是否分账
*/
private Boolean profitSharingStatus;
/**
* 分账比例
*/
private BigDecimal profitSharingRatio;
/**
* 进账商户号
*/
private String accountMerchantNum;
private String ext1;
private String ext2;
@ -177,14 +192,6 @@ public class HighOrder implements Serializable {
private Boolean isTyAgent;
public Boolean getIsTyAgent() {
return isTyAgent;
}
public void setIsTyAgent(Boolean tyAgent) {
isTyAgent = tyAgent;
}
public List<HighChildOrder> getHighChildOrderList() {
return highChildOrderList;
}
@ -201,6 +208,14 @@ public class HighOrder implements Serializable {
this.highDiscount = highDiscount;
}
public Boolean getIsTyAgent() {
return isTyAgent;
}
public void setIsTyAgent(Boolean tyAgent) {
isTyAgent = tyAgent;
}
private static final long serialVersionUID = 1L;
public Long getId() {
@ -443,6 +458,30 @@ public class HighOrder implements Serializable {
this.identificationCode = identificationCode;
}
public Boolean getProfitSharingStatus() {
return profitSharingStatus;
}
public void setProfitSharingStatus(Boolean profitSharingStatus) {
this.profitSharingStatus = profitSharingStatus;
}
public BigDecimal getProfitSharingRatio() {
return profitSharingRatio;
}
public void setProfitSharingRatio(BigDecimal profitSharingRatio) {
this.profitSharingRatio = profitSharingRatio;
}
public String getAccountMerchantNum() {
return accountMerchantNum;
}
public void setAccountMerchantNum(String accountMerchantNum) {
this.accountMerchantNum = accountMerchantNum;
}
public String getExt1() {
return ext1;
}
@ -509,6 +548,9 @@ public class HighOrder implements Serializable {
&& (this.getRefundContent() == null ? other.getRefundContent() == null : this.getRefundContent().equals(other.getRefundContent()))
&& (this.getRefusalRefundContent() == null ? other.getRefusalRefundContent() == null : this.getRefusalRefundContent().equals(other.getRefusalRefundContent()))
&& (this.getIdentificationCode() == null ? other.getIdentificationCode() == null : this.getIdentificationCode().equals(other.getIdentificationCode()))
&& (this.getProfitSharingStatus() == null ? other.getProfitSharingStatus() == null : this.getProfitSharingStatus().equals(other.getProfitSharingStatus()))
&& (this.getProfitSharingRatio() == null ? other.getProfitSharingRatio() == null : this.getProfitSharingRatio().equals(other.getProfitSharingRatio()))
&& (this.getAccountMerchantNum() == null ? other.getAccountMerchantNum() == null : this.getAccountMerchantNum().equals(other.getAccountMerchantNum()))
&& (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()));
@ -548,6 +590,9 @@ public class HighOrder implements Serializable {
result = prime * result + ((getRefundContent() == null) ? 0 : getRefundContent().hashCode());
result = prime * result + ((getRefusalRefundContent() == null) ? 0 : getRefusalRefundContent().hashCode());
result = prime * result + ((getIdentificationCode() == null) ? 0 : getIdentificationCode().hashCode());
result = prime * result + ((getProfitSharingStatus() == null) ? 0 : getProfitSharingStatus().hashCode());
result = prime * result + ((getProfitSharingRatio() == null) ? 0 : getProfitSharingRatio().hashCode());
result = prime * result + ((getAccountMerchantNum() == null) ? 0 : getAccountMerchantNum().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());
@ -590,6 +635,9 @@ public class HighOrder implements Serializable {
sb.append(", refundContent=").append(refundContent);
sb.append(", refusalRefundContent=").append(refusalRefundContent);
sb.append(", identificationCode=").append(identificationCode);
sb.append(", profitSharingStatus=").append(profitSharingStatus);
sb.append(", profitSharingRatio=").append(profitSharingRatio);
sb.append(", accountMerchantNum=").append(accountMerchantNum);
sb.append(", ext1=").append(ext1);
sb.append(", ext2=").append(ext2);
sb.append(", ext3=").append(ext3);

@ -2026,6 +2026,196 @@ public class HighOrderExample {
return (Criteria) this;
}
public Criteria andProfitSharingStatusIsNull() {
addCriterion("profit_sharing_status is null");
return (Criteria) this;
}
public Criteria andProfitSharingStatusIsNotNull() {
addCriterion("profit_sharing_status is not null");
return (Criteria) this;
}
public Criteria andProfitSharingStatusEqualTo(Boolean value) {
addCriterion("profit_sharing_status =", value, "profitSharingStatus");
return (Criteria) this;
}
public Criteria andProfitSharingStatusNotEqualTo(Boolean value) {
addCriterion("profit_sharing_status <>", value, "profitSharingStatus");
return (Criteria) this;
}
public Criteria andProfitSharingStatusGreaterThan(Boolean value) {
addCriterion("profit_sharing_status >", value, "profitSharingStatus");
return (Criteria) this;
}
public Criteria andProfitSharingStatusGreaterThanOrEqualTo(Boolean value) {
addCriterion("profit_sharing_status >=", value, "profitSharingStatus");
return (Criteria) this;
}
public Criteria andProfitSharingStatusLessThan(Boolean value) {
addCriterion("profit_sharing_status <", value, "profitSharingStatus");
return (Criteria) this;
}
public Criteria andProfitSharingStatusLessThanOrEqualTo(Boolean value) {
addCriterion("profit_sharing_status <=", value, "profitSharingStatus");
return (Criteria) this;
}
public Criteria andProfitSharingStatusIn(List<Boolean> values) {
addCriterion("profit_sharing_status in", values, "profitSharingStatus");
return (Criteria) this;
}
public Criteria andProfitSharingStatusNotIn(List<Boolean> values) {
addCriterion("profit_sharing_status not in", values, "profitSharingStatus");
return (Criteria) this;
}
public Criteria andProfitSharingStatusBetween(Boolean value1, Boolean value2) {
addCriterion("profit_sharing_status between", value1, value2, "profitSharingStatus");
return (Criteria) this;
}
public Criteria andProfitSharingStatusNotBetween(Boolean value1, Boolean value2) {
addCriterion("profit_sharing_status not between", value1, value2, "profitSharingStatus");
return (Criteria) this;
}
public Criteria andProfitSharingRatioIsNull() {
addCriterion("profit_sharing_ratio is null");
return (Criteria) this;
}
public Criteria andProfitSharingRatioIsNotNull() {
addCriterion("profit_sharing_ratio is not null");
return (Criteria) this;
}
public Criteria andProfitSharingRatioEqualTo(BigDecimal value) {
addCriterion("profit_sharing_ratio =", value, "profitSharingRatio");
return (Criteria) this;
}
public Criteria andProfitSharingRatioNotEqualTo(BigDecimal value) {
addCriterion("profit_sharing_ratio <>", value, "profitSharingRatio");
return (Criteria) this;
}
public Criteria andProfitSharingRatioGreaterThan(BigDecimal value) {
addCriterion("profit_sharing_ratio >", value, "profitSharingRatio");
return (Criteria) this;
}
public Criteria andProfitSharingRatioGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("profit_sharing_ratio >=", value, "profitSharingRatio");
return (Criteria) this;
}
public Criteria andProfitSharingRatioLessThan(BigDecimal value) {
addCriterion("profit_sharing_ratio <", value, "profitSharingRatio");
return (Criteria) this;
}
public Criteria andProfitSharingRatioLessThanOrEqualTo(BigDecimal value) {
addCriterion("profit_sharing_ratio <=", value, "profitSharingRatio");
return (Criteria) this;
}
public Criteria andProfitSharingRatioIn(List<BigDecimal> values) {
addCriterion("profit_sharing_ratio in", values, "profitSharingRatio");
return (Criteria) this;
}
public Criteria andProfitSharingRatioNotIn(List<BigDecimal> values) {
addCriterion("profit_sharing_ratio not in", values, "profitSharingRatio");
return (Criteria) this;
}
public Criteria andProfitSharingRatioBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("profit_sharing_ratio between", value1, value2, "profitSharingRatio");
return (Criteria) this;
}
public Criteria andProfitSharingRatioNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("profit_sharing_ratio not between", value1, value2, "profitSharingRatio");
return (Criteria) this;
}
public Criteria andAccountMerchantNumIsNull() {
addCriterion("account_merchant_num is null");
return (Criteria) this;
}
public Criteria andAccountMerchantNumIsNotNull() {
addCriterion("account_merchant_num is not null");
return (Criteria) this;
}
public Criteria andAccountMerchantNumEqualTo(String value) {
addCriterion("account_merchant_num =", value, "accountMerchantNum");
return (Criteria) this;
}
public Criteria andAccountMerchantNumNotEqualTo(String value) {
addCriterion("account_merchant_num <>", value, "accountMerchantNum");
return (Criteria) this;
}
public Criteria andAccountMerchantNumGreaterThan(String value) {
addCriterion("account_merchant_num >", value, "accountMerchantNum");
return (Criteria) this;
}
public Criteria andAccountMerchantNumGreaterThanOrEqualTo(String value) {
addCriterion("account_merchant_num >=", value, "accountMerchantNum");
return (Criteria) this;
}
public Criteria andAccountMerchantNumLessThan(String value) {
addCriterion("account_merchant_num <", value, "accountMerchantNum");
return (Criteria) this;
}
public Criteria andAccountMerchantNumLessThanOrEqualTo(String value) {
addCriterion("account_merchant_num <=", value, "accountMerchantNum");
return (Criteria) this;
}
public Criteria andAccountMerchantNumLike(String value) {
addCriterion("account_merchant_num like", value, "accountMerchantNum");
return (Criteria) this;
}
public Criteria andAccountMerchantNumNotLike(String value) {
addCriterion("account_merchant_num not like", value, "accountMerchantNum");
return (Criteria) this;
}
public Criteria andAccountMerchantNumIn(List<String> values) {
addCriterion("account_merchant_num in", values, "accountMerchantNum");
return (Criteria) this;
}
public Criteria andAccountMerchantNumNotIn(List<String> values) {
addCriterion("account_merchant_num not in", values, "accountMerchantNum");
return (Criteria) this;
}
public Criteria andAccountMerchantNumBetween(String value1, String value2) {
addCriterion("account_merchant_num between", value1, value2, "accountMerchantNum");
return (Criteria) this;
}
public Criteria andAccountMerchantNumNotBetween(String value1, String value2) {
addCriterion("account_merchant_num not between", value1, value2, "accountMerchantNum");
return (Criteria) this;
}
public Criteria andExt1IsNull() {
addCriterion("ext_1 is null");
return (Criteria) this;

@ -0,0 +1,246 @@
package com.hai.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* high_order_split_accounts_record
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class HighOrderSplitAccountsRecord implements Serializable {
private Long id;
/**
* 订单id
*/
private Long orderId;
/**
* 订单号
*/
private Integer orderNo;
/**
* 平台类型 1微信
*/
private Integer type;
/**
* 账户号码
*/
private String accountNo;
/**
* 分账比例
*/
private BigDecimal rate;
/**
* 分账金额
*/
private BigDecimal splitPrice;
/**
* 状态 0删除 1待分账 2分账成功 3分账失败
*/
private Integer status;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改时间
*/
private Date updateTime;
private String ext1;
private String ext2;
private String ext3;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getOrderId() {
return orderId;
}
public void setOrderId(Long orderId) {
this.orderId = orderId;
}
public Integer getOrderNo() {
return orderNo;
}
public void setOrderNo(Integer orderNo) {
this.orderNo = orderNo;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getAccountNo() {
return accountNo;
}
public void setAccountNo(String accountNo) {
this.accountNo = accountNo;
}
public BigDecimal getRate() {
return rate;
}
public void setRate(BigDecimal rate) {
this.rate = rate;
}
public BigDecimal getSplitPrice() {
return splitPrice;
}
public void setSplitPrice(BigDecimal splitPrice) {
this.splitPrice = splitPrice;
}
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;
}
HighOrderSplitAccountsRecord other = (HighOrderSplitAccountsRecord) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId()))
&& (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo()))
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
&& (this.getAccountNo() == null ? other.getAccountNo() == null : this.getAccountNo().equals(other.getAccountNo()))
&& (this.getRate() == null ? other.getRate() == null : this.getRate().equals(other.getRate()))
&& (this.getSplitPrice() == null ? other.getSplitPrice() == null : this.getSplitPrice().equals(other.getSplitPrice()))
&& (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 + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
result = prime * result + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode());
result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
result = prime * result + ((getAccountNo() == null) ? 0 : getAccountNo().hashCode());
result = prime * result + ((getRate() == null) ? 0 : getRate().hashCode());
result = prime * result + ((getSplitPrice() == null) ? 0 : getSplitPrice().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(", orderId=").append(orderId);
sb.append(", orderNo=").append(orderNo);
sb.append(", type=").append(type);
sb.append(", accountNo=").append(accountNo);
sb.append(", rate=").append(rate);
sb.append(", splitPrice=").append(splitPrice);
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,43 @@
package com.hai.enum_type;
import java.util.Objects;
/**
* 订单状态
* @author hurui
*/
public enum OperatorEnum {
type1(1 , "电信运营商"),
type2(2 , "移动运营商"),
type3(3 , "联通运营商"),
;
private Integer type;
private String name;
OperatorEnum(int type , String name) {
this.type = type;
this.name = name;
}
public static String getNameByType(Integer type) {
for (OperatorEnum ele : values()) {
if(Objects.equals(type,ele.getType())) return ele.getName();
}
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;
}
}

@ -8,7 +8,7 @@ import java.util.Objects;
*/
public enum OrderPushType {
type1(1 , "加油订单"),
type2(2 , "话费订单"),
type2(2 , "充值订单"),
type3(3 , "KFC订单"),
type4(4 , "电影票订单"),
type5(5 , "汇联通会员卡"),

@ -32,4 +32,5 @@ public class HighMerchantStoreModel extends HighMerchantStore {
public void setHighMerchant(HighMerchant highMerchant) {
this.highMerchant = highMerchant;
}
}

@ -18,14 +18,14 @@ public class OutOrderModel {
*/
private BigDecimal orderPrice;
private Integer status;
private Integer payStatus;
public Integer getStatus() {
return status;
public Integer getPayStatus() {
return payStatus;
}
public void setStatus(Integer status) {
this.status = status;
public void setPayStatus(Integer payStatus) {
this.payStatus = payStatus;
}
public Date getDay() {

@ -0,0 +1,17 @@
package com.hai.model;
import com.hai.entity.OutRechargeOrder;
import com.hai.entity.OutRechargePrice;
public class OutRechargeOrderDetailModel extends OutRechargeOrder {
// 产品模型
private OutRechargePrice outRechargePrice;
public OutRechargePrice getOutRechargePrice() {
return outRechargePrice;
}
public void setOutRechargePrice(OutRechargePrice outRechargePrice) {
this.outRechargePrice = outRechargePrice;
}
}

@ -20,6 +20,9 @@ public class UserModel {
// 待支付数量
private Integer unpaid;
// 充值订单待支付数量
private Integer rechargeOrderNum;
// 是否设置支付密码
private Boolean isSetPayPwd;
@ -114,4 +117,12 @@ public class UserModel {
public void setIsSetHltCard(Boolean setHltCard) {
isSetHltCard = setHltCard;
}
public Integer getRechargeOrderNum() {
return rechargeOrderNum;
}
public void setRechargeOrderNum(Integer rechargeOrderNum) {
this.rechargeOrderNum = rechargeOrderNum;
}
}

@ -3,7 +3,8 @@ package com.hai.msg.entity;
public enum MsgTopic {
// 门店账户业务员
MerStoreAccount("mer-store-account");
MerStoreAccount("mer-store-account"),
oilPriceTask("OIL-PRICE-TASK");
private String name;

@ -147,6 +147,12 @@ public interface CommonService {
*/
SecRegion getRegionsById(Long regionId);
/**
* 查询省级列表
* @return
*/
List<SecRegion> getProvinceList();
/**
* 根据地区名称模糊查询
* @param regionName

@ -17,6 +17,12 @@ public interface HighGasOilPriceTaskService {
*/
void editData(HighGasOilPriceTask gasOilPriceTask);
/**
* 批量增加价格任务
* @param taskList
*/
void batchAddTask(List<HighGasOilPriceTask> taskList);
/**
* 增加价格任务
* @param gasOilPriceTask

@ -0,0 +1,45 @@
package com.hai.service;
import com.hai.entity.HighMerchantAccount;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
public interface HighMerchantAccountService {
/**
* 编辑商户账户
* @param merchantAccount
*/
void editMerchantAccount(HighMerchantAccount merchantAccount);
/**
* 充值
* @param merId
* @param amount
* @param otherParam
*/
void recharge(Long merId, BigDecimal amount, Map<String, Object> otherParam);
/**
* 查询商户账户
* @param merId
* @return
*/
HighMerchantAccount getStoreAccountDetail(Long merId);
/**
* 统计商户加油金额
* @param merId
* @return
*/
BigDecimal countMerGasOilAmount(Long merId);
/**
* 查询门店加油金额
* @param merId
* @return
*/
List<Map<String, Object>> getStoreGasOilAmountByMer(Long merId);
}

@ -0,0 +1,20 @@
package com.hai.service;
import com.hai.entity.HighMerchantTripartitePlatform;
public interface HighMerchantTripartitePlatformService {
/**
* 编辑数据
* @param tripartitePlatform
*/
void editDate(HighMerchantTripartitePlatform tripartitePlatform);
/**
* 查询详情
* @param merId
* @param platformType
* @return
*/
HighMerchantTripartitePlatform getDetail(Long merId,Integer platformType);
}

@ -2,6 +2,7 @@ package com.hai.service;
import com.alibaba.fastjson.JSONObject;
import com.hai.entity.HighUserCard;
import com.hai.entity.OutRechargeChildOrder;
import com.hai.entity.OutRechargeOrder;
import com.hai.model.OrderCountModel;
import com.hai.model.OutOrderModel;
@ -49,7 +50,7 @@ public interface OutRechargeOrderService {
* @Param [outRechargeOrder]
* @return void
**/
void insertOrder(OutRechargeOrder outRechargeOrder) throws Exception;
OutRechargeOrder insertOrder(JSONObject object) throws Exception;
/***
* @Author Sum1Dream
@ -165,4 +166,15 @@ public interface OutRechargeOrderService {
*/
void pollRequest(OutRechargeOrder outRechargeOrder) throws Exception;
/**
* @Author Sum1Dream
* @name rechargeOrderNum.java
* @Description // 查询充值订单待支付数量
* @Date 17:49 2022/5/30
* @Param [java.lang.Long]
* @return java.lang.Integer
*/
Integer rechargeOrderNum(Long userId);
}

@ -37,6 +37,15 @@ public interface OutRechargePriceService {
**/
OutRechargePriceModel findById(Long id , Integer platformId);
/**
* @Author Sum1Dream
* @Description //查询详情 Administrator
* @Date 17:40 2021/6/12
* @Param [id]
* @return com.hai.entity.OutRechargePrice
**/
OutRechargePrice findByGoodsId(Long goodsId);
/**
* @Author Sum1Dream
* @Description //新增 Administrator

@ -89,7 +89,10 @@ public class BsCompanyServiceImpl implements BsCompanyService {
public BsCompany getCompanyById(Long id) {
BsCompany company =bsCompanyMapper.selectByPrimaryKey(id);
if (company.getRegionId() != null) {
// company.setRegionName(commonService.getRegionName(Long.valueOf(company.getRegionId())));
SecRegion region = commonService.getRegionsById(Long.parseLong(company.getRegionId()));
if (region != null) {
company.setRegionName(region.getRegionName());
}
}
return company;
}

@ -410,6 +410,13 @@ public class CommonServiceImpl implements CommonService {
return regionMapper.selectByPrimaryKey(regionId);
}
@Override
public List<SecRegion> getProvinceList() {
SecRegionExample example = new SecRegionExample();
example.createCriteria().andParentIdIsNull().andStatusEqualTo(1);
return regionMapper.selectByExample(example);
}
@Override
public SecRegion getRegionsByName(String regionName) {
SecRegionExample example = new SecRegionExample();
@ -531,6 +538,8 @@ public class CommonServiceImpl implements CommonService {
String url = "http://api.map.baidu.com/reverse_geocoding/v3/";
System.out.println("请求经纬度========" + map);
return HttpsUtils.doGet(url , map);
}

@ -20,6 +20,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.List;
import java.util.Map;
@ -134,12 +135,74 @@ public class HighGasDiscountOilPriceServiceImpl implements HighGasDiscountOilPri
}
discount = discount.divide(new BigDecimal("100"));
// 枪价
BigDecimal priceGun = null;
BigDecimal priceGun;
// 优惠价
BigDecimal priceVip = null;
BigDecimal priceVip;
// 优惠幅度
BigDecimal preferentialMargin = new BigDecimal("0");
// 来源类型 1:平台自建 2:团油
if (store.getSourceType().equals(2)) {
// 查询油站价格
HighGasOilPrice gasOilPrice = gasOilPriceService.getGasOilPriceByStoreAndOilNo(goodsId, Integer.parseInt(oilNo));
if (gasOilPrice == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油站价格");
}
priceGun = gasOilPrice.getPriceGun();
priceVip = gasOilPrice.getPriceVip();
preferentialMargin = gasOilPrice.getPreferentialMargin();
// 国标价
BigDecimal priceOfficial = gasOilPrice.getPriceOfficial();
GasPayPriceModel payPriceModel = new GasPayPriceModel();
if (store.getSourceType().equals(1)) {
// 嗨森逛平台价 国标价 * 折扣
BigDecimal pricePlatform = priceGun.multiply(discount).setScale(2, BigDecimal.ROUND_HALF_UP);
// 加油金额
payPriceModel.setOilingPrice(oilingPrice);
// 加油站枪价
payPriceModel.setPriceGun(priceGun);
// 加油站优惠价
payPriceModel.setPriceVip(priceVip);
// 加油站国标价
payPriceModel.setPriceOfficial(priceOfficial);
// 平台价
payPriceModel.setPricePlatform(pricePlatform);
// 加油升数,计算方式:加油金额 / 枪价
payPriceModel.setOilLiters(oilingPrice.divide(priceGun, 2, BigDecimal.ROUND_HALF_DOWN));
// 平台折扣,我们平台或者代理商设置的折扣
payPriceModel.setDiscount(discount.compareTo(new BigDecimal("1.00")) == 0 ? new BigDecimal("100") : discount);
// 加油补贴, 计算方式:加油站枪价 - 加油站VIP价
payPriceModel.setOilSubsidy(priceGun.subtract(priceVip));
// 折扣,1 -平台折扣
BigDecimal decimal1 = new BigDecimal("1").subtract(discount);
// 油枪价 - 优惠幅度
BigDecimal price = payPriceModel.getPriceGun().subtract(preferentialMargin);
// 优惠价格 (油枪价 - 优惠幅度) * 系统折扣
payPriceModel.setPricePreferences(price.multiply(discount).setScale(2, BigDecimal.ROUND_HALF_UP));
// 每升优惠 枪价 - 优惠价格
payPriceModel.setLitersPreferences(priceGun.subtract(payPriceModel.getPricePreferences()));
// 本次优惠 加油升数 * 每升优惠
payPriceModel.setTotalPreferences(payPriceModel.getOilLiters().multiply(payPriceModel.getLitersPreferences()).setScale(2, BigDecimal.ROUND_DOWN));
// 支付价格 加油金额 - 本次优惠
payPriceModel.setPayPrice(oilingPrice.subtract(payPriceModel.getTotalPreferences()));
} else if (store.getSourceType().equals(2)) {
// 查询油站油品价格
JSONObject oilPriceObject = TuanYouConfig.queryCompanyPriceDetail(store.getStoreKey(), oilNo);
if (oilPriceObject == null) {
@ -154,66 +217,52 @@ public class HighGasDiscountOilPriceServiceImpl implements HighGasDiscountOilPri
priceGun = priceDetail.getBigDecimal("priceGun");
// 团油优惠价
priceVip = priceDetail.getBigDecimal("priceVip");
}
HighGasOilPrice gasOilPrice = gasOilPriceService.getGasOilPriceByStoreAndOilNo(goodsId, Integer.parseInt(oilNo));
if (gasOilPrice == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油站价格");
}
if (priceGun == null) {
priceGun = gasOilPrice.getPriceGun();
}
if (priceVip == null) {
priceVip = gasOilPrice.getPriceVip();
}
// 团油国标价
BigDecimal priceOfficial = gasOilPrice.getPriceOfficial();
// 嗨森逛平台价 国标价 * 折扣
BigDecimal pricePlatform = priceGun.multiply(discount).setScale(2, BigDecimal.ROUND_HALF_UP);
// 嗨森逛平台价 国标价 * 折扣
BigDecimal pricePlatform = priceGun.multiply(discount).setScale(2, BigDecimal.ROUND_HALF_UP);
GasPayPriceModel payPriceModel = new GasPayPriceModel();
// 加油金额
payPriceModel.setOilingPrice(oilingPrice);
// 加油金额
payPriceModel.setOilingPrice(oilingPrice);
// 团油枪价
payPriceModel.setPriceGun(priceGun);
// 团油优惠价
payPriceModel.setPriceVip(priceVip);
// 团油枪价
payPriceModel.setPriceGun(priceGun);
// 团油国标
payPriceModel.setPriceOfficial(priceOfficial);
// 团油优惠价
payPriceModel.setPriceVip(priceVip);
// 平台
payPriceModel.setPricePlatform(pricePlatform);
// 团油国标
payPriceModel.setPriceOfficial(priceOfficial);
// 加油升数,计算方式:加油金额 / 枪
payPriceModel.setOilLiters(oilingPrice.divide(priceGun, 2, BigDecimal.ROUND_HALF_DOWN));
// 平台
payPriceModel.setPricePlatform(pricePlatform);
// 平台折扣,我们平台或者代理商设置的折扣
payPriceModel.setDiscount(discount.compareTo(new BigDecimal("1.00")) == 0 ? new BigDecimal("0") : discount);
// 加油升数,计算方式:加油金额 / 枪价
payPriceModel.setOilLiters(oilingPrice.divide(priceGun, 2, BigDecimal.ROUND_HALF_DOWN));
// 加油补贴, 计算方式:团油枪价 - 团油VIP价
payPriceModel.setOilSubsidy(priceGun.subtract(priceVip));
// 平台折扣,我们平台或者代理商设置的折扣
payPriceModel.setDiscount(discount.compareTo(new BigDecimal("1.00")) == 0 ? new BigDecimal("100") : discount);
// 折扣,1 -平台折扣
BigDecimal decimal1 = new BigDecimal("1").subtract(discount);
// 加油补贴, 计算方式:团油枪价 - 团油VIP价
payPriceModel.setOilSubsidy(priceGun.subtract(priceVip));
// 价格差价 团油枪价 - 团油VIP价
BigDecimal oilPriceDifferences = priceGun.subtract(priceVip);
// 折扣,1 -平台折扣
BigDecimal decimal1 = new BigDecimal("1").subtract(discount);
// 每升优惠 团油枪价 *(1-平台折扣)+(国标价-团油VIP价 )
payPriceModel.setLitersPreferences(priceGun.multiply(decimal1).setScale(2, BigDecimal.ROUND_HALF_UP).add(oilPriceDifferences));
// 价格差价 团油枪价 - 团油VIP价
BigDecimal oilPriceDifferences = priceGun.subtract(priceVip);
// 优惠价格 团油枪价 * 平台折扣 -(国标价-团油VIP价 )
payPriceModel.setPricePreferences(pricePlatform.subtract(oilPriceDifferences));
// 每升优惠 团油枪价 *(1-平台折扣)+(国标价-团油VIP价 )
payPriceModel.setLitersPreferences(priceGun.multiply(decimal1).setScale(2, BigDecimal.ROUND_HALF_UP).add(oilPriceDifferences));
// 本次优惠
payPriceModel.setTotalPreferences(payPriceModel.getOilLiters().multiply(payPriceModel.getLitersPreferences()).setScale(2, BigDecimal.ROUND_DOWN));
// 优惠价格 团油枪价 * 平台折扣 -(国标价-团油VIP价 )
payPriceModel.setPricePreferences(pricePlatform.subtract(oilPriceDifferences));
// 支付价格
payPriceModel.setPayPrice(oilingPrice.subtract(payPriceModel.getTotalPreferences()));
// 本次优惠
payPriceModel.setTotalPreferences(payPriceModel.getOilLiters().multiply(payPriceModel.getLitersPreferences()).setScale(2, BigDecimal.ROUND_DOWN));
// 支付价格
payPriceModel.setPayPrice(oilingPrice.subtract(payPriceModel.getTotalPreferences()));
}
return payPriceModel;
}
}

@ -3,6 +3,8 @@ package com.hai.service.impl;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.utils.DateUtil;
import com.hai.common.utils.RedisUtil;
import com.hai.dao.HighGasOilPriceTaskMapper;
import com.hai.entity.HighGasOilPrice;
import com.hai.entity.HighGasOilPriceOfficial;
@ -11,12 +13,15 @@ import com.hai.entity.HighGasOilPriceTaskExample;
import com.hai.enum_type.GasTaskExecutionTypeEnum;
import com.hai.enum_type.GasTaskPriceTypeEnum;
import com.hai.enum_type.GasTaskStatusEnum;
import com.hai.msg.entity.MsgTopic;
import com.hai.service.HighGasOilPriceOfficialService;
import com.hai.service.HighGasOilPriceService;
import com.hai.service.HighGasOilPriceTaskService;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
@ -26,6 +31,9 @@ import java.util.Map;
@Service("gasOilPriceTaskService")
public class HighGasOilPriceTaskServiceImpl implements HighGasOilPriceTaskService {
@Resource
private RedisUtil redisUtil;
@Resource
private HighGasOilPriceTaskMapper gasOilPriceTaskMapper;
@ -48,63 +56,77 @@ public class HighGasOilPriceTaskServiceImpl implements HighGasOilPriceTaskServic
}
@Override
@Transactional(propagation= Propagation.REQUIRED)
public void batchAddTask(List<HighGasOilPriceTask> taskList) {
for (HighGasOilPriceTask task : taskList) {
addTask(task);
}
}
@Override
@Transactional(propagation= Propagation.REQUIRED)
public void addTask(HighGasOilPriceTask gasOilPriceTask) {
editData(gasOilPriceTask);
// 立刻执行
if (gasOilPriceTask.getExecutionType().equals(GasTaskExecutionTypeEnum.type1.getStatus())) {
businessHandle(gasOilPriceTask);
}
} else if (gasOilPriceTask.getExecutionType().equals(GasTaskExecutionTypeEnum.type2.getStatus())) {
long time = DateUtil.getSecondDiff(new Date(), gasOilPriceTask.getStartTime());
if (time >= 1) {
redisUtil.set(MsgTopic.oilPriceTask.getName() + "-" + gasOilPriceTask.getId(), "", time);
} else {
businessHandle(gasOilPriceTask);
}
}
}
@Override
@Transactional(propagation= Propagation.REQUIRED)
public void businessHandle(HighGasOilPriceTask gasOilPriceTask) {
// 立刻执行
if (gasOilPriceTask.getExecutionType().equals(GasTaskExecutionTypeEnum.type1.getStatus())) {
gasOilPriceTask.setStartTime(new Date());
gasOilPriceTask.setStatus(GasTaskStatusEnum.status2.getStatus());
editData(gasOilPriceTask);
// 国标价
if (gasOilPriceTask.getPriceType().equals(GasTaskPriceTypeEnum.type1.getStatus())) {
// 查询国标价油品价格
HighGasOilPriceOfficial price = gasOilPriceOfficialService.getPrice(gasOilPriceTask.getRegionId(), gasOilPriceTask.getOilNo());
if (price == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油品价格");
}
gasOilPriceOfficialService.editPrice(gasOilPriceTask.getRegionId(), gasOilPriceTask.getOilNo(), gasOilPriceTask.getPrice());
new Thread(() -> {
gasOilPriceOfficialService.refreshGasPriceOfficial(gasOilPriceTask.getRegionId(), gasOilPriceTask.getOilNo());
}).start();
}
gasOilPriceTask.setStartTime(new Date());
gasOilPriceTask.setStatus(GasTaskStatusEnum.status2.getStatus());
editData(gasOilPriceTask);
// 油站价
if (gasOilPriceTask.getPriceType().equals(GasTaskPriceTypeEnum.type2.getStatus())) {
// 查询油品价格
HighGasOilPrice price = gasOilPriceService.getGasOilPriceByStoreAndOilNo(gasOilPriceTask.getMerStoreId(), gasOilPriceTask.getOilNo());
if (price == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油品价格");
}
price.setPriceGun(gasOilPriceTask.getPrice());
price.setPriceVip(gasOilPriceTask.getPrice().subtract(price.getPreferentialMargin()));
gasOilPriceService.editGasOilPrice(price);
// 国标价
if (gasOilPriceTask.getPriceType().equals(GasTaskPriceTypeEnum.type1.getStatus())) {
// 查询国标价油品价格
HighGasOilPriceOfficial price = gasOilPriceOfficialService.getPrice(gasOilPriceTask.getRegionId(), gasOilPriceTask.getOilNo());
if (price == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油品价格");
}
gasOilPriceOfficialService.editPrice(gasOilPriceTask.getRegionId(), gasOilPriceTask.getOilNo(), gasOilPriceTask.getPrice());
// 优惠幅度
if (gasOilPriceTask.getPriceType().equals(GasTaskPriceTypeEnum.type3.getStatus())) {
// 查询油品价格
HighGasOilPrice price = gasOilPriceService.getGasOilPriceByStoreAndOilNo(gasOilPriceTask.getMerStoreId(), gasOilPriceTask.getOilNo());
if (price == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油品价格");
}
price.setPreferentialMargin(gasOilPriceTask.getPrice());
price.setPriceVip(price.getPriceGun().subtract(price.getPreferentialMargin()));
gasOilPriceService.editGasOilPrice(price);
new Thread(() -> {
gasOilPriceOfficialService.refreshGasPriceOfficial(gasOilPriceTask.getRegionId(), gasOilPriceTask.getOilNo());
}).start();
}
// 油站价
if (gasOilPriceTask.getPriceType().equals(GasTaskPriceTypeEnum.type2.getStatus())) {
// 查询油品价格
HighGasOilPrice price = gasOilPriceService.getGasOilPriceByStoreAndOilNo(gasOilPriceTask.getMerStoreId(), gasOilPriceTask.getOilNo());
if (price == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油品价格");
}
price.setPriceGun(gasOilPriceTask.getPrice());
price.setPriceVip(gasOilPriceTask.getPrice().subtract(price.getPreferentialMargin()));
gasOilPriceService.editGasOilPrice(price);
}
// 优惠幅度
if (gasOilPriceTask.getPriceType().equals(GasTaskPriceTypeEnum.type3.getStatus())) {
// 查询油品价格
HighGasOilPrice price = gasOilPriceService.getGasOilPriceByStoreAndOilNo(gasOilPriceTask.getMerStoreId(), gasOilPriceTask.getOilNo());
if (price == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油品价格");
}
price.setPreferentialMargin(gasOilPriceTask.getPrice());
price.setPriceVip(price.getPriceGun().subtract(price.getPreferentialMargin()));
gasOilPriceService.editGasOilPrice(price);
}
}
@Override
@ -121,6 +143,9 @@ public class HighGasOilPriceTaskServiceImpl implements HighGasOilPriceTaskServic
}
detail.setStatus(GasTaskStatusEnum.status0.getStatus());
editData(detail);
// 从redis中删除任务
redisUtil.del(MsgTopic.oilPriceTask.getName() + "-" + taskId);
}
@Override
@ -145,6 +170,10 @@ public class HighGasOilPriceTaskServiceImpl implements HighGasOilPriceTaskServic
criteria.andMerStoreNameLike("%" + MapUtils.getString(param, "merStoreName") + "%");
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "merStoreKey"))) {
criteria.andMerStoreKeyLike("%" + MapUtils.getString(param, "merStoreKey") + "%");
}
if (MapUtils.getInteger(param, "oilType") != null) {
criteria.andOilTypeEqualTo(MapUtils.getInteger(param, "oilType"));
}

@ -0,0 +1,93 @@
package com.hai.service.impl;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.utils.BankNumberUtil;
import com.hai.dao.HighMerchantAccountMapper;
import com.hai.entity.HighMerchant;
import com.hai.entity.HighMerchantAccount;
import com.hai.entity.HighMerchantAccountExample;
import com.hai.entity.HighMerchantStoreAccount;
import com.hai.model.HighMerchantModel;
import com.hai.model.HighMerchantStoreModel;
import com.hai.service.HighMerchantAccountService;
import com.hai.service.HighMerchantService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Service("merchantAccountService")
public class HighMerchantAccountServiceImpl implements HighMerchantAccountService {
@Resource
private HighMerchantAccountMapper merchantAccountMapper;
@Resource
private HighMerchantService merchantService;
@Override
public void editMerchantAccount(HighMerchantAccount merchantAccount) {
if (merchantAccount.getId() == null) {
merchantAccount.setAccountNo(BankNumberUtil.getBrankNumber("6"));
merchantAccount.setCreateTime(new Date());
merchantAccount.setUpdateTime(new Date());
merchantAccount.setStatus(1);
merchantAccountMapper.insert(merchantAccount);
} else {
merchantAccount.setUpdateTime(new Date());
merchantAccountMapper.updateByPrimaryKey(merchantAccount);
}
}
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void recharge(Long merId, BigDecimal amount, Map<String, Object> otherParam) {
// 查询商户
HighMerchant merchant = merchantService.getDetailById(merId);
if (merchant == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户");
}
// 是否开通了账户
HighMerchantAccount account = getStoreAccountDetail(merId);
if (account == null) {
account = new HighMerchantAccount();
account.setMerId(merId);
account.setAmounts(new BigDecimal("0"));
}
// 变更前金额
BigDecimal beforeAmount = account.getAmounts();
// 计算金额
account.setAmounts(account.getAmounts().add(amount));
// 变更后金额
BigDecimal afterAmount = account.getAmounts();
editMerchantAccount(account);
}
@Override
public HighMerchantAccount getStoreAccountDetail(Long merId) {
HighMerchantAccountExample example = new HighMerchantAccountExample();
example.createCriteria().andStatusEqualTo(1).andMerIdEqualTo(merId);
List<HighMerchantAccount> list = merchantAccountMapper.selectByExample(example);
if (list.size() > 0) {
return list.get(0);
}
return null;
}
@Override
public BigDecimal countMerGasOilAmount(Long merId) {
return merchantAccountMapper.countMerGasOilAmount(merId);
}
@Override
public List<Map<String, Object>> getStoreGasOilAmountByMer(Long merId) {
return merchantAccountMapper.selectStoreGasOilAmountByMer(merId);
}
}

@ -1,9 +1,6 @@
package com.hai.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
@ -178,6 +175,14 @@ public class HighMerchantStoreServiceImpl implements HighMerchantStoreService {
HighMerchantStoreExample example = new HighMerchantStoreExample();
HighMerchantStoreExample.Criteria criteria = example.createCriteria();
if (MapUtils.getInteger(map, "type") != null) {
criteria.andTypeEqualTo(MapUtils.getInteger(map, "type"));
}
if (MapUtils.getInteger(map, "sourceType") != null) {
criteria.andSourceTypeEqualTo(MapUtils.getInteger(map, "sourceType"));
}
if (MapUtils.getLong(map, "companyId") != null) {
criteria.andCompanyIdEqualTo(MapUtils.getLong(map, "companyId"));
}

@ -0,0 +1,42 @@
package com.hai.service.impl;
import com.hai.dao.HighMerchantTripartitePlatformMapper;
import com.hai.entity.HighMerchantTripartitePlatform;
import com.hai.entity.HighMerchantTripartitePlatformExample;
import com.hai.service.HighMerchantTripartitePlatformService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
@Service("merchantTripartitePlatformService")
public class HighMerchantTripartitePlatformServiceImpl implements HighMerchantTripartitePlatformService {
@Resource
private HighMerchantTripartitePlatformMapper merchantTripartitePlatformMapper;
@Override
public void editDate(HighMerchantTripartitePlatform tripartitePlatform) {
if (tripartitePlatform.getId() == null) {
tripartitePlatform.setStatus(1);
tripartitePlatform.setCreateTime(new Date());
tripartitePlatform.setUpdateTime(new Date());
merchantTripartitePlatformMapper.insert(tripartitePlatform);
} else {
tripartitePlatform.setUpdateTime(new Date());
merchantTripartitePlatformMapper.updateByPrimaryKey(tripartitePlatform);
}
}
@Override
public HighMerchantTripartitePlatform getDetail(Long merId, Integer platformType) {
HighMerchantTripartitePlatformExample example = new HighMerchantTripartitePlatformExample();
example.createCriteria().andMerIdEqualTo(merId).andPlatformTypeEqualTo(platformType);
List<HighMerchantTripartitePlatform> list = merchantTripartitePlatformMapper.selectByExample(example);
if (list.size() > 0) {
return list.get(0);
}
return null;
}
}

@ -36,7 +36,7 @@ public class HighOilCardRecordServiceImpl implements HighOilCardRecordService {
oilCardRecord.setOpUserName(userInfoModel.getSecUser().getUserName());
}
HighUserModel userModel = userCenter.getSessionModel(HighUserModel.class);
if (userModel == null) {
if (userModel != null) {
oilCardRecord.setOpUserId(userModel.getHighUser().getId());
oilCardRecord.setOpUserName(userModel.getHighUser().getName());
}

@ -40,6 +40,9 @@ public class HighUserServiceImpl implements HighUserService {
@Resource
private HighUserCouponService highUserCouponService;
@Resource
private OutRechargeOrderService outRechargeOrderService;
@Resource
private HighUserCardService highUserCardService;
@ -98,6 +101,7 @@ public class HighUserServiceImpl implements HighUserService {
}
user.setUnusedCouponNum(highUserCouponService.getCouponList(userId, 1).size()); //未使用卡卷数量
user.setUnpaid(highOrderService.countOrderByUserId(userId , 1));
user.setRechargeOrderNum(outRechargeOrderService.rechargeOrderNum(userId));
user.setUnusedDiscount(highOrderService.countUnusedDiscountByUserId(userId , 1));
user.setIsSetPayPwd(highUserPayPasswordService.isSetPayPwd(userId));
user.setIsSetHltCard(highUserCardService.isBindHtlCard(userId));
@ -218,7 +222,7 @@ public class HighUserServiceImpl implements HighUserService {
}
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
@Transactional(propagation= Propagation.REQUIRED)
public void goldHandle(Long userId, Integer goldNum, Integer goldType, Integer resType, Long resId) {
// 查询用户信息
HighUser user = highUserMapper.selectByPrimaryKey(userId);

@ -199,7 +199,8 @@ public class HltUnionCardVipServiceImpl implements HltUnionCardVipService {
if (equityLevel == 1) {
HuiLianTongUnionCardConfig.submitSms(phone , "“E信通会员专属”3张4元话费券、2张99折加油券已到账,打开“嗨森逛”微信小程序>我的>我的优惠券即可直接使用,到账之日起1月内(30天)有效。");
} else {
HuiLianTongUnionCardConfig.submitSms(phone , "“工会卡用户专属”2元话费券、2张99折加油券已到账,打开“嗨森逛”微信小程序>我的>我的优惠券即可直接使用,到账之日起1月内(30天)有效。");
HuiLianTongUnionCardConfig.submitSms(phone , "“工会卡用户专属”2元话费券、5张98折加油券已到账,打开“嗨森逛”微信小程序>我的>我的优惠券即可直接使用,到账之日起1月内(30天)有效。");
}
}

@ -12,6 +12,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -34,6 +35,8 @@ public class OutRechargeChildOrderServiceImpl implements OutRechargeChildOrderSe
criteria.andStatusEqualTo(MapUtils.getInteger(map , "status"));
}
example.setOrderByClause("create_time desc");
return rechargeChildOrderMapper.selectByExample(example);
}
@ -44,6 +47,17 @@ public class OutRechargeChildOrderServiceImpl implements OutRechargeChildOrderSe
@Override
public OutRechargeChildOrder findByOrderNo(String orderNo) {
OutRechargeChildOrderExample example = new OutRechargeChildOrderExample();
OutRechargeChildOrderExample.Criteria criteria = example.createCriteria();
criteria.andOrderNoEqualTo(orderNo);
List<OutRechargeChildOrder> list = rechargeChildOrderMapper.selectByExample(example);
if (list.size() > 0 ) {
return list.get(0);
}
return null;
}

@ -7,12 +7,15 @@ 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.security.AESEncodeUtil;
import com.hai.common.utils.*;
import com.hai.config.*;
import com.hai.dao.HighGasOrderPushMapper;
import com.hai.dao.OutRechargeOrderMapper;
import com.hai.dao.OutRechargeOrderMapperExt;
import com.hai.entity.*;
import com.hai.enum_type.DiscountUseScope;
import com.hai.enum_type.OperatorEnum;
import com.hai.enum_type.OrderPushType;
import com.hai.enum_type.RechargePayType;
import com.hai.model.*;
@ -28,12 +31,14 @@ import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.util.EntityUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestParam;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.SimpleDateFormat;
import java.util.*;
@ -76,6 +81,16 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
@Resource
private BsRequestRecordService bsRequestRecordService;
@Resource
private BsConfigService bsConfigService;
@Resource
private SecConfigService secConfigService;
@Resource
private HighUserPayPasswordService highUserPayPasswordService;
@Override
public List<OutRechargeOrder> getListRechargeOrder(Map<String, String> map) {
OutRechargeOrderExample example = new OutRechargeOrderExample();
@ -105,6 +120,13 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
criteria.andUserPhoneEqualTo(MapUtils.getString(map, "phone"));
}
if (MapUtils.getInteger(map, "status") != null) {
criteria.andPayStatusEqualTo(MapUtils.getInteger(map, "status"));
}
if (MapUtils.getInteger(map, "rechargeStatus") != null) {
criteria.andRechargeStatusEqualTo(MapUtils.getInteger(map, "rechargeStatus"));
}
if (StringUtils.isNotBlank(map.get("payTimeS")) && StringUtils.isNotBlank(map.get("payTimeE"))) {
criteria.andPayTimeBetween(
@ -134,8 +156,173 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
}
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void insertOrder(OutRechargeOrder outRechargeOrder) throws Exception {
@Transactional(
isolation = Isolation.SERIALIZABLE,
propagation= Propagation.REQUIRES_NEW)
public OutRechargeOrder insertOrder(JSONObject object) throws Exception {
OutRechargeOrder outRechargeOrder = new OutRechargeOrder();
HighUser user = highUserService.findByUserId(object.getLong("userId"));
// 产品id
Long goodsId = object.getLong("goodsId");
// 充值内容
String rechargeContent = object.getString("rechargeContent");
// 查询产品详情
OutRechargePriceModel outRechargePrice = outRechargePriceService.findById(goodsId , null);
Map<String, Object> listMap = new HashMap<>();
listMap.put("productType", "3");
listMap.put("returnType", 1);
listMap.put("sourceId", goodsId);
// 查询产品积分抵扣比例
BsProductDiscount bsProductDiscount = bsConfigService.getProductDiscountByMap(listMap);
// 判断充值系统是否关闭
if (!secConfigService.isConfig("RECHARGE" , "1")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.RECHARGE_CLOSE, "");
}
HighDiscountUserRel highDiscountUserRel = null;
// 判断是否有优惠券
if (object.getLong("memDiscountId") != null) {
outRechargeOrder.setMemDiscountId(object.getLong("memDiscountId"));
// 卡优惠券信息
highDiscountUserRel = highDiscountUserRelService.getRelById(object.getLong("memDiscountId"));
if (highDiscountUserRel == null || highDiscountUserRel.getStatus() != 1) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "优惠券状态错误");
}
if (!highDiscountUserRel.getHighDiscount().getUseScope().equals(DiscountUseScope.type1.getType())
&& !highDiscountUserRel.getHighDiscount().getUseScope().equals(DiscountUseScope.type3.getType())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法使用此优惠券");
}
} else {
outRechargeOrder.setPayRealPrice(outRechargePrice.getPayPrice());
}
// 优惠券抵扣
if (highDiscountUserRel != null) {
outRechargeOrder.setMemDiscountName(highDiscountUserRel.getHighDiscount().getDiscountName());
BigDecimal payPrice = new BigDecimal(0);
// 卡卷类型 1:满减 2:抵扣 3:折扣
if (highDiscountUserRel.getHighDiscount().getDiscountType() == 1) {
// 如果商品支付总额 小于 满减价格
if (outRechargePrice.getRechargePrice().compareTo(highDiscountUserRel.getHighDiscount().getDiscountCondition()) < 0) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.UN_MEMBER_ERROR, "订单未达到"+highDiscountUserRel.getHighDiscount().getDiscountCondition()+"元,无法使用此优惠券");
}
// 计算支付金额 = 商品充值总额 - 满减额度
payPrice = outRechargePrice.getRechargePrice().subtract(highDiscountUserRel.getHighDiscount().getDiscountPrice());
outRechargeOrder.setDiscountDeductionPrice(highDiscountUserRel.getHighDiscount().getDiscountPrice());
}
// 卡卷类型 1:满减 2:抵扣 3:折扣
if (highDiscountUserRel.getHighDiscount().getDiscountType() == 2) {
// 计算支付金额 = 商品充值总额 - 满减额度
payPrice = outRechargePrice.getRechargePrice().subtract(highDiscountUserRel.getHighDiscount().getDiscountPrice());
outRechargeOrder.setDiscountDeductionPrice(highDiscountUserRel.getHighDiscount().getDiscountPrice());
}
// 卡卷类型 1:满减 2:抵扣 3:折扣
if (highDiscountUserRel.getHighDiscount().getDiscountType() == 3) {
BigDecimal discountPrice = highDiscountUserRel.getHighDiscount().getDiscountPrice();
// 订单总额 * 折扣
payPrice = outRechargePrice.getRechargePrice().multiply(discountPrice);
outRechargeOrder.setDiscountDeductionPrice(outRechargePrice.getRechargePrice().subtract(payPrice));
outRechargeOrder.setPayRealPrice(payPrice);
}
// 如果总额小于0
if (payPrice.compareTo(new BigDecimal("0")) < 0) {
outRechargeOrder.setPayRealPrice(new BigDecimal("0"));
} else {
outRechargeOrder.setPayRealPrice(payPrice);
}
}
// 判断积分数量是否大于0
if (object.getLong("integralNum") > 0 && bsProductDiscount.getDiscount().compareTo(new BigDecimal("0")) > 0) {
// 判断用户积分是否够
if (object.getLong("integralNum") > user.getGold()) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "用户积分不足");
}
// 积分抵扣金额
BigDecimal integralDeductionPrice = object.getBigDecimal("integralNum").divide(new BigDecimal(100).setScale(2, RoundingMode.HALF_DOWN));
// 最高可抵扣金额
BigDecimal maxIntegralDeductionPrice = outRechargeOrder.getPayRealPrice().multiply(bsProductDiscount.getDiscount()).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_DOWN);
// 判读积分是否大于限制额度
if (maxIntegralDeductionPrice.compareTo(integralDeductionPrice) < 0) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "订单最大抵扣积分金额:" + maxIntegralDeductionPrice);
}
// 判断积分抵扣比例是否为100% 并且积分数量是否可以抵扣最后的支付金额
if (bsProductDiscount.getDiscount().compareTo(new BigDecimal(100)) == 0 && integralDeductionPrice.compareTo(outRechargeOrder.getPayRealPrice()) == 0) {
// 查询用户支付密码
HighUserPayPassword userPayPassword = highUserPayPasswordService.getDetailByUser(object.getLong("userId"));
if (userPayPassword == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_SET_USER_PAY_PWD, "");
}
if (StringUtils.isBlank(object.getString("password"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_ENTER_USER_PAY_PWD, "");
}
// 校验支付密码
if (!AESEncodeUtil.aesEncrypt(object.getString("password")).equals(userPayPassword.getPassword())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.USER_PAY_PWD_ERROR, "");
}
}
outRechargeOrder.setIntegralDeductionPrice(integralDeductionPrice);
outRechargeOrder.setPayRealPrice(outRechargeOrder.getPayRealPrice().subtract(outRechargeOrder.getIntegralDeductionPrice()));
}
outRechargeOrder.setUserId(object.getLong("userId"));
outRechargeOrder.setIntegralNum(object.getBigDecimal("integralNum"));
outRechargeOrder.setRechargeContent(rechargeContent);
outRechargeOrder.setCompanyId(outRechargePrice.getCompanyId());
outRechargeOrder.setUserName(object.getString("username"));
outRechargeOrder.setRechargeType(outRechargePrice.getRechargeType());
outRechargeOrder.setUserPhone(object.getString("phone"));
outRechargeOrder.setOrderNo("RCG" + DateUtil.date2String(new Date(),"yyyyMMddHHmmss") + IDGenerator.nextId(5));
outRechargeOrder.setCreateTimed(new Date());
outRechargeOrder.setGoodsId(goodsId);
outRechargeOrder.setRechargePrice(outRechargePrice.getRechargePrice());
if (object.getLong("memDiscountId") != null) {
outRechargeOrder.setPayPrice(outRechargePrice.getRechargePrice());
} else {
outRechargeOrder.setPayPrice(outRechargePrice.getPayPrice());
}
outRechargeOrder.setType(1);
outRechargeOrder.setOrderPrice(outRechargePrice.getRechargePrice());
outRechargeOrder.setOperatorName(OperatorEnum.getNameByType(outRechargePrice.getOperatorType()));
outRechargeOrder.setOperatorType(outRechargePrice.getOperatorType());
// 判断积分支付是否扣完金额
if (outRechargeOrder.getPayRealPrice().compareTo(new BigDecimal(0)) == 0) {
// 201:充值中 202:充值成功 203:充值失败 204:未充值
outRechargeOrder.setRechargeStatus(204);
// 101.待支付 102.已支付 100.已完成 104.已取消 105.已退款
outRechargeOrder.setPayStatus(102);
outRechargeOrder.setPayTime(new Date());
outRechargeOrder.setPaySerialNo("22" + DateUtil.date2String(new Date(),"yyyyMMddHHmmss") + IDGenerator.nextId(5));
} else {
// 201:充值中 202:充值成功 203:充值失败 204:未充值
outRechargeOrder.setRechargeStatus(204);
// 101.待支付 102.已支付 100.已完成 104.已取消 105.已退款
outRechargeOrder.setPayStatus(101);
}
// 使用优惠券
if (outRechargeOrder.getMemDiscountId() != null) {
HighDiscountUserRel discountUserRel = highDiscountUserRelService.getRelById(outRechargeOrder.getMemDiscountId());
@ -147,16 +334,22 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
code.setStatus(3);
highDiscountAgentCodeService.updateCode(code);
}
if (outRechargeOrder.getIntegralNum() != null) {
highUserService.goldHandle(outRechargeOrder.getUserId(), outRechargeOrder.getIntegralNum().intValue(), 2, 2, outRechargeOrder.getId());
}
outRechargeOrderMapper.insert(outRechargeOrder);
if (outRechargeOrder.getRechargeStatus() == 201 && outRechargeOrder.getPayStatus() == 102) {
if (outRechargeOrder.getPayStatus() == 102) {
pollRequest(outRechargeOrder);
}
return outRechargeOrder;
}
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void updateOrder(OutRechargeOrder outRechargeOrder) {
outRechargeOrderMapper.updateByPrimaryKey(outRechargeOrder);
}
@ -366,13 +559,14 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
}
order.setPaySerialNo(consumptionResult.getString("orderId")); // 支付流水号
order.setPayRealPrice(order.getPayRealPrice()); // 实付金额
outRechargeOrderService.pollRequest(order);
order.setPayStatus(102);
order.setRechargeStatus(201);
order.setRechargeStatus(204);
order.setLaborUnionCard(userCard.getCardNo());
order.setPayType(3);
order.setPayTime(new Date()); // 支付时间
updateOrder(order);
outRechargeOrderService.pollRequest(order);
}
@Override
@ -387,7 +581,6 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void rechargeOrderToRefund(Long orderId) throws Exception {
OutRechargeOrder order = outRechargeOrderService.findByOrderId(orderId);
@ -396,78 +589,96 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法退款,订单不处于已支付状态");
}
// 微信退款
if (order.getPayType() == 1) {
Map<String,String> param = new HashMap<>();
param.put("appid", "wx637bd6f7314daa46");
param.put("mch_id", "1289663601");
param.put("sub_mch_id" , "1614670195");
param.put("nonce_str", WxUtils.makeNonStr());
param.put("transaction_id", order.getPaySerialNo());
param.put("out_refund_no", "HFR"+new Date().getTime());
param.put("total_fee", String.valueOf(order.getPayRealPrice().multiply(new BigDecimal("100")).intValue()));
param.put("refund_fee", String.valueOf(order.getPayRealPrice().multiply(new BigDecimal("100")).intValue()));
param.put("sign_type", "HMAC-SHA256");
String signStr = WxUtils.generateSignature(param, "Skufk5oi85wDFGl888i6wsRSTkdd5df5" , WXPayConstants.SignType.HMACSHA256);
param.put("sign", signStr);
String resultXmL = doRefundRequest(param.get("mch_id"), WxUtils.mapToXml(param));
OrderRefundModel orderRefundModel = XmlUtil.getObjectFromXML(resultXmL, OrderRefundModel.class);
if(orderRefundModel.getResult_code().equals("SUCCESS")) {
order.setPayStatus(105);
order.setRechargeStatus(203);
order.setRefundTime(new Date());
order.setOutRefundNo(orderRefundModel.getOut_refund_no());
order.setRefundId(orderRefundModel.getRefund_id());
order.setRefundFee(new BigDecimal(orderRefundModel.getRefund_fee()).divide(new BigDecimal("100")));
outRechargeOrderService.updateOrder(order);
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "退款失败!错误代码:"+orderRefundModel.getErr_code()+",错误描述"+orderRefundModel.getErr_code_des());
}
// 充值状态:201:充值中 202:充值成功 203:充值失败 204:未充值
if (order.getRechargeStatus() == 201) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法退款,订单处于充值中状态");
}
// 工会卡退款
if (order.getPayType() == 2) {
JSONObject jsonObject = HuiLianTongUnionCardConfig.refund( "HFR"+new Date().getTime() , order.getOrderNo());
if (jsonObject == null) {
jsonObject = HuiLianTongUnionCardConfig.refund( "HFR"+new Date().getTime() , order.getOrderNo());
// 1:支付宝 2:微信 3:汇联通工会卡 4:银联 5:银联分期
if (order.getPayType() == null) {
// 退还积分
if (order.getIntegralNum() != null) {
highUserService.goldHandle(order.getUserId(), order.getIntegralNum().intValue(), 1, 3, order.getId());
if (order.getPayRealPrice().compareTo(new BigDecimal(0)) == 0) {
order.setPayStatus(105);
order.setRechargeStatus(203);
order.setRefundTime(new Date());
outRechargeOrderService.updateOrder(order);
}
}
} else {
// 微信退款
if (order.getPayType() == 2) {
Map<String,String> param = new HashMap<>();
param.put("appid", "wx637bd6f7314daa46");
param.put("mch_id", "1289663601");
param.put("sub_mch_id" , "1614670195");
param.put("nonce_str", WxUtils.makeNonStr());
param.put("transaction_id", order.getPaySerialNo());
param.put("out_refund_no", "HFR"+new Date().getTime());
param.put("total_fee", String.valueOf(order.getPayRealPrice().multiply(new BigDecimal("100")).intValue()));
param.put("refund_fee", String.valueOf(order.getPayRealPrice().multiply(new BigDecimal("100")).intValue()));
param.put("sign_type", "HMAC-SHA256");
String signStr = WxUtils.generateSignature(param, "Skufk5oi85wDFGl888i6wsRSTkdd5df5" , WXPayConstants.SignType.HMACSHA256);
param.put("sign", signStr);
String resultXmL = doRefundRequest(param.get("mch_id"), WxUtils.mapToXml(param));
OrderRefundModel orderRefundModel = XmlUtil.getObjectFromXML(resultXmL, OrderRefundModel.class);
if(orderRefundModel.getResult_code().equals("SUCCESS")) {
order.setPayStatus(105);
order.setRechargeStatus(203);
order.setRefundTime(new Date());
order.setOutRefundNo(orderRefundModel.getOut_refund_no());
order.setRefundId(orderRefundModel.getRefund_id());
order.setRefundFee(new BigDecimal(orderRefundModel.getRefund_fee()).divide(new BigDecimal("100")));
outRechargeOrderService.updateOrder(order);
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "退款失败!错误代码:"+orderRefundModel.getErr_code()+",错误描述"+orderRefundModel.getErr_code_des());
}
}
// 工会卡退款
if (order.getPayType() == 3) {
JSONObject jsonObject = HuiLianTongUnionCardConfig.refund( "HFR"+new Date().getTime() , order.getOrderNo());
if (jsonObject == null) {
jsonObject = HuiLianTongUnionCardConfig.refund( "HFR"+new Date().getTime() , order.getOrderNo());
}
JSONObject dataObject = HuiLianTongUnionCardConfig.resolveResponse(jsonObject.getString("data"));
if (dataObject.getBoolean("success") || Objects.equals(dataObject.getString("message"), "原交易已撤销,不可再次操作")) {
order.setPayStatus(105);
order.setRechargeStatus(203);
order.setRefundTime(new Date());
order.setOutRefundNo("HFR"+new Date().getTime() );
order.setRefundFee(order.getPayRealPrice());
order.setRefundId(dataObject.getString("orderId"));
outRechargeOrderService.updateOrder(order);
JSONObject dataObject = HuiLianTongUnionCardConfig.resolveResponse(jsonObject.getString("data"));
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, dataObject.getString("message"));
}
}
if (dataObject.getBoolean("success") || Objects.equals(dataObject.getString("message"), "原交易已撤销,不可再次操作")) {
// 银联退款
if (order.getPayType() == 4) {
// 订单退款
JSONObject refund = UnionPayConfig.zwrefund(UnionPayConfig.MER_ID2, UnionPayConfig.TERM_ID2, order.getOrderNo(), order.getPaySerialNo(), order.getPayRealPrice().multiply(new BigDecimal("100")).longValue());
if (!refund.getString("resultcode").equals("W6")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, refund.getString("returnmsg"));
}
order.setPayStatus(105);
order.setRechargeStatus(203);
order.setRefundTime(new Date());
order.setOutRefundNo("HFR"+new Date().getTime() );
order.setOutRefundNo(refund.getString("oriwtorderid"));
order.setRefundFee(order.getPayRealPrice());
order.setRefundId(dataObject.getString("orderId"));
outRechargeOrderService.updateOrder(order);
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, dataObject.getString("message"));
}
}
// 银联退款
if (order.getPayType() == 4) {
// 订单退款
JSONObject refund = UnionPayConfig.zwrefund(UnionPayConfig.MER_ID2, UnionPayConfig.TERM_ID2, order.getOrderNo(), order.getPaySerialNo(), order.getPayRealPrice().multiply(new BigDecimal("100")).longValue());
if (!refund.getString("resultcode").equals("W6")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, refund.getString("returnmsg"));
}
order.setPayStatus(105);
order.setRechargeStatus(203);
order.setRefundTime(new Date());
order.setOutRefundNo(refund.getString("oriwtorderid"));
order.setRefundFee(order.getPayRealPrice());
outRechargeOrderService.updateOrder(order);
}
if (order.getMemDiscountId() != null) {
HighDiscountUserRel rel = highDiscountUserRelService.getRelById(order.getMemDiscountId());
if (rel != null) {
@ -514,7 +725,6 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
}
@Override
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public void pollRequest(OutRechargeOrder outRechargeOrder) throws Exception {
// 查询充值产品
@ -552,14 +762,20 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
for (String s : rechargePlatform) {
// 尖椒充值
if (s.equals("1") && type == 2) {
if (s.equals("1") && (type == 2 || type == 0)) {
object.put("out_order_id" ,orderNo );
object.put("amount" , outRechargePrice.getRechargePrice());
object.put("mobile" , outRechargeOrder.getRechargeContent());
if (outRechargePrice.getRechargeType() == 1) {
object.put("is_fast" , 1);
}
RechargeConfig.rechargeOrderByJj(object);
JSONObject returnObject = RechargeConfig.rechargeOrderByJj(object);
object.put("return_content" , returnObject);
if (returnObject != null && returnObject.getLong("code") == 200) {
childOrder.setStatus(102);
} else {
childOrder.setStatus(103);
}
rechargePlatformType = 1;
break;
}
@ -567,7 +783,13 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
object.put("out_trade_num" , orderNo);
object.put("product_id" , outRechargePrice.getGoodsId());
object.put("mobile" , outRechargeOrder.getRechargeContent());
RechargeConfig.rechargeOrderByLy(object);
JSONObject returnObject = RechargeConfig.rechargeOrderByLy(object);
object.put("return_content" , returnObject);
if (returnObject != null && returnObject.getLong("errno") == 0) {
childOrder.setStatus(102);
} else {
childOrder.setStatus(103);
}
rechargePlatformType = 2;
break;
}
@ -576,7 +798,6 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
childOrder.setOrderNo(orderNo);
childOrder.setCreateTime(new Date());
childOrder.setParentOrderId(outRechargeOrder.getId());
childOrder.setStatus(102);
childOrder.setRechargePlatform(rechargePlatformType);
childOrder.setUpdateTime(new Date());
outRechargeChildOrderService.insertOrder(childOrder);
@ -586,7 +807,7 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
requestRecord.setCreateTime(new Date());
requestRecord.setUpdateTime(new Date());
requestRecord.setOrderNo(orderNo);
requestRecord.setRequestContent(String.valueOf(object));
requestRecord.setRequestContent(object.toJSONString());
requestRecord.setOperatorId(0L);
requestRecord.setOperatorName("系统生成");
requestRecord.setSourceId(childOrder.getId().toString());
@ -594,6 +815,25 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
bsRequestRecordService.insertRequestRecord(requestRecord);
// 判断是否充值提交成功
if (childOrder.getStatus() == 102) {
outRechargeOrder.setRechargeStatus(201);
}
if (childOrder.getStatus() == 103) {
outRechargeOrder.setRechargeStatus(204);
}
outRechargeOrderService.updateOrder(outRechargeOrder);
}
@Override
public Integer rechargeOrderNum(Long userId) {
OutRechargeOrderExample example = new OutRechargeOrderExample();
OutRechargeOrderExample.Criteria criteria = example.createCriteria();
criteria.andUserIdEqualTo(userId);
criteria.andPayStatusEqualTo(101);
return outRechargeOrderMapper.selectByExample(example).size();
}
}

@ -90,6 +90,22 @@ public class OutRechargePriceServiceImpl implements OutRechargePriceService {
return outRechargePriceModel;
}
@Override
public OutRechargePrice findByGoodsId(Long goodsId) {
OutRechargePriceExample example = new OutRechargePriceExample();
OutRechargePriceExample.Criteria criteria = example.createCriteria();
criteria.andIdEqualTo(goodsId).andStatusEqualTo(1);
List<OutRechargePrice> list = outRechargePriceMapper.selectByExample(example);
if (list.size() > 0) {
return list.get(0);
}
return null;
}
@Override
@Transactional(propagation = Propagation.REQUIRES_NEW)
@ -106,7 +122,7 @@ public class OutRechargePriceServiceImpl implements OutRechargePriceService {
BigDecimal priceBd = new BigDecimal(dictionary.getCodeName());
outRechargePrice = new OutRechargePrice();
outRechargePrice.setRechargePrice(priceBd);
outRechargePrice.setPayPrice(priceBd.multiply(object.getBigDecimal("discount").divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP)));
outRechargePrice.setPayPrice(priceBd.multiply(object.getBigDecimal("discount").divide(new BigDecimal(100))));
outRechargePrice.setDiscount(object.getBigDecimal("discount"));
outRechargePrice.setRechargeType(object.getInteger("rechargeType"));
outRechargePrice.setOperatorType(object.getInteger("operatorType"));
@ -140,7 +156,7 @@ public class OutRechargePriceServiceImpl implements OutRechargePriceService {
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void updateRechargePrice(JSONObject object) {
OutRechargePrice outRechargePrice = outRechargePriceMapper.selectByPrimaryKey(object.getLong("id"));
outRechargePrice.setPayPrice(outRechargePrice.getRechargePrice().multiply(object.getBigDecimal("discount").divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP)));
outRechargePrice.setPayPrice(outRechargePrice.getRechargePrice().multiply(object.getBigDecimal("discount").divide(new BigDecimal(100))));
outRechargePrice.setDiscount(object.getBigDecimal("discount"));
outRechargePrice.setRechargeType(object.getInteger("rechargeType"));
outRechargePrice.setOperatorType(object.getInteger("operatorType"));

@ -440,35 +440,42 @@ public class GoodsOrderServiceImpl implements PayService {
highOrderService.updateOrder(order);
if (order.getHighChildOrderList().get(0).getGoodsType().equals(3)) {
new Thread(() -> {
Map<String, Object> pushMsg = new HashMap<>();
pushMsg.put("userId", order.getHighChildOrderList().get(0).getGoodsId());
Map<String, Object> msgContent = new HashMap<>();
msgContent.put("order", highOrderService.getGasOrderDetail(order.getOrderNo()));
msgContent.put("voice", baiduVoiceService.text2audio(order.getHighChildOrderList().get(0).getGoodsName() + ",收款:" + order.getTotalPrice() + "元"));
pushMsg.put("message", JSONObject.toJSONString(msgContent));
HttpsUtils.doPost("http://127.0.0.1:9901/msg/websocket/websocket", pushMsg, new HashMap<>());
}).start();
new Thread(() -> {
try {
Thread.sleep(120*1000);
BigDecimal rake = new BigDecimal("0.01");
// 计算微信收取的手续费 支付金额 * 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.getPaySerialNo(),order.getOrderNo(),profitSharingAmount);
} catch (InterruptedException e) {
e.printStackTrace();
// 加油站
HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreById(order.getHighChildOrderList().get(0).getGoodsId());
if (store != null) {
if (store.getSourceType() != null && store.getSourceType().equals(1)) {
new Thread(() -> {
Map<String, Object> pushMsg = new HashMap<>();
pushMsg.put("userId", order.getHighChildOrderList().get(0).getGoodsId());
Map<String, Object> msgContent = new HashMap<>();
msgContent.put("order", highOrderService.getGasOrderDetail(order.getOrderNo()));
msgContent.put("voice", baiduVoiceService.text2audio(order.getHighChildOrderList().get(0).getGoodsName() + ",收款:" + order.getTotalPrice() + "元"));
pushMsg.put("message", JSONObject.toJSONString(msgContent));
HttpsUtils.doPost("http://127.0.0.1:9901/msg/websocket/websocket", pushMsg, new HashMap<>());
}).start();
}
}).start();
}
if (order.getProfitSharingStatus() == true) {
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);
// 计算分账金额 手续费后的价格 * 0.05 注:如果与两个相邻数字的距离相等,则为上舍入的舍入模式。
BigDecimal profitSharingAmount = price.multiply(rake).setScale(2,BigDecimal.ROUND_DOWN);
this.wxGasProfitsharing(order.getExt1(), order.getAccountMerchantNum(), order.getPaySerialNo(),order.getOrderNo(),profitSharingAmount);
} catch (InterruptedException e) {
e.printStackTrace();
}
}).start();
}
} else {
new Thread(() -> {
try {
@ -504,12 +511,12 @@ public class GoodsOrderServiceImpl implements PayService {
System.out.println("实际分账价格:" + profitSharingAmount);
}
public void wxGasProfitsharing(String appid, String transaction_id,String out_order_no, BigDecimal amount) {
public void wxGasProfitsharing(String appid, String subMchId, 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" , "1624126902"); // 渝北区浩联物资经营部
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());

@ -55,8 +55,8 @@ public class RechargeOrderServiceImpl implements PayService {
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void paySuccess(Map<String, String> map, String payType) throws Exception {
if (payType.equals("Alipay")) {
// 支付宝支付 todo 暂未开发
return;
@ -64,11 +64,23 @@ public class RechargeOrderServiceImpl implements PayService {
if (payType.equals("WechatPay")) {
// 查询订单信息
OutRechargeOrder order = outRechargeOrderService.findByOrderNo(map.get("out_trade_no"));
// if (order != null && order.getStatus() == 1) {
// order.setPaySerialNo(map.get("transaction_id")); // 支付流水号
// order.setPayRealPrice(new BigDecimal(map.get("total_fee")).divide(new BigDecimal("100"))); // 实付金额
// order.setPayTime(new Date()); // 支付时间
// order.setStatus(2); // 订单状态 : 1.待支付 2.已支付 3.已完成 4.已取消 5.已退款
// 推送订单记录
HighGasOrderPush highGasOrderPush = new HighGasOrderPush();
highGasOrderPush.setType(OrderPushType.type2.getType());
highGasOrderPush.setOrderNo(order.getOrderNo());
highGasOrderPush.setCreateTime(new Date());
highGasOrderPush.setRequestContent(order.getOrderNo());
highGasOrderPush.setReturnContent(String.valueOf(map));
highGasOrderPushMapper.insert(highGasOrderPush);
if (order.getPayStatus() == 101) {
order.setPaySerialNo(map.get("transaction_id")); // 支付流水号
order.setPayRealPrice(new BigDecimal(map.get("total_fee")).divide(new BigDecimal("100"))); // 实付金额
order.setPayTime(new Date()); // 支付时间
// 订单支付状态 : 101.待支付 102.已支付 100.已完成 104.已取消 105.已退款
order.setPayStatus(102);
order.setRechargeStatus(204);
order.setPayType(2);
outRechargeOrderService.updateOrder(order);
// if (order.getRechargeType() == 1) {
// JSONObject object = outRechargeOrderService.getMobile(order.getRechargeContent() , order.getOrderPrice().intValue() , order.getOrderNo() , order.getRechargeType());
// if (object.getInteger("code") != 200) {
@ -76,16 +88,9 @@ public class RechargeOrderServiceImpl implements PayService {
// order.setAbnormalMsg(object.getString("message"));
// }
// }
// outRechargeOrderService.updateOrder(order);
// // 推送订单记录
// HighGasOrderPush highGasOrderPush = new HighGasOrderPush();
// highGasOrderPush.setType(OrderPushType.type2.getType());
// highGasOrderPush.setOrderNo(order.getOrderNo());
// highGasOrderPush.setCreateTime(new Date());
// highGasOrderPush.setRequestContent(order.getOrderNo());
// highGasOrderPush.setReturnContent(String.valueOf(map));
// highGasOrderPushMapper.insert(highGasOrderPush);
// }
outRechargeOrderService.pollRequest(order);
}
}
}

@ -53,13 +53,13 @@ TelApiSecret=d11ee9b41e014a039f030e53ae6f5295
TelMemberId=d13091df65d64aafbf0f35d2093157b7
# Jj
JjNotifyUrl = https://hsgcs.dctpay.com/crest/czOrder/rechargeCallback
JjNotifyUrl = https://hsgcs.dctpay.com/crest/czOrder/rechargeCallbackByJj
JjAppKey = eaomqcbpdz7yjfih
JjUrl = https://hfcs.dmjvip.com/index.php/third/mobile/
JjAppSecret = xkf9eoq2cjh6uvzp0mtrga134lnibdw8
#LY
LyNotifyUrl = https://hsgcs.dctpay.com/crest/czOrder/rechargeCallback
LyNotifyUrl = https://hsgcs.dctpay.com/crest/czOrder/rechargeCallbackByLy
LyApiKey=CMdyxh2gJ7tbXc6rS0KADqPIfVpaQLjU
LyMemberId=18665
LyPostUrl=https://cz.31994.cn/yrapi.php/

@ -0,0 +1,56 @@
server:
port: 9902
servlet:
context-path: /v1
#配置是否为debug模式,debug模式下,不开启权限校验
debug: false
#datasource数据源设置
spring:
datasource:
url: jdbc:mysql://139.159.177.244:3306/hfkj?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root
password: HF123456.
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.jdbc.Driver
filters: stat
maxActive: 10
initialSize: 5
maxWait: 60000
minIdle: 5
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: select 'x'
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 20
redis:
database: 0
host: 139.159.177.244
port: 36379
password: HF123456.Redis
timeout: 36000000
jedis:
pool:
max-active: 20
max-wait: -1
max-idle: 10
min-idle: 0
#配置日期返回至前台为时间戳
jackson:
serialization:
write-dates-as-timestamps: true
mybatis:
mapperLocations:
- classpath*:sqlmap*/*.xml
type-aliases-package:
org.springboot.sample.entity
pagehelper:
helperDialect: mysql
reasonable: true
supportMethodsArguments: true
params: count=countSql

@ -0,0 +1,72 @@
<configuration>
<!-- %m输出的信息,%p日志级别,%t线程名,%d日期,%c类的全名,,,, -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d %p (%file:%line\)- %m%n</pattern>
<charset>UTF-8</charset>
</encoder>
</appender>
<appender name="baselog"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/base.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/base.log.%d.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 64 MB -->
<maxFileSize>64 MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>
%d %p (%file:%line\)- %m%n
</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
</appender>
<appender name="daolog"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/dao.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/dao.log.%d.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 64 MB -->
<maxFileSize>64 MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>
%d %p (%file:%line\)- %m%n
</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
</appender>
<appender name="errorlog"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/error.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/error.log.%d.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 64 MB -->
<maxFileSize>64 MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>
%d %p (%file:%line\)- %m%n
</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
</appender>
<root level="DEBUG">
<appender-ref ref="STDOUT" />
</root>
<logger name="com.hai" level="DEBUG">
<appender-ref ref="baselog" />
</logger>
<logger name="com.hai.dao" level="DEBUG">
<appender-ref ref="daolog" />
</logger>
<logger name="com.hai" level="ERROR">
<appender-ref ref="errorlog" />
</logger>
</configuration>

Binary file not shown.

@ -0,0 +1,4 @@
#Created by Apache Maven 3.8.2
version=1.0-SNAPSHOT
groupId=com.hgj
artifactId=hai-v1

@ -0,0 +1,11 @@
com/V1Application.class
com/v1/config/SignatureConfig.class
com/v1/config/AuthConfig$1.class
com/v1/config/SysConfig.class
com/v1/config/ConfigListener.class
com/v1/config/SwaggerConfig.class
com/v1/config/CorsConfig.class
com/v1/config/AuthConfig.class
com/v1/config/RedisConfig.class
com/v1/config/SysConst.class
com/v1/config/MultipartConfig.class

@ -0,0 +1,10 @@
/Volumes/work/code/high-work/high-service/v1/src/main/java/com/V1Application.java
/Volumes/work/code/high-work/high-service/v1/src/main/java/com/v1/config/SysConfig.java
/Volumes/work/code/high-work/high-service/v1/src/main/java/com/v1/config/SwaggerConfig.java
/Volumes/work/code/high-work/high-service/v1/src/main/java/com/v1/config/MultipartConfig.java
/Volumes/work/code/high-work/high-service/v1/src/main/java/com/v1/config/CorsConfig.java
/Volumes/work/code/high-work/high-service/v1/src/main/java/com/v1/config/AuthConfig.java
/Volumes/work/code/high-work/high-service/v1/src/main/java/com/v1/config/ConfigListener.java
/Volumes/work/code/high-work/high-service/v1/src/main/java/com/v1/config/RedisConfig.java
/Volumes/work/code/high-work/high-service/v1/src/main/java/com/v1/config/SysConst.java
/Volumes/work/code/high-work/high-service/v1/src/main/java/com/v1/config/SignatureConfig.java
Loading…
Cancel
Save