From 4839974e3d82d7127ceab69d7de4ee809c2a3283 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Fri, 30 Jun 2023 11:15:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/bweb/config/AuthConfig.java | 1 + .../controller/BsTradeOrderController.java | 83 +++++++++++++++- .../com/cweb/notify/LaKaLaController.java | 6 ++ .../java/com/hfkj/dao/BsTradeOrderMapper.java | 20 ++-- .../com/hfkj/dao/BsTradeOrderMapperExt.java | 26 +++++ .../com/hfkj/dao/BsTradeOrderSqlProvider.java | 24 ++--- .../java/com/hfkj/entity/BsTradeOrder.java | 16 ++-- .../com/hfkj/entity/BsTradeOrderExample.java | 95 ++++++++++++------- .../com/hfkj/service/BsTradeOrderService.java | 7 ++ .../service/impl/BsTradeOrderServiceImpl.java | 7 ++ 10 files changed, 216 insertions(+), 69 deletions(-) diff --git a/bweb/src/main/java/com/bweb/config/AuthConfig.java b/bweb/src/main/java/com/bweb/config/AuthConfig.java index a93bd19..a4e67a2 100644 --- a/bweb/src/main/java/com/bweb/config/AuthConfig.java +++ b/bweb/src/main/java/com/bweb/config/AuthConfig.java @@ -100,6 +100,7 @@ public class AuthConfig implements WebMvcConfigurer { .excludePathPatterns("/laKaLaNotify/merContract") .excludePathPatterns("/openApi/*") .excludePathPatterns("/sysVersion/*") + .excludePathPatterns("/tradeOrder/*") ; } diff --git a/bweb/src/main/java/com/bweb/controller/BsTradeOrderController.java b/bweb/src/main/java/com/bweb/controller/BsTradeOrderController.java index 0596d9e..f7cae23 100644 --- a/bweb/src/main/java/com/bweb/controller/BsTradeOrderController.java +++ b/bweb/src/main/java/com/bweb/controller/BsTradeOrderController.java @@ -12,6 +12,7 @@ import com.hfkj.common.security.UserCenter; import com.hfkj.common.utils.EasyExcelUtil; import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.config.CommonSysConst; +import com.hfkj.entity.BsMer; import com.hfkj.entity.BsPayQrCode; import com.hfkj.entity.BsTradeOrder; import com.hfkj.model.ResponseData; @@ -23,6 +24,7 @@ import com.hfkj.sysenum.TradeOrderPayModeEnum; import com.hfkj.sysenum.TradeOrderStatusEnum; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.apache.commons.collections4.MapUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; @@ -30,6 +32,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.io.File; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -51,6 +54,9 @@ public class BsTradeOrderController { @Resource private BsTradeOrderRefundService tradeOrderRefundService; + @Resource + private BsMerService merService; + @RequestMapping(value="/getOrderList",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询订单列表") @@ -257,10 +263,44 @@ public class BsTradeOrderController { @RequestMapping(value="/queryCheckingDetail",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "根据交易订单号 查询订单信息") - public ResponseData queryCheckingDetail(@RequestParam(value = "outTradeOrder" , required = true) String outTradeOrder) { + public ResponseData queryCheckingDetail(@RequestParam(value = "merNo" , required = true) String merNo, + @RequestParam(value = "settleTimeS" , required = true) Long settleTimeS, + @RequestParam(value = "settleTimeE" , required = true) Long settleTimeE) { try { + // 查询商户 + BsMer mer = merService.getMer(merNo); + if (mer == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户"); + } + + Map param = new HashMap<>(); + param.put("merNo", merNo); + param.put("settleTimeS", settleTimeS); + param.put("settleTimeE", settleTimeE); + // 查询交易详情 + List> mapList = tradeOrderService.getTradeOrderDetailCount(param); + + int totalTradeNum = 0; + BigDecimal totalTradeAmount = new BigDecimal("0"); + BigDecimal totalSettleAmount = new BigDecimal("0"); + BigDecimal totalShdFeeAmount = new BigDecimal("0"); + + for (Map map : mapList) { + map.put("merName", mer.getMerName()); + map.put("merAbbreviate", mer.getMerAbbreviate()); + totalTradeNum += MapUtils.getInteger(map, "tradeNum").intValue(); + totalTradeAmount = totalTradeAmount.add(new BigDecimal(MapUtils.getString(map, "tradeAmount"))); + totalSettleAmount = totalSettleAmount.add(new BigDecimal(MapUtils.getString(map, "settleAmount"))); + totalShdFeeAmount = totalShdFeeAmount.add(new BigDecimal(MapUtils.getString(map, "shdFeeAmount"))); + } - return ResponseMsgUtil.success(""); + Map returnParam = new HashMap<>(); + returnParam.put("totalTradeNum", totalTradeNum); + returnParam.put("totalTradeAmount", totalTradeAmount); + returnParam.put("totalSettleAmount", totalSettleAmount); + returnParam.put("totalShdFeeAmount", totalShdFeeAmount); + returnParam.put("settleDetailList", mapList); + return ResponseMsgUtil.success(returnParam); } catch (Exception e) { log.error(e.getMessage(), e); @@ -268,13 +308,46 @@ public class BsTradeOrderController { } } - @RequestMapping(value="/getOrderByOutTradeOrder",method = RequestMethod.GET) + @RequestMapping(value="/queryChecking",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "根据交易订单号 查询订单信息") - public ResponseData queryChecking(@RequestParam(value = "outTradeOrder" , required = true) String outTradeOrder) { + public ResponseData queryChecking(@RequestParam(value = "merNo" , required = true) String merNo, + @RequestParam(value = "settleTimeS" , required = true) Long settleTimeS, + @RequestParam(value = "settleTimeE" , required = true) Long settleTimeE) { try { + // 查询商户 + BsMer mer = merService.getMer(merNo); + if (mer == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户"); + } + + Map param = new HashMap<>(); + param.put("merNo", merNo); + param.put("settleTimeS", settleTimeS); + param.put("settleTimeE", settleTimeE); + // 查询交易详情 + List> mapList = tradeOrderService.getTradeOrderDetailCount(param); + + int totalTradeNum = 0; + BigDecimal totalTradeAmount = new BigDecimal("0"); + BigDecimal totalSettleAmount = new BigDecimal("0"); + BigDecimal totalShdFeeAmount = new BigDecimal("0"); + + for (Map map : mapList) { + totalTradeNum += MapUtils.getInteger(map, "tradeNum").intValue(); + totalTradeAmount = totalTradeAmount.add(new BigDecimal(MapUtils.getString(map, "tradeAmount"))); + totalSettleAmount = totalSettleAmount.add(new BigDecimal(MapUtils.getString(map, "settleAmount"))); + totalShdFeeAmount = totalShdFeeAmount.add(new BigDecimal(MapUtils.getString(map, "shdFeeAmount"))); + } - return ResponseMsgUtil.success(""); + Map returnParam = new HashMap<>(); + returnParam.put("merNo", mer.getMerNo()); + returnParam.put("merName", mer.getMerName()); + returnParam.put("totalTradeNum", totalTradeNum); + returnParam.put("totalTradeAmount", totalTradeAmount); + returnParam.put("totalSettleAmount", totalSettleAmount); + returnParam.put("totalShdFeeAmount", totalShdFeeAmount); + return ResponseMsgUtil.success(returnParam); } catch (Exception e) { log.error(e.getMessage(), e); diff --git a/cweb/src/main/java/com/cweb/notify/LaKaLaController.java b/cweb/src/main/java/com/cweb/notify/LaKaLaController.java index 8f7e728..ce8467a 100644 --- a/cweb/src/main/java/com/cweb/notify/LaKaLaController.java +++ b/cweb/src/main/java/com/cweb/notify/LaKaLaController.java @@ -77,6 +77,12 @@ public class LaKaLaController { other.put("log_no", body.getString("log_no")); other.put("acc_trade_no", body.getString("acc_trade_no")); other.put("card_type", body.getString("card_type")); + if (body.getString("acc_discount_amount") != null) { + other.put("acc_discount_amount", body.getBigDecimal("acc_discount_amount").divide(new BigDecimal("100"))); + } + if (body.getString("acc_mdiscount_amount") != null) { + other.put("acc_mdiscount_amount", body.getBigDecimal("acc_mdiscount_amount").divide(new BigDecimal("100"))); + } tradeOrderService.paySuccess( body.getString("out_trade_no"), diff --git a/service/src/main/java/com/hfkj/dao/BsTradeOrderMapper.java b/service/src/main/java/com/hfkj/dao/BsTradeOrderMapper.java index 7397734..bdff433 100644 --- a/service/src/main/java/com/hfkj/dao/BsTradeOrderMapper.java +++ b/service/src/main/java/com/hfkj/dao/BsTradeOrderMapper.java @@ -59,7 +59,7 @@ public interface BsTradeOrderMapper extends BsTradeOrderMapperExt { "user_phone, user_discount_id, ", "user_discount_name, user_discount_type, ", "user_discount_price, user_discount_actual_price, ", - "trade_actual_amount, income_amout, ", + "trade_actual_amount, income_amount, ", "acc_trade_no, acc_mdiscount_amount, ", "acc_discount_amount, shd_fee_amt, ", "fee_rate, settle_amount, ", @@ -92,11 +92,11 @@ public interface BsTradeOrderMapper extends BsTradeOrderMapperExt { "#{userPhone,jdbcType=VARCHAR}, #{userDiscountId,jdbcType=BIGINT}, ", "#{userDiscountName,jdbcType=VARCHAR}, #{userDiscountType,jdbcType=INTEGER}, ", "#{userDiscountPrice,jdbcType=DECIMAL}, #{userDiscountActualPrice,jdbcType=DECIMAL}, ", - "#{tradeActualAmount,jdbcType=DECIMAL}, #{incomeAmout,jdbcType=DECIMAL}, ", + "#{tradeActualAmount,jdbcType=DECIMAL}, #{incomeAmount,jdbcType=DECIMAL}, ", "#{accTradeNo,jdbcType=VARCHAR}, #{accMdiscountAmount,jdbcType=DECIMAL}, ", "#{accDiscountAmount,jdbcType=DECIMAL}, #{shdFeeAmt,jdbcType=DECIMAL}, ", "#{feeRate,jdbcType=DECIMAL}, #{settleAmount,jdbcType=DECIMAL}, ", - "#{settleDate,jdbcType=TIMESTAMP}, #{accPaymentCode,jdbcType=VARCHAR}, ", + "#{settleDate,jdbcType=DATE}, #{accPaymentCode,jdbcType=VARCHAR}, ", "#{cardType,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", "#{profitSharingStatus,jdbcType=BIT}, #{payTime,jdbcType=TIMESTAMP}, ", "#{timeoutExpress,jdbcType=INTEGER}, #{subject,jdbcType=VARCHAR}, ", @@ -158,14 +158,14 @@ public interface BsTradeOrderMapper extends BsTradeOrderMapperExt { @Result(column="user_discount_price", property="userDiscountPrice", jdbcType=JdbcType.DECIMAL), @Result(column="user_discount_actual_price", property="userDiscountActualPrice", jdbcType=JdbcType.DECIMAL), @Result(column="trade_actual_amount", property="tradeActualAmount", jdbcType=JdbcType.DECIMAL), - @Result(column="income_amout", property="incomeAmout", jdbcType=JdbcType.DECIMAL), + @Result(column="income_amount", property="incomeAmount", jdbcType=JdbcType.DECIMAL), @Result(column="acc_trade_no", property="accTradeNo", jdbcType=JdbcType.VARCHAR), @Result(column="acc_mdiscount_amount", property="accMdiscountAmount", jdbcType=JdbcType.DECIMAL), @Result(column="acc_discount_amount", property="accDiscountAmount", jdbcType=JdbcType.DECIMAL), @Result(column="shd_fee_amt", property="shdFeeAmt", jdbcType=JdbcType.DECIMAL), @Result(column="fee_rate", property="feeRate", jdbcType=JdbcType.DECIMAL), @Result(column="settle_amount", property="settleAmount", jdbcType=JdbcType.DECIMAL), - @Result(column="settle_date", property="settleDate", jdbcType=JdbcType.TIMESTAMP), + @Result(column="settle_date", property="settleDate", jdbcType=JdbcType.DATE), @Result(column="acc_payment_code", property="accPaymentCode", jdbcType=JdbcType.VARCHAR), @Result(column="card_type", property="cardType", jdbcType=JdbcType.VARCHAR), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @@ -197,7 +197,7 @@ public interface BsTradeOrderMapper extends BsTradeOrderMapperExt { "store_discount_condition, store_discount_price, store_discount_final_cost_price, ", "store_discount_actual_price, store_discount_profit_price, user_id, user_phone, ", "user_discount_id, user_discount_name, user_discount_type, user_discount_price, ", - "user_discount_actual_price, trade_actual_amount, income_amout, acc_trade_no, ", + "user_discount_actual_price, trade_actual_amount, income_amount, acc_trade_no, ", "acc_mdiscount_amount, acc_discount_amount, shd_fee_amt, fee_rate, settle_amount, ", "settle_date, acc_payment_code, card_type, `status`, profit_sharing_status, pay_time, ", "timeout_express, subject, pay_notify_url, attach, refund_type, refund_price, ", @@ -249,14 +249,14 @@ public interface BsTradeOrderMapper extends BsTradeOrderMapperExt { @Result(column="user_discount_price", property="userDiscountPrice", jdbcType=JdbcType.DECIMAL), @Result(column="user_discount_actual_price", property="userDiscountActualPrice", jdbcType=JdbcType.DECIMAL), @Result(column="trade_actual_amount", property="tradeActualAmount", jdbcType=JdbcType.DECIMAL), - @Result(column="income_amout", property="incomeAmout", jdbcType=JdbcType.DECIMAL), + @Result(column="income_amount", property="incomeAmount", jdbcType=JdbcType.DECIMAL), @Result(column="acc_trade_no", property="accTradeNo", jdbcType=JdbcType.VARCHAR), @Result(column="acc_mdiscount_amount", property="accMdiscountAmount", jdbcType=JdbcType.DECIMAL), @Result(column="acc_discount_amount", property="accDiscountAmount", jdbcType=JdbcType.DECIMAL), @Result(column="shd_fee_amt", property="shdFeeAmt", jdbcType=JdbcType.DECIMAL), @Result(column="fee_rate", property="feeRate", jdbcType=JdbcType.DECIMAL), @Result(column="settle_amount", property="settleAmount", jdbcType=JdbcType.DECIMAL), - @Result(column="settle_date", property="settleDate", jdbcType=JdbcType.TIMESTAMP), + @Result(column="settle_date", property="settleDate", jdbcType=JdbcType.DATE), @Result(column="acc_payment_code", property="accPaymentCode", jdbcType=JdbcType.VARCHAR), @Result(column="card_type", property="cardType", jdbcType=JdbcType.VARCHAR), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @@ -331,14 +331,14 @@ public interface BsTradeOrderMapper extends BsTradeOrderMapperExt { "user_discount_price = #{userDiscountPrice,jdbcType=DECIMAL},", "user_discount_actual_price = #{userDiscountActualPrice,jdbcType=DECIMAL},", "trade_actual_amount = #{tradeActualAmount,jdbcType=DECIMAL},", - "income_amout = #{incomeAmout,jdbcType=DECIMAL},", + "income_amount = #{incomeAmount,jdbcType=DECIMAL},", "acc_trade_no = #{accTradeNo,jdbcType=VARCHAR},", "acc_mdiscount_amount = #{accMdiscountAmount,jdbcType=DECIMAL},", "acc_discount_amount = #{accDiscountAmount,jdbcType=DECIMAL},", "shd_fee_amt = #{shdFeeAmt,jdbcType=DECIMAL},", "fee_rate = #{feeRate,jdbcType=DECIMAL},", "settle_amount = #{settleAmount,jdbcType=DECIMAL},", - "settle_date = #{settleDate,jdbcType=TIMESTAMP},", + "settle_date = #{settleDate,jdbcType=DATE},", "acc_payment_code = #{accPaymentCode,jdbcType=VARCHAR},", "card_type = #{cardType,jdbcType=VARCHAR},", "`status` = #{status,jdbcType=INTEGER},", diff --git a/service/src/main/java/com/hfkj/dao/BsTradeOrderMapperExt.java b/service/src/main/java/com/hfkj/dao/BsTradeOrderMapperExt.java index 093aad6..8d8b7c9 100644 --- a/service/src/main/java/com/hfkj/dao/BsTradeOrderMapperExt.java +++ b/service/src/main/java/com/hfkj/dao/BsTradeOrderMapperExt.java @@ -4,6 +4,7 @@ import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import java.math.BigDecimal; +import java.util.List; import java.util.Map; /** @@ -31,4 +32,29 @@ public interface BsTradeOrderMapperExt { "") Map countTradeOrderPrice(@Param("param") Map param); + + @Select("") + List> queryTradeOrderDetailCount(@Param("param") Map param); + } diff --git a/service/src/main/java/com/hfkj/dao/BsTradeOrderSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsTradeOrderSqlProvider.java index bc4314b..f34df3a 100644 --- a/service/src/main/java/com/hfkj/dao/BsTradeOrderSqlProvider.java +++ b/service/src/main/java/com/hfkj/dao/BsTradeOrderSqlProvider.java @@ -196,8 +196,8 @@ public class BsTradeOrderSqlProvider { sql.VALUES("trade_actual_amount", "#{tradeActualAmount,jdbcType=DECIMAL}"); } - if (record.getIncomeAmout() != null) { - sql.VALUES("income_amout", "#{incomeAmout,jdbcType=DECIMAL}"); + if (record.getIncomeAmount() != null) { + sql.VALUES("income_amount", "#{incomeAmount,jdbcType=DECIMAL}"); } if (record.getAccTradeNo() != null) { @@ -225,7 +225,7 @@ public class BsTradeOrderSqlProvider { } if (record.getSettleDate() != null) { - sql.VALUES("settle_date", "#{settleDate,jdbcType=TIMESTAMP}"); + sql.VALUES("settle_date", "#{settleDate,jdbcType=DATE}"); } if (record.getAccPaymentCode() != null) { @@ -352,7 +352,7 @@ public class BsTradeOrderSqlProvider { sql.SELECT("user_discount_price"); sql.SELECT("user_discount_actual_price"); sql.SELECT("trade_actual_amount"); - sql.SELECT("income_amout"); + sql.SELECT("income_amount"); sql.SELECT("acc_trade_no"); sql.SELECT("acc_mdiscount_amount"); sql.SELECT("acc_discount_amount"); @@ -567,8 +567,8 @@ public class BsTradeOrderSqlProvider { sql.SET("trade_actual_amount = #{record.tradeActualAmount,jdbcType=DECIMAL}"); } - if (record.getIncomeAmout() != null) { - sql.SET("income_amout = #{record.incomeAmout,jdbcType=DECIMAL}"); + if (record.getIncomeAmount() != null) { + sql.SET("income_amount = #{record.incomeAmount,jdbcType=DECIMAL}"); } if (record.getAccTradeNo() != null) { @@ -596,7 +596,7 @@ public class BsTradeOrderSqlProvider { } if (record.getSettleDate() != null) { - sql.SET("settle_date = #{record.settleDate,jdbcType=TIMESTAMP}"); + sql.SET("settle_date = #{record.settleDate,jdbcType=DATE}"); } if (record.getAccPaymentCode() != null) { @@ -722,14 +722,14 @@ public class BsTradeOrderSqlProvider { sql.SET("user_discount_price = #{record.userDiscountPrice,jdbcType=DECIMAL}"); sql.SET("user_discount_actual_price = #{record.userDiscountActualPrice,jdbcType=DECIMAL}"); sql.SET("trade_actual_amount = #{record.tradeActualAmount,jdbcType=DECIMAL}"); - sql.SET("income_amout = #{record.incomeAmout,jdbcType=DECIMAL}"); + sql.SET("income_amount = #{record.incomeAmount,jdbcType=DECIMAL}"); sql.SET("acc_trade_no = #{record.accTradeNo,jdbcType=VARCHAR}"); sql.SET("acc_mdiscount_amount = #{record.accMdiscountAmount,jdbcType=DECIMAL}"); sql.SET("acc_discount_amount = #{record.accDiscountAmount,jdbcType=DECIMAL}"); sql.SET("shd_fee_amt = #{record.shdFeeAmt,jdbcType=DECIMAL}"); sql.SET("fee_rate = #{record.feeRate,jdbcType=DECIMAL}"); sql.SET("settle_amount = #{record.settleAmount,jdbcType=DECIMAL}"); - sql.SET("settle_date = #{record.settleDate,jdbcType=TIMESTAMP}"); + sql.SET("settle_date = #{record.settleDate,jdbcType=DATE}"); sql.SET("acc_payment_code = #{record.accPaymentCode,jdbcType=VARCHAR}"); sql.SET("card_type = #{record.cardType,jdbcType=VARCHAR}"); sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); @@ -926,8 +926,8 @@ public class BsTradeOrderSqlProvider { sql.SET("trade_actual_amount = #{tradeActualAmount,jdbcType=DECIMAL}"); } - if (record.getIncomeAmout() != null) { - sql.SET("income_amout = #{incomeAmout,jdbcType=DECIMAL}"); + if (record.getIncomeAmount() != null) { + sql.SET("income_amount = #{incomeAmount,jdbcType=DECIMAL}"); } if (record.getAccTradeNo() != null) { @@ -955,7 +955,7 @@ public class BsTradeOrderSqlProvider { } if (record.getSettleDate() != null) { - sql.SET("settle_date = #{settleDate,jdbcType=TIMESTAMP}"); + sql.SET("settle_date = #{settleDate,jdbcType=DATE}"); } if (record.getAccPaymentCode() != null) { diff --git a/service/src/main/java/com/hfkj/entity/BsTradeOrder.java b/service/src/main/java/com/hfkj/entity/BsTradeOrder.java index 4a52b3a..59f7c11 100644 --- a/service/src/main/java/com/hfkj/entity/BsTradeOrder.java +++ b/service/src/main/java/com/hfkj/entity/BsTradeOrder.java @@ -236,7 +236,7 @@ public class BsTradeOrder implements Serializable { /** * 商家交易入账金额 */ - private BigDecimal incomeAmout; + private BigDecimal incomeAmount; /** * 账户端交易流水号 @@ -700,12 +700,12 @@ public class BsTradeOrder implements Serializable { this.tradeActualAmount = tradeActualAmount; } - public BigDecimal getIncomeAmout() { - return incomeAmout; + public BigDecimal getIncomeAmount() { + return incomeAmount; } - public void setIncomeAmout(BigDecimal incomeAmout) { - this.incomeAmout = incomeAmout; + public void setIncomeAmount(BigDecimal incomeAmount) { + this.incomeAmount = incomeAmount; } public String getAccTradeNo() { @@ -963,7 +963,7 @@ public class BsTradeOrder implements Serializable { && (this.getUserDiscountPrice() == null ? other.getUserDiscountPrice() == null : this.getUserDiscountPrice().equals(other.getUserDiscountPrice())) && (this.getUserDiscountActualPrice() == null ? other.getUserDiscountActualPrice() == null : this.getUserDiscountActualPrice().equals(other.getUserDiscountActualPrice())) && (this.getTradeActualAmount() == null ? other.getTradeActualAmount() == null : this.getTradeActualAmount().equals(other.getTradeActualAmount())) - && (this.getIncomeAmout() == null ? other.getIncomeAmout() == null : this.getIncomeAmout().equals(other.getIncomeAmout())) + && (this.getIncomeAmount() == null ? other.getIncomeAmount() == null : this.getIncomeAmount().equals(other.getIncomeAmount())) && (this.getAccTradeNo() == null ? other.getAccTradeNo() == null : this.getAccTradeNo().equals(other.getAccTradeNo())) && (this.getAccMdiscountAmount() == null ? other.getAccMdiscountAmount() == null : this.getAccMdiscountAmount().equals(other.getAccMdiscountAmount())) && (this.getAccDiscountAmount() == null ? other.getAccDiscountAmount() == null : this.getAccDiscountAmount().equals(other.getAccDiscountAmount())) @@ -1038,7 +1038,7 @@ public class BsTradeOrder implements Serializable { result = prime * result + ((getUserDiscountPrice() == null) ? 0 : getUserDiscountPrice().hashCode()); result = prime * result + ((getUserDiscountActualPrice() == null) ? 0 : getUserDiscountActualPrice().hashCode()); result = prime * result + ((getTradeActualAmount() == null) ? 0 : getTradeActualAmount().hashCode()); - result = prime * result + ((getIncomeAmout() == null) ? 0 : getIncomeAmout().hashCode()); + result = prime * result + ((getIncomeAmount() == null) ? 0 : getIncomeAmount().hashCode()); result = prime * result + ((getAccTradeNo() == null) ? 0 : getAccTradeNo().hashCode()); result = prime * result + ((getAccMdiscountAmount() == null) ? 0 : getAccMdiscountAmount().hashCode()); result = prime * result + ((getAccDiscountAmount() == null) ? 0 : getAccDiscountAmount().hashCode()); @@ -1116,7 +1116,7 @@ public class BsTradeOrder implements Serializable { sb.append(", userDiscountPrice=").append(userDiscountPrice); sb.append(", userDiscountActualPrice=").append(userDiscountActualPrice); sb.append(", tradeActualAmount=").append(tradeActualAmount); - sb.append(", incomeAmout=").append(incomeAmout); + sb.append(", incomeAmount=").append(incomeAmount); sb.append(", accTradeNo=").append(accTradeNo); sb.append(", accMdiscountAmount=").append(accMdiscountAmount); sb.append(", accDiscountAmount=").append(accDiscountAmount); diff --git a/service/src/main/java/com/hfkj/entity/BsTradeOrderExample.java b/service/src/main/java/com/hfkj/entity/BsTradeOrderExample.java index 1e044c9..7c7f105 100644 --- a/service/src/main/java/com/hfkj/entity/BsTradeOrderExample.java +++ b/service/src/main/java/com/hfkj/entity/BsTradeOrderExample.java @@ -3,6 +3,7 @@ package com.hfkj.entity; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Date; +import java.util.Iterator; import java.util.List; public class BsTradeOrderExample { @@ -126,6 +127,32 @@ public class BsTradeOrderExample { criteria.add(new Criterion(condition, value1, value2)); } + protected void addCriterionForJDBCDate(String condition, Date value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + addCriterion(condition, new java.sql.Date(value.getTime()), property); + } + + protected void addCriterionForJDBCDate(String condition, List values, String property) { + if (values == null || values.size() == 0) { + throw new RuntimeException("Value list for " + property + " cannot be null or empty"); + } + List dateList = new ArrayList(); + Iterator iter = values.iterator(); + while (iter.hasNext()) { + dateList.add(new java.sql.Date(iter.next().getTime())); + } + addCriterion(condition, dateList, property); + } + + protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + addCriterion(condition, new java.sql.Date(value1.getTime()), new java.sql.Date(value2.getTime()), property); + } + public Criteria andIdIsNull() { addCriterion("id is null"); return (Criteria) this; @@ -2876,63 +2903,63 @@ public class BsTradeOrderExample { return (Criteria) this; } - public Criteria andIncomeAmoutIsNull() { - addCriterion("income_amout is null"); + public Criteria andIncomeAmountIsNull() { + addCriterion("income_amount is null"); return (Criteria) this; } - public Criteria andIncomeAmoutIsNotNull() { - addCriterion("income_amout is not null"); + public Criteria andIncomeAmountIsNotNull() { + addCriterion("income_amount is not null"); return (Criteria) this; } - public Criteria andIncomeAmoutEqualTo(BigDecimal value) { - addCriterion("income_amout =", value, "incomeAmout"); + public Criteria andIncomeAmountEqualTo(BigDecimal value) { + addCriterion("income_amount =", value, "incomeAmount"); return (Criteria) this; } - public Criteria andIncomeAmoutNotEqualTo(BigDecimal value) { - addCriterion("income_amout <>", value, "incomeAmout"); + public Criteria andIncomeAmountNotEqualTo(BigDecimal value) { + addCriterion("income_amount <>", value, "incomeAmount"); return (Criteria) this; } - public Criteria andIncomeAmoutGreaterThan(BigDecimal value) { - addCriterion("income_amout >", value, "incomeAmout"); + public Criteria andIncomeAmountGreaterThan(BigDecimal value) { + addCriterion("income_amount >", value, "incomeAmount"); return (Criteria) this; } - public Criteria andIncomeAmoutGreaterThanOrEqualTo(BigDecimal value) { - addCriterion("income_amout >=", value, "incomeAmout"); + public Criteria andIncomeAmountGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("income_amount >=", value, "incomeAmount"); return (Criteria) this; } - public Criteria andIncomeAmoutLessThan(BigDecimal value) { - addCriterion("income_amout <", value, "incomeAmout"); + public Criteria andIncomeAmountLessThan(BigDecimal value) { + addCriterion("income_amount <", value, "incomeAmount"); return (Criteria) this; } - public Criteria andIncomeAmoutLessThanOrEqualTo(BigDecimal value) { - addCriterion("income_amout <=", value, "incomeAmout"); + public Criteria andIncomeAmountLessThanOrEqualTo(BigDecimal value) { + addCriterion("income_amount <=", value, "incomeAmount"); return (Criteria) this; } - public Criteria andIncomeAmoutIn(List values) { - addCriterion("income_amout in", values, "incomeAmout"); + public Criteria andIncomeAmountIn(List values) { + addCriterion("income_amount in", values, "incomeAmount"); return (Criteria) this; } - public Criteria andIncomeAmoutNotIn(List values) { - addCriterion("income_amout not in", values, "incomeAmout"); + public Criteria andIncomeAmountNotIn(List values) { + addCriterion("income_amount not in", values, "incomeAmount"); return (Criteria) this; } - public Criteria andIncomeAmoutBetween(BigDecimal value1, BigDecimal value2) { - addCriterion("income_amout between", value1, value2, "incomeAmout"); + public Criteria andIncomeAmountBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("income_amount between", value1, value2, "incomeAmount"); return (Criteria) this; } - public Criteria andIncomeAmoutNotBetween(BigDecimal value1, BigDecimal value2) { - addCriterion("income_amout not between", value1, value2, "incomeAmout"); + public Criteria andIncomeAmountNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("income_amount not between", value1, value2, "incomeAmount"); return (Criteria) this; } @@ -3317,52 +3344,52 @@ public class BsTradeOrderExample { } public Criteria andSettleDateEqualTo(Date value) { - addCriterion("settle_date =", value, "settleDate"); + addCriterionForJDBCDate("settle_date =", value, "settleDate"); return (Criteria) this; } public Criteria andSettleDateNotEqualTo(Date value) { - addCriterion("settle_date <>", value, "settleDate"); + addCriterionForJDBCDate("settle_date <>", value, "settleDate"); return (Criteria) this; } public Criteria andSettleDateGreaterThan(Date value) { - addCriterion("settle_date >", value, "settleDate"); + addCriterionForJDBCDate("settle_date >", value, "settleDate"); return (Criteria) this; } public Criteria andSettleDateGreaterThanOrEqualTo(Date value) { - addCriterion("settle_date >=", value, "settleDate"); + addCriterionForJDBCDate("settle_date >=", value, "settleDate"); return (Criteria) this; } public Criteria andSettleDateLessThan(Date value) { - addCriterion("settle_date <", value, "settleDate"); + addCriterionForJDBCDate("settle_date <", value, "settleDate"); return (Criteria) this; } public Criteria andSettleDateLessThanOrEqualTo(Date value) { - addCriterion("settle_date <=", value, "settleDate"); + addCriterionForJDBCDate("settle_date <=", value, "settleDate"); return (Criteria) this; } public Criteria andSettleDateIn(List values) { - addCriterion("settle_date in", values, "settleDate"); + addCriterionForJDBCDate("settle_date in", values, "settleDate"); return (Criteria) this; } public Criteria andSettleDateNotIn(List values) { - addCriterion("settle_date not in", values, "settleDate"); + addCriterionForJDBCDate("settle_date not in", values, "settleDate"); return (Criteria) this; } public Criteria andSettleDateBetween(Date value1, Date value2) { - addCriterion("settle_date between", value1, value2, "settleDate"); + addCriterionForJDBCDate("settle_date between", value1, value2, "settleDate"); return (Criteria) this; } public Criteria andSettleDateNotBetween(Date value1, Date value2) { - addCriterion("settle_date not between", value1, value2, "settleDate"); + addCriterionForJDBCDate("settle_date not between", value1, value2, "settleDate"); return (Criteria) this; } diff --git a/service/src/main/java/com/hfkj/service/BsTradeOrderService.java b/service/src/main/java/com/hfkj/service/BsTradeOrderService.java index 06944fa..4e32949 100644 --- a/service/src/main/java/com/hfkj/service/BsTradeOrderService.java +++ b/service/src/main/java/com/hfkj/service/BsTradeOrderService.java @@ -73,5 +73,12 @@ public interface BsTradeOrderService { */ Map countTradeOrderPrice(Map param); + /** + * 交易详情统计 + * @param param + * @return + */ + List> getTradeOrderDetailCount(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 da179ab..9b162e5 100644 --- a/service/src/main/java/com/hfkj/service/impl/BsTradeOrderServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/impl/BsTradeOrderServiceImpl.java @@ -417,4 +417,11 @@ public class BsTradeOrderServiceImpl implements BsTradeOrderService { return tradeOrderMapper.countTradeOrderPrice(paramMap); } + @Override + public List> getTradeOrderDetailCount(Map param) { + param.put("settleTimeS", DateUtil.date2String(new Date(MapUtils.getLong(param, "settleTimeS")), DateUtil.Y_M_D)); + param.put("settleTimeE", DateUtil.date2String(new Date(MapUtils.getLong(param, "settleTimeE")), DateUtil.Y_M_D)); + return tradeOrderMapper.queryTradeOrderDetailCount(param); + } + }