|
|
@@ -3814,30 +3814,57 @@ question, int page = 1, int limit = 10)
|
|
3814
|
3814
|
for (int i = 0; i < model1.Count; i++)
|
|
3815
|
3815
|
{
|
|
3816
|
3816
|
Questions model = new Questions();
|
|
3817
|
|
- if (!string .IsNullOrEmpty (model1[i].F_CustomerID))
|
|
3818
|
|
- {
|
|
3819
|
|
- if (valcode(model1[i].F_CustomerID, 10))//验证客户编码为10位纯数字
|
|
|
3817
|
+ Model.T_Cus_CustomerBaseNew cuModel = new Model.T_Cus_CustomerBaseNew();
|
|
|
3818
|
+ if (!string .IsNullOrEmpty (model1[i].F_CustomerID))//验证客户编码为10位纯数字
|
|
3820
|
3819
|
{
|
|
3821
|
|
- Model.T_Cus_CustomerBaseNew cuModel = cusbll.GetModel(model1[i].F_CustomerID);//通过客户编号获取客户资料
|
|
3822
|
|
- if (cuModel != null)
|
|
|
3820
|
+ cuModel = cusbll.GetModel(model1[i].F_CustomerID);//通过客户编号获取客户资料
|
|
|
3821
|
+ }
|
|
|
3822
|
+ else
|
|
|
3823
|
+ {
|
|
|
3824
|
+ var sql = $" and F_LegalPhone ='" + model1[i].F_CusPhone.Trim() + "'";
|
|
|
3825
|
+ cuModel = new BLL.T_Cus_CustomerBaseNew().GetModelList(" F_IsDelete = 0 " + sql).FirstOrDefault();
|
|
|
3826
|
+ }
|
|
|
3827
|
+ if (cuModel != null)
|
|
3823
|
3828
|
{
|
|
3824
|
|
- Model.T_Sys_Department pdModel = departmentBLL.GetModel(cuModel.F_AreaID);//通过公司id获取部门
|
|
3825
|
|
- if (pdModel != null)
|
|
|
3829
|
+ if (!string.IsNullOrEmpty(cuModel.F_AreaID))
|
|
3826
|
3830
|
{
|
|
3827
|
|
- model.AreaName = pdModel.F_DeptName;
|
|
|
3831
|
+ Model.T_Sys_Department pdModel = new T_Sys_Department();
|
|
|
3832
|
+ try
|
|
|
3833
|
+ {
|
|
|
3834
|
+ pdModel = departmentBLL.GetModel(int.Parse(cuModel.F_AreaID));//通过公司id获取部门
|
|
|
3835
|
+ }
|
|
|
3836
|
+ catch
|
|
|
3837
|
+ {
|
|
|
3838
|
+ pdModel = departmentBLL.GetModel(cuModel.F_AreaID);//通过公司id获取部门
|
|
|
3839
|
+ }
|
|
|
3840
|
+ if (pdModel != null)
|
|
|
3841
|
+ {
|
|
|
3842
|
+ model.AreaName = pdModel.F_DeptName;
|
|
|
3843
|
+ }
|
|
3828
|
3844
|
}
|
|
3829
|
|
- Model.T_Sys_Department pdModel1 = departmentBLL.GetModel(cuModel.F_BranchID);
|
|
3830
|
|
- if (pdModel1 != null)
|
|
|
3845
|
+ if (!string.IsNullOrEmpty(cuModel.F_BranchID))
|
|
3831
|
3846
|
{
|
|
3832
|
|
- model.BranchName = pdModel1.F_DeptName;
|
|
|
3847
|
+ Model.T_Sys_Department pdModel1 = new T_Sys_Department();
|
|
|
3848
|
+ try
|
|
|
3849
|
+ {
|
|
|
3850
|
+ pdModel1 = departmentBLL.GetModel(int.Parse(cuModel.F_BranchID));//通过公司id获取部门
|
|
|
3851
|
+ }
|
|
|
3852
|
+ catch
|
|
|
3853
|
+ {
|
|
|
3854
|
+ pdModel1 = departmentBLL.GetModel(cuModel.F_BranchID);//通过公司id获取部门
|
|
|
3855
|
+ }
|
|
|
3856
|
+ if (pdModel1 != null)
|
|
|
3857
|
+ {
|
|
|
3858
|
+ model.BranchName = pdModel1.F_DeptName;
|
|
|
3859
|
+ }
|
|
3833
|
3860
|
}
|
|
3834
|
3861
|
model.Salesman = cuModel.F_Salesman;
|
|
3835
|
3862
|
model.Brands = cuModel.F_Brands;
|
|
3836
|
3863
|
model.Channel = cuModel.F_Channel;
|
|
3837
|
3864
|
|
|
3838
|
3865
|
}
|
|
3839
|
|
- }
|
|
3840
|
|
- }
|
|
|
3866
|
+
|
|
|
3867
|
+
|
|
3841
|
3868
|
model .Category = model1[i].F_TS_Category ;
|
|
3842
|
3869
|
if (model1[i].F_Type == "1")
|
|
3843
|
3870
|
{
|