Commit 299a0f6d authored by hanfeng's avatar hanfeng

修改实名认证,证件到期时间

parent fe70118f
...@@ -24,6 +24,7 @@ import org.springframework.stereotype.Service; ...@@ -24,6 +24,7 @@ import org.springframework.stereotype.Service;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
...@@ -347,9 +348,18 @@ public class CertificationService { ...@@ -347,9 +348,18 @@ public class CertificationService {
return ObjectRestResponse.succ(); return ObjectRestResponse.succ();
} }
Date expirationDate = new Date();
if (!Validation.isDate(endDate)) {
Date date = new Date();
Calendar c = Calendar.getInstance();
c.setTime(date);
c.add(Calendar.YEAR, 100);
expirationDate = c.getTime();
} else {
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd"); SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
formatter.setLenient(false); formatter.setLenient(false);
Date expirationDate = null;
try { try {
expirationDate = formatter.parse(endDate); expirationDate = formatter.parse(endDate);
} catch (ParseException e) { } catch (ParseException e) {
...@@ -358,6 +368,8 @@ public class CertificationService { ...@@ -358,6 +368,8 @@ public class CertificationService {
return ObjectRestResponse.createDefaultFail(); return ObjectRestResponse.createDefaultFail();
} }
}
idInformation.setExpirationDate(expirationDate); idInformation.setExpirationDate(expirationDate);
......
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