| | |
| | | |
| | | string sql = string.Format(@"select * from h_v_Sc_ProcessExchangeBillQuerySub"); |
| | | |
| | | ds = oCN.RunProcReturn(sql + " where hmainid=" + HInterID + " and 出站关联数量=0 and cast(流水号 as int)>" + ds1 .Tables[0].Rows[0][0].ToString(), "h_v_Sc_ProcessExchangeBillQuerySub"); |
| | | ds = oCN.RunProcReturn(sql + " where hmainid=" + HInterID + " and 出站关联数量=0 and cast(流水号 as int)>" + ds1 .Tables[0].Rows[0][0].ToString()+ " order by cast(流水号 as int) ", "h_v_Sc_ProcessExchangeBillQuerySub"); |
| | | |
| | | if (float.Parse(ds.Tables[0].Rows[0]["进站关联数量"].ToString()) > 0) |
| | | { |
| | |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | int num = oItem.HBillNo.Split('-').Length; |
| | | oBill.omodel.HMaker = msg5; //制单人 |
| | | oBill.omodel.HNo = DBUtility.ClsPub.isLong(oItem.HBillNo.Split('-')[1]); |
| | | oBill.omodel.HNo = DBUtility.ClsPub.isLong(oItem.HBillNo.Split('-')[num - 1]); |
| | | oBill.omodel.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); |
| | | oBill.omodel.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month); |
| | | oBill.omodel.HDate = oItem.HDate;// 日期 |
| | |
| | | oBill.omodel.HPlanEndDate = oItem.HPlanEndDate;// 计划完工日期 |
| | | oBill.omodel.HQty = oItem.HQty;// 数量 |
| | | oBill.omodel.HBillNo = oItem.HBillNo;// 单据号 |
| | | oBill.omodel.HProjectNum = oItem.HProjectNum;// 项目号 |
| | | } |
| | | |
| | | //表体数据 |
| | |
| | | j++; |
| | | } |
| | | } |
| | | |
| | | |
| | | //保存 |
| | | //保存完毕后处理 |
| | |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region 工序流转卡列表 |
| | | /// <summary> |
| | | /// 获取工序流转卡列表信息 |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region[批量拆分生成流转卡] |
| | | /// <summary> |
| | | /// 返回拆分后的生产订单信息 |
| | | /// </summary> |
| | | /// <param name="hmainid">生产任务单主子ID</param> |
| | | /// <returns>object</returns> |
| | | [Route("Sc_ProcessExchangeBill/BatchSpilt")] |
| | | [HttpGet] |
| | | public object BatchSpilt(string HInterID, string user) |
| | | { |
| | | try |
| | | { |
| | | if (string.IsNullOrWhiteSpace(HInterID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "源单主子id为空!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | string[] HInterEntryIDArr = HInterID.Split(','); |
| | | |
| | | string[] HData; |
| | | |
| | | for (int i = 0; i < HInterEntryIDArr.Length; i++) |
| | | { |
| | | string[] HIDs = HInterEntryIDArr[i].Split('@'); |
| | | |
| | | string sql = "exec h_p_Sc_ProcessExchange_BatchSplit '" + HIDs[0] + "','" + HIDs[1] + "'"; |
| | | |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_ProcessExchange_BatchSplit"); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "拆分生产订单无数据!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | 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 |
| | | |
| | | } |
| | | } |