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
c1d1cd1d
Commit
c1d1cd1d
authored
Mar 28, 2019
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug修复
parent
efd0ac30
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
14 deletions
+30
-14
performance/Performance.Api/Controllers/AllotController.cs
+2
-2
performance/Performance.Services/ConfigService.cs
+28
-12
No files found.
performance/Performance.Api/Controllers/AllotController.cs
View file @
c1d1cd1d
...
...
@@ -156,8 +156,8 @@ public ApiResponse Generate([CustomizeValidator(RuleSet = "Delete"), FromBody]Al
if
(
null
==
allot
||
string
.
IsNullOrEmpty
(
allot
.
Path
))
throw
new
PerformanceException
(
"当前绩效记录不存在或没有上传数据文件"
);
var
user
=
_claim
.
At
(
request
);
_allotService
.
Generate
(
allot
,
user
);
//
BackgroundJob.Enqueue(() => _allotService.Generate(allot, user));
//
_allotService.Generate(allot, user);
BackgroundJob
.
Enqueue
(()
=>
_allotService
.
Generate
(
allot
,
user
));
return
new
ApiResponse
(
ResponseType
.
OK
);
}
}
...
...
performance/Performance.Services/ConfigService.cs
View file @
c1d1cd1d
...
...
@@ -301,21 +301,37 @@ public void Copy(per_allot allot)
if
(
list
[
i
].
ID
==
allot
.
ID
&&
(
i
-
1
)
>=
0
)
allotId
=
list
[
i
-
1
].
ID
;
}
var
director
=
_directorRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
_directorRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
var
newDirectors
=
director
.
Select
(
t
=>
new
cof_director
{
AllotID
=
allot
.
ID
,
JobTitle
=
t
.
JobTitle
,
TypeName
=
t
.
TypeName
,
Value
=
t
.
Value
});
_directorRepository
.
AddRange
(
newDirectors
.
ToArray
());
var
orgDirector
=
_directorRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
);
if
(
orgDirector
==
null
||
orgDirector
.
Count
==
0
)
{
var
director
=
_directorRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
_directorRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
var
newDirectors
=
director
.
Select
(
t
=>
new
cof_director
{
AllotID
=
allot
.
ID
,
JobTitle
=
t
.
JobTitle
,
TypeName
=
t
.
TypeName
,
Value
=
t
.
Value
});
_directorRepository
.
AddRange
(
newDirectors
.
ToArray
());
}
var
durgprop
=
_drugpropRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
_drugpropRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
var
newDurgprops
=
durgprop
.
Select
(
t
=>
new
cof_drugprop
{
AllotID
=
allot
.
ID
,
MaxRange
=
t
.
MaxRange
,
MinRange
=
t
.
MinRange
,
Value
=
t
.
Value
});
_drugpropRepository
.
AddRange
(
newDurgprops
.
ToArray
());
var
orgDurgprop
=
_drugpropRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
);
if
(
orgDurgprop
==
null
||
orgDurgprop
.
Count
==
0
)
{
var
durgprop
=
_drugpropRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
_drugpropRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
var
newDurgprops
=
durgprop
.
Select
(
t
=>
new
cof_drugprop
{
AllotID
=
allot
.
ID
,
MaxRange
=
t
.
MaxRange
,
MinRange
=
t
.
MinRange
,
Value
=
t
.
Value
});
_drugpropRepository
.
AddRange
(
newDurgprops
.
ToArray
());
}
var
income
=
_incomeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
_incomeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
var
newIncomes
=
income
.
Select
(
t
=>
new
cof_income
{
AllotID
=
allot
.
ID
,
SheetNameKeyword
=
t
.
SheetNameKeyword
,
UnitName
=
t
.
UnitName
,
Value
=
t
.
Value
});
_incomeRepository
.
AddRange
(
newIncomes
.
ToArray
());
var
orgIncome
=
_incomeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
);
if
(
orgIncome
==
null
||
orgIncome
.
Count
==
0
)
{
var
income
=
_incomeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
_incomeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
var
newIncomes
=
income
.
Select
(
t
=>
new
cof_income
{
AllotID
=
allot
.
ID
,
SheetNameKeyword
=
t
.
SheetNameKeyword
,
UnitName
=
t
.
UnitName
,
Value
=
t
.
Value
});
_incomeRepository
.
AddRange
(
newIncomes
.
ToArray
());
}
var
workyear
=
_workyearRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
_workyearRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
var
newWorkyears
=
workyear
.
Select
(
t
=>
new
cof_workyear
{
AllotID
=
allot
.
ID
,
MaxRange
=
t
.
MaxRange
,
MinRange
=
t
.
MinRange
,
Value
=
t
.
Value
});
_workyearRepository
.
AddRange
(
newWorkyears
.
ToArray
());
var
orgWorkyear
=
_workyearRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
);
if
(
orgWorkyear
==
null
||
orgWorkyear
.
Count
==
0
)
{
var
workyear
=
_workyearRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
_workyearRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
var
newWorkyears
=
workyear
.
Select
(
t
=>
new
cof_workyear
{
AllotID
=
allot
.
ID
,
MaxRange
=
t
.
MaxRange
,
MinRange
=
t
.
MinRange
,
Value
=
t
.
Value
});
_workyearRepository
.
AddRange
(
newWorkyears
.
ToArray
());
}
}
}
}
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