Browse Source

增加抽检,定时推送,删除权限,工单导出,工单筛选

duhongyu 5 years ago
parent
commit
7266987105

File diff suppressed because it is too large
+ 69 - 12
codegit/CallCenterApi/CallCenterApi.DAL/T_Bus_WorkOrder.cs


File diff suppressed because it is too large
+ 43 - 2
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/PushMessageController.cs


+ 17 - 2
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/UserAccountController.cs

@@ -875,7 +875,14 @@ namespace CallCenterApi.Interface.Controllers
875 875
             if (userModel != null)
876 876
                 pId = userModel.F_DeptId;
877 877
             var uModel = new BLL.T_Sys_UserAccount().GetModel(int.Parse(ids[0]));
878
-
878
+            if (uModel !=null )
879
+            {
880
+                var book = new BLL.T_Cus_AddressBook().GetModelList("F_Name='" + uModel.F_UserName + "'and F_Mobile='" + uModel.F_Mobile + "'").FirstOrDefault(); ;
881
+                if (book != null)
882
+                {
883
+                    bool n = new BLL.T_Cus_AddressBook().Delete(book.F_UserId);
884
+                }
885
+            }
879 886
             if (pId == 2 || pId == 421)
880 887
             {
881 888
                 if (uModel != null)
@@ -883,6 +890,7 @@ namespace CallCenterApi.Interface.Controllers
883 890
                     Model.T_Sys_RoleInfo ro = rolebll.GetModel(uModel.F_RoleId);
884 891
                     if (ro.F_RoleCode != "ZG" && ro.F_RoleCode != "YWY")
885 892
                         return Error("无删除此人员权限");
893
+                    
886 894
                 }
887 895
             }
888 896
             SysConfigController sys = new SysConfigController();
@@ -921,7 +929,14 @@ namespace CallCenterApi.Interface.Controllers
921 929
                 if (userModel != null)
922 930
                     pId = userModel.F_DeptId;
923 931
                 var uModel = new BLL.T_Sys_UserAccount().GetModel(int .Parse (ids[0]));
924
-
932
+                if (uModel != null)
933
+                {
934
+                    var book = new BLL.T_Cus_AddressBook().GetModelList("F_Name='" + uModel.F_UserName + "'and F_Mobile='" + uModel.F_Mobile + "'").FirstOrDefault(); ;
935
+                    if (book != null)
936
+                    {
937
+                        bool n = new BLL.T_Cus_AddressBook().Delete(book.F_UserId);
938
+                    }
939
+                }
925 940
                 if (pId == 2 || pId == 421)
926 941
                 {
927 942
                     if (uModel != null)

File diff suppressed because it is too large
+ 407 - 179
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs


File diff suppressed because it is too large
+ 359 - 199
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkorderAppController.cs


+ 42 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Input/WorkOrderInput.cs

@@ -331,5 +331,47 @@ namespace CallCenterApi.Interface.Models.Input
331 331
         {
332 332
             get; set;
333 333
         }
334
+        /// <summary>
335
+        /// 涉及工厂
336
+        /// </summary>
337
+        public string F_Factories
338
+        {
339
+            get; set;
340
+        }
341
+        /// <summary>
342
+        /// 抽检产品
343
+        /// </summary>
344
+        public string F_Samplingproducts
345
+        {
346
+            get; set;
347
+        }
348
+        /// <summary>
349
+        /// 抽样客户/门店
350
+        /// </summary>
351
+        public string F_Salesroom
352
+        {
353
+            get; set;
354
+        }
355
+        /// <summary>
356
+        /// 抽检类型
357
+        /// </summary>
358
+        public string F_Samplingtype
359
+        {
360
+            get; set;
361
+        }
362
+        /// <summary>
363
+        /// 抽检单位
364
+        /// </summary>
365
+        public string F_Company
366
+        {
367
+            get; set;
368
+        }
369
+        /// <summary>
370
+        /// 生产时间
371
+        /// </summary>
372
+        public string F_Productiontime
373
+        {
374
+            get; set;
375
+        }
334 376
     }
335 377
 }

+ 54 - 0
codegit/CallCenterApi/CallCenterApi.Model/T_Bus_WorkOrder.cs

@@ -61,6 +61,60 @@ namespace CallCenterApi.Model
61 61
         private string _f_reason;
62 62
         private int _f_isreduction;
63 63
         private string _f_remissionremarks;
