|
|
@@ -1272,30 +1272,57 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
1272
|
1272
|
foreach (var it in depts)
|
|
1273
|
1273
|
{
|
|
1274
|
1274
|
DataRow drNew = dt.NewRow();
|
|
1275
|
|
- if (!string .IsNullOrEmpty (it.F_CustomerID))
|
|
1276
|
|
- {
|
|
1277
|
|
- if (valcode(it.F_CustomerID, 10))//验证客户编码为10位纯数字
|
|
1278
|
|
- {
|
|
1279
|
|
- Model.T_Cus_CustomerBaseNew cuModel = cusbll.GetModel(it.F_CustomerID.ToString());//通过客户编号获取客户资料
|
|
|
1275
|
+ Model.T_Cus_CustomerBaseNew cuModel = new Model.T_Cus_CustomerBaseNew();
|
|
|
1276
|
+ if (!string.IsNullOrEmpty(it.F_CustomerID))//验证客户编码为10位纯数字
|
|
|
1277
|
+ {
|
|
|
1278
|
+ cuModel = cusbll.GetModel(it.F_CustomerID);//通过客户编号获取客户资料
|
|
|
1279
|
+ }
|
|
|
1280
|
+ else
|
|
|
1281
|
+ {
|
|
|
1282
|
+
|
|
|
1283
|
+ cuModel = new BLL.T_Cus_CustomerBaseNew().GetModelList(" F_IsDelete = 0 and F_LegalPhone ='" + it.F_CusPhone.Trim() + "'").FirstOrDefault();
|
|
|
1284
|
+ }
|
|
|
1285
|
+
|
|
1280
|
1286
|
if (cuModel != null)
|
|
1281
|
1287
|
{
|
|
1282
|
|
- Model.T_Sys_Department pdModel = departmentBLL.GetModel(cuModel.F_AreaID);//通过公司id获取部门
|
|
1283
|
|
- if (pdModel != null)
|
|
1284
|
|
- {
|
|
1285
|
|
- drNew["大区名称"] = pdModel.F_DeptName;
|
|
1286
|
|
- }
|
|
1287
|
|
- Model.T_Sys_Department pdModel1 = departmentBLL.GetModel(cuModel.F_BranchID);
|
|
1288
|
|
- if (pdModel1 != null)
|
|
1289
|
|
- {
|
|
1290
|
|
- drNew["分公司名称"] = pdModel1.F_DeptName;
|
|
1291
|
|
- }
|
|
|
1288
|
+ if (!string.IsNullOrEmpty(cuModel.F_AreaID))
|
|
|
1289
|
+ {
|
|
|
1290
|
+ Model.T_Sys_Department pdModel = new T_Sys_Department();
|
|
|
1291
|
+ try
|
|
|
1292
|
+ {
|
|
|
1293
|
+ pdModel = departmentBLL.GetModel(int.Parse(cuModel.F_AreaID));//通过公司id获取部门
|
|
|
1294
|
+ }
|
|
|
1295
|
+ catch
|
|
|
1296
|
+ {
|
|
|
1297
|
+ pdModel = departmentBLL.GetModel(cuModel.F_AreaID);//通过公司id获取部门
|
|
|
1298
|
+ }
|
|
|
1299
|
+
|
|
|
1300
|
+ if (pdModel != null)
|
|
|
1301
|
+ {
|
|
|
1302
|
+ drNew["大区名称"] = pdModel.F_DeptName;
|
|
|
1303
|
+ }
|
|
|
1304
|
+ }
|
|
|
1305
|
+ if (!string.IsNullOrEmpty(cuModel.F_BranchID))
|
|
|
1306
|
+ {
|
|
|
1307
|
+ Model.T_Sys_Department pdModel1 = new T_Sys_Department();
|
|
|
1308
|
+ try
|
|
|
1309
|
+ {
|
|
|
1310
|
+ pdModel1 = departmentBLL.GetModel(int.Parse(cuModel.F_BranchID));//通过公司id获取部门
|
|
|
1311
|
+ }
|
|
|
1312
|
+ catch
|
|
|
1313
|
+ {
|
|
|
1314
|
+ pdModel1 = departmentBLL.GetModel(cuModel.F_BranchID);//通过公司id获取部门
|
|
|
1315
|
+ }
|
|
|
1316
|
+ if (pdModel1 != null)
|
|
|
1317
|
+ {
|
|
|
1318
|
+ drNew["分公司名称"] = pdModel1.F_DeptName;
|
|
|
1319
|
+ }
|
|
|
1320
|
+ }
|
|
1292
|
1321
|
drNew["业务员"] = cuModel.F_Salesman;
|
|
1293
|
1322
|
drNew["品牌"] = cuModel.F_Brands;
|
|
1294
|
1323
|
drNew["渠道类型"] = cuModel.F_Channel;
|
|
1295
|
1324
|
|
|
1296
|
1325
|
}
|
|
1297
|
|
- }
|
|
1298
|
|
- }
|
|
1299
|
1326
|
|
|
1300
|
1327
|
drNew["产品"] = it.F_TS_Category;
|
|
1301
|
1328
|
if (it.F_Type == "1")
|
|
|
@@ -1434,7 +1461,7 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
1434
|
1461
|
}
|
|
1435
|
1462
|
sql += $" and T_Wo_WorkOrder.F_QuestionType in ( '" + GetComplaint("'化肥产品质量问题反馈','化肥服务质量问题反馈','化肥农作物长势问题反馈'") + "') "; ;
|
|
1436
|
1463
|
sql += $" and T_Wo_WorkOrder.F_State in ( " + (int)EnumWorkOrderState.finish + "," + (int)EnumWorkOrderState.evaluate + ") "; ;
|
|
1437
|
|
- sql += " order by F_CreateOn desc";
|
|
|
1464
|
+ sql += " order by F_CreateOn desc";
|
|
1438
|
1465
|
#endregion
|
|
1439
|
1466
|
var depts = new BLL.T_Wo_WorkOrder().GetModelList(sql);
|
|
1440
|
1467
|
|
|
|
@@ -1491,34 +1518,45 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
1491
|
1518
|
foreach (var it in depts)
|
|
1492
|
1519
|
{
|
|
1493
|
1520
|
DataRow drNew = dt.NewRow();
|
|
1494
|
|
- if (!string .IsNullOrEmpty (it.F_CustomerID))
|
|
|
1521
|
+ Model.T_Cus_CustomerBaseNew cuModel = new Model.T_Cus_CustomerBaseNew();
|
|
|
1522
|
+ if (!string.IsNullOrEmpty(it.F_CustomerID))//验证客户编码为10位纯数字
|
|
1495
|
1523
|
{
|
|
1496
|
|
- if (valcode(it.F_CustomerID, 10))//验证客户编码为10位纯数字
|
|
1497
|
|
- {
|
|
1498
|
|
- drNew["客户编号"] = it.F_CustomerID;//
|
|
1499
|
|
- Model.T_Cus_CustomerBaseNew cuModel = cusbll.GetModel(it.F_CustomerID.ToString());//通过客户编号获取客户资料
|
|
|
1524
|
+ cuModel = cusbll.GetModel(it.F_CustomerID);//通过客户编号获取客户资料
|
|
|
1525
|
+ }
|
|
|
1526
|
+ else
|
|
|
1527
|
+ {
|
|
|
1528
|
+
|
|
|
1529
|
+ cuModel = new BLL.T_Cus_CustomerBaseNew().GetModelList(" F_IsDelete = 0 and F_LegalPhone ='" + it.F_CusPhone.Trim() + "'").FirstOrDefault();
|
|
|
1530
|
+ }
|
|
|
1531
|
+
|
|
1500
|
1532
|
if (cuModel != null)
|
|
1501
|
1533
|
{
|
|
1502
|
|
- Model.T_Sys_Department pdModel = departmentBLL.GetModel(cuModel.F_AreaID);//通过公司id获取部门
|
|
1503
|
|
- if (pdModel != null)
|
|
1504
|
|
- {
|
|
1505
|
|
- drNew["大区名称"] = pdModel.F_DeptName;//
|
|
1506
|
|
- }
|
|
1507
|
|
- Model.T_Sys_Department pdModel1 = departmentBLL.GetModel(cuModel.F_BranchID);
|
|
1508
|
|
- if (pdModel1 != null)
|
|
1509
|
|
- {
|
|
1510
|
|
- drNew["分公司名称"] = pdModel1.F_DeptName;//分公司名称
|
|
1511
|
|
- }
|
|
1512
|
|
- drNew["业务员"] = cuModel.F_Salesman;//业务员
|
|
|
1534
|
+ drNew["客户编号"] = cuModel.F_CustomerCode ;//
|
|
|
1535
|
+ if (!string.IsNullOrEmpty(cuModel.F_AreaID))
|
|
|
1536
|
+ {
|
|
|
1537
|
+ Model.T_Sys_Department pdModel = new T_Sys_Department();
|
|
|
1538
|
+ try
|
|
|
1539
|
+ {
|
|
|
1540
|
+ pdModel = departmentBLL.GetModel(int.Parse(cuModel.F_AreaID));//通过公司id获取部门
|
|
|
1541
|
+ }
|
|
|
1542
|
+ catch
|
|
|
1543
|
+ {
|
|
|
1544
|
+ pdModel = departmentBLL.GetModel(cuModel.F_AreaID);//通过公司id获取部门
|
|
1513
|
1545
|
}
|
|
1514
|
|
- }
|
|
1515
|
1546
|
|
|
1516
|
|
- }
|
|
|
1547
|
+ if (pdModel != null)
|
|
|
1548
|
+ {
|
|
|
1549
|
+ drNew["大区名称"] = pdModel.F_DeptName;
|
|
|
1550
|
+ }
|
|
|
1551
|
+ }
|
|
|
1552
|
+ drNew["业务员"] = cuModel.F_Salesman;//业务员
|
|
|
1553
|
+ }
|
|
|
1554
|
+
|
|
1517
|
1555
|
if (!string .IsNullOrEmpty (it.F_MaterialID))
|
|
1518
|
1556
|
{
|
|
1519
|
1557
|
if (valcode(it.F_MaterialID.ToString(), 11))
|
|
1520
|
1558
|
{
|
|
1521
|
|
- drNew["物料编码"] = int.Parse(it.F_MaterialID);//验证物料编码为11位纯数字
|
|
|
1559
|
+ drNew["物料编码"] = it.F_MaterialID;//验证物料编码为11位纯数字
|
|
1522
|
1560
|
Model.T_Wo_MaterialManage maModel = mmBLL.GetModel(it.F_MaterialID.ToString());//通过物料编码获取物料信息
|
|
1523
|
1561
|
if (maModel != null)
|
|
1524
|
1562
|
{
|
|
|
@@ -1758,27 +1796,54 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
1758
|
1796
|
foreach (var it in depts)
|
|
1759
|
1797
|
{
|
|
1760
|
1798
|
DataRow drNew = dt.NewRow();
|
|
1761
|
|
- if (!string .IsNullOrEmpty (it.F_CustomerID))
|
|
|
1799
|
+ Model.T_Cus_CustomerBaseNew cuModel = new Model.T_Cus_CustomerBaseNew();
|
|
|
1800
|
+ if (!string.IsNullOrEmpty(it.F_CustomerID))//验证客户编码为10位纯数字
|
|
1762
|
1801
|
{
|
|
1763
|
|
- if (valcode(it.F_CustomerID, 10))//验证客户编码为10位纯数字
|
|
1764
|
|
- {
|
|
1765
|
|
- Model.T_Cus_CustomerBaseNew cuModel = cusbll.GetModel(it.F_CustomerID.ToString());//通过客户编号获取客户资料
|
|
|
1802
|
+ cuModel = cusbll.GetModel(it.F_CustomerID);//通过客户编号获取客户资料
|
|
|
1803
|
+ }
|
|
|
1804
|
+ else
|
|
|
1805
|
+ {
|
|
|
1806
|
+ cuModel = new BLL.T_Cus_CustomerBaseNew().GetModelList(" F_IsDelete = 0 and F_LegalPhone ='" + it.F_CusPhone.Trim() + "'").FirstOrDefault();
|
|
|
1807
|
+ }
|
|
|
1808
|
+
|
|
1766
|
1809
|
if (cuModel != null)
|
|
1767
|
1810
|
{
|
|
1768
|
|
- Model.T_Sys_Department pdModel = departmentBLL.GetModel(cuModel.F_AreaID);//通过公司id获取部门
|
|
1769
|
|
- if (pdModel != null)
|
|
1770
|
|
- {
|
|
1771
|
|
- drNew["大区名称"] = pdModel.F_DeptName;//大区名称
|
|
1772
|
|
- }
|
|
1773
|
|
- Model.T_Sys_Department pdModel1 = departmentBLL.GetModel(cuModel.F_BranchID);
|
|
1774
|
|
- if (pdModel1 != null)
|
|
1775
|
|
- {
|
|
1776
|
|
- drNew["分公司名称"] = pdModel1.F_DeptName;//大区名称
|
|
1777
|
|
- }
|
|
1778
|
|
- drNew["品牌"] = cuModel.F_Brands;//品牌
|
|
|
1811
|
+ if (!string.IsNullOrEmpty(cuModel.F_AreaID))
|
|
|
1812
|
+ {
|
|
|
1813
|
+ Model.T_Sys_Department pdModel = new T_Sys_Department();
|
|
|
1814
|
+ try
|
|
|
1815
|
+ {
|
|
|
1816
|
+ pdModel = departmentBLL.GetModel(int.Parse(cuModel.F_AreaID));//通过公司id获取部门
|
|
|
1817
|
+ }
|
|
|
1818
|
+ catch
|
|
|
1819
|
+ {
|
|
|
1820
|
+ pdModel = departmentBLL.GetModel(cuModel.F_AreaID);//通过公司id获取部门
|
|
|
1821
|
+ }
|
|
|
1822
|
+
|
|
|
1823
|
+ if (pdModel != null)
|
|
|
1824
|
+ {
|
|
|
1825
|
+ drNew["大区名称"] = pdModel.F_DeptName;
|
|
1779
|
1826
|
}
|
|
1780
|
1827
|
}
|
|
1781
|
|
- }
|
|
|
1828
|
+ if (!string.IsNullOrEmpty(cuModel.F_BranchID))
|
|
|
1829
|
+ {
|
|
|
1830
|
+ Model.T_Sys_Department pdModel1 = new T_Sys_Department();
|
|
|
1831
|
+ try
|
|
|
1832
|
+ {
|
|
|
1833
|
+ pdModel1 = departmentBLL.GetModel(int.Parse(cuModel.F_BranchID));//通过公司id获取部门
|
|
|
1834
|
+ }
|
|
|
1835
|
+ catch
|
|
|
1836
|
+ {
|
|
|
1837
|
+ pdModel1 = departmentBLL.GetModel(cuModel.F_BranchID);//通过公司id获取部门
|
|
|
1838
|
+ }
|
|
|
1839
|
+ if (pdModel1 != null)
|
|
|
1840
|
+ {
|
|
|
1841
|
+ drNew["分公司名称"] = pdModel1.F_DeptName;
|
|
|
1842
|
+ }
|
|
|
1843
|
+ }
|
|
|
1844
|
+ drNew["品牌"] = cuModel.F_Brands;//品牌
|
|
|
1845
|
+ }
|
|
|
1846
|
+
|
|
1782
|
1847
|
if (!string.IsNullOrEmpty(it.F_QuestionType))
|
|
1783
|
1848
|
{
|
|
1784
|
1849
|
Model.T_Wo_QuestionManage Manage = null ;
|
|
|
@@ -1952,20 +2017,24 @@ question, int page = 1, int limit = 10)
|
|
1952
|
2017
|
foreach (var it in depts)
|
|
1953
|
2018
|
{
|
|
1954
|
2019
|
DataRow drNew = dt.NewRow();
|
|
1955
|
|
- if (!string .IsNullOrEmpty (it.F_CustomerID))
|
|
|
2020
|
+ Model.T_Cus_CustomerBaseNew cuModel = new Model.T_Cus_CustomerBaseNew();
|
|
|
2021
|
+ if (!string.IsNullOrEmpty(it.F_CustomerID))//验证客户编码为10位纯数字
|
|
1956
|
2022
|
{
|
|
1957
|
|
- if (valcode(it.F_CustomerID, 10))//验证客户编码为10位纯数字
|
|
1958
|
|
- {
|
|
1959
|
|
-
|
|
1960
|
|
- Model.T_Cus_CustomerBaseNew cuModel = cusbll.GetModel(it.F_CustomerID.ToString());//通过客户编号获取客户资料
|
|
|
2023
|
+ cuModel = cusbll.GetModel(it.F_CustomerID);//通过客户编号获取客户资料
|
|
|
2024
|
+ }
|
|
|
2025
|
+ else
|
|
|
2026
|
+ {
|
|
|
2027
|
+ cuModel = new BLL.T_Cus_CustomerBaseNew().GetModelList(" F_IsDelete = 0 and F_LegalPhone ='" + it.F_CusPhone.Trim() + "'").FirstOrDefault();
|
|
|
2028
|
+ }
|
|
|
2029
|
+
|
|
|
2030
|
+
|
|
1961
|
2031
|
if (cuModel != null)
|
|
1962
|
2032
|
{
|
|
1963
|
2033
|
Model.T_Sys_Department pdModel = departmentBLL.GetModel(cuModel.F_AreaID);//通过公司id获取部门
|
|
1964
|
2034
|
|
|
1965
|
2035
|
drNew["业务员"] = cuModel.F_Salesman;//业务员
|
|
1966
|
2036
|
}
|
|
1967
|
|
- }
|
|
1968
|
|
- }
|
|
|
2037
|
+
|
|
1969
|
2038
|
|
|
1970
|
2039
|
drNew["化工产品名称"] = it.F_TS_Category;//产品
|
|
1971
|
2040
|
drNew["客户单位"] = it.F_CompanyName;//客户单位
|
|
|
@@ -2094,12 +2163,24 @@ question, int page = 1, int limit = 10)
|
|
2094
|
2163
|
public int Totalnumber;
|
|
2095
|
2164
|
public string Proportion;
|
|
2096
|
2165
|
}
|
|
2097
|
|
-
|
|
|
2166
|
+ public class Comling
|
|
|
2167
|
+ {
|
|
|
2168
|
+ public string name;
|
|
|
2169
|
+ public int typeid;
|
|
|
2170
|
+ public int number;//数量
|
|
|
2171
|
+ public List<Complainthand> Complainthand;
|
|
|
2172
|
+ /// <summary>
|
|
|
2173
|
+ /// 效率提升率
|
|
|
2174
|
+ /// </summary>
|
|
|
2175
|
+ public string efficiency = "0%";//
|
|
|
2176
|
+ public List<worker> worker;
|
|
|
2177
|
+ }
|
|
2098
|
2178
|
public class Complainthandling
|
|
2099
|
2179
|
{
|
|
2100
|
2180
|
public string name;
|
|
2101
|
2181
|
public int typeid;
|
|
2102
|
2182
|
public int number;//数量
|
|
|
2183
|
+ public List<Complainthand> Complainthand;
|
|
2103
|
2184
|
/// <summary>
|
|
2104
|
2185
|
/// 用时最长
|
|
2105
|
2186
|
/// </summary>
|
|
|
@@ -2130,7 +2211,11 @@ question, int page = 1, int limit = 10)
|
|
2130
|
2211
|
public string efficiency = "0%";//
|
|
2131
|
2212
|
public List<worker> worker;
|
|
2132
|
2213
|
}
|
|
2133
|
|
-
|
|
|
2214
|
+ public class Complainthand
|
|
|
2215
|
+ {
|
|
|
2216
|
+ public string name;
|
|
|
2217
|
+ public string total="0";
|
|
|
2218
|
+ }
|
|
2134
|
2219
|
public class Channel
|
|
2135
|
2220
|
{
|
|
2136
|
2221
|
public string channel;//渠道
|
|
|
@@ -2957,7 +3042,7 @@ question, int page = 1, int limit = 10)
|
|
2957
|
3042
|
public string F_SalesBase;//销售基地
|
|
2958
|
3043
|
public string F_Type;//反馈类型
|
|
2959
|
3044
|
}
|
|
2960
|
|
-
|
|
|
3045
|
+
|
|
2961
|
3046
|
/// <summary>
|
|
2962
|
3047
|
///月份投诉处理周期表
|
|
2963
|
3048
|
/// </summary>
|
|
|
@@ -2972,18 +3057,31 @@ question, int page = 1, int limit = 10)
|
|
2972
|
3057
|
else if (isEnd == 2)
|
|
2973
|
3058
|
sql += $" and F_State =11 ";
|
|
2974
|
3059
|
string Queststr = "";
|
|
|
3060
|
+ bool k = true;
|
|
|
3061
|
+ if (questionName != "" && questionName != "0")
|
|
|
3062
|
+ {
|
|
|
3063
|
+ try
|
|
|
3064
|
+ {
|
|
|
3065
|
+ int a = int.Parse(questionName);
|
|
|
3066
|
+ }
|
|
|
3067
|
+ catch
|
|
|
3068
|
+ {
|
|
|
3069
|
+ k = false;
|
|
|
3070
|
+ }
|
|
|
3071
|
+ }
|
|
2975
|
3072
|
if (questionName!=""&& questionName!="0")
|
|
2976
|
3073
|
{
|
|
2977
|
3074
|
|
|
2978
|
|
- try
|
|
|
3075
|
+ if (k)
|
|
2979
|
3076
|
{
|
|
2980
|
3077
|
Queststr = " select * from T_Wo_QuestionManage where F_IsDelete=0 and F_Label in(3) and F_Id='" + questionName + "'";
|
|
2981
|
3078
|
}
|
|
2982
|
|
- catch
|
|
|
3079
|
+ else
|
|
2983
|
3080
|
{
|
|
2984
|
3081
|
Queststr = " select * from T_Wo_QuestionManage where F_IsDelete=0 and F_Label in(3) and F_QuestionName='" + questionName + "'";
|
|
2985
|
3082
|
}
|
|
2986
|
3083
|
|
|
|
3084
|
+
|
|
2987
|
3085
|
}
|
|
2988
|
3086
|
else
|
|
2989
|
3087
|
{
|
|
|
@@ -3112,6 +3210,7 @@ question, int page = 1, int limit = 10)
|
|
3112
|
3210
|
string timeover = "", timeover2 = ""; int x = 0, y = 0;
|
|
3113
|
3211
|
var itemList = itembll.GetModelList(" F_WoID=" + it.F_ID + " order by F_ID desc");
|
|
3114
|
3212
|
if (itemList[0].F_NextDept > 0)
|
|
|
3213
|
+
|
|
3115
|
3214
|
{
|
|
3116
|
3215
|
var deptmodel = departmentBLL.GetModel(int.Parse(itemList[0].F_NextDept.ToString()));
|
|
3117
|
3216
|
if (deptmodel != null)
|
|
|
@@ -3119,7 +3218,17 @@ question, int page = 1, int limit = 10)
|
|
3119
|
3218
|
worker.F_Responsibility = deptmodel.F_DeptName;
|
|
3120
|
3219
|
}
|
|
3121
|
3220
|
}
|
|
3122
|
|
-
|
|
|
3221
|
+ else
|
|
|
3222
|
+ {
|
|
|
3223
|
+ if (itemList[0].F_WoState == 10)
|
|
|
3224
|
+ {
|
|
|
3225
|
+ var deptmodel = departmentBLL.GetModel(2);
|
|
|
3226
|
+ if (deptmodel != null)
|
|
|
3227
|
+ {
|
|
|
3228
|
+ worker.F_Responsibility = deptmodel.F_DeptName;
|
|
|
3229
|
+ }
|
|
|
3230
|
+ }
|
|
|
3231
|
+ }
|
|
3123
|
3232
|
int limit = it.F_limit ;
|
|
3124
|
3233
|
if (itemList != null)
|
|
3125
|
3234
|
{
|
|
|
@@ -3132,48 +3241,85 @@ question, int page = 1, int limit = 10)
|
|
3132
|
3241
|
x = z;
|
|
3133
|
3242
|
timeover = itemList[z].F_CreateTime.ToString();
|
|
3134
|
3243
|
// limit = int.Parse(itemList[z].F_LimitTime);
|
|
3135
|
|
- break; ;
|
|
|
3244
|
+ break ;
|
|
3136
|
3245
|
}
|
|
3137
|
3246
|
}
|
|
3138
|
3247
|
}
|
|
3139
|
|
- if (it .F_State ==10|| it.F_State == 11)
|
|
3140
|
|
- {
|
|
3141
|
|
-
|
|
3142
|
|
- System.TimeSpan id = DateTime.Parse(it .F_DealTime .ToString ()) - DateTime.Parse(timeover);
|
|
3143
|
|
- double a = id.TotalHours;
|
|
3144
|
|
- worker.time = a - limit;
|
|
3145
|
|
- timehource.Add((float)worker.time);
|
|
3146
|
|
- if (worker.time > 24)
|
|
|
3248
|
+ for (int z = 0; z < itemList.Count; z++)
|
|
3147
|
3249
|
{
|
|
3148
|
|
- double t = worker.time / 24;
|
|
3149
|
|
- double v = worker.time % 24;
|
|
3150
|
|
- worker.overtime = string.Format("{0:f0}天{1:f2}h", t, v);
|
|
|
3250
|
+ if (itemList[z].F_WoState >= 1)
|
|
|
3251
|
+ {
|
|
|
3252
|
+ if (itemList[z].F_WoState == 11)
|
|
|
3253
|
+ {
|
|
|
3254
|
+ y = z;
|
|
|
3255
|
+ timeover2 = itemList[z].F_CreateTime.ToString();
|
|
|
3256
|
+ // limit = int.Parse(itemList[z].F_LimitTime);
|
|
|
3257
|
+ }
|
|
|
3258
|
+ }
|
|
|
3259
|
+ if (timeover2 != "")
|
|
|
3260
|
+ {
|
|
|
3261
|
+ if (timeover != "")
|
|
|
3262
|
+ {
|
|
|
3263
|
+ if (x > y)
|
|
|
3264
|
+ {
|
|
|
3265
|
+ System.TimeSpan id = DateTime.Parse(timeover2) - DateTime.Parse(timeover);
|
|
|
3266
|
+ double a = id.TotalHours;
|
|
|
3267
|
+ worker.time = a - limit;
|
|
|
3268
|
+ timehource.Add((float)worker.time);
|
|
|
3269
|
+ if (worker.time > 24)
|
|
|
3270
|
+ {
|
|
|
3271
|
+ double t = worker.time / 24;
|
|
|
3272
|
+ double v = worker.time % 24;
|
|
|
3273
|
+ worker.overtime = string.Format("{0:f0}天{1:f2}h", t, v);
|
|
3151
|
3274
|
|
|
3152
|
|
- }
|
|
3153
|
|
- else
|
|
3154
|
|
- {
|
|
3155
|
|
- worker.overtime = string.Format("{0:f2}h", a - limit);
|
|
3156
|
|
- }
|
|
3157
|
|
- }
|
|
3158
|
|
- else
|
|
3159
|
|
- {
|
|
3160
|
|
- System.TimeSpan id = DateTime.Now - DateTime.Parse(timeover);
|
|
3161
|
|
- double a = id.TotalHours;
|
|
|
3275
|
+ }
|
|
|
3276
|
+ else
|
|
|
3277
|
+ {
|
|
|
3278
|
+ worker.overtime = string.Format("{0:f2}h", a - limit);
|
|
|
3279
|
+ }
|
|
|
3280
|
+ }
|
|
|
3281
|
+ else
|
|
|
3282
|
+ {
|
|
|
3283
|
+ System.TimeSpan id = DateTime.Now - DateTime.Parse(timeover);
|
|
|
3284
|
+ double a = id.TotalHours;
|
|
|
3285
|
+
|
|
|
3286
|
+ worker.time = a - limit;
|
|
|
3287
|
+ timehource.Add((float)worker.time);
|
|
|
3288
|
+ if (worker.time > 24)
|
|
|
3289
|
+ {
|
|
|
3290
|
+ double t = worker.time / 24;
|
|
|
3291
|
+ double v = worker.time % 24;
|
|
|
3292
|
+ worker.overtime = string.Format("{0:f0}天{1:f2}h", t, v);
|
|
|
3293
|
+ }
|
|
|
3294
|
+ else
|
|
|
3295
|
+ {
|
|
|
3296
|
+ worker.overtime = string.Format("{0:f2}h", a - limit);
|
|
|
3297
|
+ }
|
|
|
3298
|
+
|
|
|
3299
|
+ }
|
|
|
3300
|
+ }
|
|
3162
|
3301
|
|
|
3163
|
|
- worker.time = a - limit;
|
|
3164
|
|
- timehource.Add((float)worker.time);
|
|
3165
|
|
- if (worker.time > 24)
|
|
3166
|
|
- {
|
|
3167
|
|
- double t = worker.time / 24;
|
|
3168
|
|
- double v = worker.time % 24;
|
|
3169
|
|
- worker.overtime = string.Format("{0:f0}天{1:f2}h", t, v);
|
|
3170
|
3302
|
}
|
|
3171
|
|
- else
|
|
|
3303
|
+ else if (timeover != "")
|
|
3172
|
3304
|
{
|
|
3173
|
|
- worker.overtime = string.Format("{0:f2}h", a - limit);
|
|
|
3305
|
+ System.TimeSpan id = DateTime.Now - DateTime.Parse(timeover);
|
|
|
3306
|
+ double a = id.TotalHours;
|
|
|
3307
|
+
|
|
|
3308
|
+ worker.time = a - limit;
|
|
|
3309
|
+ timehource.Add((float)worker.time);
|
|
|
3310
|
+ if (worker.time > 24)
|
|
|
3311
|
+ {
|
|
|
3312
|
+ double t = worker.time / 24;
|
|
|
3313
|
+ double v = worker.time % 24;
|
|
|
3314
|
+ worker.overtime = string.Format("{0:f0}天{1:f2}h", t, v);
|
|
|
3315
|
+ }
|
|
|
3316
|
+ else
|
|
|
3317
|
+ {
|
|
|
3318
|
+ worker.overtime = string.Format("{0:f2}h", a - limit);
|
|
|
3319
|
+ }
|
|
3174
|
3320
|
}
|
|
3175
|
3321
|
}
|
|
3176
|
|
-
|
|
|
3322
|
+
|
|
3177
|
3323
|
}
|
|
3178
|
3324
|
if (it.F_State != 11)
|
|
3179
|
3325
|
Overdue++;
|
|
|
@@ -3211,23 +3357,23 @@ question, int page = 1, int limit = 10)
|
|
3211
|
3357
|
{
|
|
3212
|
3358
|
timehource.Sort((a, b) => b.CompareTo(a));
|
|
3213
|
3359
|
|
|
3214
|
|
- model.ongesttime = string.Format("{0:f2}h", timehource[0]);
|
|
3215
|
|
- model.minimumtime = string.Format("{0:f2}h", timehource[timehource.Count - 1]);
|
|
|
3360
|
+ model.ongesttime = string.Format("{0:f2}", timehource[0]/24);
|
|
|
3361
|
+ model.minimumtime = string.Format("{0:f2}", timehource[timehource.Count - 1]/24);
|
|
3216
|
3362
|
int n = timehource.Count / 2;
|
|
3217
|
|
- model.median = string.Format("{0:f2}h", timehource[n]);
|
|
|
3363
|
+ model.median = string.Format("{0:f2}", timehource[n]/24);
|
|
3218
|
3364
|
float y = 0;
|
|
3219
|
3365
|
foreach (var iu in timehource)
|
|
3220
|
3366
|
{
|
|
3221
|
3367
|
y += iu;
|
|
3222
|
3368
|
}
|
|
3223
|
|
- model.averageTime = string.Format("{0:f2}h", y / timehource.Count);
|
|
|
3369
|
+ model.averageTime = string.Format("{0:f2}", y / timehource.Count/24);
|
|
3224
|
3370
|
}
|
|
3225
|
3371
|
else
|
|
3226
|
3372
|
{
|
|
3227
|
|
- model.ongesttime = "0h";
|
|
3228
|
|
- model.minimumtime = "0h";
|
|
3229
|
|
- model.median = "0h";
|
|
3230
|
|
- model.averageTime = "0h";
|
|
|
3373
|
+ model.ongesttime = "0";
|
|
|
3374
|
+ model.minimumtime = "0";
|
|
|
3375
|
+ model.median = "0";
|
|
|
3376
|
+ model.averageTime = "0";
|
|
3231
|
3377
|
}
|
|
3232
|
3378
|
|
|
3233
|
3379
|
model.worker.Sort((a, b) => b.time.CompareTo(a.time));
|
|
|
@@ -3342,7 +3488,7 @@ question, int page = 1, int limit = 10)
|
|
3342
|
3488
|
x = z;
|
|
3343
|
3489
|
timeover = itemList[z].F_CreateTime.ToString();
|
|
3344
|
3490
|
// limit = int.Parse(itemList[z].F_LimitTime);
|
|
3345
|
|
- continue;
|
|
|
3491
|
+ break ;
|
|
3346
|
3492
|
}
|
|
3347
|
3493
|
}
|
|
3348
|
3494
|
}
|
|
|
@@ -3461,23 +3607,23 @@ question, int page = 1, int limit = 10)
|
|
3461
|
3607
|
{
|
|
3462
|
3608
|
timehource.Sort((a, b) => b.CompareTo(a));
|
|
3463
|
3609
|
|
|
3464
|
|
- model.ongesttime = string.Format("{0:f2}h", timehource[0]);
|
|
3465
|
|
- model.minimumtime = string.Format("{0:f2}h", timehource[timehource.Count - 1]);
|
|
|
3610
|
+ model.ongesttime = string.Format("{0:f2}", timehource[0]/24);
|
|
|
3611
|
+ model.minimumtime = string.Format("{0:f2}", timehource[timehource.Count - 1]/24);
|
|
3466
|
3612
|
int n = timehource.Count / 2;
|
|
3467
|
|
- model.median = string.Format("{0:f2}h", timehource[n]);
|
|
|
3613
|
+ model.median = string.Format("{0:f2}", timehource[n]/24);
|
|
3468
|
3614
|
float y = 0;
|
|
3469
|
3615
|
foreach (var iu in timehource)
|
|
3470
|
3616
|
{
|
|
3471
|
3617
|
y += iu;
|
|
3472
|
3618
|
}
|
|
3473
|
|
- model.averageTime = string.Format("{0:f2}h", y / timehource.Count);
|
|
|
3619
|
+ model.averageTime = string.Format("{0:f2}", y / timehource.Count/24);
|
|
3474
|
3620
|
}
|
|
3475
|
3621
|
else
|
|
3476
|
3622
|
{
|
|
3477
|
|
- model.ongesttime = "0h";
|
|
3478
|
|
- model.minimumtime = "0h";
|
|
3479
|
|
- model.median = "0h";
|
|
3480
|
|
- model.averageTime = "0h";
|
|
|
3623
|
+ model.ongesttime = "0";
|
|
|
3624
|
+ model.minimumtime = "0";
|
|
|
3625
|
+ model.median = "0";
|
|
|
3626
|
+ model.averageTime = "0";
|
|
3481
|
3627
|
}
|
|
3482
|
3628
|
|
|
3483
|
3629
|
model.worker.Sort((a, b) => b.time.CompareTo(a.time));
|
|
|
@@ -3492,13 +3638,18 @@ question, int page = 1, int limit = 10)
|
|
3492
|
3638
|
|
|
3493
|
3639
|
}
|
|
3494
|
3640
|
}
|
|
3495
|
|
-
|
|
3496
|
|
- modeNamelList.Sort((a, b) => b .number .CompareTo(a .number ));
|
|
|
3641
|
+ int max = 0;
|
|
|
3642
|
+ if (modeNamelList.Count >0)
|
|
|
3643
|
+ {
|
|
|
3644
|
+ modeNamelList.Sort((a, b) => b.number.CompareTo(a.number));
|
|
|
3645
|
+ max = modeNamelList.Max(t => t.number);
|
|
|
3646
|
+ }
|
|
3497
|
3647
|
var obj = new
|
|
3498
|
3648
|
{
|
|
3499
|
3649
|
state = "success",
|
|
3500
|
3650
|
message = "成功",
|
|
3501
|
3651
|
rows = modeNamelList,
|
|
|
3652
|
+ max,
|
|
3502
|
3653
|
total = modeNamelList.Count
|
|
3503
|
3654
|
};
|
|
3504
|
3655
|
|
|
|
@@ -3723,27 +3874,56 @@ question, int page = 1, int limit = 10)
|
|
3723
|
3874
|
for (int i = 0; i < model1.Count; i++)
|
|
3724
|
3875
|
{
|
|
3725
|
3876
|
Prescription model = new Prescription();
|
|
3726
|
|
- if (!string .IsNullOrEmpty (model1[i].F_CustomerID))
|
|
|
3877
|
+ Model.T_Cus_CustomerBaseNew cuModel = new Model.T_Cus_CustomerBaseNew();
|
|
|
3878
|
+ if (!string.IsNullOrEmpty(model1[i].F_CustomerID))//验证客户编码为10位纯数字
|
|
3727
|
3879
|
{
|
|
3728
|
|
- if (valcode(model1[i].F_CustomerID, 10))//验证客户编码为10位纯数字
|
|
3729
|
|
- {
|
|
3730
|
|
- Model.T_Cus_CustomerBaseNew cuModel = cusbll.GetModel(model1[i].F_CustomerID);//通过客户编号获取客户资料
|
|
|
3880
|
+ cuModel = cusbll.GetModel(model1[i].F_CustomerID);//通过客户编号获取客户资料
|
|
|
3881
|
+ }
|
|
|
3882
|
+ else
|
|
|
3883
|
+ {
|
|
|
3884
|
+ cuModel = new BLL.T_Cus_CustomerBaseNew().GetModelList(" F_IsDelete = 0 and F_LegalPhone ='" + model1[i].F_CusPhone.Trim() + "'").FirstOrDefault();
|
|
|
3885
|
+ }
|
|
|
3886
|
+
|
|
|
3887
|
+
|
|
3731
|
3888
|
if (cuModel != null)
|
|
3732
|
3889
|
{
|
|
3733
|
|
- Model.T_Sys_Department pdModel = departmentBLL.GetModel(cuModel.F_AreaID);//通过公司id获取部门
|
|
3734
|
|
- if (pdModel != null)
|
|
3735
|
|
- {
|
|
3736
|
|
- model.AreaName = pdModel.F_DeptName;//大区名称
|
|
3737
|
|
- }
|
|
3738
|
|
- Model.T_Sys_Department pdModel1 = departmentBLL.GetModel(cuModel.F_BranchID);
|
|
3739
|
|
- if (pdModel1 != null)
|
|
3740
|
|
- {
|
|
3741
|
|
- model.BranchName = pdModel1.F_DeptName;//大区名称
|
|
3742
|
|
- }
|
|
3743
|
|
- model.Brands = cuModel.F_Brands;//品牌
|
|
|
3890
|
+ if (!string.IsNullOrEmpty(cuModel.F_AreaID))
|
|
|
3891
|
+ {
|
|
|
3892
|
+ Model.T_Sys_Department pdModel = new T_Sys_Department();
|
|
|
3893
|
+ try
|
|
|
3894
|
+ {
|
|
|
3895
|
+ pdModel = departmentBLL.GetModel(int.Parse(cuModel.F_AreaID));//通过公司id获取部门
|
|
|
3896
|
+ }
|
|
|
3897
|
+ catch
|
|
|
3898
|
+ {
|
|
|
3899
|
+ pdModel = departmentBLL.GetModel(cuModel.F_AreaID);//通过公司id获取部门
|
|
|
3900
|
+ }
|
|
|
3901
|
+
|
|
|
3902
|
+ if (pdModel != null)
|
|
|
3903
|
+ {
|
|
|
3904
|
+ model.AreaName = pdModel.F_DeptName;
|
|
3744
|
3905
|
}
|
|
3745
|
3906
|
}
|
|
3746
|
|
- }
|
|
|
3907
|
+ if (!string.IsNullOrEmpty(cuModel.F_BranchID))
|
|
|
3908
|
+ {
|
|
|
3909
|
+ Model.T_Sys_Department pdModel1 = new T_Sys_Department();
|
|
|
3910
|
+ try
|
|
|
3911
|
+ {
|
|
|
3912
|
+ pdModel1 = departmentBLL.GetModel(int.Parse(cuModel.F_BranchID));//通过公司id获取部门
|
|
|
3913
|
+ }
|
|
|
3914
|
+ catch
|
|
|
3915
|
+ {
|
|
|
3916
|
+ pdModel1 = departmentBLL.GetModel(cuModel.F_BranchID);//通过公司id获取部门
|
|
|
3917
|
+ }
|
|
|
3918
|
+ if (pdModel1 != null)
|
|
|
3919
|
+ {
|
|
|
3920
|
+ model.BranchName = pdModel1.F_DeptName;
|
|
|
3921
|
+ }
|
|
|
3922
|
+ }
|
|
|
3923
|
+
|
|
|
3924
|
+ model.Brands = cuModel.F_Brands;//品牌
|
|
|
3925
|
+ }
|
|
|
3926
|
+
|
|
3747
|
3927
|
|
|
3748
|
3928
|
if (!string.IsNullOrEmpty(model1[i].F_QuestionType))
|
|
3749
|
3929
|
{
|
|
|
@@ -3916,28 +4096,56 @@ question, int page = 1, int limit = 10)
|
|
3916
|
4096
|
for (int i = 0; i < model1.Count; i++)
|
|
3917
|
4097
|
{
|
|
3918
|
4098
|
WorkOrderComplaint model = new WorkOrderComplaint();
|
|
3919
|
|
- if (!string .IsNullOrEmpty (model1[i].F_CustomerID))
|
|
|
4099
|
+ Model.T_Cus_CustomerBaseNew cuModel = new Model.T_Cus_CustomerBaseNew();
|
|
|
4100
|
+ if (!string.IsNullOrEmpty(model1[i].F_CustomerID))//验证客户编码为10位纯数字
|
|
3920
|
4101
|
{
|
|
3921
|
|
- if (valcode(model1[i].F_CustomerID, 10))//验证客户编码为10位纯数字
|
|
3922
|
|
- {
|
|
3923
|
|
- model.F_CustomerID = model1[i].F_CustomerID;//客户编码
|
|
3924
|
|
- Model.T_Cus_CustomerBaseNew cuModel = cusbll.GetModel(model1[i].F_CustomerID);//通过客户编号获取客户资料
|
|
|
4102
|
+ cuModel = cusbll.GetModel(model1[i].F_CustomerID);//通过客户编号获取客户资料
|
|
|
4103
|
+ }
|
|
|
4104
|
+ else
|
|
|
4105
|
+ {
|
|
|
4106
|
+
|
|
|
4107
|
+ cuModel = new BLL.T_Cus_CustomerBaseNew().GetModelList(" F_IsDelete = 0 and F_LegalPhone ='" + model1[i].F_CusPhone.Trim() + "'").FirstOrDefault();
|
|
|
4108
|
+ }
|
|
|
4109
|
+
|
|
3925
|
4110
|
if (cuModel != null)
|
|
3926
|
4111
|
{
|
|
3927
|
|
- Model.T_Sys_Department pdModel = departmentBLL.GetModel(cuModel.F_AreaID);//通过公司id获取部门
|
|
3928
|
|
- if (pdModel != null)
|
|
3929
|
|
- {
|
|
3930
|
|
- model.F_AreaName = pdModel.F_DeptName;//大区名称
|
|
3931
|
|
- }
|
|
3932
|
|
- Model.T_Sys_Department pdModel1 = departmentBLL.GetModel(cuModel.F_BranchID);
|
|
3933
|
|
- if (pdModel1 != null)
|
|
3934
|
|
- {
|
|
3935
|
|
- model.F_BranchName = pdModel1.F_DeptName;//分公司名称
|
|
3936
|
|
- }
|
|
3937
|
|
- model.F_Salesman = cuModel.F_Salesman;//业务员
|
|
|
4112
|
+ model.F_CustomerID = cuModel.F_CustomerCode;//客户编码
|
|
|
4113
|
+ if (!string.IsNullOrEmpty(cuModel.F_AreaID))
|
|
|
4114
|
+ {
|
|
|
4115
|
+ Model.T_Sys_Department pdModel = new T_Sys_Department();
|
|
|
4116
|
+ try
|
|
|
4117
|
+ {
|
|
|
4118
|
+ pdModel = departmentBLL.GetModel(int.Parse(cuModel.F_AreaID));//通过公司id获取部门
|
|
|
4119
|
+ }
|
|
|
4120
|
+ catch
|
|
|
4121
|
+ {
|
|
|
4122
|
+ pdModel = departmentBLL.GetModel(cuModel.F_AreaID);//通过公司id获取部门
|
|
|
4123
|
+ }
|
|
|
4124
|
+
|
|
|
4125
|
+ if (pdModel != null)
|
|
|
4126
|
+ {
|
|
|
4127
|
+ model.F_AreaName = pdModel.F_DeptName;
|
|
3938
|
4128
|
}
|
|
3939
|
4129
|
}
|
|
3940
|
|
- }
|
|
|
4130
|
+ if (!string.IsNullOrEmpty(cuModel.F_BranchID))
|
|
|
4131
|
+ {
|
|
|
4132
|
+ Model.T_Sys_Department pdModel1 = new T_Sys_Department();
|
|
|
4133
|
+ try
|
|
|
4134
|
+ {
|
|
|
4135
|
+ pdModel1 = departmentBLL.GetModel(int.Parse(cuModel.F_BranchID));//通过公司id获取部门
|
|
|
4136
|
+ }
|
|
|
4137
|
+ catch
|
|
|
4138
|
+ {
|
|
|
4139
|
+ pdModel1 = departmentBLL.GetModel(cuModel.F_BranchID);//通过公司id获取部门
|
|
|
4140
|
+ }
|
|
|
4141
|
+ if (pdModel1 != null)
|
|
|
4142
|
+ {
|
|
|
4143
|
+ model.F_BranchName = pdModel1.F_DeptName;
|
|
|
4144
|
+ }
|
|
|
4145
|
+ }
|
|
|
4146
|
+ model.F_Salesman = cuModel.F_Salesman;//业务员
|
|
|
4147
|
+ }
|
|
|
4148
|
+
|
|
3941
|
4149
|
if (!string .IsNullOrEmpty (model1[i].F_MaterialID))
|
|
3942
|
4150
|
{
|
|
3943
|
4151
|
if (valcode(model1[i].F_MaterialID, 11))
|
|
|
@@ -4051,21 +4259,21 @@ question, int page = 1, int limit = 10)
|
|
4051
|
4259
|
for (int i = 0; i < model1.Count; i++)
|
|
4052
|
4260
|
{
|
|
4053
|
4261
|
Product model = new Product();
|
|
4054
|
|
- if (!string .IsNullOrEmpty (model1[i].F_CustomerID))
|
|
|
4262
|
+ Model.T_Cus_CustomerBaseNew cuModel = new Model.T_Cus_CustomerBaseNew();
|
|
|
4263
|
+ if (!string.IsNullOrEmpty(model1[i].F_CustomerID))//验证客户编码为10位纯数字
|
|
4055
|
4264
|
{
|
|
4056
|
|
- if (valcode(model1[i].F_CustomerID, 10))//验证客户编码为10位纯数字
|
|
4057
|
|
- {
|
|
4058
|
|
-
|
|
4059
|
|
- Model.T_Cus_CustomerBaseNew cuModel = cusbll.GetModel(model1[i].F_CustomerID);//通过客户编号获取客户资料
|
|
|
4265
|
+ cuModel = cusbll.GetModel(model1[i].F_CustomerID);//通过客户编号获取客户资料
|
|
|
4266
|
+ }
|
|
|
4267
|
+ else
|
|
|
4268
|
+ {
|
|
|
4269
|
+ cuModel = new BLL.T_Cus_CustomerBaseNew().GetModelList(" F_IsDelete = 0 and F_LegalPhone ='" + model1[i].F_CusPhone.Trim() + "'").FirstOrDefault();
|
|
|
4270
|
+ }
|
|
4060
|
4271
|
if (cuModel != null)
|
|
4061
|
4272
|
{
|
|
4062
|
4273
|
Model.T_Sys_Department pdModel = departmentBLL.GetModel(cuModel.F_AreaID);//通过公司id获取部门
|
|
4063
|
4274
|
|
|
4064
|
4275
|
model.F_Salesman = cuModel.F_Salesman;//业务员
|
|
4065
|
4276
|
}
|
|
4066
|
|
- }
|
|
4067
|
|
- }
|
|
4068
|
|
-
|
|
4069
|
4277
|
model.Category = model1[i].F_TS_Category;//产品
|
|
4070
|
4278
|
model.Company = model1[i].F_CompanyName;//客户单位
|
|
4071
|
4279
|
if (!string.IsNullOrEmpty(model1[i].F_BatchNumber))
|