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,18 +348,29 @@ public class CertificationService { ...@@ -347,18 +348,29 @@ public class CertificationService {
return ObjectRestResponse.succ(); return ObjectRestResponse.succ();
} }
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd"); Date expirationDate = new Date();
formatter.setLenient(false); if (!Validation.isDate(endDate)) {
Date expirationDate = null; Date date = new Date();
try { Calendar c = Calendar.getInstance();
expirationDate = formatter.parse(endDate); c.setTime(date);
} catch (ParseException e) { c.add(Calendar.YEAR, 100);
expirationDate = c.getTime();
e.printStackTrace(); } else {
return ObjectRestResponse.createDefaultFail(); SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
formatter.setLenient(false);
try {
expirationDate = formatter.parse(endDate);
} catch (ParseException e) {
e.printStackTrace();
return ObjectRestResponse.createDefaultFail();
}
} }
idInformation.setExpirationDate(expirationDate); idInformation.setExpirationDate(expirationDate);
Boolean aBoolean = addIdInformation(idInformation); Boolean aBoolean = addIdInformation(idInformation);
......
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