Commit b5109042 authored by 黄奎's avatar 黄奎

代码优化

parent f054df5f
...@@ -10,12 +10,12 @@ namespace Edu.Education.Helper ...@@ -10,12 +10,12 @@ namespace Edu.Education.Helper
/// </summary> /// </summary>
public class LogHelper public class LogHelper
{ {
private static string logDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "log/error"); private static readonly string logDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "log/error");
private static string infoLogDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "log/info"); private static readonly string infoLogDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "log/info");
private static string requestLogDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "log/request"); private static readonly string requestLogDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "log/request");
private static object objError = new object(); private static readonly object objError = new object();
private static object objInfo = new object(); private static readonly object objInfo = new object();
private static object objRequest = new object(); private static readonly object objRequest = new object();
/// <summary> /// <summary>
/// 构造函数 /// 构造函数
......
...@@ -22,7 +22,7 @@ namespace Edu.Education.Helper ...@@ -22,7 +22,7 @@ namespace Edu.Education.Helper
/// <returns></returns> /// <returns></returns>
public async Task TeachingPerfTimer() public async Task TeachingPerfTimer()
{ {
string cronExpression = "0 0 */1 * * ?"; //每天凌晨1点 //string cronExpression = "0 0 */1 * * ?"; //每天凌晨1点
NameValueCollection props = new NameValueCollection NameValueCollection props = new NameValueCollection
{ {
{ "quartz.serializer.type", "binary" } { "quartz.serializer.type", "binary" }
......
...@@ -19,15 +19,15 @@ namespace Edu.Module.User ...@@ -19,15 +19,15 @@ namespace Edu.Module.User
/// </summary> /// </summary>
public class AttendanceModule public class AttendanceModule
{ {
private Rb_attendanceRepository respository = new Rb_attendanceRepository(); private readonly Rb_attendanceRepository respository = new Rb_attendanceRepository();
private Rb_attendance_wayRepository AWrespository = new Rb_attendance_wayRepository(); private readonly Rb_attendance_wayRepository AWrespository = new Rb_attendance_wayRepository();
private Rb_workdaysetingRepository WDrespository = new Rb_workdaysetingRepository(); private readonly Rb_workdaysetingRepository WDrespository = new Rb_workdaysetingRepository();
private Rb_technicaldatesRepository TDrespository = new Rb_technicaldatesRepository(); private readonly Rb_technicaldatesRepository TDrespository = new Rb_technicaldatesRepository();
private Rb_Workflow_AskforleaveRepository AskforleaveRepository = new Rb_Workflow_AskforleaveRepository(); private readonly Rb_Workflow_AskforleaveRepository AskforleaveRepository = new Rb_Workflow_AskforleaveRepository();
private Rb_technicaldatesRepository technicaldatesRepository = new Rb_technicaldatesRepository(); private readonly Rb_technicaldatesRepository technicaldatesRepository = new Rb_technicaldatesRepository();
private Rb_workdaysetingRepository workdaysetingRepository = new Rb_workdaysetingRepository(); private readonly Rb_workdaysetingRepository workdaysetingRepository = new Rb_workdaysetingRepository();
private Rb_attendance_recordRepository RecordRepository = new Rb_attendance_recordRepository(); private readonly Rb_attendance_recordRepository RecordRepository = new Rb_attendance_recordRepository();
private Rb_dictvalueRepository dictvalueRepository = new Rb_dictvalueRepository(); private readonly Rb_dictvalueRepository dictvalueRepository = new Rb_dictvalueRepository();
/// <summary> /// <summary>
/// 部门 /// 部门
......
...@@ -21,11 +21,11 @@ namespace Edu.Module.User ...@@ -21,11 +21,11 @@ namespace Edu.Module.User
/// </summary> /// </summary>
public class AttendanceRecodModule public class AttendanceRecodModule
{ {
private Rb_attendanceRepository respository = new Rb_attendanceRepository(); private readonly Rb_attendanceRepository respository = new Rb_attendanceRepository();
private Rb_attendance_wayRepository AWrespository = new Rb_attendance_wayRepository(); private readonly Rb_attendance_wayRepository AWrespository = new Rb_attendance_wayRepository();
private Rb_workdaysetingRepository WDrespository = new Rb_workdaysetingRepository(); private readonly Rb_workdaysetingRepository WDrespository = new Rb_workdaysetingRepository();
private Rb_technicaldatesRepository TDrespository = new Rb_technicaldatesRepository(); private readonly Rb_technicaldatesRepository TDrespository = new Rb_technicaldatesRepository();
private Rb_attendance_recordRepository attendRecordRespository = new Rb_attendance_recordRepository(); private readonly Rb_attendance_recordRepository attendRecordRespository = new Rb_attendance_recordRepository();
/// <summary> /// <summary>
...@@ -119,7 +119,7 @@ namespace Edu.Module.User ...@@ -119,7 +119,7 @@ namespace Edu.Module.User
result["onStatus"] = (int)recode.BeOnStatus; result["onStatus"] = (int)recode.BeOnStatus;
result["onPunshCardTime"] = recode.BeOnDutyTime == null ? "" : recode.BeOnDutyTime.Value.ToString("HH:mm"); result["onPunshCardTime"] = recode.BeOnDutyTime == null ? "" : recode.BeOnDutyTime.Value.ToString("HH:mm");
result["onPunshCardAddress"] = recode.BeOnVerifyAddress; result["onPunshCardAddress"] = recode.BeOnVerifyAddress;
result["isLackCard"] = recode.BeOnStatus == AttendanceEnum.QK ? true : false; result["isLackCard"] = recode.BeOnStatus == AttendanceEnum.QK;
result["offStatus"] = (int)recode.OffStatus; result["offStatus"] = (int)recode.OffStatus;
result["offPunshCardTime"] = recode.OffDutyTime?.ToString("HH:mm"); result["offPunshCardTime"] = recode.OffDutyTime?.ToString("HH:mm");
result["offPunshCardAddress"] = recode.OffVerifyAddress; result["offPunshCardAddress"] = recode.OffVerifyAddress;
......
...@@ -21,16 +21,16 @@ namespace Edu.Module.User ...@@ -21,16 +21,16 @@ namespace Edu.Module.User
/// </summary> /// </summary>
public class WorkFlowManagementModule public class WorkFlowManagementModule
{ {
private Rb_Workflow_TemplateRepository respository = new Rb_Workflow_TemplateRepository(); private readonly Rb_Workflow_TemplateRepository respository = new Rb_Workflow_TemplateRepository();
private Rb_Workflow_AuditRepository respositoryAudit = new Rb_Workflow_AuditRepository(); private readonly Rb_Workflow_AuditRepository respositoryAudit = new Rb_Workflow_AuditRepository();
private Rb_Workflow_AuditUserRepository respositoryUser = new Rb_Workflow_AuditUserRepository(); private readonly Rb_Workflow_AuditUserRepository respositoryUser = new Rb_Workflow_AuditUserRepository();
private Rb_Workflow_ConditionRepository respositoryCondition = new Rb_Workflow_ConditionRepository(); private readonly Rb_Workflow_ConditionRepository respositoryCondition = new Rb_Workflow_ConditionRepository();
private Rb_Workflow_AskforleaveRepository respositoryAskforleave = new Rb_Workflow_AskforleaveRepository(); private readonly Rb_Workflow_AskforleaveRepository respositoryAskforleave = new Rb_Workflow_AskforleaveRepository();
private Rb_Workflow_EvectionRepository respositoryEvection = new Rb_Workflow_EvectionRepository(); private readonly Rb_Workflow_EvectionRepository respositoryEvection = new Rb_Workflow_EvectionRepository();
private Rb_Workflow_GoOutRepository respositoryGoout = new Rb_Workflow_GoOutRepository(); private readonly Rb_Workflow_GoOutRepository respositoryGoout = new Rb_Workflow_GoOutRepository();
private Rb_Workflow_ReissuecardRepository respositoryReissuecar = new Rb_Workflow_ReissuecardRepository(); private readonly Rb_Workflow_ReissuecardRepository respositoryReissuecar = new Rb_Workflow_ReissuecardRepository();
private Rb_Workflow_VisualrangeRepository visualrangeRepository = new Rb_Workflow_VisualrangeRepository(); private readonly Rb_Workflow_VisualrangeRepository visualrangeRepository = new Rb_Workflow_VisualrangeRepository();
private RB_AccountRepository accountRepository = new RB_AccountRepository(); private readonly RB_AccountRepository accountRepository = new RB_AccountRepository();
/// <summary> /// <summary>
...@@ -169,7 +169,7 @@ namespace Edu.Module.User ...@@ -169,7 +169,7 @@ namespace Edu.Module.User
} }
if (askType != "") if (askType != "")
{ {
description = description + askType.Substring(0, askType.Length - 1); description += askType.Substring(0, askType.Length - 1);
} }
description += " 并且 "; description += " 并且 ";
} }
......
This diff is collapsed.
...@@ -12,12 +12,18 @@ namespace Edu.ThirdCore.Message ...@@ -12,12 +12,18 @@ namespace Edu.ThirdCore.Message
/// </summary> /// </summary>
public class SMSService public class SMSService
{ {
/// <summary> /// <summary>
/// 发送证码 /// 发送证码
/// </summary> /// </summary>
/// <param name="phoneNumber">电话号码</param> /// <param name="phoneNumber">电话号码</param>
/// <param name="code">验证码</param> /// <param name="code">验证码</param>
/// <param name="templateCode"></param>
/// <param name="SignName"></param>
/// <param name="Domain"></param>
/// <param name="AccessKeyId"></param>
/// <param name="AccessKeySecret"></param>
/// <param name="RegionId"></param>
/// <param name="OutId"></param>
public static void SendCode(string phoneNumber, string code, string templateCode, string SignName, string Domain, string AccessKeyId, string AccessKeySecret, string RegionId, string OutId) public static void SendCode(string phoneNumber, string code, string templateCode, string SignName, string Domain, string AccessKeyId, string AccessKeySecret, string RegionId, string OutId)
{ {
JObject obj = new JObject JObject obj = new JObject
...@@ -59,7 +65,6 @@ namespace Edu.ThirdCore.Message ...@@ -59,7 +65,6 @@ namespace Edu.ThirdCore.Message
var TemplateParam = new { content }; var TemplateParam = new { content };
obj["OutId"] = OutId; obj["OutId"] = OutId;
obj["templateParam"] = JsonConvert.SerializeObject(TemplateParam); obj["templateParam"] = JsonConvert.SerializeObject(TemplateParam);
//LogHelper.WriteInfo("发送短信信息");
QueueHelper.EnqueueTask(JsonConvert.SerializeObject(obj)); QueueHelper.EnqueueTask(JsonConvert.SerializeObject(obj));
} }
......
using System; using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Edu.Cache.User; using Edu.Cache.User;
using Edu.Common.API; using Edu.Common.API;
using Edu.Common.Enum.Course; using Edu.Common.Enum.Course;
...@@ -10,7 +7,6 @@ using Edu.Model.ViewModel.Course; ...@@ -10,7 +7,6 @@ using Edu.Model.ViewModel.Course;
using Edu.Module.Course; using Edu.Module.Course;
using Edu.WebApi.Filter; using Edu.WebApi.Filter;
using Microsoft.AspNetCore.Cors; using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
......
...@@ -317,7 +317,7 @@ namespace Edu.WebApi.Controllers.Finance ...@@ -317,7 +317,7 @@ namespace Edu.WebApi.Controllers.Finance
ExcelDataSource thirdRow = new ExcelDataSource(30) ExcelDataSource thirdRow = new ExcelDataSource(30)
{ {
ExcelRows = new List<ExcelColumn>() { ExcelRows = new List<ExcelColumn>() {
new ExcelColumn(value: $"开班时间:{classInfo.OpenTime.ToString("yyyy-MM-dd")}",colspan:2){ new ExcelColumn(value: $"开班时间:{classInfo.OpenTime:yyyy-MM-dd}",colspan:2){
HAlignmentEnum= HAlignmentEnum.LEFT, HAlignmentEnum= HAlignmentEnum.LEFT,
}, },
new ExcelColumn(value:$"待收:¥{(IncomeReceive-IncomeActual)}",colspan:2) new ExcelColumn(value:$"待收:¥{(IncomeReceive-IncomeActual)}",colspan:2)
......
...@@ -840,6 +840,16 @@ namespace Edu.WebApi.Controllers.User ...@@ -840,6 +840,16 @@ namespace Edu.WebApi.Controllers.User
case AttendanceEnum.CD: case AttendanceEnum.CD:
TimeStr = "上班迟到" + EmTime.BeLateTime + "分钟<br/>"; TimeStr = "上班迟到" + EmTime.BeLateTime + "分钟<br/>";
break; break;
case AttendanceEnum.ZC:
break;
case AttendanceEnum.WQ:
break;
case AttendanceEnum.CC:
break;
case AttendanceEnum.QJ:
break;
case AttendanceEnum.BK:
break;
default: TimeStr = ""; break; default: TimeStr = ""; break;
} }
} }
...@@ -904,6 +914,16 @@ namespace Edu.WebApi.Controllers.User ...@@ -904,6 +914,16 @@ namespace Edu.WebApi.Controllers.User
case AttendanceEnum.CD: case AttendanceEnum.CD:
TimeStr += "下班迟到" + EmTime.BeLateTime + "分钟"; TimeStr += "下班迟到" + EmTime.BeLateTime + "分钟";
break; break;
case AttendanceEnum.ZC:
break;
case AttendanceEnum.WQ:
break;
case AttendanceEnum.CC:
break;
case AttendanceEnum.QJ:
break;
case AttendanceEnum.BK:
break;
default: TimeStr += ""; break; default: TimeStr += ""; break;
} }
} }
...@@ -1616,6 +1636,16 @@ namespace Edu.WebApi.Controllers.User ...@@ -1616,6 +1636,16 @@ namespace Edu.WebApi.Controllers.User
case AttendanceEnum.CD: case AttendanceEnum.CD:
TimeStr = "上班迟到" + EmTime.BeLateTime + "分钟\r\n"; TimeStr = "上班迟到" + EmTime.BeLateTime + "分钟\r\n";
break; break;
case AttendanceEnum.ZC:
break;
case AttendanceEnum.WQ:
break;
case AttendanceEnum.CC:
break;
case AttendanceEnum.QJ:
break;
case AttendanceEnum.BK:
break;
default: TimeStr = ""; break; default: TimeStr = ""; break;
} }
} }
...@@ -1680,6 +1710,16 @@ namespace Edu.WebApi.Controllers.User ...@@ -1680,6 +1710,16 @@ namespace Edu.WebApi.Controllers.User
case AttendanceEnum.CD: case AttendanceEnum.CD:
TimeStr += "下班迟到" + EmTime.BeLateTime + "分钟"; TimeStr += "下班迟到" + EmTime.BeLateTime + "分钟";
break; break;
case AttendanceEnum.ZC:
break;
case AttendanceEnum.WQ:
break;
case AttendanceEnum.CC:
break;
case AttendanceEnum.QJ:
break;
case AttendanceEnum.BK:
break;
default: TimeStr += ""; break; default: TimeStr += ""; break;
} }
} }
...@@ -1955,12 +1995,10 @@ namespace Edu.WebApi.Controllers.User ...@@ -1955,12 +1995,10 @@ namespace Edu.WebApi.Controllers.User
return ApiResult.ParamIsNull("手机标识码为空"); return ApiResult.ParamIsNull("手机标识码为空");
} }
UserInfo userInfo = UserReidsCache.GetUserLoginInfo(RequestParm.Uid); UserInfo userInfo = UserReidsCache.GetUserLoginInfo(RequestParm.Uid);
string date = JsonHelper.GetStringValue(parm, "date");
wifiMac = GetMdifyWifiMac(wifiMac); wifiMac = GetMdifyWifiMac(wifiMac);
LogHelper.WriteInfo($"打卡信息:{JsonConvert.SerializeObject(RequestParm)}-->更新后的mac:{wifiMac}"); LogHelper.WriteInfo($"打卡信息:{JsonConvert.SerializeObject(RequestParm)}-->更新后的mac:{wifiMac}");
int PunchCardType;
bool isNotVerifyVifi = JudgeNotVerifyVifi(version, userInfo.Id); bool isNotVerifyVifi = JudgeNotVerifyVifi(version, userInfo.Id);
string result = attendRecodeModule.PunchCard(userInfo.Id, userInfo.DeptId, latAndLong, wifiMac, oldWifiMac, phoneId, address, PhoneName, out PunchCardType, isNotVerifyVifi); string result = attendRecodeModule.PunchCard(userInfo.Id, userInfo.DeptId, latAndLong, wifiMac, oldWifiMac, phoneId, address, PhoneName, out int PunchCardType, isNotVerifyVifi);
var resultData = new { punchCardType = PunchCardType }; var resultData = new { punchCardType = PunchCardType };
if (result.Equals("ok")) if (result.Equals("ok"))
{ {
......
...@@ -1296,7 +1296,7 @@ namespace Edu.WebApi.Controllers.User ...@@ -1296,7 +1296,7 @@ namespace Edu.WebApi.Controllers.User
/// <returns></returns> /// <returns></returns>
public string GetImagePath(string path) public string GetImagePath(string path)
{ {
path = path ?? "[]"; path ??= "[]";
path = path == "" ? "[]" : path; path = path == "" ? "[]" : path;
string[] pathstr = JsonConvert.DeserializeObject<string[]>(path); string[] pathstr = JsonConvert.DeserializeObject<string[]>(path);
List<string> pathList = new List<string>(); List<string> pathList = new List<string>();
...@@ -1314,7 +1314,7 @@ namespace Edu.WebApi.Controllers.User ...@@ -1314,7 +1314,7 @@ namespace Edu.WebApi.Controllers.User
/// <returns></returns> /// <returns></returns>
public string GetStatusColor(WFRrocessStatus? status) public string GetStatusColor(WFRrocessStatus? status)
{ {
string color = ""; string color;
switch (status) switch (status)
{ {
case WFRrocessStatus.NotAudit: color = "#257BF1"; break; case WFRrocessStatus.NotAudit: color = "#257BF1"; break;
...@@ -1404,12 +1404,11 @@ namespace Edu.WebApi.Controllers.User ...@@ -1404,12 +1404,11 @@ namespace Edu.WebApi.Controllers.User
/// <returns></returns> /// <returns></returns>
public ApiResult GetWfTmplateType() public ApiResult GetWfTmplateType()
{ {
int empId = Convert.ToInt32(RequestParm.Uid);
List<Rb_Workflow_Template_Extend> wfTemplateList = workFlowModule.GetTemplateByEmpId(empId);
var dicTemplate = EnumHelper.EnumToList(typeof(WFTTemplateTypeEnum)); var dicTemplate = EnumHelper.EnumToList(typeof(WFTTemplateTypeEnum));
List<Dictionary<string, int>> TemplateList = new List<Dictionary<string, int>>(); List<Dictionary<string, int>> TemplateList = new List<Dictionary<string, int>>
Dictionary<string, int> dicTemplateData = new Dictionary<string, int>(); {
TemplateList.Add(new Dictionary<string, int> { { "全部", 0 } }); new Dictionary<string, int> { { "全部", 0 } }
};
foreach (var item in dicTemplate) foreach (var item in dicTemplate)
{ {
string[] tempTypeStr = item.Name.Split('|'); string[] tempTypeStr = item.Name.Split('|');
...@@ -1426,8 +1425,6 @@ namespace Edu.WebApi.Controllers.User ...@@ -1426,8 +1425,6 @@ namespace Edu.WebApi.Controllers.User
/// <returns></returns> /// <returns></returns>
public ApiResult GetMyInitiateAuditStatus() public ApiResult GetMyInitiateAuditStatus()
{ {
int empId = Convert.ToInt32(RequestParm.Uid);
List<Rb_Workflow_Template_Extend> wfTemplateList = workFlowModule.GetTemplateByEmpId(empId);
var dicAuditStatus = EnumHelper.EnumToList(typeof(AppAuditStatusEnum)); var dicAuditStatus = EnumHelper.EnumToList(typeof(AppAuditStatusEnum));
List<Dictionary<string, int>> auditStatusList = new List<Dictionary<string, int>>(); List<Dictionary<string, int>> auditStatusList = new List<Dictionary<string, int>>();
foreach (var item in dicAuditStatus) foreach (var item in dicAuditStatus)
......
...@@ -621,7 +621,6 @@ namespace Edu.WebApi.Controllers.User ...@@ -621,7 +621,6 @@ namespace Edu.WebApi.Controllers.User
/// <returns></returns> /// <returns></returns>
public virtual ApiResult SetTempleteEmployee() public virtual ApiResult SetTempleteEmployee()
{ {
UserInfo userInfo = UserReidsCache.GetUserLoginInfo(RequestParm.Uid);
JObject parm = JObject.Parse(RequestParm.Msg.ToString()); JObject parm = JObject.Parse(RequestParm.Msg.ToString());
int TemplateId = parm.GetInt("TemplateId"); int TemplateId = parm.GetInt("TemplateId");
string EmployeeId = parm.GetStringValue("EmployeeIdArr"); string EmployeeId = parm.GetStringValue("EmployeeIdArr");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment