Commit 78877750 by wyc

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

parent 84b84d99
......@@ -7,7 +7,7 @@
},
"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=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;"
},
"Application": {
......
......@@ -50,7 +50,7 @@ public class EmployeeService : IAutoInjection
private readonly DownloadService downloadService;
private readonly PerAprAmountTypeRepository perAprAmountTypeRepository;
private readonly PerAprAmountTypeHideRepository perAprAmountTypeHIdeRepository;
private readonly PerforPerapramountRepository perforPerapramountRepository;
......@@ -83,7 +83,6 @@ public class EmployeeService : IAutoInjection
UserService userService,
DownloadService downloadService,
PerAprAmountTypeRepository perAprAmountTypeRepository,
PerforPerapramountRepository perforPerapramountRepository,
PerAprAmountTypeHideRepository perAprAmountTypeHideRepository
)
{
......@@ -113,7 +112,6 @@ PerAprAmountTypeHideRepository perAprAmountTypeHideRepository
this.userService = userService;
this.downloadService = downloadService;
this.perAprAmountTypeRepository = perAprAmountTypeRepository;
this.perforPerapramountRepository = perforPerapramountRepository;
this.perAprAmountTypeHIdeRepository = perAprAmountTypeHideRepository;
}
......@@ -943,7 +941,7 @@ public ApiResponse<List<per_apr_amount_type>> GetAprTypeList(int allotId)
public ApiResponse<AprTypeRequest> InsertAprType(int createUser, AprTypeRequest request)
{
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);
if (tepm != null)
return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "已存在该类型");
......@@ -960,26 +958,31 @@ public ApiResponse<AprTypeRequest> InsertAprType(int createUser, AprTypeRequest
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);
if (tepm != null)
return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "已存在该类型");
var res = perAprAmountTypeRepository.GetEntity(t => t.Id == typeId);
if (res == null)
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.AllotId = request.AllotId;
res.PerforType = request.PerforType.Trim();
if (perAprAmountTypeRepository.Update(res)) return new ApiResponse<AprTypeRequest>(ResponseType.OK, "修改成功");
else return new ApiResponse<AprTypeRequest>(ResponseType.Fail, "修改失败");
}
public ApiResponse DeleteAprType(int typeId)
{
var any = perAprAmountTypeRepository.GetEntity(t => t.Id == typeId);
if (any == null) return new ApiResponse(ResponseType.NotFound, "没有该数据");
var use = perforPerapramountRepository.GetEntity(t => t.PerforType == any.PerforType);
if (use != null) return new ApiResponse(ResponseType.ParameterError, "该类型正在使用!");
if (any == null)
return new ApiResponse(ResponseType.NotFound, "没有该数据");
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)
return new ApiResponse(ResponseType.OK, "删除成功");
else return new ApiResponse(ResponseType.Fail, "删除失败");
......@@ -1463,7 +1466,7 @@ public List<TitleValue> GetPerforTypeDictHide(int allotId)
}
#endregion
#region 不公医院其他绩效类型
#region 不公医院其他绩效类型
public ApiResponse<List<per_apr_amount_hide_type>> GetAprTypeListHide(int allotId)
{
var result = perAprAmountTypeHIdeRepository.GetEntities(t => t.AllotId == allotId).ToList();
......@@ -1475,7 +1478,7 @@ public ApiResponse<List<per_apr_amount_hide_type>> GetAprTypeListHide(int allotI
public ApiResponse<AprTypeRequest> InsertAprTypeHide(int createUser, AprTypeRequest request)
{
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);
if (tepm != null)
return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "已存在该类型");
......@@ -1492,26 +1495,31 @@ public ApiResponse<AprTypeRequest> InsertAprTypeHide(int createUser, AprTypeRequ
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);
if (tepm != null)
return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "已存在该类型");
var res = perAprAmountTypeHIdeRepository.GetEntity(t => t.Id == typeId);
if (res == null)
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.AllotId = request.AllotId;
res.PerforType = request.PerforType.Trim();
if (perAprAmountTypeHIdeRepository.Update(res)) return new ApiResponse<AprTypeRequest>(ResponseType.OK, "修改成功");
else return new ApiResponse<AprTypeRequest>(ResponseType.Fail, "修改失败");
}
public ApiResponse DeleteAprTypeHide(int typeId)
{
var any = perAprAmountTypeHIdeRepository.GetEntity(t => t.Id == typeId);
if (any == null) return new ApiResponse(ResponseType.NotFound, "没有该数据");
var use = perforPerapramountRepository.GetEntity(t => t.PerforType == any.PerforType);
if (use != null) return new ApiResponse(ResponseType.ParameterError, "该类型正在使用!");
if (any == null)
return new ApiResponse(ResponseType.NotFound, "没有该数据");
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)
return new ApiResponse(ResponseType.OK, "删除成功");
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