Browse Source

添加自定义显示分渠道用户标签开关功能

chenzhenguo 2 years ago
parent
commit
9dc8377b19

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

@@ -24,6 +24,7 @@ import org.elasticsearch.client.RestClient;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.*;
 
@@ -43,6 +44,13 @@ import java.util.*;
 @Controller
 @RequestMapping("/customer")
 public class CustomerApiController {
+    /**
+     * SHOW_ALL_LABLES  不分渠道展示所有标签   总部团险展示所有标签
+     * HIDE_CHANNELS_LABLES   有不同渠道保单情况下 分渠道标签全不显示  仅显示公共标签  , 总部团险展示所有标签
+     * SHOW_DISTINGUISH_CHANNELS_LABLES    分渠道展示标签, 总部团险展示所有标签
+     */
+    @Value("${dgtis.show-label-code}")
+    private  String  showLabelCode = "SHOW_ALL_LABLES";
 
     private static Logger logger = LoggerFactory.getLogger(CustomerApiController.class);
     @Autowired
@@ -50,6 +58,9 @@ public class CustomerApiController {
     @Autowired
     private ISysUserService userService;
 
+
+
+
     @GetMapping("/getCustomerList")
     @ResponseBody
     public AjaxResult getCustomerList(@RequestParam(defaultValue = "1") int pageNum,@RequestParam(defaultValue = "10") int pageSize,
@@ -1374,6 +1385,7 @@ public class CustomerApiController {
 
     }
 
+
     public Map getLables(JSONObject jsonObject,String deptCode ) throws Exception {
         Map mpInfo = new HashMap();
 
@@ -1389,13 +1401,15 @@ public class CustomerApiController {
         String[] salecoms = salecom.split(",");
         Arrays.sort(salecoms);
         Map<String, Object> sourceMap = JSON.parseObject(jsonObject.getString("_source"), Map.class);
-        if (StringUtils.isEmpty(deptCode)) {
+        if (StringUtils.isEmpty(deptCode)||showLabelCode.equals("SHOW_ALL_LABLES")) {
             // 根渠道,也就是上海人寿,也是admin用户所属的渠道,返回jsonObject中的所有标签(公共标签 + 渠道标签)
             mpInfo.putAll(sourceMap);
         } else if (Arrays.binarySearch(salecoms, deptCode) >= 0) {
             // 登录用户的渠道与客户渠道一致,返回jsonObject中的公共标签 + shanglifeecif.customerno_salecom_relation表中的渠道标签
             mpInfo.putAll(getPublicLabels(sourceMap));
-            mpInfo.putAll(getSalecomLabels(source.getString("scustid"), deptCode));
+            if(showLabelCode.equals("SHOW_DISTINGUISH_CHANNELS_LABLES")){
+                mpInfo.putAll(getSalecomLabels(source.getString("scustid"), deptCode));
+            }
         } else {
             // 未找到渠道,不返回渠道标签
             logger.info(String.format("登录渠道和客户所属渠道不匹配,不返回渠道标签,登录渠道 [%s],客户所属渠道 [%s]", deptCode, salecom));

+ 7 - 4
dgtis-modules/dgtis-modules-data/src/main/resources/bootstrap.yml

@@ -1,6 +1,10 @@
 dgtis:
   project-name: ShangHaiLife-ECIF
-  common-server-addr: 10.52.3.1
+  common-server-addr: 10.52.200.159
+ #SHOW_ALL_LABLES  不分渠道展示所有标签   总部团险展示所有标签
+ #HIDE_CHANNELS_LABLES   有不同渠道保单情况下 分渠道标签全不显示  仅显示公共标签  , 总部团险展示所有标签
+ #SHOW_DISTINGUISH_CHANNELS_LABLES    分渠道展示标签, 总部团险展示所有标签
+  show-label-code: SHOW_ALL_LABLES
 # Tomcat
 server:
   port: 19204
@@ -8,13 +12,12 @@ server:
 elasticsearch:
   cluster:
     name: cluster
-  host: 10.52.3.12
+  host: 10.32.2.230
   port: 9200
-  hostlist: 10.52.3.11:9200,10.52.3.12:9200,10.52.3.13:9200
+  hostlist: 10.50.254.44:9200,10.50.254.45:9200,10.50.254.46:9200
   client:
     connectNum: 10
     connectPerRoute: 50
-
 # Spring
 spring: 
   application: