Commit 6b12caa6 by 纪旭 韦

合并梧州,修改人员字典设置

parents 2acea3f1 ab2d5185
......@@ -163,6 +163,7 @@ public AutoMapperConfigs()
//二次绩效
CreateMap<ag_header, PerHeader>();
CreateMap<PerHeader, ag_header>();
CreateMap<CofAgainRequest, cof_again>();
CreateMap<PerAgainData, ag_data>();
CreateMap<ag_data, PerAgainData>();
......
......@@ -69,6 +69,7 @@ public class ComputerAliasHead
public string Head { get; set; }
public int HeadId { get; set; }
public int Sort { get; set; }
public int States { get; set; }
}
public class BeginEndTime
......
......@@ -9,9 +9,9 @@
"AllowedHosts": "*",
//连接字符串
"AppConnection": {
"PerformanceConnectionString": "server=192.168.18.166;database=db_performance;uid=root;pwd=1234qwer;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;",
//"PerformanceConnectionString": "server=192.168.18.166;database=db_performance;uid=root;pwd=1234qwer;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;",
//"PerformanceConnectionString": "server=112.124.13.17;database=db_performance;uid=suvalue;pwd=suvalue2016;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;",
//"PerformanceConnectionString": "server=116.62.245.55;database=db_performance;uid=bigdata;pwd=Suvalue@abc;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;",
"PerformanceConnectionString": "server=116.62.245.55;database=db_performance;uid=bigdata;pwd=Suvalue@abc;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;",
"HangfireConnectionString": "server=192.168.18.166;database=db_hangfire;uid=root;pwd=1234qwer;port=3306;allow user variables=true;",
"RedisConnectionString": "116.62.245.55:6379,defaultDatabase=2"
},
......
......@@ -390,23 +390,20 @@ public List<EmployeeReservedDto> GetEmployeeReserved(ReservedRequest request)
string view = request.Source == 1 ? "view_allot_result_report_emp" : request.Source == 2 ? "view_allot_result_report_issue_source" : request.Source == 3 ? "view_allot_result_report":"";
string sql = $"SELECT * FROM {view} WHERE HospitalID=@HospitalID AND Year=@Year";
var reserveds = DapperQuery<EmployeeReservedDto>(sql, new { HospitalID = request.HospitalId, Year = request.Year }, commandTimeout : 60 * 60 )?.ToList();
return reserveds;
return DapperQuery<EmployeeReservedDto>(sql, new { HospitalID = request.HospitalId, Year = request.Year }, commandTimeout: 60 * 10)?.ToList();
}
public List<view_allot_result> GetOwnerPerformance(List<int> hospitalId, string jobNumber)
{
string sql = "SELECT * FROM view_allot_result WHERE States IN (6,8) AND HospitalID IN @HospitalID AND JobNumber=@JobNumber";
return DapperQuery<view_allot_result>(sql, new { HospitalID = hospitalId, JobNumber = jobNumber }, commandTimeout: 60 * 60)?.ToList();
return DapperQuery<view_allot_result>(sql, new { HospitalID = hospitalId, JobNumber = jobNumber }, commandTimeout: 60 * 10)?.ToList();
}
public List<dynamic> QueryCompute(int allotId, string viewName)
{
var sql = $@"SELECT * FROM {viewName} WHERE AllotId = @AllotId; ";
return DapperQuery<dynamic>(sql, new { allotId })?.ToList();
return DapperQuery<dynamic>(sql, new { allotId }, commandTimeout: 60 * 10)?.ToList();
}
public List<dynamic> QueryComputeByDate(string viewName, BeginEndTime request)
......@@ -426,7 +423,7 @@ public List<dynamic> QueryComputeByDate(string viewName, BeginEndTime request)
else
sql += $" order by hospitalid,code,unittype,accountingunit";
return DapperQuery<dynamic>(sql, new { beginTime = request.BeginTime, endTime = request.EndTime }).ToList();
return DapperQuery<dynamic>(sql, new { beginTime = request.BeginTime, endTime = request.EndTime }, commandTimeout: 60 * 10).ToList();
}
public List<dynamic> QueryComputeByDateAndTotal(string viewName, HospitalGrantSummary request)
......@@ -471,7 +468,7 @@ public List<dynamic> QueryComputeByDateAndTotal(string viewName, HospitalGrantSu
}
//sql = $"select {string.Join(",", request.GroupBy)}, {string.Join(",", request.SumBy.Select(t => $"sum({t}) {t}"))} from ({sql}) tab group by {string.Join(",", request.GroupBy)}";
return DapperQuery<dynamic>(sql, new { beginTime = request.BeginTime, endTime = request.EndTime }).ToList();
return DapperQuery<dynamic>(sql, new { beginTime = request.BeginTime, endTime = request.EndTime },commandTimeout: 60*10).ToList();
}
public (List<dynamic> list, int count) QueryComputePageData(string query, object param = null)
......@@ -508,8 +505,8 @@ public CustonPagingData QueryCustom(string tableName, int allotId, string accoun
var result = new CustonPagingData
{
DataList = DapperQuery<dynamic>(dataQuery, new { allotId, unitType, accountingUnit })?.ToList(),
TotalCount = DapperQuery<int>(countQuery, new { allotId, unitType, accountingUnit })?.FirstOrDefault() ?? 0,
DataList = DapperQuery<dynamic>(dataQuery, new { allotId, unitType, accountingUnit }, commandTimeout: 60 * 10)?.ToList(),
TotalCount = DapperQuery<int>(countQuery, new { allotId, unitType, accountingUnit }, commandTimeout: 60 * 10)?.FirstOrDefault() ?? 0,
};
return result;
......@@ -537,10 +534,10 @@ public CustonPagingData QueryCustom(CustomPagingRequest request, bool IsHead)
sql = $@"SELECT * FROM {request.TableName} WHERE AllotId = @AllotId {Query} order by UnitType,AccountingUnit LIMIT {(request.PageIndex - 1) * request.PageSize},{request.PageSize} ";
result.DataList = DapperQuery<dynamic>(sql, new { request.AllotId })?.ToList();
result.DataList = DapperQuery<dynamic>(sql, new { request.AllotId }, commandTimeout: 60 * 10)?.ToList();
sql = $@"SELECT COUNT(*) FROM {request.TableName} WHERE AllotId = @AllotId {Query} ";
result.TotalCount = DapperQuery<int>(sql, new { request.AllotId })?.FirstOrDefault() ?? 0;
result.TotalCount = DapperQuery<int>(sql, new { request.AllotId }, commandTimeout: 60 * 10)?.FirstOrDefault() ?? 0;
return result;
}
......@@ -549,7 +546,7 @@ public bool QueryIsAllotId(string tableName, params string[] columns)
var database = context.Database.GetDbConnection().Database;
var sql = $@"SELECT column_name FROM information_schema.COLUMNS s
WHERE table_name = @table_name AND TABLE_SCHEMA = @database AND column_name in @columns;";
var result = DapperQuery<string>(sql, new { database = database, table_name = tableName, columns });
var result = DapperQuery<string>(sql, new { database = database, table_name = tableName, columns }, commandTimeout: 60 * 10);
var isExist = result?.Count() == 3;
......@@ -561,7 +558,7 @@ public List<ColumnEntity> QueryCustomColumn(string tableName)
{
var database = context.Database.GetDbConnection().Database;
var sql = $@"SELECT column_name as Name,ifnull(column_comment,column_name) as comment FROM information_schema.`COLUMNS` WHERE table_schema = @table_schema AND table_name = @table_name AND COLUMN_KEY <> 'PRI' ";
var result = DapperQuery<ColumnEntity>(sql, new { table_schema = database, table_name = tableName })?.ToList();
var result = DapperQuery<ColumnEntity>(sql, new { table_schema = database, table_name = tableName }, commandTimeout: 60 * 10)?.ToList();
return result;
}
......@@ -576,7 +573,7 @@ public bool CreatCustom(int AllotId, string tableName, List<dynamic> datas)
var database = context.Database.GetDbConnection().Database;
sql = $@"SELECT column_name FROM information_schema.COLUMNS s
WHERE table_name = @table_name AND TABLE_SCHEMA = @database AND COLUMN_KEY <> 'PRI';";
var columns = DapperQuery<string>(sql, new { database = database, table_name = tableName })?.ToList();
var columns = DapperQuery<string>(sql, new { database = database, table_name = tableName }, commandTimeout: 60 * 10)?.ToList();
sql = $"INSERT INTO {tableName}({string.Join(",", columns.ToArray())}) VALUES({string.Join(",", columns.Select(t => "@" + t))});";
......@@ -591,7 +588,7 @@ public List<dynamic> QueryType(string tableName)
{
var database = context.Database.GetDbConnection().Database;
var sql = $@"select column_name,data_type from information_schema.columns where table_name=@table_name and table_schema=@table_schema AND (data_type like '%int%' or data_type like '%decimal%' or data_type like '%date%') AND COLUMN_KEY <> 'PRI' ";
var result = DapperQuery<dynamic>(sql, new { table_schema = database, table_name = tableName })?.ToList();
var result = DapperQuery<dynamic>(sql, new { table_schema = database, table_name = tableName }, commandTimeout: 60 * 10)?.ToList();
return result;
}
......
......@@ -2054,7 +2054,7 @@ public bool UpdateHeadersStatus(ComputerAliasUpdate request)
if (headIds.Contains(t.Id))
{
var item = request.computerAliasHead.FirstOrDefault(w => w.HeadId == t.Id);
t.States = 1;
t.States = item.States;
t.Alias = item.Head;
t.Sort = item.Sort;
}
......
......@@ -568,6 +568,7 @@ select new
JobCategory = t1.JobCategory,
Duty = t1.Duty,
JobTitle = t1.JobTitle,
JobNumber = t1.JobNumber,
AttendanceDay = t1.AttendanceDay,
ReservedRatio = t1.ReservedRatio,
BankCard = t1.BankCard,
......@@ -775,6 +776,7 @@ public ApiResponse SaveReportPersonTag(int hospitalId, int allotId, int userId,
var pdata = JsonHelper.Deserialize<per_employee>(json);
//employee.PersonnelNumber = pdata.PersonnelNumber;
//employee.DoctorName = pdata.DoctorName;
employee.JobNumber = pdata.JobNumber;
employee.JobCategory = pdata.JobCategory;
employee.Duty = pdata.Duty;
employee.JobTitle = pdata.JobTitle;
......@@ -801,11 +803,13 @@ public ApiResponse SaveReportPersonTag(int hospitalId, int allotId, int userId,
tdata.CreateTime = DateTime.Now;
tdata.AccountingUnit = employee.AccountingUnit;
tdata.UnitType = employee.UnitType;
tdata.UnitType = employee.UnitType;
var tag = tags.FirstOrDefault(t => t.PersonnelNumber == item["PersonnelNumber"]);
if (tag != null)
{
tag.AccountingUnit = employee.AccountingUnit;
tag.AccountingUnit = employee.AccountingUnit;
tag.UnitType = employee.UnitType;
tag.PersonnelName = tdata.PersonnelName;
tag.PersonnelNumber = tdata.PersonnelNumber;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment