|
|
|
@ -110,11 +110,14 @@ public class Ghrh_YearHumanSettingsServices : BaseServices<Ghrh_YearHumanSetting |
|
|
|
|
|
|
|
|
|
result.result.JM_TableColumnT1.TableColumn?.ForEach(x => |
|
|
|
|
{ |
|
|
|
|
int month = x.field.Replace("M", null).Replace("F", null).ObjToInt(); |
|
|
|
|
if (x.GroupName == "预算编制数") |
|
|
|
|
x.label = year + "-" + x.field.Replace("M", null); |
|
|
|
|
if (month == 12) |
|
|
|
|
year++; |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
int month = x.field.Replace("M", null).Replace("F", null).ObjToInt(); |
|
|
|
|
x.label = year + "-" + x.field.Replace("M", null).Replace("F", null); |
|
|
|
|
if (month == 12) |
|
|
|
|
year++; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
return result; |
|
|
|
@ -144,4 +147,70 @@ public class Ghrh_YearHumanSettingsServices : BaseServices<Ghrh_YearHumanSetting |
|
|
|
|
return result; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public async Task<ServiceResult<List<FlowTableColumn>>> QueryApplyColumn(int curentYear, int langId) |
|
|
|
|
{ |
|
|
|
|
int flowId = await Db.Ado.GetIntAsync("Select FlowID from Ghrw_Flow where FlowNo='F_ESS_RecruitYearManpowerApply'"); |
|
|
|
|
var param = new FlowParam() { doType = "Insert", jsonParam = new FlowJsonParam() { FlowID = flowId }, menuName = "F_ESS_RecruitYearManpowerApply", langId = langId, userId = App.User.ID }; |
|
|
|
|
|
|
|
|
|
var flowReturn = await _commonServices.GetFlowInfoAsync(param); |
|
|
|
|
var config = await Db.Queryable<Ghrh_Config>().Where(x => x.ConfigCode == "ESS_Recruit_Year_Human_Start_Month").FirstAsync(); |
|
|
|
|
|
|
|
|
|
var startMonth = config != null ? config.ConfigValue.ObjToInt() : 1; |
|
|
|
|
|
|
|
|
|
#region 处理起始月 |
|
|
|
|
var months = new List<string>(); |
|
|
|
|
List<int> numbers = new(); |
|
|
|
|
for (int i = 1; i <= 12; i++) |
|
|
|
|
{ |
|
|
|
|
if (i < 10) |
|
|
|
|
months.Add("0" + i); |
|
|
|
|
else |
|
|
|
|
months.Add(i.ObjToString()); |
|
|
|
|
numbers.Add(i); |
|
|
|
|
} |
|
|
|
|
// 指定要打头的数字 |
|
|
|
|
int startNumber = startMonth; |
|
|
|
|
var sort = flowReturn.result.JM_TableColumnT1.TableColumn.Where(x => x.field == "M1").SingleOrDefault()?.rowNum ?? 5; |
|
|
|
|
// 创建一个新的列表用于存储重新排序后的结果 |
|
|
|
|
List<int> reorderedNumbers = new(); |
|
|
|
|
flowReturn.result.JM_TableColumnT1.TableColumn?.ForEach(x => |
|
|
|
|
{ |
|
|
|
|
if (months.Where(o => o == x.label).Any()) |
|
|
|
|
x.GroupName = "预算编制数"; |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// 找到指定数字的索引 |
|
|
|
|
int index1 = numbers.IndexOf(startNumber); |
|
|
|
|
if (index1 != -1) |
|
|
|
|
{ |
|
|
|
|
// 从指定数字开始,按照循环顺序添加数字 |
|
|
|
|
for (int i = 0; i < numbers.Count; i++) |
|
|
|
|
{ |
|
|
|
|
int currentIndex = (index1 + i) % numbers.Count; |
|
|
|
|
reorderedNumbers.Add(numbers[currentIndex]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
foreach (var num in reorderedNumbers) |
|
|
|
|
{ |
|
|
|
|
flowReturn.result.JM_TableColumnT1.TableColumn?.ForEach(x => |
|
|
|
|
{ |
|
|
|
|
if (x.field.Replace("M", null).ObjToInt() == num) |
|
|
|
|
{ |
|
|
|
|
x.rowNum = sort; |
|
|
|
|
x.label = curentYear + "-" + x.field.Replace("M", null); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
if (num == 12) |
|
|
|
|
curentYear++; |
|
|
|
|
sort++; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
flowReturn.result.JM_TableColumnT1.TableColumn = flowReturn.result.JM_TableColumnT1.TableColumn.OrderBy(x => x.rowNum).ToList(); |
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
return ServiceResult<List<FlowTableColumn>>.OprateSuccess("查询成功!", flowReturn.result.JM_TableColumnT1.TableColumn); ; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |