diff --git a/hai-bweb/src/main/java/com/bweb/config/RedisConfig.java b/hai-bweb/src/main/java/com/bweb/config/RedisConfig.java index 0c5f530e..9689c265 100644 --- a/hai-bweb/src/main/java/com/bweb/config/RedisConfig.java +++ b/hai-bweb/src/main/java/com/bweb/config/RedisConfig.java @@ -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 zSetOperations(RedisTemplate redisTemplate) { return redisTemplate.opsForZSet(); } -} \ No newline at end of file +} diff --git a/hai-bweb/src/main/java/com/bweb/config/msg/OilPriceTaskMsgListener.java b/hai-bweb/src/main/java/com/bweb/config/msg/OilPriceTaskMsgListener.java new file mode 100644 index 00000000..8609c91a --- /dev/null +++ b/hai-bweb/src/main/java/com/bweb/config/msg/OilPriceTaskMsgListener.java @@ -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 redisTemplate; + + @Override + public void onMessage(Message message, byte[] pattern) { + System.out.println(message); + } +} diff --git a/hai-bweb/src/main/java/com/bweb/config/msg/RedisKeyExpirationListener.java b/hai-bweb/src/main/java/com/bweb/config/msg/RedisKeyExpirationListener.java new file mode 100644 index 00000000..334b1058 --- /dev/null +++ b/hai-bweb/src/main/java/com/bweb/config/msg/RedisKeyExpirationListener.java @@ -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); + } + } +} diff --git a/hai-bweb/src/main/java/com/bweb/controller/CommonController.java b/hai-bweb/src/main/java/com/bweb/controller/CommonController.java index ae62e3a6..7a9f8059 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/CommonController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/CommonController.java @@ -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); + } + } + } diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java b/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java index ab501bdc..4aea9994 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java @@ -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 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 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 = "导出油站订单") diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighGasOilPriceTaskController.java b/hai-bweb/src/main/java/com/bweb/controller/HighGasOilPriceTaskController.java index f0c2a0e3..223d1f26 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighGasOilPriceTaskController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighGasOilPriceTaskController.java @@ -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 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 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); diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighMerAmountController.java b/hai-bweb/src/main/java/com/bweb/controller/HighMerAmountController.java new file mode 100644 index 00000000..34a4231a --- /dev/null +++ b/hai-bweb/src/main/java/com/bweb/controller/HighMerAmountController.java @@ -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 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); + } + } + +} diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighMerchantController.java b/hai-bweb/src/main/java/com/bweb/controller/HighMerchantController.java index aecbfd76..67565426 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighMerchantController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighMerchantController.java @@ -101,7 +101,6 @@ public class HighMerchantController { } } - @RequestMapping(value="/updateMerchant",method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "修改商户") diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java b/hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java index 5896070e..66b4ad97 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java @@ -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 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) { diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighMerchantTripartitePlatformController.java b/hai-bweb/src/main/java/com/bweb/controller/HighMerchantTripartitePlatformController.java new file mode 100644 index 00000000..d5c92ce0 --- /dev/null +++ b/hai-bweb/src/main/java/com/bweb/controller/HighMerchantTripartitePlatformController.java @@ -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); + } + } +} diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java b/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java index 244d40bd..754e6ba4 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java @@ -1 +1 @@ -package com.bweb.controller; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.pay.util.XmlUtil; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.utils.DateUtil; import com.hai.common.utils.HttpsUtils; import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.WxUtils; import com.hai.config.*; import com.hai.entity.*; import com.hai.model.*; import com.hai.service.*; import com.hai.service.pay.impl.GoodsOrderServiceImpl; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpEntity; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.util.EntityUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.io.*; import java.math.BigDecimal; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.*; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/26 23:08 */ @Controller @RequestMapping(value = "/test") @Api(value = "订单接口") public class HighTestController { private static Logger log = LoggerFactory.getLogger(HighTestController.class); @Resource private HltUnionCardVipService hltUnionCardVipService; @Resource private OutRechargeOrderService outRechargeOrderService; @Resource private HighOrderService highOrderService; @Resource private HighUserService highUserService; @Resource private SecSinopecConfigService secSinopecConfigService; @Resource private HighCouponCodeService highCouponCodeService; @Resource private HighOilCardService oilCardService; @Resource private GoodsOrderServiceImpl goodsOrderService; @Resource private BaiduVoiceService baiduVoiceService; @Resource private HighProfitSharingRecordService highProfitSharingRecordService; @RequestMapping(value = "/oilCardRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "油卡退款") public ResponseData oilCardRefund(@RequestParam(name = "orderNo", required = true) String orderNo,HttpServletRequest request) { try { oilCardService.refund(orderNo); return ResponseMsgUtil.success(""); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/wxProfitsharing", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "分账") public ResponseData wxProfitsharing(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); BigDecimal rake = new BigDecimal("0.01"); // 计算微信收取的手续费 支付金额 * 0.002 注:如果与两个相邻数字的距离相等,则为上舍入的舍入模式。 BigDecimal wxHandlingFee = order.getPayPrice().multiply(new BigDecimal("0.002")).setScale(2,BigDecimal.ROUND_HALF_DOWN); BigDecimal price = order.getPayPrice().subtract(wxHandlingFee); Map param = new LinkedHashMap<>(); param.put("appid", "wx637bd6f7314daa46"); param.put("mch_id", "1289663601"); param.put("sub_mch_id" , "1624126902"); // 渝北区浩联物资经营部 param.put("transaction_id" , order.getPaySerialNo()); param.put("out_order_no" , order.getOrderNo()); param.put("nonce_str" , WxUtils.makeNonStr()); // 计算分账金额 手续费后的价格 * 0.01 注:如果与两个相邻数字的距离相等,则为上舍入的舍入模式。 BigDecimal porofitSharingAmount = price.multiply(rake).setScale(2,BigDecimal.ROUND_DOWN); List> receiversList = new ArrayList<>(); Map receiversMap = new LinkedHashMap<>(); receiversMap.put("type", "MERCHANT_ID"); receiversMap.put("account", "1603942866"); receiversMap.put("amount", porofitSharingAmount.multiply(new BigDecimal("100")).intValue()); receiversMap.put("description", "分给商户【惠昕石化】"); receiversList.add(receiversMap); param.put("receivers" , JSONObject.toJSONString(receiversList)); String signStr = WxUtils.generateSignature(param, "Skufk5oi85wDFGl888i6wsRSTkdd5df5" , WXPayConstants.SignType.HMACSHA256); param.put("sign" , signStr); String resultXmL = this.profitsharing(param.get("mch_id"),null, WxUtils.mapToXml(param)); // 请求分账返回的结果 ResultProfitSharing resultProfitSharing = XmlUtil.getObjectFromXML(resultXmL, ResultProfitSharing.class); HighProfitSharingRecord sharingRecord = new HighProfitSharingRecord(); sharingRecord.setOutOrderNo(resultProfitSharing.getOut_order_no()); sharingRecord.setTransactionId(resultProfitSharing.getTransaction_id()); sharingRecord.setOrderId(resultProfitSharing.getOrder_id()); sharingRecord.setStatus(resultProfitSharing.getResult_code()); sharingRecord.setPrice(porofitSharingAmount); sharingRecord.setCreateTime(new Date()); sharingRecord.setContent(resultXmL); highProfitSharingRecordService.insert(sharingRecord); return ResponseMsgUtil.success("操作成功"); } catch (Exception e) { log.error("CmsContentController --> getCorporateAdvertising() error!", e); return ResponseMsgUtil.success(e); } } public String profitsharing(String mchId, String url, String data) throws Exception { //小程序退款需要调用双向证书的认证 CloseableHttpClient httpClient = goodsOrderService.readCertificate(mchId); try { HttpPost httpost = new HttpPost("https://api.mch.weixin.qq.com/secapi/pay/profitsharing"); // 设置响应头信息 httpost.addHeader("Connection", "keep-alive"); httpost.addHeader("Accept", "*/*"); httpost.addHeader("Content-Type", "text/xml"); httpost.addHeader("Host", "api.mch.weixin.qq.com"); httpost.addHeader("X-Requested-With", "XMLHttpRequest"); httpost.addHeader("Cache-Control", "max-age=0"); httpost.addHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0) "); httpost.setEntity(new StringEntity(data, "UTF-8")); CloseableHttpResponse response = httpClient.execute(httpost); try { HttpEntity entity = response.getEntity(); String jsonStr = EntityUtils.toString(response.getEntity(), "UTF-8"); EntityUtils.consume(entity); return jsonStr; } finally { response.close(); } } catch (Exception e){ throw new RuntimeException(e); } finally { httpClient.close(); } } @RequestMapping(value = "/getBackendToken", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取访问令牌backendToken") public ResponseData getBackendToken() { try { return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/sys", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "同步") public ResponseData sys(@RequestParam(name = "appId", required = true) String appId, @RequestParam(name = "appSecret", required = true) String appSecret, @RequestParam(name = "code", required = true) String code, @RequestParam(name = "signKey", required = true) String signKey ) { try { Map tokenMap = new HashMap<>(); tokenMap.put("appId", appId); tokenMap.put("appSecret", appSecret); JSONObject jsonObject = HttpsUtils.doPost("https://app.zshcqsy.com/api-provider/api/open/merchant/token", JSON.toJSONString(tokenMap)); log.error(jsonObject.toJSONString()); if (jsonObject != null && jsonObject.getBoolean("success") == true) { JSONObject data = jsonObject.getJSONObject("data"); String token = data.getString("token"); Calendar instance = Calendar.getInstance(); instance.set(2021,3,1); Map bodyMap = new HashMap<>(); bodyMap.put("appId", appId); bodyMap.put("pageNo", 1); bodyMap.put("pageSize", 999999); bodyMap.put("startTime", instance.getTime()); bodyMap.put("endTime", new Date().getTime()); bodyMap.put("customerCode", code); Long date = new Date().getTime(); String sha256 = encodeBySHA256(signKey + JSON.toJSONString(bodyMap) + date); JSONObject object = HttpsUtils.doPost("https://app.zshcqsy.com/api-provider/sapapi/open/coupon/customerRedeemcodeList", JSON.toJSONString(bodyMap), token, sha256, date); File file = new File("/home/data/" + System.currentTimeMillis() + ".txt"); if (!file.exists()) { file.createNewFile(); } FileWriter fw = new FileWriter(file.getAbsoluteFile()); BufferedWriter bw = new BufferedWriter(fw); bw.write(object.toJSONString()); bw.close(); //JSONObject object = JSONObject.parseObject("{\"code\":1000,\"data\":{\"pageNo\":1,\"pageSize\":100,\"rowCount\":\"2\",\"list\":[{\"nodeName\":\"中国石油化工股份有限公司重庆江南石油分公司大学城南二路加油加\",\"totalAmount\":150.00,\"codeId\":\"01DIhbtPzIghPP0mPWaWzO13\",\"nodeNo\":\"50000105\",\"name\":\"重庆惠昕石化有限责任公司11.02日150元券\",\"useTime\":\"2021-04-03 06:11:14\"},{\"nodeName\":\"中国石化销售有限公司重庆三峡分公司忠县经营部三台加油站\",\"totalAmount\":100.00,\"codeId\":\"201126141728001027\",\"nodeNo\":\"50000238\",\"name\":\"重庆惠昕石化有限责任公司11.26日100元券\",\"useTime\":\"2021-04-03 15:16:03\"}]},\"success\":true}"); if(Objects.equals(object.get("success"), true)) { log.error(JSONObject.toJSONString(object.get("data"))); Object dataJson = JSONObject.parse(JSONObject.toJSONString(object.get("data"))); JSONObject dataObject = JSON.parseObject(JSONObject.toJSONString(dataJson)); JSONArray list = dataObject.getJSONArray("list"); for (Object dataJsonObject : list) { try { JSONObject parseObject = JSON.parseObject(JSON.toJSONString(dataJsonObject)); String codeId = parseObject.getString("codeId"); String nodeName = parseObject.getString("nodeName"); Date useTime = DateUtil.format(parseObject.getString("useTime"), "yyyy-MM-dd HH:mm:ss"); highCouponCodeService.cnpcCallbackCouponCode(codeId, useTime, nodeName); } catch (Exception e) { log.error("HighCouponSchedule --> expiredCoupon() error!", e); } } } return ResponseMsgUtil.success("下载成功"); } return ResponseMsgUtil.success(jsonObject); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } public String encodeBySHA256(String str) { try{ MessageDigest messageDigest = MessageDigest.getInstance("SHA-256"); messageDigest.reset(); messageDigest.update(str.getBytes("UTF-8")); return getFormattedText(messageDigest.digest()); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } catch (Exception e) { throw new RuntimeException(e); } return ""; } private static final String[] HEX_DIGITS = {"0" ,"1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"}; private String getFormattedText(byte[] bytes) { int len = bytes.length; StringBuilder buf = new StringBuilder(len * 2); // 把密文转换成十六进制的字符串形式 for (int j=0;j> 4) & 0x0f]); buf.append(HEX_DIGITS[bytes[j] & 0x0f]); } return buf.toString(); } @RequestMapping(value = "/GetMembershipLevel", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "请求会员体系") public ResponseData GetMembershipLevel(@RequestParam(name = "phone", required = true) String phone , @RequestParam(name = "regionId", required = true) String regionId ) { try { return ResponseMsgUtil.success(hltUnionCardVipService.GetMembershipLevel(phone , regionId)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/submitSms", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "请求短信") public ResponseData submitSms(@RequestParam(name = "phone", required = true) String phone , @RequestParam(name = "sms", required = true) String sms ) { try { return ResponseMsgUtil.success(HuiLianTongUnionCardConfig.submitSms(phone , sms)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value="/resolveResponse",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "解析") public ResponseData resolveResponse( @RequestParam(name = "data", required = false) String data ) { try { JSONObject cardInfoObject = HuiLianTongUnionCardConfig.resolveResponse(data); return ResponseMsgUtil.success(cardInfoObject); } catch (Exception e) { log.error("getUserByTelephone",e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value="/queryAmount",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询余额") public ResponseData queryAmount() { try { // outRechargeOrderService.queryAmount(); return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("getUserByTelephone",e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getHuiLianTongCardConsume", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询汇联通工会卡消费记录") public ResponseData getHuiLianTongCardConsume(@RequestParam(name = "businessType", required = true) String businessType, @RequestParam(name = "cardNo", required = true) String cardNo, @RequestParam(name = "sdate", required = true) Long sdate, @RequestParam(name = "edate", required = true) Long edate, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) { try { JSONObject consumptionRecord = HuiLianTongUnionCardConfig.queryConsumptionRecordByBusiness(businessType, cardNo, sdate, edate, pageNum, pageSize); if (StringUtils.isBlank(consumptionRecord.getString("data"))) { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQUEST_ERROR, ""); } return ResponseMsgUtil.success(HuiLianTongUnionCardConfig.resolveResponse(consumptionRecord.getString("data"))); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardConsume() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/orderToRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "积分充值退款") public ResponseData orderToRefund(@RequestParam(name = "orderId", required = true) Long orderId ,HttpServletRequest request) { try { HighOrder highOrder = highOrderService.getOrderById(orderId); // 微信退款 OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund(highOrder.getPaySerialNo(), highOrder.getPayRealPrice(), highOrder.getPayRealPrice()); if(orderRefundModel.getResult_code().equals("SUCCESS")) { for (HighChildOrder childOrder : highOrder.getHighChildOrderList()) { childOrder.setChildOrdeStatus(4); } highOrder.setOrderStatus(4); highOrder.setRefundTime(new Date()); highOrder.setRefundPrice(highOrder.getPayRealPrice()); highOrderService.updateOrder(highOrder); } if (highUserService.findGoldRepeat(3 , highOrder.getId())) { highUserService.goldHandle(highOrder.getMemId(), highOrder.getPayRealPrice().multiply(BigDecimal.valueOf(100)).intValue(), 2, 3, highOrder.getId()); }else { log.error("orderToPay error!", "已有退款记录"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已有退款记录"); } return ResponseMsgUtil.success(orderRefundModel); } catch (Exception e) { log.error("HighOrderController --> orderToRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/orderToRefundByHlt", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "汇联通充值退款") public ResponseData orderToRefundByHlt(@RequestParam(name = "orderId", required = true) Long orderId ,HttpServletRequest request) { try { HighOrder highOrder = highOrderService.getOrderById(orderId); // 微信退款 OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund(highOrder.getPaySerialNo(), highOrder.getPayRealPrice(), WxOrderConfig.MCH_ID_1619676214 , highOrder.getPayRealPrice()); if(orderRefundModel.getResult_code().equals("SUCCESS")) { for (HighChildOrder childOrder : highOrder.getHighChildOrderList()) { childOrder.setChildOrdeStatus(4); } highOrder.setOrderStatus(4); highOrder.setRefundTime(new Date()); highOrder.setRefundPrice(highOrder.getPayRealPrice()); highOrderService.updateOrder(highOrder); } return ResponseMsgUtil.success(orderRefundModel); } catch (Exception e) { log.error("HighOrderController --> orderToRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/zwrefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "银联退款") public ResponseData zwrefund( @RequestParam(name = "orderId", required = true) Long orderId , @RequestParam(name = "MER_ID", required = true) String MER_ID , @RequestParam(name = "TERM_ID", required = true) String TERM_ID , HttpServletRequest request) { try { OutRechargeOrder order = outRechargeOrderService.findByOrderId(orderId); // 订单退款 JSONObject refund = UnionPayConfig.zwrefund(MER_ID, TERM_ID, 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.setStatus(5); order.setRefundTime(new Date()); order.setOutRefundNo(refund.getString("oriwtorderid")); order.setRefundFee(order.getPayRealPrice()); outRechargeOrderService.updateOrder(order); return ResponseMsgUtil.success(refund); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/rechargeOrderToRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "话费退款") public ResponseData rechargeOrderToRefund( @RequestParam(name = "orderId", required = true) Long orderId) { try { outRechargeOrderService.rechargeOrderToRefund(orderId); return ResponseMsgUtil.success("退款成功"); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/websocket", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "websocket") public ResponseData websocket( @RequestParam(name = "userId", required = true) String orderNo ) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); if (order.getHighChildOrderList().get(0).getGoodsType().equals(3)) { Map pushMsg = new HashMap<>(); pushMsg.put("userId", order.getHighChildOrderList().get(0).getGoodsId()); Map 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://139.159.177.244:9901/msg/websocket/websocket", pushMsg, new HashMap<>()); } return ResponseMsgUtil.success("请求成功"); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getProductsList", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取产品") public ResponseData getProductsList() { try { return ResponseMsgUtil.success(RechargeConfig.getProductsListByLy()); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } } \ No newline at end of file +package com.bweb.controller; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.bweb.config.SysConst; import com.google.gson.JsonObject; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.pay.util.XmlUtil; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.utils.DateUtil; import com.hai.common.utils.HttpsUtils; import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.WxUtils; import com.hai.config.*; import com.hai.dao.HighGasOrderPushMapper; import com.hai.entity.*; import com.hai.model.*; import com.hai.service.*; import com.hai.service.pay.impl.GoodsOrderServiceImpl; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpEntity; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPost; import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.ssl.SSLContexts; import org.apache.http.util.EntityUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; import javax.net.ssl.SSLContext; import javax.servlet.http.HttpServletRequest; import java.io.*; import java.math.BigDecimal; import java.security.KeyStore; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.*; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/26 23:08 */ @Controller @RequestMapping(value = "/test") @Api(value = "订单接口") public class HighTestController { private static Logger log = LoggerFactory.getLogger(HighTestController.class); @Resource private HltUnionCardVipService hltUnionCardVipService; @Resource private OutRechargeOrderService outRechargeOrderService; @Resource private HighOrderService highOrderService; @Resource private HighUserService highUserService; @Resource private SecSinopecConfigService secSinopecConfigService; @Resource private HighCouponCodeService highCouponCodeService; @Resource private HighOilCardService oilCardService; @Resource private GoodsOrderServiceImpl goodsOrderService; @Resource private BaiduVoiceService baiduVoiceService; @Resource private HighGasOilPriceOfficialService gasOilPriceOfficialService; @Resource private HighProfitSharingRecordService highProfitSharingRecordService; @RequestMapping(value = "/oilCardRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "油卡退款") public ResponseData oilCardRefund(@RequestParam(name = "orderNo", required = true) String orderNo,HttpServletRequest request) { try { oilCardService.refund(orderNo); return ResponseMsgUtil.success(""); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/refreshGasPriceOfficial", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "刷新国标价") public ResponseData refreshGasPriceOfficial() { try { gasOilPriceOfficialService.refreshPriceOfficial(); gasOilPriceOfficialService.refreshGasPriceOfficial(null, null); return ResponseMsgUtil.success("操作成功"); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/wxProfitsharing", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "分账") public ResponseData wxProfitsharing(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); BigDecimal rake = new BigDecimal("0.01"); // 计算微信收取的手续费 支付金额 * 0.002 注:如果与两个相邻数字的距离相等,则为上舍入的舍入模式。 BigDecimal wxHandlingFee = order.getPayPrice().multiply(new BigDecimal("0.002")).setScale(2,BigDecimal.ROUND_HALF_DOWN); BigDecimal price = order.getPayPrice().subtract(wxHandlingFee); Map param = new LinkedHashMap<>(); param.put("appid", "wx637bd6f7314daa46"); param.put("mch_id", "1289663601"); param.put("sub_mch_id" , "1624126902"); // 渝北区浩联物资经营部 param.put("transaction_id" , order.getPaySerialNo()); param.put("out_order_no" , order.getOrderNo()); param.put("nonce_str" , WxUtils.makeNonStr()); // 计算分账金额 手续费后的价格 * 0.01 注:如果与两个相邻数字的距离相等,则为上舍入的舍入模式。 BigDecimal porofitSharingAmount = price.multiply(rake).setScale(2,BigDecimal.ROUND_DOWN); List> receiversList = new ArrayList<>(); Map receiversMap = new LinkedHashMap<>(); receiversMap.put("type", "MERCHANT_ID"); receiversMap.put("account", "1603942866"); receiversMap.put("amount", porofitSharingAmount.multiply(new BigDecimal("100")).intValue()); receiversMap.put("description", "分给商户【惠昕石化】"); receiversList.add(receiversMap); param.put("receivers" , JSONObject.toJSONString(receiversList)); String signStr = WxUtils.generateSignature(param, "Skufk5oi85wDFGl888i6wsRSTkdd5df5" , WXPayConstants.SignType.HMACSHA256); param.put("sign" , signStr); String resultXmL = this.profitsharing(param.get("mch_id"),null, WxUtils.mapToXml(param)); // 请求分账返回的结果 ResultProfitSharing resultProfitSharing = XmlUtil.getObjectFromXML(resultXmL, ResultProfitSharing.class); HighProfitSharingRecord sharingRecord = new HighProfitSharingRecord(); sharingRecord.setOutOrderNo(resultProfitSharing.getOut_order_no()); sharingRecord.setTransactionId(resultProfitSharing.getTransaction_id()); sharingRecord.setOrderId(resultProfitSharing.getOrder_id()); sharingRecord.setStatus(resultProfitSharing.getResult_code()); sharingRecord.setPrice(porofitSharingAmount); sharingRecord.setCreateTime(new Date()); sharingRecord.setContent(resultXmL); highProfitSharingRecordService.insert(sharingRecord); return ResponseMsgUtil.success("操作成功"); } catch (Exception e) { log.error("CmsContentController --> getCorporateAdvertising() error!", e); return ResponseMsgUtil.success(e); } } public String profitsharing(String mchId, String url, String data) throws Exception { //小程序退款需要调用双向证书的认证 CloseableHttpClient httpClient = goodsOrderService.readCertificate(mchId); try { HttpPost httpost = new HttpPost("https://api.mch.weixin.qq.com/secapi/pay/profitsharing"); // 设置响应头信息 httpost.addHeader("Connection", "keep-alive"); httpost.addHeader("Accept", "*/*"); httpost.addHeader("Content-Type", "text/xml"); httpost.addHeader("Host", "api.mch.weixin.qq.com"); httpost.addHeader("X-Requested-With", "XMLHttpRequest"); httpost.addHeader("Cache-Control", "max-age=0"); httpost.addHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0) "); httpost.setEntity(new StringEntity(data, "UTF-8")); CloseableHttpResponse response = httpClient.execute(httpost); try { HttpEntity entity = response.getEntity(); String jsonStr = EntityUtils.toString(response.getEntity(), "UTF-8"); EntityUtils.consume(entity); return jsonStr; } finally { response.close(); } } catch (Exception e){ throw new RuntimeException(e); } finally { httpClient.close(); } } @RequestMapping(value = "/getBackendToken", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取访问令牌backendToken") public ResponseData getBackendToken() { try { return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/sys", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "同步") public ResponseData sys(@RequestParam(name = "appId", required = true) String appId, @RequestParam(name = "appSecret", required = true) String appSecret, @RequestParam(name = "code", required = true) String code, @RequestParam(name = "signKey", required = true) String signKey ) { try { Map tokenMap = new HashMap<>(); tokenMap.put("appId", appId); tokenMap.put("appSecret", appSecret); JSONObject jsonObject = HttpsUtils.doPost("https://app.zshcqsy.com/api-provider/api/open/merchant/token", JSON.toJSONString(tokenMap)); log.error(jsonObject.toJSONString()); if (jsonObject != null && jsonObject.getBoolean("success") == true) { JSONObject data = jsonObject.getJSONObject("data"); String token = data.getString("token"); Calendar instance = Calendar.getInstance(); instance.set(2021,3,1); Map bodyMap = new HashMap<>(); bodyMap.put("appId", appId); bodyMap.put("pageNo", 1); bodyMap.put("pageSize", 999999); bodyMap.put("startTime", instance.getTime()); bodyMap.put("endTime", new Date().getTime()); bodyMap.put("customerCode", code); Long date = new Date().getTime(); String sha256 = encodeBySHA256(signKey + JSON.toJSONString(bodyMap) + date); JSONObject object = HttpsUtils.doPost("https://app.zshcqsy.com/api-provider/sapapi/open/coupon/customerRedeemcodeList", JSON.toJSONString(bodyMap), token, sha256, date); File file = new File("/home/data/" + System.currentTimeMillis() + ".txt"); if (!file.exists()) { file.createNewFile(); } FileWriter fw = new FileWriter(file.getAbsoluteFile()); BufferedWriter bw = new BufferedWriter(fw); bw.write(object.toJSONString()); bw.close(); //JSONObject object = JSONObject.parseObject("{\"code\":1000,\"data\":{\"pageNo\":1,\"pageSize\":100,\"rowCount\":\"2\",\"list\":[{\"nodeName\":\"中国石油化工股份有限公司重庆江南石油分公司大学城南二路加油加\",\"totalAmount\":150.00,\"codeId\":\"01DIhbtPzIghPP0mPWaWzO13\",\"nodeNo\":\"50000105\",\"name\":\"重庆惠昕石化有限责任公司11.02日150元券\",\"useTime\":\"2021-04-03 06:11:14\"},{\"nodeName\":\"中国石化销售有限公司重庆三峡分公司忠县经营部三台加油站\",\"totalAmount\":100.00,\"codeId\":\"201126141728001027\",\"nodeNo\":\"50000238\",\"name\":\"重庆惠昕石化有限责任公司11.26日100元券\",\"useTime\":\"2021-04-03 15:16:03\"}]},\"success\":true}"); if(Objects.equals(object.get("success"), true)) { log.error(JSONObject.toJSONString(object.get("data"))); Object dataJson = JSONObject.parse(JSONObject.toJSONString(object.get("data"))); JSONObject dataObject = JSON.parseObject(JSONObject.toJSONString(dataJson)); JSONArray list = dataObject.getJSONArray("list"); for (Object dataJsonObject : list) { try { JSONObject parseObject = JSON.parseObject(JSON.toJSONString(dataJsonObject)); String codeId = parseObject.getString("codeId"); String nodeName = parseObject.getString("nodeName"); Date useTime = DateUtil.format(parseObject.getString("useTime"), "yyyy-MM-dd HH:mm:ss"); highCouponCodeService.cnpcCallbackCouponCode(codeId, useTime, nodeName); } catch (Exception e) { log.error("HighCouponSchedule --> expiredCoupon() error!", e); } } } return ResponseMsgUtil.success("下载成功"); } return ResponseMsgUtil.success(jsonObject); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } public String encodeBySHA256(String str) { try{ MessageDigest messageDigest = MessageDigest.getInstance("SHA-256"); messageDigest.reset(); messageDigest.update(str.getBytes("UTF-8")); return getFormattedText(messageDigest.digest()); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } catch (Exception e) { throw new RuntimeException(e); } return ""; } private static final String[] HEX_DIGITS = {"0" ,"1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"}; private String getFormattedText(byte[] bytes) { int len = bytes.length; StringBuilder buf = new StringBuilder(len * 2); // 把密文转换成十六进制的字符串形式 for (int j=0;j> 4) & 0x0f]); buf.append(HEX_DIGITS[bytes[j] & 0x0f]); } return buf.toString(); } @RequestMapping(value = "/GetMembershipLevel", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "请求会员体系") public ResponseData GetMembershipLevel(@RequestParam(name = "phone", required = true) String phone , @RequestParam(name = "regionId", required = true) String regionId ) { try { return ResponseMsgUtil.success(hltUnionCardVipService.GetMembershipLevel(phone , regionId)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/submitSms", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "请求短信") public ResponseData submitSms(@RequestParam(name = "phone", required = true) String phone , @RequestParam(name = "sms", required = true) String sms ) { try { return ResponseMsgUtil.success(HuiLianTongUnionCardConfig.submitSms(phone , sms)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value="/resolveResponse",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "解析") public ResponseData resolveResponse( @RequestParam(name = "data", required = false) String data ) { try { JSONObject cardInfoObject = HuiLianTongUnionCardConfig.resolveResponse(data); return ResponseMsgUtil.success(cardInfoObject); } catch (Exception e) { log.error("getUserByTelephone",e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value="/queryAmount",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询余额") public ResponseData queryAmount() { try { // outRechargeOrderService.queryAmount(); return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("getUserByTelephone",e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getHuiLianTongCardConsume", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询汇联通工会卡消费记录") public ResponseData getHuiLianTongCardConsume(@RequestParam(name = "businessType", required = true) String businessType, @RequestParam(name = "cardNo", required = true) String cardNo, @RequestParam(name = "sdate", required = true) Long sdate, @RequestParam(name = "edate", required = true) Long edate, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) { try { JSONObject consumptionRecord = HuiLianTongUnionCardConfig.queryConsumptionRecordByBusiness(businessType, cardNo, sdate, edate, pageNum, pageSize); if (StringUtils.isBlank(consumptionRecord.getString("data"))) { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQUEST_ERROR, ""); } return ResponseMsgUtil.success(HuiLianTongUnionCardConfig.resolveResponse(consumptionRecord.getString("data"))); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardConsume() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/orderToRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "积分充值退款") public ResponseData orderToRefund(@RequestParam(name = "orderId", required = true) Long orderId ,HttpServletRequest request) { try { HighOrder highOrder = highOrderService.getOrderById(orderId); // 微信退款 OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund(highOrder.getPaySerialNo(), highOrder.getPayRealPrice(), highOrder.getPayRealPrice()); if(orderRefundModel.getResult_code().equals("SUCCESS")) { for (HighChildOrder childOrder : highOrder.getHighChildOrderList()) { childOrder.setChildOrdeStatus(4); } highOrder.setOrderStatus(4); highOrder.setRefundTime(new Date()); highOrder.setRefundPrice(highOrder.getPayRealPrice()); highOrderService.updateOrder(highOrder); } if (highUserService.findGoldRepeat(3 , highOrder.getId())) { highUserService.goldHandle(highOrder.getMemId(), highOrder.getPayRealPrice().multiply(BigDecimal.valueOf(100)).intValue(), 2, 3, highOrder.getId()); }else { log.error("orderToPay error!", "已有退款记录"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已有退款记录"); } return ResponseMsgUtil.success(orderRefundModel); } catch (Exception e) { log.error("HighOrderController --> orderToRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/orderToRefundByHlt", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "汇联通充值退款") public ResponseData orderToRefundByHlt(@RequestParam(name = "orderId", required = true) Long orderId ,HttpServletRequest request) { try { HighOrder highOrder = highOrderService.getOrderById(orderId); // 微信退款 OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund(highOrder.getPaySerialNo(), highOrder.getPayRealPrice(), WxOrderConfig.MCH_ID_1619676214 , highOrder.getPayRealPrice()); if(orderRefundModel.getResult_code().equals("SUCCESS")) { for (HighChildOrder childOrder : highOrder.getHighChildOrderList()) { childOrder.setChildOrdeStatus(4); } highOrder.setOrderStatus(4); highOrder.setRefundTime(new Date()); highOrder.setRefundPrice(highOrder.getPayRealPrice()); highOrderService.updateOrder(highOrder); } return ResponseMsgUtil.success(orderRefundModel); } catch (Exception e) { log.error("HighOrderController --> orderToRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/rechargeOrderToRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "话费退款") public ResponseData rechargeOrderToRefund( @RequestParam(name = "orderId", required = true) Long orderId) { try { outRechargeOrderService.rechargeOrderToRefund(orderId); return ResponseMsgUtil.success("退款成功"); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/websocket", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "websocket") public ResponseData websocket( @RequestParam(name = "userId", required = true) String orderNo ) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); if (order.getHighChildOrderList().get(0).getGoodsType().equals(3)) { Map pushMsg = new HashMap<>(); pushMsg.put("userId", order.getHighChildOrderList().get(0).getGoodsId()); Map 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://139.159.177.244:9901/msg/websocket/websocket", pushMsg, new HashMap<>()); } return ResponseMsgUtil.success("请求成功"); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } } \ No newline at end of file diff --git a/hai-bweb/src/main/java/com/bweb/controller/OutRechargeOrderController.java b/hai-bweb/src/main/java/com/bweb/controller/OutRechargeOrderController.java index ba2aa641..5745bb27 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/OutRechargeOrderController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/OutRechargeOrderController.java @@ -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 childOrderMap = new HashMap<>(); + + childOrderMap.put("parent_order_id" , orderId); + + List 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 diff --git a/hai-bweb/src/main/resources/dev/application.yml b/hai-bweb/src/main/resources/dev/application.yml index b3326583..21d771dd 100644 --- a/hai-bweb/src/main/resources/dev/application.yml +++ b/hai-bweb/src/main/resources/dev/application.yml @@ -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 diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java b/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java index c2d28294..cdbceca9 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java @@ -112,32 +112,72 @@ public class HighGasController { PageInfo> mapPageInfo = PageUtil.initPageInfoObj(pageNum, distance.size(), pageSize, new PageInfo<>(distance)); for (Map 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); diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java index e80f130c..2210cdb1 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java @@ -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) { diff --git a/hai-cweb/src/main/java/com/cweb/controller/OutRechargeOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/OutRechargeOrderController.java index a2bae762..c2bf4d6d 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/OutRechargeOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/OutRechargeOrderController.java @@ -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 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!"); diff --git a/hai-cweb/src/main/java/com/cweb/controller/WechatController.java b/hai-cweb/src/main/java/com/cweb/controller/WechatController.java index 69ed7e06..80b94913 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/WechatController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/WechatController.java @@ -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); diff --git a/hai-cweb/src/main/java/com/cweb/controller/pay/CzOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/pay/CzOrderController.java index 4c18fda8..fabbd8db 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/pay/CzOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/pay/CzOrderController.java @@ -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, "无法支付,订单不处于待支付状态"); } diff --git a/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java b/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java index ff42bcfc..6eb41fb2 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java @@ -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 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); diff --git a/hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java b/hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java index d621d2cb..f5b8ea93 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java @@ -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()); diff --git a/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java b/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java index 42e6a085..1de9a2aa 100644 --- a/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java +++ b/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java @@ -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(); diff --git a/hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java b/hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java index 09f645b5..f49e434c 100644 --- a/hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java +++ b/hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java @@ -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 map = new HashMap<>(); + map.put("status" , String.valueOf(102)); + map.put("rechargeStatus" , String.valueOf(204)); + List orderList = outRechargeOrderService.getListRechargeOrder(map); + + if (orderList != null && orderList.size() > 0) { + for (OutRechargeOrder order : orderList) { + try { + // 查询充值子订单 + Map childOrderMap = new HashMap<>(); + + childOrderMap.put("parent_order_id" , order.getId()); + childOrderMap.put("status" , 102); + + List 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 处理话费充值订单 diff --git a/hai-service/src/main/java/com/hai/common/utils/DateUtil.java b/hai-service/src/main/java/com/hai/common/utils/DateUtil.java index 72f6bc61..09d9f1a4 100644 --- a/hai-service/src/main/java/com/hai/common/utils/DateUtil.java +++ b/hai-service/src/main/java/com/hai/common/utils/DateUtil.java @@ -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)); } } diff --git a/hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapperExt.java index e4cd226c..c1aa28b9 100644 --- a/hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapperExt.java @@ -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," + diff --git a/hai-service/src/main/java/com/hai/dao/HighGasOilPriceTaskMapper.java b/hai-service/src/main/java/com/hai/dao/HighGasOilPriceTaskMapper.java index 3db09123..d10678e9 100644 --- a/hai-service/src/main/java/com/hai/dao/HighGasOilPriceTaskMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighGasOilPriceTaskMapper.java @@ -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},", diff --git a/hai-service/src/main/java/com/hai/dao/HighGasOilPriceTaskSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighGasOilPriceTaskSqlProvider.java index fa514857..81386790 100644 --- a/hai-service/src/main/java/com/hai/dao/HighGasOilPriceTaskSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighGasOilPriceTaskSqlProvider.java @@ -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}"); } diff --git a/hai-service/src/main/java/com/hai/dao/HighMerchantAccountMapper.java b/hai-service/src/main/java/com/hai/dao/HighMerchantAccountMapper.java new file mode 100644 index 00000000..4d2f0b68 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighMerchantAccountMapper.java @@ -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 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); +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighMerchantAccountMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighMerchantAccountMapperExt.java new file mode 100644 index 00000000..5eda9554 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighMerchantAccountMapperExt.java @@ -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> selectStoreGasOilAmountByMer(@Param("merId") Long merId); +} diff --git a/hai-service/src/main/java/com/hai/dao/HighMerchantAccountSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighMerchantAccountSqlProvider.java new file mode 100644 index 00000000..b847aea5 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighMerchantAccountSqlProvider.java @@ -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 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 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 oredCriteria = example.getOredCriteria(); + boolean firstCriteria = true; + for (int i = 0; i < oredCriteria.size(); i++) { + Criteria criteria = oredCriteria.get(i); + if (criteria.isValid()) { + if (firstCriteria) { + firstCriteria = false; + } else { + sb.append(" or "); + } + + sb.append('('); + List criterions = criteria.getAllCriteria(); + boolean firstCriterion = true; + for (int j = 0; j < criterions.size(); j++) { + Criterion criterion = criterions.get(j); + if (firstCriterion) { + firstCriterion = false; + } else { + sb.append(" and "); + } + + if (criterion.isNoValue()) { + sb.append(criterion.getCondition()); + } else if (criterion.isSingleValue()) { + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); + } else { + sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); + } + } else if (criterion.isBetweenValue()) { + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); + } else { + sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); + } + } else if (criterion.isListValue()) { + sb.append(criterion.getCondition()); + sb.append(" ("); + List listItems = (List) criterion.getValue(); + boolean comma = false; + for (int k = 0; k < listItems.size(); k++) { + if (comma) { + sb.append(", "); + } else { + comma = true; + } + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase3, i, j, k)); + } else { + sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); + } + } + sb.append(')'); + } + } + sb.append(')'); + } + } + + if (sb.length() > 0) { + sql.WHERE(sb.toString()); + } + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighMerchantTripartitePlatformMapper.java b/hai-service/src/main/java/com/hai/dao/HighMerchantTripartitePlatformMapper.java new file mode 100644 index 00000000..1e322e73 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighMerchantTripartitePlatformMapper.java @@ -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 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); +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighMerchantTripartitePlatformMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighMerchantTripartitePlatformMapperExt.java new file mode 100644 index 00000000..f9c3b3dc --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighMerchantTripartitePlatformMapperExt.java @@ -0,0 +1,7 @@ +package com.hai.dao; + +/** + * mapper扩展类 + */ +public interface HighMerchantTripartitePlatformMapperExt { +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighMerchantTripartitePlatformSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighMerchantTripartitePlatformSqlProvider.java new file mode 100644 index 00000000..a626ae6b --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighMerchantTripartitePlatformSqlProvider.java @@ -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 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 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 oredCriteria = example.getOredCriteria(); + boolean firstCriteria = true; + for (int i = 0; i < oredCriteria.size(); i++) { + Criteria criteria = oredCriteria.get(i); + if (criteria.isValid()) { + if (firstCriteria) { + firstCriteria = false; + } else { + sb.append(" or "); + } + + sb.append('('); + List criterions = criteria.getAllCriteria(); + boolean firstCriterion = true; + for (int j = 0; j < criterions.size(); j++) { + Criterion criterion = criterions.get(j); + if (firstCriterion) { + firstCriterion = false; + } else { + sb.append(" and "); + } + + if (criterion.isNoValue()) { + sb.append(criterion.getCondition()); + } else if (criterion.isSingleValue()) { + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); + } else { + sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); + } + } else if (criterion.isBetweenValue()) { + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); + } else { + sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); + } + } else if (criterion.isListValue()) { + sb.append(criterion.getCondition()); + sb.append(" ("); + List listItems = (List) criterion.getValue(); + boolean comma = false; + for (int k = 0; k < listItems.size(); k++) { + if (comma) { + sb.append(", "); + } else { + comma = true; + } + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase3, i, j, k)); + } else { + sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); + } + } + sb.append(')'); + } + } + sb.append(')'); + } + } + + if (sb.length() > 0) { + sql.WHERE(sb.toString()); + } + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighOrderMapper.java b/hai-service/src/main/java/com/hai/dao/HighOrderMapper.java index 99cefb59..3cdc4d3e 100644 --- a/hai-service/src/main/java/com/hai/dao/HighOrderMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighOrderMapper.java @@ -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); - - -} +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighOrderSplitAccountsRecordMapper.java b/hai-service/src/main/java/com/hai/dao/HighOrderSplitAccountsRecordMapper.java new file mode 100644 index 00000000..af286bbc --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighOrderSplitAccountsRecordMapper.java @@ -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 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); +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighOrderSplitAccountsRecordMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighOrderSplitAccountsRecordMapperExt.java new file mode 100644 index 00000000..ee5acf1e --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighOrderSplitAccountsRecordMapperExt.java @@ -0,0 +1,7 @@ +package com.hai.dao; + +/** + * mapper扩展类 + */ +public interface HighOrderSplitAccountsRecordMapperExt { +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighOrderSplitAccountsRecordSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighOrderSplitAccountsRecordSqlProvider.java new file mode 100644 index 00000000..63adc197 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighOrderSplitAccountsRecordSqlProvider.java @@ -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 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 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 oredCriteria = example.getOredCriteria(); + boolean firstCriteria = true; + for (int i = 0; i < oredCriteria.size(); i++) { + Criteria criteria = oredCriteria.get(i); + if (criteria.isValid()) { + if (firstCriteria) { + firstCriteria = false; + } else { + sb.append(" or "); + } + + sb.append('('); + List criterions = criteria.getAllCriteria(); + boolean firstCriterion = true; + for (int j = 0; j < criterions.size(); j++) { + Criterion criterion = criterions.get(j); + if (firstCriterion) { + firstCriterion = false; + } else { + sb.append(" and "); + } + + if (criterion.isNoValue()) { + sb.append(criterion.getCondition()); + } else if (criterion.isSingleValue()) { + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); + } else { + sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); + } + } else if (criterion.isBetweenValue()) { + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); + } else { + sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); + } + } else if (criterion.isListValue()) { + sb.append(criterion.getCondition()); + sb.append(" ("); + List listItems = (List) criterion.getValue(); + boolean comma = false; + for (int k = 0; k < listItems.size(); k++) { + if (comma) { + sb.append(", "); + } else { + comma = true; + } + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase3, i, j, k)); + } else { + sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); + } + } + sb.append(')'); + } + } + sb.append(')'); + } + } + + if (sb.length() > 0) { + sql.WHERE(sb.toString()); + } + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighOrderSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighOrderSqlProvider.java index 10dd906d..9e5a74ab 100644 --- a/hai-service/src/main/java/com/hai/dao/HighOrderSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighOrderSqlProvider.java @@ -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}"); } diff --git a/hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapperExt.java b/hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapperExt.java index 3e099165..6b08cdc8 100644 --- a/hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapperExt.java @@ -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} " , - " and status = #{status} ", + " and pay_status = #{status} ", "GROUP BY day", "" }) @@ -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 getListOrderCount(String finishTimeS , String finishTimeE , Integer status); @@ -108,7 +108,7 @@ public interface OutRechargeOrderMapperExt { List selectOrderCount(@Param("map") Map 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 = { "" }) @Results({ diff --git a/hai-service/src/main/java/com/hai/entity/HighGasOilPriceTask.java b/hai-service/src/main/java/com/hai/entity/HighGasOilPriceTask.java index b4a50850..d1f65131 100644 --- a/hai-service/src/main/java/com/hai/entity/HighGasOilPriceTask.java +++ b/hai-service/src/main/java/com/hai/entity/HighGasOilPriceTask.java @@ -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); diff --git a/hai-service/src/main/java/com/hai/entity/HighGasOilPriceTaskExample.java b/hai-service/src/main/java/com/hai/entity/HighGasOilPriceTaskExample.java index 601a1183..4527ab1a 100644 --- a/hai-service/src/main/java/com/hai/entity/HighGasOilPriceTaskExample.java +++ b/hai-service/src/main/java/com/hai/entity/HighGasOilPriceTaskExample.java @@ -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 values) { + addCriterion("mer_store_key in", values, "merStoreKey"); + return (Criteria) this; + } + + public Criteria andMerStoreKeyNotIn(List 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; diff --git a/hai-service/src/main/java/com/hai/entity/HighMerchantAccount.java b/hai-service/src/main/java/com/hai/entity/HighMerchantAccount.java new file mode 100644 index 00000000..dc072b83 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighMerchantAccount.java @@ -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(); + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/HighMerchantAccountExample.java b/hai-service/src/main/java/com/hai/entity/HighMerchantAccountExample.java new file mode 100644 index 00000000..2a1d4b4a --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighMerchantAccountExample.java @@ -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 oredCriteria; + + private Integer limit; + + private Long offset; + + public HighMerchantAccountExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getLimit() { + return limit; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public Long getOffset() { + return offset; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andMerIdIsNull() { + addCriterion("mer_id is null"); + return (Criteria) this; + } + + public Criteria andMerIdIsNotNull() { + addCriterion("mer_id is not null"); + return (Criteria) this; + } + + public Criteria andMerIdEqualTo(Long value) { + addCriterion("mer_id =", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotEqualTo(Long value) { + addCriterion("mer_id <>", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdGreaterThan(Long value) { + addCriterion("mer_id >", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdGreaterThanOrEqualTo(Long value) { + addCriterion("mer_id >=", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdLessThan(Long value) { + addCriterion("mer_id <", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdLessThanOrEqualTo(Long value) { + addCriterion("mer_id <=", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdIn(List values) { + addCriterion("mer_id in", values, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotIn(List values) { + addCriterion("mer_id not in", values, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdBetween(Long value1, Long value2) { + addCriterion("mer_id between", value1, value2, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotBetween(Long value1, Long value2) { + addCriterion("mer_id not between", value1, value2, "merId"); + return (Criteria) this; + } + + public Criteria 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 values) { + addCriterion("mer_name in", values, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotIn(List 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 values) { + addCriterion("account_no in", values, "accountNo"); + return (Criteria) this; + } + + public Criteria andAccountNoNotIn(List 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 values) { + addCriterion("amounts in", values, "amounts"); + return (Criteria) this; + } + + public Criteria andAmountsNotIn(List 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 values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("`status` not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Integer value1, Integer value2) { + addCriterion("`status` between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Integer value1, Integer value2) { + addCriterion("`status` not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andExt1IsNull() { + addCriterion("ext_1 is null"); + return (Criteria) this; + } + + public Criteria andExt1IsNotNull() { + addCriterion("ext_1 is not null"); + return (Criteria) this; + } + + public Criteria andExt1EqualTo(String value) { + addCriterion("ext_1 =", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotEqualTo(String value) { + addCriterion("ext_1 <>", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThan(String value) { + addCriterion("ext_1 >", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThanOrEqualTo(String value) { + addCriterion("ext_1 >=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThan(String value) { + addCriterion("ext_1 <", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThanOrEqualTo(String value) { + addCriterion("ext_1 <=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Like(String value) { + addCriterion("ext_1 like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotLike(String value) { + addCriterion("ext_1 not like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1In(List values) { + addCriterion("ext_1 in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotIn(List values) { + addCriterion("ext_1 not in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Between(String value1, String value2) { + addCriterion("ext_1 between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotBetween(String value1, String value2) { + addCriterion("ext_1 not between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt2IsNull() { + addCriterion("ext_2 is null"); + return (Criteria) this; + } + + public Criteria andExt2IsNotNull() { + addCriterion("ext_2 is not null"); + return (Criteria) this; + } + + public Criteria andExt2EqualTo(String value) { + addCriterion("ext_2 =", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotEqualTo(String value) { + addCriterion("ext_2 <>", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThan(String value) { + addCriterion("ext_2 >", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThanOrEqualTo(String value) { + addCriterion("ext_2 >=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThan(String value) { + addCriterion("ext_2 <", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThanOrEqualTo(String value) { + addCriterion("ext_2 <=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Like(String value) { + addCriterion("ext_2 like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotLike(String value) { + addCriterion("ext_2 not like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2In(List values) { + addCriterion("ext_2 in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotIn(List values) { + addCriterion("ext_2 not in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Between(String value1, String value2) { + addCriterion("ext_2 between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotBetween(String value1, String value2) { + addCriterion("ext_2 not between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt3IsNull() { + addCriterion("ext_3 is null"); + return (Criteria) this; + } + + public Criteria andExt3IsNotNull() { + addCriterion("ext_3 is not null"); + return (Criteria) this; + } + + public Criteria andExt3EqualTo(String value) { + addCriterion("ext_3 =", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotEqualTo(String value) { + addCriterion("ext_3 <>", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThan(String value) { + addCriterion("ext_3 >", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThanOrEqualTo(String value) { + addCriterion("ext_3 >=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThan(String value) { + addCriterion("ext_3 <", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThanOrEqualTo(String value) { + addCriterion("ext_3 <=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Like(String value) { + addCriterion("ext_3 like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotLike(String value) { + addCriterion("ext_3 not like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3In(List values) { + addCriterion("ext_3 in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotIn(List values) { + addCriterion("ext_3 not in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Between(String value1, String value2) { + addCriterion("ext_3 between", value1, value2, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotBetween(String value1, String value2) { + addCriterion("ext_3 not between", value1, value2, "ext3"); + return (Criteria) this; + } + } + + /** + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/HighMerchantTripartitePlatform.java b/hai-service/src/main/java/com/hai/entity/HighMerchantTripartitePlatform.java new file mode 100644 index 00000000..73468479 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighMerchantTripartitePlatform.java @@ -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(); + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/HighMerchantTripartitePlatformExample.java b/hai-service/src/main/java/com/hai/entity/HighMerchantTripartitePlatformExample.java new file mode 100644 index 00000000..1880d144 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighMerchantTripartitePlatformExample.java @@ -0,0 +1,1054 @@ +package com.hai.entity; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class HighMerchantTripartitePlatformExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public HighMerchantTripartitePlatformExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getLimit() { + return limit; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public Long getOffset() { + return offset; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andMerIdIsNull() { + addCriterion("mer_id is null"); + return (Criteria) this; + } + + public Criteria andMerIdIsNotNull() { + addCriterion("mer_id is not null"); + return (Criteria) this; + } + + public Criteria andMerIdEqualTo(Long value) { + addCriterion("mer_id =", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotEqualTo(Long value) { + addCriterion("mer_id <>", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdGreaterThan(Long value) { + addCriterion("mer_id >", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdGreaterThanOrEqualTo(Long value) { + addCriterion("mer_id >=", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdLessThan(Long value) { + addCriterion("mer_id <", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdLessThanOrEqualTo(Long value) { + addCriterion("mer_id <=", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdIn(List values) { + addCriterion("mer_id in", values, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotIn(List values) { + addCriterion("mer_id not in", values, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdBetween(Long value1, Long value2) { + addCriterion("mer_id between", value1, value2, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotBetween(Long value1, Long value2) { + addCriterion("mer_id not between", value1, value2, "merId"); + return (Criteria) this; + } + + public Criteria andPlatformTypeIsNull() { + addCriterion("platform_type is null"); + return (Criteria) this; + } + + public Criteria andPlatformTypeIsNotNull() { + addCriterion("platform_type is not null"); + return (Criteria) this; + } + + public Criteria andPlatformTypeEqualTo(Integer value) { + addCriterion("platform_type =", value, "platformType"); + return (Criteria) this; + } + + public Criteria andPlatformTypeNotEqualTo(Integer value) { + addCriterion("platform_type <>", value, "platformType"); + return (Criteria) this; + } + + public Criteria andPlatformTypeGreaterThan(Integer value) { + addCriterion("platform_type >", value, "platformType"); + return (Criteria) this; + } + + public Criteria andPlatformTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("platform_type >=", value, "platformType"); + return (Criteria) this; + } + + public Criteria andPlatformTypeLessThan(Integer value) { + addCriterion("platform_type <", value, "platformType"); + return (Criteria) this; + } + + public Criteria andPlatformTypeLessThanOrEqualTo(Integer value) { + addCriterion("platform_type <=", value, "platformType"); + return (Criteria) this; + } + + public Criteria andPlatformTypeIn(List values) { + addCriterion("platform_type in", values, "platformType"); + return (Criteria) this; + } + + public Criteria andPlatformTypeNotIn(List values) { + addCriterion("platform_type not in", values, "platformType"); + return (Criteria) this; + } + + public Criteria andPlatformTypeBetween(Integer value1, Integer value2) { + addCriterion("platform_type between", value1, value2, "platformType"); + return (Criteria) this; + } + + public Criteria andPlatformTypeNotBetween(Integer value1, Integer value2) { + addCriterion("platform_type not between", value1, value2, "platformType"); + return (Criteria) this; + } + + public Criteria andPlatformMerNameIsNull() { + addCriterion("platform_mer_name is null"); + return (Criteria) this; + } + + public Criteria andPlatformMerNameIsNotNull() { + addCriterion("platform_mer_name is not null"); + return (Criteria) this; + } + + public Criteria andPlatformMerNameEqualTo(String value) { + addCriterion("platform_mer_name =", value, "platformMerName"); + return (Criteria) this; + } + + public Criteria andPlatformMerNameNotEqualTo(String value) { + addCriterion("platform_mer_name <>", value, "platformMerName"); + return (Criteria) this; + } + + public Criteria andPlatformMerNameGreaterThan(String value) { + addCriterion("platform_mer_name >", value, "platformMerName"); + return (Criteria) this; + } + + public Criteria andPlatformMerNameGreaterThanOrEqualTo(String value) { + addCriterion("platform_mer_name >=", value, "platformMerName"); + return (Criteria) this; + } + + public Criteria andPlatformMerNameLessThan(String value) { + addCriterion("platform_mer_name <", value, "platformMerName"); + return (Criteria) this; + } + + public Criteria andPlatformMerNameLessThanOrEqualTo(String value) { + addCriterion("platform_mer_name <=", value, "platformMerName"); + return (Criteria) this; + } + + public Criteria andPlatformMerNameLike(String value) { + addCriterion("platform_mer_name like", value, "platformMerName"); + return (Criteria) this; + } + + public Criteria andPlatformMerNameNotLike(String value) { + addCriterion("platform_mer_name not like", value, "platformMerName"); + return (Criteria) this; + } + + public Criteria andPlatformMerNameIn(List values) { + addCriterion("platform_mer_name in", values, "platformMerName"); + return (Criteria) this; + } + + public Criteria andPlatformMerNameNotIn(List values) { + addCriterion("platform_mer_name not in", values, "platformMerName"); + return (Criteria) this; + } + + public Criteria andPlatformMerNameBetween(String value1, String value2) { + addCriterion("platform_mer_name between", value1, value2, "platformMerName"); + return (Criteria) this; + } + + public Criteria andPlatformMerNameNotBetween(String value1, String value2) { + addCriterion("platform_mer_name not between", value1, value2, "platformMerName"); + return (Criteria) this; + } + + public Criteria andPlatformMerNumberIsNull() { + addCriterion("platform_mer_number is null"); + return (Criteria) this; + } + + public Criteria andPlatformMerNumberIsNotNull() { + addCriterion("platform_mer_number is not null"); + return (Criteria) this; + } + + public Criteria andPlatformMerNumberEqualTo(String value) { + addCriterion("platform_mer_number =", value, "platformMerNumber"); + return (Criteria) this; + } + + public Criteria andPlatformMerNumberNotEqualTo(String value) { + addCriterion("platform_mer_number <>", value, "platformMerNumber"); + return (Criteria) this; + } + + public Criteria andPlatformMerNumberGreaterThan(String value) { + addCriterion("platform_mer_number >", value, "platformMerNumber"); + return (Criteria) this; + } + + public Criteria andPlatformMerNumberGreaterThanOrEqualTo(String value) { + addCriterion("platform_mer_number >=", value, "platformMerNumber"); + return (Criteria) this; + } + + public Criteria andPlatformMerNumberLessThan(String value) { + addCriterion("platform_mer_number <", value, "platformMerNumber"); + return (Criteria) this; + } + + public Criteria andPlatformMerNumberLessThanOrEqualTo(String value) { + addCriterion("platform_mer_number <=", value, "platformMerNumber"); + return (Criteria) this; + } + + public Criteria andPlatformMerNumberLike(String value) { + addCriterion("platform_mer_number like", value, "platformMerNumber"); + return (Criteria) this; + } + + public Criteria andPlatformMerNumberNotLike(String value) { + addCriterion("platform_mer_number not like", value, "platformMerNumber"); + return (Criteria) this; + } + + public Criteria andPlatformMerNumberIn(List values) { + addCriterion("platform_mer_number in", values, "platformMerNumber"); + return (Criteria) this; + } + + public Criteria andPlatformMerNumberNotIn(List values) { + addCriterion("platform_mer_number not in", values, "platformMerNumber"); + return (Criteria) this; + } + + public Criteria andPlatformMerNumberBetween(String value1, String value2) { + addCriterion("platform_mer_number between", value1, value2, "platformMerNumber"); + return (Criteria) this; + } + + public Criteria andPlatformMerNumberNotBetween(String value1, String value2) { + addCriterion("platform_mer_number not between", value1, value2, "platformMerNumber"); + 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 values) { + addCriterion("profit_sharing_status in", values, "profitSharingStatus"); + return (Criteria) this; + } + + public Criteria andProfitSharingStatusNotIn(List 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 values) { + addCriterion("profit_sharing_ratio in", values, "profitSharingRatio"); + return (Criteria) this; + } + + public Criteria andProfitSharingRatioNotIn(List 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 andStatusIsNull() { + addCriterion("`status` is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("`status` is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Integer value) { + addCriterion("`status` =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Integer value) { + addCriterion("`status` <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Integer value) { + addCriterion("`status` >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("`status` >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Integer value) { + addCriterion("`status` <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Integer value) { + addCriterion("`status` <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("`status` not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Integer value1, Integer value2) { + addCriterion("`status` between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Integer value1, Integer value2) { + addCriterion("`status` not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andExt1IsNull() { + addCriterion("ext_1 is null"); + return (Criteria) this; + } + + public Criteria andExt1IsNotNull() { + addCriterion("ext_1 is not null"); + return (Criteria) this; + } + + public Criteria andExt1EqualTo(String value) { + addCriterion("ext_1 =", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotEqualTo(String value) { + addCriterion("ext_1 <>", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThan(String value) { + addCriterion("ext_1 >", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThanOrEqualTo(String value) { + addCriterion("ext_1 >=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThan(String value) { + addCriterion("ext_1 <", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThanOrEqualTo(String value) { + addCriterion("ext_1 <=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Like(String value) { + addCriterion("ext_1 like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotLike(String value) { + addCriterion("ext_1 not like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1In(List values) { + addCriterion("ext_1 in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotIn(List values) { + addCriterion("ext_1 not in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Between(String value1, String value2) { + addCriterion("ext_1 between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotBetween(String value1, String value2) { + addCriterion("ext_1 not between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt2IsNull() { + addCriterion("ext_2 is null"); + return (Criteria) this; + } + + public Criteria andExt2IsNotNull() { + addCriterion("ext_2 is not null"); + return (Criteria) this; + } + + public Criteria andExt2EqualTo(String value) { + addCriterion("ext_2 =", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotEqualTo(String value) { + addCriterion("ext_2 <>", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThan(String value) { + addCriterion("ext_2 >", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThanOrEqualTo(String value) { + addCriterion("ext_2 >=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThan(String value) { + addCriterion("ext_2 <", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThanOrEqualTo(String value) { + addCriterion("ext_2 <=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Like(String value) { + addCriterion("ext_2 like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotLike(String value) { + addCriterion("ext_2 not like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2In(List values) { + addCriterion("ext_2 in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotIn(List values) { + addCriterion("ext_2 not in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Between(String value1, String value2) { + addCriterion("ext_2 between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotBetween(String value1, String value2) { + addCriterion("ext_2 not between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt3IsNull() { + addCriterion("ext_3 is null"); + return (Criteria) this; + } + + public Criteria andExt3IsNotNull() { + addCriterion("ext_3 is not null"); + return (Criteria) this; + } + + public Criteria andExt3EqualTo(String value) { + addCriterion("ext_3 =", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotEqualTo(String value) { + addCriterion("ext_3 <>", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThan(String value) { + addCriterion("ext_3 >", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThanOrEqualTo(String value) { + addCriterion("ext_3 >=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThan(String value) { + addCriterion("ext_3 <", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThanOrEqualTo(String value) { + addCriterion("ext_3 <=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Like(String value) { + addCriterion("ext_3 like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotLike(String value) { + addCriterion("ext_3 not like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3In(List values) { + addCriterion("ext_3 in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotIn(List values) { + addCriterion("ext_3 not in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Between(String value1, String value2) { + addCriterion("ext_3 between", value1, value2, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotBetween(String value1, String value2) { + addCriterion("ext_3 not between", value1, value2, "ext3"); + return (Criteria) this; + } + } + + /** + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/HighOrder.java b/hai-service/src/main/java/com/hai/entity/HighOrder.java index cf0c1f52..3dd4b8d0 100644 --- a/hai-service/src/main/java/com/hai/entity/HighOrder.java +++ b/hai-service/src/main/java/com/hai/entity/HighOrder.java @@ -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 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); diff --git a/hai-service/src/main/java/com/hai/entity/HighOrderExample.java b/hai-service/src/main/java/com/hai/entity/HighOrderExample.java index ffb207fb..a7de7e76 100644 --- a/hai-service/src/main/java/com/hai/entity/HighOrderExample.java +++ b/hai-service/src/main/java/com/hai/entity/HighOrderExample.java @@ -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 values) { + addCriterion("profit_sharing_status in", values, "profitSharingStatus"); + return (Criteria) this; + } + + public Criteria andProfitSharingStatusNotIn(List 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 values) { + addCriterion("profit_sharing_ratio in", values, "profitSharingRatio"); + return (Criteria) this; + } + + public Criteria andProfitSharingRatioNotIn(List 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 values) { + addCriterion("account_merchant_num in", values, "accountMerchantNum"); + return (Criteria) this; + } + + public Criteria andAccountMerchantNumNotIn(List 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; diff --git a/hai-service/src/main/java/com/hai/entity/HighOrderSplitAccountsRecord.java b/hai-service/src/main/java/com/hai/entity/HighOrderSplitAccountsRecord.java new file mode 100644 index 00000000..0ccdc159 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighOrderSplitAccountsRecord.java @@ -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(); + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/HighOrderSplitAccountsRecordExample.java b/hai-service/src/main/java/com/hai/entity/HighOrderSplitAccountsRecordExample.java new file mode 100644 index 00000000..cb6c0f63 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighOrderSplitAccountsRecordExample.java @@ -0,0 +1,1044 @@ +package com.hai.entity; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class HighOrderSplitAccountsRecordExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public HighOrderSplitAccountsRecordExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getLimit() { + return limit; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public Long getOffset() { + return offset; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andOrderIdIsNull() { + addCriterion("order_id is null"); + return (Criteria) this; + } + + public Criteria andOrderIdIsNotNull() { + addCriterion("order_id is not null"); + return (Criteria) this; + } + + public Criteria andOrderIdEqualTo(Long value) { + addCriterion("order_id =", value, "orderId"); + return (Criteria) this; + } + + public Criteria andOrderIdNotEqualTo(Long value) { + addCriterion("order_id <>", value, "orderId"); + return (Criteria) this; + } + + public Criteria andOrderIdGreaterThan(Long value) { + addCriterion("order_id >", value, "orderId"); + return (Criteria) this; + } + + public Criteria andOrderIdGreaterThanOrEqualTo(Long value) { + addCriterion("order_id >=", value, "orderId"); + return (Criteria) this; + } + + public Criteria andOrderIdLessThan(Long value) { + addCriterion("order_id <", value, "orderId"); + return (Criteria) this; + } + + public Criteria andOrderIdLessThanOrEqualTo(Long value) { + addCriterion("order_id <=", value, "orderId"); + return (Criteria) this; + } + + public Criteria andOrderIdIn(List values) { + addCriterion("order_id in", values, "orderId"); + return (Criteria) this; + } + + public Criteria andOrderIdNotIn(List values) { + addCriterion("order_id not in", values, "orderId"); + return (Criteria) this; + } + + public Criteria andOrderIdBetween(Long value1, Long value2) { + addCriterion("order_id between", value1, value2, "orderId"); + return (Criteria) this; + } + + public Criteria andOrderIdNotBetween(Long value1, Long value2) { + addCriterion("order_id not between", value1, value2, "orderId"); + return (Criteria) this; + } + + public Criteria andOrderNoIsNull() { + addCriterion("order_no is null"); + return (Criteria) this; + } + + public Criteria andOrderNoIsNotNull() { + addCriterion("order_no is not null"); + return (Criteria) this; + } + + public Criteria andOrderNoEqualTo(Integer value) { + addCriterion("order_no =", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoNotEqualTo(Integer value) { + addCriterion("order_no <>", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoGreaterThan(Integer value) { + addCriterion("order_no >", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoGreaterThanOrEqualTo(Integer value) { + addCriterion("order_no >=", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoLessThan(Integer value) { + addCriterion("order_no <", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoLessThanOrEqualTo(Integer value) { + addCriterion("order_no <=", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoIn(List values) { + addCriterion("order_no in", values, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoNotIn(List values) { + addCriterion("order_no not in", values, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoBetween(Integer value1, Integer value2) { + addCriterion("order_no between", value1, value2, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoNotBetween(Integer value1, Integer value2) { + addCriterion("order_no not between", value1, value2, "orderNo"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("`type` is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("`type` is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(Integer value) { + addCriterion("`type` =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(Integer value) { + addCriterion("`type` <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(Integer value) { + addCriterion("`type` >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("`type` >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(Integer value) { + addCriterion("`type` <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(Integer value) { + addCriterion("`type` <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("`type` in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("`type` not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(Integer value1, Integer value2) { + addCriterion("`type` between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(Integer value1, Integer value2) { + addCriterion("`type` not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria 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 values) { + addCriterion("account_no in", values, "accountNo"); + return (Criteria) this; + } + + public Criteria andAccountNoNotIn(List 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 andRateIsNull() { + addCriterion("rate is null"); + return (Criteria) this; + } + + public Criteria andRateIsNotNull() { + addCriterion("rate is not null"); + return (Criteria) this; + } + + public Criteria andRateEqualTo(BigDecimal value) { + addCriterion("rate =", value, "rate"); + return (Criteria) this; + } + + public Criteria andRateNotEqualTo(BigDecimal value) { + addCriterion("rate <>", value, "rate"); + return (Criteria) this; + } + + public Criteria andRateGreaterThan(BigDecimal value) { + addCriterion("rate >", value, "rate"); + return (Criteria) this; + } + + public Criteria andRateGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("rate >=", value, "rate"); + return (Criteria) this; + } + + public Criteria andRateLessThan(BigDecimal value) { + addCriterion("rate <", value, "rate"); + return (Criteria) this; + } + + public Criteria andRateLessThanOrEqualTo(BigDecimal value) { + addCriterion("rate <=", value, "rate"); + return (Criteria) this; + } + + public Criteria andRateIn(List values) { + addCriterion("rate in", values, "rate"); + return (Criteria) this; + } + + public Criteria andRateNotIn(List values) { + addCriterion("rate not in", values, "rate"); + return (Criteria) this; + } + + public Criteria andRateBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("rate between", value1, value2, "rate"); + return (Criteria) this; + } + + public Criteria andRateNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("rate not between", value1, value2, "rate"); + return (Criteria) this; + } + + public Criteria andSplitPriceIsNull() { + addCriterion("split_price is null"); + return (Criteria) this; + } + + public Criteria andSplitPriceIsNotNull() { + addCriterion("split_price is not null"); + return (Criteria) this; + } + + public Criteria andSplitPriceEqualTo(BigDecimal value) { + addCriterion("split_price =", value, "splitPrice"); + return (Criteria) this; + } + + public Criteria andSplitPriceNotEqualTo(BigDecimal value) { + addCriterion("split_price <>", value, "splitPrice"); + return (Criteria) this; + } + + public Criteria andSplitPriceGreaterThan(BigDecimal value) { + addCriterion("split_price >", value, "splitPrice"); + return (Criteria) this; + } + + public Criteria andSplitPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("split_price >=", value, "splitPrice"); + return (Criteria) this; + } + + public Criteria andSplitPriceLessThan(BigDecimal value) { + addCriterion("split_price <", value, "splitPrice"); + return (Criteria) this; + } + + public Criteria andSplitPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("split_price <=", value, "splitPrice"); + return (Criteria) this; + } + + public Criteria andSplitPriceIn(List values) { + addCriterion("split_price in", values, "splitPrice"); + return (Criteria) this; + } + + public Criteria andSplitPriceNotIn(List values) { + addCriterion("split_price not in", values, "splitPrice"); + return (Criteria) this; + } + + public Criteria andSplitPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("split_price between", value1, value2, "splitPrice"); + return (Criteria) this; + } + + public Criteria andSplitPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("split_price not between", value1, value2, "splitPrice"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("`status` is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("`status` is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Integer value) { + addCriterion("`status` =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Integer value) { + addCriterion("`status` <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Integer value) { + addCriterion("`status` >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("`status` >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Integer value) { + addCriterion("`status` <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Integer value) { + addCriterion("`status` <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("`status` not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Integer value1, Integer value2) { + addCriterion("`status` between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Integer value1, Integer value2) { + addCriterion("`status` not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andExt1IsNull() { + addCriterion("ext_1 is null"); + return (Criteria) this; + } + + public Criteria andExt1IsNotNull() { + addCriterion("ext_1 is not null"); + return (Criteria) this; + } + + public Criteria andExt1EqualTo(String value) { + addCriterion("ext_1 =", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotEqualTo(String value) { + addCriterion("ext_1 <>", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThan(String value) { + addCriterion("ext_1 >", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThanOrEqualTo(String value) { + addCriterion("ext_1 >=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThan(String value) { + addCriterion("ext_1 <", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThanOrEqualTo(String value) { + addCriterion("ext_1 <=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Like(String value) { + addCriterion("ext_1 like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotLike(String value) { + addCriterion("ext_1 not like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1In(List values) { + addCriterion("ext_1 in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotIn(List values) { + addCriterion("ext_1 not in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Between(String value1, String value2) { + addCriterion("ext_1 between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotBetween(String value1, String value2) { + addCriterion("ext_1 not between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt2IsNull() { + addCriterion("ext_2 is null"); + return (Criteria) this; + } + + public Criteria andExt2IsNotNull() { + addCriterion("ext_2 is not null"); + return (Criteria) this; + } + + public Criteria andExt2EqualTo(String value) { + addCriterion("ext_2 =", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotEqualTo(String value) { + addCriterion("ext_2 <>", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThan(String value) { + addCriterion("ext_2 >", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThanOrEqualTo(String value) { + addCriterion("ext_2 >=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThan(String value) { + addCriterion("ext_2 <", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThanOrEqualTo(String value) { + addCriterion("ext_2 <=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Like(String value) { + addCriterion("ext_2 like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotLike(String value) { + addCriterion("ext_2 not like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2In(List values) { + addCriterion("ext_2 in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotIn(List values) { + addCriterion("ext_2 not in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Between(String value1, String value2) { + addCriterion("ext_2 between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotBetween(String value1, String value2) { + addCriterion("ext_2 not between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt3IsNull() { + addCriterion("ext_3 is null"); + return (Criteria) this; + } + + public Criteria andExt3IsNotNull() { + addCriterion("ext_3 is not null"); + return (Criteria) this; + } + + public Criteria andExt3EqualTo(String value) { + addCriterion("ext_3 =", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotEqualTo(String value) { + addCriterion("ext_3 <>", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThan(String value) { + addCriterion("ext_3 >", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThanOrEqualTo(String value) { + addCriterion("ext_3 >=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThan(String value) { + addCriterion("ext_3 <", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThanOrEqualTo(String value) { + addCriterion("ext_3 <=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Like(String value) { + addCriterion("ext_3 like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotLike(String value) { + addCriterion("ext_3 not like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3In(List values) { + addCriterion("ext_3 in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotIn(List values) { + addCriterion("ext_3 not in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Between(String value1, String value2) { + addCriterion("ext_3 between", value1, value2, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotBetween(String value1, String value2) { + addCriterion("ext_3 not between", value1, value2, "ext3"); + return (Criteria) this; + } + } + + /** + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/enum_type/OperatorEnum.java b/hai-service/src/main/java/com/hai/enum_type/OperatorEnum.java new file mode 100644 index 00000000..5dddc084 --- /dev/null +++ b/hai-service/src/main/java/com/hai/enum_type/OperatorEnum.java @@ -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; + } +} diff --git a/hai-service/src/main/java/com/hai/enum_type/OrderPushType.java b/hai-service/src/main/java/com/hai/enum_type/OrderPushType.java index 32897ac9..99d18f97 100644 --- a/hai-service/src/main/java/com/hai/enum_type/OrderPushType.java +++ b/hai-service/src/main/java/com/hai/enum_type/OrderPushType.java @@ -8,7 +8,7 @@ import java.util.Objects; */ public enum OrderPushType { type1(1 , "加油订单"), - type2(2 , "话费订单"), + type2(2 , "充值订单"), type3(3 , "KFC订单"), type4(4 , "电影票订单"), type5(5 , "汇联通会员卡"), diff --git a/hai-service/src/main/java/com/hai/model/HighMerchantStoreModel.java b/hai-service/src/main/java/com/hai/model/HighMerchantStoreModel.java index 52533361..cbedf6bc 100644 --- a/hai-service/src/main/java/com/hai/model/HighMerchantStoreModel.java +++ b/hai-service/src/main/java/com/hai/model/HighMerchantStoreModel.java @@ -32,4 +32,5 @@ public class HighMerchantStoreModel extends HighMerchantStore { public void setHighMerchant(HighMerchant highMerchant) { this.highMerchant = highMerchant; } + } diff --git a/hai-service/src/main/java/com/hai/model/OutOrderModel.java b/hai-service/src/main/java/com/hai/model/OutOrderModel.java index 5bf2c3e2..1de5c073 100644 --- a/hai-service/src/main/java/com/hai/model/OutOrderModel.java +++ b/hai-service/src/main/java/com/hai/model/OutOrderModel.java @@ -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() { diff --git a/hai-service/src/main/java/com/hai/model/OutRechargeOrderDetailModel.java b/hai-service/src/main/java/com/hai/model/OutRechargeOrderDetailModel.java new file mode 100644 index 00000000..cf739e09 --- /dev/null +++ b/hai-service/src/main/java/com/hai/model/OutRechargeOrderDetailModel.java @@ -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; + } +} diff --git a/hai-service/src/main/java/com/hai/model/UserModel.java b/hai-service/src/main/java/com/hai/model/UserModel.java index 2ab4c6d4..3f85b06d 100644 --- a/hai-service/src/main/java/com/hai/model/UserModel.java +++ b/hai-service/src/main/java/com/hai/model/UserModel.java @@ -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; + } } diff --git a/hai-service/src/main/java/com/hai/msg/entity/MsgTopic.java b/hai-service/src/main/java/com/hai/msg/entity/MsgTopic.java index a2ebb3dd..65af6191 100644 --- a/hai-service/src/main/java/com/hai/msg/entity/MsgTopic.java +++ b/hai-service/src/main/java/com/hai/msg/entity/MsgTopic.java @@ -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; diff --git a/hai-service/src/main/java/com/hai/service/CommonService.java b/hai-service/src/main/java/com/hai/service/CommonService.java index ee8bbe23..21926282 100644 --- a/hai-service/src/main/java/com/hai/service/CommonService.java +++ b/hai-service/src/main/java/com/hai/service/CommonService.java @@ -147,6 +147,12 @@ public interface CommonService { */ SecRegion getRegionsById(Long regionId); + /** + * 查询省级列表 + * @return + */ + List getProvinceList(); + /** * 根据地区名称模糊查询 * @param regionName diff --git a/hai-service/src/main/java/com/hai/service/HighGasOilPriceTaskService.java b/hai-service/src/main/java/com/hai/service/HighGasOilPriceTaskService.java index dd528cb1..3d6e7a69 100644 --- a/hai-service/src/main/java/com/hai/service/HighGasOilPriceTaskService.java +++ b/hai-service/src/main/java/com/hai/service/HighGasOilPriceTaskService.java @@ -17,6 +17,12 @@ public interface HighGasOilPriceTaskService { */ void editData(HighGasOilPriceTask gasOilPriceTask); + /** + * 批量增加价格任务 + * @param taskList + */ + void batchAddTask(List taskList); + /** * 增加价格任务 * @param gasOilPriceTask diff --git a/hai-service/src/main/java/com/hai/service/HighMerchantAccountService.java b/hai-service/src/main/java/com/hai/service/HighMerchantAccountService.java new file mode 100644 index 00000000..00a5af15 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/HighMerchantAccountService.java @@ -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 otherParam); + + /** + * 查询商户账户 + * @param merId + * @return + */ + HighMerchantAccount getStoreAccountDetail(Long merId); + + /** + * 统计商户加油金额 + * @param merId + * @return + */ + BigDecimal countMerGasOilAmount(Long merId); + + /** + * 查询门店加油金额 + * @param merId + * @return + */ + List> getStoreGasOilAmountByMer(Long merId); + } diff --git a/hai-service/src/main/java/com/hai/service/HighMerchantTripartitePlatformService.java b/hai-service/src/main/java/com/hai/service/HighMerchantTripartitePlatformService.java new file mode 100644 index 00000000..57102f72 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/HighMerchantTripartitePlatformService.java @@ -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); +} diff --git a/hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java b/hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java index f46d8caf..8c63c654 100644 --- a/hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java +++ b/hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java @@ -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); + + } diff --git a/hai-service/src/main/java/com/hai/service/OutRechargePriceService.java b/hai-service/src/main/java/com/hai/service/OutRechargePriceService.java index eb69e260..7539e09e 100644 --- a/hai-service/src/main/java/com/hai/service/OutRechargePriceService.java +++ b/hai-service/src/main/java/com/hai/service/OutRechargePriceService.java @@ -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 diff --git a/hai-service/src/main/java/com/hai/service/impl/BsCompanyServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/BsCompanyServiceImpl.java index 6a2ed729..f95b0a58 100644 --- a/hai-service/src/main/java/com/hai/service/impl/BsCompanyServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/BsCompanyServiceImpl.java @@ -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; } diff --git a/hai-service/src/main/java/com/hai/service/impl/CommonServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/CommonServiceImpl.java index e83619a0..01e53f8f 100644 --- a/hai-service/src/main/java/com/hai/service/impl/CommonServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/CommonServiceImpl.java @@ -410,6 +410,13 @@ public class CommonServiceImpl implements CommonService { return regionMapper.selectByPrimaryKey(regionId); } + @Override + public List 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); } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighGasDiscountOilPriceServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighGasDiscountOilPriceServiceImpl.java index 549c908e..5de5044a 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighGasDiscountOilPriceServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighGasDiscountOilPriceServiceImpl.java @@ -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; } } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceTaskServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceTaskServiceImpl.java index e01f6f1b..69e845bf 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceTaskServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceTaskServiceImpl.java @@ -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 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")); } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighMerchantAccountServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighMerchantAccountServiceImpl.java new file mode 100644 index 00000000..0e05a400 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/impl/HighMerchantAccountServiceImpl.java @@ -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 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 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> getStoreGasOilAmountByMer(Long merId) { + return merchantAccountMapper.selectStoreGasOilAmountByMer(merId); + } +} diff --git a/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreServiceImpl.java index 268d69ef..a3f15204 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreServiceImpl.java @@ -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")); } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighMerchantTripartitePlatformServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighMerchantTripartitePlatformServiceImpl.java new file mode 100644 index 00000000..00c4f016 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/impl/HighMerchantTripartitePlatformServiceImpl.java @@ -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 list = merchantTripartitePlatformMapper.selectByExample(example); + if (list.size() > 0) { + return list.get(0); + } + return null; + } +} diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOilCardRecordServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOilCardRecordServiceImpl.java index 5c0d2a3c..04311f2a 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOilCardRecordServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOilCardRecordServiceImpl.java @@ -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()); } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java index b267c21f..142dd10a 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java @@ -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); diff --git a/hai-service/src/main/java/com/hai/service/impl/HltUnionCardVipServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HltUnionCardVipServiceImpl.java index e7f4e724..64177692 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HltUnionCardVipServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HltUnionCardVipServiceImpl.java @@ -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天)有效。"); } } diff --git a/hai-service/src/main/java/com/hai/service/impl/OutRechargeChildOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/OutRechargeChildOrderServiceImpl.java index 271e92fe..a636be22 100644 --- a/hai-service/src/main/java/com/hai/service/impl/OutRechargeChildOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/OutRechargeChildOrderServiceImpl.java @@ -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 list = rechargeChildOrderMapper.selectByExample(example); + + if (list.size() > 0 ) { + return list.get(0); + } + return null; } diff --git a/hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java index 8589aa60..33edc812 100644 --- a/hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java @@ -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 getListRechargeOrder(Map 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 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 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 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(); + } + } diff --git a/hai-service/src/main/java/com/hai/service/impl/OutRechargePriceServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/OutRechargePriceServiceImpl.java index e356627e..c91288cc 100644 --- a/hai-service/src/main/java/com/hai/service/impl/OutRechargePriceServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/OutRechargePriceServiceImpl.java @@ -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 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")); diff --git a/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java index ffc16c68..446e9862 100644 --- a/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java @@ -440,35 +440,42 @@ public class GoodsOrderServiceImpl implements PayService { highOrderService.updateOrder(order); - if (order.getHighChildOrderList().get(0).getGoodsType().equals(3)) { - new Thread(() -> { - Map pushMsg = new HashMap<>(); - pushMsg.put("userId", order.getHighChildOrderList().get(0).getGoodsId()); - - Map 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 pushMsg = new HashMap<>(); + pushMsg.put("userId", order.getHighChildOrderList().get(0).getGoodsId()); + + Map 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 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()); diff --git a/hai-service/src/main/java/com/hai/service/pay/impl/RechargeOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/pay/impl/RechargeOrderServiceImpl.java index a9675089..242873dd 100644 --- a/hai-service/src/main/java/com/hai/service/pay/impl/RechargeOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/pay/impl/RechargeOrderServiceImpl.java @@ -55,8 +55,8 @@ public class RechargeOrderServiceImpl implements PayService { @Override - @Transactional(propagation= Propagation.REQUIRES_NEW) public void paySuccess(Map 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); + + } } } diff --git a/hai-service/src/main/resources/dev/commonConfig.properties b/hai-service/src/main/resources/dev/commonConfig.properties index e71ad337..0c763aa3 100644 --- a/hai-service/src/main/resources/dev/commonConfig.properties +++ b/hai-service/src/main/resources/dev/commonConfig.properties @@ -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/ diff --git a/v1/target/classes/application.yml b/v1/target/classes/application.yml new file mode 100644 index 00000000..f0e71e2f --- /dev/null +++ b/v1/target/classes/application.yml @@ -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 diff --git a/v1/target/classes/com/V1Application.class b/v1/target/classes/com/V1Application.class new file mode 100644 index 00000000..ceb0ff8c Binary files /dev/null and b/v1/target/classes/com/V1Application.class differ diff --git a/v1/target/classes/com/v1/config/AuthConfig$1.class b/v1/target/classes/com/v1/config/AuthConfig$1.class new file mode 100644 index 00000000..e3751ab7 Binary files /dev/null and b/v1/target/classes/com/v1/config/AuthConfig$1.class differ diff --git a/v1/target/classes/com/v1/config/AuthConfig.class b/v1/target/classes/com/v1/config/AuthConfig.class new file mode 100644 index 00000000..9ca4e4ac Binary files /dev/null and b/v1/target/classes/com/v1/config/AuthConfig.class differ diff --git a/v1/target/classes/com/v1/config/ConfigListener.class b/v1/target/classes/com/v1/config/ConfigListener.class new file mode 100644 index 00000000..39d84eff Binary files /dev/null and b/v1/target/classes/com/v1/config/ConfigListener.class differ diff --git a/v1/target/classes/com/v1/config/CorsConfig.class b/v1/target/classes/com/v1/config/CorsConfig.class new file mode 100644 index 00000000..b5ba99c5 Binary files /dev/null and b/v1/target/classes/com/v1/config/CorsConfig.class differ diff --git a/v1/target/classes/com/v1/config/MultipartConfig.class b/v1/target/classes/com/v1/config/MultipartConfig.class new file mode 100644 index 00000000..28f5220c Binary files /dev/null and b/v1/target/classes/com/v1/config/MultipartConfig.class differ diff --git a/v1/target/classes/com/v1/config/RedisConfig.class b/v1/target/classes/com/v1/config/RedisConfig.class new file mode 100644 index 00000000..50c73185 Binary files /dev/null and b/v1/target/classes/com/v1/config/RedisConfig.class differ diff --git a/v1/target/classes/com/v1/config/SignatureConfig.class b/v1/target/classes/com/v1/config/SignatureConfig.class new file mode 100644 index 00000000..ef6024ee Binary files /dev/null and b/v1/target/classes/com/v1/config/SignatureConfig.class differ diff --git a/v1/target/classes/com/v1/config/SwaggerConfig.class b/v1/target/classes/com/v1/config/SwaggerConfig.class new file mode 100644 index 00000000..47a2b53b Binary files /dev/null and b/v1/target/classes/com/v1/config/SwaggerConfig.class differ diff --git a/v1/target/classes/com/v1/config/SysConfig.class b/v1/target/classes/com/v1/config/SysConfig.class new file mode 100644 index 00000000..649049a9 Binary files /dev/null and b/v1/target/classes/com/v1/config/SysConfig.class differ diff --git a/v1/target/classes/com/v1/config/SysConst.class b/v1/target/classes/com/v1/config/SysConst.class new file mode 100644 index 00000000..68148cb1 Binary files /dev/null and b/v1/target/classes/com/v1/config/SysConst.class differ diff --git a/v1/target/classes/config.properties b/v1/target/classes/config.properties new file mode 100644 index 00000000..e69de29b diff --git a/v1/target/classes/logback.xml b/v1/target/classes/logback.xml new file mode 100644 index 00000000..a7602e3d --- /dev/null +++ b/v1/target/classes/logback.xml @@ -0,0 +1,72 @@ + + + + + %d %p (%file:%line\)- %m%n + UTF-8 + + + + log/base.log + + log/base.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + log/dao.log + + log/dao.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + log/error.log + + log/error.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + + + + + + + + + + + + diff --git a/v1/target/hai-v1-1.0-SNAPSHOT.jar b/v1/target/hai-v1-1.0-SNAPSHOT.jar new file mode 100644 index 00000000..07d2a24d Binary files /dev/null and b/v1/target/hai-v1-1.0-SNAPSHOT.jar differ diff --git a/v1/target/hai-v1-1.0-SNAPSHOT.jar.original b/v1/target/hai-v1-1.0-SNAPSHOT.jar.original new file mode 100644 index 00000000..bedf98de Binary files /dev/null and b/v1/target/hai-v1-1.0-SNAPSHOT.jar.original differ diff --git a/v1/target/maven-archiver/pom.properties b/v1/target/maven-archiver/pom.properties new file mode 100644 index 00000000..5dc4b086 --- /dev/null +++ b/v1/target/maven-archiver/pom.properties @@ -0,0 +1,4 @@ +#Created by Apache Maven 3.8.2 +version=1.0-SNAPSHOT +groupId=com.hgj +artifactId=hai-v1 diff --git a/v1/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/v1/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 00000000..896eace6 --- /dev/null +++ b/v1/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -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 diff --git a/v1/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/v1/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 00000000..d4372d21 --- /dev/null +++ b/v1/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -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 diff --git a/v1/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/v1/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst new file mode 100644 index 00000000..e69de29b