去除引用common.props
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Filter;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Systems.Entitys.Permission;
|
||||
using JNPF.Systems.Entitys.System;
|
||||
using JNPF.VisualDev;
|
||||
@@ -16,7 +13,6 @@ using SqlSugar;
|
||||
using Tnb.BasicData;
|
||||
using Tnb.EquipMgr.Entities;
|
||||
using Tnb.EquipMgr.Entities.Dto;
|
||||
using Tnb.EquipMgr.Interfaces;
|
||||
|
||||
namespace Tnb.EquipMgr
|
||||
{
|
||||
@@ -26,7 +22,7 @@ namespace Tnb.EquipMgr
|
||||
[ApiDescriptionSettings(Tag = ModuleConsts.Tag, Area = ModuleConsts.Area, Order = 700)]
|
||||
[Route("api/[area]/[controller]/[action]")]
|
||||
[OverideVisualDev(ModuleId)]
|
||||
public class AppEqpRepairApplyService : IOverideVisualDevService,IDynamicApiController, ITransient
|
||||
public class AppEqpRepairApplyService : IOverideVisualDevService, IDynamicApiController, ITransient
|
||||
{
|
||||
private const string ModuleId = "28621611210261";
|
||||
private readonly ISqlSugarRepository<EqpRepairApply> _repository;
|
||||
@@ -46,43 +42,43 @@ namespace Tnb.EquipMgr
|
||||
_visualDevService = visualDevService;
|
||||
OverideFuncs.GetListAsync = GetList;
|
||||
}
|
||||
|
||||
|
||||
private async Task<dynamic> GetList(VisualDevModelListQueryInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
Dictionary<string, object> queryJson = !string.IsNullOrEmpty(input.queryJson) ? JsonConvert.DeserializeObject<Dictionary<string, object>>(input.queryJson) : new Dictionary<string, object>();
|
||||
string code = queryJson!=null && queryJson.ContainsKey("code") ? queryJson["code"].ToString() : "";
|
||||
string name = queryJson!=null && queryJson.ContainsKey("name") ? queryJson["name"].ToString() : "";
|
||||
string code = queryJson != null && queryJson.ContainsKey("code") ? queryJson["code"].ToString() : "";
|
||||
string name = queryJson != null && queryJson.ContainsKey("name") ? queryJson["name"].ToString() : "";
|
||||
string userId = _userManager.UserId;
|
||||
var result = await db.Queryable<EqpRepairApply>()
|
||||
.LeftJoin<EqpEquipment>((a, b) => a.equip_id == b.id)
|
||||
.LeftJoin<UserEntity>((a, b, c) => a.apply_user_id == c.Id)
|
||||
.LeftJoin<DictionaryTypeEntity>((a,b,c,d)=>d.EnCode==DictConst.RepairStatus)
|
||||
.LeftJoin<DictionaryDataEntity>((a,b,c,d,e)=>a.status==e.EnCode && d.Id==e.DictionaryTypeId)
|
||||
.LeftJoin<DictionaryTypeEntity>((a, b, c, d) => d.EnCode == DictConst.RepairStatus)
|
||||
.LeftJoin<DictionaryDataEntity>((a, b, c, d, e) => a.status == e.EnCode && d.Id == e.DictionaryTypeId)
|
||||
.WhereIF(!string.IsNullOrEmpty("code"), (a, b, c) => a.code.Contains(code))
|
||||
.WhereIF(!string.IsNullOrEmpty("name"), (a, b, c) => a.name.Contains(name))
|
||||
.Where((a, b, c) => a.repairer_id == userId)
|
||||
.Where((a, b, c) => a.status == "2" || a.status=="3")
|
||||
.Select((a, b, c,d,e) => new PdaRepairApplyListOutput
|
||||
.Where((a, b, c) => a.status == "2" || a.status == "3")
|
||||
.Select((a, b, c, d, e) => new PdaRepairApplyListOutput
|
||||
{
|
||||
id = a.id,
|
||||
code = a.code,
|
||||
name = a.name,
|
||||
equip_id = b.code+"/"+b.name,
|
||||
equip_id = b.code + "/" + b.name,
|
||||
equip_id_id = a.equip_id,
|
||||
expect_complete_time = a.expect_complete_time==null ? "" : a.expect_complete_time.Value.ToString("yyyy-MM-dd"),
|
||||
is_ugent = a.is_ugent==null ? "" : a.is_ugent==0 ? "否" : "是",
|
||||
expect_complete_time = a.expect_complete_time == null ? "" : a.expect_complete_time.Value.ToString("yyyy-MM-dd"),
|
||||
is_ugent = a.is_ugent == null ? "" : a.is_ugent == 0 ? "否" : "是",
|
||||
description = a.description,
|
||||
status = e.FullName,
|
||||
apply_user_id = SqlFunc.IsNull(c.RealName,"异常停机"),
|
||||
apply_user_id = SqlFunc.IsNull(c.RealName, "异常停机"),
|
||||
apply_user_id_id = a.create_id,
|
||||
// repairer_id = c.RealName,
|
||||
// repairer_id_id = a.repairer_id,
|
||||
}).ToPagedListAsync(input.currentPage,input.pageSize);
|
||||
}).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
|
||||
return PageResult<PdaRepairApplyListOutput>.SqlSugarPageResult(result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据id获取维修相关信息
|
||||
@@ -90,7 +86,7 @@ namespace Tnb.EquipMgr
|
||||
/// <param name="dic"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<dynamic> GetRepairInfoById(Dictionary<string,string> dic)
|
||||
public async Task<dynamic> GetRepairInfoById(Dictionary<string, string> dic)
|
||||
{
|
||||
string id = dic.ContainsKey("id") ? dic["id"] : "";
|
||||
if (string.IsNullOrEmpty(id)) return null;
|
||||
@@ -106,7 +102,7 @@ namespace Tnb.EquipMgr
|
||||
equip_id = a.equip_id,
|
||||
equip_code = b.code,
|
||||
equip_name = b.name,
|
||||
expect_complete_time = a.expect_complete_time==null?"":a.expect_complete_time.Value.ToString("yyyy-MM-dd"),
|
||||
expect_complete_time = a.expect_complete_time == null ? "" : a.expect_complete_time.Value.ToString("yyyy-MM-dd"),
|
||||
is_ugent = a.is_ugent,
|
||||
description = a.description,
|
||||
status = a.status,
|
||||
|
||||
Reference in New Issue
Block a user