64
+        private string _f_productiontime;
65
+        private string _f_company;
66
+        private string _f_samplingtype;
67
+        private string _f_salesroom;
68
+        private string _f_samplingproducts;
69
+        private string _f_factories;
70
+        /// <summary>
71
+        /// 涉及工厂
72
+        /// </summary>
73
+        public string F_Factories
74
+        {
75
+            set { _f_factories = value; }
76
+            get { return _f_factories; }
77
+        }
78
+        /// <summary>
79
+        /// 抽检产品
80
+        /// </summary>
81
+        public string F_Samplingproducts
82
+        {
83
+            set { _f_samplingproducts = value; }
84
+            get { return _f_samplingproducts; }
85
+        }
86
+        /// <summary>
87
+        /// 抽样客户/门店
88
+        /// </summary>
89
+        public string F_Salesroom
90
+        {
91
+            set { _f_salesroom = value; }
92
+            get { return _f_salesroom; }
93
+        }
94
+        /// <summary>
95
+        /// 抽检类型
96
+        /// </summary>
97
+        public string F_Samplingtype
98
+        {
99
+            set { _f_samplingtype = value; }
100
+            get { return _f_samplingtype; }
101
+        }
102
+        /// <summary>
103
+        /// 抽检单位
104
+        /// </summary>
105
+        public string F_Company
106
+        {
107
+            set { _f_company = value; }
108
+            get { return _f_company; }
109
+        }
110
+        /// <summary>
111
+        /// 生产时间
112
+        /// </summary>
113
+        public string F_Productiontime
114
+        {
115
+            set { _f_productiontime = value; }
116
+            get { return _f_productiontime; }
117
+        }
64 118
         /// <summary>
65 119
         /// 减免备注
66 120
         /// </summary>

+ 132 - 6
codegit/PushMessage/Program.cs

@@ -1,32 +1,82 @@
1
-using System;
1
+
2
+using Newtonsoft.Json;
3
+using System;
2 4
 using System.Collections.Generic;
5
+using System.IO;
3 6
 using System.Linq;
4 7
 using System.Net;
5 8
 using System.Text;
6 9
 using System.Threading;
7 10
 using System.Threading.Tasks;
8 11
 
12
+
9 13
 namespace Push
