提交代码

yy_dev
胡锐 1 year ago
parent f81fc16dc4
commit 4839974e3d
  1. 1
      bweb/src/main/java/com/bweb/config/AuthConfig.java
  2. 83
      bweb/src/main/java/com/bweb/controller/BsTradeOrderController.java
  3. 6
      cweb/src/main/java/com/cweb/notify/LaKaLaController.java
  4. 20
      service/src/main/java/com/hfkj/dao/BsTradeOrderMapper.java
  5. 26
      service/src/main/java/com/hfkj/dao/BsTradeOrderMapperExt.java
  6. 24
      service/src/main/java/com/hfkj/dao/BsTradeOrderSqlProvider.java
  7. 16
      service/src/main/java/com/hfkj/entity/BsTradeOrder.java
  8. 95
      service/src/main/java/com/hfkj/entity/BsTradeOrderExample.java
  9. 7
      service/src/main/java/com/hfkj/service/BsTradeOrderService.java
  10. 7
      service/src/main/java/com/hfkj/service/impl/BsTradeOrderServiceImpl.java

@ -100,6 +100,7 @@ public class AuthConfig implements WebMvcConfigurer {
.excludePathPatterns("/laKaLaNotify/merContract") .excludePathPatterns("/laKaLaNotify/merContract")
.excludePathPatterns("/openApi/*") .excludePathPatterns("/openApi/*")
.excludePathPatterns("/sysVersion/*") .excludePathPatterns("/sysVersion/*")
.excludePathPatterns("/tradeOrder/*")
; ;
} }

