ソースを参照

西昌同步部门(部门负责人、备注等)

master
dao 8ヶ月前
コミット
09e1a2229d
1個のファイルの変更53行の追加42行の削除
  1. +53
    -42
      DigitalSchoolApi/Controllers/YKTTrabs.cs

+ 53
- 42
DigitalSchoolApi/Controllers/YKTTrabs.cs ファイルの表示

@@ -813,7 +813,7 @@ namespace DigitalSchoolApi.Controllers
conncore.Execute(
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),121,'typecode','开票typecode:" + item.Key + "',getdate())");
}
InvoiceEBillByTypeTwo(conn,orderEntity, item.Key, item);
InvoiceEBillByTypeTwo(conn, orderEntity, item.Key, item);
}
catch (Exception ex)
{
@@ -1030,7 +1030,7 @@ namespace DigitalSchoolApi.Controllers
}
}

private static void InvoiceEBillByTypeTwo(IDbConnection conn,FinaChargeStuOrderEntity orderEntity, string billCode, IGrouping<string, FinaChargeStuYearItemEntity> stuEnrollFeeOrderDetailList)
private static void InvoiceEBillByTypeTwo(IDbConnection conn, FinaChargeStuOrderEntity orderEntity, string billCode, IGrouping<string, FinaChargeStuYearItemEntity> stuEnrollFeeOrderDetailList)
{
Encoding encoding = Encoding.UTF8;
string StuName = conn.QuerySingle("select StuName from FinaChargeStudent where stuno='" + orderEntity.StuNo + "'").StuName;
@@ -1465,37 +1465,7 @@ namespace DigitalSchoolApi.Controllers

#endregion

using (IDbConnection db =new SqlConnection(_coresqlConnection))
{

#region 部门
List<DepartmentEntity> departments = db.Query<DepartmentEntity>("select * from LR_Base_Department").ToList();
int anumDept = 0;
int unumDept = 0;
foreach (var item in depts)
{
try
{
if(departments.Any(x=>x.F_DepartmentId==item.ID))
{
var sql = $"update LR_Base_Department set F_FullName='{item.NAME_}',F_ParentId='{item.PID}',F_EnCode='{item.ID}',F_ShortName='{item.NAME_SHORT}',F_CreateDate='{DateTime.Now}' where F_DepartmentId='{item.ID}'";
anumDept += db.Execute(sql);
}
else
{
var sql = $"insert into LR_Base_Department (F_DepartmentId,F_CompanyId,F_ParentId,F_EnCode,F_FullName,F_ShortName,F_SortCode,F_DeleteMark,F_EnabledMark,F_CreateDate,F_Order) values ('{item.ID}','207fa1a9-160c-4943-a89b-8fa4db0547ce','{item.PID}','{item.ID}','{item.NAME_}','{item.NAME_SHORT}',0,0,1,'{DateTime.Now}',0)";
anumDept += db.Execute(sql);
}
}
catch (Exception ex)
{
db.Execute(
$"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),55555,'更新部门数据','编号({item.ID}),姓名({item.NAME_})更新时出现异常:{ex.Message}',getdate())");
}
}

#endregion
}
var teachinfo = new List<TeachModel>();

using (IDbConnection conncores = new SqlConnection(_sqlConnection))
{
@@ -1532,7 +1502,7 @@ namespace DigitalSchoolApi.Controllers
sb.Remove(sb.ToString().LastIndexOf(","), 1);
}
//修改条件
sb.Append($" where MajorNo='{item.CODE_ }' and MajorName='{item.NAME_}'");
sb.Append($" where MajorNo='{item.CODE_}' and MajorName='{item.NAME_}'");
unumMajor += conncores.Execute(sb.ToString());
}
else
@@ -1592,7 +1562,7 @@ namespace DigitalSchoolApi.Controllers
sb.Remove(sb.ToString().LastIndexOf(","), 1);
}
//修改条件
sb.Append($" where lessonno='{item.CODE_ }' and lessonName='{item.NAME_}'");
sb.Append($" where lessonno='{item.CODE_}' and lessonName='{item.NAME_}'");
unumlesson += conncores.Execute(sb.ToString());
}
else
@@ -1619,9 +1589,9 @@ namespace DigitalSchoolApi.Controllers
}

