Ver código fonte

Merge remote-tracking branch 'origin/test' into test

785834757 2 anos atrás
pai
commit
5764de5450

+ 1 - 7
src/main/java/com/ydtech/modules/order/components/gouren/GuorenDuplicateInsuranceComponent.java

@@ -81,18 +81,12 @@ public class GuorenDuplicateInsuranceComponent {
         if (b) {
             try {
                 String group = m.group(1);
-                System.out.println(group);
                 String startDate = group.replace(":", "").replace(":", "").replace("-", "").replace(" ", "");
                 String string = dateFormatMap.get(startDate.length());
                 SimpleDateFormat dateFormat = new SimpleDateFormat(string);
                 SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-
                 Date parse = dateFormat.parse(startDate);
-                Date start = new Date();
-
-                if (start.after(parse)) {
-                    return simpleDateFormat.format(parse);
-                }
+                return simpleDateFormat.format(parse);
 
             } catch (Exception e) {
                 throw new SystemException(message);

+ 16 - 2
src/main/java/com/ydtech/modules/order/components/zijin/ZijinDuplicateInsuranceComponents.java

@@ -16,7 +16,8 @@ import org.springframework.context.annotation.Lazy;
 import org.springframework.http.HttpHeaders;
 import org.springframework.stereotype.Component;
 
-import java.util.Optional;
+import java.text.SimpleDateFormat;
+import java.util.Date;
 
 
 /**
@@ -56,7 +57,6 @@ public class ZijinDuplicateInsuranceComponents extends ResponseMessageAbstractHa
                                                    boolean retry) {
 
 
-
         InsuranceLog.infoLog(InsuranceEnum.ZKIC.getPinyin(), "\n\t---------> {}\n\t---------> {}", "紫金财险重复投保处理",
                 calculatePremiumResponse.getRtnMsg());
         String rtnMsg = calculatePremiumResponse.getRtnMsg();
@@ -81,6 +81,20 @@ public class ZijinDuplicateInsuranceComponents extends ResponseMessageAbstractHa
         // 商业险
         if (rtnMsg.contains(SY)) {
             syEndDate = GuorenDuplicateInsuranceComponent.getEndDate(rtnMsg, SY_REGEX);
+            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            try {
+                Date parse = simpleDateFormat.parse(syEndDate);
+                Date date = new Date();
+                if (date.after(parse)) {
+                    syEndDate = "";
+                    if(jqEndDate.isEmpty()){
+                        return calculatePremiumResponse;
+                    }
+                }
+
+            } catch (Exception ignored) {
+
+            }
         }
 
         if (jqEndDate.isEmpty() && syEndDate.isEmpty()) {