|
|
@@ -36,7 +36,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
36
|
36
|
/// 获取工单列表
|
|
37
|
37
|
/// </summary>
|
|
38
|
38
|
/// <returns></returns>
|
|
39
|
|
- public ActionResult GetList(string code, string cusname, string cusphone,string keywords, string companyname, string province, string city,
|
|
|
39
|
+ public ActionResult GetList(string code, string cusname, string cusphone, string starttime, string endtime, string keywords, string companyname, string province, string city,
|
|
40
|
40
|
string country, string township, string touser, int source=0,int type = 0, int state=-1, int pageindex = 1,int pagesize = 10)
|
|
41
|
41
|
{
|
|
42
|
42
|
|
|
|
@@ -52,6 +52,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
52
|
52
|
sql += $" and F_Source=" + source;
|
|
53
|
53
|
if (!string.IsNullOrWhiteSpace(touser))//参与人
|
|
54
|
54
|
sql += $" and F_DealBy like '%" + touser.Trim() + "%'";
|
|
|
55
|
+ if (starttime.Trim() != "" && starttime != "undefined")
|
|
|
56
|
+ sql += " and datediff(day,F_CreateOn,'" + starttime + "')<=0 ";
|
|
|
57
|
+ if (endtime.Trim() != "" && endtime != "undefined")
|
|
|
58
|
+ sql += " and datediff(day,F_CreateOn,'" + endtime + "')>=0 ";
|
|
55
|
59
|
if (!string.IsNullOrWhiteSpace(keywords))//关键字搜索
|
|
56
|
60
|
sql += $" and ( F_CusName like '%" + keywords.Trim() + "%'or F_CusPhone like '%" + keywords.Trim() + "%' ) ";
|
|
57
|
61
|
if (!string.IsNullOrWhiteSpace(code))//工单编号
|
|
|
@@ -4132,8 +4136,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
4132
|
4136
|
/// 创建工单时指派
|
|
4133
|
4137
|
/// </summary>
|
|
4134
|
4138
|
/// <returns></returns>
|
|
4135
|
|
- public ActionResult Createass(WorkOrderNewInput input, string cont, WorkOrdeDeptment deptment, int isvisit = 1,
|
|
4136
|
|
- int overtime = 0, int sms = 0, int clbm = 0, int clid = 0)
|
|
|
4139
|
+ public ActionResult Createass(WorkOrderNewInput input, string cont, WorkOrdeDeptment deptment, int isvisit = 1,
|
|
|
4140
|
+ int overtime = 0, int sms = 0, int clbm = 0, int clid = 0)
|
|
4137
|
4141
|
{
|
|
4138
|
4142
|
int userId = CurrentUser.UserData.F_UserId;
|
|
4139
|
4143
|
if (userId != 0)
|
|
|
@@ -4174,6 +4178,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
4174
|
4178
|
long n = workOrder.Add(model);
|
|
4175
|
4179
|
if (n > 0)
|
|
4176
|
4180
|
{
|
|
|
4181
|
+<<<<<<< .merge_file_a17512
|
|
4177
|
4182
|
Model.T_Wo_WorkOrder modlelist = new BLL.T_Wo_WorkOrder().GetModel(n);
|
|
4178
|
4183
|
WorkOrderNewInput inputs = new WorkOrderNewInput();
|
|
4179
|
4184
|
if (clbm == 0 && clid == 0)
|
|
|
@@ -4181,10 +4186,28 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
4181
|
4186
|
return Error("请选择接收部门");
|
|
4182
|
4187
|
}
|
|
4183
|
4188
|
else
|
|
|
4189
|
+=======
|
|
|
4190
|
+ DataTable dt = new DataTable();
|
|
|
4191
|
+ dt = new BLL.T_Wo_WorkOrder().GetList(1, "", "F_ID desc").Tables[0];
|
|
|
4192
|
+ List<Model.T_Wo_WorkOrder> modlelist = new BLL.T_Wo_WorkOrder().DataTableToList(dt);
|
|
|
4193
|
+ WorkOrderNewInput inputs = new WorkOrderNewInput();
|
|
|
4194
|
+ //if (clbm == 0 && clid == 0)
|
|
|
4195
|
+ //{
|
|
|
4196
|
+ // return Error("请选择接收人");
|
|
|
4197
|
+ //}
|
|
|
4198
|
+ //else
|
|
|
4199
|
+ //{
|
|
|
4200
|
+ if (clbm == 0)
|
|
|
4201
|
+ return Error("请选择指派部门");
|
|
|
4202
|
+ var deptmodel = departmentBLL.GetModel(ua.F_DeptId);
|
|
|
4203
|
+ if (deptmodel != null)
|
|
|
4204
|
+ {
|
|
|
4205
|
+ if (modlelist != null && modlelist.Count > 0)
|
|
|
4206
|
+>>>>>>> .merge_file_a11592
|
|
4184
|
4207
|
{
|
|
4185
|
|
- var deptmodel = departmentBLL.GetModel(ua.F_DeptId);
|
|
4186
|
|
- if (deptmodel != null)
|
|
|
4208
|
+ if (modlelist[0].F_Type == "2")
|
|
4187
|
4209
|
{
|
|
|
4210
|
+<<<<<<< .merge_file_a17512
|
|
4188
|
4211
|
if (modlelist != null)
|
|
4189
|
4212
|
{
|
|
4190
|
4213
|
if (modlelist.F_Type == "2")
|
|
|
@@ -4233,26 +4256,78 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
4233
|
4256
|
}
|
|
4234
|
4257
|
else if (deptmodel.F_DeptId == 36)
|
|
4235
|
4258
|
{
|
|
|
4259
|
+=======
|
|
|
4260
|
+ if (deptmodel.F_DeptId == 37)
|
|
|
4261
|
+ {
|
|
|
4262
|
+ inputs.F_SC_PreliminaryOpinion = deptment.PreliminaryOpinion;//市场管理科-初审意见:退货、换货、补偿、自行处理
|
|
|
4263
|
+ }
|
|
|
4264
|
+ else if (deptmodel.F_DeptId == 12)
|
|
|
4265
|
+ {
|
|
|
4266
|
+ inputs.F_IsVisit = isvisit;
|
|
|
4267
|
+ inputs.F_ZL_QualityEventLevel = deptment.QualityEventLevel;//质量管理科-质量事件等级(未遂、一般、较大、重大)
|
|
|
4268
|
+ inputs.F_ZL_ClaimAmount = deptment.ClaimAmount;// 质量管理科-索赔金额(单位元,对应责任单位)
|
|
|
4269
|
+ inputs.F_ZL_ResponsibleUnit = deptment.ResponsibleUnit;// 质量管理科-责任单位(需列出,可选多个)
|
|
|
4270
|
+ inputs.F_ZL_ApprovalOpinions = deptment.ApprovalOpinions;// 质量管理科-审批意见(同意、不同意,若选择不同意,增加输入框输入补充内容)
|
|
|
4271
|
+ inputs.F_ZL_ApprovalDisagree = deptment.ApprovalDisagree;// 质量管理科-审批不同意意见
|
|
|
4272
|
+ inputs.F_ZL_CompensationMethod = deptment.CompensationMethod;// 质量管理科-补偿方式(实物、钱款【单位元】,若选择钱款,增加输入框输入补充内容)
|
|
|
4273
|
+ inputs.F_ZL_CompensationMoney = deptment.CompensationMoney;// 质量管理科-补偿钱款
|
|
|
4274
|
+ inputs.F_ZL_CResponsibleUnits = deptment.CResponsibleUnits;//质量管理科-对应责任单位(生产、研发、农化、物流、质量管理科,销售内勤)
|
|
|
4275
|
+>>>>>>> .merge_file_a11592
|
|
4236
|
4276
|
inputs.F_ZL_Fquantity = deptment.Fquantity;//质量管理科-确认实收数量(吨)
|
|
4237
|
|
- }
|
|
|
4277
|
+ inputs.F_ZL_ImprovementRequirements = deptment.ImprovementRequirements;// 质量管理科-改进要求
|
|
|
4278
|
+ inputs.F_ZL_CApprovalNo = deptment.CApprovalNo;// 质量管理科-对应审批工作流单号
|
|
|
4279
|
+
|
|
4238
|
4280
|
}
|
|
4239
|
|
- else
|
|
4240
|
|
- return Error("工单不存在!");
|
|
4241
|
4281
|
}
|
|
4242
|
|
- else
|
|
|
4282
|
+ else if (modlelist[0].F_Type == "3")
|
|
4243
|
4283
|
{
|
|
4244
|
|
- return Error("请选择接收部门");
|
|
|
4284
|
+ if (deptmodel.F_DeptId == 37)
|
|
|
4285
|
+ {
|
|
|
4286
|
+ inputs.F_SC_CJ_SpotResult = deptment.SpotResult;//市场管理科-抽检-抽检结果(视同合格、合格、不合格、复检后合格、未送检)
|
|
|
4287
|
+ inputs.F_SC_CJ_SelfResult = deptment.SelfResult;//市场管理科-抽检-自检结果
|
|
|
4288
|
+ inputs.F_SC_CJ_ApprovalNo = deptment.ApprovalNo;//市场管理科-抽检-对应审批工作流单号
|
|
|
4289
|
+ inputs.F_SC_CJ_ReturnAccount = deptment.ReturnAccount;//市场管理科-抽检-确认返账金额
|
|
|
4290
|
+ }
|
|
|
4291
|
+ else if (deptmodel.F_DeptId == 12)
|
|
|
4292
|
+ {
|
|
|
4293
|
+ inputs.F_IsVisit = isvisit;
|
|
|
4294
|
+ inputs.F_ZL_CJ_IsRecord = deptment.IsRecord;//质量管理科-抽检-未备案、已备案
|
|
|
4295
|
+ inputs.F_ZL_ClaimAmount = deptment.ClaimAmount;// 质量管理科-索赔金额(单位元,对应责任单位)
|
|
|
4296
|
+ }
|
|
|
4297
|
+ }
|
|
|
4298
|
+ if (deptmodel.F_DeptId == 25)
|
|
|
4299
|
+ {
|
|
|
4300
|
+
|
|
|
4301
|
+ inputs.F_SC_CJ_ReturnAccount = deptment.ReturnAccount;//销售内勤-确认返账金额
|
|
|
4302
|
+ }
|
|
|
4303
|
+ else if (deptmodel.F_DeptId == 36)
|
|
|
4304
|
+ {
|
|
|
4305
|
+ inputs.F_ZL_Fquantity = deptment.Fquantity;//质量管理科-确认实收数量(吨)
|
|
4245
|
4306
|
}
|
|
4246
|
4307
|
}
|
|
|
4308
|
+ else
|
|
|
4309
|
+ return Error("工单不存在!");
|
|
|
4310
|
+ }
|
|
|
4311
|
+ else
|
|
|
4312
|
+ {
|
|
|
4313
|
+ return Error("请选择接收部门");
|
|
|
4314
|
+ }
|
|
|
4315
|
+ //}
|
|
4247
|
4316
|
|
|
|
4317
|
+<<<<<<< .merge_file_a17512
|
|
4248
|
4318
|
if (modlelist != null)
|
|
4249
|
4319
|
{
|
|
|
4320
|
+=======
|
|
|
4321
|
+ if (modlelist[0] != null && modlelist.Count > 0)
|
|
|
4322
|
+ {
|
|
|
4323
|
+>>>>>>> .merge_file_a11592
|
|
4250
|
4324
|
string deptname = "";
|
|
4251
|
|
- var deptmodel = departmentBLL.GetModel(ua.F_DeptId);
|
|
|
4325
|
+ //var deptmodel = departmentBLL.GetModel(ua.F_DeptId);
|
|
4252
|
4326
|
if (deptmodel != null)
|
|
4253
|
4327
|
{
|
|
4254
|
4328
|
deptname = deptmodel.F_DeptName + "-";
|
|
4255
|
4329
|
}
|
|
|
4330
|
+<<<<<<< .merge_file_a17512
|
|
4256
|
4331
|
AddLog(modlelist.F_ID, modlelist.F_State.Value, deptname + ua.F_UserName + "(" + ua.F_UserCode + ")" + "添加工单", (int)EnumWorkOrderState.neworder, (int)EnumItemOpt.create, "", 0, ua, 0, 0);
|
|
4257
|
4332
|
var res = AssignWO(ua, modlelist, inputs, cont, clbm, clid, overtime, sms);
|
|
4258
|
4333
|
if (res)
|
|
|
@@ -4262,6 +4337,20 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
4262
|
4337
|
}
|
|
4263
|
4338
|
else
|
|
4264
|
4339
|
return Error("工单不存在!");
|
|
|
4340
|
+=======
|
|
|
4341
|
+ AddLog(modlelist[0].F_ID, modlelist[0].F_State.Value, deptname + ua.F_UserName + "(" + ua.F_UserCode + ")" + "添加工单", (int)EnumWorkOrderState.neworder, (int)EnumItemOpt.create, "", 0, ua, 0, 0);
|
|
|
4342
|
+ var res = AssignWO(ua, modlelist[0], inputs, cont, clbm, clid, overtime, sms);
|
|
|
4343
|
+ if (res)
|
|
|
4344
|
+ return Success("转派成功");
|
|
|
4345
|
+ else
|
|
|
4346
|
+ return Error("转派失败!");
|
|
|
4347
|
+ }
|
|
|
4348
|
+ else
|
|
|
4349
|
+ return Error("工单不存在!");
|
|
|
4350
|
+
|
|
|
4351
|
+
|
|
|
4352
|
+
|
|
|
4353
|
+>>>>>>> .merge_file_a11592
|
|
4265
|
4354
|
}
|
|
4266
|
4355
|
else
|
|
4267
|
4356
|
return Error("添加失败!");
|
|
|
@@ -4271,6 +4360,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
4271
|
4360
|
return Error("无操作权限!");
|
|
4272
|
4361
|
}
|
|
4273
|
4362
|
}
|
|
|
4363
|
+
|
|
4274
|
4364
|
public ActionResult CreatOver(WorkOrderNewInput input )
|
|
4275
|
4365
|
{
|
|
4276
|
4366
|
int userId = CurrentUser.UserData.F_UserId;
|