2 Commity 471799d1df ... 811d0c18fc

Autor SHA1 Wiadomość Data
  chenzhenguo 811d0c18fc security ,提取周岁天数判断 2 lat temu
  chenzhenguo 1e9c5eac24 dateMerge 报错问题修改 2 lat temu

+ 19 - 16
dgtis-modules/dgtis-modules-data/src/main/java/com/dgtis/data/api/CustomerApiController.java

@@ -1835,26 +1835,29 @@ public class CustomerApiController {
 
     public List<PolicyDate> dateMerge(List<PolicyDate> policyDates) {
         List<PolicyDate> rst = new ArrayList<>();
-        rst.add(policyDates.get(0));
-        for (int i = 1, j = 0; i < policyDates.size(); i++) {
-            PolicyDate ip = policyDates.get(i);
-            PolicyDate jp = rst.get(j);
-            int isje = ip.getStartDate().compareTo(jp.getEndDate());
-            if (isje <= 0) {
-                // next start 在 last end之前,要判断next end位置
-                int ieje = ip.getEndDate().compareTo(jp.getEndDate());
-                if (ieje <= 0) {
-                    //nothing 说明下一个时间范围包含在上一个时间范围内,不做任何操作
+        if(null!=policyDates&&policyDates.size()>0){
+            rst.add(policyDates.get(0));
+            for (int i = 1, j = 0; i < policyDates.size(); i++) {
+                PolicyDate ip = policyDates.get(i);
+                PolicyDate jp = rst.get(j);
+                int isje = ip.getStartDate().compareTo(jp.getEndDate());
+                if (isje <= 0) {
+                    // next start 在 last end之前,要判断next end位置
+                    int ieje = ip.getEndDate().compareTo(jp.getEndDate());
+                    if (ieje <= 0) {
+                        //nothing 说明下一个时间范围包含在上一个时间范围内,不做任何操作
+                    } else {
+                        // 说明下一个结束时间在上一个结束时间之后,更新结束时间
+                        jp.setEndDate(ip.getEndDate());
+                    }
                 } else {
-                    // 说明下一个结束时间在上一个结束时间之后,更新结束时间
-                    jp.setEndDate(ip.getEndDate());
+                    // 下一个开始时间在上一个结束时间之后,说明这又是一个新的时间范围,加入rst
+                    rst.add(ip);
+                    j++;
                 }
-            } else {
-                // 下一个开始时间在上一个结束时间之后,说明这又是一个新的时间范围,加入rst
-                rst.add(ip);
-                j++;
             }
         }
+
         return rst;
     }
 

+ 8 - 23
sql-achievement/存储过程/保单qxp.sql

@@ -187,29 +187,14 @@ SELECT
 	RISKCODE,--productid ,-- '险种代码 POLICY_INFORMATION.RISKCODE', 
 	SALECOM,--policybelong ,-- '业绩归属 POLICY_INFORMATION.SALECOM', 
 	PAYENDYEAR,--payendyear ,-- '缴费年期 POLICY_INFORMATION.PAYENDYEAR', 
-	
-	case
-		when security ='终身' then 42720
-		when security = '至100周岁' then 36500
-		when security = '至80周岁' then 29200
-		when security = '70年' then 25550
-		when security = '至70周岁' then 25550
-		when security = '至65周岁' then 23725
-		when security = '至60周岁' then 21900
-		when security = '30年' then 10950
-		when security = '20年' then 7300
-		when security = '10年' then 3650
-		when security = '6年' then 2190
-		when security = '5年' then 1825
-		when security = '1年' then 365
-		when security = '180天' then 180
-		when security = '6月' then 180
-		when security = '90天' then 90
-		when security = '3月' then 90
-		when security = '1月' then 30
-		when security = '30天' then 30
-		when security = '15天' then 15
-		when security = '7天' then 7
+
+    case
+        when security ='终身' then 42720
+        WHEN security LIKE '%天' THEN CAST(SUBSTR(security, 1, LENGTH(security) - 1) AS INT)
+        WHEN security LIKE '%月' THEN CAST(SUBSTR(security, 1, LENGTH(security) - 1) AS INT) * 30
+        WHEN security LIKE '%年' THEN CAST(SUBSTR(security, 1, LENGTH(security) - 1) AS INT) * 365
+        WHEN security LIKE '%周岁' THEN CAST(SUBSTR(security, 2, LENGTH(security) - 3) AS INT) * 365
+        ELSE 0
 	end,
 	'admin',
 	sysdate() 

+ 7 - 22
sql-achievement/存储过程/测试环境/存储过程.sql

@@ -1637,28 +1637,13 @@ SELECT
 	trim(PRESERVATIONFLAG) as PRESERVATIONFLAG,--保全标志
 	"上海人寿上海分公司",
 	trim(security) as security, --保险期原始值
-	case
-		when security ='终身' then 42720
-		when security = '至100周岁' then 36500
-		when security = '至80周岁' then 29200
-		when security = '70年' then 25550
-		when security = '至70周岁' then 25550
-		when security = '至65周岁' then 23725
-		when security = '至60周岁' then 21900
-		when security = '30年' then 10950
-		when security = '20年' then 7300
-		when security = '10年' then 3650
-		when security = '6年' then 2190
-		when security = '5年' then 1825
-		when security = '1年' then 365
-		when security = '180天' then 180
-		when security = '6月' then 180
-		when security = '90天' then 90
-		when security = '3月' then 90
-		when security = '1月' then 30
-		when security = '30天' then 30
-		when security = '15天' then 15
-		when security = '7天' then 7
+		case
+        when security ='终身' then 42720
+        WHEN security LIKE '%天' THEN CAST(SUBSTR(security, 1, LENGTH(security) - 1) AS INT)
+        WHEN security LIKE '%月' THEN CAST(SUBSTR(security, 1, LENGTH(security) - 1) AS INT) * 30
+        WHEN security LIKE '%年' THEN CAST(SUBSTR(security, 1, LENGTH(security) - 1) AS INT) * 365
+        WHEN security LIKE '%周岁' THEN CAST(SUBSTR(security, 2, LENGTH(security) - 3) AS INT) * 365
+        ELSE 0
 	end,
 	trim(AGENTCODE) as AGENTCODE,--代理人代码
 	trim(AGENTNAME) as AGENTNAME,--代理人名称

+ 7 - 22
sql-achievement/存储过程/生产环境/存储过程.sql

@@ -1072,28 +1072,13 @@ SELECT
 	trim(PRESERVATIONFLAG) as PRESERVATIONFLAG,--保全标志
 	"上海人寿上海分公司",
 	trim(security) as security, --保险期原始值
-	case
-		when security ='终身' then 42720
-		when security = '至100周岁' then 36500
-		when security = '至80周岁' then 29200
-		when security = '70年' then 25550
-		when security = '至70周岁' then 25550
-		when security = '至65周岁' then 23725
-		when security = '至60周岁' then 21900
-		when security = '30年' then 10950
-		when security = '20年' then 7300
-		when security = '10年' then 3650
-		when security = '6年' then 2190
-		when security = '5年' then 1825
-		when security = '1年' then 365
-		when security = '180天' then 180
-		when security = '6月' then 180
-		when security = '90天' then 90
-		when security = '3月' then 90
-		when security = '1月' then 30
-		when security = '30天' then 30
-		when security = '15天' then 15
-		when security = '7天' then 7
+		case
+        when security ='终身' then 42720
+        WHEN security LIKE '%天' THEN CAST(SUBSTR(security, 1, LENGTH(security) - 1) AS INT)
+        WHEN security LIKE '%月' THEN CAST(SUBSTR(security, 1, LENGTH(security) - 1) AS INT) * 30
+        WHEN security LIKE '%年' THEN CAST(SUBSTR(security, 1, LENGTH(security) - 1) AS INT) * 365
+        WHEN security LIKE '%周岁' THEN CAST(SUBSTR(security, 2, LENGTH(security) - 3) AS INT) * 365
+        ELSE 0
 	end,
 	trim(AGENTCODE) as AGENTCODE,--代理人代码
 	trim(AGENTNAME) as AGENTNAME,--代理人名称

+ 8 - 23
sql-achievement/存储过程/生产环境/存储过程——new.sql

@@ -1638,27 +1638,12 @@ SELECT
 	"上海人寿上海分公司",
 	trim(security) as security, --保险期原始值
 	case
-		when security ='终身' then 42720
-		when security = '至100周岁' then 36500
-		when security = '至80周岁' then 29200
-		when security = '70年' then 25550
-		when security = '至70周岁' then 25550
-		when security = '至65周岁' then 23725
-		when security = '至60周岁' then 21900
-		when security = '30年' then 10950
-		when security = '20年' then 7300
-		when security = '10年' then 3650
-		when security = '6年' then 2190
-		when security = '5年' then 1825
-		when security = '1年' then 365
-		when security = '180天' then 180
-		when security = '6月' then 180
-		when security = '90天' then 90
-		when security = '3月' then 90
-		when security = '1月' then 30
-		when security = '30天' then 30
-		when security = '15天' then 15
-		when security = '7天' then 7
+        when security ='终身' then 42720
+        WHEN security LIKE '%天' THEN CAST(SUBSTR(security, 1, LENGTH(security) - 1) AS INT)
+        WHEN security LIKE '%月' THEN CAST(SUBSTR(security, 1, LENGTH(security) - 1) AS INT) * 30
+        WHEN security LIKE '%年' THEN CAST(SUBSTR(security, 1, LENGTH(security) - 1) AS INT) * 365
+        WHEN security LIKE '%周岁' THEN CAST(SUBSTR(security, 2, LENGTH(security) - 3) AS INT) * 365
+        ELSE 0
 	end,
 	trim(AGENTCODE) as AGENTCODE,--代理人代码
 	trim(AGENTNAME) as AGENTNAME,--代理人名称
@@ -2547,7 +2532,7 @@ BEGIN
 		 	salecom,
 		 	salecomname
 		)SELECT row_number()over(),p.customerno,p.contno,p.cvalidate,t.edorappdate ,p.salecom,p.salecomname FROM dsj.lpedoritem t,dsj.policy_information p
-	WHERE t.contno = p.contno and t.edortype='CT' AND t.edorstate = 0 ;
+	WHERE t.contno = p.contno and (t.edortype='CT' OR t.edortype='WT' ) AND t.edorstate = 0 ;
 	dbms_output.put_line('tb_customerinfo函数跑批完成!');
 	EXCEPTION
 			WHEN HIVE_EXCEPTION THEN
@@ -3120,7 +3105,7 @@ BEGIN
 	-- 31. 父母生日提醒	Label78	父亲生日临近 | 母亲生日临近			客户父母生日-当前日期<=5
 	UPDATE shanglifeecif.customerno_salecom_relation si1 SET si1.label78 = (
 		SELECT
-			case max(p.insuredsex)
+			case max(p.insuredsdeleteex)
 				when '0' then '父亲生日临近'
 				when '1' then '母亲生日临近'
 			end as s