liyuanyuan 10 ay önce
ebeveyn
işleme
402bea0acf

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

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,
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
         string nowusercode, UserAccountInfoModel userinfo,
44
         string nowusercode, UserAccountInfoModel userinfo,
45
         //string nowrolecode,
45
         //string nowrolecode,
46
-        int pageindex, int pagesize, out int recordcount,
46
+        int pageindex, int pagesize, int usehc, out int recordcount,
47
         out int totalcount, out int wzpcount, out int yjdcount, out int dpjcount, out int ygqcount, out int ywjcount, out int yqxcount);
47
         out int totalcount, out int wzpcount, out int yjdcount, out int dpjcount, out int ygqcount, out int ywjcount, out int yqxcount);
48
         /// <summary>
48
         /// <summary>
49
         /// 获取返修工单信息
49
         /// 获取返修工单信息

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

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,
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
          string nowusercode, UserAccountInfoModel userinfo,
352
          string nowusercode, UserAccountInfoModel userinfo,
353
          //string nowrolecode,
353
          //string nowrolecode,
354
-         int pageindex, int pagesize, out int recordcount,
354
+         int pageindex, int pagesize,int usehc, out int recordcount,
355
          out int totalcount, out int wzpcount, out int yjdcount, out int dpjcount, out int ygqcount, out int ywjcount, out int yqxcount)
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
                 #region 护士长权限
359
                 #region 护士长权限
360
                
360
                
440
                                 || it.touser.Contains(usercode)
440
                                 || it.touser.Contains(usercode)
441
                                 || it.dealuser.Contains(usercode)
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
                     if (!string.IsNullOrEmpty(wocode))
445
                     if (!string.IsNullOrEmpty(wocode))
446
                         query = query.Where(it => it.wocode.Contains(wocode));
446
                         query = query.Where(it => it.wocode.Contains(wocode));
447
                     if (!string.IsNullOrEmpty(province))
447
                     if (!string.IsNullOrEmpty(province))
466
                         query = query.Where(it => it.channel == Convert.ToInt32(channel));
466
                         query = query.Where(it => it.channel == Convert.ToInt32(channel));
467
                     if (!string.IsNullOrEmpty(Jwocode))
467
                     if (!string.IsNullOrEmpty(Jwocode))
468
                         query = query.Where(it => it.Jwocode == Jwocode);
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
                         query = query.Where(it => it.createtime >= Convert.ToDateTime(stime + " 00:00:00"));
475
                         query = query.Where(it => it.createtime >= Convert.ToDateTime(stime + " 00:00:00"));
472
                     if (!string.IsNullOrEmpty(etime))
476
                     if (!string.IsNullOrEmpty(etime))
473
                         query = query.Where(it => it.createtime <= Convert.ToDateTime(etime + " 23:59:59"));
477
                         query = query.Where(it => it.createtime <= Convert.ToDateTime(etime + " 23:59:59"));
637
                             postlist = userinfolis.postlist,
641
                             postlist = userinfolis.postlist,
638
                             repairbase.wxtimeid,
642
                             repairbase.wxtimeid,
639
                             repairbase.wxdemodes,
643
                             repairbase.wxdemodes,
640
-                            repairbase.wxtimecenter,
644
+                            repairbase.wxtimecenter,                           
641
                             wxtimecentername = wxtimelisDefa.Count() > 0 ? wxtimelisDefa.First().wxcenter : "",//维修时效信息
645
                             wxtimecentername = wxtimelisDefa.Count() > 0 ? wxtimelisDefa.First().wxcenter : "",//维修时效信息
642
                             wxtimeleths = wxtimelisDefa.Count() > 0 ? wxtimelisDefa.First().timecount : 0,//维修时长
646
                             wxtimeleths = wxtimelisDefa.Count() > 0 ? wxtimelisDefa.First().timecount : 0,//维修时长
643
                     };
647
                     };
653
                                 || it.dealuser.Contains(usercode)
657
                                 || it.dealuser.Contains(usercode)
654
                                 );
658
                                 );
655
                     if (!string.IsNullOrEmpty(Pwcode))
659
                     if (!string.IsNullOrEmpty(Pwcode))
656
-                        query = query.Where(it => it.Pwcode == Pwcode);
660
+                        query = query.Where(it => it.Jwocode == Pwcode);
657
                     if (!string.IsNullOrEmpty(province))
661
                     if (!string.IsNullOrEmpty(province))
