From 445f0928ea74a18e72e65a520c0023508e14e936 Mon Sep 17 00:00:00 2001
From: llj <132905093+newwwwwwtree@users.noreply.github.com>
Date: 星期五, 15 五月 2026 16:52:57 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/WebAPIController.cs |  394 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 380 insertions(+), 14 deletions(-)

diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs
index c001130..4559f40 100644
--- a/WebAPI/Controllers/WebAPIController.cs
+++ b/WebAPI/Controllers/WebAPIController.cs
@@ -21,6 +21,7 @@
 using WebAPI.Service;
 using SyntacticSugar.constant;
 using System.Text.RegularExpressions;
+using WebAPI.Utility;
 
 namespace WebAPI.Controllers
 {
@@ -381,6 +382,16 @@
                         objjson.code = "0";
                         objjson.count = 0;
                         objjson.Message = "鐢ㄦ埛" + UserName + "娌℃湁璇ョ粍缁囨潈闄�";
+                        objjson.data = null;
+                        return objjson;
+                    }
+                }else if (HOrgName == "鍗庤繀鐗圭闄剁摲")
+                {
+                    if (DateTime.Now >= new DateTime(2026, 7, 15))
+                    {
+                        objjson.code = "0";
+                        objjson.count = 0;
+                        objjson.Message = "璇ョ敤鎴风殑璁稿彲鍒版湡锛岃涓庣鐞嗗憳鑱旂郴";
                         objjson.data = null;
                         return objjson;
                     }
@@ -1701,6 +1712,7 @@
         /// <returns></returns>
         [Route("Web/GetGy_ErrMsgBackTypeList_Json")]
         [HttpGet]
+        [Permission(HModName = "Gy_ErrMsgBackType_Query")]
         public object GetGy_ErrMsgBackTypeList_Json(string ErrMsg)
         {
             sWhere = " 绂佺敤鏍囧織 ='鍚�'";
@@ -3479,6 +3491,7 @@
         /// <returns></returns>
         [Route("SaveGy_BadType")]
         [HttpPost]
+        [Permission(HModName = "Gy_BadType", Operate = "_Edit")]
         public object SaveGy_BadType([FromBody] JObject msg)
         {
             DataSet ds;
@@ -3698,6 +3711,7 @@
         /// <returns></returns>
         [Route("GetGy_BadTypeDetail")]
         [HttpGet]
+        [Permission(HModName = "Gy_BadType", Operate = "_Query")]
         public ApiResult<DataSet> GetGy_BadTypeDetail(string HID)
         {
             var dataSet = oCN.RunProcReturn("select top 1 * from h_v_gy_BadTypeList  where HItemID= " + HID + " ", "h_v_gy_BadTypeList");
@@ -3712,6 +3726,8 @@
         /// <returns></returns>
         [Route("DeltetGy_BadType")]
         [HttpGet]
+        [Permission(HModName = "Gy_BadType", Operate = "_Drop")]
+
         public object DeltetGy_BadType(string HItemID, string user)
         {
             DataSet ds;
@@ -4150,6 +4166,7 @@
         /// <returns></returns>
         [Route("SaveGy_ErrType")]
         [HttpPost]
+        [Permission(HModName = "Gy_ErrType", Operate = "_Edit")]
         public object SaveGy_ErrType([FromBody] JObject msg)
         {
             DataSet ds;
@@ -4363,6 +4380,7 @@
         /// <returns></returns>
         [Route("GetGy_ErrTypeDetail")]
         [HttpGet]
+        [Permission(HModName = "Gy_ErrType", Operate = "_Query")]
         public ApiResult<DataSet> GetGy_ErrTypeDetail(string HID)
         {
             var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Gy_ErrTypeList  where HItemID= " + HID + " ", "h_v_Gy_ErrTypeList");
@@ -4378,6 +4396,7 @@
         /// <returns></returns>
         [Route("DeltetGy_ErrType")]
         [HttpGet]
+        [Permission(HModName = "Gy_ErrType", Operate = "_Drop")]
         public object DeltetGy_ErrType(string HItemID, string user)
         {
             DataSet ds;
@@ -4436,6 +4455,7 @@
         #region 寮傚父绫诲瀷瀹℃牳/鍙嶅鏍�
         [Route("Gy_ErrType/AuditGy_ErrType")]
         [HttpGet]
+        [Permission(HModName = "Gy_ErrType", Operate = "_Check")]
         public object AuditGy_ErrType(string HInterID, int Type, string user)
         {
             try
@@ -4802,6 +4822,7 @@
         /// <returns></returns>
         [Route("SaveGy_BadResultList")]
         [HttpPost]
+        [Permission(HModName = "Gy_BadResult", Operate = "_Edit")]
         public object SaveGy_BadResultList([FromBody] JObject msg)
         {
             DataSet ds;
@@ -5023,6 +5044,8 @@
         /// <returns></returns>
         [Route("GetGy_BadResultDetail")]
         [HttpGet]
+        [Permission(HModName = "Gy_BadResult", Operate = "_Query")]
+
         public ApiResult<DataSet> GetGy_BadResultDetail(string HID)
         {
             var model = LuBaoSevice.GetGy_BadResultBillDetail(HID);
@@ -5035,6 +5058,8 @@
         /// <returns></returns>
         [Route("DeltetGy_BadResult")]
         [HttpGet]
+        [Permission(HModName = "Gy_BadResult", Operate = "_Drop")]
+
         public object DeltetGy_BadResult(string HItemID, string user)
         {
             DataSet ds;
@@ -5437,6 +5462,7 @@
         /// <returns></returns>
         [Route("SaveGy_InspectValueList")]
         [HttpPost]
+        [Permission(HModName = "Gy_InspectValue", Operate = "_Edit")]
         public object SaveGy_InspectValueList([FromBody] JObject msg)
         {
             DataSet ds;
@@ -5647,6 +5673,7 @@
         /// <returns></returns>
         [Route("GetGy_InspectValueDetail")]
         [HttpGet]
+        [Permission(HModName = "Gy_InspectValue", Operate = "_Query")]
         public ApiResult<DataSet> GetGy_InspectValueDetail(string HID)
         {
             var model = LuBaoSevice.GetGy_InspectValueBillDetail(HID);
@@ -5659,6 +5686,7 @@
         /// <returns></returns>
         [Route("DeltetGy_InspectValue")]
         [HttpGet]
+        [Permission(HModName = "Gy_InspectValue", Operate = "_Drop")]
         public object DeltetGy_InspectValue(string HItemID, string user)
         {
             DataSet ds;
@@ -5988,6 +6016,7 @@
         /// <returns></returns>
         [Route("SaveGy_InspectMethodList")]
         [HttpPost]
+        [Permission(HModName = "Gy_InspectMethod", Operate = "_Edit")]
         public object SaveGy_InspectMethodList([FromBody] JObject msg)
         {
             DataSet ds;
@@ -6197,6 +6226,7 @@
         /// <returns></returns>
         [Route("GetGy_InspectMethodDetail")]
         [HttpGet]
+        [Permission(HModName = "Gy_InspectMethod", Operate = "_Query")]
         public ApiResult<DataSet> GetGy_InspectMethodDetail(string HID)
         {
             var model = LuBaoSevice.GetGy_InspectMethodBillDetail(HID);
@@ -6209,6 +6239,7 @@
         /// <returns></returns>
         [Route("DeltetGy_InspectMethod")]
         [HttpGet]
+        [Permission(HModName = "Gy_InspectMethod", Operate = "_Drop")]
         public object DeltetGy_InspectMethod(string HItemID, string user)
         {
             DataSet ds;
@@ -6289,6 +6320,7 @@
         /// <returns></returns>
         [Route("SaveGy_QualityStdList")]
         [HttpPost]
+        [Permission(HModName = "Gy_QualityStd", Operate = "_Edit")]
         public object SaveGy_QualityStdList([FromBody] JObject msg)
         {
             DataSet ds;
@@ -6502,6 +6534,7 @@
         /// <returns></returns>
         [Route("GetGy_QualityStdDetail")]
         [HttpGet]
+        [Permission(HModName = "Gy_QualityStd", Operate = "_Query")]
         public ApiResult<DataSet> GetGy_QualityStdDetail(string HID)
         {
             var model = LuBaoSevice.GetGy_QualityStdBillDetail(HID);
@@ -6514,6 +6547,7 @@
         /// <returns></returns>
         [Route("DeltetGy_QualityStd")]
         [HttpGet]
+        [Permission(HModName = "Gy_QualityStd", Operate = "_Drop")]
         public object DeltetGy_QualityStd(string HItemID, string user)
         {
             DataSet ds;
@@ -6594,6 +6628,7 @@
         /// <returns></returns>
         [Route("SaveGy_InspectInstruMentList")]
         [HttpPost]
+        [Permission(HModName = "Gy_InspectInstruMent", Operate = "_Edit")]
         public object SaveGy_InspectInstruMentList([FromBody] JObject msg)
         {
             DataSet ds;
@@ -6806,6 +6841,7 @@
         /// <returns></returns>
         [Route("GetGy_InspectInstruMentDetail")]
         [HttpGet]
+        [Permission(HModName = "Gy_InspectInstruMent", Operate = "_Query")]
         public ApiResult<DataSet> GetGy_InspectInstruMentDetail(string HID)
         {
             var model = LuBaoSevice.GetGy_InspectInstruMentBillDetail(HID);
@@ -6818,6 +6854,7 @@
         /// <returns></returns>
         [Route("DeltetGy_InspectInstruMent")]
         [HttpGet]
+        [Permission(HModName = "Gy_InspectInstruMent", Operate = "_Drop")]
         public object DeltetGy_InspectInstruMent(string HItemID, string user)
         {
             DataSet ds;
@@ -7128,6 +7165,7 @@
         /// <returns></returns>
         [Route("SaveGy_InspectBasisList")]
         [HttpPost]
+        [Permission(HModName = "Gy_InspectBasis", Operate = "_Edit")]
         public object SaveGy_InspectBasisList([FromBody] JObject msg)
         {
             DataSet ds;
@@ -7338,6 +7376,7 @@
         /// <returns></returns>
         [Route("GetGy_InspectBasisDetail")]
         [HttpGet]
+        [Permission(HModName = "Gy_InspectBasis", Operate = "_Query")]
         public ApiResult<DataSet> GetGy_InspectBasisDetail(string HID)
         {
             var model = LuBaoSevice.GetGy_InspectBasisBillDetail(HID);
@@ -7350,6 +7389,7 @@
         /// <returns></returns>
         [Route("DeltetGy_InspectBasis")]
         [HttpGet]
+        [Permission(HModName = "Gy_InspectBasis", Operate = "_Drop")]
         public object DeltetGy_InspectBasis(string HItemID, string user)
         {
             DataSet ds;
@@ -7430,6 +7470,7 @@
         /// <returns></returns>
         [Route("SaveGy_PostSkillList")]
         [HttpPost]
+        [Permission(HModName = "Gy_PostSkill_Edit")]
         public object SaveGy_PostSkillList([FromBody] JObject msg)
         {
             DataSet ds;
@@ -7643,6 +7684,7 @@
         /// <returns></returns>
         [Route("GetGy_PostSkillDetail")]
         [HttpGet]
+        [Permission(HModName = "Gy_PostSkill_Query")]
         public ApiResult<DataSet> GetGy_PostSkillDetail(string HID)
         {
             var model = LuBaoSevice.GetGy_PostSkillDetail(HID);
@@ -7655,6 +7697,7 @@
         /// <returns></returns>
         [Route("DeltetGy_PostSkill")]
         [HttpGet]
+        [Permission(HModName = "Gy_PostSkill_Drop")]
         public object DeltetGy_PostSkill(string HItemID, string user)
         {
             DataSet ds;
@@ -8072,6 +8115,7 @@
         /// <returns></returns>
         [Route("SaveGy_PostList")]
         [HttpPost]
+        [Permission(HModName = "Gy_Post_Edit")]
         public object SaveGy_PostList([FromBody] JObject msg)
         {
             DataSet ds;
@@ -8285,6 +8329,7 @@
         /// <returns></returns>
         [Route("GetGy_PostDetail")]
         [HttpGet]
+        [Permission(HModName = "Gy_Post_Query")]
         public ApiResult<DataSet> GetGy_PostDetail(string HID)
         {
             var model = LuBaoSevice.GetGy_PostDetail(HID);
@@ -8297,6 +8342,7 @@
         /// <returns></returns>
         [Route("DeltetGy_Post")]
         [HttpGet]
+        [Permission(HModName = "Gy_Post_Drop")]
         public object DeltetGy_Post(string HItemID, string user)
         {
             DataSet ds;
@@ -8565,6 +8611,7 @@
         #region 宀椾綅椤圭洰 瀵煎叆(淇濆瓨)
         [Route("Gy_Post/Gy_Post_btnSave")]
         [HttpPost]
+        [Permission(HModName = "Gy_Post_Edit")]
         public object Gy_Post_btnSave([FromBody] JObject sMainSub)
         {
             var _value = sMainSub["sMainSub"].ToString();
@@ -8685,6 +8732,7 @@
         /// <returns></returns>
         [Route("SaveGy_StockMoveStyleList")]
         [HttpPost]
+        [Permission(HModName = "Gy_StockMoveStyle_Edit")]
         public object SaveGy_StockMoveStyleList([FromBody] JObject msg)
         {
             DataSet ds;
@@ -8888,6 +8936,7 @@
         /// <returns></returns>
         [Route("GetGy_StockMoveStyleDetail")]
         [HttpGet]
+        [Permission(HModName = "Gy_StockMoveStyle_Query")]
         public ApiResult<DataSet> GetGy_StockMoveStyleDetail(string HID)
         {
             var model = LuBaoSevice.GetGy_StockMoveStyleDetail(HID);
@@ -8900,6 +8949,7 @@
         /// <returns></returns>
         [Route("DeltetGy_StockMoveStyle")]
         [HttpGet]
+        [Permission(HModName = "Gy_StockMoveStyle_Drop")]
         public object DeltetGy_StockMoveStyle(string HItemID, string user)
         {
             DataSet ds;
@@ -8965,6 +9015,7 @@
         /// <returns></returns>
         [Route("SaveGy_StockInStyleList")]
         [HttpPost]
+        [Permission(HModName = "Gy_StockInStyle_Edit")]
         public object SaveGy_StockInStyleList([FromBody] JObject msg)
         {
             DataSet ds;
@@ -9168,6 +9219,7 @@
         /// <returns></returns>
         [Route("GetGy_StockInStyleDetail")]
         [HttpGet]
+        [Permission(HModName = "Gy_StockInStyle_Query")]
         public ApiResult<DataSet> GetGy_StockInStyleDetail(string HID)
         {
             var model = LuBaoSevice.GetGy_StockInStyleDetail(HID);
@@ -9180,6 +9232,7 @@
         /// <returns></returns>
         [Route("DeltetGy_StockInStyle")]
         [HttpGet]
+        [Permission(HModName = "Gy_StockInStyle_Drop")]
         public object DeltetGy_StockInStyle(string HItemID, string user)
         {
             DataSet ds;
@@ -9245,6 +9298,7 @@
         /// <returns></returns>
         [Route("SaveGy_StockOutStyleList")]
         [HttpPost]
+        [Permission(HModName = "Gy_StockOutStyle_Edit")]
         public object SaveGy_StockOutStyleList([FromBody] JObject msg)
         {
             DataSet ds;
@@ -9448,6 +9502,7 @@
         /// <returns></returns>
         [Route("GetGy_StockOutStyleDetail")]
         [HttpGet]
+        [Permission(HModName = "Gy_StockOutStyle_Query")]
         public ApiResult<DataSet> GetGy_StockOutStyleDetail(string HID)
         {
             var model = LuBaoSevice.GetGy_StockOutStyleDetail(HID);
@@ -9460,6 +9515,7 @@
         /// <returns></returns>
         [Route("DeltetGy_StockOutStyle")]
         [HttpGet]
+        [Permission(HModName = "Gy_StockOutStyle_Drop")]
         public object DeltetGy_StockOutStyle(string HItemID, string user)
         {
             DataSet ds;
@@ -9525,6 +9581,7 @@
         /// <returns></returns>
         [Route("SaveGy_AreaSetList")]
         [HttpPost]
+        [Permission(HModName = "Gy_AreaSet_Edit")]
         public object SaveGy_AreaSetList([FromBody] JObject msg)
         {
             DataSet ds;
@@ -9728,6 +9785,7 @@
         /// <returns></returns>
         [Route("GetGy_AreaSetDetail")]
         [HttpGet]
+        [Permission(HModName = "Gy_AreaSet_Query")]
         public ApiResult<DataSet> GetGy_AreaSetDetail(string HID)
         {
             var model = LuBaoSevice.GetGy_AreaSetDetail(HID);
@@ -9740,6 +9798,7 @@
         /// <returns></returns>
         [Route("DeltetGy_AreaSet")]
         [HttpGet]
+        [Permission(HModName = "Gy_AreaSet_Drop")]
         public object DeltetGy_AreaSet(string HItemID, string user)
         {
             DataSet ds;
@@ -9805,6 +9864,7 @@
         /// <returns></returns>
         [Route("SaveGy_SellStyleList")]
         [HttpPost]
+        [Permission(HModName = "Gy_SellStyle_Edit")]
         public object SaveGy_SellStyleList([FromBody] JObject msg)
         {
             DataSet ds;
@@ -10008,6 +10068,7 @@
         /// <returns></returns>
         [Route("GetGy_SellStyleDetail")]
         [HttpGet]
+        [Permission(HModName = "Gy_SellStyle_Query")]
         public ApiResult<DataSet> GetGy_SellStyleDetail(string HID)
         {
             var model = LuBaoSevice.GetGy_SellStyleDetail(HID);
@@ -10020,6 +10081,7 @@
         /// <returns></returns>
         [Route("DeltetGy_SellStyle")]
         [HttpGet]
+        [Permission(HModName = "Gy_SellStyle_Drop")]
         public object DeltetGy_SellStyle(string HItemID, string user)
         {
             DataSet ds;
@@ -10085,6 +10147,7 @@
         /// <returns></returns>
         [Route("SaveGy_PoStockStyleList")]
         [HttpPost]
+        [Permission(HModName = "Gy_PoStockStyle_Edit")]
         public object SaveGy_PoStockStyleList([FromBody] JObject msg)
         {
             DataSet ds;
@@ -10288,6 +10351,7 @@
         /// <returns></returns>
         [Route("GetGy_PoStockStyleDetail")]
         [HttpGet]
+        [Permission(HModName = "Gy_PoStockStyle_Query")]
         public ApiResult<DataSet> GetGy_PoStockStyleDetail(string HID)
         {
             var model = LuBaoSevice.GetGy_PoStockStyleDetail(HID);
@@ -10300,6 +10364,7 @@
         /// <returns></returns>
         [Route("DeltetGy_PoStockStyle")]
         [HttpGet]
+        [Permission(HModName = "Gy_PoStockStyle_Drop")]
         public object DeltetGy_PoStockStyle(string HItemID, string user)
         {
             DataSet ds;
@@ -10365,6 +10430,7 @@
         /// <returns></returns>
         [Route("SaveGy_SupTypeList")]
         [HttpPost]
+        [Permission(HModName = "Gy_SupType_Edit")]
         public object SaveGy_SupTypeList([FromBody] JObject msg)
         {
             DataSet ds;
@@ -10568,6 +10634,7 @@
         /// <returns></returns>
         [Route("GetGy_SupTypeDetail")]
         [HttpGet]
+        [Permission(HModName = "Gy_SupType_Query")]
         public ApiResult<DataSet> GetGy_SupTypeDetail(string HID)
         {
             var model = LuBaoSevice.GetGy_SupTypeDetail(HID);
@@ -10580,6 +10647,7 @@
         /// <returns></returns>
         [Route("DeltetGy_SupType")]
         [HttpGet]
+        [Permission(HModName = "Gy_SupType_Drop")]
         public object DeltetGy_SupType(string HItemID, string user)
         {
             DataSet ds;
@@ -10796,6 +10864,7 @@
         #region 渚涘簲鍟嗗垎绫婚」鐩� 瀵煎叆(淇濆瓨)
         [Route("Gy_SupType/Gy_SupType_btnSave")]
         [HttpPost]
+        [Permission(HModName = "Gy_SupType_Edit")]
         public object Gy_SupType_btnSave([FromBody] JObject sMainSub)
         {
             var _value = sMainSub["sMainSub"].ToString();
@@ -11247,6 +11316,7 @@
         /// <returns></returns>
         [Route("SaveGy_CusTypeList")]
         [HttpPost]
+        [Permission(HModName = "Gy_CusType_Edit")]
         public object SaveGy_CusTypeList([FromBody] JObject msg)
         {
             DataSet ds;
@@ -11450,6 +11520,7 @@
         /// <returns></returns>
         [Route("GetGy_CusTypeDetail")]
         [HttpGet]
+        [Permission(HModName = "Gy_CusType_Query")]
         public ApiResult<DataSet> GetGy_CusTypeDetail(string HID)
         {
             var model = LuBaoSevice.GetGy_CusTypeDetail(HID);
@@ -11462,6 +11533,7 @@
         /// <returns></returns>
         [Route("DeltetGy_CusType")]
         [HttpGet]
+        [Permission(HModName = "Gy_CusType_Drop")]
         public object DeltetGy_CusType(string HItemID, string user)
         {
             DataSet ds;
@@ -11679,6 +11751,7 @@
         #region 瀹㈡埛鍒嗙被椤圭洰 瀵煎叆(淇濆瓨)
         [Route("Gy_CusType/Gy_CusType_btnSave")]
         [HttpPost]
+        [Permission(HModName = "Gy_CusType_Edit")]
         public object Gy_CusType_btnSave([FromBody] JObject sMainSub)
         {
             var _value = sMainSub["sMainSub"].ToString();
@@ -11799,6 +11872,7 @@
         /// <returns></returns>
         [Route("SaveGy_StockCheckItemList")]
         [HttpPost]
+        [Permission(HModName = "Gy_StockCheckItem_Edit")]
         public object SaveGy_StockCheckItemList([FromBody] JObject msg)
         {
             DataSet ds;
@@ -12002,6 +12076,7 @@
         /// <returns></returns>
         [Route("GetGy_StockCheckItemDetail")]
         [HttpGet]
+        [Permission(HModName = "Gy_StockCheckItem_Query")]
         public ApiResult<DataSet> GetGy_StockCheckItemDetail(string HID)
         {
             var model = LuBaoSevice.GetGy_StockCheckItemDetail(HID);
@@ -12014,6 +12089,7 @@
         /// <returns></returns>
         [Route("DeltetGy_StockCheckItem")]
         [HttpGet]
+        [Permission(HModName = "Gy_StockCheckItem_Drop")]
         public object DeltetGy_StockCheckItem(string HItemID, string user)
         {
             DataSet ds;
@@ -12079,6 +12155,7 @@
         /// <returns></returns>
         [Route("SaveGy_ProjectMoneyList")]
         [HttpPost]
+        [Permission(HModName = "Gy_ProjectMoney_Edit")]
         public object SaveGy_ProjectMoneyList([FromBody] JObject msg)
         {
             DataSet ds;
@@ -12281,6 +12358,8 @@
         /// <returns></returns>
         [Route("GetGy_ProjectMoneyDetail")]
         [HttpGet]
+        [Permission(HModName = "Gy_ProjectMoney_Query")]
+
         public ApiResult<DataSet> GetGy_ProjectMoneyDetail(string HID)
         {
             var model = LuBaoSevice.GetGy_ProjectMoneyDetail(HID);
@@ -12293,6 +12372,7 @@
         /// <returns></returns>
         [Route("DeltetGy_ProjectMoney")]
         [HttpGet]
+        [Permission(HModName = "Gy_ProjectMoney_Drop")]
         public object DeltetGy_ProjectMoney(string HItemID, string user)
         {
             DataSet ds;
@@ -12782,6 +12862,7 @@
         /// <returns></returns>
         [Route("SaveGy_ErrMsgBackType")]
         [HttpPost]
+        [Permission(HModName = "Gy_ErrMsgBackType_Edit")]
         public object SaveGy_ErrMsgBackType([FromBody] JObject msg)
         {
             DataSet ds;
@@ -12987,6 +13068,7 @@
         /// <returns></returns>
         [Route("GetGy_ErrMsgBackTypeDetail")]
         [HttpGet]
+        [Permission(HModName = "Gy_ErrMsgBackType_Query")]
         public ApiResult<DataSet> GetGy_ErrMsgBackTypeDetail(string HID)
         {
             var model = LuBaoSevice.GetGy_ErrMsgBackTypeDetail(HID);
@@ -12999,6 +13081,7 @@
         /// <returns></returns>
         [Route("DeltetGy_ErrMsgBackType")]
         [HttpGet]
+        [Permission(HModName = "Gy_ErrMsgBackType_Drop")]
         public object DeltetGy_ErrMsgBackType(string HItemID, string user)
         {
             DataSet ds;
@@ -13386,6 +13469,7 @@
         /// <returns></returns>
         [Route("SaveGy_BadPhenomenaList")]
         [HttpPost]
+        [Permission(HModName = "Gy_BadPhenomena_Edit")]
         public object SaveGy_BadPhenomenaList([FromBody] JObject msg)
         {
             DataSet ds;
@@ -13609,6 +13693,7 @@
         /// <returns></returns>
         [Route("GetGy_BadPhenomenaDetail")]
         [HttpGet]
+        [Permission(HModName = "Gy_BadPhenomena_Query")]
         public ApiResult<DataSet> GetGy_BadPhenomenaDetail(string HID)
         {
             var model = LuBaoSevice.GetGy_BadPhenomenaDetail(HID);
@@ -13621,6 +13706,7 @@
         /// <returns></returns>
         [Route("DeltetGy_BadPhenomena")]
         [HttpGet]
+        [Permission(HModName = "Gy_BadPhenomena_Drop")]
         public object DeltetGy_BadPhenomena(string HItemID, string user)
         {
             DataSet ds;
@@ -13908,6 +13994,7 @@
         #region 涓嶈壇鐜拌薄椤圭洰 瀵煎叆(淇濆瓨)
         [Route("Gy_BadPhenomena/Gy_BadPhenomena_btnSave")]
         [HttpPost]
+        [Permission(HModName = "Gy_BadPhenomena_Edit")]
         public object Gy_BadPhenomena_btnSave([FromBody] JObject sMainSub)
         {
             var _value = sMainSub["sMainSub"].ToString();
@@ -14030,6 +14117,7 @@
         /// <returns></returns>
         [Route("SaveGy_ProjectClassList")]
         [HttpPost]
+        [Permission(HModName = "Gy_ProjectClass_Edit")]
         public object SaveGy_ProjectClassList([FromBody] JObject msg)
         {
             DataSet ds;
@@ -14234,6 +14322,7 @@
         /// <returns></returns>
         [Route("GetGy_ProjectClassDetail")]
         [HttpGet]
+        [Permission(HModName = "Gy_ProjectClass_Query")]
         public ApiResult<DataSet> GetGy_ProjectClassDetail(string HID)
         {
             var model = LuBaoSevice.GetGy_ProjectClassDetail(HID);
@@ -14246,6 +14335,7 @@
         /// <returns></returns>
         [Route("DeltetGy_ProjectClass")]
         [HttpGet]
+        [Permission(HModName = "Gy_ProjectClass_Drop")]
         public object DeltetGy_ProjectClass(string HItemID, string user)
         {
             DataSet ds;
@@ -14331,6 +14421,7 @@
         /// <returns></returns>
         [Route("SaveGy_TaskClassList")]
         [HttpPost]
+        [Permission(HModName = "Gy_TaskClass_Edit")]
         public object SaveGy_TaskClassList([FromBody] JObject msg)
         {
             DataSet ds;
@@ -14535,6 +14626,7 @@
         /// <returns></returns>
         [Route("GetGy_TaskClassDetail")]
         [HttpGet]
+        [Permission(HModName = "Gy_TaskClass_Query")]
         public ApiResult<DataSet> GetGy_TaskClassDetail(string HID)
         {
             var model = LuBaoSevice.GetGy_TaskClassDetail(HID);
@@ -14547,6 +14639,7 @@
         /// <returns></returns>
         [Route("DeltetGy_TaskClass")]
         [HttpGet]
+        [Permission(HModName = "Gy_TaskClass_Drop")]
         public object DeltetGy_TaskClass(string HItemID, string user)
         {
             DataSet ds;
@@ -18734,6 +18827,7 @@
         /// <returns></returns>
         [Route("Xt_User/Gy_UserByUserListDrop")]
         [HttpGet]
+        [Permission(HModName = "Gy_UserByUser_Drop")]
         public object DeltetGy_Material(string HItemID, string user)
         {
             DataSet ds;
@@ -18823,6 +18917,8 @@
         /// <returns></returns>
         [Route("Gy_UserByUserEdit")]
         [HttpGet]
+        [Permission(HModName = "Gy_UserByUser_Query")]
+
         public ApiResult<DataSet> Gy_UserByUserEdit(string HID)
         {
             var model = LuBaoSevice.Gy_UserByUserEdit(HID);
@@ -19351,6 +19447,7 @@
         /// <returns></returns>
         [Route("Web/GetClassTimePrjGroupBillEdit_Json")]
         [HttpGet]
+
         public object GetClassTimePrjGroupBillEdit_Json(string sWhere)
         {
             //if (!DBUtility.ClsPub.Security_Log("Gy_ClassTimePrj", 1, false, user))
@@ -19444,6 +19541,7 @@
         /// <returns></returns>
         [Route("Web/SaveGetClassTimePrjGroupList")]
         [HttpGet]
+        [Permission(HModName = "Gy_ClassTimePrj")]
         public object SaveGetClassTimePrjGroupList(string HNumber, string HName, string HDeptID, string refSav, string user, string HItem)
         {
 
@@ -24127,7 +24225,12 @@
             string suffix = ".txt";
             string folder = "ptTemplate";
             // 鍖归厤 {{ 瀛楁鍚� }} 鎵�闇�姝e垯琛ㄨ揪寮� 鏀寔涓枃
-            var regex = new Regex(@"{{\s*([\u4e00-\u9fa5a-zA-Z0-9_\s]+?)\s*}}", RegexOptions.Compiled);
+            var regex = new Regex(@"{{\s*([\u4e00-\u9fa5a-zA-Z0-9_\s]+?)\s*}}", RegexOptions.Singleline);
+
+            // 鍖归厤 鐭╁舰妗� 浣嶇疆 瀹介珮 鎵�闇�姝e垯琛ㄨ揪寮�
+            var RectRegex = new Regex(@"^\^FO(\d+),(\d+)\^GB(\d+),(\d+)", RegexOptions.Singleline);
+            // 鍖归厤 妯℃澘瀛楃涓� 鎵�鍦ㄨ 浣嶇疆 瀹介珮 鎵�闇�姝e垯琛ㄨ揪寮� 鏀寔涓枃
+            var fieldRegex = new Regex(@"\^FO(\d+),(\d+)\^A[A-Z]+,(\d+),(\d+).*?\{\{\s*([\u4e00-\u9fa5a-zA-Z0-9_\s]+?)\s*\}\}", RegexOptions.Singleline);
 
             if (ptMode == "ZPL")
             {
@@ -24201,6 +24304,7 @@
                         {
                             string currentLine = lines[i];
                             string preLine = "";
+                            string concatStr = "";
                             if(i>0)
                             {
                                 // 鑾峰彇褰撳墠琛岀殑涓婁竴琛岋紝鐢ㄤ簬鍒ゆ柇鏄惁鏄煩褰㈡
@@ -24213,20 +24317,32 @@
                                 continue;
                             }
 
-
-                            // 姝e垯琛ㄨ揪寮忓尮閰� {{ 瀛楁鍚� }} 鎵�鍦ㄨ鐨勫瓧娈碉紝濡傛灉鏈夛紝鍒欒繘琛屾浛鎹紝娌℃湁锛屽垯榛樿涓虹┖瀛楃涓�
-                            currentLine = regex.Replace(currentLine, match =>
+                            // 鍒ゆ柇鐭╁舰妗嗭紝濡傛灉鍓嶄竴琛屾槸鐭╁舰妗嗭紝鍒欓渶鍒ゆ柇璇ヨ瀛楃涓查暱搴︽槸鍚﹁秴闀�
+                            if(!getConcatStr(rectRegex: RectRegex, fieldRegex: fieldRegex,
+                                PreLine: preLine, CurrLine: currentLine, fieldObject: item,
+                                templateRegex: regex,
+                                ref concatStr))
                             {
-                                string fieldName = match.Groups[1].Value.Trim();
-                                if (msg != null && item.ContainsKey(fieldName))
+                                // 姝e垯琛ㄨ揪寮忓尮閰� {{ 瀛楁鍚� }} 鎵�鍦ㄨ鐨勫瓧娈碉紝濡傛灉鏈夛紝鍒欒繘琛屾浛鎹紝娌℃湁锛屽垯榛樿涓虹┖瀛楃涓�
+                                concatStr = regex.Replace(currentLine, match =>
                                 {
-                                    return item[fieldName]?.ToString() ?? "";
-                                }
-                                return "";
-                            });
-                            // 灏嗘墍鏈� \n 鐨勬崲琛岀 鏇挎崲涓� \r\n
+                                    string fieldName = match.Groups[1].Value.Trim();
+                                    if (msg != null && item.ContainsKey(fieldName))
+                                    {
+                                        return item[fieldName]?.ToString() ?? "";
+                                    }
+                                    return "";
+                                });
+                            }
 
-                            sb.Append(currentLine);
+                            if(string.IsNullOrWhiteSpace(concatStr))
+                            {
+                                concatStr = currentLine;
+                            }
+
+                            
+                            // 灏嗘墍鏈� \n 鐨勬崲琛岀 鏇挎崲涓� \r\n
+                            sb.Append(concatStr);
                             sb.Append("\r\n"); // 鏍囧噯鎹㈣
                         }
                     }
@@ -24245,12 +24361,113 @@
             {
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
-                objJsonResult.Message = $"妯℃澘娓叉煋澶辫触锛歿ex.Message}";
+                objJsonResult.Message = $"妯℃澘娓叉煋澶辫触锛歿ex}";
                 objJsonResult.data = null;
                 return objJsonResult;
             }
 
         }
+
+        private bool getConcatStr(Regex rectRegex, Regex fieldRegex,
+            string PreLine, string CurrLine, JObject fieldObject, Regex templateRegex, ref string concatStr)
+        {
+            var rectRegexResult = rectRegex.Match(PreLine);
+            var fieldRegexResult = fieldRegex.Match(CurrLine);
+            var templateRegexResult = templateRegex.Match(CurrLine);
+            if (!rectRegexResult.Success)
+            {
+                return false;
+            }
+
+            if(!fieldRegexResult.Success)
+            {
+                return false;
+            }
+
+            if(!templateRegexResult.Success)
+            {
+                return false;
+            }
+            
+
+            // 鐭╁舰 浣嶇疆 瀹介珮
+            int rectLocationX = int.Parse(rectRegexResult.Groups[1].Value);
+            int rectLocationY = int.Parse(rectRegexResult.Groups[2].Value);
+            int rectWidth = int.Parse(rectRegexResult.Groups[3].Value);
+            int rectHeight = int.Parse(rectRegexResult.Groups[4].Value);
+
+
+            // 妯℃澘瀛楃涓� 浣嶇疆 瀛楃瀹介珮
+            int fieldLocationX = int.Parse(fieldRegexResult.Groups[1].Value);
+            int fieldLocationY = int.Parse(fieldRegexResult.Groups[2].Value);
+            int fieldWidth = int.Parse(fieldRegexResult.Groups[3].Value);
+            int fieldHeight = int.Parse(fieldRegexResult.Groups[4].Value);
+            var fieldName = fieldRegexResult.Groups[5].Value;
+            
+            
+            JToken fieldValueToken = "";
+            fieldObject.TryGetValue(fieldName, out fieldValueToken);
+
+            if (string.IsNullOrWhiteSpace(fieldValueToken?.ToString()))
+            {
+                return false;
+            }
+            string fieldValue = fieldValueToken.ToString();
+            if (fieldValue.Length * fieldWidth > rectWidth)
+            {
+                // 瀛楃涓查暱搴﹀ぇ浜庣煩褰㈢殑鏈�澶ч暱搴� 鍒欐枃鏈渶瑕佷粠鐭╁舰鐨刌浣嶇疆寮�濮嬫覆鏌�
+                fieldLocationY = rectLocationY;
+                // 鑾峰彇鎹㈣鎵�闇�鐨勮鏁�
+                int lineCount = int.Parse(Math.Ceiling((float)fieldValue.Length / fieldWidth).ToString());
+                
+                // 璁$畻鎹㈣鍚庣殑鏈�澶ц鏁� * 瀛楃楂樺害 鏄惁澶т簬鐭╁舰鏈�澶ч珮搴�
+                if(lineCount * fieldHeight > rectHeight)
+                {
+                    
+                    fieldHeight = int.Parse(Math.Floor((float)rectHeight / lineCount).ToString());
+                    fieldWidth = fieldHeight;
+                }
+
+                // 璁$畻姣忚搴旇鏀惧灏戝瓧绗�
+                int maxCharsPerLine = (int)Math.Ceiling((double)fieldValue.Length / lineCount);
+
+                for (int i = 0; i < lineCount; i++)
+                {
+                    // 璧峰浣嶇疆
+                    int start = i * maxCharsPerLine;
+
+                    // 鍓╀綑澶氬皯瀛楃
+                    int remaining = fieldValue.Length - start;
+
+                    if (remaining <= 0)
+                        break;
+
+                    // 鏈鍙栧嚑涓瓧绗�
+                    int take = Math.Min(maxCharsPerLine, remaining);
+
+                    // 鎴彇褰撳墠琛屾枃鏈�
+                    string lineText = fieldValue.Substring(start, take);
+
+                    // 璁$畻鏂拌鍧愭爣
+                    int newY = fieldLocationY + i * fieldHeight;
+
+                    // 鏇挎崲鎷兼帴
+                    concatStr += fieldRegex.Replace(CurrLine, m =>
+                        $"^FO{fieldLocationX},{newY}^AJN,{fieldWidth},{fieldHeight}^CI28^FD{lineText}^FS"
+                    );
+                }
+                return true;
+            }
+
+            return false;
+
+        }
+        #endregion
+
+        #region APP鏍规嵁璁惧id杩涜鑷姩鐧诲綍
+       
+
+
         [HttpGet]
         [Route("Web/getSysParameter")]
         public object getSysParameter(string HClientID)
@@ -24294,6 +24511,155 @@
                 return objJsonResult;
             }
         }
+        #endregion
+
+        #region 鏍规嵁琛ㄥ悕鑾峰彇sql璇彞
+        [HttpGet]
+        [Route("Web/getSQL")]
+        public object getSQL(string TableName, string ModeName, string OpertionType, string Identityid)
+        {
+            if (OpertionType == "insert")
+            {
+                string sql = $"select * from {TableName}";
+                DataSet ds = oCN.RunProcReturn(sql, TableName);
+
+                if (ds == null || ds.Tables[0].Rows.Count <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "绯荤粺鍙傛暟涓嶅瓨鍦紝璇疯仈绯荤鐞�";
+                    objJsonResult.data = 0;
+                    return objJsonResult;
+                }
+
+                sql = $"exec h_p_sqlhelper '{TableName}'";
+                ds = oCN.RunProcReturn(sql, "h_p_sqlhelper");
+
+                if (ds == null || ds.Tables.Count < 2 || ds.Tables[1].Rows.Count <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "绯荤粺鍙傛暟涓嶅瓨鍦紝璇疯仈绯荤鐞�";
+                    objJsonResult.data = 0;
+                    return objJsonResult;
+                }
+
+                StringBuilder sb = new StringBuilder();
+                string columnsStr = ds.Tables[0].Rows[0][0].ToString();
+                sb.AppendLine($"string sqlRes = $\"INSERT INTO [{TableName}] ({columnsStr})");
+                sb.AppendLine("                VALUES (");
+
+                // 2. 鎷兼帴 VALUES 閲岄潰鐨勫弬鏁�
+                int count = ds.Tables[1].Rows.Count;
+                for (int i = 0; i < count; i++)
+                {
+                    string propName = ds.Tables[1].Rows[i][0].ToString();
+                    string valueFormat = "";
+                    if (propName == "HMakeDate" || propName == "HMakeTime")
+                    {
+                        valueFormat = "getdata()";
+                    }
+                    else if (propName == "HERPItemID")
+                    {
+                        valueFormat = "'{0}'";
+                    }
+                    else
+                    {
+                        valueFormat = $"'{{{ModeName}.{propName}}}'"; // 榛樿閫氱敤閫昏緫
+                    }
+                    sb.Append("                " + valueFormat);
+
+                    if (i < count - 1)
+                    {
+                        sb.Append(",");
+                    }
+                    sb.AppendLine();
+                }
+                sb.AppendLine("                ); \";");
+                sb.Append(" oCN.RunProc(sqlRes);");
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鎴愬姛";
+                objJsonResult.data = sb;
+                return objJsonResult;
+            }
+            else
+            {
+                string whereKey = Identityid;
+                string sql = $"select * from {TableName}";
+                DataSet ds = oCN.RunProcReturn(sql, TableName);
+
+                if (ds == null || ds.Tables[0].Rows.Count <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "绯荤粺鍙傛暟涓嶅瓨鍦紝璇疯仈绯荤鐞�";
+                    objJsonResult.data = 0;
+                    return objJsonResult;
+                }
+                sql = $"exec h_p_sqlhelper '{TableName}'";
+                ds = oCN.RunProcReturn(sql, "h_p_sqlhelper");
+
+                if (ds == null || ds.Tables.Count < 2 || ds.Tables[1].Rows.Count <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "绯荤粺鍙傛暟涓嶅瓨鍦紝璇疯仈绯荤鐞�";
+                    objJsonResult.data = 0;
+                    return objJsonResult;
+                }
+                StringBuilder sb = new StringBuilder();
+
+                sb.Append($"string sqlRes =$\"Update {TableName} set ");
+
+                int count = ds.Tables[1].Rows.Count;
+                int setFieldCount = 0;
+
+                for (int i = 0; i < count; i++)
+                {
+                    string propName = ds.Tables[1].Rows[i][0].ToString();
+
+
+                    if (propName == whereKey)
+                        continue;
+
+
+                    if (setFieldCount > 0)
+                    {
+                        sb.Append(",");
+                    }
+                    string valueFormat = "";
+                    if (propName == "HModifyTime" || propName == "HUpDateDate")
+                    {
+                        valueFormat = $"{propName}=getdate()";
+                    }
+                    else
+                    {
+                        valueFormat = $"{propName}='{{{ModeName}.{propName}}}'";
+                    }
+                    sb.Append("\r\n                " + valueFormat);
+
+                    setFieldCount++;
+                }
+
+                sb.Append($" where {whereKey}='{{{ModeName}.{whereKey}}}'\"");
+                sb.AppendLine();
+                sb.Append("oCN.RunProc(sqlRes);");
+
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鎴愬姛";
+                objJsonResult.data = sb;
+                return objJsonResult;
+            }
+        }
+        #endregion
+    
+        
     }
+
+
 }
-#endregion
\ No newline at end of file
+

--
Gitblit v1.9.1