#endregion
#region 教师信息
List<TeachModel> teachinfo = conncores.Query<TeachModel>("select * from empinfo").ToList();
teachinfo = conncores.Query<TeachModel>("select * from empinfo").ToList();
int anumTeach = 0;
int unumTeach = 0;
foreach (var item in jsxx)
@@ -1678,7 +1648,7 @@ namespace DigitalSchoolApi.Controllers
sb.Remove(sb.ToString().LastIndexOf(","), 1);
}
//修改条件
sb.Append($" where empno='{item.TEA_NO }' and empName='{item.NAME_}'");
sb.Append($" where empno='{item.TEA_NO}' and empName='{item.NAME_}'");
unumTeach += conncores.Execute(sb.ToString());
}
else
@@ -1764,7 +1734,7 @@ namespace DigitalSchoolApi.Controllers
sb.Remove(sb.ToString().LastIndexOf(","), 1);
}
//修改条件
sb.Append($" where classno='{item.NO_ }' and className='{item.NAME_}'");
sb.Append($" where classno='{item.NO_}' and className='{item.NAME_}'");
unumClass += conncores.Execute(sb.ToString());
}
else
@@ -1849,7 +1819,7 @@ namespace DigitalSchoolApi.Controllers
sb.Remove(sb.ToString().LastIndexOf(","), 1);
}
//修改条件
sb.Append($" where classroomno='{item.CODE_ }' and classroomName='{item.NAME_}'");
sb.Append($" where classroomno='{item.CODE_}' and classroomName='{item.NAME_}'");
unumCroom += conncores.Execute(sb.ToString());
}
else
@@ -1881,6 +1851,47 @@ namespace DigitalSchoolApi.Controllers
#endregion
}

using (IDbConnection db = new SqlConnection(_coresqlConnection))
{

#region 部门
List<DepartmentEntity> departments = db.Query<DepartmentEntity>("select * from LR_Base_Department").ToList();
int anumDept = 0;
int unumDept = 0;
foreach (var item in depts)
{
try
{
if (item.LEVEL_TYPE.ToLower() != "xx" && item.LEVEL_TYPE.ToLower() != "zy")
{
var manager = string.Empty;
if (!string.IsNullOrWhiteSpace(item.ADMIN_MANAGE_TEA_NO))
{
manager = teachinfo.FirstOrDefault(x => x.EmpNo == item.ADMIN_MANAGE_TEA_NO)?.EmpId ?? "";
}
if (departments.Any(x => x.F_DepartmentId == item.ID))
{
var sql = $"update LR_Base_Department set F_FullName='{item.NAME_}',F_ParentId='{item.PID}',F_EnCode='{item.CODE_}',F_ShortName='{item.NAME_SHORT}',F_Manager='{manager}',F_Description='{item.LEVEL_TYPE}',F_CreateDate='{DateTime.Now}' where F_DepartmentId='{item.ID}'";
anumDept += db.Execute(sql);
}
else
{
var sql = $"insert into LR_Base_Department (F_DepartmentId,F_CompanyId,F_ParentId,F_EnCode,F_FullName,F_ShortName,F_Manager,F_Description,F_SortCode,F_DeleteMark,F_EnabledMark,F_CreateDate,F_Order) values ('{item.ID}','207fa1a9-160c-4943-a89b-8fa4db0547ce','{item.PID}','{item.CODE_}','{item.NAME_}','{item.NAME_SHORT}','{manager}','{item.LEVEL_TYPE}',0,0,1,'{DateTime.Now}',0)";
anumDept += db.Execute(sql);
}
}

}
catch (Exception ex)
{
db.Execute(
$"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),55555,'更新部门数据','编号({item.ID}),姓名({item.NAME_})更新时出现异常:{ex.Message}',getdate())");
}
}

#endregion
}
//获取oracle学生数据
//List<XCStudentEntity> xcStudentList = conn_oracle.Query<XCStudentEntity>(@"select ID,stu_no,name_,
//(case when dept_id in ('01','02','03') then dept_id when dept_id='00' then '06' when dept_id='23' then '04' when dept_id='06' then '07' else '' end )as dept_id,
@@ -1947,7 +1958,7 @@ namespace DigitalSchoolApi.Controllers
}
if (!string.IsNullOrEmpty(item.SEX_CODE))
{
sb.Append(" GenderNo='"+(item.SEX_CODE=="1"?"1":"0")+"',");
sb.Append(" GenderNo='" + (item.SEX_CODE == "1" ? "1" : "0") + "',");
}
//民族
if (!string.IsNullOrEmpty(item.NATION_CODE))
@@ -2138,7 +2149,7 @@ namespace DigitalSchoolApi.Controllers
sb.Append($" '{xsxx.ENROLL_GRADE.ToString().Substring(2)}',");
}

if (xsxx.IS_NORMAL!=null)
if (xsxx.IS_NORMAL != null)
{
fieleSb.Append("InSchoolStatus,");
sb.Append(" '" + (xsxx.IS_NORMAL) + "',");


読み込み中…
キャンセル
保存