From eb65436c2312821e3e513ab9ada41dd486d6d7cf Mon Sep 17 00:00:00 2001
From: 啊鑫 <t2856754968@163.com>
Date: 星期二, 09 九月 2025 15:35:41 +0800
Subject: [PATCH] 同步为祈禧的代码
---
WebApi/Gs.Ww/WWTBlDJManager.cs | 38
WebApi/Gs.QiTaCk/MesCgthSqManager.cs | 23
WebApi/Gs.QiTaCk/MesCgytDjManager.cs | 205 +
WebApi/Gs.Wom/WorkService/WorkProController.cs | 21
WebApi/Gs.Ww/WWBlManager.cs | 4
WebApi/Gs.BaseInfo/Services/MesStaffManager.cs | 57
WebApi/Gs.Report/BTDetails.cs | 126 +
WebApi/GS.QC/Service/RkqcManager.cs | 7
WebApi/GS.QC/Service/MesQaItemsDetect01Manager.cs | 4
WebApi/Gs.Ww/WWGDManager.cs | 64
WebApi/Gs.HostIIS/Program.cs | 3
WebApi/Gs.Warehouse/Services/MesRohInManager.cs | 35
WebApi/Gs.Ww/WWBlDJManager.cs | 38
WebApi/Gs.Entity/BaseInfo/MesItems.cs | 98
WebApi/Gs.Report/CkController.cs | 227 +
WebApi/GS.QC/Service/FqcItemsManager.cs | 474 ++++
WebApi/Gs.Sales/SalesReturnManager.cs | 20
WebApi/GS.QC/Service/IpqcShouManager.cs | 281 ++
WebApi/Gs.BaseInfo/Services/MesWorkshopLineManager.cs | 84
WebApi/Gs.Report/WOTraceCodes.cs | 89
WebApi/GS.QC/Service/MesQaMjManager.cs | 86
WebApi/Gs.Sys/Services/MesSysPageviewManager.cs | 4
WebApi/Gs.Ww/WWTblManager.cs | 1
WebApi/CLAUDE.md | 83
WebApi/Gs.Sys/Services/FmController.cs | 73
WebApi/Gs.Warehouse/Services/MesDepotsManager.cs | 122
WebApi/Gs.Wom/WorkService/WorkCollectController.cs | 38
WebApi/Gs.Warehouse/Services/VArrivalBarcodeManager.cs | 94
WebApi/Gs.Toolbox/ExcelHelper.cs | 652 +++++
WebApi/GS.QC/Service/FqcExceptionalManager.cs | 1
WebApi/Gs.BaseInfo/Services/MesCustomerManager.cs | 4
WebApi/Gs.Report/QLController.cs | 164 +
WebApi/Gs.Ww/WWLLDJManager.cs | 39
WebApi/Gs.Report/ReportController.cs | 116
WebApi/Gs.Warehouse/Services/MesDepotSectionsManager.cs | 104
WebApi/Gs.QiTaRk/MesItemQtrkManager.cs | 6
WebApi/Gs.Wom/Service/FanGongManager.cs | 188 +
WebApi/Gs.BaseInfo/Services/MesSupplierManager.cs | 94
WebApi/Gs.Wom/Service/WomdaaManager.cs | 462 +--
WebApi/Gs.Warehouse/Services/MesInvItemInsManager.cs | 62
WebApi/Gs.Sys/Services/SysLogController.cs | 12
WebApi/Gs.Sys/Models/SysLogOperation.cs | 109
WebApi/GS.QC/Service/MesQcExceptionalManager.cs | 111
WebApi/Gs.Warehouse/Services/MesInvItemArnManager.cs | 222 +
WebApi/Gs.BaseInfo/Services/PrintInfoManager.cs | 2
WebApi/Gs.Sys/Services/MesConfigController.cs | 94
WebApi/Gs.HostIIS/CustomContractResolver.cs | 8
WebApi/Gs.Wom/WorkService/MesBackFlashController.cs | 331 -
WebApi/Gs.Sys/Services/MesFileController.cs | 7
WebApi/Gs.QiTaCk/MesItemQtManager.cs | 7
WebApi/Gs.Wom/WorkService/WorkWeightController.cs | 94
WebApi/Gs.Ww/ProductionOrderManager.cs | 13
WebApi/GS.QC/Service/MesDefectCodeManager.cs | 53
WebApi/Gs.HostIIS/appsettings.json | 6
WebApi/Gs.Sales/SalesManager.cs | 89
WebApi/Gs.Wom/Service/WompbaManager.cs | 12
WebApi/GS.QC/Service/RkqcfaManager.cs | 331 ++
WebApi/Gs.BaseInfo/Services/MesItemsManager.cs | 187 +
WebApi/Gs.Sys/Services/OrganizationController.cs | 151
WebApi/Gs.Entity/BaseInfo/MesDepotSections.cs | 5
WebApi/Gs.BaseInfo/Services/MesItemTypeManager.cs | 73
WebApi/Gs.Report/XlsInOutController.cs | 124
WebApi/Gs.Wom/WorkService/WorkTechniqueController.cs | 122
WebApi/Gs.Toolbox/ApiCore/Group/ApiGroupNames.cs | 4
WebApi/Gs.Toolbox/InterfaceUtil.cs | 30
WebApi/Gs.Sys/Services/UserController.cs | 16
WebApi/Gs.QiTaCk/MesItemBlManager.cs | 3
WebApi/GS.QC/Service/FqcManager.cs | 114
WebApi/Gs.HostIIS/RequestAuthorizeAttribute.cs | 5
WebApi/GS.QC/Service/RkqcSqManager.cs | 414 +++
WebApi/Gs.Wom/Service/MesScrkDjManager.cs | 2
71 files changed, 5,180 insertions(+), 1,862 deletions(-)
diff --git a/WebApi/CLAUDE.md b/WebApi/CLAUDE.md
new file mode 100644
index 0000000..a9dd5f0
--- /dev/null
+++ b/WebApi/CLAUDE.md
@@ -0,0 +1,83 @@
+# CLAUDE.md
+
+This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
+
+## Project Overview
+
+This is a .NET 8 MES (Manufacturing Execution System) solution built with ASP.NET Core Web API. The system is organized as a modular monolith with domain-separated projects for different business areas.
+
+## Solution Structure
+
+The solution follows a modular architecture with these main projects:
+
+- **Gs.HostIIS**: Main Web API host application with Swagger documentation
+- **Gs.Entity**: Data entities organized by business domains (BaseInfo, QC, Sys, Warehouse)
+- **Gs.Toolbox**: Core utilities, API framework, and dependency injection infrastructure
+- **Business Modules**:
+ - **Gs.BaseInfo**: Basic information management (items, customers, suppliers, staff, etc.)
+ - **Gs.Warehouse**: Inventory and warehouse management
+ - **Gs.QC** / **GS.QC**: Quality control functionality
+ - **Gs.Sys**: System administration and user management
+ - **Gs.Report**: Reporting functionality
+ - **Gs.Wom**: Work order management
+ - **Gs.Sales**: Sales management
+ - **Gs.Pda**: Mobile/handheld device support
+ - **Gs.QiTaCk** / **Gs.QiTaRk**: Additional business modules
+ - **Gs.Ww**: Additional functionality
+
+## Development Commands
+
+### Build and Run
+- Build entire solution: `dotnet build GsMesSolution.sln`
+- Run main API: `dotnet run --project Gs.HostIIS`
+- Build specific project: `dotnet build Gs.ProjectName/Gs.ProjectName.csproj`
+
+### Development Server
+- The API runs on `http://localhost:5263` (or `http://localhost:37005` via IIS Express)
+- Swagger UI is available at `/swagger` endpoint
+- CORS is configured to allow all origins for development
+
+## Architecture Details
+
+### Custom API Framework
+The solution uses a custom API framework built in `Gs.Toolbox`:
+- Custom dependency injection with lifecycle attributes (`ITransient`, `IScope`, `ISingleton`)
+- Custom controller convention and routing
+- API grouping for Swagger documentation via `ApiGroupAttribute`
+- Custom authorization with `ApiAuthorizeAttribute`
+
+### Data Access
+- Uses SqlSugar ORM for database operations
+- Connection string configured in `appsettings.json`
+- Repository pattern implemented in `Gs.Toolbox/Repository.cs`
+
+### Configuration
+- Database: SQL Server (connection string in appsettings.json)
+- External services: ERP integration endpoints configured
+- File paths: Services, logs, upload, and download paths configured
+- Custom JSON serialization with Newtonsoft.Json
+
+### Key Components
+- **CustomContractResolver**: Custom JSON property naming
+- **ResponseResult**: Standardized API response format
+- **ExcelHelper**: Excel import/export functionality
+- **LogHelper**: Logging utilities
+- **DbHelperSQL**: Additional database utilities
+
+## Business Domains
+
+The system handles typical MES functionality:
+- Base information (items, customers, suppliers, departments, staff)
+- Quality control and inspection
+- Warehouse and inventory management
+- Work order management
+- Reporting and analytics
+- Mobile device integration
+
+## Development Notes
+
+- All projects target .NET 8.0
+- Nullable reference types are enabled
+- The system uses a Chinese interface (comments and some naming in Chinese)
+- Custom API framework provides dependency injection and controller conventions
+- Swagger documentation is automatically generated with XML comments
\ No newline at end of file
diff --git a/WebApi/GS.QC/Service/FqcExceptionalManager.cs b/WebApi/GS.QC/Service/FqcExceptionalManager.cs
index af60bd3..f6ff373 100644
--- a/WebApi/GS.QC/Service/FqcExceptionalManager.cs
+++ b/WebApi/GS.QC/Service/FqcExceptionalManager.cs
@@ -79,7 +79,6 @@
{
LogHelper.Debug(ToString(), ex.Message);
}
-
return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
ReturnCode.Success, "璇诲彇鎴愬姛");
}
diff --git a/WebApi/GS.QC/Service/FqcItemsManager.cs b/WebApi/GS.QC/Service/FqcItemsManager.cs
new file mode 100644
index 0000000..3d55749
--- /dev/null
+++ b/WebApi/GS.QC/Service/FqcItemsManager.cs
@@ -0,0 +1,474 @@
+锘縰sing Gs.Toolbox;
+using Gs.Toolbox.ApiCore.Abstract.Mvc;
+using Gs.Toolbox.ApiCore.Common.Mvc;
+using Gs.Toolbox.ApiCore.Group;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using Newtonsoft.Json.Linq;
+using System.Data;
+using System.Data.SqlClient;
+using System.Dynamic;
+using System.Security.Cryptography.X509Certificates;
+using System.Text;
+using static Gs.Toolbox.UtilityHelper;
+
+namespace GS.QC.Service
+{
+ [ApiGroup(ApiGroupNames.QC)]
+ public class FqcItemsManager : IRomteService
+ {
+ private readonly IHttpContextAccessor _http;
+ private readonly string _userCode, _userGuid, _orgFids;
+
+ public FqcItemsManager(IHttpContextAccessor httpContextAccessor)
+ {
+ _http = httpContextAccessor;
+ (_userCode, _userGuid, _orgFids) =
+ GetUserGuidAndOrgGuid(_http);
+ }
+
+ /// <summary>
+ /// 璇诲彇鍒楄〃锛屾敮鎸佸垎椤�
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<PageList<dynamic>> GetListPage([FromBody] dynamic model)
+ {
+ int currentPage = model.currentPage;
+ int everyPageSize = model.everyPageSize;
+ string sortName = model.sortName;
+ string keyWhere = model.keyWhere;
+ SqlParameter[] parameters =
+ {
+ new("@inCurrentPage", currentPage),
+ new("@inEveryPageSize", everyPageSize),
+ new("@inSortName", sortName),
+ new("@inSortOrder", ""),
+ new("@inQueryWhere", keyWhere),
+ new("@inFid", ""),
+ new("@inP1", ""),
+ new("@inP2", ""),
+ new("@inP3", ""),
+ new("@inP4", "")
+ };
+ var dset = new DataSet();
+ var _pglist = new PageList<dynamic>
+ {
+ total = 0,
+ everyPageSize = 0,
+ pages = 0,
+ list = new List<dynamic>()
+ };
+ try
+ {
+ dset = DbHelperSQL.RunProcedure("prc_fqc_items_lst", parameters, "0");
+ if (dset != null && dset.Tables.Count > 0 &&
+ dset.Tables[0].Rows.Count > 0) //鏈夋暟鎹�
+ {
+ var intTotal =
+ int.Parse(dset.Tables[1].Rows[0]["intTotal"].ToString());
+ var pages = intTotal % everyPageSize != 0
+ ? intTotal / everyPageSize + 1
+ : intTotal / everyPageSize;
+ _pglist.total = intTotal;
+ _pglist.everyPageSize = everyPageSize;
+ _pglist.pages = pages;
+ var _dy = dset.Tables[0].TableToDynamicList();
+ _pglist.list = _dy;
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), ex.Message);
+ return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
+ ReturnCode.Exception, ex.Message);
+ }
+ return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
+ ReturnCode.Success, "璇诲彇鎴愬姛");
+ }
+
+ /// <summary>
+ /// 璇诲彇鍗曚釜瀹炰綋
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<ExpandoObject> GetModel([FromBody] dynamic model)
+ {
+ string guid = model.guid.ToString();
+ dynamic m = new ExpandoObject();
+ m.list = new List<dynamic>();
+ m.list2 = new List<dynamic>();
+
+ try
+ {
+ // 鏌ヨ涓昏〃鏁版嵁
+ string sqlMain = $"SELECT A.*,B.Name as OrgName FROM MES_FQC_ITEMS A LEFT JOIN SYS_ORGANIZATION b ON A.OrgId = b.FID WHERE a.GUID='{guid}'";
+ var dsMain = DbHelperSQL.Query(sqlMain);
+ if (dsMain != null && dsMain.Tables.Count > 0 && dsMain.Tables[0].Rows.Count > 0)
+ {
+ var dr = dsMain.Tables[0].Rows[0];
+ m = dr.RowToDynamic();
+ }
+
+ // 鏌ヨ瀛愯〃1鏁版嵁
+ string sqlDetail1 = $"SELECT * FROM MES_FQC_ITEM_DETAIL1 WHERE PID='{guid}' ORDER BY Seq";
+ var dsDetail1 = DbHelperSQL.Query(sqlDetail1);
+ if (dsDetail1 != null && dsDetail1.Tables.Count > 0)
+ {
+ var _tb = dsDetail1.Tables[0].TableToDynamicList();
+ m.list = _tb;
+ }
+
+ // 鏌ヨ瀛愯〃2鏁版嵁
+ string sqlDetail2 = $"SELECT * FROM MES_FQC_ITEM_DETAIL2 WHERE PID='{guid}' ORDER BY Seq";
+ var dsDetail2 = DbHelperSQL.Query(sqlDetail2);
+ if (dsDetail2 != null && dsDetail2.Tables.Count > 0)
+ {
+ var _tb2 = dsDetail2.Tables[0].TableToDynamicList();
+ m.list2 = _tb2;
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), ex.Message);
+ }
+
+ if (m != null)
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "璇诲彇鎴愬姛锛�");
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, "璇诲彇澶辫触锛�");
+ }
+
+ /// <summary>
+ /// 澧炲姞鎴栫紪杈戝疄浣�
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<ExpandoObject> EditModel([FromBody] dynamic model)
+ {
+ Guid? guid = model.guid; //涓婚敭
+ string fqcNo = model.fqcNo; // 妫�楠屽崟鍙�
+ string workShop = model.workShop; // 鐢熶骇杞﹂棿
+ string itemName = model.itemName; // 浜у搧鍚嶇О
+ string itemModel = model.itemModel; // 瑙勬牸鍨嬪彿
+ string brand = model.brand; // 鍟嗘爣
+
+ // 澶勭悊鐢熶骇鏃ユ湡锛屽厑璁镐负绌�
+ DateTime? productionDate = null;
+ if (model.productionDate != null && !string.IsNullOrEmpty(model.productionDate.ToString()))
+ {
+ if (DateTime.TryParse(model.productionDate.ToString(), out DateTime parsedDate))
+ {
+ productionDate = parsedDate;
+ }
+ }
+
+ string acRe_A = model.acRe_A; // AC/Re A绫�
+ string acRe_B = model.acRe_B; // AC/Re B绫�
+ string acRe_C = model.acRe_C; // AC/Re C绫�
+ string sampleMethod = model.sampleMethod; // 鎶芥牱
+ string sampleSize1 = model.sampleSize1; // 鍖�閫熸娊鏍烽��
+ string sampleSize2 = model.sampleSize2; // 闅忔満鎶芥牱鏁�
+ string sampleSize3 = model.sampleSize3; // 鏍锋湰鏁�
+ string temperature = model.temperature; // 瀹ゆ俯
+ string voltage = model.voltage; // 鐢靛帇
+ string classes = model.classes; // 鐝
+ string lineNo = model.lineNo; // 绾垮彿
+ string batch = model.batch; // 鎵归噺
+ string checkResult = model.checkResult; // 妫�楠岀粨鏋�
+ string processResults = model.processResults; // 澶勭悊缁撴灉
+
+ // 娣诲姞妫�楠屼汉銆佸鏍镐汉銆佸鎵逛汉鍙婂搴旂殑鏃ユ湡
+ string jyUser = model.jyUser; // 妫�楠屼汉
+ string checkUser = model.checkUser; // 瀹℃牳浜�
+ string spUser = model.spUser; // 瀹℃壒浜�
+
+ // 澶勭悊妫�楠屾棩鏈燂紝鍏佽涓虹┖
+ DateTime? jyDate = null;
+ if (model.jyDate != null && !string.IsNullOrEmpty(model.jyDate.ToString()))
+ {
+ if (DateTime.TryParse(model.jyDate.ToString(), out DateTime parsedJyDate))
+ {
+ jyDate = parsedJyDate;
+ }
+ }
+
+ // 澶勭悊瀹℃牳鏃ユ湡锛屽厑璁镐负绌�
+ DateTime? checkDate = null;
+ if (model.checkDate != null && !string.IsNullOrEmpty(model.checkDate.ToString()))
+ {
+ if (DateTime.TryParse(model.checkDate.ToString(), out DateTime parsedCheckDate))
+ {
+ checkDate = parsedCheckDate;
+ }
+ }
+
+ // 澶勭悊瀹℃壒鏃ユ湡锛屽厑璁镐负绌�
+ DateTime? spDate = null;
+ if (model.spDate != null && !string.IsNullOrEmpty(model.spDate.ToString()))
+ {
+ if (DateTime.TryParse(model.spDate.ToString(), out DateTime parsedSpDate))
+ {
+ spDate = parsedSpDate;
+ }
+ }
+
+ // 鏋勫缓瀛愯〃1鏁版嵁瀛楃涓�
+ var _sb1 = new StringBuilder();
+ var _split = "|";
+ foreach (var m in model.list1)
+ {
+ string _guid = m.Guid.ToString();
+ var _line = m.RPB001 + _split
+ + m.RPB003 + _split
+ + m.RPB004 + _split
+ + m.RPB005 + _split
+ + m.RPB006 + _split
+ + m.RPB007 + _split
+ + m.RPB008 + _split
+ + m.RPB009 + _split
+ + m.RPB010 + _split
+ + m.RPB011 + _split
+ + m.RPB012 + _split
+ + m.RPB013 + _split
+ + m.RPB014 + _split
+ + m.RPB015 + _split
+ + m.RPB016 + _split
+ + m.RPB017 + _split
+ + m.RPB018 + _split
+ + m.RPB019 + _split
+ + m.Remark + _split
+ + (CheckGuid(_guid) ? _guid : Guid.Empty.ToString());
+ if (_sb1.Length > 0)
+ _sb1.Append("~");
+ _sb1.Append(_line);
+ }
+
+ // 鏋勫缓瀛愯〃2鏁版嵁瀛楃涓�
+ var _sb2 = new StringBuilder();
+ foreach (var m in model.list2)
+ {
+ string _guid = m.Guid.ToString();
+ var _line = m.Seq + _split
+ + m.Description + _split
+ + m.AClass + _split
+ + m.BClass + _split
+ + m.CClass + _split
+ + m.Point + _split
+ + m.Remark + _split
+ + (CheckGuid(_guid) ? _guid : Guid.Empty.ToString());
+ if (_sb2.Length > 0)
+ _sb2.Append("~");
+ _sb2.Append(_line);
+ }
+
+ dynamic mObj = new ExpandoObject();
+ mObj.outMsg = "";
+ mObj.outSum = -1;
+ mObj.outGuid = "";
+ mObj.outNo = "";
+
+ using (var conn = new SqlConnection(DbHelperSQL.strConn))
+ {
+ using (var cmd = new SqlCommand("[prc_fqc_items_edt]", conn))
+ {
+ try
+ {
+ conn.Open();
+ cmd.CommandType = CommandType.StoredProcedure;
+ SqlParameter[] parameters =
+ {
+ new("@outMsg", SqlDbType.NVarChar, 300),
+ new("@outSum", SqlDbType.Int),
+ new("@outGuid", SqlDbType.UniqueIdentifier),
+ new("@outNo", SqlDbType.NVarChar, 300),
+ new("@inOrderGuid", CheckGuid(guid) ? guid : DBNull.Value),
+ new("@inFQCNo", fqcNo),
+ new("@inWorkShop", workShop),
+ new("@inItemName", itemName),
+ new("@inItemModel", itemModel),
+ new("@inBrand", brand),
+ new("@inProductionDate", productionDate.HasValue ? (object)productionDate.Value : DBNull.Value),
+ new("@inAcRe_A", acRe_A),
+ new("@inAcRe_B", acRe_B),
+ new("@inAcRe_C", acRe_C),
+ new("@inSampleMethod", sampleMethod),
+ new("@inSampleSize1", sampleSize1),
+ new("@inSampleSize2", sampleSize2),
+ new("@inSampleSize3", sampleSize3),
+ new("@inTemperature", temperature),
+ new("@inVoltage", voltage),
+ new("@inClasses", classes),
+ new("@inLineNo", lineNo),
+ new("@inBatch", batch),
+ new("@inCheckResult", checkResult),
+ new("@inProcessResults", processResults),
+ // 娣诲姞妫�楠屼汉銆佸鏍镐汉銆佸鎵逛汉鍙婂搴旂殑鏃ユ湡鍙傛暟
+ new("@inJyUser", jyUser),
+ new("@inCheckUser", checkUser),
+ new("@inSpUser", spUser),
+ new("@inJyDate", jyDate.HasValue ? (object)jyDate.Value : DBNull.Value),
+ new("@inCheckDate", checkDate.HasValue ? (object)checkDate.Value : DBNull.Value),
+ new("@inSpDate", spDate.HasValue ? (object)spDate.Value : DBNull.Value),
+ new("@inEdtUserGuid", _userGuid),
+ new("@inDetail1List", _sb1.ToString()),
+ new("@inDetail2List", _sb2.ToString())
+ };
+ parameters[0].Direction = ParameterDirection.Output;
+ parameters[1].Direction = ParameterDirection.Output;
+ parameters[2].Direction = ParameterDirection.Output;
+ parameters[3].Direction = ParameterDirection.Output;
+ foreach (var parameter in parameters)
+ cmd.Parameters.Add(parameter);
+ cmd.ExecuteNonQuery();
+ mObj.outMsg = parameters[0].Value.ToString();
+ mObj.outSum = int.Parse(parameters[1].Value.ToString());
+ mObj.outGuid = parameters[2].Value.ToString();
+ mObj.outNo = parameters[3].Value.ToString();
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(),
+ "prc_fqc_items_edt error锛�" + ex.Message);
+ mObj.outMsg = ex.Message;
+ mObj.outSum = -1;
+ }
+ finally
+ {
+ conn.Close();
+ }
+ }
+ }
+ if (mObj.outSum <= 0)
+ return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Exception, mObj.outMsg);
+ return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Success, mObj.outMsg);
+ }
+
+ /// <summary>
+ /// 鍒犻櫎涓昏〃鍙婃槑缁�
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<int?> DeleteModel([FromBody] dynamic model)
+ {
+ int? rtnInt = (int)ReturnCode.Default;
+ Guid? guid = model.guid;
+ var _outMsg = "";
+ var _outSum = -1;
+ try
+ {
+ if (CheckGuid(guid))
+ {
+ string sql = $@"
+ DELETE FROM MES_FQC_ITEM_DETAIL1 WHERE PID='{guid}';
+ DELETE FROM MES_FQC_ITEM_DETAIL2 WHERE PID='{guid}';
+ DELETE FROM MES_FQC_ITEMS WHERE GUID='{guid}';";
+ _outSum = DbHelperSQL.ExecuteSql(sql);
+ _outMsg = _outSum > 0 ? "鍒犻櫎鎴愬姛锛�" : "鏈垹闄や换浣曟暟鎹�";
+ }
+ else
+ {
+ _outMsg = "涓婚敭涓嶈兘涓虹┖锛�";
+ _outSum = -1;
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), "DeleteModel error锛�" + ex.Message);
+ _outMsg = ex.Message;
+ _outSum = -1;
+ }
+ if (_outSum <= 0)
+ return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Exception, _outMsg);
+ return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Success, _outMsg);
+ }
+
+
+ /// <summary>
+ /// 鎴愬搧妫�楠屾姤琛�
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<PageList<dynamic>> GetCPMX([FromBody] dynamic model)
+ {
+ int currentPage = model.currentPage;
+ int everyPageSize = model.everyPageSize;
+ string sortName = model.sortName;
+ string keyWhere = model.keyWhere;
+ SqlParameter[] parameters =
+ {
+ new("@inCurrentPage", currentPage),
+ new("@inEveryPageSize", everyPageSize),
+ new("@inSortName", sortName),
+ new("@inSortOrder", ""),
+ new("@inQueryWhere", keyWhere),
+ };
+ var dset = new DataSet();
+ var _pglist = new PageList<dynamic>
+ {
+ total = 0,
+ everyPageSize = 0,
+ pages = 0,
+ list = new List<dynamic>()
+ };
+ try
+ {
+ dset = DbHelperSQL.RunProcedure("report_cprkjd", parameters, "0");
+ if (dset != null && dset.Tables.Count > 0 &&
+ dset.Tables[0].Rows.Count > 0) //鏈夋暟鎹�
+ {
+ var intTotal =
+ int.Parse(dset.Tables[1].Rows[0]["intTotal"].ToString());
+ var pages = intTotal % everyPageSize != 0
+ ? intTotal / everyPageSize + 1
+ : intTotal / everyPageSize;
+ _pglist.total = intTotal;
+ _pglist.everyPageSize = everyPageSize;
+ _pglist.pages = pages;
+ var _dy = dset.Tables[0].TableToDynamicList();
+ _pglist.list = _dy;
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), ex.Message);
+ }
+
+ return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
+ ReturnCode.Success, "璇诲彇鎴愬姛");
+ }
+
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<ExpandoObject> GetCPMXDetail([FromBody] dynamic model)
+ {
+ dynamic m = new ExpandoObject();
+ m.list = new List<dynamic>();
+
+ string daa001 = model.daa001;
+ SqlParameter[] parameters =
+ {
+ new("@daa001", daa001)
+ };
+ try
+ {
+ var dsMain = DbHelperSQL.RunProcedure("report_cprkjdDetail", parameters, "0");
+ if (dsMain != null && dsMain.Tables.Count > 0 && dsMain.Tables[0].Rows.Count > 0)
+ {
+
+ m.list = dsMain.Tables[0].TableToDynamicList();
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), ex.Message);
+ }
+ if (m != null)
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "璇诲彇鎴愬姛锛�");
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, "璇诲彇澶辫触锛�");
+ }
+ }
+}
diff --git a/WebApi/GS.QC/Service/FqcManager.cs b/WebApi/GS.QC/Service/FqcManager.cs
index fe238a4..2c084ac 100644
--- a/WebApi/GS.QC/Service/FqcManager.cs
+++ b/WebApi/GS.QC/Service/FqcManager.cs
@@ -506,59 +506,7 @@
ReturnCode.Success, "璇诲彇鎴愬姛");
}
- /// <summary>
- /// 璐ㄩ噺锛屽鏍革紝鍙嶅鏍革紝椹冲洖
- /// </summary>
- /// <param name="mode"></param>
- /// <returns></returns>
- [RequestMethod(RequestMethods.POST)]
- public ReturnDto<ExpandoObject> EditModelSubmitZhiLiang([FromBody] dynamic mode)
- {
- string _guid = mode.guid;
- string _inFieldValue = mode.inFieldValue;
- dynamic m = new ExpandoObject();
- m.outSum = -1;
- m.outMsg = "";
- using (var conn = new SqlConnection(DbHelperSQL.strConn))
- {
- using (var cmd = new SqlCommand("fqc_zhiLiang", conn))
- {
- try
- {
- conn.Open();
- cmd.CommandType = CommandType.StoredProcedure;
- SqlParameter[] parameters =
- {
- new("@outMsg", SqlDbType.NVarChar, 300),
- new("@outSum", SqlDbType.Int),
- new("@inEdtUserGuid", _userGuid),
- new("@inOrderGuid", _guid),
- new("@inFieldValue",_inFieldValue),
- new("@in1", ""),
- new("@in2", "")
- };
- parameters[0].Direction = ParameterDirection.Output;
- parameters[1].Direction = ParameterDirection.Output;
- foreach (var parameter in parameters)
- cmd.Parameters.Add(parameter);
- cmd.ExecuteNonQuery();
- m.outMsg = parameters[0].Value.ToString();
- m.outSum = int.Parse(parameters[1].Value.ToString());
- }
- catch (Exception ex)
- {
- LogHelper.Debug(this.ToString(), "fqc_zhiLiang error锛�" + ex.Message);
- return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, ex.Message);
- }
- finally
- {
- conn.Close();
- }
- }
- }
- return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "鎿嶄綔鎴愬姛锛�");
- }
-
+
/// <summary>
/// 璇诲彇
@@ -661,7 +609,62 @@
return GetModel14(dy);
}
-
+ /// <summary>
+ /// 鐢熸垚鎶ュ憡
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<int?> GetBaoGao([FromBody] dynamic model)
+ {
+ int? rtnInt = (int)ReturnCode.Default;
+ Guid? guid = model.guid;
+ var _outMsg = "";
+ var _outSum = -1;
+ using (var conn = new SqlConnection(DbHelperSQL.strConn))
+ {
+ using (var cmd = new SqlCommand("[prc_fqc_items_add]", conn))
+ {
+ try
+ {
+ conn.Open();
+ cmd.CommandType = CommandType.StoredProcedure;
+ SqlParameter[] parameters =
+ {
+ new("@outMsg", SqlDbType.NVarChar, 300),
+ new("@outSum", SqlDbType.Int),
+ new("@inOrderGuid",
+ UtilityHelper.CheckGuid(guid)
+ ? guid
+ : DBNull.Value),
+ new("@inEdtUserGuid", _userGuid),
+ };
+ parameters[0].Direction = ParameterDirection.Output;
+ parameters[1].Direction = ParameterDirection.Output;
+ foreach (var parameter in parameters)
+ cmd.Parameters.Add(parameter);
+ cmd.ExecuteNonQuery();
+ _outMsg = parameters[0].Value.ToString();
+ _outSum = int.Parse(parameters[1].Value.ToString());
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(),
+ "prc_QT_del error锛�" + ex.Message);
+ _outMsg = ex.Message;
+ _outSum = -1;
+ }
+ finally
+ {
+ conn.Close();
+ }
+ }
+ }
+ if (_outSum <= 0)
+ return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Exception,
+ _outMsg);
+ return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Success, _outMsg);
+ }
#region 鎻愪氦妫�楠�
/// <summary>
@@ -673,6 +676,7 @@
public ReturnDto<ExpandoObject> EditModelSubmit([FromBody] dynamic mode)
{
string _guid = mode.guid;
+ string _inFieldValue = mode.inFieldValue;
dynamic m = new ExpandoObject();
m.outSum = -1;
m.outMsg = "";
@@ -690,7 +694,7 @@
new("@outSum", SqlDbType.Int),
new("@inEdtUserGuid", _userGuid),
new("@inOrderGuid", _guid),
- new("@inFieldValue", 1),
+ new("@inFieldValue", _inFieldValue),
new("@in1", ""),
new("@in2", "")
};
diff --git a/WebApi/GS.QC/Service/IpqcShouManager.cs b/WebApi/GS.QC/Service/IpqcShouManager.cs
index 78cd33b..225158f 100644
--- a/WebApi/GS.QC/Service/IpqcShouManager.cs
+++ b/WebApi/GS.QC/Service/IpqcShouManager.cs
@@ -1,13 +1,15 @@
-锘縰sing System.Data;
-using System.Data.SqlClient;
-using System.Dynamic;
-using System.Text;
-using Gs.Toolbox;
+锘縰sing Gs.Toolbox;
using Gs.Toolbox.ApiCore.Abstract.Mvc;
using Gs.Toolbox.ApiCore.Common.Mvc;
using Gs.Toolbox.ApiCore.Group;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using System.Data;
+using System.Data.SqlClient;
+using System.Dynamic;
+using System.Text;
using static Gs.Toolbox.UtilityHelper;
namespace GS.QC.Service
@@ -24,7 +26,6 @@
(_userCode, _userGuid, _orgFids) =
GetUserGuidAndOrgGuid(_http);
}
-
/// <summary>
/// 璇诲彇鍒楄〃锛屾敮鎸佸垎椤�
@@ -88,7 +89,7 @@
}
/// <summary>
- /// 璇诲彇
+ /// 璇诲彇瀹炰綋
/// </summary>
/// <param name="guid"></param>
/// <returns></returns>
@@ -168,5 +169,271 @@
return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default,
"璇诲彇澶辫触锛�");
}
+
+ /// <summary>
+ /// 璇诲彇web瀹炰綋
+ /// </summary>
+ /// <param name="guid"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<ExpandoObject> GetModelWeb([FromBody] dynamic model)
+ {
+ string guid = model.guid.ToString();
+ dynamic m = new ExpandoObject();
+ SqlParameter[] parameters =
+ {
+ new("@inMainGuid", guid),
+ new("@inP1", ""),
+ new("@inP2", ""),
+ new("@inP3", ""),
+ new("@inP4", "")
+ };
+ var dset = new DataSet();
+ try
+ {
+ dset = DbHelperSQL.RunProcedure("[ipqc_shou_get_web]", parameters, "0");
+ if (dset != null && dset.Tables.Count > 0 &&
+ dset.Tables[0].Rows.Count > 0)
+ {
+ var dr = dset.Tables[0].Rows[0];
+ m = dr.RowToDynamic();
+ m.list = new List<dynamic>();
+ DataTable dtDistinct = (new DataView(dset.Tables[1])).ToTable(true, new string[] { "groupName" });
+ foreach (DataRow DataRow in dtDistinct.Rows)
+ {
+ dynamic _obj = new System.Dynamic.ExpandoObject();
+ _obj.groupName = DataRow["groupName"].ToString();
+ _obj.child = new List<dynamic>();
+ DataRow[] _dtRows = dset.Tables[1].Select("groupName='" + _obj.groupName.ToString() + "'");
+ if (_dtRows.Length == 0)
+ continue;
+ foreach (DataRow _row in _dtRows)
+ {
+ dynamic _dy = _row.RowToDynamic();
+ if (_obj.groupName.ToString() == "鍒剁儹鎬ц兘")
+ {
+ //姘存俯閫夋嫨
+ if (!string.IsNullOrEmpty(_row["ipqc_zrxn_sel1"].ToString()))
+ _dy.selectedWater = JsonConvert.DeserializeObject(_row["ipqc_zrxn_sel1"].ToString());
+ else
+ _dy.selectedWater = Array.Empty<string>();
+ //娴侀噺閫夋嫨
+ if (!string.IsNullOrEmpty(_row["ipqc_zrxn_sel2"].ToString()))
+ _dy.selectedFlow = JsonConvert.DeserializeObject(_row["ipqc_zrxn_sel2"].ToString());
+ else
+ _dy.selectedFlow = Array.Empty<string>();
+ //琛ㄦ牸鏁版嵁
+ if (!string.IsNullOrEmpty(_row["ipqc_zrxn_table"].ToString()))
+ _dy.selecteTable = JsonConvert.DeserializeObject(_row["ipqc_zrxn_table"].ToString());
+ else
+ _dy.selecteTable = new { };
+ }
+ _obj.child.Add(_dy);
+ }
+ m.list.Add(_obj);
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), ex.Message);
+ }
+ if (m != null)
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success,
+ "璇诲彇鎴愬姛锛�");
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, "璇诲彇澶辫触锛�");
+ }
+
+ /// <summary>
+ /// 璁剧疆
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<int?> SetModelWeb([FromBody] dynamic model)
+ {
+ string guid = model.guid;
+ string strSql = model.strSql;
+ string ziduan = model.ziduan;
+ int? rtnInt = (int)ReturnCode.Default;
+ try
+ {
+ System.Text.StringBuilder sbSql = new StringBuilder();
+ if (ziduan == "bpwym" || ziduan == "sjwym" || ziduan == "sjtxm")
+ sbSql.Append("update dbo.MES_QA_ITEMS_DETECT_01 set " + strSql + " where guid='" + guid + "'");
+ else
+ sbSql.Append("update dbo.MES_QA_ITEMS_DETECT_DETAIL5 set " + strSql + " where guid='" + guid + "'");
+ rtnInt = DbHelperSQL.ExecuteSql(sbSql.ToString());
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(this.ToString(), "SetModelWeb error锛�" + ex.Message);
+ rtnInt = (int)ReturnCode.Exception;
+ }
+ if (rtnInt > 0)
+ return ReturnDto<int>.QuickReturn(default(int?), ReturnCode.Success, "鎿嶄綔鎴愬姛!");
+ else
+ return ReturnDto<int>.QuickReturn(default(int?), ReturnCode.Exception, "鎿嶄綔澶辫触锛岃閲嶈瘯锛�");
+ }
+
+
+ /// <summary>
+ /// 鎻愪氦妫�楠�
+ /// </summary>
+ /// <param name="mode"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<ExpandoObject> EditModelSubmit([FromBody] dynamic mode)
+ {
+ string _guid = mode.guid;
+ string _inFieldValue = mode.submitType;
+ dynamic m = new ExpandoObject();
+ m.outSum = -1;
+ m.outMsg = "";
+ using (var conn = new SqlConnection(DbHelperSQL.strConn))
+ {
+ using (var cmd = new SqlCommand("ipqc_shou_submit", conn))
+ {
+ try
+ {
+ conn.Open();
+ cmd.CommandType = CommandType.StoredProcedure;
+ SqlParameter[] parameters =
+ {
+ new("@outMsg", SqlDbType.NVarChar, 300),
+ new("@outSum", SqlDbType.Int),
+ new("@inEdtUserGuid", _userGuid),
+ new("@inOrderGuid", _guid),
+ new("@inFieldValue", _inFieldValue),
+ new("@in1", ""),
+ new("@in2", "")
+ };
+ parameters[0].Direction = ParameterDirection.Output;
+ parameters[1].Direction = ParameterDirection.Output;
+ foreach (var parameter in parameters)
+ cmd.Parameters.Add(parameter);
+ cmd.ExecuteNonQuery();
+ m.outMsg = parameters[0].Value.ToString();
+ m.outSum = int.Parse(parameters[1].Value.ToString());
+ }
+ catch (Exception ex)
+ {
+ m.outMsg = ex.Message;
+ LogHelper.Debug(this.ToString(), "ipqc_shou_submit error锛�" + ex.Message);
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, ex.Message);
+ }
+ finally
+ {
+ conn.Close();
+ }
+ }
+ }
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "鎿嶄綔鎴愬姛锛�");
+ }
+
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<int?> UpdateTableConfig([FromBody] dynamic model)
+ {
+ string guid = model.guid;
+ string mxguid = model.mxguid;
+ JArray arrayWater = model.selectedWater;
+ JArray arrayFlow = model.selectedFlow;
+ JObject arrayTable = model.selectedTable;
+ string selectedWater = arrayWater.ToString();
+ string selectedFlow = arrayFlow.ToString();
+ System.Text.StringBuilder tableData = new StringBuilder();
+ tableData.Append("{");
+ foreach (JValue jsonitem in arrayWater)
+ {
+ string jv = jsonitem.ToString().Trim();
+ var _temp = arrayTable[jv]["temp"];
+ if (tableData.Length > 2)
+ tableData.Append(",");
+ tableData.Append("'" + jv + "':");
+ tableData.Append("{");
+ tableData.Append("'temp':'" + _temp + "'");
+ foreach (JValue volume in arrayFlow)
+ {
+ var _temp2 = arrayTable[jv][volume.ToString().Trim()];
+ tableData.Append(",'" + volume.ToString().Trim() + "':'" + _temp2 + "'");
+ }
+ tableData.Append("}");
+ }
+ tableData.Append("}");
+ int? rtnInt = (int)ReturnCode.Default;
+ try
+ {
+ System.Text.StringBuilder sbSql = new StringBuilder();
+ sbSql.Append("UPDATE MES_QA_ITEMS_DETECT_DETAIL5 SET ipqc_zrxn_sel1 = @selectedWater,ipqc_zrxn_sel2 = @selectedFlow, ipqc_zrxn_table = @tableData WHERE guid = @mxguid");
+ rtnInt = Gs.Toolbox.DbHelperSQL.ExecuteSql(sbSql.ToString(), new SqlParameter[] {
+ new SqlParameter("@selectedWater", selectedWater),
+ new SqlParameter("@selectedFlow", selectedFlow),
+ new SqlParameter("@tableData", tableData.ToString()),
+ new SqlParameter("@mxguid", mxguid),
+ });
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(this.ToString(), "SetModelWeb error锛�" + ex.Message);
+ rtnInt = (int)ReturnCode.Exception;
+ }
+ if (rtnInt > 0)
+ return ReturnDto<int>.QuickReturn(default(int?), ReturnCode.Success, "鎿嶄綔鎴愬姛!");
+ else
+ return ReturnDto<int>.QuickReturn(default(int?), ReturnCode.Exception, "鎿嶄綔澶辫触锛岃閲嶈瘯锛�");
+ }
+
+ /// <summary>
+ /// 璇诲彇
+ /// </summary>
+ /// <param name="guid"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<ExpandoObject> GetModelWebMx([FromBody] dynamic model)
+ {
+ string mxGuid = model.mxGuid.ToString();
+ dynamic m = new ExpandoObject();
+ var dset = new DataSet();
+ try
+ {
+ System.Text.StringBuilder sbSql = new StringBuilder();
+ sbSql.Append("select * from [dbo].[MES_QA_ITEMS_DETECT_DETAIL5] where guid='" + mxGuid + "'");
+ dset = DbHelperSQL.Query(sbSql.ToString());
+ if (dset != null && dset.Tables.Count > 0 &&
+ dset.Tables[0].Rows.Count > 0)
+ {
+ var _row = dset.Tables[0].Rows[0];
+ //姘存俯閫夋嫨
+ if (!string.IsNullOrEmpty(_row["ipqc_zrxn_sel1"].ToString()))
+ m.selectedWater = JsonConvert.DeserializeObject(_row["ipqc_zrxn_sel1"].ToString());
+ else
+ m.selectedWater = Array.Empty<string>();
+ //娴侀噺閫夋嫨
+ if (!string.IsNullOrEmpty(_row["ipqc_zrxn_sel2"].ToString()))
+ m.selectedFlow = JsonConvert.DeserializeObject(_row["ipqc_zrxn_sel2"].ToString());
+ else
+ m.selectedFlow = Array.Empty<string>();
+ //琛ㄦ牸鏁版嵁
+ if (!string.IsNullOrEmpty(_row["ipqc_zrxn_table"].ToString()))
+ m.selecteTable = JsonConvert.DeserializeObject(_row["ipqc_zrxn_table"].ToString());
+ else
+ m.selecteTable = new { };
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), ex.Message);
+ }
+ if (m != null)
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success,
+ "璇诲彇鎴愬姛锛�");
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, "璇诲彇澶辫触锛�");
+ }
+
}
}
diff --git a/WebApi/GS.QC/Service/MesDefectCodeManager.cs b/WebApi/GS.QC/Service/MesDefectCodeManager.cs
index d305cfa..9dcf208 100644
--- a/WebApi/GS.QC/Service/MesDefectCodeManager.cs
+++ b/WebApi/GS.QC/Service/MesDefectCodeManager.cs
@@ -35,49 +35,33 @@
/// <param name="query"></param>
/// <returns></returns>
[RequestMethod(RequestMethods.POST)]
- /// <summary>
- /// 鍒嗛〉鏌ヨ缂洪櫡浠g爜鍒楄〃鏁版嵁
- /// </summary>
- /// <param name="query">鍒嗛〉鏌ヨ鍙傛暟瀵硅薄锛堝寘鍚〉鐮併�佹瘡椤垫潯鏁般�佹帓搴忋�佹煡璇㈡潯浠剁瓑锛�</param>
- /// <returns>鍖呭惈鍒嗛〉鏁版嵁鐨勮繑鍥炵粨鏋滐紙鏁版嵁鍒楄〃銆佹�绘潯鏁扮瓑锛�</returns>
public ReturnDto<PageList<MesDefectCode>> GetListPage(PageQuery query)
{
- // 鍒濆鍖栧垎椤电粨鏋滃璞★紙榛樿绌哄垪琛紝鍚庣画浼氬~鍏呮暟鎹級
var pageList = new PageList<MesDefectCode>();
try
{
- // 1. 鏋勫缓鏌ヨ鏉′欢锛圵HERE瀛愬彞锛�
- // "1=1" 鏄竾鑳芥潯浠讹紙閬垮厤鍚庣画鎷兼帴鏉′欢鏃堕渶瑕佸垽鏂槸鍚﹀姞AND锛夛紝鎷兼帴鏌ヨ鍙傛暟涓殑鑷畾涔夋潯浠讹紙query.keyWhere锛�
var _sbWhere = new StringBuilder(" 1=1" + query.keyWhere);
-
- // 2. 鏋勫缓鎺掑簭鏉′欢锛圤RDER BY瀛愬彞锛�
- // 鎷兼帴鎺掑簭瀛楁锛坬uery.sortName锛夊拰鎺掑簭鏂瑰悜锛坬uery.sortOrder锛屽"ASC"鍗囧簭銆�"DESC"闄嶅簭锛�
- var _sbBy = new StringBuilder(query.sortName + " " + query.sortOrder);
-
- // 3. 澹版槑鎬昏褰曟暟鍙橀噺锛堢敤浜庢帴鏀舵煡璇㈢粨鏋滅殑鎬绘潯鏁帮級
+ var _sbBy =
+ new StringBuilder(query.sortName + " " + query.sortOrder);
var totalCount = 0;
-
- // 4. 鎵ц鍒嗛〉鏌ヨ
- // 浣跨敤鏁版嵁搴撹闂伐鍏凤紙Db.Queryable锛夋煡璇esDefectCode琛紙鍒悕"a"锛�
var itemsList = Db.Queryable<MesDefectCode>("a")
- .Where(_sbWhere.ToString()) // 搴旂敤WHERE鏉′欢
- .OrderBy(_sbBy.ToString()) // 搴旂敤鎺掑簭鏉′欢
- // 鍒嗛〉鏌ヨ锛氬綋鍓嶉〉鐮侊紙query.currentPage锛夈�佹瘡椤垫潯鏁帮紙query.everyPageSize锛夛紝鎬绘潯鏁伴�氳繃ref鍙傛暟杩斿洖
- .ToPageList(query.currentPage, query.everyPageSize, ref totalCount);
+ .Where(_sbWhere.ToString())
+ .OrderBy(_sbBy.ToString())
+ .ToPageList(query.currentPage, query.everyPageSize,
+ ref totalCount);
- // 5. 缁勮鍒嗛〉缁撴灉瀵硅薄
- // 鍖呭惈褰撳墠椤垫暟鎹紙itemsList锛夈�佹�绘潯鏁帮紙totalCount锛夈�佹瘡椤垫潯鏁帮紙query.everyPageSize锛�
- pageList = new PageList<MesDefectCode>(itemsList, totalCount, query.everyPageSize);
-
- // 6. 杩斿洖鎴愬姛缁撴灉锛氬寘鍚垎椤垫暟鎹�佹垚鍔熺姸鎬佺爜銆佹彁绀轰俊鎭�
- return ReturnDto<PageList<MesDefectCode>>.QuickReturn(pageList, ReturnCode.Success, "璇诲彇鎴愬姛");
+ pageList = new PageList<MesDefectCode>(itemsList, totalCount,
+ query.everyPageSize);
+ return ReturnDto<PageList<MesDefectCode>>.QuickReturn(pageList,
+ ReturnCode.Success, "璇诲彇鎴愬姛");
}
catch (Exception ex)
{
- // 鎹曡幏寮傚父鏃讹紝杩斿洖绌哄垎椤电粨鏋溿�侀粯璁ら敊璇爜銆佸紓甯镐俊鎭�
- return ReturnDto<PageList<MesDefectCode>>.QuickReturn(pageList, ReturnCode.Default, ex.Message);
+ return ReturnDto<PageList<MesDefectCode>>.QuickReturn(pageList,
+ ReturnCode.Default, ex.Message);
}
}
+
/// <summary>
/// 璇诲彇
/// </summary>
@@ -256,10 +240,17 @@
sbSql.Append(" left join [dbo].[SYS_ORGANIZATION] org on org.FID=f.FSubsidiary");
sbSql.Append(" where 1=1 and bind.userGuid='" + guid + "' and bind.fType='鍛樺伐鍒嗗尯'");
sbSql.Append(" select bind.guid,bind.fType ,f.item_id,f.item_no,f.item_name,org.NAME as orgName,q.defect_name");
- sbSql.Append(" from [dbo].[SYS_USER_BIND] bind left join MES_ITEMS f on bind.aboutGuid=f.guid");
+ sbSql.Append(" from [dbo].[SYS_USER_BIND] bind left join MES_ITEMS f on bind.aboutGuid=f.item_id");
sbSql.Append(" left join [dbo].[MES_DEFECT_CODE] q on bind.userGuid=q.guid");
sbSql.Append(" left join [dbo].[SYS_ORGANIZATION] org on org.FID=f.FSubsidiary");
sbSql.Append(" where 1=1 and bind.userGuid='" + guid + "' and bind.fType='鐗╂枡鍒嗗尯'");
+ sbSql.Append(" select bind.guid,bind.fType ,u.depot_section_code,u.depot_section_name");
+ sbSql.Append(" ,org.NAME as orgName ,q.defect_name from [dbo].[SYS_USER_BIND] bind ");
+ sbSql.Append(" left join MES_DEPOT_SECTIONS u on bind.aboutGuid=u.depot_section_code ");
+ sbSql.Append(" left join MES_DEPOTS f on u.depot_guid=f.depot_id");
+ sbSql.Append(" left join [dbo].[MES_DEFECT_CODE] q on bind.userGuid=q.guid ");
+ sbSql.Append(" left join [dbo].[SYS_ORGANIZATION] org on org.FID=f.FSubsidiary ");
+ sbSql.Append(" where 1=1 and bind.userGuid='" + guid + "' and bind.fType='搴撲綅'");
try
{
dset = DbHelperSQL.Query(sbSql.ToString());
@@ -272,6 +263,8 @@
m.list = _tb;
var _tb2 = dset.Tables[2].TableToDynamicList();
m.list2 = _tb2;
+ var _tb3 = dset.Tables[3].TableToDynamicList();
+ m.list3 = _tb3;
}
}
catch (Exception ex)
diff --git a/WebApi/GS.QC/Service/MesQaItemsDetect01Manager.cs b/WebApi/GS.QC/Service/MesQaItemsDetect01Manager.cs
index 6239f75..1c1a94a 100644
--- a/WebApi/GS.QC/Service/MesQaItemsDetect01Manager.cs
+++ b/WebApi/GS.QC/Service/MesQaItemsDetect01Manager.cs
@@ -300,7 +300,7 @@
{
Guid? guid = model.guid; //鍒拌揣鍗曚富閿�
string fngDesc = model.fngDesc; //澶囨敞
- string fhandle = model.fhandle; //澶囨敞
+ string ckId=model.ckId;
var _outMsg = "";
var _outSum = -1;
using (var conn = new SqlConnection(DbHelperSQL.strConn))
@@ -318,7 +318,7 @@
new("@inEdtUserGuid", _userGuid),
new("@inOrderGuid", UtilityHelper.CheckGuid(guid) ? guid: DBNull.Value),
new("@fngDesc", fngDesc),
- new("@fhandle", fhandle),
+ new("@ckId", ckId),
};
parameters[0].Direction = ParameterDirection.Output;
parameters[1].Direction = ParameterDirection.Output;
diff --git a/WebApi/GS.QC/Service/MesQaMjManager.cs b/WebApi/GS.QC/Service/MesQaMjManager.cs
index 2449da8..2de656b 100644
--- a/WebApi/GS.QC/Service/MesQaMjManager.cs
+++ b/WebApi/GS.QC/Service/MesQaMjManager.cs
@@ -127,25 +127,13 @@
}
try
{
- // ===== 鏂板锛氱畝鍖栫殑鍏嶆缁存姢鏍¢獙閫昏緫 =====
- var validationResult = ValidateItemMaintenance(model);
- if (!validationResult.IsSuccess)
- {
- return ReturnDto<string>.QuickReturn("", ReturnCode.Default, validationResult.Message);
- }
-
- // ===== 淇敼锛氱粍缁囦竴鑷存�ф牎楠岋紙浠呭湪鏈変緵搴斿晢鏃惰繘琛岋級 =====
- // 褰撴病鏈夌淮鎶や緵搴斿晢鏃讹紙鍏ㄥ厤妫�锛夛紝璺宠繃缁勭粐鏍¢獙
- if (!string.IsNullOrEmpty(model.SuppId))
- {
- string supOrg = "", itemOrg = "";
- supOrg = Gs.Toolbox.DbHelperSQL.GetSingle("select top 1 FSubsidiary from MES_SUPPLIER a where a.id=" + model.SuppId.ToString()).ToString();
- itemOrg = Gs.Toolbox.DbHelperSQL.GetSingle("select top 1 FSubsidiary from MES_ITEMS a where a.id=" + model.ItemId.ToString()).ToString();
- if (supOrg != itemOrg)
- {
- return ReturnDto<string>.QuickReturn("",
- ReturnCode.Default, "渚涘簲鍟嗗拰鐗╂枡涓嶅湪鍚屼竴缁勭粐涓嬶紝璇烽噸鏂伴�夋嫨锛�");
- }
+ //闃插憜鏄笉鏄睘浜庡悓涓�缁勭粐
+ string supOrg = "", itemOrg = "";
+ supOrg = Gs.Toolbox.DbHelperSQL.GetSingle("select top 1 FSubsidiary from MES_SUPPLIER a where a.id="+model.SuppId.ToString()).ToString();
+ itemOrg = Gs.Toolbox.DbHelperSQL.GetSingle("select top 1 FSubsidiary from MES_ITEMS a where a.id=" + model.ItemId.ToString()).ToString();
+ if (supOrg != itemOrg) {
+ return ReturnDto<string>.QuickReturn("",
+ ReturnCode.Default, "渚涘簲鍟嗗拰鐗╂枡涓嶅湪鍚屼竴缁勭粐涓嬶紝璇烽噸鏂伴�夋嫨锛�");
}
Db.Ado.BeginTran();
if (!UtilityHelper.CheckGuid(model.Guid))
@@ -235,65 +223,5 @@
it.Guid == Guid.Parse(_guid) && it.Status == true)
.Count();
return cont;
- }
-
- /// <summary>
- /// ===== 鏂板鏂规硶锛氱畝鍖栫殑鍏嶆缁存姢鏍¢獙閫昏緫 =====
- /// 涓氬姟瑙勫垯锛堜簰鏂ュ師鍒欙級锛�
- /// 1. 鍏ㄥ厤妫�妯″紡锛氱墿鏂欎笉缁存姢渚涘簲鍟嗭紙SuppId涓虹┖锛夛紝琛ㄧず瀵规墍鏈変緵搴斿晢鍏嶆
- /// 2. 鎸囧畾鍏嶆妯″紡锛氱墿鏂欑淮鎶ょ壒瀹氫緵搴斿晢锛岃〃绀轰粎瀵规寚瀹氫緵搴斿晢鍏嶆
- /// 3. 涓ょ妯″紡涓嶈兘鍏卞瓨锛屼竴鏃﹂�夋嫨浜嗕竴绉嶆ā寮忥紝灏变笉鑳藉垏鎹㈠埌鍙︿竴绉嶆ā寮�
- /// 4. 鍚岀墿鏂�+鍚屼緵搴斿晢鐨勮褰曚笉鍏佽閲嶅
- /// </summary>
- /// <param name="model">瑕佷繚瀛樼殑鍏嶆璁板綍</param>
- /// <returns>鏍¢獙缁撴灉</returns>
- private (bool IsSuccess, string Message) ValidateItemMaintenance(MesQaMj model)
- {
- // 鏌ヨ褰撳墠鐗╂枡鐨勬墍鏈夊厤妫�璁板綍
- var query = Db.Queryable<MesQaMj>()
- .Where(x => x.ItemId == model.ItemId);
-
- // 濡傛灉鏄紪杈戞搷浣滐紝鎺掗櫎褰撳墠璁板綍閬垮厤璇垽
- if (UtilityHelper.CheckGuid(model.Guid))
- {
- query = query.Where(x => x.Guid != model.Guid);
- }
-
- var existingRecords = query.ToList();
- bool isCurrentGlobalMode = string.IsNullOrEmpty(model.SuppId); // 褰撳墠瑕佷繚瀛樼殑鏄惁涓哄叏鍏嶆妯″紡
-
- // 妫�鏌ョ幇鏈夎褰曠殑妯″紡
- var hasGlobalRecord = existingRecords.Any(x => string.IsNullOrEmpty(x.SuppId)); // 鏄惁宸叉湁鍏ㄥ厤妫�璁板綍
- var hasSpecificRecord = existingRecords.Any(x => !string.IsNullOrEmpty(x.SuppId)); // 鏄惁宸叉湁鎸囧畾渚涘簲鍟嗗厤妫�璁板綍
-
- if (isCurrentGlobalMode)
- {
- // 瑕佷繚瀛樺叏鍏嶆妯″紡
- if (hasGlobalRecord)
- {
- return (false, "璇ョ墿鏂欏凡瀛樺湪鍏ㄥ厤妫�璁板綍锛屼笉鑳介噸澶嶆坊鍔狅紒");
- }
- if (hasSpecificRecord)
- {
- return (false, "璇ョ墿鏂欏凡缁存姢浜嗘寚瀹氫緵搴斿晢鍏嶆锛屼笉鑳藉啀璁剧疆鍏ㄥ厤妫�妯″紡锛佽缁х画缁存姢鍏蜂綋渚涘簲鍟嗐��");
- }
- }
- else
- {
- // 瑕佷繚瀛樻寚瀹氫緵搴斿晢鍏嶆妯″紡
- if (hasGlobalRecord)
- {
- return (false, "璇ョ墿鏂欏凡璁剧疆涓哄叏鍏嶆妯″紡锛屼笉鑳藉啀娣诲姞鎸囧畾渚涘簲鍟嗗厤妫�璁板綍锛�");
- }
-
- // 妫�鏌ユ槸鍚︿笌鐜版湁鐨勬寚瀹氫緵搴斿晢璁板綍閲嶅
- var hasDuplicateSupplier = existingRecords.Any(x => x.SuppId == model.SuppId);
- if (hasDuplicateSupplier)
- {
- return (false, "璇ョ墿鏂欎笌璇ヤ緵搴斿晢鐨勫厤妫�璁板綍宸插瓨鍦紝涓嶈兘閲嶅娣诲姞锛�");
- }
- }
-
- return (true, ""); // 鏍¢獙閫氳繃
}
}
\ No newline at end of file
diff --git a/WebApi/GS.QC/Service/MesQcExceptionalManager.cs b/WebApi/GS.QC/Service/MesQcExceptionalManager.cs
index 2474328..2ef1c13 100644
--- a/WebApi/GS.QC/Service/MesQcExceptionalManager.cs
+++ b/WebApi/GS.QC/Service/MesQcExceptionalManager.cs
@@ -1,14 +1,12 @@
-锘縰sing Gs.Toolbox;
+锘縰sing System.Data;
+using System.Data.SqlClient;
+using System.Dynamic;
+using Gs.Toolbox;
using Gs.Toolbox.ApiCore.Abstract.Mvc;
using Gs.Toolbox.ApiCore.Common.Mvc;
using Gs.Toolbox.ApiCore.Group;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
-using Newtonsoft.Json.Linq;
-using System.Data;
-using System.Data.SqlClient;
-using System.Dynamic;
-using System.Text;
using static Gs.Toolbox.UtilityHelper;
namespace Gs.Wom.Service;
@@ -185,107 +183,6 @@
}
}
return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "鎿嶄綔鎴愬姛锛�");
- }
-
- /// <summary>
- /// 澧炲姞鎴栫紪杈戝疄浣�-浠呭鐞嗘槑缁嗘暟鎹殑缂栬緫鎿嶄綔
- /// </summary>
- /// <param name="model">鍖呭惈鏄庣粏鍒楄〃鐨勬ā鍨�</param>
- /// <returns>澶勭悊缁撴灉</returns>
- [RequestMethod(RequestMethods.POST)]
- public ReturnDto<ExpandoObject> EditModel([FromBody] dynamic model)
- {
- // 鍒濆鍖栧瓧绗︿覆鏋勫缓鍣ㄥ鐞嗘槑缁嗘暟鎹�
- Guid? guid = model.guid; //涓婚敭
- var _sb = new StringBuilder();
- var _split = "|"; // 瀛楁鍒嗛殧绗�
- var _lineSeparator = "~"; // 琛屽垎闅旂
-
- // 澶勭悊鏄庣粏鍒楄〃锛岃浆鎹负瀛樺偍杩囩▼鎵�闇�鏍煎紡
- foreach (var m in model.list)
- {
- // 鑾峰彇鏄庣粏椤逛富閿紙鍙负绌猴紝鏂板鏃朵负绌猴級
- string _guid = m.Guid?.ToString() ?? Guid.Empty.ToString();
-
-
- // 鎷兼帴鍗曡鏄庣粏鏁版嵁锛殀鐢宠鏁伴噺|澶囨敞|鏄庣粏GUID
- var _line = m.BatchQty + _split + m.GfRkqty + _split + m.LfRkqtyz + _split + m.HandResult + _split
- + m.ChooseType + _split + m.Process + _split
- + (UtilityHelper.CheckGuid(_guid) ? _guid : Guid.Empty.ToString());
-
- // 澶氭潯鏄庣粏闂存坊鍔犲垎闅旂
- if (_sb.Length > 0)
- _sb.Append(_lineSeparator);
- _sb.Append(_line);
- }
-
- // 鍑嗗杩斿洖缁撴灉瀵硅薄
- dynamic mObj = new ExpandoObject();
- mObj.outMsg = ""; // 鎿嶄綔娑堟伅
- mObj.outSum = -1; // 鎿嶄綔缁撴灉鐘舵�侊紙-1琛ㄧず澶辫触锛�
- mObj.outGuid = ""; // 鍙繚鐣欑敤浜庤繑鍥炴槑缁嗙浉鍏崇殑GUID
- mObj.outNo = ""; // 鍙繚鐣欑敤浜庤繑鍥炴槑缁嗙浉鍏崇殑缂栧彿
-
- // 璋冪敤瀛樺偍杩囩▼澶勭悊鏄庣粏鏁版嵁
- using (var conn = new SqlConnection(DbHelperSQL.strConn))
- {
- using (var cmd = new SqlCommand("[prc_Qcyc_edt]", conn)) // 寤鸿淇敼瀛樺偍杩囩▼鍚嶄负鏄庣粏涓撶敤
- {
- try
- {
- conn.Open();
- cmd.CommandType = CommandType.StoredProcedure;
-
- // 瀹氫箟瀛樺偍杩囩▼鍙傛暟锛堜粎淇濈暀涓庢槑缁嗙浉鍏崇殑鍙傛暟锛�
- SqlParameter[] parameters =
- {
- new("@outMsg", SqlDbType.NVarChar, 300), // 杈撳嚭锛氭搷浣滄秷鎭�
- new("@outSum", SqlDbType.Int), // 杈撳嚭锛氱粨鏋滅姸鎬侊紙>0琛ㄧず鎴愬姛锛�
- new("@outGuid", SqlDbType.UniqueIdentifier),// 杈撳嚭锛氬彲杩斿洖澶勭悊鍚庣殑鏄庣粏鍏宠仈ID
- new("@outNo", SqlDbType.NVarChar, 300), // 杈撳嚭锛氬彲杩斿洖鏄庣粏鐩稿叧缂栧彿
- new("@inOrderGuid",UtilityHelper.CheckGuid(guid)? guid : DBNull.Value),//涓昏〃GUID
- new("@inEdtUserGuid", _userGuid), // 杈撳叆锛氭搷浣滅敤鎴稧UID
- new("@inLineList", _sb.ToString()) // 杈撳叆锛氬鐞嗗悗鐨勬槑缁嗗瓧绗︿覆
- };
-
- // 璁剧疆杈撳嚭鍙傛暟鏂瑰悜
- parameters[0].Direction = ParameterDirection.Output;
- parameters[1].Direction = ParameterDirection.Output;
- parameters[2].Direction = ParameterDirection.Output;
- parameters[3].Direction = ParameterDirection.Output;
-
- // 娣诲姞鍙傛暟鍒板懡浠ゅ璞�
- foreach (var parameter in parameters)
- cmd.Parameters.Add(parameter);
-
- // 鎵ц瀛樺偍杩囩▼
- cmd.ExecuteNonQuery();
-
- // 浠庤緭鍑哄弬鏁拌幏鍙栫粨鏋�
- mObj.outMsg = parameters[0].Value?.ToString() ?? "澶勭悊鎴愬姛";
- mObj.outSum = int.TryParse(parameters[1].Value?.ToString(), out int sum) ? sum : -1;
- mObj.outGuid = parameters[2].Value?.ToString() ?? "";
- mObj.outNo = parameters[3].Value?.ToString() ?? "";
- }
- catch (Exception ex)
- {
- // 璁板綍寮傚父鏃ュ織
- LogHelper.Debug(ToString(), $"澶勭悊鏄庣粏鏃跺嚭閿欙細{ex.Message}");
- mObj.outMsg = ex.Message;
- mObj.outSum = -1;
- }
- finally
- {
- conn.Close();
- }
- }
- }
-
- // 鏍规嵁澶勭悊缁撴灉杩斿洖瀵瑰簲鐘舵��
- if (mObj.outSum <= 0)
- return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Exception, mObj.outMsg);
-
- return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Success, mObj.outMsg);
}
diff --git a/WebApi/GS.QC/Service/RkqcManager.cs b/WebApi/GS.QC/Service/RkqcManager.cs
index b740af2..7c424eb 100644
--- a/WebApi/GS.QC/Service/RkqcManager.cs
+++ b/WebApi/GS.QC/Service/RkqcManager.cs
@@ -8,10 +8,15 @@
using Microsoft.AspNetCore.Mvc;
using System.Dynamic;
using static Gs.Toolbox.UtilityHelper;
+using System.Text;
namespace GS.QC.Service
{
+
+ /// <summary>
+ /// 鍏跺畠鍏ュ簱妫�楠�
+ /// </summary>
[ApiGroup(ApiGroupNames.QC)]
public class RkqcManager : IRomteService
@@ -138,6 +143,8 @@
return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, "璇诲彇澶辫触锛�");
}
+
+
#endregion
}
}
\ No newline at end of file
diff --git a/WebApi/GS.QC/Service/RkqcSqManager.cs b/WebApi/GS.QC/Service/RkqcSqManager.cs
new file mode 100644
index 0000000..0d77dc1
--- /dev/null
+++ b/WebApi/GS.QC/Service/RkqcSqManager.cs
@@ -0,0 +1,414 @@
+锘縰sing System.Data;
+using System.Data.SqlClient;
+using System.Dynamic;
+using System.Text;
+using Gs.Toolbox;
+using Gs.Toolbox.ApiCore.Abstract.Mvc;
+using Gs.Toolbox.ApiCore.Common.Mvc;
+using Gs.Toolbox.ApiCore.Group;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using static Gs.Toolbox.UtilityHelper;
+
+namespace GS.QC.Service
+{
+
+ /// <summary>
+ /// 瓒呮湡妫�楠岀敵璇�
+ /// </summary>
+ [ApiGroup(ApiGroupNames.QC)]
+ public class RkqcSqManager : IRomteService
+ {
+ private readonly IHttpContextAccessor _http;
+ private readonly string _userCode, _userGuid, _orgFids;
+
+ public RkqcSqManager(IHttpContextAccessor httpContextAccessor)
+ {
+ _http = httpContextAccessor;
+ (_userCode, _userGuid, _orgFids) =
+ GetUserGuidAndOrgGuid(_http);
+ }
+
+ /// <summary>
+ /// 璇诲彇鍒楄〃锛屾敮鎸佸垎椤�
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<PageList<dynamic>> GetListPage([FromBody] dynamic model)
+ {
+ int currentPage = model.currentPage;
+ int everyPageSize = model.everyPageSize;
+ string sortName = model.sortName;
+ string keyWhere = model.keyWhere;
+ SqlParameter[] parameters =
+ {
+ new("@inCurrentPage", currentPage),
+ new("@inEveryPageSize", everyPageSize),
+ new("@inSortName", sortName),
+ new("@inSortOrder", ""),
+ new("@inQueryWhere", keyWhere),
+ new("@inFid", ""),
+ new("@inP1", ""),
+ new("@inP2", ""),
+ new("@inP3", ""),
+ new("@inP4", "")
+ };
+ var dset = new DataSet();
+ var _pglist = new PageList<dynamic>
+ {
+ total = 0,
+ everyPageSize = 0,
+ pages = 0,
+ list = new List<dynamic>()
+ };
+ try
+ {
+ dset = DbHelperSQL.RunProcedure("cqjy_lst", parameters, "0");
+ if (dset != null && dset.Tables.Count > 0 &&
+ dset.Tables[0].Rows.Count > 0) //鏈夋暟鎹�
+ {
+ var intTotal =
+ int.Parse(dset.Tables[1].Rows[0]["intTotal"].ToString());
+ var pages = intTotal % everyPageSize != 0
+ ? intTotal / everyPageSize + 1
+ : intTotal / everyPageSize;
+ _pglist.total = intTotal;
+ _pglist.everyPageSize = everyPageSize;
+ _pglist.pages = pages;
+ var _dy = dset.Tables[0].TableToDynamicList();
+ _pglist.list = _dy;
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), ex.Message);
+ return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
+ ReturnCode.Exception, ex.Message);
+ }
+ return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
+ ReturnCode.Success, "璇诲彇鎴愬姛");
+ }
+
+
+ /// <summary>
+ /// 璇诲彇
+ /// </summary>
+ /// <param name="guid"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<ExpandoObject> GetModel([FromBody] dynamic model)
+ {
+ string guid = model.guid.ToString();
+ dynamic m = new ExpandoObject();
+ m.list = new List<dynamic>();
+ m.list2 = new List<dynamic>();
+ SqlParameter[] parameters =
+ {
+ new("@inMainGuid", guid),
+ new("@inP1", ""),
+ new("@inP2", ""),
+ new("@inP3", ""),
+ new("@inP4", "")
+ };
+ var dset = new DataSet();
+ try
+ {
+ dset = DbHelperSQL.RunProcedure("[cqjy_mx]",
+ parameters, "0");
+ if (dset != null && dset.Tables.Count > 0 &&
+ dset.Tables[0].Rows.Count > 0)
+ {
+ var dr = dset.Tables[0].Rows[0];
+ m = dr.RowToDynamic();
+ var _tb = dset.Tables[1].TableToDynamicList();
+ m.list = _tb;
+ var _tb2 = dset.Tables[2].TableToDynamicList();
+ m.list2 = _tb2;
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), ex.Message);
+ }
+ if (m != null)
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success,
+ "璇诲彇鎴愬姛锛�");
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default,
+ "璇诲彇澶辫触锛�");
+ }
+
+
+ /// <summary>
+ /// 澧炲姞鎴栫紪杈戝疄浣�
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<ExpandoObject> EditModel([FromBody] dynamic model)
+ {
+ Guid? guid = model.Guid; //涓婚敭
+ string remark = model.Remark; //澶囨敞
+ string billType = model.BillType; //鐢宠绫诲瀷
+ string kcOrgId = model.KcOrgId;//
+ StringBuilder _sb = new StringBuilder();
+ string _split = "|";
+ foreach (var m in model.list)
+ {
+ string _guid = m.Guid.ToString();
+ var _line = m.ItemBarCode + _split
+ + (UtilityHelper.CheckGuid(_guid) ? _guid : Guid.Empty.ToString());
+ if (_sb.Length > 0)
+ _sb.Append("~");
+ _sb.Append(_line);
+ }
+ dynamic mObj = new ExpandoObject();
+ mObj.outMsg = "";
+ mObj.outSum = -1;
+ mObj.outGuid = "";
+ mObj.outNo = "";
+ using (var conn = new SqlConnection(DbHelperSQL.strConn))
+ {
+ using (var cmd = new SqlCommand("[cqjy_edt]", conn))
+ {
+ try
+ {
+ conn.Open();
+ cmd.CommandType = CommandType.StoredProcedure;
+ SqlParameter[] parameters =
+ {
+ new("@outMsg", SqlDbType.NVarChar, 300),
+ new("@outSum", SqlDbType.Int),
+ new("@outGuid", SqlDbType.UniqueIdentifier),
+ new("@outNo", SqlDbType.NVarChar, 300),
+ new("@inOrderGuid",UtilityHelper.CheckGuid(guid) ? guid: DBNull.Value),
+ new("@remark", remark),
+ new("@billType", billType),
+ new("@kcOrgId", kcOrgId),
+ new("@inEdtUserGuid", _userGuid),
+ new("@inLineList", _sb.ToString())
+ };
+ parameters[0].Direction = ParameterDirection.Output;
+ parameters[1].Direction = ParameterDirection.Output;
+ parameters[2].Direction = ParameterDirection.Output;
+ parameters[3].Direction = ParameterDirection.Output;
+ foreach (var parameter in parameters)
+ cmd.Parameters.Add(parameter);
+ cmd.ExecuteNonQuery();
+ mObj.outMsg = parameters[0].Value.ToString();
+ mObj.outSum = int.Parse(parameters[1].Value.ToString());
+ mObj.outGuid = parameters[2].Value.ToString();
+ mObj.outNo = parameters[3].Value.ToString();
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(),
+ "cqjy_edt error锛�" + ex.Message);
+ mObj.outMsg = ex.Message;
+ mObj.outSum = -1;
+ }
+ finally
+ {
+ conn.Close();
+ }
+ }
+ }
+ if (mObj.outSum <= 0)
+ return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Exception, mObj.outMsg);
+ return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Success, mObj.outMsg);
+ }
+
+ /// <summary>
+ /// 鍒犻櫎涓昏〃鎴栨槑缁�
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<int?> DeleteModelOrMx([FromBody] dynamic model)
+ {
+ int? rtnInt = (int)ReturnCode.Default;
+ Guid? guid = model.guid;
+ string mxGuid = model.mxGuid;
+ var _outMsg = "";
+ var _outSum = -1;
+ using (var conn = new SqlConnection(DbHelperSQL.strConn))
+ {
+ using (var cmd = new SqlCommand("[cqjy_del]", conn))
+ {
+ try
+ {
+ conn.Open();
+ cmd.CommandType = CommandType.StoredProcedure;
+ SqlParameter[] parameters =
+ {
+ new("@outMsg", SqlDbType.NVarChar, 300),
+ new("@outSum", SqlDbType.Int),
+ new("@inOrderGuid",
+ UtilityHelper.CheckGuid(guid)
+ ? guid
+ : DBNull.Value),
+ new("@inEdtUserGuid", _userGuid),
+ new("@inMxGuid", mxGuid)
+ };
+ parameters[0].Direction = ParameterDirection.Output;
+ parameters[1].Direction = ParameterDirection.Output;
+ foreach (var parameter in parameters)
+ cmd.Parameters.Add(parameter);
+ cmd.ExecuteNonQuery();
+ _outMsg = parameters[0].Value.ToString();
+ _outSum = int.Parse(parameters[1].Value.ToString());
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(),
+ "cqjy_del error锛�" + ex.Message);
+ _outMsg = ex.Message;
+ _outSum = -1;
+ }
+ finally
+ {
+ conn.Close();
+ }
+ }
+ }
+
+ if (_outSum <= 0)
+ return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Exception,
+ _outMsg);
+ return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Success, _outMsg);
+ }
+
+
+ /// <summary>
+ /// 璇诲彇鍒楄〃锛屾敮鎸佸垎椤�
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<PageList<dynamic>> SelectForm([FromBody] dynamic model)
+ {
+ int currentPage = model.currentPage;
+ int everyPageSize = model.everyPageSize;
+ string sortName = model.sortName;
+ string keyWhere = model.keyWhere;
+ string kcOrgId = model.kcOrgId;
+ var dset = new DataSet();
+ try
+ {
+ using (var conn = new SqlConnection(DbHelperSQL.strConn))
+ {
+ using (var cmd = new SqlCommand("[cqjy_select]", conn))
+ {
+ conn.Open();
+ cmd.CommandType = CommandType.StoredProcedure;
+ SqlParameter[] parameters =
+ {
+ new("@inCurrentPage", currentPage),
+ new("@inEveryPageSize", everyPageSize),
+ new("@inSortName", sortName),
+ new("@inSortOrder", ""),
+ new("@inQueryWhere", keyWhere),
+ new("@inP1", ""),
+ new("@inP2", kcOrgId)
+ };
+ foreach (var parameter in parameters)
+ cmd.Parameters.Add(parameter);
+ using (var dt =
+ new SqlDataAdapter(cmd))
+ {
+ dt.Fill(dset, "0");
+ }
+ }
+ conn.Close();
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), "GetListPage error锛�" + ex.Message);
+ return ReturnDto<PageList<dynamic>>.QuickReturn(
+ default(PageList<dynamic>), ReturnCode.Exception, "璇诲彇澶辫触");
+ }
+
+ var _pglist = new PageList<dynamic>
+ {
+ total = 0,
+ everyPageSize = 0,
+ pages = 0,
+ list = new List<dynamic>()
+ };
+ if (dset != null && dset.Tables.Count > 0 &&
+ dset.Tables[0].Rows.Count > 0) //鏈夋暟鎹�
+ {
+ var intTotal =
+ int.Parse(dset.Tables[1].Rows[0]["intTotal"].ToString());
+ var pages = intTotal % everyPageSize != 0
+ ? intTotal / everyPageSize + 1
+ : intTotal / everyPageSize;
+ _pglist.total = intTotal;
+ _pglist.everyPageSize = everyPageSize;
+ _pglist.pages = pages;
+ var _dy = dset.Tables[0].TableToDynamicList();
+ _pglist.list = _dy;
+ }
+
+ return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
+ ReturnCode.Success, "璇诲彇鎴愬姛");
+ }
+
+
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="mode"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<ExpandoObject> EditModelSubmit([FromBody] dynamic mode)
+ {
+ string _guid = mode.guid;
+ string _inFieldValue = mode.inFieldValue;
+ string _proName = "cqjy_submit";
+ dynamic m = new ExpandoObject();
+ m.outSum = -1;
+ m.outMsg = "";
+ using (var conn = new SqlConnection(DbHelperSQL.strConn))
+ {
+ using (var cmd = new SqlCommand(_proName, conn))
+ {
+ try
+ {
+ conn.Open();
+ cmd.CommandType = CommandType.StoredProcedure;
+ SqlParameter[] parameters =
+ {
+ new("@outMsg", SqlDbType.NVarChar, 300),
+ new("@outSum", SqlDbType.Int),
+ new("@inEdtUserGuid", _userGuid),
+ new("@inOrderGuid", _guid),
+ new("@inFieldValue", _inFieldValue),
+ new("@in1", ""),
+ new("@in2", "")
+ };
+ parameters[0].Direction = ParameterDirection.Output;
+ parameters[1].Direction = ParameterDirection.Output;
+ foreach (var parameter in parameters)
+ cmd.Parameters.Add(parameter);
+ cmd.ExecuteNonQuery();
+ m.outMsg = parameters[0].Value.ToString();
+ m.outSum = int.Parse(parameters[1].Value.ToString());
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), "cqjy_submit error锛�" + ex.Message);
+ m.outMsg = ex.Message;
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, ex.Message);
+ }
+ finally
+ {
+ conn.Close();
+ }
+ }
+ }
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "鎿嶄綔鎴愬姛锛�");
+ }
+ }
+}
diff --git a/WebApi/GS.QC/Service/RkqcfaManager.cs b/WebApi/GS.QC/Service/RkqcfaManager.cs
new file mode 100644
index 0000000..934bd6d
--- /dev/null
+++ b/WebApi/GS.QC/Service/RkqcfaManager.cs
@@ -0,0 +1,331 @@
+锘縰sing System.Data;
+using Gs.Toolbox;
+using Gs.Toolbox.ApiCore.Abstract.Mvc;
+using Gs.Toolbox.ApiCore.Common.Mvc;
+using Gs.Toolbox.ApiCore.Group;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using static Gs.Toolbox.UtilityHelper;
+using Microsoft.AspNetCore.Authorization;
+using System.Text;
+using System.Dynamic;
+using System.Data.SqlClient;
+
+
+namespace GS.QC.Service
+{
+ /// <summary>
+ /// 璐ㄤ繚鏈熸柟妗�
+ /// </summary>
+ [ApiGroup(ApiGroupNames.QC)]
+ public class RkqcfaManager : IRomteService
+ {
+ private readonly IHttpContextAccessor _http;
+
+ private readonly string _userCode, _userGuid, _orgFids;
+ public RkqcfaManager(IHttpContextAccessor httpContextAccessor)
+ {
+ _http = httpContextAccessor;
+ (_userCode, _userGuid, _orgFids) =
+ UtilityHelper.GetUserGuidAndOrgGuid(_http);
+ }
+
+ #region
+ /// <summary>
+ /// 璇诲彇鍒楄〃锛屾敮鎸佸垎椤�
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<PageList<dynamic>> GetListPage([FromBody] PageQuery model)
+ {
+ int currentPage = model.currentPage;
+ int everyPageSize = model.everyPageSize;
+ string sortName = string.IsNullOrEmpty(model.sortName) ? "a.fabm" : model.sortName;
+ string keyWhere = model.keyWhere;
+ System.Text.StringBuilder sbSql = new StringBuilder();
+ sbSql.Append("select * from ");
+ sbSql.Append("( ");
+ sbSql.Append("select top 100000 ROW_NUMBER() over(order by " + sortName + " " + model.sortOrder + ") as rowIndex,a.* ,(case a.zt when 1 then '姝e父' when 0 then '绂佺敤' end) as isStatusTxt,('('+org.FNumber+')'+org.NAME) as orgName from MES_CQJY_FA A LEFT JOIN SYS_ORGANIZATION ORG ON ORG.FID=A.fSubsidiary where 1=1" + keyWhere);
+ sbSql.Append(") as T ");
+ sbSql.Append(" where T.rowindex>(" + currentPage + "-1)*" + everyPageSize + " and T.rowindex<=" + currentPage + "*" + everyPageSize);
+ sbSql.Append(" order by rowindex asc ");
+ sbSql.Append(" select count(1) as intTotal from MES_CQJY_FA a LEFT JOIN SYS_ORGANIZATION ORG ON ORG.FID=A.fSubsidiary where 1=1 " + keyWhere);
+ DataSet dset = new DataSet();
+ try
+ {
+ dset = Gs.Toolbox.DbHelperSQL.Query(sbSql.ToString());
+ }
+ catch (Exception ex)
+ {
+ Gs.Toolbox.LogHelper.Debug(this.ToString(), "GetListPage error锛�" + ex.Message);
+ return ReturnDto<PageList<dynamic>>.QuickReturn(default(PageList<dynamic>), ReturnCode.Exception, "璇诲彇澶辫触");
+ }
+ PageList<dynamic> _pglist = new PageList<dynamic>
+ {
+ total = 0,
+ everyPageSize = 0,
+ pages = 0,
+ list = new List<dynamic>()
+ };
+ if (dset != null && dset.Tables.Count > 0 && dset.Tables[0].Rows.Count > 0)//鏈夋暟鎹�
+ {
+ int intTotal = int.Parse(dset.Tables[1].Rows[0]["intTotal"].ToString());
+ int pages = (intTotal % everyPageSize != 0) ? (intTotal / everyPageSize + 1) : (intTotal / everyPageSize);
+ _pglist.total = intTotal;
+ _pglist.everyPageSize = everyPageSize;
+ _pglist.pages = pages;
+ List<dynamic> _dy = dset.Tables[0].TableToDynamicList();
+ _pglist.list = _dy;
+ }
+ return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist, ReturnCode.Success, "璇诲彇鎴愬姛");
+ }
+
+
+ /// <summary>
+ /// 鍒犻櫎瀹炰綋
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<int?> DeleteModel([FromBody] dynamic model)
+ {
+ string guid = model.guid;
+ string mxGuid = model.mxGuid;
+ int rtnInt = (int)ReturnCode.Default;
+ int cont = 0;
+ try
+ {
+ cont = isChkOrUnChk(guid, 1);
+ if (cont > 0)
+ return ReturnDto<int>.QuickReturn(default(int?), ReturnCode.Exception, "鍒犻櫎澶辫触锛岃淇℃伅宸茶瀹℃牳锛�");
+ StringBuilder sbCount = new StringBuilder();
+ sbCount.Append("select COUNT(1) from [dbo].[MES_CQJY_FA_DETAIL] where pGuid='" + guid + "'");
+ cont = 0;
+ try
+ {
+ cont = int.Parse(DbHelperSQL.GetSingle(sbCount.ToString()).ToString());
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), "DeleteModel error锛�" + sbCount.ToString());
+ return ReturnDto<int>.QuickReturn(default(int?), ReturnCode.Exception, "鍒犻櫎澶辫触锛岃閲嶈瘯锛�");
+ }
+ if (cont > 0)
+ {
+ return ReturnDto<int>.QuickReturn(default(int?), ReturnCode.Exception, "璇峰厛鍒犻櫎涓嬮潰鐨勭墿鏂欏垪琛紒");
+ }
+ StringBuilder strSql = new StringBuilder();
+ strSql.Append(" delete from MES_CQJY_FA ");
+ strSql.Append(" where guid='" + guid + "'");
+ int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
+ rtnInt = rows;
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(this.ToString(), "DeleteModel error锛�" + ex.Message);
+ rtnInt = (int)ReturnCode.Exception;
+ return ReturnDto<int>.QuickReturn(default(int?), ReturnCode.Exception, "鍒犻櫎澶辫触锛�" + ex.Message);
+ }
+ if (rtnInt > 0)
+ return ReturnDto<int>.QuickReturn(default(int?), ReturnCode.Success, "鎿嶄綔鎴愬姛锛屽叡鍒犻櫎" + rtnInt.ToString() + "鏉℃暟鎹紒");
+ else
+ return ReturnDto<int>.QuickReturn(default(int?), ReturnCode.Exception, "鍒犻櫎澶辫触锛岃閲嶈瘯锛�");
+ }
+
+ /// <summary>
+ /// 澧炲姞瀹炰綋
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<ExpandoObject> EditModel([FromBody] dynamic model)
+ {
+ string guid = model.guid;
+ string famc = model.famc;
+ string bzqx = model.bzqx;
+ string fjxz = model.fjxz;
+ string yjrq = model.yjrq;
+ string bz = model.bz;
+ int zt = 1;
+ string fSubsidiary = model.fSubsidiary;
+ int? rtnInt = (int)ReturnCode.Default;
+ dynamic mObj = new ExpandoObject();
+ mObj.outMsg = "";
+ mObj.outSum = -1;
+ mObj.outGuid = "";
+ mObj.outNo = "";
+
+ if (UtilityHelper.CheckGuid(guid))
+ {
+ int cont = isChkOrUnChk(guid, 1);
+ if (cont > 0)
+ {
+ mObj.outMsg = "鍒犻櫎澶辫触锛岃淇℃伅宸茶瀹℃牳锛�";
+ mObj.outSum = -1;
+ return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Exception, mObj.outMsg);
+ }
+ }
+
+ string fabm = "";//鏂规缂栫爜
+ StringBuilder strSql = new StringBuilder();
+ if (!UtilityHelper.CheckGuid(guid))
+ {
+ guid = Guid.NewGuid().ToString();
+ fabm = GetBillNo("JYFA(妫�楠屾柟妗�)");
+ strSql.Append(" insert into MES_CQJY_FA");
+ strSql.Append(" ([guid] ,[fabm] ,[famc] ,[bzqx] ,[fjxz],[yjrq] ,[bz] ,[zt],fSubsidiary,checkStatus)");
+ strSql.Append(" values(");
+ strSql.Append(" '" + guid + "','" + fabm + "','" + famc + "'," + bzqx + "," + fjxz + "," + yjrq + ",'" + bz + "'," + zt + "," + fSubsidiary + ",0)");
+ }
+ else
+ {
+ strSql.Append(" update MES_CQJY_FA set [famc]='" + famc + "' ,[bzqx]=" + bzqx + " ,[fjxz]=" + fjxz + ",[yjrq]=" + yjrq + " ,[bz]='" + bz + "'");
+ strSql.Append(" where guid='" + guid + "'");
+ }
+ try
+ {
+ rtnInt = DbHelperSQL.ExecuteSql(strSql.ToString());
+ mObj.outMsg = "鎿嶄綔鎴愬姛锛�";
+ mObj.outSum = rtnInt;
+ mObj.outGuid = guid;
+ mObj.outNo = fabm;
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(this.ToString(), "EditModel error锛�" + ex.Message);
+ rtnInt = (int)ReturnCode.Exception;
+ mObj.outMsg = ex.Message;
+ mObj.outSum = -1;
+ }
+ if (mObj.outSum <= 0)
+ return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Exception, mObj.outMsg);
+ return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Success, mObj.outMsg);
+ }
+
+ /// <summary>
+ /// 璇诲彇瀹炰綋
+ /// </summary>
+ /// <param name="guid"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ [AllowAnonymous]
+ public ReturnDto<System.Dynamic.ExpandoObject> GetModel([FromBody] dynamic model)
+ {
+ dynamic m = new System.Dynamic.ExpandoObject();
+ System.Text.StringBuilder sbSql = new StringBuilder();
+ sbSql.Append(" select top 1 * from MES_CQJY_FA where 1=1 and guid='" + model.guid.ToString() + "' ");
+ try
+ {
+ DataSet dset = new DataSet();
+ dset = DbHelperSQL.Query(sbSql.ToString());
+ if (dset != null && dset.Tables.Count > 0 && dset.Tables[0].Rows.Count > 0)
+ {
+ System.Data.DataRow dr = dset.Tables[0].Rows[0];
+ m = dr.RowToDynamic();
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "璇诲彇鎴愬姛锛�");
+ }
+ else
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, "璇诲彇澶辫触锛�");
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(this.ToString(), "GetModel error:" + ex.Message);
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, "璇诲彇澶辫触锛�");
+ }
+ }
+ /// <summary>
+ /// 鍒ゆ柇鏄惁瀹℃牳
+ /// </summary>
+ /// <param name="guidList"></param>
+ /// <param name="status"></param>
+ /// <returns></returns>
+ private int isChkOrUnChk(string guidList, int status)
+ {
+ int cont = 0;
+ cont = int.Parse(DbHelperSQL.GetSingle("select count(1) from MES_CQJY_FA where guid='" + guidList + "' and isnull(checkstatus,0)=" + status + "").ToString());
+ return cont;
+ }
+ #endregion
+
+
+ /// <summary>
+ /// 绉诲嚭鎴栫Щ鍏�
+ /// </summary>
+ /// <param name="mode"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<ExpandoObject> EditModelOutIn([FromBody] dynamic mode)
+ {
+ string _guid = mode.guid;
+ string _inFieldValue = mode.inFieldValue;
+ string _inItemsGuids = mode.inItemsGuids;
+ dynamic m = new ExpandoObject();
+ m.outSum = -1;
+ m.outMsg = "";
+ using (var conn = new SqlConnection(DbHelperSQL.strConn))
+ {
+ using (var cmd = new SqlCommand("cqjy_itemsOutIn", conn))
+ {
+ try
+ {
+ conn.Open();
+ cmd.CommandType = CommandType.StoredProcedure;
+ SqlParameter[] parameters =
+ {
+ new("@outMsg", SqlDbType.NVarChar, 300),
+ new("@outSum", SqlDbType.Int),
+ new("@inEdtUserGuid", _userGuid),
+ new("@inOrderGuid", _guid),
+ new("@inFieldValue",_inFieldValue),
+ new("@inItemsGuids",_inItemsGuids),
+ };
+ parameters[0].Direction = ParameterDirection.Output;
+ parameters[1].Direction = ParameterDirection.Output;
+ foreach (var parameter in parameters)
+ cmd.Parameters.Add(parameter);
+ cmd.ExecuteNonQuery();
+ m.outMsg = parameters[0].Value.ToString();
+ m.outSum = int.Parse(parameters[1].Value.ToString());
+ }
+ catch (Exception ex)
+ {
+ m.outMsg = ex.Message;
+ LogHelper.Debug(this.ToString(), "cqjy_itemsOutIn error锛�" + ex.Message);
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, ex.Message);
+ }
+ finally
+ {
+ conn.Close();
+ }
+ }
+ }
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "鎿嶄綔鎴愬姛锛�");
+ }
+
+
+ /// <summary>
+ /// 璇诲彇缂栫爜
+ /// </summary>
+ /// <param name="billType"></param>
+ /// <returns></returns>
+ private static string GetBillNo(string billType, string itemNo = "")
+ {
+ var sbSql = new StringBuilder();
+ sbSql.Append(" DECLARE @hNo nvarchar(50) ");
+ sbSql.Append(" EXEC [getOrderNo] '" + billType + "',@hNo output,'" +
+ itemNo + "'");
+ sbSql.Append(" select @hNo as t1");
+ var str = "";
+ try
+ {
+ str = DbHelperSQL.GetSingle(sbSql.ToString()).ToString();
+ }
+ catch (Exception ex)
+ {
+ str = Guid.NewGuid().ToString();
+ }
+ return str;
+ }
+ }
+}
diff --git a/WebApi/Gs.BaseInfo/Services/MesCustomerManager.cs b/WebApi/Gs.BaseInfo/Services/MesCustomerManager.cs
index 7282582..abf6633 100644
--- a/WebApi/Gs.BaseInfo/Services/MesCustomerManager.cs
+++ b/WebApi/Gs.BaseInfo/Services/MesCustomerManager.cs
@@ -11,6 +11,9 @@
namespace Gs.BaseInfo.Services;
+/// <summary>
+/// 瀹㈡埛绠$悊
+/// </summary>
[ApiGroup(ApiGroupNames.BaseInfo)]
public class MesCustomerManager : Repository<MesCustomer>, IRomteService
{
@@ -31,7 +34,6 @@
[RequestMethod(RequestMethods.POST)]
public ReturnDto<PageList<MesCustomer>> GetListPage(PageQuery query)
{
-
var pageList = new PageList<MesCustomer>();
try
{
diff --git a/WebApi/Gs.BaseInfo/Services/MesItemTypeManager.cs b/WebApi/Gs.BaseInfo/Services/MesItemTypeManager.cs
new file mode 100644
index 0000000..fcd8392
--- /dev/null
+++ b/WebApi/Gs.BaseInfo/Services/MesItemTypeManager.cs
@@ -0,0 +1,73 @@
+锘縰sing System.Text;
+using Gs.BaseInfo.Models;
+using Gs.Toolbox;
+using Gs.Toolbox.ApiCore.Abstract.Mvc;
+using Gs.Toolbox.ApiCore.Common.Mvc;
+using Gs.Toolbox.ApiCore.Group;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Gs.BaseInfo.Services;
+
+[ApiGroup(ApiGroupNames.BaseInfo)]
+public class MesItemTypeManager : Repository<MesItemType>, IRomteService
+{
+ private readonly IHttpContextAccessor _http;
+ private readonly string _userCode,_userGuid,_orgFids;
+
+ public MesItemTypeManager(IHttpContextAccessor httpContextAccessor)
+ {
+ _http = httpContextAccessor;
+ (_userCode, _userGuid, _orgFids) =
+ UtilityHelper.GetUserGuidAndOrgGuid(_http);
+ }
+
+ /// <summary>
+ /// 鏌ヨ鍒楄〃锛屾敮鎸佸垎椤�
+ /// </summary>
+ /// <param name="query"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<PageList<MesItemType>> GetListPage(PageQuery query)
+ {
+ var pageList = new PageList<MesItemType>();
+ try
+ {
+ var _sbWhere = new StringBuilder(" 1=1" + query.keyWhere);
+ var _sbBy =
+ new StringBuilder(query.sortName + " " + query.sortOrder);
+ var totalCount = 0;
+ var itemsList = Db.Queryable<MesItemType>("a")
+ .Where(_sbWhere.ToString())
+ .OrderBy(_sbBy.ToString())
+ .ToPageList(query.currentPage, query.everyPageSize,
+ ref totalCount);
+
+ pageList = new PageList<MesItemType>(itemsList, totalCount,
+ query.everyPageSize);
+ return ReturnDto<PageList<MesItemType>>.QuickReturn(pageList,
+ ReturnCode.Success, "璇诲彇鎴愬姛");
+ }
+ catch (Exception ex)
+ {
+ return ReturnDto<PageList<MesItemType>>.QuickReturn(pageList,
+ ReturnCode.Default, ex.Message);
+ }
+ }
+
+ /// <summary>
+ /// 璇诲彇
+ /// </summary>
+ /// <param name="guid"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<MesItemType> GetModel([FromBody] MesItemType model)
+ {
+ var m = base.GetById(model.Guid);
+ if (m != null)
+ return ReturnDto<MesItemType>.QuickReturn(m, ReturnCode.Success,
+ "璇诲彇鎴愬姛锛�");
+ return ReturnDto<MesItemType>.QuickReturn(m, ReturnCode.Default,
+ "璇诲彇澶辫触锛�");
+ }
+}
\ No newline at end of file
diff --git a/WebApi/Gs.BaseInfo/Services/MesItemsManager.cs b/WebApi/Gs.BaseInfo/Services/MesItemsManager.cs
index ea0a397..dd4f9b6 100644
--- a/WebApi/Gs.BaseInfo/Services/MesItemsManager.cs
+++ b/WebApi/Gs.BaseInfo/Services/MesItemsManager.cs
@@ -1,7 +1,4 @@
-锘縰sing System.Data;
-using System.Data.SqlClient;
-using System.Dynamic;
-using System.Text;
+锘縰sing Gs.BaseInfo.Models;
using Gs.Entity.BaseInfo;
using Gs.Entity.Sys;
using Gs.Toolbox;
@@ -11,6 +8,10 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
+using System.Data;
+using System.Data.SqlClient;
+using System.Dynamic;
+using System.Text;
using SqlDataAdapter = System.Data.SqlClient.SqlDataAdapter;
namespace Gs.BaseInfo.Services;
@@ -30,66 +31,70 @@
}
/// <summary>
- /// 璇诲彇鍒楄〃锛屾敮鎸佸垎椤�
+ /// 鏌ヨ鍒楄〃锛屾敮鎸佸垎椤�
/// </summary>
- /// <param name="model"></param>
+ /// <param name="query"></param>
/// <returns></returns>
[RequestMethod(RequestMethods.POST)]
- public ReturnDto<PageList<dynamic>> GetListPage([FromBody] dynamic model)
+ public ReturnDto<PageList<MesItems>> GetListPage(PageQuery query)
{
- int currentPage = model.currentPage;
- int everyPageSize = model.everyPageSize;
- string sortName = model.sortName;
- string keyWhere = model.keyWhere;
- SqlParameter[] parameters =
- {
- new("@inCurrentPage", currentPage),
- new("@inEveryPageSize", everyPageSize),
- new("@inSortName", sortName),
- new("@inSortOrder", ""),
- new("@inQueryWhere", keyWhere),
- new("@inFid", ""),
- new("@inP1", ""),
- new("@inP2", ""),
- new("@inP3", ""),
- new("@inP4", "")
- };
- var dset = new DataSet();
- var _pglist = new PageList<dynamic>
- {
- total = 0,
- everyPageSize = 0,
- pages = 0,
- list = new List<dynamic>()
- };
+ var pageList = new PageList<MesItems>();
try
{
- dset = DbHelperSQL.RunProcedure("prc_item_lst", parameters, "0");
- if (dset != null && dset.Tables.Count > 0 &&
- dset.Tables[0].Rows.Count > 0) //鏈夋暟鎹�
- {
- var intTotal =
- int.Parse(dset.Tables[1].Rows[0]["intTotal"].ToString());
- var pages = intTotal % everyPageSize != 0
- ? intTotal / everyPageSize + 1
- : intTotal / everyPageSize;
- _pglist.total = intTotal;
- _pglist.everyPageSize = everyPageSize;
- _pglist.pages = pages;
- var _dy = dset.Tables[0].TableToDynamicList();
- _pglist.list = _dy;
- }
- }
+ var _sbWhere = new StringBuilder(" 1=1" + query.keyWhere);
+ var _sbBy = new StringBuilder(query.sortName + " " + query.sortOrder);
+ var totalCount = 0;
+ var itemsList = Db
+ .Queryable<MesItems, SysOrganization, MesUnit, MesUnit, MesUnit,
+ MesUnit, MesUnit, MesUnit, MesDepots, MesItemType>(
+ (a, org, c, d, e, f, g, h, m,n) => new object[]
+ {
+ JoinType.Left, a.FSubsidiary == org.Fid,
+ JoinType.Left, a.ItemUnit == c.Id.ToString(),
+ JoinType.Left, a.Fpurchaseunitid == d.Id.ToString(),
+ JoinType.Left, a.Saleunit == e.Id.ToString(),
+ JoinType.Left, a.Storeunit == f.Id.ToString(),
+ JoinType.Left, a.SubconUnit == g.Id.ToString(),
+ JoinType.Left, a.ProduceUnit == h.Id.ToString(),
+ JoinType.Left, a.DepotCode == m.DepotId.ToString(),
+ JoinType.Left, a.Fmaterialgroup == n.Id.ToString()
+ })
+ .Select((a, org, c, d, e, f, g, h, m,n) => new MesItems
+ {
+ chkInt = false,
+ FSubsidiary = "(" + org.FNumber + ")" + org.Name,
+ ItemUnit = c.Fname,
+ Fpurchaseunitid = d.Fname,
+ Saleunit = e.Fname,
+ Storeunit = f.Fname,
+ SubconUnit = g.Fname,
+ ProduceUnit = h.Fname,
+ DepotCode = m.DepotName,
+ Fmaterialgroup=n.Tname,
+ Fforbidstatus = a.Fforbidstatus + ":" + (a.Fforbidstatus == "A" ? "姝e父" : "绂佺敤"),
+ DataType = a.DataType + ":"
+ + SqlFunc.IF(a.DataType == "Z").Return("鏆傚瓨")
+ .ElseIF(a.DataType == "A").Return("鍒涘缓")
+ .ElseIF(a.DataType == "B").Return("瀹℃牳涓�")
+ .ElseIF(a.DataType == "C").Return("宸插鏍�")
+ .ElseIF(a.DataType == "D").Return("閲嶆柊瀹℃牳")
+ .End(a.DataType)
+ }, true)
+ .Where(_sbWhere.ToString())
+ .OrderBy(_sbBy.ToString())
+ .ToPageList(query.currentPage, query.everyPageSize,
+ ref totalCount);
+ pageList = new PageList<MesItems>(itemsList, totalCount,
+ query.everyPageSize);
+ return ReturnDto<PageList<MesItems>>.QuickReturn(pageList,
+ ReturnCode.Success, "璇诲彇鎴愬姛");
+ }
catch (Exception ex)
{
- LogHelper.Debug(ToString(), ex.Message);
- return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
- ReturnCode.Exception, ex.Message);
+ return ReturnDto<PageList<MesItems>>.QuickReturn(pageList,
+ ReturnCode.Default, ex.Message);
}
-
- return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
- ReturnCode.Success, "璇诲彇鎴愬姛");
}
@@ -129,6 +134,42 @@
return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, "璇诲彇澶辫触锛�");
}
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<ExpandoObject> GetModelByOrg([FromBody] dynamic model)
+ {
+ string itemNo = model.itemNo;
+ string orgId = model.orgId;
+ dynamic m = new ExpandoObject();
+ SqlParameter[] parameters =
+ {
+ new("@inItemNo", itemNo),
+ new("@inOrgId", orgId),
+ };
+ var dset = new DataSet();
+ try
+ {
+ dset = DbHelperSQL.RunProcedure("[prc_item_detailByOrg]", parameters, "0");
+ if (dset != null && dset.Tables.Count > 0 &&
+ dset.Tables[0].Rows.Count > 0)
+ {
+ var dr = dset.Tables[0].Rows[0];
+ m = dr.RowToDynamic();
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "璇诲彇鎴愬姛锛�");
+ }
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, "璇诲彇澶辫触锛屾壘涓嶅埌璇ョ墿鏂欙紒");
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), ex.Message);
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, "璇诲彇澶辫触锛�" + ex.Message.ToString());
+ }
+ }
+
/// <summary>
/// 璇诲彇鍒楄〃锛屾敮鎸佸垎椤�
@@ -143,6 +184,7 @@
string sortName = model.sortName;
string keyWhere = model.keyWhere;
string keyType = model.keyType;
+ string keyWord = model.keyWord; //杩欎釜pguid锛屼綔涓烘柟妗堢殑涓婚敭
var dset = new DataSet();
try
{
@@ -160,7 +202,7 @@
new("@inSortOrder", ""),
new("@inQueryWhere", keyWhere),
new("@inP1",keyType),//褰撲负锛氭楠岄」鐩紝iqc,ipqc,fqc鏃讹紝鍏嶆鏃� 鐗瑰埆鍔犱笂杩囨护鏉′欢
- new("@inP2", "")
+ new("@inP2", keyWord) //杩欎釜pguid锛屼綔涓烘柟妗堢殑涓婚敭
};
foreach (var parameter in parameters)
cmd.Parameters.Add(parameter);
@@ -222,7 +264,7 @@
System.Text.StringBuilder sbJoin = new StringBuilder();
sbJoin.Append(" FROM MES_ITEMS [a]");
sbJoin.Append(" Left JOIN [SYS_ORGANIZATION] [Org] ON ( [a].[FSubsidiary] = [Org].[FID] )");
- sbJoin.Append(" left join SYS_USER_BIND b on (b.userGuid='"+ keyType + "' and b.aboutGuid=a.guid)");
+ sbJoin.Append(" left join SYS_USER_BIND b on (b.userGuid='" + keyType + "' and b.aboutGuid=a.item_id and b.fType='鐗╂枡鍒嗗尯')");
sbJoin.Append(" where 1=1 ");
sbJoin.Append(keyWhere);
var sbSql = new StringBuilder();
@@ -275,4 +317,37 @@
ReturnCode.Success, "璇诲彇鎴愬姛");
}
+
+ /// <summary>
+ /// 鎵归噺璁剧疆鎻愬墠鍒拌揣鏃ユ湡
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<int?> SetDays([FromBody] dynamic model)
+ {
+ string guidList = model.guidList;
+ string bz10 = model.bz10;
+ string percent = model.percent;
+ int rtnInt = (int)ReturnCode.Default;
+ try
+ {
+ StringBuilder strSql = new StringBuilder();
+ strSql.Append(" update MES_ITEMS set bz10=" + bz10.Trim() + " ," + "loss_percent = " + percent.Trim() + " ");
+ strSql.Append(" where guid in (select line from dbo.fn_split('" + guidList + "',','))");
+ int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
+ rtnInt = rows;
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(this.ToString(), "SetDays error锛�" + ex.Message);
+ rtnInt = (int)ReturnCode.Exception;
+ return ReturnDto<int>.QuickReturn(default(int?), ReturnCode.Exception, "鎿嶄綔澶辫触锛�" + ex.Message);
+ }
+ if (rtnInt > 0)
+ return ReturnDto<int>.QuickReturn(default(int?), ReturnCode.Success, "鎿嶄綔鎴愬姛锛�");
+ else
+ return ReturnDto<int>.QuickReturn(default(int?), ReturnCode.Exception, "鎿嶄綔澶辫触锛岃閲嶈瘯锛�");
+ }
+
}
\ No newline at end of file
diff --git a/WebApi/Gs.BaseInfo/Services/MesStaffManager.cs b/WebApi/Gs.BaseInfo/Services/MesStaffManager.cs
index e427a48..23936cc 100644
--- a/WebApi/Gs.BaseInfo/Services/MesStaffManager.cs
+++ b/WebApi/Gs.BaseInfo/Services/MesStaffManager.cs
@@ -1,4 +1,5 @@
-锘縰sing Gs.Entity.BaseInfo;
+锘縰sing System.Text;
+using Gs.Entity.BaseInfo;
using Gs.Entity.Sys;
using Gs.Toolbox;
using Gs.Toolbox.ApiCore.Abstract.Mvc;
@@ -7,10 +8,6 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
-using System.Data;
-using System.Data.SqlClient;
-using System.Dynamic;
-using System.Text;
namespace Gs.BaseInfo.Services;
@@ -83,55 +80,13 @@
/// <param name="guid"></param>
/// <returns></returns>
[RequestMethod(RequestMethods.POST)]
- //public ReturnDto<MesStaff> GetModel([FromBody] MesStaff model)
- //{
- // var m = base.GetById(model.Guid);
- // if (m != null)
- // return ReturnDto<MesStaff>.QuickReturn(m, ReturnCode.Success,
- // "璇诲彇鎴愬姛锛�");
- // return ReturnDto<MesStaff>.QuickReturn(m, ReturnCode.Default, "璇诲彇澶辫触锛�");
- //}
-
- public ReturnDto<ExpandoObject> GetModel([FromBody] dynamic model)
+ public ReturnDto<MesStaff> GetModel([FromBody] MesStaff model)
{
- string guid = model.guid.ToString();
- dynamic m = new ExpandoObject();
- m.list = new List<dynamic>();
- m.list2 = new List<dynamic>();
- SqlParameter[] parameters =
- {
- new("@inMainGuid", guid),
- new("@inP1", ""),
- new("@inP2", ""),
- new("@inP3", ""),
- new("@inP4", "")
- };
- var dset = new DataSet();
- try
- {
- dset = DbHelperSQL.RunProcedure("[prc_staff_mx]", parameters, "0");
- if (dset != null && dset.Tables.Count > 0 &&
- dset.Tables[0].Rows.Count > 0)
- {
- var dr = dset.Tables[0].Rows[0];
- m = dr.RowToDynamic();
- var _tb = dset.Tables[1].TableToDynamicList();
- m.list = _tb;
- //var _tb2 = dset.Tables[2].TableToDynamicList();
- //m.list2 = _tb2;
- }
- }
- catch (Exception ex)
- {
- LogHelper.Debug(ToString(), ex.Message);
- }
-
+ var m = base.GetById(model.Guid);
if (m != null)
- return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success,
+ return ReturnDto<MesStaff>.QuickReturn(m, ReturnCode.Success,
"璇诲彇鎴愬姛锛�");
- return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, "璇诲彇澶辫触锛�");
+ return ReturnDto<MesStaff>.QuickReturn(m, ReturnCode.Default, "璇诲彇澶辫触锛�");
}
-
-
}
\ No newline at end of file
diff --git a/WebApi/Gs.BaseInfo/Services/MesSupplierManager.cs b/WebApi/Gs.BaseInfo/Services/MesSupplierManager.cs
index e20fbde..06e6c55 100644
--- a/WebApi/Gs.BaseInfo/Services/MesSupplierManager.cs
+++ b/WebApi/Gs.BaseInfo/Services/MesSupplierManager.cs
@@ -51,7 +51,7 @@
).Select((a, org) => new MesSupplier
{
FSubsidiary = "(" + org.FNumber + ")" + org.Name,
- Fforbidstatus = a.Fforbidstatus+":"+(a.Fforbidstatus == "A" ? "姝e父" : "绂佺敤"),
+ Fforbidstatus = a.Fforbidstatus + ":" + (a.Fforbidstatus == "A" ? "姝e父" : "绂佺敤"),
DataType = a.DataType + ":"
+ SqlFunc.IF(a.DataType == "Z").Return("鏆傚瓨")
.ElseIF(a.DataType == "A").Return("鍒涘缓")
@@ -165,4 +165,96 @@
return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
ReturnCode.Success, "璇诲彇鎴愬姛");
}
+
+
+
+ /// <summary>
+ /// 鍔犲叆srm鍚嶅崟
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<int?> SrmJoin([FromBody] dynamic model)
+ {
+ string suppId = model.suppId;
+ string joinType = model.joinType;
+ int rtnInt = (int)ReturnCode.Default;
+ try
+ {
+ StringBuilder strSql = new StringBuilder();
+ strSql.Append(" delete from MES_SUPPLIER_SRM ");
+ strSql.Append(" where suppId='" + suppId + "'");
+ int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
+ if (joinType == "1")
+ {
+ strSql = new StringBuilder();
+ strSql.Append(" insert into MES_SUPPLIER_SRM(suppId,isSrm,create_by,create_date)");
+ strSql.Append(" values('" + suppId + "',1,'" + _userCode + "',getdate())");
+ rows = DbHelperSQL.ExecuteSql(strSql.ToString());
+ }
+ rtnInt = rows;
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(this.ToString(), "DeleteModel error锛�" + ex.Message);
+ rtnInt = (int)ReturnCode.Exception;
+ return ReturnDto<int>.QuickReturn(default(int?), ReturnCode.Exception, "鎿嶄綔澶辫触锛�" + ex.Message);
+ }
+ if (rtnInt > 0)
+ return ReturnDto<int>.QuickReturn(default(int?), ReturnCode.Success, "鎿嶄綔鎴愬姛锛�");
+ else
+ return ReturnDto<int>.QuickReturn(default(int?), ReturnCode.Exception, "鎿嶄綔澶辫触锛岃閲嶈瘯锛�");
+ }
+
+
+ /// <summary>
+ /// 璇诲彇srm鍒楄〃
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<PageList<dynamic>> GetSrmListPage([FromBody] PageQuery model)
+ {
+ int currentPage = model.currentPage;
+ int everyPageSize = model.everyPageSize;
+ string sortName = string.IsNullOrEmpty(model.sortName) ? "a.supp_name" : model.sortName;
+ string keyWhere = model.keyWhere;
+ System.Text.StringBuilder sbSql = new StringBuilder();
+ sbSql.Append("select * from ");
+ sbSql.Append("( ");
+ sbSql.Append("select top 100000 ROW_NUMBER() over(order by " + sortName + " " + model.sortOrder + ") as rowIndex,a.*,b.create_date as joinDate,'(' + org.FNumber + ')' + org.Name as orgName from [dbo].[MES_SUPPLIER_SRM] b left join [dbo].[MES_SUPPLIER] a on b.suppId=a.[id] left join SYS_ORGANIZATION org on org.FID=a.FSubsidiary where 1=1" + keyWhere);
+ sbSql.Append(") as T ");
+ sbSql.Append(" where T.rowindex>(" + currentPage + "-1)*" + everyPageSize + " and T.rowindex<=" + currentPage + "*" + everyPageSize);
+ sbSql.Append(" order by rowindex asc ");
+ sbSql.Append(" select count(1) as intTotal from [dbo].[MES_SUPPLIER_SRM] b left join [dbo].[MES_SUPPLIER] a on b.suppId=a.[id] left join SYS_ORGANIZATION org on org.FID=a.FSubsidiary where 1=1 " + keyWhere);
+ DataSet dset = new DataSet();
+ try
+ {
+ dset = Gs.Toolbox.DbHelperSQL.Query(sbSql.ToString());
+ }
+ catch (Exception ex)
+ {
+ Gs.Toolbox.LogHelper.Debug(this.ToString(), "GetListPage error锛�" + ex.Message);
+ return ReturnDto<PageList<dynamic>>.QuickReturn(default(PageList<dynamic>), ReturnCode.Exception, "璇诲彇澶辫触");
+ }
+ PageList<dynamic> _pglist = new PageList<dynamic>
+ {
+ total = 0,
+ everyPageSize = 0,
+ pages = 0,
+ list = new List<dynamic>()
+ };
+ if (dset != null && dset.Tables.Count > 0 && dset.Tables[0].Rows.Count > 0)//鏈夋暟鎹�
+ {
+ int intTotal = int.Parse(dset.Tables[1].Rows[0]["intTotal"].ToString());
+ int pages = (intTotal % everyPageSize != 0) ? (intTotal / everyPageSize + 1) : (intTotal / everyPageSize);
+ _pglist.total = intTotal;
+ _pglist.everyPageSize = everyPageSize;
+ _pglist.pages = pages;
+ List<dynamic> _dy = dset.Tables[0].TableToDynamicList();
+ _pglist.list = _dy;
+ }
+ return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist, ReturnCode.Success, "璇诲彇鎴愬姛");
+ }
+
}
\ No newline at end of file
diff --git a/WebApi/Gs.BaseInfo/Services/MesWorkshopLineManager.cs b/WebApi/Gs.BaseInfo/Services/MesWorkshopLineManager.cs
index 1e449a8..03728cf 100644
--- a/WebApi/Gs.BaseInfo/Services/MesWorkshopLineManager.cs
+++ b/WebApi/Gs.BaseInfo/Services/MesWorkshopLineManager.cs
@@ -71,6 +71,78 @@
}
}
+
+ /// <summary>
+ /// 鏌ヨ鍒楄〃锛屾敮鎸佸垎椤碉紝鐢ㄤ簬鍚勭缁戝畾
+ /// </summary>
+ /// <param name="query"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<PageList<dynamic>> GetListPage2(PageQuery model)
+ {
+ var currentPage = model.currentPage;
+ var everyPageSize = model.everyPageSize;
+ var sortName = string.IsNullOrEmpty(model.sortName) ? "org.FNumber" : model.sortName;
+ var keyWhere = model.keyWhere;
+ string keyType = model.keyType;
+ var sbSql = new StringBuilder();
+ sbSql.Append("select * from ");
+ sbSql.Append("( ");
+ sbSql.Append("select top 100000 ROW_NUMBER() over(order by " + sortName + " " + model.sortOrder + ") as rowIndex,a.* ");
+ sbSql.Append(",d.departmentname,('(' + org.FNumber + ')' + org.NAME) as kcOrg");
+ if (string.IsNullOrEmpty(keyType))
+ {
+ sbSql.Append(",cast(0 as bit) as chkInt");
+ }
+ else
+ sbSql.Append(",cast( (select count(1) from SYS_USER_BIND b where b.userGuid='" + keyType + "' and b.aboutGuid=a.guid and b.fType='杩囩珯鏃剁粦瀹氱嚎浣�') as bit) as chkInt ");
+ sbSql.Append(" from MES_WORKSHOP_LINE a ");
+ sbSql.Append(" left join SYS_DEPARTMENT d on a.dpt_id=d.departmentid left join SYS_ORGANIZATION org on d.FSubsidiary=org.FID");
+ sbSql.Append(" where 1=1");
+ sbSql.Append(keyWhere);
+ sbSql.Append(") as T ");
+ sbSql.Append(" where T.rowindex>(" + currentPage + "-1)*" + everyPageSize + " and T.rowindex<=" + currentPage + "*" + everyPageSize);
+ sbSql.Append(" order by rowindex asc ");
+ sbSql.Append(" select count(1) as intTotal from MES_WORKSHOP_LINE a ");
+ sbSql.Append(" left join SYS_DEPARTMENT d on a.dpt_id=d.departmentid left join SYS_ORGANIZATION org on d.FSubsidiary=org.FID");
+ sbSql.Append(" where 1=1");
+ sbSql.Append(keyWhere);
+ var dset = new DataSet();
+ try
+ {
+ dset = DbHelperSQL.Query(sbSql.ToString());
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), "GetListPage error锛�" + ex.Message);
+ return ReturnDto<PageList<dynamic>>.QuickReturn(default(PageList<dynamic>), ReturnCode.Exception, "璇诲彇澶辫触");
+ }
+
+ var _pglist = new PageList<dynamic>
+ {
+ total = 0,
+ everyPageSize = 0,
+ pages = 0,
+ list = new List<dynamic>()
+ };
+ if (dset != null && dset.Tables.Count > 0 &&
+ dset.Tables[0].Rows.Count > 0) //鏈夋暟鎹�
+ {
+ var intTotal = int.Parse(dset.Tables[1].Rows[0]["intTotal"].ToString());
+ var pages = intTotal % everyPageSize != 0
+ ? intTotal / everyPageSize + 1
+ : intTotal / everyPageSize;
+ _pglist.total = intTotal;
+ _pglist.everyPageSize = everyPageSize;
+ _pglist.pages = pages;
+ var _dy = dset.Tables[0].TableToDynamicList();
+ _pglist.list = _dy;
+ }
+ return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
+ ReturnCode.Success, "璇诲彇鎴愬姛");
+ }
+
+
/// <summary>
/// 妫�鏌ユ槸鍚﹁浣跨敤锛屼娇鐢ㄥ悗涓嶈兘杩涜淇敼鍜屽垹闄�
/// </summary>
@@ -81,8 +153,6 @@
{
System.Text.StringBuilder sbSql = new StringBuilder();
sbSql.Append(" select top 1 daa015 as xt from WOMDAA daa left join MES_WORKSHOP_LINE line on daa.daa015=line.id where line.guid='" + strGuid + "'");
- sbSql.Append(" union all");
- sbSql.Append(" select top 1 lineId as xt from MES_WORK_PROD daa left join MES_WORKSHOP_LINE line on daa.lineId=line.id where line.guid='" + strGuid + "'");
try
{
DataSet dset = new DataSet();
@@ -105,11 +175,11 @@
[RequestMethod(RequestMethods.POST)]
public ReturnDto<string?> EditModel([FromBody] MesWorkshopLine model)
{
- bool _blChk = checkLine(model.Guid.ToString());
- if (_blChk)
- {
- return ReturnDto<string>.QuickReturn("", ReturnCode.Exception, "鎿嶄綔澶辫触锛岃绾夸綋宸蹭骇鐢熶簡鏁版嵁锛屾棤娉曡繘琛屼慨鏀癸紝鍒犻櫎绛夋搷浣滐紒");
- }
+ //bool _blChk = checkLine(model.Guid.ToString());
+ //if (_blChk)
+ //{
+ // return ReturnDto<string>.QuickReturn("", ReturnCode.Exception, "鎿嶄綔澶辫触锛岃绾夸綋宸蹭骇鐢熶簡鏁版嵁锛屾棤娉曡繘琛屼慨鏀癸紝鍒犻櫎绛夋搷浣滐紒");
+ //}
var _bl = false;
try
{
diff --git a/WebApi/Gs.BaseInfo/Services/PrintInfoManager.cs b/WebApi/Gs.BaseInfo/Services/PrintInfoManager.cs
index 3e894f5..f6c71a8 100644
--- a/WebApi/Gs.BaseInfo/Services/PrintInfoManager.cs
+++ b/WebApi/Gs.BaseInfo/Services/PrintInfoManager.cs
@@ -79,7 +79,7 @@
sbSql.Append(",cast(0 as bit) as chkInt");
}
else
- sbSql.Append(",cast( (select count(1) from SYS_USER_BIND b where b.userGuid='" + keyType + "' and b.aboutGuid=a.guid) as bit) as chkInt ");
+ sbSql.Append(",cast( (select count(1) from SYS_USER_BIND b where b.userGuid='" + keyType + "' and b.aboutGuid=a.guid and b.fType='鎵撳嵃鏈�') as bit) as chkInt ");
sbSql.Append(" from print_info a ");
sbSql.Append(keyWhere);
sbSql.Append(") as T ");
diff --git a/WebApi/Gs.Entity/BaseInfo/MesDepotSections.cs b/WebApi/Gs.Entity/BaseInfo/MesDepotSections.cs
index d449615..c53c97d 100644
--- a/WebApi/Gs.Entity/BaseInfo/MesDepotSections.cs
+++ b/WebApi/Gs.Entity/BaseInfo/MesDepotSections.cs
@@ -105,9 +105,4 @@
/// </summary>
[SugarColumn(ColumnName = "erpid")]
public int? Erpid { get; set; }
- /// <summary>
- /// ID(SEQ_INV_ID)锛圗RPID锛�
- /// </summary>
- [SugarColumn(ColumnName = "xh")]
- public int Xh { get; set; }
}
\ No newline at end of file
diff --git a/WebApi/Gs.Entity/BaseInfo/MesItems.cs b/WebApi/Gs.Entity/BaseInfo/MesItems.cs
index 7cce14e..37f8d32 100644
--- a/WebApi/Gs.Entity/BaseInfo/MesItems.cs
+++ b/WebApi/Gs.Entity/BaseInfo/MesItems.cs
@@ -325,8 +325,6 @@
[SugarColumn(ColumnName = "DATA_TYPE")]
public string DataType { get; set; }
-
-
/// <summary>
/// 浣跨敤缁勭粐ID锛屽洜涓轰笂涓�涓浣跨敤缁勭粐鍚嶇О鍗犵敤浜�
/// </summary>
@@ -348,99 +346,9 @@
[SugarColumn(IsIgnore = true)] public string? Tc { get; set; }
-
-
/// <summary>
- /// 浠撶鍛�
+ /// 閫夋嫨妗�
/// </summary>
- [SugarColumn(ColumnName = "F_WPVT_BASE_QTR")]
- public string? F_WPVT_BASE_QTR { get; set; }
- /// <summary>
- /// 搴忓垪鍙风敓鎴愭椂鏈�
- /// </summary>
- [SugarColumn(ColumnName = "FSNCREATETIME")]
- public string? FSNCREATETIME { get; set; }
- /// <summary>
- /// 涓氬姟鑼冨洿
- /// </summary>
- [SugarColumn(ColumnName = "FSNMANAGETYPE")]
- public string? FSNMANAGETYPE { get; set; }
- /// <summary>
- /// 搴撳瓨绠$悊
- /// </summary>
- [SugarColumn(ColumnName = "FISSNMANAGE")]
- public string? FISSNMANAGE { get; set; }
- /// <summary>
- /// 鐢熶骇杩芥函
- /// </summary>
- [SugarColumn(ColumnName = "FISSNPRDTRACY")]
- public string? FISSNPRDTRACY { get; set; }
- /// <summary>
- /// 搴忓垪鍙峰崟浣�
- /// </summary>
- [SugarColumn(ColumnName = "FSNUNIT")]
- public string? FSNUNIT { get; set; }
- /// <summary>
- /// 鍒堕�犵瓥鐣�
- /// </summary>
- [SugarColumn(ColumnName = "FMfgPolicyId")]
- public string? FMfgPolicyId { get; set; }
- /// <summary>
- /// 鏁版嵁鐘舵��
- /// </summary>
- [SugarColumn(ColumnName = "FDocumentStatus")]
- public string? FDocumentStatus { get; set; }
- /// <summary>
- /// 鏄惁鍏抽敭浠�
- /// </summary>
- [SugarColumn(ColumnName = "FIsKitting")]
- public string? FIsKitting { get; set; }
- /// <summary>
- /// 鍙负鑱斿壇浜у搧
- /// </summary>
- [SugarColumn(ColumnName = "FIsCoby")]
- public string? FIsCoby { get; set; }
- /// <summary>
- /// 瓒呭彂鎺у埗鏂瑰紡
- /// </summary>
- [SugarColumn(ColumnName = "FOverControlMode")]
- public string? FOverControlMode { get; set; }
- /// <summary>
- /// 鎹熻�楃巼
- /// </summary>
- [SugarColumn(ColumnName = "FLOSSPERCENT")]
- public string? FLOSSPERCENT { get; set; }
- /// <summary>
- /// 淇濊川鏈�
- /// </summary>
- [SugarColumn(ColumnName = "FExpPeriod")]
- public string? FExpPeriod { get; set; }
- /// <summary>
- /// 鏃х墿鏂欑紪鐮�
- /// </summary>
- [SugarColumn(ColumnName = "FOldNumber")]
- public string? FOldNumber { get; set; }
- /// <summary>
- /// 鏈�灏忓簱瀛�
- /// </summary>
- [SugarColumn(ColumnName = "FMinStock")]
- public string? FMinStock { get; set; }
- /// <summary>
- /// 鍏ュ簱娆犳敹姣斾緥(%)
- /// </summary>
- [SugarColumn(ColumnName = "FFinishReceiptShortRate")]
- public string? FFinishReceiptShortRate { get; set; }
-
- /// <summary>
- /// 榛樿渚涘簲鍟�
- /// </summary>
- [SugarColumn(ColumnName = "FDefaultVendor")]
- public string? FDefaultVendor { get; set; }
- /// <summary>
- /// 瀛愰」鍗曚綅
- /// </summary>
- [SugarColumn(ColumnName = "FBOMUnitId")]
- public string? FBOMUnitId { get; set; }
-
-
+ [SugarColumn(IsIgnore = true)] public bool? chkInt { get; set; }
+
}
\ No newline at end of file
diff --git a/WebApi/Gs.HostIIS/CustomContractResolver.cs b/WebApi/Gs.HostIIS/CustomContractResolver.cs
index a8e3d82..8e3df92 100644
--- a/WebApi/Gs.HostIIS/CustomContractResolver.cs
+++ b/WebApi/Gs.HostIIS/CustomContractResolver.cs
@@ -5,6 +5,12 @@
public class CustomContractResolver : DefaultContractResolver
{
+
+ /// <summary>
+ /// 鎶婂疄浣撳瓧娈佃浆涓洪┘宄板懡鍚�
+ /// </summary>
+ /// <param name="strItem"></param>
+ /// <returns></returns>
protected override string ResolvePropertyName(string strItem)
{
var hasLowercase = Regex.IsMatch(strItem, @"[a-z]");
@@ -14,7 +20,6 @@
chars[0] = char.ToLower(chars[0]);
return new string(chars);
}
-
var strItems = strItem.ToLower().Split('_');
var strItemTarget = strItems[0];
for (var j = 1; j < strItems.Length; j++)
@@ -25,7 +30,6 @@
temp2 = temp1 + temp.Remove(0, 1);
strItemTarget += temp2;
}
-
return strItemTarget;
}
}
\ No newline at end of file
diff --git a/WebApi/Gs.HostIIS/Program.cs b/WebApi/Gs.HostIIS/Program.cs
index 76e691a..f1938f3 100644
--- a/WebApi/Gs.HostIIS/Program.cs
+++ b/WebApi/Gs.HostIIS/Program.cs
@@ -73,8 +73,7 @@
//娣诲姞瀹夊叏瀹氫箟
c.AddSecurityDefinition("Token", new OpenApiSecurityScheme
{
- Description =
- "璇疯緭鍏oken,鏍煎紡涓猴細token 3fa85f64-5717-4562-b3fc-2c963f66afa6锛堟敞鎰忎腑闂村繀椤绘湁绌烘牸锛�",
+ Description ="璇疯緭鍏oken,鏍煎紡涓猴細token 3fa85f64-5717-4562-b3fc-2c963f66afa6锛堟敞鎰忎腑闂村繀椤绘湁绌烘牸锛�",
Name = "token",
In = ParameterLocation.Header,
Type = SecuritySchemeType.ApiKey,
diff --git a/WebApi/Gs.HostIIS/RequestAuthorizeAttribute.cs b/WebApi/Gs.HostIIS/RequestAuthorizeAttribute.cs
index d6e9394..493ecc1 100644
--- a/WebApi/Gs.HostIIS/RequestAuthorizeAttribute.cs
+++ b/WebApi/Gs.HostIIS/RequestAuthorizeAttribute.cs
@@ -7,6 +7,11 @@
public class ApiAuthorizeAttribute : Attribute, IAuthorizationFilter
{
+
+ /// <summary>
+ /// 鐢ㄦ埛浠ょ墝楠岃瘉
+ /// </summary>
+ /// <param name="context"></param>
public void OnAuthorization(AuthorizationFilterContext context)
{
var token = context.HttpContext.Request.Headers["token"]
diff --git a/WebApi/Gs.HostIIS/appsettings.json b/WebApi/Gs.HostIIS/appsettings.json
index 8ec6a4e..873cb13 100644
--- a/WebApi/Gs.HostIIS/appsettings.json
+++ b/WebApi/Gs.HostIIS/appsettings.json
@@ -6,9 +6,9 @@
}
},
"AllowedHosts": "*",
-
- "ConnectionStrings": "Data Source=192.168.1.187;Initial Catalog=GS_MES;User ID=sa;Password =LongWei@2025",
- "TestErpUrl": "http://192.168.1.101:8083/MesToKd.asmx/MesToErpinfoTest",
+ /*"ConnectionStrings": "Data Source=192.168.1.146;Initial Catalog=TEST_MES;User ID=testUser;Password =qixi1qaz@WSXtest",*/
+ "ConnectionStrings": "Data Source=192.168.1.146,12468;Initial Catalog=GS_MES;User ID=mesUser;Password =qixi1qaz@WSXmes",
+ "TestErpUrl": "http://192.168.1.149:8066/WebService1.asmx/MesToErpinfoTest",
"TestErpUrl2": "http://192.168.1.149:8066/WebService1.asmx/MesToErpUpdateFlag",
"ProductionErpUrl": "http://192.168.1.149:8066/WebService1.asmx/mesToErpinfoFormal",
"ServicesPath": "Services",
diff --git a/WebApi/Gs.QiTaCk/MesCgthSqManager.cs b/WebApi/Gs.QiTaCk/MesCgthSqManager.cs
index 16b4956..1c5904e 100644
--- a/WebApi/Gs.QiTaCk/MesCgthSqManager.cs
+++ b/WebApi/Gs.QiTaCk/MesCgthSqManager.cs
@@ -118,7 +118,7 @@
m = dr.RowToDynamic();
var _tb = dset.Tables[1].TableToDynamicList();
m.list = _tb;
-
+
}
}
catch (Exception ex)
@@ -174,11 +174,9 @@
}
catch (Exception ex)
{
- LogHelper.Debug(ToString(),
- "prc_cgthsq_submit error锛�" + ex.Message);
+ LogHelper.Debug(ToString(), "prc_cgthsq_submit error锛�" + ex.Message);
m.outMsg = ex.Message;
- return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default,
- ex.Message);
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, ex.Message);
}
finally
{
@@ -199,9 +197,15 @@
{
Guid? guid = model.Guid; //涓婚敭
string bz = model.Remark; //澶囨敞
+ string thOrgId = model.thOrgId;//閫�璐х粍缁�
string gysId = model.SuppId; //渚涘簲鍟�
string Fmrmode = model.Fmrmode;//鏂瑰紡
string Reason = model.Reason;//鍘熷洜
+ string fHasLink = model.fHasLink;
+ string fRequireOrgId = model.fRequireOrgId;
+ string fPurchaseDeptId = model.fPurchaseDeptId;
+ string fPurchaserId = model.fPurchaserId;
+ string fOwnerIdHead = model.fOwnerIdHead;
StringBuilder _sb = new StringBuilder();
string _split = "|";
foreach (var m in model.list)
@@ -211,6 +215,7 @@
+ m.Quantity + _split
+ m.Bz + _split
+ m.DepotId + _split
+ + m.ItemId + _split
+ (UtilityHelper.CheckGuid(_guid) ? _guid : Guid.Empty.ToString());
if (_sb.Length > 0)
_sb.Append("~");
@@ -241,6 +246,12 @@
new("@Fmrmode", Fmrmode),
new("@Reason", Reason),
new("@inEdtUserGuid", _userGuid),
+ new("@thOrgId", thOrgId),
+ new("@fHasLink", fHasLink),
+ new("@fRequireOrgId", fRequireOrgId),
+ new("@fPurchaseDeptId", fPurchaseDeptId),
+ new("@fPurchaserId", fPurchaserId),
+ new("@fOwnerIdHead", fOwnerIdHead),
new("@inLineList", _sb.ToString())
};
parameters[0].Direction = ParameterDirection.Output;
@@ -282,7 +293,7 @@
public ReturnDto<int?> DeleteModelOrMx([FromBody] dynamic model)
{
int? rtnInt = (int)ReturnCode.Default;
- Guid? guid = model.guid;
+ Guid? guid = model.guid;
string mxGuid = model.mxGuid;
var _outMsg = "";
var _outSum = -1;
diff --git a/WebApi/Gs.QiTaCk/MesCgytDjManager.cs b/WebApi/Gs.QiTaCk/MesCgytDjManager.cs
new file mode 100644
index 0000000..9eb8d22
--- /dev/null
+++ b/WebApi/Gs.QiTaCk/MesCgytDjManager.cs
@@ -0,0 +1,205 @@
+锘縰sing System.Data;
+using System.Data.SqlClient;
+using System.Dynamic;
+using Gs.Toolbox;
+using Gs.Toolbox.ApiCore.Abstract.Mvc;
+using Gs.Toolbox.ApiCore.Common.Mvc;
+using Gs.Toolbox.ApiCore.Group;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using static Gs.Toolbox.UtilityHelper;
+
+
+namespace Gs.QiTaCk
+{
+ /// <summary>
+ /// 浠撳簱楠岄��
+ /// </summary>
+
+ [ApiGroup(ApiGroupNames.QTCK)]
+ public class MesCgytDjManager : IRomteService
+ {
+ private readonly IHttpContextAccessor _http;
+
+ private readonly string _userCode, _userGuid, _orgFids;
+
+ public MesCgytDjManager(IHttpContextAccessor httpContextAccessor)
+ {
+ _http = httpContextAccessor;
+ (_userCode, _userGuid, _orgFids) =
+ GetUserGuidAndOrgGuid(_http);
+ }
+
+ /// <summary>
+ /// 璇诲彇鍒楄〃锛屾敮鎸佸垎椤�
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<PageList<dynamic>> GetListPage(
+ [FromBody] dynamic model)
+ {
+ int currentPage = model.currentPage;
+ int everyPageSize = model.everyPageSize;
+ string sortName = model.sortName;
+ string keyWhere = model.keyWhere;
+ SqlParameter[] parameters =
+ {
+ new("@inCurrentPage", currentPage),
+ new("@inEveryPageSize", everyPageSize),
+ new("@inSortName", sortName),
+ new("@inSortOrder", ""),
+ new("@inQueryWhere", keyWhere),
+ new("@inFid", ""),
+ new("@inP1", ""),
+ new("@inP2", ""),
+ new("@inP3", ""),
+ new("@inP4", "")
+ };
+ var dset = new DataSet();
+ var _pglist = new PageList<dynamic>
+ {
+ total = 0,
+ everyPageSize = 0,
+ pages = 0,
+ list = new List<dynamic>()
+ };
+ try
+ {
+ dset = DbHelperSQL.RunProcedure("prc_cgyt_dj_lst", parameters,
+ "0");
+ if (dset != null && dset.Tables.Count > 0 &&
+ dset.Tables[0].Rows.Count > 0) //鏈夋暟鎹�
+ {
+ var intTotal =
+ int.Parse(dset.Tables[1].Rows[0]["intTotal"].ToString());
+ var pages = intTotal % everyPageSize != 0
+ ? intTotal / everyPageSize + 1
+ : intTotal / everyPageSize;
+ _pglist.total = intTotal;
+ _pglist.everyPageSize = everyPageSize;
+ _pglist.pages = pages;
+ var _dy = dset.Tables[0].TableToDynamicList();
+ _pglist.list = _dy;
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), ex.Message);
+ return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
+ ReturnCode.Exception, ex.Message);
+ }
+
+ return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
+ ReturnCode.Success, "璇诲彇鎴愬姛");
+ }
+
+ /// <summary>
+ /// 璇诲彇
+ /// </summary>
+ /// <param name="guid"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<ExpandoObject> GetModel([FromBody] dynamic model)
+ {
+ string guid = model.guid.ToString();
+ dynamic m = new ExpandoObject();
+ m.list = new List<dynamic>();
+ m.list2 = new List<dynamic>();
+ SqlParameter[] parameters =
+ {
+ new("@inMainGuid", guid),
+ new("@inP1", ""),
+ new("@inP2", ""),
+ new("@inP3", ""),
+ new("@inP4", "")
+ };
+ var dset = new DataSet();
+ try
+ {
+ dset = DbHelperSQL.RunProcedure("[prc_cgyt_dj_mx]",
+ parameters, "0");
+ if (dset != null && dset.Tables.Count > 0 &&
+ dset.Tables[0].Rows.Count > 0)
+ {
+ var dr = dset.Tables[0].Rows[0];
+ m = dr.RowToDynamic();
+ var _tb = dset.Tables[1].TableToDynamicList();
+ m.list = _tb;
+ var _tb2 = dset.Tables[2].TableToDynamicList();
+ m.list2 = _tb2;
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), ex.Message);
+ }
+
+ if (m != null)
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success,
+ "璇诲彇鎴愬姛锛�");
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default,
+ "璇诲彇澶辫触锛�");
+ }
+
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="mode"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<ExpandoObject> EditModelSubmit([FromBody] dynamic mode)
+ {
+ string _guid = mode.guid;
+ string _inFieldValue = mode.inFieldValue;
+ string _proName = "prc_cgyt_dj_submit";
+ dynamic m = new ExpandoObject();
+ m.outSum = -1;
+ m.outMsg = "";
+ using (var conn = new SqlConnection(DbHelperSQL.strConn))
+ {
+ using (var cmd = new SqlCommand(_proName, conn))
+ {
+ try
+ {
+ conn.Open();
+ cmd.CommandType = CommandType.StoredProcedure;
+ SqlParameter[] parameters =
+ {
+ new("@outMsg", SqlDbType.NVarChar, 2500),
+ new("@outSum", SqlDbType.Int),
+ new("@inEdtUserGuid", _userGuid),
+ new("@inOrderGuid", _guid),
+ new("@inFieldValue", _inFieldValue),
+ new("@in1", ""),
+ new("@in2", "")
+ };
+ parameters[0].Direction = ParameterDirection.Output;
+ parameters[1].Direction = ParameterDirection.Output;
+ foreach (var parameter in parameters)
+ cmd.Parameters.Add(parameter);
+ cmd.ExecuteNonQuery();
+ m.outMsg = parameters[0].Value.ToString();
+ m.outSum = int.Parse(parameters[1].Value.ToString());
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(),
+ "prc_cgthsq_dj_submit error锛�" + ex.Message);
+ m.outMsg = ex.Message;
+ return ReturnDto<dynamic>.QuickReturn(m,
+ ReturnCode.Default,
+ ex.Message);
+ }
+ finally
+ {
+ conn.Close();
+ }
+ }
+ }
+
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success,
+ "鎿嶄綔鎴愬姛锛�");
+ }
+ }
+}
\ No newline at end of file
diff --git a/WebApi/Gs.QiTaCk/MesItemBlManager.cs b/WebApi/Gs.QiTaCk/MesItemBlManager.cs
index 468676a..29da1bb 100644
--- a/WebApi/Gs.QiTaCk/MesItemBlManager.cs
+++ b/WebApi/Gs.QiTaCk/MesItemBlManager.cs
@@ -8,7 +8,6 @@
using Gs.Toolbox.ApiCore.Group;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
-using Newtonsoft.Json.Linq;
using static Gs.Toolbox.UtilityHelper;
namespace Gs.QiTaCk
@@ -331,7 +330,7 @@
return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Exception,
_outMsg);
return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Success, _outMsg);
- }
+ }
}
}
\ No newline at end of file
diff --git a/WebApi/Gs.QiTaCk/MesItemQtManager.cs b/WebApi/Gs.QiTaCk/MesItemQtManager.cs
index 845ebb3..0accc3d 100644
--- a/WebApi/Gs.QiTaCk/MesItemQtManager.cs
+++ b/WebApi/Gs.QiTaCk/MesItemQtManager.cs
@@ -207,8 +207,8 @@
string inLyCus = model.inLyCus;//棰嗙敤瀹㈡埛
string inLyDepart = model.inLyDepart;//棰嗙敤閮ㄩ棬
string inKcfx = model.inKcfx;//搴撳瓨鏂瑰悜
- string inFlck=model.inFlck;//鍙戞枡浠撳簱
string inSource = model.inSource;
+ string qtlx = model.qtlx;//鍚庢潵澧炲姞鐨勭被鍨�
var _sb = new StringBuilder();
var _split = "|";
foreach (var m in model.list)
@@ -218,6 +218,7 @@
m.ItemId + _split
+ m.Sqsl + _split
+ m.Bz + _split
+ + m.DepotId + _split
+ (UtilityHelper.CheckGuid(_guid) ? _guid : Guid.Empty.ToString());
if (_sb.Length > 0)
_sb.Append("~");
@@ -252,10 +253,10 @@
new("@inLyCus", inLyCus),
new("@inLyDepart", inLyDepart),
new("@inKcfx", inKcfx),
- new("@inFlck", inFlck),
new("@inEdtUserGuid", _userGuid),
new("@inLineList", _sb.ToString()),
- new("@inSource", inSource)
+ new("@inSource", inSource),
+ new("@qtlx", qtlx)
};
parameters[0].Direction = ParameterDirection.Output;
parameters[1].Direction = ParameterDirection.Output;
diff --git a/WebApi/Gs.QiTaRk/MesItemQtrkManager.cs b/WebApi/Gs.QiTaRk/MesItemQtrkManager.cs
index 2a861f3..13e5ccf 100644
--- a/WebApi/Gs.QiTaRk/MesItemQtrkManager.cs
+++ b/WebApi/Gs.QiTaRk/MesItemQtrkManager.cs
@@ -207,7 +207,8 @@
string kcfx = model.kcfx;//搴撳瓨鏂瑰悜
string hzlx = model.hzlx;//璐т富绫诲瀷
string inHz = model.inHz;//璐т富缁勭粐
- string inSource=model.inSource;
+ string inSource = model.inSource;
+ string qtlx = model.qtlx;//鍚庢潵澧炲姞鐨勭被鍨�
var _sb = new StringBuilder();
var _split = "|";
foreach (var m in model.list)
@@ -254,7 +255,8 @@
new("@inHz", inHz),
new("@inEdtUserGuid", _userGuid),
new("@inLineList", _sb.ToString()),
- new("@inSource", inSource)
+ new("@inSource", inSource),
+ new("@qtlx", qtlx)
};
parameters[0].Direction = ParameterDirection.Output;
parameters[1].Direction = ParameterDirection.Output;
diff --git a/WebApi/Gs.Report/BTDetails.cs b/WebApi/Gs.Report/BTDetails.cs
new file mode 100644
index 0000000..07e57e9
--- /dev/null
+++ b/WebApi/Gs.Report/BTDetails.cs
@@ -0,0 +1,126 @@
+锘縰sing Gs.Toolbox;
+using Gs.Toolbox.ApiCore.Abstract.Mvc;
+using Gs.Toolbox.ApiCore.Common.Mvc;
+using Gs.Toolbox.ApiCore.Group;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using System.Data;
+using System.Data.SqlClient;
+using System.Dynamic;
+using static Gs.Toolbox.UtilityHelper;
+
+
+namespace Gs.Report
+{
+
+ [ApiGroup(ApiGroupNames.Report)]
+ public class BTDetails : IRomteService
+ {
+ private readonly IHttpContextAccessor _http;
+ private readonly string _userCode, _userGuid, _orgFids;
+
+ public BTDetails(IHttpContextAccessor httpContextAccessor)
+ {
+ _http = httpContextAccessor;
+ (_userCode, _userGuid, _orgFids) =
+ GetUserGuidAndOrgGuid(_http);
+ }
+
+ /// <summary>
+ /// 鏉$爜浜ゆ槗鏄庣粏
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<PageList<dynamic>> GetListPage([FromBody] dynamic model)
+ {
+ int currentPage = model.currentPage;
+ int everyPageSize = model.everyPageSize;
+ string sortName = model.sortName;
+ string keyWhere = model.keyWhere;
+ SqlParameter[] parameters =
+ {
+ new("@inCurrentPage", currentPage),//
+ new("@inEveryPageSize", everyPageSize),
+ new("@inSortName", sortName),
+ new("@inSortOrder", ""),
+ new("@inQueryWhere", keyWhere),
+ new("@inFid", ""),
+ new("@inP1", ""),
+ new("@inP2", ""),
+ new("@inP3", ""),
+ new("@inP4", "")
+ };
+ var dset = new DataSet();
+ var _pglist = new PageList<dynamic>
+ {
+ total = 0,
+ everyPageSize = 0,
+ pages = 0,
+ list = new List<dynamic>()
+ };
+ try
+ {
+ dset = DbHelperSQL.RunProcedure("BTDetails", parameters, "0");
+ if (dset != null && dset.Tables.Count > 0 &&
+ dset.Tables[0].Rows.Count > 0) //鏈夋暟鎹�
+ {
+ var intTotal =
+ int.Parse(dset.Tables[1].Rows[0]["intTotal"].ToString());
+ var pages = intTotal % everyPageSize != 0
+ ? intTotal / everyPageSize + 1
+ : intTotal / everyPageSize;
+ _pglist.total = intTotal;
+ _pglist.everyPageSize = everyPageSize;
+ _pglist.pages = pages;
+ var _dy = dset.Tables[0].TableToDynamicList();
+ _pglist.list = _dy;
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), ex.Message);
+ }
+
+ return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
+ ReturnCode.Success, "璇诲彇鎴愬姛");
+ }
+
+ /// <summary>
+ /// 璇诲彇
+ /// </summary>
+ /// <param name="guid"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<ExpandoObject> GetModel([FromBody] dynamic model)
+ {
+ string guid = model.guid.ToString();
+ dynamic m = new ExpandoObject();
+ SqlParameter[] parameters =
+ {
+ new("@inMainGuid", guid),
+ };
+ var dset = new DataSet();
+ try
+ {
+ dset = DbHelperSQL.RunProcedure("[BTDetails_MX]", parameters, "0");
+ if (dset != null && dset.Tables.Count > 0 &&
+ dset.Tables[0].Rows.Count > 0)
+ {
+ var dr = dset.Tables[0].Rows[0];
+ m = dr.RowToDynamic();
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), ex.Message);
+ }
+
+ if (m != null)
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success,
+ "璇诲彇鎴愬姛锛�");
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, "璇诲彇澶辫触锛�");
+ }
+ }
+}
+
diff --git a/WebApi/Gs.Report/CkController.cs b/WebApi/Gs.Report/CkController.cs
index 5a00caa..58ce2c1 100644
--- a/WebApi/Gs.Report/CkController.cs
+++ b/WebApi/Gs.Report/CkController.cs
@@ -1,11 +1,12 @@
-锘縰sing System.Data;
-using System.Data.SqlClient;
-using Gs.Toolbox;
+锘縰sing Gs.Toolbox;
using Gs.Toolbox.ApiCore.Abstract.Mvc;
using Gs.Toolbox.ApiCore.Common.Mvc;
using Gs.Toolbox.ApiCore.Group;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
+using System.Data;
+using System.Data.SqlClient;
+using System.Dynamic;
using static Gs.Toolbox.UtilityHelper;
@@ -60,7 +61,7 @@
};
try
{
- dset = DbHelperSQL.RunProcedure("sys_rpt_cktm", parameters, "0");
+ dset = DbHelperSQL.RunProcedure("report_cktm", parameters, "0");
if (dset != null && dset.Tables.Count > 0 &&
dset.Tables[0].Rows.Count > 0) //鏈夋暟鎹�
{
@@ -143,5 +144,223 @@
return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
ReturnCode.Success, "璇诲彇鎴愬姛");
}
+
+
+
+ /// <summary>
+ /// 楠岄��鏄庣粏
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<PageList<dynamic>> GetListPageYtmx([FromBody] dynamic model)
+ {
+ int currentPage = model.currentPage;
+ int everyPageSize = model.everyPageSize;
+ string sortName = model.sortName;
+ string keyWhere = model.keyWhere;
+ SqlParameter[] parameters =
+ {
+ new("@inCurrentPage", currentPage),
+ new("@inEveryPageSize", everyPageSize),
+ new("@inSortName", sortName),
+ new("@inSortOrder", ""),
+ new("@inQueryWhere", keyWhere),
+ new("@inFid", ""),
+ new("@inP1", ""),
+ new("@inP2", ""),
+ new("@inP3", ""),
+ new("@inP4", "")
+ };
+ var dset = new DataSet();
+ var _pglist = new PageList<dynamic>
+ {
+ total = 0,
+ everyPageSize = 0,
+ pages = 0,
+ list = new List<dynamic>()
+ };
+ try
+ {
+ dset = DbHelperSQL.RunProcedure("report_ytmx", parameters, "0");
+ if (dset != null && dset.Tables.Count > 0 &&
+ dset.Tables[0].Rows.Count > 0) //鏈夋暟鎹�
+ {
+ var intTotal =
+ int.Parse(dset.Tables[1].Rows[0]["intTotal"].ToString());
+ var pages = intTotal % everyPageSize != 0
+ ? intTotal / everyPageSize + 1
+ : intTotal / everyPageSize;
+ _pglist.total = intTotal;
+ _pglist.everyPageSize = everyPageSize;
+ _pglist.pages = pages;
+ var _dy = dset.Tables[0].TableToDynamicList();
+ _pglist.list = _dy;
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), ex.Message);
+ }
+
+ return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
+ ReturnCode.Success, "璇诲彇鎴愬姛");
+ }
+
+
+ /// <summary>
+ /// 閫佽揣璁″垝鏄庣粏
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<PageList<dynamic>> GetListPageShjh([FromBody] dynamic model)
+ {
+ int currentPage = model.currentPage;
+ int everyPageSize = model.everyPageSize;
+ string sortName = model.sortName;
+ string keyWhere = model.keyWhere;
+ SqlParameter[] parameters =
+ {
+ new("@inCurrentPage", currentPage),
+ new("@inEveryPageSize", everyPageSize),
+ new("@inSortName", sortName),
+ new("@inSortOrder", ""),
+ new("@inQueryWhere", keyWhere),
+ new("@inFid", ""),
+ new("@inP1", ""),
+ new("@inP2", ""),
+ new("@inP3", ""),
+ new("@inP4", "")
+ };
+ var dset = new DataSet();
+ var _pglist = new PageList<dynamic>
+ {
+ total = 0,
+ everyPageSize = 0,
+ pages = 0,
+ list = new List<dynamic>()
+ };
+ try
+ {
+ dset = DbHelperSQL.RunProcedure("report_shjh", parameters, "0");
+ if (dset != null && dset.Tables.Count > 0 &&
+ dset.Tables[0].Rows.Count > 0) //鏈夋暟鎹�
+ {
+ var intTotal =
+ int.Parse(dset.Tables[1].Rows[0]["intTotal"].ToString());
+ var pages = intTotal % everyPageSize != 0
+ ? intTotal / everyPageSize + 1
+ : intTotal / everyPageSize;
+ _pglist.total = intTotal;
+ _pglist.everyPageSize = everyPageSize;
+ _pglist.pages = pages;
+ var _dy = dset.Tables[0].TableToDynamicList();
+ _pglist.list = _dy;
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), ex.Message);
+ }
+ return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
+ ReturnCode.Success, "璇诲彇鎴愬姛");
+ }
+
+ /// <summary>
+ /// 璇诲彇
+ /// </summary>
+ /// <param name="guid"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<ExpandoObject> GetModel([FromBody] dynamic model)
+ {
+ string guid = model.guid.ToString();
+ dynamic m = new ExpandoObject();
+ SqlParameter[] parameters =
+ {
+ new("@inMainGuid", guid),
+ };
+ var dset = new DataSet();
+ try
+ {
+ dset = DbHelperSQL.RunProcedure("[report_cktm_MX]", parameters, "0");
+ if (dset != null && dset.Tables.Count > 0 &&
+ dset.Tables[0].Rows.Count > 0)
+ {
+ var dr = dset.Tables[0].Rows[0];
+ m = dr.RowToDynamic();
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), ex.Message);
+ }
+
+ if (m != null)
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success,
+ "璇诲彇鎴愬姛锛�");
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, "璇诲彇澶辫触锛�");
+ }
+
+
+ /// <summary>
+ /// 鍙婃椂搴撳瓨宸紓琛�
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<PageList<dynamic>> GetListPageJskc([FromBody] dynamic model)
+ {
+ int currentPage = model.currentPage;
+ int everyPageSize = model.everyPageSize;
+ string sortName = model.sortName;
+ string keyWhere = model.keyWhere;
+ SqlParameter[] parameters =
+ {
+ new("@inCurrentPage", currentPage),
+ new("@inEveryPageSize", everyPageSize),
+ new("@inSortName", sortName),
+ new("@inSortOrder", ""),
+ new("@inQueryWhere", keyWhere),
+ new("@inFid", ""),
+ new("@inP1", ""),
+ new("@inP2", ""),
+ new("@inP3", ""),
+ new("@inP4", "")
+ };
+ var dset = new DataSet();
+ var _pglist = new PageList<dynamic>
+ {
+ total = 0,
+ everyPageSize = 0,
+ pages = 0,
+ list = new List<dynamic>()
+ };
+ try
+ {
+ dset = DbHelperSQL.RunProcedure("report_jskc", parameters, "0");
+ if (dset != null && dset.Tables.Count > 0 &&
+ dset.Tables[0].Rows.Count > 0) //鏈夋暟鎹�
+ {
+ var intTotal =
+ int.Parse(dset.Tables[1].Rows[0]["intTotal"].ToString());
+ var pages = intTotal % everyPageSize != 0
+ ? intTotal / everyPageSize + 1
+ : intTotal / everyPageSize;
+ _pglist.total = intTotal;
+ _pglist.everyPageSize = everyPageSize;
+ _pglist.pages = pages;
+ var _dy = dset.Tables[0].TableToDynamicList();
+ _pglist.list = _dy;
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), ex.Message);
+ }
+ return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
+ ReturnCode.Success, "璇诲彇鎴愬姛");
+ }
}
}
diff --git a/WebApi/Gs.Report/QLController.cs b/WebApi/Gs.Report/QLController.cs
new file mode 100644
index 0000000..3f69cd0
--- /dev/null
+++ b/WebApi/Gs.Report/QLController.cs
@@ -0,0 +1,164 @@
+锘縰sing Gs.Toolbox;
+using Gs.Toolbox.ApiCore.Abstract.Mvc;
+using Gs.Toolbox.ApiCore.Common.Mvc;
+using Gs.Toolbox.ApiCore.Group;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using System.Data;
+using System.Data.SqlClient;
+using System.Dynamic;
+using System.Security.Cryptography.X509Certificates;
+using static Gs.Toolbox.UtilityHelper;
+
+namespace Gs.Report
+{
+ [ApiGroup(ApiGroupNames.Report)]
+ public class QLController : IRomteService
+ {
+ private readonly IHttpContextAccessor _http;
+ private readonly string _userCode, _userGuid, _orgFids;
+
+ public QLController(IHttpContextAccessor httpContextAccessor)
+ {
+ _http = httpContextAccessor;
+ (_userCode, _userGuid, _orgFids) =
+ GetUserGuidAndOrgGuid(_http);
+ }
+
+ /// <summary>
+ /// 娆犳枡琛�
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<ExpandoObject> GetQLList([FromBody] dynamic model)
+ {
+ string orgId = model.orgId ?? "";
+ string beginDate = model.beginDate ?? DateTime.Now.AddMonths(-1).ToString();
+ string endDate = model.endDate ?? DateTime.Now.ToString();
+ dynamic m = new ExpandoObject();
+ m.list = new List<dynamic>();
+ SqlParameter[] parameters =
+ {
+ new("@orgId", orgId),
+ new("@beginDate", beginDate),
+ new("@endDate", endDate)
+ };
+ var dset = new DataSet();
+ try
+ {
+ dset = DbHelperSQL.RunProcedure("report_qlmx", parameters, "0");
+ if (dset != null && dset.Tables.Count > 0 &&
+ dset.Tables[0].Rows.Count > 0)
+ {
+ //var dr = dset.Tables[0].Rows[0];
+ //m = dr.RowToDynamic();
+ var _tb = dset.Tables[0].TableToDynamicList();
+ m.list = _tb;
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), ex.Message);
+ }
+ if (m != null)
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "璇诲彇鎴愬姛锛�");
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, "璇诲彇澶辫触锛�");
+ }
+
+
+ /// <summary>
+ /// 閫佽揣璁″垝
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<ExpandoObject> GetShjhList([FromBody] dynamic model)
+ {
+ string orgId = model.orgId ?? "";
+ string beginDate = model.beginDate ?? DateTime.Now.AddMonths(-1).ToString();
+ string endDate = model.endDate ?? DateTime.Now.ToString();
+ dynamic m = new ExpandoObject();
+ m.list = new List<dynamic>();
+ SqlParameter[] parameters =
+ {
+ new("@orgId", orgId),
+ new("@beginDate", beginDate),
+ new("@endDate", endDate)
+ };
+ var dset = new DataSet();
+ try
+ {
+ dset = DbHelperSQL.RunProcedure("report_shjh", parameters, "0");
+ if (dset != null && dset.Tables.Count > 0 &&
+ dset.Tables[0].Rows.Count > 0)
+ {
+ var _tb = dset.Tables[0].TableToDynamicList();
+ m.list = _tb;
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), ex.Message);
+ }
+ if (m != null)
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "璇诲彇鎴愬姛锛�");
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, "璇诲彇澶辫触锛�");
+ }
+
+ /// <summary>
+ /// 鐗╂枡娆犳枡琛�
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<PageList<dynamic>> GetWLQLList([FromBody] dynamic model)
+ {
+ int currentPage = model.currentPage;
+ int everyPageSize = model.everyPageSize;
+ string sortName = model.sortName;
+ string keyWhere = model.keyWhere;
+ SqlParameter[] parameters =
+ {
+ new("@inCurrentPage", currentPage),
+ new("@inEveryPageSize", everyPageSize),
+ new("@inSortName", sortName),
+ new("@inSortOrder", ""),
+ new("@inQueryWhere", keyWhere),
+ };
+ var dset = new DataSet();
+ var _pglist = new PageList<dynamic>
+ {
+ total = 0,
+ everyPageSize = 0,
+ pages = 0,
+ list = new List<dynamic>()
+ };
+ try
+ {
+ dset = DbHelperSQL.RunProcedure("report_ItemQL", parameters, "0");
+ if (dset != null && dset.Tables.Count > 0 &&
+ dset.Tables[0].Rows.Count > 0) //鏈夋暟鎹�
+ {
+ var intTotal =
+ int.Parse(dset.Tables[1].Rows[0]["intTotal"].ToString());
+ var pages = intTotal % everyPageSize != 0
+ ? intTotal / everyPageSize + 1
+ : intTotal / everyPageSize;
+ _pglist.total = intTotal;
+ _pglist.everyPageSize = everyPageSize;
+ _pglist.pages = pages;
+ var _dy = dset.Tables[0].TableToDynamicList();
+ _pglist.list = _dy;
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), ex.Message);
+ }
+
+ return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
+ ReturnCode.Success, "璇诲彇鎴愬姛");
+ }
+ }
+}
diff --git a/WebApi/Gs.Report/ReportController.cs b/WebApi/Gs.Report/ReportController.cs
index 5c65426..8a27b27 100644
--- a/WebApi/Gs.Report/ReportController.cs
+++ b/WebApi/Gs.Report/ReportController.cs
@@ -16,7 +16,7 @@
{
private readonly IHttpContextAccessor _http;
private readonly string _userCode, _userGuid, _orgFids;
-
+ private readonly string _customTag = "瀹㈡埛妯℃澘";
public ReportController(IHttpContextAccessor httpContextAccessor)
{
_http = httpContextAccessor;
@@ -25,7 +25,7 @@
}
/// <summary>
- /// 鏍规嵁鎶ヨ〃鍙傛暟璇诲彇鎶ヨ〃鍚嶅瓧
+ /// 鏍规嵁鎶ヨ〃鍙傛暟璇诲彇鎶ヨ〃鍚嶅瓧(瀵瑰簲鐨勫瓨鍌ㄨ繃绋�)
/// </summary>
/// <returns></returns>
private string _rptGetParameterName(string str)
@@ -87,7 +87,6 @@
m.zb = new List<dynamic>();
m.mx1 = new List<dynamic>();
m.mx2 = new List<dynamic>();
- var sbSql = new StringBuilder();
var _blDate = false;
try
{
@@ -111,7 +110,14 @@
if (_blDate == false)
return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default,
"璇诲彇澶辫触锛屾病鏈夊垵濮嬪寲妯℃澘锛�");
- //璇绘暟鎹�
+ //濡傛灉鏄璁℃ā寮忥紝閫�鍑�
+ if (isDesign == 1)
+ {
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "璇诲彇鎴愬姛锛�");
+ }
+ //璇婚渶瑕佹墦鍗扮殑鏁版嵁锛岀敤鏉ュ~鍏呮ā鏉�
+ if (_rptParameter.StartsWith(_customTag))
+ rptParameterName = "rpt_hgm";
var dset = new DataSet();
using (var conn = new SqlConnection(DbHelperSQL.strConn))
{
@@ -139,10 +145,6 @@
}
}
conn.Close();
- }
- if (isDesign == 1)
- {
- return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "璇诲彇鎴愬姛锛�");
}
//0鏄姸鎬侊紝1鏄富琛紝2鏄槑缁嗚〃锛�3鏄槑缁嗚〃
if (dset.Tables[0].Rows[0]["msgState"].ToString() == "-1")
@@ -222,6 +224,8 @@
return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "鎿嶄綔鎴愬姛锛�");
}
+
+ #region MyRegion
/// <summary>
///
/// </summary>
@@ -230,9 +234,17 @@
[RequestMethod(RequestMethods.POST)]
public ReturnDto<List<dynamic>> GetTemplateList([FromBody] dynamic model)
{
+ string keyType = model.keyType;
+
List<dynamic> lst = new List<dynamic>();
System.Text.StringBuilder sbSql = new StringBuilder();
- sbSql.Append("select [GUID],[REPORT_TYPE],[REPORT_NAME] from [dbo].[SYS_REPORT_TEMPLATE] order by [REPORT_NAME] asc");
+ if (keyType == "瀹㈡埛妯℃澘")
+ {
+ sbSql.Append("select [GUID],[REPORT_TYPE],[REPORT_NAME] from [dbo].[SYS_REPORT_TEMPLATE] where REPORT_TYPE like '" + _customTag + "%' ");
+ sbSql.Append(" union all select [GUID],[REPORT_TYPE],[REPORT_NAME] from [dbo].[SYS_REPORT_TEMPLATE] where REPORT_TYPE='rpt_hgm' order by REPORT_TYPE asc");
+ }
+ else
+ sbSql.Append("select [GUID],[REPORT_TYPE],[REPORT_NAME] from [dbo].[SYS_REPORT_TEMPLATE] order by [REPORT_TYPE] desc");
var dset = new DataSet();
try
{
@@ -248,4 +260,90 @@
return ReturnDto<List<dynamic>>.QuickReturn(lst, ReturnCode.Success,
"璇诲彇鎴愬姛锛�");
}
+
+ /// <summary>
+ /// 鍔犲叆
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<int?> AddModel([FromBody] dynamic model)
+ {
+ string reportName = model.reportName;
+ string reportType = _customTag + DateTime.Now.ToString("MMddHHmmff");
+ int rtnInt = (int)ReturnCode.Default;
+ using (var conn = new SqlConnection(DbHelperSQL.strConn))
+ {
+ using (var cmd = new SqlCommand("[prc_report_edt]", conn))
+ {
+ try
+ {
+ conn.Open();
+ cmd.CommandType = CommandType.StoredProcedure;
+ SqlParameter[] parameters =
+ {
+ new("@outGuid", SqlDbType.NVarChar, 100),
+ new("@outMsg", SqlDbType.NVarChar, 300),
+ new("@edtUserGuid", _userGuid),
+ //new("@rptData", rptData),
+ new("@rptType", reportType),
+ new("@reportName", reportName)
+ };
+ parameters[0].Direction = ParameterDirection.Output;
+ parameters[1].Direction = ParameterDirection.Output;
+ foreach (var parameter in parameters)
+ cmd.Parameters.Add(parameter);
+ rtnInt = cmd.ExecuteNonQuery();
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(),
+ "AddModel error锛�" + ex.Message);
+ }
+ finally
+ {
+ conn.Close();
+ }
+ }
+ }
+ if (rtnInt > 0)
+ return ReturnDto<int>.QuickReturn(default(int?), ReturnCode.Success, "鎿嶄綔鎴愬姛锛�");
+ else
+ return ReturnDto<int>.QuickReturn(default(int?), ReturnCode.Exception, "鎿嶄綔澶辫触锛岃閲嶈瘯锛�");
+ }
+
+ /// <summary>
+ /// 绉诲嚭
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<int?> DeleteModel([FromBody] dynamic model)
+ {
+ string guid = model.guid;
+ int rtnInt = (int)ReturnCode.Default;
+ if (guid.ToUpper() == "AF1105F3-1CFA-4E48-BE07-6EC3A184918C".ToUpper())
+ {
+ return ReturnDto<int>.QuickReturn(default(int?), ReturnCode.Exception, "鎿嶄綔澶辫触锛岄粯璁ゆā鐗堬紝涓嶈兘鍒犻櫎锛�");
+ }
+ try
+ {
+ StringBuilder strSql = new StringBuilder();
+ strSql.Append(" delete from SYS_REPORT_TEMPLATE ");
+ strSql.Append(" where guid='" + guid + "'");
+ rtnInt = DbHelperSQL.ExecuteSql(strSql.ToString());
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(this.ToString(), "DeleteModel error锛�" + ex.Message);
+ rtnInt = (int)ReturnCode.Exception;
+ return ReturnDto<int>.QuickReturn(default(int?), ReturnCode.Exception, "鎿嶄綔澶辫触锛�" + ex.Message);
+ }
+ if (rtnInt > 0)
+ return ReturnDto<int>.QuickReturn(default(int?), ReturnCode.Success, "鎿嶄綔鎴愬姛锛�");
+ else
+ return ReturnDto<int>.QuickReturn(default(int?), ReturnCode.Exception, "鎿嶄綔澶辫触锛岃閲嶈瘯锛�");
+ }
+ #endregion
+
}
\ No newline at end of file
diff --git a/WebApi/Gs.Report/WOTraceCodes.cs b/WebApi/Gs.Report/WOTraceCodes.cs
new file mode 100644
index 0000000..2eada14
--- /dev/null
+++ b/WebApi/Gs.Report/WOTraceCodes.cs
@@ -0,0 +1,89 @@
+锘縰sing System.Data;
+using System.Data.SqlClient;
+using Gs.Toolbox;
+using Gs.Toolbox.ApiCore.Abstract.Mvc;
+using Gs.Toolbox.ApiCore.Common.Mvc;
+using Gs.Toolbox.ApiCore.Group;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using static Gs.Toolbox.UtilityHelper;
+
+
+namespace Gs.Report
+{
+
+ [ApiGroup(ApiGroupNames.Report)]
+ public class WOTraceCodes : IRomteService
+ {
+ private readonly IHttpContextAccessor _http;
+ private readonly string _userCode, _userGuid, _orgFids;
+
+ public WOTraceCodes(IHttpContextAccessor httpContextAccessor)
+ {
+ _http = httpContextAccessor;
+ (_userCode, _userGuid, _orgFids) =
+ GetUserGuidAndOrgGuid(_http);
+ }
+
+ /// <summary>
+ /// 鏌ヨ宸ュ崟杩芥函鐮�
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<PageList<dynamic>> GetListPage([FromBody] dynamic model)
+ {
+ int currentPage = model.currentPage;
+ int everyPageSize = model.everyPageSize;
+ string sortName = model.sortName;
+ string keyWhere = model.keyWhere;
+ SqlParameter[] parameters =
+ {
+ new("@inCurrentPage", currentPage),//
+ new("@inEveryPageSize", everyPageSize),
+ new("@inSortName", sortName),
+ new("@inSortOrder", ""),
+ new("@inQueryWhere", keyWhere),
+ new("@inFid", ""),
+ new("@inP1", ""),
+ new("@inP2", ""),
+ new("@inP3", ""),
+ new("@inP4", "")
+ };
+ var dset = new DataSet();
+ var _pglist = new PageList<dynamic>
+ {
+ total = 0,
+ everyPageSize = 0,
+ pages = 0,
+ list = new List<dynamic>()
+ };
+ try
+ {
+ dset = DbHelperSQL.RunProcedure("WOTraceCodes", parameters, "0");
+ if (dset != null && dset.Tables.Count > 0 &&
+ dset.Tables[0].Rows.Count > 0) //鏈夋暟鎹�
+ {
+ var intTotal =
+ int.Parse(dset.Tables[1].Rows[0]["intTotal"].ToString());
+ var pages = intTotal % everyPageSize != 0
+ ? intTotal / everyPageSize + 1
+ : intTotal / everyPageSize;
+ _pglist.total = intTotal;
+ _pglist.everyPageSize = everyPageSize;
+ _pglist.pages = pages;
+ var _dy = dset.Tables[0].TableToDynamicList();
+ _pglist.list = _dy;
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), ex.Message);
+ }
+
+ return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
+ ReturnCode.Success, "璇诲彇鎴愬姛");
+ }
+ }
+}
+
diff --git a/WebApi/Gs.Report/XlsInOutController.cs b/WebApi/Gs.Report/XlsInOutController.cs
index 7d2763a..78a536f 100644
--- a/WebApi/Gs.Report/XlsInOutController.cs
+++ b/WebApi/Gs.Report/XlsInOutController.cs
@@ -27,6 +27,70 @@
}
/// <summary>
+ /// 閫氱敤瀛樺偍杩囩▼鎵ц鏂规硶
+ /// </summary>
+ private DataSet RunProcedure(string procName, IDictionary<string, object> paramDict)
+ {
+ var dset = new DataSet();
+ using (var conn = new SqlConnection(DbHelperSQL.strConn))
+ {
+ using (var comm = new SqlCommand(procName, conn))
+ {
+ comm.CommandType = CommandType.StoredProcedure;
+ // 鍔ㄦ�佹坊鍔犲弬鏁�
+ foreach (var kvp in paramDict)
+ {
+ comm.Parameters.AddWithValue("@" + kvp.Key, kvp.Value == null? DBNull.Value : kvp.Value.ToString());
+ }
+ using (var adapter = new SqlDataAdapter(comm))
+ {
+ adapter.Fill(dset, "0");
+ }
+ }
+ }
+ return dset;
+ }
+
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<ExpandoObject> XlsOutView_NEW([FromBody] dynamic mode)
+ {
+ string rptParameter = mode.outParameter;
+ var paramDict = new Dictionary<string, object>();
+ // 鍔ㄦ�佽В鏋愬弬鏁�
+ if (mode.outParams != null)
+ {
+ foreach (var prop in mode.outParams)
+ {
+ string name = prop.Name;
+ object value = prop.Value;
+ paramDict.Add(name, value);
+ }
+ }
+ var _pdfFloder = AppSettingsHelper.getValueByKey("DownPath");
+ var _pdfName = Guid.NewGuid() + ".xls";
+ var _pdfSaveFolder = Path.Combine(AppContext.BaseDirectory, _pdfFloder);
+ if (!Directory.Exists(_pdfSaveFolder))
+ Directory.CreateDirectory(_pdfSaveFolder);
+ var pdfSavePath = Path.Combine(_pdfSaveFolder, _pdfName);
+ dynamic m = new ExpandoObject();
+ try
+ {
+ var dset = RunProcedure(rptParameter, paramDict);
+ if (dset == null || dset.Tables.Count <= 0)
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Exception, "娌℃湁鏌ヨ鍒颁换浣曟暟鎹�");
+ var ary = new ArrayList();
+ ExcelHelper.ExportAryHead(dset.Tables[0], ary, pdfSavePath);
+ m.fileUrl = "down/" + _pdfName;
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "璇诲彇鎴愬姛锛�");
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), ex.Message);
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Exception, "璇诲彇澶辫触," + ex.Message);
+ }
+ }
+
+ /// <summary>
/// 鏁版嵁瀵煎嚭锛岄渶瑕佸瓨鍌ㄨ繃绋嬫敮鎾戯紝鐩墠娌$敤鍒�
/// </summary>
/// <param name="mode"></param>
@@ -68,7 +132,6 @@
dt.Fill(dset, "0");
}
}
-
conn.Close();
}
@@ -205,7 +268,7 @@
[RequestMethod(RequestMethods.POST)]
public ReturnDto<ExpandoObject> XlsOutXunJian([FromBody] dynamic mode)
{
- string begDate = mode.begDate;
+ string guid = mode.guid;
var _pdfFloder = AppSettingsHelper.getValueByKey("DownPath");
var _pdfName = Guid.NewGuid() + ".xls";
var _pdfSaveFolder = Path.Combine(AppContext.BaseDirectory, _pdfFloder);
@@ -216,7 +279,7 @@
//璇绘暟鎹�
var dset = new DataSet();
SqlParameter[] parameters ={
- new("@begDate", begDate),
+ new("@inMainGuid", guid),
new("@inP1", ""),
new("@inP2", ""),
new("@inP3", ""),
@@ -241,6 +304,49 @@
}
}
+ /// <summary>
+ /// 瀵煎嚭鎴愬搧妫�楠屾姤鍛�
+ /// </summary>
+ /// <param name="mode"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<ExpandoObject> XlsOutChengPin([FromBody] dynamic mode)
+ {
+ string guid = mode.guid;
+ var _pdfFloder = AppSettingsHelper.getValueByKey("DownPath");
+ var _pdfName = Guid.NewGuid() + ".xls";
+ var _pdfSaveFolder = Path.Combine(AppContext.BaseDirectory, _pdfFloder);
+ if (!Directory.Exists(_pdfSaveFolder))
+ Directory.CreateDirectory(_pdfSaveFolder);
+ var pdfSavePath = Path.Combine(_pdfSaveFolder, _pdfName);
+ dynamic m = new ExpandoObject();
+ //璇绘暟鎹�
+ var dset = new DataSet();
+ SqlParameter[] parameters ={
+ new("@inMainGuid", guid),
+ new("@inP1", ""),
+ new("@inP2", ""),
+ new("@inP3", ""),
+ new("@inP4", "")};
+ try
+ {
+ dset = DbHelperSQL.RunProcedure("[xlsOutChengPin]", parameters, "0");
+ if (dset == null || dset.Tables.Count <= 0)
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Exception,
+ "娌℃湁鏌ヨ鍒颁换浣曟暟鎹�");
+ var ary = new ArrayList();
+ ExcelHelper.ExportChengPin(dset, pdfSavePath);
+ m.fileUrl = "down/" + _pdfName;
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success,
+ "璇诲彇鎴愬姛锛�");
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), ex.Message);
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Exception,
+ "璇诲彇澶辫触," + ex.Message);
+ }
+ }
#endregion
@@ -412,6 +518,7 @@
{
rtnInt = -1;
sbMsg.Append("鎿嶄綔澶辫触锛�" + ex.Message);
+ LogHelper.Debug("", "XlsInDaaHgm:" + ex.Message);
}
finally
{
@@ -466,7 +573,7 @@
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter[] parameters = new SqlParameter[] {
new SqlParameter("@outGuid",SqlDbType.NVarChar,100),
- new SqlParameter("@outMsg",SqlDbType.NVarChar,300),
+ new SqlParameter("@outMsg",SqlDbType.NVarChar,1200),
new SqlParameter("@inEdtUserGuid",_userGuid),
new SqlParameter("@tmpGuid",tmpGuid),
new SqlParameter("@strType",strType),
@@ -483,8 +590,7 @@
catch (Exception ex)
{
rtnInt = -1;
- LogHelper.Debug(this.ToString(), "XlsInItemJyxm:" + ex.Message);
- sbMsg.Append("鎿嶄綔澶辫触锛�" + ex.Message);
+ sbMsg.Append("鎿嶄綔澶辫触1锛�" + ex.Message);
}
finally
{
@@ -518,7 +624,6 @@
{
_it = 0;
_msg = "鎿嶄綔澶辫触锛氳鍙栨枃浠舵椂鍙戠敓閿欒:" + ex.Message;
- LogHelper.Debug("", "XlsInItemJyxm:" + ex.Message);
}
if (string.IsNullOrEmpty(files))
@@ -537,6 +642,7 @@
{
_it = 0;
_msg = "鎿嶄綔澶辫触锛孍xcelToTable璇诲彇涓婁紶鏂囦欢鍙戠敓閿欒锛�" + ex.Message;
+ LogHelper.Debug("", "getTable:" + ex.Message);
}
dt.Columns.Add("tmpGuid", Type.GetType("System.Guid"));
dt.Columns.Add("tmpIdx", Type.GetType("System.String"));
@@ -568,10 +674,8 @@
catch (Exception ex)
{
_it = 0;
+ LogHelper.Debug("", "getTable:" + ex.Message);
_msg = "鎿嶄綔澶辫触锛宐ulkCopy璇诲彇涓婁紶鏂囦欢鍙戠敓閿欒锛�" + ex.Message;
-
- LogHelper.Debug("", "XlsInItemJyxm:" + ex.Message);
-
}
}
}
diff --git a/WebApi/Gs.Sales/SalesManager.cs b/WebApi/Gs.Sales/SalesManager.cs
index 69c7041..ddad263 100644
--- a/WebApi/Gs.Sales/SalesManager.cs
+++ b/WebApi/Gs.Sales/SalesManager.cs
@@ -120,7 +120,7 @@
m = dr.RowToDynamic();
var _tb = dset.Tables[1].TableToDynamicList();
m.list = _tb;
-
+
}
}
catch (Exception ex)
@@ -137,7 +137,7 @@
/// <summary>
- /// 閫夋嫨寮圭獥
+ /// 閿�鍞嚭搴撴椂锛岄�夋嫨閿�鍞鍗�
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
@@ -287,7 +287,7 @@
/// <summary>
- /// 璇诲彇鍒楄〃锛屾敮鎸佸垎椤�
+ /// 閫夋嫨閿�鍞��璐х敵璇锋槑缁嗭紝鏈夋簮鍗曟嵁锛岄攢鍞嚭搴撳崟
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
@@ -298,7 +298,8 @@
int everyPageSize = model.everyPageSize;
string sortName = model.sortName;
string keyWhere = model.keyWhere;
- string keyType = model.keyType;//杩欐槸閿�鍞鍗曞彿
+ string inP1 = model.inP1;//杩欐槸瀹㈡埛id
+ string inP2 = model.inP2;//杩欐槸閿�鍞粍缁噄d
var dset = new DataSet();
try
{
@@ -315,8 +316,8 @@
new("@inSortName", sortName),
new("@inSortOrder", ""),
new("@inQueryWhere", keyWhere),
- new("@inP1",keyType),//杩欐槸閿�鍞鍗曞彿
- new("@inP2", "")
+ new("@inP1",inP1),
+ new("@inP2", inP2)
};
foreach (var parameter in parameters)
cmd.Parameters.Add(parameter);
@@ -359,5 +360,81 @@
return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
ReturnCode.Success, "璇诲彇鎴愬姛");
}
+
+
+ /// <summary>
+ /// 閫夋嫨閿�鍞��璐х敵璇锋槑缁嗭紝鏈夋簮鍗曟嵁锛岄攢鍞崟
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<PageList<dynamic>> SelectFormFhMxSales([FromBody] dynamic model)
+ {
+ int currentPage = model.currentPage;
+ int everyPageSize = model.everyPageSize;
+ string sortName = model.sortName;
+ string keyWhere = model.keyWhere;
+ string inP1 = model.inP1;//杩欐槸瀹㈡埛id
+ string inP2 = model.inP2;//杩欐槸閿�鍞粍缁噄d
+ var dset = new DataSet();
+ try
+ {
+ using (var conn = new SqlConnection(DbHelperSQL.strConn))
+ {
+ using (var cmd = new SqlCommand("[select_salesFhMxSales]", conn))
+ {
+ conn.Open();
+ cmd.CommandType = CommandType.StoredProcedure;
+ SqlParameter[] parameters =
+ {
+ new("@inCurrentPage", currentPage),
+ new("@inEveryPageSize", everyPageSize),
+ new("@inSortName", sortName),
+ new("@inSortOrder", ""),
+ new("@inQueryWhere", keyWhere),
+ new("@inP1",inP1),
+ new("@inP2", inP2)
+ };
+ foreach (var parameter in parameters)
+ cmd.Parameters.Add(parameter);
+ using (var dt = new SqlDataAdapter(cmd))
+ {
+ dt.Fill(dset, "0");
+ }
+ }
+ conn.Close();
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), "select_salesFhMxSales error锛�" + ex.Message);
+ return ReturnDto<PageList<dynamic>>.QuickReturn(default(PageList<dynamic>), ReturnCode.Exception, "璇诲彇澶辫触");
+ }
+
+ var _pglist = new PageList<dynamic>
+ {
+ total = 0,
+ everyPageSize = 0,
+ pages = 0,
+ list = new List<dynamic>()
+ };
+ if (dset != null && dset.Tables.Count > 0 &&
+ dset.Tables[0].Rows.Count > 0) //鏈夋暟鎹�
+ {
+ var intTotal =
+ int.Parse(dset.Tables[1].Rows[0]["intTotal"].ToString());
+ var pages = intTotal % everyPageSize != 0
+ ? intTotal / everyPageSize + 1
+ : intTotal / everyPageSize;
+ _pglist.total = intTotal;
+ _pglist.everyPageSize = everyPageSize;
+ _pglist.pages = pages;
+ var _dy = dset.Tables[0].TableToDynamicList();
+ _pglist.list = _dy;
+ }
+
+ return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
+ ReturnCode.Success, "璇诲彇鎴愬姛");
+ }
}
}
diff --git a/WebApi/Gs.Sales/SalesReturnManager.cs b/WebApi/Gs.Sales/SalesReturnManager.cs
index 2e9e9a9..c3b4470 100644
--- a/WebApi/Gs.Sales/SalesReturnManager.cs
+++ b/WebApi/Gs.Sales/SalesReturnManager.cs
@@ -144,10 +144,15 @@
{
Guid? guid = model.guid; //涓婚敭
string djlx = model.djlx;//鍗曟嵁绫诲瀷
- string salesId = model.salesId;//閿�鍞崟鍙�
string inRemark = model.inRemark;//澶囨敞
string ckId = model.ckId;
- string FIsLink = model.FIsLink;
+ string fIsLink = model.fIsLink;
+ string fHasLinkSource=model.fHasLinkSource;
+ //涓嬮潰鏄棤婧愮殑
+ string salesOrg = model.salesOrg;
+ string inventoryOrg = model.inventoryOrg;
+ string returnCustomer = model.returnCustomer;
+ string salesDept = model.salesDept;
var _sb = new StringBuilder();
var _split = "|";
foreach (var m in model.list)
@@ -158,6 +163,7 @@
+ m.Bz + _split
+ m.Thlx + _split
+ m.Thrq + _split
+ + m.ItemId + _split
+ (CheckGuid(_guid) ? _guid : Guid.Empty.ToString());
if (_sb.Length > 0)
_sb.Append("~");
@@ -184,11 +190,15 @@
new("@outNo", SqlDbType.NVarChar, 300),
new("@inOrderGuid",UtilityHelper.CheckGuid(guid)? guid : DBNull.Value),
new("@djlx", djlx),
- new("@salesId", salesId),
new("@inRemark", inRemark),
new("@ckId", ckId),
new("@inEdtUserGuid", _userGuid),
- new("@FIsLink", FIsLink),
+ new("@fIsLink", fIsLink),
+ new("@fHasLinkSource", fHasLinkSource),
+ new("@salesOrg", salesOrg),
+ new("@inventoryOrg", inventoryOrg),
+ new("@returnCustomer", returnCustomer),
+ new("@salesDept", salesDept),
new("@inLineList", _sb.ToString())
};
parameters[0].Direction = ParameterDirection.Output;
@@ -206,7 +216,7 @@
catch (Exception ex)
{
LogHelper.Debug(ToString(),
- "prc_salesDeliver_edt error锛�" + ex.Message);
+ "prc_salesReturn_edt error锛�" + ex.Message);
mObj.outMsg = ex.Message;
mObj.outSum = -1;
}
diff --git a/WebApi/Gs.Sys/Models/SysLogOperation.cs b/WebApi/Gs.Sys/Models/SysLogOperation.cs
index 99649ce..dad06d7 100644
--- a/WebApi/Gs.Sys/Models/SysLogOperation.cs
+++ b/WebApi/Gs.Sys/Models/SysLogOperation.cs
@@ -7,70 +7,70 @@
[SugarTable("SYS_LOG_OPERATION")]
public class SysLogOperation
{
- /// <summary>
- /// 涓婚敭
- /// </summary>
- [SugarColumn(ColumnName = "GUID", IsPrimaryKey = true)]
+ /// <summary>
+ /// 涓婚敭
+ /// </summary>
+ [SugarColumn(ColumnName = "GUID", IsPrimaryKey = true)]
public Guid? Guid { get; set; }
- /// <summary>
- /// 鎿嶄綔绫诲瀷
- /// </summary>
- [SugarColumn(ColumnName = "OPERATION_TYPE")]
+ /// <summary>
+ /// 鎿嶄綔绫诲瀷
+ /// </summary>
+ [SugarColumn(ColumnName = "OPERATION_TYPE")]
public string OperationType { get; set; }
- /// <summary>
- /// 鎿嶄綔鏃堕棿
- /// </summary>
- [SugarColumn(ColumnName = "OPERATION_TIME")]
+ /// <summary>
+ /// 鎿嶄綔鏃堕棿
+ /// </summary>
+ [SugarColumn(ColumnName = "OPERATION_TIME")]
public DateTime? OperationTime { get; set; }
- /// <summary>
- /// 鎿嶄綔琛�
- /// </summary>
- [SugarColumn(ColumnName = "OPERATION_TABLE")]
+ /// <summary>
+ /// 鎿嶄綔琛�
+ /// </summary>
+ [SugarColumn(ColumnName = "OPERATION_TABLE")]
public string OperationTable { get; set; }
- /// <summary>
- /// 鎿嶄綔鑰単uid
- /// </summary>
- [SugarColumn(ColumnName = "USER_GUID")]
+ /// <summary>
+ /// 鎿嶄綔鑰単uid
+ /// </summary>
+ [SugarColumn(ColumnName = "USER_GUID")]
public Guid? UserGuid { get; set; }
- /// <summary>
- /// 鎿嶄綔鑰呭悕绉�
- /// </summary>
- [SugarColumn(ColumnName = "USER_NAME")]
+ /// <summary>
+ /// 鎿嶄綔鑰呭悕绉�
+ /// </summary>
+ [SugarColumn(ColumnName = "USER_NAME")]
public string UserName { get; set; }
- /// <summary>
- /// 绐椾綋鍚嶇О
- /// </summary>
- [SugarColumn(ColumnName = "FORM_NAME")]
+ /// <summary>
+ /// 绐椾綋鍚嶇О
+ /// </summary>
+ [SugarColumn(ColumnName = "FORM_NAME")]
public string FormName { get; set; }
- /// <summary>
- /// 绐椾綋鏍囬
- /// </summary>
- [SugarColumn(ColumnName = "FORM_CAPTION")]
+ /// <summary>
+ /// 绐椾綋鏍囬
+ /// </summary>
+ [SugarColumn(ColumnName = "FORM_CAPTION")]
public string FormCaption { get; set; }
- /// <summary>
- /// 鎸夐挳鍚嶇О
- /// </summary>
- [SugarColumn(ColumnName = "MENU_NAME")]
+ /// <summary>
+ /// 鎸夐挳鍚嶇О
+ /// </summary>
+ [SugarColumn(ColumnName = "MENU_NAME")]
public string MenuName { get; set; }
- /// <summary>
- /// 璇︽儏
- /// </summary>
- [SugarColumn(ColumnName = "MSG")]
+ /// <summary>
+ /// 璇︽儏
+ /// </summary>
+ [SugarColumn(ColumnName = "MSG")]
public string Msg { get; set; }
- /// <summary>
- /// 鍏宠仈guid
- /// </summary>
- [SugarColumn(ColumnName = "ABT_GUID")]
+ /// <summary>
+ /// 鍏宠仈guid
+ /// </summary>
+ [SugarColumn(ColumnName = "ABT_GUID")]
public Guid? AbtGuid { get; set; }
@@ -93,4 +93,25 @@
/// </summary>
[SugarColumn(ColumnName = "RTN_JSON")]
public string? RtnJson { get; set; }
+
+ /// <summary>
+ /// 鏄惁鍙戦�乪rp
+ /// </summary>
+ [SugarColumn(ColumnName = "IS_ERP")]
+ public bool? IsErp { get; set; }
+
+ /// <summary>
+ /// 鍙戦�佺粨鏋�
+ /// </summary>
+ [SugarColumn(ColumnName = "IS_SUCCESS")]
+ public bool? IsSuccess { get; set; }
+
+ /// <summary>
+ /// 琛岄鑹�0姝e父锛�1绾㈣壊
+ /// </summary>
+ [SugarColumn(IsIgnore = true)] public int? isRed { get; set; }
+ /// <summary>
+ /// 鍙戦�乪rp缁撴灉
+ /// </summary>
+ [SugarColumn(IsIgnore = true)] public string? isErpDetail { get; set; }
}
\ No newline at end of file
diff --git a/WebApi/Gs.Sys/Services/FmController.cs b/WebApi/Gs.Sys/Services/FmController.cs
index c6b5389..8e5b3a8 100644
--- a/WebApi/Gs.Sys/Services/FmController.cs
+++ b/WebApi/Gs.Sys/Services/FmController.cs
@@ -176,6 +176,40 @@
"璇诲彇澶辫触锛�");
}
+
+ /// <summary>
+ /// 璇诲彇
+ /// </summary>
+ /// <param name="guid"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<string> GetModelByVersion([FromBody] dynamic model)
+ {
+ string formPath = model.formPath.ToString();
+ string strMsg = "";
+ SqlParameter[] parameters =
+ {
+ new("@formPath", formPath),
+ new("@userGuid", _userGuid),
+ };
+ var dset = new DataSet();
+ try
+ {
+ dset = DbHelperSQL.RunProcedure("[fm_get_layout_ver]", parameters, "0");
+ if (dset != null && dset.Tables.Count > 0
+ )
+ {
+ strMsg = dset.Tables[0].Rows[0][0].ToString();
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), ex.Message);
+ }
+ return ReturnDto<string>.QuickReturn(strMsg, ReturnCode.Success, "璇诲彇鎴愬姛锛�");
+ }
+
+
#endregion
private int? chkAdmin()
@@ -224,11 +258,11 @@
if (string.IsNullOrEmpty(idtype))
(_rtnInt, _rtnStr) = InterfaceUtil.HttpPostErp(_erpJson, keyUserGuid, keyGuid, keyNo);
else
- (_rtnInt, _rtnStr) = InterfaceUtil.HttpPostErp(_erpJson, keyUserGuid, keyGuid, keyNo,2);
+ (_rtnInt, _rtnStr) = InterfaceUtil.HttpPostErp(_erpJson, keyUserGuid, keyGuid, keyNo, 2);
}
catch (Exception ex)
{
- Gs.Toolbox.LogHelper.Debug(this.ToString(), "SendErp:" + ex.Message);
+ Gs.Toolbox.LogHelper.Debug(this.ToString(), "Fm SendErp:" + ex.Message);
return "鍙戦�乪rp澶辫触:" + ex.Message;
}
if (_rtnInt <= 0)
@@ -253,8 +287,8 @@
string keyMeth = model.keyMeth;
string keyNo = model.keyNo;
string idtype = model.idtype;//杩欎釜浠呬粎鏄洿鏂板伐鍗曠姸鎬佺殑鏃跺�欐湁
- //if (keyMeth.ToUpper() == "delete".ToUpper())
- // return "";
+ if (keyMeth.ToUpper() == "delete".ToUpper())
+ return "";
try
{
System.Data.DataSet dset = new System.Data.DataSet();
@@ -278,7 +312,7 @@
dynamic _datajson = new ExpandoObject();
if (dset.Tables.Count > 1)
{
- //杩欐槸缁撴锛岀粨鏋勫拰鍏跺畠涓嶄竴鏍�
+ //杩欐槸杩欐槸鏅�氱殑鎺ュ彛閲岀殑缁撴锛岀粨鏋勫拰鍏跺畠涓嶄竴鏍�
if (keyMeth.ToLower() == "toclose".ToLower() || keyMeth.ToLower() == "closure".ToLower() || keyMeth.ToLower() == "unfinish")
{
_datajson = dset.Tables[1].Rows[0].RowToDynamic();
@@ -296,16 +330,14 @@
taskname = keyTaskName,
optype = keyMeth,
datajson = JsonConvert.SerializeObject(_datajson),
- // datajson = (_datajson),
};
return JsonConvert.SerializeObject(_obj);
}
//杩欐槸璁㈠崟鍥炰紶鏍囪瘑
List<dynamic> _datajson22 = new List<dynamic>();
- dynamic _ob= new ExpandoObject();
+ dynamic _ob = new ExpandoObject();
_ob.ENTRY = dset.Tables[0].TableToDynamicList();
_datajson22.Add(_ob);
-
var _obj22 = new
{
taskname = keyTaskName,
@@ -350,7 +382,8 @@
if (_sb.Length > 0)
_sb.Append("~");
_sb.Append(_line);
- };
+ }
+ ;
var lst = new List<dynamic>();
SqlParameter[] parameters =
{
@@ -403,15 +436,23 @@
{
Gs.Toolbox.LogHelper.Debug(this.ToString(), "EditModel isAdmin error锛�" + ex.Message);
}
- Gs.Toolbox.DbHelperSQL.ExecuteSql("delete from [FM_QUERY_TABLE] where formPath=@formPath ", new SqlParameter[] { new SqlParameter("@formPath", formPath) });
- foreach (var _obj in model.list)
+ try
{
- System.Text.StringBuilder _sb = new System.Text.StringBuilder();
- _sb.Append("INSERT INTO [dbo].[FM_QUERY_TABLE]([guid],[formPath] ,[tableName] ,[lastUpdateBy] ,[lastUpdateDate],[tableOtherName])");
- _sb.Append(" values(newid(),'" + formPath + "','" + _obj.tableName + "','',getdate(),'" + _obj.tableOtherName + "')");
- arrayList.Add(_sb.ToString());
+ Gs.Toolbox.DbHelperSQL.ExecuteSql("delete from [FM_QUERY_TABLE] where formPath=@formPath ", new SqlParameter[] { new SqlParameter("@formPath", formPath) });
+ foreach (var _obj in model.list)
+ {
+ System.Text.StringBuilder _sb = new System.Text.StringBuilder();
+ _sb.Append("INSERT INTO [dbo].[FM_QUERY_TABLE]([guid],[formPath] ,[tableName] ,[lastUpdateBy] ,[lastUpdateDate],[tableOtherName])");
+ _sb.Append(" values(newid(),'" + formPath + "','" + _obj.tableName + "','',getdate(),'" + _obj.tableOtherName + "')");
+ arrayList.Add(_sb.ToString());
+ }
+ Gs.Toolbox.DbHelperSQL.ExecuteSqlTran(arrayList);
}
- Gs.Toolbox.DbHelperSQL.ExecuteSqlTran(arrayList);
+ catch (Exception ex)
+ {
+ m.outMsg = ex.Message;
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, ex.Message);
+ }
m.outMsg = "鎿嶄綔鎴愬姛锛�";
return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, "鎿嶄綔鎴愬姛锛�");
}
diff --git a/WebApi/Gs.Sys/Services/MesConfigController.cs b/WebApi/Gs.Sys/Services/MesConfigController.cs
new file mode 100644
index 0000000..1ccb2ee
--- /dev/null
+++ b/WebApi/Gs.Sys/Services/MesConfigController.cs
@@ -0,0 +1,94 @@
+锘縰sing System.Data;
+using System.Text;
+using Gs.Toolbox;
+using Gs.Toolbox.ApiCore.Abstract.Mvc;
+using Gs.Toolbox.ApiCore.Common.Mvc;
+using Gs.Toolbox.ApiCore.Group;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using static Gs.Toolbox.UtilityHelper;
+
+namespace Gs.Sys.Services
+{
+
+ /// <summary>
+ /// 閰嶇疆绯荤粺鍙傛暟
+ /// </summary>
+
+ [ApiGroup(ApiGroupNames.Sys)]
+ public class MesConfigController : IRomteService
+ {
+
+ private readonly IHttpContextAccessor _http;
+ private readonly string _userCode, _userGuid, _orgFids;
+
+ public MesConfigController(IHttpContextAccessor httpContextAccessor)
+ {
+ _http = httpContextAccessor;
+ (_userCode, _userGuid, _orgFids) =
+ GetUserGuidAndOrgGuid(_http);
+ }
+
+
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<int?> SetModel([FromBody] dynamic model)
+ {
+ string sql = model.sql;
+ int rtnInt = (int)ReturnCode.Default;
+ try
+ {
+ StringBuilder strSql = new StringBuilder();
+ strSql.Append(sql);
+ int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
+ rtnInt = rows;
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(this.ToString(), "SetSql error锛�" + ex.Message);
+ rtnInt = (int)ReturnCode.Exception;
+ return ReturnDto<int>.QuickReturn(default(int?), ReturnCode.Exception, "鍒犻櫎澶辫触锛�" + ex.Message);
+ }
+ if (rtnInt > 0)
+ return ReturnDto<int>.QuickReturn(default(int?), ReturnCode.Success, "鎿嶄綔鎴愬姛锛�");
+ else
+ return ReturnDto<int>.QuickReturn(default(int?), ReturnCode.Exception, "鍒犻櫎澶辫触锛岃閲嶈瘯锛�");
+ }
+
+ /// <summary>
+ /// 璇诲彇瀹炰綋
+ /// </summary>
+ /// <param name="guid"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<System.Dynamic.ExpandoObject> GetModel([FromBody] dynamic model)
+ {
+ dynamic m = new System.Dynamic.ExpandoObject();
+ m.list = new List<dynamic>();
+ System.Text.StringBuilder sbSql = new StringBuilder();
+ sbSql.Append(" select * from MES_CONFIG");
+ try
+ {
+ DataSet dset = new DataSet();
+ dset = DbHelperSQL.Query(sbSql.ToString());
+ if (dset != null && dset.Tables.Count > 0 && dset.Tables[0].Rows.Count > 0)
+ {
+ var _tb = dset.Tables[0].TableToDynamicList();
+ m.list = _tb;
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "璇诲彇鎴愬姛锛�");
+ }
+ else
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, "璇诲彇澶辫触锛�");
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(this.ToString(), "GetModel error:" + ex.Message);
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, "璇诲彇澶辫触锛�");
+ }
+ }
+ }
+}
diff --git a/WebApi/Gs.Sys/Services/MesFileController.cs b/WebApi/Gs.Sys/Services/MesFileController.cs
index ae75e24..e02e756 100644
--- a/WebApi/Gs.Sys/Services/MesFileController.cs
+++ b/WebApi/Gs.Sys/Services/MesFileController.cs
@@ -39,11 +39,13 @@
var _ary = file.FileName.Split("~");
var _parentGuid = _ary[0];
var _fileName = Guid.NewGuid() + _ary[1];
- var savePath = AppContext.BaseDirectory + AppSettingsHelper.getValueByKey("UploadPath");
+ var savePath = AppContext.BaseDirectory +
+ AppSettingsHelper.getValueByKey("UploadPath");
if (!Directory.Exists(savePath)) Directory.CreateDirectory(savePath);
if (file == null || file.Length == 0)
- return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Exception, "璇烽�夋嫨鏂囦欢");
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Exception,
+ "璇烽�夋嫨鏂囦欢");
var _fullName = Path.Combine(savePath, _fileName);
using (var stream = new FileStream(_fullName, FileMode.Create))
{
@@ -67,7 +69,6 @@
model.fileGroup = "";
var _bl = base.Insert(model);
}
-
return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "涓婁紶鎴愬姛");
}
diff --git a/WebApi/Gs.Sys/Services/MesSysPageviewManager.cs b/WebApi/Gs.Sys/Services/MesSysPageviewManager.cs
index b92d984..2f89a2f 100644
--- a/WebApi/Gs.Sys/Services/MesSysPageviewManager.cs
+++ b/WebApi/Gs.Sys/Services/MesSysPageviewManager.cs
@@ -54,7 +54,7 @@
sbSql.Append(",cast(0 as bit) as chkInt");
}
else
- sbSql.Append(",cast( (select count(1) from SYS_USER_BIND b where b.userGuid='" + keyType+ "' and b.aboutGuid=a.guid) as bit) as chkInt ");
+ sbSql.Append(",cast( (select count(1) from SYS_USER_BIND b where b.userGuid='" + keyType+ "' and b.aboutGuid=a.guid and b.fType='PDA椤甸潰') as bit) as chkInt ");
sbSql.Append(" from MES_SYS_PAGEVIEW a ");
sbSql.Append(keyWhere);
sbSql.Append(") as T ");
@@ -241,7 +241,7 @@
new("@outMsg", SqlDbType.NVarChar, 300),
new("@edtUserGuid", _userGuid),
new("@userGuid", userGuid),
- new("@fType", fType),
+ new("@fType", fType),
new("@bindGuids", bindGuidslist)
};
parameters[0].Direction = ParameterDirection.Output;
diff --git a/WebApi/Gs.Sys/Services/OrganizationController.cs b/WebApi/Gs.Sys/Services/OrganizationController.cs
index 6b98c76..cdfca2f 100644
--- a/WebApi/Gs.Sys/Services/OrganizationController.cs
+++ b/WebApi/Gs.Sys/Services/OrganizationController.cs
@@ -79,96 +79,71 @@
}
}
- ///// <summary>
- ///// 鍒犻櫎鏈烘瀯
- ///// </summary>
- ///// <param name="model"></param>
- ///// <returns></returns>
- //[RequestMethod(RequestMethods.POST)]
- //public ReturnDto<int?> DeleteModel([FromBody] JArray guidList)
- //{
- // string[] intArray = guidList.ToObject<string[]>();
- // string guid = intArray[0];
+ /// <summary>
+ /// 鏌ヨ鍒楄〃锛屾敮鎸佸垎椤碉紝鐢ㄤ簬鍚勭缁戝畾
+ /// </summary>
+ /// <param name="query"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<PageList<dynamic>> GetListPage2(PageQuery model)
+ {
+ var currentPage = model.currentPage;
+ var everyPageSize = model.everyPageSize;
+ var sortName = string.IsNullOrEmpty(model.sortName) ? "a.FNumber" : model.sortName;
+ var keyWhere = model.keyWhere;
+ string keyType = model.keyType;
+ var sbSql = new StringBuilder();
+ sbSql.Append("select * from ");
+ sbSql.Append("( ");
+ sbSql.Append("select top 100000 ROW_NUMBER() over(order by " + sortName + " " + model.sortOrder + ") as rowIndex,a.* ");
+ if (string.IsNullOrEmpty(keyType))
+ {
+ sbSql.Append(",cast(0 as bit) as chkInt");
+ }
+ else
+ sbSql.Append(",cast( (select count(1) from SYS_USER_BIND b where b.userGuid='" + keyType + "' and b.aboutGuid=cast( a.FID as nvarchar(50)) and b.fType='缁勭粐') as bit) as chkInt ");
+ sbSql.Append(" from SYS_ORGANIZATION a ");
+ sbSql.Append(keyWhere);
+ sbSql.Append(") as T ");
+ sbSql.Append(" where T.rowindex>(" + currentPage + "-1)*" + everyPageSize + " and T.rowindex<=" + currentPage + "*" + everyPageSize);
+ sbSql.Append(" order by rowindex asc ");
+ sbSql.Append(" select count(1) as intTotal from SYS_ORGANIZATION a where 1=1 ");
+ sbSql.Append(keyWhere);
+ var dset = new DataSet();
+ try
+ {
+ dset = DbHelperSQL.Query(sbSql.ToString());
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), "GetListPage2 error锛�" + ex.Message);
+ return ReturnDto<PageList<dynamic>>.QuickReturn(default(PageList<dynamic>), ReturnCode.Exception, "璇诲彇澶辫触");
+ }
- // int cont = 0;
- // cont = IsChkOrUnChk(intArray[0], true);
- // if (cont > 0)
- // return ReturnDto<int>.QuickReturn(default(int?), ReturnCode.Exception, "鍒犻櫎澶辫触锛岃淇℃伅宸茶瀹℃牳锛�");
+ var _pglist = new PageList<dynamic>
+ {
+ total = 0,
+ everyPageSize = 0,
+ pages = 0,
+ list = new List<dynamic>()
+ };
+ if (dset != null && dset.Tables.Count > 0 &&
+ dset.Tables[0].Rows.Count > 0) //鏈夋暟鎹�
+ {
+ var intTotal = int.Parse(dset.Tables[1].Rows[0]["intTotal"].ToString());
+ var pages = intTotal % everyPageSize != 0
+ ? intTotal / everyPageSize + 1
+ : intTotal / everyPageSize;
+ _pglist.total = intTotal;
+ _pglist.everyPageSize = everyPageSize;
+ _pglist.pages = pages;
+ var _dy = dset.Tables[0].TableToDynamicList();
+ _pglist.list = _dy;
+ }
+ return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
+ ReturnCode.Success, "璇诲彇鎴愬姛");
+ }
-
- // int? rtnInt = (int)ReturnCode.Default;
-
- // int it1 = 0;
- // int it2 = 0;
- // cont = Db.Queryable<SysOrganization>().Where(c => c.Guid == Guid.Parse(guid) && c.IsSys == 1).Count();
- // if (cont > 0)
- // {
- // return ReturnDto<int>.QuickReturn(default(int?), ReturnCode.Exception, "鍒犻櫎澶辫触锛岃鏉$洰涓虹郴缁熷唴缃紝涓嶅彲鍒犻櫎锛�");
- // }
- // try
- // {
- // Db.Ado.BeginTran();
- // it1 = Db.Deleteable<SysOrganization>().In(guid).ExecuteCommand();
- // it2 = Db.Deleteable<SysRoleMenuAction>().Where(it => it.OrgGuid == Guid.Parse(guid)).ExecuteCommand();
- // Db.Ado.CommitTran();
- // }
- // catch (Exception ex)
- // {
- // LogHelper.Debug(this.ToString(), "DeleteModel error锛�" + ex.Message);
- // Db.Ado.RollbackTran();
- // return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Exception, "鍒犻櫎澶辫触锛岃閲嶈瘯锛�");
- // }
- // rtnInt = (it2 + it1);
- // return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Success, "鎿嶄綔鎴愬姛锛屽叡鍒犻櫎" + rtnInt.ToString() + "鏉℃暟鎹紒");
- //}
-
- ///// <summary>
- ///// 澧炲姞鏈烘瀯
- ///// </summary>
- ///// <param name="model"></param>
- ///// <returns></returns>
- //[RequestMethod(RequestMethods.POST)]
- //public ReturnDto<string?> EditModel([FromBody] SysOrganization model)
- //{
- // if (UtilityHelper.CheckGuid(model.Guid))
- // {
- // int cont = 0;
- // cont = IsChkOrUnChk(model.Guid.ToString(), true);
- // if (cont > 0)
- // return ReturnDto<string>.QuickReturn("", ReturnCode.Exception, "淇敼澶辫触锛岃淇℃伅宸茶瀹℃牳锛�");
- // }
- // if (!UtilityHelper.CheckGuid(model.UpGuid))//鍙兘鏈変竴涓牴缁勭粐
- // {
- // int cont = 0;
- // cont = Db.Queryable<SysOrganization>().Where(c => c.UpGuid == null).Count();
- // if (cont > 0)
- // {
- // return ReturnDto<int>.QuickReturn(default(string?), ReturnCode.Exception, "澧炲姞澶辫触锛岃閫夋嫨涓婄骇缁勭粐锛�");
- // }
- // }
- // bool _bl = false;
- // try
- // {
- // if (!UtilityHelper.CheckGuid(model.Guid))
- // {
- // model.Guid = Guid.NewGuid();
- // _bl = base.Insert(model);
- // }
- // else
- // {
- // // _bl = base.Update(model);
- // _bl = Db.Updateable(model).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand() > 0 ? true : false;
- // }
- // }
- // catch (Exception ex)
- // {
- // LogHelper.Debug(this.ToString(), "EditModel error锛�" + ex.Message);
- // return ReturnDto<string>.QuickReturn("", ReturnCode.Exception, ex.Message);
- // }
- // if (_bl)
- // return ReturnDto<string>.QuickReturn(model.Guid.ToString(), ReturnCode.Success, "鎿嶄綔鎴愬姛锛�");
- // return ReturnDto<string>.QuickReturn("", ReturnCode.Exception, "澧炲姞澶辫触锛岃閲嶈瘯锛�");
- //}
/// <summary>
/// 璇诲彇鏈烘瀯
diff --git a/WebApi/Gs.Sys/Services/SysLogController.cs b/WebApi/Gs.Sys/Services/SysLogController.cs
index a5f780b..7f7e154 100644
--- a/WebApi/Gs.Sys/Services/SysLogController.cs
+++ b/WebApi/Gs.Sys/Services/SysLogController.cs
@@ -1,10 +1,11 @@
-锘縰sing System.Text;
+锘縰sing Gs.Entity.BaseInfo;
using Gs.Sys.Models;
using Gs.Toolbox;
using Gs.Toolbox.ApiCore.Abstract.Mvc;
using Gs.Toolbox.ApiCore.Common.Mvc;
using Gs.Toolbox.ApiCore.Group;
using Microsoft.AspNetCore.Mvc;
+using System.Text;
namespace Gs.Sys.Services;
@@ -27,10 +28,15 @@
var _sbBy =
new StringBuilder(query.sortName + " " + query.sortOrder);
var totalCount = 0;
- var itemsList = Db.Queryable<SysLogOperation>()
+ var itemsList = Db.Queryable<SysLogOperation>("a")
+ .Select((a) => new SysLogOperation
+ {
+ isRed = ((a.IsErp == true && a.IsSuccess == false) ? 1 : 0),
+ isErpDetail = (a.IsErp == true ? (a.IsSuccess == true ? "1:鍙戦�佹垚鍔�" : "0:鍙戦�佸け璐�") : "2:涓嶉渶瑕佸彂閫�"),
+ }, true)
.Where(_sbWhere.ToString())
.OrderBy(_sbBy.ToString())
- .ToPageList(query.currentPage, query.everyPageSize,ref totalCount);
+ .ToPageList(query.currentPage, query.everyPageSize, ref totalCount);
pageList = new PageList<SysLogOperation>(itemsList, totalCount,
query.everyPageSize);
return ReturnDto<PageList<SysLogOperation>>.QuickReturn(pageList,
diff --git a/WebApi/Gs.Sys/Services/UserController.cs b/WebApi/Gs.Sys/Services/UserController.cs
index e563ab3..5ccfacc 100644
--- a/WebApi/Gs.Sys/Services/UserController.cs
+++ b/WebApi/Gs.Sys/Services/UserController.cs
@@ -45,6 +45,7 @@
var accountPwd = model.accountPwd;
string accountLog = model.accountLog;
var _strMsg = "";
+ string dd = MD5Encrypt32(accountPwd);
var dset = new DataSet();
dynamic m = new ExpandoObject();
using (var conn = new SqlConnection(DbHelperSQL.strConn))
@@ -319,6 +320,8 @@
return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "鎿嶄綔鎴愬姛锛�");
}
+
+
#region
/// <summary>
/// 鏌ヨ鍒楄〃锛屾敮鎸佸垎椤�
@@ -501,12 +504,17 @@
dynamic m = new ExpandoObject();
m.list = new List<dynamic>();
m.list2 = new List<dynamic>();
+ m.list3 = new List<dynamic>();
+ m.list4= new List<dynamic>();
+ m.list5 = new List<dynamic>();
var dset = new DataSet();
System.Text.StringBuilder sbSql = new StringBuilder();
sbSql.Append(" select * from [dbo].[SYS_USER] where guid='" + guid + "'");
sbSql.Append(" select bd.userGuid, bd.guid,pg.PAGE_VIEW as gnName, bd.fType,bd.createBy,bd.createDate from [MES_SYS_PAGEVIEW] pg right join [dbo].[SYS_USER_BIND] bd on(bd.aboutGuid= pg.guid and bd.fType= 'PDA椤甸潰') where bd.fType= 'PDA椤甸潰' and bd.userGuid='" + guid + "' ");
- sbSql.Append(" select bd.userGuid, bd.guid, pg.depot_name + '(' + pg.depot_code + ')' as gnName, bd.fType,bd.createBy,bd.createDate from [dbo].[MES_DEPOTS] pg right join[dbo].[SYS_USER_BIND] bd on bd.aboutGuid = pg.guid and bd.fType = '浠撳簱' where bd.fType = '浠撳簱' and bd.userGuid='" + guid + "'");
+ sbSql.Append(" select bd.userGuid, bd.guid, '銆�' + pg.depot_code + '銆�'+pg.depot_name as gnName, bd.fType,bd.createBy,bd.createDate from [dbo].[MES_DEPOTS] pg right join[dbo].[SYS_USER_BIND] bd on bd.aboutGuid = pg.guid and bd.fType = '浠撳簱' where bd.fType = '浠撳簱' and bd.userGuid='" + guid + "'");
sbSql.Append(" select bd.userGuid, bd.guid,pg.ip as gnName, bd.fType,bd.createBy,bd.createDate from [dbo].[print_info] pg right join [dbo].[SYS_USER_BIND] bd on bd.aboutGuid = pg.guid and bd.fType = '鎵撳嵃鏈�' where bd.fType = '鎵撳嵃鏈�' and bd.userGuid='" + guid + "'");
+ sbSql.Append(" select bd.userGuid, bd.guid,'銆�'+pg.line_no+'銆�'+pg.name as gnName, bd.fType,bd.createBy,bd.createDate from MES_WORKSHOP_LINE pg right join [dbo].[SYS_USER_BIND] bd on bd.aboutGuid = pg.guid and bd.fType = '杩囩珯鏃剁粦瀹氱嚎浣�' where bd.fType = '杩囩珯鏃剁粦瀹氱嚎浣�' and bd.userGuid='" + guid + "'");
+ sbSql.Append(" select bd.userGuid, bd.guid,'銆�'+pg.FNumber+'銆�'+pg.NAME as gnName, bd.fType,bd.createBy,bd.createDate from SYS_ORGANIZATION pg right join [dbo].[SYS_USER_BIND] bd on cast( bd.aboutGuid as nvarchar(50)) = cast( pg.FID as nvarchar(50)) and bd.fType = '缁勭粐' where bd.fType = '缁勭粐' and bd.userGuid='" + guid + "'");
try
{
dset = DbHelperSQL.Query(sbSql.ToString());
@@ -521,6 +529,10 @@
m.list2 = _tb2;
var _tb3 = dset.Tables[3].TableToDynamicList();
m.list3 = _tb3;
+ var _tb4 = dset.Tables[4].TableToDynamicList();
+ m.list4 = _tb4;
+ var _tb5 = dset.Tables[5].TableToDynamicList();
+ m.list5 = _tb5;
}
}
catch (Exception ex)
@@ -562,7 +574,7 @@
sbSql.Append(",cast(0 as bit) as chkInt");
}
else
- sbSql.Append(",cast( (select count(1) from SYS_USER_BIND b where b.userGuid='" + keyType + "' and b.aboutGuid=a.guid) as bit) as chkInt ");
+ sbSql.Append(",cast( (select count(1) from SYS_USER_BIND bind where bind.userGuid='" + keyType + "' and bind.aboutGuid=a.guid and bind.fType='鍛樺伐鍒嗗尯') as bit) as chkInt ");
sbSql.Append(sbJoin);
sbSql.Append(") T");
sbSql.Append(" where T.rowindex>(" + currentPage + "-1)*" + everyPageSize + " and T.rowindex<=" + currentPage + "*" + everyPageSize);
diff --git a/WebApi/Gs.Toolbox/ApiCore/Group/ApiGroupNames.cs b/WebApi/Gs.Toolbox/ApiCore/Group/ApiGroupNames.cs
index b08094c..08dbf8f 100644
--- a/WebApi/Gs.Toolbox/ApiCore/Group/ApiGroupNames.cs
+++ b/WebApi/Gs.Toolbox/ApiCore/Group/ApiGroupNames.cs
@@ -45,5 +45,7 @@
[GroupInfo(Title = "鎶ヨ〃", Description = "鎶ヨ〃")]
Rport,
[GroupInfo(Title = "PDA", Description = "PDA")]
- PDA
+ PDA,
+ [GroupInfo(Title = "璁′欢宸ヨ祫", Description = "璁′欢宸ヨ祫")]
+ JJGZ
}
\ No newline at end of file
diff --git a/WebApi/Gs.Toolbox/ExcelHelper.cs b/WebApi/Gs.Toolbox/ExcelHelper.cs
index 818bf82..b654eb7 100644
--- a/WebApi/Gs.Toolbox/ExcelHelper.cs
+++ b/WebApi/Gs.Toolbox/ExcelHelper.cs
@@ -1,6 +1,8 @@
锘縰sing System.Collections;
using System.Data;
using System.Text;
+using System.Timers;
+using Masuit.Tools;
using NPOI.HSSF.UserModel;
using NPOI.HSSF.Util;
using NPOI.SS.Formula.Functions;
@@ -226,8 +228,8 @@
//sheet.SetAutoFilter(new CellRangeAddress(0, 0, 0, dtSource.Columns.Count - 1)); //棣栬绛涢��
// if (fixW <= 0)
- sheet.CreateFreezePane(dtSource.Columns.Count,
- 1 + aryHeader.Count); //棣栬鍐荤粨
+ //sheet.CreateFreezePane(dtSource.Columns.Count,
+ // 1 + aryHeader.Count); //棣栬鍐荤粨
//濉厖鍐呭
var dataRow = sheet.CreateRow(roct + 1);
for (var i = 0; i < dtSource.Rows.Count; i++)
@@ -429,16 +431,131 @@
//浠庣7琛屽紑濮嬶紝灏辨槸寰幆鏁版嵁搴�
int _idx = 7;
DataTable tb1 = dtSource.Tables[1];
+ string dd = "";
+ bool _blPscs = false;
+ bool _blGjyzx = false;
foreach (DataRow rrr in tb1.Rows)
{
+ //澧炲姞鍝佹按娴嬭瘯鏍囬
+ if (_blPscs == false && rrr["椤圭洰"].ToString() == "鍝佹按娴嬭瘯")
+ {
+ IRow row700 = sheet.CreateRow(_idx);
+ for (int i = 0; i < ary.Length; i++)
+ {
+ ICell cell700 = row700.CreateCell(i);
+ cell700.CellStyle = style;
+ if (i == 0)
+ cell700.SetCellValue(rrr["椤圭洰"].ToString());
+ if (i == 1)
+ cell700.SetCellValue("娓╁害");
+ if (i == 3)
+ cell700.SetCellValue("娴侀噺");
+ if (i == 5)
+ cell700.SetCellValue("鏄惁鏈夊紓鍛�");
+ if (i == 6)
+ cell700.SetCellValue("妫�楠岀粨鏋�");
+ }
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 1, 2));
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 3, 4));
+ _idx++;
+ _blPscs = true;
+ }
+ //澧炲姞鏍囬
+ if (_blGjyzx == false && rrr["椤圭洰"].ToString() == "鍏抽敭閮ㄤ欢涓�鑷存��")
+ {
+ IRow row700 = sheet.CreateRow(_idx);
+ for (int i = 0; i < ary.Length; i++)
+ {
+ ICell cell700 = row700.CreateCell(i);
+ cell700.CellStyle = style;
+ if (i == 0)
+ cell700.SetCellValue(rrr["椤圭洰"].ToString());
+ if (i == 1)
+ cell700.SetCellValue("鍏抽敭鍚嶇О");
+ if (i == 2)
+ cell700.SetCellValue("鐢熶骇鏃ユ湡");
+ if (i == 3)
+ cell700.SetCellValue("浣跨敤鏁伴噺");
+ if (i == 4)
+ cell700.SetCellValue("璁よ瘉淇℃伅");
+ if (i == 5)
+ cell700.SetCellValue("鏄惁绗﹀悎CCC涓�鑷存��");
+ if (i == 6)
+ cell700.SetCellValue("鎿嶄綔");
+ }
+ _idx++;
+ _blGjyzx = true;
+ }
+
IRow row7 = sheet.CreateRow(_idx);
row7.HeightInPoints = rowHeight;
+ string _tmphb = rrr["椤圭洰鍚堝苟琛屾暟"].ToString();
+ string _tmp = "";
+ if (dd == rrr["椤圭洰"].ToString())
+ _tmp = "";
+ else
+ _tmp = rrr["椤圭洰"].ToString();
+ dd = rrr["椤圭洰"].ToString();
for (int i = 0; i < ary.Length; i++)
{
ICell cell7 = row7.CreateCell(i);
cell7.CellStyle = style;
- cell7.SetCellValue(rrr[ary[i]].ToString());
-
+ if (i == 0)
+ {
+ cell7.SetCellValue(_tmp);
+ if (!string.IsNullOrEmpty(_tmp) && int.Parse(_tmphb) > 1)
+ {
+ if (rrr["椤圭洰"].ToString() == "鍝佹按娴嬭瘯" || rrr["椤圭洰"].ToString() == "鍏抽敭閮ㄤ欢涓�鑷存��" )
+ sheet.AddMergedRegion(new CellRangeAddress(_idx-1, _idx + int.Parse(_tmphb)-1, 0, 0));
+ else
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx + int.Parse(_tmphb) - 1, 0, 0));
+ }
+ }
+ else
+ {
+ switch (rrr["椤圭洰"].ToString())
+ {
+ case "鍒剁儹鎬ц兘":
+ cell7.SetCellValue(rrr["鍒剁儹鎬ц兘table"].ToString());
+ row7.HeightInPoints = rowHeight * 5;
+ if (i == ary.Length - 1)
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 1, 6));
+ break;
+ case "鍝佹按娴嬭瘯":
+ //搴︽暟
+ if (i == 1)
+ cell7.SetCellValue(rrr["鎶�鏈�/鍝佽川瑕佹眰"].ToString());
+ if (i == 3)
+ cell7.SetCellValue(rrr["鍝佹按娴嬭瘯娴侀噺"].ToString());
+ if (i == 5)
+ cell7.SetCellValue(rrr["鏄惁鏈夊紓鍛�"].ToString());
+ if (i == 6)
+ cell7.SetCellValue(rrr["妫�楠岀粨鏋�"].ToString());
+ if (i == ary.Length - 1)
+ {
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 1, 2));
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 3, 4));
+ }
+ break;
+ case "鍏抽敭閮ㄤ欢涓�鑷存��":
+ if (i == 1)
+ cell7.SetCellValue(rrr["鎶�鏈�/鍝佽川瑕佹眰"].ToString());
+ if (i == 2)
+ cell7.SetCellValue(rrr["鐢熶骇鏃ユ湡"].ToString());
+ if (i == 3)
+ cell7.SetCellValue(rrr["浣跨敤鏁伴噺"].ToString());
+ if (i == 4)
+ cell7.SetCellValue(rrr["璁よ瘉淇℃伅"].ToString());
+ if (i == 5)
+ cell7.SetCellValue(rrr["鏄惁绗﹀悎CCC涓�鑷存��"].ToString());
+ //if (i == 6)
+ // cell7.SetCellValue(rrr["妫�楠岀粨鏋�"].ToString());
+ break;
+ default:
+ cell7.SetCellValue(rrr[ary[i]].ToString());
+ break;
+ }
+ }
}
_idx++;
}
@@ -489,26 +606,6 @@
sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 0, 6));
setCellVal(sheet, _idx, 0, "棣栦欢濉啓,鏉ユ枡妫�楠�");
//****鍚堝苟濂藉悗寮�濮嬭祴鍊糴nd**************
-
- // 5. 绗�8鍒�10琛屼腑鐨勭涓�鍒楀簲琚悎骞�
- //sheet.AddMergedRegion(new CellRangeAddress(7, 9, 0, 0));
-
- //// 6. 绗�17锛�18琛屼腑鐨勭涓�鍒楀悎骞�
- //sheet.AddMergedRegion(new CellRangeAddress(16, 17, 0, 0));
-
- //// 7. 绗�17琛屼腑鐨�2锛�3锛�4锛�5鍒楀悎骞�
- //sheet.AddMergedRegion(new CellRangeAddress(16, 16, 1, 4));
-
- //// 8. 绗�18琛屼腑鐨勶紝2锛�3鍒楀悎骞讹紝4锛�5锛�6鍒楀悎骞�
- //sheet.AddMergedRegion(new CellRangeAddress(17, 17, 1, 2));
- //sheet.AddMergedRegion(new CellRangeAddress(17, 17, 3, 5));
-
- //// 9. 绗�19琛屼腑鐨勶紝鍒�2锛�3锛�4鍚堝苟
- //sheet.AddMergedRegion(new CellRangeAddress(18, 18, 1, 3));
-
- //// 10. 绗�20琛屼腑鐨勫垪鍏ㄩ儴鍚堝苟
- //sheet.AddMergedRegion(new CellRangeAddress(19, 19, 0, 5));
-
//淇濆瓨
using (var ms = new MemoryStream())
{
@@ -625,9 +722,9 @@
setCellVal(sheet, 6, 6, "涓嶅悎鏍兼暟");
setCellVal(sheet, 6, 7, row0["bhgs"].ToString());
setCellVal(sheet, 7, 0, "鍒ゅ畾Ac/Re");
- setCellVal(sheet, 7, 1, "0/1");
- setCellVal(sheet, 7, 2, "0/1");
- setCellVal(sheet, 7, 3, "0/1");
+ setCellVal(sheet, 7, 1, row0["cr"].ToString());
+ setCellVal(sheet, 7, 2, row0["ma"].ToString());
+ setCellVal(sheet, 7, 3, row0["mi"].ToString());
setCellVal(sheet, 8, 0, "椤圭洰");
setCellVal(sheet, 8, 1, "璐ㄩ噺瑕佹眰");
setCellVal(sheet, 8, 6, "妫�楠岃褰�");
@@ -750,16 +847,14 @@
//琛岄珮
int rowHeight = 25;
//鎬诲垪
- int maxCols = tb1.Columns.Count;
+ int maxCols = 10;
HSSFWorkbook workbook = new HSSFWorkbook();
ISheet sheet = workbook.CreateSheet("Sheet1");
-
// 鍒涘缓鍗曞厓鏍兼牱寮� - 甯﹁竟妗嗗拰鎸囧畾瀛椾綋
ICellStyle style = getStyle(workbook);
ICellStyle styleHeader = getStyle(workbook, 20, true, true);
ICellStyle style12 = getStyle(workbook, 11, false, true);
-
- // 璁剧疆鍒楀锛�6鍒楋級
+ // 璁剧疆鍒楀锛�10鍒楋級
sheet.SetColumnWidth(0, 3000); // 绗竴鍒楃◢瀹�
sheet.SetColumnWidth(1, 3000);
sheet.SetColumnWidth(2, 3000);
@@ -768,8 +863,10 @@
sheet.SetColumnWidth(5, 3000);
sheet.SetColumnWidth(6, 3000);
sheet.SetColumnWidth(7, 3000);
- // 鍒涘缓琛�
- for (int rowIndex = 0; rowIndex <= 1; rowIndex++)
+ sheet.SetColumnWidth(8, 3000);
+ sheet.SetColumnWidth(9, 3000);
+ // 鍒涘缓澶磋
+ for (int rowIndex = 0; rowIndex <= 2; rowIndex++)
{
IRow row = sheet.CreateRow(rowIndex);
// 璁剧疆琛岄珮锛堟墍鏈夎鐩稿悓楂樺害锛�
@@ -785,31 +882,70 @@
}
}
//绗竴琛屽垪鍚堝苟
- sheet.AddMergedRegion(new CellRangeAddress(0, 0, 0, 7));
+ sheet.AddMergedRegion(new CellRangeAddress(0, 0, 0, 9));
setCellVal(sheet, 0, 0, row0["title"].ToString());
+ //绗簩琛屽垪鍚堝苟
+ sheet.AddMergedRegion(new CellRangeAddress(1, 1, 0, 1));
+ sheet.AddMergedRegion(new CellRangeAddress(1, 1, 6, 9));
+ setCellVal(sheet, 1, 0, "宸ュ崟鍙�");
+ setCellVal(sheet, 1, 2, row0["daaNo"].ToString());
+ setCellVal(sheet, 1, 3, "浜у搧鍚嶇О");
+ setCellVal(sheet, 1, 4, row0["itemName"].ToString());
+ setCellVal(sheet, 1, 5, "瑙勬牸鍨嬪彿");
+ setCellVal(sheet, 1, 6, row0["itemModel"].ToString());
+ //绗笁琛屽垪鍚堝苟
+ sheet.AddMergedRegion(new CellRangeAddress(2, 2,2, 4));
+ setCellVal(sheet,2, 0, "搴忓彿");
+ setCellVal(sheet, 2, 1, "妫�楠岄」鐩�");
+ setCellVal(sheet, 2, 2, "妫�楠屾爣鍑�");
+ setCellVal(sheet, 2, 5, row0["tm1"].ToString());
+ setCellVal(sheet, 2, 6, row0["tm2"].ToString());
+ setCellVal(sheet, 2, 7, row0["tm3"].ToString());
+ setCellVal(sheet, 2, 8, row0["tm4"].ToString());
+ setCellVal(sheet, 2, 9, row0["tm5"].ToString());
//寰幆鏁版嵁搴�
- int _idx = 1;
- IRow row6 = sheet.CreateRow(_idx);
- for (int colIndex = 0; colIndex < maxCols; colIndex++)
- {
- ICell cell6 = row6.CreateCell(colIndex);
- cell6.CellStyle = style;
- cell6.SetCellValue(tb1.Columns[colIndex].Caption.ToString().Trim());
- }
- _idx++;
+ int _idx = 3;
foreach (DataRow rrr in tb1.Rows)
{
IRow row7 = sheet.CreateRow(_idx);
row7.HeightInPoints = rowHeight;
- for (int colIndex = 0; colIndex < tb1.Columns.Count; colIndex++)
+ for (int colIndex = 0; colIndex < maxCols; colIndex++)
{
ICell cell7 = row7.CreateCell(colIndex);
cell7.CellStyle = style;
- cell7.SetCellValue(rrr[tb1.Columns[colIndex]].ToString());
+ // cell7.SetCellValue("1");
+ switch (colIndex)
+ {
+ case 0:
+ cell7.SetCellValue(rrr["搴忓彿"].ToString());
+ break;
+ case 1:
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 2, 4));
+ cell7.SetCellValue(rrr["妫�楠岄」鐩�"].ToString());
+ break;
+ case 2:
+ cell7.SetCellValue(rrr["妫�楠屾爣鍑�"].ToString());
+ break;
+ case 5:
+ cell7.SetCellValue(rrr["tm1"].ToString());
+ break;
+ case 6:
+ cell7.SetCellValue(rrr["tm2"].ToString());
+ break;
+ case 7:
+ cell7.SetCellValue(rrr["tm3"].ToString());
+ break;
+ case 8:
+ cell7.SetCellValue(rrr["tm4"].ToString());
+ break;
+ case 9:
+ cell7.SetCellValue(rrr["tm5"].ToString());
+ break;
+ }
}
_idx++;
}
- //澶囨敞
+ ////澶囨敞
IRow row8 = sheet.CreateRow(_idx);
row8.HeightInPoints = rowHeight;
for (int colIndex = 0; colIndex < maxCols; colIndex++)
@@ -817,12 +953,13 @@
ICell cell = row8.CreateCell(colIndex);
cell.CellStyle = style12;
}
- sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 0, 2));
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 0, 4));
setCellVal(sheet, _idx, 0, "宸℃浜猴細");
- for (int colIndex = 2; colIndex < tb1.Columns.Count; colIndex++)
- {
- setCellVal(sheet, _idx, colIndex, "浣欏悏鏋�");
- }
+ setCellVal(sheet, _idx, 5, row0["xjr1"].ToString());
+ setCellVal(sheet, _idx, 6, row0["xjr2"].ToString());
+ setCellVal(sheet, _idx, 7, row0["xjr3"].ToString());
+ setCellVal(sheet, _idx, 8, row0["xjr4"].ToString());
+ setCellVal(sheet, _idx, 9, row0["xjr5"].ToString());
//淇濆瓨
using (var ms = new MemoryStream())
{
@@ -839,6 +976,419 @@
}
}
+ /// <summary>
+ /// 鐢熸垚鎴愬搧妫�楠屾姤鍛婏紙鎸夊疄闄呮ā鏉跨粨鏋勶級
+ /// </summary>
+ /// <param name="dtSource"></param>
+ /// <param name="strFileName"></param>
+ public static void ExportChengPin(DataSet dtSource, string strFileName)
+ {
+ //琛岄珮
+ int rowHeight = 25;
+ //鎬诲垪鏁� - 鏍规嵁妯℃澘鍒嗘瀽锛岃嚦灏戦渶瑕�18鍒�
+ int maxCols = 18;
+ // 鍒涘缓宸ヤ綔绨�
+ HSSFWorkbook workbook = new HSSFWorkbook();
+ ISheet sheet = workbook.CreateSheet("Sheet1");
+
+ // 鍒涘缓鍗曞厓鏍兼牱寮�
+ ICellStyle style = getStyle(workbook);
+ ICellStyle styleHeader = getStyle(workbook, 16, true, true);
+ ICellStyle styleTitle = getStyle(workbook, 14, true, true);
+ ICellStyle styleSmall = getStyle(workbook, 10, false, false);
+
+ // 璁剧疆鍒楀
+ sheet.SetColumnWidth(0, 3500); // A鍒楋細椤圭洰鍚嶇О
+ sheet.SetColumnWidth(1, 5000); // B鍒楋細鏍囧噯/瑙勮寖
+ for (int i = 2; i < 18; i++) // C鍒癛鍒楋細16涓娴嬪�煎垪
+ {
+ sheet.SetColumnWidth(i, 2500);
+ }
+
+ //鑾峰彇琛ㄥご鏁版嵁
+ DataTable tb0 = dtSource.Tables[0];
+ DataRow row0 = tb0.Rows[0];
+ int _idx = 0;
+
+ // 绗�1琛岋細鎶ュ憡鏍囬
+ IRow titleRow = sheet.CreateRow(_idx);
+ titleRow.HeightInPoints = 30;
+ for (int i = 0; i < maxCols; i++)
+ {
+ ICell cell = titleRow.CreateCell(i);
+ cell.CellStyle = styleHeader;
+ }
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 0, maxCols - 1));
+ setCellVal(sheet, _idx, 0, "鎴愬搧妫�楠屾姤鍛�");
+ _idx++;
+
+ // 绗�2琛岋細鍩烘湰淇℃伅绗竴琛�
+ IRow info1Row = sheet.CreateRow(_idx);
+ info1Row.HeightInPoints = rowHeight;
+ for (int i = 0; i < maxCols; i++)
+ {
+ ICell cell = info1Row.CreateCell(i);
+ cell.CellStyle = style;
+ }
+ setCellVal(sheet, _idx, 0, "鐢熶骇杞﹂棿锛�" + (row0["workShop"]?.ToString() ?? ""));
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 0, 5));
+
+ setCellVal(sheet, _idx, 12, "瀹ゆ俯锛�" + (row0["temperature"]?.ToString() ?? ""));
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 12, 17));
+ _idx++;
+
+ // 绗�3琛岋細浜у搧淇℃伅
+ IRow info2Row = sheet.CreateRow(_idx);
+ info2Row.HeightInPoints = rowHeight;
+ for (int i = 0; i < maxCols; i++)
+ {
+ ICell cell = info2Row.CreateCell(i);
+ cell.CellStyle = style;
+ }
+ setCellVal(sheet, _idx, 0, "浜у搧鍚嶇О");
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 1, 4));
+ setCellVal(sheet, _idx, 1, row0["itemName"]?.ToString() ?? "");
+
+ setCellVal(sheet, _idx, 5, "鍨嬪彿瑙勬牸");
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 6, 11));
+ setCellVal(sheet, _idx, 6, row0["itemModel"]?.ToString() ?? "");
+
+ setCellVal(sheet, _idx, 12, "鐢靛帇");
+ setCellVal(sheet, _idx, 13, row0["voltage"]?.ToString() ?? "");
+
+ setCellVal(sheet, _idx, 14, "绾垮彿");
+ setCellVal(sheet, _idx, 15, row0["lineNo"]?.ToString() ?? "");
+ _idx++;
+
+ // 绗�4琛岋細鍟嗘爣绛変俊鎭�
+ IRow info3Row = sheet.CreateRow(_idx);
+ info3Row.HeightInPoints = rowHeight;
+ for (int i = 0; i < maxCols; i++)
+ {
+ ICell cell = info3Row.CreateCell(i);
+ cell.CellStyle = style;
+ }
+ setCellVal(sheet, _idx, 0, "鍟嗘爣");
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 1, 4));
+ setCellVal(sheet, _idx, 1, row0["brand"]?.ToString() ?? "");
+
+ setCellVal(sheet, _idx, 5, "鐢熶骇鏃ユ湡");
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 6, 11));
+ setCellVal(sheet, _idx, 6, row0["productionDate"]?.ToString() ?? "");
+
+ setCellVal(sheet, _idx, 12, "鐝");
+ setCellVal(sheet, _idx, 13, row0["classes"]?.ToString() ?? "");
+
+ setCellVal(sheet, _idx, 14, "鎵归噺");
+ setCellVal(sheet, _idx, 15, row0["batch"]?.ToString() ?? "");
+ _idx++;
+
+ // 绗�5琛岋細AC/Re鏍囧噯
+ IRow acreRow = sheet.CreateRow(_idx);
+ acreRow.HeightInPoints = rowHeight;
+ for (int i = 0; i < maxCols; i++)
+ {
+ ICell cell = acreRow.CreateCell(i);
+ cell.CellStyle = style;
+ }
+ setCellVal(sheet, _idx, 0, "Ac/Re(A绫伙級");
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 1, 5));
+ setCellVal(sheet, _idx, 1, row0["acRe_A"]?.ToString() ?? "");
+
+ setCellVal(sheet, _idx, 6, "Ac/Re(B绫伙級");
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 7, 11));
+ setCellVal(sheet, _idx, 7, row0["acRe_B"]?.ToString() ?? "");
+
+ setCellVal(sheet, _idx, 12, "Ac/Re(C绫伙級");
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 13, 17));
+ setCellVal(sheet, _idx, 13, row0["acRe_C"]?.ToString() ?? "");
+ _idx++;
+
+ // 绗�6琛岋細鎶芥牱淇℃伅
+ IRow sampleRow = sheet.CreateRow(_idx);
+ sampleRow.HeightInPoints = rowHeight;
+ for (int i = 0; i < maxCols; i++)
+ {
+ ICell cell = sampleRow.CreateCell(i);
+ cell.CellStyle = style;
+ }
+ setCellVal(sheet, _idx, 0, "鎶芥牱");
+ setCellVal(sheet, _idx, 1, "鍖�閫�");
+ setCellVal(sheet, _idx, 2, row0["SampleMethod"]?.ToString() == "鍖�閫�" ? "鈭�" : "");
+ setCellVal(sheet, _idx, 3, "闅忔満");
+ setCellVal(sheet, _idx, 4, row0["SampleMethod"]?.ToString() == "闅忔満" ? "鈭�" : "");
+
+ setCellVal(sheet, _idx, 5, "鏍锋湰鏁�");
+ setCellVal(sheet, _idx, 6, "鍖�閫熸娊鏍锋暟");
+ setCellVal(sheet, _idx, 7, row0["sampleSize1"]?.ToString() ?? "");
+ setCellVal(sheet, _idx, 8, "闅忔満鎶芥牱鏁�");
+ setCellVal(sheet, _idx, 9, row0["sampleSize2"]?.ToString() ?? "");
+ setCellVal(sheet, _idx, 10, "鏍锋湰");
+ setCellVal(sheet, _idx, 11, row0["sampleSize3"]?.ToString() ?? "");
+ _idx++;
+
+ // 绗�7琛岋細妫�楠岄」鐩〃澶�
+ IRow headerRow = sheet.CreateRow(_idx);
+ headerRow.HeightInPoints = rowHeight;
+ for (int i = 0; i < maxCols; i++)
+ {
+ ICell cell = headerRow.CreateCell(i);
+ cell.CellStyle = styleTitle;
+ }
+ setCellVal(sheet, _idx, 0, "椤圭洰");
+ setCellVal(sheet, _idx, 1, "鏍囧噯");
+ setCellVal(sheet, _idx, 2, "1");
+ setCellVal(sheet, _idx, 3, "2");
+ // 鏍规嵁闇�瑕佺户缁坊鍔犳洿澶氬垪鏍囬锛岃繖閲岀畝鍖栦负涓昏鍒�
+ for (int i = 4; i < 18; i++)
+ {
+ setCellVal(sheet, _idx, i, (i-1).ToString());
+ }
+ _idx++;
+
+ // 妫�楠岄」鐩暟鎹�
+ if (dtSource.Tables.Count > 1)
+ {
+ DataTable tb1 = dtSource.Tables[1];
+ foreach (DataRow rrr in tb1.Rows)
+ {
+ IRow dataRow = sheet.CreateRow(_idx);
+ dataRow.HeightInPoints = rowHeight;
+
+ for (int i = 0; i < maxCols; i++)
+ {
+ ICell cell = dataRow.CreateCell(i);
+ cell.CellStyle = style;
+ }
+
+ setCellVal(sheet, _idx, 0, rrr["RPB003"]?.ToString() ?? "");
+ setCellVal(sheet, _idx, 1, rrr["RPB004"]?.ToString() ?? "");
+
+ // 濉厖16涓祴璇曞��
+ for (int i = 0; i < 16; i++)
+ {
+ string colName = $"RPB{i + 5:D3}"; // RPB005, RPB006, ..., RPB020
+ if (rrr.Table.Columns.Contains(colName))
+ {
+ setCellVal(sheet, _idx, i + 2, rrr[colName]?.ToString() ?? "");
+ }
+ else
+ {
+ setCellVal(sheet, _idx, i + 2, "");
+ }
+ }
+
+ _idx++;
+ }
+ }
+
+ // 涓嶅悎鏍煎唴瀹硅褰�
+ IRow defectHeaderRow = sheet.CreateRow(_idx);
+ defectHeaderRow.HeightInPoints = rowHeight;
+ for (int i = 0; i < maxCols; i++)
+ {
+ ICell cell = defectHeaderRow.CreateCell(i);
+ cell.CellStyle = styleTitle;
+ }
+ setCellVal(sheet, _idx, 0, "搴忓彿");
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 1, 10)); // 涓嶅悎鏍煎唴瀹瑰崰澶氬垪
+ setCellVal(sheet, _idx, 1, "涓嶅悎鏍煎唴瀹�");
+ setCellVal(sheet, _idx, 11, "A绫�");
+ setCellVal(sheet, _idx, 12, "B绫�");
+ setCellVal(sheet, _idx, 13, "C绫�");
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 14, 17)); // 娉ㄦ剰鐐瑰崰鍓╀綑鍒�
+ setCellVal(sheet, _idx, 14, "娉ㄦ剰鐐�");
+ _idx++;
+
+ if (dtSource.Tables.Count > 2)
+ {
+ DataTable tb2 = dtSource.Tables[2];
+ foreach (DataRow rrr in tb2.Rows)
+ {
+ if (rrr["Description"]?.ToString() == "涓嶈壇鏁伴噺")
+ break;
+ IRow dataRow = sheet.CreateRow(_idx);
+ dataRow.HeightInPoints = rowHeight;
+
+ for (int i = 0; i < maxCols; i++)
+ {
+ ICell cell = dataRow.CreateCell(i);
+ cell.CellStyle = style;
+ }
+
+ setCellVal(sheet, _idx, 0, rrr["Seq"]?.ToString() ?? "");
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 1, 10)); // 涓嶅悎鏍煎唴瀹瑰崰澶氬垪
+ setCellVal(sheet, _idx, 1, rrr["Description"]?.ToString() ?? "");
+ setCellVal(sheet, _idx, 11, rrr["AClass"]?.ToString() ?? "");
+ setCellVal(sheet, _idx, 12, rrr["BClass"]?.ToString() ?? "");
+ setCellVal(sheet, _idx, 13, rrr["CClass"]?.ToString() ?? "");
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 14, 17)); // 娉ㄦ剰鐐瑰崰鍓╀綑鍒�
+ setCellVal(sheet, _idx, 14, rrr["Point"]?.ToString() ?? "");
+ _idx++;
+ }
+
+ DataRow dr = tb2.Rows[tb2.Rows.Count - 1];
+ // 澶囨敞琛�
+ IRow remarkRow = sheet.CreateRow(_idx);
+ remarkRow.HeightInPoints = rowHeight;
+ for (int i = 0; i < maxCols; i++)
+ {
+ ICell cell = remarkRow.CreateCell(i);
+ cell.CellStyle = style;
+ }
+ setCellVal(sheet, _idx, 0, "澶囨敞锛�");
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 1, 8));
+ setCellVal(sheet, _idx, 9, "涓嶈壇鏁伴噺锛�");
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 9, 10));
+ setCellVal(sheet, _idx, 11, dr["AClass"]?.ToString() ?? "");
+ setCellVal(sheet, _idx, 12, dr["BClass"]?.ToString() ?? "");
+ setCellVal(sheet, _idx, 13, dr["CClass"]?.ToString() ?? "");
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 14, 17)); // 娉ㄦ剰鐐瑰崰鍓╀綑鍒�
+ setCellVal(sheet, _idx, 14, dr["Point"]?.ToString() ?? "");
+ _idx++;
+
+ // 澶х殑澶囨敞鍐呭鍖哄煙
+ IRow remarkContentRow = sheet.CreateRow(_idx);
+ remarkContentRow.HeightInPoints = 60;
+ for (int i = 0; i < maxCols; i++)
+ {
+ ICell cell = remarkContentRow.CreateCell(i);
+ cell.CellStyle = style;
+ }
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 0, 17));
+ setCellVal(sheet, _idx, 0, dr["Remark"]?.ToString() ?? "");
+ _idx++;
+ }
+
+ // 妫�楠屽垽瀹氬尯鍩燂紙3琛屽竷灞�锛�
+ for (int judgeRowIndex = 0; judgeRowIndex < 3; judgeRowIndex++)
+ {
+ IRow judgmentRow = sheet.CreateRow(_idx);
+ judgmentRow.HeightInPoints = rowHeight;
+ for (int i = 0; i < maxCols; i++)
+ {
+ ICell cell = judgmentRow.CreateCell(i);
+ cell.CellStyle = styleTitle;
+ }
+
+ if (judgeRowIndex == 0)
+ {
+ // 绗竴琛岋細妫�楠屽垽瀹�
+ setCellVal(sheet, _idx, 0, "妫�楠屽垽瀹�");
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx + 2, 0, 0)); // 妫�楠屽垽瀹氳法3琛�
+
+ if (row0["CheckResult"]?.ToString() == "鍚堟牸")
+ {
+ setCellVal(sheet, _idx, 1, "鈭� 鍚堟牸 鈻� 涓嶅悎鏍�");
+ }
+ else if(row0["CheckResult"]?.ToString() == "涓嶅悎鏍�")
+ {
+ setCellVal(sheet, _idx, 1, "鈻� 鍚堟牸 鈭� 涓嶅悎鏍�");
+ }
+ else
+ {
+ setCellVal(sheet, _idx, 1, "鈻� 鍚堟牸 鈻� 涓嶅悎鏍�");
+ }
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx + 1, 1, 5)); // 鍚堟牸/涓嶅悎鏍艰法2琛�
+
+ setCellVal(sheet, _idx, 6, "瀹℃牳");
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx + 2, 6, 6)); // 瀹℃牳璺�3琛�
+
+ if (row0["ProcessResults"]?.ToString() == "鏃�")
+ {
+ setCellVal(sheet, _idx, 7, "鈭� 鏃� 鈻� 杩斿伐");
+ }
+ else if (row0["ProcessResults"]?.ToString() == "杩斿伐")
+ {
+ setCellVal(sheet, _idx, 7, "鈻� 鏃� 鈭� 杩斿伐");
+ }
+ else
+ {
+ setCellVal(sheet, _idx, 7, "鈻� 鏃� 鈻� 杩斿伐");
+ }
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 7, 11));
+
+ setCellVal(sheet, _idx, 12, "瀹℃壒");
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx + 2, 12, 12)); // 瀹℃壒璺�3琛�
+
+ if (row0["ProcessResults"]?.ToString() == "鏃�")
+ {
+ setCellVal(sheet, _idx, 13, "鈭� 鏃� 鈻� 杩斿伐");
+ }
+ else if (row0["ProcessResults"]?.ToString() == "杩斿伐")
+ {
+ setCellVal(sheet, _idx, 13, "鈻� 鏃� 鈭� 杩斿伐");
+ }
+ else
+ {
+ setCellVal(sheet, _idx, 13, "鈻� 鏃� 鈻� 杩斿伐");
+ }
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 13, 17));
+ }
+ else if (judgeRowIndex == 1)
+ {
+ if (row0["ProcessResults"]?.ToString() == "璁╂鎺ユ敹")
+ {
+ setCellVal(sheet, _idx, 7, "鈭� 璁╂鎺ユ敹 鈻� 鐗归噰");
+ }
+ else if (row0["ProcessResults"]?.ToString() == "鐗归噰")
+ {
+ setCellVal(sheet, _idx, 7, "鈻� 璁╂鎺ユ敹 鈭� 鐗归噰");
+ }
+ else
+ {
+ setCellVal(sheet, _idx, 7, "鈻� 璁╂鎺ユ敹 鈻� 鐗归噰");
+ }
+ // 绗簩琛岋細璁╂鎺ユ敹閫夐」
+
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 7, 11));
+
+ if (row0["ProcessResults"]?.ToString() == "璁╂鎺ユ敹")
+ {
+ setCellVal(sheet, _idx, 13, "鈭� 璁╂鎺ユ敹 鈻� 鐗归噰");
+ }
+ else if (row0["ProcessResults"]?.ToString() == "鐗归噰")
+ {
+ setCellVal(sheet, _idx, 13, "鈻� 璁╂鎺ユ敹 鈭� 鐗归噰");
+ }
+ else
+ {
+ setCellVal(sheet, _idx, 13, "鈻� 璁╂鎺ユ敹 鈻� 鐗归噰");
+ }
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 13, 17));
+ }
+ else
+ {
+ // 绛惧悕琛�
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 1, 2));
+ setCellVal(sheet, _idx, 1, $"绛惧悕/鏃ユ湡锛�");
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 3, 5));
+ setCellVal(sheet, _idx, 3, $"{row0["JY_USER"]?.ToString() ?? ""}/{row0["JY_DATE"]?.ToString() ?? ""}");
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 7, 8));
+ setCellVal(sheet, _idx, 7, $"绛惧悕/鏃ユ湡锛�");
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 9, 11));
+ setCellVal(sheet, _idx, 9, $"{row0["CHECK_USER"]?.ToString() ?? ""}/{row0["CHECK_DATE"]?.ToString() ?? ""}");
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 13, 14));
+ setCellVal(sheet, _idx, 13, $"绛惧悕/鏃ユ湡锛�");
+ sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 15, 17));
+ setCellVal(sheet, _idx, 15, $"{row0["SP_USER"]?.ToString() ?? ""}/{row0["SP_DATE"]?.ToString() ?? ""}");
+ }
+ _idx++;
+ }
+ //淇濆瓨
+ using (var ms = new MemoryStream())
+ {
+ using (var fs = new FileStream(strFileName, FileMode.Create, FileAccess.Write))
+ {
+ workbook.Write(ms);
+ ms.Flush();
+ ms.Position = 0;
+ var data = ms.ToArray();
+ fs.Write(data, 0, data.Length);
+ fs.Flush();
+ }
+ }
+ }
/// <summary>
/// Excel瀵煎叆鎴怐atable
diff --git a/WebApi/Gs.Toolbox/InterfaceUtil.cs b/WebApi/Gs.Toolbox/InterfaceUtil.cs
index 794a67b..c40aa81 100644
--- a/WebApi/Gs.Toolbox/InterfaceUtil.cs
+++ b/WebApi/Gs.Toolbox/InterfaceUtil.cs
@@ -20,8 +20,10 @@
/// <returns>濡傛灉鎴愬姛杩斿洖鏃ュ織guid,鍚﹀垯杩斿洖涓�</returns>
public static (int, string) HttpPostErp(string param, string edtUserGuid = "", string abtGuid = "", string hNo = "", int urlType = 0)
{
- System.Text.StringBuilder sbTm = new System.Text.StringBuilder();
- sbTm.Append(DateTime.Now.ToString() + "寮�濮嬪彂閫�");
+ int _rtn = 0;
+ //鏃ュ織璇︾粏锛屽彂閫佺殑鏃跺�欙紝璁板綍鏃ュ織锛屽瓨鍌ㄨ繃绋嬭皟鐢ㄧ殑鏃跺�欙紝鍐嶇疮鍔犱笂mes涓氬姟鐨勬搷浣滅粨鏋�
+ System.Text.StringBuilder sbLog = new System.Text.StringBuilder();
+ sbLog.Append(DateTime.Now.ToString() + "寮�濮嬪彂閫�");
string strLogGuid = Guid.NewGuid().ToString();
string url = AppSettingsHelper.getValueByKey("TestErpUrl");
if (urlType == 2)
@@ -55,9 +57,9 @@
}
catch (Exception ex)
{
- LogHelper.Debug(url, "HttpPostErp param:" + param + "锛宔x:" + ex.Message);
+ LogHelper.Debug(url, "HttpPostErp response:" + param + "锛宔x:" + ex.Message);
responseStr = ex.Message;
- // throw ex;
+ _rtn = -1;
}
finally
{
@@ -65,15 +67,17 @@
requestStream = null;
response = null;
}
- Result _result = JsonConvert.DeserializeObject<Result>(responseStr);
- int _rtn = 0;
- if ("200".Equals(_result.state))
- _rtn = 1;
- sbTm.Append("," + DateTime.Now.ToString() + "缁撴潫鍙戦��");
+ if (_rtn != -1)
+ {
+ Result _result = JsonConvert.DeserializeObject<Result>(responseStr);
+ if ("200".Equals(_result.state))
+ _rtn = 1;
+ }
+ sbLog.Append("," + DateTime.Now.ToString() + "缁撴潫鍙戦��");
if (_rtn > 0)
- sbTm.Append(",鍙戦�佹垚鍔�");
+ sbLog.Append(",鍙戦�佹垚鍔�");
else
- sbTm.Append(",鍙戦�佸け璐�,mes閫�鍑烘搷浣�");
+ sbLog.Append(",鍙戦�佸け璐�,mes閫�鍑烘搷浣�");
try
{
SqlParameter[] parameters =
@@ -81,11 +85,13 @@
new("@edtUserGuid", edtUserGuid),
new("@abtGuid", abtGuid),
new("@abtTable", ""),
- new("@detail", sbTm.ToString()),
+ new("@detail", sbLog.ToString()),
new("@hNo", hNo),
new("@RtnLogGuid", strLogGuid),
new("@SendJson", param),
new("@RtnJson", responseStr),
+ new("@isSuccess", (_rtn>0?1:0)),
+ new("@isErp", 1),
};
DbHelperSQL.RunProcedure("[prc_log_create]", parameters);
}
diff --git a/WebApi/Gs.Warehouse/Services/MesDepotSectionsManager.cs b/WebApi/Gs.Warehouse/Services/MesDepotSectionsManager.cs
index 4895098..9e4606c 100644
--- a/WebApi/Gs.Warehouse/Services/MesDepotSectionsManager.cs
+++ b/WebApi/Gs.Warehouse/Services/MesDepotSectionsManager.cs
@@ -1,11 +1,9 @@
-锘縰sing AngleSharp.Text;
-using Gs.Entity.BaseInfo;
-using Gs.Entity.Sys;
+锘縰sing Gs.Entity.BaseInfo;
using Gs.Toolbox;
using Gs.Toolbox.ApiCore.Abstract.Mvc;
using Gs.Toolbox.ApiCore.Common.Mvc;
using Gs.Toolbox.ApiCore.Group;
-using SqlSugar;
+using Microsoft.AspNetCore.Http;
using System.Data;
using System.Text;
@@ -15,50 +13,15 @@
public class MesDepotSectionsManager : Repository<MesDepotSections>,
IRomteService
{
+ private readonly IHttpContextAccessor _http;
- /// <summary>
- /// 鏌ヨ鍒楄〃锛屾敮鎸佸垎椤�
- /// </summary>
- /// <param name="query"></param>
- /// <returns></returns>
- [RequestMethod(RequestMethods.POST)]
- public ReturnDto<PageList<MesDepotSections>> GetListPage(PageQuery query)
+ private readonly string _userCode, _userGuid, _orgFids;
+
+ public MesDepotSectionsManager()
{
- var pageList = new PageList<MesDepotSections>();
- try
- {
- var _sbWhere = new StringBuilder(" 1=1" + query.keyWhere);
- var _sbBy = new StringBuilder(query.sortName + " " + query.sortOrder);
- var totalCount = 0;
- // 鍏堟瀯寤哄熀纭�鏌ヨ
- var queryBase = Db.Queryable<MesDepots>()
- .LeftJoin<MesDepotSections>((a, b) => a.Guid == b.DepotGuid);
- //.LeftJoin<SysOrganization>((a, b, c) => a.FSubsidiary == c.Fid)
- //.LeftJoin<MesStaff>((a, b, c, d) => a.CreateBy == d.Id.ToString())
- //.LeftJoin<MesCustomer>((a, b, c, d, e) => e.Id.ToString() == a.ClientId)
- //.LeftJoin<MesSupplier>((a, b, c, d, e, f) => f.Id.ToString() == a.SuppLierId)
- //.LeftJoin<SysDepartment>((a, b, c, d, e, f, g) => g.Id.ToString() == a.department);
- // 鐒跺悗杩涜閫夋嫨鍜屽垎椤�
- var itemsList = queryBase.Select((a, b) => new MesDepotSections
- {
- Guid = b.Guid,
- DepotSectionCode = b.DepotSectionCode,
- DepotSectionName = b.DepotSectionName
- })
- .Where(_sbWhere.ToString())
- .OrderBy(_sbBy.ToString())
- .ToPageList(query.currentPage, query.everyPageSize, ref totalCount);
-
- pageList = new PageList<MesDepotSections>(itemsList, totalCount,
- query.everyPageSize);
- return ReturnDto<PageList<MesDepotSections>>.QuickReturn(pageList,
- ReturnCode.Success, "璇诲彇鎴愬姛");
- }
- catch (Exception ex)
- {
- return ReturnDto<PageList<MesDepotSections>>.QuickReturn(pageList,
- ReturnCode.Default, ex.Message);
- }
+ //_http = httpContextAccessor;
+ //(_userCode, _userGuid, _orgFids) =
+ // UtilityHelper.GetUserGuidAndOrgGuid(_http);
}
@@ -72,51 +35,30 @@
{
var currentPage = model.currentPage;
var everyPageSize = model.everyPageSize;
- var sortName = string.IsNullOrEmpty(model.sortName) ? "a.PAGE_GROUP" : model.sortName;
+ var sortName = string.IsNullOrEmpty(model.sortName) ? "a.USER_NAME" : model.sortName;
var keyWhere = model.keyWhere;
string keyType = model.keyType;
+ System.Text.StringBuilder sbJoin = new StringBuilder();
+ sbJoin.Append(" from [dbo].[MES_DEPOT_SECTIONS] a ");
+ sbJoin.Append(" left join [dbo].[MES_DEPOTS] d on a.depot_guid=d.depot_id");
+ sbJoin.Append(" left join SYS_ORGANIZATION org on d.FSubsidiary=org.FID");
+ sbJoin.Append(keyWhere);
var sbSql = new StringBuilder();
sbSql.Append(" SELECT * FROM ");
- sbSql.Append(" (SELECT N'(' +[Org].[FNumber] + N')' +[Org].[NAME] AS [FSubsidiary2] ,");
- sbSql.Append(" [Org].[NAME] AS [OrgName] , [Org].[FNumber] AS [OrgId] , CAST([c].[staff_name]");
- sbSql.Append(" AS NVARCHAR(MAX)) AS [CreateBy] , [d].[cust_name] AS [ClientId] ,");
- sbSql.Append(" [f].[supp_name] AS [SuppLierId] , [g].[departmentname] AS [department2] ,");
- sbSql.Append(" ( CASE WHEN ( [a].[is_ng] = N'A' ) THEN N'姝e父' ELSE N'绂佺敤' END ) AS [IsNg] ");
- // 娣诲姞MesDepotSections琛ㄧ殑瀛楁
- sbSql.Append(" , [b].[DepotSectionCode] AS [DepotSectionCode] ");
- sbSql.Append(" , [b].[DepotSectionName] AS [DepotSectionName] ");
- sbSql.Append(" , [a].*,ROW_NUMBER() OVER(ORDER BY org.FNumber asc ,a.depot_code asc) AS RowIndex ");
+ sbSql.Append(" (SELECT N'(' +[Org].[FNumber] + N')' +[Org].[NAME] AS [FSubsidiary2]");
+ sbSql.Append(", a.depot_section_code as cwCode,a.depot_section_name as cwName,d.depot_name as ckName,d.depot_id as ckId,d.depot_code as ckCode ,ROW_NUMBER() OVER(ORDER BY a.depot_section_code asc) AS RowIndex ");
+ //濡傛灉鏃犲叧閿瓧锛屾棤闇�鎵炬煡缁戝畾
if (string.IsNullOrEmpty(keyType))
{
sbSql.Append(",cast(0 as bit) as chkInt");
}
else
- {
- sbSql.Append(",cast( (select count(1) from SYS_USER_BIND b where b.userGuid='" + keyType + "' and b.aboutGuid=a.guid) as bit) as chkInt ");
- }
- // 娣诲姞LEFT JOIN MesDepotSections琛�
- sbSql.Append(" FROM [MES_DEPOTS] [a] ");
- sbSql.Append(" Left JOIN [MES_DEPOT_SECTIONS] [b] ON [a].[Guid] = [b].[DepotGuid] "); // 鏂板鐨凧OIN
- sbSql.Append(" Left JOIN [SYS_ORGANIZATION] [Org] ON ( [a].[FSubsidiary] = [Org].[FID] )");
- sbSql.Append(" Left JOIN [MES_STAFF] [c] ON ( [a].[create_by] = CAST([c].[id] AS NVARCHAR(50))) ");
- sbSql.Append(" Left JOIN [MES_CUSTOMER] [d] ON (CAST([d].[id] AS NVARCHAR(50)) = CAST([a].[Client_Id] AS NVARCHAR(50))) ");
- sbSql.Append(" Left JOIN [MES_SUPPLIER] [f] ON (CAST([f].[id] AS NVARCHAR(50)) = CAST([a].[SUPPLIER_ID] AS NVARCHAR(50))) ");
- sbSql.Append(" Left JOIN [SYS_DEPARTMENT] [g] ON (CAST([g].[id] AS NVARCHAR(50)) = CAST([a].[department] AS NVARCHAR(50))) ");
- sbSql.Append(" WHERE 1=1");
- sbSql.Append(keyWhere);
+ sbSql.Append(",cast( (select count(1) from SYS_USER_BIND bind where bind.userGuid='" + keyType + "' and bind.aboutGuid=a.depot_section_code and bind.fType='搴撲綅') as bit) as chkInt ");
+ sbSql.Append(sbJoin);
sbSql.Append(") T");
sbSql.Append(" where T.rowindex>(" + currentPage + "-1)*" + everyPageSize + " and T.rowindex<=" + currentPage + "*" + everyPageSize);
-
- // 鍚屾椂闇�瑕佷慨鏀硅鏁版煡璇紝娣诲姞鐩稿悓鐨凧OIN鏉′欢
- sbSql.Append(" select count(1) as intTotal FROM [MES_DEPOTS] [a] ");
- sbSql.Append(" Left JOIN [MES_DEPOT_SECTIONS] [b] ON [a].[Guid] = [b].[DepotGuid] "); // 鏂板鐨凧OIN
- sbSql.Append(" Left JOIN [SYS_ORGANIZATION] [Org] ON ( [a].[FSubsidiary] = [Org].[FID] )");
- sbSql.Append(" Left JOIN [MES_STAFF] [c] ON ( [a].[create_by] = CAST([c].[id] AS NVARCHAR(50))) ");
- sbSql.Append(" Left JOIN [MES_CUSTOMER] [d] ON (CAST([d].[id] AS NVARCHAR(50)) = CAST([a].[Client_Id] AS NVARCHAR(50))) ");
- sbSql.Append(" Left JOIN [MES_SUPPLIER] [f] ON (CAST([f].[id] AS NVARCHAR(50)) = CAST([a].[SUPPLIER_ID] AS NVARCHAR(50))) ");
- sbSql.Append(" Left JOIN [SYS_DEPARTMENT] [g] ON (CAST([g].[id] AS NVARCHAR(50)) = CAST([a].[department] AS NVARCHAR(50))) ");
- sbSql.Append(" WHERE 1=1");
- sbSql.Append(keyWhere);
+ sbSql.Append(" select count(1) as intTotal ");
+ sbSql.Append(sbJoin);
var dset = new DataSet();
try
{
@@ -151,4 +93,6 @@
ReturnCode.Success, "璇诲彇鎴愬姛");
}
+
+
}
\ No newline at end of file
diff --git a/WebApi/Gs.Warehouse/Services/MesDepotsManager.cs b/WebApi/Gs.Warehouse/Services/MesDepotsManager.cs
index de7b05d..07b72ba 100644
--- a/WebApi/Gs.Warehouse/Services/MesDepotsManager.cs
+++ b/WebApi/Gs.Warehouse/Services/MesDepotsManager.cs
@@ -8,7 +8,6 @@
using Gs.Toolbox.ApiCore.Group;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
-using Microsoft.Extensions.Logging;
using Newtonsoft.Json.Linq;
using NPOI.SS.Formula.Functions;
using SqlSugar;
@@ -41,7 +40,8 @@
try
{
var _sbWhere = new StringBuilder(" 1=1" + query.keyWhere);
- var _sbBy = new StringBuilder(query.sortName + " " + query.sortOrder);
+ var _sbBy =
+ new StringBuilder(query.sortName + " " + query.sortOrder);
var totalCount = 0;
var itemsList = Db.Queryable<MesDepots, SysOrganization, MesStaff, MesCustomer, MesSupplier, SysDepartment>(
(a, Org, c, d, f, g) => new object[]
@@ -87,96 +87,6 @@
}
/// <summary>
- /// 鏌ヨ鍒楄〃锛屾敮鎸佸垎椤�
- /// </summary>
- /// <param name="query"></param>
- /// <returns></returns>
- [RequestMethod(RequestMethods.POST)]
- public ReturnDto<PageList<MesDepots>> GetListPage3(PageQuery query)
- {
- var pageList = new PageList<MesDepots>();
- try
- {
- // 鏋勫缓鏌ヨ鏉′欢
- var whereClause = "1=1" + (string.IsNullOrEmpty(query.keyWhere) ? "" : query.keyWhere);
- var orderBy = $"{query.sortName ?? "DepotCode"} {query.sortOrder ?? "ASC"}";
- var totalCount = 0;
-
- // 浣跨敤鏇存竻鏅扮殑鏌ヨ璇硶
- var queryable = Db.Queryable<MesDepots>()
- .LeftJoin<SysOrganization>((a, Org) => a.FSubsidiary == Org.Fid)
- .LeftJoin<MesStaff>((a, c) => a.CreateBy == c.Id.ToString())
- .LeftJoin<MesCustomer>((a, d) => d.Id.ToString() == a.ClientId.ToString())
- .LeftJoin<MesSupplier>((a, f) => f.Id.ToString() == a.SuppLierId.ToString())
- .LeftJoin<SysDepartment>((a, g) => g.Id.ToString() == a.department.ToString())
- .LeftJoin<MesItems>((a, h) => h.DepotCode.ToString() == a.DepotId.ToString())
- .Where(whereClause)
- .GroupBy(a => new {
- a.Guid,
- a.DepotCode,
- a.DepotName,
- a.DepotId,
- a.FSubsidiary,
- a.CreateBy,
- a.ClientId,
- a.SuppLierId,
- a.department,
- a.IsNg,
- a.DocumentStatus
- })
- .OrderBy(orderBy);
-
- // 浣跨敤鏇村畨鍏ㄧ殑鏄犲皠鏂瑰紡
- var itemsList = queryable.Select<MesDepots>(a => new MesDepots
- {
- Guid = a.Guid,
- DepotCode = a.DepotCode,
- DepotName = a.DepotName,
- DepotId = a.DepotId,
- FSubsidiary = SqlFunc.Subqueryable<SysOrganization>()
- .Where(org => org.Fid == a.FSubsidiary)
- .Select(org => "(" + org.FNumber + ")" + org.Name),
- OrgName = SqlFunc.Subqueryable<SysOrganization>()
- .Where(org => org.Fid == a.FSubsidiary)
- .Select(org => org.Name),
- OrgId = SqlFunc.Subqueryable<SysOrganization>()
- .Where(org => org.Fid == a.FSubsidiary)
- .Select(org => org.FNumber),
- CreateBy = SqlFunc.Subqueryable<MesStaff>()
- .Where(staff => staff.Id.ToString() == a.CreateBy)
- .Select(staff => staff.StaffName),
- ClientId = SqlFunc.Subqueryable<MesCustomer>()
- .Where(cust => cust.Id.ToString() == a.ClientId)
- .Select(cust => cust.CustName),
- SuppLierId = SqlFunc.Subqueryable<MesSupplier>()
- .Where(supp => supp.Id.ToString() == a.SuppLierId)
- .Select(supp => supp.SuppName),
- department = SqlFunc.Subqueryable<SysDepartment>()
- .Where(dept => dept.Id.ToString() == a.department)
- .Select(dept => dept.Departmentname),
- IsNg = a.IsNg + ":" + (a.IsNg == "A" ? "姝e父" : "绂佺敤"),
- DocumentStatus = a.DocumentStatus + ":" +
- SqlFunc.IF(a.DocumentStatus == "Z").Return("鏆傚瓨")
- .ElseIF(a.DocumentStatus == "A").Return("鍒涘缓")
- .ElseIF(a.DocumentStatus == "B").Return("瀹℃牳涓�")
- .ElseIF(a.DocumentStatus == "C").Return("宸插鏍�")
- .ElseIF(a.DocumentStatus == "D").Return("閲嶆柊瀹℃牳")
- .End(a.DocumentStatus)
- })
- .ToPageList(query.currentPage, query.everyPageSize, ref totalCount);
-
- pageList = new PageList<MesDepots>(itemsList, totalCount, query.everyPageSize);
- return ReturnDto<PageList<MesDepots>>.QuickReturn(pageList, ReturnCode.Success, "璇诲彇鎴愬姛");
- }
- catch (Exception ex)
- {
-
- return ReturnDto<PageList<MesDepots>>.QuickReturn(pageList,
- ReturnCode.Default, $"绯荤粺閿欒: {ex.Message}");
- }
- }
-
- /// <summary>
/// 鏌ヨ鍒楄〃锛屾敮鎸佸垎椤�,鐢ㄤ簬鍚勭缁戝畾
/// </summary>
/// <param name="query"></param>
@@ -202,7 +112,7 @@
sbSql.Append(",cast(0 as bit) as chkInt");
}
else
- sbSql.Append(",cast( (select count(1) from SYS_USER_BIND b where b.userGuid='" + keyType + "' and b.aboutGuid=a.guid) as bit) as chkInt ");
+ sbSql.Append(",cast( (select count(1) from SYS_USER_BIND b where b.userGuid='" + keyType + "' and b.aboutGuid=a.guid and b.fType='浠撳簱') as bit) as chkInt ");
sbSql.Append(" FROM [MES_DEPOTS] [a] Left JOIN [SYS_ORGANIZATION] [Org] ON ( [a].[FSubsidiary] = [Org].[FID] )");
sbSql.Append(" Left JOIN [MES_STAFF] [c] ON ( [a].[create_by] = CAST([c].[id] AS NVARCHAR(50))) ");
sbSql.Append(" Left JOIN [MES_CUSTOMER] [d] ON (CAST([d].[id] AS NVARCHAR(50)) = CAST([a].[Client_Id] AS NVARCHAR(50))) ");
@@ -264,18 +174,18 @@
public ReturnDto<MesDepots> GetModel([FromBody] MesDepots model)
{
var m = base.GetById(model.Guid);
- string _CreateBy = m.CreateBy;
- try
- {
- m.CreateBy = Gs.Toolbox.DbHelperSQL.GetSingle("select top 1 staff_name from [dbo].[MES_STAFF] where id='" + _CreateBy + "'").ToString();
- }
- catch (Exception ex)
- {
- Gs.Toolbox.LogHelper.Debug(this.ToString(), "璇诲彇璐熻矗浜篹rror," + ex.Message);
- }
+ //string _CreateBy = m.CreateBy;
+ //try
+ //{
+ // m.CreateBy = Gs.Toolbox.DbHelperSQL.GetSingle("select top 1 staff_name from [dbo].[MES_STAFF] where id='" + _CreateBy + "'").ToString();
+ //}
+ //catch (Exception ex)
+ //{
+ // Gs.Toolbox.LogHelper.Debug(this.ToString(), "璇诲彇璐熻矗浜篹rror," + ex.Message);
+ //}
m.IsNg = m.IsNg + ":" + (m.IsNg == "A" ? "姝e父" : "绂佺敤");
var lst = new MesDepotSectionsManager();
- m.list = lst.GetList(it => it.DepotGuid == m.Guid).OrderBy(it => it.Xh).ToList();
+ m.list = lst.GetList(it => it.DepotGuid == m.Guid).OrderBy(it => it.DepotSectionCode).ToList();
if (m != null)
return ReturnDto<MesDepots>.QuickReturn(m, ReturnCode.Success, "璇诲彇鎴愬姛锛�");
return ReturnDto<MesDepots>.QuickReturn(m, ReturnCode.Default, "璇诲彇澶辫触锛�");
@@ -292,6 +202,12 @@
System.Text.StringBuilder sbMsg = new System.Text.StringBuilder();
try
{
+ string Remark55 = model.Remark5;
+ string Guid55 = model.Guid;
+ //if (!string.IsNullOrEmpty(Remark55))
+ //{
+ Gs.Toolbox.DbHelperSQL.ExecuteSql(" update MES_DEPOTS set Remark5='" + Remark55 + "' where guid='" + Guid55 + "'");
+ //}
Db.Ado.BeginTran();
var _manager = new MesDepotSectionsManager();
var _upLst = new List<MesDepotSections>();
diff --git a/WebApi/Gs.Warehouse/Services/MesInvItemArnManager.cs b/WebApi/Gs.Warehouse/Services/MesInvItemArnManager.cs
index dd35489..619199b 100644
--- a/WebApi/Gs.Warehouse/Services/MesInvItemArnManager.cs
+++ b/WebApi/Gs.Warehouse/Services/MesInvItemArnManager.cs
@@ -213,14 +213,11 @@
public ReturnDto<ExpandoObject> EditModel([FromBody] dynamic model)
{
Guid? guid = model.Guid; //鍒拌揣鍗曚富閿�
- //string shDh = model.PaperBillNo; //閫佽揣鍗曞彿
- string shDh = model.bcsl;
+ string shDh = model.PaperBillNo; //閫佽揣鍗曞彿
string bz = model.Remark; //澶囨敞
string gysId = model.SuppId; //渚涘簲鍟�
string orgId = model.OrgId; //鏀舵枡缁勭粐
-
- // string depot = model.Depot;//浠撳簱
-
+ int isSrm = model.IsSrm;
var _sb = new StringBuilder();
var _split = "|";
foreach (var m in model.list)
@@ -256,12 +253,15 @@
new("@outSum", SqlDbType.Int),
new("@outGuid", SqlDbType.UniqueIdentifier),
new("@outNo", SqlDbType.NVarChar, 300),
- new("@inOrderGuid", UtilityHelper.CheckGuid(guid) ? guid : DBNull.Value),
+ new("@inOrderGuid",
+ UtilityHelper.CheckGuid(guid)
+ ? guid
+ : DBNull.Value),
new("@inShdh", shDh),
new("@inBz", bz),
new("@inGysId", gysId),
new("@OrgId", orgId),
- // new("@inDepot",depot),
+ new("@isSrm", isSrm),
new("@inEdtUserGuid", _userGuid),
new("@inLineList", _sb.ToString())
};
@@ -311,7 +311,7 @@
foreach (string _val in guidList) sbMx.Append(_val);
using (var conn = new SqlConnection(DbHelperSQL.strConn))
{
- using (var cmd = new SqlCommand("[prc_cgdhd_tui]", conn))
+ using (var cmd = new SqlCommand("[prc_cgyt_dj_add]", conn))
{
try
{
@@ -337,7 +337,7 @@
catch (Exception ex)
{
LogHelper.Debug(ToString(),
- "prc_cgdhd_tui error锛�" + ex.Message);
+ "prc_cgyt_dj_add error锛�" + ex.Message);
_outMsg = ex.Message;
_outSum = -1;
}
@@ -379,7 +379,6 @@
new("@inEdtUserGuid", _userGuid),
new("@inOrderGuid", _guid),
new("@inFieldValue", 1),
- new("@inFieldName", ""),
new("@in1", ""),
new("@in2", "")
};
@@ -388,11 +387,8 @@
foreach (var parameter in parameters)
cmd.Parameters.Add(parameter);
cmd.ExecuteNonQuery();
-
-
m.outMsg = parameters[0].Value.ToString();
m.outSum = int.Parse(parameters[1].Value.ToString());
-
}
catch (Exception ex)
{
@@ -466,64 +462,7 @@
return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "鎿嶄綔鎴愬姛锛�");
}
- /// <summary>
- /// 鍚堝苟鎻愪氦妫�楠� 2025-08-06 kyy
- /// </summary>
- /// <param name="mode"></param>
- /// <returns></returns>
- [RequestMethod(RequestMethods.POST)]
- public ReturnDto<ExpandoObject> EditModelSubmitHb([FromBody] dynamic mode)
- {
- string _guid = mode.guid;
- dynamic m = new ExpandoObject();
- m.outSum = -1;
- m.outMsg = "";
- using (var conn = new SqlConnection(DbHelperSQL.strConn))
- {
- using (var cmd = new SqlCommand("prc_cgdhd_submit_hb", conn))
- {
- try
- {
- conn.Open();
- cmd.CommandType = CommandType.StoredProcedure;
- SqlParameter[] parameters =
- {
- new("@outMsg", SqlDbType.NVarChar, 2500),
- new("@outSum", SqlDbType.Int),
- new("@inEdtUserGuid", _userGuid),
- new("@inOrderGuid", _guid),
- new("@inFieldValue", 1),
- new("@inFieldName", ""),
- new("@in1", ""),
- new("@in2", "")
- };
- parameters[0].Direction = ParameterDirection.Output;
- parameters[1].Direction = ParameterDirection.Output;
- foreach (var parameter in parameters)
- cmd.Parameters.Add(parameter);
- cmd.ExecuteNonQuery();
-
- m.outMsg = parameters[0].Value.ToString();
- m.outSum = int.Parse(parameters[1].Value.ToString());
-
- }
- catch (Exception ex)
- {
- LogHelper.Debug(ToString(),
- "prc_cgdhd_submit_hb error锛�" + ex.Message);
- m.outMsg = ex.Message;
- return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default,
- ex.Message);
- }
- finally
- {
- conn.Close();
- }
- }
- }
- return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "鎿嶄綔鎴愬姛锛�");
- }
/// <summary>
/// 璇诲彇鍒楄〃锛屾敮鎸佸垎椤�
@@ -558,7 +497,7 @@
new("@inQueryWhere", keyWhere),
new("@inBusType", inBusType),
new("@inSupId", inSupId),
- new("@inP1", inReceiveOrgId),
+ new("@inP1", inReceiveOrgId),//缁勭粐
new("@inP2", "")
};
foreach (var parameter in parameters)
@@ -666,8 +605,147 @@
"璇诲彇鎴愬姛锛�");
}
+
#endregion
-
+ #region srm
+
+ /// <summary>
+ /// 璇诲彇srm
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<PageList<dynamic>> SelectSrm([FromBody] dynamic model)
+ {
+ int currentPage = model.currentPage;
+ int everyPageSize = model.everyPageSize;
+ string sortName = model.sortName;
+ string keyWhere = model.keyWhere;
+ string inBusType = model.inBusType;
+ string inSupId = model.inSupId;
+ string inReceiveOrgId = model.inReceiveOrgId;
+ var dset = new DataSet();
+ try
+ {
+ using (var conn = new SqlConnection(DbHelperSQL.strConn))
+ {
+ using (var cmd = new SqlCommand("[prc_sel_dhd_by_xky]", conn))
+ {
+ conn.Open();
+ cmd.CommandType = CommandType.StoredProcedure;
+ SqlParameter[] parameters =
+ {
+ new("@inCurrentPage", currentPage),
+ new("@inEveryPageSize", everyPageSize),
+ new("@inSortName", sortName),
+ new("@inSortOrder", ""),
+ new("@inQueryWhere", keyWhere),
+ new("@inBusType", inBusType),//1鏄噰璐紝2鏄澶�
+ new("@inSupId", inSupId),//渚涘簲鍟�
+ new("@inP1", inReceiveOrgId),//缁勭粐
+ new("@inP2", "")
+ };
+ foreach (var parameter in parameters)
+ cmd.Parameters.Add(parameter);
+ using (var dt =
+ new SqlDataAdapter(cmd))
+ {
+ dt.Fill(dset, "0");
+ }
+ }
+ conn.Close();
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), "SelectSrm error锛�" + ex.Message);
+ return ReturnDto<PageList<dynamic>>.QuickReturn(
+ default(PageList<dynamic>), ReturnCode.Exception, "璇诲彇澶辫触");
+ }
+
+ var _pglist = new PageList<dynamic>
+ {
+ total = 0,
+ everyPageSize = 0,
+ pages = 0,
+ list = new List<dynamic>()
+ };
+ if (dset != null && dset.Tables.Count > 0 &&
+ dset.Tables[0].Rows.Count > 0) //鏈夋暟鎹�
+ {
+ var intTotal =
+ int.Parse(dset.Tables[1].Rows[0]["intTotal"].ToString());
+ var pages = intTotal % everyPageSize != 0
+ ? intTotal / everyPageSize + 1
+ : intTotal / everyPageSize;
+ _pglist.total = intTotal;
+ _pglist.everyPageSize = everyPageSize;
+ _pglist.pages = pages;
+ var _dy = dset.Tables[0].TableToDynamicList();
+ _pglist.list = _dy;
+ }
+
+ return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
+ ReturnCode.Success, "璇诲彇鎴愬姛");
+ }
+
+
+ /// <summary>
+ /// 鏍规嵁鍗曞彿璇诲彇srm鏄庣粏
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<List<dynamic>> SelectSrmTo([FromBody] dynamic model)
+ {
+ string pi_shdh = model.inShdh;
+ string inP1 = model.inP1;
+ string inP2 = model.inP2;
+ var lst = new List<dynamic>();
+ var dset = new DataSet();
+ using (var conn = new SqlConnection(DbHelperSQL.strConn))
+ {
+ using (var cmd = new SqlCommand("[prc_sel_dhdmx_by_xky]", conn))
+ {
+ try
+ {
+ conn.Open();
+ cmd.CommandType = CommandType.StoredProcedure;
+ SqlParameter[] parameters =
+ {
+ new("@pi_shdh",pi_shdh),
+ new("@inP1",""),
+ new("@inP2",""),
+ };
+ foreach (var parameter in parameters)
+ cmd.Parameters.Add(parameter);
+ using (var dt =
+ new SqlDataAdapter(cmd))
+ {
+ dt.Fill(dset, "0");
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(),
+ "prc_sel_dhdmx_by_xky error锛�" + ex.Message);
+ }
+ finally
+ {
+ conn.Close();
+ }
+ }
+ }
+
+ if (dset != null && dset.Tables.Count > 0 &&
+ dset.Tables[0].Rows.Count > 0) //鏈夋暟鎹�
+ lst = dset.Tables[0].TableToDynamicList();
+
+ return ReturnDto<List<dynamic>>.QuickReturn(lst, ReturnCode.Success,
+ "璇诲彇鎴愬姛锛�");
+ }
+
+ #endregion
}
\ No newline at end of file
diff --git a/WebApi/Gs.Warehouse/Services/MesInvItemInsManager.cs b/WebApi/Gs.Warehouse/Services/MesInvItemInsManager.cs
index 828f895..9940de3 100644
--- a/WebApi/Gs.Warehouse/Services/MesInvItemInsManager.cs
+++ b/WebApi/Gs.Warehouse/Services/MesInvItemInsManager.cs
@@ -133,68 +133,6 @@
/// <summary>
- /// 鍒犻櫎涓昏〃鎴栨槑缁�
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- [RequestMethod(RequestMethods.POST)]
- public ReturnDto<int?> DeleteCgrk([FromBody] dynamic model)
- {
- int? rtnInt = (int)ReturnCode.Default;
- Guid? guid = model.guid; //鍒拌揣鍗曚富閿�
- string mxGuid = model.mxGuid;
- var _outMsg = "";
- var _outSum = -1;
- using (var conn = new SqlConnection(DbHelperSQL.strConn))
- {
- using (var cmd = new SqlCommand("[prc_cgrk_del]", conn))
- {
- try
- {
- conn.Open();
- cmd.CommandType = CommandType.StoredProcedure;
- SqlParameter[] parameters =
- {
- new("@outMsg", SqlDbType.NVarChar, 300),
- new("@outSum", SqlDbType.Int),
- new("@inOrderGuid",
- UtilityHelper.CheckGuid(guid)
- ? guid
- : DBNull.Value),
- new("@inEdtUserGuid", _userGuid),
- new("@inMxGuid", mxGuid)
- };
- parameters[0].Direction = ParameterDirection.Output;
- parameters[1].Direction = ParameterDirection.Output;
- foreach (var parameter in parameters)
- cmd.Parameters.Add(parameter);
-
- cmd.ExecuteNonQuery();
- _outMsg = parameters[0].Value.ToString();
- _outSum = int.Parse(parameters[1].Value.ToString());
- }
- catch (Exception ex)
- {
- LogHelper.Debug(ToString(),
- "prc_cgdhd_Edt error锛�" + ex.Message);
- _outMsg = ex.Message;
- _outSum = -1;
- }
- finally
- {
- conn.Close();
- }
- }
- }
-
- if (_outSum <= 0)
- return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Exception,
- _outMsg);
- return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Success, _outMsg);
- }
-
-
- /// <summary>
/// 瀹℃牳鍜屽弽瀹℃牳
/// </summary>
/// <param name="mode"></param>
diff --git a/WebApi/Gs.Warehouse/Services/MesRohInManager.cs b/WebApi/Gs.Warehouse/Services/MesRohInManager.cs
index 629dd77..ed455e7 100644
--- a/WebApi/Gs.Warehouse/Services/MesRohInManager.cs
+++ b/WebApi/Gs.Warehouse/Services/MesRohInManager.cs
@@ -14,17 +14,25 @@
/// 閲囪喘涓昏〃锛屾暟鎹粠erp鏉�
/// </summary>
[ApiGroup(ApiGroupNames.PerMission)]
-public class MesRohInManager :IRomteService
+public class MesRohInManager : IRomteService
{
+
+ /// <summary>
+ /// HTTP涓婁笅鏂�
+ /// </summary>
private readonly IHttpContextAccessor _http;
+
+ /// <summary>
+ /// 鐢ㄦ埛code,鐢ㄦ埛guid,缁勭粐id鍒楄〃
+ /// </summary>
private readonly string _userCode, _userGuid, _orgFids;
public MesRohInManager(IHttpContextAccessor httpContextAccessor)
{
+ //鍙橀噺闄勫��
_http = httpContextAccessor;
- (_userCode, _userGuid, _orgFids) =
- UtilityHelper.GetUserGuidAndOrgGuid(_http);
+ (_userCode, _userGuid, _orgFids) =UtilityHelper.GetUserGuidAndOrgGuid(_http);
}
/// <summary>
@@ -35,10 +43,10 @@
[RequestMethod(RequestMethods.POST)]
public ReturnDto<PageList<dynamic>> GetListPage([FromBody] dynamic model)
{
- int currentPage = model.currentPage;
- int everyPageSize = model.everyPageSize;
- string sortName = model.sortName;
- string keyWhere = model.keyWhere;
+ int currentPage = model.currentPage;//褰撳墠椤�
+ int everyPageSize = model.everyPageSize;//姣忛〉澶у皬
+ string sortName = model.sortName;//鎺掑簭
+ string keyWhere = model.keyWhere;//鏌ヨ鏉′欢
SqlParameter[] parameters =
{
new("@inCurrentPage", currentPage),
@@ -66,8 +74,9 @@
if (dset != null && dset.Tables.Count > 0 &&
dset.Tables[0].Rows.Count > 0) //鏈夋暟鎹�
{
- var intTotal =
- int.Parse(dset.Tables[1].Rows[0]["intTotal"].ToString());
+ //鎬昏褰曟暟
+ var intTotal =int.Parse(dset.Tables[1].Rows[0]["intTotal"].ToString());
+ //璁$畻鍏辨湁鍑犻〉
var pages = intTotal % everyPageSize != 0
? intTotal / everyPageSize + 1
: intTotal / everyPageSize;
@@ -88,7 +97,7 @@
/// <summary>
- /// 璇诲彇
+ /// 璇诲彇鏄庣粏
/// </summary>
/// <param name="guid"></param>
/// <returns></returns>
@@ -114,11 +123,13 @@
if (dset != null && dset.Tables.Count > 0 &&
dset.Tables[0].Rows.Count > 0)
{
+ //涓讳綋淇℃伅
var dr = dset.Tables[0].Rows[0];
m = dr.RowToDynamic();
+ //琛�1
var _tb = dset.Tables[1].TableToDynamicList();
m.list = _tb;
-
+ //琛�2
var _tb2 = dset.Tables[2].TableToDynamicList();
m.list2 = _tb2;
}
@@ -133,4 +144,6 @@
"璇诲彇鎴愬姛锛�");
return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, "璇诲彇澶辫触锛�");
}
+
+
}
\ No newline at end of file
diff --git a/WebApi/Gs.Warehouse/Services/VArrivalBarcodeManager.cs b/WebApi/Gs.Warehouse/Services/VArrivalBarcodeManager.cs
index 44e4de0..ec7c04f 100644
--- a/WebApi/Gs.Warehouse/Services/VArrivalBarcodeManager.cs
+++ b/WebApi/Gs.Warehouse/Services/VArrivalBarcodeManager.cs
@@ -115,7 +115,6 @@
m = dr.RowToDynamic();
m.list1 = dset.Tables[1].TableToDynamicList();
m.list2 = dset.Tables[2].TableToDynamicList();
- m.list3 = dset.Tables[3].TableToDynamicList();
}
}
catch (Exception ex)
@@ -125,68 +124,6 @@
return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success,
"璇诲彇鎴愬姛锛�");
}
-
- /* /// <summary>
- /// 鍒犻櫎鏉$爜
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- [RequestMethod(RequestMethods.POST)]
- public ReturnDto<int?> DeleteBarcode([FromBody] dynamic model)
- {
- int? rtnInt = (int)ReturnCode.Default;
- string guidList = model.guidList;
- string aboutType = model.aboutType;
- string aboutGuid = model.aboutGuid;
- var _outMsg = "";
- var _outSum = -1;
- using (var conn = new SqlConnection(DbHelperSQL.strConn))
- {
- using (var cmd = new SqlCommand("[prc_barcode_del]", conn))
- {
- try
- {
- conn.Open();
- cmd.CommandType = CommandType.StoredProcedure;
- SqlParameter[] parameters =
- {
- new("@outMsg", SqlDbType.NVarChar, 300),
- new("@outSum", SqlDbType.Int),
- new("@inOrderGuid", aboutGuid),
- new("@inEdtUserGuid", _userGuid),
- new("@guidList", guidList),
- new("@aboutType", aboutType)
- };
- parameters[0].Direction = ParameterDirection.Output;
- parameters[1].Direction = ParameterDirection.Output;
- foreach (var parameter in parameters)
- cmd.Parameters.Add(parameter);
- cmd.ExecuteNonQuery();
- _outMsg = parameters[0].Value.ToString();
- _outSum = int.Parse(parameters[1].Value.ToString());
- }
- catch (Exception ex)
- {
- LogHelper.Debug(ToString(),
- "prc_barcode_del error锛�" + ex.Message);
- _outMsg = ex.Message;
- _outSum = -1;
- }
- finally
- {
- conn.Close();
- }
- }
- }
-
- if (_outSum <= 0)
- return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Exception,
- _outMsg);
- return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Success, _outMsg);
- }
- */
- /// <summary>
-
/// <summary>
/// 鍒犻櫎鏉$爜
@@ -202,15 +139,9 @@
string aboutGuid = model.aboutGuid;
var _outMsg = "";
var _outSum = -1;
-
- // 鍒ゆ柇aboutGuid鏄惁涓烘湁鏁堢殑uniqueidentifier
- bool is_validGuid = Guid.TryParse(aboutGuid, out _);
- // 鏍规嵁楠岃瘉缁撴灉閫夋嫨瀵瑰簲鐨勫瓨鍌ㄨ繃绋�
- string storedProcedureName = is_validGuid ? "[prc_barcode_del]" : "[prc_barcode_del_hb]";
-
using (var conn = new SqlConnection(DbHelperSQL.strConn))
{
- using (var cmd = new SqlCommand(storedProcedureName, conn))
+ using (var cmd = new SqlCommand("[prc_barcode_del]", conn))
{
try
{
@@ -218,13 +149,13 @@
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter[] parameters =
{
- new("@outMsg", SqlDbType.NVarChar, 300),
- new("@outSum", SqlDbType.Int),
- new("@inOrderGuid", aboutGuid),
- new("@inEdtUserGuid", _userGuid),
- new("@guidList", guidList),
- new("@aboutType", aboutType)
- };
+ new("@outMsg", SqlDbType.NVarChar, 300),
+ new("@outSum", SqlDbType.Int),
+ new("@inOrderGuid", aboutGuid),
+ new("@inEdtUserGuid", _userGuid),
+ new("@guidList", guidList),
+ new("@aboutType", aboutType)
+ };
parameters[0].Direction = ParameterDirection.Output;
parameters[1].Direction = ParameterDirection.Output;
foreach (var parameter in parameters)
@@ -236,7 +167,7 @@
catch (Exception ex)
{
LogHelper.Debug(ToString(),
- $"{storedProcedureName} error锛歿ex.Message}");
+ "prc_barcode_del error锛�" + ex.Message);
_outMsg = ex.Message;
_outSum = -1;
}
@@ -253,8 +184,6 @@
return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Success, _outMsg);
}
-
-
/// <summary>
/// 閫夋嫨鏉$爜
/// </summary>
@@ -269,6 +198,7 @@
string keyWhere = model.keyWhere;
string aboutGuid = model.aboutGuid;
string aboutType = model.aboutType;
+ string qcGuid = model.qcGuid;
var dset = new DataSet();
try
{
@@ -286,7 +216,8 @@
new("@inSortOrder", ""),
new("@inQueryWhere", keyWhere),
new("@inP1", aboutGuid),
- new("@inP2", aboutType)
+ new("@inP2", aboutType),
+ new("@inP3", qcGuid)
};
foreach (var parameter in parameters)
cmd.Parameters.Add(parameter);
@@ -327,5 +258,4 @@
return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
ReturnCode.Success, "璇诲彇鎴愬姛");
}
-
}
\ No newline at end of file
diff --git a/WebApi/Gs.Wom/Service/FanGongManager.cs b/WebApi/Gs.Wom/Service/FanGongManager.cs
new file mode 100644
index 0000000..702a04d
--- /dev/null
+++ b/WebApi/Gs.Wom/Service/FanGongManager.cs
@@ -0,0 +1,188 @@
+锘縰sing Gs.Toolbox.ApiCore.Common.Mvc;
+using Gs.Toolbox;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using System.Data;
+using System.Dynamic;
+using Gs.Toolbox.ApiCore.Abstract.Mvc;
+using System.Data.SqlClient;
+using Gs.Toolbox.ApiCore.Group;
+
+namespace Gs.Wom.Service
+{
+ [ApiGroup(ApiGroupNames.QC)]
+ public class FanGongManager : IRomteService
+ {
+ private readonly IHttpContextAccessor _http;
+
+ private readonly string _userCode, _userGuid, _orgFids;
+
+ public FanGongManager(IHttpContextAccessor httpContextAccessor)
+ {
+ _http = httpContextAccessor;
+ (_userCode, _userGuid, _orgFids) =
+ UtilityHelper.GetUserGuidAndOrgGuid(_http);
+ }
+
+ /// <summary>
+ /// 璇诲彇鍒楄〃锛屾敮鎸佸垎椤�
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<PageList<dynamic>> GetListPage([FromBody] dynamic model)
+ {
+ int currentPage = model.currentPage;
+ int everyPageSize = model.everyPageSize;
+ string sortName = model.sortName;
+ string keyWhere = model.keyWhere;
+ SqlParameter[] parameters =
+ {
+ new("@inCurrentPage", currentPage),
+ new("@inEveryPageSize", everyPageSize),
+ new("@inSortName", sortName),
+ new("@inSortOrder", ""),
+ new("@inQueryWhere", keyWhere),
+ new("@inFid", ""),
+ new("@inP1", ""),
+ new("@inP2", ""),
+ new("@inP3", ""),
+ new("@inP4", "")
+ };
+ var dset = new DataSet();
+ var _pglist = new PageList<dynamic>
+ {
+ total = 0,
+ everyPageSize = 0,
+ pages = 0,
+ list = new List<dynamic>()
+ };
+ try
+ {
+ dset = DbHelperSQL.RunProcedure("prc_fgd_lst", parameters, "0");
+ if (dset != null && dset.Tables.Count > 0 &&
+ dset.Tables[0].Rows.Count > 0) //鏈夋暟鎹�
+ {
+ var intTotal =
+ int.Parse(dset.Tables[1].Rows[0]["intTotal"].ToString());
+ var pages = intTotal % everyPageSize != 0
+ ? intTotal / everyPageSize + 1
+ : intTotal / everyPageSize;
+ _pglist.total = intTotal;
+ _pglist.everyPageSize = everyPageSize;
+ _pglist.pages = pages;
+ var _dy = dset.Tables[0].TableToDynamicList();
+ _pglist.list = _dy;
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), ex.Message);
+ }
+ return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
+ ReturnCode.Success, "璇诲彇鎴愬姛");
+ }
+
+
+ /// <summary>
+ /// 璇诲彇
+ /// </summary>
+ /// <param name="guid"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<ExpandoObject> GetModel([FromBody] dynamic model)
+ {
+ string guid = model.guid.ToString();
+ dynamic m = new ExpandoObject();
+ m.list = new List<dynamic>();
+ m.list2 = new List<dynamic>();
+ m.list3 = new List<dynamic>();
+ SqlParameter[] parameters =
+ {
+ new("@inMainGuid", guid),
+ new("@inP1", ""),
+ new("@inP2", ""),
+ new("@inP3", ""),
+ new("@inP4", "")};
+ var dset = new DataSet();
+ try
+ {
+ dset = DbHelperSQL.RunProcedure("[prc_fgd_mx]", parameters, "0");
+ if (dset != null && dset.Tables.Count > 0 &&
+ dset.Tables[0].Rows.Count > 0)
+ {
+ var dr = dset.Tables[0].Rows[0];
+ m = dr.RowToDynamic();
+ var _tb = dset.Tables[1].TableToDynamicList();
+ m.list = _tb;
+ var _tb2 = dset.Tables[2].TableToDynamicList();
+ m.list2 = _tb2;
+ var _tb3 = dset.Tables[3].TableToDynamicList();
+ m.list3 = _tb3;
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), ex.Message);
+ }
+ if (m != null)
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "璇诲彇鎴愬姛锛�");
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, "璇诲彇澶辫触锛�");
+ }
+
+
+ /// <summary>
+ /// 鐢熸垚鏂扮殑杩芥函鐮�
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<int?> CreateTrace([FromBody] dynamic model)
+ {
+ int? rtnInt = (int)ReturnCode.Default;
+ Guid? guid = model.guid;
+ var _outMsg = "";
+ var _outSum = -1;
+ using (var conn = new SqlConnection(DbHelperSQL.strConn))
+ {
+ using (var cmd = new SqlCommand("[prc_fgd_trace_code]", conn))
+ {
+ try
+ {
+ conn.Open();
+ cmd.CommandType = CommandType.StoredProcedure;
+ SqlParameter[] parameters =
+ {
+ new("@outMsg", SqlDbType.NVarChar, 300),
+ new("@outSum", SqlDbType.Int),
+ new("@inOrderGuid", UtilityHelper.CheckGuid(guid)? guid : DBNull.Value),
+ new("@inEdtUserGuid", _userGuid),
+ };
+ parameters[0].Direction = ParameterDirection.Output;
+ parameters[1].Direction = ParameterDirection.Output;
+ foreach (var parameter in parameters)
+ cmd.Parameters.Add(parameter);
+ cmd.ExecuteNonQuery();
+ _outMsg = parameters[0].Value.ToString();
+ _outSum = int.Parse(parameters[1].Value.ToString());
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(),
+ "prc_fgd_trace_code error锛�" + ex.Message);
+ _outMsg = ex.Message;
+ _outSum = -1;
+ }
+ finally
+ {
+ conn.Close();
+ }
+ }
+ }
+ if (_outSum <= 0)
+ return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Exception,_outMsg);
+ return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Success, _outMsg);
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/WebApi/Gs.Wom/Service/MesScrkDjManager.cs b/WebApi/Gs.Wom/Service/MesScrkDjManager.cs
index 674ce74..e6790b8 100644
--- a/WebApi/Gs.Wom/Service/MesScrkDjManager.cs
+++ b/WebApi/Gs.Wom/Service/MesScrkDjManager.cs
@@ -158,7 +158,7 @@
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter[] parameters =
{
- new("@outMsg", SqlDbType.NVarChar, 2500),
+ new("@outMsg", SqlDbType.NVarChar, 2500),
new("@outSum", SqlDbType.Int),
new("@inEdtUserGuid", _userGuid),
new("@inOrderGuid", _guid),
diff --git a/WebApi/Gs.Wom/Service/WomdaaManager.cs b/WebApi/Gs.Wom/Service/WomdaaManager.cs
index d380820..392b6de 100644
--- a/WebApi/Gs.Wom/Service/WomdaaManager.cs
+++ b/WebApi/Gs.Wom/Service/WomdaaManager.cs
@@ -1,21 +1,21 @@
-锘縰sing System.Data;
-using System.Data.SqlClient;
-using System.Dynamic;
-using System.Text;
-using Gs.Toolbox;
+锘縰sing Gs.Toolbox;
using Gs.Toolbox.ApiCore.Abstract.Mvc;
using Gs.Toolbox.ApiCore.Common.Mvc;
using Gs.Toolbox.ApiCore.Group;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;
+using System.Data;
+using System.Data.SqlClient;
+using System.Dynamic;
+using System.Text;
using static Gs.Toolbox.UtilityHelper;
namespace Gs.Wom.Service;
[ApiGroup(ApiGroupNames.WOM)]
-public class WomdaaManager :IRomteService
+public class WomdaaManager : IRomteService
{
private readonly IHttpContextAccessor _http;
@@ -127,10 +127,16 @@
m.list2 = _tb2;
var _tb3 = dset.Tables[3].TableToDynamicList();
m.list3 = _tb3;
- var _tb4= dset.Tables[4].TableToDynamicList();
+ var _tb4 = dset.Tables[4].TableToDynamicList();
m.list4 = _tb4;
var _tb5 = dset.Tables[5].TableToDynamicList();
m.list5 = _tb5;
+ var _tb6 = dset.Tables[6].TableToDynamicList();
+ m.list6 = _tb6;
+ var _tb7 = dset.Tables[7].TableToDynamicList();
+ m.list7 = _tb7;
+ var _tb8 = dset.Tables[8].TableToDynamicList();
+ m.list8 = _tb8;
}
}
catch (Exception ex)
@@ -259,63 +265,65 @@
- ///// <summary>
- ///// 澧炲姞鎴栫紪杈戝疄浣�
- ///// </summary>
- ///// <param name="model"></param>
- ///// <returns></returns>
- //[RequestMethod(RequestMethods.POST)]
- //public ReturnDto<string?> EditModel([FromBody] dynamic model)
- //{
- // Guid? guid = model.guid; //涓婚敭
- // string sjxt = model.sjxt; //宸ュ崟鍙�
- // string bz = model.bz;//浠撳簱
- // var _outMsg = "";
- // var _outSum = -1;
- // using (var conn = new SqlConnection(DbHelperSQL.strConn))
- // {
- // using (var cmd = new SqlCommand("[prc_wom_daa_edt]", conn))
- // {
- // try
- // {
- // conn.Open();
- // cmd.CommandType = CommandType.StoredProcedure;
- // SqlParameter[] parameters =
- // {
- // new("@outMsg", SqlDbType.NVarChar, 300),
- // new("@outSum", SqlDbType.Int),
- // new("@inOrderGuid",UtilityHelper.CheckGuid(guid)? guid : DBNull.Value),
- // new("@inSjxt", sjxt),
- // new("@inBz", bz),
- // new("@inEdtUserGuid", _userGuid),
- // };
- // parameters[0].Direction = ParameterDirection.Output;
- // parameters[1].Direction = ParameterDirection.Output;
- // foreach (var parameter in parameters)
- // cmd.Parameters.Add(parameter);
- // cmd.ExecuteNonQuery();
- // _outMsg = parameters[0].Value.ToString();
- // _outSum = int.Parse(parameters[1].Value.ToString());
- // }
- // catch (Exception ex)
- // {
- // LogHelper.Debug(ToString(),
- // "prc_wom_daa_edt error锛�" + ex.Message);
- // _outMsg = ex.Message;
- // _outSum = -1;
- // }
- // finally
- // {
- // conn.Close();
- // }
- // }
- // }
- // if (_outSum <= 0)
- // return ReturnDto<string>.QuickReturn(guid.ToString(),
- // ReturnCode.Exception, _outMsg);
- // return ReturnDto<string>.QuickReturn(guid.ToString(),
- // ReturnCode.Success, _outMsg);
- //}
+ /// <summary>
+ /// 澧炲姞鎴栫紪杈戝疄浣�
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<string?> EditModel([FromBody] dynamic model)
+ {
+ Guid? guid = model.guid; //涓婚敭
+ string sjxt = model.sjxt; //宸ュ崟鍙�
+ string bz = model.bz;
+ string sclx = model.sclx;
+ var _outMsg = "";
+ var _outSum = -1;
+ using (var conn = new SqlConnection(DbHelperSQL.strConn))
+ {
+ using (var cmd = new SqlCommand("[prc_wom_daa_edt]", conn))
+ {
+ try
+ {
+ conn.Open();
+ cmd.CommandType = CommandType.StoredProcedure;
+ SqlParameter[] parameters =
+ {
+ new("@outMsg", SqlDbType.NVarChar, 300),
+ new("@outSum", SqlDbType.Int),
+ new("@inOrderGuid",UtilityHelper.CheckGuid(guid)? guid : DBNull.Value),
+ new("@inSjxt", sjxt),
+ new("@inBz", bz),
+ new("@inSclx", sclx),
+ new("@inEdtUserGuid", _userGuid),
+ };
+ parameters[0].Direction = ParameterDirection.Output;
+ parameters[1].Direction = ParameterDirection.Output;
+ foreach (var parameter in parameters)
+ cmd.Parameters.Add(parameter);
+ cmd.ExecuteNonQuery();
+ _outMsg = parameters[0].Value.ToString();
+ _outSum = int.Parse(parameters[1].Value.ToString());
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(),
+ "prc_wom_daa_edt error锛�" + ex.Message);
+ _outMsg = ex.Message;
+ _outSum = -1;
+ }
+ finally
+ {
+ conn.Close();
+ }
+ }
+ }
+ if (_outSum <= 0)
+ return ReturnDto<string>.QuickReturn(guid.ToString(),
+ ReturnCode.Exception, _outMsg);
+ return ReturnDto<string>.QuickReturn(guid.ToString(),
+ ReturnCode.Success, _outMsg);
+ }
/// <summary>
@@ -470,58 +478,56 @@
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
- [RequestMethod(RequestMethods.POST)]
- public ReturnDto<int?> DeleteBarcode([FromBody] dynamic model)
- {
- int? rtnInt = (int)ReturnCode.Default;
- string mxGuid = model.mxGuid;
- string inType = model.inType;
- var _outMsg = "";
- var _outSum = -1;
- using (var conn = new SqlConnection(DbHelperSQL.strConn))
- {
- using (var cmd = new SqlCommand("[prc_wom_daatm_del]", conn))
- {
- try
- {
- conn.Open();
- cmd.CommandType = CommandType.StoredProcedure;
- SqlParameter[] parameters =
- {
- new("@outMsg", SqlDbType.NVarChar, 300),
- new("@outSum", SqlDbType.Int),
- new("@inEdtUserGuid", _userGuid),
- new("@inMxGuid", mxGuid),
- new("@inType", inType)
- };
- parameters[0].Direction = ParameterDirection.Output;
- parameters[1].Direction = ParameterDirection.Output;
- foreach (var parameter in parameters)
- cmd.Parameters.Add(parameter);
- cmd.ExecuteNonQuery();
- _outMsg = parameters[0].Value.ToString();
- _outSum = int.Parse(parameters[1].Value.ToString());
- }
- catch (Exception ex)
- {
- LogHelper.Debug(ToString(),
- "prc_wom_daatm_del error锛�" + ex.Message);
- _outMsg = ex.Message;
- _outSum = -1;
- }
- finally
- {
- conn.Close();
- }
- }
- }
- if (_outSum <= 0)
- return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Exception,
- _outMsg);
- return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Success, _outMsg);
- }
-
-
+ //[RequestMethod(RequestMethods.POST)]
+ //public ReturnDto<int?> DeleteBarcode([FromBody] dynamic model)
+ //{
+ // int? rtnInt = (int)ReturnCode.Default;
+ // string mxGuid = model.mxGuid;
+ // string inType = model.inType;
+ // var _outMsg = "";
+ // var _outSum = -1;
+ // using (var conn = new SqlConnection(DbHelperSQL.strConn))
+ // {
+ // using (var cmd = new SqlCommand("[prc_wom_daatm_del]", conn))
+ // {
+ // try
+ // {
+ // conn.Open();
+ // cmd.CommandType = CommandType.StoredProcedure;
+ // SqlParameter[] parameters =
+ // {
+ // new("@outMsg", SqlDbType.NVarChar, 300),
+ // new("@outSum", SqlDbType.Int),
+ // new("@inEdtUserGuid", _userGuid),
+ // new("@inMxGuid", mxGuid),
+ // new("@inType", inType)
+ // };
+ // parameters[0].Direction = ParameterDirection.Output;
+ // parameters[1].Direction = ParameterDirection.Output;
+ // foreach (var parameter in parameters)
+ // cmd.Parameters.Add(parameter);
+ // cmd.ExecuteNonQuery();
+ // _outMsg = parameters[0].Value.ToString();
+ // _outSum = int.Parse(parameters[1].Value.ToString());
+ // }
+ // catch (Exception ex)
+ // {
+ // LogHelper.Debug(ToString(),
+ // "prc_wom_daatm_del error锛�" + ex.Message);
+ // _outMsg = ex.Message;
+ // _outSum = -1;
+ // }
+ // finally
+ // {
+ // conn.Close();
+ // }
+ // }
+ // }
+ // if (_outSum <= 0)
+ // return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Exception,
+ // _outMsg);
+ // return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Success, _outMsg);
+ //}
/// <summary>
@@ -580,111 +586,37 @@
}
if (_outSum <= 0)
- return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Exception,_outMsg);
+ return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Exception, _outMsg);
return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Success, _outMsg);
}
/// <summary>
- /// 鏍规嵁绾夸綋鎴栬溅闂磇d锛岃鍙栧伐鍗�
+ /// 宸ヨ壓鍙樻洿
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[RequestMethod(RequestMethods.POST)]
- public ReturnDto<PageList<dynamic>> SelectDaa([FromBody] dynamic model)
+ public ReturnDto<ExpandoObject> EditGy([FromBody] dynamic model)
{
- int currentPage = model.currentPage;
- int everyPageSize = model.everyPageSize;
- string sortName = model.sortName;
- string keyWhere = model.keyWhere;
- string workId = model.workId;
- string lineId = model.lineId;
- var dset = new DataSet();
- try
+ Guid? guid = model.guid; //浜у搧涓婚敭
+ var _sb = new StringBuilder();
+ var _split = "|";
+ foreach (var m in model.list)
{
- using (var conn = new SqlConnection(DbHelperSQL.strConn))
- {
- using (var cmd = new SqlCommand("[prc_wom_daa_select]", conn))
- {
- conn.Open();
- cmd.CommandType = CommandType.StoredProcedure;
- SqlParameter[] parameters =
- {
- new("@inCurrentPage", currentPage),
- new("@inEveryPageSize", everyPageSize),
- new("@inSortName", sortName),
- new("@inSortOrder", ""),
- new("@inQueryWhere", keyWhere),
- new("@workId", workId),
- new("@inP1", lineId),
- new("@inP2", "")
- };
- foreach (var parameter in parameters)
- cmd.Parameters.Add(parameter);
- using (var dt = new SqlDataAdapter(cmd))
- {
- dt.Fill(dset, "0");
- }
- }
-
- conn.Close();
- }
+ var _line = m.processNo + _split
+ + m.frontProcessNo;
+ if (_sb.Length > 0)
+ _sb.Append("~");
+ _sb.Append(_line);
}
- catch (Exception ex)
- {
- LogHelper.Debug(ToString(), "prc_wom_pba_select error锛�" + ex.Message);
- return ReturnDto<PageList<dynamic>>.QuickReturn(default(PageList<dynamic>), ReturnCode.Exception, "璇诲彇澶辫触");
- }
-
- var _pglist = new PageList<dynamic>
- {
- total = 0,
- everyPageSize = 0,
- pages = 0,
- list = new List<dynamic>()
- };
- if (dset != null && dset.Tables.Count > 0 &&
- dset.Tables[0].Rows.Count > 0) //鏈夋暟鎹�
- {
- var intTotal =
- int.Parse(dset.Tables[1].Rows[0]["intTotal"].ToString());
- var pages = intTotal % everyPageSize != 0
- ? intTotal / everyPageSize + 1
- : intTotal / everyPageSize;
- _pglist.total = intTotal;
- _pglist.everyPageSize = everyPageSize;
- _pglist.pages = pages;
- var _dy = dset.Tables[0].TableToDynamicList();
- _pglist.list = _dy;
- }
-
- return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
- ReturnCode.Success, "璇诲彇鎴愬姛");
- }
-
- /// <summary>
- /// 鏍规嵁鐢ㄦ埛閫夋嫨鐨勯噰璐槑缁唃uid锛岃鍙栭渶瑕佷綔鍏ュ簱鍒拌揣鍗曠殑鏄庣粏
- /// </summary>
- /// <param name="query"></param>
- /// <returns></returns>
- [RequestMethod(RequestMethods.POST)]
- public ReturnDto<List<dynamic>> SelectDaaToView(
- JArray guidList)
- {
- var intArray = guidList.ToObject<string[]>();
- var sbLine = new StringBuilder();
- foreach (var str in intArray)
- {
- if (sbLine.Length > 0)
- sbLine.Append(",");
- sbLine.Append(str);
- }
-
- var lst = new List<dynamic>();
- var dset = new DataSet();
+ dynamic mObj = new ExpandoObject();
+ mObj.outMsg = "";
+ mObj.outSum = -1;
+ mObj.outGuid = "";
+ mObj.outNo = "";
using (var conn = new SqlConnection(DbHelperSQL.strConn))
{
- using (var cmd =
- new SqlCommand("[prc_wom_daa_select_to_grid]", conn))
+ using (var cmd = new SqlCommand("[prc_wom_daa_technique]", conn))
{
try
{
@@ -692,19 +624,26 @@
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter[] parameters =
{
- new("@inP1", sbLine.ToString())
+ new("@outMsg", SqlDbType.NVarChar, 300),
+ new("@outSum", SqlDbType.Int),
+ new("@inOrderGuid", CheckGuid(guid) ? guid : DBNull.Value),
+ new("@inEdtUserGuid", _userGuid),
+ new("@inLineList", _sb.ToString())
};
+ parameters[0].Direction = ParameterDirection.Output;
+ parameters[1].Direction = ParameterDirection.Output;
foreach (var parameter in parameters)
cmd.Parameters.Add(parameter);
- using (var dt = new SqlDataAdapter(cmd))
- {
- dt.Fill(dset, "0");
- }
+ cmd.ExecuteNonQuery();
+ mObj.outMsg = parameters[0].Value.ToString();
+ mObj.outSum = int.Parse(parameters[1].Value.ToString());
}
catch (Exception ex)
{
LogHelper.Debug(ToString(),
- "prc_wom_daa_select_to_grid error锛�" + ex.Message);
+ "prc_wom_daa_technique error锛�" + ex.Message);
+ mObj.outMsg = ex.Message;
+ mObj.outSum = -1;
}
finally
{
@@ -712,7 +651,34 @@
}
}
}
+ if (mObj.outSum <= 0)
+ return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Exception, mObj.outMsg);
+ return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Success, mObj.outMsg);
+ }
+
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="query"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<List<dynamic>> GetGyList(
+ [FromBody] dynamic model)
+ {
+ string daaGuid = model.guid;
+ var lst = new List<dynamic>();
+ var dset = new DataSet();
+ System.Text.StringBuilder sbSql = new System.Text.StringBuilder();
+ sbSql.Append(" select * from [dbo].[WOMDAA_TECHNIQUE] where daaGuid='" + daaGuid + "' order by processNo asc ");
+ try
+ {
+ dset = Gs.Toolbox.DbHelperSQL.Query(sbSql.ToString());
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), ex.Message);
+ }
if (dset != null && dset.Tables.Count > 0 &&
dset.Tables[0].Rows.Count > 0) //鏈夋暟鎹�
lst = dset.Tables[0].TableToDynamicList();
@@ -720,66 +686,49 @@
"璇诲彇鎴愬姛锛�");
}
+
/// <summary>
- /// 鎾ゅ洖鎶ュ伐
+ /// 鍙樻洿鍐呭寘瑁呮暟閲�
/// </summary>
- /// <param name="mode"></param>
+ /// <param name="model"></param>
/// <returns></returns>
[RequestMethod(RequestMethods.POST)]
- public ReturnDto<ExpandoObject> EditModelChbg([FromBody] dynamic mode)
+ public ReturnDto<int?> EditTb([FromBody] dynamic model)
{
- string _billNo = mode.billNo;
- string _inFieldValue = mode.inFieldValue;
- string _proName = "prc_pda_scbg_withdraw";
- dynamic m = new ExpandoObject();
- m.outSum = -1;
- m.outMsg = "";
-
- if (!Guid.TryParse(_userGuid, out Guid userGuid))
- throw new ArgumentException("鏃犳晥鐨� UserGuid");
+ int? rtnInt = (int)ReturnCode.Default;
+ Guid? guid = model.guid;
+ string sl = model.sl;
+ var _outMsg = "";
+ var _outSum = -1;
using (var conn = new SqlConnection(DbHelperSQL.strConn))
{
- using (var cmd = new SqlCommand(_proName, conn))
+ using (var cmd = new SqlCommand("[prc_wom_daa_nbz]", conn))
{
try
{
conn.Open();
cmd.CommandType = CommandType.StoredProcedure;
- // 鎸夌収瀛樺偍杩囩▼瀹氫箟鐨勯『搴忔坊鍔犲弬鏁�
SqlParameter[] parameters =
{
- // 杈撳叆鍙傛暟锛堟寜椤哄簭锛�
- new SqlParameter("@inEdtUserGuid", SqlDbType.UniqueIdentifier) { Value = userGuid },
- new SqlParameter("@inOrderGuid", SqlDbType.UniqueIdentifier) { Value = DBNull.Value }, // 浼犲叆null
- new SqlParameter("@pi_inventoryAppBillNo", SqlDbType.NVarChar, 100) { Value = string.Empty },
- new SqlParameter("@inBarcodeGuids", SqlDbType.NVarChar, -1) { Value = _billNo ?? (object)DBNull.Value },
- new SqlParameter("@in1", SqlDbType.NVarChar, 100) { Value = string.Empty },
- new SqlParameter("@in2", SqlDbType.NVarChar, 100) { Value = string.Empty },
- new SqlParameter("@in3", SqlDbType.NVarChar, 100) { Value = string.Empty },
-
- // 杈撳嚭鍙傛暟锛堟渶鍚庯級
- new SqlParameter("@outMsg", SqlDbType.NVarChar, 2000) { Direction = ParameterDirection.Output },
- new SqlParameter("@outSum", SqlDbType.Int) { Direction = ParameterDirection.Output }
- };
-
+ new("@outMsg", SqlDbType.NVarChar, 300),
+ new("@outSum", SqlDbType.Int),
+ new("@inOrderGuid", UtilityHelper.CheckGuid(guid) ? guid: DBNull.Value),
+ new("@inEdtUserGuid", _userGuid),
+ new("@inSl", sl)
+ };
+ parameters[0].Direction = ParameterDirection.Output;
+ parameters[1].Direction = ParameterDirection.Output;
foreach (var parameter in parameters)
cmd.Parameters.Add(parameter);
-
cmd.ExecuteNonQuery();
-
- m.outMsg = parameters[7].Value?.ToString() ?? ""; // @outMsg鏄8涓弬鏁帮紙绱㈠紩7锛�
- if (parameters[8].Value != DBNull.Value && parameters[8].Value != null)
- {
- m.outSum = Convert.ToInt32(parameters[8].Value); // @outSum鏄9涓弬鏁帮紙绱㈠紩8锛�
- }
+ _outMsg = parameters[0].Value.ToString();
+ _outSum = int.Parse(parameters[1].Value.ToString());
}
catch (Exception ex)
{
- LogHelper.Debug(ToString(),
- "prc_pda_scbg_withdraw error锛�" + ex.Message);
- m.outMsg = ex.Message;
- return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default,
- ex.Message);
+ LogHelper.Debug(ToString(), "prc_wom_daa_nbz error锛�" + ex.Message);
+ _outMsg = ex.Message;
+ _outSum = -1;
}
finally
{
@@ -787,7 +736,10 @@
}
}
}
- return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "鎿嶄綔鎴愬姛锛�");
+
+ if (_outSum <= 0)
+ return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Exception, _outMsg);
+ return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Success, _outMsg);
}
}
\ No newline at end of file
diff --git a/WebApi/Gs.Wom/Service/WompbaManager.cs b/WebApi/Gs.Wom/Service/WompbaManager.cs
index 3fe0a0e..321194e 100644
--- a/WebApi/Gs.Wom/Service/WompbaManager.cs
+++ b/WebApi/Gs.Wom/Service/WompbaManager.cs
@@ -143,8 +143,6 @@
Guid? guid = model.guid; //涓婚敭
string bz = model.bz; //澶囨敞
string cjId = model.cjId; //杞﹂棿
- string cxId = ""; //浜х嚎,鐢ㄤ笉鍒颁簡
- string jhrs = ""; //璁″垝浜烘暟,鐢ㄤ笉鍒颁簡
var _sb = new StringBuilder();
var _split = "|";
foreach (var m in model.list)
@@ -153,15 +151,11 @@
var _line = m.AboutGuid + _split
+ m.LineId + _split
+ m.Yjkgsj + _split
- + m.Jhrs + _split
- + m.Hxsj + _split
+ + m.Hxsj + _split//鐢熶骇绫诲瀷
+ m.Bz + _split
- + m.Blsj + _split
+ m.Pcsl + _split
+ m.Yjwgsj + _split
- + (CheckGuid(_guid)
- ? _guid
- : Guid.Empty.ToString());
+ + (CheckGuid(_guid)? _guid: Guid.Empty.ToString());
if (_sb.Length > 0)
_sb.Append("~");
_sb.Append(_line);
@@ -188,8 +182,6 @@
new("@inOrderGuid", CheckGuid(guid) ? guid : DBNull.Value),
new("@inBz", bz),
new("@inCjId", cjId),
- new("@inCxId", cxId),
- new("@inJhrs", jhrs),
new("@inEdtUserGuid", _userGuid),
new("@inLineList", _sb.ToString())
};
diff --git a/WebApi/Gs.Wom/WorkService/MesBackFlashController.cs b/WebApi/Gs.Wom/WorkService/MesBackFlashController.cs
index 81d079c..287814d 100644
--- a/WebApi/Gs.Wom/WorkService/MesBackFlashController.cs
+++ b/WebApi/Gs.Wom/WorkService/MesBackFlashController.cs
@@ -1,5 +1,4 @@
锘縰sing System.Data;
-using System.Data.SqlClient;
using System.Dynamic;
using System.Text;
using Gs.Toolbox;
@@ -28,171 +27,138 @@
#region
/// <summary>
- /// 璇诲彇鍒楄〃锛屾敮鎸佸垎椤�
+ /// 璇诲彇鍒楄〃锛屾敮鎸佸垎椤�
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[RequestMethod(RequestMethods.POST)]
- public ReturnDto<PageList<dynamic>> GetListPage([FromBody] dynamic model)
+ public ReturnDto<PageList<dynamic>> GetListPage([FromBody] PageQuery model)
{
int currentPage = model.currentPage;
int everyPageSize = model.everyPageSize;
- string sortName = model.sortName;
+ string sortName = string.IsNullOrEmpty(model.sortName) ? "org.FNumber" : model.sortName;
string keyWhere = model.keyWhere;
- SqlParameter[] parameters =
+ System.Text.StringBuilder _w = new StringBuilder();
+ _w.Append(" from [dbo].[MES_BACK_FLASH] a");
+ _w.Append(" left join MES_ITEMS i on a.ItemID=i.item_id ");
+ _w.Append(" left join MES_DEPOTS d on a.depotId=d.depot_id ");
+ _w.Append(" left join SYS_DEPARTMENT m on a.departmentId=m.departmentid ");
+ _w.Append(" left join SYS_ORGANIZATION org on i.FSubsidiary=org.FID");
+ _w.Append(" where 1=1 " + keyWhere);
+ System.Text.StringBuilder sbSql = new StringBuilder();
+ sbSql.Append("select * from ");
+ sbSql.Append("( ");
+ sbSql.Append("select top 100000 ROW_NUMBER() over(order by " + sortName + " " + model.sortOrder + ") as rowIndex,a.*,'('+org.FNumber+')'+org.NAME as orgName ");
+ sbSql.Append(",i.item_no as itemNo,i.item_name as itemName,i.item_model as itemModel,d.depot_name as depotName,m.departmentname as bmName");
+ sbSql.Append(_w);
+ sbSql.Append(") as T ");
+ sbSql.Append(" where T.rowindex>(" + currentPage + "-1)*" + everyPageSize + " and T.rowindex<=" + currentPage + "*" + everyPageSize);
+ sbSql.Append(" order by rowindex asc ");
+ sbSql.Append(" select count(1) as intTotal ");
+ sbSql.Append(_w);
+ DataSet dset = new DataSet();
+ try
{
- new("@inCurrentPage", currentPage),
- new("@inEveryPageSize", everyPageSize),
- new("@inSortName", sortName),
- new("@inSortOrder", ""),
- new("@inQueryWhere", keyWhere),
- new("@inFid", ""),
- new("@inP1", ""),
- new("@inP2", ""),
- new("@inP3", ""),
- new("@inP4", "")
- };
- var dset = new DataSet();
- var _pglist = new PageList<dynamic>
+ dset = Gs.Toolbox.DbHelperSQL.Query(sbSql.ToString());
+ }
+ catch (Exception ex)
+ {
+ Gs.Toolbox.LogHelper.Debug(this.ToString(), "GetListPage error锛�" + ex.Message);
+ return ReturnDto<PageList<dynamic>>.QuickReturn(default(PageList<dynamic>), ReturnCode.Exception, "璇诲彇澶辫触");
+ }
+ PageList<dynamic> _pglist = new PageList<dynamic>
{
total = 0,
everyPageSize = 0,
pages = 0,
list = new List<dynamic>()
};
- try
+ if (dset != null && dset.Tables.Count > 0 && dset.Tables[0].Rows.Count > 0)//鏈夋暟鎹�
{
- dset = DbHelperSQL.RunProcedure("prc_back_flash_lst", parameters, "0");
- if (dset != null && dset.Tables.Count > 0 &&
- dset.Tables[0].Rows.Count > 0) //鏈夋暟鎹�
- {
- var intTotal =
- int.Parse(dset.Tables[1].Rows[0]["intTotal"].ToString());
- var pages = intTotal % everyPageSize != 0
- ? intTotal / everyPageSize + 1
- : intTotal / everyPageSize;
- _pglist.total = intTotal;
- _pglist.everyPageSize = everyPageSize;
- _pglist.pages = pages;
- var _dy = dset.Tables[0].TableToDynamicList();
- _pglist.list = _dy;
- }
+ int intTotal = int.Parse(dset.Tables[1].Rows[0]["intTotal"].ToString());
+ int pages = (intTotal % everyPageSize != 0) ? (intTotal / everyPageSize + 1) : (intTotal / everyPageSize);
+ _pglist.total = intTotal;
+ _pglist.everyPageSize = everyPageSize;
+ _pglist.pages = pages;
+ List<dynamic> _dy = dset.Tables[0].TableToDynamicList();
+ _pglist.list = _dy;
}
- catch (Exception ex)
- {
- LogHelper.Debug(ToString(), ex.Message);
- return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
- ReturnCode.Exception, ex.Message);
- }
- return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
- ReturnCode.Success, "璇诲彇鎴愬姛");
+ return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist, ReturnCode.Success, "璇诲彇鎴愬姛");
}
+
/// <summary>
- /// 璇诲彇
+ /// 鍒犻櫎瀹炰綋
/// </summary>
- /// <param name="guid"></param>
+ /// <param name="model"></param>
/// <returns></returns>
[RequestMethod(RequestMethods.POST)]
- public ReturnDto<ExpandoObject> GetModel([FromBody] dynamic model)
+ public ReturnDto<int?> DeleteModel([FromBody] JArray guidList)
{
- string guid = model.guid.ToString();
- dynamic m = new ExpandoObject();
- m.list = new List<dynamic>();
- m.list2 = new List<dynamic>();
- SqlParameter[] parameters =
- {
- new("@inMainGuid", guid),
- new("@inP1", ""),
- new("@inP2", ""),
- new("@inP3", ""),
- new("@inP4", "")
- };
- var dset = new DataSet();
+ var intArray = guidList.ToObject<string[]>();
+ string guid = intArray[0];
+ int rtnInt = (int)ReturnCode.Default;
+ int cont = 0;
try
{
- dset = DbHelperSQL.RunProcedure("[prc_back_flash_mx]", parameters, "0");
- if (dset != null && dset.Tables.Count > 0 &&
- dset.Tables[0].Rows.Count > 0)
- {
- var dr = dset.Tables[0].Rows[0];
- m = dr.RowToDynamic();
- }
+ cont = isChkOrUnChk(guid, 1);
+ if (cont > 0)
+ return ReturnDto<int>.QuickReturn(default(int?), ReturnCode.Exception, "鍒犻櫎澶辫触锛岃淇℃伅宸茶瀹℃牳锛�");
+ StringBuilder strSql = new StringBuilder();
+ strSql.Append(" delete from MES_BACK_FLASH ");
+ strSql.Append(" where guid='" + guid + "'");
+ int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
+ rtnInt = rows;
}
catch (Exception ex)
{
- LogHelper.Debug(ToString(), ex.Message);
+ LogHelper.Debug(this.ToString(), "DeleteModel error锛�" + ex.Message);
+ rtnInt = (int)ReturnCode.Exception;
+ return ReturnDto<int>.QuickReturn(default(int?), ReturnCode.Exception, "鍒犻櫎澶辫触锛�" + ex.Message);
}
-
- if (m != null)
- return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success,
- "璇诲彇鎴愬姛锛�");
- return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, "璇诲彇澶辫触锛�");
+ if (rtnInt > 0)
+ return ReturnDto<int>.QuickReturn(default(int?), ReturnCode.Success, "鎿嶄綔鎴愬姛锛屽叡鍒犻櫎" + rtnInt.ToString() + "鏉℃暟鎹紒");
+ else
+ return ReturnDto<int>.QuickReturn(default(int?), ReturnCode.Exception, "鍒犻櫎澶辫触锛岃閲嶈瘯锛�");
}
/// <summary>
- /// 澧炲姞鎴栫紪杈戝疄浣�
+ /// 澧炲姞瀹炰綋
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[RequestMethod(RequestMethods.POST)]
public ReturnDto<ExpandoObject> EditModel([FromBody] dynamic model)
{
- Guid? guid = model.guid; //涓婚敭
string itemId = model.itemId;
string departmentId = model.departmentId;
string depotId = model.depotId;
- string depotlocid = model.depotlocid;
+ int? rtnInt = (int)ReturnCode.Default;
dynamic mObj = new ExpandoObject();
mObj.outMsg = "";
mObj.outSum = -1;
mObj.outGuid = "";
mObj.outNo = "";
- using (var conn = new SqlConnection(DbHelperSQL.strConn))
+ StringBuilder strSql = new StringBuilder();
+ string guid = Guid.NewGuid().ToString();
+ strSql.Append(" insert into MES_BACK_FLASH");
+ strSql.Append(" ([guid] ,[ItemId] ,[departmentId] ,[depotId],createBy,createDate,checkStatus)");
+ strSql.Append(" values(");
+ strSql.Append(" '" + guid + "','" + itemId + "','" + departmentId + "'," + depotId + ",'" + _userCode + "',getdate(),0)");
+ try
{
- using (var cmd = new SqlCommand("[prc_back_flash_edt]", conn))
- {
- try
- {
- conn.Open();
- cmd.CommandType = CommandType.StoredProcedure;
- SqlParameter[] parameters =
- {
- new SqlParameter("@outMsg", SqlDbType.NVarChar, 300),
- new SqlParameter("@outSum", SqlDbType.Int),
- new SqlParameter("@outGuid", SqlDbType.UniqueIdentifier),
- new SqlParameter("@outNo", SqlDbType.NVarChar, 300),
- new SqlParameter("@inOrderGuid", CheckGuid(guid) ? guid : DBNull.Value),
- new SqlParameter("@ItemId", string.IsNullOrEmpty(itemId) ? DBNull.Value : (object)long.Parse(itemId)),
- new SqlParameter("@departmentId", string.IsNullOrEmpty(departmentId) ? DBNull.Value : (object)long.Parse(departmentId)),
- new SqlParameter("@depotId", string.IsNullOrEmpty(depotId) ? DBNull.Value : (object)long.Parse(depotId)),
- new SqlParameter("@remark", ""),
- new SqlParameter("@inEdtUserGuid", _userGuid)
- };
- parameters[0].Direction = ParameterDirection.Output;
- parameters[1].Direction = ParameterDirection.Output;
- parameters[2].Direction = ParameterDirection.Output;
- parameters[3].Direction = ParameterDirection.Output;
- foreach (var parameter in parameters)
- cmd.Parameters.Add(parameter);
- cmd.ExecuteNonQuery();
- mObj.outMsg = parameters[0].Value.ToString();
- mObj.outSum = int.Parse(parameters[1].Value.ToString());
- mObj.outGuid = parameters[2].Value.ToString();
- mObj.outNo = parameters[3].Value.ToString();
- }
- catch (Exception ex)
- {
- LogHelper.Debug(ToString(),
- "prc_back_flash_edt error锛�" + ex.Message);
- mObj.outMsg = ex.Message;
- mObj.outSum = -1;
- }
- finally
- {
- conn.Close();
- }
- }
+ rtnInt = DbHelperSQL.ExecuteSql(strSql.ToString());
+ mObj.outMsg = "鎿嶄綔鎴愬姛锛�";
+ mObj.outSum = rtnInt;
+ mObj.outGuid = guid;
+ mObj.outNo = itemId;
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(this.ToString(), "EditModel error锛�" + ex.Message);
+ rtnInt = (int)ReturnCode.Exception;
+ mObj.outMsg = ex.Message;
+ mObj.outSum = -1;
}
if (mObj.outSum <= 0)
return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Exception, mObj.outMsg);
@@ -200,121 +166,48 @@
}
/// <summary>
- /// 鍒犻櫎涓昏〃鎴栨槑缁�
+ /// 璇诲彇瀹炰綋
/// </summary>
- /// <param name="model"></param>
+ /// <param name="guid"></param>
/// <returns></returns>
[RequestMethod(RequestMethods.POST)]
- public ReturnDto<int?> DeleteModel([FromBody] dynamic model)
+ [AllowAnonymous]
+ public ReturnDto<System.Dynamic.ExpandoObject> GetModel([FromBody] dynamic model)
{
- int? rtnInt = (int)ReturnCode.Default;
- Guid? guid = model.guid; //鍒拌揣鍗曚富閿�
- var _outMsg = "";
- var _outSum = -1;
- using (var conn = new SqlConnection(DbHelperSQL.strConn))
+ dynamic m = new System.Dynamic.ExpandoObject();
+ System.Text.StringBuilder sbSql = new StringBuilder();
+ sbSql.Append("select top 1 a.*,org.FID as orgId ,i.item_no as itemNo,i.item_name as itemName,i.item_model as itemModel from MES_BACK_FLASH a left join MES_ITEMS i on a.ItemID=i.item_id left join SYS_ORGANIZATION org on i.FSubsidiary=org.FID where 1=1 and a.guid='" + model.guid.ToString() + "' ");
+ try
{
- using (var cmd = new SqlCommand("[prc_back_flash_del]", conn))
+ DataSet dset = new DataSet();
+ dset = DbHelperSQL.Query(sbSql.ToString());
+ if (dset != null && dset.Tables.Count > 0 && dset.Tables[0].Rows.Count > 0)
{
- try
- {
- conn.Open();
- cmd.CommandType = CommandType.StoredProcedure;
- SqlParameter[] parameters =
- {
- new("@outMsg", SqlDbType.NVarChar, 300),
- new("@outSum", SqlDbType.Int),
- new("@inOrderGuid",
- CheckGuid(guid)
- ? guid
- : DBNull.Value),
- new("@inEdtUserGuid", _userGuid)
- };
- parameters[0].Direction = ParameterDirection.Output;
- parameters[1].Direction = ParameterDirection.Output;
- foreach (var parameter in parameters)
- cmd.Parameters.Add(parameter);
-
- cmd.ExecuteNonQuery();
- _outMsg = parameters[0].Value.ToString();
- _outSum = int.Parse(parameters[1].Value.ToString());
- }
- catch (Exception ex)
- {
- LogHelper.Debug(ToString(),
- "prc_auto_rk_del error锛�" + ex.Message);
- _outMsg = ex.Message;
- _outSum = -1;
- }
- finally
- {
- conn.Close();
- }
+ System.Data.DataRow dr = dset.Tables[0].Rows[0];
+ m = dr.RowToDynamic();
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "璇诲彇鎴愬姛锛�");
}
+ else
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, "璇诲彇澶辫触锛�");
}
-
- if (_outSum <= 0)
- return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Exception,
- _outMsg);
- return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Success, _outMsg);
+ catch (Exception ex)
+ {
+ LogHelper.Debug(this.ToString(), "GetModel error:" + ex.Message);
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, "璇诲彇澶辫触锛�");
+ }
}
-
/// <summary>
- /// 鎻愪氦妫�楠�
+ /// 鍒ゆ柇鏄惁瀹℃牳
/// </summary>
- /// <param name="mode"></param>
+ /// <param name="guidList"></param>
+ /// <param name="status"></param>
/// <returns></returns>
- [RequestMethod(RequestMethods.POST)]
- public ReturnDto<ExpandoObject> EditModelSubmit([FromBody] dynamic mode)
+ private int isChkOrUnChk(string guidList, int status)
{
- string _guid = mode.guid;
- string _inFieldValue = mode.inFieldValue;
- string _chkOut = mode.chkOut;
- string _proName = "prc_back_flash_submit";
- dynamic m = new ExpandoObject();
- m.outSum = -1;
- m.outMsg = "";
- using (var conn = new SqlConnection(DbHelperSQL.strConn))
- {
- using (var cmd = new SqlCommand(_proName, conn))
- {
- try
- {
- conn.Open();
- cmd.CommandType = CommandType.StoredProcedure;
- SqlParameter[] parameters =
- {
- new("@outMsg", SqlDbType.NVarChar, 2500),
- new("@outSum", SqlDbType.Int),
- new("@inEdtUserGuid", _userGuid),
- new("@inOrderGuid", _guid),
- new("@inFieldValue", _inFieldValue),
- new("@in1", _chkOut),
- new("@in2", "")
- };
- parameters[0].Direction = ParameterDirection.Output;
- parameters[1].Direction = ParameterDirection.Output;
- foreach (var parameter in parameters)
- cmd.Parameters.Add(parameter);
- cmd.ExecuteNonQuery();
- m.outMsg = parameters[0].Value.ToString();
- m.outSum = int.Parse(parameters[1].Value.ToString());
- }
- catch (Exception ex)
- {
- LogHelper.Debug(ToString(),
- "prc_auto_rk_submit error锛�" + ex.Message);
- m.outMsg = ex.Message;
- return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default,
- ex.Message);
- }
- finally
- {
- conn.Close();
- }
- }
- }
- return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "鎿嶄綔鎴愬姛锛�");
+ int cont = 0;
+ cont = int.Parse(DbHelperSQL.GetSingle("select count(1) from MES_BACK_FLASH where guid='" + guidList + "' and isnull(checkstatus,0)=" + status + "").ToString());
+ return cont;
}
#endregion
}
diff --git a/WebApi/Gs.Wom/WorkService/WorkCollectController.cs b/WebApi/Gs.Wom/WorkService/WorkCollectController.cs
index f77dcdb..9d5bf87 100644
--- a/WebApi/Gs.Wom/WorkService/WorkCollectController.cs
+++ b/WebApi/Gs.Wom/WorkService/WorkCollectController.cs
@@ -1,7 +1,6 @@
锘縰sing System.Data;
using System.Data.SqlClient;
using System.Dynamic;
-using System.Text;
using Gs.Toolbox;
using Gs.Toolbox.ApiCore.Abstract.Mvc;
using Gs.Toolbox.ApiCore.Common.Mvc;
@@ -25,8 +24,6 @@
GetUserGuidAndOrgGuid(_http);
}
#region
-
-
/// <summary>
/// 璇诲彇锛岄噰闆�,閲囬泦鐨勬椂鍊欒繑鍥炲垪琛�
/// </summary>
@@ -41,6 +38,7 @@
string gongWei = model.gongWei;//宸ヤ綅
string checkResult = model.checkResult; //缁撴灉
string badDescription = model.badDescription;//涓嶈壇鎻忚堪
+ string collectGuid = model.collectGuid;
//姘存鍊�
string t001 = model.t001;
string t002 = model.t002;
@@ -53,6 +51,8 @@
string t009 = model.t009;
string t010 = model.t010;
string t011 = model.t011;
+ string t012 = model.t012;
+ string t013 = model.t013;
dynamic m = new ExpandoObject();
m.list = new List<dynamic>();
m.list2 = new List<dynamic>();
@@ -70,17 +70,20 @@
new("@banCi",banCi),
new("@gongWei",gongWei),
new("@badDescription",badDescription),
- new("@t001",t001),
- new("@t002",t002),
- new("@t003",t003),
- new("@t004",t004),
- new("@t005",t005),
- new("@t006",t006),
- new("@t007",t007),
- new("@t008",t008),
- new("@t009",t009),
- new("@t010",t010),
- new("@t011",t011),
+ new("@t001",t001),
+ new("@t002",t002),
+ new("@t003",t003),
+ new("@t004",t004),
+ new("@t005",t005),
+ new("@t006",t006),
+ new("@t007",t007),
+ new("@t008",t008),
+ new("@t009",t009),
+ new("@t010",t010),
+ new("@t011",t011),
+ new("@t012",t012),
+ new("@t013",t013),
+ new("@collectGuid",collectGuid),
};
var dset = new DataSet();
try
@@ -122,7 +125,12 @@
}
catch (Exception ex)
{
- LogHelper.Debug(this.ToString(), ex.Message);
+ System.Text.StringBuilder sbLog = new System.Text.StringBuilder();
+ sbLog.Append("_userGuid:" + _userGuid.ToString());
+ sbLog.Append("processNo:" + processNo.ToString());
+ sbLog.Append("gongWei:" + gongWei.ToString());
+ sbLog.Append("inP4:" + barCode);
+ LogHelper.Debug(this.ToString(), ex.Message + ":" + sbLog.ToString());
m.outMsg = ex.Message;
m.outSum = -1;
}
diff --git a/WebApi/Gs.Wom/WorkService/WorkProController.cs b/WebApi/Gs.Wom/WorkService/WorkProController.cs
index 8c7cb2c..8b7528e 100644
--- a/WebApi/Gs.Wom/WorkService/WorkProController.cs
+++ b/WebApi/Gs.Wom/WorkService/WorkProController.cs
@@ -38,9 +38,6 @@
[RequestMethod(RequestMethods.POST)]
public ReturnDto<PageList<dynamic>> GetListPage([FromBody] PageQuery model)
{
-
- //(case a.isStatus when 1 then '姝e父' when - 1 then '绂佺敤' else cast(a.isStatus as nvarchar(4)) end) as isStatusTxt
-
var currentPage = model.currentPage;
var everyPageSize = model.everyPageSize;
var sortName = string.IsNullOrEmpty(model.sortName)
@@ -52,7 +49,7 @@
sbSql.Append("( ");
sbSql.Append("select top 100000 ROW_NUMBER() over(order by " +
sortName + " " + model.sortOrder +
- ") as rowIndex,cast(0 as bit) as chkInt, a.*,(a.PROC_NO+':'+a.PROC_NAME) as processNoAndName from MES_PROC_INFO a where 1=1" +
+ ") as rowIndex,cast(0 as bit) as chkInt,a.*,(a.processNo+':'+a.processName) as processNoAndName,(case a.isStatus when 1 then '姝e父' when -1 then '绂佺敤' else cast(a.isStatus as nvarchar(4)) end) as isStatusTxt from WORK_PROCESS a where 1=1" +
keyWhere);
sbSql.Append(") as T ");
sbSql.Append(" where T.rowindex>(" + currentPage + "-1)*" +
@@ -60,8 +57,8 @@
everyPageSize);
sbSql.Append(" order by rowindex asc ");
sbSql.Append(
- " select count(1) as intTotal from MES_PROC_INFO a where 1=1 " +
- keyWhere);
+ " select count(1) as intTotal from WORK_PROCESS a where 1=1 " +
+ keyWhere);
var dset = new DataSet();
try
{
@@ -123,7 +120,7 @@
return ReturnDto<int>.QuickReturn(default(int?),
ReturnCode.Exception, "鍒犻櫎澶辫触锛岃淇℃伅宸茶瀹℃牳锛�");
System.Text.StringBuilder sbSql = new StringBuilder();
- sbSql.Append("delete from MES_PROC_INFO ");
+ sbSql.Append("delete from WORK_PROCESS ");
sbSql.Append(" where guid in (select line from dbo.fn_split('" + sbGuid.ToString() + "',','))");
var rows = DbHelperSQL.ExecuteSql(sbSql.ToString());
rtnInt = rows;
@@ -156,18 +153,20 @@
string remark = model.remark;
string isBack = model.isBack;
string isStatus = model.isStatus;
+ string isZsm = model.isZsm;
+ string isTbm = model.isTbm;
string description = model.description;
int? rtnInt = (int)ReturnCode.Default;
System.Text.StringBuilder sbSql = new StringBuilder();
if (!CheckGuid(guid))
{
guid= Guid.NewGuid().ToString();
- sbSql.Append("INSERT INTO [dbo].[WORK_PROCESS] ([guid] ,[processNo] ,[processName] ,[remark] ,[isBack] ,[isStatus] ,[description] ,[createBy] ,[createDate] ,[lastUpdateBy] ,[lastUpdateDate])");
- sbSql.Append(" values( '"+ guid + "',@processNo,@processName,@remark,@isBack,@isStatus,@description,'" + _userCode + "',getdate(),'" + _userCode + "',getdate())");
+ sbSql.Append("INSERT INTO [dbo].[WORK_PROCESS] ([guid] ,[processNo] ,[processName] ,[remark] ,[isBack] ,[isStatus] ,[description] ,[createBy] ,[createDate] ,[lastUpdateBy] ,[lastUpdateDate],isZsm,isTbm)");
+ sbSql.Append(" values( '"+ guid + "',@processNo,@processName,@remark,@isBack,@isStatus,@description,'" + _userCode + "',getdate(),'" + _userCode + "',getdate(),@isZsm,@isTbm)");
}
else
{
- sbSql.Append("UPDATE [dbo].[WORK_PROCESS] SET [processNo] =@processNo,[processName] =@processName,[remark] =@remark,[isBack] =@isBack,[isStatus] =@isStatus,[description] =@description,[lastUpdateBy] ='" + _userCode + "',[lastUpdateDate] =getdate() where guid='"+guid.ToString()+"'");
+ sbSql.Append("UPDATE [dbo].[WORK_PROCESS] SET [processNo] =@processNo,[processName] =@processName,[remark] =@remark,[isBack] =@isBack,[isStatus] =@isStatus,[description] =@description,[lastUpdateBy] ='" + _userCode + "',[lastUpdateDate] =getdate(),isZsm=@isZsm,isTbm=@isTbm where guid='" + guid.ToString()+"'");
}
SqlParameter[] parameters =
{
@@ -177,6 +176,8 @@
new("@isBack", isBack),
new("@isStatus", isStatus),
new("@description", description),
+ new("@isZsm", isZsm),
+ new("@isTbm", isTbm),
};
try
{
diff --git a/WebApi/Gs.Wom/WorkService/WorkTechniqueController.cs b/WebApi/Gs.Wom/WorkService/WorkTechniqueController.cs
index 0692fbe..a4441ad 100644
--- a/WebApi/Gs.Wom/WorkService/WorkTechniqueController.cs
+++ b/WebApi/Gs.Wom/WorkService/WorkTechniqueController.cs
@@ -35,7 +35,7 @@
[RequestMethod(RequestMethods.POST)]
public ReturnDto<ExpandoObject> GetModel([FromBody] dynamic model)
{
- string guid = model.guid.ToString();
+ string guid = model.guid.ToString();// --杩欐槸浜у搧鐨刧uid
dynamic m = new ExpandoObject();
m.list = new List<dynamic>();
SqlParameter[] parameters =
@@ -49,8 +49,7 @@
var dset = new DataSet();
try
{
- //dset = DbHelperSQL.RunProcedure("[work_technique_mx]", parameters, "0");
- dset = DbHelperSQL.RunProcedure("[mes_prod_gx_mx]", parameters, "0");
+ dset = DbHelperSQL.RunProcedure("[work_technique_mx]", parameters, "0");
if (dset != null && dset.Tables.Count > 0 &&
dset.Tables[0].Rows.Count > 0)
{
@@ -58,8 +57,6 @@
m = dr.RowToDynamic();
var _tb = dset.Tables[1].TableToDynamicList();
m.list = _tb;
- var _tb2 = dset.Tables[2].TableToDynamicList();
- m.list2 = _tb2;
}
}
catch (Exception ex)
@@ -81,36 +78,28 @@
public ReturnDto<ExpandoObject> EditModel([FromBody] dynamic model)
{
Guid? guid = model.guid; //浜у搧涓婚敭
- string orgName = model.orgName;
- string itemNo = model.itemNo;
+ string fType = model.fType;
+ string fBegDate = model.fBegDate;
+ string fEndDate = model.fEndDate;
+ string fJingDu = model.fJingDu;
+ string fCapacity = model.fCapacity;
+ string fMaxWeight = model.fMaxWeight;
+ string fMinWeight = model.fMinWeight;
+ string fSumPeople = model.fSumPeople;
+ string remark = model.remark;
var _sb = new StringBuilder();
var _split = "|";
foreach (var m in model.list)
{
- var _line = m.guid + _split
+ var _line = m.fSeq + _split
+ m.processNo + _split
- + m.gxOrder + _split
- + m.signingFlag + _split
- + m.storageFlag + _split
+ + m.statStatus + _split
+ + m.collectionName + _split
+ + m.remark + _split
+ m.frontProcessNo;
if (_sb.Length > 0)
_sb.Append("~");
_sb.Append(_line);
- }
- var _sb2 = new StringBuilder();
- var _split2 = "|";
- foreach (var m in model.list2)
- {
- var _line2 = m.guid + _split2
- + m.workers + _split2
- + m.hours + _split2
- + m.capacity + _split2
- + m.sCapacity + _split2
- + m.lineType + _split2
- + m.changeTime;
- if (_sb2.Length > 0)
- _sb2.Append("~");
- _sb2.Append(_line2);
}
dynamic mObj = new ExpandoObject();
mObj.outMsg = "";
@@ -119,8 +108,7 @@
mObj.outNo = "";
using (var conn = new SqlConnection(DbHelperSQL.strConn))
{
- //using (var cmd = new SqlCommand("[work_technique_edt]", conn))
- using (var cmd = new SqlCommand("[mes_prod_gx_edt]", conn))
+ using (var cmd = new SqlCommand("[work_technique_edt]", conn))
{
try
{
@@ -133,11 +121,17 @@
new("@outGuid", SqlDbType.UniqueIdentifier),
new("@outNo", SqlDbType.NVarChar, 300),
new("@inOrderGuid", CheckGuid(guid) ? guid : DBNull.Value),
- new("@orgName", orgName),
- new("@itemNo", itemNo),
+ new("@fType", fType),
+ new("@fBegDate", fBegDate),
+ new("@fEndDate", fEndDate),
+ new("@fJingDu", fJingDu),
+ new("@fCapacity", fCapacity),
+ new("@fMaxWeight", fMaxWeight),
+ new("@fMinWeight", fMinWeight),
+ new("@fSumPeople", fSumPeople),
+ new("@remark", remark),
new("@inEdtUserGuid", _userGuid),
- new("@inLineList", _sb.ToString()),
- new("@inLineList2", _sb2.ToString())
+ new("@inLineList", _sb.ToString())
};
parameters[0].Direction = ParameterDirection.Output;
parameters[1].Direction = ParameterDirection.Output;
@@ -245,8 +239,7 @@
var _outSum = -1;
using (var conn = new SqlConnection(DbHelperSQL.strConn))
{
- //using (var cmd = new SqlCommand("[work_technique_del]", conn))
- using (var cmd = new SqlCommand("[mes_prod_gx_del]", conn))
+ using (var cmd = new SqlCommand("[work_technique_del]", conn))
{
try
{
@@ -292,67 +285,6 @@
return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Success, _outMsg);
}
- /// <summary>
- /// 鍒犻櫎涓昏〃鎴栦骇鑳芥槑缁�
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- [RequestMethod(RequestMethods.POST)]
- public ReturnDto<int?> DeleteMode2OrMx([FromBody] dynamic model)
- {
- int? rtnInt = (int)ReturnCode.Default;
- Guid? guid = model.guid;
- string mxGuid2 = model.mxGuid2;
- var _outMsg = "";
- var _outSum = -1;
- using (var conn = new SqlConnection(DbHelperSQL.strConn))
- {
- //using (var cmd = new SqlCommand("[work_technique_del]", conn))
- using (var cmd = new SqlCommand("[mes_prod_gx_del2]", conn))
- {
- try
- {
- conn.Open();
- cmd.CommandType = CommandType.StoredProcedure;
- SqlParameter[] parameters =
- {
- new("@outMsg", SqlDbType.NVarChar, 300),
- new("@outSum", SqlDbType.Int),
- new("@inOrderGuid",
- CheckGuid(guid)
- ? guid
- : DBNull.Value),
- new("@inEdtUserGuid", _userGuid),
- new("@inMxGuid", mxGuid2)
- };
- parameters[0].Direction = ParameterDirection.Output;
- parameters[1].Direction = ParameterDirection.Output;
- foreach (var parameter in parameters)
- cmd.Parameters.Add(parameter);
-
- cmd.ExecuteNonQuery();
- _outMsg = parameters[0].Value.ToString();
- _outSum = int.Parse(parameters[1].Value.ToString());
- }
- catch (Exception ex)
- {
- LogHelper.Debug(ToString(),
- "work_technique error锛�" + ex.Message);
- _outMsg = ex.Message;
- _outSum = -1;
- }
- finally
- {
- conn.Close();
- }
- }
- }
-
- if (_outSum <= 0)
- return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Exception,
- _outMsg);
- return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Success, _outMsg);
- }
/// <summary>
/// 澶嶅埗鐗╂枡椤圭洰
diff --git a/WebApi/Gs.Wom/WorkService/WorkWeightController.cs b/WebApi/Gs.Wom/WorkService/WorkWeightController.cs
index ec99902..3c9ca88 100644
--- a/WebApi/Gs.Wom/WorkService/WorkWeightController.cs
+++ b/WebApi/Gs.Wom/WorkService/WorkWeightController.cs
@@ -46,8 +46,7 @@
}
catch (Exception ex)
{
- LogHelper.Debug(ToString(),
- "work_weight_lst error锛�" + ex.Message);
+ LogHelper.Debug(ToString(), "work_weight_lst error锛�" + ex.Message);
}
if (dset != null && dset.Tables.Count > 0 && dset.Tables[0].Rows.Count > 0)
lst = dset.Tables[0].TableToDynamicList();
@@ -57,7 +56,7 @@
/// <summary>
- /// 澧炲姞鎴栫紪杈戝疄浣�
+ /// 澧炲姞涓�鏉¢噸閲忎俊鎭�
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
@@ -66,7 +65,7 @@
{
string lineId = model.lineId;
string realWeight = model.realWeight;
- string realWeightTxt=model.realWeightTxt;
+ string realWeightTxt = model.realWeightTxt;
dynamic mObj = new ExpandoObject();
mObj.outMsg = "";
mObj.outSum = -1;
@@ -112,5 +111,92 @@
return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Exception, mObj.outMsg);
return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Success, mObj.outMsg);
}
+
+
+ /// <summary>
+ /// 璇诲彇iqc绉伴噸
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<string?> GetIqcWeight([FromBody] dynamic model)
+ {
+ string? rtnInt = "";
+ var dset = new DataSet();
+ try
+ {
+ SqlParameter[] parameters =
+ {
+ new("@inLineId","")
+ };
+ dset = DbHelperSQL.RunProcedure("iqc_detect01_get_weight", parameters, "0");
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), "GetIqcWeight error锛�" + ex.Message);
+ }
+ if (dset != null && dset.Tables.Count > 0 && dset.Tables[0].Rows.Count > 0)
+ {
+ rtnInt = dset.Tables[0].Rows[0]["realWeight"].ToString();
+ }
+ return ReturnDto<string>.QuickReturn(rtnInt, ReturnCode.Success, "璇诲彇鎴愬姛锛�");
+ }
+
+
+ /// <summary>
+ /// 缂栬緫iqc閲嶉噺
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<ExpandoObject> EditIqcWeight([FromBody] dynamic model)
+ {
+ string iqcGuid = model.iqcGuid;
+ string weightType = model.weightType;
+ string weight = model.weight;
+ dynamic mObj = new ExpandoObject();
+ mObj.outMsg = "";
+ mObj.outSum = -1;
+ using (var conn = new SqlConnection(DbHelperSQL.strConn))
+ {
+ using (var cmd = new SqlCommand("[iqc_detect01_edt_weight]", conn))
+ {
+ try
+ {
+ conn.Open();
+ cmd.CommandType = CommandType.StoredProcedure;
+ SqlParameter[] parameters =
+ {
+ new("@outMsg", SqlDbType.NVarChar, 300),
+ new("@outSum", SqlDbType.Int),
+ new("@weightType", weightType),
+ new("@weight", weight),
+ new("@iqcGuid", iqcGuid),
+ new("@inEdtUserGuid", _userGuid),
+ };
+ parameters[0].Direction = ParameterDirection.Output;
+ parameters[1].Direction = ParameterDirection.Output;
+ foreach (var parameter in parameters)
+ cmd.Parameters.Add(parameter);
+ cmd.ExecuteNonQuery();
+ mObj.outMsg = parameters[0].Value.ToString();
+ mObj.outSum = int.Parse(parameters[1].Value.ToString());
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), "iqc_detect01_edt_weight error锛�" + ex.Message);
+ mObj.outMsg = ex.Message;
+ mObj.outSum = -1;
+ }
+ finally
+ {
+ conn.Close();
+ }
+ }
+ }
+ if (mObj.outSum <= 0)
+ return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Exception, mObj.outMsg);
+ return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Success, mObj.outMsg);
+ }
}
}
diff --git a/WebApi/Gs.Ww/ProductionOrderManager.cs b/WebApi/Gs.Ww/ProductionOrderManager.cs
index e75855d..d445cd6 100644
--- a/WebApi/Gs.Ww/ProductionOrderManager.cs
+++ b/WebApi/Gs.Ww/ProductionOrderManager.cs
@@ -25,7 +25,6 @@
GetUserGuidAndOrgGuid(_http);
}
-
/// <summary>
/// 璇诲彇鍒楄〃锛屾敮鎸佸垎椤�
/// </summary>
@@ -183,9 +182,9 @@
{
LogHelper.Debug(ToString(),
"prc_ww_rwd_dj_submit error锛�" + ex.Message);
- return ReturnDto<dynamic>.QuickReturn(m,
- ReturnCode.Default,
- ex.Message);
+ m.outMsg = ex.Message;
+ m.outSum = -1;
+
}
finally
{
@@ -193,8 +192,12 @@
}
}
}
+ if (m.outSum <= 0)
+ return ReturnDto<dynamic>.QuickReturn(m,
+ ReturnCode.Default,
+ "鎿嶄綔澶辫触锛�");
return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success,
- "鎿嶄綔鎴愬姛锛�");
+ "鎿嶄綔鎴愬姛锛�");
}
}
}
\ No newline at end of file
diff --git a/WebApi/Gs.Ww/WWBlDJManager.cs b/WebApi/Gs.Ww/WWBlDJManager.cs
index 5c74030..4c36f5e 100644
--- a/WebApi/Gs.Ww/WWBlDJManager.cs
+++ b/WebApi/Gs.Ww/WWBlDJManager.cs
@@ -145,6 +145,44 @@
dynamic m = new ExpandoObject();
m.outSum = -1;
m.outMsg = "";
+ // 褰撳鏍告椂锛坃inFieldValue涓�"1"鏃讹級妫�鏌ヤ粨搴�
+ if (_inFieldValue == "1")
+ {
+ try
+ {
+ string warehouseCheckSql = @"
+ SELECT COUNT(1)
+ FROM MES_INV_ITEM_OUT_C_DETAILS b
+ LEFT JOIN MES_INV_ITEM_OUTS h ON h.GUID = b.ITEM_OUT_ID
+ LEFT JOIN (
+ SELECT h.ORDER_NO, b1.MATERIAL_CODE, b1.WAREHOUSE, h.ERP_PRODUCTION_ORDER_NO
+ FROM PRODUCTION_ORDER_SUB b1
+ LEFT JOIN PRODUCTION_ORDER h ON h.ERP_PRODUCTION_ENTRY_CODE = b1.ERP_PRODUCTION_ENTRY_CODE
+ ) d ON h.work_no = d.ERP_PRODUCTION_ORDER_NO AND d.MATERIAL_CODE = b.item_id
+ WHERE b.item_out_id = @inFieldValue
+ AND (d.WAREHOUSE IS NULL OR d.WAREHOUSE = '' OR d.WAREHOUSE = '0')";
+
+ var parameters = new[] {
+ new SqlParameter("@inFieldValue", _guid)
+ };
+
+ var emptyWarehouseCount = DbHelperSQL.GetSingle(warehouseCheckSql, parameters);
+
+ if (emptyWarehouseCount != null && Convert.ToInt32(emptyWarehouseCount) > 0)
+ {
+ m.outSum = -1;
+ m.outMsg = "瀵瑰簲鐨勫澶栧崟鐨勪粨搴撲负绌猴紝鏃犳硶瀹℃牳锛�";
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Exception, m.outMsg);
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), "浠撳簱妫�鏌ュけ璐ワ細" + ex.Message);
+ m.outSum = -1;
+ m.outMsg = "浠撳簱妫�鏌ュけ璐ワ細" + ex.Message;
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Exception, m.outMsg);
+ }
+ }
using (var conn = new SqlConnection(DbHelperSQL.strConn))
{
using (var cmd = new SqlCommand("prc_ww_bldj_submit", conn))
diff --git a/WebApi/Gs.Ww/WWBlManager.cs b/WebApi/Gs.Ww/WWBlManager.cs
index 4c67cf2..7093010 100644
--- a/WebApi/Gs.Ww/WWBlManager.cs
+++ b/WebApi/Gs.Ww/WWBlManager.cs
@@ -117,8 +117,8 @@
m = dr.RowToDynamic();
var _tb = dset.Tables[1].TableToDynamicList();
m.list = _tb;
- var _tb2 = dset.Tables[2].TableToDynamicList();
- m.list2 = _tb2;
+ //var _tb2 = dset.Tables[2].TableToDynamicList();
+ //m.list2 = _tb2;
}
}
catch (Exception ex)
diff --git a/WebApi/Gs.Ww/WWGDManager.cs b/WebApi/Gs.Ww/WWGDManager.cs
index de5b16c..dca7c67 100644
--- a/WebApi/Gs.Ww/WWGDManager.cs
+++ b/WebApi/Gs.Ww/WWGDManager.cs
@@ -119,8 +119,8 @@
m = dr.RowToDynamic();
var _tb = dset.Tables[1].TableToDynamicList();
m.list = _tb;
- var _tb2 = dset.Tables[2].TableToDynamicList();
- m.list2 = _tb2;
+ //var _tb2 = dset.Tables[2].TableToDynamicList();
+ //m.list2 = _tb2;
}
}
catch (Exception ex)
@@ -190,66 +190,6 @@
}
return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "鎿嶄綔鎴愬姛锛�");
- }
-
- /// <summary>
- /// 鍒犻櫎涓昏〃鎴栨槑缁�
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- [RequestMethod(RequestMethods.POST)]
- public ReturnDto<int?> DeleteModelOrMx([FromBody] dynamic model)
- {
- int? rtnInt = (int)ReturnCode.Default;
- Guid? guid = model.guid;
- string mxGuid = model.mxGuid;
- var _outMsg = "";
- var _outSum = -1;
- using (var conn = new SqlConnection(DbHelperSQL.strConn))
- {
- using (var cmd = new SqlCommand("[prc_ww_gd_del]", conn))
- {
- try
- {
- conn.Open();
- cmd.CommandType = CommandType.StoredProcedure;
- SqlParameter[] parameters =
- {
- new("@outMsg", SqlDbType.NVarChar, 300),
- new("@outSum", SqlDbType.Int),
- new("@inOrderGuid",
- UtilityHelper.CheckGuid(guid)
- ? guid
- : DBNull.Value),
- new("@inEdtUserGuid", _userGuid),
- new("@inMxGuid", mxGuid)
- };
- parameters[0].Direction = ParameterDirection.Output;
- parameters[1].Direction = ParameterDirection.Output;
- foreach (var parameter in parameters)
- cmd.Parameters.Add(parameter);
-
- cmd.ExecuteNonQuery();
- _outMsg = parameters[0].Value.ToString();
- _outSum = int.Parse(parameters[1].Value.ToString());
- }
- catch (Exception ex)
- {
- LogHelper.Debug(ToString(),
- "prc_ww_gd_del error锛�" + ex.Message);
- _outMsg = ex.Message;
- _outSum = -1;
- }
- finally
- {
- conn.Close();
- }
- }
- }
-
- if (_outSum <= 0)
- return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Exception, _outMsg);
- return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Success, _outMsg);
}
}
diff --git a/WebApi/Gs.Ww/WWLLDJManager.cs b/WebApi/Gs.Ww/WWLLDJManager.cs
index 1e0f8c1..548f468 100644
--- a/WebApi/Gs.Ww/WWLLDJManager.cs
+++ b/WebApi/Gs.Ww/WWLLDJManager.cs
@@ -143,6 +143,45 @@
dynamic m = new ExpandoObject();
m.outSum = -1;
m.outMsg = "";
+ // 褰撳鏍告椂锛坃inFieldValue涓�"1"鏃讹級妫�鏌ヤ粨搴�
+ if (_inFieldValue == "1")
+ {
+ try
+ {
+ string warehouseCheckSql = @"
+ SELECT COUNT(1)
+ FROM MES_INV_ITEM_OUT_C_DETAILS b
+ LEFT JOIN MES_INV_ITEM_OUTS h ON h.GUID = b.ITEM_OUT_ID
+ LEFT JOIN (
+ SELECT h.ORDER_NO, b1.MATERIAL_CODE, b1.WAREHOUSE, h.ERP_PRODUCTION_ORDER_NO
+ FROM PRODUCTION_ORDER_SUB b1
+ LEFT JOIN PRODUCTION_ORDER h ON h.ERP_PRODUCTION_ENTRY_CODE = b1.ERP_PRODUCTION_ENTRY_CODE
+ ) d ON h.work_no = d.ERP_PRODUCTION_ORDER_NO AND d.MATERIAL_CODE = b.item_id
+ WHERE b.item_out_id = @inFieldValue
+ AND (d.WAREHOUSE IS NULL OR d.WAREHOUSE = '' OR d.WAREHOUSE = '0')";
+
+ var parameters = new[] {
+ new SqlParameter("@inFieldValue", _guid)
+ };
+
+ var emptyWarehouseCount = DbHelperSQL.GetSingle(warehouseCheckSql, parameters);
+
+ if (emptyWarehouseCount != null && Convert.ToInt32(emptyWarehouseCount) > 0)
+ {
+ m.outSum = -1;
+ m.outMsg = "瀵瑰簲鐨勫澶栧崟鐨勪粨搴撲负绌猴紝鏃犳硶瀹℃牳锛�";
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Exception, m.outMsg);
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), "浠撳簱妫�鏌ュけ璐ワ細" + ex.Message);
+ m.outSum = -1;
+ m.outMsg = "浠撳簱妫�鏌ュけ璐ワ細" + ex.Message;
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Exception, m.outMsg);
+ }
+ }
+
using (var conn = new SqlConnection(DbHelperSQL.strConn))
{
using (var cmd = new SqlCommand("prc_ww_lldj_submit", conn))
diff --git a/WebApi/Gs.Ww/WWTBlDJManager.cs b/WebApi/Gs.Ww/WWTBlDJManager.cs
index fc54f1e..f9056f4 100644
--- a/WebApi/Gs.Ww/WWTBlDJManager.cs
+++ b/WebApi/Gs.Ww/WWTBlDJManager.cs
@@ -145,6 +145,44 @@
dynamic m = new ExpandoObject();
m.outSum = -1;
m.outMsg = "";
+ // 褰撳鏍告椂锛坃inFieldValue涓�"1"鏃讹級妫�鏌ヤ粨搴�
+ if (_inFieldValue == "1")
+ {
+ try
+ {
+ string warehouseCheckSql = @"
+ SELECT COUNT(1)
+ FROM MES_INV_ITEM_IN_C_DETAILS b
+ LEFT JOIN MES_INV_ITEM_INS h ON h.GUID = b.ITEM_IN_ID
+ LEFT JOIN (
+ SELECT h.ORDER_NO, b1.MATERIAL_CODE, b1.WAREHOUSE, h.ERP_PRODUCTION_ORDER_NO
+ FROM PRODUCTION_ORDER_SUB b1
+ LEFT JOIN PRODUCTION_ORDER h ON h.ERP_PRODUCTION_ENTRY_CODE = b1.ERP_PRODUCTION_ENTRY_CODE
+ ) d ON h.work_no = d.ERP_PRODUCTION_ORDER_NO AND d.MATERIAL_CODE = b.item_id
+ WHERE b.item_in_id = @inFieldValue
+ AND (d.WAREHOUSE IS NULL OR d.WAREHOUSE = '' OR d.WAREHOUSE = '0')";
+
+ var parameters = new[] {
+ new SqlParameter("@inFieldValue", _guid)
+ };
+
+ var emptyWarehouseCount = DbHelperSQL.GetSingle(warehouseCheckSql, parameters);
+
+ if (emptyWarehouseCount != null && Convert.ToInt32(emptyWarehouseCount) > 0)
+ {
+ m.outSum = -1;
+ m.outMsg = "瀵瑰簲鐨勫澶栧崟鐨勪粨搴撲负绌猴紝鏃犳硶瀹℃牳锛�";
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Exception, m.outMsg);
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), "浠撳簱妫�鏌ュけ璐ワ細" + ex.Message);
+ m.outSum = -1;
+ m.outMsg = "浠撳簱妫�鏌ュけ璐ワ細" + ex.Message;
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Exception, m.outMsg);
+ }
+ }
using (var conn = new SqlConnection(DbHelperSQL.strConn))
{
using (var cmd = new SqlCommand("prc_ww_tbldj_Submit", conn))
diff --git a/WebApi/Gs.Ww/WWTblManager.cs b/WebApi/Gs.Ww/WWTblManager.cs
index 13c3d2b..3a87dfa 100644
--- a/WebApi/Gs.Ww/WWTblManager.cs
+++ b/WebApi/Gs.Ww/WWTblManager.cs
@@ -158,6 +158,7 @@
var _line = m.AboutGuid + _split
+ m.Sl + _split
+ m.Remark + _split
+ + m.Bllb + _split
+ (CheckGuid(_guid) ? _guid : Guid.Empty.ToString());
if (_sb.Length > 0)
_sb.Append("~");
--
Gitblit v1.9.3