|
@@ -318,12 +318,9 @@ namespace OASystem.API.Controllers
|
|
|
return Ok(JsonView(true, "操作成功!"));
|
|
|
}
|
|
|
|
|
|
- [HttpPost]
|
|
|
-
|
|
|
- public IActionResult QueryClientType(QueryClientTypeDto Dto)
|
|
|
+ private Dictionary<int, List<int>> MCRSetting()
|
|
|
{
|
|
|
- var jw = JsonView(true,"获取成功!");
|
|
|
- Dictionary<int,List<int>> keyValuePairs = new Dictionary<int,List<int>>();
|
|
|
+ Dictionary<int, List<int>> keyValuePairs = new Dictionary<int, List<int>>();
|
|
|
keyValuePairs.Add(419, new List<int>() //四川
|
|
|
{
|
|
|
376,377,378,381,382,387,388,389,390,753,754
|
|
@@ -341,6 +338,16 @@ namespace OASystem.API.Controllers
|
|
|
keyValuePairs.Add(625, new List<int>() { 617, 618, 619, 620, 621, 622, 622, 623, 624, 754 }); // 甘肃
|
|
|
keyValuePairs.Add(634, new List<int>() { 455, 630, 631, 632, 633, 754 }); // 新疆
|
|
|
|
|
|
+ return keyValuePairs;
|
|
|
+ }
|
|
|
+
|
|
|
+ [HttpPost]
|
|
|
+
|
|
|
+ public IActionResult QueryClientType(QueryClientTypeDto Dto)
|
|
|
+ {
|
|
|
+ var jw = JsonView(true,"获取成功!");
|
|
|
+
|
|
|
+ var keyValuePairs = MCRSetting();
|
|
|
ArrayList arr = new ArrayList();
|
|
|
var ids = new List<int>();
|
|
|
foreach (var item in Dto.SetDataIdArr)
|
|
@@ -353,19 +360,74 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
arr.AddRange(_sqlSugar.Queryable<Sys_SetData>()
|
|
|
.Where(u => ids.Contains(u.Id) && u.IsDel == 0)
|
|
|
- .Select(x => new { x.Id, x.Name })
|
|
|
+ .Select(x => new { x.Id, x.Name , x.Remark })
|
|
|
.ToList());
|
|
|
|
|
|
if (arr.Count == 0)
|
|
|
{
|
|
|
arr.AddRange(_sqlSugar.Queryable<Sys_SetData>()
|
|
|
.Where(u => u.STid == 37 && u.IsDel == 0)
|
|
|
- .Select(x => new { x.Id, x.Name }).ToList());
|
|
|
+ .Select(x => new { x.Id, x.Name, x.Remark }).ToList());
|
|
|
}
|
|
|
|
|
|
+ // 创建比较器实例
|
|
|
+ IComparer remakeComparer = new RemakeComparer();
|
|
|
+
|
|
|
+ // 使用ArrayList.Sort方法和自定义比较器对arr进行排序
|
|
|
+ arr.Sort(remakeComparer);
|
|
|
+
|
|
|
jw.Data = arr;
|
|
|
|
|
|
return Ok(jw);
|
|
|
}
|
|
|
+
|
|
|
+ [HttpPost]
|
|
|
+ public IActionResult SynchronizationData()
|
|
|
+ {
|
|
|
+ var keyValuePairs = new Dictionary<int, List<string>>
|
|
|
+ {
|
|
|
+ { 5, new List<string> { "省级部门", "省级单位" } },
|
|
|
+ { 10, new List<string> { "市州" } },
|
|
|
+ { 15, new List<string> { "省属国企" } },
|
|
|
+ { 20, new List<string> { "省属学校", "省属高校" } },
|
|
|
+ { 25, new List<string> { "省级行业协会", "省级社团", "省级联合会" , "省属行业协会", "民营企业", "地方国企" } },
|
|
|
+ { 30, new List<string> { "市级部门", "市级单位" } },
|
|
|
+ { 35, new List<string> { "区市县" } },
|
|
|
+ { 40, new List<string> { "市级国企", "市属国企" } },
|
|
|
+ { 45, new List<string> { "市属学校", "市属高校" } },
|
|
|
+ { 50, new List<string> { "市级行业协会", "市级社团", "市级联合会" } }
|
|
|
+ };
|
|
|
+
|
|
|
+ var setting = MCRSetting();
|
|
|
+ var arr = new List<List<Sys_SetData>>();
|
|
|
+
|
|
|
+ foreach (var item in setting.Keys)
|
|
|
+ {
|
|
|
+ var setDataList_DB = _sqlSugar.Queryable<Sys_SetData>()
|
|
|
+ .Where(x => x.IsDel == 0 && setting[item].Contains(x.Id))
|
|
|
+ .ToList();
|
|
|
+ foreach (var setData in setDataList_DB)
|
|
|
+ {
|
|
|
+ foreach (var lv in keyValuePairs.Keys)
|
|
|
+ {
|
|
|
+ var islv = keyValuePairs[lv].Where(x => setData.Name.Contains(x)).Count() > 0;
|
|
|
+
|
|
|
+ if (islv)
|
|
|
+ {
|
|
|
+ setData.Remark = lv.ToString();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ arr.Add(setDataList_DB);
|
|
|
+ }
|
|
|
+
|
|
|
+ _sqlSugar.Updateable(arr.SelectMany(x => x).ToList()).UpdateColumns(x => new
|
|
|
+ {
|
|
|
+ x.Remark
|
|
|
+ }).ExecuteCommand();
|
|
|
+
|
|
|
+ return Ok(arr);
|
|
|
+ }
|
|
|
}
|
|
|
}
|