| | |
| | | |
| | | public static DataSet Sc_MouldMaintainBillList_s(string sWhere) |
| | | { |
| | | return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldMaintainBillList ", "h_v_Sc_MouldMaintainBillList"); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldMaintain", "h_v_Sc_MouldMaintain"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_Sc_MouldMaintain where 1 = 1 "; |
| | | string sql = sql1 + sWhere; |
| | | return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldMaintain"); |
| | | |
| | | } |
| | | //return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldMaintainBillList ", "h_v_Sc_MouldMaintainBillList"); |
| | | } |
| | | #endregion |
| | | |
| | |
| | | |
| | | public static DataSet Sc_MouldDotCheckBillList_s(string sWhere) |
| | | { |
| | | return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldDotCheckBillList ", "h_v_Sc_MouldDotCheckBillList"); |
| | | return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldDotCheckBillList where 1=1 "+sWhere+" ", "h_v_Sc_MouldDotCheckBillList"); |
| | | } |
| | | #endregion |
| | | |
| | |
| | | |
| | | public static DataSet Sc_MouldConkBookBillList_s(string sWhere) |
| | | { |
| | | return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldConkBookBillList ", "h_v_Sc_MouldConkBookBillList"); |
| | | if (sWhere != "" || sWhere != null) |
| | | { |
| | | sWhere = " where 1=1 " + sWhere; |
| | | } |
| | | return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldConkBookBillList "+sWhere+"", "h_v_Sc_MouldConkBookBillList"); |
| | | } |
| | | #endregion |
| | | |
| | |
| | | |
| | | public static DataSet Sc_MouldRepairWorkBillList_s(string sWhere) |
| | | { |
| | | return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldRepairWorkBillList ", "h_v_Sc_MouldRepairWorkBillList"); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldRepairWorkBillList " + sWhere, "h_v_Sc_MouldRepairWorkBillList"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_Sc_MouldRepairWorkBillList where 1 = 1 "; |
| | | string sql = sql1 + sWhere; |
| | | return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldRepairWorkBillList"); |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | |
| | | if (sqlWhere == null || sqlWhere.Equals("")) |
| | | { |
| | | //ds = oCN.RunProcReturn("select HRepairID,HRepairExplanation,HManagerID,HMoney,HRemark from Sc_MouldRepairWorkBillSub", "Sc_MouldRepairWorkBillSub"); |
| | | ds = oCN.RunProcReturn("select HRepairSonID HRepairID, 子维修项目代码 HRepairCode,子维修项目 HRepairName,子维修要求 HRepairExplanation,HManagerSonID HManagerID,子负责人代码 HManagerCode,子负责人 HManagerName,维修费用 HMoney,表体备注 HRemark from h_v_Sc_MouldRepairWorkBillList_Edit", "h_v_Sc_MouldRepairWorkBillList_Edit"); |
| | | ds = oCN.RunProcReturn("select HRepairID, 子维修项目代码 HRepairCode,子维修项目 HRepairName,子维修要求 HRepairExplanation,HManagerSonID HManagerID,子负责人代码 HManagerCode,子负责人 HManagerName,维修费用 HMoney,表体备注 HRemark from h_v_Sc_MouldRepairWorkBillList_Edit", "h_v_Sc_MouldRepairWorkBillList_Edit"); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "获取信息成功!"; |
| | |
| | | else |
| | | { |
| | | //string sql1 = "select HRepairID,HRepairExplanation,HManagerID,HMoney,HRemark from Sc_MouldRepairWorkBillSub where 1 = 1 "; |
| | | string sql1 = "select HRepairSonID HRepairID, 子维修项目代码 HRepairCode,子维修项目 HRepairName,子维修要求 HRepairExplanation,HManagerSonID HManagerID,子负责人代码 HManagerCode,子负责人 HManagerName,维修费用 HMoney,表体备注 HRemark from h_v_Sc_MouldRepairWorkBillList_Edit where 1 = 1 "; |
| | | string sql1 = "select HRepairID,子维修项目代码 HRepairCode,子维修项目 HRepairName,子维修要求 HRepairExplanation,HManagerSonID HManagerID,子负责人代码 HManagerCode,子负责人 HManagerName,维修费用 HMoney,表体备注 HRemark from h_v_Sc_MouldRepairWorkBillList_Edit where 1 = 1 "; |
| | | string sql = sql1 + sqlWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldRepairWorkBillList_Edit"); |
| | | objJsonResult.code = "0"; |
| | |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region 模具保养记录表 |
| | | |
| | | #region 模具保养记录表 保存/编辑 |
| | |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString(); |
| | | |
| | | string msg4 = sArray[2].ToString(); |
| | | |
| | | string UserName = ""; |
| | | ListModels oListModels = new ListModels(); |
| | |
| | | lsmain = oListModels.getObjectByJson_Sc_MouldMaintainBillMain(msg2); |
| | | foreach (Model.ClsSc_MouldMaintainBillMain oItem in lsmain) |
| | | { |
| | | //oItem.HMaker = ""; |
| | | UserName = oItem.HMaker; //制单人 |
| | | oItem.HBillType = "3818"; |
| | | oItem.HBillSubType = "3818"; |
| | | DBUtility.ClsPub.CurUserName = UserName; |
| | | oItem.HBillType = "3819"; |
| | | oItem.HBillSubType = "3819"; |
| | | |
| | | //oItem.HInterID =0; |
| | | //oItem.HBillNo = ""; |
| | |
| | | } |
| | | oBill.omodel = oItem; |
| | | } |
| | | //表体数据 |
| | | //保养项表体数据 |
| | | //按 },{来拆分数组 //去掉【和】 |
| | | msg3 = msg3.Substring(1, msg3.Length - 2); |
| | | msg3 = msg3.Replace("\\", ""); |
| | | msg3 = msg3.Replace("\n", ""); //\n |
| | | //msg2 = msg2.Replace("'", "’"); |
| | | List<Model.ClsSc_MouldMaintainBillSub> ls = new List<Model.ClsSc_MouldMaintainBillSub>(); |
| | | ls = oListModels.getObjectByJson_Sc_MouldMaintainBillSub(msg3); |
| | | List<Model.ClsSc_MouldMaintainRuleBillSub_Item> ls = new List<Model.ClsSc_MouldMaintainRuleBillSub_Item>(); |
| | | ls = oListModels.getObjectByJson_Sc_MouldMaintainRuleBillSub_Item(msg3); |
| | | int i = 0; |
| | | foreach (Model.ClsSc_MouldMaintainBillSub oItemSub in ls) |
| | | foreach (Model.ClsSc_MouldMaintainRuleBillSub_Item oItemSub in ls) |
| | | { |
| | | |
| | | i++; |
| | |
| | | //oItemSub.HSourceBillNo = ""; //源单单号 |
| | | //oItemSub.HSourceBillType = ""; //源单类型 |
| | | oItemSub.HRelationQty = 0; //关联数量 |
| | | oBill.DetailCol.Add(oItemSub); |
| | | |
| | | } |
| | | //配件项表体数据 |
| | | //按 },{来拆分数组 //去掉【和】 |
| | | msg4 = msg4.Substring(1, msg4.Length - 2); |
| | | msg4 = msg4.Replace("\\", ""); |
| | | msg4 = msg4.Replace("\n", ""); //\n |
| | | //msg2 = msg2.Replace("'", "’"); |
| | | List<Model.ClsSc_MouldMaintainBillSub> ls1 = new List<Model.ClsSc_MouldMaintainBillSub>(); |
| | | ls1 = oListModels.getObjectByJson_Sc_MouldMaintainBillSub(msg4); |
| | | int j = 0; |
| | | foreach (Model.ClsSc_MouldMaintainBillSub Sub in ls1) |
| | | { |
| | | |
| | | j++; |
| | | Sub.HEntryID = j; |
| | | //oItemSub.HCloseMan = ""; //行关闭 |
| | | Sub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); |
| | | Sub.HCloseType = false; //关闭类型 |
| | | //oItemSub.HRemark = ""; //备注 |
| | | Sub.HSourceInterID = 0; // 源单主内码 |
| | | Sub.HSourceEntryID = 0; //源单子内码 |
| | | //oItemSub.HSourceBillNo = ""; //源单单号 |
| | | //oItemSub.HSourceBillType = ""; //源单类型 |
| | | Sub.HRelationQty = 0; //关联数量 |
| | | //oItemSub.HRelationMoney = 0; //关联金额 |
| | | //HMaterID = "";//配件代码 |
| | | //HUnitID = "";//单位代码 |
| | |
| | | //HQtyMust = "";//单位用量 |
| | | //HRemark = "";//备注 |
| | | |
| | | oBill.DetailColl.Add(oItemSub); |
| | | oBill.DetailColl.Add(Sub); |
| | | |
| | | } |
| | | //保存 |
| | |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region[模具保养记录表编辑时获取表头数据] |
| | | [Route("Sc_MouldMaintainBill/Sc_MouldMaintainBillListCheckDetai")] |
| | | [HttpGet] |
| | |
| | | if (string.IsNullOrEmpty(HID)) |
| | | return new ApiResult<DataSet> { code = -1, msg = "ID不能为空" }; |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_MouldMaintainBillList where hmainid= " + HID + " ", "h_v_Sc_MouldMaintainBillList"); |
| | | var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_MouldMaintain where hmainid= " + HID + " ", "h_v_Sc_MouldMaintain"); |
| | | if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) |
| | | return new ApiResult<DataSet> { code = -1, msg = "不存在保养记录表" }; |
| | | return new ApiResult<DataSet> { code = 1, msg = "查询成功", data = dataSet }; |
| | | } |
| | | #endregion |
| | | |
| | | #region[模具保养记录表编辑时获取表题数据] |
| | | [Route("Sc_MouldMaintainBill/Sc_MouldMaintainBillListProjectDetai")] |
| | | [HttpGet] |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region[模具保养记录表编辑时获取表体数据新(保养项列表、配件项列表)] |
| | | [Route("Sc_MouldMaintainBill/Sc_MouldMaintainBillListProjectDetaiNew")] |
| | | [HttpGet] |
| | | public object Sc_MouldMaintainBillListProjectDetaiNew(string HInterID) |
| | | { |
| | | |
| | | DataSet ds,ds1; |
| | | List<object> list = new List<object>(); |
| | | string Swhere = ""; |
| | | try |
| | | { |
| | | if (HInterID != "" || HInterID != null) |
| | | { |
| | | Swhere = " and hmainid='" + HInterID + "'"; |
| | | } |
| | | else |
| | | { |
| | | Swhere = HInterID; |
| | | } |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | //获取保养项目编辑数据 |
| | | string sql = "select HMaintainItemID, 保养项目代码 HMaintainItemNumber,保养项目名称 HMaintainItem,保养部位 HMaintainPart,具体要求 HClaim,HManagerID,负责人代码 HManagerNumber,负责人 HManagerName,表体备注 HRemark from h_v_Sc_MouldMaintainBillListItem where 1 = 1 " + Swhere + ""; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldMaintainBillListItem"); |
| | | //获取配件项目编辑数据 |
| | | string sql1 = "select HMaterID, 配件代码 HMaterNumber,配件名称 HMaterName,规格型号 HMaterSpec,HUnitID,单位代码 HUnitNumber,单位名称 HUnitName,实际用量 HQty,标准用量 HQtyMust,HManagerID,负责人代码 HManagerNumber,负责人 HManagerName,表体备注 HRemark from h_v_Sc_MouldMaintainBillList where 1 = 1 " + Swhere + ""; |
| | | ds1 = oCN.RunProcReturn(sql1, "h_v_Sc_MouldMaintainBillList"); |
| | | list.Add(ds.Tables[0]); |
| | | list.Add(ds1.Tables[0]); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "获取信息成功!"; |
| | | objJsonResult.list = list; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没有返回任何记录!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | } |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | |
| | | #region [模具保养记录表删除功能] |
| | | /// <summary> |
| | | /// 模具维修单删除功能 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("Sc_MouldMaintainBill/DeltetSc_MouldMaintainBill")] |
| | | /// <summary> |
| | | /// 模具维修单删除功能 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("Sc_MouldMaintainBill/DeltetSc_MouldMaintainBill")] |
| | | [HttpGet] |
| | | public object DeltetSc_MouldMaintainBill(string HInterID) |
| | | { |
| | |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region 模具点检记录表 |
| | | |
| | | #region 模具点检记录表 保存/编辑 |
| | |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | if (sqlWhere == null || sqlWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("select HDotCheckItem,HDotCheckPart,HClaim,HRemark,HManagerID from Sc_MouldDotCheckBillSub", "Sc_MouldMaintainBillSub"); |
| | | ds = oCN.RunProcReturn("select 点检项目 HDotCheckItem,点检部位 HDotCheckPart,具体要求 HClaim,表体备注 HRemark,HManagerID,负责人代码 HManagerNumber,负责人 HManagerName from h_v_Sc_MouldDotCheckBillList", "h_v_Sc_MouldDotCheckBillList"); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "获取信息成功!"; |
| | |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select HDotCheckItem,HDotCheckPart,HClaim,HRemark,HManagerID from Sc_MouldDotCheckBillSub where 1 = 1 "; |
| | | string sql1 = "select 点检项目 HDotCheckItem,点检部位 HDotCheckPart,具体要求 HClaim,表体备注 HRemark,HManagerID,负责人代码 HManagerNumber,负责人 HManagerName from h_v_Sc_MouldDotCheckBillList where 1 = 1 "; |
| | | string sql = sql1 + sqlWhere; |
| | | ds = oCN.RunProcReturn(sql, "Sc_MouldDotCheckBillSub"); |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldDotCheckBillList"); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "获取信息成功!"; |
| | |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region [模具点检记录表删除功能] |
| | | /// <summary> |
| | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region 模具点检计划表 |
| | | |
| | | #region 模具点检计划表 保存/编辑 |
| | |
| | | #region 模具报废入库单 |
| | | |
| | | |
| | | #region 模具报废入库单列表 |
| | | |
| | | [Route("Sc_MouldScrapInHouseBill/GetMouldScrapInHouseBill")] |
| | | [HttpGet] |
| | | public object GetMouldScrapInHouseBill(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = Sc_GetMouldScrapInHouseBill(sWhere); |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | public static DataSet Sc_GetMouldScrapInHouseBill(string sWhere) |
| | | { |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldScrapInHouseBillList " + sWhere, "h_v_Sc_MouldScrapInHouseBillList"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_Sc_MouldScrapInHouseBillList where 1 = 1 "; |
| | | string sql = sql1 + sWhere; |
| | | return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldScrapInHouseBillList"); |
| | | } |
| | | |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region[模具报废入库单编辑时获取表头数据] |
| | | [Route("Sc_MouldScrapInHouseBill/Sc_MouldScrapInHouseBillListCheckDetai")] |
| | |
| | | try |
| | | { |
| | | DLL.ClsSc_MouldScrapInBill oBill = new DLL.ClsSc_MouldScrapInBill(); |
| | | List<Model.ClsSc_MouldStockBillMain> lsmain = new List<Model.ClsSc_MouldStockBillMain>(); |
| | | List<Models.ClsSc_MouldStockBillMain> lsmain = new List<Models.ClsSc_MouldStockBillMain>(); |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); //\n |
| | | lsmain = oListModels.getObjectByJson_Gy_MouldScrapInHouseBillMain(msg2); |
| | | foreach (Model.ClsSc_MouldStockBillMain oItem in lsmain) |
| | | foreach (Models.ClsSc_MouldStockBillMain oItem in lsmain) |
| | | { |
| | | if (refSav == "Add") |
| | | { |
| | |
| | | msg3 = msg3.Replace("\\", ""); |
| | | msg3 = msg3.Replace("\n", ""); //\n |
| | | //msg2 = msg2.Replace("'", "’"); |
| | | List<Model.ClsSc_MouldStockBillSub> ls = new List<Model.ClsSc_MouldStockBillSub>(); |
| | | List<Models.ClsSc_MouldStockBillSub> ls = new List<Models.ClsSc_MouldStockBillSub>(); |
| | | ls = oListModels.getObjectByJson_Gy_MouldScrapInHouseBillSub(msg3); |
| | | int i = 0; |
| | | foreach (Model.ClsSc_MouldStockBillSub oItemSub in ls) |
| | | foreach (Models.ClsSc_MouldStockBillSub oItemSub in ls) |
| | | { |
| | | |
| | | i++; |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region [模具报废入库单删除功能] |
| | | /// <summary> |
| | | /// 模具报废入库单删除功能 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("Sc_MouldScrapInHouseBill/DeltetMouldScrapInHouseBill")] |
| | | [HttpGet] |
| | | public object DeltetMouldScrapInHouseBill(string HInterID) |
| | | { |
| | | //编辑权限 |
| | | //if (!DBUtility.ClsPub.Security_Log("Sc_MouldScrapInBill_Delete", 1, true, DBUtility.ClsPub.CurUserName)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "无删除权限!"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | string s = ""; |
| | | Int64 lngBillKey = 0; |
| | | lngBillKey = DBUtility.ClsPub.isLong(HInterID); |
| | | if (lngBillKey == 0) |
| | | |
| | | |
| | | #region 模具报废入库单保存 |
| | | |
| | | [Route("Sc_MouldScrapInHouseBill/SaveGetMouldScrapInHouseBillList_PDA")] |
| | | [HttpPost] |
| | | public object SaveGetMouldScrapInHouseBillList_PDA([FromBody] JObject msg) |
| | | { |
| | | var _value = msg["msg"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | |
| | | string UserName = ""; |
| | | |
| | | ListModels oListModels = new ListModels(); |
| | | try |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据ID为空!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | DAL.ClsSc_MouldScrapInBill oBill = new DAL.ClsSc_MouldScrapInBill(); |
| | | if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | if (oBill.omodel.HBillStatus > 1) |
| | | DLL.ClsSc_MouldScrapInBill oBill = new DLL.ClsSc_MouldScrapInBill(); |
| | | List<Models.ClsSc_MouldStockBillMain> lsmain = new List<Models.ClsSc_MouldStockBillMain>(); |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); //\n |
| | | lsmain = oListModels.getObjectByJson_Gy_MouldScrapInHouseBillMain(msg2); |
| | | foreach (Models.ClsSc_MouldStockBillMain oItem in lsmain) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据当前处于不能删除状态,不能删除!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | //单据号是否重复 |
| | | if (BillNew0.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, BillOld0.omodel.HInterID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据号重复!不允许保存!"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //oItem.HMaker = ""; |
| | | UserName = oItem.HMaker; //制单人 |
| | | oItem.HBillType = "3831"; |
| | | oItem.HBillSubType = "3831"; |
| | | //oItem.HBillNo = ""; //单据号 |
| | | //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --日期 |
| | | //oItem.HInnerBillNo = ""; // --内部单据号 |
| | | oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); |
| | | oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); |
| | | //oItem.HEquipID = 0; //设备ID(Gy_EquipMent) |
| | | //oItem.HPeriod = 0; |
| | | //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --维修日期 |
| | | //oItem.HCheckResult = ""; //验收结论--(正常,异常) |
| | | //oItem.HEmpID = 0; //验收人(Gy_Employee) |
| | | //oItem.HManagerID = 0; //负责人(Gy_Employee) |
| | | //oItem.HDeptID = 0; //验收部门(Gy_Department) |
| | | //oItem.HExplanation = ""; //摘要(故障描述) |
| | | //oItem.HRemark = ""; //备注 |
| | | |
| | | //oItem.HMainSourceInterID = oItem.HInterID; |
| | | |
| | | //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "保存失败!没有单据日期,无法保存!"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | oBill.omodel = oItem; |
| | | } |
| | | if (oBill.omodel.HChecker != "") |
| | | //子表体数据 |
| | | |
| | | List<Models.ClsSc_MouldStockBillSub> ls = new List<Models.ClsSc_MouldStockBillSub>(); |
| | | ls = oListModels.getObjectByJson_Gy_MouldScrapInHouseBillSub(msg2); |
| | | int i = 0; |
| | | foreach (Models.ClsSc_MouldStockBillSub oItemSub in ls) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据已经审核,不能删除!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | | i++; |
| | | oItemSub.HEntryID = i; |
| | | |
| | | //oItemSub.HRepairCheckID = 0; //验收项目ID |
| | | //oItemSub.HRepairCheckContent = ""; //验收内容 |
| | | //oItemSub.HManagerID = 0; //负责人ID |
| | | //oItemSub.HCloseMan = ""; //行关闭 |
| | | oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); |
| | | oItemSub.HCloseType = false; //关闭类型 |
| | | //oItemSub.HRemark = ""; //备注 |
| | | oItemSub.HSourceInterID = 0; // 源单主内码 |
| | | oItemSub.HSourceEntryID = 0; //源单子内码 |
| | | //oItemSub.HSourceBillNo = ""; //源单单号 |
| | | //oItemSub.HSourceBillType = ""; //源单类型 |
| | | //oItemSub.HRelationQty = 0; //关联数量 |
| | | //oItemSub.HRelationMoney = 0; //关联金额 |
| | | //oItemSub.HRepairID = 0; //维修项目 |
| | | //oItemSub.HRepairExplanation =""; //维修要求 |
| | | //oItemSub.HMoney = 0; //维修费用 |
| | | oBill.DetailColl.Add(oItemSub); |
| | | |
| | | } |
| | | if (!DBUtility.Xt_BaseBillFun.Fun_AllowDeleteBill(BillOld0, ref s)) |
| | | //保存 |
| | | //保存完毕后处理 |
| | | bool bResult; |
| | | if (oBill.omodel.HInterID == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = s + ",不允许删除"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); |
| | | bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | if (IsDete) |
| | | else |
| | | { |
| | | bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | if (bResult) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | objJsonResult.Message = "保存成功!"; |
| | | //WebAPIController.Add_Log("送货单下推", UserName, "生成送货单"); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | objJsonResult.Message = "保存失败!" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据未找到"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region [模具报废入库单审核、反审核] |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="HInterID">单据ID</param> |
| | | /// <param name="IsAudit">审核(0),反审核(1)</param> |
| | | /// <param name="CurUserName">审核人</param> |
| | | /// <returns></returns> |
| | | [Route("Sc_MouldScrapInHouseBill/MouldScrapInHouseAudit")] |
| | | [HttpGet] |
| | | public object MouldScrapInHouseAudit(int HInterID, int IsAudit, string CurUserName) |
| | | { |
| | | string ModRightNameCheck = "Sc_MouldScrapInBill_Check"; |
| | | DBUtility.ClsPub.CurUserName = CurUserName; |
| | | try |
| | | { |
| | | //审核权限 |
| | | if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "审核失败!无权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | string s = ""; |
| | | if (!DBUtility.Xt_BaseBillFun.Fun_AllowCheckBill(BillOld0, ref s)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = s + ",不允许审核"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (HInterID <= 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "HInterID小于0!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | Int64 lngBillKey = 0; |
| | | lngBillKey = DBUtility.ClsPub.isLong(HInterID); |
| | | DLL.ClsSc_MouldScrapInBill oBill = new DLL.ClsSc_MouldScrapInBill(); |
| | | //查看是否已审核,关闭,作废 |
| | | if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | if (oBill.omodel.HCloseMan.Trim() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据已关闭!不能再次审核!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (oBill.omodel.HDeleteMan.Trim() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据已作废!不能再次审核!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (IsAudit == 0) //审核判断 |
| | | { |
| | | if (oBill.omodel.HChecker.Trim() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据已审核!不能再次审核!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (IsAudit == 1) //反审核判断 |
| | | { |
| | | if (oBill.omodel.HChecker.Trim() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据未审核!不需要反审核!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (IsAudit == 0) //审核提交 |
| | | { |
| | | //审核提交 |
| | | if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "审核成功"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (IsAudit == 1) //反审核提交 |
| | | { |
| | | //反审核提交AbandonCheck |
| | | if (oBill.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "反审核成功"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "反审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "审核失败或者反审核失败!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | objJsonResult.Message = "保存失败!" + e.ToString(); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |