From ef01f86ce5c84f04edc3ba67e74a5263d86f238d Mon Sep 17 00:00:00 2001
From: 啊鑫 <t2856754968@163.com>
Date: 星期二, 19 十一月 2024 08:40:20 +0800
Subject: [PATCH] 11
---
Dto/service/Material.cs | 20
entity/MesInvItemIns.cs | 329 ++++
entity/MesInvItemStocks.cs | 134 +
entity/MesInvItemArn.cs | 153 +
DB/DbHelperSQL.cs | 677 +++++++++
entity/MesDepotSections.cs | 126 +
entity/MesInvItemBarcodes.cs | 406 +++--
entity/MesInvItemInCItems.cs | 168 ++
Dto/service/WarehouseQuery.cs | 38
Dto/service/PurchaseInventory.cs | 19
util/BillNo.cs | 31
Controllers/Warehouse/MesDepotSectionsController.cs | 226 +++
entity/MesInvItemInCDetails.cs | 311 ++-
service/Warehouse/MesDepotSectionsManager.cs | 88 +
NewPdaSqlServer.csproj | 2
entity/MesDepots.cs | 161 +
service/Warehouse/MesInvItemInCDetailsManager.cs | 870 ++++++++++++
entity/MesInvBusiness2.cs | 235 +++
Controllers/Warehouse/MesInvItemInCDetailsController.cs | 290 ++++
19 files changed, 3,826 insertions(+), 458 deletions(-)
diff --git a/Controllers/Warehouse/MesDepotSectionsController.cs b/Controllers/Warehouse/MesDepotSectionsController.cs
new file mode 100644
index 0000000..b89b739
--- /dev/null
+++ b/Controllers/Warehouse/MesDepotSectionsController.cs
@@ -0,0 +1,226 @@
+锘縰sing System.Dynamic;
+using Microsoft.AspNetCore.Mvc;
+using NewPdaSqlServer.Dto.service;
+using NewPdaSqlServer.entity;
+using NewPdaSqlServer.service.Warehouse;
+using NewPdaSqlServer.util;
+
+namespace NewPdaSqlServer.Controllers.Warehouse;
+
+[ApiController]
+[Route("api/[controller]")]
+public class MesDepotSectionsController : ControllerBase
+{
+ private readonly MesDepotSectionsManager m = new();
+
+
+ /***杩涘叆妯$増绠$悊鍙互淇敼妯$増***/
+
+ //ScanInDepotSectionsName
+ [HttpPost("ScanInDepotSectionsName")]
+ public ResponseResult ScanInDepotSectionsName(WarehouseQuery query)
+ {
+ try
+ {
+ dynamic resultInfos = new ExpandoObject();
+ resultInfos.tbBillList = m.ScanInDepotSectionsName(query);
+ return new ResponseResult
+ {
+ status = 0,
+ message = "OK",
+ data = resultInfos
+ };
+ }
+ catch (Exception ex)
+ {
+ return ResponseResult.ResponseError(ex);
+ }
+ }
+
+ //ScanEditBarcode
+ [HttpPost("ScanEditBarcode")]
+ public ResponseResult ScanEditBarcode(WarehouseQuery query)
+ {
+ try
+ {
+ dynamic resultInfos = new ExpandoObject();
+ resultInfos.tbBillList = m.ScanEditBarcode(query);
+ return new ResponseResult
+ {
+ status = 0,
+ message = "OK",
+ data = resultInfos
+ };
+ }
+ catch (Exception ex)
+ {
+ return ResponseResult.ResponseError(ex);
+ }
+ }
+
+ //GetSectionName
+ [HttpPost("GetSectionName")]
+ public ResponseResult GetSectionName(WarehouseQuery query)
+ {
+ try
+ {
+ dynamic resultInfos = new ExpandoObject();
+ resultInfos.tbBillList = m.GetSectionName(query);
+ return new ResponseResult
+ {
+ status = 0,
+ message = "OK",
+ data = resultInfos
+ };
+ }
+ catch (Exception ex)
+ {
+ return ResponseResult.ResponseError(ex);
+ }
+ }
+
+ /// <summary>
+ /// 鑾峰彇鎵�鏈�
+ /// </summary>
+ /// <returns></returns>
+ [HttpPost("GetList")]
+ public ResponseResult GetList()
+ {
+ try
+ {
+ dynamic resultInfos = new ExpandoObject();
+ resultInfos.tbBillList = m.GetList();
+ return new ResponseResult
+ {
+ status = 0,
+ message = "OK",
+ data = resultInfos
+ };
+ }
+ catch (Exception ex)
+ {
+ return ResponseResult.ResponseError(ex);
+ }
+ }
+
+
+ /// <summary>
+ /// 鏍规嵁涓婚敭鑾峰彇
+ /// </summary>
+ /// <returns></returns>
+ [HttpPost("GetById")]
+ public ResponseResult GetById(int id)
+ {
+ try
+ {
+ dynamic resultInfos = new ExpandoObject();
+ resultInfos.tbBillList = m.GetById(id);
+ return new ResponseResult
+ {
+ status = 0,
+ message = "OK",
+ data = resultInfos
+ };
+ }
+ catch (Exception ex)
+ {
+ return ResponseResult.ResponseError(ex);
+ }
+ }
+
+ /// <summary>
+ /// 鏍规嵁涓婚敭鍒犻櫎
+ /// </summary>
+ /// <returns></returns>
+ [HttpPost("DeleteByIds")]
+ public ResponseResult DeleteByIds([FromBody] object[] ids)
+ {
+ try
+ {
+ dynamic resultInfos = new ExpandoObject();
+ resultInfos.tbBillList = m.DeleteByIds(ids);
+ return new ResponseResult
+ {
+ status = 0,
+ message = "OK",
+ data = resultInfos
+ };
+ }
+ catch (Exception ex)
+ {
+ return ResponseResult.ResponseError(ex);
+ }
+ }
+
+ /// <summary>
+ /// 娣诲姞
+ /// </summary>
+ /// <returns></returns>
+ [HttpPost("Insert")]
+ public ResponseResult Add([FromBody] MesDepotSections data)
+ {
+ try
+ {
+ dynamic resultInfos = new ExpandoObject();
+ resultInfos.tbBillList = m.Insert(data);
+ return new ResponseResult
+ {
+ status = 0,
+ message = "OK",
+ data = resultInfos
+ };
+ }
+ catch (Exception ex)
+ {
+ return ResponseResult.ResponseError(ex);
+ }
+ }
+
+ /// <summary>
+ /// 娣诲姞杩斿洖鑷
+ /// </summary>
+ /// <returns></returns>
+ [HttpPost("InsertReturnIdentity")]
+ public ResponseResult InsertReturnIdentity([FromBody] MesDepotSections data)
+ {
+ try
+ {
+ dynamic resultInfos = new ExpandoObject();
+ resultInfos.tbBillList = m.InsertReturnIdentity(data);
+ return new ResponseResult
+ {
+ status = 0,
+ message = "OK",
+ data = resultInfos
+ };
+ }
+ catch (Exception ex)
+ {
+ return ResponseResult.ResponseError(ex);
+ }
+ }
+
+ /// <summary>
+ /// 淇敼
+ /// </summary>
+ /// <returns></returns>
+ [HttpPost("Update")]
+ public ResponseResult Update([FromBody] MesDepotSections data)
+ {
+ try
+ {
+ dynamic resultInfos = new ExpandoObject();
+ resultInfos.tbBillList = m.Update(data);
+ return new ResponseResult
+ {
+ status = 0,
+ message = "OK",
+ data = resultInfos
+ };
+ }
+ catch (Exception ex)
+ {
+ return ResponseResult.ResponseError(ex);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Controllers/Warehouse/MesInvItemInCDetailsController.cs b/Controllers/Warehouse/MesInvItemInCDetailsController.cs
new file mode 100644
index 0000000..eca4d94
--- /dev/null
+++ b/Controllers/Warehouse/MesInvItemInCDetailsController.cs
@@ -0,0 +1,290 @@
+锘縰sing System.Dynamic;
+using Microsoft.AspNetCore.Mvc;
+using NewPdaSqlServer.Dto.service;
+using NewPdaSqlServer.entity;
+using NewPdaSqlServer.service.Warehouse;
+using NewPdaSqlServer.util;
+
+namespace NewPdaSqlServer.Controllers.Warehouse;
+
+[ApiController]
+[Route("api/[controller]")]
+public class MesInvItemInCDetailsController : ControllerBase
+{
+ private readonly MesInvItemInCDetailsManager m = new();
+
+ //audit
+ [HttpPost("Audit")]
+ public ResponseResult Audit(WarehouseQuery entity)
+ {
+ try
+ {
+ dynamic resultInfos = new ExpandoObject();
+ resultInfos.tbBillList = m.audit(entity);
+ return new ResponseResult
+ {
+ status = 0,
+ message = "OK",
+ data = resultInfos
+ };
+ }
+ catch (Exception ex)
+ {
+ return ResponseResult.ResponseError(ex);
+ }
+ }
+
+ //deApprove
+ [HttpPost("DeApprove")]
+ public ResponseResult DeApprove(WarehouseQuery entity)
+ {
+ try
+ {
+ dynamic resultInfos = new ExpandoObject();
+ resultInfos.tbBillList = m.deApprove(entity);
+ return new ResponseResult
+ {
+ status = 0,
+ message = "OK",
+ data = resultInfos
+ };
+ }
+ catch (Exception ex)
+ {
+ return ResponseResult.ResponseError(ex);
+ }
+ }
+
+ //getPurchaseInventory
+ [HttpPost("GetPurchaseInventory")]
+ public ResponseResult GetPurchaseInventory(WarehouseQuery entity)
+ {
+ try
+ {
+ dynamic resultInfos = new ExpandoObject();
+ //resultInfos.tbBillList = m.getPurchaseInventory(entity);
+ return new ResponseResult
+ {
+ status = 0,
+ message = "OK",
+ data = resultInfos
+ };
+ }
+ catch (Exception ex)
+ {
+ return ResponseResult.ResponseError(ex);
+ }
+ }
+
+ [HttpPost("GetInvItemInsList")]
+ public ResponseResult GetInvItemInsList(WarehouseQuery entity)
+ {
+ try
+ {
+ dynamic resultInfos = new ExpandoObject();
+ //var (items, totalCount) = m.GetInvItemInsList(entity);
+ //resultInfos.tbBillList = items;
+ return new ResponseResult
+ {
+ status = 0,
+ message = "OK",
+ data = resultInfos,
+ //TotalCount = totalCount
+ };
+ }
+ catch (Exception ex)
+ {
+ return ResponseResult.ResponseError(ex);
+ }
+ }
+
+ //SaveBarCodes
+ [HttpPost("SaveBarCodes")]
+ public ResponseResult SaveBarCodes(WarehouseQuery entity)
+ {
+ try
+ {
+ dynamic resultInfos = new ExpandoObject();
+ resultInfos.tbBillList = m.SaveBarCodes(entity);
+ return new ResponseResult
+ {
+ status = 0,
+ message = "OK",
+ data = resultInfos
+ };
+ }
+ catch (Exception ex)
+ {
+ return ResponseResult.ResponseError(ex);
+ }
+ }
+
+ //MesToErp
+ [HttpPost("SaveMessageCenter")]
+ public ResponseResult SaveMessageCenter(WarehouseQuery entity)
+ {
+ try
+ {
+ dynamic resultInfos = new ExpandoObject();
+ resultInfos.tbBillList = m.SaveMessageCenter(entity);
+ return new ResponseResult
+ {
+ status = 0,
+ message = "OK",
+ data = resultInfos
+ };
+ }
+ catch (Exception ex)
+ {
+ return ResponseResult.ResponseError(ex);
+ }
+ }
+
+ /***杩涘叆妯$増绠$悊鍙互淇敼妯$増***/
+
+ /// <summary>
+ /// 鑾峰彇鎵�鏈�
+ /// </summary>
+ /// <returns></returns>
+ [HttpPost("GetList")]
+ public ResponseResult GetList()
+ {
+ try
+ {
+ dynamic resultInfos = new ExpandoObject();
+ resultInfos.tbBillList = m.GetList();
+ return new ResponseResult
+ {
+ status = 0,
+ message = "OK",
+ data = resultInfos
+ };
+ }
+ catch (Exception ex)
+ {
+ return ResponseResult.ResponseError(ex);
+ }
+ }
+
+
+ /// <summary>
+ /// 鏍规嵁涓婚敭鑾峰彇
+ /// </summary>
+ /// <returns></returns>
+ [HttpPost("GetById")]
+ public ResponseResult GetById(int id)
+ {
+ try
+ {
+ dynamic resultInfos = new ExpandoObject();
+ resultInfos.tbBillList = m.GetById(id);
+ return new ResponseResult
+ {
+ status = 0,
+ message = "OK",
+ data = resultInfos
+ };
+ }
+ catch (Exception ex)
+ {
+ return ResponseResult.ResponseError(ex);
+ }
+ }
+
+ /// <summary>
+ /// 鏍规嵁涓婚敭鍒犻櫎
+ /// </summary>
+ /// <returns></returns>
+ [HttpPost("DeleteByIds")]
+ public ResponseResult DeleteByIds([FromBody] object[] ids)
+ {
+ try
+ {
+ dynamic resultInfos = new ExpandoObject();
+ resultInfos.tbBillList = m.DeleteByIds(ids);
+ return new ResponseResult
+ {
+ status = 0,
+ message = "OK",
+ data = resultInfos
+ };
+ }
+ catch (Exception ex)
+ {
+ return ResponseResult.ResponseError(ex);
+ }
+ }
+
+ /// <summary>
+ /// 娣诲姞
+ /// </summary>
+ /// <returns></returns>
+ [HttpPost("Insert")]
+ public ResponseResult Add([FromBody] MesInvItemInCDetails data)
+ {
+ try
+ {
+ dynamic resultInfos = new ExpandoObject();
+ resultInfos.tbBillList = m.Insert(data);
+ return new ResponseResult
+ {
+ status = 0,
+ message = "OK",
+ data = resultInfos
+ };
+ }
+ catch (Exception ex)
+ {
+ return ResponseResult.ResponseError(ex);
+ }
+ }
+
+ /// <summary>
+ /// 娣诲姞杩斿洖鑷
+ /// </summary>
+ /// <returns></returns>
+ [HttpPost("InsertReturnIdentity")]
+ public ResponseResult InsertReturnIdentity(
+ [FromBody] MesInvItemInCDetails data)
+ {
+ try
+ {
+ dynamic resultInfos = new ExpandoObject();
+ resultInfos.tbBillList = m.InsertReturnIdentity(data);
+ return new ResponseResult
+ {
+ status = 0,
+ message = "OK",
+ data = resultInfos
+ };
+ }
+ catch (Exception ex)
+ {
+ return ResponseResult.ResponseError(ex);
+ }
+ }
+
+ /// <summary>
+ /// 淇敼
+ /// </summary>
+ /// <returns></returns>
+ [HttpPost("Update")]
+ public ResponseResult Update([FromBody] MesInvItemInCDetails data)
+ {
+ try
+ {
+ dynamic resultInfos = new ExpandoObject();
+ resultInfos.tbBillList = m.Update(data);
+ return new ResponseResult
+ {
+ status = 0,
+ message = "OK",
+ data = resultInfos
+ };
+ }
+ catch (Exception ex)
+ {
+ return ResponseResult.ResponseError(ex);
+ }
+ }
+}
\ No newline at end of file
diff --git a/DB/DbHelperSQL.cs b/DB/DbHelperSQL.cs
new file mode 100644
index 0000000..cf0d708
--- /dev/null
+++ b/DB/DbHelperSQL.cs
@@ -0,0 +1,677 @@
+锘縰sing System.Collections;
+using System.Data;
+using System.Data.SqlClient;
+using NewPdaSqlServer.util;
+
+namespace NewPdaSqlServer.DB;
+
+/// <summary>
+/// 鏁版嵁璁块棶绫�
+/// </summary>
+public abstract class DbHelperSQL
+{
+ //鏁版嵁搴撹繛鎺ュ瓧绗︿覆(web.config鏉ラ厤缃�)
+ public static readonly string strConn =
+ AppsettingsUtility.Settings.DataBaseConn;
+
+ #region 鍏敤鏂规硶
+
+ /// <summary>
+ /// 鍙栧埌鏈�澶у瓧娈靛��
+ /// </summary>
+ /// <param name="FieldName"></param>
+ /// <param name="TableName"></param>
+ /// <returns></returns>
+ public static int GetMaxID(string FieldName, string TableName)
+ {
+ var strsql = "select max(" + FieldName + ") from " + TableName;
+ var obj = GetSingle(strsql);
+ if (obj == null)
+ return 0;
+ return int.Parse(obj.ToString());
+ }
+
+ /// <summary>
+ /// 鏄惁瀛樺湪鏌愭潯璁板綍
+ /// </summary>
+ /// <param name="strSql"></param>
+ /// <param name="cmdParms"></param>
+ /// <returns></returns>
+ public static bool Exists(string strSql, params SqlParameter[] cmdParms)
+ {
+ var obj = GetSingle(strSql, cmdParms);
+ int cmdresult;
+ if (Equals(obj, null) || Equals(obj, DBNull.Value))
+ cmdresult = 0;
+ else
+ cmdresult = int.Parse(obj.ToString());
+ if (cmdresult == 0)
+ return false;
+ return true;
+ }
+
+ #endregion
+
+ #region 鎵ц绠�鍗昐QL璇彞
+
+ /// <summary>
+ /// 鎵цSQL璇彞锛岃繑鍥炲奖鍝嶇殑璁板綍鏁�
+ /// </summary>
+ /// <param name="SQLString">SQL璇彞</param>
+ /// <returns>褰卞搷鐨勮褰曟暟</returns>
+ public static int ExecuteSql(string SQLString)
+ {
+ using (var connection = new SqlConnection(strConn))
+ {
+ using (var cmd = new SqlCommand(SQLString, connection))
+ {
+ try
+ {
+ connection.Open();
+ var rows = cmd.ExecuteNonQuery();
+ return rows;
+ }
+ catch (SqlException E)
+ {
+ connection.Close();
+ throw new Exception(E.Message);
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// 鎵ц澶氭潯SQL璇彞锛屽疄鐜版暟鎹簱浜嬪姟銆�
+ /// </summary>
+ /// <param name="SQLStringList">澶氭潯SQL璇彞</param>
+ public static void ExecuteSqlTran(ArrayList SQLStringList)
+ {
+ using (var conn = new SqlConnection(strConn))
+ {
+ conn.Open();
+ var cmd = new SqlCommand();
+ cmd.Connection = conn;
+ var tx = conn.BeginTransaction();
+ cmd.Transaction = tx;
+ try
+ {
+ for (var n = 0; n < SQLStringList.Count; n++)
+ {
+ var strsql = SQLStringList[n].ToString();
+ if (strsql.Trim().Length > 1)
+ {
+ cmd.CommandText = strsql;
+ cmd.ExecuteNonQuery();
+ }
+ }
+
+ tx.Commit();
+ }
+ catch (SqlException E)
+ {
+ tx.Rollback();
+ throw new Exception(E.Message);
+ }
+ }
+ }
+
+ /// <summary>
+ /// 鎵ц甯︿竴涓瓨鍌ㄨ繃绋嬪弬鏁扮殑鐨凷QL璇彞銆�
+ /// </summary>
+ /// <param name="SQLString">SQL璇彞</param>
+ /// <param name="content">鍙傛暟鍐呭,姣斿涓�涓瓧娈垫槸鏍煎紡澶嶆潅鐨勬枃绔狅紝鏈夌壒娈婄鍙凤紝鍙互閫氳繃杩欎釜鏂瑰紡娣诲姞</param>
+ /// <returns>褰卞搷鐨勮褰曟暟</returns>
+ public static int ExecuteSql(string SQLString, string content)
+ {
+ using (var connection = new SqlConnection(strConn))
+ {
+ var cmd = new SqlCommand(SQLString, connection);
+ var myParameter = new SqlParameter("@content", SqlDbType.NText);
+ myParameter.Value = content;
+ cmd.Parameters.Add(myParameter);
+ try
+ {
+ connection.Open();
+ var rows = cmd.ExecuteNonQuery();
+ return rows;
+ }
+ catch (SqlException E)
+ {
+ throw new Exception(E.Message);
+ }
+ finally
+ {
+ cmd.Dispose();
+ connection.Close();
+ }
+ }
+ }
+
+ /// <summary>
+ /// 鍚戞暟鎹簱閲屾彃鍏ュ浘鍍忔牸寮忕殑瀛楁(鍜屼笂闈㈡儏鍐电被浼肩殑鍙︿竴绉嶅疄渚�)
+ /// </summary>
+ /// <param name="strSQL">SQL璇彞</param>
+ /// <param name="fs">鍥惧儚瀛楄妭,鏁版嵁搴撶殑瀛楁绫诲瀷涓篿mage鐨勬儏鍐�</param>
+ /// <returns>褰卞搷鐨勮褰曟暟</returns>
+ public static int ExecuteSqlInsertImg(string strSQL, byte[] fs)
+ {
+ using (var connection = new SqlConnection(strConn))
+ {
+ var cmd = new SqlCommand(strSQL, connection);
+ var myParameter = new SqlParameter("@fs", SqlDbType.Image);
+ myParameter.Value = fs;
+ cmd.Parameters.Add(myParameter);
+ try
+ {
+ connection.Open();
+ var rows = cmd.ExecuteNonQuery();
+ return rows;
+ }
+ catch (SqlException E)
+ {
+ throw new Exception(E.Message);
+ }
+ finally
+ {
+ cmd.Dispose();
+ connection.Close();
+ }
+ }
+ }
+
+ /// <summary>
+ /// 鎵ц涓�鏉¤绠楁煡璇㈢粨鏋滆鍙ワ紝杩斿洖鏌ヨ缁撴灉锛坥bject锛夈��
+ /// </summary>
+ /// <param name="SQLString">璁$畻鏌ヨ缁撴灉璇彞</param>
+ /// <returns>鏌ヨ缁撴灉锛坥bject锛�</returns>
+ public static object GetSingle(string SQLString)
+ {
+ using (var connection = new SqlConnection(strConn))
+ {
+ using (var cmd = new SqlCommand(SQLString, connection))
+ {
+ try
+ {
+ connection.Open();
+ var obj = cmd.ExecuteScalar();
+ if (Equals(obj, null) || Equals(obj, DBNull.Value))
+ return null;
+ return obj;
+ }
+ catch (SqlException e)
+ {
+ connection.Close();
+ throw new Exception(e.Message);
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// 鎵ц鏌ヨ璇彞锛岃繑鍥濻qlDataReader
+ /// </summary>
+ /// <param name="strSQL">鏌ヨ璇彞</param>
+ /// <returns>SqlDataReader</returns>
+ public static SqlDataReader ExecuteReader(string strSQL)
+ {
+ var connection = new SqlConnection(strConn);
+ var cmd = new SqlCommand(strSQL, connection);
+ try
+ {
+ connection.Open();
+ var myReader = cmd.ExecuteReader();
+ return myReader;
+ }
+ catch (SqlException e)
+ {
+ throw new Exception(e.Message);
+ }
+ }
+
+ /// <summary>
+ /// 鎵ц鏌ヨ璇彞锛岃繑鍥濪ataSet
+ /// </summary>
+ /// <param name="SQLString">鏌ヨ璇彞</param>
+ /// <returns>DataSet</returns>
+ public static DataSet Query(string SQLString)
+ {
+ using (var connection = new SqlConnection(strConn))
+ {
+ var ds = new DataSet();
+ try
+ {
+ connection.Open();
+ var command = new SqlDataAdapter(SQLString, connection);
+ command.Fill(ds, "ds");
+ }
+ catch (SqlException ex)
+ {
+ throw new Exception(ex.Message);
+ }
+
+ return ds;
+ }
+ }
+
+ #endregion
+
+ #region 鎵ц甯﹀弬鏁扮殑SQL璇彞
+
+ /// <summary>
+ /// 鎵цSQL璇彞锛岃繑鍥炲奖鍝嶇殑璁板綍鏁�
+ /// </summary>
+ /// <param name="SQLString">SQL璇彞</param>
+ /// <returns>褰卞搷鐨勮褰曟暟</returns>
+ public static int ExecuteSql(string SQLString,
+ params SqlParameter[] cmdParms)
+ {
+ using (var connection = new SqlConnection(strConn))
+ {
+ using (var cmd = new SqlCommand())
+ {
+ try
+ {
+ PrepareCommand(cmd, connection, null, SQLString, cmdParms);
+ var rows = cmd.ExecuteNonQuery();
+ cmd.Parameters.Clear();
+ return rows;
+ }
+ catch (SqlException E)
+ {
+ throw new Exception(E.Message);
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// 鎵ц澶氭潯SQL璇彞锛屽疄鐜版暟鎹簱浜嬪姟銆�
+ /// </summary>
+ /// <param name="SQLStringList">SQL璇彞鐨勫搱甯岃〃锛坘ey涓簊ql璇彞锛寁alue鏄璇彞鐨凷qlParameter[]锛�</param>
+ public static void ExecuteSqlTran(Hashtable SQLStringList)
+ {
+ using (var conn = new SqlConnection(strConn))
+ {
+ conn.Open();
+ using (var trans = conn.BeginTransaction())
+ {
+ var cmd = new SqlCommand();
+ try
+ {
+ //寰幆
+ foreach (DictionaryEntry myDE in SQLStringList)
+ {
+ var cmdText = myDE.Key.ToString();
+ var cmdParms = (SqlParameter[])myDE.Value;
+ PrepareCommand(cmd, conn, trans, cmdText, cmdParms);
+ var val = cmd.ExecuteNonQuery();
+ cmd.Parameters.Clear();
+
+ //trans.Commit();
+ }
+
+ trans.Commit();
+ }
+ catch
+ {
+ trans.Rollback();
+ throw;
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// 鎵ц澶氭潯SQL璇彞锛屽疄鐜版暟鎹簱浜嬪姟銆�
+ /// </summary>
+ /// <param name="SQLStringList">SQL璇彞鐨勫搱甯岃〃锛坘ey涓簊ql璇彞锛寁alue鏄璇彞鐨凷qlParameter[]锛�</param>
+ public static int ExecuteSqlTranRtn(Hashtable SQLStringList)
+ {
+ var d = 0;
+ using (var conn = new SqlConnection(strConn))
+ {
+ conn.Open();
+ using (var trans = conn.BeginTransaction())
+ {
+ var cmd = new SqlCommand();
+ try
+ {
+ //寰幆
+ foreach (DictionaryEntry myDE in SQLStringList)
+ {
+ var cmdText = myDE.Key.ToString();
+ var cmdParms = (SqlParameter[])myDE.Value;
+ PrepareCommand(cmd, conn, trans, cmdText, cmdParms);
+ var val = cmd.ExecuteNonQuery();
+ d = d + val;
+ cmd.Parameters.Clear();
+
+ //trans.Commit();
+ }
+
+ trans.Commit();
+ }
+ catch
+ {
+ trans.Rollback();
+ throw;
+ }
+ }
+ }
+
+ return d;
+ }
+
+ /// <summary>
+ /// 鎵ц澶氭潯SQL璇彞锛屽疄鐜版暟鎹簱浜嬪姟
+ /// </summary>
+ /// <param name="SQLStringList">SQL璇彞鐨勫搱甯岃〃锛坘ey涓烘爣璇嗭紝value鏄璇彞鐨凷qlParameter[]锛�</param>
+ public static void ExecuteSqlTran(string sqltxt, Hashtable SQLStringList)
+ {
+ using (var conn = new SqlConnection(strConn))
+ {
+ conn.Open();
+ using (var trans = conn.BeginTransaction())
+ {
+ var cmd = new SqlCommand();
+ try
+ {
+ //寰幆
+ foreach (DictionaryEntry myDE in SQLStringList)
+ {
+ var cmdText = sqltxt;
+ var cmdParms = (SqlParameter[])myDE.Value;
+ PrepareCommand(cmd, conn, trans, cmdText, cmdParms);
+ var val = cmd.ExecuteNonQuery();
+ cmd.Parameters.Clear();
+ }
+
+ trans.Commit();
+ }
+ catch
+ {
+ trans.Rollback();
+ throw;
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// 鎵ц涓�鏉¤绠楁煡璇㈢粨鏋滆鍙ワ紝杩斿洖鏌ヨ缁撴灉锛坥bject锛夈��
+ /// </summary>
+ /// <param name="SQLString">璁$畻鏌ヨ缁撴灉璇彞</param>
+ /// <returns>鏌ヨ缁撴灉锛坥bject锛�</returns>
+ public static object GetSingle(string SQLString,
+ params SqlParameter[] cmdParms)
+ {
+ using (var connection = new SqlConnection(strConn))
+ {
+ using (var cmd = new SqlCommand())
+ {
+ try
+ {
+ PrepareCommand(cmd, connection, null, SQLString, cmdParms);
+ var obj = cmd.ExecuteScalar();
+ cmd.Parameters.Clear();
+ if (Equals(obj, null) || Equals(obj, DBNull.Value))
+ return null;
+ return obj;
+ }
+ catch (SqlException e)
+ {
+ throw new Exception(e.Message);
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// 鎵ц鏌ヨ璇彞锛岃繑鍥濻qlDataReader
+ /// </summary>
+ /// <param name="strSQL">鏌ヨ璇彞</param>
+ /// <returns>SqlDataReader</returns>
+ public static SqlDataReader ExecuteReader(string SQLString,
+ params SqlParameter[] cmdParms)
+ {
+ var connection = new SqlConnection(strConn);
+ var cmd = new SqlCommand();
+ try
+ {
+ PrepareCommand(cmd, connection, null, SQLString, cmdParms);
+ var myReader = cmd.ExecuteReader();
+ cmd.Parameters.Clear();
+ return myReader;
+ }
+ catch (SqlException e)
+ {
+ throw new Exception(e.Message);
+ }
+ }
+
+ /// <summary>
+ /// 鎵ц鏌ヨ璇彞锛岃繑鍥濪ataSet
+ /// </summary>
+ /// <param name="SQLString">鏌ヨ璇彞</param>
+ /// <returns>DataSet</returns>
+ public static DataSet Query(string SQLString,
+ params SqlParameter[] cmdParms)
+ {
+ using (var connection = new SqlConnection(strConn))
+ {
+ var cmd = new SqlCommand();
+ PrepareCommand(cmd, connection, null, SQLString, cmdParms);
+ using (var da = new SqlDataAdapter(cmd))
+ {
+ var ds = new DataSet();
+ try
+ {
+ da.Fill(ds, "ds");
+ cmd.Parameters.Clear();
+ }
+ catch (SqlException ex)
+ {
+ throw new Exception(ex.Message);
+ }
+
+ return ds;
+ }
+ }
+ }
+
+ //private static void PrepareCommand(SqlCommand cmd, SqlConnection conn, SqlTransaction trans, string cmdText, SqlParameter[] cmdParms)
+ //{
+
+ // if (conn.State != ConnectionState.Open)
+ // conn.Open();
+ // cmd.Connection = conn;
+ // cmd.CommandText = cmdText;
+ // if (trans != null)
+ // cmd.Transaction = trans;
+ // cmd.CommandType = CommandType.Text;//cmdType;
+ // if (cmdParms != null)
+ // {
+ // foreach (SqlParameter parameter in cmdParms)
+ // {
+ // if ((parameter.Direction == ParameterDirection.InputOutput || parameter.Direction == ParameterDirection.Input) &&
+ // (parameter.Value == null))
+ // {
+ // parameter.Value = DBNull.Value;
+ // }
+ // cmd.Parameters.Add(parameter);
+ // }
+ // }
+ //}
+ private static void PrepareCommand(SqlCommand cmd, SqlConnection conn,
+ SqlTransaction trans, string cmdText, SqlParameter[] cmdParms)
+ {
+ if (conn.State != ConnectionState.Open)
+ conn.Open();
+ cmd.Connection = conn;
+ cmd.CommandText = cmdText;
+ if (trans != null)
+ cmd.Transaction = trans;
+ cmd.CommandType = CommandType.Text; //cmdType;
+ if (cmdParms != null)
+ foreach (var parm in cmdParms)
+ {
+ //cmd.Parameters.Add(parm);
+ if ((parm.Direction == ParameterDirection.InputOutput ||
+ parm.Direction == ParameterDirection.Input) &&
+ parm.Value == null)
+ parm.Value = DBNull.Value;
+ cmd.Parameters.Add(parm);
+ }
+ }
+
+ #endregion
+
+ #region 瀛樺偍杩囩▼鎿嶄綔
+
+ /// <summary>
+ /// 鎵ц瀛樺偍杩囩▼
+ /// </summary>
+ /// <param name="storedProcName">瀛樺偍杩囩▼鍚�</param>
+ /// <param name="parameters">瀛樺偍杩囩▼鍙傛暟</param>
+ /// <returns>SqlDataReader</returns>
+ public static SqlDataReader RunProcedure(string storedProcName,
+ IDataParameter[] parameters)
+ {
+ var connection = new SqlConnection(strConn);
+ SqlDataReader returnReader;
+ connection.Open();
+ var command = BuildQueryCommand(connection, storedProcName, parameters);
+ command.CommandType = CommandType.StoredProcedure;
+ returnReader = command.ExecuteReader();
+ return returnReader;
+ }
+
+ /// <summary>
+ /// 鎵ц甯﹁緭鍑哄弬鏁扮殑瀛樺偍杩囩▼
+ /// </summary>
+ /// <param name="storedProcName">瀛樺偍杩囩▼鍚�</param>
+ /// <param name="parameters">瀛樺偍杩囩▼鍙傛暟,OutName 杈撳嚭鍙傛暟鐨勫悕瀛楋紙濡傛灉鏄涓互@涓哄垎鍓茬锛�</param>
+ /// <returns>string(浠鍒嗗壊鐨勮緭鍑哄弬鏁扮殑鍊�)</returns>
+ public static string RunProcedureOut(string storedProcName,
+ IDataParameter[] parameters, string outName)
+ {
+ var connection = new SqlConnection(strConn);
+ var returnstring = string.Empty;
+ connection.Open();
+ var command = BuildQueryCommand(connection, storedProcName, parameters);
+ command.CommandType = CommandType.StoredProcedure;
+ command.ExecuteNonQuery();
+ var str = string.Empty;
+ //瑙f瀽绌胯繃鏉ョ殑鍙傛暟
+ var Arraystr = outName.Split('|');
+ foreach (var st in Arraystr)
+ {
+ var a = st;
+ if (str == string.Empty)
+ str = command.Parameters[a].Value.ToString();
+ else
+ str = str + "|" + command.Parameters[a].Value;
+ }
+
+ return str;
+ }
+
+ /// <summary>
+ /// 鎵ц瀛樺偍杩囩▼
+ /// </summary>
+ /// <param name="storedProcName">瀛樺偍杩囩▼鍚�</param>
+ /// <param name="parameters">瀛樺偍杩囩▼鍙傛暟</param>
+ /// <param name="tableName">DataSet缁撴灉涓殑琛ㄥ悕</param>
+ /// <returns>DataSet</returns>
+ public static DataSet RunProcedure(string storedProcName,
+ IDataParameter[] parameters, string tableName)
+ {
+ using (var connection = new SqlConnection(strConn))
+ {
+ var dataSet = new DataSet();
+ connection.Open();
+ var sqlDA = new SqlDataAdapter();
+ sqlDA.SelectCommand =
+ BuildQueryCommand(connection, storedProcName, parameters);
+ sqlDA.Fill(dataSet, tableName);
+ connection.Close();
+ return dataSet;
+ }
+ }
+
+ /// <summary>
+ /// 鏋勫缓 SqlCommand 瀵硅薄(鐢ㄦ潵杩斿洖涓�涓粨鏋滈泦锛岃�屼笉鏄竴涓暣鏁板��)
+ /// </summary>
+ /// <param name="connection">鏁版嵁搴撹繛鎺�</param>
+ /// <param name="storedProcName">瀛樺偍杩囩▼鍚�</param>
+ /// <param name="parameters">瀛樺偍杩囩▼鍙傛暟</param>
+ /// <returns>SqlCommand</returns>
+ private static SqlCommand BuildQueryCommand(SqlConnection connection,
+ string storedProcName, IDataParameter[] parameters)
+ {
+ var command = new SqlCommand(storedProcName, connection);
+ command.CommandType = CommandType.StoredProcedure;
+ foreach (SqlParameter parameter in parameters)
+ command.Parameters.Add(parameter);
+ return command;
+ }
+
+ /// <summary>
+ /// 鎵ц瀛樺偍杩囩▼锛岃繑鍥炲奖鍝嶇殑琛屾暟
+ /// </summary>
+ /// <param name="storedProcName">瀛樺偍杩囩▼鍚�</param>
+ /// <param name="parameters">瀛樺偍杩囩▼鍙傛暟</param>
+ /// <param name="rowsAffected">褰卞搷鐨勮鏁�</param>
+ /// <returns></returns>
+ public static int RunProcedure(string storedProcName,
+ IDataParameter[] parameters, out int rowsAffected)
+ {
+ using (var connection = new SqlConnection(strConn))
+ {
+ int result;
+ connection.Open();
+ var command =
+ BuildIntCommand(connection, storedProcName, parameters);
+ rowsAffected = command.ExecuteNonQuery();
+ result = (int)command.Parameters["ReturnValue"].Value;
+ //Connection.Close();
+ return result;
+ }
+ }
+
+ /// <summary>
+ /// 鎵ц瀛樺偍杩囩▼锛岃繑鍥炲奖鍝嶈鏁�
+ /// </summary>
+ /// <param name="storedProcName">string绫诲瀷瀛樺偍杩囩▼鍚�</param>
+ /// <param name="parameters">SqlParameters[]瀛樺偍杩囩▼鍙傛暟</param>
+ /// <returns>int 褰卞搷琛屾暟</returns>
+ public static int RunProcedure_NonQuery(string storedProcName,
+ IDataParameter[] parameters)
+ {
+ using (var connection = new SqlConnection(strConn))
+ {
+ connection.Open();
+ var command =
+ BuildQueryCommand(connection, storedProcName, parameters);
+ return command.ExecuteNonQuery();
+ }
+ }
+
+ /// <summary>
+ /// 鍒涘缓 SqlCommand 瀵硅薄瀹炰緥(鐢ㄦ潵杩斿洖涓�涓暣鏁板��)
+ /// </summary>
+ /// <param name="storedProcName">瀛樺偍杩囩▼鍚�</param>
+ /// <param name="parameters">瀛樺偍杩囩▼鍙傛暟</param>
+ /// <returns>SqlCommand 瀵硅薄瀹炰緥</returns>
+ private static SqlCommand BuildIntCommand(SqlConnection connection,
+ string storedProcName, IDataParameter[] parameters)
+ {
+ var command = BuildQueryCommand(connection, storedProcName, parameters);
+ command.Parameters.Add(new SqlParameter("ReturnValue",
+ SqlDbType.Int, 4, ParameterDirection.ReturnValue,
+ false, 0, 0, string.Empty, DataRowVersion.Default, null));
+ return command;
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/Dto/service/Material.cs b/Dto/service/Material.cs
new file mode 100644
index 0000000..a6624e0
--- /dev/null
+++ b/Dto/service/Material.cs
@@ -0,0 +1,20 @@
+锘縩amespace NewPdaSqlServer.Dto.service;
+
+public class Material
+{
+ public string? FMaterialId { get; set; }
+ public string? FUintId { get; set; }
+ public decimal? FActReceiveQty { get; set; }
+ public string? FStockId { get; set; }
+ public DateTime? FPreDeliveryDate { get; set; }
+ public Guid? F_MES_ENTRYID { get; set; }
+ public int? FSRCENTRYID { get; set; }
+ public Guid? FSRCENTRYGuid { get; set; }
+
+ public string? FLot { get; set; }
+
+ public string? FMATERIALID { get; set; }
+ public string? FRMREALQTY { get; set; }
+ public string? FSTOCKID { get; set; }
+ public string? FUINT { get; set; }
+}
\ No newline at end of file
diff --git a/Dto/service/PurchaseInventory.cs b/Dto/service/PurchaseInventory.cs
new file mode 100644
index 0000000..9680359
--- /dev/null
+++ b/Dto/service/PurchaseInventory.cs
@@ -0,0 +1,19 @@
+锘縰sing NewPdaSqlServer.entity;
+
+namespace NewPdaSqlServer.Dto.service;
+
+public class PurchaseInventory
+{
+ public string? ItemNo { get; set; }
+
+ public decimal? SumQuantity { get; set; }
+
+ public MesInvItemIns? ItemIns { get; set; }
+ public List<MesInvItemInCDetails>? InvItemInCDetails { get; set; }
+
+ public List<MesInvItemInCItems>? ItemInDetails { get; set; }
+
+ public List<MesInvItemStocks>? ItemStocks { get; set; }
+
+ public string? Message{ get; set; }
+}
\ No newline at end of file
diff --git a/Dto/service/WarehouseQuery.cs b/Dto/service/WarehouseQuery.cs
new file mode 100644
index 0000000..24a77db
--- /dev/null
+++ b/Dto/service/WarehouseQuery.cs
@@ -0,0 +1,38 @@
+锘縰sing NewPdaSqlServer.Dto.@base;
+
+namespace NewPdaSqlServer.Dto.service;
+
+public class WarehouseQuery : Page
+{
+ public string? id { get; set; }
+
+ public decimal[]? ItemArnDetailIds { get; set; }
+
+ public string? itemInId { get; set; }
+
+ public string? sectionCode { get; set; }
+ public string? barcode { get; set; }
+ public string? userName { get; set; }
+ public string? billNo { get; set; }
+ public short? status { get; set; }
+ public DateTime? date { get; set; }
+ public string? Type { get; set; }
+ public string? DepotCode { get; set; }
+ public string? SuppNo { get; set; }
+
+ public string? Factory { get; set; }
+
+ public string? Company { get; set; }
+ public string? ItemNo { get; set; }
+
+ public string? ItemModel { get; set; }
+ public string? OrgName { get; set; }
+ public string? OrgOwner { get; set; }
+ public string? ItemNum { get; set; }
+ public string? Printnumn { get; set; }
+
+ public string? ItemName { get; set; }
+ public string? daa001 { get; set; }
+
+ public decimal? Num { get; set; }
+}
\ No newline at end of file
diff --git a/NewPdaSqlServer.csproj b/NewPdaSqlServer.csproj
index 55d24ed..8f8119c 100644
--- a/NewPdaSqlServer.csproj
+++ b/NewPdaSqlServer.csproj
@@ -7,10 +7,12 @@
</PropertyGroup>
<ItemGroup>
+ <PackageReference Include="Masuit.Tools.Core" Version="2024.5.8" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.8" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.10" />
<PackageReference Include="SqlSugarCore" Version="5.1.4.169" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.8.0" />
+ <PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
</ItemGroup>
</Project>
diff --git a/entity/MesDepotSections.cs b/entity/MesDepotSections.cs
new file mode 100644
index 0000000..4f40049
--- /dev/null
+++ b/entity/MesDepotSections.cs
@@ -0,0 +1,126 @@
+锘縰sing SqlSugar;
+
+namespace NewPdaSqlServer.entity
+{
+ /// <summary>
+ ///
+ ///</summary>
+ [SugarTable("MES_DEPOT_SECTIONS")]
+ public class MesDepotSections
+ {
+ /// <summary>
+ ///
+ /// 榛樿鍊�: (newid())
+ ///</summary>
+ [SugarColumn(ColumnName = "guid", IsPrimaryKey = true)]
+ public Guid Guid { get; set; }
+
+ /// <summary>
+ ///
+ ///</summary>
+ [SugarColumn(ColumnName = "depot_guid")]
+ public Guid? DepotGuid { get; set; }
+
+ /// <summary>
+ /// ID(SEQ_INV_ID)锛圗RPID锛�
+ ///</summary>
+ [SugarColumn(ColumnName = "depot_section_id")]
+ public int DepotSectionId { get; set; }
+
+ /// <summary>
+ /// 璐т綅缂栫爜
+ ///</summary>
+ [SugarColumn(ColumnName = "depot_section_code")]
+ public string? DepotSectionCode { get; set; }
+
+ /// <summary>
+ /// 璐т綅鍚嶇О
+ ///</summary>
+ [SugarColumn(ColumnName = "depot_section_name")]
+ public string? DepotSectionName { get; set; }
+
+ /// <summary>
+ /// 鍙備笌榻愬鏍¢獙(0:鍚�,1:鏄�)
+ ///</summary>
+ [SugarColumn(ColumnName = "completeness_flag")]
+ public int? CompletenessFlag { get; set; }
+
+ /// <summary>
+ /// 澶囨敞
+ ///</summary>
+ [SugarColumn(ColumnName = "description")]
+ public string? Description { get; set; }
+
+ /// <summary>
+ /// 鍒涘缓浜�
+ ///</summary>
+ [SugarColumn(ColumnName = "create_by")]
+ public string? CreateBy { get; set; }
+
+ /// <summary>
+ /// 鍒涘缓鏃堕棿
+ ///</summary>
+ [SugarColumn(ColumnName = "create_date")]
+ public DateTime? CreateDate { get; set; }
+
+ /// <summary>
+ /// 鏈�鍚庢洿鏂颁汉
+ ///</summary>
+ [SugarColumn(ColumnName = "lastupdate_by")]
+ public string? LastupdateBy { get; set; }
+
+ /// <summary>
+ /// 鏈�鍚庢洿鏂版椂闂�
+ ///</summary>
+ [SugarColumn(ColumnName = "lastupdate_date")]
+ public DateTime? LastupdateDate { get; set; }
+
+ /// <summary>
+ ///
+ ///</summary>
+ [SugarColumn(ColumnName = "company")]
+ public string? Company { get; set; }
+
+ /// <summary>
+ ///
+ ///</summary>
+ [SugarColumn(ColumnName = "factory")]
+ public string? Factory { get; set; }
+
+ /// <summary>
+ /// 鍗℃澘鏁�
+ ///</summary>
+ [SugarColumn(ColumnName = "kb_qty")]
+ public int? KbQty { get; set; }
+
+ /// <summary>
+ /// 浠撲綅缁処D
+ ///</summary>
+ [SugarColumn(ColumnName = "zuid")]
+ public int? Zuid { get; set; }
+
+ /// <summary>
+ /// 浠撲綅鍏ㄥ悕
+ ///</summary>
+ [SugarColumn(ColumnName = "depot_section_namet")]
+ public string? DepotSectionNamet { get; set; }
+
+ /// <summary>
+ ///
+ ///</summary>
+ [SugarColumn(ColumnName = "erpid")]
+ public int? Erpid { get; set; }
+
+ /// <summary>
+ /// 浠撳簱绫诲埆缂栫爜
+ /// </summary>
+ [SugarColumn(IsIgnore = true)]
+ public string? DepotCode { get; set; }
+
+ /// <summary>
+ /// 浠撳簱绫诲埆鍚嶇О
+ /// </summary>
+ [SugarColumn(IsIgnore = true)]
+ public string? DepotName { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/entity/MesDepots.cs b/entity/MesDepots.cs
index 6d4ae7b..7448b67 100644
--- a/entity/MesDepots.cs
+++ b/entity/MesDepots.cs
@@ -12,168 +12,199 @@
///
/// 榛樿鍊�: (newid())
///</summary>
- [SugarColumn(ColumnName="guid" ,IsPrimaryKey = true )]
- public Guid Guid { get; set; }
+ [SugarColumn(ColumnName = "guid", IsPrimaryKey = true)]
+ public Guid Guid { get; set; }
+
/// <summary>
/// ID(SEQ_INV_ID)
///</summary>
- [SugarColumn(ColumnName="depot_id" )]
- public int DepotId { get; set; }
+ [SugarColumn(ColumnName = "depot_id")]
+ public int DepotId { get; set; }
+
/// <summary>
/// 浠撳簱绫诲埆缂栫爜
///</summary>
- [SugarColumn(ColumnName="depot_code" )]
- public string DepotCode { get; set; }
+ [SugarColumn(ColumnName = "depot_code")]
+ public string? DepotCode { get; set; }
+
/// <summary>
/// 浠撳簱绫诲埆鍚嶇О
///</summary>
- [SugarColumn(ColumnName="depot_name" )]
- public string DepotName { get; set; }
+ [SugarColumn(ColumnName = "depot_name")]
+ public string? DepotName { get; set; }
+
/// <summary>
/// 澶囨敞
///</summary>
- [SugarColumn(ColumnName="description" )]
- public string Description { get; set; }
+ [SugarColumn(ColumnName = "description")]
+ public string? Description { get; set; }
+
/// <summary>
/// 浠撳簱璐熻矗浜�
///</summary>
- [SugarColumn(ColumnName="create_by" )]
- public string CreateBy { get; set; }
+ [SugarColumn(ColumnName = "create_by")]
+ public string? CreateBy { get; set; }
+
/// <summary>
/// 鍒涘缓鏃堕棿
///</summary>
- [SugarColumn(ColumnName="create_date" )]
- public DateTime? CreateDate { get; set; }
+ [SugarColumn(ColumnName = "create_date")]
+ public DateTime? CreateDate { get; set; }
+
/// <summary>
/// 鏈�鍚庢洿鏂颁汉
///</summary>
- [SugarColumn(ColumnName="lastupdate_by" )]
- public string LastupdateBy { get; set; }
+ [SugarColumn(ColumnName = "lastupdate_by")]
+ public string? LastupdateBy { get; set; }
+
/// <summary>
/// 鏈�鍚庢洿鏂版椂闂�
///</summary>
- [SugarColumn(ColumnName="lastupdate_date" )]
- public DateTime? LastupdateDate { get; set; }
+ [SugarColumn(ColumnName = "lastupdate_date")]
+ public DateTime? LastupdateDate { get; set; }
+
/// <summary>
/// 浠撳簱绫诲瀷
///</summary>
- [SugarColumn(ColumnName="depottype" )]
- public string Depottype { get; set; }
+ [SugarColumn(ColumnName = "depottype")]
+ public string? Depottype { get; set; }
+
/// <summary>
/// 鍒嗗巶缂栫爜
///</summary>
- [SugarColumn(ColumnName="factory" )]
- public string Factory { get; set; }
+ [SugarColumn(ColumnName = "factory")]
+ public string? Factory { get; set; }
+
/// <summary>
/// 鐗╂枡浣跨敤
/// 榛樿鍊�: ((0))
///</summary>
- [SugarColumn(ColumnName="type_1" )]
- public int? Type1 { get; set; }
+ [SugarColumn(ColumnName = "type_1")]
+ public int? Type1 { get; set; }
+
/// <summary>
/// 鎴愬搧浣跨敤
/// 榛樿鍊�: ((0))
///</summary>
- [SugarColumn(ColumnName="type_2" )]
- public int? Type2 { get; set; }
+ [SugarColumn(ColumnName = "type_2")]
+ public int? Type2 { get; set; }
+
/// <summary>
/// 浠撳簱绫诲瀷缂栫爜
///</summary>
- [SugarColumn(ColumnName="depottypecode" )]
- public int? Depottypecode { get; set; }
+ [SugarColumn(ColumnName = "depottypecode")]
+ public int? Depottypecode { get; set; }
+
/// <summary>
/// 鍏徃浠g爜
///</summary>
- [SugarColumn(ColumnName="company" )]
- public string Company { get; set; }
+ [SugarColumn(ColumnName = "company")]
+ public string? Company { get; set; }
+
/// <summary>
/// 鐪嬫澘鍥炬爣鏍峰紡
///</summary>
- [SugarColumn(ColumnName="icon_type" )]
- public int? IconType { get; set; }
+ [SugarColumn(ColumnName = "icon_type")]
+ public int? IconType { get; set; }
+
/// <summary>
/// 鏄惁濮斿浠撳簱
/// 榛樿鍊�: ((0))
///</summary>
- [SugarColumn(ColumnName="is_wy" )]
- public int? IsWy { get; set; }
+ [SugarColumn(ColumnName = "is_wy")]
+ public int? IsWy { get; set; }
+
/// <summary>
/// 鏄惁涓嶈壇鍝佷粨
/// 榛樿鍊�: ((0))
///</summary>
- [SugarColumn(ColumnName="is_ng" )]
- public string IsNg { get; set; }
+ [SugarColumn(ColumnName = "is_ng")]
+ public string? IsNg { get; set; }
+
/// <summary>
/// 浠撳簱鍦板潃
///</summary>
- [SugarColumn(ColumnName="cwhaddress" )]
- public string Cwhaddress { get; set; }
+ [SugarColumn(ColumnName = "cwhaddress")]
+ public string? Cwhaddress { get; set; }
+
/// <summary>
/// 鐪嬫澘鏄剧ず鍖哄煙缂栧彿
/// 榛樿鍊�: ((1))
///</summary>
- [SugarColumn(ColumnName="pi_type" )]
- public string PiType { get; set; }
+ [SugarColumn(ColumnName = "pi_type")]
+ public string? PiType { get; set; }
+
/// <summary>
/// 鍒嗙粍
///</summary>
- [SugarColumn(ColumnName="zuid" )]
- public string Zuid { get; set; }
+ [SugarColumn(ColumnName = "zuid")]
+ public string? Zuid { get; set; }
+
/// <summary>
/// 鍏佽鍗虫椂搴撳瓨璐熷簱瀛�
///</summary>
- [SugarColumn(ColumnName="is_fkc" )]
- public string IsFkc { get; set; }
+ [SugarColumn(ColumnName = "is_fkc")]
+ public string? IsFkc { get; set; }
+
/// <summary>
/// 鐢熶骇杞﹂棿
///</summary>
- [SugarColumn(ColumnName="production_workshop" )]
- public string ProductionWorkshop { get; set; }
+ [SugarColumn(ColumnName = "production_workshop")]
+ public string? ProductionWorkshop { get; set; }
+
/// <summary>
/// 鐗╂枡灞炴��
///</summary>
- [SugarColumn(ColumnName="material_properti" )]
- public string MaterialProperti { get; set; }
+ [SugarColumn(ColumnName = "material_properti")]
+ public string? MaterialProperti { get; set; }
+
/// <summary>
/// 鑷畾涔夊瓧娈�3
///</summary>
- [SugarColumn(ColumnName="remark3" )]
- public string Remark3 { get; set; }
+ [SugarColumn(ColumnName = "remark3")]
+ public string? Remark3 { get; set; }
+
/// <summary>
/// 鑷畾涔夊瓧娈�4
///</summary>
- [SugarColumn(ColumnName="remark4" )]
- public string Remark4 { get; set; }
+ [SugarColumn(ColumnName = "remark4")]
+ public string? Remark4 { get; set; }
+
/// <summary>
/// 鑷畾涔夊瓧娈�5
///</summary>
- [SugarColumn(ColumnName="remark5" )]
- public string Remark5 { get; set; }
+ [SugarColumn(ColumnName = "remark5")]
+ public string? Remark5 { get; set; }
+
/// <summary>
///
///</summary>
- [SugarColumn(ColumnName="check_date" )]
- public DateTime? CheckDate { get; set; }
+ [SugarColumn(ColumnName = "check_date")]
+ public DateTime? CheckDate { get; set; }
+
/// <summary>
///
///</summary>
- [SugarColumn(ColumnName="check_by" )]
- public string CheckBy { get; set; }
+ [SugarColumn(ColumnName = "check_by")]
+ public string? CheckBy { get; set; }
+
/// <summary>
///
/// 榛樿鍊�: ((0))
///</summary>
- [SugarColumn(ColumnName="check_status" )]
- public bool? CheckStatus { get; set; }
+ [SugarColumn(ColumnName = "check_status")]
+ public bool? CheckStatus { get; set; }
+
/// <summary>
/// 鍒涘缓缁勭粐
///</summary>
- [SugarColumn(ColumnName="Fumbrella" )]
- public string Fumbrella { get; set; }
+ [SugarColumn(ColumnName = "Fumbrella")]
+ public string? Fumbrella { get; set; }
+
/// <summary>
/// 浣跨敤缁勭粐
///</summary>
- [SugarColumn(ColumnName="FSubsidiary" )]
- public string FSubsidiary { get; set; }
+ [SugarColumn(ColumnName = "FSubsidiary")]
+ public string? FSubsidiary { get; set; }
}
-}
+}
\ No newline at end of file
diff --git a/entity/MesInvBusiness2.cs b/entity/MesInvBusiness2.cs
new file mode 100644
index 0000000..e10ba5d
--- /dev/null
+++ b/entity/MesInvBusiness2.cs
@@ -0,0 +1,235 @@
+锘縰sing SqlSugar;
+
+namespace NewPdaSqlServer.entity
+{
+ /// <summary>
+ /// 搴撳瓨浜ゆ槗璁板綍琛�
+ ///</summary>
+ [SugarTable("MES_INV_BUSINESS2")]
+ public class MesInvBusiness2
+ {
+ /// <summary>
+ /// ID(seq_inv_id)
+ /// 榛樿鍊�: (newid())
+ ///</summary>
+ [SugarColumn(ColumnName = "guid", IsPrimaryKey = true)]
+ public Guid Guid { get; set; }
+
+ /// <summary>
+ /// 鐘舵�亅0-鏈氦鏄�1-宸蹭氦鏄�
+ ///</summary>
+ [SugarColumn(ColumnName = "STATUS")]
+ public long? Status { get; set; }
+
+ /// <summary>
+ /// 鍗曟嵁绫诲瀷ID
+ ///</summary>
+ [SugarColumn(ColumnName = "BILL_TYPE_ID")]
+ public long? BillTypeId { get; set; }
+
+ /// <summary>
+ /// 浜嬪姟绫诲瀷缂栫爜
+ ///</summary>
+ [SugarColumn(ColumnName = "TRANSACTION_CODE")]
+ public string? TransactionCode { get; set; }
+
+ /// <summary>
+ /// 浜ゆ槗绫诲瀷|1-鍏ュ簱0-杞簱-1鍑哄簱
+ ///</summary>
+ [SugarColumn(ColumnName = "BUSINESS_TYPE")]
+ public long? BusinessType { get; set; }
+
+ /// <summary>
+ /// 鍗曟嵁ID
+ ///</summary>
+ [SugarColumn(ColumnName = "BILL_ID")]
+ public long? BillId { get; set; }
+
+ /// <summary>
+ /// 鍗曟嵁缂栫爜
+ ///</summary>
+ [SugarColumn(ColumnName = "BILL_NO")]
+ public string? BillNo { get; set; }
+
+ /// <summary>
+ /// 鐢熶骇璁㈠崟鍙�
+ ///</summary>
+ [SugarColumn(ColumnName = "TASK_NO")]
+ public string? TaskNo { get; set; }
+
+ /// <summary>
+ /// 瀹㈡埛缂栧彿
+ ///</summary>
+ [SugarColumn(ColumnName = "CUSTOMER_NO")]
+ public string? CustomerNo { get; set; }
+
+ /// <summary>
+ /// 鍗曟嵁琛孖D
+ ///</summary>
+ [SugarColumn(ColumnName = "BILL_LINE_ID")]
+ public long? BillLineId { get; set; }
+
+ /// <summary>
+ /// 鐗╂枡鏉$爜
+ ///</summary>
+ [SugarColumn(ColumnName = "ITEM_BARCODE")]
+ public string? ItemBarcode { get; set; }
+
+ /// <summary>
+ /// 鏈徃鐗╂枡缂栫爜
+ ///</summary>
+ [SugarColumn(ColumnName = "ITEM_NO")]
+ public string? ItemNo { get; set; }
+
+ /// <summary>
+ /// 瀹㈡埛鐗╂枡缂栫爜
+ ///</summary>
+ [SugarColumn(ColumnName = "C_ITEM_CODE")]
+ public string? CItemCode { get; set; }
+
+ /// <summary>
+ /// 鍘傚鎵规
+ ///</summary>
+ [SugarColumn(ColumnName = "LOT_NO")]
+ public string? LotNo { get; set; }
+
+ /// <summary>
+ /// 鏄惁鐜繚(0:鍚�,1:鏄�)
+ ///</summary>
+ [SugarColumn(ColumnName = "EP_FLAG")]
+ public bool? EpFlag { get; set; }
+
+ /// <summary>
+ /// 鏁伴噺
+ ///</summary>
+ [SugarColumn(ColumnName = "QUANTITY")]
+ public decimal? Quantity { get; set; }
+
+ /// <summary>
+ /// 婧愬瓙搴揅ODE
+ ///</summary>
+ [SugarColumn(ColumnName = "FROM_INV_DEPOTS_CODE")]
+ public string? FromInvDepotsCode { get; set; }
+
+ /// <summary>
+ /// 婧愯揣浣岰ODE
+ ///</summary>
+ [SugarColumn(ColumnName = "FROM_INV_DEPOT_SECTIONS_CODE")]
+ public string? FromInvDepotSectionsCode { get; set; }
+
+ /// <summary>
+ /// 鐩殑瀛愬簱CODE
+ ///</summary>
+ [SugarColumn(ColumnName = "TO_INV_DEPOTS_CODE")]
+ public string? ToInvDepotsCode { get; set; }
+
+ /// <summary>
+ /// 鐩殑璐т綅CODE
+ ///</summary>
+ [SugarColumn(ColumnName = "TO_INV_DEPOT_SECTIONS_CODE")]
+ public string? ToInvDepotSectionsCode { get; set; }
+
+ /// <summary>
+ /// 浜ゆ槗寮傚父淇℃伅
+ ///</summary>
+ [SugarColumn(ColumnName = "DESCRIPTION")]
+ public string? Description { get; set; }
+
+ /// <summary>
+ /// 鍒涘缓浜�
+ ///</summary>
+ [SugarColumn(ColumnName = "CREATE_BY")]
+ public string? CreateBy { get; set; }
+
+ /// <summary>
+ /// 鍒涘缓鏃堕棿
+ ///</summary>
+ [SugarColumn(ColumnName = "CREATE_DATE")]
+ public DateTime? CreateDate { get; set; }
+
+ /// <summary>
+ /// 鏈�鍚庢洿鏂颁汉
+ ///</summary>
+ [SugarColumn(ColumnName = "LASTUPDATE_BY")]
+ public string? LastupdateBy { get; set; }
+
+ /// <summary>
+ /// 鏈�鍚庢洿鏂版椂闂�
+ ///</summary>
+ [SugarColumn(ColumnName = "LASTUPDATE_DATE")]
+ public DateTime? LastupdateDate { get; set; }
+
+ /// <summary>
+ /// 瓒呮崯缁熻鏍囪瘑
+ /// 榛樿鍊�: ((0))
+ ///</summary>
+ [SugarColumn(ColumnName = "ULLAGE_STAT_FLAG")]
+ public bool? UllageStatFlag { get; set; }
+
+ /// <summary>
+ /// 鍒嗗巶缂栫爜
+ ///</summary>
+ [SugarColumn(ColumnName = "FACTORY")]
+ public string? Factory { get; set; }
+
+ /// <summary>
+ /// 鍏徃浠g爜
+ ///</summary>
+ [SugarColumn(ColumnName = "COMPANY")]
+ public string? Company { get; set; }
+
+ /// <summary>
+ /// 绠卞彿鏉$爜
+ ///</summary>
+ [SugarColumn(ColumnName = "ITEM_BARCODE2")]
+ public string? ItemBarcode2 { get; set; }
+
+ /// <summary>
+ /// 鍗℃澘鏉$爜
+ ///</summary>
+ [SugarColumn(ColumnName = "ITEM_BARCODE3")]
+ public string? ItemBarcode3 { get; set; }
+
+ /// <summary>
+ /// 浠诲姟鍗曞彿
+ ///</summary>
+ [SugarColumn(ColumnName = "WORK_NO")]
+ public string? WorkNo { get; set; }
+
+ /// <summary>
+ /// 浠诲姟鍗曡鍙�
+ ///</summary>
+ [SugarColumn(ColumnName = "WORK_LINE")]
+ public int? WorkLine { get; set; }
+
+ /// <summary>
+ /// 渚涘簲鍟�
+ ///</summary>
+ [SugarColumn(ColumnName = "SUPP_NO")]
+ public string? SuppNo { get; set; }
+
+ /// <summary>
+ /// 鐢熶骇绾�
+ ///</summary>
+ [SugarColumn(ColumnName = "LINE_NO")]
+ public string? LineNo { get; set; }
+
+ /// <summary>
+ /// 閲囪喘璁㈠崟id
+ ///</summary>
+ [SugarColumn(ColumnName = "EBELN_K3ID")]
+ public long? EbelnK3id { get; set; }
+
+ /// <summary>
+ /// 閲囪喘璁㈠崟琛宨d
+ ///</summary>
+ [SugarColumn(ColumnName = "LINE_K3ID")]
+ public long? LineK3id { get; set; }
+
+ /// <summary>
+ /// 鐗╂枡ID
+ ///</summary>
+ [SugarColumn(ColumnName = "ITEM_ID")]
+ public long? ItemId { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/entity/MesInvItemArn.cs b/entity/MesInvItemArn.cs
index 53c077d..5609e47 100644
--- a/entity/MesInvItemArn.cs
+++ b/entity/MesInvItemArn.cs
@@ -8,202 +8,239 @@
[SugarTable("MES_INV_ITEM_ARN")]
public class MesInvItemArn
{
- /// <summary>
+ /// <summary>
/// 涓婚敭
/// 榛樿鍊�: (newid())
///</summary>
[SugarColumn(ColumnName="guid" ,IsPrimaryKey = true )]
public Guid Guid { get; set; }
- /// <summary>
+
+ /// <summary>
/// 鍒拌揣鍗曞彿
///</summary>
[SugarColumn(ColumnName="bill_no" )]
- public string BillNo { get; set; }
- /// <summary>
+ public string? BillNo { get; set; }
+
+ /// <summary>
/// 鐘舵�亅0-鏈鏍�1-瀹℃牳鍏ュ簱\缁撴
/// 榛樿鍊�: ((0))
///</summary>
[SugarColumn(ColumnName="status" )]
public int? Status { get; set; }
- /// <summary>
+
+ /// <summary>
/// 鍘熷洜
///</summary>
[SugarColumn(ColumnName="reason" )]
- public string Reason { get; set; }
- /// <summary>
+ public string? Reason { get; set; }
+
+ /// <summary>
/// 鍒涘缓浜�
///</summary>
[SugarColumn(ColumnName="create_by" )]
- public string CreateBy { get; set; }
- /// <summary>
+ public string? CreateBy { get; set; }
+
+ /// <summary>
/// 鍒涘缓鏃堕棿
///</summary>
[SugarColumn(ColumnName="create_date" )]
public DateTime? CreateDate { get; set; }
- /// <summary>
+
+ /// <summary>
/// 鏈�鍚庢洿鏂颁汉
///</summary>
[SugarColumn(ColumnName="lastupdate_by" )]
- public string LastupdateBy { get; set; }
- /// <summary>
+ public string? LastupdateBy { get; set; }
+
+ /// <summary>
/// 鏈�鍚庢洿鏂版椂闂�
///</summary>
[SugarColumn(ColumnName="lastupdate_date" )]
public DateTime? LastupdateDate { get; set; }
- /// <summary>
+
+ /// <summary>
/// 鍗曟嵁绫诲瀷ID
///</summary>
[SugarColumn(ColumnName="bill_type_id" )]
public int? BillTypeId { get; set; }
- /// <summary>
+
+ /// <summary>
/// 浜嬪姟绫诲瀷ID
///</summary>
[SugarColumn(ColumnName="transaction_id" )]
public int? TransactionId { get; set; }
- /// <summary>
+
+ /// <summary>
/// 澶囨敞
///</summary>
[SugarColumn(ColumnName="remark" )]
- public string Remark { get; set; }
- /// <summary>
+ public string? Remark { get; set; }
+
+ /// <summary>
/// 閫佽揣鍗曞彿
///</summary>
[SugarColumn(ColumnName="paper_bill_no" )]
- public string PaperBillNo { get; set; }
- /// <summary>
+ public string? PaperBillNo { get; set; }
+
+ /// <summary>
/// 閫�鏂欎汉宸ュ彿
///</summary>
[SugarColumn(ColumnName="user_no_back" )]
- public string UserNoBack { get; set; }
- /// <summary>
+ public string? UserNoBack { get; set; }
+
+ /// <summary>
/// 鎻愪氦浜�
///</summary>
[SugarColumn(ColumnName="check_user" )]
- public string CheckUser { get; set; }
- /// <summary>
+ public string? CheckUser { get; set; }
+
+ /// <summary>
/// 鎻愪氦鏃ユ湡
///</summary>
[SugarColumn(ColumnName="check_date" )]
public DateTime? CheckDate { get; set; }
- /// <summary>
+
+ /// <summary>
/// 鍏ュ簱鏃ユ湡
///</summary>
[SugarColumn(ColumnName="ins_date" )]
public DateTime? InsDate { get; set; }
- /// <summary>
+
+ /// <summary>
/// 妫�楠岀粨鏋�
///</summary>
[SugarColumn(ColumnName="check_res" )]
- public string CheckRes { get; set; }
- /// <summary>
+ public string? CheckRes { get; set; }
+
+ /// <summary>
/// 宸叉崱鏁伴噺
///</summary>
[SugarColumn(ColumnName="check_qty" )]
public int? CheckQty { get; set; }
- /// <summary>
+
+ /// <summary>
/// 浠撳簱id
///</summary>
[SugarColumn(ColumnName="depots_id" )]
- public string DepotsId { get; set; }
- /// <summary>
+ public string? DepotsId { get; set; }
+
+ /// <summary>
/// 浜嬪姟绫诲瀷缂栫爜
///</summary>
[SugarColumn(ColumnName="transction_no" )]
- public string TransctionNo { get; set; }
- /// <summary>
+ public string? TransctionNo { get; set; }
+
+ /// <summary>
/// 渚涘簲鍟唅d
///</summary>
[SugarColumn(ColumnName="supp_id" )]
- public string SuppId { get; set; }
- /// <summary>
+ public string? SuppId { get; set; }
+
+ /// <summary>
/// 鎻愪氦鐘舵��
/// 榛樿鍊�: ((0))
///</summary>
[SugarColumn(ColumnName="fstatus" )]
public bool? Fstatus { get; set; }
- /// <summary>
+
+ /// <summary>
/// 宸ュ巶缂栫爜
///</summary>
[SugarColumn(ColumnName="factory" )]
- public string Factory { get; set; }
- /// <summary>
+ public string? Factory { get; set; }
+
+ /// <summary>
/// 鏄惁宸插洖鍐橲AP
/// 榛樿鍊�: ((0))
///</summary>
[SugarColumn(ColumnName="sapstatus" )]
public int? Sapstatus { get; set; }
- /// <summary>
+
+ /// <summary>
/// 鏄惁妫�楠�
///</summary>
[SugarColumn(ColumnName="ischeck" )]
public bool? Ischeck { get; set; }
- /// <summary>
+
+ /// <summary>
/// 瀹℃牳鍏ュ簱浜�
///</summary>
[SugarColumn(ColumnName="insby" )]
- public string Insby { get; set; }
- /// <summary>
+ public string? Insby { get; set; }
+
+ /// <summary>
/// 鍏徃浠g爜
///</summary>
[SugarColumn(ColumnName="company" )]
- public string Company { get; set; }
- /// <summary>
+ public string? Company { get; set; }
+
+ /// <summary>
/// 鎬ユ枡鏍囪瘑
/// 榛樿鍊�: ((0))
///</summary>
[SugarColumn(ColumnName="urgent_flag" )]
public bool? UrgentFlag { get; set; }
- /// <summary>
+
+ /// <summary>
/// 鍐查攢浜嬪姟绫诲瀷缂栫爜
///</summary>
[SugarColumn(ColumnName="mttransction_no" )]
public int? MttransctionNo { get; set; }
- /// <summary>
+
+ /// <summary>
/// IQC妫�楠屽崟鍙�
///</summary>
[SugarColumn(ColumnName="iqc_release_no" )]
- public string IqcReleaseNo { get; set; }
- /// <summary>
+ public string? IqcReleaseNo { get; set; }
+
+ /// <summary>
/// 鏄惁鏄剧ず
/// 榛樿鍊�: ((0))
///</summary>
[SugarColumn(ColumnName="is_visual" )]
public int? IsVisual { get; set; }
- /// <summary>
+
+ /// <summary>
/// 0=閲囪喘锛�1=濮斿
/// 榛樿鍊�: ((1))
///</summary>
[SugarColumn(ColumnName="f_type" )]
public bool? FType { get; set; }
- /// <summary>
+
+ /// <summary>
/// ERP鍒拌揣鍗旾D
///</summary>
[SugarColumn(ColumnName="ebeln_k3id" )]
- public string EbelnK3id { get; set; }
- /// <summary>
+ public string? EbelnK3id { get; set; }
+
+ /// <summary>
/// 鏉$爜鏉″嵃杩涘害
///</summary>
[SugarColumn(ColumnName="barcode_ratio" )]
public int? BarcodeRatio { get; set; }
- /// <summary>
+
+ /// <summary>
/// ERP鍗曞彿
///</summary>
[SugarColumn(ColumnName="erpno" )]
- public string Erpno { get; set; }
- /// <summary>
+ public string? Erpno { get; set; }
+
+ /// <summary>
/// 鏄惁宸查��璐�0-鏈��璐э紝1-閫�璐�
///</summary>
[SugarColumn(ColumnName="thstatus" )]
public int? Thstatus { get; set; }
- /// <summary>
+
+ /// <summary>
/// ERP閫�璐у崟鍙�
///</summary>
[SugarColumn(ColumnName="erpthno" )]
- public string Erpthno { get; set; }
- /// <summary>
+ public string? Erpthno { get; set; }
+
+ /// <summary>
/// 缁勭粐缂栫爜
///</summary>
[SugarColumn(ColumnName="organize_code" )]
- public string OrganizeCode { get; set; }
+ public string? OrganizeCode { get; set; }
}
}
diff --git a/entity/MesInvItemBarcodes.cs b/entity/MesInvItemBarcodes.cs
index 126aec7..98c2ca1 100644
--- a/entity/MesInvItemBarcodes.cs
+++ b/entity/MesInvItemBarcodes.cs
@@ -12,418 +12,498 @@
///
/// 榛樿鍊�: (newid())
///</summary>
- [SugarColumn(ColumnName="guid" ,IsPrimaryKey = true )]
- public Guid Guid { get; set; }
+ [SugarColumn(ColumnName = "guid", IsPrimaryKey = true)]
+ public Guid Guid { get; set; }
+
/// <summary>
/// 鐗╂枡鏉$爜
///</summary>
- [SugarColumn(ColumnName="ITEM_BARCODE" )]
- public string ItemBarcode { get; set; }
+ [SugarColumn(ColumnName = "ITEM_BARCODE")]
+ public string? ItemBarcode { get; set; }
+
/// <summary>
/// 瀹㈡埛鎴愬搧缂栫爜
///</summary>
- [SugarColumn(ColumnName="C_PRODUCT_CODE" )]
- public string CProductCode { get; set; }
+ [SugarColumn(ColumnName = "C_PRODUCT_CODE")]
+ public string? CProductCode { get; set; }
+
/// <summary>
/// 瀹㈡埛鐗╂枡鏉$爜
///</summary>
- [SugarColumn(ColumnName="C_ITEM_BARCODE" )]
- public string CItemBarcode { get; set; }
+ [SugarColumn(ColumnName = "C_ITEM_BARCODE")]
+ public string? CItemBarcode { get; set; }
+
/// <summary>
/// 瀹㈡埛鐗╂枡缂栫爜
///</summary>
- [SugarColumn(ColumnName="C_ITEM_CODE" )]
- public string CItemCode { get; set; }
+ [SugarColumn(ColumnName = "C_ITEM_CODE")]
+ public string? CItemCode { get; set; }
+
/// <summary>
/// 鏈徃鐗╂枡缂栫爜
///</summary>
- [SugarColumn(ColumnName="ITEM_NO" )]
- public string ItemNo { get; set; }
+ [SugarColumn(ColumnName = "ITEM_NO")]
+ public string? ItemNo { get; set; }
+
/// <summary>
/// 鍘傚鎵规
///</summary>
- [SugarColumn(ColumnName="LOT_NO" )]
- public string LotNo { get; set; }
+ [SugarColumn(ColumnName = "LOT_NO")]
+ public string? LotNo { get; set; }
+
/// <summary>
/// 鏁伴噺
/// 榛樿鍊�: ((0))
///</summary>
- [SugarColumn(ColumnName="QUANTITY" )]
- public decimal? Quantity { get; set; }
+ [SugarColumn(ColumnName = "QUANTITY")]
+ public decimal? Quantity { get; set; }
+
/// <summary>
/// 鏄惁鐜繚(0:鍚�,1:鏄�)
///</summary>
- [SugarColumn(ColumnName="EP_FLAG" )]
- public bool? EpFlag { get; set; }
+ [SugarColumn(ColumnName = "EP_FLAG")]
+ public bool? EpFlag { get; set; }
+
/// <summary>
/// 鐢熶骇宸ュ崟
///</summary>
- [SugarColumn(ColumnName="TASK_NO" )]
- public string TaskNo { get; set; }
+ [SugarColumn(ColumnName = "TASK_NO")]
+ public string? TaskNo { get; set; }
+
/// <summary>
/// 鍒涘缓浜�
///</summary>
- [SugarColumn(ColumnName="CREATE_BY" )]
- public string CreateBy { get; set; }
+ [SugarColumn(ColumnName = "CREATE_BY")]
+ public string? CreateBy { get; set; }
+
/// <summary>
/// 鍒涘缓鏃堕棿
///</summary>
- [SugarColumn(ColumnName="CREATE_DATE" )]
- public DateTime? CreateDate { get; set; }
+ [SugarColumn(ColumnName = "CREATE_DATE")]
+ public DateTime? CreateDate { get; set; }
+
/// <summary>
/// 鏈�鍚庢洿鏂颁汉
///</summary>
- [SugarColumn(ColumnName="LASTUPDATE_BY" )]
- public string LastupdateBy { get; set; }
+ [SugarColumn(ColumnName = "LASTUPDATE_BY")]
+ public string? LastupdateBy { get; set; }
+
/// <summary>
/// 鏈�鍚庢洿鏂版椂闂�
///</summary>
- [SugarColumn(ColumnName="LASTUPDATE_DATE" )]
- public DateTime? LastupdateDate { get; set; }
+ [SugarColumn(ColumnName = "LASTUPDATE_DATE")]
+ public DateTime? LastupdateDate { get; set; }
+
/// <summary>
/// 瀹㈡埛缂栧彿
///</summary>
- [SugarColumn(ColumnName="CUST_NO" )]
- public string CustNo { get; set; }
+ [SugarColumn(ColumnName = "CUST_NO")]
+ public string? CustNo { get; set; }
+
/// <summary>
/// 鐗╂枡鏉$爜娉ㄩ噴琛孾鍐椾綑锛屾潯鐮侀噸鎵撲娇鐢╙
///</summary>
- [SugarColumn(ColumnName="ITEM_BARCODE_TEXT" )]
- public string ItemBarcodeText { get; set; }
+ [SugarColumn(ColumnName = "ITEM_BARCODE_TEXT")]
+ public string? ItemBarcodeText { get; set; }
+
/// <summary>
/// 鍘烶SN鐗╂枡鏉$爜
///</summary>
- [SugarColumn(ColumnName="OLD_ITEM_BARCODE" )]
- public string OldItemBarcode { get; set; }
+ [SugarColumn(ColumnName = "OLD_ITEM_BARCODE")]
+ public string? OldItemBarcode { get; set; }
+
/// <summary>
/// SAP鏀惰揣鐗╂枡鍑瘉鍙� --閲囪喘鍗曞彿
///</summary>
- [SugarColumn(ColumnName="MBLNR" )]
- public string Mblnr { get; set; }
+ [SugarColumn(ColumnName = "MBLNR")]
+ public string? Mblnr { get; set; }
+
/// <summary>
/// SAP鏀惰揣鐗╂枡鍑瘉琛屽彿 --閲囪喘鍗曡鍙�
///</summary>
- [SugarColumn(ColumnName="ZEILE" )]
- public int? Zeile { get; set; }
+ [SugarColumn(ColumnName = "ZEILE")]
+ public int? Zeile { get; set; }
+
/// <summary>
/// 鏀舵枡琛↖D
///</summary>
- [SugarColumn(ColumnName="ROH_IN_ID" )]
- public long? RohInId { get; set; }
+ [SugarColumn(ColumnName = "ROH_IN_ID")]
+ public long? RohInId { get; set; }
+
/// <summary>
/// 0涓烘湁鏁堟潯鐮侊紱1涓烘棤鏁堟潯鐮�
/// 榛樿鍊�: ((0))
///</summary>
- [SugarColumn(ColumnName="BARCODESTATUS" )]
- public bool? Barcodestatus { get; set; }
+ [SugarColumn(ColumnName = "BARCODESTATUS")]
+ public bool? Barcodestatus { get; set; }
+
/// <summary>
/// 鍘熷鏁伴噺
/// 榛樿鍊�: ((0))
///</summary>
- [SugarColumn(ColumnName="OLDQTY" )]
- public long? Oldqty { get; set; }
+ [SugarColumn(ColumnName = "OLDQTY")]
+ public long? Oldqty { get; set; }
+
/// <summary>
/// 浣跨敤鏁伴噺
/// 榛樿鍊�: ((0))
///</summary>
- [SugarColumn(ColumnName="USEQTY" )]
- public long? Useqty { get; set; }
+ [SugarColumn(ColumnName = "USEQTY")]
+ public long? Useqty { get; set; }
+
/// <summary>
/// 0鍦ㄥ簱锛�1鍦ㄧ嚎锛�2浣滃簾
/// 榛樿鍊�: ((0))
///</summary>
- [SugarColumn(ColumnName="LOCATION" )]
- public byte? Location { get; set; }
+ [SugarColumn(ColumnName = "LOCATION")]
+ public byte? Location { get; set; }
+
/// <summary>
/// 鍗曚綅
///</summary>
- [SugarColumn(ColumnName="UNIT" )]
- public string Unit { get; set; }
+ [SugarColumn(ColumnName = "UNIT")]
+ public string? Unit { get; set; }
+
/// <summary>
/// 閲嶉噺锛堝崟浣嶏細鍏枻锛�
/// 榛樿鍊�: ((0))
///</summary>
- [SugarColumn(ColumnName="WEIGHT_UNIT" )]
- public decimal? WeightUnit { get; set; }
+ [SugarColumn(ColumnName = "WEIGHT_UNIT")]
+ public decimal? WeightUnit { get; set; }
+
/// <summary>
/// 鍗曚环
///</summary>
- [SugarColumn(ColumnName="PRICE" )]
- public decimal? Price { get; set; }
+ [SugarColumn(ColumnName = "PRICE")]
+ public decimal? Price { get; set; }
+
/// <summary>
/// 鍘熸潯鐮佹暟閲�
///</summary>
- [SugarColumn(ColumnName="OLD_BAR_QUANTITY" )]
- public long? OldBarQuantity { get; set; }
+ [SugarColumn(ColumnName = "OLD_BAR_QUANTITY")]
+ public long? OldBarQuantity { get; set; }
+
/// <summary>
/// 姹囨�绘潯鐮�
///</summary>
- [SugarColumn(ColumnName="SUM_BARCODE" )]
- public string SumBarcode { get; set; }
+ [SugarColumn(ColumnName = "SUM_BARCODE")]
+ public string? SumBarcode { get; set; }
+
/// <summary>
/// 鎵规鏃ユ湡
///</summary>
- [SugarColumn(ColumnName="LOT_DATE" )]
- public string LotDate { get; set; }
+ [SugarColumn(ColumnName = "LOT_DATE")]
+ public string? LotDate { get; set; }
+
/// <summary>
/// 鎴愬搧鏉$爜
///</summary>
- [SugarColumn(ColumnName="MOCODE" )]
- public string Mocode { get; set; }
+ [SugarColumn(ColumnName = "MOCODE")]
+ public string? Mocode { get; set; }
+
/// <summary>
/// 澶囨敞
///</summary>
- [SugarColumn(ColumnName="MEMO" )]
- public string Memo { get; set; }
+ [SugarColumn(ColumnName = "MEMO")]
+ public string? Memo { get; set; }
+
/// <summary>
/// 渚涘簲鍟嗙紪鍙�
///</summary>
- [SugarColumn(ColumnName="SUPP_NO" )]
- public string SuppNo { get; set; }
+ [SugarColumn(ColumnName = "SUPP_NO")]
+ public string? SuppNo { get; set; }
+
/// <summary>
/// 鍙戣揣浣嶇疆
///</summary>
- [SugarColumn(ColumnName="SPOSTION" )]
- public string Spostion { get; set; }
+ [SugarColumn(ColumnName = "SPOSTION")]
+ public string? Spostion { get; set; }
+
/// <summary>
/// 鍒拌揣浣嶇疆
///</summary>
- [SugarColumn(ColumnName="EPOSTION" )]
- public string Epostion { get; set; }
+ [SugarColumn(ColumnName = "EPOSTION")]
+ public string? Epostion { get; set; }
+
/// <summary>
/// 鐗╂枡鍚嶇О
///</summary>
- [SugarColumn(ColumnName="ITEM_SNAME" )]
- public string ItemSname { get; set; }
+ [SugarColumn(ColumnName = "ITEM_SNAME")]
+ public string? ItemSname { get; set; }
+
/// <summary>
/// 鏄惁鍙
/// 榛樿鍊�: ((0))
///</summary>
- [SugarColumn(ColumnName="VISABLE" )]
- public bool? Visable { get; set; }
+ [SugarColumn(ColumnName = "VISABLE")]
+ public bool? Visable { get; set; }
+
/// <summary>
/// 澶栧彂鎵规鍙�
///</summary>
- [SugarColumn(ColumnName="TR_LOTNO" )]
- public string TrLotno { get; set; }
+ [SugarColumn(ColumnName = "TR_LOTNO")]
+ public string? TrLotno { get; set; }
+
/// <summary>
/// 鍙戣揣鏃ユ湡
///</summary>
- [SugarColumn(ColumnName="FLEZZ_DATE" )]
- public DateTime? FlezzDate { get; set; }
+ [SugarColumn(ColumnName = "FLEZZ_DATE")]
+ public DateTime? FlezzDate { get; set; }
+
/// <summary>
/// 澶栧彂鍘熷洜
///</summary>
- [SugarColumn(ColumnName="FLEZZ_REASON" )]
- public string FlezzReason { get; set; }
+ [SugarColumn(ColumnName = "FLEZZ_REASON")]
+ public string? FlezzReason { get; set; }
+
/// <summary>
/// 澶栧彂浜�
///</summary>
- [SugarColumn(ColumnName="FLEZZ_BY" )]
- public string FlezzBy { get; set; }
+ [SugarColumn(ColumnName = "FLEZZ_BY")]
+ public string? FlezzBy { get; set; }
+
/// <summary>
/// 鍙戣揣鏈�
/// 榛樿鍊�: ((0))
///</summary>
- [SugarColumn(ColumnName="DELANY_MONTH" )]
- public int? DelanyMonth { get; set; }
+ [SugarColumn(ColumnName = "DELANY_MONTH")]
+ public int? DelanyMonth { get; set; }
+
/// <summary>
/// 鏄惁鏈�灏忓寘瑁�
///</summary>
- [SugarColumn(ColumnName="MINPACK_FLAG" )]
- public bool? MinpackFlag { get; set; }
+ [SugarColumn(ColumnName = "MINPACK_FLAG")]
+ public bool? MinpackFlag { get; set; }
+
/// <summary>
/// 鎵撳嵃ID
///</summary>
- [SugarColumn(ColumnName="PRINT_ID" )]
- public string PrintId { get; set; }
+ [SugarColumn(ColumnName = "PRINT_ID")]
+ public string? PrintId { get; set; }
+
/// <summary>
/// 鐜鐗╂枡
///</summary>
- [SugarColumn(ColumnName="EP_ITEM" )]
- public string EpItem { get; set; }
+ [SugarColumn(ColumnName = "EP_ITEM")]
+ public string? EpItem { get; set; }
+
/// <summary>
/// 宸ュ巶
///</summary>
- [SugarColumn(ColumnName="FACTORY" )]
- public string Factory { get; set; }
+ [SugarColumn(ColumnName = "FACTORY")]
+ public string? Factory { get; set; }
+
/// <summary>
/// 鍏徃
///</summary>
- [SugarColumn(ColumnName="COMPANY" )]
- public string Company { get; set; }
+ [SugarColumn(ColumnName = "COMPANY")]
+ public string? Company { get; set; }
+
/// <summary>
/// 鍙戠エ鍙风爜
///</summary>
- [SugarColumn(ColumnName="CB_NO" )]
- public string CbNo { get; set; }
+ [SugarColumn(ColumnName = "CB_NO")]
+ public string? CbNo { get; set; }
+
/// <summary>
/// 琛屽彿
///</summary>
- [SugarColumn(ColumnName="LINFLINE" )]
- public string Linfline { get; set; }
+ [SugarColumn(ColumnName = "LINFLINE")]
+ public string? Linfline { get; set; }
+
/// <summary>
/// 鏈夋晥鏃堕棿
///</summary>
- [SugarColumn(ColumnName="VALID_TIME" )]
- public DateTime? ValidTime { get; set; }
+ [SugarColumn(ColumnName = "VALID_TIME")]
+ public DateTime? ValidTime { get; set; }
+
/// <summary>
/// 璐ㄦ鐘舵��
///</summary>
- [SugarColumn(ColumnName="IQC_STATUS" )]
- public string IqcStatus { get; set; }
+ [SugarColumn(ColumnName = "IQC_STATUS")]
+ public string? IqcStatus { get; set; }
+
/// <summary>
/// 杞﹀彿
///</summary>
- [SugarColumn(ColumnName="FCAR" )]
- public string Fcar { get; set; }
+ [SugarColumn(ColumnName = "FCAR")]
+ public string? Fcar { get; set; }
+
/// <summary>
/// 姣涢噸
///</summary>
- [SugarColumn(ColumnName="GWEIGHT" )]
- public string Gweight { get; set; }
+ [SugarColumn(ColumnName = "GWEIGHT")]
+ public string? Gweight { get; set; }
+
/// <summary>
/// 鍑�閲�
///</summary>
- [SugarColumn(ColumnName="NWEIGHT" )]
- public string Nweight { get; set; }
+ [SugarColumn(ColumnName = "NWEIGHT")]
+ public string? Nweight { get; set; }
+
/// <summary>
/// 鎵╁睍鏃ユ湡
///</summary>
- [SugarColumn(ColumnName="EXT_DATE" )]
- public long? ExtDate { get; set; }
+ [SugarColumn(ColumnName = "EXT_DATE")]
+ public long? ExtDate { get; set; }
+
/// <summary>
/// 鏉$爜绫诲瀷
///</summary>
- [SugarColumn(ColumnName="BARCODETYPE" )]
- public string Barcodetype { get; set; }
+ [SugarColumn(ColumnName = "BARCODETYPE")]
+ public string? Barcodetype { get; set; }
+
/// <summary>
/// 渚涘簲鍟嗗悕绉�
///</summary>
- [SugarColumn(ColumnName="SUPP_NAME" )]
- public string SuppName { get; set; }
+ [SugarColumn(ColumnName = "SUPP_NAME")]
+ public string? SuppName { get; set; }
+
/// <summary>
/// 鍙戠エ缂栧彿
///</summary>
- [SugarColumn(ColumnName="BILL_NO" )]
- public string BillNo { get; set; }
+ [SugarColumn(ColumnName = "BILL_NO")]
+ public string? BillNo { get; set; }
+
/// <summary>
/// 鏄惁绱ф��
///</summary>
- [SugarColumn(ColumnName="URGENT_FLAG" )]
- public bool? UrgentFlag { get; set; }
+ [SugarColumn(ColumnName = "URGENT_FLAG")]
+ public bool? UrgentFlag { get; set; }
+
/// <summary>
/// 棰滆壊鍚嶇О
///</summary>
- [SugarColumn(ColumnName="COLOR_NAME" )]
- public string ColorName { get; set; }
+ [SugarColumn(ColumnName = "COLOR_NAME")]
+ public string? ColorName { get; set; }
+
/// <summary>
/// 鏉垮瀷
///</summary>
- [SugarColumn(ColumnName="BOARD_STYLE" )]
- public string BoardStyle { get; set; }
+ [SugarColumn(ColumnName = "BOARD_STYLE")]
+ public string? BoardStyle { get; set; }
+
/// <summary>
/// 鍒涘缓鏃ユ湡
///</summary>
- [SugarColumn(ColumnName="INS_DATE" )]
- public DateTime? InsDate { get; set; }
+ [SugarColumn(ColumnName = "INS_DATE")]
+ public DateTime? InsDate { get; set; }
+
/// <summary>
/// 宸ュ簭绾�
///</summary>
- [SugarColumn(ColumnName="WORK_LINE" )]
- public int? WorkLine { get; set; }
+ [SugarColumn(ColumnName = "WORK_LINE")]
+ public int? WorkLine { get; set; }
+
/// <summary>
/// 涓嶈壇澶囨敞
///</summary>
- [SugarColumn(ColumnName="MEMO_BAD" )]
- public string MemoBad { get; set; }
+ [SugarColumn(ColumnName = "MEMO_BAD")]
+ public string? MemoBad { get; set; }
+
/// <summary>
/// 宸ュ崟
///</summary>
- [SugarColumn(ColumnName="WORK_NO" )]
- public string WorkNo { get; set; }
+ [SugarColumn(ColumnName = "WORK_NO")]
+ public string? WorkNo { get; set; }
+
/// <summary>
/// 鍒拌揣鏍囪
/// 榛樿鍊�: ((0))
///</summary>
- [SugarColumn(ColumnName="COME_FLG" )]
- public bool? ComeFlg { get; set; }
+ [SugarColumn(ColumnName = "COME_FLG")]
+ public bool? ComeFlg { get; set; }
+
/// <summary>
/// 琛屽彿
///</summary>
- [SugarColumn(ColumnName="LINE_NO" )]
- public string LineNo { get; set; }
+ [SugarColumn(ColumnName = "LINE_NO")]
+ public string? LineNo { get; set; }
+
/// <summary>
/// 涓濆嵃鏁伴噺
/// 榛樿鍊�: ((0))
///</summary>
- [SugarColumn(ColumnName="SILK_PQTY" )]
- public long? SilkPqty { get; set; }
+ [SugarColumn(ColumnName = "SILK_PQTY")]
+ public long? SilkPqty { get; set; }
+
/// <summary>
/// 涓濆嵃瑙勬牸
///</summary>
- [SugarColumn(ColumnName="SILK" )]
- public string Silk { get; set; }
+ [SugarColumn(ColumnName = "SILK")]
+ public string? Silk { get; set; }
+
/// <summary>
/// 涓濆嵃ID
///</summary>
- [SugarColumn(ColumnName="SILK_ID" )]
- public long? SilkId { get; set; }
+ [SugarColumn(ColumnName = "SILK_ID")]
+ public long? SilkId { get; set; }
+
/// <summary>
/// 宸ュ崟鐘舵��
/// 榛樿鍊�: ((0))
///</summary>
- [SugarColumn(ColumnName="WORK_FLG" )]
- public bool? WorkFlg { get; set; }
+ [SugarColumn(ColumnName = "WORK_FLG")]
+ public bool? WorkFlg { get; set; }
+
/// <summary>
/// 宸ュ崟鏈�鍚庤
///</summary>
- [SugarColumn(ColumnName="WORK_LAST" )]
- public int? WorkLast { get; set; }
+ [SugarColumn(ColumnName = "WORK_LAST")]
+ public int? WorkLast { get; set; }
+
/// <summary>
/// HBDY
///</summary>
- [SugarColumn(ColumnName="HBDY" )]
- public int? Hbdy { get; set; }
+ [SugarColumn(ColumnName = "HBDY")]
+ public int? Hbdy { get; set; }
+
/// <summary>
/// HBDYTM
///</summary>
- [SugarColumn(ColumnName="HBDYTM" )]
- public int? Hbdytm { get; set; }
+ [SugarColumn(ColumnName = "HBDYTM")]
+ public int? Hbdytm { get; set; }
+
/// <summary>
/// 宸ュ簭鏃堕棿
///</summary>
- [SugarColumn(ColumnName="WORK_FLGTIME" )]
- public string WorkFlgtime { get; set; }
+ [SugarColumn(ColumnName = "WORK_FLGTIME")]
+ public string? WorkFlgtime { get; set; }
+
/// <summary>
/// K3ID璁㈠崟
///</summary>
- [SugarColumn(ColumnName="EBELN_K3ID" )]
- public long? EbelnK3id { get; set; }
+ [SugarColumn(ColumnName = "EBELN_K3ID")]
+ public long? EbelnK3id { get; set; }
+
/// <summary>
/// K3ID琛�
///</summary>
- [SugarColumn(ColumnName="LINE_K3ID" )]
- public long? LineK3id { get; set; }
+ [SugarColumn(ColumnName = "LINE_K3ID")]
+ public long? LineK3id { get; set; }
+
/// <summary>
/// 鐗╂枡ID
///</summary>
- [SugarColumn(ColumnName="ITEM_ID" )]
- public long? ItemId { get; set; }
+ [SugarColumn(ColumnName = "ITEM_ID")]
+ public long? ItemId { get; set; }
+
/// <summary>
///
///</summary>
- [SugarColumn(ColumnName="GX_ID" )]
- public long? GxId { get; set; }
+ [SugarColumn(ColumnName = "GX_ID")]
+ public long? GxId { get; set; }
+
/// <summary>
/// 涓存椂鎵归噺guid
///</summary>
- [SugarColumn(ColumnName="tmpGuid" )]
- public Guid? TmpGuid { get; set; }
+ [SugarColumn(ColumnName = "tmpGuid")]
+ public Guid? TmpGuid { get; set; }
+
/// <summary>
/// 渚涘簲鍟唅d
///</summary>
- [SugarColumn(ColumnName="supp_id" )]
- public string SuppId { get; set; }
+ [SugarColumn(ColumnName = "supp_id")]
+ public string? SuppId { get; set; }
}
-}
+}
\ No newline at end of file
diff --git a/entity/MesInvItemInCDetails.cs b/entity/MesInvItemInCDetails.cs
index fd05a40..801475e 100644
--- a/entity/MesInvItemInCDetails.cs
+++ b/entity/MesInvItemInCDetails.cs
@@ -12,308 +12,377 @@
///
/// 榛樿鍊�: (newid())
///</summary>
- [SugarColumn(ColumnName="guid" ,IsPrimaryKey = true )]
- public Guid Guid { get; set; }
+ [SugarColumn(ColumnName = "guid", IsPrimaryKey = true)]
+ public Guid Guid { get; set; }
+
/// <summary>
/// 鍏ュ簱鍗昳d
///</summary>
- [SugarColumn(ColumnName="ITEM_IN_ID" )]
- public long? ItemInId { get; set; }
+ [SugarColumn(ColumnName = "ITEM_IN_ID")]
+ public Guid ItemInId { get; set; }
+
/// <summary>
/// 鐗╂枡鏉$爜PSN
///</summary>
- [SugarColumn(ColumnName="ITEM_BARCODE" )]
- public string ItemBarcode { get; set; }
+ [SugarColumn(ColumnName = "ITEM_BARCODE")]
+ public string? ItemBarcode { get; set; }
+
/// <summary>
/// 瀹㈡埛鐗╂枡缂栫爜锛堟棤鏉$爜鎵嬪伐褰曞叆锛屾湁鏉$爜涓哄啑浣欏瓧娈碉級
///</summary>
- [SugarColumn(ColumnName="C_ITEM_CODE" )]
- public string CItemCode { get; set; }
+ [SugarColumn(ColumnName = "C_ITEM_CODE")]
+ public string? CItemCode { get; set; }
+
/// <summary>
/// 瀹㈡埛鐗╂枡鏉$爜
///</summary>
- [SugarColumn(ColumnName="C_ITEM_BARCODE" )]
- public string CItemBarcode { get; set; }
+ [SugarColumn(ColumnName = "C_ITEM_BARCODE")]
+ public string? CItemBarcode { get; set; }
+
/// <summary>
/// 楠屾敹鏁伴噺
///</summary>
- [SugarColumn(ColumnName="QUANTITY" )]
- public decimal? Quantity { get; set; }
+ [SugarColumn(ColumnName = "QUANTITY")]
+ public decimal? Quantity { get; set; }
+
/// <summary>
/// 鍏ュ簱鏂瑰紡(1:鏈夋潯鐮�,0:鏃犳潯鐮�)
/// 榛樿鍊�: ((1))
///</summary>
- [SugarColumn(ColumnName="BARCODE_FLAG" )]
- public bool? BarcodeFlag { get; set; }
+ [SugarColumn(ColumnName = "BARCODE_FLAG")]
+ public bool? BarcodeFlag { get; set; }
+
/// <summary>
/// 鐜繚鏍囧織锛�0-闈炵幆淇�,1-鐜繚.鏃犳潯鐮佹墜宸ュ綍鍏ワ紝鏈夋潯鐮佷负鍐椾綑瀛楁锛�
/// 榛樿鍊�: ((1))
///</summary>
- [SugarColumn(ColumnName="EP_FLAG" )]
- public bool? EpFlag { get; set; }
+ [SugarColumn(ColumnName = "EP_FLAG")]
+ public bool? EpFlag { get; set; }
+
/// <summary>
/// 鍒涘缓浜�
///</summary>
- [SugarColumn(ColumnName="CREATE_BY" )]
- public string CreateBy { get; set; }
+ [SugarColumn(ColumnName = "CREATE_BY")]
+ public string? CreateBy { get; set; }
+
/// <summary>
/// 鍒涘缓鏃堕棿
///</summary>
- [SugarColumn(ColumnName="CREATE_DATE" )]
- public DateTime? CreateDate { get; set; }
+ [SugarColumn(ColumnName = "CREATE_DATE")]
+ public DateTime? CreateDate { get; set; }
+
/// <summary>
/// 鏈�鍚庢洿鏂颁汉
///</summary>
- [SugarColumn(ColumnName="LASTUPDATE_BY" )]
- public string LastupdateBy { get; set; }
+ [SugarColumn(ColumnName = "LASTUPDATE_BY")]
+ public string? LastupdateBy { get; set; }
+
/// <summary>
/// 鏈�鍚庢洿鏂版椂闂�
///</summary>
- [SugarColumn(ColumnName="LASTUPDATE_DATE" )]
- public DateTime? LastupdateDate { get; set; }
+ [SugarColumn(ColumnName = "LASTUPDATE_DATE")]
+ public DateTime? LastupdateDate { get; set; }
+
/// <summary>
/// 浣滀笟鏂瑰紡0-鏈夌嚎鏉$爜鏋�1-鏃犵嚎鏉$爜鏋�
///</summary>
- [SugarColumn(ColumnName="WORK_TYPE" )]
- public long? WorkType { get; set; }
+ [SugarColumn(ColumnName = "WORK_TYPE")]
+ public long? WorkType { get; set; }
+
/// <summary>
/// 鏈徃鐗╂枡缂栫爜锛堟棤鏉$爜鎵嬪伐褰曞叆锛屾湁鏉$爜涓哄啑浣欏瓧娈碉級
///</summary>
- [SugarColumn(ColumnName="ITEM_NO" )]
- public string ItemNo { get; set; }
+ [SugarColumn(ColumnName = "ITEM_NO")]
+ public string? ItemNo { get; set; }
+
/// <summary>
/// 鍘傚鎵规
///</summary>
- [SugarColumn(ColumnName="LOT_NO" )]
- public string LotNo { get; set; }
+ [SugarColumn(ColumnName = "LOT_NO")]
+ public string? LotNo { get; set; }
+
/// <summary>
/// 鏄惁鍏辩鐗╂枡(0:鍚︼紝1:鏄�)
/// 榛樿鍊�: ((0))
///</summary>
- [SugarColumn(ColumnName="COMANAGEMENT_FLAG" )]
- public bool? ComanagementFlag { get; set; }
+ [SugarColumn(ColumnName = "COMANAGEMENT_FLAG")]
+ public bool? ComanagementFlag { get; set; }
+
/// <summary>
/// 瀹㈡埛缂栫爜
///</summary>
- [SugarColumn(ColumnName="CUST_NO" )]
- public string CustNo { get; set; }
+ [SugarColumn(ColumnName = "CUST_NO")]
+ public string? CustNo { get; set; }
+
/// <summary>
/// 妫�楠岀粨鏋�
///</summary>
- [SugarColumn(ColumnName="CHECK_RES" )]
- public string CheckRes { get; set; }
+ [SugarColumn(ColumnName = "CHECK_RES")]
+ public string? CheckRes { get; set; }
+
/// <summary>
/// 杩涜揣鏁伴噺
///</summary>
- [SugarColumn(ColumnName="CHECK_QTY" )]
- public decimal? CheckQty { get; set; }
+ [SugarColumn(ColumnName = "CHECK_QTY")]
+ public decimal? CheckQty { get; set; }
+
/// <summary>
/// 妫�楠岀姸鎬�
///</summary>
- [SugarColumn(ColumnName="CHECK_STATES" )]
- public string CheckStates { get; set; }
+ [SugarColumn(ColumnName = "CHECK_STATES")]
+ public string? CheckStates { get; set; }
+
/// <summary>
/// 寮哄埗鍏ュ簱鏍囪0鏃狅紝1-寮哄埗鍏ュ簱 閫�鏂欏崟浣跨敤
/// 榛樿鍊�: ((0))
///</summary>
- [SugarColumn(ColumnName="FORCE_IN_FLAG" )]
- public bool? ForceInFlag { get; set; }
+ [SugarColumn(ColumnName = "FORCE_IN_FLAG")]
+ public bool? ForceInFlag { get; set; }
+
/// <summary>
/// 浠撳簱缂栫爜
///</summary>
- [SugarColumn(ColumnName="DEPOT_CODE" )]
- public string DepotCode { get; set; }
+ [SugarColumn(ColumnName = "DEPOT_CODE")]
+ public string? DepotCode { get; set; }
+
/// <summary>
/// 璐т綅缂栫爜
///</summary>
- [SugarColumn(ColumnName="DEPOT_SECTION_CODE" )]
- public string DepotSectionCode { get; set; }
+ [SugarColumn(ColumnName = "DEPOT_SECTION_CODE")]
+ public string? DepotSectionCode { get; set; }
+
/// <summary>
/// 鐗硅浜嬮」
///</summary>
- [SugarColumn(ColumnName="REMARK" )]
- public string Remark { get; set; }
+ [SugarColumn(ColumnName = "REMARK")]
+ public string? Remark { get; set; }
+
/// <summary>
/// 鐗╂枡鏉$爜
///</summary>
- [SugarColumn(ColumnName="ITEM_BARCODE2" )]
- public string ItemBarcode2 { get; set; }
+ [SugarColumn(ColumnName = "ITEM_BARCODE2")]
+ public string? ItemBarcode2 { get; set; }
+
/// <summary>
/// 鏂版潯鐮�
///</summary>
- [SugarColumn(ColumnName="ITEM_BARCODE3" )]
- public string ItemBarcode3 { get; set; }
+ [SugarColumn(ColumnName = "ITEM_BARCODE3")]
+ public string? ItemBarcode3 { get; set; }
+
/// <summary>
/// 宸蹭娇鐢ㄦ暟閲�
///</summary>
- [SugarColumn(ColumnName="USE_QTY" )]
- public decimal? UseQty { get; set; }
+ [SugarColumn(ColumnName = "USE_QTY")]
+ public decimal? UseQty { get; set; }
+
/// <summary>
/// 鍑哄簱鏁伴噺
///</summary>
- [SugarColumn(ColumnName="OUT_QTY" )]
- public decimal? OutQty { get; set; }
+ [SugarColumn(ColumnName = "OUT_QTY")]
+ public decimal? OutQty { get; set; }
+
/// <summary>
/// 鐗╂枡鍚嶇О
///</summary>
- [SugarColumn(ColumnName="ITEM_SNAME" )]
- public string ItemSname { get; set; }
+ [SugarColumn(ColumnName = "ITEM_SNAME")]
+ public string? ItemSname { get; set; }
+
/// <summary>
/// 璧峰浣嶇疆
///</summary>
- [SugarColumn(ColumnName="SPOSTION" )]
- public int? Spostion { get; set; }
+ [SugarColumn(ColumnName = "SPOSTION")]
+ public int? Spostion { get; set; }
+
/// <summary>
/// 缁撴潫浣嶇疆
///</summary>
- [SugarColumn(ColumnName="EPOSTION" )]
- public int? Epostion { get; set; }
+ [SugarColumn(ColumnName = "EPOSTION")]
+ public int? Epostion { get; set; }
+
/// <summary>
/// 妫�楠屾棩鏈�
///</summary>
- [SugarColumn(ColumnName="CHECK_DATE" )]
- public DateTime? CheckDate { get; set; }
+ [SugarColumn(ColumnName = "CHECK_DATE")]
+ public DateTime? CheckDate { get; set; }
+
/// <summary>
/// 鍗曚綅
///</summary>
- [SugarColumn(ColumnName="UNIT" )]
- public string Unit { get; set; }
+ [SugarColumn(ColumnName = "UNIT")]
+ public string? Unit { get; set; }
+
/// <summary>
/// 鏄惁妫�楠�
/// 榛樿鍊�: ((0))
///</summary>
- [SugarColumn(ColumnName="ISCHECK" )]
- public bool? Ischeck { get; set; }
+ [SugarColumn(ColumnName = "ISCHECK")]
+ public bool? Ischeck { get; set; }
+
/// <summary>
/// 閲囪喘鍗曞彿
///</summary>
- [SugarColumn(ColumnName="EBELN" )]
- public string Ebeln { get; set; }
+ [SugarColumn(ColumnName = "EBELN")]
+ public string? Ebeln { get; set; }
+
/// <summary>
/// 鎵规鏃ユ湡
///</summary>
- [SugarColumn(ColumnName="LOT_DATE" )]
- public string LotDate { get; set; }
+ [SugarColumn(ColumnName = "LOT_DATE")]
+ public string? LotDate { get; set; }
+
/// <summary>
/// 鍙戠エ鍙�
///</summary>
- [SugarColumn(ColumnName="BILL_NO" )]
- public string BillNo { get; set; }
+ [SugarColumn(ColumnName = "BILL_NO")]
+ public string? BillNo { get; set; }
+
/// <summary>
/// 鏄惁鍏ュ簱鎴愬姛
/// 榛樿鍊�: ((0))
///</summary>
- [SugarColumn(ColumnName="STOCK_OK" )]
- public bool? StockOk { get; set; }
+ [SugarColumn(ColumnName = "STOCK_OK")]
+ public bool? StockOk { get; set; }
+
/// <summary>
/// 宸ュ巶
///</summary>
- [SugarColumn(ColumnName="FACTORY" )]
- public string Factory { get; set; }
+ [SugarColumn(ColumnName = "FACTORY")]
+ public string? Factory { get; set; }
+
/// <summary>
/// 鍏徃
///</summary>
- [SugarColumn(ColumnName="COMPANY" )]
- public string Company { get; set; }
+ [SugarColumn(ColumnName = "COMPANY")]
+ public string? Company { get; set; }
+
/// <summary>
/// CB鍗曞彿
///</summary>
- [SugarColumn(ColumnName="CB_NO" )]
- public string CbNo { get; set; }
+ [SugarColumn(ColumnName = "CB_NO")]
+ public string? CbNo { get; set; }
+
/// <summary>
/// 绠卞彿
///</summary>
- [SugarColumn(ColumnName="BOX_NO" )]
- public string BoxNo { get; set; }
+ [SugarColumn(ColumnName = "BOX_NO")]
+ public string? BoxNo { get; set; }
+
/// <summary>
/// 浠撳簱ID
///</summary>
- [SugarColumn(ColumnName="DEPOT_ID" )]
- public long? DepotId { get; set; }
+ [SugarColumn(ColumnName = "DEPOT_ID")]
+ public long? DepotId { get; set; }
+
/// <summary>
/// 璐т綅ID
///</summary>
- [SugarColumn(ColumnName="DEPOT_SECTION_ID" )]
- public long? DepotSectionId { get; set; }
+ [SugarColumn(ColumnName = "DEPOT_SECTION_ID")]
+ public long? DepotSectionId { get; set; }
+
/// <summary>
/// 琛屽彿
///</summary>
- [SugarColumn(ColumnName="LINE_NUM" )]
- public string LineNum { get; set; }
+ [SugarColumn(ColumnName = "LINE_NUM")]
+ public string? LineNum { get; set; }
+
/// <summary>
/// 鎵弿鏁伴噺
///</summary>
- [SugarColumn(ColumnName="SM_QTY" )]
- public decimal? SmQty { get; set; }
+ [SugarColumn(ColumnName = "SM_QTY")]
+ public decimal? SmQty { get; set; }
+
/// <summary>
/// 鍙戣揣鍗曞彿
///</summary>
- [SugarColumn(ColumnName="VGBEL" )]
- public string Vgbel { get; set; }
+ [SugarColumn(ColumnName = "VGBEL")]
+ public string? Vgbel { get; set; }
+
/// <summary>
/// 琛屽彿
///</summary>
- [SugarColumn(ColumnName="KDPOS" )]
- public long? Kdpos { get; set; }
+ [SugarColumn(ColumnName = "KDPOS")]
+ public long? Kdpos { get; set; }
+
/// <summary>
/// 浣滀笟鍗曞彿
///</summary>
- [SugarColumn(ColumnName="WORK_NO" )]
- public string WorkNo { get; set; }
+ [SugarColumn(ColumnName = "WORK_NO")]
+ public string? WorkNo { get; set; }
+
/// <summary>
/// 琛屽彿
///</summary>
- [SugarColumn(ColumnName="EBELN_LINE_NO" )]
- public long? EbelnLineNo { get; set; }
+ [SugarColumn(ColumnName = "EBELN_LINE_NO")]
+ public long? EbelnLineNo { get; set; }
+
/// <summary>
/// CB鍗曞彿
///</summary>
- [SugarColumn(ColumnName="CBILL_NO" )]
- public string CbillNo { get; set; }
+ [SugarColumn(ColumnName = "CBILL_NO")]
+ public string? CbillNo { get; set; }
+
/// <summary>
/// 绱ф�ユ爣璁�
///</summary>
- [SugarColumn(ColumnName="URGENT_FLAG" )]
- public bool? UrgentFlag { get; set; }
+ [SugarColumn(ColumnName = "URGENT_FLAG")]
+ public bool? UrgentFlag { get; set; }
+
/// <summary>
/// 鏉垮瀷
///</summary>
- [SugarColumn(ColumnName="BOARD_STYLE" )]
- public string BoardStyle { get; set; }
+ [SugarColumn(ColumnName = "BOARD_STYLE")]
+ public string? BoardStyle { get; set; }
+
/// <summary>
/// 宸ヤ綔琛屽彿
///</summary>
- [SugarColumn(ColumnName="WORK_LINE" )]
- public int? WorkLine { get; set; }
+ [SugarColumn(ColumnName = "WORK_LINE")]
+ public int? WorkLine { get; set; }
+
/// <summary>
/// 浠诲姟鍙�
///</summary>
- [SugarColumn(ColumnName="TASK_NO" )]
- public string TaskNo { get; set; }
+ [SugarColumn(ColumnName = "TASK_NO")]
+ public string? TaskNo { get; set; }
+
/// <summary>
/// 渚涘簲鍟嗙紪鐮�
///</summary>
- [SugarColumn(ColumnName="SUPP_NO" )]
- public string SuppNo { get; set; }
+ [SugarColumn(ColumnName = "SUPP_NO")]
+ public string? SuppNo { get; set; }
+
/// <summary>
/// 鏀惰揣鍗曞彿
///</summary>
- [SugarColumn(ColumnName="RBILL_NO" )]
- public string RbillNo { get; set; }
+ [SugarColumn(ColumnName = "RBILL_NO")]
+ public string? RbillNo { get; set; }
+
/// <summary>
/// K3 閲囪喘鍗曞彿
///</summary>
- [SugarColumn(ColumnName="EBELN_K3ID" )]
- public long? EbelnK3id { get; set; }
+ [SugarColumn(ColumnName = "EBELN_K3ID")]
+ public long? EbelnK3id { get; set; }
+
/// <summary>
/// K3 琛屽彿
///</summary>
- [SugarColumn(ColumnName="LINE_K3ID" )]
- public long? LineK3id { get; set; }
+ [SugarColumn(ColumnName = "LINE_K3ID")]
+ public long? LineK3id { get; set; }
+
/// <summary>
/// 鐗╂枡ID
///</summary>
- [SugarColumn(ColumnName="ITEM_ID" )]
- public long? ItemId { get; set; }
+ [SugarColumn(ColumnName = "ITEM_ID")]
+ public long? ItemId { get; set; }
+
+
+ // 娣诲姞鐨勫瓧娈碉紝骞朵笖瀹冧滑涓嶅睘浜庢暟鎹簱琛�
+ [SugarColumn(IsIgnore = true)] public string? ItemName { get; set; }
+
+ [SugarColumn(IsIgnore = true)] public string? ItemModel { get; set; }
+
+ [SugarColumn(IsIgnore = true)] public string? ItemUnit { get; set; }
+
+ [SugarColumn(IsIgnore = true)] public decimal? SumQuantity { get; set; }
}
-}
+}
\ No newline at end of file
diff --git a/entity/MesInvItemInCItems.cs b/entity/MesInvItemInCItems.cs
new file mode 100644
index 0000000..c41ca35
--- /dev/null
+++ b/entity/MesInvItemInCItems.cs
@@ -0,0 +1,168 @@
+锘縰sing SqlSugar;
+
+namespace NewPdaSqlServer.entity
+{
+ /// <summary>
+ /// 鐗╂枡鍏ュ簱鏄庣粏
+ ///</summary>
+ [SugarTable("MES_INV_ITEM_IN_C_ITEMS")]
+ public class MesInvItemInCItems
+ {
+ /// <summary>
+ ///
+ /// 榛樿鍊�: (newid())
+ ///</summary>
+ [SugarColumn(ColumnName = "guid", IsPrimaryKey = true)]
+ public Guid Guid { get; set; }
+
+ /// <summary>
+ /// 鍏ュ簱鍗昳d
+ ///</summary>
+ [SugarColumn(ColumnName = "ITEM_IN_ID")]
+ public Guid ItemInId { get; set; }
+
+ /// <summary>
+ /// 楠屾敹鏁伴噺
+ ///</summary>
+ [SugarColumn(ColumnName = "QUANTITY")]
+ public decimal? Quantity { get; set; }
+
+ /// <summary>
+ /// 鍒涘缓浜�
+ ///</summary>
+ [SugarColumn(ColumnName = "CREATE_BY")]
+ public string? CreateBy { get; set; }
+
+ /// <summary>
+ /// 鍒涘缓鏃堕棿
+ ///</summary>
+ [SugarColumn(ColumnName = "CREATE_DATE")]
+ public DateTime? CreateDate { get; set; }
+
+ /// <summary>
+ /// 鏈�鍚庢洿鏂颁汉
+ ///</summary>
+ [SugarColumn(ColumnName = "LASTUPDATE_BY")]
+ public string? LastupdateBy { get; set; }
+
+ /// <summary>
+ /// 鏈�鍚庢洿鏂版椂闂�
+ ///</summary>
+ [SugarColumn(ColumnName = "LASTUPDATE_DATE")]
+ public DateTime? LastupdateDate { get; set; }
+
+ /// <summary>
+ /// 鐗╂枡缂栫爜
+ ///</summary>
+ [SugarColumn(ColumnName = "ITEM_NO")]
+ public string? ItemNo { get; set; }
+
+ /// <summary>
+ /// 浠撳簱缂栫爜
+ ///</summary>
+ [SugarColumn(ColumnName = "DEPOT_CODE")]
+ public string? DepotCode { get; set; }
+
+ /// <summary>
+ /// 璐т綅缂栫爜
+ ///</summary>
+ [SugarColumn(ColumnName = "DEPOT_SECTION_CODE")]
+ public string? DepotSectionCode { get; set; }
+
+ /// <summary>
+ /// 鐗硅浜嬮」
+ ///</summary>
+ [SugarColumn(ColumnName = "REMARK")]
+ public string? Remark { get; set; }
+
+ /// <summary>
+ /// 鐗╂枡绠�绉�
+ ///</summary>
+ [SugarColumn(ColumnName = "ITEM_SNAME")]
+ public string? ItemSname { get; set; }
+
+ /// <summary>
+ /// 鍗曚綅
+ ///</summary>
+ [SugarColumn(ColumnName = "UNIT")]
+ public string? Unit { get; set; }
+
+ /// <summary>
+ /// 閲囪喘璁㈠崟
+ ///</summary>
+ [SugarColumn(ColumnName = "EBELN")]
+ public string? Ebeln { get; set; }
+
+ /// <summary>
+ /// 鍏ュ簱鍗曞彿
+ ///</summary>
+ [SugarColumn(ColumnName = "BILL_NO")]
+ public string? BillNo { get; set; }
+
+ /// <summary>
+ /// 鍒嗗巶缂栫爜
+ ///</summary>
+ [SugarColumn(ColumnName = "FACTORY")]
+ public string? Factory { get; set; }
+
+ /// <summary>
+ /// 鍏徃浠g爜
+ ///</summary>
+ [SugarColumn(ColumnName = "COMPANY")]
+ public string? Company { get; set; }
+
+ /// <summary>
+ /// 浠诲姟鍗曞彿
+ ///</summary>
+ [SugarColumn(ColumnName = "WORK_NO")]
+ public string? WorkNo { get; set; }
+
+ /// <summary>
+ /// 琛屽彿
+ ///</summary>
+ [SugarColumn(ColumnName = "EBELN_LINE_NO")]
+ public long? EbelnLineNo { get; set; }
+
+ /// <summary>
+ /// 鍒拌揣鍗曞彿
+ ///</summary>
+ [SugarColumn(ColumnName = "CBILL_NO")]
+ public string? CbillNo { get; set; }
+
+ /// <summary>
+ /// 浠诲姟鍗曡鍙�
+ ///</summary>
+ [SugarColumn(ColumnName = "WORK_LINE")]
+ public long? WorkLine { get; set; }
+
+ /// <summary>
+ /// 鐢熶骇宸ュ崟
+ ///</summary>
+ [SugarColumn(ColumnName = "TASK_NO")]
+ public string? TaskNo { get; set; }
+
+ /// <summary>
+ /// 渚涘簲鍟�
+ ///</summary>
+ [SugarColumn(ColumnName = "SUPP_NO")]
+ public string? SuppNo { get; set; }
+
+ /// <summary>
+ /// 閲囪喘璁㈠崟ID
+ ///</summary>
+ [SugarColumn(ColumnName = "EBELN_K3ID")]
+ public long? EbelnK3id { get; set; }
+
+ /// <summary>
+ /// 閲囪喘璁㈠崟琛孖D
+ ///</summary>
+ [SugarColumn(ColumnName = "LINE_K3ID")]
+ public long? LineK3id { get; set; }
+
+ /// <summary>
+ /// 鐗╂枡ID
+ ///</summary>
+ [SugarColumn(ColumnName = "ITEM_ID")]
+ public long? ItemId { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/entity/MesInvItemIns.cs b/entity/MesInvItemIns.cs
new file mode 100644
index 0000000..a2206ee
--- /dev/null
+++ b/entity/MesInvItemIns.cs
@@ -0,0 +1,329 @@
+锘縰sing SqlSugar;
+
+namespace NewPdaSqlServer.entity
+{
+ /// <summary>
+ /// 鐗╂枡鍏ュ簱涓昏〃
+ ///</summary>
+ [SugarTable("MES_INV_ITEM_INS")]
+ public class MesInvItemIns
+ {
+ /// <summary>
+ /// ID(SEQ_INV_ID)
+ /// 榛樿鍊�: (newid())
+ ///</summary>
+ [SugarColumn(ColumnName = "GUID", IsPrimaryKey = true)]
+ public Guid Guid { get; set; }
+
+ /// <summary>
+ /// 鍏ュ簱鍗曞彿
+ ///</summary>
+ [SugarColumn(ColumnName = "BILL_NO")]
+ public string? BillNo { get; set; }
+
+ /// <summary>
+ /// 鐘舵�亅0-鏈鏍�1-瀹℃牳鍏ュ簱\\缁撴
+ /// 榛樿鍊�: ((0))
+ ///</summary>
+ [SugarColumn(ColumnName = "STATUS")]
+ public byte? Status { get; set; }
+
+ /// <summary>
+ /// 浠撳簱
+ ///</summary>
+ [SugarColumn(ColumnName = "DEPOTS_ID")]
+ public long? DepotsId { get; set; }
+
+ /// <summary>
+ /// 鍘熷洜
+ ///</summary>
+ [SugarColumn(ColumnName = "REASON")]
+ public string? Reason { get; set; }
+
+ /// <summary>
+ /// 鍒涘缓浜�
+ ///</summary>
+ [SugarColumn(ColumnName = "CREATE_BY")]
+ public string? CreateBy { get; set; }
+
+ /// <summary>
+ /// 鍒涘缓鏃堕棿
+ ///</summary>
+ [SugarColumn(ColumnName = "CREATE_DATE")]
+ public DateTime? CreateDate { get; set; }
+
+ /// <summary>
+ /// 鏈�鍚庢洿鏂颁汉
+ ///</summary>
+ [SugarColumn(ColumnName = "LASTUPDATE_BY")]
+ public string? LastupdateBy { get; set; }
+
+ /// <summary>
+ /// 鏈�鍚庢洿鏂版椂闂�
+ ///</summary>
+ [SugarColumn(ColumnName = "LASTUPDATE_DATE")]
+ public DateTime? LastupdateDate { get; set; }
+
+ /// <summary>
+ /// 鍗曟嵁绫诲瀷ID
+ ///</summary>
+ [SugarColumn(ColumnName = "BILL_TYPE_ID")]
+ public long? BillTypeId { get; set; }
+
+ /// <summary>
+ /// 浜嬪姟绫诲瀷ID
+ ///</summary>
+ [SugarColumn(ColumnName = "TRANSACTION_ID")]
+ public long? TransactionId { get; set; }
+
+ /// <summary>
+ /// 澶囨敞
+ ///</summary>
+ [SugarColumn(ColumnName = "REMARK")]
+ public string? Remark { get; set; }
+
+ /// <summary>
+ /// 閫佽揣鍗曞彿
+ ///</summary>
+ [SugarColumn(ColumnName = "PAPER_BILL_NO")]
+ public string? PaperBillNo { get; set; }
+
+ /// <summary>
+ /// 閫�鏂欎汉宸ュ彿
+ ///</summary>
+ [SugarColumn(ColumnName = "USER_NO_BACK")]
+ public string? UserNoBack { get; set; }
+
+ /// <summary>
+ /// 瀹℃牳浜�
+ ///</summary>
+ [SugarColumn(ColumnName = "CHECK_USER")]
+ public string? CheckUser { get; set; }
+
+ /// <summary>
+ /// 瀹℃牳鏃ユ湡
+ ///</summary>
+ [SugarColumn(ColumnName = "CHECK_DATE")]
+ public DateTime? CheckDate { get; set; }
+
+ /// <summary>
+ /// 鐢熶骇璁㈠崟鍙�
+ ///</summary>
+ [SugarColumn(ColumnName = "TASK_NO")]
+ public string? TaskNo { get; set; }
+
+ /// <summary>
+ /// 鍏ュ簱鏃ユ湡
+ ///</summary>
+ [SugarColumn(ColumnName = "INS_DATE")]
+ public DateTime? InsDate { get; set; }
+
+ /// <summary>
+ ///
+ ///</summary>
+ [SugarColumn(ColumnName = "CHECK_RES")]
+ public string? CheckRes { get; set; }
+
+ /// <summary>
+ /// 宸叉崱鏁伴噺
+ ///</summary>
+ [SugarColumn(ColumnName = "CHECK_QTY")]
+ public long? CheckQty { get; set; }
+
+ /// <summary>
+ /// 棰嗘枡宸ユ
+ ///</summary>
+ [SugarColumn(ColumnName = "MMLIST")]
+ public string? Mmlist { get; set; }
+
+ /// <summary>
+ /// SAP閲囪喘璁㈠崟鍙�
+ ///</summary>
+ [SugarColumn(ColumnName = "EBELN")]
+ public string? Ebeln { get; set; }
+
+ /// <summary>
+ /// 浠撳簱缂栫爜
+ ///</summary>
+ [SugarColumn(ColumnName = "DEPOTS_CODE")]
+ public string? DepotsCode { get; set; }
+
+ /// <summary>
+ /// 浜嬪姟绫诲瀷缂栫爜
+ ///</summary>
+ [SugarColumn(ColumnName = "TRANSCTION_NO")]
+ public string? TransctionNo { get; set; }
+
+ /// <summary>
+ /// 渚涘簲鍟嗙紪鐮�
+ ///</summary>
+ [SugarColumn(ColumnName = "SUPP_NO")]
+ public string? SuppNo { get; set; }
+
+ /// <summary>
+ /// 鍏ュ簱鐘舵��
+ /// 榛樿鍊�: ((0))
+ ///</summary>
+ [SugarColumn(ColumnName = "FSTATUS")]
+ public byte? Fstatus { get; set; }
+
+ /// <summary>
+ /// 宸ュ巶缂栫爜
+ ///</summary>
+ [SugarColumn(ColumnName = "FACTORY")]
+ public string? Factory { get; set; }
+
+ /// <summary>
+ /// 鏄惁宸插洖鍐橲AP
+ /// 榛樿鍊�: ((0))
+ ///</summary>
+ [SugarColumn(ColumnName = "SAPSTATUS")]
+ public byte? Sapstatus { get; set; }
+
+ /// <summary>
+ /// SAP杩斿洖鍗曟嵁
+ ///</summary>
+ [SugarColumn(ColumnName = "SAPNO")]
+ public string? Sapno { get; set; }
+
+ /// <summary>
+ /// SAP杩斿洖骞翠唤
+ ///</summary>
+ [SugarColumn(ColumnName = "SAPYEAR")]
+ public short? Sapyear { get; set; }
+
+ /// <summary>
+ /// SAP杩斿洖淇℃伅
+ ///</summary>
+ [SugarColumn(ColumnName = "SAPTEXT")]
+ public string? Saptext { get; set; }
+
+ /// <summary>
+ /// 纭鍏ュ簱鏃ユ湡
+ ///</summary>
+ [SugarColumn(ColumnName = "INSDATE")]
+ public DateTime? Insdate { get; set; }
+
+ /// <summary>
+ /// 鏄惁妫�楠�
+ ///</summary>
+ [SugarColumn(ColumnName = "ISCHECK")]
+ public byte? Ischeck { get; set; }
+
+ /// <summary>
+ /// 瀹℃牳鍏ュ簱浜�
+ ///</summary>
+ [SugarColumn(ColumnName = "INSBY")]
+ public string? Insby { get; set; }
+
+ /// <summary>
+ /// 鏄惁鏄剧ず
+ /// 榛樿鍊�: ((0))
+ ///</summary>
+ [SugarColumn(ColumnName = "IS_VISUAL")]
+ public byte? IsVisual { get; set; }
+
+ /// <summary>
+ /// 鍏徃浠g爜
+ ///</summary>
+ [SugarColumn(ColumnName = "COMPANY")]
+ public string? Company { get; set; }
+
+ /// <summary>
+ /// 鎬ユ枡鏍囪瘑
+ /// 榛樿鍊�: ((0))
+ ///</summary>
+ [SugarColumn(ColumnName = "URGENT_FLAG")]
+ public int? UrgentFlag { get; set; }
+
+ /// <summary>
+ /// 閲囪喘鍗曡鍙�
+ ///</summary>
+ [SugarColumn(ColumnName = "LINE_NO")]
+ public string? LineNo { get; set; }
+
+ /// <summary>
+ /// 鍐查攢浜嬪姟绫诲瀷缂栫爜
+ ///</summary>
+ [SugarColumn(ColumnName = "MTTRANSCTION_NO")]
+ public long? MttransctionNo { get; set; }
+
+ /// <summary>
+ /// 宸ュ崟琛屽彿
+ ///</summary>
+ [SugarColumn(ColumnName = "TASK_LINO")]
+ public string? TaskLino { get; set; }
+
+ /// <summary>
+ /// 鎶曟枡閫氱煡鍗曞崟鍙�
+ ///</summary>
+ [SugarColumn(ColumnName = "FBILLNO")]
+ public string? Fbillno { get; set; }
+
+ /// <summary>
+ /// 鎶曟枡鍗曡鍙�
+ ///</summary>
+ [SugarColumn(ColumnName = "FBILL_LINO")]
+ public string? FbillLino { get; set; }
+
+ /// <summary>
+ /// 瀹㈡埛缂栧彿
+ ///</summary>
+ [SugarColumn(ColumnName = "CUST_NO")]
+ public string? CustNo { get; set; }
+
+ /// <summary>
+ /// 瀹㈡埛鍚嶇О
+ ///</summary>
+ [SugarColumn(ColumnName = "CUST_NAME")]
+ public string? CustName { get; set; }
+
+ /// <summary>
+ /// IQC妫�楠屽崟鍙�
+ ///</summary>
+ [SugarColumn(ColumnName = "IQC_RELEASE_NO")]
+ public string? IqcReleaseNo { get; set; }
+
+ /// <summary>
+ /// 鍒拌揣鍗曞彿/鍏跺畠鍏ュ簱鍗曞彿
+ ///</summary>
+ [SugarColumn(ColumnName = "CBILL_NO")]
+ public string? CbillNo { get; set; }
+
+ /// <summary>
+ /// 0 鐢宠鍗曪紝1鍏ュ簱鍗曟爣璇�
+ /// 榛樿鍊�: ((0))
+ ///</summary>
+ [SugarColumn(ColumnName = "PICK_INS")]
+ public byte? PickIns { get; set; }
+
+ /// <summary>
+ /// 鍏ュ簱瀹℃牳浜�
+ ///</summary>
+ [SugarColumn(ColumnName = "FCHECK_USER")]
+ public string? FcheckUser { get; set; }
+
+ /// <summary>
+ /// 鍏ュ簱瀹℃牳鏃ユ湡
+ ///</summary>
+ [SugarColumn(ColumnName = "FCHECK_DATE")]
+ public DateTime? FcheckDate { get; set; }
+
+ /// <summary>
+ /// 浠诲姟姹囨姤鍗�/宸ュ崟鍙凤紙鎴愬搧鍏ュ簱銆侀��鏂欙級
+ ///</summary>
+ [SugarColumn(ColumnName = "RBILL_NO")]
+ public string? RbillNo { get; set; }
+
+ /// <summary>
+ /// 鎶ュ伐浜�
+ ///</summary>
+ [SugarColumn(ColumnName = "BGR")]
+ public string? Bgr { get; set; }
+
+ //鍦ㄦ暟鎹簱鏌ヨ鏃跺拷鐣ヨ繖涓瓧娈�
+ [SugarColumn(IsIgnore = true)] public string? DepotName { get; set; }
+
+ [SugarColumn(IsIgnore = true)] public string? SuppName { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/entity/MesInvItemStocks.cs b/entity/MesInvItemStocks.cs
index 9dda5fc..a48c68c 100644
--- a/entity/MesInvItemStocks.cs
+++ b/entity/MesInvItemStocks.cs
@@ -8,172 +8,204 @@
[SugarTable("MES_INV_ITEM_STOCKS")]
public class MesInvItemStocks
{
- /// <summary>
+ /// <summary>
///
/// 榛樿鍊�: (newid())
///</summary>
[SugarColumn(ColumnName="guid" ,IsPrimaryKey = true )]
public Guid Guid { get; set; }
- /// <summary>
+
+ /// <summary>
/// 鐢熶骇璁㈠崟
///</summary>
[SugarColumn(ColumnName="TASK_NO" )]
- public string TaskNo { get; set; }
- /// <summary>
+ public string? TaskNo { get; set; }
+
+ /// <summary>
/// 鐗╂枡鏉$爜
///</summary>
[SugarColumn(ColumnName="ITEM_BARCODE" )]
- public string ItemBarcode { get; set; }
- /// <summary>
+ public string? ItemBarcode { get; set; }
+
+ /// <summary>
/// 瀹㈡埛鐗╂枡缂栫爜锛堟棤鏉$爜鎵嬪伐褰曞叆锛屾湁鏉$爜涓哄啑浣欏瓧娈碉級
///</summary>
[SugarColumn(ColumnName="C_ITEM_CODE" )]
- public string CItemCode { get; set; }
- /// <summary>
+ public string? CItemCode { get; set; }
+
+ /// <summary>
/// 鏈徃鐗╂枡缂栫爜锛堟棤鏉$爜鎵嬪伐褰曞叆锛屾湁鏉$爜涓哄啑浣欏瓧娈碉級
///</summary>
[SugarColumn(ColumnName="ITEM_NO" )]
- public string ItemNo { get; set; }
- /// <summary>
+ public string? ItemNo { get; set; }
+
+ /// <summary>
/// 瀛愬簱id
///</summary>
[SugarColumn(ColumnName="DEPOTS_ID" )]
public long? DepotsId { get; set; }
- /// <summary>
+
+ /// <summary>
/// 璐т綅id
///</summary>
[SugarColumn(ColumnName="DEPOT_SECTIONS_ID" )]
public long? DepotSectionsId { get; set; }
- /// <summary>
+
+ /// <summary>
/// 鍘傚鎵规
///</summary>
[SugarColumn(ColumnName="LOT_NO" )]
- public string LotNo { get; set; }
- /// <summary>
+ public string? LotNo { get; set; }
+
+ /// <summary>
/// 鏁伴噺
/// 榛樿鍊�: ((0))
///</summary>
[SugarColumn(ColumnName="QUANTITY" )]
public decimal? Quantity { get; set; }
- /// <summary>
+
+ /// <summary>
/// 鐜繚鏍囧織锛堟棤鏉$爜鎵嬪伐褰曞叆锛屾湁鏉$爜涓哄啑浣欏瓧娈碉級(0-鍚︼紝1-鏄�)
///</summary>
[SugarColumn(ColumnName="EP_FLAG" )]
public byte? EpFlag { get; set; }
- /// <summary>
+
+ /// <summary>
/// 瀹㈡埛缂栫爜
///</summary>
[SugarColumn(ColumnName="CUSTOMER_NO" )]
- public string CustomerNo { get; set; }
- /// <summary>
+ public string? CustomerNo { get; set; }
+
+ /// <summary>
/// 閲嶉噺
///</summary>
[SugarColumn(ColumnName="ITEM_WT" )]
public decimal? ItemWt { get; set; }
- /// <summary>
+
+ /// <summary>
/// 瀛愬簱CODE
///</summary>
[SugarColumn(ColumnName="DEPOTS_CODE" )]
- public string DepotsCode { get; set; }
- /// <summary>
+ public string? DepotsCode { get; set; }
+
+ /// <summary>
/// 璐т綅CODE
///</summary>
[SugarColumn(ColumnName="DEPOT_SECTIONS_CODE" )]
- public string DepotSectionsCode { get; set; }
- /// <summary>
+ public string? DepotSectionsCode { get; set; }
+
+ /// <summary>
/// 妫�楠屾棩鏈�
///</summary>
[SugarColumn(ColumnName="CHECK_DATE" )]
public DateTime? CheckDate { get; set; }
- /// <summary>
+
+ /// <summary>
/// 0 鐗╂枡 1 鍗婃垚鍝� 2 鎴愬搧
/// 榛樿鍊�: ((0))
///</summary>
[SugarColumn(ColumnName="ITEM_TYPE" )]
public byte? ItemType { get; set; }
- /// <summary>
+
+ /// <summary>
/// 鍏ュ簱鏃ユ湡
/// 榛樿鍊�: (getdate())
///</summary>
[SugarColumn(ColumnName="INDEP_DATE" )]
public DateTime? IndepDate { get; set; }
- /// <summary>
+
+ /// <summary>
/// 宸ュ巶缂栧彿
///</summary>
[SugarColumn(ColumnName="FACTORY" )]
- public string Factory { get; set; }
- /// <summary>
+ public string? Factory { get; set; }
+
+ /// <summary>
/// 鍏徃缂栧彿
///</summary>
[SugarColumn(ColumnName="COMPANY" )]
- public string Company { get; set; }
- /// <summary>
+ public string? Company { get; set; }
+
+ /// <summary>
/// 璐ㄩ噺鐘舵��
///</summary>
[SugarColumn(ColumnName="IQC_STATUS" )]
- public string IqcStatus { get; set; }
- /// <summary>
+ public string? IqcStatus { get; set; }
+
+ /// <summary>
/// F鍗�
///</summary>
[SugarColumn(ColumnName="FCAR" )]
- public string Fcar { get; set; }
- /// <summary>
+ public string? Fcar { get; set; }
+
+ /// <summary>
/// 鍙鎻愪氦鏍囧織锛�0-鍚︼紝1-鏄級
/// 榛樿鍊�: ((0))
///</summary>
[SugarColumn(ColumnName="VISABLE_SUBMIT" )]
public byte? VisableSubmit { get; set; }
- /// <summary>
+
+ /// <summary>
/// 鍙鎻愪氦浜�
///</summary>
[SugarColumn(ColumnName="VISABLE_SUBMIT_BY" )]
- public string VisableSubmitBy { get; set; }
- /// <summary>
+ public string? VisableSubmitBy { get; set; }
+
+ /// <summary>
/// 鍙鎻愪氦鏃堕棿
///</summary>
[SugarColumn(ColumnName="VISABLE_SUBMIT_DATE" )]
public DateTime? VisableSubmitDate { get; set; }
- /// <summary>
+
+ /// <summary>
/// 鏉垮瀷
///</summary>
[SugarColumn(ColumnName="BOARD_STYLE" )]
- public string BoardStyle { get; set; }
- /// <summary>
+ public string? BoardStyle { get; set; }
+
+ /// <summary>
/// 宸ュ崟鍙�
///</summary>
[SugarColumn(ColumnName="WORK_NO" )]
- public string WorkNo { get; set; }
- /// <summary>
+ public string? WorkNo { get; set; }
+
+ /// <summary>
/// 宸ュ崟琛屽彿
///</summary>
[SugarColumn(ColumnName="WORK_LINE" )]
public int? WorkLine { get; set; }
- /// <summary>
+
+ /// <summary>
/// 渚涘簲鍟嗙紪鐮�
///</summary>
[SugarColumn(ColumnName="SUPP_NO" )]
- public string SuppNo { get; set; }
- /// <summary>
+ public string? SuppNo { get; set; }
+
+ /// <summary>
/// 琛屽彿
///</summary>
[SugarColumn(ColumnName="LINE_NO" )]
- public string LineNo { get; set; }
- /// <summary>
+ public string? LineNo { get; set; }
+
+ /// <summary>
/// 鍗曟嵁缂栧彿
///</summary>
[SugarColumn(ColumnName="BILL_NO" )]
- public string BillNo { get; set; }
- /// <summary>
+ public string? BillNo { get; set; }
+
+ /// <summary>
/// K3ID
///</summary>
[SugarColumn(ColumnName="EBELN_K3ID" )]
public long? EbelnK3id { get; set; }
- /// <summary>
+
+ /// <summary>
/// 琛孠3ID
///</summary>
[SugarColumn(ColumnName="LINE_K3ID" )]
public long? LineK3id { get; set; }
- /// <summary>
+
+ /// <summary>
/// 鐗╂枡ID
///</summary>
[SugarColumn(ColumnName="ITEM_ID" )]
diff --git a/service/Warehouse/MesDepotSectionsManager.cs b/service/Warehouse/MesDepotSectionsManager.cs
new file mode 100644
index 0000000..9d39c4b
--- /dev/null
+++ b/service/Warehouse/MesDepotSectionsManager.cs
@@ -0,0 +1,88 @@
+锘縰sing NewPdaSqlServer.DB;
+using NewPdaSqlServer.Dto.service;
+using NewPdaSqlServer.entity;
+using SqlSugar;
+
+namespace NewPdaSqlServer.service.Warehouse
+{
+ public class MesDepotSectionsManager : Repository<MesDepotSections>
+ {
+ public string GetSectionName(WarehouseQuery query)
+ {
+ var sectionName = Db.Queryable<MesDepotSections, MesDepots>(
+ (a, b) =>
+ new JoinQueryInfos(JoinType.Inner,
+ a.DepotGuid == b.Guid))
+ .Where((a, b) => a.DepotSectionCode == query.sectionCode)
+ .Select((a, b) => a.DepotSectionName).Single();
+
+ if (sectionName == null)
+ throw new Exception("搴撲綅缂栫爜 " + query.sectionCode + " 涓嶅瓨鍦紝璇风‘璁わ紒");
+
+ return sectionName;
+ }
+
+ //搴撲綅鍙樻洿
+ public MesDepotSections ScanInDepotSectionsName(WarehouseQuery query)
+ {
+ if (string.IsNullOrEmpty(query.sectionCode))
+ throw new Exception("璇锋壂搴撲綅鏉$爜!");
+
+ var mesDepotSections = Db.Queryable<MesDepotSections, MesDepots>(
+ (a, b) =>
+ new JoinQueryInfos(JoinType.Inner,
+ a.DepotGuid == b.Guid))
+ .Where((a, b) => a.DepotSectionCode == query.sectionCode)
+ .Select((a, b) => new MesDepotSections
+ {
+ DepotSectionName = a.DepotSectionName,
+ DepotCode = b.DepotCode,
+ DepotName = b.DepotName
+ }).First();
+
+ if (mesDepotSections == null)
+ throw new Exception("搴撲綅缂栫爜" + query.sectionCode + " 涓嶅瓨鍦紝璇风‘璁�!");
+
+ return mesDepotSections;
+ }
+
+ //搴撲綅鍙樻洿
+ public MesInvItemStocks ScanEditBarcode(WarehouseQuery entity)
+ {
+ if (string.IsNullOrEmpty(entity.sectionCode))
+ throw new Exception("璇锋壂搴撲綅鏉$爜!");
+
+ var mesDepotSections = Db.Queryable<MesDepotSections, MesDepots>(
+ (a, b) =>
+ new JoinQueryInfos(JoinType.Inner,
+ a.Zuid.ToString() == b.Zuid))
+ .Where((a, b) => a.DepotSectionCode == entity.sectionCode)
+ .First();
+ if (mesDepotSections == null)
+ throw new Exception("搴撲綅缂栫爜" + entity.sectionCode + " 涓嶅瓨鍦紝璇风‘璁わ紒");
+
+ var mesInvItemStocks = Db.Queryable<MesInvItemStocks>()
+ .Where(s => s.ItemBarcode == entity.barcode).First();
+
+ if (mesInvItemStocks == null) throw new Exception("鏉$爜鍦ㄤ粨搴撲腑涓嶅瓨鍦紝璇锋牳瀵癸紒");
+
+ if (mesInvItemStocks.DepotsCode != mesDepotSections.DepotCode)
+ throw new Exception(
+ "鏉$爜鍘熶粨搴擄細" + mesInvItemStocks.DepotsCode + " 涓庣洰鏍囦粨搴擄細" +
+ mesDepotSections.DepotCode + " 涓嶄竴鑷达紝搴撲綅鍙樻洿澶辫触锛�");
+
+ UseTransaction(db =>
+ {
+ return db.Updateable<MesInvItemStocks>()
+ .SetColumns(s => s.DepotsCode == mesDepotSections.DepotCode)
+ .SetColumns(s => s.DepotSectionsCode == entity.sectionCode)
+ .Where(s => s.ItemBarcode == entity.barcode)
+ .ExecuteCommand();
+ });
+
+ return mesInvItemStocks;
+ }
+
+ //璋冩嫧鍏ュ簱
+ }
+}
\ No newline at end of file
diff --git a/service/Warehouse/MesInvItemInCDetailsManager.cs b/service/Warehouse/MesInvItemInCDetailsManager.cs
new file mode 100644
index 0000000..1cdfcbd
--- /dev/null
+++ b/service/Warehouse/MesInvItemInCDetailsManager.cs
@@ -0,0 +1,870 @@
+锘縰sing NewPdaSqlServer.DB;
+using NewPdaSqlServer.Dto.service;
+using NewPdaSqlServer.entity;
+using NewPdaSqlServer.util;
+using Newtonsoft.Json;
+using SqlSugar;
+
+namespace NewPdaSqlServer.service.Warehouse;
+
+public class MesInvItemInCDetailsManager : Repository<MesInvItemInCDetails>
+{
+ //褰撳墠绫诲凡缁忕户鎵夸簡 Repository 澧炪�佸垹銆佹煡銆佹敼鐨勬柟娉�
+
+ public PurchaseInventory SaveBarCodes(WarehouseQuery entity)
+ {
+ string functionName = "閲囪喘鍏ュ簱", fieldName = null, inFieldVal = null;
+ string user = entity.userName,
+ sectionCode = entity.sectionCode,
+ itemBarcode = entity.barcode;
+ string transactionNo = "101";
+ int? billTypeId = 100, num = 0, num2 = 0;
+ int freeze = 0;
+ decimal cSyQty = 0;
+
+ if (string.IsNullOrEmpty(sectionCode))
+ throw new Exception("璇锋壂搴撲綅鏉$爜锛�");
+
+ var itemBarcodeDetails = Db.Queryable<MesInvItemBarcodes>()
+ .Where(it => it.ItemBarcode == itemBarcode)
+ .First();
+
+ if (itemBarcodeDetails == null)
+ throw new Exception("鏉$爜涓嶅瓨鍦紝璇锋牳瀵癸紒");
+
+ if (!itemBarcodeDetails.ComeFlg.Value)
+ throw new Exception("姝ゆ潯鐮佷笉灞炰簬鍒拌揣鏉$爜锛屾棤娉曠敤閲囪喘鍏ュ簱锛�");
+
+ var inventory = Db.Queryable<MesInvItemArn>()
+ .Where(it => it.BillNo == itemBarcodeDetails.BillNo)
+ .First();
+
+ if (inventory == null)
+ throw new Exception("姝ゆ潯鐮佹壘涓嶅埌瀵瑰簲鏀惰揣鍗曪紒");
+
+ var inventoryDetails = Db.Queryable<MesInvItemArnDetail>()
+ .Where(it => it.ParentGuid == inventory.Guid
+ && it.ItemId == itemBarcodeDetails.ItemId
+ && it.EbelnLine == itemBarcodeDetails.WorkLine
+ && it.Ebeln == itemBarcodeDetails.WorkNo)
+ .First();
+
+ if (inventoryDetails == null)
+ throw new Exception("姝ゆ潯鐮佹壘涓嶅埌瀵瑰簲鏀惰揣鍗曟槑缁嗭紒");
+
+ var depotCode = Db.Queryable<MesDepotSections>()
+ .Where(it => it.DepotSectionCode == sectionCode)
+ .Select(it => it.DepotGuid)
+ .First();
+
+ var depotCode2 = Db.Queryable<MesInvItemArn>()
+ .Where(it => it.BillNo == itemBarcodeDetails.BillNo)
+ .Select(it => it.DepotsId)
+ .First();
+
+ MesDepots mesDepost = null;
+
+ var checkGuid = UtilityHelper.CheckGuid(depotCode);
+ if (checkGuid && depotCode2 != null)
+ {
+ mesDepost = Db.Queryable<MesDepots>()
+ .Where(s => s.DepotId.ToString() == depotCode2).First();
+
+ if (depotCode != mesDepost.Guid)
+ throw new Exception("鎵弿搴撲綅涓庨噰璐叆搴撳簱浣嶄笉涓�鑷达紒");
+ }
+ else
+ {
+ throw new Exception("搴撲綅缂栫爜 " + sectionCode + " 涓嶅瓨鍦紝璇风‘璁わ紒");
+ }
+
+
+ num = Db.Queryable<MesInvItemInCDetails>()
+ .Where(it => it.ItemBarcode == itemBarcode)
+ .Count();
+
+ if (num > 0)
+ throw new Exception("姝ゆ潯鐮佸凡鎵爜鍏ュ簱瀹屾垚锛岃鏍稿锛�");
+
+ num = Db.Queryable<MesInvItemStocks>()
+ .Where(it => it.ItemBarcode == itemBarcode)
+ .Count();
+
+ if (num > 0)
+ throw new Exception("姝ゆ潯鐮佸凡鎵爜鍏ュ簱锛岃鏍稿锛�");
+
+ num = Db.Queryable<MesInvItemArn>()
+ .Where(a => a.BillNo == itemBarcodeDetails.BillNo)
+ .InnerJoin<MesInvItemArnDetail>((a, b) =>
+ b.ParentGuid == a.Guid &&
+ b.ItemId == itemBarcodeDetails.ItemId && b.Ischeck == 1)
+ .Count();
+
+ num2 = Db.Queryable<MesInvItemArn>()
+ .Where(a => a.BillNo == itemBarcodeDetails.BillNo)
+ .InnerJoin<MesInvItemArnDetail>((a, b) => b.ParentGuid == a.Guid
+ && b.ItemId == itemBarcodeDetails.ItemId
+ && (b.CheckRes == "鍚堟牸" || b.CheckStates == "鐗归噰鐩存帴浣跨敤"))
+ .Count();
+
+ switch (num)
+ {
+ case 0 when num2 == 0:
+ case > 0 when num2 == 0:
+ freeze = 1;
+ break;
+ case 0 when num2 > 0:
+ throw new Exception("鍏ュ簱澶辫触,鍒拌揣鍗曟嵁鏈夐棶棰橈紒");
+ }
+
+ PurchaseInventory result = new PurchaseInventory();
+
+ UseTransaction(db =>
+ {
+ var existingRecord = db.Queryable<MesInvItemIns>()
+ .Where(it => it.InsDate.Value.Date == DateTime.Now.Date
+ && it.Status == 0
+ && it.TransctionNo == transactionNo
+ && it.BillNo == itemBarcodeDetails.BillNo
+ && it.DepotsCode == mesDepost.DepotCode)
+ .Select(it => new
+ {
+ it.Guid,
+ it.BillNo
+ })
+ .First();
+
+ Guid cId = Guid.Empty;
+ string cBillNo = null;
+
+ if (existingRecord != null)
+ {
+ // If record exists, assign values
+ cId = existingRecord.Guid;
+ cBillNo = existingRecord.BillNo;
+ }
+ else
+ {
+ cId = Guid.NewGuid();
+ cBillNo = BillNo.GetBillNo("IN(鍏ュ簱鍗�)");
+
+ var suppNo = db.Queryable<MesSupplier>()
+ .Where(s => s.Id.ToString() == inventory.SuppId)
+ .Select(s => s.SuppNo).First();
+
+ db.Insertable(new MesInvItemIns
+ {
+ Guid = cId,
+ BillNo = cBillNo,
+ BillTypeId = billTypeId,
+ InsDate = DateTime.Now,
+ DepotsCode = mesDepost.DepotCode,
+ TransctionNo = transactionNo,
+ SuppNo = suppNo,
+ CreateBy = user,
+ CreateDate = DateTime.Now,
+ LastupdateBy = user,
+ LastupdateDate = DateTime.Now,
+ UrgentFlag = itemBarcodeDetails.UrgentFlag.Value ? 1 : 0,
+ CbillNo = itemBarcodeDetails.BillNo,
+ Fstatus = 0,
+ Status = 0
+ }).IgnoreColumns(true).ExecuteCommand();
+ }
+
+ cSyQty = itemBarcodeDetails.Quantity.Value;
+
+ itemBarcodeDetails.Hbdy ??= 0;
+ if (itemBarcodeDetails.Hbdy == 1)
+ {
+ var details = db.Queryable<MesInvItemArnDetail>()
+ .Where(d =>
+ d.CbillNo == itemBarcodeDetails.BillNo &&
+ d.Quantity != d.OkRkqty &&
+ d.ItemId == itemBarcodeDetails.ItemId)
+ .ToList();
+
+
+ foreach (var detail in details)
+ {
+ if (cSyQty == 0) break;
+
+ var remainingQty = detail.Quantity - (detail.OkRkqty ?? 0);
+ if (remainingQty <= cSyQty)
+ {
+ // Update detail
+ db.Updateable<MesInvItemArnDetail>()
+ .SetColumns(d => new MesInvItemArnDetail
+ {
+ OkRkqty = (int)d.Quantity,
+ IsdepsIn = true
+ })
+ .Where(d => d.Guid == detail.Guid)
+ .IgnoreColumns(ignoreAllNullColumns: true)
+ .ExecuteCommand();
+
+ // Check if already inserted
+ var count = db.Queryable<MesInvItemInCItems>()
+ .Where(t =>
+ t.ItemInId == cId &&
+ t.ItemId == detail.ItemId &&
+ t.WorkNo == detail.WorkNo &&
+ t.WorkLine == detail.WorkLine)
+ .Count();
+
+ cSyQty -= remainingQty.Value;
+
+ if (count == 0)
+ {
+ // Insert new item into MES_INV_ITEM_IN_C_ITEMS
+ db.Insertable(new MesInvItemInCItems
+ {
+ ItemInId = cId,
+ Quantity = remainingQty,
+ CreateBy = user,
+ CreateDate = DateTime.Now,
+ ItemId = detail.ItemId,
+ DepotCode = mesDepost.DepotCode,
+ ItemSname = itemBarcodeDetails.ItemSname,
+ Unit = itemBarcodeDetails.Unit,
+ Ebeln = detail.WorkNo,
+ BillNo = cBillNo,
+ WorkNo = detail.WorkNo,
+ CbillNo = detail.CbillNo,
+ WorkLine = detail.WorkLine,
+ SuppNo = itemBarcodeDetails.SuppNo,
+ Remark = itemBarcodeDetails.Memo,
+ EbelnK3id = detail.EbelnK3id,
+ LineK3id = detail.LineK3id
+ }).IgnoreColumns(true).ExecuteCommand();
+ }
+ else
+ {
+ db.Updateable<MesInvItemInCItems>()
+ .SetColumns(it =>
+ it.Quantity == it.Quantity + remainingQty)
+ .Where(it =>
+ it.ItemInId == cId &&
+ it.ItemId == detail.ItemId &&
+ it.WorkNo == detail.WorkNo &&
+ it.WorkLine == detail.WorkLine)
+ .IgnoreColumns(ignoreAllNullColumns: true)
+ .ExecuteCommand();
+ }
+
+ // Insert new detail into MES_INV_ITEM_IN_C_DETAILS
+ db.Insertable(new MesInvItemInCDetails
+ {
+ ItemInId = cId,
+ BillNo = cBillNo,
+ ItemBarcode = itemBarcode,
+ Quantity = remainingQty,
+ BarcodeFlag = true,
+ EpFlag = true,
+ WorkType = 1,
+ ItemNo = detail.ItemNo,
+ SuppNo = itemBarcodeDetails.SuppNo,
+ DepotCode = mesDepost.DepotCode,
+ DepotSectionCode = sectionCode,
+ ItemSname = itemBarcodeDetails.ItemSname,
+ Unit = itemBarcodeDetails.Unit,
+ CreateBy = user,
+ CreateDate = DateTime.Now,
+ LastupdateBy = user,
+ LastupdateDate = DateTime.Now,
+ Remark = itemBarcodeDetails.Memo,
+ Ebeln = detail.WorkNo,
+ WorkNo = detail.WorkNo,
+ WorkLine = detail.WorkLine,
+ CbillNo = itemBarcodeDetails.BillNo,
+ UrgentFlag = detail.UrgentFlag,
+ BoardStyle = detail.BoardStyle,
+ TaskNo = detail.WorkNo,
+ EbelnK3id = detail.EbelnK3id,
+ LineK3id = detail.LineK3id,
+ ItemId = detail.ItemId
+ }).IgnoreColumns(true).ExecuteCommand();
+ }
+ else
+ {
+ // Partially fulfill remaining quantity
+ db.Updateable<MesInvItemArnDetail>()
+ .SetColumns(d => new MesInvItemArnDetail
+ {
+ OkRkqty = (int)((d.OkRkqty ?? 0) + cSyQty)
+ })
+ .Where(d => d.Guid == detail.Guid)
+ .IgnoreColumns(ignoreAllNullColumns: true)
+ .ExecuteCommand();
+
+ var count = db.Queryable<MesInvItemInCItems>()
+ .Where(t =>
+ t.ItemInId == cId &&
+ t.ItemId == detail.ItemId &&
+ t.WorkNo == detail.WorkNo &&
+ t.WorkLine == detail.WorkLine)
+ .Count();
+
+ if (count == 0)
+ {
+ db.Insertable(new MesInvItemInCItems
+ {
+ ItemInId = cId,
+ Quantity = cSyQty,
+ CreateBy = user,
+ CreateDate = DateTime.Now,
+ ItemNo = detail.ItemNo,
+ DepotCode = mesDepost.DepotCode,
+ ItemSname = itemBarcodeDetails.ItemSname,
+ Unit = itemBarcodeDetails.Unit,
+ Ebeln = detail.WorkNo,
+ BillNo = cBillNo,
+ WorkNo = detail.WorkNo,
+ EbelnLineNo = detail.EbelnLine,
+ CbillNo = detail.CbillNo,
+ WorkLine = detail.WorkLine,
+ SuppNo = itemBarcodeDetails.SuppNo,
+ Remark = itemBarcodeDetails.Memo,
+ EbelnK3id = detail.EbelnK3id,
+ LineK3id = detail.LineK3id,
+ ItemId = detail.ItemId
+ }).IgnoreColumns(true).ExecuteCommand();
+ }
+ else
+ {
+ db.Updateable<MesInvItemInCItems>()
+ .SetColumns(it =>
+ it.Quantity == it.Quantity + cSyQty)
+ .Where(it =>
+ it.ItemInId == cId &&
+ it.ItemId == detail.ItemId &&
+ it.WorkNo == detail.WorkNo &&
+ it.WorkLine == detail.WorkLine)
+ .IgnoreColumns(ignoreAllNullColumns: true)
+ .ExecuteCommand();
+ }
+
+ db.Insertable(new MesInvItemInCDetails
+ {
+ ItemInId = cId,
+ BillNo = cBillNo,
+ ItemBarcode = itemBarcode,
+ Quantity = cSyQty,
+ BarcodeFlag = true,
+ EpFlag = true,
+ WorkType = 1,
+ ItemNo = detail.ItemNo,
+ SuppNo = itemBarcodeDetails.SuppNo,
+ DepotCode = mesDepost.DepotCode,
+ DepotSectionCode = sectionCode,
+ ItemSname = itemBarcodeDetails.ItemSname,
+ Unit = itemBarcodeDetails.Unit,
+ CreateBy = user,
+ CreateDate = DateTime.Now,
+ LastupdateBy = user,
+ LastupdateDate = DateTime.Now,
+ Remark = itemBarcodeDetails.Memo,
+ Ebeln = detail.WorkNo,
+ EbelnLineNo = detail.EbelnLine,
+ WorkNo = detail.WorkNo,
+ WorkLine = detail.WorkLine,
+ CbillNo = itemBarcodeDetails.BillNo,
+ UrgentFlag = detail.UrgentFlag,
+ BoardStyle = detail.BoardStyle,
+ TaskNo = detail.WorkNo,
+ EbelnK3id = detail.EbelnK3id,
+ LineK3id = detail.LineK3id,
+ ItemId = detail.ItemId
+ }).IgnoreColumns(true).ExecuteCommand();
+
+ cSyQty = 0; // Remaining quantity fulfilled
+ }
+ }
+
+ db.Insertable(new MesInvBusiness2
+ {
+ Status = 1,
+ BillTypeId = billTypeId,
+ TransactionCode = transactionNo,
+ BusinessType = 1,
+ ItemBarcode = itemBarcode,
+ ItemNo = itemBarcodeDetails.ItemNo,
+ LotNo = itemBarcodeDetails.LotNo,
+ EpFlag = true,
+ Quantity = itemBarcodeDetails.Quantity,
+ ToInvDepotsCode = mesDepost.DepotCode,
+ ToInvDepotSectionsCode = sectionCode,
+ Description = "閲囪喘鍏ュ簱",
+ CreateBy = user,
+ CreateDate = DateTime.Now,
+ LastupdateBy = user,
+ LastupdateDate = DateTime.Now,
+ TaskNo = itemBarcodeDetails.BillNo,
+ BillNo = cBillNo,
+ WorkNo = itemBarcodeDetails.WorkNo,
+ WorkLine = itemBarcodeDetails.WorkLine,
+ SuppNo = itemBarcodeDetails.SuppNo,
+ EbelnK3id = itemBarcodeDetails.EbelnK3id,
+ LineK3id = itemBarcodeDetails.LineK3id,
+ ItemId = itemBarcodeDetails.ItemId
+ }).IgnoreColumns(true).ExecuteCommand();
+
+ // Insert into mes_inv_item_stocks
+ }
+ else
+ {
+ // 妫�鏌ユ槸鍚﹀瓨鍦ㄤ簬 MES_INV_ITEM_IN_C_ITEMS 琛�
+ var existingCount = db.Queryable<MesInvItemInCItems>()
+ .Where(t => t.ItemInId == cId &&
+ t.ItemId == itemBarcodeDetails.ItemId &&
+ t.WorkNo == itemBarcodeDetails.WorkNo &&
+ t.WorkLine == itemBarcodeDetails.WorkLine)
+ .Count();
+
+ if (existingCount == 0)
+ {
+ // 涓嶅瓨鍦ㄦ椂鎻掑叆鏂拌褰�
+ db.Insertable(new MesInvItemInCItems
+ {
+ ItemInId = cId,
+ Quantity = itemBarcodeDetails.Quantity,
+ CreateBy = user,
+ CreateDate = DateTime.Now,
+ ItemNo = itemBarcodeDetails.ItemNo,
+ DepotCode = mesDepost.DepotCode,
+ ItemSname = itemBarcodeDetails.ItemSname,
+ Unit = itemBarcodeDetails.Unit,
+ Ebeln = itemBarcodeDetails.WorkNo,
+ BillNo = cBillNo,
+ WorkNo = itemBarcodeDetails.WorkNo,
+ EbelnLineNo = itemBarcodeDetails.WorkLine,
+ CbillNo = itemBarcodeDetails.BillNo,
+ WorkLine = itemBarcodeDetails.WorkLine,
+ SuppNo = itemBarcodeDetails.SuppNo,
+ Remark = itemBarcodeDetails.Memo,
+ EbelnK3id = itemBarcodeDetails.EbelnK3id,
+ LineK3id = itemBarcodeDetails.LineK3id,
+ ItemId = itemBarcodeDetails.ItemId
+ }).IgnoreColumns(true).ExecuteCommand();
+ }
+ else
+ {
+ // 瀛樺湪鏃舵洿鏂版暟閲�
+ db.Updateable<MesInvItemInCItems>()
+ .SetColumns(it =>
+ it.Quantity ==
+ it.Quantity + itemBarcodeDetails.Quantity)
+ .Where(it => it.ItemInId == cId &&
+ it.ItemId == itemBarcodeDetails.ItemId &&
+ it.WorkNo == itemBarcodeDetails.WorkNo &&
+ it.WorkLine == itemBarcodeDetails.WorkLine)
+ .IgnoreColumns(ignoreAllNullColumns: true)
+ .ExecuteCommand();
+ }
+
+ // 鎻掑叆 mes_inv_item_in_c_details 琛�
+ db.Insertable(new MesInvItemInCDetails
+ {
+ ItemInId = cId,
+ BillNo = cBillNo,
+ ItemBarcode = itemBarcode,
+ Quantity = itemBarcodeDetails.Quantity,
+ BarcodeFlag = true,
+ EpFlag = true,
+ WorkType = 1,
+ ItemNo = itemBarcodeDetails.ItemNo,
+ LotNo = itemBarcodeDetails.LotNo,
+ SuppNo = itemBarcodeDetails.SuppNo,
+ DepotCode = mesDepost.DepotCode,
+ DepotSectionCode = sectionCode,
+ ItemSname = itemBarcodeDetails.ItemSname,
+ Unit = itemBarcodeDetails.Unit,
+ CreateBy = user,
+ CreateDate = DateTime.Now,
+ LastupdateBy = user,
+ LastupdateDate = DateTime.Now,
+ Remark = itemBarcodeDetails.Memo,
+ Ebeln = itemBarcodeDetails.Mblnr,
+ EbelnLineNo = itemBarcodeDetails.Zeile,
+ WorkNo = itemBarcodeDetails.WorkNo,
+ WorkLine = itemBarcodeDetails.WorkLine,
+ CbillNo = itemBarcodeDetails.BillNo,
+ UrgentFlag = itemBarcodeDetails.UrgentFlag,
+ BoardStyle = itemBarcodeDetails.BoardStyle,
+ TaskNo = itemBarcodeDetails.TaskNo,
+ EbelnK3id = itemBarcodeDetails.EbelnK3id,
+ LineK3id = itemBarcodeDetails.LineK3id,
+ ItemId = itemBarcodeDetails.ItemId,
+ Ischeck = true,
+ CheckDate = inventoryDetails.CheckDate,
+ CheckRes = inventoryDetails.CheckRes,
+ CheckStates = inventoryDetails.CheckStates
+ }).IgnoreColumns(true).ExecuteCommand();
+
+ // 鎻掑叆 mes_inv_business2 琛�
+ db.Insertable(new MesInvBusiness2
+ {
+ Status = 1,
+ BillTypeId = billTypeId,
+ TransactionCode = transactionNo,
+ BusinessType = 1,
+ ItemBarcode = itemBarcode,
+ ItemNo = itemBarcodeDetails.ItemNo,
+ LotNo = itemBarcodeDetails.LotNo,
+ EpFlag = true,
+ Quantity = itemBarcodeDetails.Quantity,
+ FromInvDepotsCode = null,
+ FromInvDepotSectionsCode = null,
+ ToInvDepotsCode = mesDepost.DepotCode,
+ ToInvDepotSectionsCode = sectionCode,
+ Description = "閲囪喘鍏ュ簱",
+ CreateBy = user,
+ CreateDate = DateTime.Now,
+ LastupdateBy = user,
+ LastupdateDate = DateTime.Now,
+ TaskNo = itemBarcodeDetails.TaskNo,
+ BillNo = cBillNo,
+ WorkNo = itemBarcodeDetails.WorkNo,
+ WorkLine = itemBarcodeDetails.WorkLine,
+ SuppNo = itemBarcodeDetails.SuppNo,
+ EbelnK3id = itemBarcodeDetails.EbelnK3id,
+ LineK3id = itemBarcodeDetails.LineK3id,
+ ItemId = itemBarcodeDetails.ItemId
+ }).IgnoreColumns(true).ExecuteCommand();
+
+ // 鎻掑叆 mes_inv_item_stocks 琛�
+ }
+
+ db.Insertable(new MesInvItemStocks
+ {
+ TaskNo = itemBarcodeDetails.TaskNo,
+ ItemBarcode = itemBarcode,
+ ItemNo = itemBarcodeDetails.ItemNo,
+ LotNo = itemBarcodeDetails.LotNo,
+ Quantity = itemBarcodeDetails.Quantity,
+ DepotsCode = mesDepost.DepotCode,
+ DepotSectionsCode = sectionCode,
+ CheckDate = inventoryDetails.CheckDate,
+ IndepDate = DateTime.Now,
+ IqcStatus = inventoryDetails.CheckStates,
+ BoardStyle = itemBarcodeDetails.BoardStyle,
+ WorkNo = itemBarcodeDetails.WorkNo,
+ WorkLine = itemBarcodeDetails.WorkLine,
+ SuppNo = itemBarcodeDetails.SuppNo,
+ EbelnK3id = itemBarcodeDetails.EbelnK3id,
+ LineK3id = itemBarcodeDetails.LineK3id,
+ ItemId = itemBarcodeDetails.ItemId,
+ BillNo = itemBarcodeDetails.BillNo
+ }).IgnoreColumns(true).ExecuteCommand();
+
+ itemBarcodeDetails.Hbdy ??= 0;
+
+ if (itemBarcodeDetails.Hbdy != 1)
+ {
+ db.Updateable<MesInvItemArnDetail>()
+ .SetColumns(d => new MesInvItemArnDetail
+ {
+ OkRkqty = (int)((d.OkRkqty ?? 0) + cSyQty)
+ })
+ .Where(d => d.Guid == inventoryDetails.Guid)
+ .ExecuteCommand();
+
+ var first = db
+ .Queryable<MesInvItemArnDetail>()
+ .Where(b =>
+ b.Guid == inventoryDetails.Guid)
+ .Select(b => new
+ {
+ TotalQuantity =
+ SqlFunc.AggregateSum(b.Quantity),
+ TotalOkRkQty = SqlFunc.AggregateSum(b.OkRkqty)
+ })
+ .First();
+
+ var TotalQuantity = first.TotalQuantity ?? 0;
+ var TotalOkRkQty = first.TotalOkRkQty ?? 0;
+
+ if (TotalQuantity == TotalOkRkQty)
+ {
+ db.Updateable<MesInvItemArnDetail>()
+ .SetColumns(s => s.IsdepsIn == true)
+ .Where(s => s.Guid == inventoryDetails.Guid)
+ .ExecuteCommand();
+ }
+
+
+ var totalSummary = db.Queryable<MesInvItemArnDetail>()
+ .InnerJoin<MesInvItemArn>((b, a) => a.Guid == b.ParentGuid)
+ .Where((b, a) =>
+ a.BillNo == inventory.BillNo && b.ReturnFlag == 0)
+ .Select((b, a) => new
+ {
+ TotalQuantity = SqlFunc.AggregateSum(b.Quantity),
+ TotalOkRkQty = SqlFunc.AggregateSum(b.OkRkqty)
+ })
+ .First();
+
+ if ((totalSummary.TotalQuantity ?? 0) ==
+ (totalSummary.TotalOkRkQty ?? 0))
+ {
+ db.Updateable<MesInvItemArn>()
+ .SetColumns(it => it.Status == 1)
+ .Where(it => it.BillNo == itemBarcodeDetails.BillNo)
+ .ExecuteCommand();
+ }
+
+ var totalCDetailsQuantity = db.Queryable<MesInvItemInCDetails>()
+ .Where(it => it.WorkLine == itemBarcodeDetails.WorkLine &&
+ it.WorkNo == itemBarcodeDetails.WorkNo &&
+ it.CbillNo == itemBarcodeDetails.BillNo)
+ .Sum(it => it.Quantity);
+
+ var detailSummary = db.Queryable<MesInvItemArnDetail>()
+ .Where(it => it.Guid == inventoryDetails.Guid)
+ .Select(it => new
+ {
+ TotalComeQty = SqlFunc.AggregateSum(it.Quantity),
+ TotalInvQty = SqlFunc.AggregateSum(it.OkRkqty)
+ })
+ .First();
+
+ var comeQty = detailSummary.TotalComeQty ?? 0;
+ var invQty = detailSummary.TotalInvQty ?? 0;
+ var diffQty = comeQty - invQty;
+
+ if (detailSummary == null)
+ {
+ throw new Exception("姝ゆ潯鐮佹壘涓嶅埌瀵瑰簲鏀惰揣鍗曟槑缁嗭紒");
+ }
+
+ var mesItems = db.Queryable<MesItems>()
+ .Where(s=>s.Id == itemBarcodeDetails.ItemId).First();
+
+ result.Message =
+ $"鏉$爜鏁伴噺 {itemBarcodeDetails.Quantity},閲囪喘璁㈠崟 {itemBarcodeDetails.WorkNo} 椤规 {itemBarcodeDetails.WorkLine} 鐗╂枡 {mesItems.ItemNo} 鏈鍏ュ簱鎬绘暟锛歿totalCDetailsQuantity} 鎬诲埌 {comeQty} 宸插叆 {invQty} 娆� {diffQty}";
+ return 1;
+ }
+ else
+ {
+ // Step 1: Check if bill needs to be closed (status update)
+ var totalSummary = db.Queryable<MesInvItemArnDetail>()
+ .LeftJoin<MesInvItemArn>((b, a) => a.Guid == b.ParentGuid)
+ .Where((b, a) =>
+ a.BillNo == inventory.BillNo && b.ReturnFlag == 0)
+ .Select((b, a) => new
+ {
+ TotalQuantity = SqlFunc.AggregateSum(b.Quantity),
+ TotalOkRkQty = SqlFunc.AggregateSum(b.OkRkqty)
+ })
+ .First();
+
+ if ((totalSummary.TotalQuantity ?? 0) ==
+ (totalSummary.TotalOkRkQty ?? 0))
+ {
+ db.Updateable<MesInvItemArn>()
+ .SetColumns(it => it.Status == 1)
+ .Where(it => it.BillNo == itemBarcodeDetails.BillNo)
+ .ExecuteCommand();
+ }
+
+ // Step 2: Calculate total sum from `mes_inv_item_in_c_details`
+ var totalCDetailsQuantity = db.Queryable<MesInvItemInCDetails>()
+ .Where(it => it.CbillNo == itemBarcodeDetails.BillNo &&
+ it.ItemId == itemBarcodeDetails.ItemId)
+ .Sum(it => it.Quantity);
+
+ // Step 3: Calculate comeQty and invQty from `mes_inv_item_arn_detail`
+ var detailSummary = db.Queryable<MesInvItemArnDetail>()
+ .Where(it => it.CbillNo == itemBarcodeDetails.BillNo &&
+ it.ItemId == itemBarcodeDetails.ItemId)
+ .Select(it => new
+ {
+ TotalComeQty = SqlFunc.AggregateSum(it.Quantity),
+ TotalInvQty = SqlFunc.AggregateSum(it.OkRkqty)
+ })
+ .First();
+
+ if (detailSummary == null)
+ {
+ throw new Exception("姝ゆ潯鐮佹壘涓嶅埌瀵瑰簲鏀惰揣鍗曟槑缁嗭紒");
+ }
+
+ var comeQty = detailSummary.TotalComeQty ?? 0;
+ var invQty = detailSummary.TotalInvQty ?? 0;
+ var diffQty = comeQty - invQty;
+
+ var mesItems = db.Queryable<MesItems>()
+ .Where(s=>s.Id == itemBarcodeDetails.ItemId).First();
+
+ // Step 5: Combine final result
+ result.Message =
+ $" 鏉$爜鏁伴噺:{itemBarcodeDetails.Quantity},鐗╂枡 {mesItems.ItemNo} 鏈鍏ュ簱鎬绘暟锛歿totalCDetailsQuantity} 鎬诲埌 {comeQty} 宸插叆 {invQty} 娆� {diffQty}";
+ }
+
+
+ var mesInvItemInCDetails =
+ base.GetSingle(it => it.ItemBarcode == entity.barcode);
+
+ if (mesInvItemInCDetails == null)
+ throw new Exception("鐗╂枡鍏ュ簱鏉$爜鏄庣粏涓嶅瓨鍦�"); // 鎶涘嚭寮傚父浠ヤ緵鍓嶅彴澶勭悊
+ //
+ // var itemInId = mesInvItemInCDetails.ItemInId;
+ // entity.id = itemInId;
+ // entity.PageIndex = 1;
+ // entity.Limit = 1;
+
+ //var inventory = getPurchaseInventory(entity);
+ // inventory.ItemNo = parts[0];
+ // inventory.SumQuantity = Convert.ToDecimal(parts[1]);
+ //return inventory;
+ return 1;
+ });
+ return result;
+ }
+
+
+ public MessageCenter MesToErpParam(WarehouseQuery query)
+ {
+ var erpParameters = "";
+ var title = "";
+ var tableName = "MES_INV_ITEM_INS_" + query.Type;
+ if ("A".Equals(query.Type))
+ {
+ erpParameters = GetErpParameters(query.billNo);
+ title = "閲囪喘鍏ュ簱鍗�" + query.billNo + "瀹℃牳";
+ }
+ else if ("B".Equals(query.Type))
+ {
+ erpParameters = GetDeApprovePam(query.id);
+ title = "閲囪喘鍏ュ簱鍗�" + query.billNo + "鍙嶅鏍�";
+ }
+
+ var ErpUrl = AppsettingsUtility.Settings.ProductionErpUrl;
+ var message = new MessageCenter
+ {
+ TableName = tableName,
+ Url = ErpUrl,
+ Status = 1,
+ CreateBy = query.userName,
+ Route = query.billNo,
+ Title = title,
+ PageName = "Warehouse/PurchaseInventory/Add?id=" + query.id +
+ "&billNo=" + query.billNo,
+ CreateDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
+ Method = "POST",
+ Seq = 1,
+ Data = erpParameters,
+ IsMessage = 0,
+ ContentType = "application/x-www-form-urlencoded"
+ };
+ return message;
+ }
+
+ public MessageCenter SaveMessageCenter(WarehouseQuery query)
+ {
+ var message = MesToErpParam(query);
+
+ var executeReturnIdentity =
+ Db.Insertable(message).ExecuteReturnIdentity();
+ if (executeReturnIdentity > 0)
+ {
+ //message.Guid = executeReturnIdentity;
+ message.Pid = executeReturnIdentity;
+ return message;
+ }
+
+ throw new Exception("鑾峰彇鏁版嵁澶辫触");
+ }
+
+ //audit
+ public bool audit(WarehouseQuery entity)
+ {
+ entity.date = DateTime.Now;
+ entity.status = 1;
+ return Update(entity);
+ }
+
+ public bool deApprove(WarehouseQuery entity)
+ {
+ entity.date = null;
+ entity.status = 0;
+ return Update(entity);
+ }
+
+ private bool Update(WarehouseQuery entity)
+ {
+ return Db.Updateable<MesInvItemIns>()
+ .SetColumns(x => x.Status == entity.status)
+ .SetColumns(x => x.InsDate == entity.date)
+ .Where(x => x.BillNo == entity.billNo)
+ .IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand() > 0;
+ }
+
+ private string GetErpParameters(string? billNo)
+ {
+ var invItemIns = Db.Queryable<MesInvItemIns>()
+ .Single(x => x.BillNo == billNo);
+
+ if (invItemIns == null) throw new Exception("鍏ュ簱鍗曞彿涓嶅瓨鍦�");
+
+ if (invItemIns.Status == 1) throw new Exception("鍏ュ簱鍗曞凡瀹℃牳锛屼笉鑳介噸澶嶆帹閫�");
+
+ var materials = Db.Queryable<MesInvItemInCItems, MesItems, MesUnit,
+ MesInvItemArnDetail>(
+ (g, c, d, a) => new JoinQueryInfos(
+ JoinType.Left,
+ g.ItemNo == c.ItemNo && g.Company == c.Company &&
+ g.Factory == c.Factory, JoinType.Inner,
+ d.Id == Convert.ToDecimal(c.ItemUnit),
+ JoinType.Inner,
+ a.Ebeln == g.WorkNo && a.WorkLine == g.EbelnLineNo
+ && g.CbillNo == a.CbillNo
+ )
+ ).Where((g, c, d, a) => g.BillNo == billNo).Select<Material>(
+ (g, c, d, a) => new Material
+ {
+ // FstockId = g.DepotCode,
+ // FuintId = d.Fnumber,
+ // FsrcEntryId = a.Id,
+ // FmesEntryId = g.Id,
+ // FmaterialId = a.ItemNo,
+ // DepotSectionCode = g.DepotSectionCode,
+ // WorkNo = g.WorkNo,
+ // Frealqty = g.Quantity
+ }).ToList();
+
+
+ if (materials == null || materials.Count == 0)
+ throw new Exception("娌℃湁鎵惧埌鐩稿叧鏁版嵁"); // 鎶涘嚭寮傚父浠ヤ緵鍓嶅彴澶勭悊
+ // 鏋勯�� JSON
+
+ var jsonEntries = materials.Select(d => new
+ {
+ // FMaterialId = d.FmaterialId,
+ // FUintId = d.FuintId,
+ // FRealQty = d.Frealqty,
+ // FStockId = d.FstockId,
+ // FSRCENTRYID = d.FsrcEntryId.ToString(),
+ // F_MES_ENTRYID = d.FmesEntryId.ToString()
+ }).ToList();
+
+ var fdate = DateTime.Now.ToString("yyyy-MM-dd");
+
+ var jsonString = JsonConvert.SerializeObject(jsonEntries);
+ var encodedUrl = "taskname=CGRK&mesid=" + invItemIns.Guid +
+ "&optype=create&datajson={\"F_MES_ID\":\"" +
+ invItemIns.Guid + "\",\"FDate\":\"" + fdate +
+ "\",\"cgrkentry\":" + jsonString + "}";
+
+ return encodedUrl;
+ }
+
+
+ private string GetDeApprovePam(string? id)
+ {
+ var encodedUrl = "taskname=CGRK&mesid=" + id +
+ "&optype=delete&datajson={}";
+
+ return encodedUrl;
+ }
+}
\ No newline at end of file
diff --git a/util/BillNo.cs b/util/BillNo.cs
new file mode 100644
index 0000000..2bd4eed
--- /dev/null
+++ b/util/BillNo.cs
@@ -0,0 +1,31 @@
+锘縰sing System.Text;
+using NewPdaSqlServer.DB;
+
+namespace NewPdaSqlServer.util
+{
+ public static class BillNo
+ {
+ /// <summary>
+ /// TL(閲囪喘閫�鏂欏崟),DH(鍒拌揣鍗�),JY(妫�楠屽崟),IN(鍏ュ簱鍗�)
+ /// </summary>
+ /// <param name="billType"></param>
+ /// <returns></returns>
+ public static string GetBillNo(string billType)
+ {
+ StringBuilder sbSql = new StringBuilder();
+ sbSql.Append(" DECLARE @hNo nvarchar(50) ");
+ sbSql.Append(" EXEC [getOrderNo] '" + billType + "',@hNo output");
+ sbSql.Append(" select @hNo as t1");
+ string str = "";
+ try
+ {
+ str = DbHelperSQL.GetSingle(sbSql.ToString()).ToString();
+ }
+ catch (Exception ex)
+ {
+ str = Guid.NewGuid().ToString();
+ }
+ return str;
+ }
+ }
+}
--
Gitblit v1.9.3