첨부파일 갯수, 위반코드 추출 추가

master
mjkhan21 1 year ago
parent d94165fc69
commit c369a4dc4c

@ -507,6 +507,17 @@ public class Petition extends AbstractEntity {
return this;
}
/** .
* @return
*/
public int getAttachmentCount() {
int count = 0;
for (String path: new String[] {attachmentPath1, attachmentPath2, attachmentPath3, attachmentPath4, attachmentPath5}) {
count += !Assert.isEmpty(path) ? 1 : 0;
}
return count;
}
/** .
* @param attachments
* @return Petition
@ -534,7 +545,7 @@ public class Petition extends AbstractEntity {
return "EPOUGB$" + getSendInterfaceSeqN() + ".xml";
}
/**
/**
* @author mjkhan
*/
@Getter
@ -593,7 +604,7 @@ public class Petition extends AbstractEntity {
@XmlElement(name = "apndfilcont5")
private String apndfilcont5;
/** .
/** .
* @param infoType
* @param infoKey
* @return
@ -648,7 +659,7 @@ public class Petition extends AbstractEntity {
}
}
/**
/**
* @author mjkhan
*/
public static class Violation {
@ -659,10 +670,21 @@ public class Petition extends AbstractEntity {
description = new RegexPattern("(\\(.*\\))(.*)(\\s신고입니다.*)"),
entryType = new RegexPattern("(\\[민원 유입 경로\\]:\\s)(.*)");
private String reason;
private String
title,
reason;
/** .
* @param title
* @return Violation
*/
public Violation setTitle(String title) {
this.title = title;
return this;
}
/** .
* @param reason
/** .
* @param reason
* @return Violation
*/
public Violation setReason(String reason) {
@ -670,7 +692,7 @@ public class Petition extends AbstractEntity {
return this;
}
/** , .
/** , .
* @return ,
* <ul><li>datetime: </li>
* <li>vehicleNo: </li>
@ -694,7 +716,7 @@ public class Petition extends AbstractEntity {
return list;
}
/** .
/** .
* @return
* <ul><li>latitude: </li>
* <li>longitude: </li>
@ -713,7 +735,7 @@ public class Petition extends AbstractEntity {
return info;
}
/** .
/** .
* @return
*/
public String getLocation() {
@ -742,11 +764,10 @@ public class Petition extends AbstractEntity {
return "";
}
/** .
* @param title
/** .
* @return
*/
public String getDescription(String title) {
public String getDescription() {
Matcher matcher = description.matcher(title);
String found = "";
while (matcher.find()) {
@ -755,7 +776,7 @@ public class Petition extends AbstractEntity {
return found;
}
/** .
/** .
* @return
*/
public String getEntryType() {
@ -766,6 +787,21 @@ public class Petition extends AbstractEntity {
}
return found;
}
/** .
* @return
*/
public String getCode() {
String str = title + " " + reason;
if (str.contains("방해"))
return "03";
if (str.contains("표지"))
return "05";
for (String s: new String[] {"주차", "주정차", "주자"})
if (str.contains(s))
return "01";
return "01";
}
}
private static class RegexPattern {

Loading…
Cancel
Save