|  |  |  | 
|---|
|  |  |  | return new SQLHelper.ClsCN().RunProcReturn(sql, "Sc_ICMOBillWorkQtyStatus_Tmp"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #endregion | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #region 报工平台产量汇验证汇报数量是否超出计划数量辑 | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | /// | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | /// <param name="msg"></param> | 
|---|
|  |  |  | /// <returns></returns> | 
|---|
|  |  |  | [Route("Sc_MESBeginWorkBill/GetMESOverStepQty")] | 
|---|
|  |  |  | [HttpGet] | 
|---|
|  |  |  | public object GetMESOverStepQty(string sWhere) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | try | 
|---|
|  |  |  | { | 
|---|
|  |  |  | ds = new SQLHelper.ClsCN().RunProcReturn("select isnull(sum(HQty),0) HQty,isnull(sum(HBadQty),0) HBadQty,isnull(sum(HWasterQty),0) HWasterQty   from Sc_ICMOBillWorkQtyStatus_Tmp" + sWhere, "Sc_ICMOBillWorkQtyStatus_Tmp"); | 
|---|
|  |  |  | if (ds.Tables[0].Rows.Count > 0) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | objJsonResult.code = "1"; | 
|---|
|  |  |  | objJsonResult.count = 1; | 
|---|
|  |  |  | objJsonResult.Message = "已有产量汇报数据返回!"; | 
|---|
|  |  |  | objJsonResult.data = ds; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else | 
|---|
|  |  |  | { | 
|---|
|  |  |  | objJsonResult.code = "0"; | 
|---|
|  |  |  | objJsonResult.count = 0; | 
|---|
|  |  |  | objJsonResult.Message = "无产量汇报数据!"; | 
|---|
|  |  |  | objJsonResult.data = null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | catch (Exception ex) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | objJsonResult.code = "0"; | 
|---|
|  |  |  | objJsonResult.count = 0; | 
|---|
|  |  |  | objJsonResult.Message = ex.Message; | 
|---|
|  |  |  | objJsonResult.data = null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return objJsonResult; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #endregion | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #region 报工平台产量汇报保存/编辑 | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | 
|---|
|  |  |  | { | 
|---|
|  |  |  | objJsonResult.code = "0"; | 
|---|
|  |  |  | objJsonResult.count = 0; | 
|---|
|  |  |  | objJsonResult.Message = "保存失败!" + DBUtility.ClsPub.sExeReturnInfo; | 
|---|
|  |  |  | objJsonResult.Message = "保存失败!"; | 
|---|
|  |  |  | objJsonResult.data = 1; | 
|---|
|  |  |  | return objJsonResult; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | DataSet ds0 = oCN.RunProcReturn("select HPRDORGID,HDeptID from Sc_ICMOBillMain where HBillNo='"+ workcode + "'", "Sc_ICMOBillMain"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //查询产量汇报临时表 | 
|---|
|  |  |  | ds = oCN.RunProcReturn("select top1* from Sc_ICMOBillWorkQtyStatus_Tmp where HICMOReportInterID='"+ HInterID + "' and HICMOReportBillNo='" + ScMaxWork + "'", "Sc_ICMOBillWorkQtyStatus_Tmp"); | 
|---|
|  |  |  | ds = oCN.RunProcReturn("select top 1 * from  Sc_ICMOBillWorkQtyStatus_Tmp where HICMOReportInterID='" + HInterID + "' and HICMOReportBillNo='" + ScMaxWork + "'", "Sc_ICMOBillWorkQtyStatus_Tmp"); | 
|---|
|  |  |  | if (ds.Tables[0].Rows.Count <= 0) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | objJsonResult.code = "0"; | 
|---|
|  |  |  | 
|---|
|  |  |  | objJsonResult.data = null; | 
|---|
|  |  |  | return objJsonResult; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //调用WebService服务 | 
|---|
|  |  |  |  | 
|---|
|  |  |  | WebS.ClsSc_ICMOReportBillMain model = new WebS.ClsSc_ICMOReportBillMain(); | 
|---|
|  |  |  | model.HInterID = HInterID; | 
|---|
|  |  |  | model.HBillNo = ScMaxWork; | 
|---|
|  |  |  | model.HYear= DBUtility.ClsPub.isLong(DateTime.Now.Year); | 
|---|
|  |  |  | model.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month); | 
|---|
|  |  |  | //model.HYear= DBUtility.ClsPub.isLong(DateTime.Now.Year); | 
|---|
|  |  |  | //model.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month); | 
|---|
|  |  |  | model.HDate = DateTime.Now; | 
|---|
|  |  |  | model.HRemark = ""; | 
|---|
|  |  |  | model.HMaker = HMaker; | 
|---|
|  |  |  | model.HEmpID = 0; | 
|---|
|  |  |  | model.HGroupID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HGroupID"]); | 
|---|
|  |  |  | model.HDeptID= DBUtility.ClsPub.isLong(ds0.Tables[0].Rows[0]["HDeptID"]); | 
|---|
|  |  |  | model.HPRDORGID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HPRDORGID"]); | 
|---|
|  |  |  | model.HPRDORGID = DBUtility.ClsPub.isLong(ds0.Tables[0].Rows[0]["HPRDORGID"]); | 
|---|
|  |  |  | model.HMainSourceInterID = HICMOInterID; | 
|---|
|  |  |  | model.HMainSourceEntryID = HICMOEntryID; | 
|---|
|  |  |  | WebS.WebService1 oWebs = new WebS.WebService1(); | 
|---|
|  |  |  | bool flag=oWebs.set_SaveICMOProductReportBill_Layui(model, sHSourceType, ref DBUtility.ClsPub.sErrInfo); | 
|---|
|  |  |  | if (flag) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | objJsonResult.code = "0"; | 
|---|
|  |  |  | objJsonResult.count = 0; | 
|---|
|  |  |  | objJsonResult.code = "1"; | 
|---|
|  |  |  | objJsonResult.count = 1; | 
|---|
|  |  |  | objJsonResult.Message = "保存成功!"; | 
|---|
|  |  |  | objJsonResult.data = 1; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | return objJsonResult; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #endregion | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #region [动态列表] | 
|---|
|  |  |  | [Route("Sc_MESBeginWorkBill/ReportFrom")] | 
|---|
|  |  |  | [HttpGet] | 
|---|
|  |  |  | public object ReportFrom() | 
|---|
|  |  |  | { | 
|---|
|  |  |  | List<string> columnNameList = new List<string>(); | 
|---|
|  |  |  | try | 
|---|
|  |  |  | { | 
|---|
|  |  |  | //根据选择资源ID获取当前生产工单、责任人 | 
|---|
|  |  |  | ds = oCN.RunProcReturn("select HItemID,HNumber,HName,HRemark,HUseFlag,HBirthDay   from Gy_Employee where HItemID=9999", "Gy_Employee"); | 
|---|
|  |  |  | string aa = ds.Tables[0].Columns[0].ToString(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | foreach (DataColumn col in ds.Tables[0].Columns) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | columnNameList.Add(col.ColumnName);//获取到DataColumn列对象的列名 | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (ds.Tables[0].Rows.Count > 0) | 
|---|
|  |  |  | { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | objJsonResult.code = "1"; | 
|---|
|  |  |  | objJsonResult.count = 1; | 
|---|
|  |  |  | objJsonResult.Message = "获取资源绑定数据成功!"; | 
|---|
|  |  |  | objJsonResult.data = ds; | 
|---|
|  |  |  | objJsonResult.list = columnNameList; | 
|---|
|  |  |  | return objJsonResult; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else | 
|---|
|  |  |  | { | 
|---|
|  |  |  | objJsonResult.code = "0"; | 
|---|
|  |  |  | objJsonResult.count = 0; | 
|---|
|  |  |  | objJsonResult.Message = "暂无资源绑定!"; | 
|---|
|  |  |  | objJsonResult.data = null; | 
|---|
|  |  |  | objJsonResult.list = columnNameList; | 
|---|
|  |  |  | return objJsonResult; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | catch (Exception e) | 
|---|
|  |  |  | { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | objJsonResult.code = "0"; | 
|---|
|  |  |  | objJsonResult.count = 0; | 
|---|
|  |  |  | objJsonResult.Message = e.Message.ToString(); | 
|---|
|  |  |  | objJsonResult.data = null; | 
|---|
|  |  |  | objJsonResult.list = columnNameList; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return objJsonResult; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #endregion | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|