10 14
 {
11 15
     class Program
12 16
     {
13 17
 
14
-
18
+        public  class  PushTime
19
+        {
20
+            public  DateTime time;
21
+            public  int morning;
22
+            public  int Afternoon;
23
+        }
24
+         private  PushTime time = new PushTime();
15 25
         static void Main(string[] args)
16 26
         {
17 27
             Console.OutputEncoding = System.Text.Encoding.UTF8;
18 28
             Environment.SetEnvironmentVariable("needDetails", "true");
19 29
             Console.OutputEncoding = System.Text.Encoding.UTF8;
20 30
             Environment.SetEnvironmentVariable("needDetails", "true");
21
-
31
+            
32
+            
22 33
             System.Console.WriteLine("Hello Push!");
23
-       
34
+            System.Console.WriteLine(DateTime.Now.ToString("HH"));
35
+            PushTime time = new PushTime();
36
+            time.time = DateTime.Now;
37
+            time.morning = 0;
38
+            time.Afternoon = 0;
39
+            Push(time);
24 40
             Thread t = new Thread(new ThreadStart(SetCensusURL));
25 41
             t.Start();
42
+          
43
+        }
44
+       
45
+       public static void Push(PushTime time)
46
+        {
47
+          
48
+         
49
+            FileStream fs = null;
50
+            try
51
+            {
52
+                if (!Directory.Exists("D:\\Push"))
53
+                {
54
+                    Directory.CreateDirectory("D:\\Push");
55
+                }
56
+                if ( File.Exists("D:\\Push\\PushMessage.txt"))
57
+                {
58
+                    System.Console.WriteLine(JsonConvert.SerializeObject(time));
59
+                    File.WriteAllText("D:\\Push\\PushMessage.txt", JsonConvert.SerializeObject(time), Encoding.UTF8);
60
+                }
61
+                else
62
+                {
63
+                    System.Console.WriteLine(JsonConvert.SerializeObject(time));
64
+                    File.WriteAllText("D:\\Push\\PushMessage.txt", JsonConvert.SerializeObject(time), Encoding.UTF8);
65
+                }
66
+            }
67
+            finally
68
+            {
69
+                if (fs != null)
70
+                {
71
+                    fs.Close();
72
+                }
73
+            }
26 74
 
27 75
         }
76
+        //http://oa.shuanghui.net
28 77
         private static void SetCensusURL()
29 78
         {
79
+           
30 80
             int n = 0;
31 81
             while (true)
32 82
             {
@@ -34,12 +84,88 @@ namespace Push
34 84
                 n += 1;
35 85
                 WebClient web = new WebClient();
36 86
                 web.Encoding = Encoding.UTF8;
87
+               
37 88
                 try
38 89
                 {
39
-                    string seturl = "http://oa.shuanghui.net:8046/PushMessage/SetCensusURL";
90
+                    string seturl = "http://oa.shuanghui.net/PushMessage/SetCensusURL";
40 91
                     string Dataaaurl = web.DownloadString(seturl);//这一句话就能请求到数据了
41
-                    string url = "http://oa.shuanghui.net:8046/PushMessage/SetPush";
92
+                    string url = "http://oa.shuanghui.net/PushMessage/SetPush";
42 93
                     string Dataaa = web.DownloadString(url);//这一句话就能请求到数据了
94
+                    Program program = new Program();
95
+                      if (DateTime.Now.ToString("HH") == "09")
96
+                        {
97
+                        string str1 = File.ReadAllText("D:\\Push\\PushMessage.txt");
98
+                        if (!string.IsNullOrEmpty(str1))
99
+                        {
100
+                            var obj = JsonConvert.DeserializeObject<PushTime>(str1);
101
+                            if (obj != null)
102
+                            {
103
+                                if (DateTime.Now.Day - obj.time .Day >0)
104
+                                {
105
+                                    program.time.time = DateTime.Now;
106
+                                    program.time.morning = 1;
107
+                                    program.time.Afternoon = 0;
108
+                                //    System.Console.WriteLine("aavaa" + program.time.morning);
109
+                                    Push(program.time);
110
+                                    string urla = "http://oa.shuanghui.net/PushMessage/PushMessagePush";
111
+                                    string Dataa = web.DownloadString(urla);//这一句话就能请求到数据了
112
+                                }
113
+                                else
114
+                                {
115
+                                    if (program.time.morning<=0)
116
+                                    {
117
+                                        program.time.time = DateTime.Now;
118
+                                        program.time.morning = 1;
119
+                                        program.time.Afternoon = obj.Afternoon ;
120
+                                    //    System.Console.WriteLine("aacaa" + program.time.morning);
121
+                                        Push(program.time);
122
+                                        string urla = "http://oa.shuanghui.net/PushMessage/PushMessagePush";
123
+                                        string Dataa = web.DownloadString(urla);//这一句话就能请求到数据了
124
+                                    }
125
+                                }
126
+                            }
127
+                        }
128
+                        }
129
+                        else if (DateTime.Now.ToString("HH") == "14")
130
+                        {
131
+                        string str1 = File.ReadAllText("D:\\Push\\PushMessage.txt");
132
+                      //  System.Console.WriteLine("nnvnn" + str1);
133
+                        if (!string.IsNullOrEmpty(str1))
134
+                        {
135
+                            var obj = JsonConvert.DeserializeObject<PushTime>(str1);
136
+                            if (obj != null)
137
+                            {
138
+                                if (DateTime.Now.Day - obj.time.Day > 0)
139
+                                {
140
+                                    program.time.time = DateTime.Now;
141
+                                    program.time.morning = obj .morning ;
142
+                                    program.time.Afternoon = 1;
143
+                                    Push(program.time);
144
+                                    //System.Console.WriteLine("nnvnn" + program.time.Afternoon);
145
+                                    string urla = "http://oa.shuanghui.net/PushMessage/PushMessagePush";
146
+                                    string Dataa = web.DownloadString(urla);//这一句话就能请求到数据了
147
+
148
+
149
+                                }
150
+                                else
151
+                                {
152
+                                    if (program.time.Afternoon <= 0)
153
+                                    {
154
+                                        program.time.time = DateTime.Now;
155
+                                        program.time.morning = obj.morning;
156
+                                        program.time.Afternoon = 1;
157
+                                        Push(program.time);
158
+                                      //  System.Console.WriteLine("nncnn" + program.time.Afternoon);
159
+                                        string urla = "http://oa.shuanghui.net/PushMessage/PushMessagePush";
160
+                                        string Dataa = web.DownloadString(urla);//这一句话就能请求到数据了
161
+                                    }
162
+                                }
163
+                            }
164
+                        }
165
+                       
166
+                     }
167
+                   
168
+                    
43 169
                 }
44 170
                 catch
45 171
                 {