新增销售线索通知
This commit is contained in:
+33
-1
@@ -6,12 +6,19 @@ import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Handler;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.fangjia.core.util.DataUtil;
|
||||
import com.fangjia.core.util.DingDingMessageUtil;
|
||||
import com.fangjia.core.util.HttpRequest;
|
||||
import com.fangjia.core.util.HttpRequestException;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import com.fangjia.coresite.model.JsonModel;
|
||||
@@ -129,8 +136,33 @@ public class SaleLeadsController {
|
||||
}
|
||||
|
||||
saleLeads = converValue(saleLeads);
|
||||
String body =
|
||||
"业务需求:" + saleLeads.getBusiness() + " " + saleLeads.getOtherBusiness() + "\n\n"
|
||||
+ "姓名:" + saleLeads.getUname() + "\n\n"
|
||||
+ "城市:" + saleLeads.getCity() + "\n\n"
|
||||
+ "工作职能:" + saleLeads.getWork() + "" + saleLeads.getOtherWork() + "\n\n"
|
||||
+ "手机:" + saleLeads.getMobile() + "\n\n"
|
||||
+ "邮箱:" + saleLeads.getEmail() + "\n\n"
|
||||
+ "公司名称:" + saleLeads.getCompany() + "\n\n"
|
||||
+ "行业性质:" + saleLeads.getIndustryNature() + "\n\n"
|
||||
+ "线索来源:房价网" ;
|
||||
try {
|
||||
JSONObject requestBody = new JSONObject();
|
||||
requestBody.put("msgtype", "markdown");
|
||||
JSONObject markdown = new JSONObject();
|
||||
markdown.put("title", "销售线索");
|
||||
markdown.put("text", body);
|
||||
requestBody.put("markdown", markdown);
|
||||
HttpRequest request = new HttpRequest();
|
||||
final String ding_url = "https://oapi.dingtalk.com/robot/send?access_token=894650a12af9497bed599df1d5f93b21d6da5bbae45f35f18c5825580ebbdf64";
|
||||
Map<String, String> headers = new HashMap<String, String>();
|
||||
headers.put("Content-Type", "application/json; charset=utf-8");
|
||||
request.postWithBody(ding_url, requestBody, headers, "UTF-8");
|
||||
} catch (HttpRequestException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
saleLeadsService.save(saleLeads);
|
||||
|
||||
|
||||
if(StringUtils.isNotBlank(saleLeads.getBusiness()) && saleLeads.getBusiness().contains("_")){
|
||||
String[] businessArray = saleLeads.getBusiness().split("_");
|
||||
for(String s : businessArray){
|
||||
|
||||
@@ -555,27 +555,53 @@ $(".user_btn").click(function(){
|
||||
scrollTo(0,0);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// 解决信息丢失问题
|
||||
var work = $(".duty:visible").find("select").val()
|
||||
if (work) {
|
||||
work = work.replaceAll("请选择您的工作职能", "")
|
||||
work = work.replaceAll("请选择", "")
|
||||
$("#work").val(work);
|
||||
}
|
||||
|
||||
var box = $(".demand p i.checked");
|
||||
if(box.length>0) {
|
||||
$(".demand").parent().find(".error span").text("")
|
||||
$(".demand").parent().find(".error").hide();
|
||||
var selectOtherFlag = false;
|
||||
var content = []
|
||||
box.each(function () {
|
||||
var s = $(this).parent().find("span").text();
|
||||
if (s.indexOf("请填写") > 0) {
|
||||
selectOtherFlag = true;
|
||||
} else {
|
||||
content.push(s);
|
||||
}
|
||||
})
|
||||
$("#business").val(content.join("_"));
|
||||
}
|
||||
|
||||
|
||||
/*if(!checkEmail()){
|
||||
scrollBy(0,-300);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!checkNature()){
|
||||
scrollBy(0,-200);
|
||||
return false;
|
||||
}
|
||||
if(!checkWork()){
|
||||
scrollBy(0,-100);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if(!checkNature()){
|
||||
scrollBy(0,-200);
|
||||
return false;
|
||||
}
|
||||
if(mid=="1018"||mid=="1016"){
|
||||
if(!checkOtherInfo()){
|
||||
scrollBy(0,-100);
|
||||
return false;
|
||||
}
|
||||
} */
|
||||
}
|
||||
*/
|
||||
|
||||
var cls = $(".agreement i").attr("class");
|
||||
if(cls.indexOf("checked")>-1){
|
||||
|
||||
Reference in New Issue
Block a user