Bläddra i källkod

客户信息接口完善

kouchengxing 4 år sedan
förälder
incheckning
2c35081c6f

+ 2 - 2
dgtis-common/dgtis-common-core/src/main/java/com/dgtis/common/core/utils/poi/CsvUtil.java

@@ -110,9 +110,9 @@ public class CsvUtil {
         // 写入文件头部
         for (String data : str) {
             if (data == null || "null".equals(data)) {
-                csvWriter.write("=\"" + " " + "\",");
+                csvWriter.write("\"" + " " + "\",");
             } else {
-                csvWriter.write("=\"" + data + "\",");
+                csvWriter.write("\"" + data + "\",");
             }
         }
         csvWriter.newLine();

+ 71 - 31
dgtis-modules/dgtis-modules-data/src/main/java/com/dgtis/data/api/CustomerApiController.java

@@ -51,26 +51,29 @@ public class CustomerApiController {
     @GetMapping("/getCustomerList")
     @ResponseBody
     public AjaxResult getCustomerList(@RequestParam(defaultValue = "1") int pageNum,@RequestParam(defaultValue = "10") int pageSize,
-                                      String education,//学历
-      String policybelong,//业绩归属
-       String payS,String payE,  //年缴费区间
-       String fadate,//投保年份
-       String productname,//险种类别
-       String  insuredAmountS,String  insuredAmountE,//保额区间
-        String  ageS,String ageE,//年龄区间
-         String gender,//性别
-         String sobirth,//省份
+          String education,//学历
+          String policybelong,//业绩归属
+          String payS,String payE,  //年缴费区间
+          String fadate,//投保年份
+          String productname,//险种类别
+          String insuredAmountS,String  insuredAmountE,//保额区间
+          String ageS,String ageE,//年龄区间
+          String gender,//性别
+          String sobirth,//省份
           String NOVPolicy,//保单件数
           String custtype,//客户类型  投保人
-         String  SCustID,// 核心客户号
-         String custclass,//客户等级
-         String participantsDateS,String participantsDateE,//参与方时间
-         String PIncomeS,String PIncomeE,//年收入区间
-         String   Insured,//投保对象
-        String   lp,//理赔
-       String   yx,//有效
-       String gzgw,//关注官微
-       String zcgw//注册官微
+          String SCustID,// 核心客户号
+          String custclass,//客户等级
+          String participantsDateS,String participantsDateE,//参与方时间
+          String PIncomeS,String PIncomeE,//年收入区间
+          String Insured,//投保对象
+          String lp,//理赔
+          String yx,//有效
+          String gzgw,//关注官微
+          String zcgw,//注册官微
+          String name,//客户姓名
+          String idcard,//客户证件号码
+          String mobile//客户手机号
         ) {
 
 
@@ -83,12 +86,12 @@ public class CustomerApiController {
             String deptCode = sysUser.getDept().getDeptCode();
             //1.如果存在保单信息的查询条件,需要先查询保单信息然后通过保单关联出客户信息
             //处理保单查询条件
-            List<String> customerIds = new ArrayList<String>();
+            /*List<String> customerIds = new ArrayList<String>();
             if(StringUtils.isNotEmpty(payS) || StringUtils.isNotEmpty(payE)
                     || StringUtils.isNotEmpty(insuredAmountS) || StringUtils.isNotEmpty(insuredAmountE)
                     || StringUtils.isNotEmpty(productname) || StringUtils.isNotEmpty(fadate)){
                 customerIds = queryInsurancearrangement(policybelong,payS,payE,fadate,productname,insuredAmountS,insuredAmountE);
-            }
+            }*/
 
 
             //2.如果没有客户信息以外的查询条件,只需要查询客户信息
@@ -119,6 +122,20 @@ public class CustomerApiController {
                 builder.append("{\"prefix\":{\"policybelong\":\""+deptCode+"\"}},");
             }
 
+            if(StringUtils.isNotEmpty(policybelong)){
+                builder.append("{\"prefix\":{\"policybelong\":\""+policybelong+"\"}},");
+            }
+
+            //客户姓名
+            if(StringUtils.isNotEmpty(name)){
+                builder.append("{\"wildcard\":{\"name\":\"*"+name+"*\"}},");
+            }
+
+            //客户手机
+            if(StringUtils.isNotEmpty(mobile)){
+                builder.append("{\"wildcard\":{\"pmphone\":\"*"+mobile+"*\"}},");
+            }
+
 
             if(StringUtils.isNotEmpty(gender)){
                 builder.append("{\"prefix\":{\"gender\":"+gender+"}},");
@@ -196,14 +213,14 @@ public class CustomerApiController {
                 builder.append ("]}},");
             }
 
-            if(customerIds.size()>0){
+            /*if(customerIds.size()>0){
                 builder.append("{\"terms\":{\"scustid\":[");
                 for (String id:customerIds) {
                     builder.append("\""+id+"\",");
                 }
                 builder.delete(builder.length()-1,builder.length());
                 builder.append ("]}},");
-            }
+            }*/
 
 
             if(StringUtils.isNotEmpty(gzgw) && "0".equals(gzgw)){
@@ -225,7 +242,7 @@ public class CustomerApiController {
                     || (StringUtils.isNotEmpty(zcgw) && "0".equals(zcgw)) || StringUtils.isNotEmpty(yx)
                     || (StringUtils.isNotEmpty(lp) && "0".equals(lp) || StringUtils.isNotEmpty(deptCode) ||
                     StringUtils.isNotEmpty(participantsDateS) || StringUtils.isNotEmpty(participantsDateE) ||
-                    customerIds.size()>0)){
+                    StringUtils.isNotEmpty(policybelong) )){
                 builder.delete(builder.length()-1,builder.length());
             }
 
@@ -252,7 +269,19 @@ public class CustomerApiController {
             }
 
             builder.append("],");
-            builder.append("\"should\":[]");//should
+            builder.append("\"should\":[");
+
+            //客户证件号码
+            if(StringUtils.isNotEmpty(idcard)){
+                builder.append("{\"wildcard\":{\"idcard\":\"*"+idcard+"*\"}},");
+                builder.append("{\"wildcard\":{\"passport\":\"*"+idcard+"*\"}},");
+                builder.append("{\"wildcard\":{\"dlicense\":\"*"+idcard+"*\"}},");
+                builder.append("{\"wildcard\":{\"otheridnumber\":\"*"+idcard+"*\"}},");
+                builder.delete(builder.length()-1,builder.length());
+            }
+
+
+            builder.append("]");//should
             builder.append("}");//boot结束
             builder.append("},");//query结束
             builder.append("\"from\":"+((pageNum-1)*10)+",");//第几页
@@ -754,6 +783,10 @@ public class CustomerApiController {
                 builder.append("{\"prefix\":{\"policybelong\":\""+deptCode+"\"}},");
             }
 
+            if(StringUtils.isNotEmpty(policybelong)){
+                builder.append("{\"prefix\":{\"policybelong\":\""+policybelong+"\"}},");
+            }
+
             if(StringUtils.isNotEmpty(gender)){
                 builder.append("{\"prefix\":{\"gender\":"+gender+"}},");
             }
@@ -849,7 +882,9 @@ public class CustomerApiController {
                     || StringUtils.isNotEmpty(PIncomeS) || StringUtils.isNotEmpty(PIncomeE) || (StringUtils.isNotEmpty(gzgw) && "0".equals(gzgw))
                     || (StringUtils.isNotEmpty(zcgw) && "0".equals(zcgw)) || StringUtils.isNotEmpty(yx)
                     || (StringUtils.isNotEmpty(lp) && "0".equals(lp) || StringUtils.isNotEmpty(deptCode) ||
-                    StringUtils.isNotEmpty(participantsDateS) || StringUtils.isNotEmpty(participantsDateE))){
+                    StringUtils.isNotEmpty(participantsDateS) || StringUtils.isNotEmpty(participantsDateE))
+                    || StringUtils.isNotEmpty(policybelong)
+                    ){
                 builder.delete(builder.length()-1,builder.length());
             }
 
@@ -879,8 +914,8 @@ public class CustomerApiController {
             builder.append("\"should\":[]");//should
             builder.append("}");//boot结束
             builder.append("},");//query结束
-            builder.append("\"from\":"+0+",");//第几页
-            builder.append("\"size\":"+10000+",");//查询几个
+            builder.append("\"from\":\"0\",");//第几页
+            builder.append("\"size\":\"10000\",");//查询几个
             builder.append("\"sort\":[{\"scustid\":{\"order\":\"asc\"}}],");//排序
             builder.append("\"aggs\":{}");//
             builder.append("}");
@@ -923,13 +958,18 @@ public class CustomerApiController {
                     customer.setpIncome(jsonOb.getString("pincome"));
                     customer.setNum(jsonOb.getString("label25"));
                     String ral = jsonOb.getString("ral");
-                    customer.setProvince(StringUtils.isNotBlank(ral)?ral.substring(0,3):"");
+                    if(StringUtils.isNotBlank(ral)){
+                        List list = AddressResolutionUtil.addressResolution(ral);
+                        if(list!=null && list.size()>0){
+                            customer.setProvince(list.get(0).toString());
+                        }
+                    }
                     if(mp.containsKey("birthday")){
-                        String birthday = jsonOb.getString("birthday").length()>10?jsonOb.getString("birthday").substring(0,10):jsonOb.getString("birthday");
+                        String birthday = jsonOb.getString("birthday");
                         mp.put("birthday", birthday);
-                        mp.put("age",DateUtils.getAge(DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS,jsonOb.getString("birthday"))));
+                        mp.put("age",DateUtils.getAge(DateUtils.dateTime(DateUtils.YYYY_MM_DD,birthday)));
                         customer.setBirthDay(birthday);
-                        customer.setAge(DateUtils.getAge(DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS,jsonOb.getString("birthday"))));
+                        customer.setAge(DateUtils.getAge(DateUtils.dateTime(DateUtils.YYYY_MM_DD,birthday)));
                     }
 
                     if(mp.containsKey("idcard")){

+ 1 - 1
dgtis-modules/dgtis-modules-data/src/main/java/com/dgtis/data/config/ElasticSearchConfig.java

@@ -48,7 +48,7 @@ public class ElasticSearchConfig {
     /**
      * 超时时间设为60
      */
-    private static final int TIME_OUT = 30 * 1000;
+    private static final int TIME_OUT = 600 * 1000;
 
 
     @Bean

+ 0 - 4
dgtis-modules/dgtis-modules-data/src/main/java/com/dgtis/data/util/AddressResolutionUtil.java

@@ -65,9 +65,5 @@ public class AddressResolutionUtil {
 
     }
 
-    public static void main(String[] args) {
-        System.out.println(addressResolution("北京市北京市昌平区"));
-
-    }
 
 }