| | |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_IF_ICMOBillList where hmainid=" + HInterID + " and åæ®å·='" + HBillNo + "'", "h_v_IF_ICMOBillList"); |
| | | |
| | | if ((OperationType == 1 || OperationType == 2) && ds.Tables[0].Rows.Count == 0)//æ°å¢ |
| | | if ((OperationType == 1 || OperationType == 2 || OperationType == 4) && ds.Tables[0].Rows.Count == 0)//æ°å¢ |
| | | { |
| | | //主表 |
| | | oCN.RunProc(@"Insert Into Sc_ICMOBillMain |
| | |
| | | ",'" + HSeOrderBillNo + "'," + HSeOrderInterID + "," + HSeOrderEntryID + "," + HEmpID + "," + HCusID + |
| | | "," + HCenterID + ",0,0,0,0," + HBomID + ",'',''" + |
| | | ",'"+ HIsStockQty + "','"+ HRemark3 + "') "); |
| | | |
| | | |
| | | //ååéå®è®¢åæ°æ® |
| | | ClsSc_ICMOBillSub oSub = Newtonsoft.Json.JsonConvert.DeserializeObject<ClsSc_ICMOBillSub>(msg3); |
| | | string sql = "update Xs_SeOrderBillSub set HRelationQty_ICMO = ISNULL(HRelationQty_ICMO,0) + " + (oSub.HQty == null ? 0 : oSub.HQty) + " where HInterID = " + mainList[0].HSeOrderInterID + " and HEntryID = "+ mainList[0].HSeOrderEntryID; |
| | | oCN.RunProc(sql); |
| | | |
| | | LogService.Write("ç¨æ·:" + user + ",æ¥æ:" + DateTime.Now + ",æ°å¢ç产订ååæ®:" + HBillNo); |
| | | oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "æ°å¢ç产订ååæ®ï¼" + HBillNo + "','LMES-çäº§è®¢åæ¨¡å','" + DBUtility.ClsPub.IPAddress + "','æ°å¢åæ®'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | |
| | | |
| | | //å é¤å表 |
| | | oCN.RunProc("delete from Sc_ICMOBillSub where HInterID='" + HInterID + "' and HEntryID='" + HEntryID + "'"); |
| | | |
| | | |
| | | //ååéå®è®¢åæ°æ® |
| | | ClsSc_ICMOBillSub oSub = Newtonsoft.Json.JsonConvert.DeserializeObject<ClsSc_ICMOBillSub>(msg3); |
| | | string sql = "update Xs_SeOrderBillSub set " + |
| | | "HRelationQty_ICMO = ISNULL(HRelationQty_ICMO,0) - " + ds.Tables[0].Rows[0]["é宿°é"] + " + " + (oSub.HQty == null ? 0 : oSub.HQty) + "" + |
| | | " where HInterID = " + mainList[0].HSeOrderInterID + " and HEntryID = " + mainList[0].HSeOrderEntryID; |
| | | oCN.RunProc(sql); |
| | | |
| | | |
| | | |
| | | LogService.Write("ç¨æ·:" + user + ",æ¥æ:" + DateTime.Now + ",ä¿®æ¹ç产订ååæ®:" + HBillNo); |
| | | oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "ä¿®æ¹ç产订ååæ®ï¼" + HBillNo + "','LMES-çäº§è®¢åæ¨¡å','" + DBUtility.ClsPub.IPAddress + "','ä¿®æ¹åæ®'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | |
| | | ,HMaterID,HUnitID,HRemark,HSourceID,HDeptID,HSTATUS |
| | | ,HBomID,HEntryCusID,HSTOCKINORGID |
| | | ,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney |
| | | ,HAuxQty,HAuxUnit,HWidth,HWeight,HColorRemark,HCusMaterName,HCusModel) |
| | | ,HAuxQty,HAuxUnit,HWidth,HWeight,HColorRemark,HCusMaterName,HCusModel,HOrderPickRemark) |
| | | values({HInterID},{HEntryID},{(oSub.HQty == null ? 0 : oSub.HQty)} |
| | | ,'{(oSub.HPlanBeginDate == null ? DateTime.Now.ToString("yyyy-MM-dd") : oSub.HPlanBeginDate.ToString())}','{(oSub.HPlanEndDate == null ? DateTime.Now.AddDays(1).ToString("yyyy-MM-dd") : oSub.HPlanEndDate.ToString())}' |
| | | ,'{(oSub.HBeginDate == null ? DateTime.Now.ToString("yyyy-MM-dd") : oSub.HBeginDate.ToString())}','{(oSub.HEndDate == null ? DateTime.Now.AddDays(1).ToString("yyyy-MM-dd") : oSub.HEndDate.ToString())}' |
| | | ,{oSub.HMaterID},{oSub.HUnitID},'{oSub.HRemark}',{oSub.HSourceID},{oSub.HDeptID},{oSub.HSTATUS} |
| | | ,{oSub.HBomID} ,{oSub.HCusID} ,{oSub.HSTOCKINORGID} |
| | | ,0,0,'','',0,0 |
| | | ,{oSub.HAuxQty},{oSub.HAuxUnit},{oSub.HWidth},{oSub.HWeight},'{oSub.HColorRemark}','{oSub.HCusMaterName}','{oSub.HCusModel}')"); |
| | | ,{oSub.HAuxQty},{oSub.HAuxUnit},{oSub.HWidth},{oSub.HWeight},'{oSub.HColorRemark}','{oSub.HCusMaterName}','{oSub.HCusModel}','{oSub.HOrderPickRemark}')"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region ç产任å¡å订åå
è£
夿³¨ ä¿ååè½ |
| | | [Route("Sc_ICMOBill/ICMOBillSaveRemark")] |
| | | [HttpGet] |
| | | public object ICMOBillSaveRemark(string HInterID,string HEntryID, string HOrderPickRemark) |
| | | { |
| | | try |
| | | { |
| | | if (string.IsNullOrEmpty(HInterID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼HInterIDä¸è½ä¸ºç©º"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("update Sc_ICMOBillSub set HOrderPickRemark = '" + HOrderPickRemark + "' where HInterID = " + HInterID + " and HEntryID = " + HEntryID + ""); |
| | | oCN.Commit(); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | } |
| | | } |