12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058 |
- using Microsoft.AspNetCore.Mvc;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Threading.Tasks;
- using TEAMModelOS.Models;
- using TEAMModelOS.SDK.DI;
- using System.Text.Json;
- using TEAMModelOS.SDK.Models;
- using Microsoft.AspNetCore.Http;
- using TEAMModelOS.SDK.Extension;
- using Azure.Cosmos;
- using System.Text;
- using TEAMModelOS.SDK.DI.AzureCosmos.Inner;
- using Microsoft.Extensions.Options;
- using Azure.Messaging.ServiceBus;
- using Microsoft.Extensions.Configuration;
- using TEAMModelOS.Services.Common;
- using HTEXLib.COMM.Helpers;
- using TEAMModelOS.SDK;
- using System.IdentityModel.Tokens.Jwt;
- using TEAMModelOS.Services;
- using TEAMModelOS.SDK.Models.Service;
- using System.IO;
- using System.Dynamic;
- using Microsoft.AspNetCore.Authorization;
- using Azure.Storage.Blobs.Models;
- using static TEAMModelOS.SDK.Models.Teacher;
- using System.Web;
- namespace TEAMModelOS.Controllers.Third
- {
- /// <summary>
- ///
- /// </summary>
- ///
- [ProducesResponseType(StatusCodes.Status200OK)]
- [ProducesResponseType(StatusCodes.Status400BadRequest)]
- //[Authorize(Roles = "IES5")]
- //[Route("")]
- //[Route("api/[controller]")]
- [ApiController]
- public class ScController : ControllerBase
- {
- private readonly SnowflakeId _snowflakeId;
- private readonly AzureCosmosFactory _azureCosmos;
- private readonly DingDing _dingDing;
- private readonly Option _option;
- private readonly AzureStorageFactory _azureStorage;
- private readonly AzureServiceBusFactory _serviceBus;
- private readonly AzureRedisFactory _azureRedis;
- private readonly CoreAPIHttpService _accountHttpService;
- private readonly ThirdApisService _scsApisService;
- public readonly string type = "scsyxpt";
- private readonly HttpTrigger _httpTrigger;
- /// <summary>
- /// 机构安全码
- /// </summary>
- public string _sc_passKey;
- /// <summary>
- /// 机构ID
- /// </summary>
- public string _sc_trainComID;
- /// <summary>
- /// 机构 AES 密钥
- /// </summary>
- public string _sc_privateKey;
- /// <summary>
- /// 访问地址
- /// </summary>
- public string _sc_url;
- public IConfiguration _configuration { get; set; }
- public ScController(AzureCosmosFactory azureCosmos, SnowflakeId snowflakeId, DingDing dingDing, IOptionsSnapshot<Option> option, AzureStorageFactory azureStorage,
- AzureRedisFactory azureRedis, AzureServiceBusFactory serviceBus, IConfiguration configuration, CoreAPIHttpService accountHttpService, ThirdApisService scsApisService, HttpTrigger httpTrigger)
- {
- _azureCosmos = azureCosmos;
- _snowflakeId = snowflakeId;
- _dingDing = dingDing;
- _option = option?.Value;
- _azureStorage = azureStorage;
- _serviceBus = serviceBus;
- _configuration = configuration;
- _azureRedis = azureRedis;
- _accountHttpService = accountHttpService;
- _scsApisService = scsApisService;
- _sc_passKey = _configuration.GetValue<string>("Third:scsyxpt:passKey");
- _sc_trainComID = _configuration.GetValue<string>("Third:scsyxpt:trainComID");
- _sc_privateKey = _configuration.GetValue<string>("Third:scsyxpt:privateKey");
- _sc_url = _configuration.GetValue<string>("Third:scsyxpt:url");
- _httpTrigger = httpTrigger;
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="request"></param>
- /// <returns></returns>
- [ProducesDefaultResponseType]
- [HttpPost("sc/binda")]
- [AllowAnonymous]
- public async Task<IActionResult> FixBlobBinds(JsonElement json)
- {
- List<Teacher> teachers = new List<Teacher>();
- string sql = $" SELECT value(c) FROM c where ARRAY_LENGTH(c.binds)>0 ";
- await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<Teacher>(queryText: sql,
- requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base") }))
- {
- teachers.Add(item);
- }
- var url = _configuration.GetValue<string>("HaBookAuth:CoreAPI");
- var clientID = _configuration.GetValue<string>("HaBookAuth:CoreService:clientID");
- var clientSecret = _configuration.GetValue<string>("HaBookAuth:CoreService:clientSecret");
- var location = _option.Location;
- List<string> unbind = new List<string>();
- List<string> list = new List<string>();
- (int code, string content) = await _accountHttpService.Implicit(clientID, clientSecret, location, $"{url}/oauth2/implicit",
- new Dictionary<string, string>()
- {
- { "grant_type", "implicit" },
- { "client_id",clientID },
- { "account","1639025968" },
- { "nonce",Guid.NewGuid().ToString()}
- });
-
- foreach (var teacher in teachers)
- {
- var a = teacher.binds.SelectMany(y => y.data).ToList().Find(x => !string.IsNullOrEmpty(x));
- if (a != null)
- {
- // await _azureStorage.UploadFileByContainer("teammodelos", a, $"yxpt/scpjx/scbind", $"{teacher.id}.json");
- }
- else
- {
- unbind.Add(teacher.id);
- }
- //(int code, string content) = await _accountHttpService.Implicit(clientID, clientSecret, location, $"{url}/oauth2/implicit",
- // new Dictionary<string, string>()
- // {
- // { "grant_type", "implicit" },
- // { "client_id",clientID },
- // { "account",teacher.id },
- // { "nonce",Guid.NewGuid().ToString()}
- // });
- //if (content.Contains("error")) {
- // unbind.Add(teacher.id);
- //}
- //list.Add(content);
- }
- await _dingDing.SendBotMsg($"OS,{_option.Location}\n绑定失败,出现的原因可能是 参数异常:\n{unbind.ToJsonString()}", GroupNames.成都开发測試群組);
- return Ok(new { unbind ,list});
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="request"></param>
- /// <returns></returns>
- [ProducesDefaultResponseType]
- [HttpPost("sc/bind")]
- [AllowAnonymous]
- public async Task<IActionResult> Bind(SSO sso) {
- try
- {
- Teacher teacher = null;
- if (string.IsNullOrEmpty(sso.id_token)) {
- return Ok(new
- {
- location = _option.Location,
- status = 2,
- });
- }
- JwtSecurityToken jwt = null;
- try {
- jwt = new JwtSecurityToken(sso.id_token);
- } catch (Exception ex) {
- await _dingDing.SendBotMsg($"OS,{_option.Location}\n绑定失败,出现的原因可能是 参数异常:\n{sso.ToJsonString()},{ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
- return BadRequest();
- }
- if (!jwt.Payload.Iss.Equals("account.teammodel", StringComparison.OrdinalIgnoreCase)) return BadRequest();
- var id = jwt.Payload.Sub;
- jwt.Payload.TryGetValue("name", out object name);
- jwt.Payload.TryGetValue("picture", out object picture);
- ScSSOData scsso = HttpUtility.UrlDecode(sso.param, Encoding.UTF8).ToObject<ScSSOData>();
- var client = _azureCosmos.GetCosmosClient();
- try
- {
- teacher = await client.GetContainer(Constant.TEAMModelOS, "Teacher").ReadItemAsync<Teacher>(id, new PartitionKey("Base"));
- //先检查绑定的平台是否已经被绑定
- //四川研训平台跳转隐式登录/或者绑定IES平台接入规范
- string sql = $"SELECT distinct value(c) FROM c join A1 in c.binds where A1.tid='{scsso.tid}'";
- await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<Teacher>(queryText: sql,
- requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base") }))
- {
- teacher = item;
- break;
- }
- if (teacher != null)
- {
- if (teacher.id.Equals(id))
- {
- //var bind = teacher.binds.Find(x => x.source.Equals($"{scsso.Webid}") && x.userid.Equals($"{scsso.tid}"));
- var bind = teacher.binds.Find(x => x.userid.Equals($"{scsso.tid}"));
- if (bind == null)
- {
- teacher.binds = new List<Teacher.ThirdBind> { new Teacher.ThirdBind { data = new List<string> { scsso.data }, userid = $"{scsso.tid}", /*source = $"{scsso.Webid}",*/ type = type } };
- await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Teacher").ReplaceItemAsync<Teacher>(teacher, teacher.id, new PartitionKey(teacher.code));
- }
- else
- {
- var bindData = scsso.data.ToObject<ScBindData>();
- bool isnew = true;
- for (int index = 0; index < bind.data.Count; index++)
- {
- ScBindData scBind = bind.data[index].ToObject<ScBindData>();
- if (scBind.pxid.Equals(bindData.pxid))
- {
- bind.data[index] = bindData.ToJsonString();
- isnew = false;
- }
- }
- if (isnew)
- {
- bind.data.Add(bindData.ToJsonString());
- }
- await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Teacher").ReplaceItemAsync<Teacher>(teacher, teacher.id, new PartitionKey(teacher.code));
- await _azureStorage.UploadFileByContainer("teammodelos", bindData.ToJsonString(), $"yxpt/{scsso.path}/scbind", $"{teacher.id}.json");
- }
- }
- else
- {
- return Ok(new
- {
- location = _option.Location,
- //账号已被别的醍摩豆id绑定
- status = 3,
- tmdid = teacher.id,
- name = teacher.name,
- tid = scsso.tid
- });
- }
- }
- }
- catch (CosmosException ex)
- {
- teacher = new Teacher
- {
- id = id,
- pk = "Base",
- code = "Base",
- name = name?.ToString(),
- picture = picture?.ToString(),
- //创建账号并第一次登录IES5则默认赠送1G
- size = 1,
- defaultSchool = null,
- schools = new List<Teacher.TeacherSchool>(),
- binds = new List<Teacher.ThirdBind> { new Teacher.ThirdBind { data = new List<string> { scsso.data }, userid = $"{scsso.tid}", /*source = $"{scsso.Webid}",*/ type = type } }
- };
- var container = _azureStorage.GetBlobContainerClient(id);
- await container.CreateIfNotExistsAsync(PublicAccessType.None); //嘗試創建Teacher私有容器,如存在則不做任何事,保障容器一定存在
- teacher = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Teacher").CreateItemAsync<Teacher>(teacher, new PartitionKey("Base"));
- await _azureStorage.UploadFileByContainer("teammodelos", scsso.data.ToJsonString(), $"yxpt/{scsso.path}/scbind", $"{teacher.id}.json");
- }
- catch (Exception ex) {
- await _dingDing.SendBotMsg($"OS,{_option.Location}\n绑定失败:\n{sso.ToJsonString()},{ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
- return Ok(new
- {
- location = _option.Location,
- status = 2,
- });
- }
- return Ok(new
- {
- location = _option.Location,
- status = 200,
- });
-
- } catch (Exception ex ) {
- await _dingDing.SendBotMsg($"OS,{_option.Location}\n绑定失败:\n{sso.ToJsonString()},{ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
- return Ok(new
- {
- location = _option.Location,
- status = 2,
- });
- }
- }
- /// <summary>
- /// 动态地址路由。"config":"scsyxpt","path":"sc{pjx/jinniu}"
- /// </summary>
- /// <param name="request"></param>
- /// <returns></returns>
- [HttpGet("{path}/sso")]
- [AllowAnonymous]
- public async Task<IActionResult> Sso([FromQuery] ScSSO scsso,string path)
- {
- var HostName = HttpContext.GetHostName();
- if (path.Equals("sc"))
- {
- path = $"scpjx";
- }
- else
- {
- path = $"sc{path}";
- }
- //var rurl = new StringBuilder($"https://{_option.HostName}/sso");
- var rurl = new StringBuilder($"https://{HostName}/sso");
- try {
-
- string parmas = $"Pxid={scsso.Pxid}&Webid={scsso.Webid}&tid={scsso.tid}&time={scsso.time}";
- if (Md5Hash.GetMd5String(parmas).Equals($"{scsso.Encrypt}"))
- {
- //四川研训平台跳转隐式登录/或者绑定IES平台接入规范
- long ssotime = long.Parse($"{scsso.time}");
- long nowtime = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
- if (nowtime - ssotime > 60 * 10)//10分钟有效期
- {
- // return Ok(new { status = 2, msg = "登录超时!" });
- }
- }
- else
- {
- return Redirect(rurl.Append($"?status=1").ToString());
- }
- string setsql = $"select value(c) from c where contains(c.accessConfig,'{path}') and contains(c.accessConfig,'scsyxpt') ";
- AreaSetting setting = null;
- await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<AreaSetting>(queryText: setsql,
- requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AreaSetting") }))
- {
- setting = item;
- break;
- }
- if (setting==null ||(setting != null && string.IsNullOrEmpty(setting.accessConfig)))
- {
- return Redirect(rurl.Append($"?status=1").ToString());
- }
- string accessConfig = setting.accessConfig;
- Dictionary<string, object> dict = new Dictionary<string, object> { { "accessConfig", accessConfig }, { "pxid", scsso.Pxid }, { "tid", scsso.tid } };
- string SchoolName="",SchoolID = "", ProjectID = "", ProjectItemID ="" ;
- (int status, string json) = await _httpTrigger.RequestHttpTrigger(dict, _option.Location, "GetSingleTeacherByProject");
- if (status == 200)
- {
- ScTeacher scTeacher = json.ToObject<ScTeacher>(new JsonSerializerOptions { PropertyNameCaseInsensitive = false });
- await _dingDing.SendBotMsg($"OS,{_option.Location}\n省平台教师信息:\n{scTeacher.ToJsonString()}",GroupNames.成都开发測試群組);
- if (scTeacher != null && $"{scTeacher.PXID}".Equals(scsso.Pxid) && $"{scTeacher.TID}".Equals(scsso.tid))
- {
- SchoolName = scTeacher.SchoolName;
- SchoolID = $"{scTeacher.SchoolID}";
- ProjectID =$"{ scTeacher.ProjectID}";
- ProjectItemID =$"{ scTeacher.ProjectItemID}";
- }
- }
- ScBindData bindData = new ScBindData
- {
- sn = SchoolName,
- sid = SchoolID,
- pd = ProjectID,
- pid = ProjectItemID,
- pxid = scsso.Pxid
- };
- var data = bindData.ToJsonString();
- ScSSOData sso = new ScSSOData {
- path = path,
- Pxid = scsso.Pxid,
- Encrypt = scsso.Encrypt,
- tid = scsso.tid,
- time = scsso.time,
- data= data
- };
- Teacher teacher = null;
- //四川研训平台跳转隐式登录/或者绑定IES平台接入规范
- //string sql = $"SELECT distinct value(c) FROM c join A1 in c.binds where A1.pxid='{sso.Pxid}' and A1.webid='{sso.Webid}' and A1.tid='{sso.tid}'";
- string sql = $"SELECT distinct value(c) FROM c join A1 in c.binds where A1.userid='{sso.tid}'";
- await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<Teacher>(queryText: sql,
- requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base") }))
- {
- teacher = item;
- break;
- }
- if (teacher == null)
- {
- //string enurl = HttpUtility.UrlEncode(rurl.Append($"?status=4¶m={sso.ToJsonString()}&type={type}&bindurl=sc/bind").ToString());
- string enurl = $"status=4¶m={HttpUtility.UrlEncode(sso.ToJsonString(), Encoding.UTF8)}&type={type}&bindurl=sc/bind";
- return Redirect(rurl.Append($"?{enurl}").ToString());
- }
- else
- {
- var url = _configuration.GetValue<string>("HaBookAuth:CoreAPI");
- var clientID = _configuration.GetValue<string>("HaBookAuth:CoreService:clientID");
- var clientSecret = _configuration.GetValue<string>("HaBookAuth:CoreService:clientSecret");
- var location = _option.Location;
- (int code, string content) = await _accountHttpService.Implicit(clientID, clientSecret, location, $"{url}/oauth2/implicit",
- new Dictionary<string, string>()
- {
- { "grant_type", "implicit" },
- { "client_id",clientID },
- { "account",teacher.id },
- { "nonce",Guid.NewGuid().ToString()}
- });
- TmdidImplicit implicit_token = new TmdidImplicit();
- if (!string.IsNullOrEmpty(content) && code == 200)
- {
- implicit_token = content.ToObject<TmdidImplicit>();
- if (string.IsNullOrEmpty(implicit_token.id_token)) {
- await _dingDing.SendBotMsg($"OS,隐式登录获得信息位空:{_option.Location}-\n{scsso.ToJsonString()} \npath:{path}\n{content}", GroupNames.成都开发測試群組);
- return Redirect(rurl.Append($"?status=1").ToString());
- }
- var bind = teacher.binds.Find(x => x.userid.Equals(sso.tid));
- //var bind = teacher.binds.Find(x => x.userid.Equals(sso.tid) && x.source.Equals(sso.Webid));
- if (bind != null)
- {
- bool isnew = true;
- for (int index = 0;index< bind.data.Count; index++) {
- ScBindData scBind = bind.data[index].ToObject<ScBindData>();
- if (scBind.pxid.Equals(bindData.pxid))
- {
- bind.data[index]= bindData.ToJsonString();
- isnew = false;
- }
- }
- if (isnew)
- {
- bind.data.Add(bindData.ToJsonString());
- }
- await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Teacher").ReplaceItemAsync<Teacher>(teacher, teacher.id, new PartitionKey(teacher.code));
- //var scbind= bind.data.FindAll(x=>x.Contains("scsyxpt"));
- //if (scbind != null) {
- // foreach (var bd in scbind) {
-
- // }
- //}
- //if (bind.pxid != null)
- //{
- // if (bind.pxid.Add(sso.Pxid))
- // {
- // await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Teacher").ReplaceItemAsync<Teacher>(teacher, teacher.id, new PartitionKey(teacher.code));
- // }
- //}
- //else
- //{
- // bind.pxid = new HashSet<string> { sso.Pxid };
- // await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Teacher").ReplaceItemAsync<Teacher>(teacher, teacher.id, new PartitionKey(teacher.code));
- //}
- }
- await _azureStorage.UploadFileByContainer("teammodelos", bindData.ToJsonString(), $"yxpt/{sso.path}/scbind", $"{teacher.id}.json");
- rurl.Append($"?status=200&id_token={implicit_token.id_token}&access_token={implicit_token.access_token}&expires_in={HttpUtility.UrlEncode(implicit_token.expires_in)}&token_type={HttpUtility.UrlEncode(implicit_token.token_type)}").ToString();
- string uri = rurl.ToString();
- return Redirect(uri);
- }
- else
- {
- //绑定失效
- if (teacher.binds.IsNotEmpty())
- {
- // teacher.binds.RemoveAll(x => x.userid.Equals(sso.tid) && x.source.Equals(sso.Webid));
- teacher.binds.RemoveAll(x => x.userid.Equals(sso.tid) );
- await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Teacher").ReplaceItemAsync<Teacher>(teacher, teacher.id, new PartitionKey(teacher.code));
- }
- // string enurl = HttpUtility.UrlEncode(rurl.Append($"status=4¶m={sso.ToJsonString()}&type={type}&bindurl=sc/bind").ToString());
- string enurl = $"status=4¶m={HttpUtility.UrlEncode(sso.ToJsonString(),Encoding.UTF8)}&type={type}&bindurl=sc/bind";
- return Redirect(rurl.Append($"?{enurl}").ToString());
- }
- }
- } catch (Exception ex) {
- await _dingDing.SendBotMsg($"OS,{_option.Location}-\n{scsso.ToJsonString()} \npath:{path}\n{ex.StackTrace}\n{ex.Message}", GroupNames.醍摩豆服務運維群組);
- return Redirect(rurl.Append($"?status=1").ToString());
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- /// <param name="json"></param>
- /// <returns></returns>
- [ProducesDefaultResponseType]
- [HttpPost("sc/get-list")]
- [AllowAnonymous]
- public async Task<IActionResult> GetProjectList(JsonElement json)
- {
- // 5.3.1.1获取项目列表
- string trainComID = _sc_trainComID;
- string Code = "GetProjectInfoByTrainComID";
- Dictionary<string, object> parameterMap = new Dictionary<string, object>();
- parameterMap.Add("TrainComID", _sc_trainComID);
- ScsResult GetProjectInfoByTrainComID = await _scsApisService.Post(_sc_url, Code, _sc_passKey, _sc_privateKey, parameterMap);
- GetProjectInfoByTrainComID.code = Code;
- GetProjectInfoByTrainComID.title = "5.3.1.1获取项目列表";
-
- // 5.3.1.2获取学员名单,暂不对接 V1。
- Code = "GetTeachersListByProject";
- parameterMap = new Dictionary<string, object>();
- parameterMap.Add("TrainComID", trainComID);
- parameterMap.Add("ProjectID", "22");
- parameterMap.Add("ProjectItemID", "24");
- ScsResult GetTeachersListByProject = await _scsApisService.Post(_sc_url, Code, _sc_passKey, _sc_privateKey, parameterMap);
- GetTeachersListByProject.code = Code;
- GetTeachersListByProject.title = "5.3.1.2获取学员名单";
- // 5.3.1.3通过项目编号获取学员测评能力项,需要确认每个教师是是否一样。
- Code = "GetDiagnosisListByProject";
- parameterMap = new Dictionary<string, object>();
- parameterMap.Add("TrainComID", trainComID);
- parameterMap.Add("ProjectID", "22");
- parameterMap.Add("ProjectItemID", "24");
- parameterMap.Add("PXID", "65321");
- ScsResult GetDiagnosisListByProject = await _scsApisService.Post(_sc_url, Code, _sc_passKey, _sc_privateKey, parameterMap);
- GetDiagnosisListByProject.code = Code;
- GetDiagnosisListByProject.title = "5.3.1.3通过项目编号获取学员测评能力项";
- // 补充
- // 5.3.1.3通过项目编号获取学员测评能力项,需要确认每个教师是是否一样。
- Code = "GetDiagnosisListByProject_V2";
- parameterMap = new Dictionary<string, object>();
- parameterMap.Add("TrainComID", trainComID);
- //parameterMap.Add("ProjectID", "22");
- //parameterMap.Add("ProjectItemID", "22");
- parameterMap.Add("PXID", "65321");
- ScsResult GetDiagnosisListByProject_V2 = await _scsApisService.Post(_sc_url, Code, _sc_passKey, _sc_privateKey, parameterMap);
- GetDiagnosisListByProject_V2.code = Code;
- GetDiagnosisListByProject_V2.title = "5.3.1.3通过项目编号获取学员测评能力项V2";
- ScsResult UpdateTeacherSituation = null;
- // 5.3.1.4学员培训基本情况回写
- try
- {
- Code = "UpdateTeacherSituation";
- parameterMap = new Dictionary<string, object>();
- parameterMap.Add("TrainComID", trainComID);
- parameterMap.Add("PXID", "65324");
- parameterMap.Add("TID", "253940");
- parameterMap.Add("TeacherName", "宋鸿");
- parameterMap.Add("CourseHour", "50");
- parameterMap.Add("ResearchText", "");//学习成果描述,字符长度<=300
- parameterMap.Add("ComPassed", "1");//0、未认定 1、合格 2、优秀 3、不合格 4、其他
- UpdateTeacherSituation = await _scsApisService.Post(_sc_url, Code, _sc_passKey, _sc_privateKey, parameterMap);
- UpdateTeacherSituation.code = Code;
- UpdateTeacherSituation.title = "5.3.1.4学员培训基本情况回写";
- }
- catch (Exception ex) { }
- ScsResult UpdateTeacherDiagnosis = null;
- try
- {
- // 5.3.1.5学员能力点测评结果回写
- Code = "UpdateTeacherDiagnosis";
- parameterMap = new Dictionary<string, object>();
- parameterMap.Add("TrainComID", trainComID);
- parameterMap.Add("PXID", "65321");
- parameterMap.Add("TID", "32393");
- parameterMap.Add("DiagnosisNum", "A1");
- //0"未认定", 1"合格", 2"优秀", 3"不合格"
- parameterMap.Add("zpresult", "1");
- parameterMap.Add("hpresult", "1");
- parameterMap.Add("xzpresult", "1");
- List<Dictionary<string, string>> pfilesA = new List<Dictionary<string, string>>();
- parameterMap.Add("pfiles", pfilesA);
- Dictionary<string, string> pfileMapA = new Dictionary<string, string>();
- pfileMapA.Add("url", "https://scnltsfiles.scedu.com.cn/upload/infofj/202104011628463774.pdf");
- pfileMapA.Add("fileName", "XXX.pdf");
- pfileMapA.Add("fileSize", "247767");
- pfileMapA.Add("md5", "9c3da8c5c07c2c660cd73c01f56d7fca");
- pfileMapA.Add("fileType", "pdf");
- pfilesA.Add(pfileMapA);
- UpdateTeacherDiagnosis = await _scsApisService.Post(_sc_url, Code, _sc_passKey, _sc_privateKey, parameterMap);
- UpdateTeacherDiagnosis.code = Code;
- UpdateTeacherDiagnosis.title = "5.3.1.5学员能力点测评结果回写";
- }
- catch (Exception ex)
- {
- }
- // 5.3.1.6获取能力测评体系字典值数据
- Code = "GetDiagnosisDic";
- parameterMap = new Dictionary<string, object>();
- parameterMap.Add("TrainComID", trainComID);
- ScsResult GetDiagnosisDic = await _scsApisService.Post(_sc_url, Code, _sc_passKey, _sc_privateKey, parameterMap);
- GetDiagnosisDic.code = Code;
- GetDiagnosisDic.title = "5.3.1.6获取能力测评体系字典值数据";
- // 5.3.1.7获取能力测评评价类型字典值数据 ,不用对接
- Code = "GetDiagnosisItemDic";
- parameterMap = new Dictionary<string, object>();
- parameterMap.Add("TrainComID", trainComID);
- parameterMap.Add("DiagnosisDicID", "3");
- ScsResult GetDiagnosisItemDic = await _scsApisService.Post(_sc_url, Code, _sc_passKey, _sc_privateKey, parameterMap);
- GetDiagnosisItemDic.code = Code;
- GetDiagnosisItemDic.title = "5.3.1.7获取能力测评评价类型字典值数据";
- // 5.3.1.8获取能力测评评价类型细则字典值数据,不用对接。
- Code = "GetchoiceDic";
- parameterMap = new Dictionary<string, object>();
- parameterMap.Add("TrainComID", trainComID);
- parameterMap.Add("DiagnosisItemID", "4");
- ScsResult GetchoiceDic = await _scsApisService.Post(_sc_url, Code, _sc_passKey, _sc_privateKey, parameterMap);
- GetchoiceDic.code = Code;
- GetchoiceDic.title = "5.3.1.8获取能力测评评价类型细则字典值数据";
- // 5.3.1.9根据培训ID与机构ID获取老师信息
- Code = "GetTeacherInfoByPXID";
- parameterMap = new Dictionary<string, object>();
- parameterMap.Add("TrainComID", trainComID);
- parameterMap.Add("PXID", "65321");
- ScsResult GetTeacherInfoByPXID = await _scsApisService.Post(_sc_url, Code, _sc_passKey, _sc_privateKey, parameterMap);
- GetTeacherInfoByPXID.code = Code;
- GetTeacherInfoByPXID.title = "5.3.1.9根据培训ID与机构ID获取老师信息";
- // 5.3.1.10根据培训项目ID与学校ID获取学校方案,用于展示学校的id方案。顺便确认学校的名单。
- Code = "GetSchoolPlanBySchoolID";
- parameterMap = new Dictionary<string, object>();
- parameterMap.Add("TrainComID", trainComID);
- parameterMap.Add("ProjectItemID", "3");
- parameterMap.Add("SchoolID", "220913");
- parameterMap.Add("Type", "0");
- ScsResult GetSchoolPlanBySchoolID = await _scsApisService.Post(_sc_url, Code, _sc_passKey, _sc_privateKey, parameterMap);
- GetSchoolPlanBySchoolID.code = Code;
- GetSchoolPlanBySchoolID.title = "5.3.1.10根据培训项目ID与学校ID获取学校方案";
- // 5.3.1.11获取跳转学员信息。用于sso单点,后端验证
- Code = "GetSingleTeacherByProject";
- parameterMap = new Dictionary<string, object>();
- parameterMap.Add("TrainComID", trainComID);
- parameterMap.Add("Pxid", "65321");
- parameterMap.Add("Tid", "32393");
- ScsResult GetSingleTeacherByProject = await _scsApisService.Post(_sc_url, Code, _sc_passKey, _sc_privateKey, parameterMap);
- GetSingleTeacherByProject.code = Code;
- GetSingleTeacherByProject.title = "5.3.1.11获取跳转学员信息";
- ScsResult UpdateTeacherListSituation = null;
- Dictionary<string, object> parameterContent = new Dictionary<string, object>();
- List<Dictionary<string, object>> list = new List<Dictionary<string, object>>();
- try
- { // 5.3.1.12学员培训基本情况批量回写
- Code = "UpdateTeacherListSituation";
- parameterContent.Add("TrainComID", trainComID);
- parameterContent.Add("List", list);
- // {"TrainComID":"39","List":[{"ResearchText":"","ComPassed":1,"PXID":"35455","CourseHour":"50.0","TID":"411105","TeacherName":"付绍令"}]}
- {
- Dictionary<string, object> parameterMapData = new Dictionary<string, object>();
- parameterMapData.Add("PXID", "65324");
- parameterMapData.Add("TID", "253940");
- parameterMapData.Add("TeacherName", "柏成伟");
- parameterMapData.Add("CourseHour", "50");
- parameterMapData.Add("ResearchText", "学习成果描述,字符长度<=300");
- parameterMapData.Add("ComPassed", "2");//0、未认定 1、合格 2、优秀 3、不合格 4、其他
- list.Add(parameterMapData);
- parameterMapData = new Dictionary<string, object>();
- parameterMapData.Add("PXID", "65324");
- parameterMapData.Add("TID", "253940");
- parameterMapData.Add("TeacherName", "柏成伟");
- parameterMapData.Add("CourseHour", "50");
- parameterMapData.Add("ResearchText", "学习成果描述,字符长度<=300");
- parameterMapData.Add("ComPassed", "2");//0、未认定 1、合格 2、优秀 3、不合格 4、其他
- list.Add(parameterMapData);
- parameterMapData = new Dictionary<string, object>();
- //parameterMapData.Add("PXID", "22");
- //parameterMapData.Add("TID", "21348");
- //parameterMapData.Add("TeacherName", "邓泽燕");
- //parameterMapData.Add("CourseHour", "50");
- //parameterMapData.Add("ResearchText", "学习成果描述,字符长度<=300");
- //parameterMapData.Add("ComPassed", "2");//0、未认定 1、合格 2、优秀 3、不合格 4、其他
- //list.Add(parameterMapData);
- //parameterMapData = new Dictionary<string, object>();
- //parameterMapData.Add("PXID", "35546");
- //parameterMapData.Add("TID", "411182");
- //parameterMapData.Add("TeacherName", "刘晓莉");
- //parameterMapData.Add("CourseHour", "50");
- //parameterMapData.Add("ResearchText", "");
- //parameterMapData.Add("ComPassed", "1");//0、未认定 1、合格 2、优秀 3、不合格 4、其他
- //list.Add(parameterMapData);
- }
- UpdateTeacherListSituation = await _scsApisService.Post(_sc_url, Code, _sc_passKey, _sc_privateKey, parameterContent);
- UpdateTeacherListSituation.code = Code;
- UpdateTeacherListSituation.title = "5.3.1.12学员培训基本情况批量回写";
- }
- catch (Exception ex) { }
- ScsResult UpdateTeacherListDiagnosis = null;
- try
- { // 5.3.1.13学员能力点测评结果批量回写
- Code = "UpdateTeacherListDiagnosis";
- parameterContent = new Dictionary<string, object>();
- list = new List<Dictionary<string, object>>();
- parameterContent.Add("TrainComID", trainComID);
- parameterContent.Add("List", list);
- {
- Dictionary<string, object> parameterMapData = new Dictionary<string, object>();
- parameterMapData.Add("PXID", "65321");
- parameterMapData.Add("TID", "32393");
- parameterMapData.Add("DiagnosisNum", "A1");
- //0"未认定", 1"合格", 2"优秀", 3"不合格"
- parameterMapData.Add("zpresult", "1");
- parameterMapData.Add("hpresult", "2");
- parameterMapData.Add("xzpresult", "2");
- List<Dictionary<string, object>> pfiles = new List<Dictionary<string, object>>();
- parameterMapData.Add("pfiles", pfiles);
- Dictionary<string, object> pfileMap = new Dictionary<string, object>();
- pfileMap.Add("url", "https://srt-read-online.3ren.cn/basebusiness/material/20210422/1619055398463iE97VWe36i001.mp4");
- pfileMap.Add("fileName", "697a58c2375f7a031456c893e1e1860c.mp4");
- pfileMap.Add("fileSize", "17036168");
- pfileMap.Add("md5", "");
- pfileMap.Add("fileType", "video");
- pfiles.Add(pfileMap);
- list.Add(parameterMapData);
- pfileMap = new Dictionary<string, object>();
- pfileMap.Add("url", "https://srt-read-online.3ren.cn/basebusiness/material/20210422/1619055446704gbKuNF8eas001.pdf");
- pfileMap.Add("fileName", "A6技术支持的课堂反思.pdf");
- pfileMap.Add("fileSize", "32192");
- pfileMap.Add("md5", "");
- pfileMap.Add("fileType", "pdf");
- pfiles.Add(pfileMap);
- list.Add(parameterMapData);
- }
- //{
- // Dictionary<string, object> parameterMapData = new Dictionary<string, object>();
- // parameterMapData.Add("PXID", "3062");
- // parameterMapData.Add("TID", "401268");
- // parameterMapData.Add("DiagnosisNum", "A1");
- // //0"未认定", 1"合格", 2"优秀", 3"不合格"
- // parameterMapData.Add("zpresult", "1");
- // parameterMapData.Add("hpresult", "2");
- // parameterMapData.Add("xzpresult", "2");
- // List<Dictionary<string, object>> pfiles = new List<Dictionary<string, object>>();
- // parameterMapData.Add("pfiles", pfiles);
- // Dictionary<string, object> pfileMap = new Dictionary<string, object>();
- // pfileMap.Add("url", "https://srt-read-online.3ren.cn/basebusiness/material/20210422/1619058650000bphKFbDVSa001.pdf");
- // pfileMap.Add("fileName", "学情分析.pdf");
- // pfileMap.Add("fileSize", "94926");
- // pfileMap.Add("md5", "");
- // pfileMap.Add("fileType", "pdf");
- // pfiles.Add(pfileMap);
- // list.Add(parameterMapData);
- // pfileMap = new Dictionary<string, object>();
- // pfileMap.Add("url", "https://srt-read-online.3ren.cn/basebusiness/material/20210422/1619058698452gF19jmiuML001.mp4");
- // pfileMap.Add("fileName", "种子萌发学情分析.mp4");
- // pfileMap.Add("fileSize", "12692368");
- // pfileMap.Add("md5", "");
- // pfileMap.Add("fileType", "video");
- // pfiles.Add(pfileMap);
- // list.Add(parameterMapData);
- //}
- UpdateTeacherListDiagnosis = await _scsApisService.Post(_sc_url, Code, _sc_passKey, _sc_privateKey, parameterContent);
- UpdateTeacherListDiagnosis.code = Code;
- UpdateTeacherListDiagnosis.title = "5.3.1.13学员能力点测评结果批量回写";
- }
- catch (Exception ex)
- {
- }
- ScsResult UploadSBTARPDF = null;
- try
- { // 5.3.1.14学员校本研修PDF回写
- Code = "UploadSBTARPDF";
- parameterMap = new Dictionary<string, object>();
- parameterMap.Add("TrainComID", trainComID);
- parameterMap.Add("PXID", "16");
- parameterMap.Add("TID", "16");
- parameterMap.Add("url", "http://image1.cersp.com.cn/scpx/images/article/file/20190318/upload__51f98fc8_1697695ae73__7ffe_00001297.pdf");
- parameterMap.Add("fileName", "XXX.pdf");
- parameterMap.Add("fileSize", "247767");
- parameterMap.Add("md5", "9c3da8c5c07c2c660cd73c01f56d7fca");
- parameterMap.Add("fileType", "pdf");
- UploadSBTARPDF = await _scsApisService.Post(_sc_url, Code, _sc_passKey, _sc_privateKey, parameterMap);
- UploadSBTARPDF.code = Code;
- UploadSBTARPDF.title = "5.3.1.14学员校本研修PDF回写";
- }
- catch (Exception ex)
- {
- }
- ScsResult UploadSBTARPDFList = null;
- try
- { // 5.3.1.15学员校本教研PDF批量回写
- Code = "UploadSBTARPDFList";
- parameterContent = new Dictionary<string, object>();
- list = new List<Dictionary<string, object>>();
- parameterContent.Add("TrainComID", trainComID);
- parameterContent.Add("List", list);
- {
- Dictionary<string, object> parameterMapData = new Dictionary<string, object>();
- parameterMapData.Add("PXID", "65309");
- parameterMapData.Add("TID", "253940");
- parameterMapData.Add("url", "https://scnltsfiles.scedu.com.cn/upload/infofj/202104011628463774.pdf");
- parameterMapData.Add("fileName", "XXX.pdf");
- parameterMapData.Add("fileSize", "247767");
- parameterMapData.Add("md5", "9c3da8c5c07c2c660cd73c01f56d7fca");
- parameterMapData.Add("fileType", "pdf");
- list.Add(parameterMapData);
- }
- {
- Dictionary<string, object> parameterMapData = new Dictionary<string, object>();
- parameterMapData.Add("PXID", "65306");
- parameterMapData.Add("TID", "32393");
- parameterMapData.Add("url", "https://scnltsfiles.scedu.com.cn/upload/infofj/202104011628463774.pdf");
- parameterMapData.Add("fileName", "XXX.pdf");
- parameterMapData.Add("fileSize", "247767");
- parameterMapData.Add("md5", "9c3da8c5c07c2c660cd73c01f56d7fca");
- parameterMapData.Add("fileType", "pdf");
- list.Add(parameterMapData);
- }
- UploadSBTARPDFList = await _scsApisService.Post(_sc_url, Code, _sc_passKey, _sc_privateKey, parameterContent);
- UploadSBTARPDFList.code = Code;
- UploadSBTARPDFList.title = "5.3.1.15学员校本教研PDF批量回写";
- }
- catch (Exception ex) { }
- ScsResult UploadKTSL = null;
- try
- {
- // 5.3.1.16学员课堂实录回写
- Code = "UploadKTSL";
- parameterMap = new Dictionary<string, object>();
- parameterMap.Add("TrainComID", trainComID);
- parameterMap.Add("PXID", "16");
- parameterMap.Add("TID", "16");
- parameterMap.Add("url", "https://xxx.mp4");
- parameterMap.Add("url2", "https://xxx.mp4");
- parameterMap.Add("fileName", "XXX.mp4");
- parameterMap.Add("fileSize", "247767");
- parameterMap.Add("md5", "9c3da8c5c07c2c660cd73c01f56d7fca");
- parameterMap.Add("fileType", "mp4");
- UploadKTSL = await _scsApisService.Post(_sc_url, Code, _sc_passKey, _sc_privateKey, parameterMap);
- UploadKTSL.code = Code;
- UploadKTSL.title = "5.3.1.16学员课堂实录回写";
- }
- catch (Exception ex) { }
- ScsResult UploadKTSLList = null;
- try
- {
- // 5.3.1.17学员课堂实录批量回写
- Code = "UploadKTSLList";
- parameterContent = new Dictionary<string, object>();
- list = new List<Dictionary<string, object>>();
- parameterContent.Add("TrainComID", trainComID);
- parameterContent.Add("List", list);
- {
- Dictionary<string, object> parameterMapData = new Dictionary<string, object>();
- parameterMapData.Add("PXID", "16");
- parameterMapData.Add("TID", "16");
- parameterMapData.Add("url", "https://xxx.mp4");
- parameterMapData.Add("url2", "https://xxx.mp4");
- parameterMapData.Add("fileName", "XXX.mp4");
- parameterMapData.Add("fileSize", "247767");
- parameterMapData.Add("md5", "9c3da8c5c07c2c660cd73c01f56d7fca");
- parameterMapData.Add("fileType", "mp4");
- list.Add(parameterMapData);
- }
- {
- Dictionary<string, object> parameterMapData = new Dictionary<string, object>();
- parameterMapData.Add("PXID", "16");
- parameterMapData.Add("TID", "16");
- parameterMapData.Add("url", "https://xxx.mp4");
- parameterMapData.Add("url2", "https://xxx.mp4");
- parameterMapData.Add("fileName", "XXX.mp4");
- parameterMapData.Add("fileSize", "247767");
- parameterMapData.Add("md5", "9c3da8c5c07c2c660cd73c01f56d7fca");
- parameterMapData.Add("fileType", "mp4");
- list.Add(parameterMapData);
- }
- UploadKTSLList = await _scsApisService.Post(_sc_url, Code, _sc_passKey, _sc_privateKey, parameterContent);
- UploadKTSLList.code = Code;
- UploadKTSLList.title = "5.3.1.17学员课堂实录批量回写";
- }
- catch (Exception ex) { }
- // 5.3.1.18根据机构ID、项目ID、子项目ID返回学校列表
- Code = "GetSchoolList";
- parameterMap = new Dictionary<string, object>();
- parameterMap.Add("TrainComID", trainComID);
- parameterMap.Add("ProjectID", "22");
- parameterMap.Add("ProjectItemID", "24");
- ScsResult GetSchoolList = await _scsApisService.Post(_sc_url, Code, _sc_passKey, _sc_privateKey, parameterMap);
- GetSchoolList.code = Code;
- GetSchoolList.title = "5.3.1.18根据机构ID、项目ID、子项目ID返回学校列表";
- // 5.3.1.19获取项目设置的可选能力点,
- Code = "GetProjectDiagnosis";
- parameterMap = new Dictionary<string, object>();
- parameterMap.Add("TrainComID", trainComID);
- parameterMap.Add("ProjectID", "22");
- parameterMap.Add("ProjectItemID", "21");
- ScsResult GetProjectDiagnosis = await _scsApisService.Post(_sc_url, Code, _sc_passKey, _sc_privateKey, parameterMap);
- GetProjectDiagnosis.code = Code;
- GetProjectDiagnosis.title = "5.3.1.19获取项目设置的可选能力点";
- // 5.3.1.20获取学校设置的可选能力点,
- Code = "GetSchoolDiagnosis";
- parameterMap = new Dictionary<string, object>();
- parameterMap.Add("TrainComID", trainComID);
- parameterMap.Add("ProjectID", "22");
- parameterMap.Add("ProjectItemID", "21");
- parameterMap.Add("SchoolID", "200001");
- ScsResult GetSchoolDiagnosis = await _scsApisService.Post(_sc_url, Code, _sc_passKey, _sc_privateKey, parameterMap);
- GetSchoolDiagnosis.code = Code;
- GetSchoolDiagnosis.title = "5.3.1.20获取学校设置的可选能力点";
- // 5.3.1.21分页获取学员名单
- Code = "GetTeachersPageListByProject";
- parameterMap = new Dictionary<string, object>();
- parameterMap.Add("TrainComID", trainComID);
- parameterMap.Add("ProjectID", "22");
- parameterMap.Add("ProjectItemID", "24");
- parameterMap.Add("curPage", "1");
- parameterMap.Add("pageSize", "10");
- ScsResult GetTeachersPageListByProject = await _scsApisService.Post(_sc_url, Code, _sc_passKey, _sc_privateKey, parameterMap);
- GetTeachersPageListByProject.code = Code;
- GetTeachersPageListByProject.title = "5.3.1.21分页获取学员名单";
- // 5.3.1.22学员校本教研PDF(每人可以返回多条)批量回写
- Code = "UploadSBTARPDFListV2";
- parameterContent = new Dictionary<string, object>();
- parameterContent.Add("TrainComID", trainComID);
- list = new List<Dictionary<string, object>>();
- parameterContent.Add("List", list);
- {
- Dictionary<string, object> parameterMapData = new Dictionary<string, object>();
- parameterMapData.Add("PXID", "65309");
- parameterMapData.Add("TID", "253940");
- List<Dictionary<string, object>> pfiles = new List<Dictionary<string, object>>();
- parameterMapData.Add("pfiles", pfiles);
- Dictionary<string, object> pfileMap = new Dictionary<string, object>();
- pfileMap.Add("url", "https://scnltsfiles.scedu.com.cn/upload/infofj/202104011628463774.pdf");
- pfileMap.Add("fileName", "XXX.pdf");
- pfileMap.Add("fileSize", "247767");
- pfileMap.Add("md5", "9c3da8c5c07c2c660cd73c01f56d7fca");
- pfileMap.Add("fileType", "pdf");
- pfiles.Add(pfileMap);
- pfileMap = new Dictionary<string, object>(); //添加第二个校本研修方案
- pfileMap.Add("url", "https://scnltsfiles.scedu.com.cn/upload/infofj/202104011628463774.pdf");
- pfileMap.Add("fileName", "XXX.pdf");
- pfileMap.Add("fileSize", "247767");
- pfileMap.Add("md5", "9c3da8c5c07c2c660cd73c01f56d7fca");
- pfileMap.Add("fileType", "pdf");
- pfiles.Add(pfileMap);
- parameterMapData.Add("files", pfiles);
- list.Add(parameterMapData);
- }
- {
- Dictionary<string, object> parameterMapData = new Dictionary<string, object>();
- parameterMapData.Add("PXID", "65306");
- parameterMapData.Add("TID", "32393");
- List<Dictionary<string, object>> pfiles = new List<Dictionary<string, object>>();
- parameterMapData.Add("pfiles", pfiles);
- Dictionary<string, object> pfileMap = new Dictionary<string, object>();
- pfileMap.Add("url", "https://scnltsfiles.scedu.com.cn/upload/infofj/202104011628463774.pdf");
- pfileMap.Add("fileName", "XXX.pdf");
- pfileMap.Add("fileSize", "247767");
- pfileMap.Add("md5", "9c3da8c5c07c2c660cd73c01f56d7fca");
- pfileMap.Add("fileType", "pdf");
- pfiles.Add(pfileMap);
- pfileMap = new Dictionary<string, object>(); //添加第二个校本研修方案
- pfileMap.Add("url", "https://scnltsfiles.scedu.com.cn/upload/infofj/202104011628463774.pdf");
- pfileMap.Add("fileName", "XXX.pdf");
- pfileMap.Add("fileSize", "247767");
- pfileMap.Add("md5", "9c3da8c5c07c2c660cd73c01f56d7fca");
- pfileMap.Add("fileType", "pdf");
- pfiles.Add(pfileMap);
- parameterMapData.Add("files", pfiles);
- list.Add(parameterMapData);
- }
- ScsResult UploadSBTARPDFListV2 = await _scsApisService.Post(_sc_url, Code, _sc_passKey, _sc_privateKey, parameterContent);
- UploadSBTARPDFListV2.code = Code;
- UploadSBTARPDFListV2.title = "5.3.1.22学员校本教研PDF(每人可以返回多条)批量回写";
- return Ok(new
- {
- GetProjectInfoByTrainComID,
- GetTeachersListByProject,
- GetDiagnosisListByProject,
- GetDiagnosisListByProject_V2,
- UpdateTeacherSituation,
- UpdateTeacherDiagnosis,
- GetDiagnosisDic,
- GetDiagnosisItemDic,
- GetchoiceDic,
- GetTeacherInfoByPXID,
- GetSchoolPlanBySchoolID,
- GetSingleTeacherByProject,
- UpdateTeacherListSituation,
- UpdateTeacherListDiagnosis,
- UploadSBTARPDF,
- UploadSBTARPDFList,
- UploadKTSL,
- UploadKTSLList,
- GetSchoolList,
- GetProjectDiagnosis,
- GetSchoolDiagnosis,
- GetTeachersPageListByProject,
- UploadSBTARPDFListV2
- });
- //return Ok(GetProjectInfoByTrainComID);
- }
- public record ScSSO{
- public string Webid { get; set; }
- public string Pxid { get; set; }
- public string tid { get; set; }
- public string time { get; set; }
- public string Encrypt { get; set; }
- // public string data { get; set; }
- }
- public record ScSSOData
- {
- public string path { get; set; }
- public string Pxid { get; set; }
- public string tid { get; set; }
- public string time { get; set; }
- public string Encrypt { get; set; }
- public string data { get; set; }
- }
- public record SSO
- {
- public string type { get; set; }
- public string param { get; set; }
- public string id_token { get; set; }
- }
- public record TmdidImplicit {
- public string id_token { get; set; }
- public string access_token { get; set; }
- public string expires_in { get; set; }
- public string token_type { get; set; }
- }
- }
- }
|