| | |
| | | private readonly IOperationSysServer _operation; //操作日志 |
| | | private readonly IExceptionServer _table; //异常处理 |
| | | private readonly IHeaderSettingsServer _headerSet;//表头设置 |
| | | private readonly IPrintTemplateServer _template;//打印模板 |
| | | /// <summary> |
| | | /// 构造函数 |
| | | /// </summary> |
| | |
| | | /// <param name="dic">数据字典</param> |
| | | /// <param name="operation">操作日志</param> |
| | | /// <param name="table">异常处理</param> |
| | | public SysController(IWareHouseServer wareHouseSvc, IStorageAreaServer areaSvc, IStorageRoadwayServer roadwaySvc, IStorageLocatServer locatSvc, IPalletsServer palletSvc, IPalletTrackServer palletTrackSvc, IMenuServer menuSvc, IDictionaryServer dic, IOperationSysServer operation, IExceptionServer table, IHeaderSettingsServer headerSet) |
| | | public SysController(IWareHouseServer wareHouseSvc, IStorageAreaServer areaSvc, IStorageRoadwayServer roadwaySvc, IStorageLocatServer locatSvc, IPalletsServer palletSvc, IPalletTrackServer palletTrackSvc, IMenuServer menuSvc, IDictionaryServer dic, IOperationSysServer operation, IExceptionServer table, IHeaderSettingsServer headerSet, IPrintTemplateServer template) |
| | | { |
| | | _wareHouseSvc = wareHouseSvc; //仓库 |
| | | _areaSvc = areaSvc; //区域 |
| | |
| | | _table = table; //异常处理 |
| | | |
| | | _headerSet = headerSet;//表头设置 |
| | | _template = template;//打印模板 |
| | | } |
| | | |
| | | #region 菜单管理 |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return Ok(new { data = "", code = 3, msg = "新增菜单信息异常:"+ ex.Message }); |
| | | return Ok(new { data = "", code = 3, msg = "新增菜单信息异常:" + ex.Message }); |
| | | } |
| | | |
| | | } |
| | |
| | | { |
| | | _operation.InsertOperation("仓库设置", "储位管理", storage.LocatNo, "修改", "修改储位信息 储位号:" + storage.LocatNo, Convert.ToInt32(userId)); |
| | | } |
| | | |
| | | |
| | | return Ok(new { code = 0, msg = "编辑成功", data = "" }); |
| | | } |
| | | else |
| | |
| | | int uid = Convert.ToInt32(userId); |
| | | //更改人 |
| | | tabledto.UpdateUser = uid; |
| | | string strMesage = _table.EditStatus(tabledto); |
| | | string strMesage = _table.EditStatus(tabledto); |
| | | if (strMesage == "") |
| | | { |
| | | return Ok(new { code = 0, msg = "处理成功" }); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return Ok(new { code = 1, msg = strMesage }); |
| | |
| | | /// <param name="row">排</param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | public IActionResult GetStorageLocatLists(string wareHouseNo, string roadway,string row) |
| | | public IActionResult GetStorageLocatLists(string wareHouseNo, string roadway, string row) |
| | | { |
| | | //获取储位信息 |
| | | List<SysStorageLocat> storagelist = _locatSvc.GetStorageLocatLists(wareHouseNo, roadway, row); |
| | |
| | | [HttpGet] |
| | | public IActionResult GetStorageProportion1(string wareHouseNo, string roadwayNo) |
| | | { |
| | | List<GetLocateVm> getLocateVms = _locatSvc.GetStorageProportion1(wareHouseNo,roadwayNo); |
| | | List<GetLocateVm> getLocateVms = _locatSvc.GetStorageProportion1(wareHouseNo, roadwayNo); |
| | | return Ok(new |
| | | { |
| | | data = getLocateVms, |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region 打印模板 |
| | | |
| | | /// <summary> |
| | | /// 获取打印模板 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | public async Task<IActionResult> GetPrintTemplateList([FromQuery] PrintTemplateVm model) |
| | | { |
| | | try |
| | | { |
| | | RefAsync<int> count = new RefAsync<int>(0); |
| | | var list = await _template.GetPrintTemplateList(model, count); |
| | | return Ok(new { code = 0, count = count.Value, msg = "打印模板", data = list }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 获取默认打印模板 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | public async Task<IActionResult> GetDefaultPrintTemplate([FromQuery] string type = "1") |
| | | { |
| | | try |
| | | { |
| | | var data = await _template.GetDefaultPrintTemplate(type); |
| | | return Ok(new { code = 0, msg = "打印模板", data = data }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 添加打印模板 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public async Task<IActionResult> AddPrintTemplate(SysPrintTemplate model) |
| | | { |
| | | try |
| | | { |
| | | //获取当前登录的用户ID |
| | | var claimsIdentity = this.User.Identity as ClaimsIdentity; |
| | | if (claimsIdentity == null) |
| | | { |
| | | return Ok(new { code = 1, msg = "为获取到当前操作人信息" }); |
| | | } |
| | | var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value; |
| | | if (string.IsNullOrWhiteSpace(userId)) |
| | | { |
| | | return Ok(new { code = 1, msg = "为获取到当前操作人信息" }); |
| | | } |
| | | await _template.AddPrintTemplate(model, int.Parse(userId)); |
| | | return Ok(new { code = 0, msg = "添加成功", data = "" }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 修改打印模板 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public async Task<IActionResult> EditPrintTemplate(SysPrintTemplate model) |
| | | { |
| | | try |
| | | { |
| | | //获取当前登录的用户ID |
| | | var claimsIdentity = this.User.Identity as ClaimsIdentity; |
| | | if (claimsIdentity == null) |
| | | { |
| | | return Ok(new { code = 1, msg = "未获取到当前操作人信息" }); |
| | | } |
| | | var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value; |
| | | if (string.IsNullOrWhiteSpace(userId)) |
| | | { |
| | | return Ok(new { code = 1, msg = "未获取到当前操作人信息" }); |
| | | } |
| | | await _template.EditPrintTemplate(model, int.Parse(userId)); |
| | | return Ok(new { code = 0, msg = "修改成功", data = "" }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 删除打印模板 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public async Task<IActionResult> DelPrintTemplate(SysPrintTemplate model) |
| | | { |
| | | try |
| | | { |
| | | //获取当前登录的用户ID |
| | | var claimsIdentity = this.User.Identity as ClaimsIdentity; |
| | | if (claimsIdentity == null) |
| | | { |
| | | return Ok(new { code = 1, msg = "为获取到当前操作人信息" }); |
| | | } |
| | | var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value; |
| | | if (string.IsNullOrWhiteSpace(userId)) |
| | | { |
| | | return Ok(new { code = 1, msg = "为获取到当前操作人信息" }); |
| | | } |
| | | await _template.DelPrintTemplate(model, int.Parse(userId)); |
| | | return Ok(new { code = 0, msg = "添加成功", data = "" }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 数据表格表头自定义(通用方法) |
| | | /// <summary> |