zhupei 3 gadi atpakaļ
vecāks
revīzija
38af600b1c

+ 3 - 3
codegit/CallCenterApi/CallCenterApi.DAL/T_Wo_WorkOrder.cs

156
                     new SqlParameter("@F_UnLoadingFee", SqlDbType.Decimal,9),
156
                     new SqlParameter("@F_UnLoadingFee", SqlDbType.Decimal,9),
157
                     new SqlParameter("@F_MaterialFee", SqlDbType.Decimal,9),
157
                     new SqlParameter("@F_MaterialFee", SqlDbType.Decimal,9),
158
                     new SqlParameter("@F_Formula", SqlDbType.NVarChar,200),
158
                     new SqlParameter("@F_Formula", SqlDbType.NVarChar,200),
159
-                    new SqlParameter("@F_ReturnQuantity", SqlDbType.Int,4),
159
+                    new SqlParameter("@F_ReturnQuantity", SqlDbType.Decimal,9),
160
                     new SqlParameter("@F_EventReason", SqlDbType.NText),
160
                     new SqlParameter("@F_EventReason", SqlDbType.NText),
161
                     new SqlParameter("@F_MailingNumber", SqlDbType.VarChar,20),
161
                     new SqlParameter("@F_MailingNumber", SqlDbType.VarChar,20),
162
                     new SqlParameter("@F_ExpressName", SqlDbType.NVarChar,200),
162
                     new SqlParameter("@F_ExpressName", SqlDbType.NVarChar,200),
531
                     new SqlParameter("@F_UnLoadingFee", SqlDbType.Decimal,9),
531
                     new SqlParameter("@F_UnLoadingFee", SqlDbType.Decimal,9),
532
                     new SqlParameter("@F_MaterialFee", SqlDbType.Decimal,9),
532
                     new SqlParameter("@F_MaterialFee", SqlDbType.Decimal,9),
533
                     new SqlParameter("@F_Formula", SqlDbType.NVarChar,200),
533
                     new SqlParameter("@F_Formula", SqlDbType.NVarChar,200),
534
-                    new SqlParameter("@F_ReturnQuantity", SqlDbType.Int,4),
534
+                    new SqlParameter("@F_ReturnQuantity", SqlDbType.Decimal,9),
535
                     new SqlParameter("@F_EventReason", SqlDbType.NText),
535
                     new SqlParameter("@F_EventReason", SqlDbType.NText),
536
                     new SqlParameter("@F_MailingNumber", SqlDbType.VarChar,20),
536
                     new SqlParameter("@F_MailingNumber", SqlDbType.VarChar,20),
537
                     new SqlParameter("@F_ExpressName", SqlDbType.NVarChar,200),
537
                     new SqlParameter("@F_ExpressName", SqlDbType.NVarChar,200),
1204
                 }
1204
                 }
1205
                 if (row["F_ReturnQuantity"] != null && row["F_ReturnQuantity"].ToString() != "")
1205
                 if (row["F_ReturnQuantity"] != null && row["F_ReturnQuantity"].ToString() != "")
1206
                 {
1206
                 {
1207
-                    model.F_ReturnQuantity = int.Parse(row["F_ReturnQuantity"].ToString());
1207
+                    model.F_ReturnQuantity = decimal.Parse(row["F_ReturnQuantity"].ToString());
1208
                 }
1208
                 }
1209
                 if (row["F_EventReason"] != null)
1209
                 if (row["F_EventReason"] != null)
