Commit 8eedeb12 authored by zhuxiang's avatar zhuxiang
Browse files

优化

parent 9589e2d2
...@@ -40,8 +40,6 @@ public class CaseDTO extends CasesEntity { ...@@ -40,8 +40,6 @@ public class CaseDTO extends CasesEntity {
private String payUserName; private String payUserName;
private String fileName;
private String nodeName; private String nodeName;
private String label; private String label;
......
...@@ -11,8 +11,12 @@ public class EdgeVO { ...@@ -11,8 +11,12 @@ public class EdgeVO {
private String source; private String source;
private String sourceType;
private String target; private String target;
private String targetType;
private String relation; private String relation;
// 总汇款笔数 // 总汇款笔数
private int totalTransactions; private int totalTransactions;
...@@ -30,7 +34,13 @@ public class EdgeVO { ...@@ -30,7 +34,13 @@ public class EdgeVO {
public EdgeVO(String source, String target, int totalTransactions, double totalAmount, String groupId, public EdgeVO(String source, String target, int totalTransactions, double totalAmount, String groupId,
String ip, String mac, String account) { String ip, String mac, String account) {
this.source = source; this.source = source;
this.sourceType = "个人";
this.target = target; this.target = target;
if (target.contains("公司")) {
this.targetType = "银联";
}else{
this.targetType = "个人";
}
this.totalTransactions = totalTransactions; this.totalTransactions = totalTransactions;
this.totalAmount = totalAmount; this.totalAmount = totalAmount;
this.groupId = groupId; this.groupId = groupId;
...@@ -42,7 +52,13 @@ public class EdgeVO { ...@@ -42,7 +52,13 @@ public class EdgeVO {
public EdgeVO(String id, String source, String target, int totalTransactions, double totalAmount) { public EdgeVO(String id, String source, String target, int totalTransactions, double totalAmount) {
this.id = id; this.id = id;
this.source = source; this.source = source;
this.sourceType = "个人";
this.target = target; this.target = target;
if (target.contains("公司")) {
this.targetType = "银联";
}else{
this.targetType = "个人";
}
this.totalTransactions = totalTransactions; this.totalTransactions = totalTransactions;
this.totalAmount = totalAmount; this.totalAmount = totalAmount;
} }
......
...@@ -7,6 +7,14 @@ public class NodeVO { ...@@ -7,6 +7,14 @@ public class NodeVO {
private String node; private String node;
private int nodeNum;
private String label;
private String nodeType;
private String bankCode;
private int degree; private int degree;
public NodeVO(String node) { public NodeVO(String node) {
......
...@@ -7,6 +7,7 @@ import com.platform.model.entity.CasesEntity; ...@@ -7,6 +7,7 @@ import com.platform.model.entity.CasesEntity;
import com.platform.model.vo.CaseVO; import com.platform.model.vo.CaseVO;
import com.platform.model.vo.ExcelDataVO; import com.platform.model.vo.ExcelDataVO;
import com.platform.model.vo.GraphVO; import com.platform.model.vo.GraphVO;
import com.platform.model.vo.NodeVO;
import java.util.List; import java.util.List;
...@@ -58,7 +59,7 @@ public interface CasesService extends IService<CasesEntity> { ...@@ -58,7 +59,7 @@ public interface CasesService extends IService<CasesEntity> {
*/ */
GraphVO draw(CaseDTO caseDTO); GraphVO draw(CaseDTO caseDTO);
List<ExcelDataVO> info(CaseDTO caseDTO); List<NodeVO> info(CaseDTO caseDTO);
/** /**
* 新增编辑 * 新增编辑
......
...@@ -6,7 +6,6 @@ import com.platform.model.entity.ExcelDataEntity; ...@@ -6,7 +6,6 @@ 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.EveryoneVO;
import com.platform.model.vo.UserVO; import com.platform.model.vo.UserVO;
import com.sun.org.apache.xpath.internal.operations.Bool;
import java.util.List; import java.util.List;
......
...@@ -370,7 +370,7 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem ...@@ -370,7 +370,7 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem
} }
@Override @Override
public List<ExcelDataVO> info(CaseDTO caseDTO) { public List<NodeVO> info(CaseDTO caseDTO) {
// 使用Set去重 // 使用Set去重
Set<String> uniqueNodes = new HashSet<>(); Set<String> uniqueNodes = new HashSet<>();
// 使用Map来统计每个人关联的节点数量 // 使用Map来统计每个人关联的节点数量
...@@ -426,7 +426,25 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem ...@@ -426,7 +426,25 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem
} }
} }
} }
return groupedObjects; List<NodeVO> result = Lists.newArrayList();
groupedObjects.forEach(excelDataVO->{
NodeVO person = new NodeVO();
person.setNode(excelDataVO.getPayUserName());
person.setNodeNum(excelDataVO.getNodeNum());
person.setLabel(excelDataVO.getLabel());
person.setNodeType("个人");
result.add(person);
NodeVO org = new NodeVO();
if(StringUtils.isNotBlank(excelDataVO.getPayeeName()) && excelDataVO.getPayeeName().contains("公司")){
org.setNode(excelDataVO.getPayeeName());
org.setNodeNum(excelDataVO.getNodeNum());
org.setBankCode(excelDataVO.getPayeeBankCard());
org.setNodeType("银联");
result.add(org);
}
});
return result;
} }
// 节点过滤逻辑 // 节点过滤逻辑
......
...@@ -21,10 +21,7 @@ ...@@ -21,10 +21,7 @@
and ed.id = #{id} and ed.id = #{id}
</if> </if>
<if test="payUserName != null and payUserName != ''"> <if test="payUserName != null and payUserName != ''">
and ed.pay_user_name like concat('%',#{payUserName},'%') and (ed.pay_user_name like concat('%',#{payUserName},'%') or fu.file_name like concat('%',#{fileName},'%')
</if>
<if test="fileName != null and fileName != ''">
and fu.file_name like concat('%',#{fileName},'%')
</if> </if>
</where> </where>
group by group by
...@@ -46,7 +43,7 @@ ...@@ -46,7 +43,7 @@
and and
case_id = #{id} case_id = #{id}
<if test="startTime != null and endTime != ''"> <if test="startTime != null and endTime != ''">
and time betwenn #{startTime} and #{endTime} and time BETWEEN #{startTime} and #{endTime}
</if> </if>
</select> </select>
<select id="selectFinancialTransactions" resultType="com.platform.model.vo.AssociationVO"> <select id="selectFinancialTransactions" resultType="com.platform.model.vo.AssociationVO">
...@@ -72,6 +69,7 @@ ...@@ -72,6 +69,7 @@
ed.pay_user_name, ed.pay_user_name,
ed.payee_name payeeName, ed.payee_name payeeName,
ed.remark, ed.remark,
ed.payee_bank_card,
ed.external_channel, ed.external_channel,
ed.amount, ed.amount,
u.label u.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