|
@@ -109,7 +109,6 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
|
|
|
.OrderByDescending(gi => gi.LastUpdateTime)
|
|
|
.ToPageListAsync(_dto.PageIndex, _dto.PageSize, total);
|
|
|
|
|
|
-
|
|
|
_jv.Code = StatusCodes.Status200OK;
|
|
|
_jv.Data = data;
|
|
|
_jv.Count = total;
|
|
@@ -177,7 +176,7 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
|
|
|
|
|
|
if (_dto.Id > 0) //Edit
|
|
|
{
|
|
|
- var upd = await _sqlSugar.Updateable<Pm_GoodsInfo>(info)
|
|
|
+ var upd = await _sqlSugar.Updateable(info)
|
|
|
.UpdateColumns(x => new
|
|
|
{
|
|
|
x.Name,
|
|
@@ -203,7 +202,7 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
|
|
|
return _jv;
|
|
|
}
|
|
|
|
|
|
- var add = await _sqlSugar.Insertable<Pm_GoodsInfo>(info).ExecuteCommandAsync();
|
|
|
+ var add = await _sqlSugar.Insertable(info).ExecuteCommandAsync();
|
|
|
if (add > 0)
|
|
|
{
|
|
|
_jv.Msg = $"添加成功!";
|
|
@@ -362,7 +361,7 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
|
|
|
editAgoQauntity = selectInfo.Quantity;
|
|
|
editAgoTotalPrice = selectInfo.TotalPrice;
|
|
|
|
|
|
- var stoageEdit = await _sqlSugar.Updateable<Pm_GoodsStorage>(info)
|
|
|
+ var stoageEdit = await _sqlSugar.Updateable(info)
|
|
|
.UpdateColumns(x => new
|
|
|
{
|
|
|
x.Quantity,
|
|
@@ -392,6 +391,7 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
|
|
|
return _jv;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
var goodsInfo = await _sqlSugar.Queryable<Pm_GoodsInfo>().FirstAsync(x => x.Id == info.GoodsId);
|
|
|
goodsInfo.SQ_Total = goodsInfo.SQ_Total - editAgoQauntity + info.Quantity;
|
|
|
goodsInfo.StockQuantity = goodsInfo.StockQuantity - editAgoQauntity + info.Quantity;
|
|
@@ -431,8 +431,8 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
|
|
|
public async Task<JsonView> GoodsStorageDel(int id, int userId)
|
|
|
{
|
|
|
var storageInfo = await _sqlSugar.Queryable<Pm_GoodsStorage>()
|
|
|
- .Where(x => x.Id == id)
|
|
|
- .FirstAsync();
|
|
|
+ .Where(x => x.Id == id)
|
|
|
+ .FirstAsync();
|
|
|
if (storageInfo == null) return _jv;
|
|
|
|
|
|
decimal delAgoQauntity = storageInfo.Quantity,
|
|
@@ -442,14 +442,14 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
|
|
|
_sqlSugar.BeginTran();
|
|
|
|
|
|
var storageDel = await _sqlSugar.Updateable<Pm_GoodsStorage>()
|
|
|
- .SetColumns(x => new Pm_GoodsStorage
|
|
|
- {
|
|
|
- DeleteUserId = userId,
|
|
|
- DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
|
|
|
- IsDel = 1
|
|
|
- })
|
|
|
- .Where(x => x.Id == id)
|
|
|
- .ExecuteCommandAsync();
|
|
|
+ .SetColumns(x => new Pm_GoodsStorage
|
|
|
+ {
|
|
|
+ DeleteUserId = userId,
|
|
|
+ DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
|
|
|
+ IsDel = 1
|
|
|
+ })
|
|
|
+ .Where(x => x.Id == id)
|
|
|
+ .ExecuteCommandAsync();
|
|
|
if (storageDel < 1)
|
|
|
{
|
|
|
_sqlSugar.RollbackTran();
|
|
@@ -564,7 +564,6 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
|
|
|
})
|
|
|
.FirstAsync();
|
|
|
|
|
|
-
|
|
|
_jv.Code = StatusCodes.Status200OK;
|
|
|
_jv.Data = data;
|
|
|
_jv.Msg = $"操作成功";
|
|
@@ -592,7 +591,7 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
|
|
|
.Where(x => x.IsDel == 0 &&
|
|
|
x.GoodsId == _dto.GoodsId &&
|
|
|
x.AuditStatus == GoodsAuditEnum.Pending
|
|
|
- )
|
|
|
+ )
|
|
|
.SumAsync(x => x.Quantity);
|
|
|
if (info.Id > 0) //修改
|
|
|
{
|