|
|
@@ -1,4 +1,5 @@
|
|
1
|
1
|
using CallCenter.Utility;
|
|
|
2
|
+using CallCenterApi.Cache.Models;
|
|
2
|
3
|
using CallCenterApi.Common;
|
|
3
|
4
|
using CallCenterApi.DB;
|
|
4
|
5
|
using CallCenterApi.Interface.Controllers.Base;
|
|
|
@@ -3407,16 +3408,19 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3407
|
3408
|
dt.Columns.Add("问题数量");
|
|
3408
|
3409
|
dt.Columns.Add("销售基地");
|
|
3409
|
3410
|
dt.Columns.Add("生产批次号");
|
|
3410
|
|
- if (type == 5)
|
|
3411
|
|
- {
|
|
3412
|
|
- dt.Columns.Add("问题类别");
|
|
3413
|
|
- }
|
|
3414
|
|
- else
|
|
3415
|
|
- {
|
|
3416
|
|
- dt.Columns.Add("问题类别1");
|
|
3417
|
|
- dt.Columns.Add("问题类别2");
|
|
3418
|
|
- dt.Columns.Add("问题类别3");
|
|
3419
|
|
- }
|
|
|
3411
|
+ dt.Columns.Add("问题类别1");
|
|
|
3412
|
+ dt.Columns.Add("问题类别2");
|
|
|
3413
|
+ dt.Columns.Add("问题类别3");
|
|
|
3414
|
+ //if (type == 5)
|
|
|
3415
|
+ //{
|
|
|
3416
|
+ // dt.Columns.Add("问题类别");
|
|
|
3417
|
+ //}
|
|
|
3418
|
+ //else
|
|
|
3419
|
+ //{
|
|
|
3420
|
+ // dt.Columns.Add("问题类别1");
|
|
|
3421
|
+ // dt.Columns.Add("问题类别2");
|
|
|
3422
|
+ // dt.Columns.Add("问题类别3");
|
|
|
3423
|
+ //}
|
|
3420
|
3424
|
dt.Columns.Add("重要级别");
|
|
3421
|
3425
|
dt.Columns.Add("品牌");
|
|
3422
|
3426
|
dt.Columns.Add("客户编号");
|
|
|
@@ -3493,7 +3497,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3493
|
3497
|
dt.Columns.Add("超时时限");
|
|
3494
|
3498
|
dt.Columns.Add("剩余时间");
|
|
3495
|
3499
|
dt.Columns.Add("创建时间");
|
|
3496
|
|
- dt.Columns.Add("回访时间");
|
|
|
3500
|
+ dt.Columns.Add("完结时间");
|
|
3497
|
3501
|
dt.Columns.Add("用时(天)");
|
|
3498
|
3502
|
//dt.Columns.Add("剩余时间-内线");
|
|
3499
|
3503
|
//dt.Columns.Add("超时原因");
|
|
|
@@ -3506,7 +3510,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3506
|
3510
|
dt.Columns.Add("该批次生产数量");
|
|
3507
|
3511
|
dt.Columns.Add("车牌号");
|
|
3508
|
3512
|
dt.Columns.Add("返账金额");
|
|
3509
|
|
- dt.Columns.Add("实收货数量");
|
|
|
3513
|
+ dt.Columns.Add("实收返厂数量");
|
|
|
3514
|
+ dt.Columns.Add("是否退换货");
|
|
3510
|
3515
|
//dt.Columns.Add("工单记录");
|
|
3511
|
3516
|
#endregion
|
|
3512
|
3517
|
foreach (var it in depts)
|
|
|
@@ -3688,6 +3693,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3688
|
3693
|
drNew["内线工单状态"] = "已撤回待指派";
|
|
3689
|
3694
|
}
|
|
3690
|
3695
|
#endregion
|
|
|
3696
|
+
|
|
|
3697
|
+ int cropid = 0;
|
|
3691
|
3698
|
if (type == 1 || type == 4)
|
|
3692
|
3699
|
{
|
|
3693
|
3700
|
if (!string.IsNullOrEmpty(it.F_QuestionType))
|
|
|
@@ -3707,18 +3714,19 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3707
|
3714
|
}
|
|
3708
|
3715
|
}
|
|
3709
|
3716
|
drNew["产品名称"] = it.F_TS_Category;
|
|
3710
|
|
- drNew["问题数量"] = it.F_ZX_Quantity;//投诉-(吨)
|
|
|
3717
|
+ drNew["问题数量"] = string.IsNullOrEmpty(it.F_ZX_Quantity)? it.F_TS_Quantity : it.F_ZX_Quantity;//投诉-(吨)
|
|
3711
|
3718
|
drNew["销售基地"] = it.F_SalesBase;
|
|
3712
|
3719
|
}
|
|
3713
|
3720
|
else if (type == 2 || type==5)
|
|
3714
|
3721
|
{
|
|
3715
|
3722
|
drNew["产品名称"] = it.F_TS_Category;
|
|
3716
|
|
- if (!string.IsNullOrEmpty(it.F_TS_Quantity))
|
|
3717
|
|
- {
|
|
3718
|
|
- drNew["问题数量"] = it.F_TS_Quantity + "吨";//投诉-问题数量(吨)
|
|
3719
|
|
- }
|
|
3720
|
|
- else
|
|
3721
|
|
- drNew["问题数量"] = "";
|
|
|
3723
|
+ drNew["问题数量"] = string.IsNullOrEmpty(it.F_TS_Quantity)? it.F_ZX_Quantity : it.F_TS_Quantity + "吨";//投诉-问题数量(吨)
|
|
|
3724
|
+ //if (!string.IsNullOrEmpty(it.F_TS_Quantity))
|
|
|
3725
|
+ //{
|
|
|
3726
|
+ // drNew["问题数量"] =string.IsNullOrEmpty(it.F_TS_Quantity)? it.F_ZX_Quantity : it.F_TS_Quantity + "吨";//投诉-问题数量(吨)
|
|
|
3727
|
+ //}
|
|
|
3728
|
+ //else
|
|
|
3729
|
+ // drNew["问题数量"] = "";
|
|
3722
|
3730
|
drNew["销售基地"] = it.F_SalesBase;
|
|
3723
|
3731
|
drNew["生产批次号"] = it.F_BatchNumber;
|
|
3724
|
3732
|
if (!string.IsNullOrEmpty(it.F_QuestionType))
|
|
|
@@ -3731,7 +3739,15 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3731
|
3739
|
{
|
|
3732
|
3740
|
if (type == 5)
|
|
3733
|
3741
|
{
|
|
3734
|
|
- drNew["问题类别"] = manage.F_QuestionName;
|
|
|
3742
|
+ drNew["问题类别1"] = manage.F_QuestionName;
|
|
|
3743
|
+ if (manage.F_QuestionName.Contains("肥效"))
|
|
|
3744
|
+ {
|
|
|
3745
|
+ if (int.TryParse(it.F_Crops.Trim(), out cropid))
|
|
|
3746
|
+ {
|
|
|
3747
|
+ drNew["问题类别2"] = new BLL.T_Sys_DictionaryValue().GetModel(cropid)?.F_Name ?? "";//作物
|
|
|
3748
|
+ }
|
|
|
3749
|
+ else drNew["问题类别2"] = "";
|
|
|
3750
|
+ }
|
|
3735
|
3751
|
}
|
|
3736
|
3752
|
else
|
|
3737
|
3753
|
{
|
|
|
@@ -3767,9 +3783,11 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3767
|
3783
|
List<T_Wo_MaterialItems> materlist = new BLL.T_Wo_MaterialItems().GetModelList($" F_WoID={it.F_ID}");
|
|
3768
|
3784
|
if (materlist != null)
|
|
3769
|
3785
|
{
|
|
3770
|
|
- drNew["实收货数量"] = materlist.Sum(x => x.F_ReturnQuantity).ToString();
|
|
|
3786
|
+ drNew["实收返厂数量"] = materlist.Sum(x => x.F_ReturnQuantity).ToString();
|
|
3771
|
3787
|
}
|
|
3772
|
|
-
|
|
|
3788
|
+
|
|
|
3789
|
+ drNew["是否退换货"] = it.F_SC_PreliminaryOpinion;
|
|
|
3790
|
+
|
|
3773
|
3791
|
//dt.Columns.Add("原料及厂家");
|
|
3774
|
3792
|
//dt.Columns.Add("车牌号");
|
|
3775
|
3793
|
//dt.Columns.Add("返账金额");
|
|
|
@@ -3908,7 +3926,11 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3908
|
3926
|
drNew["客户电话"] = it.F_CusPhone;//
|
|
3909
|
3927
|
drNew["问题描述"] = it.F_Description;//
|
|
3910
|
3928
|
drNew["创建时间"] = it.F_CreateOn;
|
|
3911
|
|
- drNew["回访时间"] = it.F_VisitOn;
|
|
|
3929
|
+ #region 获取外线完结时间
|
|
|
3930
|
+ var itemlasts = itembll.GetModelList($" F_WoID={it.F_ID} and F_ItemType={(int)EnumItemType.deal} and F_OptType={(int)EnumItemOpt.end} and F_Type=1 order by F_CreateTime desc").FirstOrDefault();
|
|
|
3931
|
+ if (itemlasts != null)
|
|
|
3932
|
+ drNew["完结时间"] = itemlasts.F_CreateTime;
|
|
|
3933
|
+ #endregion
|
|
3912
|
3934
|
|
|
3913
|
3935
|
drNew["事发地-省"] = it.F_IncidentProvince;//
|
|
3914
|
3936
|
drNew["事发地-市"] = it.F_IncidentCity;//
|
|
|
@@ -3920,17 +3942,34 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3920
|
3942
|
drNew["处理详情-内线"] = it.F_DealContent2;//处理内容
|
|
3921
|
3943
|
drNew["回访备注"] = it.F_VisitRemarks;//处理内容
|
|
3922
|
3944
|
drNew["注解"] = it.F_Annotation;//处理内容
|
|
3923
|
|
- drNew["超时时限"] = it.F_limit;//处理内容
|
|
3924
|
|
- #region
|
|
3925
|
|
- float RemainingTime = float.Parse(string.Format("{0:f2}", TimeToOver(it.F_ID, it.F_limit)));
|
|
3926
|
|
- if (RemainingTime >= 0)
|
|
3927
|
|
- {
|
|
3928
|
|
- drNew["剩余时间"] = RemainingTime;//处理内容
|
|
3929
|
|
- }
|
|
|
3945
|
+ #region 超时时限
|
|
|
3946
|
+ int day = (int)Math.Floor(Convert.ToDouble(it.F_limit / 24));
|
|
|
3947
|
+ int hour = day > 0
|
|
|
3948
|
+ ? (int)Math.Floor(Convert.ToDouble((it.F_limit - day * 24)))
|
|
|
3949
|
+ : (int)Math.Floor(Convert.ToDouble(it.F_limit));
|
|
|
3950
|
+
|
|
|
3951
|
+ string time = "";
|
|
|
3952
|
+ if (day > 0) time += day + "天";
|
|
|
3953
|
+ if (hour > 0) time += hour + "小时";
|
|
|
3954
|
+ drNew["超时时限"] = time;//超时时限
|
|
|
3955
|
+ #endregion
|
|
|
3956
|
+
|
|
|
3957
|
+
|
|
|
3958
|
+ #region 剩余时间
|
|
|
3959
|
+ float c = TimeToOver(it.F_ID, it.F_limit);
|
|
|
3960
|
+ float a = Math.Abs(c);
|
|
|
3961
|
+ int days1 = (int)Math.Floor(Convert.ToDouble(a / 24));
|
|
|
3962
|
+ int hours = days1 > 0
|
|
|
3963
|
+ ? (int)Math.Floor(Convert.ToDouble((a - days1 * 24)))
|
|
|
3964
|
+ : (int)Math.Floor(Convert.ToDouble(a));
|
|
|
3965
|
+ float minutes = hours > 0
|
|
|
3966
|
+ ? a * 60 - days1 * 1440 - hours * 60
|
|
|
3967
|
+ : 0;
|
|
|
3968
|
+ if (c > 0)
|
|
|
3969
|
+ drNew["剩余时间"] = string.Format("剩余{0:f0}天{1:f0}时{2:f0}分", days1, hours, minutes);
|
|
3930
|
3970
|
else
|
|
3931
|
|
- {
|
|
3932
|
|
- drNew["剩余时间"] = "超时" + Math.Abs(RemainingTime);//处理内容
|
|
3933
|
|
- }
|
|
|
3971
|
+ drNew["剩余时间"] = string.Format("超时{0:f0}天{1:f0}时{2:f0}分", days1, hours, minutes);
|
|
|
3972
|
+ float RemainingTime = float.Parse(string.Format("{0:f2}", TimeToOver(it.F_ID, it.F_limit)));
|
|
3934
|
3973
|
float aa = Math.Abs(it.F_limit-RemainingTime);
|
|
3935
|
3974
|
int days = (int)Math.Floor(Convert.ToDouble(aa / 24));
|
|
3936
|
3975
|
drNew["用时(天)"] = days+"天";
|
|
|
@@ -3947,7 +3986,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3947
|
3986
|
//}
|
|
3948
|
3987
|
//#endregion
|
|
3949
|
3988
|
//drNew["超时原因"] = it.F_Reasontimeout;//处理内容it
|
|
3950
|
|
- int cropid = 0;
|
|
|
3989
|
+ //int cropid = 0;
|
|
3951
|
3990
|
if (int.TryParse(it.F_Crops.Trim(), out cropid))
|
|
3952
|
3991
|
{
|
|
3953
|
3992
|
drNew["作物"] = new BLL.T_Sys_DictionaryValue().GetModel(cropid)?.F_Name ?? "";//作物
|
|
|
@@ -10252,9 +10291,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
10252
|
10291
|
else
|
|
10253
|
10292
|
model.F_Files = F_Files;
|
|
10254
|
10293
|
}
|
|
10255
|
|
-
|
|
|
10294
|
+ string strcont = nowUser.F_UserName + "(" + nowUser.F_WorkNumber + ") " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
10256
|
10295
|
if (!string.IsNullOrEmpty(cont))
|
|
10257
|
10296
|
{
|
|
|
10297
|
+ string strconts1 = strcont + " " + cont + ";@# ";
|
|
10258
|
10298
|
if (model.F_Source == "3")
|
|
10259
|
10299
|
{
|
|
10260
|
10300
|
if (flag == 2)
|
|
|
@@ -10284,6 +10324,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
10284
|
10324
|
if (model.F_SuperiorOpinion.Trim() != cont.Trim())
|
|
10285
|
10325
|
{
|
|
10286
|
10326
|
model.F_SuperiorOpinion = nowUser.F_UserName + "(" + nowUser.F_WorkNumber + ") " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " " + cont;
|
|
|
10327
|
+ //model.F_SuperiorOpinion = string.IsNullOrEmpty(model.F_SuperiorOpinion)? strconts1:model.F_SuperiorOpinion + strconts1;
|
|
10287
|
10328
|
}
|
|
10288
|
10329
|
}
|
|
10289
|
10330
|
else if (flag == 2)
|
|
|
@@ -10291,6 +10332,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
10291
|
10332
|
if (model.F_SuperiorOpinion2.Trim() != cont.Trim())
|
|
10292
|
10333
|
{
|
|
10293
|
10334
|
model.F_SuperiorOpinion2 = nowUser.F_UserName + "(" + nowUser.F_WorkNumber + ") " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " " + cont;
|
|
|
10335
|
+ //model.F_SuperiorOpinion2 = string.IsNullOrEmpty(model.F_SuperiorOpinion2) ? strconts1 : model.F_SuperiorOpinion2 + strconts1;
|
|
10294
|
10336
|
}
|
|
10295
|
10337
|
}
|
|
10296
|
10338
|
}
|
|
|
@@ -10468,6 +10510,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
10468
|
10510
|
private Model.T_Wo_WorkOrder InToworkModel(Model.T_Wo_WorkOrder model, WorkOrderNewInput input)
|
|
10469
|
10511
|
|
|
10470
|
10512
|
{
|
|
|
10513
|
+ CurrentUserInfo ua =CurrentUser.UserData;
|
|
|
10514
|
+ string str = ua.F_UserName + "(" + ua.F_WorkNumber + ")" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " ";
|
|
10471
|
10515
|
if (!string.IsNullOrEmpty(input.F_SC_ProductBase))
|
|
10472
|
10516
|
model.F_SC_ProductBase = input.F_SC_ProductBase;//市场管理科-生产基地(新乡、新疆、九江、东北、贴牌、无法确定)
|
|
10473
|
10517
|
if (!string.IsNullOrEmpty(input.F_SC_PreliminaryOpinion))
|
|
|
@@ -10500,8 +10544,12 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
10500
|
10544
|
model.F_ZL_CResponsibleUnits = input.F_ZL_CResponsibleUnits;//质量管理科-对应责任单位(生产、研发、农化、物流、质量管理科,销售内勤)
|
|
10501
|
10545
|
if (!string.IsNullOrEmpty(input.F_ZL_Fquantity))
|
|
10502
|
10546
|
model.F_ZL_Fquantity = input.F_ZL_Fquantity;// 质量管理科-确认实收数量(吨)
|
|
10503
|
|
- if (!string.IsNullOrEmpty(input.F_ZL_ImprovementRequirements))
|
|
10504
|
|
- model.F_ZL_ImprovementRequirements = input.F_ZL_ImprovementRequirements;//质量管理科-改进要求
|
|
|
10547
|
+ if (!string.IsNullOrEmpty(input.F_ZL_ImprovementRequirements) && !model.F_ZL_ImprovementRequirements.Contains(input.F_ZL_ImprovementRequirements) )
|
|
|
10548
|
+ {
|
|
|
10549
|
+ string strimprovement = str + input.F_ZL_ImprovementRequirements + ";@# ";
|
|
|
10550
|
+ model.F_ZL_ImprovementRequirements = string.IsNullOrEmpty(model.F_ZL_ImprovementRequirements) ? strimprovement : model.F_ZL_ImprovementRequirements + strimprovement; //质量管理科-改进要求
|
|
|
10551
|
+ //model.F_ZL_ImprovementRequirements = input.F_ZL_ImprovementRequirements;//质量管理科-改进要求
|
|
|
10552
|
+ }
|
|
10505
|
10553
|
if (!string.IsNullOrEmpty(input.F_ZL_CApprovalNo))
|
|
10506
|
10554
|
model.F_ZL_CApprovalNo = input.F_ZL_CApprovalNo;//质量管理科-对应审批工作流单号
|
|
10507
|
10555
|
if (!string.IsNullOrEmpty(input.F_ZL_CJ_IsRecord))
|
|
|
@@ -10530,8 +10578,11 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
10530
|
10578
|
model.F_UnLoadingFee = input.F_UnLoadingFee;
|
|
10531
|
10579
|
if (input.F_MaterialFee > 0) //返料费
|
|
10532
|
10580
|
model.F_MaterialFee = input.F_MaterialFee;
|
|
10533
|
|
- if (!string.IsNullOrEmpty(input.F_EventReason))
|
|
10534
|
|
- model.F_EventReason = input.F_EventReason;//质量管理科-事件原因
|
|
|
10581
|
+ if (!string.IsNullOrEmpty(input.F_EventReason) && !model.F_EventReason.Contains(input.F_EventReason))
|
|
|
10582
|
+ {
|
|
|
10583
|
+ string strevent = str + input.F_EventReason + ";@# ";
|
|
|
10584
|
+ model.F_EventReason = string.IsNullOrEmpty(model.F_EventReason) ? strevent : model.F_EventReason + strevent; //质量管理科-事件原因
|
|
|
10585
|
+ }
|
|
10535
|
10586
|
if (!string.IsNullOrEmpty(input.F_DrivePhone))
|
|
10536
|
10587
|
model.F_DrivePhone = input.F_DrivePhone;//电话号码
|
|
10537
|
10588
|
if (!string.IsNullOrEmpty(input.F_WorkmanShip))
|
|
|
@@ -11239,7 +11290,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
11239
|
11290
|
/// <summary>
|
|
11240
|
11291
|
/// 返厂数量
|
|
11241
|
11292
|
/// </summary>
|
|
11242
|
|
- public int? returnum { get; set; }
|
|
|
11293
|
+ public decimal? returnum { get; set; }
|
|
11243
|
11294
|
/// <summary>
|
|
11244
|
11295
|
/// 规格
|
|
11245
|
11296
|
/// </summary>
|