From 437b5cd5f34c9c2f16c6a939b178afe6cdb64f27 Mon Sep 17 00:00:00 2001
From: yl <ykxkd@outlook.com>
Date: 星期四, 21 七月 2022 18:56:48 +0800
Subject: [PATCH] 用户清单导入
---
VueWebApi/Controllers/ProductModelController.cs | 263 ++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 250 insertions(+), 13 deletions(-)
diff --git a/VueWebApi/Controllers/ProductModelController.cs b/VueWebApi/Controllers/ProductModelController.cs
index ab052a6..90e51e8 100644
--- a/VueWebApi/Controllers/ProductModelController.cs
+++ b/VueWebApi/Controllers/ProductModelController.cs
@@ -13,7 +13,7 @@
namespace VueWebApi.Controllers
{
- [RoutePrefix(prefix: "api/BasicSetting")]
+ [RoutePrefix(prefix: "api/ProductModel")]
[ControllerGroup("鍒堕�犳ā鍨�", "鍦ㄧ嚎鎺ュ彛")]
public class ProductModelController : ApiController
{
@@ -82,7 +82,7 @@
string stocktypecode = obj["stocktypecode"].ToString(); //瀛樿揣绫诲瀷缂栫爜
var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //鎿嶄綔浜哄憳
string OperType = obj["OperType"].ToString(); //鎿嶄綔绫诲瀷
- mes = ProductModelBLL.AddUpdateMaterialType(materialtypeid,materialtypecode, materialtypename, stocktypecode, username, OperType);
+ mes = ProductModelBLL.AddUpdateMaterialType(materialtypeid, materialtypecode, materialtypename, stocktypecode, username, OperType);
return TJson.toJson(mes);
}
#endregion
@@ -137,7 +137,7 @@
public HttpResponseMessage UomAdd(List<Uom> json)
{
var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //鎿嶄綔浜哄憳
- mes = ProductModelBLL.UomAdd(username,json);
+ mes = ProductModelBLL.UomAdd(username, json);
return TJson.toJson(mes);
}
#endregion
@@ -157,9 +157,9 @@
}
#endregion
- #region[瀛樼被鍨嬫煡鎵剧墿鏂欑被鍨媇
+ #region[瀛樿揣绫诲瀷鏌ユ壘鐗╂枡绫诲瀷]
/// <summary>
- /// 瀛樼被鍨嬫煡鎵剧墿鏂欑被鍨�
+ /// 瀛樿揣绫诲瀷鏌ユ壘鐗╂枡绫诲瀷
/// </summary>
/// <param name="stocktypecode">瀛樿揣绫诲瀷缂栫爜</param>
/// <returns></returns>
@@ -176,6 +176,20 @@
mes.code = "300";
mes.Message = e.Message;
}
+ return TJson.toJson(mes);
+ }
+ #endregion
+
+ #region[鍗曚綅涓嬫媺鍒楄〃鏌ヨ]
+ /// <summary>
+ /// 鍗曚綅涓嬫媺鍒楄〃鏌ヨ
+ /// </summary>
+ /// <returns></returns>
+ [Route(template: "UomSelect")]
+ [HttpGet]
+ public HttpResponseMessage UomSelect()
+ {
+ mes = ProductModelBLL.UomSelect();
return TJson.toJson(mes);
}
#endregion
@@ -197,7 +211,7 @@
/// <returns></returns>
[Route(template: "InventoryFileSelect")]
[HttpGet]
- public HttpResponseMessage InventoryFileSelect(string partcode = null, string partname = null,string partspec=null,string stocktypecode = null,string materialtypecode=null,string storehousecode=null, int page = 0, int rows = 0, string prop = null, string order = null)
+ public HttpResponseMessage InventoryFileSelect(string partcode = null, string partname = null, string partspec = null, string stocktypecode = null, string materialtypecode = null, string storehousecode = null, int page = 0, int rows = 0, string prop = null, string order = null)
{
int startNum = rows * (page - 1) + 1; //璧峰璁板綍rowNum
int endNum = rows * page; //缁撴潫璁板綍 rowNum
@@ -228,7 +242,7 @@
string maxstockqty = obj["maxstockqty"].ToString(); //鏈�澶у簱瀛�
var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //鎿嶄綔浜哄憳
string OperType = obj["OperType"].ToString(); //鎿嶄綔绫诲瀷
- mes = ProductModelBLL.AddUpdateInventoryFile(materialid, materialcode, materialname, materialspec, uomcode, warehousecode, stocktypecode, materialtypecode, minstockqty, maxstockqty,username, OperType);
+ mes = ProductModelBLL.AddUpdateInventoryFile(materialid, materialcode, materialname, materialspec, uomcode, warehousecode, stocktypecode, materialtypecode, minstockqty, maxstockqty, username, OperType);
return TJson.toJson(mes);
}
#endregion
@@ -268,20 +282,34 @@
/// 瀛樿揣妗f鍏宠仈宸ヨ壓璺嚎鎻愪氦
/// </summary>
/// <param name="partcode">鐗╂枡缂栫爜</param>
+ /// <param name="defaultroute_code">榛樿宸ヨ壓璺嚎缂栫爜</param>
/// <param name="json">鎻愪氦鏁版嵁瀵硅薄</param>
/// <returns></returns>
[Route(template: "SaveInventoryFile")]
[HttpPost]
- public HttpResponseMessage SaveInventoryFile(string partcode, List<ObjectData> json)
+ public HttpResponseMessage SaveInventoryFile(string partcode, List<ObjectData> json, string defaultroute_code = null)
{
var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //鎿嶄綔浜哄憳
- mes = ProductModelBLL.SaveInventoryFile(partcode, username,json);
+ mes = ProductModelBLL.SaveInventoryFile(partcode, defaultroute_code, username, json);
return TJson.toJson(mes);
}
#endregion
+ #region[宸ュ簭涓嬫媺鏌ヨ鎺ュ彛]
+ /// <summary>
+ /// 宸ュ簭涓嬫媺鏌ヨ鎺ュ彛
+ /// </summary>
+ /// <returns></returns>
+ [Route(template: "StepSelect")]
+ [HttpGet]
+ public HttpResponseMessage StepSelect()
+ {
+ mes = ProductModelBLL.StepSelect();
+ return TJson.toJson(mes);
+ }
+ #endregion
#region[宸ヨ壓璺嚎鏌ヨ]
/// <summary>
@@ -324,7 +352,7 @@
#region[宸ヨ壓璺嚎鏂板]
/// <summary>
- /// 宸ヨ壓璺嚎鏂板缂栬緫
+ /// 宸ヨ壓璺嚎鏂板
/// </summary>
/// <param name="id">宸ヨ壓璺嚎id</param>
/// <param name="opertype">鎿嶄綔绫诲瀷(鏂板)</param>
@@ -332,7 +360,7 @@
/// <returns></returns>
[Route(template: "AddUpdateRoute")]
[HttpPost]
- public HttpResponseMessage AddUpdateRoute(string id,string opertype, RoutEdit json)
+ public HttpResponseMessage AddUpdateRoute(string opertype, RoutEdit json,string id=null)
{
var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //鎿嶄綔浜哄憳
mes = ProductModelBLL.AddUpdateRoute(id, opertype, username, json);
@@ -373,11 +401,11 @@
/// <returns></returns>
[Route(template: "StepSearch")]
[HttpGet]
- public HttpResponseMessage StepSearch(string stepcode = null, string stepname = null, string enable = null,string steptypecode=null, string createuser = null, int page = 0, int rows = 0, string prop = null, string order = null)
+ public HttpResponseMessage StepSearch(string stepcode = null, string stepname = null, string enable = null, string steptypecode = null, string createuser = null, int page = 0, int rows = 0, string prop = null, string order = null)
{
int startNum = rows * (page - 1) + 1; //璧峰璁板綍rowNum
int endNum = rows * page; //缁撴潫璁板綍 rowNum
- mes = ProductModelBLL.StepSearch(stepcode, stepname, enable, steptypecode,createuser, startNum, endNum, prop, order);
+ mes = ProductModelBLL.StepSearch(stepcode, stepname, enable, steptypecode, createuser, startNum, endNum, prop, order);
return TJson.toJson(mes);
}
#endregion
@@ -451,5 +479,214 @@
return TJson.toJson(mes);
}
#endregion
+
+ #region[宸ュ簭鍏宠仈缂洪櫡鏌ヨ]
+ /// <summary>
+ /// 宸ュ簭鍏宠仈缂洪櫡鏌ヨ
+ /// </summary>
+ /// <param name="stepcode">宸ュ簭缂栫爜</param>
+ /// <returns></returns>
+ [Route(template: "StepAssociationDefect")]
+ [HttpGet]
+ public HttpResponseMessage StepAssociationDefect(string stepcode)
+ {
+ mes = ProductModelBLL.StepAssociationDefect(stepcode);
+ return TJson.toJson(mes);
+ }
+ #endregion
+
+ #region[宸ュ簭鍏宠仈缂洪櫡鎻愪氦]
+ /// <summary>
+ /// 宸ュ簭鍏宠仈缂洪櫡鎻愪氦
+ /// </summary>
+ /// <param name="stepcode">宸ュ簭缂栫爜</param>
+ /// <param name="json">鎻愪氦鏁版嵁</param>
+ /// <returns></returns>
+ [Route(template: "SaveStepAssociationDefect")]
+ [HttpPost]
+ public HttpResponseMessage SaveStepAssociationDefect(string stepcode, List<ObjectData> json)
+ {
+ var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //鎿嶄綔浜哄憳
+ mes = ProductModelBLL.SaveStepAssociationDefect(stepcode, username, json);
+ return TJson.toJson(mes);
+ }
+ #endregion
+
+
+
+ #region[浜у搧淇℃伅涓嬫媺妗嗘煡璇
+ /// <summary>
+ /// 浜у搧淇℃伅涓嬫媺妗嗘煡璇�
+ /// </summary>
+ /// <returns></returns>
+ [Route(template: "PartSelect")]
+ [HttpGet]
+ public HttpResponseMessage PartSelect()
+ {
+ try
+ {
+ mes = ProductModelBLL.PartSelect();
+ }
+ catch (Exception e)
+ {
+ mes.code = "300";
+ mes.Message = e.Message;
+ }
+ return TJson.toJson(mes);
+ }
+ #endregion
+
+ #region[浜у搧缂栫爜鏌ユ壘宸ヨ壓璺嚎涓嬫媺妗哴
+ /// <summary>
+ /// 浜у搧缂栫爜鏌ユ壘宸ヨ壓璺嚎涓嬫媺妗�
+ /// </summary>
+ /// <param name="partcode">浜у搧缂栫爜</param>
+ /// <returns></returns>
+ [Route(template: "PartSelectRpute")]
+ [HttpGet]
+ public HttpResponseMessage PartSelectRpute(string partcode)
+ {
+ try
+ {
+ mes = ProductModelBLL.PartSelectRpute(partcode);
+ }
+ catch (Exception e)
+ {
+ mes.code = "300";
+ mes.Message = e.Message;
+ }
+ return TJson.toJson(mes);
+ }
+ #endregion
+
+ #region[鏍规嵁宸ヨ壓璺嚎缂栫爜鏌ユ壘鍏宠仈宸ュ簭闆嗗悎]
+ /// <summary>
+ /// 鏍规嵁宸ヨ壓璺嚎缂栫爜鏌ユ壘鍏宠仈宸ュ簭闆嗗悎
+ /// </summary>
+ /// <param name="routecode">宸ヨ壓璺嚎缂栫爜</param>
+ /// <returns></returns>
+ [Route(template: "RouteSelectStep")]
+ [HttpGet]
+ public HttpResponseMessage RouteSelectStep(string routecode)
+ {
+ try
+ {
+ mes = ProductModelBLL.RouteSelectStep(routecode);
+ }
+ catch (Exception e)
+ {
+ mes.code = "300";
+ mes.Message = e.Message;
+ }
+ return TJson.toJson(mes);
+ }
+ #endregion
+
+ #region[鏍规嵁宸ュ簭绾跨紪鐮佹煡鎵惧叧鑱旇澶囦笅鎷夋闆嗗悎]
+ /// <summary>
+ /// 鏍规嵁宸ュ簭绾跨紪鐮佹煡鎵惧叧鑱旇澶囦笅鎷夋闆嗗悎
+ /// </summary>
+ /// <param name="stepcode">宸ュ簭缂栫爜</param>
+ /// <returns></returns>
+ [Route(template: "StepSelectEqp")]
+ [HttpGet]
+ public HttpResponseMessage StepSelectEqp(string stepcode)
+ {
+ mes = ProductModelBLL.StepSelectEqp(stepcode);
+ return TJson.toJson(mes);
+ }
+ #endregion
+
+ #region[鏍规嵁宸ュ簭绾跨紪鐮佹煡鎵惧叧鑱旇澶囧垪琛ㄩ泦鍚圿
+ /// <summary>
+ /// 鏍规嵁宸ュ簭绾跨紪鐮佹煡鎵惧叧鑱旇澶囧垪琛ㄩ泦鍚�
+ /// </summary>
+ /// <param name="partcode">浜у搧缂栫爜</param>
+ /// <param name="routecode">宸ヨ壓璺嚎缂栫爜</param>
+ /// <param name="stepcode">宸ュ簭缂栫爜</param>
+ /// <param name="page">椤电爜</param>
+ /// <param name="rows">姣忛〉鏄剧ず鏉℃暟</param>
+ /// <param name="prop">鎺掑簭瀛楁</param>
+ /// <param name="order">鎺掑簭瑙勫垯</param>
+ /// <returns></returns>
+ [Route(template: "StepSelectEqpList")]
+ [HttpGet]
+ public HttpResponseMessage StepSelectEqpList(string partcode, string routecode, string stepcode, int page = 0, int rows = 0, string prop = null, string order = null)
+ {
+
+ int startNum = rows * (page - 1) + 1; //璧峰璁板綍rowNum
+ int endNum = rows * page; //缁撴潫璁板綍 rowNum
+ mes = ProductModelBLL.StepSelectEqpList(partcode, routecode, stepcode, startNum, endNum, prop, order);
+ return TJson.toJson(mes);
+ }
+ #endregion
+
+ #region[鑺傛媿宸ヤ环鏌ヨ]
+ /// <summary>
+ /// 鑺傛媿宸ヤ环鏌ヨ
+ /// </summary>
+ /// <param name="partcode">浜у搧缂栫爜</param>
+ /// <param name="routecode">宸ヨ壓璺嚎缂栫爜</param>
+ /// <param name="stepcode">宸ュ簭缂栫爜</param>
+ /// <param name="eqpcode">璁惧缂栫爜</param>
+ /// <param name="page">椤电爜</param>
+ /// <param name="rows">姣忛〉鏄剧ず鏉℃暟</param>
+ /// <param name="prop">鎺掑簭瀛楁</param>
+ /// <param name="order">鎺掑簭瑙勫垯</param>
+ /// <returns></returns>
+ [Route(template: "BeatRateSearch")]
+ [HttpGet]
+ public HttpResponseMessage BeatRateSearch(string partcode = null, string routecode = null, string stepcode = null, string eqpcode = null,int page = 0, int rows = 0, string prop = null, string order = null)
+ {
+ int startNum = rows * (page - 1) + 1; //璧峰璁板綍rowNum
+ int endNum = rows * page; //缁撴潫璁板綍 rowNum
+ mes = ProductModelBLL.BeatRateSearch(partcode,routecode, stepcode, eqpcode, startNum, endNum, prop, order);
+ return TJson.toJson(mes);
+ }
+ #endregion
+
+ #region[鑺傛媿宸ヤ环鎻愪氦]
+ /// <summary>
+ /// 鑺傛媿宸ヤ环鎻愪氦
+ /// </summary>
+ /// <param name="obj">鎻愪氦鏁版嵁</param>
+ /// <returns></returns>
+ [Route(template: "SaveBeatRate")]
+ [HttpPost]
+ public HttpResponseMessage SaveBeatRate([FromBody] JObject obj)
+ {
+ string partcode = obj["partcode"].ToString(); //浜у搧缂栫爜
+ string routecode = obj["routecode"].ToString(); //宸ヨ壓璺嚎缂栫爜
+ string stepcode = obj["stepcode"].ToString(); //宸ュ簭缂栫爜
+ string eqpcode = obj["eqpcode"].ToString(); //璁惧缂栫爜
+ string wkshopcode = obj["wkshopcode"].ToString(); //鐢熶骇杞﹂棿缂栫爜
+ string eqp_value = obj["eqp_value"].ToString(); //璁惧鑺傛媿
+ string stand_value = obj["stand_value"].ToString(); //鐢熶骇鑺傛媿
+ string cavity_qty = obj["cavity_qty"].ToString(); //鍨嬭厰鏁�
+ string unprice = obj["unprice"].ToString(); //璁′欢鍗曚环
+ var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //鎿嶄綔浜哄憳
+ mes = ProductModelBLL.SaveBeatRate(partcode, routecode, stepcode, eqpcode, wkshopcode, eqp_value, stand_value, cavity_qty, unprice, username);
+ return TJson.toJson(mes);
+ }
+ #endregion
+
+ #region[鑺傛媿宸ヤ环鍒犻櫎]
+ /// <summary>
+ /// 鑺傛媿宸ヤ环鍒犻櫎
+ /// </summary>
+ /// <param name="partcode">浜у搧缂栫爜</param>
+ /// <param name="routecode">宸ヨ壓璺嚎缂栫爜</param>
+ /// <param name="stepcode">宸ュ簭缂栫爜</param>
+ /// <param name="eqpcode">璁惧缂栫爜</param>
+ /// <returns></returns>
+ [Route(template: "DeleteBeatRate")]
+ [HttpPost]
+ public HttpResponseMessage DeleteBeatRate(string partcode,string routecode,string stepcode,string eqpcode)
+ {
+ mes = ProductModelBLL.DeleteBeatRate(partcode, routecode, stepcode, eqpcode);
+ return TJson.toJson(mes);
+ }
+ #endregion
+
}
}
--
Gitblit v1.9.3