Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
performance
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zry
performance
Commits
f0b10e29
Commit
f0b10e29
authored
Jun 06, 2020
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
单元格原始值错误提示修改
parent
ed9bf788
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
21 deletions
+44
-21
performance/Performance.Api/Controllers/OriginalController.cs
+1
-1
performance/Performance.Services/EmployeeService.cs
+3
-1
performance/Performance.Services/OriginalService.cs
+23
-12
performance/Performance.Services/SecondAllotService.cs
+13
-3
performance/Performance.Services/SheetSevice.cs
+4
-4
No files found.
performance/Performance.Api/Controllers/OriginalController.cs
View file @
f0b10e29
...
...
@@ -38,7 +38,7 @@ public class OriginalController : Controller
public
ApiResponse
FactorEdit
([
FromBody
]
OriginalRequest
request
)
{
if
(
request
.
Cell
.
Id
<=
0
)
return
new
ApiResponse
(
ResponseType
.
Fail
,
"
暂不支持
修改"
);
return
new
ApiResponse
(
ResponseType
.
Fail
,
"
当前列费用无效,无法
修改"
);
var
result
=
originalService
.
EditFactorData
(
claim
.
GetUserId
(),
request
);
return
result
?
new
ApiResponse
(
ResponseType
.
OK
,
"修改成功"
)
:
new
ApiResponse
(
ResponseType
.
Fail
,
"修改失败"
);
...
...
performance/Performance.Services/EmployeeService.cs
View file @
f0b10e29
...
...
@@ -254,8 +254,10 @@ public bool DeleteClinic(im_employee_clinic request)
public
bool
Audit
(
int
allotId
)
{
var
allot
=
perforPerallotRepository
.
GetEntity
(
t
=>
t
.
ID
==
allotId
);
if
(
allot
==
null
||
!
new
List
<
int
>
{
(
int
)
AllotStates
.
GenerateSucceed
,
(
int
)
AllotStates
.
Archive
}.
Contains
(
allot
.
States
))
if
(
allot
==
null
||
!
new
List
<
int
>
{
(
int
)
AllotStates
.
GenerateSucceed
,
(
int
)
AllotStates
.
GenerateAccomplish
}.
Contains
(
allot
.
States
))
throw
new
PerformanceException
(
"绩效信息错误"
);
if
((
int
)
AllotStates
.
Archive
==
allot
.
States
)
throw
new
PerformanceException
(
"绩效已归档,暂不支持修改"
);
allot
.
Generate
=
(
int
)
AllotGenerate
.
PersonnelOffice
;
return
perforPerallotRepository
.
Update
(
allot
);
...
...
performance/Performance.Services/OriginalService.cs
View file @
f0b10e29
...
...
@@ -109,6 +109,10 @@ public bool EditSheetData(int userId, OriginalRequest request)
break
;
}
}
catch
(
NotSupportedException
ex
)
{
throw
new
PerformanceException
(
"提交参数不合规范"
);
}
catch
(
InvalidCastException
ex
)
{
throw
new
PerformanceException
(
"提交参数不合规范"
);
...
...
@@ -170,18 +174,18 @@ private void SetValue<TEntity>(TEntity entity, CellRequest cell)
var
property
=
typeof
(
TEntity
).
GetProperty
(
cell
.
FieldName
);
if
(
value
.
ToString
().
IndexOf
(
"%"
)
>
-
1
)
value
=
ConvertHelper
.
To
<
decimal
>(
value
.
ToString
().
Replace
(
"%"
,
""
))
/
100
;
else
if
(
cell
.
FieldName
==
"FitPeople"
)
{
var
fit
=
EnumHelper
.
GetItems
<
PerforType
>();
if
(!
fit
.
Select
(
t
=>
t
.
Description
).
Contains
(
cell
.
CellValue
.
ToString
()))
throw
new
PerformanceException
(
"'绩效基数核算参考对象'提交值无效"
);
}
else
if
(
cell
.
FieldName
==
"UnitType"
)
{
var
fit
=
EnumHelper
.
GetItems
<
UnitType
>();
if
(!
fit
.
Select
(
t
=>
t
.
Description
).
Contains
(
cell
.
CellValue
.
ToString
()))
throw
new
PerformanceException
(
"'核算单元分类'提交值无效"
);
}
//
else if (cell.FieldName == "FitPeople")
//
{
//
var fit = EnumHelper.GetItems<PerforType>();
//
if (!fit.Select(t => t.Description).Contains(cell.CellValue.ToString()))
//
throw new PerformanceException("'绩效基数核算参考对象'提交值无效");
//
}
//
else if (cell.FieldName == "UnitType")
//
{
//
var fit = EnumHelper.GetItems<UnitType>();
//
if (!fit.Select(t => t.Description).Contains(cell.CellValue.ToString()))
//
throw new PerformanceException("'核算单元分类'提交值无效");
//
}
else
{
if
(
property
==
null
)
...
...
@@ -189,6 +193,8 @@ private void SetValue<TEntity>(TEntity entity, CellRequest cell)
if
(
value
!=
null
&&
value
.
ToString
()
!=
""
)
{
try
{
string
type
=
property
.
PropertyType
.
FullName
.
ToLower
();
if
(
type
.
IndexOf
(
"int"
)
>
-
1
)
value
=
Convert
.
ToInt32
(
value
);
...
...
@@ -201,6 +207,11 @@ private void SetValue<TEntity>(TEntity entity, CellRequest cell)
else
if
(
type
.
IndexOf
(
"string"
)
>
-
1
)
value
=
cell
.
CellValue
.
ToString
();
}
catch
(
Exception
ex
)
{
throw
new
PerformanceException
(
"提交参数不合规范"
);
}
}
else
value
=
null
;
}
...
...
performance/Performance.Services/SecondAllotService.cs
View file @
f0b10e29
...
...
@@ -482,6 +482,8 @@ private void SupplyHeaderByWorkItem(UseTempRequest request, SecondResponse resul
{
var
headItem
=
(
HeadItem
)
headers
[
i
].
Clone
();
headItem
.
FiledName
=
(
i
%
2
==
0
)
?
item
.
TypeName
:
item
.
TypeName
.
Replace
(
"占比"
,
"金额"
);
if
(
i
%
2
!=
0
&&
!
headItem
.
FiledName
.
EndsWith
(
"金额"
))
headItem
.
FiledName
+=
"金额"
;
headItem
.
FiledId
+=
item
.
Id
;
headItem
.
Sort
=
maxSortValue
+
sortindex
;
headItem
.
WorkType
=
item
.
Id
;
...
...
@@ -491,13 +493,21 @@ private void SupplyHeaderByWorkItem(UseTempRequest request, SecondResponse resul
}
var
defauleHeader
=
new
List
<
ag_workload_type
>
{
new
ag_workload_type
{
Id
=
2
,
TypeName
=
"工作量绩效占比"
},
new
ag_workload_type
{
Id
=
2
,
TypeName
=
"工作量绩效占比"
,
},
new
ag_workload_type
{
Id
=
2
,
TypeName
=
"工作量分配绩效金额"
},
};
foreach
(
var
item
in
defauleHeader
)
{
result
.
HeadItems
.
Where
(
t
=>
t
.
FiledName
==
item
.
TypeName
).
ToList
()?.
ForEach
(
t
=>
t
.
WorkType
=
item
.
Id
);
result
.
BodyItems
.
Where
(
t
=>
t
.
FiledName
==
item
.
TypeName
).
ToList
()?.
ForEach
(
t
=>
t
.
WorkType
=
item
.
Id
);
result
.
HeadItems
.
Where
(
t
=>
t
.
FiledName
==
item
.
TypeName
).
ToList
()?.
ForEach
(
t
=>
{
t
.
WorkType
=
item
.
Id
;
t
.
SpecialAttr
=
item
.
TypeName
.
IndexOf
(
"占比"
)
>
-
1
?
1
:
2
;
});
result
.
BodyItems
.
Where
(
t
=>
t
.
FiledName
==
item
.
TypeName
).
ToList
()?.
ForEach
(
t
=>
{
t
.
WorkType
=
item
.
Id
;
t
.
SpecialAttr
=
item
.
TypeName
.
IndexOf
(
"占比"
)
>
-
1
?
1
:
2
;
});
}
var
rownumber
=
result
.
BodyItems
.
Any
(
t
=>
t
.
RowNumber
==
-
1
)
?
-
1
:
0
;
...
...
performance/Performance.Services/SheetSevice.cs
View file @
f0b10e29
...
...
@@ -132,18 +132,18 @@ private void CommonExport(int sheetID, SheetExportResponse response)
var
factorhead
=
new
Row
(
0
);
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
Workload
)
{
factorhead
.
Data
.
Add
(
new
Cell
(
0
,
"单元工作量绩效标准:"
,
1
,
2
,
false
,
false
,
cellType
:
"
facto
r"
));
factorhead
.
Data
.
Add
(
new
Cell
(
0
,
"单元工作量绩效标准:"
,
1
,
2
,
false
,
false
,
cellType
:
"
heade
r"
));
response
=
AddFactor
(
response
,
factorhead
,
headList
.
ToList
(),
dataList
);
}
else
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
OtherIncome
||
sheet
.
SheetType
==
(
int
)
SheetType
.
Income
||
sheet
.
SheetType
==
(
int
)
SheetType
.
Expend
)
{
factorhead
.
Data
.
Add
(
new
Cell
(
0
,
"护理组分割比例"
,
1
,
merge
,
false
,
false
,
cellType
:
"
facto
r"
));
factorhead
.
Data
.
Add
(
new
Cell
(
0
,
"护理组分割比例"
,
1
,
merge
,
false
,
false
,
cellType
:
"
heade
r"
));
response
=
AddFactor
(
response
,
factorhead
,
headList
.
ToList
(),
dataList
,
UnitType
.
护理组
);
var
factorhead1
=
new
Row
(
1
);
factorhead1
.
Data
.
Add
(
new
Cell
(
0
,
"医生组分割比例"
,
1
,
merge
,
false
,
false
,
cellType
:
"
facto
r"
));
factorhead1
.
Data
.
Add
(
new
Cell
(
0
,
"医生组分割比例"
,
1
,
merge
,
false
,
false
,
cellType
:
"
heade
r"
));
response
=
AddFactor
(
response
,
factorhead1
,
headList
.
ToList
(),
dataList
,
UnitType
.
医生组
);
var
factorhead2
=
new
Row
(
2
);
factorhead2
.
Data
.
Add
(
new
Cell
(
0
,
"医技组分割比例"
,
1
,
merge
,
false
,
false
,
cellType
:
"
facto
r"
));
factorhead2
.
Data
.
Add
(
new
Cell
(
0
,
"医技组分割比例"
,
1
,
merge
,
false
,
false
,
cellType
:
"
heade
r"
));
response
=
AddFactor
(
response
,
factorhead2
,
headList
.
ToList
(),
dataList
,
UnitType
.
医技组
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment