1
llj
4 天以前 5283fa35215bc599aba8d4914d4ccb868da99596
WebAPI/Controllers/Sb_CheckEqpRepairWorkBillController.cs
@@ -917,7 +917,40 @@
        #endregion
        #region [设备维修单通过故障登记单获取维修记录]
        [Route("Sb_EqpRepairWorkBill/GetEquipMatainanceBillBySourceInterID")]
        [HttpGet]
        public object GetEquipMatainanceBillBySourceInterID (string user, int HSourceInterID)
        {
            try
            {
                if (!DBUtility.ClsPub.Security_Log("Sb_EquipRepairCheckBillList", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无保存权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                ds = oCN.RunProcReturn($"select * from h_v_GetEquipMatainanceBillBySourceInterID where HInterID = {HSourceInterID} and isnull(设备维修验收单,'') = ''", "h_v_GetEquipMatainanceBillBySourceInterID");
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "返回记录成功!";
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception ex)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "没有返回任何记录!" + ex.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 设备维修验收单保存/编辑
        /// <summary>
@@ -1258,6 +1291,7 @@
            ListModels oListModels = new ListModels();
            try
            {
                string errRef = "";
                if (!DBUtility.ClsPub.Security_Log("Sb_EquipConkBookBill_Edit", 1, false, msg4))
                {
                    objJsonResult.code = "0";
@@ -1303,6 +1337,18 @@
                    //oItem.HRepairID = 0; //维修项目(Gy_Repair)
                    //oItem.HRemark = "";   //备注
                    //oItem.HMainSourceInterID = oItem.HInterID;
                    if (oSystemParameter.ShowBill(ref errRef))
                    {
                        // if (oSystemParameter.omodel.WMS_CampanyName == "华舟")
                        // {
                        //     oItem.HRepairManID = oItem.HEmpID;
                        // }
                        // else
                        // {
                            oItem.HRepairManID = 0;
                        // }
                    }
                    //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo);
                    if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
@@ -1344,7 +1390,6 @@
                    //oItemSub.HManagerID = 0;   //负责人ID
                    //oItemSub.HMoney = 0;        //维修费用
                    oBill.DetailColl.Add(oItemSub);
                }
                //保存
                //保存完毕后处理
@@ -1518,19 +1563,20 @@
                }
                bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Sb_EquipConkBookBill_AfterDelCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo);
                if (IsDete)
                var oDelDs = oCN.RunProcReturn($"exec h_p_Sb_EquipConkBookBill_AfterDelCtrl {lngBillKey},{oBill.omodel.HBillNo}, {user}, {oBill.omodel.HEquipID}", "h_p_Sb_EquipConkBookBill_AfterDelCtrl");
                if (!IsDete || oDelDs == null)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.count = 1;
                    objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
@@ -1633,7 +1679,7 @@
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    LogService.Write("源单类型: " + oItem.HMainSourceBillType);
                    //oItem.HMaker = "";
                    UserName = oItem.HMaker;  //制单人
                    oItem.HBillType = "3910";
@@ -1686,6 +1732,7 @@
                    //oItemSub.HCloseMan = "";       //行关闭
                    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                    oItemSub.HCloseType = false;   //关闭类型
                    //oItemSub.HRemark = "";         //备注
                    //oItemSub.HSourceInterID = 0;     // 源单主内码
                    //oItemSub.HSourceEntryID = 0;   //源单子内码