From 0c7e6deb5e426a53ce095ddff808168c26215d83 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期五, 20 六月 2025 12:55:40 +0800
Subject: [PATCH] 提交
---
zhengcaioa/zhengcaioa/Controllers/admin/AdmGoodsManageController.cs | 90 +++++++++++++++++++++++++++++++++++++++-----
1 files changed, 79 insertions(+), 11 deletions(-)
diff --git a/zhengcaioa/zhengcaioa/Controllers/admin/AdmGoodsManageController.cs b/zhengcaioa/zhengcaioa/Controllers/admin/AdmGoodsManageController.cs
index 5fbfaaf..307b08a 100644
--- a/zhengcaioa/zhengcaioa/Controllers/admin/AdmGoodsManageController.cs
+++ b/zhengcaioa/zhengcaioa/Controllers/admin/AdmGoodsManageController.cs
@@ -29,15 +29,19 @@
private readonly IAdmGoodsManageService _admGoodsManageService;
private readonly IAdmGoodsClassifyService _admGoodsClassifyService;
private readonly IPltPageService _pltPageService;
+ private readonly IAdmGoodsRecordService _admGoodsRecordService;
- public AdmGoodsManageController(ILogger<AdmGoodsManageController> logger, ILiaotianService liaotianService, IAdmGoodsManageService admGoodsManageService, IAdmGoodsClassifyService admGoodsClassifyService, IPltPageService pltPageService)
+
+ public AdmGoodsManageController(ILogger<AdmGoodsManageController> logger, ILiaotianService liaotianService, IAdmGoodsManageService admGoodsManageService, IAdmGoodsClassifyService admGoodsClassifyService, IPltPageService pltPageService
+ , IAdmGoodsRecordService admGoodsRecordService)
{
_logger = logger;
_liaotianService = liaotianService;
_admGoodsManageService = admGoodsManageService;
_admGoodsClassifyService = admGoodsClassifyService;
_pltPageService = pltPageService;
+ _admGoodsRecordService = admGoodsRecordService;
}
@@ -55,8 +59,8 @@
actionlist.Add(actionEntity);
List<PageEntity> pageEntities = _pltPageService.GetUserPage(curentuser.Id, "/AdmGoodsManage/Index/");
-
- foreach (var pageEntity in pageEntities )
+ var pageEntities1 = pageEntities.Where(x => x.PageMethod == "01").ToList();
+ foreach (var pageEntity in pageEntities1)
{
ActionEntity actionEntity1 = new ActionEntity();
actionEntity1.OpenType = pageEntity.OpenType;
@@ -99,11 +103,11 @@
ViewData["ActionInfo"] = actionlist;
-
+ ViewData["ActionInfo2"] = pageEntities1;
ViewBag.GoodsStatus = _liaotianService.GetSYScode("adm_goods_manage", "goods_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
- ViewBag.Goods = _admGoodsManageService.GetList().Select(x => new { code = x.Id, label = x.GoodsName }).ToList();
+ ViewBag.Goods = _admGoodsManageService.GetList().Select(x => new { code = x.Id, label = (x.GoodsName.Length>15? x.GoodsName.Substring(0, 15) : x.GoodsName) }).ToList();
ViewBag.ClassifyId = _admGoodsClassifyService.GetList().Select(x => new { code = x.Id, label = x.ClassifyName }).ToList();
@@ -153,19 +157,22 @@
return new JsonResult(_admGoodsManageService.SearchByPaging(search));
}
- public IActionResult Edit(string id = null)
+ public IActionResult Edit(string id = null,string ClassifyIds = "")
{
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
ViewData["curentuser"] = curentuser;
+ var pageEntities = _pltPageService.GetUserPage(curentuser.Id, "/AdmGoodsManage/Index/");
+ var pageEntities2 = pageEntities.Where(x => x.PageMethod == "02").ToList();
+ ViewData["ActionInfo2"] = pageEntities2;
AdmGoodsManageDTO dto = new AdmGoodsManageDTO();
if (!String.IsNullOrEmpty(id))
{
dto = _admGoodsManageService.Get(id);
}
-
+ ViewBag.ClassifyIds = ClassifyIds;
@@ -175,7 +182,7 @@
ViewBag.GoodsStatus = _liaotianService.GetSYScode("adm_goods_manage", "goods_status");
-
+ ViewBag.shifou = _liaotianService.GetSYScode("system", "shifou");
@@ -219,13 +226,17 @@
- public IActionResult Chuku()
+ public IActionResult Chuku(string id = null)
{
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
ViewData["curentuser"] = curentuser;
AdmGoodsManageDTO dto = new AdmGoodsManageDTO();
-
+ if (!String.IsNullOrEmpty(id))
+ {
+ dto = _admGoodsManageService.Get(id);
+ }
+
ViewBag.ClassifyId = _admGoodsClassifyService.GetList();
ViewBag.Goods = _admGoodsManageService.GetList().Where(x => x.GoodsStatus == "A").ToList();
@@ -264,6 +275,19 @@
}
+ AdmGoodsRecordDTO dto = new AdmGoodsRecordDTO();
+ dto.GoodsId = savedata.Id;
+ dto.GoodsNum = data.GoodsCaozuo;
+ dto.GoodsLeft = savedata.GoodsLeft;
+ dto.RecordTypeId = "02";
+ dto.RecStatus = "A";
+ dto.Creater = curentuser.Id;
+ dto.Createtime = DateTime.Now;
+ dto.Modifier = curentuser.Id;
+ dto.Modifytime = DateTime.Now;
+ dto.OperationalMatters = curentuser.UserName + "锛氬嚭搴�";
+ resultEntity = _admGoodsRecordService.save(dto);
+
data.Modifier = curentuser.Id;
@@ -280,12 +304,16 @@
- public IActionResult Ruku()
+ public IActionResult Ruku(string id=null)
{
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
ViewData["curentuser"] = curentuser;
AdmGoodsManageDTO dto = new AdmGoodsManageDTO();
+ if (!String.IsNullOrEmpty(id))
+ {
+ dto = _admGoodsManageService.Get(id);
+ }
ViewBag.ClassifyId = _admGoodsClassifyService.GetList();
@@ -331,6 +359,18 @@
savedata.GoodsLeft = data.GoodsCaozuo;
}
+ AdmGoodsRecordDTO dto = new AdmGoodsRecordDTO();
+ dto.GoodsId = savedata.Id;
+ dto.GoodsNum = data.GoodsCaozuo;
+ dto.GoodsLeft = savedata.GoodsLeft;
+ dto.RecordTypeId = "01";
+ dto.RecStatus = "A";
+ dto.Creater = curentuser.Id;
+ dto.Createtime = DateTime.Now;
+ dto.Modifier = curentuser.Id;
+ dto.Modifytime = DateTime.Now;
+ dto.OperationalMatters = curentuser.UserName+"锛氬叆搴�";
+ resultEntity = _admGoodsRecordService.save(dto);
@@ -358,5 +398,33 @@
ViewData["curentuser"] = curentuser;
return new JsonResult(_admGoodsManageService.ModifyStatus(Id, curentuser.Id));
}
+
+
+ public IActionResult Liushuizhang(string id)
+ {
+ var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
+ ViewData["curentuser"] = curentuser;
+ List<ActionEntity> actionlist = new List<ActionEntity>();
+ ActionEntity actionEntity = new ActionEntity();
+ actionEntity.OpenType = 0;
+ actionEntity.ActionUrl = "";
+ actionEntity.ActionFun = "Search";
+ actionEntity.PageIco = "fa fa-search";
+ actionEntity.ActionName = "鏌ヨ";
+ actionlist.Add(actionEntity);
+
+ ViewData["ActionInfo"] = actionlist;
+ ViewBag.RecordTypeId = _liaotianService.GetSYScode("adm_goods_record", "RecordTypeId").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
+ ViewBag.id = id;
+ return View();
+ }
+
+
+ public IActionResult GetListLiushuizhang(AdmGoodsRecordDTOSearch search)
+ {
+ var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
+ ViewData["curentuser"] = curentuser;
+ return new JsonResult(_admGoodsRecordService.SearchByPaging(search));
+ }
}
}
--
Gitblit v1.9.1