Merge branch 'v1.0.5' of https://codeup.aliyun.com/62ce7bca487c500c27f70a79/OPS/WMS-Api into v1.0.5
This commit is contained in:
132
src/WMS.Web.Api/Controllers/SubscribeNotificationController.cs
Normal file
132
src/WMS.Web.Api/Controllers/SubscribeNotificationController.cs
Normal file
@@ -0,0 +1,132 @@
|
||||
using AutoMapper;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using WMS.Web.Core.Dto;
|
||||
using WMS.Web.Core.Dto.SubscribeNotification;
|
||||
using WMS.Web.Core.Internal.Results;
|
||||
using WMS.Web.Domain.Entitys;
|
||||
using WMS.Web.Domain.Infrastructure;
|
||||
using WMS.Web.Domain.IService.Public;
|
||||
using WMS.Web.Domain.Values;
|
||||
|
||||
namespace WMS.Web.Api.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 订阅通知
|
||||
/// </summary>
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class SubscribeNotificationController : ControllerBase
|
||||
{
|
||||
private readonly IMapper _mapper;
|
||||
private readonly ILoginService _loginService;
|
||||
private readonly ISubscribeNotificationRepositories _repositories;
|
||||
public SubscribeNotificationController(IMapper mapper, ILoginService loginService, ISubscribeNotificationRepositories repositories)
|
||||
{
|
||||
_mapper = mapper;
|
||||
_loginService = loginService;
|
||||
_repositories = repositories;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 列表
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("GetList")]
|
||||
public async Task<ResultPagedList<SubscribeNotificationQueryInfoResponse>> GetPagedList([FromBody] SubscribeNotificationQueryRequest dto)
|
||||
{
|
||||
var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]);
|
||||
if (loginInfo == null || loginInfo.UserInfo == null)
|
||||
return ResultPagedList<SubscribeNotificationQueryInfoResponse>.ReFailure(ResultCodes.Token_Invalid_Error);
|
||||
|
||||
var (list, count) = await _repositories.GetListAsync(dto);
|
||||
var result = ResultPagedList<SubscribeNotificationQueryInfoResponse>.ReSuccess(list, count);
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 新增
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("Save")]
|
||||
public async Task<Result> Save(SaveSubscribeNotificationRequest dto)
|
||||
{
|
||||
var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]);
|
||||
if (loginInfo == null || loginInfo.UserInfo == null)
|
||||
return Result.ReFailure(ResultCodes.Token_Invalid_Error);
|
||||
|
||||
//新增
|
||||
var isExist = await _repositories.IsExist(dto.CustomerName, dto.CustomerNumber);
|
||||
if (isExist) return Result.ReFailure($"客户名称:{dto.CustomerName} 客户编码:{dto.CustomerName} 已经存在,无需再次添加!", 700000);
|
||||
|
||||
var entity = _mapper.Map<SubscribeNotification>(dto);
|
||||
entity.Create(loginInfo.UserInfo.StaffId);
|
||||
var res = await _repositories.Add(entity, true);
|
||||
|
||||
if (res == null) Result.ReFailure(ResultCodes.DateWriteError);
|
||||
return Result.ReSuccess();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("Edit")]
|
||||
public async Task<Result> Edit(EditSubscribeNotificationRequest dto)
|
||||
{
|
||||
var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]);
|
||||
if (loginInfo == null || loginInfo.UserInfo == null)
|
||||
return Result.ReFailure(ResultCodes.Token_Invalid_Error);
|
||||
|
||||
var entity = await _repositories.Get(dto.Id);
|
||||
if (entity == null)
|
||||
return Result.ReFailure(ResultCodes.SubscribeNotificationNoData);
|
||||
//修改
|
||||
//修改了名字或者编码后 验重
|
||||
if (entity.CustomerName != dto.CustomerName || entity.CustomerNumber != dto.CustomerNumber)
|
||||
{
|
||||
var isExist = await _repositories.IsExist(dto.CustomerName, dto.CustomerNumber);
|
||||
if (isExist) return Result.ReFailure($"客户名称:{dto.CustomerName} 客户编码:{dto.CustomerName} 已经存在,无需再次添加!", 700000);
|
||||
}
|
||||
_mapper.Map(dto, entity);
|
||||
entity.Edit(loginInfo.UserInfo.StaffId);
|
||||
var res = await _repositories.Edit(entity, true);
|
||||
|
||||
if (res == null) Result.ReFailure(ResultCodes.DateWriteError);
|
||||
return Result.ReSuccess();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("Delete")]
|
||||
public async Task<Result> Sync(OperateRequest dto)
|
||||
{
|
||||
var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]);
|
||||
if (loginInfo == null || loginInfo.UserInfo == null)
|
||||
return Result.ReFailure(ResultCodes.Token_Invalid_Error);
|
||||
|
||||
var list = await _repositories.GetList(dto.Ids);
|
||||
foreach (var e in list)
|
||||
{
|
||||
e.Delete(loginInfo.UserInfo.StaffId);
|
||||
}
|
||||
var res = await _repositories.EditList(list, true);
|
||||
|
||||
if (!res) Result.ReFailure(ResultCodes.DateWriteError);
|
||||
return Result.ReSuccess();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -506,6 +506,39 @@
|
||||
<param name="serialNumber">序列号</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Api.Controllers.SubscribeNotificationController">
|
||||
<summary>
|
||||
订阅通知
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Api.Controllers.SubscribeNotificationController.GetPagedList(WMS.Web.Core.Dto.SubscribeNotification.SubscribeNotificationQueryRequest)">
|
||||
<summary>
|
||||
列表
|
||||
</summary>
|
||||
<param name="dto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Api.Controllers.SubscribeNotificationController.Save(WMS.Web.Core.Dto.SubscribeNotification.SaveSubscribeNotificationRequest)">
|
||||
<summary>
|
||||
新增
|
||||
</summary>
|
||||
<param name="dto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Api.Controllers.SubscribeNotificationController.Edit(WMS.Web.Core.Dto.SubscribeNotification.EditSubscribeNotificationRequest)">
|
||||
<summary>
|
||||
修改
|
||||
</summary>
|
||||
<param name="dto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Api.Controllers.SubscribeNotificationController.Sync(WMS.Web.Core.Dto.OperateRequest)">
|
||||
<summary>
|
||||
删除
|
||||
</summary>
|
||||
<param name="dto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Api.Controllers.SysConfigController">
|
||||
<summary>
|
||||
系统配置
|
||||
|
||||
@@ -5238,6 +5238,141 @@
|
||||
编码
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Core.Dto.SubscribeNotification.EditSubscribeNotificationRequest">
|
||||
<summary>
|
||||
修改
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.SubscribeNotification.EditSubscribeNotificationRequest.Id">
|
||||
<summary>
|
||||
主键
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.SubscribeNotification.EditSubscribeNotificationRequest.CustomerName">
|
||||
<summary>
|
||||
客户名称
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.SubscribeNotification.EditSubscribeNotificationRequest.CustomerNumber">
|
||||
<summary>
|
||||
客户编码
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.SubscribeNotification.EditSubscribeNotificationRequest.Telephones">
|
||||
<summary>
|
||||
电话
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.SubscribeNotification.EditSubscribeNotificationRequest.Emails">
|
||||
<summary>
|
||||
邮件
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Core.Dto.SubscribeNotification.SaveSubscribeNotificationRequest">
|
||||
<summary>
|
||||
新增编辑订阅通知
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.SubscribeNotification.SaveSubscribeNotificationRequest.CustomerName">
|
||||
<summary>
|
||||
客户名称
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.SubscribeNotification.SaveSubscribeNotificationRequest.CustomerNumber">
|
||||
<summary>
|
||||
客户编码
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.SubscribeNotification.SaveSubscribeNotificationRequest.Telephones">
|
||||
<summary>
|
||||
电话
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.SubscribeNotification.SaveSubscribeNotificationRequest.Emails">
|
||||
<summary>
|
||||
邮件
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Core.Dto.SubscribeNotification.SubscribeNotificationQueryInfoResponse">
|
||||
<summary>
|
||||
订阅通知列表
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.SubscribeNotification.SubscribeNotificationQueryInfoResponse.Id">
|
||||
<summary>
|
||||
主键
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.SubscribeNotification.SubscribeNotificationQueryInfoResponse.CustomerName">
|
||||
<summary>
|
||||
客户名称
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.SubscribeNotification.SubscribeNotificationQueryInfoResponse.CustomerNumber">
|
||||
<summary>
|
||||
客户编码
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.SubscribeNotification.SubscribeNotificationQueryInfoResponse.Telephones">
|
||||
<summary>
|
||||
电话
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.SubscribeNotification.SubscribeNotificationQueryInfoResponse.Emails">
|
||||
<summary>
|
||||
邮件
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.SubscribeNotification.SubscribeNotificationQueryInfoResponse.Creator">
|
||||
<summary>
|
||||
创建人
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.SubscribeNotification.SubscribeNotificationQueryInfoResponse.Operate">
|
||||
<summary>
|
||||
操作人
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.SubscribeNotification.SubscribeNotificationQueryInfoResponse.CreateTime">
|
||||
<summary>
|
||||
创建时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.SubscribeNotification.SubscribeNotificationQueryInfoResponse.OperateTime">
|
||||
<summary>
|
||||
操作时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Core.Dto.SubscribeNotification.SubscribeNotificationQueryRequest">
|
||||
<summary>
|
||||
订阅通知列表
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.SubscribeNotification.SubscribeNotificationQueryRequest.CustomerName">
|
||||
<summary>
|
||||
客户名称
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.SubscribeNotification.SubscribeNotificationQueryRequest.CustomerNumber">
|
||||
<summary>
|
||||
客户编码
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.SubscribeNotification.SubscribeNotificationQueryRequest.Creator">
|
||||
<summary>
|
||||
操作人
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.SubscribeNotification.SubscribeNotificationQueryRequest.OperateBeginDate">
|
||||
<summary>
|
||||
操作时间 开始
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.SubscribeNotification.SubscribeNotificationQueryRequest.OperateEndDate">
|
||||
<summary>
|
||||
操作时间 结束
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Core.Dto.TakeStock.SaveTakeStockRequest">
|
||||
<summary>
|
||||
盘点单明细
|
||||
|
||||
@@ -2062,6 +2062,79 @@
|
||||
</summary>
|
||||
<param name="inStockBillNo">出库单号</param>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Domain.Entitys.SubscribeNotification">
|
||||
<summary>
|
||||
订阅通知信息
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Domain.Entitys.SubscribeNotification.Id">
|
||||
<summary>
|
||||
主键
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Domain.Entitys.SubscribeNotification.CustomerName">
|
||||
<summary>
|
||||
客户名称
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Domain.Entitys.SubscribeNotification.CustomerNumber">
|
||||
<summary>
|
||||
客户编码
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Domain.Entitys.SubscribeNotification.Telephones">
|
||||
<summary>
|
||||
电话
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Domain.Entitys.SubscribeNotification.Emails">
|
||||
<summary>
|
||||
邮件
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Domain.Entitys.SubscribeNotification.IsDelete">
|
||||
<summary>
|
||||
是否删除
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Domain.Entitys.SubscribeNotification.CreatorId">
|
||||
<summary>
|
||||
创建人
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Domain.Entitys.SubscribeNotification.OperateId">
|
||||
<summary>
|
||||
操作人
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Domain.Entitys.SubscribeNotification.CreateTime">
|
||||
<summary>
|
||||
创建时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Domain.Entitys.SubscribeNotification.OperateTime">
|
||||
<summary>
|
||||
操作时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Domain.Entitys.SubscribeNotification.Create(System.Int32)">
|
||||
<summary>
|
||||
新增
|
||||
</summary>
|
||||
<param name="creatorId"></param>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Domain.Entitys.SubscribeNotification.Edit(System.Int32)">
|
||||
<summary>
|
||||
修改
|
||||
</summary>
|
||||
<param name="operateId"></param>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Domain.Entitys.SubscribeNotification.Delete(System.Int32)">
|
||||
<summary>
|
||||
删除
|
||||
</summary>
|
||||
<param name="operateId"></param>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Domain.Entitys.TakeStock">
|
||||
<summary>
|
||||
wms盘点单
|
||||
@@ -2893,6 +2966,33 @@
|
||||
<member name="M:WMS.Web.Domain.Infrastructure.ISerialNumbersRepositories.EditEntityList(System.Collections.Generic.List{WMS.Web.Domain.Entitys.SerialNumbers},System.Boolean)">
|
||||
修改实体集合
|
||||
</member>
|
||||
<member name="T:WMS.Web.Domain.Infrastructure.ISubscribeNotificationRepositories">
|
||||
<summary>
|
||||
订阅通知
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Domain.Infrastructure.ISubscribeNotificationRepositories.IsExist(System.String,System.String)">
|
||||
<summary>
|
||||
根据客户名称和客户编码验重
|
||||
</summary>
|
||||
<param name="name"></param>
|
||||
<param name="number"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Domain.Infrastructure.ISubscribeNotificationRepositories.Get(System.Int32)">
|
||||
<summary>
|
||||
获取订阅通知
|
||||
</summary>
|
||||
<param name="id"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Domain.Infrastructure.ISubscribeNotificationRepositories.GetList(System.Collections.Generic.List{System.Int32})">
|
||||
<summary>
|
||||
获取订阅通知
|
||||
</summary>
|
||||
<param name="ids"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Domain.Infrastructure.ITakeStockRepositories.AddRange(System.Collections.Generic.List{WMS.Web.Domain.Entitys.TakeStock},System.Boolean)">
|
||||
<summary>
|
||||
批量添加
|
||||
@@ -3910,6 +4010,11 @@
|
||||
<param name="destinationList"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Domain.Mappers.SubscribeNotificationMapper">
|
||||
<summary>
|
||||
订阅通知
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Domain.Options.AppOptions.DBConnectionString">
|
||||
<summary>
|
||||
数据库
|
||||
|
||||
Reference in New Issue
Block a user