From 4548e24916ac5f63eef736cabdcd634864f8de16 Mon Sep 17 00:00:00 2001
From: wangbin <lan@DESKTOP-MG88OFJ>
Date: 星期一, 08 七月 2024 10:39:16 +0800
Subject: [PATCH] 1
---
WebAPI/Controllers/生产管理/报工台工序/Sc_MESReturnStepWorkBillController.cs | 70 ++++++++++++++++++++++++++++------
1 files changed, 57 insertions(+), 13 deletions(-)
diff --git "a/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/Sc_MESReturnStepWorkBillController.cs" "b/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/Sc_MESReturnStepWorkBillController.cs"
index 6ed5f79..6818cab 100644
--- "a/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/Sc_MESReturnStepWorkBillController.cs"
+++ "b/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/Sc_MESReturnStepWorkBillController.cs"
@@ -1,4 +1,5 @@
锘縰sing DBUtility;
+using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
@@ -38,12 +39,20 @@
{
try
{
+ List<object> a = new List<object>();
ds = Sc_GetMESReturnStepWorkBill(sWhere);
+ foreach (DataColumn col in ds.Tables[0].Columns)//閬嶅巻ds涓涓�涓〃锛圱ables[0]锛夌殑鎵�鏈夊垪锛圕olumns锛夋瘡娆″惊鐜腑锛宑ol鍙橀噺浼氭寔鏈夊綋鍓嶅垪鐨勫紩鐢�
+ {
+ Type dataType = col.DataType; //鑾峰彇褰撳墠鏁版嵁绫诲瀷浼犲叆 鑷畾涔夊彉閲廳atadataType
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; //瀛楃涓叉嫾鎺� // 灏嗗垪鍚嶅拰鏁版嵁绫诲瀷淇℃伅鎷兼帴鎴愪竴涓狫SON鏍煎紡鐨勫瓧绗︿覆
+ a.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = a;
return objJsonResult;
}
catch (Exception ex)
@@ -60,17 +69,52 @@
{
if (sWhere == null || sWhere.Equals(""))
{
- return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MESReturnWorkBillList_NEW ", "h_v_Sc_MESReturnWorkBillList_NEW");
+ return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MESReturnWorkBillList_NEW order by hmainid desc ", "h_v_Sc_MESReturnWorkBillList_NEW");
}
else
{
string sql1 = "select * from h_v_Sc_MESReturnWorkBillList_NEW where 1 = 1 ";
- string sql = sql1 + sWhere;
+ string sql = sql1 + sWhere+ " order by hmainid desc ";
return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MESReturnWorkBillList_NEW");
}
}
+ #endregion
+
+ #region 鑾峰彇杩斿伐宸ュ簭涓嬫媺妗嗘暟鎹�(鎵�鏈夊伐搴�)
+ [Route("Sc_MESReturnStepWorkBill/GetMESReturnStepSelectBill")]
+ [HttpGet]
+ public object GetMESReturnStepSelectBill()
+ {
+ try
+ {
+ ds = oCN.RunProcReturn("select HItemID,宸ュ簭浠g爜,宸ュ簭鍚嶇О from h_v_Gy_ProcessList ", "h_v_Gy_ProcessList");
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
+ objJsonResult.data = ds.Tables[0];
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犲伐搴忔暟鎹�,璇风淮鎶わ紒";
+ objJsonResult.data =null;
+ }
+ return objJsonResult;
+ }
+ catch (Exception ex)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
#endregion
#region[杩斿伐鍗曠紪杈戞椂鑾峰彇琛ㄥご鏁版嵁]
@@ -101,7 +145,7 @@
{
DBUtility.ClsPub.CurUserName = UserName;
//缂栬緫鏉冮檺
- if (!DBUtility.ClsPub.Security_Log_second("Sc_ProcessPlan_Drop", 1, true, DBUtility.ClsPub.CurUserName))
+ if (!DBUtility.ClsPub.Security_Log_second("Sc_ProcessPlan_Drop", 1, false, DBUtility.ClsPub.CurUserName))
{
objJsonResult.code = "0";
objJsonResult.count = 0;
@@ -183,19 +227,19 @@
[HttpGet]
public object AuditReturnStepProcessReportList(int HInterID, int IsAudit, string CurUserName)
{
- string ModRightNameCheck = "Sc_ProcessPlan_Check";
+ string ModRightNameCheck = "Sc_ReturnStepProcess_Check";
DBUtility.ClsPub.CurUserName = CurUserName;
try
{
//瀹℃牳鏉冮檺
- if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, true, CurUserName))
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
- objJsonResult.data = null;
- return objJsonResult;
- }
+ //if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName))
+ //{
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
if (HInterID <= 0)
{
objJsonResult.code = "0";
@@ -330,7 +374,7 @@
DBUtility.ClsPub.CurUserName = UserName;
//淇濆瓨鏉冮檺
- if (!DBUtility.ClsPub.Security_Log_second("Sc_ProcessPlan_Edit", 1, true, DBUtility.ClsPub.CurUserName))
+ if (!DBUtility.ClsPub.Security_Log_second("Sc_ProcessPlan_Edit", 1, false, DBUtility.ClsPub.CurUserName))
{
objJsonResult.code = "0";
objJsonResult.count = 0;
--
Gitblit v1.9.1