Browse Source

深i企登录加企业时进行时间格式化

v2
蟑螂恶霸 2 years ago
parent
commit
5656d49b9a
  1. 17
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/ThirdLoginServiceImpl.java

17
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/ThirdLoginServiceImpl.java

@ -26,6 +26,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -52,6 +55,8 @@ public class ThirdLoginServiceImpl implements ThirdLoginService {
@Autowired
private IEnterpriseInformationService enterpriseInformationService;
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
@Override
public ZDResponse siqLogin(JSONObject jsonObject) {
try {
@ -149,8 +154,20 @@ public class ThirdLoginServiceImpl implements ThirdLoginService {
//营业时间
//开始时间
String termStart = jsonObject.getString("termStart");
try {
Date termStartD = format.parse(termStart);
termStart = format.format(termStartD);
} catch (ParseException e) {
termStart = "";
}
//结束时间 返回为空表示为永久
String termEnd = jsonObject.getString("termEnd");
try {
Date termEndD = format.parse(termEnd);
termEnd = format.format(termEndD);
} catch (ParseException e) {
termEnd = "";
}
//营业时间
enterpriseInformation.setOperatingTerm(termStart+ "-" +termEnd);

Loading…
Cancel
Save