Commit c8e46324 by 叶兴兴

去掉多余的方法

parent e1890704
......@@ -618,50 +618,6 @@ public class PersonRecordController {
return ("".equals(builder.toString())) ? "无" : builder.toString();
}
/**
* 分配的线索
*
* @param subject
* @return
*/
public String convertAllocationClue(Integer subject) {
//List<ClueRecord> clueRecordList=clueRecordService.getClueRecords(subject);
List<RelationRecord> relationRecordList = relationRecordService.getRelationRecords(subject);
Map<Integer, Integer> map = new HashMap<>();
for (RelationRecord relationRecord : relationRecordList) {
if (!map.containsKey(relationRecord.getObject())) {
map.put(relationRecord.getObject(), relationRecord.getMasterInfoLevel());
} else {
if (map.get(relationRecord.getObject()) < relationRecord.getMasterInfoLevel()) {
map.put(relationRecord.getObject(), relationRecord.getMasterInfoLevel());
}
}
}
List<ClueRecord> clueRecordList = new ArrayList<>();
for (Integer key : map.keySet()) {
clueRecordList.addAll(clueRecordService.getClueRecords(key, map.get(key)));
}
Set<String> obj = new HashSet<>();
for (ClueRecord clueRecord : clueRecordList) {
Clue clue = clueService.getById(clueRecord.getClueId());
double prob = RandomUtil.randomDouble(2, RoundingMode.HALF_UP);
if (prob < Double.parseDouble(clue.getProb())) {
if (!StringUtils.isEmpty(clueRecord.getClueTemplate())) {
obj.add(clueRecord.getClueTemplate());
}
}
}
StringBuilder builder = new StringBuilder();
for (String description : obj) {
builder.append(String.format(" %s \n ", description));
}
return ("".equals(builder.toString())) ? "无" : builder.toString();
}
/**
* 分配的线索
*
......@@ -687,7 +643,7 @@ public class PersonRecordController {
clueRecordList.addAll(clueRecordService.getClueRecords(key, map.get(key)));
}
Set<String> obj = new HashSet<>();
List<ClueRecord> cueRecordResult = new ArrayList<>();
List<ClueRecord> clueRecordResult = new ArrayList<>();
for (ClueRecord clueRecord : clueRecordList) {
......@@ -698,7 +654,7 @@ public class PersonRecordController {
obj.add(clueRecord.getClueTemplate() + "(" + clue.getTrustDegree() + "|" + clue.getDeterrenceDegree() + ")");
clueRecord.setTrustDegree(clue.getTrustDegree());
clueRecord.setDeterrenceDegree(clue.getDeterrenceDegree());
cueRecordResult.add(clueRecord);
clueRecordResult.add(clueRecord);
}
}
}
......@@ -707,45 +663,10 @@ public class PersonRecordController {
builder.append(String.format(" %s \n ", description));
}
result.put("1", ("".equals(builder.toString())) ? "无" : builder.toString());
result.put("2", cueRecordResult);
result.put("2", clueRecordResult);
return result;
}
public List<ClueRecord> allocationClue(Integer subject) {
List<RelationRecord> relationRecordList = relationRecordService.getRelationRecords(subject);
Map<Integer, Integer> map = new HashMap<>();
for (RelationRecord relationRecord : relationRecordList) {
if (!map.containsKey(relationRecord.getObject())) {
map.put(relationRecord.getObject(), relationRecord.getMasterInfoLevel());
} else {
if (map.get(relationRecord.getObject()) < relationRecord.getMasterInfoLevel()) {
map.put(relationRecord.getObject(), relationRecord.getMasterInfoLevel());
}
}
}
List<ClueRecord> clueRecordList = new ArrayList<>();
for (Integer key : map.keySet()) {
clueRecordList.addAll(clueRecordService.getClueRecords(key, map.get(key)));
}
List<ClueRecord> result = new ArrayList<>();
for (ClueRecord clueRecord : clueRecordList) {
Clue clue = clueService.getById(clueRecord.getClueId());
double prob = RandomUtil.randomDouble(2, RoundingMode.HALF_UP);
if (prob < Double.parseDouble(clue.getProb())) {
clueRecord.setTrustDegree(clue.getTrustDegree());
clueRecord.setDeterrenceDegree(clue.getDeterrenceDegree());
result.add(clueRecord);
}
}
return result;
}
/**
* 根据身份生成一个人物
*
......
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