Commit c46fbd32 authored by zhuxiang's avatar zhuxiang
Browse files

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	src/main/java/com/platform/mapper/ExcelDataMapper.java
parents 34926d24 e6d9c144
package com.platform.controller; package com.platform.controller;
import com.platform.model.dto.UserDTO; import com.platform.model.dto.UserDTO;
import com.platform.model.entity.ExcelDataEntity;
import com.platform.model.resp.Result; import com.platform.model.resp.Result;
import com.platform.page.TableDataInfo;
import com.platform.service.UserService; import com.platform.service.UserService;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
@RestController @RestController
@RequestMapping("/user") @RequestMapping("/user")
...@@ -33,4 +36,17 @@ public class UserController extends BaseController { ...@@ -33,4 +36,17 @@ public class UserController extends BaseController {
public Result<Boolean> add(@RequestBody UserDTO userDTO) { public Result<Boolean> add(@RequestBody UserDTO userDTO) {
return Result.data(userService.add(userDTO)); return Result.data(userService.add(userDTO));
} }
@ApiModelProperty(value = "资金流水")
@PostMapping("/cash/flow/page")
public TableDataInfo cashFlow(@RequestBody UserDTO userDTO) {
startPage(userDTO.getPageNum(), userDTO.getPageSize());
return getDataTable((userService.cashFlow(userDTO)));
}
@ApiModelProperty(value = "人与人关系弹框分页")
@PostMapping("/relation/page")
public Result relationPage(@RequestBody UserDTO userDTO) {
return Result.data(userService.relationPage(userDTO));
}
} }
...@@ -2,6 +2,7 @@ package com.platform.mapper; ...@@ -2,6 +2,7 @@ package com.platform.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.platform.model.dto.CaseDTO; import com.platform.model.dto.CaseDTO;
import com.platform.model.dto.UserDTO;
import com.platform.model.entity.ExcelDataEntity; import com.platform.model.entity.ExcelDataEntity;
import com.platform.model.vo.AssociationVO; import com.platform.model.vo.AssociationVO;
import com.platform.model.vo.ExcelDataVO; import com.platform.model.vo.ExcelDataVO;
...@@ -26,4 +27,8 @@ public interface ExcelDataMapper extends BaseMapper<ExcelDataEntity> { ...@@ -26,4 +27,8 @@ public interface ExcelDataMapper extends BaseMapper<ExcelDataEntity> {
List<ExcelDataVO> queryListByPayUserList(@Param("userList") List<String> userList, List<ExcelDataVO> queryListByPayUserList(@Param("userList") List<String> userList,
@Param("caseId") int caseId); @Param("caseId") int caseId);
List<ExcelDataEntity> cashFlow(UserDTO userDTO);
List<ExcelDataEntity> relationPage(@Param("oneselfAccountList") List<String> oneselfAccountList, @Param("otherAccountList") List<String> otherAccountList);
} }
...@@ -11,4 +11,6 @@ import java.util.List; ...@@ -11,4 +11,6 @@ import java.util.List;
public interface UserAccountMapper extends BaseMapper<UserAccountEntity> { public interface UserAccountMapper extends BaseMapper<UserAccountEntity> {
void saveUserBatch(@Param("userAccountList") List<UserAccountEntity> userAccountList); void saveUserBatch(@Param("userAccountList") List<UserAccountEntity> userAccountList);
List<String> queryUserAccountList(@Param("userName") String userName);
} }
...@@ -14,4 +14,19 @@ public class UserDTO extends UserEntity { ...@@ -14,4 +14,19 @@ public class UserDTO extends UserEntity {
private List<UserAccountEntity> userAccountList; private List<UserAccountEntity> userAccountList;
@ApiModelProperty(value = "对方用户名")
private String otherUserName;
@ApiModelProperty(value = "页数", example = "0")
private Integer pageNum;
@ApiModelProperty(value = "每页显示的数量", example = "10")
private Integer pageSize;
@ApiModelProperty(value = "用户id")
private String userId;
@ApiModelProperty(value = "对方id")
private String otherId;
} }
...@@ -100,4 +100,12 @@ public class ExcelDataEntity { ...@@ -100,4 +100,12 @@ public class ExcelDataEntity {
@TableField("use_flag") @TableField("use_flag")
private Boolean useFlag; private Boolean useFlag;
@ApiModelProperty("本人账户")
@TableField(exist = false)
private String selfAccount;
@ApiModelProperty("关联账户")
@TableField(exist = false)
private String associationAccount;
} }
package com.platform.model.vo;
import com.platform.model.entity.ExcelDataEntity;
import com.platform.model.entity.UserRelationEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author : wujipeng
* @date : 2025/8/1 17:51
* @Version: 1.0
* @Desc : 描述信息
*/
@Data
public class EveryoneVO {
@ApiModelProperty(value = "标题")
private String title;
@ApiModelProperty(value = "指认关系")
private List<UserRelationEntity> relation;
@ApiModelProperty(value = "交易次数")
private Integer tradeCount;
@ApiModelProperty(value = "交易总额")
private String tradeTotal;
@ApiModelProperty(value = "明细")
private List<ExcelDataEntity> details;
}
...@@ -3,6 +3,7 @@ package com.platform.service; ...@@ -3,6 +3,7 @@ package com.platform.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.platform.model.dto.CaseDTO; import com.platform.model.dto.CaseDTO;
import com.platform.model.dto.ExcelDataDTO; import com.platform.model.dto.ExcelDataDTO;
import com.platform.model.dto.UserDTO;
import com.platform.model.entity.ExcelDataEntity; import com.platform.model.entity.ExcelDataEntity;
import com.platform.model.vo.AssociationVO; import com.platform.model.vo.AssociationVO;
import com.platform.model.vo.ExcelDataVO; import com.platform.model.vo.ExcelDataVO;
...@@ -49,4 +50,8 @@ public interface ExcelDataService extends IService<ExcelDataEntity> { ...@@ -49,4 +50,8 @@ public interface ExcelDataService extends IService<ExcelDataEntity> {
List<ExcelDataVO> queryListByPayUserList(List<String> userList, int caseId); List<ExcelDataVO> queryListByPayUserList(List<String> userList, int caseId);
List<AssociationVO> selectFinancialTransactions(String userName, String caseId); List<AssociationVO> selectFinancialTransactions(String userName, String caseId);
List<ExcelDataEntity> cashFlow(UserDTO userDTO);
List<ExcelDataEntity> relationPage(List<String> oneselfAccountList, List<String> otherAccountList);
} }
...@@ -11,4 +11,6 @@ public interface UserAccountService extends IService<UserAccountEntity> { ...@@ -11,4 +11,6 @@ public interface UserAccountService extends IService<UserAccountEntity> {
void deleteByUserName(String userName); void deleteByUserName(String userName);
void saveUserBatch(List<UserAccountEntity> userAccountList); void saveUserBatch(List<UserAccountEntity> userAccountList);
List<String> queryUserAccountList(String userName);
} }
...@@ -2,9 +2,13 @@ package com.platform.service; ...@@ -2,9 +2,13 @@ package com.platform.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.platform.model.dto.UserDTO; import com.platform.model.dto.UserDTO;
import com.platform.model.entity.ExcelDataEntity;
import com.platform.model.entity.UserEntity; import com.platform.model.entity.UserEntity;
import com.platform.model.vo.EveryoneVO;
import com.platform.model.vo.UserVO; import com.platform.model.vo.UserVO;
import java.util.List;
public interface UserService extends IService<UserEntity> { public interface UserService extends IService<UserEntity> {
UserVO getDetail(String userName,String caseId); UserVO getDetail(String userName,String caseId);
...@@ -16,4 +20,12 @@ public interface UserService extends IService<UserEntity> { ...@@ -16,4 +20,12 @@ public interface UserService extends IService<UserEntity> {
* @return Boolean * @return Boolean
*/ */
Boolean add(UserDTO userDTO); Boolean add(UserDTO userDTO);
/**
* 资金流水
* @return List<ExcelDataEntity>
*/
List<ExcelDataEntity> cashFlow(UserDTO userDTO);
EveryoneVO relationPage(UserDTO userDTO);
} }
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.platform.mapper.ExcelDataMapper; import com.platform.mapper.ExcelDataMapper;
import com.platform.model.dto.CaseDTO; import com.platform.model.dto.CaseDTO;
import com.platform.model.dto.UserDTO;
import com.platform.model.entity.ExcelDataEntity; import com.platform.model.entity.ExcelDataEntity;
import com.platform.model.vo.AssociationVO; import com.platform.model.vo.AssociationVO;
import com.platform.model.vo.ExcelDataVO; import com.platform.model.vo.ExcelDataVO;
...@@ -70,4 +71,14 @@ public class ExcelDataServiceImpl extends ServiceImpl<ExcelDataMapper, ExcelData ...@@ -70,4 +71,14 @@ public class ExcelDataServiceImpl extends ServiceImpl<ExcelDataMapper, ExcelData
public List<AssociationVO> selectFinancialTransactions(String userName, String caseId) { public List<AssociationVO> selectFinancialTransactions(String userName, String caseId) {
return baseMapper.selectFinancialTransactions(userName, caseId); return baseMapper.selectFinancialTransactions(userName, caseId);
} }
@Override
public List<ExcelDataEntity> cashFlow(UserDTO userDTO) {
return baseMapper.cashFlow(userDTO);
}
@Override
public List<ExcelDataEntity> relationPage(List<String> oneselfAccountList, List<String> otherAccountList) {
return baseMapper.relationPage(oneselfAccountList,otherAccountList);
}
} }
...@@ -27,4 +27,9 @@ public class UserAccountServiceImpl extends ServiceImpl<UserAccountMapper, UserA ...@@ -27,4 +27,9 @@ public class UserAccountServiceImpl extends ServiceImpl<UserAccountMapper, UserA
public void saveUserBatch(List<UserAccountEntity> userAccountList) { public void saveUserBatch(List<UserAccountEntity> userAccountList) {
baseMapper.saveUserBatch(userAccountList); baseMapper.saveUserBatch(userAccountList);
} }
@Override
public List<String> queryUserAccountList(String userName) {
return baseMapper.queryUserAccountList(userName);
}
} }
...@@ -4,14 +4,18 @@ import cn.hutool.core.collection.CollUtil; ...@@ -4,14 +4,18 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.map.MapUtil; import cn.hutool.core.map.MapUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import com.platform.exception.BusinessException;
import com.platform.mapper.UserMapper; import com.platform.mapper.UserMapper;
import com.platform.model.dto.UserDTO; import com.platform.model.dto.UserDTO;
import com.platform.model.entity.ExcelDataEntity;
import com.platform.model.entity.UserAccountEntity; import com.platform.model.entity.UserAccountEntity;
import com.platform.model.entity.UserEntity; import com.platform.model.entity.UserEntity;
import com.platform.model.entity.UserRelationEntity; import com.platform.model.entity.UserRelationEntity;
import com.platform.model.vo.AssociationVO; import com.platform.model.vo.AssociationVO;
import com.platform.model.vo.EveryoneVO;
import com.platform.model.vo.UserVO; import com.platform.model.vo.UserVO;
import com.platform.service.ExcelDataService; import com.platform.service.ExcelDataService;
import com.platform.service.UserAccountService; import com.platform.service.UserAccountService;
...@@ -100,6 +104,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme ...@@ -100,6 +104,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
userVO.setQuantity(quantity); userVO.setQuantity(quantity);
//本人账户数量 //本人账户数量
userVO.setAccountNum(account.size()); userVO.setAccountNum(account.size());
//明细
userVO.setDetailsFunds(detailsFunds);
return userVO; return userVO;
} }
...@@ -146,4 +152,49 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme ...@@ -146,4 +152,49 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
userRelationService.saveBatch(relationShipList); userRelationService.saveBatch(relationShipList);
return Boolean.TRUE; return Boolean.TRUE;
} }
@Override
public List<ExcelDataEntity> cashFlow(UserDTO userDTO) {
List<ExcelDataEntity> excelDataList = excelDataService.cashFlow(userDTO);
for (ExcelDataEntity excelDataEntity : excelDataList) {
if("出账".equals(excelDataEntity.getDirection())){
excelDataEntity.setSelfAccount(excelDataEntity.getPayAccount());
excelDataEntity.setAssociationAccount(excelDataEntity.getPayeeAccount());
}else if("入账".equals(excelDataEntity.getDirection())){
excelDataEntity.setSelfAccount(excelDataEntity.getPayeeAccount());
excelDataEntity.setAssociationAccount(excelDataEntity.getPayAccount());
}
}
return excelDataList;
}
@Override
public EveryoneVO relationPage(UserDTO userDTO) {
EveryoneVO everyoneVO = new EveryoneVO();
UserEntity oneself = getById(userDTO.getUserId());
UserEntity other = getById(userDTO.getOtherId());
if(ObjectUtils.isEmpty(oneself) || ObjectUtils.isEmpty(other)){
throw new BusinessException("用户不存在");
}
//标题
everyoneVO.setTitle(oneself.getUserName() + "," + other.getUserName());
//查询关系
List<UserRelationEntity> userRelation = userRelationService.list(new LambdaQueryWrapper<UserRelationEntity>()
.eq(UserRelationEntity::getUserId, userDTO.getUserId())
.eq(UserRelationEntity::getOtherId, userDTO.getOtherId()));
//指认关系
if(ObjectUtils.isEmpty(userRelation)){
everyoneVO.setRelation(userRelation);
}
//查询账户
List<String> oneselfAccountList = userAccountService.queryUserAccountList(oneself.getUserName());
List<String> otherAccountList = userAccountService.queryUserAccountList(oneself.getUserName());
PageHelper.startPage(userDTO.getPageNum(),userDTO.getPageSize());
List<ExcelDataEntity> details = excelDataService.relationPage(oneselfAccountList,otherAccountList);
everyoneVO.setDetails(details);
PageHelper.clearPage();
return everyoneVO;
}
} }
...@@ -80,4 +80,42 @@ ...@@ -80,4 +80,42 @@
#{userName} #{userName}
</foreach> </foreach>
</select> </select>
<select id="cashFlow" resultType="com.platform.model.entity.ExcelDataEntity">
select id,
directory_id,
type,
direction,
time,
amount,
serial,
payee_bank_card,
payee_account,
payee_merchant,
payee_name,
payment_bank_name,
payment_bank_card,
payment_account,
ip,
mac,
external_channel,
pay_account,
remark,
case_id,
pay_user_name,
use_flag,
file_id
from excel_data
where case_id = #{caseId}
and pay_user_name = #{userName}
and (
payee_account = #{otherUserName}
or
payment_account = #{otherUserName}
)
</select>
<select id="relationPage" resultType="com.platform.model.entity.ExcelDataEntity">
select amount,time,payee_account,payment_account
from excel_data
where (payment_account in (#{oneselfAccountList}) and payment_account in (#{otherAccountList})) or (payment_account in (#{otherAccountList}) and payment_account in (#{oneselfAccountList}))
</select>
</mapper> </mapper>
...@@ -9,4 +9,15 @@ ...@@ -9,4 +9,15 @@
(#{item.userName}, #{item.account}, #{item.caseId}) (#{item.userName}, #{item.account}, #{item.caseId})
</foreach> </foreach>
</insert> </insert>
<select id="queryUserAccountList" resultType="java.lang.String">
SELECT DISTINCT
CASE
WHEN direction = '出账' THEN payment_account
WHEN direction = '入账' THEN payee_account
ELSE NULL
END AS account
FROM excel_data
WHERE direction IN ('出账', '入账')
and pay_user_name = #{userName}
</select>
</mapper> </mapper>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment