Commit 48546689 by lcx

抽取下载格式修改,抽取时保存门诊住院开单医生,重置密码,取消邮箱手机号验证

parent e9c758d0
......@@ -268,5 +268,19 @@ public ApiResponse<JwtToken> DemoUsers(int userId)
var jwtToken = JwtTokenHelper.GenerateToken(claims, _options.ExpirationMinutes);
return new ApiResponse<JwtToken>(ResponseType.OK, jwtToken);
}
/// <summary>
/// 修改用户密码
/// </summary>
/// <param name="userId">用户id</param>
/// <returns></returns>
[Route("reset/{userId}")]
[HttpPost]
public ApiResponse<UserResponse> Password(int userId)
{
var loginUserId = _claim.GetUserId();
var user = _userService.ResetPwd(userId, loginUserId);
return new ApiResponse<UserResponse>(ResponseType.OK, user);
}
}
}
......@@ -90,6 +90,13 @@
<param name="userId"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.AccountController.Password(System.Int32)">
<summary>
修改用户密码
</summary>
<param name="userId">用户id</param>
<returns></returns>
</member>
<member name="T:Performance.Api.Controllers.AgainAllotController">
<summary>
科室二次分配
......
......@@ -4163,6 +4163,11 @@
sheet页id
</summary>
</member>
<member name="P:Performance.EntityModels.res_compute.UnitType">
<summary>
核算单元分类
</summary>
</member>
<member name="P:Performance.EntityModels.res_compute.AccountType">
<summary>
核算单元类型(医技科室、临床科室等)
......
......@@ -62,7 +62,7 @@ public UserRequestValidator()
{
RuleFor(x => x.RealName).NotNull().NotEmpty();
RuleFor(x => x.Login).NotNull().NotEmpty();
RuleFor(x => x.Mobile).NotNull().NotEmpty().Must((pre) => { return CustomValidator.IsMobile(pre); });
//RuleFor(x => x.Mobile).NotNull().NotEmpty().Must((pre) => { return CustomValidator.IsMobile(pre); });
//RuleFor(x => x.Mail).EmailAddress().When(pre => { return !string.IsNullOrEmpty(pre.Mail); });
};
......@@ -92,12 +92,12 @@ public UserRequestValidator()
RuleSet("Self", () =>
{
RuleFor(x => x.Password).Length(4, 20);
RuleFor(x => x.Mobile).Must((pre) =>
{
if (!string.IsNullOrEmpty(pre))
return CustomValidator.IsMobile(pre);
return true;
});
//RuleFor(x => x.Mobile).Must((pre) =>
//{
// if (!string.IsNullOrEmpty(pre))
// return CustomValidator.IsMobile(pre);
// return true;
//});
//RuleFor(x => x.Mail).EmailAddress().When(pre => { return !string.IsNullOrEmpty(pre.Mail); });
});
}
......
......@@ -137,7 +137,7 @@ public void ImportWorkloadData(per_allot allot, object parameters)
string clear = "delete from report_original_workload where allotid = @allotid and hospitalid = @hospitalid;";
connection.Execute(clear, new { allotid = allot.ID, hospitalid = allot.HospitalId }, commandTimeout: 60 * 60, transaction: transaction);
string insert = "insert into report_original_workload(allotid,year,month,hospitalid,accountingunit,department,doctorname,personnelnumber,category,fee) values(@allotid,@year,@month,@hospitalid,@accountingunit,@department,@doctorname,@personnelnumber,@category,@fee);";
string insert = "insert into report_original_workload(allotid,year,month,hospitalid,sourcetype,accountingunit,department,doctorname,personnelnumber,category,fee) values(@allotid,@year,@month,@hospitalid,@sourcetype,@accountingunit,@department,@doctorname,@personnelnumber,@category,@fee);";
connection.Execute(insert, parameters, commandTimeout: 60 * 60, transaction: transaction);
transaction.Commit();
......
......@@ -591,7 +591,7 @@ private List<NewExtractDto> StandData(IEnumerable<ex_result> results)
};
});
//new Task(() => SaveWorkload(data.Where(t => t.SheetName.Contains("3.")))).Start();
SaveWorkload(data.Where(t => t.SheetName.Contains("3.")));
SaveWorkload(data.Where(t => t.SheetName.Contains("3.") || t.SheetName.Contains("开单")));
var groupdata = data.GroupBy(t => new { t.Department, t.Category, t.SheetName }).Select(t => new NewExtractDto
{
SheetName = t.Key.SheetName,
......@@ -615,18 +615,24 @@ private void SaveWorkload(IEnumerable<NewExtractDto> dtos)
{
if (dtos == null || !dtos.Any()) return;
var parameters = dtos.Select(t => new
var parameters = dtos.Select(t =>
{
var source = t.SheetName.IndexOf("门诊") > -1 ? "门诊" : t.SheetName.IndexOf("住院") > -1 ? "住院" : "";
return new
{
allotid = Allot.ID,
year = Allot.Year,
month = Allot.Month,
hospitalid = Allot.HospitalId,
sourcetype = source,
accountingunit = HasValue(t.InpatTechnicAccounting, t.OutTechnicAccounting, t.InpatDoctorAccounting, t.InpatNurseAccounting, t.OutDoctorAccounting, t.OutNurseAccounting),
department = t.Department,
doctorname = t.DoctorName,
personnelnumber = t.PersonnelNumber,
category = t.Category,
fee = t.Value
};
});
if (parameters != null && parameters.Any())
perforPerallotRepository.ImportWorkloadData(Allot, parameters);
......@@ -647,7 +653,7 @@ private void SaveWorkload(IEnumerable<NewExtractDto> dtos)
FileHelper.CreateDirectory(dpath);
string tempPath = Path.Combine(dpath, $"Template{DateTime.Now.ToString("yyyyMMddHHmmssfff")}.xlsx");
FileHelper.Copy(originalPath, tempPath);
string newPath = Path.Combine(dpath, $"绩效提取数据{DateTime.Now.ToString("yyyyMMddHHmmssfff")}.xlsx");
string newPath = Path.Combine(dpath, $"绩效提取数据{DateTime.Now.ToString("yyyyMMddHHmmssfff")}.xls");
return (tempPath, newPath);
}
......
......@@ -416,5 +416,26 @@ public UserIdentity GetDemoUserIdentity(int userId)
data.Token = Guid.NewGuid().ToString("N");
return data;
}
/// <summary>
/// 重置用户密码
/// </summary>
/// <param name="userId"></param>
/// <param name="loginUserId"></param>
/// <returns></returns>
public UserResponse ResetPwd(int userId, int loginUserId)
{
var user = _userRepository.GetEntity(t => t.ID == userId && t.IsDelete == 1);
if (user == null)
throw new PerformanceException($"用户不存在 UserId:{userId}");
if (user.CreateUser != loginUserId)
throw new PerformanceException($"当前用户无权限重置用户密码");
user.Password = "123456";
if (!_userRepository.Update(user))
throw new PerformanceException("重置失败");
return Mapper.Map<UserResponse>(user);
}
}
}
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