<!-- 获取该号码的标签名-->
<select id="getCustomerTagName" resultType="java.lang.String">
SELECT customer_tag_name AS tagname
FROM _customer_tag
WHERE customer_tag_id IN (
SELECT customer_tag_id
FROM _customer_tag_rel
WHERE CUSTOMER_ID = (
SELECT CUSTOMER_ID
FROM _customer
WHERE CUSTOMER_PHONE = #{phoneNum}
)
)
</select>
@Override
public JSONObject iSpecialCustomer(String phoneNum) {
JSONObject result = new JSONObject();
int p = 0;
for (String s : ivrRecordDao.getCustomerTagName(phoneNum)) {
if ("高价值".equals(s) || "VIP".equals(s) || "营销敏感".equals(s) || "投诉敏感".equals(s)) {
p++;
}
}
if (p > 0){
result.put("code","success");
}else {
result.put("code","fail");
}
return result;
}
@ResponseBody
public String iSpecialCustomers(@RequestBody String jsonString) {
JSONObject result = new JSONObject();
Gson gson = new Gson();
String phoneNum = gson.fromJson(jsonString, JSONObject.class).get("phoneNum").toString();
try {
result = ivrRecordSevice.iSpecialCustomer(phoneNum);
// result.put("code","success");
} catch (Exception e) {
result.put("code","fail");
logger.error("error",e);
}
return result.toString();
}
}