diff --git a/bweb/src/main/java/com/bweb/controller/BsRebateRewardController.java b/bweb/src/main/java/com/bweb/controller/BsRebateRewardController.java index d099b65..29f7419 100644 --- a/bweb/src/main/java/com/bweb/controller/BsRebateRewardController.java +++ b/bweb/src/main/java/com/bweb/controller/BsRebateRewardController.java @@ -147,7 +147,9 @@ public class BsRebateRewardController { // 上传华为云 OBS HuaWeiYunObs.obsUtilPutObject(CommonSysConst.getSysConfig().getFilesystem() + "/" + childPath + fileName, HuaWeiYunObs.bucketName, childPath + fileName); - return ResponseMsgUtil.success(fileName); + + String fileUrl = CommonSysConst.getSysConfig().getObs_url() + "/"+ childPath + fileName; + return ResponseMsgUtil.success(fileUrl); } catch (Exception e) { log.error(e.getMessage(), e); diff --git a/cweb/src/main/java/com/cweb/controller/BsRebateActivityController.java b/cweb/src/main/java/com/cweb/controller/BsRebateActivityController.java index 8631e23..90695eb 100644 --- a/cweb/src/main/java/com/cweb/controller/BsRebateActivityController.java +++ b/cweb/src/main/java/com/cweb/controller/BsRebateActivityController.java @@ -14,10 +14,7 @@ import com.hfkj.model.ResponseData; import com.hfkj.service.BsMerService; import com.hfkj.service.rebate.BsRebateActivityAccountService; import com.hfkj.service.rebate.BsRebateActivityService; -import com.hfkj.sysenum.RebateActivityPartakeTypeEnum; -import com.hfkj.sysenum.RebateActivityPreferentialTypeEnum; -import com.hfkj.sysenum.RebateActivityStatusEnum; -import com.hfkj.sysenum.RebateActivityTypeEnum; +import com.hfkj.sysenum.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; @@ -76,7 +73,7 @@ public class BsRebateActivityController { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的优惠类型"); } // 满减条件 - if (preferentialType.getNumber().equals(RebateActivityPreferentialTypeEnum.type2.getNumber()) + if (preferentialType.getNumber().equals(RebateActivityPreferentialTypeEnum.type1.getNumber()) && body.getBigDecimal("condition") == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "满减类型未设置满减条件"); } @@ -145,7 +142,7 @@ public class BsRebateActivityController { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的优惠类型"); } // 满减条件 - if (preferentialType.getNumber().equals(RebateActivityPreferentialTypeEnum.type3.getNumber()) + if (preferentialType.getNumber().equals(RebateActivityPreferentialTypeEnum.type1.getNumber()) && body.getBigDecimal("condition") == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "满减类型未设置满减条件"); } @@ -211,7 +208,7 @@ public class BsRebateActivityController { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } - rebateActivityService.closeActivity(body.getString("activityNo")); + rebateActivityService.closeActivity(body.getString("activityNo"), RebateActivityEndTypeEnum.type2); return ResponseMsgUtil.success("操作成功"); diff --git a/cweb/src/main/java/com/cweb/controller/BsTradeOrderController.java b/cweb/src/main/java/com/cweb/controller/BsTradeOrderController.java index 47ecea5..e0b9983 100644 --- a/cweb/src/main/java/com/cweb/controller/BsTradeOrderController.java +++ b/cweb/src/main/java/com/cweb/controller/BsTradeOrderController.java @@ -192,27 +192,6 @@ public class BsTradeOrderController { } } - @RequestMapping(value="/cancelOrder",method = RequestMethod.POST) - @ResponseBody - @ApiOperation(value = "取消交易订单") - public ResponseData cancelOrder(@RequestBody JSONObject body, HttpServletRequest request) { - try { - if (body == null || StringUtils.isBlank(body.getString("outTradeNo"))) { - log.error("configStore error!", "参数错误"); - throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); - } - - // 取消交易订单 - tradeOrderService.cancelOrder(body.getString("outTradeNo")); - - return ResponseMsgUtil.success("操作成功"); - - } catch (Exception e) { - log.error(e.getMessage(), e); - return ResponseMsgUtil.exception(e); - } - } - @RequestMapping(value="/createJSAPIOrder",method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "创建交易【JSAPI】订单") @@ -324,6 +303,27 @@ public class BsTradeOrderController { } } + @RequestMapping(value="/cancelOrder",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "取消交易订单") + public ResponseData cancelOrder(@RequestBody JSONObject body, HttpServletRequest request) { + try { + if (body == null || StringUtils.isBlank(body.getString("outTradeNo"))) { + log.error("configStore error!", "参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + // 取消交易订单 + tradeOrderService.cancelOrder(body.getString("outTradeNo")); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + } + @RequestMapping(value="/getOrderByOutTradeOrder",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "根据交易订单号 查询订单信息") diff --git a/cweb/src/main/java/com/cweb/controller/TestController.java b/cweb/src/main/java/com/cweb/controller/TestController.java index a5197a9..a677ecd 100644 --- a/cweb/src/main/java/com/cweb/controller/TestController.java +++ b/cweb/src/main/java/com/cweb/controller/TestController.java @@ -284,14 +284,10 @@ public class TestController { System.out.println("order:" + orderNo); // return ResponseMsgUtil.success(tianQueFundManageService.orgTransfer("399230906938051",orderNo,new BigDecimal("0.01"), "测试", "01")); List merId = new ArrayList<>(); - merId.add(78L); - merId.add(135L); - merId.add(160L); - merId.add(157L); - merId.add(53L); - merId.add(288L); - - /* for (Long id : merId) { + merId.add(51L); + merId.add(61L); + + for (Long id : merId) { BsMer mer = merService.getMer(id); BsRebateMerAccount rebateMerAccount = new BsRebateMerAccount(); rebateMerAccount.setAccountNumber(System.currentTimeMillis()); @@ -301,9 +297,10 @@ public class TestController { rebateMerAccount.setMerName(mer.getMerName()); rebateMerAccount.setMerAbbreviate(mer.getMerAbbreviate()); rebateMerAccountService.editData(rebateMerAccount); - }*/ + } + - // rebateRewardService.createReward(new Date(1693497600000L), new Date(1696089599000L), merId); + rebateRewardService.createReward(new Date(1680278400000L), new Date(1696089600000L), merId); // rebateRewardService.grantReward(202310111953L); /* diff --git a/schedule/src/main/java/com/hfkj/schedule/RebateActivitySchedule.java b/schedule/src/main/java/com/hfkj/schedule/RebateActivitySchedule.java new file mode 100644 index 0000000..8bba8d1 --- /dev/null +++ b/schedule/src/main/java/com/hfkj/schedule/RebateActivitySchedule.java @@ -0,0 +1,53 @@ +package com.hfkj.schedule; + +import com.hfkj.entity.BsRebateActivity; +import com.hfkj.entity.BsTradeOrder; +import com.hfkj.service.rebate.BsRebateActivityService; +import com.hfkj.sysenum.RebateActivityEndTypeEnum; +import com.hfkj.sysenum.RebateActivityStatusEnum; +import com.hfkj.sysenum.TradeOrderCreateTypeEnum; +import com.hfkj.sysenum.TradeOrderStatusEnum; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.Scheduled; + +import javax.annotation.Resource; +import java.util.*; + +/** + * @className: RebateActivitySchedule + * @author: HuRui + * @date: 2023/10/27 + **/ +@Configuration +public class RebateActivitySchedule { + + private static final Logger log = LoggerFactory.getLogger(RebateActivitySchedule.class); + + @Resource + private BsRebateActivityService rebateActivityService; + + /** + * 取消订单 + * 1分钟扫描一次 + */ + @Scheduled(cron="0 0/1 * * * ?") + public void endActivity() { + Map param = new HashMap<>(); + param.put("endTimeE", new Date().getTime()); + param.put("status", RebateActivityStatusEnum.status2.getNumber()); + + List activityList = rebateActivityService.getActivityList(param); + for (BsRebateActivity activity : activityList) { + try { + + // 关闭活动 + rebateActivityService.closeActivity(activity.getActivityNo(), RebateActivityEndTypeEnum.type1); + + } catch (Exception e) { + + } + } + } +} diff --git a/schedule/src/main/java/com/hfkj/schedule/TradeOrderSchedule.java b/schedule/src/main/java/com/hfkj/schedule/TradeOrderSchedule.java index 1e8e664..5bb99c0 100644 --- a/schedule/src/main/java/com/hfkj/schedule/TradeOrderSchedule.java +++ b/schedule/src/main/java/com/hfkj/schedule/TradeOrderSchedule.java @@ -50,6 +50,31 @@ public class TradeOrderSchedule { @Resource private BsTradeSettleService tradeSettleService; + /** + * 取消订单 + * 1分钟扫描一次 + */ + @Scheduled(cron="0 0/1 * * * ?") + public void cancelOrder() { + Calendar createTime = Calendar.getInstance(); + createTime.add(Calendar.MINUTE, -10); + + Map param = new HashMap<>(); + param.put("createTimeS", createTime.getTimeInMillis()); + param.put("status", TradeOrderStatusEnum.status1.getNumber()); + param.put("createType", TradeOrderCreateTypeEnum.type1.getCode()); + List orderList = tradeOrderService.getTradeOrderList(param); + for (BsTradeOrder tradeOrder : orderList) { + try { + // 取消订单 + tradeOrderService.cancelOrder(tradeOrder.getOutTradeNo()); + + } catch (Exception e) { + + } + } + } + /** * 订单发起分账 * 5分钟扫描一次需要分账的订单 diff --git a/schedule/src/main/java/com/hfkj/schedule/TransferSchedule.java b/schedule/src/main/java/com/hfkj/schedule/TransferSchedule.java new file mode 100644 index 0000000..8c9ad95 --- /dev/null +++ b/schedule/src/main/java/com/hfkj/schedule/TransferSchedule.java @@ -0,0 +1,123 @@ +package com.hfkj.schedule; + +import com.alibaba.fastjson.JSONObject; +import com.hfkj.channel.tianque.service.TianQueFundManageService; +import com.hfkj.common.utils.DateUtil; +import com.hfkj.entity.*; +import com.hfkj.service.BsMerService; +import com.hfkj.service.BsTransferAccountsService; +import com.hfkj.service.rebate.BsRebateTransferCycleService; +import com.hfkj.sysenum.TransferAccountsStatus; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.util.StringUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.Scheduled; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.util.*; + +/** + * @className: TransferSchedule + * @author: HuRui + * @date: 2023/10/26 + **/ +@Configuration +public class TransferSchedule { + + private static final Logger log = LoggerFactory.getLogger(TransferSchedule.class); + + @Resource + private BsTransferAccountsService transferAccountsService; + + @Resource + private BsRebateTransferCycleService rebateTransferCycleService; + + @Resource + private TianQueFundManageService tianQueFundManageService; + + @Resource + private BsMerService merService; + + /** + * 转账结果更新 + */ + @Scheduled(cron="0 0/1 * * * ?") //每1分钟执行 + public void transferResult() { + Map param = new HashMap<>(); + param.put("status", TransferAccountsStatus.status1.getNumber()); + List list = transferAccountsService.getList(param); + for (BsTransferAccounts transferAccounts : list) { + try { + // 转账结果查询 + JSONObject transferInfo = tianQueFundManageService.getTransferInfo(transferAccounts.getOrderNo()); + if (StringUtils.isNotBlank(transferInfo.getString("rate"))) { + transferAccounts.setShdFeeAmt(new BigDecimal(transferInfo.getString("rate"))); + } + // 转账状态,枚举值 + // 00:成功 + // 01:失败 + // 02:异常 + if (transferInfo.getString("tranStatus").equals("00")) { + transferAccounts.setStatus(TransferAccountsStatus.status2.getNumber()); + } else if (transferInfo.getString("tranStatus").equals("01")) { + transferAccounts.setStatus(TransferAccountsStatus.status3.getNumber()); + } else if (transferInfo.getString("tranStatus").equals("02")) { + transferAccounts.setStatus(TransferAccountsStatus.status4.getNumber()); + } + transferAccountsService.editData(transferAccounts); + } catch (Exception e) { + System.out.println("转账结果查询失败"); + } + } + } + + /** + * 活动金返利转账 + */ + @Scheduled(cron = "0 0 1 * * ?") // 每日凌晨1点执行 + public void tradeRebate() { + Calendar startTime = Calendar.getInstance(); + startTime.setTime(new Date()); + startTime.add(Calendar.DAY_OF_MONTH, -1); + startTime.set(Calendar.HOUR_OF_DAY, 00); + startTime.set(Calendar.MINUTE, 00); + startTime.set(Calendar.SECOND, 00); + + Calendar endTime = Calendar.getInstance(); + startTime.add(Calendar.DAY_OF_MONTH, -1); + endTime.setTime(new Date()); + endTime.set(Calendar.HOUR_OF_DAY, 00); + endTime.set(Calendar.MINUTE, 00); + endTime.set(Calendar.SECOND, 00); + + BsRebateTransferCycle transferCycle = new BsRebateTransferCycle(); + transferCycle.setBatchIdentifier(DateUtil.date2String(startTime.getTime(),"yyyyMMdd") + (new Random().nextInt(8999) + 1000)); + transferCycle.setStartTime(startTime.getTime()); + transferCycle.setEndTime(endTime.getTime()); + rebateTransferCycleService.editData(transferCycle); + + List> list = transferAccountsService.getTradeRebate(startTime.getTime(), endTime.getTime()); + for (Map param : list) { + try { + BsMer mer = merService.getMer(MapUtils.getString(param, "merNo")); + if (mer == null) { + BsTransferAccounts transferAccounts = new BsTransferAccounts(); + transferAccounts.setMerId(mer.getId()); + transferAccounts.setMerNo(mer.getMerNo()); + transferAccounts.setMerName(mer.getMerName()); + transferAccounts.setMerAbbreviate(mer.getMerAbbreviate()); + transferAccounts.setOrderNo("1000"+System.currentTimeMillis()+""); + transferAccounts.setAmount(new BigDecimal(MapUtils.getString(param, "totalPrice"))); + transferAccounts.setRebateTransferCycleIdentifier(transferCycle.getId()); + transferAccountsService.transfer(transferAccounts); + } + } catch (Exception e) { + System.out.println("转账失败"); + } + } + } +} diff --git a/service/src/main/java/com/hfkj/dao/BsRebateActivityMapper.java b/service/src/main/java/com/hfkj/dao/BsRebateActivityMapper.java index c2e2f94..8b43a9e 100644 --- a/service/src/main/java/com/hfkj/dao/BsRebateActivityMapper.java +++ b/service/src/main/java/com/hfkj/dao/BsRebateActivityMapper.java @@ -46,9 +46,9 @@ public interface BsRebateActivityMapper extends BsRebateActivityMapperExt { "price, restrict_partake_type, ", "restrict_partake_num, start_time, ", "end_time, reality_end_time, ", - "`status`, create_time, ", - "update_time, ext_1, ", - "ext_2, ext_3)", + "reality_end_type, `status`, ", + "create_time, update_time, ", + "ext_1, ext_2, ext_3)", "values (#{merId,jdbcType=BIGINT}, #{merNo,jdbcType=VARCHAR}, ", "#{merName,jdbcType=VARCHAR}, #{merAbbreviate,jdbcType=VARCHAR}, ", "#{activityNo,jdbcType=VARCHAR}, #{activityType,jdbcType=INTEGER}, ", @@ -56,9 +56,9 @@ public interface BsRebateActivityMapper extends BsRebateActivityMapperExt { "#{price,jdbcType=DECIMAL}, #{restrictPartakeType,jdbcType=INTEGER}, ", "#{restrictPartakeNum,jdbcType=INTEGER}, #{startTime,jdbcType=TIMESTAMP}, ", "#{endTime,jdbcType=TIMESTAMP}, #{realityEndTime,jdbcType=TIMESTAMP}, ", - "#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", - "#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", - "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + "#{realityEndType,jdbcType=INTEGER}, #{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(BsRebateActivity record); @@ -84,6 +84,7 @@ public interface BsRebateActivityMapper extends BsRebateActivityMapperExt { @Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="reality_end_time", property="realityEndTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="reality_end_type", property="realityEndType", jdbcType=JdbcType.INTEGER), @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), @@ -97,8 +98,8 @@ public interface BsRebateActivityMapper extends BsRebateActivityMapperExt { "select", "id, mer_id, mer_no, mer_name, mer_abbreviate, activity_no, activity_type, preferential_type, ", "`condition`, price, restrict_partake_type, restrict_partake_num, start_time, ", - "end_time, reality_end_time, `status`, create_time, update_time, ext_1, ext_2, ", - "ext_3", + "end_time, reality_end_time, reality_end_type, `status`, create_time, update_time, ", + "ext_1, ext_2, ext_3", "from bs_rebate_activity", "where id = #{id,jdbcType=BIGINT}" }) @@ -118,6 +119,7 @@ public interface BsRebateActivityMapper extends BsRebateActivityMapperExt { @Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="reality_end_time", property="realityEndTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="reality_end_type", property="realityEndType", jdbcType=JdbcType.INTEGER), @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), @@ -152,6 +154,7 @@ public interface BsRebateActivityMapper extends BsRebateActivityMapperExt { "start_time = #{startTime,jdbcType=TIMESTAMP},", "end_time = #{endTime,jdbcType=TIMESTAMP},", "reality_end_time = #{realityEndTime,jdbcType=TIMESTAMP},", + "reality_end_type = #{realityEndType,jdbcType=INTEGER},", "`status` = #{status,jdbcType=INTEGER},", "create_time = #{createTime,jdbcType=TIMESTAMP},", "update_time = #{updateTime,jdbcType=TIMESTAMP},", diff --git a/service/src/main/java/com/hfkj/dao/BsRebateActivitySqlProvider.java b/service/src/main/java/com/hfkj/dao/BsRebateActivitySqlProvider.java index b865b44..2f43b24 100644 --- a/service/src/main/java/com/hfkj/dao/BsRebateActivitySqlProvider.java +++ b/service/src/main/java/com/hfkj/dao/BsRebateActivitySqlProvider.java @@ -84,6 +84,10 @@ public class BsRebateActivitySqlProvider { sql.VALUES("reality_end_time", "#{realityEndTime,jdbcType=TIMESTAMP}"); } + if (record.getRealityEndType() != null) { + sql.VALUES("reality_end_type", "#{realityEndType,jdbcType=INTEGER}"); + } + if (record.getStatus() != null) { sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); } @@ -132,6 +136,7 @@ public class BsRebateActivitySqlProvider { sql.SELECT("start_time"); sql.SELECT("end_time"); sql.SELECT("reality_end_time"); + sql.SELECT("reality_end_type"); sql.SELECT("`status`"); sql.SELECT("create_time"); sql.SELECT("update_time"); @@ -215,6 +220,10 @@ public class BsRebateActivitySqlProvider { sql.SET("reality_end_time = #{record.realityEndTime,jdbcType=TIMESTAMP}"); } + if (record.getRealityEndType() != null) { + sql.SET("reality_end_type = #{record.realityEndType,jdbcType=INTEGER}"); + } + if (record.getStatus() != null) { sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); } @@ -262,6 +271,7 @@ public class BsRebateActivitySqlProvider { sql.SET("start_time = #{record.startTime,jdbcType=TIMESTAMP}"); sql.SET("end_time = #{record.endTime,jdbcType=TIMESTAMP}"); sql.SET("reality_end_time = #{record.realityEndTime,jdbcType=TIMESTAMP}"); + sql.SET("reality_end_type = #{record.realityEndType,jdbcType=INTEGER}"); sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); @@ -334,6 +344,10 @@ public class BsRebateActivitySqlProvider { sql.SET("reality_end_time = #{realityEndTime,jdbcType=TIMESTAMP}"); } + if (record.getRealityEndType() != null) { + sql.SET("reality_end_type = #{realityEndType,jdbcType=INTEGER}"); + } + if (record.getStatus() != null) { sql.SET("`status` = #{status,jdbcType=INTEGER}"); } diff --git a/service/src/main/java/com/hfkj/dao/BsRebateTransferCycleMapper.java b/service/src/main/java/com/hfkj/dao/BsRebateTransferCycleMapper.java new file mode 100644 index 0000000..f614d26 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsRebateTransferCycleMapper.java @@ -0,0 +1,117 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsRebateTransferCycle; +import com.hfkj.entity.BsRebateTransferCycleExample; +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 BsRebateTransferCycleMapper extends BsRebateTransferCycleMapperExt { + @SelectProvider(type=BsRebateTransferCycleSqlProvider.class, method="countByExample") + long countByExample(BsRebateTransferCycleExample example); + + @DeleteProvider(type=BsRebateTransferCycleSqlProvider.class, method="deleteByExample") + int deleteByExample(BsRebateTransferCycleExample example); + + @Delete({ + "delete from bs_rebate_transfer_cycle", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into bs_rebate_transfer_cycle (batch_identifier, start_time, ", + "end_time, `status`, ", + "create_time, update_time, ", + "ext_1, ext_2, ext_3)", + "values (#{batchIdentifier,jdbcType=VARCHAR}, #{startTime,jdbcType=TIMESTAMP}, ", + "#{endTime,jdbcType=TIMESTAMP}, #{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(BsRebateTransferCycle record); + + @InsertProvider(type=BsRebateTransferCycleSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(BsRebateTransferCycle record); + + @SelectProvider(type=BsRebateTransferCycleSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="batch_identifier", property="batchIdentifier", jdbcType=JdbcType.VARCHAR), + @Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP), + @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(BsRebateTransferCycleExample example); + + @Select({ + "select", + "id, batch_identifier, start_time, end_time, `status`, create_time, update_time, ", + "ext_1, ext_2, ext_3", + "from bs_rebate_transfer_cycle", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="batch_identifier", property="batchIdentifier", jdbcType=JdbcType.VARCHAR), + @Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP), + @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) + }) + BsRebateTransferCycle selectByPrimaryKey(Long id); + + @UpdateProvider(type=BsRebateTransferCycleSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") BsRebateTransferCycle record, @Param("example") BsRebateTransferCycleExample example); + + @UpdateProvider(type=BsRebateTransferCycleSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") BsRebateTransferCycle record, @Param("example") BsRebateTransferCycleExample example); + + @UpdateProvider(type=BsRebateTransferCycleSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(BsRebateTransferCycle record); + + @Update({ + "update bs_rebate_transfer_cycle", + "set batch_identifier = #{batchIdentifier,jdbcType=VARCHAR},", + "start_time = #{startTime,jdbcType=TIMESTAMP},", + "end_time = #{endTime,jdbcType=TIMESTAMP},", + "`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(BsRebateTransferCycle record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsRebateTransferCycleMapperExt.java b/service/src/main/java/com/hfkj/dao/BsRebateTransferCycleMapperExt.java new file mode 100644 index 0000000..6c8f520 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsRebateTransferCycleMapperExt.java @@ -0,0 +1,7 @@ +package com.hfkj.dao; + +/** + * mapper扩展类 + */ +public interface BsRebateTransferCycleMapperExt { +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsRebateTransferCycleSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsRebateTransferCycleSqlProvider.java new file mode 100644 index 0000000..9875e9c --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsRebateTransferCycleSqlProvider.java @@ -0,0 +1,304 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsRebateTransferCycle; +import com.hfkj.entity.BsRebateTransferCycleExample.Criteria; +import com.hfkj.entity.BsRebateTransferCycleExample.Criterion; +import com.hfkj.entity.BsRebateTransferCycleExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class BsRebateTransferCycleSqlProvider { + + public String countByExample(BsRebateTransferCycleExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("bs_rebate_transfer_cycle"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(BsRebateTransferCycleExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("bs_rebate_transfer_cycle"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(BsRebateTransferCycle record) { + SQL sql = new SQL(); + sql.INSERT_INTO("bs_rebate_transfer_cycle"); + + if (record.getBatchIdentifier() != null) { + sql.VALUES("batch_identifier", "#{batchIdentifier,jdbcType=VARCHAR}"); + } + + if (record.getStartTime() != null) { + sql.VALUES("start_time", "#{startTime,jdbcType=TIMESTAMP}"); + } + + if (record.getEndTime() != null) { + sql.VALUES("end_time", "#{endTime,jdbcType=TIMESTAMP}"); + } + + 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(BsRebateTransferCycleExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("batch_identifier"); + sql.SELECT("start_time"); + sql.SELECT("end_time"); + sql.SELECT("`status`"); + sql.SELECT("create_time"); + sql.SELECT("update_time"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("bs_rebate_transfer_cycle"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + BsRebateTransferCycle record = (BsRebateTransferCycle) parameter.get("record"); + BsRebateTransferCycleExample example = (BsRebateTransferCycleExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("bs_rebate_transfer_cycle"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getBatchIdentifier() != null) { + sql.SET("batch_identifier = #{record.batchIdentifier,jdbcType=VARCHAR}"); + } + + if (record.getStartTime() != null) { + sql.SET("start_time = #{record.startTime,jdbcType=TIMESTAMP}"); + } + + if (record.getEndTime() != null) { + sql.SET("end_time = #{record.endTime,jdbcType=TIMESTAMP}"); + } + + 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("bs_rebate_transfer_cycle"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("batch_identifier = #{record.batchIdentifier,jdbcType=VARCHAR}"); + sql.SET("start_time = #{record.startTime,jdbcType=TIMESTAMP}"); + sql.SET("end_time = #{record.endTime,jdbcType=TIMESTAMP}"); + 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}"); + + BsRebateTransferCycleExample example = (BsRebateTransferCycleExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(BsRebateTransferCycle record) { + SQL sql = new SQL(); + sql.UPDATE("bs_rebate_transfer_cycle"); + + if (record.getBatchIdentifier() != null) { + sql.SET("batch_identifier = #{batchIdentifier,jdbcType=VARCHAR}"); + } + + if (record.getStartTime() != null) { + sql.SET("start_time = #{startTime,jdbcType=TIMESTAMP}"); + } + + if (record.getEndTime() != null) { + sql.SET("end_time = #{endTime,jdbcType=TIMESTAMP}"); + } + + 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, BsRebateTransferCycleExample 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/service/src/main/java/com/hfkj/dao/BsTransferAccountsMapper.java b/service/src/main/java/com/hfkj/dao/BsTransferAccountsMapper.java index 70dd888..a4e9036 100644 --- a/service/src/main/java/com/hfkj/dao/BsTransferAccountsMapper.java +++ b/service/src/main/java/com/hfkj/dao/BsTransferAccountsMapper.java @@ -47,8 +47,8 @@ public interface BsTransferAccountsMapper extends BsTransferAccountsMapperExt { "settle_date, content, ", "`status`, transfer_time, ", "create_time, create_type, ", - "update_time, ext_1, ", - "ext_2, ext_3)", + "update_time, rebate_transfer_cycle_identifier, ", + "ext_1, ext_2, ext_3)", "values (#{merId,jdbcType=BIGINT}, #{merNo,jdbcType=VARCHAR}, ", "#{merName,jdbcType=VARCHAR}, #{merAbbreviate,jdbcType=VARCHAR}, ", "#{orderNo,jdbcType=VARCHAR}, #{platformOrderNo,jdbcType=VARCHAR}, ", @@ -57,8 +57,8 @@ public interface BsTransferAccountsMapper extends BsTransferAccountsMapperExt { "#{settleDate,jdbcType=DATE}, #{content,jdbcType=VARCHAR}, ", "#{status,jdbcType=INTEGER}, #{transferTime,jdbcType=TIMESTAMP}, ", "#{createTime,jdbcType=TIMESTAMP}, #{createType,jdbcType=INTEGER}, ", - "#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", - "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + "#{updateTime,jdbcType=TIMESTAMP}, #{rebateTransferCycleIdentifier,jdbcType=BIGINT}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(BsTransferAccounts record); @@ -87,6 +87,7 @@ public interface BsTransferAccountsMapper extends BsTransferAccountsMapperExt { @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="create_type", property="createType", jdbcType=JdbcType.INTEGER), @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="rebate_transfer_cycle_identifier", property="rebateTransferCycleIdentifier", jdbcType=JdbcType.BIGINT), @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) @@ -97,7 +98,8 @@ public interface BsTransferAccountsMapper extends BsTransferAccountsMapperExt { "select", "id, mer_id, mer_no, mer_name, mer_abbreviate, order_no, platform_order_no, receiver_platform_type, ", "receiver_platform_no, amount, shd_fee_amt, settle_date, content, `status`, transfer_time, ", - "create_time, create_type, update_time, ext_1, ext_2, ext_3", + "create_time, create_type, update_time, rebate_transfer_cycle_identifier, ext_1, ", + "ext_2, ext_3", "from bs_transfer_accounts", "where id = #{id,jdbcType=BIGINT}" }) @@ -120,6 +122,7 @@ public interface BsTransferAccountsMapper extends BsTransferAccountsMapperExt { @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="create_type", property="createType", jdbcType=JdbcType.INTEGER), @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="rebate_transfer_cycle_identifier", property="rebateTransferCycleIdentifier", jdbcType=JdbcType.BIGINT), @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) @@ -154,6 +157,7 @@ public interface BsTransferAccountsMapper extends BsTransferAccountsMapperExt { "create_time = #{createTime,jdbcType=TIMESTAMP},", "create_type = #{createType,jdbcType=INTEGER},", "update_time = #{updateTime,jdbcType=TIMESTAMP},", + "rebate_transfer_cycle_identifier = #{rebateTransferCycleIdentifier,jdbcType=BIGINT},", "ext_1 = #{ext1,jdbcType=VARCHAR},", "ext_2 = #{ext2,jdbcType=VARCHAR},", "ext_3 = #{ext3,jdbcType=VARCHAR}", diff --git a/service/src/main/java/com/hfkj/dao/BsTransferAccountsMapperExt.java b/service/src/main/java/com/hfkj/dao/BsTransferAccountsMapperExt.java index 81e160a..319cbf6 100644 --- a/service/src/main/java/com/hfkj/dao/BsTransferAccountsMapperExt.java +++ b/service/src/main/java/com/hfkj/dao/BsTransferAccountsMapperExt.java @@ -1,7 +1,23 @@ package com.hfkj.dao; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; +import java.util.Map; + /** * mapper扩展类 */ public interface BsTransferAccountsMapperExt { -} \ No newline at end of file + + @Select(" SELECT mer_no merNo," + + " sum(rebate_activity_actual_price) totalPrice " + + " FROM bs_trade_order where rebate_activity_part = 1 " + + " = #{startTimeS} ]]>" + + " " + + " and `status` = 3" + + " GROUP BY mer_no") + List> queryTradeRebate(@Param("startTimeS") String startTime, @Param("endTime") String endTime); + +} diff --git a/service/src/main/java/com/hfkj/dao/BsTransferAccountsSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsTransferAccountsSqlProvider.java index 9810762..63d1976 100644 --- a/service/src/main/java/com/hfkj/dao/BsTransferAccountsSqlProvider.java +++ b/service/src/main/java/com/hfkj/dao/BsTransferAccountsSqlProvider.java @@ -96,6 +96,10 @@ public class BsTransferAccountsSqlProvider { sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); } + if (record.getRebateTransferCycleIdentifier() != null) { + sql.VALUES("rebate_transfer_cycle_identifier", "#{rebateTransferCycleIdentifier,jdbcType=BIGINT}"); + } + if (record.getExt1() != null) { sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); } @@ -135,6 +139,7 @@ public class BsTransferAccountsSqlProvider { sql.SELECT("create_time"); sql.SELECT("create_type"); sql.SELECT("update_time"); + sql.SELECT("rebate_transfer_cycle_identifier"); sql.SELECT("ext_1"); sql.SELECT("ext_2"); sql.SELECT("ext_3"); @@ -227,6 +232,10 @@ public class BsTransferAccountsSqlProvider { sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); } + if (record.getRebateTransferCycleIdentifier() != null) { + sql.SET("rebate_transfer_cycle_identifier = #{record.rebateTransferCycleIdentifier,jdbcType=BIGINT}"); + } + if (record.getExt1() != null) { sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); } @@ -265,6 +274,7 @@ public class BsTransferAccountsSqlProvider { sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); sql.SET("create_type = #{record.createType,jdbcType=INTEGER}"); sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); + sql.SET("rebate_transfer_cycle_identifier = #{record.rebateTransferCycleIdentifier,jdbcType=BIGINT}"); sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); @@ -346,6 +356,10 @@ public class BsTransferAccountsSqlProvider { sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); } + if (record.getRebateTransferCycleIdentifier() != null) { + sql.SET("rebate_transfer_cycle_identifier = #{rebateTransferCycleIdentifier,jdbcType=BIGINT}"); + } + if (record.getExt1() != null) { sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); } diff --git a/service/src/main/java/com/hfkj/entity/BsRebateActivity.java b/service/src/main/java/com/hfkj/entity/BsRebateActivity.java index ab37bc0..15fbcfb 100644 --- a/service/src/main/java/com/hfkj/entity/BsRebateActivity.java +++ b/service/src/main/java/com/hfkj/entity/BsRebateActivity.java @@ -89,6 +89,11 @@ public class BsRebateActivity implements Serializable { */ private Date realityEndTime; + /** + * 活动结束方式 1:系统自动 2:手动 + */ + private Integer realityEndType; + /** * 状态 0:不可用 1:编辑中 2:进行中 3:已结束 */ @@ -110,18 +115,18 @@ public class BsRebateActivity implements Serializable { private String ext3; + private static final long serialVersionUID = 1L; + private String endTimeStr; + private BsRebateActivityAccount activityAccount; + public String getEndTimeStr() { return endTimeStr; } - public void setEndTimeStr(String endTimeStr) { this.endTimeStr = endTimeStr; } - - private BsRebateActivityAccount activityAccount; - public BsRebateActivityAccount getActivityAccount() { return activityAccount; } @@ -129,9 +134,6 @@ public class BsRebateActivity implements Serializable { public void setActivityAccount(BsRebateActivityAccount activityAccount) { this.activityAccount = activityAccount; } - - private static final long serialVersionUID = 1L; - public Long getId() { return id; } @@ -252,6 +254,14 @@ public class BsRebateActivity implements Serializable { this.realityEndTime = realityEndTime; } + public Integer getRealityEndType() { + return realityEndType; + } + + public void setRealityEndType(Integer realityEndType) { + this.realityEndType = realityEndType; + } + public Integer getStatus() { return status; } @@ -327,6 +337,7 @@ public class BsRebateActivity implements Serializable { && (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime())) && (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime())) && (this.getRealityEndTime() == null ? other.getRealityEndTime() == null : this.getRealityEndTime().equals(other.getRealityEndTime())) + && (this.getRealityEndType() == null ? other.getRealityEndType() == null : this.getRealityEndType().equals(other.getRealityEndType())) && (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())) @@ -354,6 +365,7 @@ public class BsRebateActivity implements Serializable { result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode()); result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode()); result = prime * result + ((getRealityEndTime() == null) ? 0 : getRealityEndTime().hashCode()); + result = prime * result + ((getRealityEndType() == null) ? 0 : getRealityEndType().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()); @@ -384,6 +396,7 @@ public class BsRebateActivity implements Serializable { sb.append(", startTime=").append(startTime); sb.append(", endTime=").append(endTime); sb.append(", realityEndTime=").append(realityEndTime); + sb.append(", realityEndType=").append(realityEndType); sb.append(", status=").append(status); sb.append(", createTime=").append(createTime); sb.append(", updateTime=").append(updateTime); diff --git a/service/src/main/java/com/hfkj/entity/BsRebateActivityExample.java b/service/src/main/java/com/hfkj/entity/BsRebateActivityExample.java index 3ec863e..b752da5 100644 --- a/service/src/main/java/com/hfkj/entity/BsRebateActivityExample.java +++ b/service/src/main/java/com/hfkj/entity/BsRebateActivityExample.java @@ -1066,6 +1066,66 @@ public class BsRebateActivityExample { return (Criteria) this; } + public Criteria andRealityEndTypeIsNull() { + addCriterion("reality_end_type is null"); + return (Criteria) this; + } + + public Criteria andRealityEndTypeIsNotNull() { + addCriterion("reality_end_type is not null"); + return (Criteria) this; + } + + public Criteria andRealityEndTypeEqualTo(Integer value) { + addCriterion("reality_end_type =", value, "realityEndType"); + return (Criteria) this; + } + + public Criteria andRealityEndTypeNotEqualTo(Integer value) { + addCriterion("reality_end_type <>", value, "realityEndType"); + return (Criteria) this; + } + + public Criteria andRealityEndTypeGreaterThan(Integer value) { + addCriterion("reality_end_type >", value, "realityEndType"); + return (Criteria) this; + } + + public Criteria andRealityEndTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("reality_end_type >=", value, "realityEndType"); + return (Criteria) this; + } + + public Criteria andRealityEndTypeLessThan(Integer value) { + addCriterion("reality_end_type <", value, "realityEndType"); + return (Criteria) this; + } + + public Criteria andRealityEndTypeLessThanOrEqualTo(Integer value) { + addCriterion("reality_end_type <=", value, "realityEndType"); + return (Criteria) this; + } + + public Criteria andRealityEndTypeIn(List values) { + addCriterion("reality_end_type in", values, "realityEndType"); + return (Criteria) this; + } + + public Criteria andRealityEndTypeNotIn(List values) { + addCriterion("reality_end_type not in", values, "realityEndType"); + return (Criteria) this; + } + + public Criteria andRealityEndTypeBetween(Integer value1, Integer value2) { + addCriterion("reality_end_type between", value1, value2, "realityEndType"); + return (Criteria) this; + } + + public Criteria andRealityEndTypeNotBetween(Integer value1, Integer value2) { + addCriterion("reality_end_type not between", value1, value2, "realityEndType"); + return (Criteria) this; + } + public Criteria andStatusIsNull() { addCriterion("`status` is null"); return (Criteria) this; diff --git a/service/src/main/java/com/hfkj/entity/BsRebateTransferCycle.java b/service/src/main/java/com/hfkj/entity/BsRebateTransferCycle.java new file mode 100644 index 0000000..71fe102 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsRebateTransferCycle.java @@ -0,0 +1,200 @@ +package com.hfkj.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * bs_rebate_transfer_cycle + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class BsRebateTransferCycle implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 周期编号 + */ + private String batchIdentifier; + + /** + * 活动开始时间 + */ + private Date startTime; + + /** + * 活动结束时间 + */ + private Date endTime; + + /** + * 状态 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 String getBatchIdentifier() { + return batchIdentifier; + } + + public void setBatchIdentifier(String batchIdentifier) { + this.batchIdentifier = batchIdentifier; + } + + public Date getStartTime() { + return startTime; + } + + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + + public Date getEndTime() { + return endTime; + } + + public void setEndTime(Date endTime) { + this.endTime = endTime; + } + + 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; + } + BsRebateTransferCycle other = (BsRebateTransferCycle) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getBatchIdentifier() == null ? other.getBatchIdentifier() == null : this.getBatchIdentifier().equals(other.getBatchIdentifier())) + && (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime())) + && (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime())) + && (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 + ((getBatchIdentifier() == null) ? 0 : getBatchIdentifier().hashCode()); + result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode()); + result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().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(", batchIdentifier=").append(batchIdentifier); + sb.append(", startTime=").append(startTime); + sb.append(", endTime=").append(endTime); + 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/service/src/main/java/com/hfkj/entity/BsRebateTransferCycleExample.java b/service/src/main/java/com/hfkj/entity/BsRebateTransferCycleExample.java new file mode 100644 index 0000000..e610794 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsRebateTransferCycleExample.java @@ -0,0 +1,863 @@ +package com.hfkj.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class BsRebateTransferCycleExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public BsRebateTransferCycleExample() { + 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 andBatchIdentifierIsNull() { + addCriterion("batch_identifier is null"); + return (Criteria) this; + } + + public Criteria andBatchIdentifierIsNotNull() { + addCriterion("batch_identifier is not null"); + return (Criteria) this; + } + + public Criteria andBatchIdentifierEqualTo(String value) { + addCriterion("batch_identifier =", value, "batchIdentifier"); + return (Criteria) this; + } + + public Criteria andBatchIdentifierNotEqualTo(String value) { + addCriterion("batch_identifier <>", value, "batchIdentifier"); + return (Criteria) this; + } + + public Criteria andBatchIdentifierGreaterThan(String value) { + addCriterion("batch_identifier >", value, "batchIdentifier"); + return (Criteria) this; + } + + public Criteria andBatchIdentifierGreaterThanOrEqualTo(String value) { + addCriterion("batch_identifier >=", value, "batchIdentifier"); + return (Criteria) this; + } + + public Criteria andBatchIdentifierLessThan(String value) { + addCriterion("batch_identifier <", value, "batchIdentifier"); + return (Criteria) this; + } + + public Criteria andBatchIdentifierLessThanOrEqualTo(String value) { + addCriterion("batch_identifier <=", value, "batchIdentifier"); + return (Criteria) this; + } + + public Criteria andBatchIdentifierLike(String value) { + addCriterion("batch_identifier like", value, "batchIdentifier"); + return (Criteria) this; + } + + public Criteria andBatchIdentifierNotLike(String value) { + addCriterion("batch_identifier not like", value, "batchIdentifier"); + return (Criteria) this; + } + + public Criteria andBatchIdentifierIn(List values) { + addCriterion("batch_identifier in", values, "batchIdentifier"); + return (Criteria) this; + } + + public Criteria andBatchIdentifierNotIn(List values) { + addCriterion("batch_identifier not in", values, "batchIdentifier"); + return (Criteria) this; + } + + public Criteria andBatchIdentifierBetween(String value1, String value2) { + addCriterion("batch_identifier between", value1, value2, "batchIdentifier"); + return (Criteria) this; + } + + public Criteria andBatchIdentifierNotBetween(String value1, String value2) { + addCriterion("batch_identifier not between", value1, value2, "batchIdentifier"); + return (Criteria) this; + } + + public Criteria andStartTimeIsNull() { + addCriterion("start_time is null"); + return (Criteria) this; + } + + public Criteria andStartTimeIsNotNull() { + addCriterion("start_time is not null"); + return (Criteria) this; + } + + public Criteria andStartTimeEqualTo(Date value) { + addCriterion("start_time =", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotEqualTo(Date value) { + addCriterion("start_time <>", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeGreaterThan(Date value) { + addCriterion("start_time >", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeGreaterThanOrEqualTo(Date value) { + addCriterion("start_time >=", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeLessThan(Date value) { + addCriterion("start_time <", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeLessThanOrEqualTo(Date value) { + addCriterion("start_time <=", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeIn(List values) { + addCriterion("start_time in", values, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotIn(List values) { + addCriterion("start_time not in", values, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeBetween(Date value1, Date value2) { + addCriterion("start_time between", value1, value2, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotBetween(Date value1, Date value2) { + addCriterion("start_time not between", value1, value2, "startTime"); + return (Criteria) this; + } + + public Criteria andEndTimeIsNull() { + addCriterion("end_time is null"); + return (Criteria) this; + } + + public Criteria andEndTimeIsNotNull() { + addCriterion("end_time is not null"); + return (Criteria) this; + } + + public Criteria andEndTimeEqualTo(Date value) { + addCriterion("end_time =", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotEqualTo(Date value) { + addCriterion("end_time <>", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeGreaterThan(Date value) { + addCriterion("end_time >", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeGreaterThanOrEqualTo(Date value) { + addCriterion("end_time >=", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeLessThan(Date value) { + addCriterion("end_time <", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeLessThanOrEqualTo(Date value) { + addCriterion("end_time <=", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeIn(List values) { + addCriterion("end_time in", values, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotIn(List values) { + addCriterion("end_time not in", values, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeBetween(Date value1, Date value2) { + addCriterion("end_time between", value1, value2, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotBetween(Date value1, Date value2) { + addCriterion("end_time not between", value1, value2, "endTime"); + 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/service/src/main/java/com/hfkj/entity/BsTransferAccounts.java b/service/src/main/java/com/hfkj/entity/BsTransferAccounts.java index 205078a..d971306 100644 --- a/service/src/main/java/com/hfkj/entity/BsTransferAccounts.java +++ b/service/src/main/java/com/hfkj/entity/BsTransferAccounts.java @@ -101,6 +101,11 @@ public class BsTransferAccounts implements Serializable { */ private Date updateTime; + /** + * 活动金转账周期编号 + */ + private Long rebateTransferCycleIdentifier; + private String ext1; private String ext2; @@ -253,6 +258,14 @@ public class BsTransferAccounts implements Serializable { this.updateTime = updateTime; } + public Long getRebateTransferCycleIdentifier() { + return rebateTransferCycleIdentifier; + } + + public void setRebateTransferCycleIdentifier(Long rebateTransferCycleIdentifier) { + this.rebateTransferCycleIdentifier = rebateTransferCycleIdentifier; + } + public String getExt1() { return ext1; } @@ -307,6 +320,7 @@ public class BsTransferAccounts implements Serializable { && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) && (this.getCreateType() == null ? other.getCreateType() == null : this.getCreateType().equals(other.getCreateType())) && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) + && (this.getRebateTransferCycleIdentifier() == null ? other.getRebateTransferCycleIdentifier() == null : this.getRebateTransferCycleIdentifier().equals(other.getRebateTransferCycleIdentifier())) && (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())); @@ -334,6 +348,7 @@ public class BsTransferAccounts implements Serializable { result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); result = prime * result + ((getCreateType() == null) ? 0 : getCreateType().hashCode()); result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); + result = prime * result + ((getRebateTransferCycleIdentifier() == null) ? 0 : getRebateTransferCycleIdentifier().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()); @@ -364,6 +379,7 @@ public class BsTransferAccounts implements Serializable { sb.append(", createTime=").append(createTime); sb.append(", createType=").append(createType); sb.append(", updateTime=").append(updateTime); + sb.append(", rebateTransferCycleIdentifier=").append(rebateTransferCycleIdentifier); sb.append(", ext1=").append(ext1); sb.append(", ext2=").append(ext2); sb.append(", ext3=").append(ext3); diff --git a/service/src/main/java/com/hfkj/entity/BsTransferAccountsExample.java b/service/src/main/java/com/hfkj/entity/BsTransferAccountsExample.java index c165c5c..7fb77eb 100644 --- a/service/src/main/java/com/hfkj/entity/BsTransferAccountsExample.java +++ b/service/src/main/java/com/hfkj/entity/BsTransferAccountsExample.java @@ -1303,6 +1303,66 @@ public class BsTransferAccountsExample { return (Criteria) this; } + public Criteria andRebateTransferCycleIdentifierIsNull() { + addCriterion("rebate_transfer_cycle_identifier is null"); + return (Criteria) this; + } + + public Criteria andRebateTransferCycleIdentifierIsNotNull() { + addCriterion("rebate_transfer_cycle_identifier is not null"); + return (Criteria) this; + } + + public Criteria andRebateTransferCycleIdentifierEqualTo(Long value) { + addCriterion("rebate_transfer_cycle_identifier =", value, "rebateTransferCycleIdentifier"); + return (Criteria) this; + } + + public Criteria andRebateTransferCycleIdentifierNotEqualTo(Long value) { + addCriterion("rebate_transfer_cycle_identifier <>", value, "rebateTransferCycleIdentifier"); + return (Criteria) this; + } + + public Criteria andRebateTransferCycleIdentifierGreaterThan(Long value) { + addCriterion("rebate_transfer_cycle_identifier >", value, "rebateTransferCycleIdentifier"); + return (Criteria) this; + } + + public Criteria andRebateTransferCycleIdentifierGreaterThanOrEqualTo(Long value) { + addCriterion("rebate_transfer_cycle_identifier >=", value, "rebateTransferCycleIdentifier"); + return (Criteria) this; + } + + public Criteria andRebateTransferCycleIdentifierLessThan(Long value) { + addCriterion("rebate_transfer_cycle_identifier <", value, "rebateTransferCycleIdentifier"); + return (Criteria) this; + } + + public Criteria andRebateTransferCycleIdentifierLessThanOrEqualTo(Long value) { + addCriterion("rebate_transfer_cycle_identifier <=", value, "rebateTransferCycleIdentifier"); + return (Criteria) this; + } + + public Criteria andRebateTransferCycleIdentifierIn(List values) { + addCriterion("rebate_transfer_cycle_identifier in", values, "rebateTransferCycleIdentifier"); + return (Criteria) this; + } + + public Criteria andRebateTransferCycleIdentifierNotIn(List values) { + addCriterion("rebate_transfer_cycle_identifier not in", values, "rebateTransferCycleIdentifier"); + return (Criteria) this; + } + + public Criteria andRebateTransferCycleIdentifierBetween(Long value1, Long value2) { + addCriterion("rebate_transfer_cycle_identifier between", value1, value2, "rebateTransferCycleIdentifier"); + return (Criteria) this; + } + + public Criteria andRebateTransferCycleIdentifierNotBetween(Long value1, Long value2) { + addCriterion("rebate_transfer_cycle_identifier not between", value1, value2, "rebateTransferCycleIdentifier"); + return (Criteria) this; + } + public Criteria andExt1IsNull() { addCriterion("ext_1 is null"); return (Criteria) this; diff --git a/service/src/main/java/com/hfkj/obs/HuaWeiYunObs.java b/service/src/main/java/com/hfkj/obs/HuaWeiYunObs.java index bfa22d4..137a2c5 100644 --- a/service/src/main/java/com/hfkj/obs/HuaWeiYunObs.java +++ b/service/src/main/java/com/hfkj/obs/HuaWeiYunObs.java @@ -18,7 +18,7 @@ public class HuaWeiYunObs { private static String endPoint = CommonSysConst.getSysConfig().getObs_end_point(); private static String accessKey = "CZVO7VAT8UV2RPYJUBD2"; private static String secretKey = "gyjrR8rYq9w2maPq9VmpRqoMqCJzQMH8vMctg7eE"; - public static String bucketName = "gratia-pay"; + public static String bucketName = CommonSysConst.getSysConfig().getObs_bucket_name(); /** * 创建请求 diff --git a/service/src/main/java/com/hfkj/openapi/v1/utils/SignatureUtil.java b/service/src/main/java/com/hfkj/openapi/v1/utils/SignatureUtil.java index e615b6f..123150b 100644 --- a/service/src/main/java/com/hfkj/openapi/v1/utils/SignatureUtil.java +++ b/service/src/main/java/com/hfkj/openapi/v1/utils/SignatureUtil.java @@ -84,11 +84,16 @@ public class SignatureUtil { public static void main(String[] args) throws Exception { String paramStr = "{\n" + - " \"merchantNo\": \"2023090616352962600\",\n" + - " \"orderNo\": \"100001\"" + + " \"merchantNo\": \"2023041916292112804\",\n" + + " \"outTradeNo\": \"ZF1130202305051459532538971022\",\n" + + " \"payMode\": \"ALIPAY\",\n" + + " \"totalAmount\": 0.01,\n" + + " \"transType\": \"NATIVE\",\n" + + " \"profitSharing\": 0,\n" + + " \"specialField\": \"测试\"" + "}"; - String sign = createSign(JSONObject.parseObject(paramStr), "tglpZHbMLS8URfGeNqn82MGMcVRU9GtO"); + String sign = createSign(JSONObject.parseObject(paramStr), "2jLO2WjXcSRSzTCaca0Kmv0OFrfYBbrA"); System.out.println(sign); } diff --git a/service/src/main/java/com/hfkj/service/BsTransferAccountsService.java b/service/src/main/java/com/hfkj/service/BsTransferAccountsService.java index a55d653..3afef76 100644 --- a/service/src/main/java/com/hfkj/service/BsTransferAccountsService.java +++ b/service/src/main/java/com/hfkj/service/BsTransferAccountsService.java @@ -2,6 +2,10 @@ package com.hfkj.service; import com.hfkj.entity.BsTransferAccounts; +import java.util.Date; +import java.util.List; +import java.util.Map; + /** * @className: BsTransferAccountsService * @author: HuRui @@ -15,6 +19,21 @@ public interface BsTransferAccountsService { */ void editData(BsTransferAccounts transferAccounts); + /** + * 数据交易 + * @param transferAccounts + * @return + */ + BsTransferAccounts transfer(BsTransferAccounts transferAccounts); + + /** + * 查询活动金交易 + * @param startTime + * @param endTime + * @return + */ + List> getTradeRebate(Date startTime, Date endTime); + /** * 查询数据 * @param orderNo 订单号 @@ -22,4 +41,11 @@ public interface BsTransferAccountsService { */ BsTransferAccounts getDetailByOrderNo(String orderNo); + /** + * 查询数据列表 + * @param param + * @return + */ + List getList(Map param); + } diff --git a/service/src/main/java/com/hfkj/service/impl/BsTradeOrderServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/BsTradeOrderServiceImpl.java index b5fb6fe..c511c00 100644 --- a/service/src/main/java/com/hfkj/service/impl/BsTradeOrderServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/impl/BsTradeOrderServiceImpl.java @@ -226,11 +226,11 @@ public class BsTradeOrderServiceImpl implements BsTradeOrderService { // 商户活动金活动 BsRebateActivity rebateActivity = rebateActivityService.getMerCurrentActivity(mer.getMerNo()); - if (rebateActivity != null) { + if (rebateActivity != null && rebateActivity.getEndTime().compareTo(new Date()) >= 0) { if (rebateActivity.getActivityType().equals(RebateActivityTypeEnum.type1.getNumber())) { if (rebateActivity.getPreferentialType().equals(RebateActivityPreferentialTypeEnum.type1.getNumber())) { // 达到满减门槛 - if (tradeOrder.getTradeAmount().compareTo(storeDiscount.getDiscountCondition()) > 0) { + if (tradeOrder.getTradeAmount().compareTo(rebateActivity.getCondition()) >= 0) { tradeOrder.setRebateActivityPart(true); tradeOrder.setRebateActivityId(rebateActivity.getId()); tradeOrder.setRebateActivityNo(rebateActivity.getActivityNo()); @@ -258,11 +258,12 @@ public class BsTradeOrderServiceImpl implements BsTradeOrderService { tradeOrder.setRebateActivityPreferentialType(rebateActivity.getPreferentialType()); tradeOrder.setRebateActivityPrice(rebateActivity.getPrice()); - // 优惠比例 / 100 = 最终优惠比例 - BigDecimal priceRate = tradeOrder.getRebateActivityPrice().setScale(2, BigDecimal.ROUND_DOWN); + // 优惠折扣 + BigDecimal priceRate = tradeOrder.getRebateActivityPrice().divide(new BigDecimal("10")).setScale(2, BigDecimal.ROUND_DOWN); tradeOrder.setRebateActivityActualPrice(tradeOrder.getTradeActualAmount().subtract(tradeOrder.getTradeActualAmount().multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP))); tradeOrder.setTradeActualAmount(tradeOrder.getTradeActualAmount().subtract(tradeOrder.getRebateActivityActualPrice())); } + editOrder(tradeOrder); } if (tradeOrder.getRebateActivityPart().equals(true)) { @@ -281,6 +282,7 @@ public class BsTradeOrderServiceImpl implements BsTradeOrderService { Map returnParam = new HashMap<>(); returnParam.put("outTradeNo", tradeNo); + returnParam.put("tradeDetail", tradeOrder); return returnParam; } @@ -297,18 +299,19 @@ public class BsTradeOrderServiceImpl implements BsTradeOrderService { tradeOrder.setStatus(TradeOrderStatusEnum.status5.getNumber()); editOrder(tradeOrder); - // 退回活动金 - RebateActivityAccountTradeObject accountTradeObject = new RebateActivityAccountTradeObject(); - accountTradeObject.setTradeObjectType(RebateActivityAccountObjectTypeEnum.type3); - accountTradeObject.setTradeObjectId(tradeOrder.getId()); - accountTradeObject.setTradeObjectContent("取消交易" + tradeOrder.getOutTradeNo()); - rebateActivityAccountService.accountTrade( - tradeOrder.getRebateActivityNo(), - RebateActivityAccountTradeTypeEnum.type1, - tradeOrder.getRebateActivityActualPrice(), - accountTradeObject - ); - + if (tradeOrder.getRebateActivityPart().equals(true)) { + // 退回活动金 + RebateActivityAccountTradeObject accountTradeObject = new RebateActivityAccountTradeObject(); + accountTradeObject.setTradeObjectType(RebateActivityAccountObjectTypeEnum.type3); + accountTradeObject.setTradeObjectId(tradeOrder.getId()); + accountTradeObject.setTradeObjectContent("取消交易" + tradeOrder.getOutTradeNo()); + rebateActivityAccountService.accountTrade( + tradeOrder.getRebateActivityNo(), + RebateActivityAccountTradeTypeEnum.type1, + tradeOrder.getRebateActivityActualPrice(), + accountTradeObject + ); + } } @Override @@ -501,6 +504,10 @@ public class BsTradeOrderServiceImpl implements BsTradeOrderService { criteria.andAccTradeNoEqualTo(MapUtils.getString(param, "accTradeNo")); } + if (MapUtils.getLong(param, "createTimeS") != null) { + criteria.andCreateTimeGreaterThanOrEqualTo(new Date(MapUtils.getLong(param, "createTimeS"))); + } + if (MapUtils.getLong(param, "payTimeS") != null) { criteria.andPayTimeGreaterThanOrEqualTo(new Date(MapUtils.getLong(param, "payTimeS"))); } @@ -538,6 +545,10 @@ public class BsTradeOrderServiceImpl implements BsTradeOrderService { criteria.andSpecialFieldLike("%"+MapUtils.getString(param, "specialField")+"%"); } + if (MapUtils.getInteger(param, "createType") != null) { + criteria.andCreateTypeEqualTo(MapUtils.getInteger(param, "createType")); + } + example.setOrderByClause("create_time desc"); return tradeOrderMapper.selectByExample(example); } diff --git a/service/src/main/java/com/hfkj/service/impl/BsTransferAccountsServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/BsTransferAccountsServiceImpl.java index ddcd08d..7d6d271 100644 --- a/service/src/main/java/com/hfkj/service/impl/BsTransferAccountsServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/impl/BsTransferAccountsServiceImpl.java @@ -1,17 +1,33 @@ package com.hfkj.service.impl; +import com.alibaba.fastjson.JSONObject; +import com.hfkj.channel.tianque.service.TianQueFundManageService; +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.utils.DateUtil; import com.hfkj.common.utils.RedisUtil; import com.hfkj.dao.BsTransferAccountsMapper; +import com.hfkj.entity.BsMerPlatformNo; import com.hfkj.entity.BsTransferAccounts; import com.hfkj.entity.BsTransferAccountsExample; +import com.hfkj.openapi.v1.utils.SignatureUtil; +import com.hfkj.service.BsMerKeyService; +import com.hfkj.service.BsMerPlatformNoService; import com.hfkj.service.BsTransferAccountsService; +import com.hfkj.sysenum.MerPlatformNoStatusEnum; +import com.hfkj.sysenum.PlatformTypeEnum; +import com.hfkj.sysenum.TransferAccountsCreateType; import com.hfkj.sysenum.TransferAccountsStatus; +import org.apache.commons.collections4.MapUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.Date; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** * @className: BsTransferAccountsServiceImpl @@ -26,6 +42,13 @@ public class BsTransferAccountsServiceImpl implements BsTransferAccountsService @Autowired private RedisUtil redisUtil; + @Resource + private TianQueFundManageService tianQueFundManageService; + @Resource + private BsTransferAccountsService transferAccountsService; + @Resource + private BsMerPlatformNoService merPlatformNoService; + // 缓存目录 private final static String TRANSFER_ACCOUNTS = "TRANSFER_ACCOUNTS:"; // 缓存时间 1小时 @@ -44,6 +67,45 @@ public class BsTransferAccountsServiceImpl implements BsTransferAccountsService redisUtil.set(TRANSFER_ACCOUNTS + transferAccounts.getOrderNo(), transferAccounts, cacheTime); } + @Override + public BsTransferAccounts transfer(BsTransferAccounts transferAccounts) { + // 查询渠道 + BsMerPlatformNo platform = merPlatformNoService.getPlatformNo(transferAccounts.getMerId(), PlatformTypeEnum.type5); + if (platform == null) { + throw ErrorHelp.genException(SysCode.OpenApi, ErrorCode.OPEN_API_COMMON, "未开通权限"); + } + if (!platform.getStatus().equals(MerPlatformNoStatusEnum.status1.getNumber())) { + throw ErrorHelp.genException(SysCode.OpenApi, ErrorCode.OPEN_API_COMMON, "未开通权限"); + } + transferAccounts.setStatus(TransferAccountsStatus.status1.getNumber()); + transferAccounts.setCreateType(TransferAccountsCreateType.type2.getNumber()); + transferAccounts.setReceiverPlatformType(platform.getPlatformType()); + transferAccounts.setReceiverPlatformNo(platform.getPlatformNo()); + transferAccountsService.editData(transferAccounts); + + // 调用渠道转账 + JSONObject orgTransfer = tianQueFundManageService.orgTransfer( + transferAccounts.getReceiverPlatformNo(), + transferAccounts.getOrderNo(), + transferAccounts.getAmount(), + transferAccounts.getOrderNo(), + "01" + ); + transferAccounts.setReceiverPlatformNo(orgTransfer.getString("transactionNo")); + transferAccounts.setSettleDate(DateUtil.format(orgTransfer.getString("clrDt"), "yyyyMMdd")); + transferAccounts.setTransferTime(DateUtil.format(orgTransfer.getString("transactionTime"), "yyyy-MM-dd HH:mm:ss")); + transferAccountsService.editData(transferAccounts); + return transferAccounts; + } + + @Override + public List> getTradeRebate(Date startTime, Date endTime) { + return transferAccountsMapper.queryTradeRebate( + DateUtil.format(startTime, DateUtil.Y_M_D_HMS), + DateUtil.format(endTime, DateUtil.Y_M_D_HMS) + ); + } + @Override public BsTransferAccounts getDetailByOrderNo(String orderNo) { Object obj = redisUtil.get(TRANSFER_ACCOUNTS + orderNo); @@ -64,4 +126,17 @@ public class BsTransferAccountsServiceImpl implements BsTransferAccountsService return null; } + @Override + public List getList(Map param) { + BsTransferAccountsExample example = new BsTransferAccountsExample(); + example.createCriteria().andStatusNotEqualTo(TransferAccountsStatus.status0.getNumber()); + + if (MapUtils.getInteger(param, "status") != null) { + example.createCriteria().andStatusEqualTo(MapUtils.getInteger(param, "status")); + } + + example.setOrderByClause("create_time desc"); + return transferAccountsMapper.selectByExample(example); + } + } diff --git a/service/src/main/java/com/hfkj/service/rebate/BsRebateActivityService.java b/service/src/main/java/com/hfkj/service/rebate/BsRebateActivityService.java index 6ab541b..9e75e6e 100644 --- a/service/src/main/java/com/hfkj/service/rebate/BsRebateActivityService.java +++ b/service/src/main/java/com/hfkj/service/rebate/BsRebateActivityService.java @@ -1,6 +1,7 @@ package com.hfkj.service.rebate; import com.hfkj.entity.BsRebateActivity; +import com.hfkj.sysenum.RebateActivityEndTypeEnum; import java.util.Date; import java.util.List; @@ -29,7 +30,7 @@ public interface BsRebateActivityService { * 关闭活动 * @param activityNo 活动编号 */ - void closeActivity(String activityNo); + void closeActivity(String activityNo, RebateActivityEndTypeEnum rebateActivityEndTypeEnum); /** * 修改活动结束时间 diff --git a/service/src/main/java/com/hfkj/service/rebate/BsRebateTransferCycleService.java b/service/src/main/java/com/hfkj/service/rebate/BsRebateTransferCycleService.java new file mode 100644 index 0000000..e46108a --- /dev/null +++ b/service/src/main/java/com/hfkj/service/rebate/BsRebateTransferCycleService.java @@ -0,0 +1,17 @@ +package com.hfkj.service.rebate; + +import com.hfkj.entity.BsRebateTransferCycle; + +/** + * @className: BsRebateTransferCycleService + * @author: HuRui + * @date: 2023/10/26 + **/ +public interface BsRebateTransferCycleService { + + /** + * 编辑数据 + * @param transferCycle + */ + void editData(BsRebateTransferCycle transferCycle); +} diff --git a/service/src/main/java/com/hfkj/service/rebate/impl/BsRebateActivityServiceImpl.java b/service/src/main/java/com/hfkj/service/rebate/impl/BsRebateActivityServiceImpl.java index 77a91f9..2e14e31 100644 --- a/service/src/main/java/com/hfkj/service/rebate/impl/BsRebateActivityServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/rebate/impl/BsRebateActivityServiceImpl.java @@ -10,6 +10,7 @@ import com.hfkj.entity.BsRebateActivityAccount; import com.hfkj.entity.BsRebateActivityExample; import com.hfkj.service.rebate.BsRebateActivityAccountService; import com.hfkj.service.rebate.BsRebateActivityService; +import com.hfkj.sysenum.RebateActivityEndTypeEnum; import com.hfkj.sysenum.RebateActivityStatusEnum; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; @@ -86,7 +87,7 @@ public class BsRebateActivityServiceImpl implements BsRebateActivityService { } @Override - public void closeActivity(String activityNo) { + public void closeActivity(String activityNo, RebateActivityEndTypeEnum rebateActivityEndTypeEnum) { // 活动 BsRebateActivity activity = getActivityByNo(activityNo); if (activity == null) { @@ -96,7 +97,13 @@ public class BsRebateActivityServiceImpl implements BsRebateActivityService { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "活动状态错误"); } activity.setStatus(RebateActivityStatusEnum.status3.getNumber()); - activity.setRealityEndTime(new Date()); + activity.setRestrictPartakeType(rebateActivityEndTypeEnum.getNumber()); + + if (RebateActivityEndTypeEnum.type1.getNumber().equals(rebateActivityEndTypeEnum.getNumber())) { + activity.setRealityEndTime(activity.getEndTime()); + } else if (RebateActivityEndTypeEnum.type2.getNumber().equals(rebateActivityEndTypeEnum.getNumber())) { + activity.setRealityEndTime(new Date()); + } editData(activity); // 删除缓存 @@ -166,6 +173,15 @@ public class BsRebateActivityServiceImpl implements BsRebateActivityService { criteria.andMerAbbreviateLike(MapUtils.getString(param, "merAbbreviate")); } + if (MapUtils.getLong(param, "endTimeS") != null) { + criteria.andEndTimeGreaterThanOrEqualTo(new Date(MapUtils.getLong(param, "endTimeS"))); + } + + if (MapUtils.getLong(param, "endTimeE") != null) { + criteria.andEndTimeLessThanOrEqualTo(new Date(MapUtils.getLong(param, "endTimeE"))); + } + + if (MapUtils.getInteger(param, "status") != null) { criteria.andStatusEqualTo(MapUtils.getInteger(param, "status")); } diff --git a/service/src/main/java/com/hfkj/service/rebate/impl/BsRebateRewardServiceImpl.java b/service/src/main/java/com/hfkj/service/rebate/impl/BsRebateRewardServiceImpl.java index d15e88d..4079611 100644 --- a/service/src/main/java/com/hfkj/service/rebate/impl/BsRebateRewardServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/rebate/impl/BsRebateRewardServiceImpl.java @@ -81,8 +81,7 @@ public class BsRebateRewardServiceImpl implements BsRebateRewardService { rebateReward.setBatchIdentifier(Long.parseLong(DateUtil.date2String(new Date(), "yyyyMMddHHmm"))); rebateReward.setTimeStart(timeStart); rebateReward.setTimeEnd(timeEnd); - // rebateReward.setPartTradeAmount(rebateRewardMapper.queryTradeAmount(timeStartStr,timeEndStr)); - rebateReward.setPartTradeAmount(new BigDecimal("1000000")); + rebateReward.setPartTradeAmount(rebateRewardMapper.queryTradeAmount(timeStartStr,timeEndStr)); rebateReward.setPartMerNum(merIdList.size()); rebateReward.setRatio(new BigDecimal(ratio.getParam())); rebateReward.setAmount(rebateReward.getPartTradeAmount().multiply(rebateReward.getRatio().divide(new BigDecimal("100"))).setScale(2, RoundingMode.DOWN)); diff --git a/service/src/main/java/com/hfkj/service/rebate/impl/BsRebateTransferCycleServiceImpl.java b/service/src/main/java/com/hfkj/service/rebate/impl/BsRebateTransferCycleServiceImpl.java new file mode 100644 index 0000000..c917288 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/rebate/impl/BsRebateTransferCycleServiceImpl.java @@ -0,0 +1,33 @@ +package com.hfkj.service.rebate.impl; + +import com.hfkj.dao.BsRebateTransferCycleMapper; +import com.hfkj.entity.BsRebateTransferCycle; +import com.hfkj.service.rebate.BsRebateTransferCycleService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Date; + +/** + * @className: BsRebateTransferCycleServiceImpl + * @author: HuRui + * @date: 2023/10/26 + **/ +@Service("rebateTransferCycleService") +public class BsRebateTransferCycleServiceImpl implements BsRebateTransferCycleService { + @Resource + private BsRebateTransferCycleMapper rebateTransferCycleMapper; + + @Override + public void editData(BsRebateTransferCycle transferCycle) { + if (transferCycle.getId() == null) { + transferCycle.setStatus(1); + transferCycle.setCreateTime(new Date()); + transferCycle.setUpdateTime(new Date()); + rebateTransferCycleMapper.insert(transferCycle); + } else { + transferCycle.setUpdateTime(new Date()); + rebateTransferCycleMapper.updateByPrimaryKey(transferCycle); + } + } +} diff --git a/service/src/main/java/com/hfkj/sysenum/RebateActivityEndTypeEnum.java b/service/src/main/java/com/hfkj/sysenum/RebateActivityEndTypeEnum.java new file mode 100644 index 0000000..dad1939 --- /dev/null +++ b/service/src/main/java/com/hfkj/sysenum/RebateActivityEndTypeEnum.java @@ -0,0 +1,46 @@ +package com.hfkj.sysenum; + +import java.util.Objects; + +/** + * 活动金 - 活动结束方式 + */ +public enum RebateActivityEndTypeEnum { + type1(1, "自动"), + type2(2, "手动"), + ; + + private Integer number; + + private String name; + + RebateActivityEndTypeEnum(int number, String name) { + this.number = number; + this.name = name; + } + + public static RebateActivityEndTypeEnum getDataByNumber(Integer number) { + for (RebateActivityEndTypeEnum ele : values()) { + if (Objects.equals(number,ele.getNumber())) { + return ele; + } + } + return null; + } + + public Integer getNumber() { + return number; + } + + public void setNumber(Integer number) { + this.number = number; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +}