From dc1d68f934ab19d09e22983c810b39bc1fc1f4c7 Mon Sep 17 00:00:00 2001
From: yxj <1qaz@123>
Date: 星期一, 21 十一月 2022 10:50:04 +0800
Subject: [PATCH] 出站汇报单新增模块界面增加人员数、机器数
---
WebAPI/Controllers/BaseSet/Gy_MaterialController.cs | 76 ++++++++++++++++++++++++++++---------
1 files changed, 57 insertions(+), 19 deletions(-)
diff --git a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
index 126b7e9..8c07c4e 100644
--- a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
@@ -1,4 +1,5 @@
-锘縰sing Newtonsoft.Json.Linq;
+锘縰sing Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
using Pub_Class;
using System;
using System.Collections;
@@ -6,6 +7,7 @@
using System.Data;
using System.Data.SqlClient;
using System.Web.Http;
+using System.Windows.Forms;
using WebAPI.Models;
using WebAPI.Service;
@@ -20,6 +22,36 @@
DataSet ds;
+
+ ////妫�娴� 褰撳墠閫変腑琛岀殑 椤圭洰鐘舵��
+ //[Route("Gy_Material/CheckUseStatus")]
+ //[HttpGet]
+ //public void Sub_CheckUseStatus(int grd, int IDCol, string sProcName)
+ //{
+ // SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+ // Int64 sItemID;
+ // try
+ // {
+ // //寰幆褰撳墠缃戞牸閫変腑椤圭洰
+ // for (int i = 0; i < grd.SelectedRows.Count; i++)
+ // {
+ // //寰楀埌鍐呯爜
+ // sItemID = DBUtility.ClsPub.isLong(grd.Rows[grd.SelectedRows[i].Index].Cells[IDCol].Value);
+ // //璋冪敤鍌ㄥ瓨杩囩▼ h_p_Gy_CheckUseDept
+ // oCn.RunProc("exec " + sProcName + " " + sItemID.ToString(), ref ClsPub.sExeReturnInfo);
+ // }
+ // }
+ // catch (Exception e)
+ // {
+ // MessageBox.Show("妫�娴嬮敊璇紒鍘熷洜锛�" + ClsPub.sExeReturnInfo);
+ // //objJsonResult.code = "0";
+ // //objJsonResult.count = 0;
+ // //objJsonResult.Message = "妫�娴嬮敊璇紒鍘熷洜锛�" + ClsPub.sExeReturnInfo;
+ // //objJsonResult.data = null;
+ // //return objJsonResult;
+ // }
+ //}
+
/// <summary>
/// 杩斿洖鐗╂枡鍒楄〃
///鍙傛暟锛歴tring sql銆�
@@ -31,6 +63,7 @@
{
try
{
+ List<object> columnNameList = new List<object>();
//缂栬緫鏉冮檺
if (!DBUtility.ClsPub.Security_Log_second("Gy_Material", 1, false, user))
{
@@ -51,9 +84,18 @@
ds = oCN.RunProcReturn(sql, "h_v_Gy_MaterialList");
}
+ //娣诲姞鍒楀悕
+ 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));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
+
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess锛�";
+ objJsonResult.list = columnNameList;
objJsonResult.data = ds.Tables[0];
return objJsonResult;
}
@@ -93,6 +135,7 @@
string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
string msg1 = sArray[0].ToString();
string msg2 = sArray[1].ToString();
+ string msg_HUSEORGID = sArray[2].ToString();
Int64 HItemID = 0;
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
@@ -242,7 +285,7 @@
objJsonResult.data = 1;
return objJsonResult;
}
-
+ oItem.HUSEORGID = Convert.ToInt32(msg_HUSEORGID); //缁勭粐id
oItem.HShortNumber = sShortNumber;//鐭唬鐮�
oItem.HEndFlag = true;//鏈骇鏍囧織
oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //绛夌骇
@@ -342,7 +385,7 @@
return objJsonResult;
}
- oCN.RunProc("update Gy_Material set HStopflag=1 where HItemID=" + HItemID);
+ oCN.RunProc("delete from Gy_Material where HItemID=" + HItemID);
oCN.Commit();//鎻愪氦浜嬪姟
objJsonResult.code = "0";
objJsonResult.count = 1;
@@ -561,27 +604,21 @@
objJsonResult.data = null;
return objJsonResult;
}
- DataSet Ds, Ds2;
+ DataSet Ds;
Ds = oCN.RunProcReturn("Select * from h_v_IF_BarCodeBillList Where HItemID=" + lngBillKey.ToString(), "h_v_IF_BarCodeBillList");
if (Ds.Tables[0].Rows.Count != 0)
{
- oCN.BeginTran();
- Ds2 = oCN.RunProcReturn("Delete from Gy_BarCodeBill Where HItemID=" + lngBillKey.ToString(), "Gy_BarCodeBill");
- if (Ds2.Tables[0].Rows.Count != 0)
- {
- oCN.Commit();
- objJsonResult.code = "1";
- objJsonResult.count = 1;
- objJsonResult.Message = "鍒犻櫎鎴愬姛";
- objJsonResult.data = null;
- return objJsonResult;
- }
- oCN.RollBack();
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "鍒犻櫎澶辫触";
+ oCN.BeginTran();
+ oCN.RunProc("Delete from Gy_BarCodeBill Where HItemID=" + lngBillKey.ToString());
+
+ oCN.Commit();
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍒犻櫎鎴愬姛";
objJsonResult.data = null;
return objJsonResult;
+
+
}
else
{
@@ -594,6 +631,7 @@
}
catch (Exception e)
{
+ oCN.RollBack();
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = e.Message;
--
Gitblit v1.9.1