|
|
@@ -2,6 +2,7 @@
|
|
2
|
2
|
using CallCenterApi.DB;
|
|
3
|
3
|
using CallCenterApi.Interface.App_Start;
|
|
4
|
4
|
using CallCenterApi.Interface.Controllers.Base;
|
|
|
5
|
+using CallCenterApi.Interface.Controllers.customer;
|
|
5
|
6
|
using CallCenterApi.Interface.Controllers.workorder;
|
|
6
|
7
|
using CallCenterApi.Interface.Models.Enum;
|
|
7
|
8
|
using CallCenterApi.Interface.Models.Input;
|
|
|
@@ -5317,7 +5318,8 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
5317
|
5318
|
if (!string.IsNullOrEmpty(input.F_ZL_ImprovementRequirements) && !model.F_ZL_ImprovementRequirements.Contains(input.F_ZL_ImprovementRequirements))
|
|
5318
|
5319
|
{
|
|
5319
|
5320
|
string strimprovement = str + input.F_ZL_ImprovementRequirements + ";@# ";
|
|
5320
|
|
- model.F_ZL_ImprovementRequirements = string.IsNullOrEmpty(model.F_ZL_ImprovementRequirements) ? strimprovement : model.F_ZL_ImprovementRequirements + strimprovement; //质量管理科-改进要求
|
|
|
5321
|
+ //model.F_ZL_ImprovementRequirements = string.IsNullOrEmpty(model.F_ZL_ImprovementRequirements) ? strimprovement : model.F_ZL_ImprovementRequirements + strimprovement; //质量管理科-改进要求
|
|
|
5322
|
+ model.F_ZL_ImprovementRequirements = input.F_ZL_ImprovementRequirements; //质量管理科-改进要求
|
|
5321
|
5323
|
}
|
|
5322
|
5324
|
if (!string.IsNullOrEmpty(input.F_ZL_CApprovalNo))
|
|
5323
|
5325
|
model.F_ZL_CApprovalNo = input.F_ZL_CApprovalNo;//质量管理科-对应审批工作流单号
|
|
|
@@ -5347,7 +5349,8 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
5347
|
5349
|
if (!string.IsNullOrEmpty(input.F_EventReason) && !model.F_EventReason.Contains(input.F_EventReason))
|
|
5348
|
5350
|
{
|
|
5349
|
5351
|
string strevent = str + input.F_EventReason + ";@# ";
|
|
5350
|
|
- model.F_EventReason = string.IsNullOrEmpty(model.F_EventReason) ? strevent : model.F_EventReason + strevent; //质量管理科-事件原因
|
|
|
5352
|
+ //model.F_EventReason = string.IsNullOrEmpty(model.F_EventReason) ? strevent : model.F_EventReason + strevent; //质量管理科-事件原因
|
|
|
5353
|
+ model.F_EventReason = input.F_EventReason; //质量管理科-事件原因
|
|
5351
|
5354
|
}
|
|
5352
|
5355
|
if (!string.IsNullOrEmpty(input.F_DrivePhone))
|
|
5353
|
5356
|
model.F_DrivePhone = input.F_DrivePhone;//电话号码
|
|
|
@@ -5979,14 +5982,15 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
5979
|
5982
|
{
|
|
5980
|
5983
|
if (!model.F_SuperiorOpinion.Trim().Contains(Supercont.Trim()))
|
|
5981
|
5984
|
{
|
|
5982
|
|
- model.F_SuperiorOpinion = string.IsNullOrEmpty(model.F_SuperiorOpinion) ? strconts1 : model.F_SuperiorOpinion + strconts1;
|
|
|
5985
|
+ //model.F_SuperiorOpinion = string.IsNullOrEmpty(model.F_SuperiorOpinion) ? strconts1 : model.F_SuperiorOpinion + strconts1;
|
|
|
5986
|
+ model.F_SuperiorOpinion = Supercont.Trim();
|
|
5983
|
5987
|
}
|
|
5984
|
5988
|
}
|
|
5985
|
5989
|
else if (flag == 2)
|
|
5986
|
5990
|
{
|
|
5987
|
5991
|
if (!model.F_SuperiorOpinion2.Trim().Contains(Supercont.Trim()))
|
|
5988
|
5992
|
{
|
|
5989
|
|
- model.F_SuperiorOpinion2 = string.IsNullOrEmpty(model.F_SuperiorOpinion2) ? strconts1 : model.F_SuperiorOpinion2 + strconts1;
|
|
|
5993
|
+ model.F_SuperiorOpinion2 = Supercont.Trim();
|
|
5990
|
5994
|
}
|
|
5991
|
5995
|
}
|
|
5992
|
5996
|
}
|
|
|
@@ -7407,14 +7411,16 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
7407
|
7411
|
{
|
|
7408
|
7412
|
if (!model.F_SuperiorOpinion.Trim().Contains(cont.Trim()))
|
|
7409
|
7413
|
{
|
|
7410
|
|
- model.F_SuperiorOpinion = nowUser.F_UserName + "(" + nowUser.F_WorkNumber + ") " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " " + cont;
|
|
|
7414
|
+ //model.F_SuperiorOpinion = nowUser.F_UserName + "(" + nowUser.F_WorkNumber + ") " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " " + cont;
|
|
|
7415
|
+ model.F_SuperiorOpinion = cont;
|
|
7411
|
7416
|
}
|
|
7412
|
7417
|
}
|
|
7413
|
7418
|
else if (flag == 2)
|
|
7414
|
7419
|
{
|
|
7415
|
7420
|
if (!model.F_SuperiorOpinion2.Trim().Contains(cont.Trim()))
|
|
7416
|
7421
|
{
|
|
7417
|
|
- model.F_SuperiorOpinion2 = string.IsNullOrEmpty(model.F_SuperiorOpinion2) ? strconts1 : model.F_SuperiorOpinion2 + strconts1;
|
|
|
7422
|
+ //model.F_SuperiorOpinion2 = string.IsNullOrEmpty(model.F_SuperiorOpinion2) ? strconts1 : model.F_SuperiorOpinion2 + strconts1;
|
|
|
7423
|
+ model.F_SuperiorOpinion2 = cont;
|
|
7418
|
7424
|
}
|
|
7419
|
7425
|
}
|
|
7420
|
7426
|
//model.F_SuperiorOpinion = string.IsNullOrEmpty(model.F_SuperiorOpinion) ? cont : model.F_SuperiorOpinion + "; " + cont;
|
|
|
@@ -7857,6 +7863,231 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
7857
|
7863
|
var res = itembll.Add(itemModel);
|
|
7858
|
7864
|
return res;
|
|
7859
|
7865
|
}
|
|
|
7866
|
+
|
|
|
7867
|
+ #region 客户来电
|
|
|
7868
|
+ public ActionResult GetCallList(string phone,int pageindex = 1, int pagesize = 10)
|
|
|
7869
|
+ {
|
|
|
7870
|
+ DataTable dt = new DataTable();
|
|
|
7871
|
+ string sql = " and DealType =3";
|
|
|
7872
|
+ //sql+= " and datediff(Minute,BeginTime,'" + DateTime.Now.ToString() + "')<=5 ";
|
|
|
7873
|
+ if (phone != null && phone.Trim() != "")
|
|
|
7874
|
+ {
|
|
|
7875
|
+ sql += " and CallNumber like '%" + phone + "%'";
|
|
|
7876
|
+ }
|
|
|
7877
|
+ int recordCount = 0;
|
|
|
7878
|
+ dt = BLL.PagerBLL.GetListPager(
|
|
|
7879
|
+ "T_Call_CallRecords left join T_Sys_UserAccount on UserCode=F_UserCode",
|
|
|
7880
|
+ "CallRecordsId",
|
|
|
7881
|
+ "T_Call_CallRecords.*,T_Sys_UserAccount.F_SeartGroup,(SELECT F_DeptName FROM dbo.T_Sys_Department WHERE F_DeptId = T_Sys_UserAccount.F_DeptId) AS DeptName",
|
|
|
7882
|
+ sql,
|
|
|
7883
|
+ "ORDER BY CallRecordsId desc",
|
|
|
7884
|
+ pagesize,
|
|
|
7885
|
+ pageindex,
|
|
|
7886
|
+ true,
|
|
|
7887
|
+ out recordCount);
|
|
|
7888
|
+
|
|
|
7889
|
+ dt.Columns.Add("CusName");
|
|
|
7890
|
+ dt.Columns.Add("PhoneAddress",typeof(string));
|
|
|
7891
|
+
|
|
|
7892
|
+ var config = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='PlayPath' ").FirstOrDefault();
|
|
|
7893
|
+ var users = new BLL.T_Sys_UserAccount().GetModelList("");
|
|
|
7894
|
+
|
|
|
7895
|
+ foreach (DataRow dr in dt.Rows)
|
|
|
7896
|
+ {
|
|
|
7897
|
+ string path = dr["FilePath"] != null ? dr["FilePath"].ToString() : "";
|
|
|
7898
|
+ if (path != "" && config != null && !string.IsNullOrEmpty(config.F_ParamValue))
|
|
|
7899
|
+ {
|
|
|
7900
|
+ var ym = config.F_ParamValue;
|
|
|
7901
|
+ if (ym.Substring(ym.Length - 1) == "/")
|
|
|
7902
|
+ {
|
|
|
7903
|
+ ym = ym.Substring(0, ym.Length - 1);
|
|
|
7904
|
+ }
|
|
|
7905
|
+ dr["FilePath"] = ym + path.Substring(path.IndexOf(':') + 1).Replace('\\', '/');
|
|
|
7906
|
+ }
|
|
|
7907
|
+ string ucode = dr["UserCode"] != null ? dr["UserCode"].ToString() : "";
|
|
|
7908
|
+ string uname = dr["UserName"] != null ? dr["UserName"].ToString() : "";
|
|
|
7909
|
+ string tephone = dr["CallNumber"] != null ? dr["CallNumber"].ToString() : "";
|
|
|
7910
|
+ if (ucode != "")
|
|
|
7911
|
+ {
|
|
|
7912
|
+ if (uname == "")
|
|
|
7913
|
+ {
|
|
|
7914
|
+ var uu = users.Where(u => u.F_UserCode.Equals(ucode)).FirstOrDefault();
|
|
|
7915
|
+ if (uu != null)
|
|
|
7916
|
+ dr["UserName"] = uu.F_UserName;
|
|
|
7917
|
+ }
|
|
|
7918
|
+ }
|
|
|
7919
|
+ if (!string.IsNullOrEmpty(tephone))
|
|
|
7920
|
+ {
|
|
|
7921
|
+ //12:08 2020/2/27 过滤字段F_LegalPhone字段中的空格
|
|
|
7922
|
+ Model.T_Cus_CustomerBaseNew cus = new BLL.T_Cus_CustomerBaseNew().GetModelList(" REPLACE(F_LegalPhone,' ','') ='" + tephone + "' ").FirstOrDefault();
|
|
|
7923
|
+ Model.T_Cus_CustomerBaseNew cusll = new BLL.T_Cus_CustomerBaseNew().GetModelList(" REPLACE(F_LegalPhone,' ','') ='0" + tephone + "' ").FirstOrDefault();
|
|
|
7924
|
+ if (cus != null)
|
|
|
7925
|
+ {
|
|
|
7926
|
+ dr["CusName"] = new BLL.T_Cus_CustomerBaseNew().GetModelList(" REPLACE(F_LegalPhone,' ','') ='" + tephone + "' ").FirstOrDefault().F_Legal;
|
|
|
7927
|
+ }
|
|
|
7928
|
+ else if (cusll != null)
|
|
|
7929
|
+ {
|
|
|
7930
|
+ dr["CusName"] = new BLL.T_Cus_CustomerBaseNew().GetModelList(" REPLACE(F_LegalPhone,' ','') ='0" + tephone + "' ").FirstOrDefault().F_Legal;
|
|
|
7931
|
+ }
|
|
|
7932
|
+
|
|
|
7933
|
+ var otherController = DependencyResolver.Current.GetService<CustomerNewController>();
|
|
|
7934
|
+ var result = ((ContentResult)otherController.GetCustomerByTel(tephone)).Content.ToObject<AjaxResult>();
|
|
|
7935
|
+ if (result.state.ToString() == "success")
|
|
|
7936
|
+ {
|
|
|
7937
|
+ dr["PhoneAddress"] = ((dynamic)result.data).CityaddressDes;
|
|
|
7938
|
+ }
|
|
|
7939
|
+ //object acre = JsonConvert.DeserializeObject<object>(GetActionResult(tephone).ToJson());
|
|
|
7940
|
+ //dr["PhoneAddress"] = ((dynamic)acre).CityaddressDes;
|
|
|
7941
|
+ }
|
|
|
7942
|
+
|
|
|
7943
|
+ }
|
|
|
7944
|
+
|
|
|
7945
|
+ var obj = new
|
|
|
7946
|
+ {
|
|
|
7947
|
+ state = "success",
|
|
|
7948
|
+ message = "成功",
|
|
|
7949
|
+ rows = dt,
|
|
|
7950
|
+ total = recordCount
|
|
|
7951
|
+ };
|
|
|
7952
|
+
|
|
|
7953
|
+ return Content(obj.ToJson());
|
|
|
7954
|
+
|
|
|
7955
|
+ }
|
|
|
7956
|
+
|
|
|
7957
|
+ public ActionResult GetActionResult(string tel)
|
|
|
7958
|
+ {
|
|
|
7959
|
+ var otherController = DependencyResolver.Current.GetService<CustomerNewController>();
|
|
|
7960
|
+ var result = otherController.GetCustomerByTel(tel);
|
|
|
7961
|
+ return result;
|
|
|
7962
|
+ }
|
|
|
7963
|
+
|
|
|
7964
|
+ #endregion
|
|
|
7965
|
+ /// <summary>
|
|
|
7966
|
+ /// 获取记录详情
|
|
|
7967
|
+ /// </summary>
|
|
|
7968
|
+ /// <param name="callid"></param>
|
|
|
7969
|
+ /// <returns></returns>
|
|
|
7970
|
+ public ActionResult GetCallDetail(int callid)
|
|
|
7971
|
+ {
|
|
|
7972
|
+ if (callid != 0)
|
|
|
7973
|
+ {
|
|
|
7974
|
+ var model = new BLL.T_Call_CallRecords().GetModel(callid);
|
|
|
7975
|
+ Model.T_Cus_CustomerBaseNew cusmodel = null;
|
|
|
7976
|
+ if (model != null)
|
|
|
7977
|
+ {
|
|
|
7978
|
+ string CusName = "", PhoneAddress="";
|
|
|
7979
|
+ string tephone = model.CallNumber!= null ? model.CallNumber.ToString() : "";
|
|
|
7980
|
+ if (!string.IsNullOrEmpty(tephone))
|
|
|
7981
|
+ {
|
|
|
7982
|
+ //12:08 2020/2/27 过滤字段F_LegalPhone字段中的空格
|
|
|
7983
|
+ Model.T_Cus_CustomerBaseNew cus = new BLL.T_Cus_CustomerBaseNew().GetModelList(" REPLACE(F_LegalPhone,' ','') ='" + tephone + "' ").FirstOrDefault();
|
|
|
7984
|
+ Model.T_Cus_CustomerBaseNew cusll = new BLL.T_Cus_CustomerBaseNew().GetModelList(" REPLACE(F_LegalPhone,' ','') ='0" + tephone + "' ").FirstOrDefault();
|
|
|
7985
|
+ if (cus != null)
|
|
|
7986
|
+ {
|
|
|
7987
|
+ cusmodel = cus;
|
|
|
7988
|
+ CusName = new BLL.T_Cus_CustomerBaseNew().GetModelList(" REPLACE(F_LegalPhone,' ','') ='" + tephone + "' ").FirstOrDefault().F_Legal;
|
|
|
7989
|
+ }
|
|
|
7990
|
+ else if (cusll != null)
|
|
|
7991
|
+ {
|
|
|
7992
|
+ cusmodel = cusll;
|
|
|
7993
|
+ CusName = new BLL.T_Cus_CustomerBaseNew().GetModelList(" REPLACE(F_LegalPhone,' ','') ='0" + tephone + "' ").FirstOrDefault().F_Legal;
|
|
|
7994
|
+ }
|
|
|
7995
|
+
|
|
|
7996
|
+ var otherController = DependencyResolver.Current.GetService<CustomerNewController>();
|
|
|
7997
|
+ var result = ((ContentResult)otherController.GetCustomerByTel(tephone)).Content.ToObject<AjaxResult>();
|
|
|
7998
|
+ if (result.state.ToString() == "success")
|
|
|
7999
|
+ {
|
|
|
8000
|
+ PhoneAddress = ((dynamic)result.data).CityaddressDes;
|
|
|
8001
|
+ }
|
|
|
8002
|
+ }
|
|
|
8003
|
+ var obj = new
|
|
|
8004
|
+ {
|
|
|
8005
|
+ tephone = tephone,
|
|
|
8006
|
+ PhoneAddress= PhoneAddress,
|
|
|
8007
|
+ CusId= cusmodel?.F_CustomerId??0,
|
|
|
8008
|
+ CusName = CusName,
|
|
|
8009
|
+ Province=cusmodel?.F_AddressProvince??"",
|
|
|
8010
|
+ City = cusmodel?.F_AddressCity??"",
|
|
|
8011
|
+ Country = cusmodel?.F_AddressCountry??"",
|
|
|
8012
|
+ Township=cusmodel?.F_AddressTownship??""
|
|
|
8013
|
+ };
|
|
|
8014
|
+ return Content(obj.ToJson());
|
|
|
8015
|
+ }
|
|
|
8016
|
+ else return Error("获取失败!");
|
|
|
8017
|
+ }
|
|
|
8018
|
+ else
|
|
|
8019
|
+ {
|
|
|
8020
|
+ return Error("参数传输失败");
|
|
|
8021
|
+ }
|
|
|
8022
|
+ }
|
|
|
8023
|
+ #region 客户信息添加
|
|
|
8024
|
+ //public ActionResult CallAdd(CustomerBaseNewInput input,string OpenId)
|
|
|
8025
|
+ //{
|
|
|
8026
|
+ // if (!string.IsNullOrEmpty(OpenId))
|
|
|
8027
|
+ // {
|
|
|
8028
|
+ // var otherController = DependencyResolver.Current.GetService<CustomerNewController>();
|
|
|
8029
|
+ // var ua = userAccountBLL.GetModelList(" F_WxOpenId='" + OpenId + "'").FirstOrDefault();
|
|
|
8030
|
+ // string usercode = ua.F_UserCode;
|
|
|
8031
|
+ // if (string.IsNullOrEmpty(input.F_LegalPhone))
|
|
|
8032
|
+ // return Error("请输入客户电话");
|
|
|
8033
|
+ // var sql = $" and F_LegalPhone ='" + input.F_LegalPhone.Trim() + "'";
|
|
|
8034
|
+ // var userModel = new BLL.T_Cus_CustomerBaseNew().GetModelList(" F_IsDelete = 0 " + sql);
|
|
|
8035
|
+ // if (userModel.Count() > 0)
|
|
|
8036
|
+ // {
|
|
|
8037
|
+ // var model = new BLL.T_Cus_CustomerBaseNew().GetModel(userModel[0].F_CustomerId);
|
|
|
8038
|
+ // #region 保存客户基本信息
|
|
|
8039
|
+ // model = otherController.inputtoobj(model, input);
|
|
|
8040
|
+ // #endregion
|
|
|
8041
|
+ // bool n = new BLL.T_Cus_CustomerBaseNew().Update(model);
|
|
|
8042
|
+ // if (n)
|
|
|
8043
|
+ // {
|
|
|
8044
|
+ // return Success("保存成功!", model.F_CustomerId);
|
|
|
8045
|
+ // }
|
|
|
8046
|
+ // else
|
|
|
8047
|
+ // return Error("保存失败!");
|
|
|
8048
|
+ // }
|
|
|
8049
|
+ // else
|
|
|
8050
|
+ // {
|
|
|
8051
|
+ // int i = 0;
|
|
|
8052
|
+ // if (string.IsNullOrEmpty(input.F_CustomerCode))
|
|
|
8053
|
+ // {
|
|
|
8054
|
+ // while (true)
|
|
|
8055
|
+ // {
|
|
|
8056
|
+ // if (!getunique(0, otherController.GetIntCode(i)))
|
|
|
8057
|
+ // {
|
|
|
8058
|
+ // input.F_CustomerCode = otherController.GetIntCode(i);
|
|
|
8059
|
+ // break;
|
|
|
8060
|
+ // }
|
|
|
8061
|
+ // else
|
|
|
8062
|
+ // {
|
|
|
8063
|
+ // i++;
|
|
|
8064
|
+ // }
|
|
|
8065
|
+ // }
|
|
|
8066
|
+ // }
|
|
|
8067
|
+ // var model = new Model.T_Cus_CustomerBaseNew();
|
|
|
8068
|
+ // #region 保存客户基本信息
|
|
|
8069
|
+ // model = otherController.inputtoobj(model, input);
|
|
|
8070
|
+ // model.F_CreateBy = usercode;
|
|
|
8071
|
+ // model.F_CreateOn = DateTime.Now;
|
|
|
8072
|
+ // model.F_IsDelete = 0;
|
|
|
8073
|
+ // #endregion
|
|
|
8074
|
+ // int n = new BLL.T_Cus_CustomerBaseNew().Add(model);
|
|
|
8075
|
+ // if (n > 0)
|
|
|
8076
|
+ // {
|
|
|
8077
|
+ // return Success("新增成功!", n);
|
|
|
8078
|
+ // }
|
|
|
8079
|
+ // else
|
|
|
8080
|
+ // return Error("新增失败!");
|
|
|
8081
|
+
|
|
|
8082
|
+ // }
|
|
|
8083
|
+ // }
|
|
|
8084
|
+ // else
|
|
|
8085
|
+ // {
|
|
|
8086
|
+ // return Error("");
|
|
|
8087
|
+ // }
|
|
|
8088
|
+
|
|
|
8089
|
+ //}
|
|
|
8090
|
+ #endregion
|
|
7860
|
8091
|
#region
|
|
7861
|
8092
|
//workorder.WoBillController blcon = new WoBillController();
|
|
7862
|
8093
|
///// <summary>
|
|
|
@@ -9824,4 +10055,8 @@ namespace CallCenterApi.Interface.Controllers.weixin
|
|
9824
|
10055
|
|
|
9825
|
10056
|
}
|
|
9826
|
10057
|
#endregion
|
|
|
10058
|
+
|
|
|
10059
|
+
|
|
|
10060
|
+
|
|
|
10061
|
+
|
|
9827
|
10062
|
}
|