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
6d9254d7
Commit
6d9254d7
authored
Feb 01, 2023
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
年份月份转日期错误修复
parent
52f3aa57
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
54 deletions
+35
-54
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
+0
-25
performance/Performance.Services/AttendanceService.cs
+35
-29
No files found.
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
View file @
6d9254d7
...
...
@@ -74,31 +74,6 @@
Post请求地址
</summary>
</member>
<member
name=
"P:Performance.DtoModels.AprAmount.PersonnelNumber"
>
<summary>
人员工号
</summary>
</member>
<member
name=
"P:Performance.DtoModels.AprAmount.DoctorName"
>
<summary>
医生姓名
</summary>
</member>
<member
name=
"P:Performance.DtoModels.AprAmount.PerforType"
>
<summary>
</summary>
</member>
<member
name=
"P:Performance.DtoModels.AprAmount.Amount"
>
<summary>
金额
</summary>
</member>
<member
name=
"P:Performance.DtoModels.AprAmount.Remark"
>
<summary>
备注
</summary>
</member>
<member
name=
"M:Performance.DtoModels.CustomValidator.IsMobile(System.String)"
>
<summary>
判断输入的字符串是否是一个合法的手机号
...
...
performance/Performance.Services/AttendanceService.cs
View file @
6d9254d7
...
...
@@ -2,6 +2,7 @@
using
Microsoft.Extensions.Logging
;
using
Newtonsoft.Json
;
using
OfficeOpenXml
;
using
OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime
;
using
OfficeOpenXml.Style
;
using
Performance.DtoModels
;
using
Performance.EntityModels
;
...
...
@@ -205,9 +206,9 @@ public ApiResponse BatchCallIn(int allotId, int hospitalId, SaveCollectData requ
var
newAttendanceVacatione
=
JsonHelper
.
Deserialize
<
List
<
per_attendance
>>(
jsons
);
var
oldCallinAttendance
=
perforPerAttendanceRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
&&
t
.
HospitalId
==
hospitalId
);
var
per_
allot
=
perforPerallotRepository
.
GetEntities
(
t
=>
t
.
ID
==
allotId
&&
t
.
HospitalId
==
hospitalId
).
FirstOrDefault
();
var
allot
=
perforPerallotRepository
.
GetEntities
(
t
=>
t
.
ID
==
allotId
&&
t
.
HospitalId
==
hospitalId
).
FirstOrDefault
();
if
(
per_
allot
==
null
)
return
new
ApiResponse
(
ResponseType
.
Error
,
"无绩效数据"
);
if
(
allot
==
null
)
return
new
ApiResponse
(
ResponseType
.
Error
,
"无绩效数据"
);
var
cofaccounting
=
cofaccountingRepository
.
GetEntities
(
ca
=>
ca
.
AllotId
==
allotId
);
...
...
@@ -236,20 +237,23 @@ public ApiResponse BatchCallIn(int allotId, int hospitalId, SaveCollectData requ
{
"错误原因"
,
"“关键信息缺失”请补全或删除"
},
});
}
DateTime
dt
=
new
DateTime
(
per_allot
.
Year
,
per_allot
.
Month
,
1
).
AddMonths
(
1
);
if
(
newAttendanceVacatione
[
i
].
CallInDate
>
dt
)
if
(
allot
.
Month
>=
1
&&
allot
.
Month
<=
12
)
{
error
.
Add
(
new
Dictionary
<
string
,
string
>
DateTime
dt
=
new
DateTime
(
allot
.
Year
,
allot
.
Month
,
1
).
AddMonths
(
1
);
if
(
newAttendanceVacatione
[
i
].
CallInDate
>
dt
)
{
{
"行号"
,
$"第
{
i
+
1
}
行"
},
{
"人员工号"
,
newAttendanceVacatione
[
i
].
PersonnelNumber
??
""
},
{
"人员姓名"
,
newAttendanceVacatione
[
i
].
PersonnelName
??
""
},
{
"调入核算单元"
,
newAttendanceVacatione
[
i
].
CallInAccountingUnit
??
""
},
{
"调入组别"
,
newAttendanceVacatione
[
i
].
CallInUnitType
??
""
},
{
"调入时间"
,
newAttendanceVacatione
[
i
].
CallInDate
?.
ToString
(
"d"
)??
""
},
{
"来源"
,
"粘贴数据"
},
{
"错误原因"
,
$"调入时间不在当前绩效月份范围内,已超出
{
SplitEveryDay
(
dt
.
AddDays
(-
1
),
newAttendanceVacatione
[
i
].
CallInDate
.
Value
).
Count
-
1
}
天"
},
});
error
.
Add
(
new
Dictionary
<
string
,
string
>
{
{
"行号"
,
$"第
{
i
+
1
}
行"
},
{
"人员工号"
,
newAttendanceVacatione
[
i
].
PersonnelNumber
??
""
},
{
"人员姓名"
,
newAttendanceVacatione
[
i
].
PersonnelName
??
""
},
{
"调入核算单元"
,
newAttendanceVacatione
[
i
].
CallInAccountingUnit
??
""
},
{
"调入组别"
,
newAttendanceVacatione
[
i
].
CallInUnitType
??
""
},
{
"调入时间"
,
newAttendanceVacatione
[
i
].
CallInDate
?.
ToString
(
"d"
)??
""
},
{
"来源"
,
"粘贴数据"
},
{
"错误原因"
,
$"调入时间不在当前绩效月份范围内,已超出
{
SplitEveryDay
(
dt
.
AddDays
(-
1
),
newAttendanceVacatione
[
i
].
CallInDate
.
Value
).
Count
-
1
}
天"
},
});
}
}
if
(
newAttendanceVacatione
[
i
].
CallInUnitType
!=
cofaccounting
.
FirstOrDefault
(
t
=>
t
.
AccountingUnit
==
newAttendanceVacatione
[
i
].
CallInAccountingUnit
)?.
UnitType
)
...
...
@@ -496,7 +500,7 @@ public ApiResponse AttendanceBatch(int allotId, int hospitalId, SaveCollectData
var
per_employee
=
perforPeremployeeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
&&
t
.
HospitalId
==
hospitalId
);
List
<
Dictionary
<
string
,
string
>>
error
=
new
List
<
Dictionary
<
string
,
string
>>();
var
per_
allot
=
perforPerallotRepository
.
GetEntities
(
t
=>
t
.
ID
==
allotId
&&
t
.
HospitalId
==
hospitalId
).
FirstOrDefault
();
var
allot
=
perforPerallotRepository
.
GetEntities
(
t
=>
t
.
ID
==
allotId
&&
t
.
HospitalId
==
hospitalId
).
FirstOrDefault
();
for
(
int
i
=
0
;
i
<
newAttendanceVacatione
.
Count
;
i
++)
{
...
...
@@ -563,23 +567,25 @@ public ApiResponse AttendanceBatch(int allotId, int hospitalId, SaveCollectData
{
"来源"
,
"“粘贴数据”与“历史数据”比对"
},
{
"错误原因"
,
$"原名“
{
oldEmp
.
PersonnelName
}
”,工号相同但姓名不同,请删除“历史数据”中该员工"
},
});
}
DateTime
dt
=
new
DateTime
(
per_allot
.
Year
,
per_allot
.
Month
,
1
).
AddMonths
(
1
);
if
(
newAttendanceVacatione
[
i
].
BegDate
>=
dt
&&
newAttendanceVacatione
[
i
].
EndDate
>
dt
)
if
(
allot
.
Month
>=
1
&&
allot
.
Month
<=
12
)
{
error
.
Add
(
new
Dictionary
<
string
,
string
>
DateTime
dt
=
new
DateTime
(
allot
.
Year
,
allot
.
Month
,
1
).
AddMonths
(
1
);
if
(
newAttendanceVacatione
[
i
].
BegDate
>=
dt
&&
newAttendanceVacatione
[
i
].
EndDate
>
dt
)
{
{
"行号"
,
$"第
{
i
+
1
}
行"
},
{
"人员工号"
,
newAttendanceVacatione
[
i
].
PersonnelNumber
??
""
},
{
"人员姓名"
,
newAttendanceVacatione
[
i
].
PersonnelName
??
""
},
{
"考勤类型"
,
newAttendanceVacatione
[
i
].
AttendanceName
??
""
},
{
"开始日期"
,
newAttendanceVacatione
[
i
].
BegDate
?.
ToString
(
"d"
)??
""
},
{
"结束日期"
,
newAttendanceVacatione
[
i
].
EndDate
?.
ToString
(
"d"
)??
""
},
{
"来源"
,
"粘贴数据"
},
{
"错误原因"
,
$"考勤时间不在该绩效月份内,已超出
{
SplitEveryDay
(
dt
.
AddDays
(-
1
),
newAttendanceVacatione
[
i
].
EndDate
.
Value
).
Count
-
1
}
天"
},
});
error
.
Add
(
new
Dictionary
<
string
,
string
>
{
{
"行号"
,
$"第
{
i
+
1
}
行"
},
{
"人员工号"
,
newAttendanceVacatione
[
i
].
PersonnelNumber
??
""
},
{
"人员姓名"
,
newAttendanceVacatione
[
i
].
PersonnelName
??
""
},
{
"考勤类型"
,
newAttendanceVacatione
[
i
].
AttendanceName
??
""
},
{
"开始日期"
,
newAttendanceVacatione
[
i
].
BegDate
?.
ToString
(
"d"
)??
""
},
{
"结束日期"
,
newAttendanceVacatione
[
i
].
EndDate
?.
ToString
(
"d"
)??
""
},
{
"来源"
,
"粘贴数据"
},
{
"错误原因"
,
$"考勤时间不在该绩效月份内,已超出
{
SplitEveryDay
(
dt
.
AddDays
(-
1
),
newAttendanceVacatione
[
i
].
EndDate
.
Value
).
Count
-
1
}
天"
},
});
}
}
if
(
newAttendanceVacatione
[
i
].
BegDate
>
newAttendanceVacatione
[
i
].
EndDate
)
{
...
...
@@ -779,7 +785,7 @@ private List<DateTime> SplitEveryDay(DateTime begin, DateTime end)
public
string
ExcelDownload
(
List
<
Dictionary
<
string
,
object
>>
rows
,
string
name
,
int
allotId
,
List
<
ExcelDownloadHeads
>
headList
)
{
var
perAllot
=
perforPerallotRepository
.
GetEntity
(
t
=>
t
.
ID
==
allotId
);
string
title
=
$"
{
perAllot
.
Year
}
年
{
perAllot
.
Month
}
月
{
name
}
"
;
string
title
=
$"
{
perAllot
.
Year
}
年
{
perAllot
.
Month
}
月
{
name
}
"
;
var
data
=
new
List
<
Dictionary
<
string
,
object
>>();
foreach
(
var
obj
in
rows
)
...
...
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