Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
Ftt_Common
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Ftt_Common
Commits
c48cc7ce
Commit
c48cc7ce
authored
Sep 16, 2021
by
tr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、员工考核:增加任务延期扣分(延期,即最后一次待验收时间,超过任务截止时间。每超1天扣一分)
parent
e7e45040
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
3 deletions
+43
-3
Tools.exe.config
AppHome/Tools.exe.config
+1
-1
wEvaluationOfEmployee.cs
Tools/UI/wEvaluationOfEmployee.cs
+42
-2
No files found.
AppHome/Tools.exe.config
View file @
c48cc7ce
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
configuration
>
<
appSettings
>
<
add
key
=
"UpdateTime"
value
=
"2021-09-
02 13:33:06.610
"
/>
<
add
key
=
"UpdateTime"
value
=
"2021-09-
11 17:38:34.417
"
/>
</
appSettings
>
<
startup
>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.8"
/>
...
...
Tools/UI/wEvaluationOfEmployee.cs
View file @
c48cc7ce
...
...
@@ -114,7 +114,8 @@ namespace Tools.UI
//考勤数据-分组
var
dic
=
new
Dictionary
<
string
,
List
<
DataRow
>>();
var
rows
=
this
.
_ds
.
Tables
[
0
].
Select
(
$"CreateDate > '
{
this
.
tscbMonth
.
Text
}
'"
);
foreach
(
DataRow
r
in
rows
)
var
unionRows
=
this
.
UnionTaskDelayRows
(
rows
,
this
.
tscbMonth
.
Text
);
foreach
(
DataRow
r
in
unionRows
)
{
if
(
Utils
.
IsIllegalDataRow
(
r
))
continue
;
...
...
@@ -200,6 +201,45 @@ namespace Tools.UI
return
true
;
}
/// <summary>
/// 合并任务延期数据
/// </summary>
/// <param name="rows">已有的数据行</param>
/// <param name="startDate">格式:yyyy-MM-01</param>
/// <returns></returns>
private
List
<
DataRow
>
UnionTaskDelayRows
(
DataRow
[]
rows
,
string
startDate
)
{
List
<
DataRow
>
result
=
new
List
<
DataRow
>(
rows
);
try
{
//生成结束日期,开始日期所在月份的最后一天
string
endDate
=
Convert
.
ToDateTime
(
startDate
).
AddMonths
(
1
).
AddDays
(-
1
).
ToString
(
"yyyy-MM-dd"
);
//取指定月份的延期任务,即最后一次待验收时间大于任务结束时间。延期天数作为减分值。
//为适配原数据格式,此处列名做了特殊处理。
string
sql
=
$@"
SELECT u1.Name AS Who,
'【任务延期】' + a.TaskTitle AS Reason,
DATEDIFF(DAY, a.EndDate, b.EditDate) AS Minus
FROM dbo.PM_Task a
LEFT JOIN (
SELECT KeyValue, MAX(CONVERT(VARCHAR(10), EditDate, 20)) AS EditDate FROM dbo.PM_EditLog
WHERE TableName = 'PM_Task' AND FieldName = 'State' AND NewValue IN (34, 64, 88)
GROUP BY KeyValue
) b ON a.ID = b.KeyValue
LEFT JOIN dbo.AC_User u1 ON u1.ID = a.InChargeUserID
WHERE CONVERT(VARCHAR(10), a.EndDate, 20) < b.EditDate
AND a.EndDate BETWEEN '
{
startDate
}
' AND '
{
endDate
}
'
ORDER BY u1.Name"
;
DataTable
dt
=
this
.
_db
.
GetDataTable
(
sql
,
"DelayTask"
);
result
.
AddRange
(
dt
.
Select
());
}
catch
(
Exception
ex
)
{
Utils
.
Tip
(
$"获取延期任务出错:
{
ex
.
Message
}
"
);
}
return
result
;
}
}
}
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