658
                         query = query.Where(it => it.provincecode == province);
662
                         query = query.Where(it => it.provincecode == province);
659
                     if (!string.IsNullOrEmpty(city))
663
                     if (!string.IsNullOrEmpty(city))
672
                         query = query.Where(it => it.equipmentid == equipmentid);
676
                         query = query.Where(it => it.equipmentid == equipmentid);
673
                     if (!string.IsNullOrEmpty(channel))
677
                     if (!string.IsNullOrEmpty(channel))
674
                         query = query.Where(it => it.channel == Convert.ToInt32(channel));
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
                     #region 时间搜索
683
                     #region 时间搜索
676
                     if (!string.IsNullOrEmpty(stime))
684
                     if (!string.IsNullOrEmpty(stime))
677
                         query = query.Where(it => it.createtime >= Convert.ToDateTime(stime + " 00:00:00"));
685
                         query = query.Where(it => it.createtime >= Convert.ToDateTime(stime + " 00:00:00"));
888
                             || it.dealuser.Contains(usercode)
896
                             || it.dealuser.Contains(usercode)
889
                             );
897
                             );
890
                     if (!string.IsNullOrEmpty(Pwcode))
898
                     if (!string.IsNullOrEmpty(Pwcode))
891
-                        query = query.Where(it => it.Pwcode == Pwcode);
899
+                        query = query.Where(it => it.Jwocode == Pwcode);
892
                     if (!string.IsNullOrEmpty(wocode))
900
                     if (!string.IsNullOrEmpty(wocode))
893
                     query = query.Where(it => it.wocode.Contains(wocode));
901
                     query = query.Where(it => it.wocode.Contains(wocode));
894
                 if (!string.IsNullOrEmpty(province))
902
                 if (!string.IsNullOrEmpty(province))
913
                     query = query.Where(it => it.channel == Convert.ToInt32(channel));
921
                     query = query.Where(it => it.channel == Convert.ToInt32(channel));
914
                 if (!string.IsNullOrEmpty(Jwocode))
922
                 if (!string.IsNullOrEmpty(Jwocode))
915
                     query = query.Where(it => it.Jwocode == Jwocode);
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
                     query = query.Where(it => it.createtime >= Convert.ToDateTime(stime + " 00:00:00"));
930
                     query = query.Where(it => it.createtime >= Convert.ToDateTime(stime + " 00:00:00"));
919
                 if (!string.IsNullOrEmpty(etime))
931
                 if (!string.IsNullOrEmpty(etime))
920
                     query = query.Where(it => it.createtime <= Convert.ToDateTime(etime + " 23:59:59"));
932
                     query = query.Where(it => it.createtime <= Convert.ToDateTime(etime + " 23:59:59"));
947
                 }
959
                 }
948
                 if (userinfo.role_name.Contains("班") || userinfo.role_name == "默认角色")
960
                 if (userinfo.role_name.Contains("班") || userinfo.role_name == "默认角色")
949
                 {
961
                 {
950
-
962
+ 
951
                    
963
                    
952
                         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
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
                         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 
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
             _ISys_Role_InfoRepository = Sys_Role_InfoRepository;
90
             _ISys_Role_InfoRepository = Sys_Role_InfoRepository;
91
             _IusercoldandclintidsRepository = usercoldandclintidsRepository;
91
             _IusercoldandclintidsRepository = usercoldandclintidsRepository;
92
             _wxwpstimeRepository = wxwpstimeRepository;
92
             _wxwpstimeRepository = wxwpstimeRepository;
93
-            _Imate_dict_viewRepository = mate_dict_viewRepository; 
93
+            _Imate_dict_viewRepository = mate_dict_viewRepository;
94
         }
94
         }
95
-        
95
+
96
         #region 工单分页获取接口
96
         #region 工单分页获取接口
97
 
97
 
98
         /// <summary>
98
         /// <summary>
181
         [HttpGet("getlistbypage")]
181
         [HttpGet("getlistbypage")]
182
         public IActionResult GetListByPageAsync(string phone, string wocode, string province, string city, string protypeid, string projectid,
182
         public IActionResult GetListByPageAsync(string phone, string wocode, string province, string city, string protypeid, string projectid,
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,
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
             string nowusercode =User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Sid).Value;//"8000";// "8000";//
186
             string nowusercode =User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Sid).Value;//"8000";// "8000";//
187
             //var userstr = _signTokenService.GetUserInfoAsync(nowusercode).Result;
