From 39f66c32212f11d9a9d41c69e37f68e989c55cde Mon Sep 17 00:00:00 2001
From: yl <ykxkd@outlook.com>
Date: 星期一, 08 十二月 2025 10:56:23 +0800
Subject: [PATCH] 1.报工调整增加工序查询条件 2.报工调整增加批量改价 3.生产订单、生产工单车间查询条件改为多选
---
VueWebCoreApi/Tools/ExcelList.cs | 2
VueWebCoreApi/DLL/BLL/WorkOrderBLL.cs | 11 ++
VueWebCoreApi/DLL/DAL/WorkOrderDAL.cs | 134 +++++++++++++++++++++++++++++++-
VueWebCoreApi/Controllers/WorkOrderController.cs | 24 +++++
VueWebCoreApi/Models/BatchPrice.cs | 23 +++++
5 files changed, 181 insertions(+), 13 deletions(-)
diff --git a/VueWebCoreApi/Controllers/WorkOrderController.cs b/VueWebCoreApi/Controllers/WorkOrderController.cs
index da766e5..c5e967f 100644
--- a/VueWebCoreApi/Controllers/WorkOrderController.cs
+++ b/VueWebCoreApi/Controllers/WorkOrderController.cs
@@ -20,7 +20,7 @@
[ApiExplorerSettings(GroupName = "宸ュ崟绠$悊")]
[ApiController]
[Route("api/[controller]")]
- //[ChannelActionFilter]
+ [ChannelActionFilter]
public class WorkOrderController : Controller
{
//瀹氫箟鍏ㄥ眬淇℃伅杩斿洖鍙橀噺
@@ -733,6 +733,7 @@
/// <param name="partnumber">浜у搧缂栫爜</param>
/// <param name="partname">浜у搧鍚嶇О</param>
/// <param name="partspec">浜у搧瑙勬牸</param>
+ /// <param name="stepcode">宸ュ簭缂栫爜</param>
/// <param name="reportuser">鎶ュ伐浜哄憳</param>
/// <param name="reportdate">鎶ュ伐鏃堕棿</param>
/// <param name="page">椤电爜</param>
@@ -742,7 +743,7 @@
/// <returns></returns>
[Route(template: "MesOrderStepVerifySearch")]
[HttpGet]
- public JsonResult MesOrderStepVerifySearch(string wkshopcode=null, string wo_code = null, string partnumber = null, string partname = null, string partspec = null, string reportuser = null, string reportdate = null, int page = 0, int rows = 0, string prop = null, string order = null)
+ public JsonResult MesOrderStepVerifySearch(string wkshopcode=null, string wo_code = null, string partnumber = null, string partname = null, string partspec = null,string stepcode=null, string reportuser = null, string reportdate = null, int page = 0, int rows = 0, string prop = null, string order = null)
{
string reportdateopendate = ""; //鎶ュ伐寮�濮嬫椂闂�
string reportdateclosedate = ""; //鎶ュ伐缁撴潫鏃堕棿
@@ -753,7 +754,7 @@
}
int startNum = rows * (page - 1) + 1; //璧峰璁板綍rowNum
int endNum = rows * page; //缁撴潫璁板綍 rowNum
- mes = WorkOrderBLL.MesOrderStepVerifySearch(wkshopcode,wo_code, partnumber, partname, partspec, reportuser, reportdateopendate, reportdateclosedate, startNum, endNum, prop, order);
+ mes = WorkOrderBLL.MesOrderStepVerifySearch(wkshopcode,wo_code, partnumber, partname, partspec, stepcode, reportuser, reportdateopendate, reportdateclosedate, startNum, endNum, prop, order);
return Json(mes);
}
#endregion
@@ -796,6 +797,23 @@
}
#endregion
+ #region[鐢熶骇鎵ц,鎶ュ伐璋冩暣鎵归噺鏀逛环鏁版嵁鎻愪氦]
+ /// <summary>
+ /// 鐢熶骇鎵ц,鎶ュ伐璋冩暣鎵归噺鏀逛环鏁版嵁鎻愪氦
+ /// </summary>
+ /// <param name="json">鎻愪氦鏁版嵁</param>
+ /// <returns></returns>
+ [Route(template: "MesOrderStepPriceBatchUpdateSeave")]
+ [HttpPost]
+ public JsonResult MesOrderStepPriceBatchUpdateSeave(List<BatchPrice> json)
+ {
+ var token = HttpContext.Request.Headers["Token"].ToString();
+ User us = JwtTools.Denocode(token.ToString());
+ mes = WorkOrderBLL.MesOrderStepPriceBatchUpdateSeave(us, json);
+ return Json(mes);
+ }
+ #endregion
+
#region[鐢熶骇鎵ц,鎶ュ伐瀹℃牳鍒楄〃鏁版嵁鏌ヨ鎺ュ彛]
diff --git a/VueWebCoreApi/DLL/BLL/WorkOrderBLL.cs b/VueWebCoreApi/DLL/BLL/WorkOrderBLL.cs
index 9bec231..f9fd312 100644
--- a/VueWebCoreApi/DLL/BLL/WorkOrderBLL.cs
+++ b/VueWebCoreApi/DLL/BLL/WorkOrderBLL.cs
@@ -240,9 +240,9 @@
#region[鐢熶骇鎵ц,鎶ュ伐璋冩暣鏁版嵁鏌ヨ鎺ュ彛]
- public static ToMessage MesOrderStepVerifySearch(string wkshopcode,string wo_code, string partnumber, string partname, string partspec, string reportuser, string reportdateopendate, string reportdateclosedate, int startNum, int endNum, string prop, string order)
+ public static ToMessage MesOrderStepVerifySearch(string wkshopcode,string wo_code, string partnumber, string partname, string partspec,string stepcode, string reportuser, string reportdateopendate, string reportdateclosedate, int startNum, int endNum, string prop, string order)
{
- return WorkOrderDAL.MesOrderStepVerifySearch(wkshopcode,wo_code, partnumber, partname, partspec, reportuser, reportdateopendate, reportdateclosedate, startNum, endNum, prop, order);
+ return WorkOrderDAL.MesOrderStepVerifySearch(wkshopcode,wo_code, partnumber, partname, partspec, stepcode, reportuser, reportdateopendate, reportdateclosedate, startNum, endNum, prop, order);
}
#endregion
@@ -260,6 +260,13 @@
}
#endregion
+ #region[鐢熶骇鎵ц,鎶ュ伐璋冩暣鎵归噺鏀逛环鏁版嵁鎻愪氦]
+ public static ToMessage MesOrderStepPriceBatchUpdateSeave(User us,List<BatchPrice> json)
+ {
+ return WorkOrderDAL.MesOrderStepPriceBatchUpdateSeave(us, json);
+ }
+ #endregion
+
#region[鐢熶骇鎵ц,鎶ュ伐瀹℃牳鍒楄〃鏁版嵁鏌ヨ鎺ュ彛]
public static ToMessage MesOrderStepReportVerifySearch(string reviewstatus, string wkshopcode, string wo_code, string partnumber, string partname, string partspec, string stepname, string reportuser, string reportdateopendate, string reportdateclosedate, int startNum, int endNum, string prop, string order)
diff --git a/VueWebCoreApi/DLL/DAL/WorkOrderDAL.cs b/VueWebCoreApi/DLL/DAL/WorkOrderDAL.cs
index f20820a..fc7d964 100644
--- a/VueWebCoreApi/DLL/DAL/WorkOrderDAL.cs
+++ b/VueWebCoreApi/DLL/DAL/WorkOrderDAL.cs
@@ -42,8 +42,9 @@
}
if (wkshopcode != "" && wkshopcode != null)
{
- search += "and A.wkshp_code=@wkshopcode ";
- dynamicParams.Add("@wkshopcode", wkshopcode);
+ string[] wkshoplist = Array.ConvertAll<string, string>(wkshopcode.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries), s => s.ToString()); //string鍒嗗壊杞瑂tring[]
+ search += "and A.wkshp_code in @wkshoplist ";
+ dynamicParams.Add("@wkshoplist", wkshoplist);
}
if (erpordercode != "" && erpordercode != null)
{
@@ -850,8 +851,9 @@
}
if (wkshopcode != "" && wkshopcode != null)
{
- search += "and A.wkshp_code=@wkshopcode ";
- dynamicParams.Add("@wkshopcode", wkshopcode);
+ string[] wkshoplist = Array.ConvertAll<string, string>(wkshopcode.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries), s => s.ToString()); //string鍒嗗壊杞瑂tring[]
+ search += "and A.wkshp_code in @wkshoplist ";
+ dynamicParams.Add("@wkshoplist", wkshoplist);
}
if (mesordercode != "" && mesordercode != null)
{
@@ -3396,7 +3398,7 @@
#region[鐢熶骇鎵ц,鎶ュ伐璋冩暣鏁版嵁鏌ヨ鎺ュ彛]
- public static ToMessage MesOrderStepVerifySearch(string wkshopcode, string wo_code, string partnumber, string partname, string partspec, string reportuser, string reportdateopendate, string reportdateclosedate, int startNum, int endNum, string prop, string order)
+ public static ToMessage MesOrderStepVerifySearch(string wkshopcode, string wo_code, string partnumber, string partname, string partspec,string stepcode, string reportuser, string reportdateopendate, string reportdateclosedate, int startNum, int endNum, string prop, string order)
{
var dynamicParams = new DynamicParameters();
string search = "";
@@ -3427,6 +3429,11 @@
search += "and AA.partspec like '%'+@partspec+'%' ";
dynamicParams.Add("@partspec", partspec);
}
+ if (stepcode != "" && stepcode != null)
+ {
+ search += "and AA.step_code=@stepcode ";
+ dynamicParams.Add("@stepcode", stepcode);
+ }
if (reportuser != "" && reportuser != null)
{
search += "and AA.usercode like '%'+@reportuser+'%' ";
@@ -3449,7 +3456,7 @@
var total = 0; //鎬绘潯鏁�
var sql = @"select * from(
select A.id,B.id as sbid,A.wo_code,A.materiel_code as partnumber,P.partname,P.partspec,K.plan_quantity,K.plan_qty as task_qty,M.wkshp_code,T.torg_name as wkshp_name,A.eqp_code,E.name as eqp_name,
- A.step_seq,A.step_code,S.stepname,S.flwtype as steptype,k.isbott as first_choke,k.isend as last_choke,A.step_price,B.reckway,B.usergroup_code,G.usergroupname as usergroup_name,
+ A.step_seq,A.step_code,S.stepname,S.flwtype as steptype,A.style,k.isbott as first_choke,k.isend as last_choke,A.step_price,B.reckway,B.usergroup_code,G.usergroupname as usergroup_name,
B.report_person as usercode,
STUFF((SELECT ',' + U.username
FROM TUser U
@@ -3468,7 +3475,7 @@
where A.style='B' and B.style='B' and M.status<>'CLOSED' and A.verify='N'
union all
select A.id,B.id as sbid,A.wo_code,A.materiel_code as partnumber,P.partname,P.partspec,K.plan_quantity,K.plan_qty as task_qty,M.wkshp_code,T.torg_name as wkshp_name,A.wx_code as eqp_code,E.name as eqp_name,
- A.step_seq,A.step_code,S.stepname,S.flwtype as steptype,k.isbott as first_choke,k.isend as last_choke,A.step_price,'person' as reckway,'' as usergroup_code,'' as usergroup_name,
+ A.step_seq,A.step_code,S.stepname,S.flwtype as steptype,A.style,k.isbott as first_choke,k.isend as last_choke,A.step_price,'person' as reckway,'' as usergroup_code,'' as usergroup_name,
B.in_person as usercode,
STUFF((SELECT ',' + U.username
FROM TUser U
@@ -4398,6 +4405,118 @@
}
#endregion
+ #region[鐢熶骇鎵ц,鎶ュ伐璋冩暣鎵归噺鏀逛环鏁版嵁鎻愪氦]
+ public static ToMessage MesOrderStepPriceBatchUpdateSeave(User us, List<BatchPrice> json)
+ {
+ string sql = "";
+ List<object> list = new List<object>();
+ var dynamicParams = new DynamicParameters();
+ try
+ {
+ if (json.Count > 0)
+ {
+ // 浣跨敤Lambda琛ㄨ揪寮忓垽鏂被鍨嬪垎甯�:鍏ㄩ儴鎶ュ伐鎴栬�呭叏閮ㄦ敹鏂�
+ bool allB = json.All(p => p.type == "B");
+ bool allS = json.All(p => p.type == "S");
+ if (allB)//鍏ㄩ儴鎶ュ伐
+ {
+ //灏哃ist<BatchPrice>涓殑id瀛楁杞崲涓哄瓧绗︿覆鏁扮粍
+ string[] idArray = json.Select(bp => bp.id).ToArray();
+ //鍥炲啓瀵瑰簲鐨勬姤宸ヨ褰曚富琛ㄥ伐浠�
+ sql = @"update TK_Wrk_Record set step_price=@step_price where id in @idArray and style='B'";
+ list.Add(new
+ {
+ str = sql,
+ parm = new
+ {
+ step_price = decimal.Parse(json[0].price),
+ idArray = idArray
+ }
+ });
+ }
+ else if (allS)//鍏ㄩ儴鏀舵枡
+ {
+ //灏哃ist<BatchPrice>涓殑id瀛楁杞崲涓哄瓧绗︿覆鏁扮粍
+ string[] idArray = json.Select(bp => bp.id).ToArray();
+ //鍥炲啓瀵瑰簲鐨勬姤宸ヨ褰曚富琛ㄥ伐浠�
+ sql = @"update TK_Wrk_OutRecord set step_price=@step_price where id in @idArray and style='S'";
+ list.Add(new
+ {
+ str = sql,
+ parm = new
+ {
+ step_price = decimal.Parse(json[0].price),
+ idArray = idArray
+ }
+ });
+ }
+ else // 娣峰悎鎯呭喌
+ {
+ //灏哃ist<BatchPrice>涓负鎶ュ伐鐨刬d瀛楁杞崲涓哄瓧绗︿覆鏁扮粍
+ var bList = json.Where(p => p.type == "B").ToList();
+ string[] idBArray = bList.Select(bp => bp.id).ToArray();
+ //鍥炲啓瀵瑰簲鐨勬姤宸ヨ褰曚富琛ㄥ伐浠�
+ sql = @"update TK_Wrk_Record set step_price=@step_price where id in @idBArray and style='B'";
+ list.Add(new
+ {
+ str = sql,
+ parm = new
+ {
+ step_price = decimal.Parse(json[0].price),
+ idBArray = idBArray
+ }
+ });
+ //灏哃ist<BatchPrice>涓负鏀舵枡鐨刬d瀛楁杞崲涓哄瓧绗︿覆鏁扮粍
+ var sList = json.Where(p => p.type == "S").ToList();
+ string[] idSArray = sList.Select(bp => bp.id).ToArray();
+ //鍥炲啓瀵瑰簲鐨勬姤宸ヨ褰曚富琛ㄥ伐浠�
+ sql = @"update TK_Wrk_OutRecord set step_price=@step_price where id in @idSArray and style='S'";
+ list.Add(new
+ {
+ str = sql,
+ parm = new
+ {
+ step_price = decimal.Parse(json[0].price),
+ idSArray = idSArray
+ }
+ });
+ }
+ bool aa = DapperHelper.DoTransaction(list);
+ if (aa)
+ {
+ //鍐欏叆鎿嶄綔璁板綍琛�
+ LogHelper.DbOperateLog(us.usercode, "鎵归噺淇敼宸ヤ环", "鎶ュ伐ID:" + string.Join(",",json.Select(bp => bp.id).ToArray())+",鎿嶄綔绫诲瀷:"+ string.Join(",", json.Select(bp => bp.type).ToArray()), us.usertype);
+ mes.code = "200";
+ mes.count = 0;
+ mes.message = "鎿嶄綔鎴愬姛!";
+ mes.data = null;
+ }
+ else
+ {
+ mes.code = "300";
+ mes.count = 0;
+ mes.message = "鎿嶄綔澶辫触!";
+ mes.data = null;
+ }
+ }
+ else
+ {
+ mes.code = "300";
+ mes.count = 0;
+ mes.message = "璇烽�夋嫨闇�瑕佹壒閲忚皟鏁村伐浠风殑鎶ュ伐璁板綍!";
+ mes.data = null;
+ return mes;
+ }
+ return mes;
+ }
+ catch (Exception)
+ {
+
+ throw;
+ }
+ }
+ #endregion
+
#region[鐢熶骇鎵ц,鎶ュ伐瀹℃牳鍒楄〃鏁版嵁鏌ヨ鎺ュ彛]
@@ -4637,6 +4756,7 @@
#endregion
+
#region[鐢熶骇鍏ュ簱鏉$爜琛ユ墦]
public static ToMessage ProductInHouseLabCode(string ordercode)
{
diff --git a/VueWebCoreApi/Models/BatchPrice.cs b/VueWebCoreApi/Models/BatchPrice.cs
new file mode 100644
index 0000000..ac98c9a
--- /dev/null
+++ b/VueWebCoreApi/Models/BatchPrice.cs
@@ -0,0 +1,23 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace VueWebCoreApi.Models
+{
+ public class BatchPrice
+ {
+ /// <summary>
+ /// 鎶ュ伐璁板綍涓昏〃id
+ /// </summary>
+ public string id { get; set; }
+ /// <summary>
+ /// 宸ヤ环
+ /// </summary>
+ public string price { get; set; }
+ /// <summary>
+ /// 鎶ュ伐绫诲瀷:B(鎶ュ伐)/S(鏀舵枡)
+ /// </summary>
+ public string type { get; set; }
+ }
+}
diff --git a/VueWebCoreApi/Tools/ExcelList.cs b/VueWebCoreApi/Tools/ExcelList.cs
index b868a0b..86a9452 100644
--- a/VueWebCoreApi/Tools/ExcelList.cs
+++ b/VueWebCoreApi/Tools/ExcelList.cs
@@ -32,7 +32,7 @@
new ScoreReport("14","妯″叿淇濆吇椤圭洰"),
new ScoreReport("14_1","妯″叿淇濆吇鏍囧噯"),
new ScoreReport("15","宸ュ簭璁剧疆"),
- new ScoreReport("16","宸ヨ壓璺嚎"),
+ //new ScoreReport("16","宸ヨ壓璺嚎"),
//new ScoreReport("24","鑺傛媿宸ヤ环"),
new ScoreReport("17","璐ㄦ鏍囧噯"),
new ScoreReport("18","缂洪櫡瀹氫箟"),
--
Gitblit v1.9.3