1210
                 {
1210
                 {

+ 33 - 3
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/CustomerNewController.cs

211
         /// <returns></returns>
211
         /// <returns></returns>
212
         public ActionResult GetCodeCustomer(string code)
212
         public ActionResult GetCodeCustomer(string code)
213
         {
213
         {
214
-            var list = new List<Model.T_Cus_CustomerBaseNew>(); DataTable dt = new DataTable();
214
+            var list = new List<Model.T_Cus_CustomerBaseNew>();
215
+            DataTable dt = new DataTable();
215
             string sql = "  F_IsDelete=0";
216
             string sql = "  F_IsDelete=0";
216
             if (!string.IsNullOrWhiteSpace(code))//客户编号
217
             if (!string.IsNullOrWhiteSpace(code))//客户编号
217
             {
218
             {
786
                             Input1.F_Gender = "女";
787
                             Input1.F_Gender = "女";
787
                         }
788
                         }
788
                     }
789
                     }
789
-                    Input1.F_Salesman = model[i].F_Salesman;//业务员
790
-                    Input1.F_SalesPhone = model[i].F_SalesPhone;//业务员电话
790
+
791
+                    if (!string.IsNullOrEmpty(model[i].F_Salesman))
792
+                    {
793
+                        Input1.F_Salesman = model[i].F_Salesman;//业务员
794
+                        Input1.F_SalesPhone = model[i].F_SalesPhone;//业务员电话
795
+                    }
796
+                    else
797
+                    {
798
+                        string sql = $" F_DeleteFlag=0";
799
+                        if (!string.IsNullOrWhiteSpace(model[i].F_AddressCountry))//县
800
+                        {
801
+                            sql += $" and (F_Remark like '%{  model[i].F_AddressCountry.Trim()}%'";
802
+                            if (!string.IsNullOrWhiteSpace(model[i].F_AddressCity))//市
803
+                                sql += $" or F_Remark like '%{ model[i].F_AddressCity.Trim()}%')";
804
+                            else
805
+                                sql += $")";
806
+                        }
807
+                        else if (!string.IsNullOrWhiteSpace(model[i].F_AddressCity))//市
808
+                            sql += $" and F_Remark like '%{ model[i].F_AddressCity.Trim()}%'";
809
+                        else
810
+                            sql += $" and 1!=1";
811
+
812
+                        var modelist = new BLL.T_Sys_UserAccount().GetModelList(sql).FirstOrDefault();
813
+
814
+                        if (modelist!=null)
815
+                        {
816
+                            Input1.F_Salesman = modelist.F_UserName;//业务员
817
+                            Input1.F_SalesPhone = modelist.F_Mobile;//业务员电话  
818
+                        }
819
+                        
820
+                    }
791
 
821
 
792
                     Input1.F_Channel = model[i].F_Channel;// 渠道类型:总经销、二级商、种田大户、农户、化工客户、公司员工
822
                     Input1.F_Channel = model[i].F_Channel;// 渠道类型:总经销、二级商、种田大户、农户、化工客户、公司员工
793
                     Input1.F_Credit = model[i].F_Credit;//信用等级:一星、二星、三星、四星、五星、空
823
                     Input1.F_Credit = model[i].F_Credit;//信用等级:一星、二星、三星、四星、五星、空

+ 4 - 4
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/knowledge/KnowledgeController.cs

403
                     {
403
                     {
404
                         model.F_CategoryId = 0;
404
                         model.F_CategoryId = 0;
405
                     }
405
                     }
406
-                    model.F_Title = dataRow[0].ToString();
407
-                    model.F_KeyWords = dataRow[1].ToString();
408
-                    model.F_Content = WebHelper.UrlDecode(dataRow[2].ToString());
409
-                    model.F_Description = WebHelper.NoHtml(WebHelper.UrlDecode(dataRow[0].ToString()));
406
+                    model.F_Title = dataRow[1].ToString();
407
+                    model.F_KeyWords = dataRow[2].ToString();
408
+                    model.F_Content = WebHelper.UrlDecode(dataRow[3].ToString());
409
+                    model.F_Description = WebHelper.NoHtml(WebHelper.UrlDecode(dataRow[3].ToString()));
410
                     model.F_CreateOn = DateTime.Now;
410
                     model.F_CreateOn = DateTime.Now;
411
                     model.F_DeleteFlag = 0;
411
                     model.F_DeleteFlag = 0;
412
                     model.F_CreateBy = userId;
412
                     model.F_CreateBy = userId;

+ 28 - 21
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/weixin/WxLoginController.cs

1738
                 List<Model.T_Wo_WorkOrder> modlelist = new BLL.T_Wo_WorkOrder().DataTableToList(dt);
1738
                 List<Model.T_Wo_WorkOrder> modlelist = new BLL.T_Wo_WorkOrder().DataTableToList(dt);
1739
                 if (modlelist.Count > 0)
1739
                 if (modlelist.Count > 0)
1740
                 {
1740
                 {
1741
-                    List<WorkOrderNewInput> Input = modeltooip(modlelist, ua);
1741
+                    List<WorkOrderNewInput> Input =modeltooip(modlelist, ua);
1742
                     var obj = new
1742
                     var obj = new
1743
                     {
1743
                     {
1744
                         state = "success",
1744
                         state = "success",
3968
 
3968
 
3969
 
3969
 
3970
                     #region 内线超时时间计算
3970
                     #region 内线超时时间计算
3971
-                    float c2 = TimeToOver(model1[i].F_ID, model1[i].F_limit, 2);
3972
-                    float a2 = Math.Abs(c2);
3973
-                    int days2 = (int)Math.Floor(Convert.ToDouble(a2 / 24));
3974
-                    int hours2 = days2 > 0
3975
-                                   ? (int)Math.Floor(Convert.ToDouble((a2 - days2 * 24)))
3976
-                                   : (int)Math.Floor(Convert.ToDouble(a2));
3977
-                    float minutes2 = hours2 > 0
3978
-                                   ? a2 * 60 - days2 * 1440 - hours2 * 60
3979
-                                   : 0;
3980
-                    if (c2 > 0)
3981
-                        model.RemainingTime2 = string.Format("剩余{0:f0}天{1:f0}时{2:f0}分", days2, hours2, minutes2);
3982
-                    else
3983
-                        model.RemainingTime2 = string.Format("超时{0:f0}天{1:f0}时{2:f0}分", days2, hours2, minutes2);
3971
+                    //float c2 = TimeToOver(model1[i].F_ID, model1[i].F_limit, 2);
3972
+                    //float a2 = Math.Abs(c2);
3973
+                    //int days2 = (int)Math.Floor(Convert.ToDouble(a2 / 24));
3974
+                    //int hours2 = days2 > 0
3975
+                    //               ? (int)Math.Floor(Convert.ToDouble((a2 - days2 * 24)))
3976
+                    //               : (int)Math.Floor(Convert.ToDouble(a2));
3977
+                    //float minutes2 = hours2 > 0
3978
+                    //               ? a2 * 60 - days2 * 1440 - hours2 * 60
3979
+                    //               : 0;
3980
+                    //if (c2 > 0)
3981
+                    //    model.RemainingTime2 = string.Format("剩余{0:f0}天{1:f0}时{2:f0}分", days2, hours2, minutes2);
3982
+                    //else
3983
+                    //    model.RemainingTime2 = string.Format("超时{0:f0}天{1:f0}时{2:f0}分", days2, hours2, minutes2);
3984
                     #endregion
3984
                     #endregion
3985
 
3985
 
3986
                     if (ua != null)
3986
                     if (ua != null)
5255
         /// <param name="model"></param>
5255
         /// <param name="model"></param>
5256
         /// <param name="input"></param>
5256
         /// <param name="input"></param>
5257
         /// <returns></returns>
5257
         /// <returns></returns>
5258
-        private Model.T_Wo_WorkOrder InToworkModel(Model.T_Wo_WorkOrder model, WorkOrderNewInput input)
5258
+        private Model.T_Wo_WorkOrder InToworkModel(Model.T_Wo_WorkOrder model, WorkOrderNewInput input,Model.T_Sys_UserAccount ua)
5259
 
5259
 
5260
         {
5260
         {
5261
+            string str = ua.F_UserName + "(" + ua.F_WorkNumber + ")" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "  ";
5261
             if (!string.IsNullOrEmpty(input.F_SC_ProductBase))
5262
             if (!string.IsNullOrEmpty(input.F_SC_ProductBase))
5262
                 model.F_SC_ProductBase = input.F_SC_ProductBase;//市场管理科-生产基地(新乡、新疆、九江、东北、贴牌、无法确定)
5263
                 model.F_SC_ProductBase = input.F_SC_ProductBase;//市场管理科-生产基地(新乡、新疆、九江、东北、贴牌、无法确定)
5263
             if (!string.IsNullOrEmpty(input.F_SC_PreliminaryOpinion))
5264
             if (!string.IsNullOrEmpty(input.F_SC_PreliminaryOpinion))
5290
                 model.F_ZL_CResponsibleUnits = input.F_ZL_CResponsibleUnits;//质量管理科-对应责任单位(生产、研发、农化、物流、质量管理科,销售内勤)
5291
                 model.F_ZL_CResponsibleUnits = input.F_ZL_CResponsibleUnits;//质量管理科-对应责任单位(生产、研发、农化、物流、质量管理科,销售内勤)
5291
             if (!string.IsNullOrEmpty(input.F_ZL_Fquantity))
5292
             if (!string.IsNullOrEmpty(input.F_ZL_Fquantity))
5292
                 model.F_ZL_Fquantity = input.F_ZL_Fquantity;// 质量管理科-确认实收数量(吨)
5293
                 model.F_ZL_Fquantity = input.F_ZL_Fquantity;// 质量管理科-确认实收数量(吨)
5293
-            if (!string.IsNullOrEmpty(input.F_ZL_ImprovementRequirements))
5294
-                model.F_ZL_ImprovementRequirements = input.F_ZL_ImprovementRequirements;//质量管理科-改进要求
5294
+            if (!string.IsNullOrEmpty(input.F_ZL_ImprovementRequirements) && !model.F_ZL_ImprovementRequirements.Contains(input.F_ZL_ImprovementRequirements))
5295
+            {
5296
+                string strimprovement = str + input.F_ZL_ImprovementRequirements + ";@# ";
5297
+                model.F_ZL_ImprovementRequirements = string.IsNullOrEmpty(model.F_ZL_ImprovementRequirements) ? strimprovement : model.F_ZL_ImprovementRequirements + strimprovement; //质量管理科-改进要求
5298
+            }
5295
             if (!string.IsNullOrEmpty(input.F_ZL_CApprovalNo))
5299
             if (!string.IsNullOrEmpty(input.F_ZL_CApprovalNo))
5296
                 model.F_ZL_CApprovalNo = input.F_ZL_CApprovalNo;//质量管理科-对应审批工作流单号
5300
                 model.F_ZL_CApprovalNo = input.F_ZL_CApprovalNo;//质量管理科-对应审批工作流单号
5297
             if (!string.IsNullOrEmpty(input.F_ZL_CJ_IsRecord))
5301
             if (!string.IsNullOrEmpty(input.F_ZL_CJ_IsRecord))
5317
                 model.F_UnLoadingFee = input.F_UnLoadingFee;
5321
                 model.F_UnLoadingFee = input.F_UnLoadingFee;
5318
             if (input.F_MaterialFee > 0) //返料费
5322
             if (input.F_MaterialFee > 0) //返料费
5319
                 model.F_MaterialFee = input.F_MaterialFee;
5323
                 model.F_MaterialFee = input.F_MaterialFee;
5320
-            if (!string.IsNullOrEmpty(input.F_EventReason))
5321
-                model.F_EventReason = input.F_EventReason;//质量管理科-事件原因
5324
+            if (!string.IsNullOrEmpty(input.F_EventReason) &&  !model.F_EventReason.Contains(input.F_EventReason))
5325
+            {
5326
+                string strevent = str + input.F_EventReason + ";@# ";
5327
+                model.F_EventReason = string.IsNullOrEmpty(model.F_EventReason) ? strevent : model.F_EventReason + strevent; //质量管理科-事件原因
5328
+            }
5322
             if (!string.IsNullOrEmpty(input.F_DrivePhone))
5329
             if (!string.IsNullOrEmpty(input.F_DrivePhone))
5323
                 model.F_DrivePhone = input.F_DrivePhone;//电话号码
5330
                 model.F_DrivePhone = input.F_DrivePhone;//电话号码
5324
             if (!string.IsNullOrEmpty(input.F_WorkmanShip))
5331
             if (!string.IsNullOrEmpty(input.F_WorkmanShip))
5940
                     }
5947
                     }
5941
 
5948
 
5942
                 }
5949
                 }
5943
-                InToworkModel(model, input);
5950
+                InToworkModel(model, input, nowUser);
5944
 
5951
 
5945
                 if (!string.IsNullOrEmpty(F_Files))
5952
                 if (!string.IsNullOrEmpty(F_Files))
5946
                 {
5953
                 {
7369
                 //}
7376
                 //}
7370
 
7377
 
7371
                 model.F_DealTime = DateTime.Now;
7378
                 model.F_DealTime = DateTime.Now;
7372
-                InToworkModel(model, input);
7379
+                InToworkModel(model, input,nowUser);
7373
                 woBLL.Update(model);
7380
                 woBLL.Update(model);
7374
                 #endregion
7381
                 #endregion
7375
 
7382
 

+ 91 - 40
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderNewController.cs

1
 using CallCenter.Utility;
1
 using CallCenter.Utility;
2
+using CallCenterApi.Cache.Models;
2
 using CallCenterApi.Common;
3
 using CallCenterApi.Common;
3
 using CallCenterApi.DB;
4
 using CallCenterApi.DB;
4
 using CallCenterApi.Interface.Controllers.Base;
5
 using CallCenterApi.Interface.Controllers.Base;
3407
                             dt.Columns.Add("问题数量");
3408
                             dt.Columns.Add("问题数量");
3408
                             dt.Columns.Add("销售基地");                                       
3409
                             dt.Columns.Add("销售基地");                                       
3409
                             dt.Columns.Add("生产批次号");
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
                             dt.Columns.Add("重要级别");
3424
                             dt.Columns.Add("重要级别");
3421
                             dt.Columns.Add("品牌");
3425
                             dt.Columns.Add("品牌");
3422
                             dt.Columns.Add("客户编号");
3426
                             dt.Columns.Add("客户编号");
3493
                         dt.Columns.Add("超时时限");
3497
                         dt.Columns.Add("超时时限");
3494
                         dt.Columns.Add("剩余时间");
3498
                         dt.Columns.Add("剩余时间");
3495
                         dt.Columns.Add("创建时间");
3499
                         dt.Columns.Add("创建时间");
3496
-                        dt.Columns.Add("回访时间");
3500
+                        dt.Columns.Add("完结时间");
3497
                         dt.Columns.Add("用时(天)");
3501
                         dt.Columns.Add("用时(天)");
3498
                         //dt.Columns.Add("剩余时间-内线");
3502
                         //dt.Columns.Add("剩余时间-内线");
3499
                         //dt.Columns.Add("超时原因");
3503
                         //dt.Columns.Add("超时原因");
3506
                         dt.Columns.Add("该批次生产数量");
3510
                         dt.Columns.Add("该批次生产数量");
3507
                         dt.Columns.Add("车牌号");
3511
                         dt.Columns.Add("车牌号");
3508
                         dt.Columns.Add("返账金额");
3512
                         dt.Columns.Add("返账金额");
3509
-                        dt.Columns.Add("实收货数量");
3513
+                        dt.Columns.Add("实收返厂数量");
3514
+                        dt.Columns.Add("是否退换货");
3510
                         //dt.Columns.Add("工单记录");
3515
                         //dt.Columns.Add("工单记录");
3511
                         #endregion
3516
                         #endregion
3512
                         foreach (var it in depts)
3517
                         foreach (var it in depts)
3688
                                 drNew["内线工单状态"] = "已撤回待指派";
3693
                                 drNew["内线工单状态"] = "已撤回待指派";
3689
                             }
3694
                             }
3690
                             #endregion
3695
                             #endregion
3696
+
3697
+                            int cropid = 0;
3691
                             if (type == 1 || type == 4)
3698
                             if (type == 1 || type == 4)
3692
                             {
3699
                             {
3693
                                 if (!string.IsNullOrEmpty(it.F_QuestionType))
3700
                                 if (!string.IsNullOrEmpty(it.F_QuestionType))
3707
                                     }
3714
                                     }
3708
                                 }
3715
                                 }
3709
                                 drNew["产品名称"] = it.F_TS_Category;
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
                                 drNew["销售基地"] = it.F_SalesBase;
3718
                                 drNew["销售基地"] = it.F_SalesBase;
3712
                             }
3719
                             }
