|
|
@@ -27,7 +27,7 @@ namespace Learun.Application.WebApi |
|
|
|
{ |
|
|
|
private EmpInfoIBLL empInfoIBLL = new EmpInfoBLL(); |
|
|
|
private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL(); |
|
|
|
private CdDeptIBLL cdDeptIBLL = new CdDeptBLL(); |
|
|
|
private DepartmentIBLL departmentIBLL = new DepartmentBLL(); |
|
|
|
private UserIBLL userIBLL = new UserBLL(); |
|
|
|
|
|
|
|
/// <summary> |
|
|
@@ -37,7 +37,7 @@ namespace Learun.Application.WebApi |
|
|
|
: base("/TransferApi/BasicInfo") |
|
|
|
{ |
|
|
|
//发送部门基础信息 |
|
|
|
Get["/sendDeptInfo"] = SendDeptInfo; |
|
|
|
Get["/sendDepartmentInfo"] = SendDepartmentInfo; |
|
|
|
//发送教师基础信息 |
|
|
|
Get["/sendTeacherInfo"] = SendTeacherInfo; |
|
|
|
//发送学生基础信息 |
|
|
@@ -79,7 +79,7 @@ namespace Learun.Application.WebApi |
|
|
|
/// <summary> |
|
|
|
/// <param name="_"></param> |
|
|
|
/// <returns></returns> |
|
|
|
public Response SendDeptInfo(dynamic _) |
|
|
|
public Response SendDepartmentInfo(dynamic _) |
|
|
|
{ |
|
|
|
var result = new List<string>(); |
|
|
|
|
|
|
@@ -88,26 +88,32 @@ namespace Learun.Application.WebApi |
|
|
|
//调登录接口拿到cookie |
|
|
|
GetCookie(); |
|
|
|
} |
|
|
|
var deptList = cdDeptIBLL.GetAllList(); |
|
|
|
foreach (var item in deptList) |
|
|
|
var departmentList = departmentIBLL.GetAllList().Where(x => x.SendFlag == false); |
|
|
|
foreach (var item in departmentList) |
|
|
|
{ |
|
|
|
var param = new |
|
|
|
{ |
|
|
|
ParentCode = "iccsid", |
|
|
|
ParentCode = string.IsNullOrEmpty(item.F_ParentId) || item.F_ParentId == "0" ? "iccsid" : (departmentIBLL.GetEntity(item.F_ParentId) == null ? "iccsid" : departmentIBLL.GetEntity(item.F_ParentId)?.F_EnCode), |
|
|
|
pageSize = 10, |
|
|
|
Name = "部门5", |
|
|
|
Code = "5", |
|
|
|
Name = item.F_FullName, |
|
|
|
Code = item.F_EnCode, |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
var responseSend = SendRequestWithCookie("POST", "application/json;charset=utf-8", @"http://172.70.0.4:8088/fastgate/department", Encoding.UTF8, JsonConvert.SerializeObject(param)); |
|
|
|
var responseSendObj = JsonConvert.DeserializeObject<dynamic>(responseSend); |
|
|
|
|
|
|
|
result.Add("部门编号" + item.DeptNo + ",新增接口结果:" + responseSendObj.ErrCode + responseSendObj.ErrMsg); |
|
|
|
result.Add("部门编号" + item.F_EnCode + ",新增接口结果:" + responseSendObj.ErrCode + responseSendObj.ErrMsg); |
|
|
|
|
|
|
|
if (responseSendObj.ErrCode == 200) |
|
|
|
{ |
|
|
|
//第三方新增成功,修改表-发送标识为true |
|
|
|
//TODO: |
|
|
|
var entity = departmentIBLL.GetEntity(item.F_DepartmentId); |
|
|
|
if (entity != null) |
|
|
|
{ |
|
|
|
entity.SendFlag = true; |
|
|
|
departmentIBLL.SaveEntity2(entity.F_DepartmentId, entity); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (responseSendObj.ErrCode == 1010) //{ "ErrCode":1010,"ErrMsg":"登录状态已失效"} |
|
|
|
{ |
|
|
@@ -119,19 +125,25 @@ namespace Learun.Application.WebApi |
|
|
|
//调修改接口 |
|
|
|
var param2 = new |
|
|
|
{ |
|
|
|
Code = "5", |
|
|
|
Name = "部门bm5", |
|
|
|
Code = item.F_EnCode, |
|
|
|
Name = item.F_FullName, |
|
|
|
pageSize = 10, |
|
|
|
}; |
|
|
|
var responseSend2 = SendRequestWithCookie("PUT", "application/json;charset=utf-8", @"http://172.70.0.4:8088/fastgate/department", Encoding.UTF8, JsonConvert.SerializeObject(param2)); |
|
|
|
var responseSendObj2 = JsonConvert.DeserializeObject<dynamic>(responseSend2); |
|
|
|
|
|
|
|
result.Add("部门编号" + item.DeptNo + ",修改接口结果:" + responseSendObj2.ErrCode + responseSendObj2.ErrMsg); |
|
|
|
result.Add("部门编号" + item.F_EnCode + ",修改接口结果:" + responseSendObj2.ErrCode + responseSendObj2.ErrMsg); |
|
|
|
|
|
|
|
if (responseSendObj2.ErrCode == 200) |
|
|
|
{ |
|
|
|
//第三方修改成功,修改表-发送标识为true |
|
|
|
//TODO: |
|
|
|
var entity = departmentIBLL.GetEntity(item.F_DepartmentId); |
|
|
|
if (entity != null) |
|
|
|
{ |
|
|
|
entity.SendFlag = true; |
|
|
|
departmentIBLL.SaveEntity2(entity.F_DepartmentId, entity); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
@@ -172,7 +184,7 @@ namespace Learun.Application.WebApi |
|
|
|
var param = BuildQuery2(parameters, "----WebKitFormBoundaryAOT8GpQYYAP9jgGf"); |
|
|
|
var contentType = "multipart/form-data; boundary=----WebKitFormBoundaryAOT8GpQYYAP9jgGf"; |
|
|
|
|
|
|
|
var responseSend = SendRequestWithCookie("POST",contentType, @"http://172.70.0.4:8088/fastgate/person", Encoding.UTF8, param); |
|
|
|
var responseSend = SendRequestWithCookie("POST", contentType, @"http://172.70.0.4:8088/fastgate/person", Encoding.UTF8, param); |
|
|
|
var responseSendObj = JsonConvert.DeserializeObject<dynamic>(responseSend); |
|
|
|
|
|
|
|
result.Add("教师编号,新增接口结果:" + responseSendObj.ErrCode + responseSendObj.ErrMsg); |
|
|
|