username@email.com
2021-10-09 f33ece65bdfd7b8354bd5046d4b9d2d600643b0f
zhengcaioa/zhengcaioa/Controllers/admin/AdmGoodsManageController.cs
@@ -29,15 +29,18 @@
        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;
        }
@@ -268,6 +271,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;
@@ -339,6 +355,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);
@@ -366,5 +394,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));
        }
    }
}