Browse Source

邮箱掩码处理

kouchengxing 3 years ago
parent
commit
6f0b2b61d8

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

@@ -489,6 +489,10 @@ public class CustomerApiController {
             Map mpremMap = new HashMap();
             int firstDate = 1;//定义第一次长期险获取
             Date date = new Date();
+            Calendar cal = Calendar.getInstance();
+            cal.setTime(date);
+            cal.add(Calendar.YEAR, 1);
+            Date nextYearTime = cal.getTime();
             String currentDateTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD,date);
             String currentYear = DateUtils.parseDateToStr(DateUtils.YYYY,date);
             //获取最近年份
@@ -525,15 +529,28 @@ public class CustomerApiController {
                     if(_source.containsKey("prem")){
                         //计算年缴保费过滤掉缴费方式趸缴的
                         if(!"趸缴".equals(_source.getString("payment"))){
-                            prem+=_source.getDouble("prem");
+                            String norenewal = _source.getString("norenewal")==null?"":_source.getString("norenewal").trim();//续保次数
+                            String payendyear = _source.getString("payendyear")==null?"":_source.getString("payendyear").trim();//缴费年期
+
+
                             //String currentPadateStr = DateUtils.parseDateToStr(currentYear+"-MM-dd",padate);
                             if(_source.containsKey("npdate")){
                                 Date npdate = _source.getDate("npdate");
+
+
                                 String npDateStr = DateUtils.parseDateToStr("yyyy-MM-dd", npdate);
                                 String npDateStrYear = DateUtils.parseDateToStr("yyyy", npdate);
-                                if(npDateStr.compareTo(currentDateTime)>0 && !npDateStrYear.equals(currentYear)){
+                                //缴费期限和缴费次数不一样   或者   当年缴费期限和缴费次数一样时
+                                if(!norenewal.equals(payendyear) || (norenewal.equals(payendyear) && (Integer.parseInt(npDateStrYear)-1)==Integer.parseInt(currentYear))){
+                                    prem+=_source.getDouble("prem");
+                                    if(norenewal.equals(payendyear) && nextYearTime.getTime()>npdate.getTime() && Integer.parseInt(npDateStrYear)>Integer.parseInt(currentYear)){
+                                        handedinprem+=_source.getDouble("prem");
+                                    }
+                                }
+                                if(!norenewal.equals(payendyear) && npDateStr.compareTo(currentDateTime)>0 && !npDateStrYear.equals(currentYear)){
                                     handedinprem+=_source.getDouble("prem");
                                 }
+
                             }
 
                             String m = DateUtils.parseDateToStr("M", padate);

+ 10 - 0
dgtis-ui/src/utils/ruoyi.js

@@ -223,4 +223,14 @@ export function getArea(val){
     return newArea;
   }
 
+  // 邮箱掩码
+  export function emailYm(email){
+    if(email){
+      this.mystr ="****" +this.email.substr(this.email.indexOf("@"), this.email.length);
+      return mystr;
+    }else{
+      return '';
+    }
+  }
+
 }

+ 5 - 1
dgtis-ui/src/views/system/userInfo/components/contact.vue

@@ -32,7 +32,11 @@
       </el-table-column>
       <el-table-column label="邮政编码" align="center" prop="zipcode" />
       <el-table-column label="微信" align="center" prop="wechat" :show-overflow-tooltip="true"  />
-      <el-table-column label="邮箱" align="center" prop="email" :show-overflow-tooltip="true" />
+      <el-table-column label="邮箱" align="center" :show-overflow-tooltip="true" >
+        <template slot-scope="scope">
+          <span v-text="emailYm(scope.row.email)"></span>
+        </template>
+      </el-table-column>
       <el-table-column label="QQ" align="center" prop="qq"  :show-overflow-tooltip="true"/>
       <el-table-column label="手机" align="center"  :show-overflow-tooltip="true">
         <template slot-scope="scope">