|
@@ -1822,13 +1822,10 @@ namespace OASystem.API.Controllers
|
|
|
/// 物品 详情
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- [HttpGet("id")]
|
|
|
+ [HttpGet()]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> GoodsInfo(int portType, int id)
|
|
|
{
|
|
|
- //var _currUserInfo = JwtHelper.SerializeJwt(HttpContext.Request.Headers.Authorization);
|
|
|
- //if (_currUserInfo == null) return Ok(JsonView(false, "请传入token!"));
|
|
|
-
|
|
|
if (portType > 1 || portType > 3) return Ok(JsonView(false, MsgTips.Port));
|
|
|
if (id < 1) return Ok(JsonView(false, MsgTips.Id));
|
|
|
|
|
@@ -1863,12 +1860,14 @@ namespace OASystem.API.Controllers
|
|
|
/// <returns></returns>
|
|
|
[HttpDelete("{id}")]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> GoodsDel(int id,[FromQuery] int currUserId)
|
|
|
+ public async Task<IActionResult> GoodsDel(int id)
|
|
|
{
|
|
|
if (id < 1) return Ok(JsonView(false, MsgTips.Id));
|
|
|
- if (currUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
|
|
|
|
|
|
- return Ok(await _goodsRep.GoodsDel(id,currUserId));
|
|
|
+ var _currUserInfo = JwtHelper.SerializeJwt(HttpContext.Request.Headers.Authorization);
|
|
|
+ if (_currUserInfo == null) return Ok(JsonView(false, "请传入token!"));
|
|
|
+
|
|
|
+ return Ok(await _goodsRep.GoodsDel(id, _currUserInfo.UserId));
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -1891,14 +1890,14 @@ namespace OASystem.API.Controllers
|
|
|
/// 入库 详情
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- [HttpGet]
|
|
|
+ [HttpGet("{id}")]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> GoodsStorageInfo(int portType, int id)
|
|
|
+ public async Task<IActionResult> GoodsStorageInfo([FromQuery] int portType, int id)
|
|
|
{
|
|
|
if (portType > 1 || portType > 3) return Ok(JsonView(false, MsgTips.Port));
|
|
|
if (id < 1) return Ok(JsonView(false, MsgTips.Id));
|
|
|
|
|
|
- return Ok(await _goodsRep.GoodsStorageInfo(portType,id));
|
|
|
+ return Ok(await _goodsRep.GoodsStorageInfo(portType, id));
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -1910,6 +1909,9 @@ namespace OASystem.API.Controllers
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> GoodsStorageOP(GoodsStorageOPDTO _dto)
|
|
|
{
|
|
|
+ var _currUserInfo = JwtHelper.SerializeJwt(HttpContext.Request.Headers.Authorization);
|
|
|
+ if (_currUserInfo == null) return Ok(JsonView(false, "请传入token!"));
|
|
|
+
|
|
|
var vadalitor = new GoodsStorageOPDTOValidator();
|
|
|
var vadalitorRes = await vadalitor.ValidateAsync(_dto);
|
|
|
if (!vadalitorRes.IsValid)
|
|
@@ -1919,7 +1921,7 @@ namespace OASystem.API.Controllers
|
|
|
return Ok(JsonView(false, sb.ToString()));
|
|
|
}
|
|
|
|
|
|
- return Ok(await _goodsRep.GoodsStorageOP(_dto));
|
|
|
+ return Ok(await _goodsRep.GoodsStorageOP(_dto, _currUserInfo.UserId));
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -1929,12 +1931,14 @@ namespace OASystem.API.Controllers
|
|
|
/// <returns></returns>
|
|
|
[HttpDelete("{id}")]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> GoodsStorageDel(int id, [FromQuery] int currUserId)
|
|
|
+ public async Task<IActionResult> GoodsStorageDel(int id)
|
|
|
{
|
|
|
+ var _currUserInfo = JwtHelper.SerializeJwt(HttpContext.Request.Headers.Authorization);
|
|
|
+ if (_currUserInfo == null) return Ok(JsonView(false, "请传入token!"));
|
|
|
+
|
|
|
if (id < 1) return Ok(JsonView(false, MsgTips.Id));
|
|
|
- if (currUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
|
|
|
|
|
|
- return Ok(await _goodsRep.GoodsStorageDel(id,currUserId));
|
|
|
+ return Ok(await _goodsRep.GoodsStorageDel(id, _currUserInfo.UserId));
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -1957,9 +1961,9 @@ namespace OASystem.API.Controllers
|
|
|
/// 领用详情
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- [HttpGet]
|
|
|
+ [HttpGet("{id}")]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> GoodsReceiveInfo(int portType, int id)
|
|
|
+ public async Task<IActionResult> GoodsReceiveInfo([FromQuery]int portType, int id)
|
|
|
{
|
|
|
if (portType > 1 || portType > 3) return Ok(JsonView(false, MsgTips.Port));
|
|
|
if (id < 1) return Ok(JsonView(false, MsgTips.Id));
|
|
@@ -1976,6 +1980,9 @@ namespace OASystem.API.Controllers
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> GoodsReceiveOP(GoodsReceiveOPDTO _dto)
|
|
|
{
|
|
|
+ var _currUserInfo = JwtHelper.SerializeJwt(HttpContext.Request.Headers.Authorization);
|
|
|
+ if (_currUserInfo == null) return Ok(JsonView(false, "请传入token!"));
|
|
|
+
|
|
|
var vadalitor = new GoodsReceiveOPDTOValidator();
|
|
|
var vadalitorRes = await vadalitor.ValidateAsync(_dto);
|
|
|
if (!vadalitorRes.IsValid)
|
|
@@ -1985,7 +1992,7 @@ namespace OASystem.API.Controllers
|
|
|
return Ok(JsonView(false, sb.ToString()));
|
|
|
}
|
|
|
|
|
|
- return Ok(await _goodsRep.GoodsReceiveOP(_dto));
|
|
|
+ return Ok(await _goodsRep.GoodsReceiveOP(_dto, _currUserInfo.UserId));
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -1998,6 +2005,9 @@ namespace OASystem.API.Controllers
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> GoodsReceiveAudit(GoodsReceiveAuditDTO _dto)
|
|
|
{
|
|
|
+ var _currUserInfo = JwtHelper.SerializeJwt(HttpContext.Request.Headers.Authorization);
|
|
|
+ if (_currUserInfo == null) return Ok(JsonView(false, "请传入token!"));
|
|
|
+
|
|
|
var vadalitor = new GoodsReceiveAuditDTOValidator();
|
|
|
var vadalitorRes = await vadalitor.ValidateAsync(_dto);
|
|
|
if (!vadalitorRes.IsValid)
|
|
@@ -2015,7 +2025,7 @@ namespace OASystem.API.Controllers
|
|
|
else return id;
|
|
|
})
|
|
|
.ToArray();
|
|
|
- return Ok(await _goodsRep.GoodsReceiveAudit(idArray,_dto.CurrUserId,_dto.AuditEnum));
|
|
|
+ return Ok(await _goodsRep.GoodsReceiveAudit(idArray, _currUserInfo.UserId, _dto.AuditEnum));
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -2025,12 +2035,14 @@ namespace OASystem.API.Controllers
|
|
|
/// <returns></returns>
|
|
|
[HttpDelete("{id}")]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> GoodsReceiveDel(int id, [FromQuery] int currUserId)
|
|
|
+ public async Task<IActionResult> GoodsReceiveDel(int id)
|
|
|
{
|
|
|
+ var _currUserInfo = JwtHelper.SerializeJwt(HttpContext.Request.Headers.Authorization);
|
|
|
+ if (_currUserInfo == null) return Ok(JsonView(false, "请传入token!"));
|
|
|
+
|
|
|
if (id < 1) return Ok(JsonView(false, MsgTips.Id));
|
|
|
- if (currUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
|
|
|
|
|
|
- return Ok(await _goodsRep.GoodsReceiveDel(id, currUserId));
|
|
|
+ return Ok(await _goodsRep.GoodsReceiveDel(id, _currUserInfo.UserId));
|
|
|
}
|
|
|
#endregion
|
|
|
}
|