| | |
| | | { |
| | | try |
| | | { |
| | | |
| | | Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere); |
| | | |
| | | string HBeginDate = dic["HBeginDate"].ToString();//开始日期 |
| | | string HEndDate = dic["HEndDate"].ToString();//结束日期 |
| | | string HMouldNo = dic["HMouldNo"].ToString();//模具编码 |
| | | string HName = dic["HName"].ToString();//模具名称 |
| | | |
| | | ds = oCN.RunProcReturn("exec h_P_Sc_MouldLifeUsePicReport '" + HBeginDate + "'," + HEndDate + ",'" + HMouldNo + "','" + HName + "'", "h_P_Sc_MouldLifeUsePicReport"); |
| | | LogService.Write("exec h_P_Sc_MouldLifeUsePicReport '" + HBeginDate + "','" + HEndDate + "','" + HMouldNo + "','" + HName + "'"); |
| | | |
| | | ds = oCN.RunProcReturn("exec h_P_Sc_MouldLifeUsePicReport '" + HBeginDate + "','" + HEndDate + "','" + HMouldNo + "','" + HName + "'", "h_P_Sc_MouldLifeUsePicReport"); |
| | | List<object> columnNameList = new List<object>(); |
| | | //添加列名 |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | //} |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "审核失败!原因:审核前判断失败,请与网络管理人员联系"; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | |
| | | if (!oBill.CheckBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Kf_MoveStockBill_AfterCheckCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "审核失败!原因:" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "反审核失败!原因:反审核前判断失败,请与网络管理人员联系"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "反审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "审核失败!原因:" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "执行失败!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 直接调拨单列表分页列表 |
| | | [Route("Kf_MoveStockBill/page")] |
| | | [HttpGet] |
| | | public json Sc_MouldProdOutBillPage(string sWhere, string user, int page, int size, string Type) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //列表进入时判断权限,选源单进入不判断权限 |
| | | |
| | | if (!DBUtility.ClsPub.Security_Log("Kf_MoveStockBillQuery", 3, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "您没有该模块权限,请与管理员联系!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | sWhere = sWhere.Replace("'", "''"); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCn.RunProcReturn("exec h_p_IF_MoveStockBillList " + page + "," + size + ",'','" + Type + "'", "h_p_IF_MoveStockBillList"); |
| | | } |
| | | else |
| | | { |
| | | ds = oCn.RunProcReturn("exec h_p_IF_MoveStockBillList " + page + "," + size + ",'" + sWhere + "','" + Type + "'", "h_p_IF_MoveStockBillList"); |
| | | } |
| | | |
| | | //添加列名 |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名 |
| | | } |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); |
| | | objJsonResult.Message = "成功!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "查询列表信息失败!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | DAL.ClsSc_MouldDotCheckBill oBill = new DAL.ClsSc_MouldDotCheckBill(); |
| | | List<Model.ClsSc_MouldDotCheckBillMain> lsmain = new List<Model.ClsSc_MouldDotCheckBillMain>(); |
| | | msg2 = msg2.Replace("\\", ""); |
| | |
| | | |
| | | oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --日期 |
| | | oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); |
| | | oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month); |
| | | |
| | | |
| | | if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") |
| | | { |
| | |
| | | return objJsonResult; |
| | | } |
| | | oBill.omodel = oItem; |
| | | |
| | | LogService.Write("Insert Into Sc_MouldDotCheckBillMain " + |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate" + |
| | | ",HYear,HPeriod,HRemark" + |
| | | ",HMouldID,HBeginDate" + |
| | | ",HEndDate,HPlanNo,HPlanInterID" + |
| | | ",HInnerBillNo,HExplanation,HMouldDotCheckRuleID" + |
| | | ",HLastResult,HErrNote,HBigSafeNote,HShiftsID,HDotCheckNote" + |
| | | ") " + |
| | | " values('" + oBill.BillType + "','" + oBill.HBillSubType + "'," + oBill.omodel.HInterID.ToString() + ",'" + oBill.omodel.HBillNo + "','" + oBill.omodel.HDate + "','" + oBill.omodel.HMaker + "',getdate()" + |
| | | "," + oBill.omodel.HYear.ToString() + "," + oBill.omodel.HPeriod.ToString() + ",'" + oBill.omodel.HRemark + "'" + |
| | | "," + oBill.omodel.HMouldID.ToString() + ",'" + oBill.omodel.HBeginDate + "'" + |
| | | ",'" + oBill.omodel.HEndDate + "','" + oBill.omodel.HPlanNo + "'," + oBill.omodel.HPlanInterID.ToString() + |
| | | ",'" + oBill.omodel.HInnerBillNo + "','" + oBill.omodel.HExplanation + "','" + oBill.omodel.HMouldDotCheckRuleID + "','" + oBill.omodel.HLastResult + "','" + oBill.omodel.HErrNote + "','" + oBill.omodel.HBigSafeNote + "'," + oBill.omodel.HShiftsID + ",'" + oBill.omodel.HDotCheckNote + "'" + |
| | | ") "); |
| | | } |
| | | //表体数据 |
| | | //按 },{来拆分数组 //去掉【和】 |
| | |
| | | |
| | | |
| | | oBill.DetailColl.Add(oItemSub); |
| | | |
| | | LogService.Write("Insert into Sc_MouldDotCheckBillSub " + |
| | | " (HInterID,HEntryID" + |
| | | ",HManagerID" + |
| | | ",HDotCheckItemID,HDotCheckItem,HDotCheckPart,HClaim" + |
| | | ",HCloseMan,HCloseType,HRemark" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + |
| | | ",HDotCheckItemClassID,HDotCheckItemMethodID,HDotCheckResult" + |
| | | ") values(" |
| | | + oBill.omodel.HInterID.ToString() + "," + oItemSub.HEntryID.ToString() + |
| | | "," + oItemSub.HManagerID.ToString() + "," + oItemSub.HDotCheckItemID.ToString() + |
| | | ",'" + oItemSub.HDotCheckItem + "','" + oItemSub.HDotCheckPart + "','" + oItemSub.HClaim + "'" + |
| | | ",'" + oItemSub.HCloseMan + "'," + Convert.ToString(oItemSub.HCloseType ? 1 : 0) + ",'" + oItemSub.HRemark + "'" + |
| | | "," + oItemSub.HSourceInterID.ToString() + "," + oItemSub.HSourceEntryID.ToString() + ",'" + oItemSub.HSourceBillNo + "','" + oItemSub.HSourceBillType + "'," + oItemSub.HRelationQty.ToString() + "," + oItemSub.HRelationMoney.ToString() + "," + oItemSub.HDotCheckItemClassID + "," + oItemSub.HDotCheckItemMethodID + ",'" + oItemSub.HDotCheckResult + "'" + |
| | | ") "); |
| | | } |
| | | |
| | | |
| | | //保存 |
| | | //保存完毕后处理 |