解决代码冲突
This commit is contained in:
@@ -83,35 +83,6 @@ namespace Tnb.BasicData
|
||||
return PageResult<MbomListOutput>.SqlSugarPageResult(list);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据bomid获取对应的子bom列表
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<dynamic> GetSubMoListByBomId([FromRoute] string bomId)
|
||||
{
|
||||
if (string.IsNullOrEmpty(bomId)) throw new ArgumentException($"parameter {nameof(bomId)} not be null or empty");
|
||||
var result = await _db.Queryable<BasMbom>().LeftJoin<BasRouteD>((a, b) => a.route_id == b.route_id)
|
||||
.LeftJoin<BasProcess>((a, b, c) => b.process_id == c.id)
|
||||
.LeftJoin<BasMbomOutput>((a, b, c, d) => c.id == d.process_id)
|
||||
.LeftJoin<BasMaterial>((a, b, c, d, e) => d.material_id == e.id)
|
||||
.LeftJoin<BasMaterialCategory>((a, b, c, d, e, f) => e.category_id == f.id)
|
||||
.Where((a, b, c, d, e, f) => a.id == bomId)
|
||||
.Select((a, b, c, d, e, f) => new SubBomListOutput
|
||||
{
|
||||
material_id = e.id,
|
||||
material_code = e.code,
|
||||
material_name = e.name,
|
||||
material_category_code = f.category_code,
|
||||
num = d.num
|
||||
})
|
||||
.Mapper(it => it.output_qty = it.num.ParseToInt())
|
||||
.Distinct()
|
||||
.ToListAsync();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取编辑信息
|
||||
/// </summary>
|
||||
@@ -159,6 +130,38 @@ namespace Tnb.BasicData
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据bomid获取对应的子bom列表
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<dynamic> GetSubMoListByBomId([FromRoute] string bomId)
|
||||
{
|
||||
if (string.IsNullOrEmpty(bomId)) throw new ArgumentException($"parameter {nameof(bomId)} not be null or empty");
|
||||
var result = await _db.Queryable<BasMbom>().LeftJoin<BasRouteD>((a, b) => a.route_id == b.route_id)
|
||||
.LeftJoin<BasProcess>((a, b, c) => b.process_id == c.id)
|
||||
.LeftJoin<BasMbomOutput>((a, b, c, d) => c.id == d.process_id)
|
||||
.LeftJoin<BasMaterial>((a, b, c, d, e) => d.material_id == e.id)
|
||||
.LeftJoin<BasMaterialCategory>((a, b, c, d, e, f) => e.category_id == f.id)
|
||||
.Where((a, b, c, d, e, f) => a.id == bomId)
|
||||
.Select((a, b, c, d, e, f) => new SubBomListOutput
|
||||
{
|
||||
material_id = e.id,
|
||||
material_code = e.code,
|
||||
material_name = e.name,
|
||||
material_category_code = f.category_code,
|
||||
num = d.num
|
||||
})
|
||||
.Mapper(it => it.output_qty = it.num.ParseToInt())
|
||||
.Distinct()
|
||||
.ToListAsync();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据物料id获取生产bom
|
||||
/// </summary>
|
||||
@@ -204,6 +207,7 @@ namespace Tnb.BasicData
|
||||
[HttpPost]
|
||||
public async Task<string> SaveData(MbomSaveDataInput mbomSaveDataInput)
|
||||
{
|
||||
ErrorCode errorCode = ErrorCode.COM1008;
|
||||
DbResult<bool> result = await _repository.AsSugarClient().Ado.UseTranAsync(async () =>
|
||||
{
|
||||
//新增
|
||||
@@ -312,14 +316,14 @@ namespace Tnb.BasicData
|
||||
else//修改
|
||||
{
|
||||
if (await _repository.IsAnyAsync(x =>
|
||||
x.material_id == mbomSaveDataInput.material_id && x.version == mbomSaveDataInput.version && x.id!=mbomSaveDataInput.id))
|
||||
x.material_id == mbomSaveDataInput.material_id && x.version == mbomSaveDataInput.version && x.id != mbomSaveDataInput.id))
|
||||
{
|
||||
//errorCode = ErrorCode.COM1004;
|
||||
errorCode = ErrorCode.COM1004;
|
||||
throw Oops.Oh(ErrorCode.COM1004);
|
||||
}
|
||||
|
||||
string orgId = _userManager.GetUserInfo().Result.organizeId;
|
||||
await _repository.UpdateAsync(x=>new BasMbom()
|
||||
|
||||
string orgId = _userManager.GetUserInfo().Result.organizeId;
|
||||
await _repository.UpdateAsync(x => new BasMbom()
|
||||
{
|
||||
// org_id = orgId,
|
||||
material_id = mbomSaveDataInput.material_id,
|
||||
@@ -439,9 +443,10 @@ namespace Tnb.BasicData
|
||||
throw Oops.Oh(errorCode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return result.IsSuccess ? "保存成功" : result.ErrorMessage;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user