|
|
@@ -424,6 +424,7 @@ namespace EquipmentApi.Repositories
|
|
424
|
424
|
repairbase.tobztimes,
|
|
425
|
425
|
repairbase.wxtimeid,
|
|
426
|
426
|
repairbase.wxdemodes,
|
|
|
427
|
+ repairbase.wxtimecenter,
|
|
427
|
428
|
wxtimecentername = wxtimelisDefa.Count() > 0 ? wxtimelisDefa.First().wxcenter : "",//维修时效信息
|
|
428
|
429
|
wxtimeleths = wxtimelisDefa.Count() > 0 ? wxtimelisDefa.First().timecount : 0,//维修时长
|
|
429
|
430
|
|
|
|
@@ -636,6 +637,7 @@ namespace EquipmentApi.Repositories
|
|
636
|
637
|
postlist = userinfolis.postlist,
|
|
637
|
638
|
repairbase.wxtimeid,
|
|
638
|
639
|
repairbase.wxdemodes,
|
|
|
640
|
+ repairbase.wxtimecenter,
|
|
639
|
641
|
wxtimecentername = wxtimelisDefa.Count() > 0 ? wxtimelisDefa.First().wxcenter : "",//维修时效信息
|
|
640
|
642
|
wxtimeleths = wxtimelisDefa.Count() > 0 ? wxtimelisDefa.First().timecount : 0,//维修时长
|
|
641
|
643
|
};
|
|
|
@@ -870,6 +872,7 @@ namespace EquipmentApi.Repositories
|
|
870
|
872
|
repairbase.tobztimes,
|
|
871
|
873
|
repairbase.wxtimeid,
|
|
872
|
874
|
repairbase.wxdemodes,
|
|
|
875
|
+ repairbase.wxtimecenter,
|
|
873
|
876
|
wxtimecentername = wxtimelisDefa.Count() > 0 ? wxtimelisDefa.First().wxcenter : "",//维修时效信息
|
|
874
|
877
|
wxtimeleths = wxtimelisDefa.Count() > 0 ? wxtimelisDefa.First().timecount : 0,//维修时长
|
|
875
|
878
|
};
|
|
|
@@ -1049,8 +1052,7 @@ namespace EquipmentApi.Repositories
|
|
1049
|
1052
|
string replace, string systemid, string equipmentid, string usercode, string stime, string etime, string channel, string Jwocode,string Pwcode, int state, int score, int wxstate,
|
|
1050
|
1053
|
string nowusercode, UserAccountInfoModel userinfo,
|
|
1051
|
1054
|
//string nowrolecode,
|
|
1052
|
|
- int pageindex, int pagesize, out int recordcount,
|
|
1053
|
|
- out int totalcount, out int wzpcount, out int yjdcount, out int dpjcount, out int ygqcount, out int ywjcount, out int yqxcount)
|
|
|
1055
|
+ int pageindex, int pagesize)
|
|
1054
|
1056
|
{
|
|
1055
|
1057
|
if (userinfo.role_code == "HFB" || userinfo.role_code == "XTWH")
|
|
1056
|
1058
|
{
|
|
|
@@ -1059,67 +1061,32 @@ namespace EquipmentApi.Repositories
|
|
1059
|
1061
|
var query =
|
|
1060
|
1062
|
from repairbase in _collection.AsQueryable()
|
|
1061
|
1063
|
join proje in _collection_pro_project_info.AsQueryable() on repairbase.projectid equals proje.id into projeDefa
|
|
1062
|
|
- join sysprovinces in _collection_sys_provinces.AsQueryable() on repairbase.province equals sysprovinces.provincecode into sys_provincesDefa
|
|
1063
|
|
- join syscity in _collection_sys_city.AsQueryable() on repairbase.city equals syscity.citycode into sys_cityDefa
|
|
1064
|
1064
|
join wxtimelis in _collection_ewxwpstime.AsQueryable() on repairbase.wxtimeid equals wxtimelis.id into wxtimelisDefa
|
|
1065
|
1065
|
where repairbase.isdelete == 0
|
|
1066
|
1066
|
orderby repairbase.createtime descending
|
|
1067
|
1067
|
select new
|
|
1068
|
1068
|
{
|
|
1069
|
|
- repairbase.id,
|
|
|
1069
|
+
|
|
|
1070
|
+ repairbase.wostate,
|
|
1070
|
1071
|
repairbase.wocode,
|
|
1071
|
|
- repairbase.projectid,
|
|
1072
|
|
- projectname = projeDefa.Count() > 0 ? projeDefa.First().project_name : null,
|
|
1073
|
|
- repairbase.protypeid,
|
|
1074
|
|
- //protypename = dic_protypeDefa.Count() > 0 ? dic_protypeDefa.First().name : null,
|
|
1075
|
|
- repairbase.faulttypeid,
|
|
1076
|
|
- //faulttypename = dic_faulttypeDefa.Count() > 0 ? dic_faulttypeDefa.First().name : null,
|
|
1077
|
|
- repairbase.systemid,
|
|
1078
|
|
- //systemname = dic_systemDefa.Count() > 0 ? dic_systemDefa.First().name : null,
|
|
1079
|
|
- repairbase.equipmentid,
|
|
1080
|
|
- //equipmentname = dic_equDefa.Count() > 0 ? dic_equDefa.First().equipment_name : null,
|
|
1081
|
1072
|
repairbase.channel,
|
|
1082
|
|
- provincecode = repairbase.province,
|
|
1083
|
|
- province = sys_provincesDefa.Count() > 0 ? sys_provincesDefa.First().provincename : null,
|
|
1084
|
|
- citycode = repairbase.city,
|
|
1085
|
|
- city = sys_cityDefa.Count() > 0 ? sys_cityDefa.First().cityname : null,
|
|
1086
|
|
- repairbase.buildid,
|
|
1087
|
|
- //buildname = bldDefa.Count() > 0 ? bldDefa.First().buildname : null,
|
|
1088
|
|
- repairbase.floorid,
|
|
1089
|
|
- //floorname = flrDefa.Count() > 0 ? flrDefa.First().floorname : null,
|
|
|
1073
|
+ projectname = projeDefa.Count() > 0 ? projeDefa.First().project_name : null,
|
|
1090
|
1074
|
repairbase.repairreplace,
|
|
1091
|
1075
|
repairbase.repairoom,
|
|
1092
|
1076
|
repairbase.repairtime,
|
|
1093
|
|
- repairbase.contactway,
|
|
1094
|
|
- repairbase.repairman,
|
|
1095
|
|
- repairbase.faultdescripe,
|
|
1096
|
|
- repairbase.faultpic,
|
|
1097
|
|
- repairbase.appointtime,
|
|
1098
|
|
- repairbase.wostate,
|
|
1099
|
1077
|
repairbase.createtime,
|
|
1100
|
|
- repairbase.createuser,
|
|
|
1078
|
+ repairbase.repairman,
|
|
1101
|
1079
|
repairbase.createusername,
|
|
1102
|
|
- repairbase.touser,
|
|
|
1080
|
+ repairbase.contactway,
|
|
|
1081
|
+ repairbase.faultdescripe,
|
|
|
1082
|
+ repairbase.Pwcode,
|
|
|
1083
|
+ repairbase.Jwocode,
|
|
|
1084
|
+ repairbase.tobztimes,
|
|
1103
|
1085
|
repairbase.tousername,
|
|
1104
|
1086
|
repairbase.totime,
|
|
1105
|
|
- repairbase.totype,
|
|
1106
|
|
- repairbase.dealuser,
|
|
1107
|
|
- repairbase.dealusername,
|
|
1108
|
1087
|
repairbase.dealtime,
|
|
1109
|
|
- repairbase.ismaterials,
|
|
1110
|
|
- repairbase.materials,
|
|
1111
|
|
- repairbase.islosematerials,
|
|
1112
|
|
- repairbase.losematerials,
|
|
1113
|
|
- repairbase.hanguptime,
|
|
1114
|
|
- repairbase.arrivetime,
|
|
1115
|
|
- repairbase.evaluatetime,
|
|
1116
|
|
- repairbase.canceltime,
|
|
1117
|
|
- repairbase.score,
|
|
1118
|
|
- repairbase.Jwocode,
|
|
1119
|
|
- repairbase.Pwcode,
|
|
1120
|
1088
|
repairbase.CLpeoplefrom,
|
|
1121
|
|
- repairbase.tobztimes,
|
|
1122
|
|
- repairbase.wxtimeid,
|
|
|
1089
|
+ repairbase.wxtimecenter,
|
|
1123
|
1090
|
wxtimeleths = wxtimelisDefa.Count() > 0 ? wxtimelisDefa.First().timecount : 0,//维修时长
|
|
1124
|
1091
|
};
|
|
1125
|
1092
|
#endregion
|
|
|
@@ -1130,33 +1097,14 @@ namespace EquipmentApi.Repositories
|
|
1130
|
1097
|
|| it.Jwocode.Contains(phone) || it.createusername.Contains(phone)
|
|
1131
|
1098
|
|| it.repairman.Contains(phone) || it.faultdescripe.Contains(phone)
|
|
1132
|
1099
|
|| it.CLpeoplefrom.Contains(phone)
|
|
1133
|
|
- || it.touser.Contains(usercode)
|
|
1134
|
|
- || it.dealuser.Contains(usercode)
|
|
1135
|
1100
|
);
|
|
1136
|
1101
|
if (!string.IsNullOrEmpty(Pwcode))
|
|
1137
|
1102
|
query = query.Where(it => it.Pwcode == Pwcode);
|
|
1138
|
1103
|
if (!string.IsNullOrEmpty(wocode))
|
|
1139
|
1104
|
query = query.Where(it => it.wocode.Contains(wocode));
|
|
1140
|
|
- if (!string.IsNullOrEmpty(province))
|
|
1141
|
|
- query = query.Where(it => it.provincecode == province);
|
|
1142
|
|
- if (!string.IsNullOrEmpty(city))
|
|
1143
|
|
- query = query.Where(it => it.citycode == city);
|
|
1144
|
|
- if (!string.IsNullOrEmpty(projectid))
|
|
1145
|
|
- query = query.Where(it => it.projectid == projectid);
|
|
1146
|
|
- if (!string.IsNullOrEmpty(protypeid))
|
|
1147
|
|
- query = query.Where(it => it.protypeid == protypeid);
|
|
1148
|
|
- if (!string.IsNullOrEmpty(buildid))
|
|
1149
|
|
- query = query.Where(it => it.buildid == buildid);
|
|
1150
|
|
- if (!string.IsNullOrEmpty(floorid))
|
|
1151
|
|
- query = query.Where(it => it.floorid == floorid);
|
|
|
1105
|
+
|
|
1152
|
1106
|
if (!string.IsNullOrEmpty(replace))
|
|
1153
|
1107
|
query = query.Where(it => it.repairreplace.Contains(replace) || it.repairoom.Contains(replace));
|
|
1154
|
|
- if (!string.IsNullOrEmpty(systemid))
|
|
1155
|
|
- query = query.Where(it => it.systemid == systemid);
|
|
1156
|
|
- if (!string.IsNullOrEmpty(equipmentid))
|
|
1157
|
|
- query = query.Where(it => it.equipmentid == equipmentid);
|
|
1158
|
|
- if (!string.IsNullOrEmpty(channel))
|
|
1159
|
|
- query = query.Where(it => it.channel == Convert.ToInt32(channel));
|
|
1160
|
1108
|
if (!string.IsNullOrEmpty(Jwocode))
|
|
1161
|
1109
|
query = query.Where(it => it.Jwocode == Jwocode);
|
|
1162
|
1110
|
#region 时间搜索
|
|
|
@@ -1164,41 +1112,7 @@ namespace EquipmentApi.Repositories
|
|
1164
|
1112
|
query = query.Where(it => it.createtime >= Convert.ToDateTime(stime + " 00:00:00"));
|
|
1165
|
1113
|
if (!string.IsNullOrEmpty(etime))
|
|
1166
|
1114
|
query = query.Where(it => it.createtime <= Convert.ToDateTime(etime + " 23:59:59"));
|
|
1167
|
|
- if (score != 0)
|
|
1168
|
|
- {
|
|
1169
|
|
- //等于1时获取分数为1和2的数据 不满意数据
|
|
1170
|
|
- if (score == 1)
|
|
1171
|
|
- {
|
|
1172
|
|
- query = query.Where(it => it.score == 1 || it.score == 2);
|
|
1173
|
|
- }
|
|
1174
|
|
- //获取基本满意数据
|
|
1175
|
|
- else if (score == 3)
|
|
1176
|
|
- {
|
|
1177
|
|
- query = query.Where(it => it.score == 3);
|
|
1178
|
|
- }
|
|
1179
|
|
- //获取4和5分数的数据 满意数据
|
|
1180
|
|
- else
|
|
1181
|
|
- {
|
|
1182
|
|
- query = query.Where(it => it.score == 4 || it.score == 5);
|
|
1183
|
|
- }
|
|
1184
|
|
- }
|
|
1185
|
|
-
|
|
1186
|
|
- if (userinfo.type == 2)//查看自己创建的工单
|
|
1187
|
|
- {
|
|
1188
|
|
- query = query.Where(it => it.createuser == userinfo.usercode);
|
|
1189
|
|
- }
|
|
1190
|
|
- else
|
|
1191
|
|
- {
|
|
1192
|
|
- if (!string.IsNullOrEmpty(usercode)) query = query.Where(it => (it.touser.Contains(usercode) || it.dealuser.Contains(usercode)));
|
|
1193
|
|
- }
|
|
1194
|
|
-
|
|
1195
|
|
- wzpcount = query.Count(p => p.wostate == (int)EnumWorkOrderState.create);
|
|
1196
|
|
- yjdcount = query.Count(p => p.wostate == (int)EnumWorkOrderState.assign);
|
|
1197
|
|
- dpjcount = query.Count(p => p.wostate == (int)EnumWorkOrderState.deal);
|
|
1198
|
|
- ygqcount = query.Count(p => p.wostate == (int)EnumWorkOrderState.hangup);
|
|
1199
|
|
- ywjcount = query.Count(p => p.wostate == (int)EnumWorkOrderState.evaluate);
|
|
1200
|
|
- yqxcount = query.Count(p => p.Pwcode != null && p.Pwcode != "");
|
|
1201
|
|
-
|
|
|
1115
|
+
|
|
1202
|
1116
|
|
|
1203
|
1117
|
if (state != -1)
|
|
1204
|
1118
|
{
|
|
|
@@ -1216,7 +1130,6 @@ namespace EquipmentApi.Repositories
|
|
1216
|
1130
|
case (int)EnumWorkOrderState.assign: query = query.OrderByDescending(p => p.totime); break;
|
|
1217
|
1131
|
case (int)EnumWorkOrderState.deal: query = query.OrderByDescending(p => p.dealtime); break;
|
|
1218
|
1132
|
//case (int)EnumWorkOrderState.evaluate: query = query.OrderBy(p => p.evaluatetime); break;
|
|
1219
|
|
- case (int)EnumWorkOrderState.hangup: query = query.OrderByDescending(p => p.hanguptime); break;
|
|
1220
|
1133
|
//case (int)EnumWorkOrderState.cancle: query = query.OrderBy(p => p.canceltime); break;
|
|
1221
|
1134
|
}
|
|
1222
|
1135
|
}
|
|
|
@@ -1236,15 +1149,11 @@ namespace EquipmentApi.Repositories
|
|
1236
|
1149
|
case (int)EnumWorkOrderState.assign: query = query.OrderByDescending(p => p.totime); break;
|
|
1237
|
1150
|
case (int)EnumWorkOrderState.deal: query = query.OrderByDescending(p => p.dealtime); break;
|
|
1238
|
1151
|
//case (int)EnumWorkOrderState.evaluate: query = query.OrderBy(p => p.evaluatetime); break;
|
|
1239
|
|
- case (int)EnumWorkOrderState.hangup: query = query.OrderByDescending(p => p.hanguptime); break;
|
|
1240
|
1152
|
//case (int)EnumWorkOrderState.cancle: query = query.OrderBy(p => p.canceltime); break;
|
|
1241
|
1153
|
}
|
|
1242
|
1154
|
}
|
|
1243
|
1155
|
#endregion
|
|
1244
|
1156
|
#endregion
|
|
1245
|
|
- recordcount = query.Count();
|
|
1246
|
|
- //总数
|
|
1247
|
|
- totalcount = query.Count();
|
|
1248
|
1157
|
var list1 = query.ToList();
|
|
1249
|
1158
|
return list1;
|
|
1250
|
1159
|
#endregion
|
|
|
@@ -1268,63 +1177,26 @@ namespace EquipmentApi.Repositories
|
|
1268
|
1177
|
orderby repairbase.createtime descending
|
|
1269
|
1178
|
select new
|
|
1270
|
1179
|
{
|
|
1271
|
|
- repairbase.id,
|
|
|
1180
|
+ repairbase.wostate,
|
|
1272
|
1181
|
repairbase.wocode,
|
|
1273
|
|
- repairbase.projectid,
|
|
1274
|
|
- projectname = projeDefa.Count() > 0 ? projeDefa.First().project_name : null,
|
|
1275
|
|
- repairbase.protypeid,
|
|
1276
|
|
- //protypename = dic_protypeDefa.Count() > 0 ? dic_protypeDefa.First().name : null,
|
|
1277
|
|
- repairbase.faulttypeid,
|
|
1278
|
|
- //faulttypename = dic_faulttypeDefa.Count() > 0 ? dic_faulttypeDefa.First().name : null,
|
|
1279
|
|
- repairbase.systemid,
|
|
1280
|
|
- //systemname = dic_systemDefa.Count() > 0 ? dic_systemDefa.First().name : null,
|
|
1281
|
|
- repairbase.equipmentid,
|
|
1282
|
|
- //equipmentname = dic_equDefa.Count() > 0 ? dic_equDefa.First().equipment_name : null,
|
|
1283
|
1182
|
repairbase.channel,
|
|
1284
|
|
- provincecode = repairbase.province,
|
|
1285
|
|
- province = sys_provincesDefa.Count() > 0 ? sys_provincesDefa.First().provincename : null,
|
|
1286
|
|
- citycode = repairbase.city,
|
|
1287
|
|
- city = sys_cityDefa.Count() > 0 ? sys_cityDefa.First().cityname : null,
|
|
1288
|
|
- repairbase.buildid,
|
|
1289
|
|
- //buildname = bldDefa.Count() > 0 ? bldDefa.First().buildname : null,
|
|
1290
|
|
- repairbase.floorid,
|
|
1291
|
|
- //floorname = flrDefa.Count() > 0 ? flrDefa.First().floorname : null,
|
|
|
1183
|
+ projectname = projeDefa.Count() > 0 ? projeDefa.First().project_name : null,
|
|
1292
|
1184
|
repairbase.repairreplace,
|
|
1293
|
1185
|
repairbase.repairoom,
|
|
1294
|
1186
|
repairbase.repairtime,
|
|
1295
|
|
- repairbase.contactway,
|
|
1296
|
|
- repairbase.repairman,
|
|
1297
|
|
- repairbase.faultdescripe,
|
|
1298
|
|
- repairbase.faultpic,
|
|
1299
|
|
- repairbase.appointtime,
|
|
1300
|
|
- repairbase.wostate,
|
|
1301
|
1187
|
repairbase.createtime,
|
|
1302
|
|
- repairbase.createuser,
|
|
|
1188
|
+ repairbase.repairman,
|
|
1303
|
1189
|
repairbase.createusername,
|
|
1304
|
|
- repairbase.touser,
|
|
|
1190
|
+ repairbase.contactway,
|
|
|
1191
|
+ repairbase.faultdescripe,
|
|
|
1192
|
+ repairbase.Pwcode,
|
|
|
1193
|
+ repairbase.Jwocode,
|
|
|
1194
|
+ repairbase.tobztimes,
|
|
1305
|
1195
|
repairbase.tousername,
|
|
1306
|
1196
|
repairbase.totime,
|
|
1307
|
|
- repairbase.totype,
|
|
1308
|
|
- repairbase.dealuser,
|
|
1309
|
|
- repairbase.dealusername,
|
|
1310
|
1197
|
repairbase.dealtime,
|
|
1311
|
|
- repairbase.ismaterials,
|
|
1312
|
|
- repairbase.materials,
|
|
1313
|
|
- repairbase.islosematerials,
|
|
1314
|
|
- repairbase.losematerials,
|
|
1315
|
|
- repairbase.hanguptime,
|
|
1316
|
|
- repairbase.arrivetime,
|
|
1317
|
|
- repairbase.evaluatetime,
|
|
1318
|
|
- repairbase.canceltime,
|
|
1319
|
|
- repairbase.score,
|
|
1320
|
|
- repairbase.Jwocode,
|
|
1321
|
|
- repairbase.Pwcode,
|
|
1322
|
1198
|
repairbase.CLpeoplefrom,
|
|
1323
|
|
- repairbase.tobztimes,
|
|
1324
|
|
- remark = userinfolis.remark,//备注护士长
|
|
1325
|
|
- temid = userinfolis.team_id,
|
|
1326
|
|
- postlist = userinfolis.postlist,
|
|
1327
|
|
- repairbase.wxtimeid,
|
|
|
1199
|
+ repairbase.wxtimecenter,
|
|
1328
|
1200
|
wxtimeleths = wxtimelisDefa.Count() > 0 ? wxtimelisDefa.First().timecount : 0,//维修时长
|
|
1329
|
1201
|
};
|
|
1330
|
1202
|
#endregion
|
|
|
@@ -1335,27 +1207,10 @@ namespace EquipmentApi.Repositories
|
|
1335
|
1207
|
|| it.Jwocode.Contains(phone) || it.createusername.Contains(phone)
|
|
1336
|
1208
|
|| it.repairman.Contains(phone) || it.faultdescripe.Contains(phone)
|
|
1337
|
1209
|
|| it.CLpeoplefrom.Contains(phone)
|
|
1338
|
|
- || it.touser.Contains(usercode)
|
|
1339
|
|
- || it.dealuser.Contains(usercode)
|
|
1340
|
1210
|
);
|
|
1341
|
1211
|
if (!string.IsNullOrEmpty(Pwcode))
|
|
1342
|
1212
|
query = query.Where(it => it.Pwcode == Pwcode);
|
|
1343
|
|
- if (!string.IsNullOrEmpty(province))
|
|
1344
|
|
- query = query.Where(it => it.provincecode == province);
|
|
1345
|
|
- if (!string.IsNullOrEmpty(city))
|
|
1346
|
|
- query = query.Where(it => it.citycode == city);
|
|
1347
|
|
- if (!string.IsNullOrEmpty(projectid))
|
|
1348
|
|
- query = query.Where(it => it.projectid == projectid);
|
|
1349
|
|
- if (!string.IsNullOrEmpty(protypeid))
|
|
1350
|
|
- query = query.Where(it => it.protypeid == protypeid);
|
|
1351
|
|
- if (!string.IsNullOrEmpty(buildid))
|
|
1352
|
|
- query = query.Where(it => it.buildid == buildid);
|
|
1353
|
|
- if (!string.IsNullOrEmpty(floorid))
|
|
1354
|
|
- query = query.Where(it => it.floorid == floorid);
|
|
1355
|
|
- if (!string.IsNullOrEmpty(systemid))
|
|
1356
|
|
- query = query.Where(it => it.systemid == systemid);
|
|
1357
|
|
- if (!string.IsNullOrEmpty(equipmentid))
|
|
1358
|
|
- query = query.Where(it => it.equipmentid == equipmentid);
|
|
|
1213
|
+
|
|
1359
|
1214
|
if (!string.IsNullOrEmpty(channel))
|
|
1360
|
1215
|
query = query.Where(it => it.channel == Convert.ToInt32(channel));
|
|
1361
|
1216
|
#region 时间搜索
|
|
|
@@ -1363,62 +1218,9 @@ namespace EquipmentApi.Repositories
|
|
1363
|
1218
|
query = query.Where(it => it.createtime >= Convert.ToDateTime(stime + " 00:00:00"));
|
|
1364
|
1219
|
if (!string.IsNullOrEmpty(etime))
|
|
1365
|
1220
|
query = query.Where(it => it.createtime <= Convert.ToDateTime(etime + " 23:59:59"));
|
|
1366
|
|
- if (score != 0)
|
|
1367
|
|
- {
|
|
1368
|
|
- //等于1时获取分数为1和2的数据 不满意数据
|
|
1369
|
|
- if (score == 1)
|
|
1370
|
|
- {
|
|
1371
|
|
- query = query.Where(it => it.score == 1 || it.score == 2);
|
|
1372
|
|
- }
|
|
1373
|
|
- //获取基本满意数据
|
|
1374
|
|
- else if (score == 3)
|
|
1375
|
|
- {
|
|
1376
|
|
- query = query.Where(it => it.score == 3);
|
|
1377
|
|
- }
|
|
1378
|
|
- //获取4和5分数的数据 满意数据
|
|
1379
|
|
- else
|
|
1380
|
|
- {
|
|
1381
|
|
- query = query.Where(it => it.score == 4 || it.score == 5);
|
|
1382
|
|
- }
|
|
1383
|
|
- }
|
|
1384
|
|
-
|
|
1385
|
|
- if (userinfo.role_name.Contains("班") || userinfo.role_name == "默认角色")
|
|
1386
|
|
- {
|
|
1387
|
|
-
|
|
1388
|
|
- if (userinfo.remark == "组长")
|
|
1389
|
|
- {
|
|
1390
|
|
- wzpcount = query.Count(p => p.wostate == (int)EnumWorkOrderState.create && (p.postlist == userinfo.postlist || p.repairman == userinfo.username || p.repairman.Contains(userinfo.usercode)));
|
|
1391
|
|
- yjdcount = query.Count(p => p.wostate == (int)EnumWorkOrderState.assign && (p.postlist == userinfo.postlist || p.repairman == userinfo.username || p.repairman.Contains(userinfo.usercode)));//
|
|
1392
|
|
- dpjcount = query.Count(p => p.wostate == (int)EnumWorkOrderState.deal && (p.postlist == userinfo.postlist || p.repairman == userinfo.username || p.repairman.Contains(userinfo.usercode)));//
|
|
1393
|
|
- ygqcount = query.Count(p => p.wostate == (int)EnumWorkOrderState.hangup && (p.postlist == userinfo.postlist || p.repairman == userinfo.username || p.repairman.Contains(userinfo.usercode)));//
|
|
1394
|
|
- ywjcount = query.Count(p => p.wostate == (int)EnumWorkOrderState.evaluate && (p.postlist == userinfo.postlist | p.repairman == userinfo.username || p.repairman.Contains(userinfo.usercode)));//||
|
|
1395
|
|
- yqxcount = query.Count(p => (p.Pwcode != null && p.Pwcode != "") && (p.postlist == userinfo.postlist || p.repairman == userinfo.username || p.repairman.Contains(userinfo.usercode)));//||
|
|
1396
|
|
-
|
|
1397
|
|
- }
|
|
1398
|
|
- else
|
|
1399
|
|
- {
|
|
1400
|
|
- wzpcount = query.Count(p => p.wostate == (int)EnumWorkOrderState.create && (p.createusername == userinfo.username || p.tousername[0] == userinfo.username || p.repairman == userinfo.username || p.repairman.Contains(userinfo.usercode)));
|
|
1401
|
|
- yjdcount = query.Count(p => p.wostate == (int)EnumWorkOrderState.assign && (p.createusername == userinfo.username || p.tousername[0] == userinfo.username || p.repairman == userinfo.username || p.repairman.Contains(userinfo.usercode)));
|
|
1402
|
|
- dpjcount = query.Count(p => p.wostate == (int)EnumWorkOrderState.deal && (p.createusername == userinfo.username || p.tousername[0] == userinfo.username || p.repairman == userinfo.username || p.repairman.Contains(userinfo.usercode)));
|
|
1403
|
|
- ygqcount = query.Count(p => p.wostate == (int)EnumWorkOrderState.hangup && (p.createusername == userinfo.username || p.tousername[0] == userinfo.username || p.repairman == userinfo.username || p.repairman.Contains(userinfo.usercode)));
|
|
1404
|
|
- ywjcount = query.Count(p => p.wostate == (int)EnumWorkOrderState.evaluate && (p.createusername == userinfo.username || p.tousername[0] == userinfo.username || p.repairman == userinfo.username || p.repairman.Contains(userinfo.usercode)));
|
|
1405
|
|
- yqxcount = query.Count(p => (p.Pwcode != null && p.Pwcode != "") && (p.createusername == userinfo.username || p.tousername[0] == userinfo.username || p.repairman == userinfo.username || p.repairman.Contains(userinfo.usercode)));
|
|
1406
|
|
-
|
|
1407
|
|
- }
|
|
1408
|
|
-
|
|
1409
|
|
-
|
|
1410
|
|
- }
|
|
1411
|
|
- else
|
|
1412
|
|
- {
|
|
1413
|
|
- wzpcount = query.Count(p => p.wostate == (int)EnumWorkOrderState.create);
|
|
1414
|
|
- yjdcount = query.Count(p => p.wostate == (int)EnumWorkOrderState.assign);
|
|
1415
|
|
- dpjcount = query.Count(p => p.wostate == (int)EnumWorkOrderState.deal);
|
|
1416
|
|
- ygqcount = query.Count(p => p.wostate == (int)EnumWorkOrderState.hangup);
|
|
1417
|
|
- ywjcount = query.Count(p => p.wostate == (int)EnumWorkOrderState.evaluate);
|
|
1418
|
|
- yqxcount = query.Count(p => p.Pwcode != null && p.Pwcode != "");
|
|
1419
|
|
- }
|
|
1420
|
|
-
|
|
|
1221
|
+
|
|
1421
|
1222
|
|
|
|
1223
|
+
|
|
1422
|
1224
|
|
|
1423
|
1225
|
if (state != -1)
|
|
1424
|
1226
|
{
|
|
|
@@ -1432,18 +1234,18 @@ namespace EquipmentApi.Repositories
|
|
1432
|
1234
|
}
|
|
1433
|
1235
|
if (userinfo.role_name.Contains("班") || userinfo.role_name == "默认角色")
|
|
1434
|
1236
|
{
|
|
1435
|
|
- if (userinfo.remark == "组长")
|
|
1436
|
|
- {
|
|
1437
|
|
- query = query.Where(it => it.repairman.Contains(userinfo.usercode) || it.repairman == userinfo.username || it.postlist == userinfo.postlist);//
|
|
|
1237
|
+ //if (userinfo.remark == "组长")
|
|
|
1238
|
+ //{
|
|
|
1239
|
+ // query = query.Where(it => it.repairman.Contains(userinfo.usercode) || it.repairman == userinfo.username || it.postlist == userinfo.postlist);//
|
|
1438
|
1240
|
|
|
1439
|
|
- }
|
|
1440
|
|
- else
|
|
1441
|
|
- {
|
|
|
1241
|
+ //}
|
|
|
1242
|
+ //else
|
|
|
1243
|
+ //{
|
|
1442
|
1244
|
if (!string.IsNullOrEmpty(userinfo.username))
|
|
1443
|
1245
|
{
|
|
1444
|
1246
|
query = query.Where(it => it.createusername == userinfo.username || it.tousername[0] == userinfo.username || it.repairman == userinfo.username || it.repairman.Contains(userinfo.usercode));
|
|
1445
|
1247
|
}
|
|
1446
|
|
- }
|
|
|
1248
|
+ //}
|
|
1447
|
1249
|
|
|
1448
|
1250
|
|
|
1449
|
1251
|
}
|
|
|
@@ -1452,7 +1254,6 @@ namespace EquipmentApi.Repositories
|
|
1452
|
1254
|
case (int)EnumWorkOrderState.assign: query = query.OrderByDescending(p => p.totime); break;
|
|
1453
|
1255
|
case (int)EnumWorkOrderState.deal: query = query.OrderByDescending(p => p.dealtime); break;
|
|
1454
|
1256
|
//case (int)EnumWorkOrderState.evaluate: query = query.OrderBy(p => p.evaluatetime); break;
|
|
1455
|
|
- case (int)EnumWorkOrderState.hangup: query = query.OrderByDescending(p => p.hanguptime); break;
|
|
1456
|
1257
|
//case (int)EnumWorkOrderState.cancle: query = query.OrderBy(p => p.canceltime); break;
|
|
1457
|
1258
|
}
|
|
1458
|
1259
|
}
|
|
|
@@ -1461,28 +1262,25 @@ namespace EquipmentApi.Repositories
|
|
1461
|
1262
|
//query = query.Where(it => it.wostate==0|| it.wostate == 1||it.wostate == 2|| it.wostate == 3|| it.wostate == 7|| it.wostate == 9);
|
|
1462
|
1263
|
if (userinfo.role_name.Contains("班") || userinfo.role_name == "默认角色")
|
|
1463
|
1264
|
{
|
|
1464
|
|
- if (userinfo.remark == "组长")
|
|
1465
|
|
- {
|
|
1466
|
|
- query = query.Where(it => it.postlist == userinfo.postlist || it.repairman == userinfo.username || it.repairman.Contains(userinfo.usercode));//
|
|
|
1265
|
+ //if (userinfo.remark == "组长")
|
|
|
1266
|
+ //{
|
|
|
1267
|
+ // query = query.Where(it => it.postlist == userinfo.postlist || it.repairman == userinfo.username || it.repairman.Contains(userinfo.usercode));//
|
|
1467
|
1268
|
|
|
1468
|
|
- }
|
|
1469
|
|
- else
|
|
1470
|
|
- {
|
|
|
1269
|
+ //}
|
|
|
1270
|
+ //else
|
|
|
1271
|
+ //{
|
|
1471
|
1272
|
if (!string.IsNullOrEmpty(userinfo.username))
|
|
1472
|
1273
|
{
|
|
1473
|
1274
|
query = query.Where(it => it.createusername == userinfo.username || it.tousername[0] == userinfo.username || it.repairman == userinfo.username || it.repairman.Contains(userinfo.usercode));
|
|
1474
|
1275
|
}
|
|
1475
|
|
- }
|
|
|
1276
|
+ //}
|
|
1476
|
1277
|
}
|
|
1477
|
1278
|
query = query.OrderByDescending(p => p.totime);
|
|
1478
|
1279
|
}
|
|
1479
|
1280
|
|
|
1480
|
1281
|
#endregion
|
|
1481
|
1282
|
#endregion
|
|
1482
|
|
- recordcount = query.Count();
|
|
1483
|
|
- //总数
|
|
1484
|
|
- totalcount = query.Count();
|
|
1485
|
|
-
|
|
|
1283
|
+
|
|
1486
|
1284
|
var list1 = query.ToList();
|
|
1487
|
1285
|
return list1;
|
|
1488
|
1286
|
#endregion
|
|
|
@@ -1502,62 +1300,28 @@ namespace EquipmentApi.Repositories
|
|
1502
|
1300
|
orderby repairbase.createtime descending
|
|
1503
|
1301
|
select new
|
|
1504
|
1302
|
{
|
|
1505
|
|
- repairbase.id,
|
|
|
1303
|
+ repairbase.wostate,
|
|
1506
|
1304
|
repairbase.wocode,
|
|
1507
|
|
- repairbase.projectid,
|
|
|
1305
|
+ repairbase.channel,
|
|
1508
|
1306
|
projectname = projeDefa.Count() > 0 ? projeDefa.First().project_name : null,
|
|
1509
|
|
- repairbase.protypeid,
|
|
1510
|
|
- //protypename = dic_protypeDefa.Count() > 0 ? dic_protypeDefa.First().name : null,
|
|
1511
|
|
- repairbase.faulttypeid,
|
|
1512
|
|
- //faulttypename = dic_faulttypeDefa.Count() > 0 ? dic_faulttypeDefa.First().name : null,
|
|
1513
|
|
- repairbase.systemid,
|
|
1514
|
|
- //systemname = dic_systemDefa.Count() > 0 ? dic_systemDefa.First().name : null,
|
|
1515
|
|
- repairbase.equipmentid,
|
|
1516
|
|
- //equipmentname = dic_equDefa.Count() > 0 ? dic_equDefa.First().equipment_name : null,
|
|
1517
|
|
- repairbase.channel,
|
|
1518
|
|
- provincecode = repairbase.province,
|
|
1519
|
|
- province = sys_provincesDefa.Count() > 0 ? sys_provincesDefa.First().provincename : null,
|
|
1520
|
|
- citycode = repairbase.city,
|
|
1521
|
|
- city = sys_cityDefa.Count() > 0 ? sys_cityDefa.First().cityname : null,
|
|
1522
|
|
- repairbase.buildid,
|
|
1523
|
|
- //buildname = bldDefa.Count() > 0 ? bldDefa.First().buildname : null,
|
|
1524
|
|
- repairbase.floorid,
|
|
1525
|
|
- //floorname = flrDefa.Count() > 0 ? flrDefa.First().floorname : null,
|
|
1526
|
|
- repairbase.repairreplace,
|
|
|
1307
|
+ repairbase.repairreplace,
|
|
1527
|
1308
|
repairbase.repairoom,
|
|
1528
|
1309
|
repairbase.repairtime,
|
|
1529
|
|
- repairbase.contactway,
|
|
1530
|
|
- repairbase.repairman,
|
|
1531
|
|
- repairbase.faultdescripe,
|
|
1532
|
|
- repairbase.faultpic,
|
|
1533
|
|
- repairbase.appointtime,
|
|
1534
|
|
- repairbase.wostate,
|
|
1535
|
1310
|
repairbase.createtime,
|
|
1536
|
|
- repairbase.createuser,
|
|
|
1311
|
+ repairbase.repairman,
|
|
1537
|
1312
|
repairbase.createusername,
|
|
1538
|
|
- repairbase.touser,
|
|
|
1313
|
+ repairbase.contactway,
|
|
|
1314
|
+ repairbase.faultdescripe,
|
|
|
1315
|
+ repairbase.Pwcode,
|
|
|
1316
|
+ repairbase.Jwocode,
|
|
|
1317
|
+ repairbase.tobztimes,
|
|
1539
|
1318
|
repairbase.tousername,
|
|
1540
|
1319
|
repairbase.totime,
|
|
1541
|
|
- repairbase.totype,
|
|
1542
|
|
- repairbase.dealuser,
|
|
1543
|
|
- repairbase.dealusername,
|
|
1544
|
1320
|
repairbase.dealtime,
|
|
1545
|
|
- repairbase.ismaterials,
|
|
1546
|
|
- repairbase.materials,
|
|
1547
|
|
- repairbase.islosematerials,
|
|
1548
|
|
- repairbase.losematerials,
|
|
1549
|
|
- repairbase.hanguptime,
|
|
1550
|
|
- repairbase.arrivetime,
|
|
1551
|
|
- repairbase.evaluatetime,
|
|
1552
|
|
- repairbase.canceltime,
|
|
1553
|
|
- repairbase.score,
|
|
1554
|
|
- repairbase.Jwocode,
|
|
1555
|
|
- repairbase.Pwcode,
|
|
1556
|
1321
|
repairbase.CLpeoplefrom,
|
|
1557
|
|
- repairbase.tobztimes,
|
|
1558
|
|
- repairbase.wxtimeid,
|
|
|
1322
|
+ repairbase.wxtimecenter,
|
|
1559
|
1323
|
wxtimeleths = wxtimelisDefa.Count() > 0 ? wxtimelisDefa.First().timecount : 0,//维修时长
|
|
1560
|
|
- };
|
|
|
1324
|
+ };
|
|
1561
|
1325
|
#endregion
|
|
1562
|
1326
|
#region 查询条件
|
|
1563
|
1327
|
if (!string.IsNullOrEmpty(phone))
|
|
|
@@ -1566,31 +1330,12 @@ namespace EquipmentApi.Repositories
|
|
1566
|
1330
|
|| it.Jwocode.Contains(phone) || it.createusername.Contains(phone)
|
|
1567
|
1331
|
|| it.repairman.Contains(phone) || it.faultdescripe.Contains(phone)
|
|
1568
|
1332
|
|| it.CLpeoplefrom.Contains(phone)
|
|
1569
|
|
- || it.touser.Contains(usercode)
|
|
1570
|
|
- || it.dealuser.Contains(usercode)
|
|
1571
|
1333
|
);
|
|
1572
|
1334
|
if (!string.IsNullOrEmpty(Pwcode))
|
|
1573
|
1335
|
query = query.Where(it => it.Pwcode == Pwcode);
|
|
1574
|
1336
|
if (!string.IsNullOrEmpty(wocode))
|
|
1575
|
1337
|
query = query.Where(it => it.wocode.Contains(wocode));
|
|
1576
|
|
- if (!string.IsNullOrEmpty(province))
|
|
1577
|
|
- query = query.Where(it => it.provincecode == province);
|
|
1578
|
|
- if (!string.IsNullOrEmpty(city))
|
|
1579
|
|
- query = query.Where(it => it.citycode == city);
|
|
1580
|
|
- if (!string.IsNullOrEmpty(projectid))
|
|
1581
|
|
- query = query.Where(it => it.projectid == projectid);
|
|
1582
|
|
- if (!string.IsNullOrEmpty(protypeid))
|
|
1583
|
|
- query = query.Where(it => it.protypeid == protypeid);
|
|
1584
|
|
- if (!string.IsNullOrEmpty(buildid))
|
|
1585
|
|
- query = query.Where(it => it.buildid == buildid);
|
|
1586
|
|
- if (!string.IsNullOrEmpty(floorid))
|
|
1587
|
|
- query = query.Where(it => it.floorid == floorid);
|
|
1588
|
|
- if (!string.IsNullOrEmpty(replace))
|
|
1589
|
|
- query = query.Where(it => it.repairreplace.Contains(replace) || it.repairoom.Contains(replace));
|
|
1590
|
|
- if (!string.IsNullOrEmpty(systemid))
|
|
1591
|
|
- query = query.Where(it => it.systemid == systemid);
|
|
1592
|
|
- if (!string.IsNullOrEmpty(equipmentid))
|
|
1593
|
|
- query = query.Where(it => it.equipmentid == equipmentid);
|
|
|
1338
|
+
|
|
1594
|
1339
|
if (!string.IsNullOrEmpty(channel))
|
|
1595
|
1340
|
query = query.Where(it => it.channel == Convert.ToInt32(channel));
|
|
1596
|
1341
|
if (!string.IsNullOrEmpty(Jwocode))
|
|
|
@@ -1600,58 +1345,10 @@ namespace EquipmentApi.Repositories
|
|
1600
|
1345
|
query = query.Where(it => it.createtime >= Convert.ToDateTime(stime + " 00:00:00"));
|
|
1601
|
1346
|
if (!string.IsNullOrEmpty(etime))
|
|
1602
|
1347
|
query = query.Where(it => it.createtime <= Convert.ToDateTime(etime + " 23:59:59"));
|
|
1603
|
|
- if (score != 0)
|
|
1604
|
|
- {
|
|
1605
|
|
- //等于1时获取分数为1和2的数据 不满意数据
|
|
1606
|
|
- if (score == 1)
|
|
1607
|
|
- {
|
|
1608
|
|
- query = query.Where(it => it.score == 1 || it.score == 2);
|
|
1609
|
|
- }
|
|
1610
|
|
- //获取基本满意数据
|
|
1611
|
|
- else if (score == 3)
|
|
1612
|
|
- {
|
|
1613
|
|
- query = query.Where(it => it.score == 3);
|
|
1614
|
|
- }
|
|
1615
|
|
- //获取4和5分数的数据 满意数据
|
|
1616
|
|
- else
|
|
1617
|
|
- {
|
|
1618
|
|
- query = query.Where(it => it.score == 4 || it.score == 5);
|
|
1619
|
|
- }
|
|
1620
|
|
- }
|
|
1621
|
|
-
|
|
1622
|
|
- if (userinfo.type == 2)//查看自己创建的工单
|
|
1623
|
|
- {
|
|
1624
|
|
- query = query.Where(it => it.createuser == userinfo.usercode);
|
|
1625
|
|
- }
|
|
1626
|
|
- else
|
|
1627
|
|
- {
|
|
1628
|
|
- if (!string.IsNullOrEmpty(usercode)) query = query.Where(it => (it.touser.Contains(usercode) || it.dealuser.Contains(usercode)));
|
|
1629
|
|
- }
|
|
1630
|
|
- if (userinfo.role_name.Contains("班") || userinfo.role_name == "默认角色")
|
|
1631
|
|
- {
|
|
1632
|
|
-
|
|
1633
|
|
-
|
|
1634
|
|
- wzpcount = query.Count(p => p.wostate == (int)EnumWorkOrderState.create && (p.createusername == userinfo.username || p.tousername[0] == userinfo.username || p.repairman == userinfo.username || p.repairman.Contains(userinfo.usercode)));
|
|
1635
|
|
- yjdcount = query.Count(p => p.wostate == (int)EnumWorkOrderState.assign && (p.createusername == userinfo.username || p.tousername[0] == userinfo.username || p.repairman == userinfo.username || p.repairman.Contains(userinfo.usercode)));
|
|
1636
|
|
- dpjcount = query.Count(p => p.wostate == (int)EnumWorkOrderState.deal && (p.createusername == userinfo.username || p.tousername[0] == userinfo.username || p.repairman == userinfo.username || p.repairman.Contains(userinfo.usercode)));
|
|
1637
|
|
- ygqcount = query.Count(p => p.wostate == (int)EnumWorkOrderState.hangup && (p.createusername == userinfo.username || p.tousername[0] == userinfo.username || p.repairman == userinfo.username || p.repairman.Contains(userinfo.usercode)));
|
|
1638
|
|
- ywjcount = query.Count(p => p.wostate == (int)EnumWorkOrderState.evaluate && (p.createusername == userinfo.username || p.tousername[0] == userinfo.username || p.repairman == userinfo.username || p.repairman.Contains(userinfo.usercode)));
|
|
1639
|
|
- yqxcount = query.Count(p => (p.Pwcode != null && p.Pwcode != "") && (p.createusername == userinfo.username || p.tousername[0] == userinfo.username || p.repairman == userinfo.username || p.repairman.Contains(userinfo.usercode)));
|
|
1640
|
|
-
|
|
1641
|
|
-
|
|
1642
|
|
- }
|
|
1643
|
|
- else
|
|
1644
|
|
- {
|
|
1645
|
|
- wzpcount = query.Count(p => p.wostate == (int)EnumWorkOrderState.create);
|
|
1646
|
|
- yjdcount = query.Count(p => p.wostate == (int)EnumWorkOrderState.assign);
|
|
1647
|
|
- dpjcount = query.Count(p => p.wostate == (int)EnumWorkOrderState.deal);
|
|
1648
|
|
- ygqcount = query.Count(p => p.wostate == (int)EnumWorkOrderState.hangup);
|
|
1649
|
|
- ywjcount = query.Count(p => p.wostate == (int)EnumWorkOrderState.evaluate);
|
|
1650
|
|
- yqxcount = query.Count(p => p.Pwcode != null && p.Pwcode != "");
|
|
1651
|
|
- }
|
|
1652
|
|
-
|
|
1653
|
|
-
|
|
|
1348
|
+
|
|
1654
|
1349
|
|
|
|
1350
|
+
|
|
|
1351
|
+
|
|
1655
|
1352
|
if (state != -1)
|
|
1656
|
1353
|
{
|
|
1657
|
1354
|
if (state == 8)
|
|
|
@@ -1679,7 +1376,6 @@ namespace EquipmentApi.Repositories
|
|
1679
|
1376
|
case (int)EnumWorkOrderState.assign: query = query.OrderByDescending(p => p.totime); break;
|
|
1680
|
1377
|
case (int)EnumWorkOrderState.deal: query = query.OrderByDescending(p => p.dealtime); break;
|
|
1681
|
1378
|
//case (int)EnumWorkOrderState.evaluate: query = query.OrderBy(p => p.evaluatetime); break;
|
|
1682
|
|
- case (int)EnumWorkOrderState.hangup: query = query.OrderByDescending(p => p.hanguptime); break;
|
|
1683
|
1379
|
//case (int)EnumWorkOrderState.cancle: query = query.OrderBy(p => p.canceltime); break;
|
|
1684
|
1380
|
}
|
|
1685
|
1381
|
}
|
|
|
@@ -1710,15 +1406,12 @@ namespace EquipmentApi.Repositories
|
|
1710
|
1406
|
case (int)EnumWorkOrderState.assign: query = query.OrderByDescending(p => p.totime); break;
|
|
1711
|
1407
|
case (int)EnumWorkOrderState.deal: query = query.OrderByDescending(p => p.dealtime); break;
|
|
1712
|
1408
|
//case (int)EnumWorkOrderState.evaluate: query = query.OrderBy(p => p.evaluatetime); break;
|
|
1713
|
|
- case (int)EnumWorkOrderState.hangup: query = query.OrderByDescending(p => p.hanguptime); break;
|
|
1714
|
1409
|
//case (int)EnumWorkOrderState.cancle: query = query.OrderBy(p => p.canceltime); break;
|
|
1715
|
1410
|
}
|
|
1716
|
1411
|
}
|
|
1717
|
1412
|
#endregion
|
|
1718
|
1413
|
#endregion
|
|
1719
|
|
- recordcount = query.Count();
|
|
1720
|
|
- //总数
|
|
1721
|
|
- totalcount = query.Count();
|
|
|
1414
|
+
|
|
1722
|
1415
|
|
|
1723
|
1416
|
var list1 = query.ToList();
|
|
1724
|
1417
|
return list1;
|