去除引用common.props
This commit is contained in:
@@ -4,12 +4,11 @@ using JNPF.Common.Security;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.VisualDev.Interfaces;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SqlSugar;
|
||||
using Tnb.EquipMgr.Entities;
|
||||
using Tnb.EquipMgr.Interfaces;
|
||||
using Tnb.EquipMgr.Entities.Dto;
|
||||
using Tnb.EquipMgr.Interfaces;
|
||||
|
||||
namespace Tnb.EquipMgr
|
||||
{
|
||||
@@ -38,10 +37,10 @@ namespace Tnb.EquipMgr
|
||||
public async Task<string> Publish(SpotInsTemPublishInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
DbResult<bool> result = await db.Ado.UseTranAsync(async () =>
|
||||
DbResult<bool> result = await db.Ado.UseTranAsync(async () =>
|
||||
{
|
||||
EqpSpotInsTemH eqpSpotInsTemH = await _repository.GetSingleAsync(x => x.id == input.id);
|
||||
List<EqpSpotInsTemD> eqpSpotInsTemDs = await db.Queryable<EqpSpotInsTemD>().Where(x=>x.spot_ins_tem_id==input.id).ToListAsync();
|
||||
List<EqpSpotInsTemD> eqpSpotInsTemDs = await db.Queryable<EqpSpotInsTemD>().Where(x => x.spot_ins_tem_id == input.id).ToListAsync();
|
||||
|
||||
if (input.equipIds != null && input.equipIds.Length > 0)
|
||||
{
|
||||
@@ -55,7 +54,7 @@ namespace Tnb.EquipMgr
|
||||
{
|
||||
id = id,
|
||||
code = code,
|
||||
name = eqpSpotInsTemH.name+equipId,
|
||||
name = eqpSpotInsTemH.name + equipId,
|
||||
plan_cycle = eqpSpotInsTemH.plan_cycle,
|
||||
plan_cycle_unit = eqpSpotInsTemH.plan_cycle_unit,
|
||||
plan_run_notice = eqpSpotInsTemH.plan_run_notice,
|
||||
@@ -93,26 +92,26 @@ namespace Tnb.EquipMgr
|
||||
}
|
||||
|
||||
EqpSpotInsTemEquipH oldSpotInsTemEquipH = await db.Queryable<EqpSpotInsTemEquipH>().Where(x => x.spot_ins_tem_id == input.id && x.equip_id == equipId).FirstAsync();
|
||||
await db.Deleteable<EqpSpotInsTemEquipH>().Where(x => x.spot_ins_tem_id == input.id && x.equip_id==equipId).ExecuteCommandAsync();
|
||||
if(oldSpotInsTemEquipH!=null)
|
||||
await db.Deleteable<EqpSpotInsTemEquipD>().Where(x => x.spot_ins_tem_equip_id==oldSpotInsTemEquipH.id).ExecuteCommandAsync();
|
||||
await db.Deleteable<EqpSpotInsTemEquipH>().Where(x => x.spot_ins_tem_id == input.id && x.equip_id == equipId).ExecuteCommandAsync();
|
||||
if (oldSpotInsTemEquipH != null)
|
||||
await db.Deleteable<EqpSpotInsTemEquipD>().Where(x => x.spot_ins_tem_equip_id == oldSpotInsTemEquipH.id).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
if (insertEqpSpotInsTemEquipHs != null && insertEqpSpotInsTemEquipHs.Count > 0)
|
||||
{
|
||||
await db.Insertable(insertEqpSpotInsTemEquipHs).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
|
||||
if (insertEqpSpotInsTemEquipDs != null && insertEqpSpotInsTemEquipDs.Count > 0)
|
||||
{
|
||||
await db.Insertable(insertEqpSpotInsTemEquipDs).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008);
|
||||
if (!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008);
|
||||
return result.IsSuccess ? "发布成功" : result.ErrorMessage;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user