From e7cfc2b5dd153c336b944f0593207c5c7f091c11 Mon Sep 17 00:00:00 2001
From: zgq <519541279@qq.com>
Date: 星期一, 10 五月 2021 17:04:06 +0800
Subject: [PATCH] 客诉追溯流程报表
---
WebAPI/Controllers/Sc_GroupOrderBillController.cs | 107 ++++++++++++++++++++++++++
WebAPI/Models/GroupOrderBill.cs | 2
WebAPI/WebAPI.csproj | 1
WebAPI/Controllers/ReportController.cs | 78 +++++++++++++++++++
4 files changed, 185 insertions(+), 3 deletions(-)
diff --git a/WebAPI/Controllers/ReportController.cs b/WebAPI/Controllers/ReportController.cs
new file mode 100644
index 0000000..a8294e9
--- /dev/null
+++ b/WebAPI/Controllers/ReportController.cs
@@ -0,0 +1,78 @@
+锘縰sing Newtonsoft.Json.Linq;
+using Pub_Class;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Web.Http;
+using WebAPI.Models;
+
+namespace WebAPI.Controllers
+{
+ //鎶ヨ〃Controller
+ public class ReportController : ApiController
+ {
+ public ClsPub.Enum_BillStatus BillStatus;
+
+ private json objJsonResult = new json();
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ DataSet ds;
+
+
+
+ /// <summary>
+ /// 杩斿洖瀹㈣瘔杩芥函娴佺▼鎶ヨ〃
+ /// </summary>
+ /// <param name="sWhere">鎷兼帴鐨凷QL</param>
+ /// <returns>object</returns>
+ [Route("Report/RetrospectionCustomerReport")]
+ [HttpGet]
+ public object RetrospectionCustomerReport(string sWhere)
+ {
+ DataSet ds;
+ try
+ {
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ ds = oCN.RunProcReturn("select top 5000 * from h_v_RetrospectionCustomerReport order by 缁勬墭鍗曟棩鏈� desc", "h_v_RetrospectionCustomerReport");
+ }
+ else
+ {
+ string sql1 = "select * from h_v_RetrospectionCustomerReport where 1 = 1 ";
+ string sql = sql1 + sWhere;
+ string sql2 = " order by 缁勬墭鍗曟棩鏈� desc";
+ sql += sql2;
+ ds = oCN.RunProcReturn(sql, "h_v_RetrospectionCustomerReport");
+ }
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犳暟鎹紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ //
+ }
+}
\ No newline at end of file
diff --git a/WebAPI/Controllers/Sc_GroupOrderBillController.cs b/WebAPI/Controllers/Sc_GroupOrderBillController.cs
index 2d9a7b8..8b22ef6 100644
--- a/WebAPI/Controllers/Sc_GroupOrderBillController.cs
+++ b/WebAPI/Controllers/Sc_GroupOrderBillController.cs
@@ -113,6 +113,8 @@
long HInterID = list[0].HInterID;//閫掑叆type寰楀埌鐨勫崟鎹甀D
string HBillNo = list[0].HBillNo;//閫掑叆type寰楀埌鐨勫崟鎹甆o
string HMaker = list[0].HMaker;//鍒跺崟浜�
+ string HBatchNo = list[0].HBatchNo;//鍏ュ簱鎵规
+ string HBarCode_Cus = list[0].HBarCode_Cus;//瀹㈡埛鏍囩锛堥粦鏍囧彿锛�
//鐢熸垚鍞竴鏉$爜
ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + nowDate + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
oCN.RunProc("exec h_p_WMS_SetMaxNo '" + nowDate + "'");
@@ -125,17 +127,19 @@
"(" +
"HYear, HBillType, HInterID, HBillNo, HMaker" +
", HMakeDate, HPeriod, HDate, HRemark, HICMOInterID" +
- ", HICMOBillNo, HBarCode_Pack, HMaterID, HUnitID" +
+ ", HICMOBillNo, HBarCode_Pack, HMaterID, HUnitID,HBatchNo,HBarCode_Cus" +
")" +
"values" +
"(" +
"'"+ year + "', '" + HBillType + "'," + HInterID + ", '" + HBillNo + "', '" + HMaker + "'" +
",GETDATE(),0,GETDATE(),' ',0" +
- ",' ','"+ HBarCode_Pack + "',0,0" +
- ")"
+ ",' ','"+ HBarCode_Pack + "',0,0,'" + HBatchNo +"','" + HBarCode_Cus +
+ "')"
);
//鎻掑叆瀛愯〃
oCN.RunProc("exec h_p_SaveGroupOrder " + HInterID + "");
+ //鏍规嵁瀛愯〃姹囨�荤敓鎴怱c_PackUnionBillSub_Sum琛ㄨ褰�
+ oCN.RunProc("exec h_p_Sc_PackUnionBill_SumSubBill " + HInterID + ",'','',''");
oCN.Commit();
objJsonResult.code = "1";
objJsonResult.count = 1;
@@ -289,6 +293,103 @@
}
}
+ /// <summary>
+ /// 鏍规嵁鍞竴鏉$爜鍒犻櫎缂撳瓨琛ㄤ腑鎵爜璁板綍
+ /// </summary>
+ /// <param name="BarCode">鍞竴鏉$爜</param>
+ /// <returns>object</returns>
+ [Route("GroupOrderBill/DelCacheListByBarCode")]
+ [HttpGet]
+ public object DelCacheListByBarCode(string BarCode)
+ {
+ try
+ {
+ SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+ oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HBarCode = " + BarCode + " and HBillType = '2601'");
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍒犻櫎鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触锛�";
+ objJsonResult.data = e.ToString();
+ return objJsonResult;
+ }
+ }
+
+ /// <summary>
+ /// 鏍规嵁缁勬墭鍗曚富ID鍜屽瓙ID鍒犻櫎鍒楄〃涓璁板綍
+ /// </summary>
+ /// <param name="HInterID">缁勬墭鍗曚富ID</param>
+ /// <param name="HEntryID">缁勬墭鍗曞瓙ID</param>
+ /// <returns>object</returns>
+ [Route("GroupOrderBill/DelListRow")]
+ [HttpGet]
+ public object DelListRow(long HInterID,long HEntryID)
+ {
+ try
+ {
+ SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+ oCN.BeginTran();
+ oCn.RunProc("Delete from Sc_PackUnionBillSub where HInterID = " + HInterID + " and HEntryID = " + HEntryID);
+ //閲嶆柊鍒锋柊鏇存柊 姹囨�诲瓙琛� 鐨勮褰曞拰鏉$爜妗f
+ oCn.RunProc("Delete from Sc_PackUnionBillSub_Sum where HInterID = " + HInterID);
+ oCn.RunProc("Delete from Gy_BarCodeBill where HInterID = " + HInterID + " and HSourceBillType = '3772'");
+ //鏍规嵁瀛愯〃姹囨�荤敓鎴怱c_PackUnionBillSub_Sum琛ㄨ褰�
+ oCN.RunProc("exec h_p_Sc_PackUnionBill_SumSubBill " + HInterID + ",'','',''");
+ oCN.Commit();
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍒犻櫎鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触锛�";
+ objJsonResult.data = e.ToString();
+ return objJsonResult;
+ }
+ }
+
+ /// <summary>
+ /// 鏍规嵁缁勬墭鍗曚富ID鍜屽瓙ID淇敼鍒楄〃涓璁板綍鐨勯粦鏍囧彿
+ /// </summary>
+ /// <param name="HInterID">缁勬墭鍗曚富ID</param>
+ /// <param name="HBarCode_Cus">榛戞爣鍙�</param>
+ /// <returns>object</returns>
+ [Route("GroupOrderBill/editListRowHBarCode_Cus")]
+ [HttpGet]
+ public object editListRowHBarCode_Cus(long HInterID,string HBarCode_Cus)
+ {
+ try
+ {
+ SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+ oCn.RunProc("update Sc_PackUnionBillMain set HBarCode_Cus = " + HBarCode_Cus + " where HInterID = " + HInterID);
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "淇敼鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇敼澶辫触锛�";
+ objJsonResult.data = e.ToString();
+ return objJsonResult;
+ }
+ }
+
//
}
}
\ No newline at end of file
diff --git a/WebAPI/Models/GroupOrderBill.cs b/WebAPI/Models/GroupOrderBill.cs
index 504ec9d..c616859 100644
--- a/WebAPI/Models/GroupOrderBill.cs
+++ b/WebAPI/Models/GroupOrderBill.cs
@@ -10,6 +10,8 @@
public long HInterID { get; set; }
public string HBillNo { get; set; }
public string HMaker { get; set; }
+ public string HBatchNo { get; set; }//鍏ュ簱鎵规
+ public string HBarCode_Cus { get; set; }//瀹㈡埛鏍囩锛堥粦鏍囧彿锛�
//public int HYear { get; set; }
//public double HPeriod { get; set; }
//public DateTime HStationInTime { get; set; }
diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj
index a39599c..6011867 100644
--- a/WebAPI/WebAPI.csproj
+++ b/WebAPI/WebAPI.csproj
@@ -314,6 +314,7 @@
<Compile Include="Controllers\EntrustOutBackController.cs" />
<Compile Include="Controllers\EntrustOutController.cs" />
<Compile Include="Controllers\Kf_EntrustInBillController.cs" />
+ <Compile Include="Controllers\ReportController.cs" />
<Compile Include="Controllers\Sc_GroupOrderBillController.cs" />
<Compile Include="Controllers\MateOutController.cs" />
<Compile Include="Controllers\MoveStockBillController.cs" />
--
Gitblit v1.9.1