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

master
mjkhan21 1 year ago
parent d94165fc69
commit c369a4dc4c

@ -507,6 +507,17 @@ public class Petition extends AbstractEntity {
return this; 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 * @param attachments
* @return Petition * @return Petition
@ -534,7 +545,7 @@ public class Petition extends AbstractEntity {
return "EPOUGB$" + getSendInterfaceSeqN() + ".xml"; return "EPOUGB$" + getSendInterfaceSeqN() + ".xml";
} }
/** /**
* @author mjkhan * @author mjkhan
*/ */
@Getter @Getter
@ -593,7 +604,7 @@ public class Petition extends AbstractEntity {
@XmlElement(name = "apndfilcont5") @XmlElement(name = "apndfilcont5")
private String apndfilcont5; private String apndfilcont5;
/** . /** .
* @param infoType * @param infoType
* @param infoKey * @param infoKey
* @return * @return
@ -648,7 +659,7 @@ public class Petition extends AbstractEntity {
} }
} }
/** /**
* @author mjkhan * @author mjkhan
*/ */
public static class Violation { public static class Violation {
@ -659,10 +670,21 @@ public class Petition extends AbstractEntity {
description = new RegexPattern("(\\(.*\\))(.*)(\\s신고입니다.*)"), description = new RegexPattern("(\\(.*\\))(.*)(\\s신고입니다.*)"),
entryType = 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 * @return Violation
*/ */
public Violation setReason(String reason) { public Violation setReason(String reason) {
@ -670,7 +692,7 @@ public class Petition extends AbstractEntity {
return this; return this;
} }
/** , . /** , .
* @return , * @return ,
* <ul><li>datetime: </li> * <ul><li>datetime: </li>
* <li>vehicleNo: </li> * <li>vehicleNo: </li>
@ -694,7 +716,7 @@ public class Petition extends AbstractEntity {
return list; return list;
} }
/** . /** .
* @return * @return
* <ul><li>latitude: </li> * <ul><li>latitude: </li>
* <li>longitude: </li> * <li>longitude: </li>
@ -713,7 +735,7 @@ public class Petition extends AbstractEntity {
return info; return info;
} }
/** . /** .
* @return * @return
*/ */
public String getLocation() { public String getLocation() {
@ -742,11 +764,10 @@ public class Petition extends AbstractEntity {
return ""; return "";
} }
/** . /** .
* @param title
* @return * @return
*/ */
public String getDescription(String title) { public String getDescription() {
Matcher matcher = description.matcher(title); Matcher matcher = description.matcher(title);
String found = ""; String found = "";
while (matcher.find()) { while (matcher.find()) {
@ -755,7 +776,7 @@ public class Petition extends AbstractEntity {
return found; return found;
} }
/** . /** .
* @return * @return
*/ */
public String getEntryType() { public String getEntryType() {
@ -766,6 +787,21 @@ public class Petition extends AbstractEntity {
} }
return found; 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 { private static class RegexPattern {

Loading…
Cancel
Save