Merge branch 'master' of http://121.41.2.71:3000/wyw/mh_jy_safe
This commit is contained in:
commit
1140c05080
@ -1,4 +1,5 @@
|
|||||||
using APT.Infrastructure.Core;
|
using APT.BaseData.Domain.Enums;
|
||||||
|
using APT.Infrastructure.Core;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
@ -18,5 +19,11 @@ namespace APT.BaseData.Domain.Entities.FM
|
|||||||
|
|
||||||
[Description("是否集团数据")]
|
[Description("是否集团数据")]
|
||||||
public Boolean JT_SYNC { get; set; }
|
public Boolean JT_SYNC { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 生产单元
|
||||||
|
/// </summary>
|
||||||
|
[Description("生产单元")]
|
||||||
|
public PRODUCTIONEnum? PRODUCTION { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -654,4 +654,34 @@ namespace APT.BaseData.Domain.Enums
|
|||||||
[Description("API响应时间")]
|
[Description("API响应时间")]
|
||||||
APITimeResponsenAPP = 601,
|
APITimeResponsenAPP = 601,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 生产单元 选矿 10, 尾矿 20, 矿山 30, 地下矿 40,
|
||||||
|
/// </summary>
|
||||||
|
public enum PRODUCTIONEnum
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 选矿
|
||||||
|
/// </summary>
|
||||||
|
[Description("选矿厂")]
|
||||||
|
MineChoose = 10,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 尾矿
|
||||||
|
/// </summary>
|
||||||
|
[Description("尾矿库")]
|
||||||
|
Minelast = 20,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 露天矿
|
||||||
|
/// </summary>
|
||||||
|
[Description("露天矿")]
|
||||||
|
Mine = 30,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 地下矿
|
||||||
|
/// </summary>
|
||||||
|
[Description("地下矿")]
|
||||||
|
MineUnderGround = 40,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
139655
APT.Data.Migrations/Migrations/20260518054753_wyw2026051801.Designer.cs
generated
Normal file
139655
APT.Data.Migrations/Migrations/20260518054753_wyw2026051801.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,23 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
namespace APT.Data.Migrations.Migrations
|
||||||
|
{
|
||||||
|
public partial class wyw2026051801 : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "PRODUCTION",
|
||||||
|
table: "T_FM_USER_PRODUCTION_UNIT_SET",
|
||||||
|
type: "int",
|
||||||
|
nullable: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "PRODUCTION",
|
||||||
|
table: "T_FM_USER_PRODUCTION_UNIT_SET");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -8313,6 +8313,9 @@ namespace APT.Data.Migrations.Migrations
|
|||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("uniqueidentifier");
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<int?>("PRODUCTION")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
b.HasKey("ID");
|
b.HasKey("ID");
|
||||||
|
|
||||||
b.HasIndex("ORG_ID");
|
b.HasIndex("ORG_ID");
|
||||||
|
|||||||
@ -286,19 +286,25 @@ namespace APT.SC.WebApi.Controllers.Api.BI
|
|||||||
if (dtSubTypeSum != null && dtSubTypeSum.Rows.Count > 0)
|
if (dtSubTypeSum != null && dtSubTypeSum.Rows.Count > 0)
|
||||||
{
|
{
|
||||||
string NameType = string.Empty;
|
string NameType = string.Empty;
|
||||||
|
int PRODUCTION = 0;
|
||||||
int CountRow = 0;
|
int CountRow = 0;
|
||||||
foreach (DataRow item in dtSubTypeSum.Rows)
|
foreach (DataRow item in dtSubTypeSum.Rows)
|
||||||
{
|
{
|
||||||
NameType = item["NAME"].ToString().Trim();
|
try
|
||||||
CountRow = int.Parse(item["cdCount"].ToString().Trim());
|
|
||||||
if (result.listSubTypeCount.ContainsKey(NameType))
|
|
||||||
{
|
{
|
||||||
result.listSubTypeCount[NameType] += CountRow;
|
PRODUCTION = int.Parse(item["PRODUCTION"].ToString().Trim());
|
||||||
}
|
NameType = ((PRODUCTIONEnum)PRODUCTION).GetDescription();
|
||||||
else
|
CountRow = int.Parse(item["cdCount"].ToString().Trim());
|
||||||
{
|
if (result.listSubTypeCount.ContainsKey(NameType))
|
||||||
result.listSubTypeCount.Add(NameType, CountRow);
|
{
|
||||||
|
result.listSubTypeCount[NameType] += CountRow;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
result.listSubTypeCount.Add(NameType, CountRow);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
catch { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@ -23,13 +23,36 @@ namespace APT.SC.WebApi.Controllers.Api.SE
|
|||||||
[HttpPost, Route("SEOrderPaged")]
|
[HttpPost, Route("SEOrderPaged")]
|
||||||
public PagedActionResult<T_SE_NEW_USER_DETAIL> SEOrderPaged([FromBody] KeywordPageFilter pageFilter)
|
public PagedActionResult<T_SE_NEW_USER_DETAIL> SEOrderPaged([FromBody] KeywordPageFilter pageFilter)
|
||||||
{
|
{
|
||||||
var recordfilter = new BaseFilter(pageFilter.GetOrgId());
|
//var recordfilter = new BaseFilter(pageFilter.GetOrgId());
|
||||||
recordfilter.SelectField = new string[] { "USER_ID", "Nav_User.NAME", "Nav_User.CREATE_TIME" };
|
//recordfilter.SelectField = new string[] { "USER_ID", "Nav_User.NAME", "Nav_User.CREATE_TIME" };
|
||||||
var allUser = WitOrderPaged(null, pageFilter);
|
//var allUser = WitOrderPaged(null, pageFilter);
|
||||||
var totalUser = GetEntities<T_SE_NEW_USER_DETAIL>(null, pageFilter).OrderByDescending(e => e.Nav_User.CREATE_TIME).Distinct(t => t.USER_ID);
|
//var totalUser = GetEntities<T_SE_NEW_USER_DETAIL>(null, pageFilter).OrderByDescending(e => e.Nav_User.CREATE_TIME).Distinct(t => t.USER_ID);
|
||||||
allUser.Data = totalUser;
|
//allUser.Data = totalUser;
|
||||||
allUser.TotalCount = totalUser.Count();
|
//allUser.TotalCount = totalUser.Count();
|
||||||
return allUser;
|
//return allUser;
|
||||||
|
return SafeGetPagedData(delegate (PagedActionResult<T_SE_NEW_USER_DETAIL> result)
|
||||||
|
{
|
||||||
|
var resultTemp = GetOrderEntities<T_SE_NEW_USER_DETAIL>(e => e.USER_ID.HasValue && !e.IS_DELETED && (e.Nav_User.IS_DELETED || !e.Nav_User.IS_DELETED), pageFilter).Distinct(t => t.USER_ID);
|
||||||
|
|
||||||
|
var listUserIDDel = resultTemp.Where(e => e.Nav_User == null && e.USER_ID.HasValue).Select(e => e.USER_ID.Value).ToList();
|
||||||
|
if (listUserIDDel != null && listUserIDDel.Count() > 0)
|
||||||
|
{
|
||||||
|
var fmUserDel = GetEntities_noneBase<T_FM_USER>(e => listUserIDDel.Contains(e.ID) && (!e.IS_DELETED || e.IS_DELETED));
|
||||||
|
if (fmUserDel != null && fmUserDel.Count() > 0)
|
||||||
|
{
|
||||||
|
foreach (var item in resultTemp)
|
||||||
|
{
|
||||||
|
if (item.Nav_User == null && item.USER_ID.HasValue)
|
||||||
|
{
|
||||||
|
item.Nav_User = fmUserDel.FirstOrDefault(e => e.ID == item.USER_ID.Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
result.Data = resultTemp;
|
||||||
|
result.TotalCount = resultTemp.Count();
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获得单条实体数据
|
/// 获得单条实体数据
|
||||||
@ -54,11 +77,11 @@ namespace APT.SC.WebApi.Controllers.Api.SE
|
|||||||
{
|
{
|
||||||
userFilter = new BaseFilter(filter.GetOrgId());
|
userFilter = new BaseFilter(filter.GetOrgId());
|
||||||
userFilter.Include = new string[] { "Nav_NewUser.Nav_Department", "Nav_NewUser.Nav_User", "Nav_NewUser.Nav_Content", "Nav_NewUser.Nav_Files.Nav_ImgFile", "Nav_User", "Nav_Department", "Nav_Post", "Nav_Files.Nav_ImgFile" };
|
userFilter.Include = new string[] { "Nav_NewUser.Nav_Department", "Nav_NewUser.Nav_User", "Nav_NewUser.Nav_Content", "Nav_NewUser.Nav_Files.Nav_ImgFile", "Nav_User", "Nav_Department", "Nav_Post", "Nav_Files.Nav_ImgFile" };
|
||||||
educard = GetEntities<T_SE_NEW_USER_DETAIL>(t => t.USER_ID == Guid.Parse(userId), userFilter).ToList();
|
educard = GetEntities<T_SE_NEW_USER_DETAIL>(t => t.USER_ID == Guid.Parse(userId) && (t.Nav_NewUser.IS_DELETED || !t.Nav_NewUser.IS_DELETED), userFilter).ToList();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
educard = GetEntities<T_SE_NEW_USER_DETAIL>(t => t.USER_ID == Guid.Parse(userId), filter).ToList();
|
educard = GetEntities<T_SE_NEW_USER_DETAIL>(t => t.USER_ID == Guid.Parse(userId) && (t.Nav_NewUser.IS_DELETED || !t.Nav_NewUser.IS_DELETED), filter).ToList();
|
||||||
}
|
}
|
||||||
ret = educard;
|
ret = educard;
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
@ -52,7 +52,7 @@ namespace APT.SC.WebApi.Controllers.Api.SE
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var listInfo = GetEntities<T_SE_TRAIN_RECORD_REPORT>(null, pageFilter).GroupBy(e => new { e.UNIT, e.DEPARTMENT_NAME, e.CODE, e.NAME, e.USER_ID }).Select(e => new RECORD_REPORT { UNIT = e.Key.UNIT, CODE = e.Key.CODE, USER_ID = e.Key.USER_ID, NAME = e.Key.NAME, DEPARTMENT_NAME = e.Key.DEPARTMENT_NAME, TRAIN_HOUR_ALL = e.Sum(t => t.TRAIN_HOUR) }).OrderBy(e => e.UNIT).ThenBy(e => e.DEPARTMENT_NAME).ThenBy(e => e.NAME);
|
var listInfo = GetEntities<T_SE_TRAIN_RECORD_REPORT>(null, pageFilter).GroupBy(e => new { e.UNIT, e.DEPARTMENT_NAME, e.CODE, e.NAME, e.USER_ID, e.ORG_ID }).Select(e => new RECORD_REPORT { ORG_ID = e.Key.ORG_ID, UNIT = e.Key.UNIT, CODE = e.Key.CODE, USER_ID = e.Key.USER_ID, NAME = e.Key.NAME, DEPARTMENT_NAME = e.Key.DEPARTMENT_NAME, TRAIN_HOUR_ALL = e.Sum(t => t.TRAIN_HOUR) }).OrderBy(e => e.UNIT).ThenBy(e => e.DEPARTMENT_NAME).ThenBy(e => e.NAME);
|
||||||
var listDataT = listInfo.Skip(pageFilter.Start).Take(pageFilter.Limit).ToArray();
|
var listDataT = listInfo.Skip(pageFilter.Start).Take(pageFilter.Limit).ToArray();
|
||||||
var listData = new List<T_SE_TRAIN_RECORD_REPORT>();
|
var listData = new List<T_SE_TRAIN_RECORD_REPORT>();
|
||||||
foreach (var item in listDataT)
|
foreach (var item in listDataT)
|
||||||
@ -66,7 +66,8 @@ namespace APT.SC.WebApi.Controllers.Api.SE
|
|||||||
USER_ID = item.USER_ID,
|
USER_ID = item.USER_ID,
|
||||||
TRAIN_HOUR = item.TRAIN_HOUR_ALL,
|
TRAIN_HOUR = item.TRAIN_HOUR_ALL,
|
||||||
START_TIME_S = START_TIME_S,
|
START_TIME_S = START_TIME_S,
|
||||||
START_TIME_E = START_TIME_E
|
START_TIME_E = START_TIME_E,
|
||||||
|
ORG_ID = item.ORG_ID
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
result.Data = listData;
|
result.Data = listData;
|
||||||
@ -596,7 +597,7 @@ namespace APT.SC.WebApi.Controllers.Api.SE
|
|||||||
var fullFilePart = $"{fileP}{fileNameP}";
|
var fullFilePart = $"{fileP}{fileNameP}";
|
||||||
var fullFilePath = $"{fileP}{fileNameP}{fileName}";
|
var fullFilePath = $"{fileP}{fileNameP}{fileName}";
|
||||||
|
|
||||||
string Result= $"{fileNameP}{fileName}";
|
string Result = $"{fileNameP}{fileName}";
|
||||||
//如果没有文件夹 创建
|
//如果没有文件夹 创建
|
||||||
//如果文件夹下有超过10个文件 按时间 删除多余的
|
//如果文件夹下有超过10个文件 按时间 删除多余的
|
||||||
if (!Directory.Exists(fullFilePart))
|
if (!Directory.Exists(fullFilePart))
|
||||||
@ -636,6 +637,10 @@ namespace APT.SC.WebApi.Controllers.Api.SE
|
|||||||
|
|
||||||
public class RECORD_REPORT
|
public class RECORD_REPORT
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 生产单元
|
||||||
|
/// </summary>
|
||||||
|
public Guid? ORG_ID { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 生产单元
|
/// 生产单元
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user