| | |
| | | ",'" + 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); |
| | | } |
| | | //ä¿åå表 |
| | | objJsonResult = AddBillSub_NoTable(msg3, HInterID, OperationType, HEntryID); |
| | | |
| | | |
| | | //ååæºå-éå®è®¢åæ°æ® |
| | | if ((OperationType == 1 || OperationType == 2 || OperationType == 4) && ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | //çäº§è®¢åæ°å¢åå¡«éå®è®¢åå
³èæ°é |
| | | oCN.RunProc("exec h_p_Xs_UpDateRelation_SeOrderToICMO_Add " + HInterID); |
| | | } |
| | | else if (OperationType == 3 || ds.Tables[0].Rows.Count != 0) |
| | | { |
| | | //ç产订åå é¤åå¡«éå®è®¢åå
³èæ°é |
| | | oCN.RunProc("exec h_p_Xs_UpDateRelation_SeOrderToICMO_Delete " + HInterID); |
| | | //çäº§è®¢åæ°å¢åå¡«éå®è®¢åå
³èæ°é |
| | | oCN.RunProc("exec h_p_Xs_UpDateRelation_SeOrderToICMO_Add " + HInterID); |
| | | } |
| | | |
| | | |
| | | |
| | | if (objJsonResult.code == "0") |
| | | { |
| | |
| | | ,'{(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.HSourceInterID},{oSub.HSourceEntryID},'{oSub.HSourceBillNo}','{oSub.HSourceBillType}',0,0 |
| | | ,{oSub.HAuxQty},{oSub.HAuxUnit},{oSub.HWidth},{oSub.HWeight},'{oSub.HColorRemark}','{oSub.HCusMaterName}','{oSub.HCusModel}','{oSub.HOrderPickRemark}')"); |
| | | |
| | | objJsonResult.code = "1"; |
| | |
| | | return objJsonResult; ; |
| | | } |
| | | |
| | | //ç产订åå é¤åå¡«éå®è®¢åå
³èæ°é |
| | | oCN.RunProc("exec h_p_Xs_UpDateRelation_SeOrderToICMO_Delete " + HInterID); |
| | | |
| | | |
| | | oCN.RunProc("delete from Sc_ICMOBillMain where HInterID=" + HInterID); |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region 为è¿è¡æäº§çç产订å å表 |
| | | [Route("Sc_ICMOBill/NotInDayPlan")] |
| | | [HttpGet] |
| | | public object Sc_ICMOBillList_NotInDayPlan(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_ICMOList_NotInDayPlan where 1 = 1" + sWhere , "h_v_Sc_ICMOList_NotInDayPlan"); |
| | | |
| | | if (ds == null && ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Sucessï¼æ²¡ææ¥è¯¢å°ç¸å
³æ°æ®"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | //æ·»å åå |
| | | 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.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | } |
| | | } |