Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
New file |
| | |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using Pub_Class; |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Data.SqlClient; |
| | | using System.Web.Http; |
| | | using WebAPI.Models; |
| | | |
| | | |
| | | namespace WebAPI.Controllers.CJGL |
| | | { |
| | | public class Cj_SendGoodsBillController : ApiController |
| | | { |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | |
| | | #region è½¦é´æ¶æå表 æ¥è¯¢ |
| | | //è¿æ»¤æ¡ä»¶ |
| | | public class JIT_SendGoodsBill |
| | | { |
| | | public DateTime HBeginDate; |
| | | public DateTime HEndDate; |
| | | public string HBillNo { get; set; } |
| | | public string HDeptName { get; set; } |
| | | public string MaterialCode { get; set; } |
| | | public string MaterialName { get; set; } |
| | | public string MaterialModel { get; set; } |
| | | public int? HOrgID; |
| | | } |
| | | |
| | | [Route("Cj_SendGoodsBill/Cj_SendGoodsBillList")] |
| | | [HttpGet] |
| | | public object Cj_SendGoodsBillList(string sWhere,string user) |
| | | { |
| | | try |
| | | { |
| | | //æ¥çæé |
| | | if (!DBUtility.ClsPub.Security_Log("JIT_SendGoodsBill_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æ¥çæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = new DataTable(); |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //ååºååä¼ éçå¼ |
| | | JIT_SendGoodsBill com = JsonConvert.DeserializeObject<JIT_SendGoodsBill>(sWhere.ToString()); |
| | | |
| | | ds = oCN.RunProcReturn($"exec h_p_JIT_DeptCheckGoodsBillList_Query '{com.HBeginDate}','{com.HEndDate.AddDays(1).AddSeconds(-1)}','{com.HBillNo}','{com.HDeptName}'," + |
| | | $"'{com.MaterialCode}','{com.MaterialName}','{com.MaterialModel}','{com.HOrgID}'", "h_p_JIT_DeptCheckGoodsBillList_Query"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | 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("Cj_SendGoodsBill/DeptCheckGoodsBillList_Check")] |
| | | [HttpGet] |
| | | public object DeptCheckGoodsBillList_Check(string HInterID,string HEntryID,string User) |
| | | { |
| | | try |
| | | { |
| | | //æ¥çæé |
| | | if (!DBUtility.ClsPub.Security_Log("JIT_SendGoodsBill_Check", 1, false, User)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ å®¡æ ¸æéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn($"exec h_p_JIT_DeptCheckGoodsBillList_Check '{HInterID}','{HEntryID}','{User}'", "h_p_JIT_DeptCheckGoodsBillList_Check"); |
| | | |
| | | objJsonResult.code = ds.Tables[0].Rows[0][0].ToString(); |
| | | objJsonResult.count = int.Parse(ds.Tables[0].Rows[0][0].ToString()); |
| | | objJsonResult.Message = ds.Tables[0].Rows[0][1].ToString(); |
| | | 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 |
| | | } |
| | | } |
| | |
| | | ComplementGoodBill com = JsonConvert.DeserializeObject<ComplementGoodBill>(sWhere.ToString()); |
| | | |
| | | ds = oCN.RunProcReturn($"exec h_p_JIT_CallGoodsPlatForm_Query '{com.HSeOrderBillNo}','{com.DepartmentName}','{com.MaterialNumber}','{com.MaterialName}'," + |
| | | $"'{com.MaterialModel}','{com.HICMOBillNo}','{com.CPNumber}','{com.CPName}','{com.CPModel}','{com.HBeginDate}','{com.HEndDate}'," + |
| | | $"'{com.MaterialModel}','{com.HICMOBillNo}','{com.CPNumber}','{com.CPName}','{com.CPModel}','{com.HBeginDate}','{com.HEndDate.AddDays(1).AddSeconds(-1)}'," + |
| | | $"{com.ps},{com.Organization},'{com.user}' ", "h_p_JIT_CallGoodsPlatForm_Query"); |
| | | |
| | | objJsonResult.code = "1"; |
| | |
| | | { |
| | | public int HSouceInterID = 0; |
| | | public int HSourceEntryID = 0; |
| | | public int Type = 0; |
| | | public string user { get; set; } |
| | | } |
| | | [Route("Sc_ComplementGoodBill/HlpBillList")] |
| | |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //ååºååä¼ éçå¼ |
| | | HlpBill com = JsonConvert.DeserializeObject<HlpBill>(sWhere.ToString()); |
| | | |
| | | ds = oCN.RunProcReturn($"exec h_p_JIT_CallGoodsPlatForm_DownQuery 0,0,'',0,0,{com.HSouceInterID},{com.HSourceEntryID}"+ |
| | | $",'{com.user}'", "h_p_JIT_CallGoodsPlatForm_DownQuery"); |
| | | |
| | | if (ds != null) |
| | | if (com.Type == 1) |
| | | { |
| | | if (ds.Tables[0].Rows.Count != 0) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | else if (ds.Tables[1].Rows.Count != 0) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[1]; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | //çäº§å«æå¹³å° ä¸æ¥ |
| | | ds = oCN.RunProcReturn($"exec h_p_JIT_CallGoodsPlatForm_DownQuery 0,0,'',0,0,{com.HSouceInterID},{com.HSourceEntryID}" + |
| | | $",'{com.user}'", "h_p_JIT_CallGoodsPlatForm_DownQuery"); |
| | | } |
| | | else if (com.Type == 2) |
| | | { |
| | | //æ£æé
é 䏿¥ |
| | | ds = oCN.RunProcReturn($"exec h_p_JIT_ComplementGoodsBillList_UpQuery '{com.HSouceInterID}',{com.HSourceEntryID}", "h_p_JIT_ComplementGoodsBillList_UpQuery"); |
| | | } |
| | | else if (com.Type == 3) |
| | | { |
| | | //æ£æé
é 䏿¥ |
| | | ds = oCN.RunProcReturn($"exec h_p_JIT_ComplementGoodsBillList_DownQuery '{com.HSouceInterID}',{com.HSourceEntryID}", "h_p_JIT_ComplementGoodsBillList_DownQuery"); |
| | | } |
| | | |
| | | //æ·»å åå |
| | | 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å对象çåå |
| | | } |
| | | |
| | | //type==1 åå¨è¿ç¨é颿¥è¯¢äºä¸¤æ¬¡ ææéè¦å¤æä¸¤å¼ è¡¨é½ææ²¡ææ°æ® |
| | | if (ds.Tables[0].Rows.Count != 0) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | else if ((com.Type == 1 ? ds.Tables[1].Rows.Count : ds.Tables[0].Rows.Count) != 0) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[1]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data =null; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); |
| | | |
| | | List<CallGoodsBill> listCa = new List<CallGoodsBill>(); |
| | | //è·åè¡¨æ ¼æ°æ®éå |
| | | listCa = JsonConvert.DeserializeObject<List<CallGoodsBill>>(msg2.ToString()); |
| | | int a = 0; |
| | | if (listCa.Count > 0) |
| | | ds = oCN.RunProcReturn("select * from h_v_IF_JIT_CallGoodsBillList ", "h_v_IF_JIT_CallGoodsBillList "); |
| | | |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | for (int i = 0; i < listCa.Count; i++) |
| | | { |
| | | long HInterID = DBUtility.ClsPub.CreateBillID_Prod("4602", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | string HBillNo = DBUtility.ClsPub.CreateBillCode_Prod("4602", ref DBUtility.ClsPub.sExeReturnInfo, true); |
| | | long HOutOrgID = int.Parse(listCa[i].HOutOrgID.ToString()); |
| | | long HWHID = int.Parse(listCa[i].HWHID.ToString()); |
| | | ds.Clear(); |
| | | long HInterID = DBUtility.ClsPub.CreateBillID_Prod("4602", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | string HBillNo = DBUtility.ClsPub.CreateBillCode_Prod("4602", ref DBUtility.ClsPub.sExeReturnInfo, true); |
| | | |
| | | oCN.RunProc($"exec h_p_JIT_ComplementGoods_Insert {HInterID},'{HBillNo}',{HOrgID},'{user}',{HOutOrgID},{HWHID}"); |
| | | a = 1; |
| | | } |
| | | ds= oCN.RunProcReturn($"exec h_p_JIT_ComplementGoods_Insert {HInterID},'{HBillNo}',{HOrgID},'{user}',0,0", "h_p_JIT_ComplementGoods_Insert"); |
| | | |
| | | if (a == 1) |
| | | { |
| | | 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 = ds.Tables[0].Rows[0][0].ToString(); |
| | | objJsonResult.count = int.Parse(ds.Tables[0].Rows[0][0].ToString()); |
| | | objJsonResult.Message = ds.Tables[0].Rows[0][1].ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); |
| | | |
| | | List<CallGoodsBill> listCa = new List<CallGoodsBill>(); |
| | | //è·åè¡¨æ ¼æ°æ®éå |
| | | listCa = JsonConvert.DeserializeObject<List<CallGoodsBill>>(msg2.ToString()); |
| | | int a = 0; |
| | | if (listCa.Count > 0) |
| | | ds = oCN.RunProcReturn("select * from JIT_CallGoodsBackBillMain ", "JIT_CallGoodsBackBillMain "); |
| | | |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | for (int i = 0; i < listCa.Count; i++) |
| | | { |
| | | long HInterID = DBUtility.ClsPub.CreateBillID_Prod("6666", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | string HBillNo = DBUtility.ClsPub.CreateBillCode_Prod("6666", ref DBUtility.ClsPub.sExeReturnInfo, true); |
| | | //long HOutOrgID = int.Parse(listCa[i].HOutOrgID.ToString()); |
| | | //long HWHID = int.Parse(listCa[i].HWHID.ToString()); |
| | | |
| | | oCN.RunProc($"exec h_p_JIT_GetCallGoodsBillCount_Back {HInterID},'{HBillNo}',{HOrgID},'{user}'"); |
| | | a = 1; |
| | | } |
| | | long HInterID = DBUtility.ClsPub.CreateBillID_Prod("6666", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | string HBillNo = DBUtility.ClsPub.CreateBillCode_Prod("6666", ref DBUtility.ClsPub.sExeReturnInfo, true); |
| | | //long HOutOrgID = int.Parse(listCa[i].HOutOrgID.ToString()); |
| | | //long HWHID = int.Parse(listCa[i].HWHID.ToString()); |
| | | |
| | | if (a == 1) |
| | | { |
| | | 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; |
| | | } |
| | | ds= oCN.RunProcReturn($"exec h_p_JIT_GetCallGoodsBillCount_Back {HInterID},'{HBillNo}',{HOrgID},'{user}'", "h_p_JIT_GetCallGoodsBillCount_Back"); |
| | | |
| | | objJsonResult.code = ds.Tables[0].Rows[0][0].ToString(); |
| | | objJsonResult.count = int.Parse(ds.Tables[0].Rows[0][0].ToString()); |
| | | objJsonResult.Message = ds.Tables[0].Rows[0][1].ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | |
| | | //ååºååä¼ éçå¼ |
| | | ComplementGoods com = JsonConvert.DeserializeObject<ComplementGoods>(sWhere.ToString()); |
| | | |
| | | |
| | | |
| | | ds = oCN.RunProcReturn($"exec h_p_JIT_ComplementGoodsBillList_Query '{com.MaterialNumber}','{com.MaterialName}','{com.MaterialModel}','{com.HGD}'," + |
| | | $"'{com.HWHName}','{com.HDeptName}','{com.Organization}','{com.user}','{com.HJLStatus}','{com.HBeginDate}','{com.HEndDate}'" ,"h_p_JIT_ComplementGoodsBillList_Query"); |
| | | $"'{com.HWHName}','{com.HDeptName}','{com.Organization}','{com.user}','{com.HJLStatus}','{com.HBeginDate}','{com.HEndDate}'", "h_p_JIT_ComplementGoodsBillList_Query"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | #region æ£æé
éå å é¤ |
| | | [Route("Sc_ComplementGoods/DelComplementGoodsList")] |
| | | [HttpGet] |
| | | public object DelComplementGoodsList(string HInterID, string HEntryID,string HOrgID, string user) |
| | | public object DelComplementGoodsList(string HInterID, string HEntryID, string HOrgID, string user) |
| | | { |
| | | try |
| | | { |
| | |
| | | |
| | | ds = oCN.RunProcReturn($"select HISCheck from JIT_SendGoodsBillMain where HMainSourceInterID={HInterID} ", "JIT_SendGoodsBillMain"); |
| | | |
| | | if (ds.Tables[0].Rows.Count>0) |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | |
| | | #region ä»åºåæ |
| | | //åæ° |
| | | public class SendGoodsBill { |
| | | public class SendGoodsBill |
| | | { |
| | | public int? æªæ£ææ°é = 0; |
| | | public int? æå¤§æ£ææ°é = 0; |
| | | public int? æ¬æ¬¡æ£ææ°é = 0; |
| | |
| | | { |
| | | oCN.BeginTran(); |
| | | |
| | | oCN.RunProc($"delete from JIT_SendGoodsBillMain where HMainSourceInterID={SourceInterID} and HMainSourceBillNo='{SourceBillNo}'"); |
| | | //oCN.RunProc($"delete from JIT_SendGoodsBillMain where HMainSourceInterID={SourceInterID} and HMainSourceBillNo='{SourceBillNo}' and HBillStatus=1"); |
| | | |
| | | oCN.RunProc($"delete from JIT_SendGoodsBillSub where HInterID in (select HInterID from JIT_SendGoodsBillMain where HMainSourceInterID={SourceInterID} and HMainSourceBillNo='{SourceBillNo}')"); |
| | | //oCN.RunProc($"delete from JIT_SendGoodsBillSub where HInterID in (select HInterID from JIT_SendGoodsBillMain where HMainSourceInterID={SourceInterID} and HMainSourceBillNo='{SourceBillNo}' and HBillStatus=1)"); |
| | | |
| | | ds = oCN.RunProcReturn($"select a.HMainSourceEntryID,b.HMaterID from JIT_SendGoodsBillMain a with(nolock) inner join JIT_SendGoodsBillSub b with(nolock) on a.HInterID = b.HInterID where a.HMainSourceInterID={SourceInterID} and a.HBillStatus=1", "JIT_SendGoodsBillMain"); |
| | | |
| | | for (int i = 0; i < listCa.Count; i++) |
| | | { |
| | | long InterID = DBUtility.ClsPub.CreateBillID_Prod("460201", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | string HBillNo = DBUtility.ClsPub.CreateBillCode_Prod("460201", ref DBUtility.ClsPub.sExeReturnInfo, true); |
| | | int a = -1; |
| | | for (int j = 0; j < ds.Tables[0].Rows.Count; j++) |
| | | { |
| | | if (ds.Tables[0].Rows[j]["HMaterID"].ToString() == listCa[i].HMaterID.ToString()&& ds.Tables[0].Rows[j]["HMainSourceEntryID"].ToString() == listCa[i].HEntryID.ToString()) |
| | | { |
| | | a = j; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | //æ·»å ä¸»è¡¨æ°æ® |
| | | oCN.RunProc("insert into JIT_SendGoodsBillMain(HYear,HPeriod,HBillType,HBillSubType,HInterID,HDate" + |
| | | ",HBillNo,HBillStatus,HMaker,HMakeDate,HISCheck, HMainSourceInterID, HMainSourceEntryID" + |
| | | ", HMainSourceBillNo, HMainSourceBillType)" + |
| | | $"values({DateTime.Now.Year},{DateTime.Now.Month},'460201','460201',{InterID}, GETDATE(), '{HBillNo}'," + |
| | | $" 0,'{user}', GETDATE(), 0, {SourceInterID}, {listCa[i].HEntryID}, '{SourceBillNo}', '4602')"); |
| | | //a=0 å代表é
éåæ²¡ææ°æ® éè¦æ·»å æ°æ® |
| | | if (a == -1 ) |
| | | { |
| | | long InterID = DBUtility.ClsPub.CreateBillID_Prod("460201", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | string HBillNo = DBUtility.ClsPub.CreateBillCode_Prod("460201", ref DBUtility.ClsPub.sExeReturnInfo, true); |
| | | |
| | | //æ·»å åè¡¨æ°æ® |
| | | oCN.RunProc("insert into JIT_SendGoodsBillSub(HInterID,HBillNo_bak,HEntryID" + |
| | | ",HMaterID,HQty,HWHID,HSPID,HISCheck,HCheckSubMan,HCheckSubDate)" + |
| | | $"values({InterID},'{HBillNo}',{i}, {listCa[i].HMaterID},{listCa[i].æ¬æ¬¡æ£ææ°é}," + |
| | | $" {listCa[i].HWHID},{listCa[i].HSPID},0,'{user}', GETDATE())"); |
| | | //æ·»å ä¸»è¡¨æ°æ® |
| | | oCN.RunProc("insert into JIT_SendGoodsBillMain(HYear,HPeriod,HBillType,HBillSubType,HInterID,HDate" + |
| | | ",HBillNo,HBillStatus,HMaker,HMakeDate,HISCheck, HMainSourceInterID, HMainSourceEntryID" + |
| | | ", HMainSourceBillNo, HMainSourceBillType)" + |
| | | $"values({DateTime.Now.Year},{DateTime.Now.Month},'460201','460201',{InterID}, GETDATE(), '{HBillNo}'," + |
| | | $" 1,'{user}', GETDATE(), 0, {SourceInterID}, {listCa[i].HEntryID}, '{SourceBillNo}', '4602')"); |
| | | |
| | | //æ·»å åè¡¨æ°æ® |
| | | oCN.RunProc("insert into JIT_SendGoodsBillSub(HInterID,HBillNo_bak,HEntryID" + |
| | | ",HMaterID,HQty,HWHID,HSPID,HISCheck,HCheckSubMan,HCheckSubDate)" + |
| | | $"values({InterID},'{HBillNo}',{i + 1}, {listCa[i].HMaterID},{listCa[i].æ¬æ¬¡æ£ææ°é}," + |
| | | $" {listCa[i].HWHID},{listCa[i].HSPID},0,'{user}', GETDATE())"); |
| | | } |
| | | else |
| | | { |
| | | //ä¿®æ¹é
éåçé
éæ°é |
| | | oCN.RunProc($"update b set b.HQty=b.HQty+{listCa[i].æ¬æ¬¡æ£ææ°é} from JIT_SendGoodsBillMain a with(nolock) inner join JIT_SendGoodsBillSub b with(nolock) on a.HInterID = b.HInterID " + |
| | | $"where HMainSourceInterID ={SourceInterID} and b.HMaterID ={listCa[i].HMaterID} and a.HBillStatus =1 "); |
| | | } |
| | | //ä¿®æ¹è°æ¨æ°é |
| | | oCN.RunProc($"update JIT_ComplementGoodsBillSub_LK set HSendQTY={listCa[i].æ¬æ¬¡æ£ææ°é} where HMaterID={listCa[i].HMaterID} " + |
| | | oCN.RunProc($"update JIT_ComplementGoodsBillSub_LK set HSendQTY=HSendQTY+{listCa[i].æ¬æ¬¡æ£ææ°é} where HMaterID={listCa[i].HMaterID} " + |
| | | $" and HSourceInterID=(select top 1 HSourceInterID from JIT_ComplementGoodsBillSub_LK " + |
| | | $"where HMaterID={listCa[i].HMaterID} order by HSourceInterID ) and HInterID={SourceInterID}"); |
| | | $"where HMaterID={listCa[i].HMaterID} and HInterID={SourceInterID} order by HSourceInterID ) and HInterID={SourceInterID} "); |
| | | } |
| | | |
| | | sReturn = "æ°å¢åæ®æåï¼"; |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | sReturn = e.Message; |
| | | throw (e); |
| | | } |
| | |
| | | #region 䏿¥ |
| | | [Route("Sc_ComplementGoods/ComplementGoodsList_Sc")] |
| | | [HttpGet] |
| | | public object ComplementGoodsList_Sc(string HInterID,string HEntryID) |
| | | public object ComplementGoodsList_Sc(string HInterID, string HMaterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn($"exec h_p_JIT_ComplementGoodsBillList_UpQuery '{HInterID}',{HEntryID}", "h_p_JIT_ComplementGoodsBillList_UpQuery"); |
| | | ds = oCN.RunProcReturn($"exec h_p_JIT_ComplementGoodsBillList_UpQuery '{HInterID}',{HMaterID}", "h_p_JIT_ComplementGoodsBillList_UpQuery"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | 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("Sc_ComplementGoods/JIT_SendGoodsBillList_Xc")] |
| | | [HttpGet] |
| | | public object JIT_SendGoodsBillList_Xc(string HInterID, string HMaterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn($"exec h_p_JIT_ComplementGoodsBillList_DownQuery '{HInterID}',{HMaterID}", "h_p_JIT_ComplementGoodsBillList_DownQuery"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | <Compile Include="Controllers\CJGL\Cj_CallGoodsBillMainController.cs" /> |
| | | <Compile Include="Controllers\CJGL\Cj_ComplementGoodsBillController.cs" /> |
| | | <Compile Include="Controllers\CJGL\Cj_NoPassProcController.cs" /> |
| | | <Compile Include="Controllers\CJGL\Cj_SendGoodsBillController.cs" /> |
| | | <Compile Include="Controllers\CJGL\Sc_ProcessExchangeBillController.cs" /> |
| | | <Compile Include="Controllers\CJGL\Cj_StationOutBillController.cs" /> |
| | | <Compile Include="Controllers\CJGL\Cj_StationInBillController.cs" /> |
| | |
| | | <Folder Include="Views\Cj_CallGoodsBillBack\" /> |
| | | <Folder Include="Views\Cj_CallGoodsBillMain\" /> |
| | | <Folder Include="Views\Cj_ComplementGoodsBill\" /> |
| | | <Folder Include="Views\Cj_SendGoodsBill\" /> |
| | | <Folder Include="Views\Gy_EquipType\" /> |
| | | <Folder Include="Views\Gy_ICBomBill\" /> |
| | | <Folder Include="Views\Gy_RoutingGroup\" /> |
| | |
| | | // MessageBox.Show("æ¥æ¶ä¸ªæ°ä¸è½ä¸º0ï¼", "æç¤º"); |
| | | // return false; |
| | | //} |
| | | if (DBUtility.ClsPub.isDoule(txtHQty.Text.Trim()) + DBUtility.ClsPub.isDoule(txtHWasterQty.Text.Trim()) <= 0) |
| | | if (DBUtility.ClsPub.isDoule(txtHQty.Text.Trim()) |
| | | + DBUtility.ClsPub.isDoule(txtHWasterQty.Text.Trim()) |
| | | + DBUtility.ClsPub.isDoule(txtHBadCount.Text) <= 0) |
| | | { |
| | | MessageBox.Show("æ¥æ¶ä¸ªæ°ä¸è½ä¸º0ï¼", "æç¤º"); |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isDoule(txtHQty.Text.Trim()) < 0) |
| | | { |
| | | MessageBox.Show("æ¥æ¶ä¸ªæ°ä¸è½å°äº0ï¼", "æç¤º"); |
| | | MessageBox.Show("æ¥æ¶åæ ¼ä¸ªæ°ä¸è½å°äº0ï¼", "æç¤º"); |
| | | return false; |
| | | } |
| | | //if (DBUtility.ClsPub.isDoule(txtHQty.Text.Trim()) > DBUtility.ClsPub.isDoule(txtHPlanQty.Text.Trim())) |
| | |
| | | MessageBox.Show("ä¸åæ ¼æ°ä¸è½å°äº0ï¼", "æç¤º"); |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isDoule(txtHBadCount.Text.Trim()) < 0) |
| | | { |
| | | MessageBox.Show("ä¸è¯åæ°ä¸è½å°äº0ï¼", "æç¤º"); |
| | | return false; |
| | | } |
| | | //if (DBUtility.ClsPub.isDoule(txtHWasterQty.Text.Trim()) > DBUtility.ClsPub.isDoule(txtHPlanQty.Text.Trim())) |
| | | //{ |
| | | // MessageBox.Show("ä¸åæ ¼æ°ä¸è½å¤§äºè®¡åæ°éï¼", "æç¤º"); |
| | |
| | | MessageBox.Show("å·¥ä½ä¸å¿æ²¡æéæ©ï¼", "æç¤º"); |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isDoule(txtHQty.Text) + DBUtility.ClsPub.isDoule(txtHWasterQty.Text) + DBUtility.ClsPub.isDoule(txtHBadCount.Text) <= 0) |
| | | if (DBUtility.ClsPub.isDoule(txtHQty.Text) |
| | | + DBUtility.ClsPub.isDoule(txtHWasterQty.Text) |
| | | + DBUtility.ClsPub.isDoule(txtHBadCount.Text) <= 0) |
| | | { |
| | | MessageBox.Show("æ°éä¸è½ä¸º0ï¼", "æç¤º"); |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isDoule(txtHQty.Text.Trim()) < 0) |
| | | { |
| | | MessageBox.Show("åæ ¼ä¸ªæ°ä¸è½å°äº0ï¼", "æç¤º"); |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isDoule(txtHWasterQty.Text.Trim()) < 0) |
| | | { |
| | | MessageBox.Show("ä¸åæ ¼æ°ä¸è½å°äº0ï¼", "æç¤º"); |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isDoule(txtHBadCount.Text.Trim()) < 0) |
| | | { |
| | | MessageBox.Show("ä¸è¯åæ°ä¸è½å°äº0ï¼", "æç¤º"); |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isDoule(txtHWorkTimes.Text) <= 0) |
| | | { |
| | | MessageBox.Show("å·¥æ¶å¿
须大äº0ï¼", "æç¤º"); |
| | |
| | | return false; |
| | | } |
| | | //txtHMateOutBatchNo |
| | | if (DBUtility.ClsPub.isStrNull(txtHMateOutBatchNo.Text) == "") |
| | | { |
| | | MessageBox.Show("åææ¹æ¬¡ä¸è½ä¸ºç©ºï¼", "æç¤º"); |
| | | return false; |
| | | } |
| | | //if (DBUtility.ClsPub.isStrNull(txtHMateOutBatchNo.Text) == "") |
| | | //{ |
| | | // MessageBox.Show("åææ¹æ¬¡ä¸è½ä¸ºç©ºï¼", "æç¤º"); |
| | | // return false; |
| | | //} |
| | | |
| | | } |
| | | //忮巿¯å¦éå¤ |