mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
Merge branch 'dev' of https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web into dev
This commit is contained in:
@@ -2,6 +2,7 @@ package com.jsowell.pile.mapper;
|
||||
|
||||
import com.jsowell.pile.domain.MemberWalletLog;
|
||||
import com.jsowell.pile.dto.UniAppQueryMemberBalanceDTO;
|
||||
import com.jsowell.pile.vo.MemberWalletLogVO2;
|
||||
import com.jsowell.pile.vo.uniapp.customer.MemberBalanceVO;
|
||||
import com.jsowell.pile.vo.uniapp.customer.MemberWalletLogVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -102,4 +103,6 @@ public interface MemberWalletLogMapper {
|
||||
List<MemberBalanceVO> getMemberRefundAmount(List<String> memberIds);
|
||||
|
||||
List<MemberWalletLog> getOrderRecord(@Param("orderCode") String orderCode, @Param("type") String type);
|
||||
}
|
||||
|
||||
List<MemberWalletLogVO2> getByMemberId(String memberId);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.jsowell.pile.service;
|
||||
|
||||
import com.jsowell.pile.domain.MemberWalletLog;
|
||||
import com.jsowell.pile.vo.MemberWalletLogVO2;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -30,5 +31,7 @@ public interface MemberWalletLogService {
|
||||
int batchInsert(List<MemberWalletLog> list);
|
||||
|
||||
List<MemberWalletLog> getOrderRecord(String orderCode, String type);
|
||||
|
||||
List<MemberWalletLogVO2> getByMemberId(String memberId);
|
||||
}
|
||||
|
||||
|
||||
@@ -36,10 +36,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -612,9 +609,16 @@ public class MemberBasicInfoServiceImpl implements MemberBasicInfoService {
|
||||
*/
|
||||
@Override
|
||||
public List<MemberWalletLogVO> getMemberWalletDetail(UniAppQueryMemberBalanceDTO dto) {
|
||||
return memberWalletLogMapper.getMemberWalletDetail(dto);
|
||||
List<MemberWalletLogVO> memberWalletDetail = memberWalletLogMapper.getMemberWalletDetail(dto);
|
||||
for (MemberWalletLogVO log : memberWalletDetail) {
|
||||
if ("2".equals(log.getType()) && "21".equals(log.getSubType())) {
|
||||
log.setAmount(null);
|
||||
}
|
||||
}
|
||||
return memberWalletDetail;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<MemberWalletLogVO> getMemberWalletDetailV2(UniAppQueryMemberBalanceDTO dto) {
|
||||
return memberWalletLogMapper.getMemberWalletDetailV2(dto);
|
||||
|
||||
@@ -1,12 +1,21 @@
|
||||
package com.jsowell.pile.service.impl;
|
||||
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.pile.domain.MemberWalletLog;
|
||||
import com.jsowell.pile.dto.QueryMemberInfoDTO;
|
||||
import com.jsowell.pile.mapper.MemberWalletLogMapper;
|
||||
import com.jsowell.pile.service.MemberWalletLogService;
|
||||
import com.jsowell.pile.vo.MemberWalletLogVO2;
|
||||
import com.jsowell.pile.vo.uniapp.customer.MemberVO;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class MemberWalletLogServiceImpl implements MemberWalletLogService {
|
||||
@@ -73,5 +82,11 @@ public class MemberWalletLogServiceImpl implements MemberWalletLogService {
|
||||
public int batchInsert(List<MemberWalletLog> list) {
|
||||
return memberWalletLogMapper.batchInsert(list);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<MemberWalletLogVO2> getByMemberId(String memberId) {
|
||||
return memberWalletLogMapper.getByMemberId(memberId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.jsowell.pile.vo;
|
||||
import com.jsowell.common.annotation.Excel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import java.math.BigDecimal;
|
||||
/**
|
||||
* 会员钱包余额明细相关
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class MemberWalletLogVO2 {
|
||||
/**
|
||||
* 会员id
|
||||
*/
|
||||
@Excel(name = "会员id")
|
||||
private String memberId;
|
||||
|
||||
/**
|
||||
* 交易类型 1-进账;2-出账
|
||||
*/
|
||||
@Excel(name = "交易类型", readConverterExp = "1=进账,2=出账")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 钱包编号
|
||||
*/
|
||||
@Excel(name = "钱包编号")
|
||||
private String walletCode;
|
||||
|
||||
/**
|
||||
* 子类型 10-充值, 11-赠送, 12-订单结算退款,20-后管扣款, 21-订单付款, 22-用户退款
|
||||
*/
|
||||
@Excel(name = "操作类型(10-充值, 11-赠送, 12-订单结算退款,20-后管扣款, 21-订单付款, 22-用户退款)",
|
||||
readConverterExp = "10=充值,11=赠送,12=订单结算退款,20=后管扣款,21=订单付款,22=用户退款")
|
||||
private String subType;
|
||||
|
||||
/**
|
||||
* 充值/消费人员
|
||||
*/
|
||||
@Excel(name = "充值/消费人员")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 出账/入账金额
|
||||
*/
|
||||
@Excel(name = "出账/入账金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 交易时间
|
||||
*/
|
||||
@Excel(name = "交易时间")
|
||||
private String transactionTime;
|
||||
|
||||
/**
|
||||
* 余额类型(1-本金,2-赠送)
|
||||
*/
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 关联订单
|
||||
*/
|
||||
private String relatedOrderCode;
|
||||
|
||||
/**
|
||||
* 支付金额
|
||||
*/
|
||||
private BigDecimal payAmount;
|
||||
|
||||
/**
|
||||
* 订单金额
|
||||
*/
|
||||
private BigDecimal orderAmount;
|
||||
|
||||
/**
|
||||
* 退款金额
|
||||
*/
|
||||
private BigDecimal refundAmount;
|
||||
|
||||
/**
|
||||
* 变动前金额
|
||||
*/
|
||||
private BigDecimal beforeAmount;
|
||||
|
||||
/**
|
||||
* 变动后金额
|
||||
*/
|
||||
private BigDecimal afterAmount;
|
||||
}
|
||||
@@ -31,6 +31,8 @@ public class MemberWalletLogVO {
|
||||
/**
|
||||
* 子类型 10-充值, 11-赠送, 12-订单结算退款,20-后管扣款, 21-订单付款, 22-用户退款
|
||||
*/
|
||||
@Excel(name = "操作类型(10-充值, 11-赠送, 12-订单结算退款,20-后管扣款, 21-订单付款, 22-用户退款)",
|
||||
readConverterExp = "10=充值,11=赠送,12=订单结算退款,20=后管扣款,21=订单付款,22=用户退款")
|
||||
private String subType;
|
||||
|
||||
/**
|
||||
@@ -42,6 +44,7 @@ public class MemberWalletLogVO {
|
||||
/**
|
||||
* 出账/入账金额
|
||||
*/
|
||||
@Excel(name = "金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
@@ -53,6 +56,7 @@ public class MemberWalletLogVO {
|
||||
/**
|
||||
* 余额类型(1-本金,2-赠送)
|
||||
*/
|
||||
@Excel(name = "余额类型(1-本金,2-赠送)", readConverterExp = "1=本金,2=赠送")
|
||||
private String category;
|
||||
|
||||
/**
|
||||
@@ -94,6 +98,7 @@ public class MemberWalletLogVO {
|
||||
/**
|
||||
* 操作人员
|
||||
*/
|
||||
@Excel(name = "操作人员")
|
||||
private String createBy;
|
||||
|
||||
public String getSubTypeName() {
|
||||
|
||||
@@ -20,12 +20,12 @@
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, member_id, wallet_code, `type`, sub_type, amount, category, related_order_code,
|
||||
id, member_id, wallet_code, `type`, sub_type, amount, category, related_order_code,
|
||||
before_amount, after_amount, remark, create_by, create_time
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
<!--@mbg.generated-->
|
||||
select
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from member_wallet_log
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
@@ -37,14 +37,14 @@
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.MemberWalletLog" useGeneratedKeys="true">
|
||||
<!--@mbg.generated-->
|
||||
insert into member_wallet_log (member_id, wallet_code, `type`,
|
||||
sub_type, amount, category,
|
||||
related_order_code, before_amount, after_amount,
|
||||
insert into member_wallet_log (member_id, wallet_code, `type`,
|
||||
sub_type, amount, category,
|
||||
related_order_code, before_amount, after_amount,
|
||||
remark, create_by, create_time
|
||||
)
|
||||
values (#{memberId,jdbcType=VARCHAR}, #{walletCode,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
|
||||
#{subType,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, #{category,jdbcType=CHAR},
|
||||
#{relatedOrderCode,jdbcType=VARCHAR}, #{beforeAmount,jdbcType=DECIMAL}, #{afterAmount,jdbcType=DECIMAL},
|
||||
values (#{memberId,jdbcType=VARCHAR}, #{walletCode,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
|
||||
#{subType,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, #{category,jdbcType=CHAR},
|
||||
#{relatedOrderCode,jdbcType=VARCHAR}, #{beforeAmount,jdbcType=DECIMAL}, #{afterAmount,jdbcType=DECIMAL},
|
||||
#{remark,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
|
||||
)
|
||||
</insert>
|
||||
@@ -355,14 +355,14 @@
|
||||
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
|
||||
<!--@mbg.generated-->
|
||||
insert into member_wallet_log
|
||||
(member_id, wallet_code, `type`, sub_type, amount, category, related_order_code,
|
||||
(member_id, wallet_code, `type`, sub_type, amount, category, related_order_code,
|
||||
before_amount, after_amount, remark, create_by, create_time)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.memberId,jdbcType=VARCHAR}, #{item.walletCode,jdbcType=VARCHAR}, #{item.type,jdbcType=VARCHAR},
|
||||
#{item.subType,jdbcType=VARCHAR}, #{item.amount,jdbcType=DECIMAL}, #{item.category,jdbcType=CHAR},
|
||||
#{item.relatedOrderCode,jdbcType=VARCHAR}, #{item.beforeAmount,jdbcType=DECIMAL},
|
||||
#{item.afterAmount,jdbcType=DECIMAL}, #{item.remark,jdbcType=VARCHAR}, #{item.createBy,jdbcType=VARCHAR},
|
||||
(#{item.memberId,jdbcType=VARCHAR}, #{item.walletCode,jdbcType=VARCHAR}, #{item.type,jdbcType=VARCHAR},
|
||||
#{item.subType,jdbcType=VARCHAR}, #{item.amount,jdbcType=DECIMAL}, #{item.category,jdbcType=CHAR},
|
||||
#{item.relatedOrderCode,jdbcType=VARCHAR}, #{item.beforeAmount,jdbcType=DECIMAL},
|
||||
#{item.afterAmount,jdbcType=DECIMAL}, #{item.remark,jdbcType=VARCHAR}, #{item.createBy,jdbcType=VARCHAR},
|
||||
#{item.createTime,jdbcType=TIMESTAMP})
|
||||
</foreach>
|
||||
</insert>
|
||||
@@ -404,7 +404,7 @@
|
||||
#{createBy,jdbcType=VARCHAR},
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</trim>
|
||||
on duplicate key update
|
||||
on duplicate key update
|
||||
<trim suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id = #{id,jdbcType=INTEGER},
|
||||
@@ -509,7 +509,7 @@
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</trim>
|
||||
on duplicate key update
|
||||
on duplicate key update
|
||||
<trim suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id = #{id,jdbcType=INTEGER},
|
||||
@@ -651,4 +651,26 @@
|
||||
where related_order_code = #{orderCode,jdbcType=VARCHAR}
|
||||
and type = #{type,jdbcType=VARCHAR}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
<select id="getByMemberId" resultType="com.jsowell.pile.vo.MemberWalletLogVO2">
|
||||
SELECT
|
||||
member_id AS memberId,
|
||||
type,
|
||||
wallet_code AS walletCode,
|
||||
sub_type AS subType,
|
||||
create_by AS createBy,
|
||||
amount,
|
||||
create_time AS transactionTime,
|
||||
create_time AS createTime,
|
||||
category,
|
||||
related_order_code AS relatedOrderCode,
|
||||
before_amount AS beforeAmount,
|
||||
after_amount AS afterAmount
|
||||
FROM member_wallet_log
|
||||
where
|
||||
<if test="memberId != null and memberId != ''">
|
||||
member_id = #{memberId,jdbcType=VARCHAR}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user