From 5656d49b9ae01e9118abf3b033922e098ed1e1f2 Mon Sep 17 00:00:00 2001 From: kylin L <452061493@qq.com> Date: Mon, 3 Jun 2024 11:49:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=B1i=E4=BC=81=E7=99=BB=E5=BD=95=E5=8A=A0?= =?UTF-8?q?=E4=BC=81=E4=B8=9A=E6=97=B6=E8=BF=9B=E8=A1=8C=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ThirdLoginServiceImpl.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/ThirdLoginServiceImpl.java b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/ThirdLoginServiceImpl.java index 6bcecfe9..6faf9479 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/ThirdLoginServiceImpl.java +++ b/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);