Commit f53e25c9 authored by wujipeng's avatar wujipeng
Browse files

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

parents 9c66eeef bcbb30bd
...@@ -71,4 +71,6 @@ public interface ExcelDataService extends IService<ExcelDataEntity> { ...@@ -71,4 +71,6 @@ public interface ExcelDataService extends IService<ExcelDataEntity> {
List<ExcelDataEntity> queryListByPayeeNameAndPayUserName(String payeeName, int caseId); List<ExcelDataEntity> queryListByPayeeNameAndPayUserName(String payeeName, int caseId);
List<ExcelDataVO> queryListByGroupId(CaseDTO caseDTO); List<ExcelDataVO> queryListByGroupId(CaseDTO caseDTO);
List<ExcelDataEntity> queryListByCaseIdAndPayeeName(int caseId, String payUserName);
} }
...@@ -119,11 +119,17 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem ...@@ -119,11 +119,17 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem
excelDataDTO.getOldPayUserName().forEach(payUserName -> { excelDataDTO.getOldPayUserName().forEach(payUserName -> {
List<ExcelDataEntity> excelDataEntityList = excelDataService.queryListByCaseIdAndPayUserName(excelDataDTO.getCaseId(), payUserName); List<ExcelDataEntity> excelDataEntityList = excelDataService.queryListByCaseIdAndPayUserName(excelDataDTO.getCaseId(), payUserName);
if (CollUtil.isNotEmpty(excelDataEntityList)) { if (CollUtil.isNotEmpty(excelDataEntityList)) {
excelDataEntityList.forEach(excelDataEntity -> excelDataEntity.setPayUserName(excelDataDTO.getNewPayUserName()));
mergeList.addAll(excelDataEntityList); mergeList.addAll(excelDataEntityList);
} }
List<ExcelDataEntity> payeeNameList = excelDataService.queryListByCaseIdAndPayeeName(excelDataDTO.getCaseId(), payUserName);
if (CollUtil.isNotEmpty(payeeNameList)) {
payeeNameList.forEach(excelDataEntity -> excelDataEntity.setPayeeName(excelDataDTO.getNewPayUserName()));
mergeList.addAll(payeeNameList);
}
}); });
if (CollUtil.isNotEmpty(mergeList)) { if (CollUtil.isNotEmpty(mergeList)) {
mergeList.forEach(excelDataEntity -> excelDataEntity.setPayUserName(excelDataDTO.getNewPayUserName()));
excelDataService.updateBatchById(mergeList); excelDataService.updateBatchById(mergeList);
} }
return Boolean.TRUE; return Boolean.TRUE;
...@@ -337,8 +343,10 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem ...@@ -337,8 +343,10 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem
} }
private void updateEdgeMap(Map<String, EdgeVO> edgeMap, private void updateEdgeMap(Map<String, EdgeVO> edgeMap,
String payer, String payee, String payer,
double amount, ExcelDataEntity entity, String payee,
double amount,
ExcelDataEntity entity,
UnionFindVO uf) { UnionFindVO uf) {
String edgeKey = payer + "-" + payee; String edgeKey = payer + "-" + payee;
EdgeVO existingEdge = edgeMap.get(edgeKey); EdgeVO existingEdge = edgeMap.get(edgeKey);
...@@ -350,11 +358,19 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem ...@@ -350,11 +358,19 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem
existingEdge.setTotalTransactions(existingEdge.getTotalTransactions() + 1); existingEdge.setTotalTransactions(existingEdge.getTotalTransactions() + 1);
existingEdge.setTotalAmount(existingEdge.getTotalAmount() + amount); existingEdge.setTotalAmount(existingEdge.getTotalAmount() + amount);
} else { } else {
if (entity.getDirection().equals("出账")) {
EdgeVO newEdge = new EdgeVO( EdgeVO newEdge = new EdgeVO(
payer, payee, 1, amount, root, payer, payee, 1, amount, root,
entity.getIp(), entity.getMac(), entity.getPaymentBankName() entity.getIp(), entity.getMac(), entity.getPaymentBankName()
); );
edgeMap.put(edgeKey, newEdge); edgeMap.put(edgeKey, newEdge);
} else {
EdgeVO newEdge = new EdgeVO(
payee, payer, 1, amount, root,
entity.getIp(), entity.getMac(), entity.getPaymentBankName()
);
edgeMap.put(edgeKey, newEdge);
}
} }
} }
......
...@@ -129,6 +129,13 @@ public class ExcelDataServiceImpl extends ServiceImpl<ExcelDataMapper, ExcelData ...@@ -129,6 +129,13 @@ public class ExcelDataServiceImpl extends ServiceImpl<ExcelDataMapper, ExcelData
return baseMapper.queryListByGroupId(caseDTO); return baseMapper.queryListByGroupId(caseDTO);
} }
@Override
public List<ExcelDataEntity> queryListByCaseIdAndPayeeName(int caseId, String payUserName) {
return baseMapper.selectList(new LambdaQueryWrapper<ExcelDataEntity>()
.eq(ExcelDataEntity::getCaseId, caseId)
.eq(ExcelDataEntity::getPayeeName, payUserName));
}
@Override @Override
public List<AssociationVO> queryAccountTemporary(UserDTO userDTO) { public List<AssociationVO> queryAccountTemporary(UserDTO userDTO) {
return baseMapper.queryAccountTemporary(userDTO); return baseMapper.queryAccountTemporary(userDTO);
......
...@@ -133,9 +133,15 @@ public class GroupDetailServiceImpl extends ServiceImpl<GroupDetailMapper, Group ...@@ -133,9 +133,15 @@ public class GroupDetailServiceImpl extends ServiceImpl<GroupDetailMapper, Group
existingEdge.setTotalAmount(existingEdge.getTotalAmount() + amount); existingEdge.setTotalAmount(existingEdge.getTotalAmount() + amount);
} else { } else {
// 如果不存在,创建新的边 // 如果不存在,创建新的边
if (excelDataVO.getDirection().equals("出账")) {
String edgeId = "line-" + payer + "-" + payee; String edgeId = "line-" + payer + "-" + payee;
EdgeVO newEdge = new EdgeVO(edgeId, payer, payee, 1, amount); EdgeVO newEdge = new EdgeVO(edgeId, payer, payee, 1, amount);
edgeMap.put(edgeKey, newEdge); edgeMap.put(edgeKey, newEdge);
} else {
String edgeId = "line-" + payee + "-" + payer;
EdgeVO newEdge = new EdgeVO(edgeId, payee, payer, 1, amount);
edgeMap.put(edgeKey, newEdge);
}
} }
} }
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
select select
pay_user_name payUserName, pay_user_name payUserName,
payee_name payeeName, payee_name payeeName,
direction,
SUM(amount) amount, SUM(amount) amount,
COUNT(*) AS transactionCount, COUNT(*) AS transactionCount,
max(ip) ip, max(ip) ip,
...@@ -54,7 +55,7 @@ ...@@ -54,7 +55,7 @@
<if test="endTime != null"> <if test="endTime != null">
and time &lt;= #{endTime} and time &lt;= #{endTime}
</if> </if>
group by pay_user_name,payee_name group by pay_user_name,payee_name,direction
</select> </select>
<select id="selectFinancialTransactions" resultType="com.platform.model.vo.AssociationVO"> <select id="selectFinancialTransactions" resultType="com.platform.model.vo.AssociationVO">
select select
...@@ -326,6 +327,7 @@ ...@@ -326,6 +327,7 @@
select select
ed.pay_user_name payUserName, ed.pay_user_name payUserName,
ed.payee_name payeeName, ed.payee_name payeeName,
ed.direction,
SUM(ed.amount) amount, SUM(ed.amount) amount,
COUNT(*) AS transactionCount, COUNT(*) AS transactionCount,
Max(u.label) label Max(u.label) label
......
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