Commit 78877750 by wyc

医院其他绩效类型和不公示医院其他绩效类型 (添加/修改添加限制)

parent 84b84d99
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
}, },
"AppConnection": { "AppConnection": {
//"PerformanceConnectionString": "server=112.124.13.17;database=db_performance;uid=suvalue;pwd=suvalue2016;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;", //"PerformanceConnectionString": "server=112.124.13.17;database=db_performance;uid=suvalue;pwd=suvalue2016;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;",
"PerformanceConnectionString": "server=192.168.18.166;database=db_performance_screen;uid=root;pwd=1234qwer;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;" "PerformanceConnectionString": "server=192.168.18.166;database=db_test_beiliu;uid=root;pwd=1234qwer;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;"
//"PerformanceConnectionString": "server=116.62.245.55;database=db_performance;uid=root;pwd=1234qwer;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;" //"PerformanceConnectionString": "server=116.62.245.55;database=db_performance;uid=root;pwd=1234qwer;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;"
}, },
"Application": { "Application": {
......
...@@ -50,7 +50,7 @@ public class EmployeeService : IAutoInjection ...@@ -50,7 +50,7 @@ public class EmployeeService : IAutoInjection
private readonly DownloadService downloadService; private readonly DownloadService downloadService;
private readonly PerAprAmountTypeRepository perAprAmountTypeRepository; private readonly PerAprAmountTypeRepository perAprAmountTypeRepository;
private readonly PerAprAmountTypeHideRepository perAprAmountTypeHIdeRepository; private readonly PerAprAmountTypeHideRepository perAprAmountTypeHIdeRepository;
private readonly PerforPerapramountRepository perforPerapramountRepository;
...@@ -83,7 +83,6 @@ public class EmployeeService : IAutoInjection ...@@ -83,7 +83,6 @@ public class EmployeeService : IAutoInjection
UserService userService, UserService userService,
DownloadService downloadService, DownloadService downloadService,
PerAprAmountTypeRepository perAprAmountTypeRepository, PerAprAmountTypeRepository perAprAmountTypeRepository,
PerforPerapramountRepository perforPerapramountRepository,
PerAprAmountTypeHideRepository perAprAmountTypeHideRepository PerAprAmountTypeHideRepository perAprAmountTypeHideRepository
) )
{ {
...@@ -113,7 +112,6 @@ PerAprAmountTypeHideRepository perAprAmountTypeHideRepository ...@@ -113,7 +112,6 @@ PerAprAmountTypeHideRepository perAprAmountTypeHideRepository
this.userService = userService; this.userService = userService;
this.downloadService = downloadService; this.downloadService = downloadService;
this.perAprAmountTypeRepository = perAprAmountTypeRepository; this.perAprAmountTypeRepository = perAprAmountTypeRepository;
this.perforPerapramountRepository = perforPerapramountRepository;
this.perAprAmountTypeHIdeRepository = perAprAmountTypeHideRepository; this.perAprAmountTypeHIdeRepository = perAprAmountTypeHideRepository;
} }
...@@ -943,7 +941,7 @@ public ApiResponse<List<per_apr_amount_type>> GetAprTypeList(int allotId) ...@@ -943,7 +941,7 @@ public ApiResponse<List<per_apr_amount_type>> GetAprTypeList(int allotId)
public ApiResponse<AprTypeRequest> InsertAprType(int createUser, AprTypeRequest request) public ApiResponse<AprTypeRequest> InsertAprType(int createUser, AprTypeRequest request)
{ {
if (string.IsNullOrEmpty(request.PerforType.Trim()) || request.AllotId <= 0) if (string.IsNullOrEmpty(request.PerforType.Trim()) || request.AllotId <= 0)
return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "类型不能为空"); return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "输入参数不能填空或者小于1");
var tepm = perAprAmountTypeRepository.GetEntity(t => t.AllotId == request.AllotId && t.PerforType == request.PerforType); var tepm = perAprAmountTypeRepository.GetEntity(t => t.AllotId == request.AllotId && t.PerforType == request.PerforType);
if (tepm != null) if (tepm != null)
return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "已存在该类型"); return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "已存在该类型");
...@@ -960,26 +958,31 @@ public ApiResponse<AprTypeRequest> InsertAprType(int createUser, AprTypeRequest ...@@ -960,26 +958,31 @@ public ApiResponse<AprTypeRequest> InsertAprType(int createUser, AprTypeRequest
public ApiResponse<AprTypeRequest> UpdateAprType(int typeId, AprTypeRequest request) public ApiResponse<AprTypeRequest> UpdateAprType(int typeId, AprTypeRequest request)
{ {
if (string.IsNullOrEmpty(request.PerforType.Trim()) || request.AllotId <= 0)
return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "输入参数不能填空或者小于1");
var tepm = perAprAmountTypeRepository.GetEntity(t => t.AllotId == request.AllotId && t.PerforType == request.PerforType); var tepm = perAprAmountTypeRepository.GetEntity(t => t.AllotId == request.AllotId && t.PerforType == request.PerforType);
if (tepm != null) if (tepm != null)
return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "已存在该类型"); return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "已存在该类型");
var res = perAprAmountTypeRepository.GetEntity(t => t.Id == typeId); var res = perAprAmountTypeRepository.GetEntity(t => t.Id == typeId);
if (res == null) if (res == null)
return new ApiResponse<AprTypeRequest>(ResponseType.NotFound, "未查询到内容"); return new ApiResponse<AprTypeRequest>(ResponseType.NotFound, "未查询到内容");
var use = perapramountRepository.GetEntity(t => t.AllotId == res.AllotId && t.PerforType == res.PerforType);
if (use != null)
return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "该类型正在使用!");
res.UpdateTime = DateTime.Now; res.UpdateTime = DateTime.Now;
res.AllotId = request.AllotId; res.AllotId = request.AllotId;
res.PerforType = request.PerforType.Trim(); res.PerforType = request.PerforType.Trim();
if (perAprAmountTypeRepository.Update(res)) return new ApiResponse<AprTypeRequest>(ResponseType.OK, "修改成功"); if (perAprAmountTypeRepository.Update(res)) return new ApiResponse<AprTypeRequest>(ResponseType.OK, "修改成功");
else return new ApiResponse<AprTypeRequest>(ResponseType.Fail, "修改失败"); else return new ApiResponse<AprTypeRequest>(ResponseType.Fail, "修改失败");
} }
public ApiResponse DeleteAprType(int typeId) public ApiResponse DeleteAprType(int typeId)
{ {
var any = perAprAmountTypeRepository.GetEntity(t => t.Id == typeId); var any = perAprAmountTypeRepository.GetEntity(t => t.Id == typeId);
if (any == null) return new ApiResponse(ResponseType.NotFound, "没有该数据"); if (any == null)
var use = perforPerapramountRepository.GetEntity(t => t.PerforType == any.PerforType); return new ApiResponse(ResponseType.NotFound, "没有该数据");
if (use != null) return new ApiResponse(ResponseType.ParameterError, "该类型正在使用!"); var use = perapramountRepository.GetEntity(t => t.AllotId == any.AllotId && t.PerforType == any.PerforType);
if (use != null)
return new ApiResponse(ResponseType.ParameterError, "该类型正在使用!");
if (perAprAmountTypeRepository.DeleteFromQuery(t => t.Id == typeId) > 0) if (perAprAmountTypeRepository.DeleteFromQuery(t => t.Id == typeId) > 0)
return new ApiResponse(ResponseType.OK, "删除成功"); return new ApiResponse(ResponseType.OK, "删除成功");
else return new ApiResponse(ResponseType.Fail, "删除失败"); else return new ApiResponse(ResponseType.Fail, "删除失败");
...@@ -1463,7 +1466,7 @@ public List<TitleValue> GetPerforTypeDictHide(int allotId) ...@@ -1463,7 +1466,7 @@ public List<TitleValue> GetPerforTypeDictHide(int allotId)
} }
#endregion #endregion
#region 不公医院其他绩效类型 #region 不公医院其他绩效类型
public ApiResponse<List<per_apr_amount_hide_type>> GetAprTypeListHide(int allotId) public ApiResponse<List<per_apr_amount_hide_type>> GetAprTypeListHide(int allotId)
{ {
var result = perAprAmountTypeHIdeRepository.GetEntities(t => t.AllotId == allotId).ToList(); var result = perAprAmountTypeHIdeRepository.GetEntities(t => t.AllotId == allotId).ToList();
...@@ -1475,7 +1478,7 @@ public ApiResponse<List<per_apr_amount_hide_type>> GetAprTypeListHide(int allotI ...@@ -1475,7 +1478,7 @@ public ApiResponse<List<per_apr_amount_hide_type>> GetAprTypeListHide(int allotI
public ApiResponse<AprTypeRequest> InsertAprTypeHide(int createUser, AprTypeRequest request) public ApiResponse<AprTypeRequest> InsertAprTypeHide(int createUser, AprTypeRequest request)
{ {
if (string.IsNullOrEmpty(request.PerforType.Trim()) || request.AllotId <= 0) if (string.IsNullOrEmpty(request.PerforType.Trim()) || request.AllotId <= 0)
return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "类型不能为空"); return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "输入参数不能填空或者小于1");
var tepm = perAprAmountTypeHIdeRepository.GetEntity(t => t.AllotId == request.AllotId && t.PerforType == request.PerforType); var tepm = perAprAmountTypeHIdeRepository.GetEntity(t => t.AllotId == request.AllotId && t.PerforType == request.PerforType);
if (tepm != null) if (tepm != null)
return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "已存在该类型"); return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "已存在该类型");
...@@ -1492,26 +1495,31 @@ public ApiResponse<AprTypeRequest> InsertAprTypeHide(int createUser, AprTypeRequ ...@@ -1492,26 +1495,31 @@ public ApiResponse<AprTypeRequest> InsertAprTypeHide(int createUser, AprTypeRequ
public ApiResponse<AprTypeRequest> UpdateAprTypeHide(int typeId, AprTypeRequest request) public ApiResponse<AprTypeRequest> UpdateAprTypeHide(int typeId, AprTypeRequest request)
{ {
if (string.IsNullOrEmpty(request.PerforType.Trim()) || request.AllotId <= 0)
return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "输入参数不能填空或者小于1");
var tepm = perAprAmountTypeHIdeRepository.GetEntity(t => t.AllotId == request.AllotId && t.PerforType == request.PerforType); var tepm = perAprAmountTypeHIdeRepository.GetEntity(t => t.AllotId == request.AllotId && t.PerforType == request.PerforType);
if (tepm != null) if (tepm != null)
return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "已存在该类型"); return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "已存在该类型");
var res = perAprAmountTypeHIdeRepository.GetEntity(t => t.Id == typeId); var res = perAprAmountTypeHIdeRepository.GetEntity(t => t.Id == typeId);
if (res == null) if (res == null)
return new ApiResponse<AprTypeRequest>(ResponseType.NotFound, "未查询到内容"); return new ApiResponse<AprTypeRequest>(ResponseType.NotFound, "未查询到内容");
var use = _hideRepository.GetEntity(t => t.AllotId == res.AllotId && t.PerforType == res.PerforType);
if (use != null)
return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "该类型正在使用!");
res.UpdateTime = DateTime.Now; res.UpdateTime = DateTime.Now;
res.AllotId = request.AllotId; res.AllotId = request.AllotId;
res.PerforType = request.PerforType.Trim(); res.PerforType = request.PerforType.Trim();
if (perAprAmountTypeHIdeRepository.Update(res)) return new ApiResponse<AprTypeRequest>(ResponseType.OK, "修改成功"); if (perAprAmountTypeHIdeRepository.Update(res)) return new ApiResponse<AprTypeRequest>(ResponseType.OK, "修改成功");
else return new ApiResponse<AprTypeRequest>(ResponseType.Fail, "修改失败"); else return new ApiResponse<AprTypeRequest>(ResponseType.Fail, "修改失败");
} }
public ApiResponse DeleteAprTypeHide(int typeId) public ApiResponse DeleteAprTypeHide(int typeId)
{ {
var any = perAprAmountTypeHIdeRepository.GetEntity(t => t.Id == typeId); var any = perAprAmountTypeHIdeRepository.GetEntity(t => t.Id == typeId);
if (any == null) return new ApiResponse(ResponseType.NotFound, "没有该数据"); if (any == null)
var use = perforPerapramountRepository.GetEntity(t => t.PerforType == any.PerforType); return new ApiResponse(ResponseType.NotFound, "没有该数据");
if (use != null) return new ApiResponse(ResponseType.ParameterError, "该类型正在使用!"); var use = _hideRepository.GetEntity(t => t.AllotId == any.AllotId && t.PerforType == any.PerforType);
if (use != null)
return new ApiResponse(ResponseType.ParameterError, "该类型正在使用!");
if (perAprAmountTypeHIdeRepository.DeleteFromQuery(t => t.Id == typeId) > 0) if (perAprAmountTypeHIdeRepository.DeleteFromQuery(t => t.Id == typeId) > 0)
return new ApiResponse(ResponseType.OK, "删除成功"); return new ApiResponse(ResponseType.OK, "删除成功");
else return new ApiResponse(ResponseType.Fail, "删除失败"); else return new ApiResponse(ResponseType.Fail, "删除失败");
......
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