From 08520ee0e2ef25a3b9b0654f255b9ddc7564f741 Mon Sep 17 00:00:00 2001
From: ouyangqing <ouyangqing@DESKTOP-B85SG1D>
Date: 星期二, 26 一月 2021 16:53:01 +0800
Subject: [PATCH] nothing
---
WebAPI/Service/YqnQbService.cs | 32 +++++++---
WebAPI/Service/ProcessDal.cs | 37 ++++++++++++
WebAPI/Models/M_Process.cs | 72 ++++++++++++++++++++++++
WebAPI/WebAPI.csproj | 2
4 files changed, 133 insertions(+), 10 deletions(-)
diff --git a/WebAPI/Models/M_Process.cs b/WebAPI/Models/M_Process.cs
new file mode 100644
index 0000000..11bae50
--- /dev/null
+++ b/WebAPI/Models/M_Process.cs
@@ -0,0 +1,72 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+
+namespace WebAPI.Models
+{
+ public class M_Process
+ {
+ public int HItemID { get; set; }
+ /// <summary>
+ /// 宸ュ簭浠g爜
+ /// </summary>
+ public string HNumber { get; set; }
+ /// <summary>
+ /// 宸ュ簭鍚嶇О
+ /// </summary>
+ public string HName { get; set; }
+ /// <summary>
+ /// 宸ュ簭绛夌骇
+ /// </summary>
+ public int HLevel { get; set; }
+ /// <summary>
+ /// 娴佽浆鏍囪
+ /// </summary>
+ public int HTypeFlow { get; set; }
+ /// <summary>
+ /// 鏍哥畻鏍囪
+ /// </summary>
+ public int HTypeCount { get; set; }
+ /// <summary>
+ /// 姹囨姤绫诲瀷
+ /// </summary>
+ public string HBillSubType { get; set; }
+ /// <summary>
+ /// 鏄庣粏鏍囪
+ /// </summary>
+ public int HEndFlag { get; set; }
+ /// <summary>
+ /// 绂佺敤鏍囪
+ /// </summary>
+ public int HStopFlag { get; set; }
+ /// <summary>
+ /// 閮ㄩ棬
+ /// </summary>
+ public string DepartName { get; set; }
+ /// <summary>
+ /// 搴忓彿
+ /// </summary>
+ public int HSNo { get; set; }
+ /// <summary>
+ /// 瀵瑰簲K3浠g爜
+ /// </summary>
+ public int HProcessID_K3 { get; set; }
+ /// <summary>
+ /// 鐝骇瀹氶
+ /// </summary>
+ public decimal HFixPrice { get; set; }
+ /// <summary>
+ /// 鍔犵彮琛ヨ创瀹氶
+ /// </summary>
+ public decimal HOverFixPrice { get; set; }
+ /// <summary>
+ /// 鑷姩绉昏浆
+ /// </summary>
+ public int HAutoTrunFlag { get; set; }
+ /// <summary>
+ /// 澶囨敞
+ /// </summary>
+ public string HRemark { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/WebAPI/Service/ProcessDal.cs b/WebAPI/Service/ProcessDal.cs
new file mode 100644
index 0000000..cfb4099
--- /dev/null
+++ b/WebAPI/Service/ProcessDal.cs
@@ -0,0 +1,37 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Web;
+using WebAPI.Dapper;
+
+namespace WebAPI.Service
+{
+ public class ProcessDal
+ {
+ public static List<Models.M_StationBillMail> GetProcessList(string hName,int hLevel,string hNumber,string hBillSubType)
+ {
+ var sqlBuilder = new StringBuilder();
+ sqlBuilder.Append("select a.HItemID,a.HNumber,a.HName ,a.HLevel,a.HTypeFlow ,a.HTypeCount ,a.HBillSubType ");
+ sqlBuilder.Append(",a.HEndFlag,a.HStopFlag,b.hname,a.HSNo,a.HProcessID_K3,a.HFixPrice,a.HOverFixPrice ");
+ sqlBuilder.Append(",a.HEndFlag,a.HStopFlag,b.hname,a.HSNo,a.HProcessID_K3,a.HFixPrice,a.HOverFixPrice ");
+ sqlBuilder.Append(",a.HAutoTrunFlag,a.HRemark ,a.HProcessID_K3 from gy_Process a left join h_v_IF_Department b on a.HDeptID=b.hitemid where 1=1 ");
+ if (!string.IsNullOrEmpty(hName))
+ sqlBuilder.Append(" and a.HName like '%@hName%'");
+ if(!string.IsNullOrEmpty(hNumber))
+ sqlBuilder.Append(" and a.HNumbe like '%@hNumber%'");
+ if (!string.IsNullOrEmpty(hBillSubType))
+ sqlBuilder.Append(" and a.HBillSubType like '%@hBillSubType%'");
+ if(hLevel!=0)
+ sqlBuilder.Append(" and a.HLevel=@hLevel");
+ var list = SqlPools.GetInstance("YqnConn").GetModelList<Models.M_StationBillMail>(sqlBuilder.ToString(), new { hName, hLevel, hNumber, hBillSubType });
+ return list;
+ }
+ public static Models.M_StationBillMail GetProcessDetail(int hItemID)
+ {
+ var sql = "select HNumber,HHelpCode,HName,HNumber,HDeptID,HProcMulID,HRemark,HSNo,HFixPrice,HOverFixPrice,HBillSubType,HStopflag, HTypeFlow, HTypeCount, HAutoTrunFlag, HItemID from Gy_Process where HItemID=@hItemID";
+ var model = SqlPools.GetInstance("YqnConn").GetModel<Models.M_StationBillMail>(sql, new { hItemID });
+ return model;
+ }
+ }
+}
\ No newline at end of file
diff --git a/WebAPI/Service/YqnQbService.cs b/WebAPI/Service/YqnQbService.cs
index c6feccf..79b7383 100644
--- a/WebAPI/Service/YqnQbService.cs
+++ b/WebAPI/Service/YqnQbService.cs
@@ -186,17 +186,29 @@
/// </summary>
public static ApiResult SetStationOutBill(StationOutBillView omodel)
{
- if (!dicLock.TryAdd(omodel.HBillNo, omodel.HBillNo))//鍚屼竴鍗曞彿骞跺彂澶勭悊
+ if (!dicLock.TryAdd(omodel.HICMOBillNo + "cz", omodel.HBillNo))//鍚屼竴鍗曞彿骞跺彂澶勭悊
return new ApiResult { code = -1, msg = "鏈嶅姟鍣ㄧ箒蹇�" };
- var stationInBillModel = YqnDal.GetStationInBillMail(omodel.HProcID, omodel.HICMOBillNo);
- if (stationInBillModel == null)
- return new ApiResult { code = -1, msg = "璇ュ伐搴忚繘绔欏崟涓嶅瓨鍦�" };
- var stationOutBillModel = YqnDal.GetStationOutBillMail(omodel.HProcID, omodel.HICMOBillNo);
- if (stationOutBillModel != null)
- return new ApiResult { code = -1, msg = "璇ュ伐搴忓凡瀛樺湪鍑虹珯鍗�" };
- omodel.HYear = DateTime.Now.Year;
- var result = SetOutBill(omodel);
- return result;
+ try
+ {
+ var stationInBillModel = YqnDal.GetStationInBillMail(omodel.HProcID, omodel.HICMOBillNo);
+ if (stationInBillModel == null)
+ return new ApiResult { code = -1, msg = "璇ュ伐搴忚繘绔欏崟涓嶅瓨鍦�" };
+ var stationOutBillModel = YqnDal.GetStationOutBillMail(omodel.HProcID, omodel.HICMOBillNo);
+ if (stationOutBillModel != null)
+ return new ApiResult { code = -1, msg = "璇ュ伐搴忓凡瀛樺湪鍑虹珯鍗�" };
+ omodel.HYear = DateTime.Now.Year;
+ var result = SetOutBill(omodel);
+ return result;
+ }
+ catch (Exception ex)
+ {
+ return new ApiResult { code = -1, msg = ex.ToString() };
+ }
+ finally
+ {
+ dicLock.TryRemove(omodel.HICMOBillNo + "cz", out string key);
+ }
+
}
#region sql璇彞
public static DataSet GetStationOutBill(string strWhere)
diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj
index 5671c06..8221842 100644
--- a/WebAPI/WebAPI.csproj
+++ b/WebAPI/WebAPI.csproj
@@ -323,6 +323,7 @@
<Compile Include="Models\ApiResult.cs" />
<Compile Include="Models\DocumentsView.cs" />
<Compile Include="Models\M_StationBillMail.cs" />
+ <Compile Include="Models\M_Process.cs" />
<Compile Include="Models\StationOutBillView.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
@@ -334,6 +335,7 @@
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
+ <Compile Include="Service\ProcessDal.cs" />
<Compile Include="Service\YqnDal.cs" />
<Compile Include="Service\YqnQbService.cs" />
<Compile Include="Web References\WebS\Reference.cs">
--
Gitblit v1.9.1