| | |
| | | try |
| | | { |
| | | //å¾å°mainid |
| | | //omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //omodel.HBillNo = DBUtility.ClsPub.CreateBillCode(BillType, ref DBUtility.ClsPub.sExeReturnInfo, true); |
| | | omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | |
| | | //ä¿ååæ§å¶========================================= |
| | | string HBillNote = ""; |
| | | DataSet ds = oCn.RunProcReturn("Exec h_p_Xs_SeOutStockBackBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Xs_SeOutStockBackBill_BeforeSaveCtrl "); |
| | | if (ds == null) |
| | | { |
| | | sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | sReturn = "ä¿å失败ï¼" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | return false; |
| | | } |
| | | //========================================================= |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | if (IsExistBillNo(ref DBUtility.ClsPub.sExeReturnInfo, omodel.HBillNo, Pub_Class.ClsPub.Enum_BillStatus.BillStatus_AddNew, omodel.HInterID)) |
| | | { |
| | |
| | | // |
| | | //æ´æ°è®¢åå
³èæ°é |
| | | //AddNewRelation(ref sReturn, omodel.HInterID); |
| | | // |
| | | |
| | | //=========================ä¿ååæ§å¶ |
| | | DataSet ds2 = oCn.RunProcReturn("Exec h_p_Xs_SeOutStockBackBill_AfterSaveCtr " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Xs_SeOutStockBackBill_AfterSaveCtr"); |
| | | if (ds2 == null) |
| | | { |
| | | sReturn = "ä¿ååæ§å¶å¤æå¤±è´¥ï¼"; |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | sReturn = "ä¿å失败2ï¼" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]); |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | //============================ |
| | | |
| | | sReturn = "æ°å¢åæ®æåï¼"; |
| | | oCn.Commit(); |
| | | return true; |
| | |
| | | //Type 1 å®¡æ ¸ 2 åå®¡æ ¸ |
| | | if (Type == 1) |
| | | { |
| | | if (!BillOld.CheckBill(int.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | //å®¡æ ¸åæ§å¶ |
| | | DataSet BeforeDs = oCN.RunProcReturn("Exec h_p_Xs_SeOutStockBackBill_BeforeCheckCtrl " + HInterID.ToString() + ",'" + user + "'", "h_p_Xs_SeOutStockBackBill_BeforeCheckCtrl"); |
| | | if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å®¡æ ¸åå¤æå¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | if (!BillOld.CheckBill(int.Parse(HInterID), BillOld.omodel.HBillNo, "h_p_Xs_SeOutStockBackBill_AfterCheckCtrl", user, ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | |
| | | } |
| | | else |
| | | { |
| | | if (BillOld.AbandonCheck(int.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | |
| | | //åå®¡æ ¸åæ§å¶ |
| | | DataSet BeforeDs = oCN.RunProcReturn("Exec h_p_Xs_SeOutStockBackBill_BeforeUnCheckCtrl " + HInterID.ToString() + ",'" + user + "'", "h_p_Xs_SeOutStockBackBill_BeforeUnCheckCtrl"); |
| | | if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åå®¡æ ¸åå¤æå¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åå®¡æ ¸å¤±è´¥ï¼" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | if (BillOld.AbandonCheck(int.Parse(HInterID), BillOld.omodel.HBillNo, "h_p_Xs_SeOutStockBackBill_AfterUnCheckCtrl", user, ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | //DataSet DSet = oCn.RunProcReturn("exec h_p_Sc_ICMOBill_AbandonCheckCtrl " + int.Parse(HInterID), "h_p_Sc_ICMOBill_AbandonCheckCtrl"); |
| | |
| | | ds = oCN.RunProcReturn("select * from h_v_IF_SeOutStockBillList where hmainid=" + HInterID + " and åæ®å·='" + HBillNo + "'", "h_v_IF_SeOutStockBillList"); |
| | | |
| | | |
| | | //ä¿ååæ§å¶========================================= |
| | | string HBillNote = ""; |
| | | ds = oCN.RunProcReturn("Exec h_p_Xs_SeOutStockBill_BeforeSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "','" + HBillNote + "',1 ", "h_p_Xs_SeOutStockBill_BeforeSaveCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿å失败!åå :ä¿ååå¤æå¤±è´¥ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿å失败!åå :" + ds.Tables[0].Rows[0]["HBackRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //========================================================= |
| | | |
| | | |
| | | |
| | | if ((OperationType == 1 || OperationType == 2) && ds.Tables[0].Rows.Count == 0)//æ°å¢ |
| | | { |
| | | //ä¿ååæ§å¶========================================= |
| | | string HBillNote = ""; |
| | | ds = oCN.RunProcReturn("Exec h_p_Xs_SeOutStockBill_BeforeSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "','" + HBillNote + "',1 ", "h_p_Xs_SeOutStockBill_BeforeSaveCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿å失败!åå :ä¿ååå¤æå¤±è´¥ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿å失败!åå :" + ds.Tables[0].Rows[0]["HBackRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //========================================================= |
| | | |
| | | |
| | | //主表 |
| | | string sql = $@"Insert Into Xs_SeOutStockBillMain |
| | | (HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate,HBillNo,HBillStatus |
| | |
| | | //Type 1 å®¡æ ¸ 2 åå®¡æ ¸ |
| | | if (Type == 1) |
| | | { |
| | | if (!BillOld.CheckBill(int.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | //å®¡æ ¸åæ§å¶ |
| | | DataSet BeforeDs = oCN.RunProcReturn("Exec h_p_Xs_SeOutStockBill_BeforeCheckCtrl " + HInterID.ToString() + ",'" + user + "'", "h_p_Xs_SeOutStockBill_BeforeCheckCtrl"); |
| | | if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å®¡æ ¸åå¤æå¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (!BillOld.CheckBill(int.Parse(HInterID), BillOld.omodel.HBillNo, "h_p_Xs_SeOutStockBill_AfterCheckCtrl", user, ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | |
| | | } |
| | | else |
| | | { |
| | | if (BillOld.AbandonCheck(int.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | //åå®¡æ ¸åæ§å¶ |
| | | DataSet BeforeDs = oCN.RunProcReturn("Exec h_p_Xs_SeOutStockBill_BeforeUnCheckCtrl " + HInterID.ToString() + ",'" + user + "'", "h_p_Xs_SeOutStockBill_BeforeUnCheckCtrl"); |
| | | if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åå®¡æ ¸åå¤æå¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åå®¡æ ¸å¤±è´¥ï¼" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | if (BillOld.AbandonCheck(int.Parse(HInterID), BillOld.omodel.HBillNo, "h_p_Xs_SeOutStockBill_AfterUnCheckCtrl", user, ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | //DataSet DSet = oCn.RunProcReturn("exec h_p_Sc_ICMOBill_AbandonCheckCtrl " + int.Parse(HInterID), "h_p_Sc_ICMOBill_AbandonCheckCtrl"); |
| | |
| | | int HMainSourceEntryID = mainList[0].HMainSourceEntryID; |
| | | string HMainSourceBillNo = mainList[0].HMainSourceBillNo; |
| | | string HMainSourceBillType = mainList[0].HMainSourceBillType; |
| | | int HOrderLevID = mainList[0].HOrderLevID; |
| | | int HHasten = mainList[0].HHasten; |
| | | int HOrderLevID = mainList[0].HOrderLevID == null ? 0 : mainList[0].HOrderLevID; |
| | | int HHasten = mainList[0].HHasten == null ? 0 : mainList[0].HHasten; |
| | | |
| | | |
| | | if (OperationType == 2) |
| | |
| | | "','" + HReceiveEmp + |
| | | "','" + HType + |
| | | "','" + HCopyEmp + |
| | | "','" + HRemark + |
| | | "','" + HRemark + |
| | | "'," + HOrgID + |
| | | ",'" + HMaker + |
| | | "','" + HMakerDate + |
| | |
| | | "," + HMainSourceEntryID + |
| | | ",'" + HMainSourceBillNo + |
| | | "','" + HMainSourceBillType + |
| | | "','" + HOrderLevID + |
| | | "','" + HHasten + |
| | | "','" + HOrderLevID + |
| | | "','" + HHasten + |
| | | "')"; |
| | | |
| | | //主表 |
| | |
| | | ",HMainSourceEntryID = " + HMainSourceEntryID + |
| | | ",HMainSourceBillNo = '" + HMainSourceBillNo + |
| | | "',HMainSourceBillType = '" + HMainSourceBillType + |
| | | "',HOrderLevID = '" + HOrderLevID + |
| | | "',HOrderLevID = '" + HOrderLevID + |
| | | "',HHasten = '" + HHasten + |
| | | "' where HInterID = " + HInterID; |
| | | |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region å·¥ä½å¨æ»ç» è·ååè¡¨æ°æ® |
| | | [Route("PM_WorkTaskWeekBill/PM_WorkReportWeekBillMainList")] |
| | | [HttpGet] |
| | | public object PM_WorkReportWeekBillMainList(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCn.RunProcReturn("select * from h_v_PM_WorkReportWeekBillMainList order by åæ®å· desc", "h_v_PM_WorkReportWeekBillMainList"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_PM_WorkReportWeekBillMainList where 1 = 1 "; |
| | | string sql = sql1 + sWhere + " order by åæ®å· desc"; |
| | | ds = oCn.RunProcReturn(sql, "h_v_PM_WorkReportWeekBillMainList"); |
| | | } |
| | | |
| | | //æ·»å åå |
| | | 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å对象çåå |
| | | } |
| | | |
| | | |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æªè·åå°å¨æ»ç»ç¸å
³æ°æ®ï¼"; |
| | | objJsonResult.data = null; |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | 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; |
| | | } |
| | | #endregion |
| | | |
| | | #region å·¥ä½å¨æ»ç» è·åç¼è¾åè¡¨æ°æ® |
| | | [Route("PM_WorkTaskWeekBill/PM_WorkReportWeekBillMainEditList")] |
| | | [HttpGet] |
| | | public object PM_WorkReportWeekBillMainEditList(string HInterID) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | ds = oCn.RunProcReturn("select * from h_v_PM_WorkReportWeekBillMainList where HInterID='" + HInterID + "'", "h_v_PM_WorkReportWeekBillMainList"); |
| | | //æ·»å åå |
| | | 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å对象çåå |
| | | } |
| | | |
| | | |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æªè·åå°å¨æ»ç»ç¸å
³æ°æ®ï¼"; |
| | | objJsonResult.data = null; |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | 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; |
| | | } |
| | | #endregion |
| | | |
| | | #region å·¥ä½å¨æ»ç» éæ©æ»ç»äººå¸¦åºå·¥æ¶ |
| | | [Route("PM_WorkTaskWeekBill/PM_WorkReportWeekBillMainList")] |
| | | [HttpGet] |
| | |
| | | |
| | | #region å·¥ä½å¨æ»ç»ä¿å/ç¼è¾ |
| | | /// <summary> |
| | | /// ä¿åçäº§é¢æå |
| | | /// ä¿åå·¥ä½å¨æ»ç» |
| | | /// </summary> |
| | | /// <param name="msg"></param> |
| | | /// <returns></returns> |
| | |
| | | oItem.HBillType = "4757"; |
| | | oItem.HBillSubType = "4757"; |
| | | |
| | | //oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); |
| | | |
| | | oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month); |
| | | oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); |
| | | |
| | |
| | | <WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected> |
| | | <NameOfLastUsedPublishProfile>FolderProfile</NameOfLastUsedPublishProfile> |
| | | <NameOfLastUsedPublishProfile>D:\Git\houduan\WebAPI\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile> |
| | | <NameOfLastUsedPublishProfile>D:\ç½ç«åå¸\å端代ç \MES-WEB-API\MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile> |
| | | <NameOfLastUsedPublishProfile>D:\æºäºè¿æ\MES\MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile> |
| | | <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig> |
| | | <UseIISExpress>false</UseIISExpress> |
| | | <Use64BitIISExpress /> |