zhoufan лет назад: 4
Родитель
Сommit
e2b639df8b

+ 60 - 68
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderNewController.cs

@@ -6628,95 +6628,87 @@ namespace CallCenterApi.Interface.Controllers.workorder
6628 6628
                 WorkOrderNewInput input = new WorkOrderNewInput();
6629 6629
                 if (ua != null)
6630 6630
                 {
6631
+
6631 6632
                     Model.T_Wo_WorkOrder model = workOrder.GetModel(orderid);
6632
-                    if (model != null)
6633
+                    var deptmodel = departmentBLL.GetModel(ua.F_DeptId);
6634
+                    if (deptmodel != null)
6633 6635
                     {
6634
-                        if (model.F_State == (int)EnumWorkOrderState.neworder)
6636
+                        if (model != null)
6635 6637
                         {
6636
-                            var deptmodel = departmentBLL.GetModel(ua.F_DeptId);
6637
-                            if (deptmodel != null)
6638
+                            var modellist = new BLL.T_Wo_WorkOrderItem_New().GetModelList("F_WoID=" + model.F_ID + "and F_IsUsed=0 order by   F_ID desc ").FirstOrDefault();
6639
+                            if (modellist != null)
6638 6640
                             {
6639
-
6640
-                                var modellist = new BLL.T_Wo_WorkOrderItem_New().GetModelList("F_WoID=" + model.F_ID + "and F_IsUsed=0 order by   F_ID desc ").FirstOrDefault();
6641
-                                if (modellist != null)
6642
-                                {
6643
-                                    if (modellist.F_NextUser != ua.F_UserCode)
6644
-                                        return Error("非接单人不可操作工单");
6645
-                                }
6646
-                                if (model.F_Type == "2")
6641
+                                if (modellist.F_NextUser != ua.F_UserCode)
6642
+                                    return Error("非接单人不可操作工单");
6643
+                            }
6644
+                            if (model.F_Type == "2")
6645
+                            {
6646
+                                if (deptmodel.F_DeptId == 37)
6647 6647
                                 {
6648
-                                    if (deptmodel.F_DeptId == 37)
6649
-                                    {
6650
-                                        input.F_SC_ProductBase = deptment.ProductBase;//
6651
-
6652
-                                    }
6653
-                                    else if (deptmodel.F_DeptId == 12)
6654
-                                    {
6655
-                                        input.F_IsVisit = isvisit.ToString();
6656
-                                        input.F_ZL_QualityEventLevel = deptment.QualityEventLevel;//质量管理科-质量事件等级(未遂、一般、较大、重大)
6657
-                                        input.F_ZL_ClaimAmount = deptment.ClaimAmount;// 质量管理科-索赔金额(单位元,对应责任单位)
6658
-                                        input.F_ZL_ResponsibleUnit = deptment.ResponsibleUnit;// 质量管理科-责任单位(需列出,可选多个)
6659
-                                        input.F_ZL_ApprovalOpinions = deptment.ApprovalOpinions;// 质量管理科-审批意见(同意、不同意,若选择不同意,增加输入框输入补充内容)
6660
-                                        input.F_ZL_ApprovalDisagree = deptment.ApprovalDisagree;// 质量管理科-审批不同意意见
6661
-                                        input.F_ZL_CompensationMethod = deptment.CompensationMethod;// 质量管理科-补偿方式(实物、钱款【单位元】,若选择钱款,增加输入框输入补充内容)
6662
-                                        input.F_ZL_CompensationMoney = deptment.CompensationMoney;// 质量管理科-补偿钱款
6663
-                                        input.F_ZL_CResponsibleUnits = deptment.CResponsibleUnits;//质量管理科-对应责任单位(生产、研发、农化、物流、质量管理科,销售内勤)
6664
-                                        input.F_ZL_Fquantity = deptment.Fquantity;//质量管理科-确认实收数量(吨)
6665
-                                        input.F_ZL_ImprovementRequirements = deptment.ImprovementRequirements;//  质量管理科-改进要求
6666
-                                        input.F_ZL_CApprovalNo = deptment.CApprovalNo;// 质量管理科-对应审批工作流单号
6667
-                                    }
6648
+                                    input.F_SC_ProductBase = deptment.ProductBase;//
6668 6649
 
6669 6650
                                 }
6670
-                                else if (model.F_Type == "3")
6651
+                                else if (deptmodel.F_DeptId == 12)
6671 6652
                                 {
6672
-                                    if (deptmodel.F_DeptId == 37)
6673
-                                    {
6674
-                                        input.F_SC_ProductBase = deptment.ProductBase;//
6675
-                                    }
6676
-                                    else if (deptmodel.F_DeptId == 12)
6677
-                                    {
6678
-                                        input.F_IsVisit = isvisit.ToString();
6679
-                                        input.F_ZL_CJ_IsRecord = deptment.IsRecord;//质量管理科-抽检-未备案、已备案
6680
-                                    }
6653
+                                    input.F_IsVisit = isvisit.ToString();
6654
+                                    input.F_ZL_QualityEventLevel = deptment.QualityEventLevel;//质量管理科-质量事件等级(未遂、一般、较大、重大)
6655
+                                    input.F_ZL_ClaimAmount = deptment.ClaimAmount;// 质量管理科-索赔金额(单位元,对应责任单位)
6656
+                                    input.F_ZL_ResponsibleUnit = deptment.ResponsibleUnit;// 质量管理科-责任单位(需列出,可选多个)
6657
+                                    input.F_ZL_ApprovalOpinions = deptment.ApprovalOpinions;// 质量管理科-审批意见(同意、不同意,若选择不同意,增加输入框输入补充内容)
6658
+                                    input.F_ZL_ApprovalDisagree = deptment.ApprovalDisagree;// 质量管理科-审批不同意意见
6659
+                                    input.F_ZL_CompensationMethod = deptment.CompensationMethod;// 质量管理科-补偿方式(实物、钱款【单位元】,若选择钱款,增加输入框输入补充内容)
6660
+                                    input.F_ZL_CompensationMoney = deptment.CompensationMoney;// 质量管理科-补偿钱款
6661
+                                    input.F_ZL_CResponsibleUnits = deptment.CResponsibleUnits;//质量管理科-对应责任单位(生产、研发、农化、物流、质量管理科,销售内勤)
6662
+                                    input.F_ZL_Fquantity = deptment.Fquantity;//质量管理科-确认实收数量(吨)
6663
+                                    input.F_ZL_ImprovementRequirements = deptment.ImprovementRequirements;//  质量管理科-改进要求
6664
+                                    input.F_ZL_CApprovalNo = deptment.CApprovalNo;// 质量管理科-对应审批工作流单号
6681 6665
                                 }
6682
-                                if (deptmodel.F_DeptId == 25)
6683
-                                {
6684 6666
 
6685
-                                    input.F_SC_CJ_ReturnAccount = deptment.ReturnAccount;//销售内勤-确认返账金额
6667
+                            }
6668
+                            else if (model.F_Type == "3")
6669
+                            {
6670
+                                if (deptmodel.F_DeptId == 37)
6671
+                                {
6672
+                                    input.F_SC_ProductBase = deptment.ProductBase;//
6686 6673
                                 }
6687
-                                else if (deptmodel.F_DeptId == 36)
6674
+                                else if (deptmodel.F_DeptId == 12)
6688 6675
                                 {
6689
-                                    input.F_ZL_Fquantity = deptment.Fquantity;//质量管理科-确认实收数量(吨)
6676
+                                    input.F_IsVisit = isvisit.ToString();
6677
+                                    input.F_ZL_CJ_IsRecord = deptment.IsRecord;//质量管理科-抽检-未备案、已备案
6690 6678
                                 }
6691 6679
                             }
6692
-                            else
6693
-                                return Error("工单不存在!");
6694
-                        }
6695
-                        else
6696
-                        {
6697
-                            return Error("请选择接收部门");
6698
-                        }
6699
-                        if (model != null)
6700
-                        {
6701
-                            if (model.F_State == 10)
6702
-                                return Error("工单已处理请勿重复操作!");
6703
-                            else
6680
+                            if (deptmodel.F_DeptId == 25)
6704 6681
                             {
6705 6682
 
6706
-                                var res = DealWO(ua, model, input, cont, F_Files, isover, uncont);
6707
-
6708
-                                if (res)
6709
-                                    return Success("处理成功");
6710
-                                else
6711
-                                    return Error("处理失败!");
6683
+                                input.F_SC_CJ_ReturnAccount = deptment.ReturnAccount;//销售内勤-确认返账金额
6684
+                            }
6685
+                            else if (deptmodel.F_DeptId == 36)
6686
+                            {
6687
+                                input.F_ZL_Fquantity = deptment.Fquantity;//质量管理科-确认实收数量(吨)
6712 6688
                             }
6713
-
6714
-
6715 6689
                         }
6716 6690
                         else
6691
+                            return Error("工单不存在!");
6692
+                    }
6693
+                    else
6694
+                    {
6695
+                        return Error("请选择接收部门");
6696
+                    }
6697
+                    if (model != null)
6698
+                    {
6699
+                        if (model.F_State == 10)
6700
+                            return Error("工单已处理请勿重复操作!");
6701
+                        else
6717 6702
                         {
6718
-                            return Error("已经指派过了!");
6703
+
6704
+                            var res = DealWO(ua, model, input, cont, F_Files, isover, uncont);
6705
+
6706
+                            if (res)
6707
+                                return Success("处理成功");
6708
+                            else
6709
+                                return Error("处理失败!");
6719 6710
                         }
6711
+
6720 6712
                     }
6721 6713
                     else
6722 6714
                         return Error("工单不存在!");