| | |
| | | { |
| | | if (num == 1) |
| | | { |
| | | ds = oCN.RunProcReturn($"select isnull(DATEDIFF(DAY,GETDATE(),CONVERT(varchar(10),max(HMasterDate),20)),0) DayNum from Sc_WorkBillSortBillSub where HInterID in ({sWhere}) and HMasterDate>=CONVERT(varchar(10),GETDATE(),20) and HLockedSub=1", "Sc_WorkBillSortBillSub"); |
| | | ds = oCN.RunProcReturn($"select isnull(DATEDIFF(DAY,GETDATE(),CONVERT(varchar(10),max(HMasterDate),20))+1,0) DayNum from Sc_WorkBillSortBillSub where HInterID in ({sWhere}) and HMasterDate>=CONVERT(varchar(10),GETDATE(),20) and HLockedSub=1", "Sc_WorkBillSortBillSub"); |
| | | } |
| | | else if (num == 2) |
| | | { |
| | |
| | | var HMainSourceEntryID = list[i]["æºååå
ç "].ToString(); |
| | | var HPlanQty = list[i]["è®¡åæ°é"].ToString(); |
| | | |
| | | if (HSourceID == "") |
| | | if (HSourceID == ""|| HSourceID == "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn($"select * from Sc_WorkBillSortBillMain where HMainSourceEntryID={HMainSourceEntryID}" + |
| | | ds = oCN.RunProcReturn($"select * from Sc_WorkBillSortBillMain where HMainSourceInterID={HMainSourceInterID}" + |
| | | $" and HMainSourceEntryID={HMainSourceEntryID} and HICMOBillNo='{HICMOBillNo}' and HICMOEntrySEQ={HICMOEntrySEQ} and HSourceID={HSourceID}", "Sc_WorkBillSortBillMain"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | |
| | | $" 0, {(HSplitQty == "" ? 0.ToString() : HSplitQty)}, {(HDayPlanSumQty == "" ? 0.ToString() : HDayPlanSumQty)},'{HPlanBeginDate}'," + |
| | | $"'{HSeOrderBillNo}','{HICMOBillType}',{(HSourceStockInQty == "" ? 0.ToString() : HSourceStockInQty)},{(HLeftPlanQty == "" ? 0.ToString() : HLeftPlanQty)},'{HOrderLev}',getdate()," + |
| | | $"{HMainSourceInterID},{HMainSourceEntryID},{HMainSourceInterID},{HMainSourceEntryID},{HPlanQty})"); |
| | | } |
| | | else |
| | | { |
| | | var HMainSourceInterID = list[i]["æºå主å
ç "].ToString(); |
| | | var HMainSourceEntryID = list[i]["æºååå
ç "].ToString(); |
| | | var HICMOBillNo = list[i]["ç产订åå·"].ToString(); |
| | | var HICMOEntrySEQ = list[i]["ç产订åæç»è¡å·"].ToString(); |
| | | var HSourceID = list[i]["HSourceID"].ToString(); |
| | | |
| | | if (HSourceID == "" || HSourceID == "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = $"第{i + 1}è¡çäº§èµæºä¸è½ä¸ºç©º!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn($"select * from Sc_WorkBillSortBillMain where HMainSourceInterID={HMainSourceInterID}" + |
| | | $" and HMainSourceEntryID={HMainSourceEntryID} and HICMOBillNo='{HICMOBillNo}' and HICMOEntrySEQ={HICMOEntrySEQ} and HSourceID={HSourceID}", "Sc_WorkBillSortBillMain"); |
| | | |
| | | if (ds.Tables[0].Rows.Count > 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = $"第{i + 1}è¡çäº§èµæºæéå¤,请修æ¹!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.RunProc($"update Sc_WorkBillSortBillMain set HSourceID={(HSourceID == "" ? 0.ToString() : HSourceID)} where HInterID={list[i]["hmainid"].ToString()} and HBillNo='{list[i]["åæ®å·"].ToString()}'"); |
| | | } |
| | | |
| | | oCN.RunProc($"update Sc_WorkBillSortBillMain set HDayPlanSumQty={list[i]["æ¥è®¡åæ°éæ»é"].ToString()} where HInterID={(HInterID==0?int.Parse(list[i]["hmainid"].ToString()):HInterID)} and HBillNo='{(HBillNo==""?list[i]["åæ®å·"].ToString(): HBillNo)}'"); |
| | |
| | | #region ç产æ¥è®¡åå¹³å° éå® |
| | | [Route("JIT_DayPlanPlatFormBill/JIT_DayPlanPlatFormBillHLockedDay")] |
| | | [HttpGet] |
| | | public object JIT_DayPlanPlatFormBillHLockedDay(string sWhere, int HLockedDay) |
| | | public object JIT_DayPlanPlatFormBillHLockedDay(int HLockedDay,int HWorkShopID) |
| | | { |
| | | try |
| | | { |
| | | if (sWhere != null && sWhere != "") |
| | | { |
| | | oCN.RunProc("update Sc_WorkBillSortBillSub set HLockedSub=1" + |
| | | $" where HInterID in ({sWhere}) and HMasterDate between DATEADD(day, -1, getdate()) and DATEADD(day,{(HLockedDay - 1)},getdate()) "); |
| | | } |
| | | oCN.RunProc("update b set HLockedSub=0 from Sc_WorkBillSortBillMain a join Sc_WorkBillSortBillSub b on a.HInterID = b.HInterID " + |
| | | $" where a.HWorkShopID={HWorkShopID}"); |
| | | |
| | | oCN.RunProc("update b set HLockedSub=1 from Sc_WorkBillSortBillMain a join Sc_WorkBillSortBillSub b on a.HInterID = b.HInterID " + |
| | | $" where HMasterDate between DATEADD(day, -1, getdate()) " + |
| | | $"and DATEADD(day,{(HLockedDay - 1)},getdate()) and a.HWorkShopID={HWorkShopID}"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | |
| | | #region ç产æ¥è®¡åå¹³å° è§£é |
| | | [Route("JIT_DayPlanPlatFormBill/JIT_DayPlanPlatFormBillHUnlockDay")] |
| | | [HttpGet] |
| | | public object JIT_DayPlanPlatFormBillHUnlockDay(string sWhere, int HLockedDay) |
| | | public object JIT_DayPlanPlatFormBillHUnlockDay(int HWorkShopID) |
| | | { |
| | | try |
| | | { |
| | | if (sWhere != null && sWhere != "") |
| | | { |
| | | oCN.RunProc("update Sc_WorkBillSortBillSub set HLockedSub=0" + |
| | | $" where HInterID in ({sWhere}) and HMasterDate between DATEADD(day, -1, getdate()) and DATEADD(day,{(HLockedDay - 1)},getdate()) "); |
| | | } |
| | | oCN.RunProc("update b set HLockedSub=0 from Sc_WorkBillSortBillMain a join Sc_WorkBillSortBillSub b on a.HInterID = b.HInterID " + |
| | | $" where a.HWorkShopID={HWorkShopID}"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |