From 7a0d98456b4ecaf1867cd62ecb7c8169ec15d042 Mon Sep 17 00:00:00 2001
From: yl <ykxkd@outlook.com>
Date: 星期三, 22 六月 2022 18:20:34 +0800
Subject: [PATCH] 设备清单查询、新增、编辑、删除接口开发 设备类型(新增、删除)、设备组(新增、删除)接口开发 仓库定义(新增、编辑、删除)、库位定义(新增、编辑、删除) 存货类型、存货档案接口开发
---
VueWebApi/Controllers/BasicSettingController.cs | 136 +++++++++++++++++++++++++++++++++++++++++---
1 files changed, 125 insertions(+), 11 deletions(-)
diff --git a/VueWebApi/Controllers/BasicSettingController.cs b/VueWebApi/Controllers/BasicSettingController.cs
index 5743b48..e796224 100644
--- a/VueWebApi/Controllers/BasicSettingController.cs
+++ b/VueWebApi/Controllers/BasicSettingController.cs
@@ -107,6 +107,7 @@
/// <param name="UserCode">鐢ㄦ埛缂栫爜</param>
/// <param name="UserName">鐢ㄦ埛鍚嶇О</param>
/// <param name="StuOrg">鎵�灞炵粍缁�</param>
+ /// <param name="wagetype">宸ヨ祫绫诲瀷</param>
/// <param name="Enable">鍦ㄨ亴鐘舵��</param>
/// <param name="page">椤电爜</param>
/// <param name="rows">姣忛〉鏄剧ず鏉℃暟</param>
@@ -115,11 +116,11 @@
/// <returns></returns>
[Route(template: "UserSearch")]
[HttpGet]
- public HttpResponseMessage UserSearch(string UserCode = null, string UserName = null, string StuOrg = null, string Enable = null, int page = 0, int rows = 0, string prop = null, string order = null)
+ public HttpResponseMessage UserSearch(string UserCode = null, string UserName = null, string StuOrg = null,string wagetype=null, string Enable = 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 = BasicSettingBLL.UserSearch(UserCode, UserName, StuOrg, Enable, startNum, endNum, prop, order);
+ mes = BasicSettingBLL.UserSearch(UserCode, UserName, StuOrg, wagetype, Enable, startNum, endNum, prop, order);
return TJson.toJson(mes);
}
#endregion
@@ -148,16 +149,18 @@
[HttpPost]
public HttpResponseMessage AddUpdateUser([FromBody] JObject obj)
{
- string UserId = obj["UserId"].ToString(); //鐢ㄦ埛id(涓婚敭)
+ string UserId = obj["id"].ToString(); //鐢ㄦ埛id(涓婚敭)
string UserCode = obj["UserCode"].ToString(); //鐢ㄦ埛缂栫爜
string UserName = obj["UserName"].ToString(); //鐢ㄦ埛鍚嶇О
+ string Password = obj["Password"].ToString(); //瀵嗙爜
string Enable = obj["Enable"].ToString(); //鍦ㄨ亴鐘舵��
string StuOrg = obj["StuOrg"].ToString(); //閫夋嫨缁勭粐缂栫爜
+ string wagetype = obj["wagetype"].ToString(); //宸ヨ祫绫诲瀷
string Mobile = obj["Mobile"].ToString(); //鑱旂郴鏂瑰紡
string Email = obj["Email"].ToString(); //鐢靛瓙閭
string Operator = obj["Operator"].ToString(); //鎿嶄綔浜哄憳
string OperType = obj["OperType"].ToString(); //鎿嶄綔绫诲瀷
- mes = BasicSettingBLL.AddUpdateUser(UserId, UserCode, UserName, Enable, StuOrg, Mobile, Email, Operator, OperType);
+ mes = BasicSettingBLL.AddUpdateUser(UserId, UserCode, UserName, Password, Enable, StuOrg, wagetype, Mobile, Email, Operator, OperType);
return TJson.toJson(mes);
}
#endregion
@@ -212,6 +215,13 @@
#endregion
#region[鐢ㄦ埛娓呭崟瀵煎叆]
+ /// <summary>
+ /// 鐢ㄦ埛娓呭崟瀵煎叆
+ /// </summary>
+ /// <param name="files">涓婁紶鐢ㄦ埛娓呭崟瀵煎叆鏂囦欢</param>
+ /// <returns></returns>
+ [Route(template: "ImportUserExcel")]
+ [HttpPost]
public HttpResponseMessage ImportUserExcel(HttpPostedFileBase files)
{
string savePath;
@@ -271,9 +281,9 @@
- #region[瑙掕壊绫诲瀷鏌ヨ]
+ #region[瑙掕壊绫诲瀷鍒楄〃鏌ヨ]
/// <summary>
- /// 瑙掕壊绫诲瀷鏌ヨ
+ /// 瑙掕壊绫诲瀷鍒楄〃鏌ヨ
/// </summary>
/// <param name="page">椤电爜</param>
/// <param name="rows">姣忛〉鏄剧ず鏉℃暟</param>
@@ -317,6 +327,28 @@
public HttpResponseMessage RoleTypeDelete(string RoleTypeCode)
{
mes = BasicSettingBLL.RoleTypeDelete(RoleTypeCode);
+ return TJson.toJson(mes);
+ }
+ #endregion
+
+ #region[瑙掕壊绫诲瀷涓嬫媺鎺ュ彛]
+ /// <summary>
+ /// 瑙掕壊绫诲瀷涓嬫媺鎺ュ彛
+ /// </summary>
+ /// <returns></returns>
+ [Route(template: "RoleTypeSelect")]
+ [HttpGet]
+ public HttpResponseMessage RoleTypeSelect()
+ {
+ try
+ {
+ mes = BasicSettingBLL.RoleTypeSelect();
+ }
+ catch (Exception e)
+ {
+ mes.code = "300";
+ mes.Message = e.Message;
+ }
return TJson.toJson(mes);
}
#endregion
@@ -407,6 +439,22 @@
}
#endregion
+ #region[瑙掕壊娓呭崟鍏宠仈鐢ㄦ埛鏌ヨ1]
+ /// <summary>
+ /// 瑙掕壊娓呭崟鍏宠仈鐢ㄦ埛鏌ヨ1
+ /// </summary>
+ /// <param name="rolecode">瑙掕壊缂栫爜</param>
+ /// <returns></returns>
+ [Route(template: "RoleAssociationUserTwo")]
+ [HttpGet]
+ [HiddenApi]
+ public HttpResponseMessage RoleAssociationUserTwo(string rolecode = null)
+ {
+ mes = BasicSettingBLL.RoleAssociationUserTwo(rolecode);
+ return TJson.toJson(mes);
+ }
+ #endregion
+
#region[瑙掕壊娓呭崟鍏宠仈鐢ㄦ埛淇濆瓨]
/// <summary>
/// 瑙掕壊娓呭崟鍏宠仈鐢ㄦ埛淇濆瓨
@@ -414,28 +462,28 @@
/// <param name="rolecode">瑙掕壊缂栫爜</param>
/// <param name="json">鎻愪氦鏁版嵁瀵硅薄</param>
/// <returns></returns>
- [Route(template: "SaveUserAssoctRole")]
+ [Route(template: "SaveRoleAssoctUser")]
[HttpPost]
- public HttpResponseMessage SaveRoleAssociationUser(string rolecode, List<ObjectData> json)
+ public HttpResponseMessage SaveRoleAssoctUser(string rolecode, List<ObjectData> json)
{
//JavaScriptSerializer Serializer = new JavaScriptSerializer();
//List<RoleUserSubmit> objs = new List<RoleUserSubmit>();
//objs = Serializer.Deserialize<List<RoleUserSubmit>>(json);
- mes = BasicSettingBLL.SaveRoleAssociationUser(rolecode, json);
+ mes = BasicSettingBLL.SaveRoleAssoctUser(rolecode, json);
return TJson.toJson(mes);
}
#endregion
#region[瑙掕壊娓呭崟鍏宠仈鍔熻兘鏌ヨ]
/// <summary>
- /// 鐢ㄦ埛娓呭崟鍏宠仈鍔熻兘鏌ヨ
+ /// 瑙掕壊娓呭崟鍏宠仈鍔熻兘鏌ヨ
/// </summary>
/// <param name="rolecode">瑙掕壊缂栫爜</param>
/// <param name="type">鎿嶄綔绔垎绫荤紪鐮�</param>
/// <returns></returns>
[Route(template: "RoleAssociationRight")]
[HttpGet]
- public HttpResponseMessage RoleAssociationRight(string rolecode,string type)
+ public HttpResponseMessage RoleAssociationRight(string rolecode,string type=null)
{
mes = BasicSettingBLL.RoleAssociationRight(rolecode,type);
return TJson.toJson(mes);
@@ -459,5 +507,71 @@
}
#endregion
+
+
+ #region[寰�鏉ュ崟浣嶆煡璇
+ /// <summary>
+ /// 寰�鏉ュ崟浣嶆煡璇�
+ /// </summary>
+ /// <param name="CuntUnitCode">寰�鏉ュ崟浣嶇紪鐮�</param>
+ /// <param name="CuntUnitName">寰�鏉ュ崟浣嶅悕绉�</param>
+ /// <param name="UnitAttr">鍗曚綅灞炴��</param>
+ /// <param name="CreateUser">鍒涘缓浜哄憳</param>
+ /// <param name="page">椤电爜</param>
+ /// <param name="rows">姣忛〉鏄剧ず鏉℃暟</param>
+ /// <param name="prop">鎺掑簭瀛楁</param>
+ /// <param name="order">鎺掑簭瑙勫垯</param>
+ /// <returns></returns>
+ [Route(template: "CurrentUnitSearch")]
+ [HttpGet]
+ public HttpResponseMessage CurrentUnitSearch(string CuntUnitCode = null, string CuntUnitName = null, string UnitAttr = 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 = BasicSettingBLL.CurrentUnitSearch(CuntUnitCode, CuntUnitName, UnitAttr, CreateUser, startNum, endNum, prop, order);
+ return TJson.toJson(mes);
+ }
+ #endregion
+
+ #region[寰�鏉ュ崟浣嶆柊澧炵紪杈慮
+ /// <summary>
+ /// 寰�鏉ュ崟浣嶆柊澧炵紪杈�
+ /// </summary>
+ /// <param name="obj">鎻愪氦鏁版嵁瀵硅薄</param>
+ /// <returns></returns>
+ [Route(template: "AddUpdateCurrentUnit")]
+ [HttpPost]
+ public HttpResponseMessage AddUpdateCurrentUnit([FromBody] JObject obj)
+ {
+ string unitid = obj["id"].ToString(); //寰�鏉ュ崟浣峣d(涓婚敭)
+ string unitcode = obj["unitcode"].ToString(); //寰�鏉ュ崟浣嶇紪鐮佺紪鐮�
+ string unitname = obj["unitname"].ToString(); //寰�鏉ュ崟浣嶅悕绉�
+ string mtypecode = obj["mtypecode"].ToString(); //澶栬喘渚涙柟缂栫爜
+ string btypecode = obj["btypecode"].ToString(); //澶栧崗渚涙柟缂栫爜
+ string htypecode = obj["htypecode"].ToString(); //瀹㈡埛缂栫爜
+ string person = obj["person"].ToString(); //鑱旂郴浜�
+ string contact = obj["contact"].ToString(); //鑱旂郴鏂瑰紡
+ string description = obj["description"].ToString(); //琛ュ厖鎻忚堪
+ var usercode = "Admin";//HttpContext.Current.Request.Cookies["admin"].Value.ToString();
+ string OperType = obj["OperType"].ToString(); //鎿嶄綔绫诲瀷
+ mes = BasicSettingBLL.AddUpdateCurrentUnit(unitid, unitcode, unitname, mtypecode, btypecode,htypecode, person, contact, description, usercode, OperType);
+ return TJson.toJson(mes);
+ }
+ #endregion
+
+ #region[寰�鏉ュ崟浣嶅垹闄
+ /// <summary>
+ /// 寰�鏉ュ崟浣嶅垹闄�
+ /// </summary>
+ /// <param name="unitid">寰�鏉ュ崟浣岻D</param>
+ /// <returns></returns>
+ [Route(template: "DeleteCurrentUnit")]
+ [HttpPost]
+ public HttpResponseMessage DeleteCurrentUnit(string unitid)
+ {
+ mes = BasicSettingBLL.DeleteCurrentUnit(unitid);
+ return TJson.toJson(mes);
+ }
+ #endregion
}
}
\ No newline at end of file
--
Gitblit v1.9.3