|
@@ -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")) {
|
|
|
|
|
|
mpInfo.putAll(sourceMap);
|
|
|
} else if (Arrays.binarySearch(salecoms, deptCode) >= 0) {
|
|
|
|
|
|
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));
|