|
@@ -19,6 +19,8 @@ import java.util.stream.Collectors;
|
|
|
*/
|
|
|
public class merge_title extends UDF {
|
|
|
private static final String empty = "[]";
|
|
|
+ private static final String yg_key = "0";
|
|
|
+ private static final String bg_key = "1";
|
|
|
private static final Map<String, String> maping = ImmutableMap.of("0", "原告", "1", "被告");
|
|
|
|
|
|
public String evaluate(String name, String party_title, String flag, String case_no) {
|
|
@@ -43,17 +45,17 @@ public class merge_title extends UDF {
|
|
|
public String getTitle(String flag, String case_no) {
|
|
|
if (StringUtils.isBlank(case_no)) return maping.get(flag);
|
|
|
if (case_no.contains("执")) {
|
|
|
- return "申请执行人、被执行人";
|
|
|
- } else if (case_no.contains("刑初")) {
|
|
|
- return "被告";
|
|
|
+ return yg_key.equals(flag) ? "申请执行人" : "申请执行人";
|
|
|
} else if (case_no.contains("终")) {
|
|
|
- return "上诉人、被上诉人";
|
|
|
- } else if (case_no.contains("民申")) {
|
|
|
- return "再审申请人、被申请人";
|
|
|
+ return yg_key.equals(flag) ? "上诉人" : "被上诉人";
|
|
|
} else if (case_no.contains("行终")) {
|
|
|
- return "上诉人、被上诉人";
|
|
|
+ return yg_key.equals(flag) ? "上诉人" : "被上诉人";
|
|
|
+ } else if (case_no.contains("刑初")) {
|
|
|
+ return yg_key.equals(flag) ? "原告" : "被告";
|
|
|
+ } else if (case_no.contains("民申")) {
|
|
|
+ return yg_key.equals(flag) ? "再审申请人" : "被申请人";
|
|
|
} else if (case_no.contains("财保")) {
|
|
|
- return "申请人、被申请人";
|
|
|
+ return yg_key.equals(flag) ? "申请人" : "被申请人";
|
|
|
}
|
|
|
return maping.get(flag);
|
|
|
}
|
|
@@ -64,8 +66,8 @@ public class merge_title extends UDF {
|
|
|
//String name = null;
|
|
|
String party_title = "[{\"name\":\"n11\",\"litigant_id\":\"p22\",\"party_title\":\"一审原告\"},{\"name\":\"n21\",\"litigant_id\":\"p22\",\"party_title\":\"第三人\"}]";
|
|
|
//String party_title = null;
|
|
|
- String flag = "1";
|
|
|
- String case_no = "(2020)粤1302民初16042号";
|
|
|
+ String flag = "0";
|
|
|
+ String case_no = "(2020)粤1302民申16042号";
|
|
|
merge_title m = new merge_title();
|
|
|
System.out.println(m.evaluate(name, party_title, flag, case_no));
|
|
|
}
|