Commit 7bfe80fd authored by wujipeng's avatar wujipeng
Browse files

查询用户详情增加账号详情

parent 837109a0
...@@ -34,4 +34,5 @@ public interface ExcelDataMapper extends BaseMapper<ExcelDataEntity> { ...@@ -34,4 +34,5 @@ public interface ExcelDataMapper extends BaseMapper<ExcelDataEntity> {
List<ExcelDataEntity> relationPage(@Param("oneselfAccountList") List<String> oneselfAccountList, @Param("otherAccountList") List<String> otherAccountList); List<ExcelDataEntity> relationPage(@Param("oneselfAccountList") List<String> oneselfAccountList, @Param("otherAccountList") List<String> otherAccountList);
List<ExcelDataEntity> queryInfoList(CaseDTO caseDTO); List<ExcelDataEntity> queryInfoList(CaseDTO caseDTO);
List<AssociationVO> queryAccountTemporary(@Param("userName") String userName, @Param("caseId") String caseId);
} }
...@@ -49,7 +49,7 @@ public class ExcelDataEntity { ...@@ -49,7 +49,7 @@ public class ExcelDataEntity {
@ApiModelProperty("交易流水号") @ApiModelProperty("交易流水号")
private String serial; private String serial;
@ApiModelProperty("收款方银行卡所属银行名称") @ApiModelProperty("收款方银行卡所属银行卡号")
@TableField("payee_bank_card") @TableField("payee_bank_card")
private String payeeBankCard; private String payeeBankCard;
......
...@@ -60,4 +60,5 @@ public interface ExcelDataService extends IService<ExcelDataEntity> { ...@@ -60,4 +60,5 @@ public interface ExcelDataService extends IService<ExcelDataEntity> {
List<ExcelDataEntity> queryListByPayUserName(ExcelDataDTO excelDataDTO); List<ExcelDataEntity> queryListByPayUserName(ExcelDataDTO excelDataDTO);
List<ExcelDataEntity> queryListByPayeeName(String oldName, String caseId); List<ExcelDataEntity> queryListByPayeeName(String oldName, String caseId);
List<AssociationVO> queryAccountTemporary(String userName, String caseId);
} }
...@@ -106,4 +106,9 @@ public class ExcelDataServiceImpl extends ServiceImpl<ExcelDataMapper, ExcelData ...@@ -106,4 +106,9 @@ public class ExcelDataServiceImpl extends ServiceImpl<ExcelDataMapper, ExcelData
.eq(ExcelDataEntity::getCaseId, caseId) .eq(ExcelDataEntity::getCaseId, caseId)
.eq(ExcelDataEntity::getPayeeName, oldName)); .eq(ExcelDataEntity::getPayeeName, oldName));
} }
@Override
public List<AssociationVO> queryAccountTemporary(String userName, String caseId) {
return baseMapper.queryAccountTemporary(userName,caseId);
}
} }
...@@ -23,6 +23,7 @@ import com.platform.service.UserRelationService; ...@@ -23,6 +23,7 @@ import com.platform.service.UserRelationService;
import com.platform.service.UserService; import com.platform.service.UserService;
import com.platform.utils.DozerUtils; import com.platform.utils.DozerUtils;
import com.platform.utils.IdCardUtils; import com.platform.utils.IdCardUtils;
import org.jetbrains.annotations.NotNull;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
...@@ -43,10 +44,71 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme ...@@ -43,10 +44,71 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
@Override @Override
public UserVO getDetail(String userName, String caseId) { public UserVO getDetail(String userName, String caseId) {
UserEntity userEntity = baseMapper.selectOne(new LambdaQueryWrapper<UserEntity>() UserEntity userEntity = baseMapper.selectOne(new LambdaQueryWrapper<UserEntity>()
.eq(UserEntity::getUserName, userName)); .eq(UserEntity::getUserName, userName).eq(UserEntity::getCaseId, caseId));
if(ObjectUtils.isEmpty(userEntity)){ if (ObjectUtils.isEmpty(userEntity)) {
return null; return account(userName, caseId);
} else {
return personnel(userName, caseId, userEntity);
}
} }
private UserVO account(String userName, String caseId) {
UserVO userVO = new UserVO();
userVO.setUserName(userName);
userVO.setCaseId(caseId);
//本人账号数量
HashSet<String> account = Sets.newHashSet();
//查询关联资金
List<AssociationVO> financialTransactions = excelDataService.queryAccountTemporary(userName, caseId);
Map<String, List<AssociationVO>> detailsFunds = Maps.newHashMap();
for (AssociationVO financialTransaction : financialTransactions) {
if (financialTransaction.getDirection().equals("出账")) {
if (detailsFunds.containsKey(financialTransaction.getPayee())) {
financialTransaction.setRelationDesc(detailsFunds.get(financialTransaction.getPayee()).size() + "、" + financialTransaction.getStartTime() + "-" + financialTransaction.getEndTime()
+ financialTransaction.getPayee() + "->" + financialTransaction.getPayment() + "," + financialTransaction.getTotalAmount() + ",交易" + financialTransaction.getNum() + "次");
detailsFunds.get(financialTransaction.getPayee()).add(financialTransaction);
account.add(financialTransaction.getPayment());
} else {
List<AssociationVO> list = new ArrayList<>();
financialTransaction.setRelationDesc("1、" + financialTransaction.getStartTime() + "-" + financialTransaction.getEndTime()
+ financialTransaction.getPayee() + "->" + financialTransaction.getPayment() + "," + financialTransaction.getTotalAmount() + ",交易" + financialTransaction.getNum() + "次");
list.add(financialTransaction);
detailsFunds.put(financialTransaction.getPayee(), list);
account.add(financialTransaction.getPayment());
}
} else if (financialTransaction.getDirection().equals("入账")) {
if (detailsFunds.containsKey(financialTransaction.getPayment())) {
financialTransaction.setRelationDesc(detailsFunds.get(financialTransaction.getPayment()).size() + "、" + financialTransaction.getStartTime() + "-" + financialTransaction.getEndTime()
+ financialTransaction.getPayee() + "->" + financialTransaction.getPayment() + "," + financialTransaction.getTotalAmount() + ",交易" + financialTransaction.getNum() + "次");
detailsFunds.get(financialTransaction.getPayment()).add(financialTransaction);
account.add(financialTransaction.getPayee());
} else {
List<AssociationVO> list = new ArrayList<>();
financialTransaction.setRelationDesc("1、" + financialTransaction.getStartTime() + "-" + financialTransaction.getEndTime()
+ financialTransaction.getPayee() + "->" + financialTransaction.getPayment() + "," + financialTransaction.getTotalAmount() + ",交易" + financialTransaction.getNum() + "次");
list.add(financialTransaction);
detailsFunds.put(financialTransaction.getPayment(), list);
account.add(financialTransaction.getPayee());
}
}
}
//关联人员数量
userVO.setHeadcount(detailsFunds.size());
//关联交易次数
int quantity = 0;
for (AssociationVO financialTransaction : financialTransactions) {
quantity += financialTransaction.getNum();
}
userVO.setQuantity(quantity);
//本人账户数量
userVO.setAccountNum(account.size());
//明细
userVO.setDetailsFunds(detailsFunds);
return userVO;
}
@NotNull
private UserVO personnel(String userName, String caseId, UserEntity userEntity) {
UserVO userVO = DozerUtils.convertBean(userEntity, UserVO.class); UserVO userVO = DozerUtils.convertBean(userEntity, UserVO.class);
if (userVO != null) { if (userVO != null) {
//查看用户账户列表 //查看用户账户列表
......
...@@ -182,4 +182,21 @@ ...@@ -182,4 +182,21 @@
and u.label like concat('%',#{label},'%') and u.label like concat('%',#{label},'%')
</if> </if>
</select> </select>
<select id="queryAccountTemporary" resultType="com.platform.model.vo.AssociationVO">
select
min(time) as startTime,
max(time) as endTime,
sum(amount) as totalAmount,
payee_account as payee,
payment_account as payment,
count(*) as num,
direction
from excel_data
where case_id = #{caseId}
and payee_name = #{userName}
group by
payee_account,
payment_account,
direction
</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