3713
                             else if (type == 2 || type==5)
3720
                             else if (type == 2 || type==5)
3714
                             {
3721
                             {
3715
                                 drNew["产品名称"] = it.F_TS_Category;
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
                                 drNew["销售基地"] = it.F_SalesBase;
3730
                                 drNew["销售基地"] = it.F_SalesBase;
3723
                                 drNew["生产批次号"] = it.F_BatchNumber;
3731
                                 drNew["生产批次号"] = it.F_BatchNumber;
3724
                                 if (!string.IsNullOrEmpty(it.F_QuestionType))
3732
                                 if (!string.IsNullOrEmpty(it.F_QuestionType))
3731
                                         {
3739
                                         {
3732
                                             if (type == 5)
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
                                             else
3752
                                             else
3737
                                             {
3753
                                             {
3767
                                 List<T_Wo_MaterialItems> materlist = new BLL.T_Wo_MaterialItems().GetModelList($" F_WoID={it.F_ID}");
3783
                                 List<T_Wo_MaterialItems> materlist = new BLL.T_Wo_MaterialItems().GetModelList($" F_WoID={it.F_ID}");
3768
                                 if (materlist != null)
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
                                 //dt.Columns.Add("原料及厂家");
3791
                                 //dt.Columns.Add("原料及厂家");
3774
                                 //dt.Columns.Add("车牌号");
3792
                                 //dt.Columns.Add("车牌号");
3775
                                 //dt.Columns.Add("返账金额");
3793
                                 //dt.Columns.Add("返账金额");
3908
                             drNew["客户电话"] = it.F_CusPhone;//
3926
                             drNew["客户电话"] = it.F_CusPhone;//
3909
                             drNew["问题描述"] = it.F_Description;//
3927
                             drNew["问题描述"] = it.F_Description;//
3910
                             drNew["创建时间"] = it.F_CreateOn;
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
                             drNew["事发地-省"] = it.F_IncidentProvince;//
3935
                             drNew["事发地-省"] = it.F_IncidentProvince;//
3914
                             drNew["事发地-市"] = it.F_IncidentCity;//
3936
                             drNew["事发地-市"] = it.F_IncidentCity;//
3920
                             drNew["处理详情-内线"] = it.F_DealContent2;//处理内容
3942
                             drNew["处理详情-内线"] = it.F_DealContent2;//处理内容
3921
                             drNew["回访备注"] = it.F_VisitRemarks;//处理内容
3943
                             drNew["回访备注"] = it.F_VisitRemarks;//处理内容
3922
                             drNew["注解"] = it.F_Annotation;//处理内容
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
                             else
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
                             float aa = Math.Abs(it.F_limit-RemainingTime);
3973
                             float aa = Math.Abs(it.F_limit-RemainingTime);
3935
                             int days = (int)Math.Floor(Convert.ToDouble(aa / 24));
3974
                             int days = (int)Math.Floor(Convert.ToDouble(aa / 24));
3936
                             drNew["用时(天)"] = days+"天";
3975
                             drNew["用时(天)"] = days+"天";
3947
                             //}
3986
                             //}
3948
                             //#endregion
3987
                             //#endregion
3949
                             //drNew["超时原因"] = it.F_Reasontimeout;//处理内容it
3988
                             //drNew["超时原因"] = it.F_Reasontimeout;//处理内容it
3950
-                            int cropid = 0;
3989
+                            //int cropid = 0;
3951
                             if (int.TryParse(it.F_Crops.Trim(), out cropid))
3990
                             if (int.TryParse(it.F_Crops.Trim(), out cropid))
3952
                             {
3991
                             {
3953
                                 drNew["作物"] = new BLL.T_Sys_DictionaryValue().GetModel(cropid)?.F_Name ?? "";//作物
3992
                                 drNew["作物"] = new BLL.T_Sys_DictionaryValue().GetModel(cropid)?.F_Name ?? "";//作物
10252
                     else
10291
                     else
10253
                         model.F_Files = F_Files;
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
                 if (!string.IsNullOrEmpty(cont))
10295
                 if (!string.IsNullOrEmpty(cont))
10257
                 {
10296
                 {
10297
+                    string strconts1 = strcont + " " + cont + ";@# ";
10258
                     if (model.F_Source == "3")
10298
                     if (model.F_Source == "3")
10259
                     {
10299
                     {
10260
                         if (flag == 2)
10300
                         if (flag == 2)
10284
                         if (model.F_SuperiorOpinion.Trim() != cont.Trim())
10324
                         if (model.F_SuperiorOpinion.Trim() != cont.Trim())
10285
                         {
10325
                         {
10286
                             model.F_SuperiorOpinion = nowUser.F_UserName + "(" + nowUser.F_WorkNumber + ") " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " " + cont;
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
                     else if (flag == 2)
10330
                     else if (flag == 2)
10291
                         if (model.F_SuperiorOpinion2.Trim() != cont.Trim())
10332
                         if (model.F_SuperiorOpinion2.Trim() != cont.Trim())
10292
                         {
10333
                         {
10293
                             model.F_SuperiorOpinion2 = nowUser.F_UserName + "(" + nowUser.F_WorkNumber + ") " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " " + cont;
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
         private Model.T_Wo_WorkOrder InToworkModel(Model.T_Wo_WorkOrder model, WorkOrderNewInput input)
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
             if (!string.IsNullOrEmpty(input.F_SC_ProductBase))
10515
             if (!string.IsNullOrEmpty(input.F_SC_ProductBase))
10472
                 model.F_SC_ProductBase = input.F_SC_ProductBase;//市场管理科-生产基地(新乡、新疆、九江、东北、贴牌、无法确定)
10516
                 model.F_SC_ProductBase = input.F_SC_ProductBase;//市场管理科-生产基地(新乡、新疆、九江、东北、贴牌、无法确定)
10473
             if (!string.IsNullOrEmpty(input.F_SC_PreliminaryOpinion))
10517
             if (!string.IsNullOrEmpty(input.F_SC_PreliminaryOpinion))
10500
                 model.F_ZL_CResponsibleUnits = input.F_ZL_CResponsibleUnits;//质量管理科-对应责任单位(生产、研发、农化、物流、质量管理科,销售内勤)
10544
                 model.F_ZL_CResponsibleUnits = input.F_ZL_CResponsibleUnits;//质量管理科-对应责任单位(生产、研发、农化、物流、质量管理科,销售内勤)
10501
             if (!string.IsNullOrEmpty(input.F_ZL_Fquantity))
10545
             if (!string.IsNullOrEmpty(input.F_ZL_Fquantity))
10502
                 model.F_ZL_Fquantity = input.F_ZL_Fquantity;// 质量管理科-确认实收数量(吨)
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
             if (!string.IsNullOrEmpty(input.F_ZL_CApprovalNo))
10553
             if (!string.IsNullOrEmpty(input.F_ZL_CApprovalNo))
10506
                 model.F_ZL_CApprovalNo = input.F_ZL_CApprovalNo;//质量管理科-对应审批工作流单号
10554
                 model.F_ZL_CApprovalNo = input.F_ZL_CApprovalNo;//质量管理科-对应审批工作流单号
10507
             if (!string.IsNullOrEmpty(input.F_ZL_CJ_IsRecord))
10555
             if (!string.IsNullOrEmpty(input.F_ZL_CJ_IsRecord))
10530
                 model.F_UnLoadingFee = input.F_UnLoadingFee;
10578
                 model.F_UnLoadingFee = input.F_UnLoadingFee;
10531
             if (input.F_MaterialFee > 0) //返料费
10579
             if (input.F_MaterialFee > 0) //返料费
10532
                 model.F_MaterialFee = input.F_MaterialFee;
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
             if (!string.IsNullOrEmpty(input.F_DrivePhone))
10586
             if (!string.IsNullOrEmpty(input.F_DrivePhone))
10536
                 model.F_DrivePhone = input.F_DrivePhone;//电话号码
10587
                 model.F_DrivePhone = input.F_DrivePhone;//电话号码
10537
             if (!string.IsNullOrEmpty(input.F_WorkmanShip))
10588
             if (!string.IsNullOrEmpty(input.F_WorkmanShip))
11239
         /// <summary>
11290
         /// <summary>
11240
         /// 返厂数量
11291
         /// 返厂数量
11241
         /// </summary>
11292
         /// </summary>
11242
-        public int? returnum { get; set; }
11293
+        public decimal? returnum { get; set; }
11243
         /// <summary>
11294
         /// <summary>
11244
         /// 规格
11295
         /// 规格
11245
         /// </summary>
11296
         /// </summary>

+ 2 - 2
codegit/CallCenterApi/CallCenterApi.Model/T_Wo_MaterialItems.cs

19
         private decimal? _f_loadingfee;
19
         private decimal? _f_loadingfee;
20
         private decimal? _f_unloadingfee;
20
         private decimal? _f_unloadingfee;
21
         private decimal? _f_materialfee;
21
         private decimal? _f_materialfee;
22
-        private int? _f_returnquantity = 0;
22
+        private decimal? _f_returnquantity = 0;
23
         private long _f_woid;
23
         private long _f_woid;
24
         private string _f_remark;
24
         private string _f_remark;
25
         private string _f_createby;
25
         private string _f_createby;
83
         /// <summary>
83
         /// <summary>
84
         /// 实收返厂数量
84
         /// 实收返厂数量
85
         /// </summary>
85
         /// </summary>
86
-        public int? F_ReturnQuantity
86
+        public decimal? F_ReturnQuantity
87
         {
87
         {
88
             set { _f_returnquantity = value; }
88
             set { _f_returnquantity = value; }
89
             get { return _f_returnquantity; }
89
             get { return _f_returnquantity; }

+ 2 - 2
codegit/CallCenterApi/CallCenterApi.Model/T_Wo_WorkOrder.cs

111
         private decimal? _f_unloadingfee;
111
         private decimal? _f_unloadingfee;
112
         private decimal? _f_materialfee;
112
         private decimal? _f_materialfee;
113
         private string _f_formula;
113
         private string _f_formula;
114
-        private int? _f_returnquantity;
114
+        private decimal? _f_returnquantity;
115
         private string _f_eventreason;
115
         private string _f_eventreason;
116
         private string _f_mailingnumber;
116
         private string _f_mailingnumber;
117
         private string _f_expressname;
117
         private string _f_expressname;
910
         /// <summary>
910
         /// <summary>
911
         /// 实收返厂数量
911
         /// 实收返厂数量
912
         /// </summary>
912
         /// </summary>
913
-        public int? F_ReturnQuantity
913
+        public decimal? F_ReturnQuantity
914
         {
914
         {
915
             set { _f_returnquantity = value; }
915
             set { _f_returnquantity = value; }
916
             get { return _f_returnquantity; }
916
             get { return _f_returnquantity; }