@ -12,6 +12,7 @@ import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.EasyExcelUtil; import com.hfkj.common.utils.EasyExcelUtil;
import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.config.CommonSysConst; import com.hfkj.config.CommonSysConst;
import com.hfkj.entity.BsMer;
import com.hfkj.entity.BsPayQrCode; import com.hfkj.entity.BsPayQrCode;
import com.hfkj.entity.BsTradeOrder; import com.hfkj.entity.BsTradeOrder;
import com.hfkj.model.ResponseData; import com.hfkj.model.ResponseData;
@ -23,6 +24,7 @@ import com.hfkj.sysenum.TradeOrderPayModeEnum;
import com.hfkj.sysenum.TradeOrderStatusEnum; import com.hfkj.sysenum.TradeOrderStatusEnum;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections4.MapUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
@ -30,6 +32,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.File; import java.io.File;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -51,6 +54,9 @@ public class BsTradeOrderController {
@Resource @Resource
private BsTradeOrderRefundService tradeOrderRefundService; private BsTradeOrderRefundService tradeOrderRefundService;
@Resource
private BsMerService merService;
@RequestMapping(value="/getOrderList",method = RequestMethod.GET) @RequestMapping(value="/getOrderList",method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "查询订单列表") @ApiOperation(value = "查询订单列表")
@ -257,10 +263,44 @@ public class BsTradeOrderController {
@RequestMapping(value="/queryCheckingDetail",method = RequestMethod.GET) @RequestMapping(value="/queryCheckingDetail",method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "根据交易订单号 查询订单信息") @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 { try {
// 查询商户
BsMer mer = merService.getMer(merNo);
if (mer == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户");
}
Map<String, Object> param = new HashMap<>();
param.put("merNo", merNo);
param.put("settleTimeS", settleTimeS);
param.put("settleTimeE", settleTimeE);
// 查询交易详情
List<Map<String, Object>> mapList = tradeOrderService.getTradeOrderDetailCount(param);
int totalTradeNum = 0;
BigDecimal totalTradeAmount = new BigDecimal("0");
BigDecimal totalSettleAmount = new BigDecimal("0");
BigDecimal totalShdFeeAmount = new BigDecimal("0");
for (Map<String,Object> 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<String, Object> 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) { } catch (Exception e) {
log.error(e.getMessage(), 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 @ResponseBody
@ApiOperation(value = "根据交易订单号 查询订单信息") @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 { try {
// 查询商户
BsMer mer = merService.getMer(merNo);
if (mer == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户");
}
Map<String, Object> param = new HashMap<>();
param.put("merNo", merNo);
param.put("settleTimeS", settleTimeS);
param.put("settleTimeE", settleTimeE);
// 查询交易详情
List<Map<String, Object>> mapList = tradeOrderService.getTradeOrderDetailCount(param);
int totalTradeNum = 0;
BigDecimal totalTradeAmount = new BigDecimal("0");
BigDecimal totalSettleAmount = new BigDecimal("0");
BigDecimal totalShdFeeAmount = new BigDecimal("0");
for (Map<String,Object> 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<String, Object> 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) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);

@ -77,6 +77,12 @@ public class LaKaLaController {
other.put("log_no", body.getString("log_no")); other.put("log_no", body.getString("log_no"));
other.put("acc_trade_no", body.getString("acc_trade_no")); other.put("acc_trade_no", body.getString("acc_trade_no"));
other.put("card_type", body.getString("card_type")); 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( tradeOrderService.paySuccess(
body.getString("out_trade_no"), body.getString("out_trade_no"),

@ -59,7 +59,7 @@ public interface BsTradeOrderMapper extends BsTradeOrderMapperExt {
"user_phone, user_discount_id, ", "user_phone, user_discount_id, ",
"user_discount_name, user_discount_type, ", "user_discount_name, user_discount_type, ",
"user_discount_price, user_discount_actual_price, ", "user_discount_price, user_discount_actual_price, ",
"trade_actual_amount, income_amout, ", "trade_actual_amount, income_amount, ",
"acc_trade_no, acc_mdiscount_amount, ", "acc_trade_no, acc_mdiscount_amount, ",
"acc_discount_amount, shd_fee_amt, ", "acc_discount_amount, shd_fee_amt, ",
"fee_rate, settle_amount, ", "fee_rate, settle_amount, ",
@ -92,11 +92,11 @@ public interface BsTradeOrderMapper extends BsTradeOrderMapperExt {
"#{userPhone,jdbcType=VARCHAR}, #{userDiscountId,jdbcType=BIGINT}, ", "#{userPhone,jdbcType=VARCHAR}, #{userDiscountId,jdbcType=BIGINT}, ",
"#{userDiscountName,jdbcType=VARCHAR}, #{userDiscountType,jdbcType=INTEGER}, ", "#{userDiscountName,jdbcType=VARCHAR}, #{userDiscountType,jdbcType=INTEGER}, ",
"#{userDiscountPrice,jdbcType=DECIMAL}, #{userDiscountActualPrice,jdbcType=DECIMAL}, ", "#{userDiscountPrice,jdbcType=DECIMAL}, #{userDiscountActualPrice,jdbcType=DECIMAL}, ",
"#{tradeActualAmount,jdbcType=DECIMAL}, #{incomeAmout,jdbcType=DECIMAL}, ", "#{tradeActualAmount,jdbcType=DECIMAL}, #{incomeAmount,jdbcType=DECIMAL}, ",
"#{accTradeNo,jdbcType=VARCHAR}, #{accMdiscountAmount,jdbcType=DECIMAL}, ", "#{accTradeNo,jdbcType=VARCHAR}, #{accMdiscountAmount,jdbcType=DECIMAL}, ",
"#{accDiscountAmount,jdbcType=DECIMAL}, #{shdFeeAmt,jdbcType=DECIMAL}, ", "#{accDiscountAmount,jdbcType=DECIMAL}, #{shdFeeAmt,jdbcType=DECIMAL}, ",
"#{feeRate,jdbcType=DECIMAL}, #{settleAmount,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}, ", "#{cardType,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{profitSharingStatus,jdbcType=BIT}, #{payTime,jdbcType=TIMESTAMP}, ", "#{profitSharingStatus,jdbcType=BIT}, #{payTime,jdbcType=TIMESTAMP}, ",
"#{timeoutExpress,jdbcType=INTEGER}, #{subject,jdbcType=VARCHAR}, ", "#{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_price", property="userDiscountPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="user_discount_actual_price", property="userDiscountActualPrice", 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="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_trade_no", property="accTradeNo", jdbcType=JdbcType.VARCHAR),
@Result(column="acc_mdiscount_amount", property="accMdiscountAmount", jdbcType=JdbcType.DECIMAL), @Result(column="acc_mdiscount_amount", property="accMdiscountAmount", jdbcType=JdbcType.DECIMAL),
@Result(column="acc_discount_amount", property="accDiscountAmount", 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="shd_fee_amt", property="shdFeeAmt", jdbcType=JdbcType.DECIMAL),
@Result(column="fee_rate", property="feeRate", jdbcType=JdbcType.DECIMAL), @Result(column="fee_rate", property="feeRate", jdbcType=JdbcType.DECIMAL),
@Result(column="settle_amount", property="settleAmount", 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="acc_payment_code", property="accPaymentCode", jdbcType=JdbcType.VARCHAR),
@Result(column="card_type", property="cardType", jdbcType=JdbcType.VARCHAR), @Result(column="card_type", property="cardType", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @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_condition, store_discount_price, store_discount_final_cost_price, ",
"store_discount_actual_price, store_discount_profit_price, user_id, user_phone, ", "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_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, ", "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, ", "settle_date, acc_payment_code, card_type, `status`, profit_sharing_status, pay_time, ",
"timeout_express, subject, pay_notify_url, attach, refund_type, refund_price, ", "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_price", property="userDiscountPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="user_discount_actual_price", property="userDiscountActualPrice", 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="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_trade_no", property="accTradeNo", jdbcType=JdbcType.VARCHAR),
@Result(column="acc_mdiscount_amount", property="accMdiscountAmount", jdbcType=JdbcType.DECIMAL), @Result(column="acc_mdiscount_amount", property="accMdiscountAmount", jdbcType=JdbcType.DECIMAL),
@Result(column="acc_discount_amount", property="accDiscountAmount", 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="shd_fee_amt", property="shdFeeAmt", jdbcType=JdbcType.DECIMAL),
@Result(column="fee_rate", property="feeRate", jdbcType=JdbcType.DECIMAL), @Result(column="fee_rate", property="feeRate", jdbcType=JdbcType.DECIMAL),
@Result(column="settle_amount", property="settleAmount", 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="acc_payment_code", property="accPaymentCode", jdbcType=JdbcType.VARCHAR),
@Result(column="card_type", property="cardType", jdbcType=JdbcType.VARCHAR), @Result(column="card_type", property="cardType", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @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_price = #{userDiscountPrice,jdbcType=DECIMAL},",
"user_discount_actual_price = #{userDiscountActualPrice,jdbcType=DECIMAL},", "user_discount_actual_price = #{userDiscountActualPrice,jdbcType=DECIMAL},",
"trade_actual_amount = #{tradeActualAmount,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_trade_no = #{accTradeNo,jdbcType=VARCHAR},",
"acc_mdiscount_amount = #{accMdiscountAmount,jdbcType=DECIMAL},", "acc_mdiscount_amount = #{accMdiscountAmount,jdbcType=DECIMAL},",
"acc_discount_amount = #{accDiscountAmount,jdbcType=DECIMAL},", "acc_discount_amount = #{accDiscountAmount,jdbcType=DECIMAL},",
"shd_fee_amt = #{shdFeeAmt,jdbcType=DECIMAL},", "shd_fee_amt = #{shdFeeAmt,jdbcType=DECIMAL},",
"fee_rate = #{feeRate,jdbcType=DECIMAL},", "fee_rate = #{feeRate,jdbcType=DECIMAL},",
"settle_amount = #{settleAmount,jdbcType=DECIMAL},", "settle_amount = #{settleAmount,jdbcType=DECIMAL},",
"settle_date = #{settleDate,jdbcType=TIMESTAMP},", "settle_date = #{settleDate,jdbcType=DATE},",
"acc_payment_code = #{accPaymentCode,jdbcType=VARCHAR},", "acc_payment_code = #{accPaymentCode,jdbcType=VARCHAR},",
"card_type = #{cardType,jdbcType=VARCHAR},", "card_type = #{cardType,jdbcType=VARCHAR},",
"`status` = #{status,jdbcType=INTEGER},", "`status` = #{status,jdbcType=INTEGER},",

@ -4,6 +4,7 @@ import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
@ -31,4 +32,29 @@ public interface BsTradeOrderMapperExt {
"</script>") "</script>")
Map<String,Object> countTradeOrderPrice(@Param("param") Map<String, Object> param); Map<String,Object> countTradeOrderPrice(@Param("param") Map<String, Object> param);
@Select("<script>" +
" select " +
" a.days settleDay," +
" #{param.merNo} merNo, " +
" case when b.tradeNum is null then 0 else b.tradeNum end tradeNum, " +
" case when b.tradeAmount is null then 0 else b.tradeAmount end tradeAmount, " +
" case when b.settleAmount is null then 0 else b.settleAmount end settleAmount, " +
" case when b.shdFeeAmount is null then 0 else b.shdFeeAmount end shdFeeAmount " +
" from ( " +
" SELECT date_add(date_sub(#{param.settleTimeS},interval 1 day), INTERVAL ( cast( help_topic_id AS signed INTEGER ) + 1 ) day) days " +
" FROM mysql.help_topic " +
" WHERE help_topic_id <![CDATA[ < ]]> DATEDIFF(#{param.settleTimeE},date_sub(#{param.settleTimeS},interval 1 day)) ORDER BY help_topic_id) a " +
" LEFT JOIN (select " +
" settle_date, " +
" count(1) tradeNum, " +
" sum(income_amount) tradeAmount, " +
" sum(settle_amount) settleAmount, " +
" sum(shd_fee_amt) shdFeeAmount " +
" from bs_trade_order " +
" where mer_no = #{param.merNo} and `status` = 3 and settle_date between #{param.settleTimeS} and #{param.settleTimeE} GROUP BY settle_date) b on b.settle_date = a.days " +
" ORDER BY a.days desc " +
" </script>")
List<Map<String,Object>> queryTradeOrderDetailCount(@Param("param") Map<String, Object> param);
} }

@ -196,8 +196,8 @@ public class BsTradeOrderSqlProvider {
sql.VALUES("trade_actual_amount", "#{tradeActualAmount,jdbcType=DECIMAL}"); sql.VALUES("trade_actual_amount", "#{tradeActualAmount,jdbcType=DECIMAL}");
} }
if (record.getIncomeAmout() != null) { if (record.getIncomeAmount() != null) {
sql.VALUES("income_amout", "#{incomeAmout,jdbcType=DECIMAL}"); sql.VALUES("income_amount", "#{incomeAmount,jdbcType=DECIMAL}");
} }
if (record.getAccTradeNo() != null) { if (record.getAccTradeNo() != null) {
@ -225,7 +225,7 @@ public class BsTradeOrderSqlProvider {
} }
if (record.getSettleDate() != null) { if (record.getSettleDate() != null) {
sql.VALUES("settle_date", "#{settleDate,jdbcType=TIMESTAMP}"); sql.VALUES("settle_date", "#{settleDate,jdbcType=DATE}");
} }
if (record.getAccPaymentCode() != null) { if (record.getAccPaymentCode() != null) {
@ -352,7 +352,7 @@ public class BsTradeOrderSqlProvider {
sql.SELECT("user_discount_price"); sql.SELECT("user_discount_price");
sql.SELECT("user_discount_actual_price"); sql.SELECT("user_discount_actual_price");
sql.SELECT("trade_actual_amount"); sql.SELECT("trade_actual_amount");
sql.SELECT("income_amout"); sql.SELECT("income_amount");
sql.SELECT("acc_trade_no"); sql.SELECT("acc_trade_no");
sql.SELECT("acc_mdiscount_amount"); sql.SELECT("acc_mdiscount_amount");
sql.SELECT("acc_discount_amount"); sql.SELECT("acc_discount_amount");
@ -567,8 +567,8 @@ public class BsTradeOrderSqlProvider {
sql.SET("trade_actual_amount = #{record.tradeActualAmount,jdbcType=DECIMAL}"); sql.SET("trade_actual_amount = #{record.tradeActualAmount,jdbcType=DECIMAL}");
} }
if (record.getIncomeAmout() != null) { if (record.getIncomeAmount() != null) {
sql.SET("income_amout = #{record.incomeAmout,jdbcType=DECIMAL}"); sql.SET("income_amount = #{record.incomeAmount,jdbcType=DECIMAL}");
} }
if (record.getAccTradeNo() != null) { if (record.getAccTradeNo() != null) {
@ -596,7 +596,7 @@ public class BsTradeOrderSqlProvider {
} }
if (record.getSettleDate() != null) { if (record.getSettleDate() != null) {
sql.SET("settle_date = #{record.settleDate,jdbcType=TIMESTAMP}"); sql.SET("settle_date = #{record.settleDate,jdbcType=DATE}");
} }
if (record.getAccPaymentCode() != null) { if (record.getAccPaymentCode() != null) {
@ -722,14 +722,14 @@ public class BsTradeOrderSqlProvider {
sql.SET("user_discount_price = #{record.userDiscountPrice,jdbcType=DECIMAL}"); sql.SET("user_discount_price = #{record.userDiscountPrice,jdbcType=DECIMAL}");
sql.SET("user_discount_actual_price = #{record.userDiscountActualPrice,jdbcType=DECIMAL}"); sql.SET("user_discount_actual_price = #{record.userDiscountActualPrice,jdbcType=DECIMAL}");
sql.SET("trade_actual_amount = #{record.tradeActualAmount,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_trade_no = #{record.accTradeNo,jdbcType=VARCHAR}");
sql.SET("acc_mdiscount_amount = #{record.accMdiscountAmount,jdbcType=DECIMAL}"); sql.SET("acc_mdiscount_amount = #{record.accMdiscountAmount,jdbcType=DECIMAL}");
sql.SET("acc_discount_amount = #{record.accDiscountAmount,jdbcType=DECIMAL}"); sql.SET("acc_discount_amount = #{record.accDiscountAmount,jdbcType=DECIMAL}");
sql.SET("shd_fee_amt = #{record.shdFeeAmt,jdbcType=DECIMAL}"); sql.SET("shd_fee_amt = #{record.shdFeeAmt,jdbcType=DECIMAL}");
sql.SET("fee_rate = #{record.feeRate,jdbcType=DECIMAL}"); sql.SET("fee_rate = #{record.feeRate,jdbcType=DECIMAL}");
sql.SET("settle_amount = #{record.settleAmount,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("acc_payment_code = #{record.accPaymentCode,jdbcType=VARCHAR}");
sql.SET("card_type = #{record.cardType,jdbcType=VARCHAR}"); sql.SET("card_type = #{record.cardType,jdbcType=VARCHAR}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
@ -926,8 +926,8 @@ public class BsTradeOrderSqlProvider {
sql.SET("trade_actual_amount = #{tradeActualAmount,jdbcType=DECIMAL}"); sql.SET("trade_actual_amount = #{tradeActualAmount,jdbcType=DECIMAL}");
} }
if (record.getIncomeAmout() != null) { if (record.getIncomeAmount() != null) {
sql.SET("income_amout = #{incomeAmout,jdbcType=DECIMAL}"); sql.SET("income_amount = #{incomeAmount,jdbcType=DECIMAL}");
} }
if (record.getAccTradeNo() != null) { if (record.getAccTradeNo() != null) {
@ -955,7 +955,7 @@ public class BsTradeOrderSqlProvider {
} }
if (record.getSettleDate() != null) { if (record.getSettleDate() != null) {
sql.SET("settle_date = #{settleDate,jdbcType=TIMESTAMP}"); sql.SET("settle_date = #{settleDate,jdbcType=DATE}");
} }
if (record.getAccPaymentCode() != null) { if (record.getAccPaymentCode() != null) {

@ -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; this.tradeActualAmount = tradeActualAmount;
} }
public BigDecimal getIncomeAmout() { public BigDecimal getIncomeAmount() {
return incomeAmout; return incomeAmount;
} }
public void setIncomeAmout(BigDecimal incomeAmout) { public void setIncomeAmount(BigDecimal incomeAmount) {
this.incomeAmout = incomeAmout; this.incomeAmount = incomeAmount;
} }
public String getAccTradeNo() { public String getAccTradeNo() {
@ -963,7 +963,7 @@ public class BsTradeOrder implements Serializable {
&& (this.getUserDiscountPrice() == null ? other.getUserDiscountPrice() == null : this.getUserDiscountPrice().equals(other.getUserDiscountPrice())) && (this.getUserDiscountPrice() == null ? other.getUserDiscountPrice() == null : this.getUserDiscountPrice().equals(other.getUserDiscountPrice()))
&& (this.getUserDiscountActualPrice() == null ? other.getUserDiscountActualPrice() == null : this.getUserDiscountActualPrice().equals(other.getUserDiscountActualPrice())) && (this.getUserDiscountActualPrice() == null ? other.getUserDiscountActualPrice() == null : this.getUserDiscountActualPrice().equals(other.getUserDiscountActualPrice()))
&& (this.getTradeActualAmount() == null ? other.getTradeActualAmount() == null : this.getTradeActualAmount().equals(other.getTradeActualAmount())) && (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.getAccTradeNo() == null ? other.getAccTradeNo() == null : this.getAccTradeNo().equals(other.getAccTradeNo()))
&& (this.getAccMdiscountAmount() == null ? other.getAccMdiscountAmount() == null : this.getAccMdiscountAmount().equals(other.getAccMdiscountAmount())) && (this.getAccMdiscountAmount() == null ? other.getAccMdiscountAmount() == null : this.getAccMdiscountAmount().equals(other.getAccMdiscountAmount()))
&& (this.getAccDiscountAmount() == null ? other.getAccDiscountAmount() == null : this.getAccDiscountAmount().equals(other.getAccDiscountAmount())) && (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 + ((getUserDiscountPrice() == null) ? 0 : getUserDiscountPrice().hashCode());
result = prime * result + ((getUserDiscountActualPrice() == null) ? 0 : getUserDiscountActualPrice().hashCode()); result = prime * result + ((getUserDiscountActualPrice() == null) ? 0 : getUserDiscountActualPrice().hashCode());
result = prime * result + ((getTradeActualAmount() == null) ? 0 : getTradeActualAmount().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 + ((getAccTradeNo() == null) ? 0 : getAccTradeNo().hashCode());
result = prime * result + ((getAccMdiscountAmount() == null) ? 0 : getAccMdiscountAmount().hashCode()); result = prime * result + ((getAccMdiscountAmount() == null) ? 0 : getAccMdiscountAmount().hashCode());
result = prime * result + ((getAccDiscountAmount() == null) ? 0 : getAccDiscountAmount().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(", userDiscountPrice=").append(userDiscountPrice);
sb.append(", userDiscountActualPrice=").append(userDiscountActualPrice); sb.append(", userDiscountActualPrice=").append(userDiscountActualPrice);
sb.append(", tradeActualAmount=").append(tradeActualAmount); sb.append(", tradeActualAmount=").append(tradeActualAmount);
sb.append(", incomeAmout=").append(incomeAmout); sb.append(", incomeAmount=").append(incomeAmount);
sb.append(", accTradeNo=").append(accTradeNo); sb.append(", accTradeNo=").append(accTradeNo);
sb.append(", accMdiscountAmount=").append(accMdiscountAmount); sb.append(", accMdiscountAmount=").append(accMdiscountAmount);
sb.append(", accDiscountAmount=").append(accDiscountAmount); sb.append(", accDiscountAmount=").append(accDiscountAmount);

@ -3,6 +3,7 @@ package com.hfkj.entity;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.Iterator;
import java.util.List; import java.util.List;
public class BsTradeOrderExample { public class BsTradeOrderExample {
@ -126,6 +127,32 @@ public class BsTradeOrderExample {
criteria.add(new Criterion(condition, value1, value2)); 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<Date> values, String property) {
if (values == null || values.size() == 0) {
throw new RuntimeException("Value list for " + property + " cannot be null or empty");
}
List<java.sql.Date> dateList = new ArrayList<java.sql.Date>();
Iterator<Date> 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() { public Criteria andIdIsNull() {
addCriterion("id is null"); addCriterion("id is null");
return (Criteria) this; return (Criteria) this;
@ -2876,63 +2903,63 @@ public class BsTradeOrderExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andIncomeAmoutIsNull() { public Criteria andIncomeAmountIsNull() {
addCriterion("income_amout is null"); addCriterion("income_amount is null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andIncomeAmoutIsNotNull() { public Criteria andIncomeAmountIsNotNull() {
addCriterion("income_amout is not null"); addCriterion("income_amount is not null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andIncomeAmoutEqualTo(BigDecimal value) { public Criteria andIncomeAmountEqualTo(BigDecimal value) {
addCriterion("income_amout =", value, "incomeAmout"); addCriterion("income_amount =", value, "incomeAmount");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andIncomeAmoutNotEqualTo(BigDecimal value) { public Criteria andIncomeAmountNotEqualTo(BigDecimal value) {
addCriterion("income_amout <>", value, "incomeAmout"); addCriterion("income_amount <>", value, "incomeAmount");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andIncomeAmoutGreaterThan(BigDecimal value) { public Criteria andIncomeAmountGreaterThan(BigDecimal value) {
addCriterion("income_amout >", value, "incomeAmout"); addCriterion("income_amount >", value, "incomeAmount");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andIncomeAmoutGreaterThanOrEqualTo(BigDecimal value) { public Criteria andIncomeAmountGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("income_amout >=", value, "incomeAmout"); addCriterion("income_amount >=", value, "incomeAmount");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andIncomeAmoutLessThan(BigDecimal value) { public Criteria andIncomeAmountLessThan(BigDecimal value) {
addCriterion("income_amout <", value, "incomeAmout"); addCriterion("income_amount <", value, "incomeAmount");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andIncomeAmoutLessThanOrEqualTo(BigDecimal value) { public Criteria andIncomeAmountLessThanOrEqualTo(BigDecimal value) {
addCriterion("income_amout <=", value, "incomeAmout"); addCriterion("income_amount <=", value, "incomeAmount");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andIncomeAmoutIn(List<BigDecimal> values) { public Criteria andIncomeAmountIn(List<BigDecimal> values) {
addCriterion("income_amout in", values, "incomeAmout"); addCriterion("income_amount in", values, "incomeAmount");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andIncomeAmoutNotIn(List<BigDecimal> values) { public Criteria andIncomeAmountNotIn(List<BigDecimal> values) {
addCriterion("income_amout not in", values, "incomeAmout"); addCriterion("income_amount not in", values, "incomeAmount");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andIncomeAmoutBetween(BigDecimal value1, BigDecimal value2) { public Criteria andIncomeAmountBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("income_amout between", value1, value2, "incomeAmout"); addCriterion("income_amount between", value1, value2, "incomeAmount");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andIncomeAmoutNotBetween(BigDecimal value1, BigDecimal value2) { public Criteria andIncomeAmountNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("income_amout not between", value1, value2, "incomeAmout"); addCriterion("income_amount not between", value1, value2, "incomeAmount");
return (Criteria) this; return (Criteria) this;
} }
@ -3317,52 +3344,52 @@ public class BsTradeOrderExample {
} }
public Criteria andSettleDateEqualTo(Date value) { public Criteria andSettleDateEqualTo(Date value) {
addCriterion("settle_date =", value, "settleDate"); addCriterionForJDBCDate("settle_date =", value, "settleDate");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andSettleDateNotEqualTo(Date value) { public Criteria andSettleDateNotEqualTo(Date value) {
addCriterion("settle_date <>", value, "settleDate"); addCriterionForJDBCDate("settle_date <>", value, "settleDate");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andSettleDateGreaterThan(Date value) { public Criteria andSettleDateGreaterThan(Date value) {
addCriterion("settle_date >", value, "settleDate"); addCriterionForJDBCDate("settle_date >", value, "settleDate");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andSettleDateGreaterThanOrEqualTo(Date value) { public Criteria andSettleDateGreaterThanOrEqualTo(Date value) {
addCriterion("settle_date >=", value, "settleDate"); addCriterionForJDBCDate("settle_date >=", value, "settleDate");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andSettleDateLessThan(Date value) { public Criteria andSettleDateLessThan(Date value) {
addCriterion("settle_date <", value, "settleDate"); addCriterionForJDBCDate("settle_date <", value, "settleDate");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andSettleDateLessThanOrEqualTo(Date value) { public Criteria andSettleDateLessThanOrEqualTo(Date value) {
addCriterion("settle_date <=", value, "settleDate"); addCriterionForJDBCDate("settle_date <=", value, "settleDate");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andSettleDateIn(List<Date> values) { public Criteria andSettleDateIn(List<Date> values) {
addCriterion("settle_date in", values, "settleDate"); addCriterionForJDBCDate("settle_date in", values, "settleDate");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andSettleDateNotIn(List<Date> values) { public Criteria andSettleDateNotIn(List<Date> values) {
addCriterion("settle_date not in", values, "settleDate"); addCriterionForJDBCDate("settle_date not in", values, "settleDate");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andSettleDateBetween(Date value1, Date value2) { public Criteria andSettleDateBetween(Date value1, Date value2) {
addCriterion("settle_date between", value1, value2, "settleDate"); addCriterionForJDBCDate("settle_date between", value1, value2, "settleDate");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andSettleDateNotBetween(Date value1, Date value2) { 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; return (Criteria) this;
} }

@ -73,5 +73,12 @@ public interface BsTradeOrderService {
*/ */
Map<String,Object> countTradeOrderPrice(Map<String, Object> param); Map<String,Object> countTradeOrderPrice(Map<String, Object> param);
/**
* 交易详情统计
* @param param
* @return
*/
List<Map<String,Object>> getTradeOrderDetailCount(Map<String, Object> param);
} }

@ -417,4 +417,11 @@ public class BsTradeOrderServiceImpl implements BsTradeOrderService {
return tradeOrderMapper.countTradeOrderPrice(paramMap); return tradeOrderMapper.countTradeOrderPrice(paramMap);
} }
@Override
public List<Map<String, Object>> getTradeOrderDetailCount(Map<String, Object> 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);
}
} }

Loading…
Cancel
Save