DAL/基础资料/公用基础资料/ClsGy_MaterType_Ctl.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Model/基础资料/基础资料/ClsGy_MaterType_Model.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Controllers/Sc_ProcessMangementController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Controllers/基础资料/基础资料/Gy_MaterTypeBillController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Controllers/基础资料/工资基础资料/Gy_ProcPriceController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Controllers/生产管理/生产任务单/Sc_ICMOBillController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/WebAPI.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
DAL/»ù´¡×ÊÁÏ/¹«Óûù´¡×ÊÁÏ/ClsGy_MaterType_Ctl.cs
@@ -20,9 +20,9 @@ oCn.BeginTran(); oCn.RunProc("Insert into " + MvarItemKey + " " + " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + ",HLevel,HEndFlag,HStopflag,HRemark) " + ",HLevel,HEndFlag,HStopflag,HRemark,HMakeEmp,HMakeTime,HStopEmp,HStopTime,HUSEORGID,HCREATEORGID,HUseFlag) " + " Values('" + oModel.HNumber + "','" + oModel.HName + "','" + oModel.HHelpCode + "','" + oModel.HShortNumber + "'," + oModel.HParentID.ToString() + "," + oModel.HLevel.ToString() + "," + Convert.ToString(oModel.HEndFlag ? 1 : 0) + "," + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",'" + oModel.HRemark + "')", ref DBUtility.ClsPub.sExeReturnInfo); "," + oModel.HLevel.ToString() + "," + Convert.ToString(oModel.HEndFlag ? 1 : 0) + "," + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",'" + oModel.HRemark + "','"+ oModel.HMakeEmp.ToString() + "',getdate(),'" + (oModel.HStopflag==true? oModel.HMakeEmp.ToString():"") + "','"+ (oModel.HStopflag == true ? DateTime.Now.ToString() : "") + "',"+ oModel.HUSEORGID + "," + oModel.HCREATEORGID + ",'"+ oModel.HUseFlag + "')", ref DBUtility.ClsPub.sExeReturnInfo); //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo); oCn.Commit(); @@ -49,6 +49,12 @@ ",HLevel=" + oModel.HLevel.ToString() + ",HParentID=" + oModel.HParentID.ToString() + ",HEndflag=" + Convert.ToString(oModel.HEndFlag ? 1 : 0) + ",HModifyEmp='" + oModel.HMakeEmp.ToString() + "'" + ",HModifyTime= getdate()" + ",HStopEmp='" + (oModel.HStopflag == true ? oModel.HMakeEmp : "") + "'" + ",HStopTime='" + (oModel.HStopflag == true ? DateTime.Now.ToString() : "") + "'" + ",HUSEORGID=" + oModel.HUSEORGID + ",HUseFlag='" + oModel.HUseFlag + "'" + ",HStopflag=" + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",HRemark= '" + oModel.HRemark + "' Where HItemID=" + sItemID, ref DBUtility.ClsPub.sExeReturnInfo); //ä¿®æ¹å项ç®ä»£ç Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_MaterType_Model.cs
@@ -7,6 +7,15 @@ { public class ClsGy_MaterType_Model : DBUtility.ClsGy_Base_Model { public long HUSEORGID { get; set; } public long HCREATEORGID { get; set; } public string HMakeEmp { get; set; } public DateTime HMakeTime { get; set; } public string HCheckEmp { get; set; } public DateTime HCheckTime { get; set; } public string HModifyEmp { get; set; } public DateTime HModifyTime { get; set; } public string HStopEmp { get; set; } public DateTime HStopTime { get; set; } } } WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
@@ -1246,7 +1246,7 @@ num++; } if (num > 0) if (num == 2) { if (!oBill.DeleteBill(long.Parse(HInterID), 0, 0, ref DBUtility.ClsPub.sExeReturnInfo)) { WebAPI/Controllers/Sc_ProcessMangementController.cs
@@ -276,7 +276,6 @@ // model.Add("FBillType", new JObject() { ["Fnumber"] = "SCHBD01_SYS" }); //åæ®ç±»åçäº§æ±æ¥âSCHBD02_SYSâ å ¥åºæ±æ¥SCHBD01_SYS // model.Add("FPrdOrgId", new JObject() { ["Fnumber"] = dr1["FPrdOrgNUMBER"].ToString() }); //ç产ç»ç»1 // model.Add("FDate", DateTime.Now.ToString("yyyy-MM-dd")); //åæ®æ¥æ1 // model.Add("FHZYMESFLAG", "æ¯");// æ¯å¦ä¸ºMES忥 // model.Add("FBillNo", BillNo); // JArray Fentity = new JArray(); @@ -304,19 +303,15 @@ // FentityModel.Add("FFailQty", item["ä¸è¯æ°é"].ToString());//ä¸åæ ¼æ°é // FentityModel.Add("FStockInOrgId ", new JObject() { ["Fnumber"] = OrganizationNUM });// å ¥åºç»ç» // FentityModel.Add("FStockId", new JObject() { ["Fnumber"] = dr1["FStockNUM"].ToString() }); // ä»åº // FentityModel.Add("FMOID", dr1["FMOID"].ToString());// // FentityModel.Add("FMOBILLNO", dr1["FMOBILLNO"].ToString());// // FentityModel.Add("FMOENTRYID", dr1["FMOENTRYID"].ToString());// // FentityModel.Add("FMOENTRYSEQ", dr1["FMOENTRYSEQ"].ToString());// // FentityModel.Add("FOwnerTypeId", dr1["FOWNERTYPEID"].ToString()); //货主类åï¼FOwnerTypeId(å¿ å¡«é¡¹) // FentityModel.Add("FOwnerId", new JObject() { ["Fnumber"] = dr1["FOwnerNumber"].ToString() }); //货主ï¼FOwnerId(å¿ å¡«é¡¹) // FentityModel.Add("FBomId", new JObject() { ["Fnumber"] = dr1["FBOMNUM"].ToString() }); //BOMçæ¬ï¼FBomId(å¿ å¡«é¡¹) // FentityModel.Add("FCostRate", dr1["FCostRate"].ToString());// ææ¬æé // FentityModel.Add("FISBACKFLUSH", dr1["FISBACKFLUSH"].ToString() == "1" ? true : false);// åå²é¢æ // FentityModel.Add("FMOMAINENTRYID", dr1["FMOENTRYID"].ToString());// // FentityModel.Add("F_bsv_Base1", new JObject() { ["Fnumber"] = dr1["FPREBDONENUMBER"].ToString() }); //å è£ æ è¯ // FentityModel.Add("FLot", new JObject() { ["FNumber"] = dr1["FBATCHNO"].ToString() }); //æ¹å· // FentityModel.Add("F_bsv_Text", dr1["å·¥åºæµè½¬å¡å·"].ToString()); //æµè½¬å¡å· // JArray Fentity2 = new JArray(); // JObject FentityModel2 = new JObject(); // FentityModel2.Add("FEntity_Link_FFlowId", "f6e6eec3-5267-4f02-8593-b633da508a72"); @@ -329,9 +324,6 @@ // FentityModel2.Add("FEntity_Link_FBaseQuaQtyOld", item["åæ ¼æ°é"].ToString()); // FentityModel2.Add("FEntity_Link_FBaseQuaQty", item["åæ ¼æ°é"].ToString()); // Fentity2.Add(FentityModel2); // FentityModel.Add("FEntity_Link", Fentity2); // FentityModel.Add("FBFLowId", new JObject() { ["FID"] = "f6e6eec3-5267-4f02-8593-b633da508a72" }); // // Fentity.Add(FentityModel); // } // model.Add("FEntity", Fentity); //æç»ä¿¡æ¯ // JObject jsonRoot = new JObject() @@ -631,7 +623,7 @@ if (double.Parse(DTable.Rows[0]["HQty"].ToString()) == 0) { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.count = 2; objJsonResult.Message = "åæ ¼æ°é为0,ä¸éè¦å ¥åºï¼"; objJsonResult.data = null; return objJsonResult; @@ -905,7 +897,7 @@ if (double.Parse(DTable.Rows[0]["HWasterQty"].ToString()) == 0) { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.count = 2; objJsonResult.Message = "æ¥åºæ°é为0,ä¸éè¦å ¥åºï¼"; objJsonResult.data = null; return objJsonResult; WebAPI/Controllers/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/Gy_MaterTypeBillController.cs
New file @@ -0,0 +1,360 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Web; using System.Web.Http; using WebAPI.Models; namespace WebAPI.Controllers.åºç¡èµæ.åºç¡èµæ { public class Gy_MaterTypeBillController : ApiController { private json objJsonResult = new json(); SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); DataSet ds; #region ç©æåç±»å表 [Route("Gy_MaterType/Gy_MaterTypeList")] [HttpGet] public object Gy_MaterTypeList(string sWhere, string user, string Organization) { try { List<object> columnNameList = new List<object>(); //ç¼è¾æé if (!DBUtility.ClsPub.Security_Log_second("Gy_MaterType_Query", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æ¥çæéï¼"; objJsonResult.data = null; return objJsonResult; } string sql1 = string.Format(@"select * from h_v_IF_MaterType where 使ç¨ç»ç»='" + Organization + "'"); ds = oCN.RunProcReturn(sql1 + sWhere + " order by HItemID ", "h_v_IF_MaterType"); //æ·»å åå 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 = "1"; objJsonResult.count = 1; objJsonResult.Message = "Sucessï¼"; objJsonResult.list = columnNameList; objJsonResult.data = ds.Tables[0]; return objJsonResult; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "Exceptionï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region ç©æåç±» ä¿å/ç¼è¾ [Route("Gy_MaterType/SaveGy_MaterType")] [HttpPost] public object SaveGy_MaterType([FromBody] JObject msg) { DataSet ds; var _value = msg["msg"].ToString(); string msg3 = _value.ToString(); string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); string msg1 = sArray[0].ToString();//æ°æ® string msg2 = sArray[1].ToString();//ç¨æ· string msg_HUSEORGID = sArray[2].ToString();//ç»ç» SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); //ç¼è¾æé if (!DBUtility.ClsPub.Security_Log_second("Gy_MaterType_Edit", 1, false, msg2)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ ä¿åæéï¼"; objJsonResult.data = null; return objJsonResult; } try { DAL.ClsGy_MaterType_Ctl oBill = new DAL.ClsGy_MaterType_Ctl(); List<Model.ClsGy_MaterType_Model> lsmain = new List<Model.ClsGy_MaterType_Model>(); msg1 = msg1.Replace("\\", ""); msg1 = msg1.Replace("\n", ""); //\n msg1 = "[" + msg1 + "]"; lsmain = JsonConvert.DeserializeObject<List<Model.ClsGy_MaterType_Model>>(msg1); foreach (Model.ClsGy_MaterType_Model oItem in lsmain) { if (oItem.HNumber.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼ä»£ç ä¸è½ä¸ºç©ºï¼"; objJsonResult.data = 1; return objJsonResult; } if (oItem.HName.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼åç§°ä¸è½ä¸ºç©ºï¼"; objJsonResult.data = 1; return objJsonResult; } if (!DBUtility.ClsPub.AllowNumber(oItem.HNumber.Trim())) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼ä»£ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼"; objJsonResult.data = 1; return objJsonResult; } //æ¥è¯¢æ°æ®ä¸æ¯å¦åå¨éå¤ä»£ç ds = oCN.RunProcReturn("select * from Gy_MaterType where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_MaterType"); if (ds.Tables[0].Rows.Count > 0) { if (oItem.HItemID == 0 || (ds.Tables[0].Rows[0]["HItemID"].ToString() != oItem.HItemID.ToString() && oItem.HItemID != 0)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼ä»£ç éå¤ï¼"; objJsonResult.data = 1; return objJsonResult; } } //å¾å°ç代ç string sShortNumber; sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim()); if (sShortNumber.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼ç代ç 为空ï¼"; objJsonResult.data = 1; return objJsonResult; } oItem.HCREATEORGID = Convert.ToInt32(msg_HUSEORGID); //ç»ç»id oItem.HShortNumber = sShortNumber;//ç代ç oItem.HMakeEmp = msg2; oItem.HEndFlag = true;//æ«çº§æ å¿ oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //ç级 oBill.oModel = oItem; } //ä¿å //ä¿å宿¯åå¤ç bool bResult; if (oBill.oModel.HItemID == 0) { bResult = oBill.AddNew(); } else { bResult = oBill.ModifyByID(oBill.oModel.HItemID); } if (bResult) { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "ä¿åæåï¼"; objJsonResult.data = 1; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = 1; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); objJsonResult.data = 1; return objJsonResult; } } #endregion #region ç©æåç±» å é¤ [Route("Gy_MaterType/DeleteMaterType")] [HttpGet] public object DeleteMaterType(string HItemID, string user) { DataSet ds; try { SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); //å 餿é if (!DBUtility.ClsPub.Security_Log("Gy_MaterType_Drop", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ å 餿é"; objJsonResult.data = null; return objJsonResult; } if (string.IsNullOrWhiteSpace(HItemID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HItemID为空ï¼"; objJsonResult.data = null; return objJsonResult; } oCN.BeginTran();//å¼å§äºå¡ ds = oCN.RunProcReturn("select * from Gy_MaterType where HItemID=" + HItemID, "Gy_MaterType"); if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ²¡ææ°æ®ï¼æ æ³å é¤ï¼"; objJsonResult.data = null; return objJsonResult; ; } var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]); if (HStopflag) { oCN.RollBack();//åæ»äºå¡ objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ°æ®å·²ç¦ç¨æ æ³å次å é¤ï¼"; objJsonResult.data = null; return objJsonResult; } oCN.RunProc("delete from Gy_MaterType where HItemID=" + HItemID); oCN.Commit();//æäº¤äºå¡ objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "* æ°æ®å 餿åï¼"; objJsonResult.data = null; return objJsonResult; ; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å é¤å¤±è´¥ï¼" + e.ToString(); 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("Gy_MaterType/AuditGy_MaterType")] [HttpGet] public object AuditGy_MaterType(int HInterID, int IsAudit, string CurUserName) { try { //å®¡æ ¸æé if (!DBUtility.ClsPub.Security_Log_second("Gy_MaterType_Check", 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } var ds = oCN.RunProcReturn("select * from Gy_MaterType where HItemID=" + HInterID, "Gy_MaterType"); if (ds.Tables[0].Rows.Count>0) { if (IsAudit == 0) //å®¡æ ¸å¤æ { if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½åæ¬¡å®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } } if (IsAudit == 1) //åå®¡æ ¸å¤æ { if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªå®¡æ ¸!ä¸éè¦åå®¡æ ¸!"; objJsonResult.data = null; return objJsonResult; } } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®ä¸åå¨!"; objJsonResult.data = null; return objJsonResult; } oCN.BeginTran(); if (IsAudit == 0) //å®¡æ ¸å¤æ { oCN.RunProc("update Gy_MaterType set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸æå"; objJsonResult.data = null; } if (IsAudit == 1) //åå®¡æ ¸å¤æ { oCN.RunProc("update Gy_MaterType set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "åå®¡æ ¸æå"; objJsonResult.data = null; } oCN.Commit(); return objJsonResult; } catch (Exception e) { oCN.RollBack(); objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥æè åå®¡æ ¸å¤±è´¥ï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion } } WebAPI/Controllers/»ù´¡×ÊÁÏ/¹¤×Ê»ù´¡×ÊÁÏ/Gy_ProcPriceController.cs
@@ -189,44 +189,9 @@ try { List<object> columnNameList = new List<object>(); //ds = oCN.RunProcReturn("select " + // "a.HItemID,ltrim(a.HMaterID)+'-'+ltrim(a.HProcID) å·¥åºå·¥ä»·èµæä»£ç ,a.HDeptID,b.HName HDeptName" + // ",a.HMaterID HMaterIDCol,c.HNumber HMaterNumberCol,c.HName HMaterNameCol,c.HModel HMaterModelCol" + // ",a.HProcID HProcIDCol,d.HNumber HProcNumberCol,d.HName HProcNameCol" + // ",a.HSourceID HSourceIDCol,e.HNumber HSourceNumberCol,e.HName HSourceNameCol" + // ",a.HPrice HPriceCol,a.HBeginDate HBeginDateCol,a.HEndDate HEndDateCol" + // ",case when a.HCostFlag<>0 then 'true'else 'false'end HCostFlagCol" + // ",case when a.HFlowFlag<>0 then 'true'else 'false'end HFlowFlagCol" + // ",case when a.HPayFlag<>0 then 'true'else 'false'end HPayFlagCol,a.HRemark HRemarkCol " + // " from Gy_ProcPrice a " + // " left join Gy_Department b on a.HDeptID = b.HItemID " + // " left join Gy_Material c on a.HMaterID = c.HItemID " + // " left join Gy_Process d on a.HProcID = d.HItemID " + // " left join Gy_Source e on a.HSourceID = e.HItemID where a.HItemID = " + HItemID, "Gy_ProcPrice"); ds = oCN.RunProcReturn("select " + "a.HItemID,ltrim(a.HMaterID)+'-'+ltrim(a.HProcID) å·¥åºå·¥ä»·èµæä»£ç ,a.HDeptID,b.HName é¨é¨" + ",a.HMaterID HMaterIDCol,c.HNumber ç©æä»£ç ,c.HName ç©æåç§°,c.HModel è§æ ¼åå·" + ",a.HProcID HProcIDCol,d.HNumber å·¥åºä»£ç ,d.HName å·¥åºåç§°" + ",a.HSourceID HSourceIDCol,e.HNumber èµæºä»£ç ,e.HName èµæºåç§°" + ",a.HPrice åä»·,a.HBeginDate å¼å§æ¥æ,a.HEndDate ç»ææ¥æ" + ",case when a.HCostFlag<>0 then 'true'else 'false'end ææ¬å¿ é" + ",case when a.HFlowFlag<>0 then 'true'else 'false'end æµè½¬é»è®¤" + ",case when a.HPayFlag<>0 then 'true'else 'false'end å·¥èµé»è®¤,a.HRemark 夿³¨ " + " from Gy_ProcPrice a " + " left join Gy_Department b on a.HDeptID = b.HItemID " + " left join Gy_Material c on a.HMaterID = c.HItemID " + " left join Gy_Process d on a.HProcID = d.HItemID " + " left join Gy_Source e on a.HSourceID = e.HItemID where a.HItemID = " + HItemID, "Gy_ProcPrice"); if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ å表信æ¯ï¼"; objJsonResult.data = null; return objJsonResult; } else { ds = oCN.RunProcReturn("select * from h_v_Gy_ProcPriceList where HItemID = " + HItemID, "h_v_Gy_ProcPriceList"); //æ·»å åå foreach (DataColumn col in ds.Tables[0].Columns) { @@ -242,7 +207,6 @@ objJsonResult.list = columnNameList; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; @@ -253,5 +217,203 @@ } } #endregion #region å·¥åºå·¥ä»· å é¤ [Route("Gy_ProcPrice/DelProcPrice")] [HttpGet] public object DelProcPrice(int HInterID, string User) { try { //å 餿é if (!DBUtility.ClsPub.Security_Log_second("Gy_ProcPriceList_Delete", 1, false, User)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æéå é¤ï¼"; objJsonResult.data = null; return objJsonResult; } DAL.ClsGy_ProcPrice_Ctl BillNew = new DAL.ClsGy_ProcPrice_Ctl(); var sReturn = ""; if (BillNew.ShowBill(HInterID, ref sReturn)) { foreach (Model.ClsGy_ProcPrice_Model oSub in BillNew.DetailColl) { if (oSub.HChecker.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å½ååæ®ä¸è½å é¤ï¼"; objJsonResult.data = null; return objJsonResult; } } bool flag = false; oCN.BeginTran();//å¼å¯äºå¡ flag= BillNew.DeleteByID(HInterID); oCN.Commit();//ç»æäºå¡ if (flag) { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "å 餿åï¼"; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å é¤å¤±è´¥ï¼"; objJsonResult.data = null; return objJsonResult; } } objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å½ååæ®ä¸åå¨,æ æ³å é¤ï¼"; objJsonResult.data = null; return objJsonResult; } catch (Exception e) { oCN.RollBack();//åæ»äºå¡ objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = e.ToString(); 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("Gy_ProcPrice/AuditGy_ProcPrice")] [HttpGet] public object AuditGy_ProcPrice(int HInterID, int IsAudit, string CurUserName) { try { //å®¡æ ¸æé if (!DBUtility.ClsPub.Security_Log_second("Gy_ProcPriceList_Check", 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } DBUtility.ClsPub.CurUserName = CurUserName; DAL.ClsGy_ProcPrice_Ctl BillNew = new DAL.ClsGy_ProcPrice_Ctl(); var sReturn = ""; if (BillNew.ShowBill(HInterID, ref sReturn)) { foreach (Model.ClsGy_ProcPrice_Model oSub in BillNew.DetailColl) { if (IsAudit == 0) //å®¡æ ¸å¤æ { if (oSub.HChecker.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½åæ¬¡å®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } } if (IsAudit == 1) //åå®¡æ ¸å¤æ { if (oSub.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; } foreach (Model.ClsGy_ProcPrice_Model oSub in BillNew.DetailColl) { if (IsAudit == 0) //å®¡æ ¸å¤æ { //å®¡æ ¸æäº¤ if (BillNew.CheckBill(HInterID, 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 (BillNew.AbandonCheck(HInterID, 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; return objJsonResult; } } #endregion } } WebAPI/Controllers/Éú²ú¹ÜÀí/Éú²úÈÎÎñµ¥/Sc_ICMOBillController.cs
@@ -143,6 +143,9 @@ return objJsonResult; } //ä¿®æ¹å段 HSTOCKINORGID oCN.RunProc("update Sc_ICMOBillSub set HSTOCKINORGID=" + HPRDORGID + " where HInterID=" + HInterID); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = null; WebAPI/WebAPI.csproj
@@ -470,6 +470,7 @@ <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_DutyBillController.cs" /> <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_EquipStatusController.cs" /> <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_MatePriceSupController.cs" /> <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_MaterTypeBillController.cs" /> <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_MouldStatusController.cs" /> <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_OperatorController.cs" /> <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_PaymentConditionListBillController.cs" /> @@ -927,6 +928,7 @@ <Folder Include="Views\Gy_ICBomBill\" /> <Folder Include="Views\Gy_MateMould\" /> <Folder Include="Views\Gy_MatePriceSup\" /> <Folder Include="Views\Gy_MaterTypeBill\" /> <Folder Include="Views\Gy_MouldStatus\" /> <Folder Include="Views\Gy_Operator\" /> <Folder Include="Views\Gy_PackType\" />