| | |
| | | using System.Data; |
| | | using System.Data; |
| | | using System.Data.SqlClient; |
| | | using System.Dynamic; |
| | | using System.Text; |
| | |
| | | + m.Bz + _split |
| | | + m.Pcsl + _split |
| | | + m.Yjwgsj + _split |
| | | + (CheckGuid(_guid)? _guid: Guid.Empty.ToString()); |
| | | + (CheckGuid(_guid)? _guid: Guid.Empty.ToString()) + _split |
| | | + m.IsZddb + _split |
| | | + m.DepotId + _split |
| | | + m.DepotSections + _split |
| | | + m.ProdHour + _split |
| | | + m.PlanCapacity; |
| | | if (_sb.Length > 0) |
| | | _sb.Append("~"); |
| | | _sb.Append(_line); |
| | |
| | | { |
| | | LogHelper.Debug(ToString(), |
| | | "prc_wom_pba_edt error:" + ex.Message); |
| | | mObj.outMsg = ex.Message; |
| | | mObj.outSum = -1; |
| | | } |
| | | finally |
| | | { |
| | | conn.Close(); |
| | | } |
| | | } |
| | | } |
| | | if (mObj.outSum <= 0) |
| | | return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Exception, mObj.outMsg); |
| | | return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Success, mObj.outMsg); |
| | | } |
| | | |
| | | |
| | | [RequestMethod(RequestMethods.POST)] |
| | | public ReturnDto<ExpandoObject> CnpcOrder([FromBody] dynamic model) |
| | | { |
| | | Guid? guid = model.guid; |
| | | dynamic m = new ExpandoObject(); |
| | | m.outSum = -1; |
| | | m.outMsg = ""; |
| | | using (var conn = new SqlConnection(DbHelperSQL.strConn)) |
| | | { |
| | | using (var cmd = new SqlCommand("[prc_wom_pba_cxpx]", conn)) |
| | | { |
| | | try |
| | | { |
| | | conn.Open(); |
| | | cmd.CommandType = CommandType.StoredProcedure; |
| | | SqlParameter[] parameters = |
| | | { |
| | | new("@outMsg", SqlDbType.NVarChar, 300), |
| | | new("@outSum", SqlDbType.Int), |
| | | new("@inOrderGuid", CheckGuid(guid) ? guid : DBNull.Value) |
| | | }; |
| | | parameters[0].Direction = ParameterDirection.Output; |
| | | parameters[1].Direction = ParameterDirection.Output; |
| | | foreach (var parameter in parameters) |
| | | cmd.Parameters.Add(parameter); |
| | | cmd.ExecuteNonQuery(); |
| | | m.outMsg = parameters[0].Value.ToString(); |
| | | m.outSum = int.Parse(parameters[1].Value.ToString()); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | LogHelper.Debug(ToString(), |
| | | "prc_wom_pba_cxpx error:" + ex.Message); |
| | | m.outMsg = ex.Message; |
| | | return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, |
| | | ex.Message); |
| | | } |
| | | finally |
| | | { |
| | | conn.Close(); |
| | | } |
| | | } |
| | | } |
| | | if (m.outSum <= 0) |
| | | return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Exception, m.outMsg); |
| | | return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "操作成功!"); |
| | | } |
| | | |
| | | |
| | | [RequestMethod(RequestMethods.POST)] |
| | | public ReturnDto<ExpandoObject> GenerateDailyPlan([FromBody] dynamic model) |
| | | { |
| | | Guid? guid = model.guid; |
| | | dynamic m = new ExpandoObject(); |
| | | m.outSum = -1; |
| | | m.outMsg = ""; |
| | | using (var conn = new SqlConnection(DbHelperSQL.strConn)) |
| | | { |
| | | using (var cmd = new SqlCommand("[prc_wom_pba_gen_daily_plan]", conn)) |
| | | { |
| | | try |
| | | { |
| | | conn.Open(); |
| | | cmd.CommandType = CommandType.StoredProcedure; |
| | | SqlParameter[] parameters = |
| | | { |
| | | new("@outMsg", SqlDbType.NVarChar, 300), |
| | | new("@outSum", SqlDbType.Int), |
| | | new("@inOrderGuid", CheckGuid(guid) ? guid : DBNull.Value), |
| | | new("@inEdtUserGuid", _userGuid) |
| | | }; |
| | | parameters[0].Direction = ParameterDirection.Output; |
| | | parameters[1].Direction = ParameterDirection.Output; |
| | | foreach (var parameter in parameters) |
| | | cmd.Parameters.Add(parameter); |
| | | cmd.ExecuteNonQuery(); |
| | | m.outMsg = parameters[0].Value.ToString(); |
| | | m.outSum = int.Parse(parameters[1].Value.ToString()); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | LogHelper.Debug(ToString(), |
| | | "prc_wom_pba_gen_daily_plan error:" + ex.Message); |
| | | m.outMsg = ex.Message; |
| | | return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, |
| | | ex.Message); |
| | | } |
| | | finally |
| | | { |
| | | conn.Close(); |
| | | } |
| | | } |
| | | } |
| | | if (m.outSum <= 0) |
| | | return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Exception, m.outMsg); |
| | | return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "生成日计划成功!"); |
| | | } |
| | | |
| | | [RequestMethod(RequestMethods.POST)] |
| | | public ReturnDto<ExpandoObject> EditModelCnpc([FromBody] dynamic model) |
| | | { |
| | | Guid? guid = model.guid; |
| | | string bz = model.bz; |
| | | string cjId = model.cjId; |
| | | var _sb = new StringBuilder(); |
| | | var _split = "|"; |
| | | foreach (var m in model.list) |
| | | { |
| | | string _guid = m.Guid.ToString(); |
| | | var _line = m.AboutGuid + _split |
| | | + m.LineId + _split |
| | | + m.Yjkgsj + _split |
| | | + m.Hxsj + _split |
| | | + m.Bz + _split |
| | | + m.Pcsl + _split |
| | | + m.Yjwgsj + _split |
| | | + (CheckGuid(_guid)? _guid: Guid.Empty.ToString()) + _split |
| | | + m.IsZddb + _split |
| | | + m.DepotId + _split |
| | | + m.DepotSections + _split |
| | | + m.ProdHour + _split |
| | | + m.PlanCapacity + _split |
| | | + m.FSeq; |
| | | if (_sb.Length > 0) |
| | | _sb.Append("~"); |
| | | _sb.Append(_line); |
| | | } |
| | | dynamic mObj = new ExpandoObject(); |
| | | mObj.outMsg = ""; |
| | | mObj.outSum = -1; |
| | | mObj.outGuid = ""; |
| | | mObj.outNo = ""; |
| | | using (var conn = new SqlConnection(DbHelperSQL.strConn)) |
| | | { |
| | | using (var cmd = new SqlCommand("[prc_wom_pba_edtCNPC]", conn)) |
| | | { |
| | | try |
| | | { |
| | | conn.Open(); |
| | | cmd.CommandType = CommandType.StoredProcedure; |
| | | SqlParameter[] parameters = |
| | | { |
| | | new("@outMsg", SqlDbType.NVarChar, 300), |
| | | new("@outSum", SqlDbType.Int), |
| | | new("@outGuid", SqlDbType.UniqueIdentifier), |
| | | new("@outNo", SqlDbType.NVarChar, 300), |
| | | new("@inOrderGuid", CheckGuid(guid) ? guid : DBNull.Value), |
| | | new("@inBz", bz), |
| | | new("@inCjId", cjId), |
| | | new("@inEdtUserGuid", _userGuid), |
| | | new("@inLineList", _sb.ToString()) |
| | | }; |
| | | parameters[0].Direction = ParameterDirection.Output; |
| | | parameters[1].Direction = ParameterDirection.Output; |
| | | parameters[2].Direction = ParameterDirection.Output; |
| | | parameters[3].Direction = ParameterDirection.Output; |
| | | foreach (var parameter in parameters) |
| | | cmd.Parameters.Add(parameter); |
| | | cmd.ExecuteNonQuery(); |
| | | mObj.outMsg = parameters[0].Value.ToString(); |
| | | mObj.outSum = int.Parse(parameters[1].Value.ToString()); |
| | | mObj.outGuid = parameters[2].Value.ToString(); |
| | | mObj.outNo = parameters[3].Value.ToString(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | LogHelper.Debug(ToString(), |
| | | "prc_wom_pba_edtCNPC error:" + ex.Message); |
| | | mObj.outMsg = ex.Message; |
| | | mObj.outSum = -1; |
| | | } |
| | |
| | | } |
| | | return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "操作成功!"); |
| | | } |
| | | } |
| | | } |