187
             //var userstr = _signTokenService.GetUserInfoAsync(nowusercode).Result;
206
             int ywjcount = 0;
206
             int ywjcount = 0;
207
             int yqxcount = 0;
207
             int yqxcount = 0;
208
             var result = _wo_repair_baseRepository.GetListsByPageglhsz(phone, wocode, province, city, projectid, protypeid, buildid, floorid, replace,
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
                 out recordCount, out totalcount, out wzpcount, out yjdcount, out dpjcount, out ygqcount, out ywjcount, out yqxcount);
210
                 out recordCount, out totalcount, out wzpcount, out yjdcount, out dpjcount, out ygqcount, out ywjcount, out yqxcount);
211
             
211
             
212
             List<Wo_Repair_Base> lists = new List<Wo_Repair_Base>();
212
             List<Wo_Repair_Base> lists = new List<Wo_Repair_Base>();
6884
             }
6884
             }
6885
             if (string.IsNullOrWhiteSpace(input.repairreplace))
6885
             if (string.IsNullOrWhiteSpace(input.repairreplace))
6886
             {
6886
             {
6887
-                return Error("请选择修地点");
6887
+                return Error("请选择修地点");
6888
             }
6888
             }
6889
             if (string.IsNullOrWhiteSpace(input.repairman))
6889
             if (string.IsNullOrWhiteSpace(input.repairman))
6890
             {
6890
             {
7831
                         modelmap.wocode = clmodel.wocode;
7831
                         modelmap.wocode = clmodel.wocode;
7832
                         modelmap.wostate = clmodel.wostate;
7832
                         modelmap.wostate = clmodel.wostate;
7833
                         modelmap.readby = assignman;
7833
                         modelmap.readby = assignman;
7834
-                        modelmap.channelcode = 1;   //工单类型(枚举EnumOrderState) 维修工单 = 1, 保养工单 = 2, 运行工单 = 3, 超时工单 = 4
7834
+                        modelmap.channelcode = 11;   //工单类型(枚举EnumOrderState) 维修工单 = 1, 保养工单 = 2, 运行工单 = 3, 超时工单 = 4
7835
                         modelmap.isread = 0;
7835
                         modelmap.isread = 0;
7836
                         modelmap.isnotice = 0;
7836
                         modelmap.isnotice = 0;
7837
                         modelmap.readtime = DateTime.Now;
7837
                         modelmap.readtime = DateTime.Now;
12335
         public async Task<IActionResult> GetBxMessageList(int isread)
12335
         public async Task<IActionResult> GetBxMessageList(int isread)
12336
         {
12336
         {
12337
             string nowusercode = User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Sid).Value;
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
             var list = new List<MessageListDto>();
12340
             var list = new List<MessageListDto>();
12341
             if (isread == 0)
12341
             if (isread == 0)
12347
                     {
12347
                     {
12348
                         id = item.id,
12348
                         id = item.id,
12349
                         woid = item.woid,
12349
                         woid = item.woid,
12350
-                        channelcode = 1,
12350
+                        channelcode = 11,
12351
                         wotype = 1,
12351
                         wotype = 1,
12352
                         wocode = item.wocode,
12352
                         wocode = item.wocode,
12353
                         proname = "维修工单:" + item.wocode, // + " " + item.proname,
12353
                         proname = "维修工单:" + item.wocode, // + " " + item.proname,
12371
                     list.Add(new MessageListDto
12371
                     list.Add(new MessageListDto
12372
                     {
12372
                     {
12373
                         id = item.id,
12373
                         id = item.id,
12374
-                        woid = item.id,
12375
-                        channelcode = 1,
12374
+                        woid = item.woid,
12375
+                        channelcode = 11,
12376
                         wotype = 1,
12376
                         wotype = 1,
12377
                         wocode = item.wocode,
12377
                         wocode = item.wocode,
12378
                         proname = "维修工单:" + item.wocode, // + " " + item.proname,
12378
                         proname = "维修工单:" + item.wocode, // + " " + item.proname,
12406
 
12406
 
12407
             string nowusercode = User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Sid).Value;
12407
             string nowusercode = User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Sid).Value;
12408
             //  string nowusercode="1003";
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
             if (listmap != null)
12410
             if (listmap != null)
12411
             {
12411
             {
12412
                 var modelmap = listmap.FirstOrDefault();
12412
                 var modelmap = listmap.FirstOrDefault();