Pārlūkot izejas kodu

修改历史时间返回异常

haoyu 2 gadi atpakaļ
vecāks
revīzija
d4b0a65ceb

+ 8 - 1
src/main/java/com/ydtech/modules/protocol/service/impl/PtlAgreementHistoryServiceImpl.java

@@ -13,6 +13,8 @@ import com.ydtech.modules.protocol.service.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -82,7 +84,12 @@ public class PtlAgreementHistoryServiceImpl extends ServiceImpl<PtlAgreementHist
             ptlAgreementHistoryConvertQueryVo.setUnderwritingDescription(hashJson.getString("underwriting_description"));
             ptlAgreementHistoryConvertQueryVo.setOperatorType(hashJson.getString("operator_type"));
             ptlAgreementHistoryConvertQueryVo.setOperator(hashJson.getString("operator"));
-            ptlAgreementHistoryConvertQueryVo.setOperatorTime(hashJson.getString("operator_time"));
+
+            String operatorTimeStr = hashJson.getString("operator_time");
+            LocalDateTime operatorTime = LocalDateTime.parse(operatorTimeStr);
+            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+            String formattedTime = operatorTime.format(formatter);
+            ptlAgreementHistoryConvertQueryVo.setOperatorTime(formattedTime);
 
             PtlAgreementAttributionHistory ptlAgreementAttributionHistory = new PtlAgreementAttributionHistory();
             ptlAgreementAttributionHistory.setInsCompanyId(hashJson.getString("ins_company_id"));