feat: 资产
parent
0a7425da8b
commit
2b29c9cdb6
|
|
@ -1,14 +1,14 @@
|
|||
package com.ruoyi.web.controller.xkt;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.ruoyi.common.core.controller.XktBaseController;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.PageVO;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.web.controller.xkt.vo.BasePageVO;
|
||||
import com.ruoyi.web.controller.xkt.vo.account.*;
|
||||
import com.ruoyi.xkt.dto.account.AlipayBindDTO;
|
||||
import com.ruoyi.xkt.dto.account.AssetInfoDTO;
|
||||
import com.ruoyi.xkt.dto.account.TransactionPasswordSetDTO;
|
||||
import com.ruoyi.xkt.dto.account.WithdrawPrepareResult;
|
||||
import com.ruoyi.xkt.dto.account.*;
|
||||
import com.ruoyi.xkt.enums.EAccountOwnerType;
|
||||
import com.ruoyi.xkt.enums.EPayChannel;
|
||||
import com.ruoyi.xkt.manager.impl.AliPaymentMangerImpl;
|
||||
|
|
@ -94,4 +94,25 @@ public class AssetController extends XktBaseController {
|
|||
return success();
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:asset:list')")
|
||||
@ApiOperation(value = "档口交易明细")
|
||||
@PostMapping("store/trans-detail/page")
|
||||
public R<PageVO<TransDetailStorePageItemVO>> pageStoreTransDetail(@Validated @RequestBody BasePageVO vo) {
|
||||
TransDetailStoreQueryDTO queryDTO = BeanUtil.toBean(vo, TransDetailStoreQueryDTO.class);
|
||||
queryDTO.setStoreId(SecurityUtils.getStoreId());
|
||||
Page<TransDetailStorePageItemDTO> pageDTO = assetService.pageStoreTransDetail(queryDTO);
|
||||
return success(PageVO.of(pageDTO, TransDetailStorePageItemVO.class));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:asset:list')")
|
||||
@ApiOperation(value = "卖家交易明细")
|
||||
@PostMapping("user/trans-detail/page")
|
||||
public R<PageVO<TransDetailUserPageItemVO>> pageUserTransDetail(@Validated @RequestBody BasePageVO vo) {
|
||||
TransDetailUserQueryDTO queryDTO = BeanUtil.toBean(vo, TransDetailUserQueryDTO.class);
|
||||
queryDTO.setUserId(SecurityUtils.getUserId());
|
||||
Page<TransDetailUserPageItemDTO> pageDTO = assetService.pageUserTransDetail(queryDTO);
|
||||
return success(PageVO.of(pageDTO, TransDetailUserPageItemVO.class));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,52 @@
|
|||
package com.ruoyi.web.controller.xkt.vo.account;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author liangyq
|
||||
* @date 2025-04-28 19:01
|
||||
*/
|
||||
@ApiModel
|
||||
@Data
|
||||
public class TransDetailStorePageItemVO {
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
@ApiModelProperty(value = "订单号")
|
||||
private String orderNo;
|
||||
/**
|
||||
* 交易时间
|
||||
*/
|
||||
@ApiModelProperty(value = "交易时间")
|
||||
private Date transTime;
|
||||
/**
|
||||
* 收入
|
||||
*/
|
||||
@ApiModelProperty(value = "收入")
|
||||
private BigDecimal inputAmount;
|
||||
/**
|
||||
* 支出
|
||||
*/
|
||||
@ApiModelProperty(value = "支出")
|
||||
private BigDecimal outputAmount;
|
||||
/**
|
||||
* 交易说明
|
||||
*/
|
||||
@ApiModelProperty(value = "交易说明")
|
||||
private String remark;
|
||||
/**
|
||||
* 交易类型
|
||||
*/
|
||||
@ApiModelProperty(value = "交易类型")
|
||||
private String transType;
|
||||
/**
|
||||
* 支付方式
|
||||
*/
|
||||
@ApiModelProperty(value = "支付方式")
|
||||
private String payType;
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
package com.ruoyi.web.controller.xkt.vo.account;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author liangyq
|
||||
* @date 2025-04-28 19:01
|
||||
*/
|
||||
@ApiModel
|
||||
@Data
|
||||
public class TransDetailUserPageItemVO {
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
@ApiModelProperty(value = "订单号")
|
||||
private String orderNo;
|
||||
/**
|
||||
* 交易时间
|
||||
*/
|
||||
@ApiModelProperty(value = "交易时间")
|
||||
private Date transTime;
|
||||
/**
|
||||
* 收入
|
||||
*/
|
||||
@ApiModelProperty(value = "收入")
|
||||
private BigDecimal inputAmount;
|
||||
/**
|
||||
* 支出
|
||||
*/
|
||||
@ApiModelProperty(value = "支出")
|
||||
private BigDecimal outputAmount;
|
||||
/**
|
||||
* 交易说明
|
||||
*/
|
||||
@ApiModelProperty(value = "交易说明")
|
||||
private String remark;
|
||||
/**
|
||||
* 交易类型
|
||||
*/
|
||||
@ApiModelProperty(value = "交易类型")
|
||||
private String transType;
|
||||
/**
|
||||
* 支付方式
|
||||
*/
|
||||
@ApiModelProperty(value = "支付方式")
|
||||
private String payType;
|
||||
/**
|
||||
* 交易对象
|
||||
*/
|
||||
@ApiModelProperty(value = "交易对象")
|
||||
private String transTarget;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
package com.ruoyi.xkt.dto.account;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author liangyq
|
||||
* @date 2025-04-28 19:01
|
||||
*/
|
||||
@Data
|
||||
public class TransDetailStorePageItemDTO {
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
private String orderNo;
|
||||
/**
|
||||
* 交易时间
|
||||
*/
|
||||
private Date transTime;
|
||||
/**
|
||||
* 交易金额
|
||||
*/
|
||||
private BigDecimal transAmount;
|
||||
/**
|
||||
* 借贷方向[1:借(D) 2:贷(C)]
|
||||
*/
|
||||
private Integer loanDirection;
|
||||
/**
|
||||
* 收入
|
||||
*/
|
||||
private BigDecimal inputAmount;
|
||||
/**
|
||||
* 支出
|
||||
*/
|
||||
private BigDecimal outputAmount;
|
||||
/**
|
||||
* 交易说明
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 来源类型[1:代发订单支付 2:代发订单完成 3:提现]
|
||||
*/
|
||||
private Integer srcType;
|
||||
/**
|
||||
* 交易类型
|
||||
*/
|
||||
private String transType;
|
||||
/**
|
||||
* 单据类型[1:收款 2:付款 3:转移]
|
||||
*/
|
||||
private Integer billType;
|
||||
/**
|
||||
* 支付方式
|
||||
*/
|
||||
private String payType;
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package com.ruoyi.xkt.dto.account;
|
||||
|
||||
import com.ruoyi.xkt.dto.BasePageDTO;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* @author liangyq
|
||||
* @date 2025-04-28 18:59
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class TransDetailStoreQueryDTO extends BasePageDTO {
|
||||
/**
|
||||
* 档口ID
|
||||
*/
|
||||
private Long storeId;
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package com.ruoyi.xkt.dto.account;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author liangyq
|
||||
* @date 2025-04-28 19:01
|
||||
*/
|
||||
@Data
|
||||
public class TransDetailUserPageItemDTO {
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
private String orderNo;
|
||||
/**
|
||||
* 交易时间
|
||||
*/
|
||||
private Date transTime;
|
||||
/**
|
||||
* 收入
|
||||
*/
|
||||
private BigDecimal inputAmount;
|
||||
/**
|
||||
* 支出
|
||||
*/
|
||||
private BigDecimal outputAmount;
|
||||
/**
|
||||
* 交易说明
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 交易类型
|
||||
*/
|
||||
private String transType;
|
||||
/**
|
||||
* 支付方式
|
||||
*/
|
||||
private String payType;
|
||||
/**
|
||||
* 交易对象
|
||||
*/
|
||||
private String transTarget;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package com.ruoyi.xkt.dto.account;
|
||||
|
||||
import com.ruoyi.xkt.dto.BasePageDTO;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* @author liangyq
|
||||
* @date 2025-04-28 18:59
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class TransDetailUserQueryDTO extends BasePageDTO {
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
}
|
||||
|
|
@ -2,6 +2,8 @@ package com.ruoyi.xkt.mapper;
|
|||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.xkt.domain.InternalAccount;
|
||||
import com.ruoyi.xkt.dto.account.TransDetailStorePageItemDTO;
|
||||
import com.ruoyi.xkt.dto.account.TransDetailUserPageItemDTO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
|
|
@ -29,4 +31,20 @@ public interface InternalAccountMapper extends BaseMapper<InternalAccount> {
|
|||
* @return
|
||||
*/
|
||||
List<InternalAccount> listForUpdate(@Param("ids") Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 档口交易明细
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<TransDetailStorePageItemDTO> listStoreTransDetailPageItem(@Param("id")Long id);
|
||||
|
||||
/**
|
||||
* 卖家交易明细
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<TransDetailUserPageItemDTO> listUserTransDetailPageItem(@Param("userId")Long userId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
package com.ruoyi.xkt.service;
|
||||
|
||||
import com.ruoyi.xkt.dto.account.AlipayBindDTO;
|
||||
import com.ruoyi.xkt.dto.account.AssetInfoDTO;
|
||||
import com.ruoyi.xkt.dto.account.TransactionPasswordSetDTO;
|
||||
import com.ruoyi.xkt.dto.account.WithdrawPrepareResult;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.ruoyi.xkt.dto.account.*;
|
||||
import com.ruoyi.xkt.enums.EPayChannel;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
|
@ -72,4 +70,20 @@ public interface IAssetService {
|
|||
*/
|
||||
AssetInfoDTO bindAlipay(AlipayBindDTO alipayBind);
|
||||
|
||||
/**
|
||||
* 分页查询档口交易明细
|
||||
*
|
||||
* @param queryDTO
|
||||
* @return
|
||||
*/
|
||||
Page<TransDetailStorePageItemDTO> pageStoreTransDetail(TransDetailStoreQueryDTO queryDTO);
|
||||
|
||||
/**
|
||||
* 分页查询卖家交易明细
|
||||
*
|
||||
* @param queryDTO
|
||||
* @return
|
||||
*/
|
||||
Page<TransDetailUserPageItemDTO> pageUserTransDetail(TransDetailUserQueryDTO queryDTO);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,12 +2,16 @@ package com.ruoyi.xkt.service;
|
|||
|
||||
import com.ruoyi.xkt.domain.InternalAccount;
|
||||
import com.ruoyi.xkt.dto.account.InternalAccountAddDTO;
|
||||
import com.ruoyi.xkt.dto.account.TransDetailStorePageItemDTO;
|
||||
import com.ruoyi.xkt.dto.account.TransDetailUserPageItemDTO;
|
||||
import com.ruoyi.xkt.dto.finance.TransInfo;
|
||||
import com.ruoyi.xkt.enums.EAccountOwnerType;
|
||||
import com.ruoyi.xkt.enums.EEntryStatus;
|
||||
import com.ruoyi.xkt.enums.EFinBillType;
|
||||
import com.ruoyi.xkt.enums.ELoanDirection;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liangyq
|
||||
* @date 2025-04-08 21:14
|
||||
|
|
@ -76,4 +80,20 @@ public interface IInternalAccountService {
|
|||
* @param transactionPassword md5
|
||||
*/
|
||||
void setTransactionPassword(Long id, String phoneNumber, String transactionPassword);
|
||||
|
||||
/**
|
||||
* 档口交易明细
|
||||
*
|
||||
* @param internalAccountId
|
||||
* @return
|
||||
*/
|
||||
List<TransDetailStorePageItemDTO> listStoreTransDetailPageItem(Long internalAccountId);
|
||||
|
||||
/**
|
||||
* 卖家交易明细
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<TransDetailUserPageItemDTO> listUserTransDetailPageItem(Long userId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ import cn.hutool.core.lang.Assert;
|
|||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.xkt.domain.ExternalAccount;
|
||||
import com.ruoyi.xkt.domain.InternalAccount;
|
||||
|
|
@ -166,5 +168,24 @@ public class AssetServiceImpl implements IAssetService {
|
|||
return getStoreAssetInfo(alipayBind.getOwnerId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<TransDetailStorePageItemDTO> pageStoreTransDetail(TransDetailStoreQueryDTO queryDTO) {
|
||||
Assert.notNull(queryDTO.getStoreId());
|
||||
InternalAccount internalAccount = internalAccountService.getAccount(queryDTO.getStoreId(),
|
||||
EAccountOwnerType.STORE);
|
||||
Assert.notNull(internalAccount);
|
||||
Page<TransDetailStorePageItemDTO> page = PageHelper.startPage(queryDTO.getPageNum(), queryDTO.getPageSize());
|
||||
internalAccountService.listStoreTransDetailPageItem(internalAccount.getId());
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<TransDetailUserPageItemDTO> pageUserTransDetail(TransDetailUserQueryDTO queryDTO) {
|
||||
Assert.notNull(queryDTO.getUserId());
|
||||
Page<TransDetailUserPageItemDTO> page = PageHelper.startPage(queryDTO.getPageNum(), queryDTO.getPageSize());
|
||||
internalAccountService.listUserTransDetailPageItem(queryDTO.getUserId());
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ import com.ruoyi.common.utils.bean.BeanValidators;
|
|||
import com.ruoyi.xkt.domain.InternalAccount;
|
||||
import com.ruoyi.xkt.domain.InternalAccountTransDetail;
|
||||
import com.ruoyi.xkt.dto.account.InternalAccountAddDTO;
|
||||
import com.ruoyi.xkt.dto.account.TransDetailStorePageItemDTO;
|
||||
import com.ruoyi.xkt.dto.account.TransDetailUserPageItemDTO;
|
||||
import com.ruoyi.xkt.dto.finance.TransInfo;
|
||||
import com.ruoyi.xkt.enums.*;
|
||||
import com.ruoyi.xkt.mapper.InternalAccountMapper;
|
||||
|
|
@ -246,6 +248,16 @@ public class InternalAccountServiceImpl implements IInternalAccountService {
|
|||
internalAccountMapper.updateById(update);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TransDetailStorePageItemDTO> listStoreTransDetailPageItem(Long internalAccountId) {
|
||||
return internalAccountMapper.listStoreTransDetailPageItem(internalAccountId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TransDetailUserPageItemDTO> listUserTransDetailPageItem(Long userId) {
|
||||
return internalAccountMapper.listUserTransDetailPageItem(userId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 检查账户状态
|
||||
|
|
|
|||
|
|
@ -13,4 +13,51 @@
|
|||
WHERE id IN
|
||||
<foreach collection="ids" item="id" separator="," open="(" close=")">#{id}</foreach> FOR UPDATE
|
||||
</select>
|
||||
|
||||
<select id="listStoreTransDetailPageItem" resultType="com.ruoyi.xkt.dto.account.TransDetailStorePageItemDTO">
|
||||
SELECT
|
||||
so.order_no,
|
||||
iatd.trans_time,
|
||||
fb.src_type,
|
||||
CASE fb.src_type
|
||||
WHEN 2 THEN '档口代发订单'
|
||||
WHEN 3 THEN '提现'
|
||||
ELSE '推广费' END trans_type,
|
||||
fb.remark,
|
||||
fb.bill_type,
|
||||
CASE fb.bill_type
|
||||
WHEN 3 THEN '余额'
|
||||
ELSE '支付宝' END pay_type,
|
||||
iatd.trans_amount,
|
||||
iatd.loan_direction,
|
||||
IF(iatd.loan_direction = 1, iatd.trans_amount, 0) input_amount,
|
||||
IF(iatd.loan_direction = 2, iatd.trans_amount, 0) output_amount
|
||||
FROM
|
||||
internal_account_trans_detail iatd
|
||||
LEFT JOIN finance_bill fb ON iatd.src_bill_id = fb.id
|
||||
LEFT JOIN store_order so ON fb.rel_id = so.id AND fb.rel_type = 1
|
||||
WHERE
|
||||
iatd.internal_account_id = #{id}
|
||||
AND iatd.del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="listUserTransDetailPageItem" resultType="com.ruoyi.xkt.dto.account.TransDetailUserPageItemDTO">
|
||||
SELECT
|
||||
so.order_no,
|
||||
fb.create_time trans_time,
|
||||
fb.remark,
|
||||
IF(fb.src_type = 1, '下单', '退款') trans_type,
|
||||
'鞋库通平台发货' trans_target,
|
||||
'支付宝' pay_type,
|
||||
IF(fb.src_type = 1, fb.trans_amount, 0) output_amount,
|
||||
IF(fb.src_type = 2, fb.trans_amount, 0) input_amount
|
||||
FROM
|
||||
finance_bill fb
|
||||
LEFT JOIN store_order so ON fb.src_id = so.id AND fb.src_type IN (1, 4)
|
||||
WHERE
|
||||
so.order_user_id = #{userId}
|
||||
AND fb.bill_status = 3
|
||||
AND so.del_flag = '0'
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue