liyuanyuan 10 miesięcy temu
rodzic
commit
402bea0acf

+ 1 - 1
MadRunFabric.EquipmentApi/EquipmentApi.IRepositories/IWo_Repair_BaseRepository.cs

@@ -43,7 +43,7 @@ namespace EquipmentApi.IRepositories
43 43
         string replace, string systemid, string equipmentid, string usercode, string stime, string etime, string channel, string Jwocode, string Pwcode, int state,int score, int wxstate,
44 44
         string nowusercode, UserAccountInfoModel userinfo,
45 45
         //string nowrolecode,
46
-        int pageindex, int pagesize, out int recordcount,
46
+        int pageindex, int pagesize, int usehc, out int recordcount,
47 47
         out int totalcount, out int wzpcount, out int yjdcount, out int dpjcount, out int ygqcount, out int ywjcount, out int yqxcount);
48 48
         /// <summary>
49 49
         /// 获取返修工单信息

+ 24 - 12
MadRunFabric.EquipmentApi/EquipmentApi.Repositories/Wo_Repair_BaseRepository.cs

@@ -351,10 +351,10 @@ namespace EquipmentApi.Repositories
351 351
          string replace, string systemid, string equipmentid, string usercode, string stime, string etime, string channel, string Jwocode,string Pwcode, int state, int score, int wxstate,
352 352
          string nowusercode, UserAccountInfoModel userinfo,
353 353
          //string nowrolecode,
354
-         int pageindex, int pagesize, out int recordcount,
354
+         int pageindex, int pagesize,int usehc, out int recordcount,
355 355
          out int totalcount, out int wzpcount, out int yjdcount, out int dpjcount, out int ygqcount, out int ywjcount, out int yqxcount)
356 356
         {
357
-            if (userinfo.role_code == "HFB" || userinfo.role_code == "XTWH")
357
+            if (userinfo.role_code == "HFB" || userinfo.role_code == "XTWH" || userinfo.role_code == "ZZ")
358 358
             {
359 359
                 #region 护士长权限
360 360
                
@@ -440,8 +440,8 @@ namespace EquipmentApi.Repositories
440 440
                                 || it.touser.Contains(usercode)
441 441
                                 || it.dealuser.Contains(usercode)
442 442
                                 );
443
-                    if (!string.IsNullOrEmpty(Pwcode))
444
-                        query = query.Where(it => it.Pwcode == Pwcode);
443
+                     if (!string.IsNullOrEmpty(Pwcode))
444
+                        query = query.Where(it => it.Jwocode == Pwcode);
445 445
                     if (!string.IsNullOrEmpty(wocode))
446 446
                         query = query.Where(it => it.wocode.Contains(wocode));
447 447
                     if (!string.IsNullOrEmpty(province))
@@ -466,8 +466,12 @@ namespace EquipmentApi.Repositories
466 466
                         query = query.Where(it => it.channel == Convert.ToInt32(channel));
467 467
                     if (!string.IsNullOrEmpty(Jwocode))
468 468
                         query = query.Where(it => it.Jwocode == Jwocode);
469
-                    #region 时间搜索
470
-                    if (!string.IsNullOrEmpty(stime))
469
+                if (usehc > -1)
470
+                {
471
+                    query = query.Where(it => it.ismaterials == usehc);
472
+                }
473
+                #region 时间搜索
474
+                if (!string.IsNullOrEmpty(stime))
471 475
                         query = query.Where(it => it.createtime >= Convert.ToDateTime(stime + " 00:00:00"));
472 476
                     if (!string.IsNullOrEmpty(etime))
473 477
                         query = query.Where(it => it.createtime <= Convert.ToDateTime(etime + " 23:59:59"));
@@ -637,7 +641,7 @@ namespace EquipmentApi.Repositories
637 641
                             postlist = userinfolis.postlist,
638 642
                             repairbase.wxtimeid,
639 643
                             repairbase.wxdemodes,
640
-                            repairbase.wxtimecenter,
644
+                            repairbase.wxtimecenter,                           
641 645
                             wxtimecentername = wxtimelisDefa.Count() > 0 ? wxtimelisDefa.First().wxcenter : "",//维修时效信息
642 646
                             wxtimeleths = wxtimelisDefa.Count() > 0 ? wxtimelisDefa.First().timecount : 0,//维修时长
643 647
                     };
@@ -653,7 +657,7 @@ namespace EquipmentApi.Repositories
653 657
                                 || it.dealuser.Contains(usercode)
654 658
                                 );
655 659
                     if (!string.IsNullOrEmpty(Pwcode))
656
-                        query = query.Where(it => it.Pwcode == Pwcode);
660
+                        query = query.Where(it => it.Jwocode == Pwcode);
657 661
                     if (!string.IsNullOrEmpty(province))
658 662
                         query = query.Where(it => it.provincecode == province);
659 663
                     if (!string.IsNullOrEmpty(city))
@@ -672,6 +676,10 @@ namespace EquipmentApi.Repositories
672 676
                         query = query.Where(it => it.equipmentid == equipmentid);
673 677
                     if (!string.IsNullOrEmpty(channel))
674 678
                         query = query.Where(it => it.channel == Convert.ToInt32(channel));
679
+
680
+                    if (usehc > -1) {
681
+                        query = query.Where(it => it.ismaterials == usehc);
682
+                    }
675 683
                     #region 时间搜索
676 684
                     if (!string.IsNullOrEmpty(stime))
677 685
                         query = query.Where(it => it.createtime >= Convert.ToDateTime(stime + " 00:00:00"));
@@ -888,7 +896,7 @@ namespace EquipmentApi.Repositories
888 896
                             || it.dealuser.Contains(usercode)
889 897
                             );
890 898
                     if (!string.IsNullOrEmpty(Pwcode))
891
-                        query = query.Where(it => it.Pwcode == Pwcode);
899
+                        query = query.Where(it => it.Jwocode == Pwcode);
892 900
                     if (!string.IsNullOrEmpty(wocode))
893 901
                     query = query.Where(it => it.wocode.Contains(wocode));
894 902
                 if (!string.IsNullOrEmpty(province))
@@ -913,8 +921,12 @@ namespace EquipmentApi.Repositories
913 921
                     query = query.Where(it => it.channel == Convert.ToInt32(channel));
914 922
                 if (!string.IsNullOrEmpty(Jwocode))
915 923
                     query = query.Where(it => it.Jwocode == Jwocode);
916
-                #region 时间搜索
917
-                if (!string.IsNullOrEmpty(stime))
924
+                    if (usehc > -1)
925
+                    {
926
+                        query = query.Where(it => it.ismaterials == usehc);
927
+                    }
928
+                    #region 时间搜索
929
+                    if (!string.IsNullOrEmpty(stime))
918 930
                     query = query.Where(it => it.createtime >= Convert.ToDateTime(stime + " 00:00:00"));
919 931
                 if (!string.IsNullOrEmpty(etime))
920 932
                     query = query.Where(it => it.createtime <= Convert.ToDateTime(etime + " 23:59:59"));
@@ -947,7 +959,7 @@ namespace EquipmentApi.Repositories
947 959
                 }
948 960
                 if (userinfo.role_name.Contains("班") || userinfo.role_name == "默认角色")
949 961
                 {
950
-
962
+ 
951 963
                    
952 964
                         wzpcount = query.Count(p => p.wostate == (int)EnumWorkOrderState.create && (p.createusername == userinfo.username  || p.repairman == userinfo.username || p.repairman.Contains(userinfo.usercode)));//|| p.tousername[0] == userinfo.username
953 965
                         yjdcount = query.Count(p => p.wostate == (int)EnumWorkOrderState.assign && (p.createusername == userinfo.username || p.repairman == userinfo.username || p.repairman.Contains(userinfo.usercode)));//|| p.tousername[0] == userinfo.username 

+ 11 - 11
MadRunFabric.EquipmentApi/EquipmentApi/Controllers/workordermanage/WoRepairBaseController.cs

@@ -90,9 +90,9 @@ namespace EquipmentApi.Controllers.workordermanage
90 90
             _ISys_Role_InfoRepository = Sys_Role_InfoRepository;
91 91
             _IusercoldandclintidsRepository = usercoldandclintidsRepository;
92 92
             _wxwpstimeRepository = wxwpstimeRepository;
93
-            _Imate_dict_viewRepository = mate_dict_viewRepository; 
93
+            _Imate_dict_viewRepository = mate_dict_viewRepository;
94 94
         }
95
-        
95
+
96 96
         #region 工单分页获取接口
97 97
 
98 98
         /// <summary>
@@ -181,7 +181,7 @@ namespace EquipmentApi.Controllers.workordermanage
181 181
         [HttpGet("getlistbypage")]
182 182
         public IActionResult GetListByPageAsync(string phone, string wocode, string province, string city, string protypeid, string projectid,
183 183
             string buildid, string floorid, string replace, string systemid, string equipmentid, string usercode, string stime, string etime, string channel, string Jwocode, string Pwcode, int score,
184
-            int datetype = -1, int state = -1, int wxstate = -1, int pageindex = 1, int pagesize = 10)
184
+            int datetype = -1, int state = -1, int wxstate = -1, int pageindex = 1, int pagesize = 10,int usehc=-1)
185 185
         {
186 186
             string nowusercode =User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Sid).Value;//"8000";// "8000";//
187 187
             //var userstr = _signTokenService.GetUserInfoAsync(nowusercode).Result;
@@ -206,7 +206,7 @@ namespace EquipmentApi.Controllers.workordermanage
206 206
             int ywjcount = 0;
207 207
             int yqxcount = 0;
208 208
             var result = _wo_repair_baseRepository.GetListsByPageglhsz(phone, wocode, province, city, projectid, protypeid, buildid, floorid, replace,
209
-                systemid, equipmentid, usercode, stime, etime, channel, Jwocode,  Pwcode, state, score, wxstate, nowusercode, userinfo, pageindex, pagesize,
209
+                systemid, equipmentid, usercode, stime, etime, channel, Jwocode,  Pwcode, state, score, wxstate, nowusercode, userinfo, pageindex, pagesize, usehc,
210 210
                 out recordCount, out totalcount, out wzpcount, out yjdcount, out dpjcount, out ygqcount, out ywjcount, out yqxcount);
211 211
             
212 212
             List<Wo_Repair_Base> lists = new List<Wo_Repair_Base>();
@@ -6884,7 +6884,7 @@ namespace EquipmentApi.Controllers.workordermanage
6884 6884
             }
6885 6885
             if (string.IsNullOrWhiteSpace(input.repairreplace))
6886 6886
             {
6887
-                return Error("请选择修地点");
6887
+                return Error("请选择修地点");
6888 6888
             }
6889 6889
             if (string.IsNullOrWhiteSpace(input.repairman))
6890 6890
             {
@@ -7831,7 +7831,7 @@ namespace EquipmentApi.Controllers.workordermanage
7831 7831
                         modelmap.wocode = clmodel.wocode;
7832 7832
                         modelmap.wostate = clmodel.wostate;
7833 7833
                         modelmap.readby = assignman;
7834
-                        modelmap.channelcode = 1;   //工单类型(枚举EnumOrderState) 维修工单 = 1, 保养工单 = 2, 运行工单 = 3, 超时工单 = 4
7834
+                        modelmap.channelcode = 11;   //工单类型(枚举EnumOrderState) 维修工单 = 1, 保养工单 = 2, 运行工单 = 3, 超时工单 = 4
7835 7835
                         modelmap.isread = 0;
7836 7836
                         modelmap.isnotice = 0;
7837 7837
                         modelmap.readtime = DateTime.Now;
@@ -12335,7 +12335,7 @@ namespace EquipmentApi.Controllers.workordermanage
12335 12335
         public async Task<IActionResult> GetBxMessageList(int isread)
12336 12336
         {
12337 12337
             string nowusercode = User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Sid).Value;
12338
-            var listmap = await _wo_order_user_maprepository.Get(x => x.channelcode == 1 && x.readby == nowusercode);
12338
+            var listmap = await _wo_order_user_maprepository.Get(x => x.channelcode == 11 && x.readby == nowusercode);
12339 12339
 
12340 12340
             var list = new List<MessageListDto>();
12341 12341
             if (isread == 0)
@@ -12347,7 +12347,7 @@ namespace EquipmentApi.Controllers.workordermanage
12347 12347
                     {
12348 12348
                         id = item.id,
12349 12349
                         woid = item.woid,
12350
-                        channelcode = 1,
12350
+                        channelcode = 11,
12351 12351
                         wotype = 1,
12352 12352
                         wocode = item.wocode,
12353 12353
                         proname = "维修工单:" + item.wocode, // + " " + item.proname,
@@ -12371,8 +12371,8 @@ namespace EquipmentApi.Controllers.workordermanage
12371 12371
                     list.Add(new MessageListDto
12372 12372
                     {
12373 12373
                         id = item.id,
12374
-                        woid = item.id,
12375
-                        channelcode = 1,
12374
+                        woid = item.woid,
12375
+                        channelcode = 11,
12376 12376
                         wotype = 1,
12377 12377
                         wocode = item.wocode,
12378 12378
                         proname = "维修工单:" + item.wocode, // + " " + item.proname,
@@ -12406,7 +12406,7 @@ namespace EquipmentApi.Controllers.workordermanage
12406 12406
 
12407 12407
             string nowusercode = User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Sid).Value;
12408 12408
             //  string nowusercode="1003";
12409
-            var listmap = await _wo_order_user_maprepository.Get(x => x.channelcode == 1 && x.readby == nowusercode && x.id == id);
12409
+            var listmap = await _wo_order_user_maprepository.Get(x => x.channelcode ==11 && x.readby == nowusercode && x.id == id);
12410 12410
             if (listmap != null)
12411 12411
             {
12412 12412
                 var modelmap = listmap.FirstOrDefault();