Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
attendance-performance-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
attendance-performance-platform
Commits
eb645521
Commit
eb645521
authored
Apr 30, 2024
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
H5个人申请情况接口,绩效分数汇总接口
parent
7699a2d5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
133 additions
and
55 deletions
+133
-55
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/h5/web/PerformApiController.java
...va/com/mortals/xhx/busiz/h5/web/PerformApiController.java
+0
-55
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/h5/web/PerformErrorMessagePerformApiController.java
...busiz/h5/web/PerformErrorMessagePerformApiController.java
+133
-0
No files found.
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/h5/web/PerformApiController.java
View file @
eb645521
...
...
@@ -86,10 +86,6 @@ public class PerformApiController extends AbstractBaseController<PerformReq> {
private
StaffPerformStatService
staffPerformStatService
;
@Autowired
private
PerformRulesService
rulesService
;
@Autowired
private
StaffPerformSummaryService
staffPerformSummaryService
;
@Autowired
private
PerformErrorMessageService
performErrorMessageService
;
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
this
.
addDict
(
model
,
"checkStatus"
,
CheckStatusEnum
.
getEnumMap
());
...
...
@@ -513,55 +509,4 @@ public class PerformApiController extends AbstractBaseController<PerformReq> {
return
rest
;
}
/**
* 个人绩效汇总分数信息
* @param query
* @return
*/
@PostMapping
({
"summary"
})
public
String
getSummary
(
@RequestBody
PerformErrorMessageEntity
query
){
JSONObject
ret
=
new
JSONObject
();
String
busiDesc
=
"查看个人绩效汇总"
;
Context
context
=
this
.
getContext
();
Map
<
String
,
Object
>
model
=
new
HashMap
();
if
(
query
.
getStaffId
()==
null
){
return
this
.
createFailJsonResp
(
"绩效人员信息不能为空"
);
}
else
{
StaffPerformSummaryEntity
summaryQuery
=
new
StaffPerformSummaryEntity
();
summaryQuery
.
setStaffId
(
query
.
getStaffId
());
if
(
StringUtils
.
isNotEmpty
(
query
.
getErrorTimeStart
())){
try
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Date
date
=
sdf
.
parse
(
query
.
getYearmonth
());
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
date
);
summaryQuery
.
setYear
(
calendar
.
get
(
Calendar
.
YEAR
));
summaryQuery
.
setMonth
(
calendar
.
get
(
Calendar
.
MONTH
)+
1
);
}
catch
(
Exception
e
){
}
}
else
{
query
.
setErrorTimeStart
(
DateUtils
.
getCurrDateTime
(
"yyyy-MM"
)+
"-01"
);
Calendar
calendar
=
Calendar
.
getInstance
();
summaryQuery
.
setYear
(
calendar
.
get
(
Calendar
.
YEAR
));
summaryQuery
.
setMonth
(
calendar
.
get
(
Calendar
.
MONTH
)+
1
);
}
StaffPerformSummaryEntity
staffPerformSummaryEntity
=
staffPerformSummaryService
.
selectOne
(
summaryQuery
);
if
(
staffPerformSummaryEntity
!=
null
)
{
model
.
put
(
"totalScore"
,
staffPerformSummaryEntity
.
getTotalScore
());
}
int
errorCount
=
performErrorMessageService
.
count
(
query
,
null
);
model
.
put
(
"errorCount"
,
errorCount
);
List
<
Integer
>
appeal
=
Arrays
.
asList
(
1
,
2
,
3
);
query
.
setAppealStatusList
(
appeal
);
int
appealCount
=
performErrorMessageService
.
count
(
query
,
null
);
model
.
put
(
"appealCount"
,
appealCount
);
ret
.
put
(
"data"
,
model
);
ret
.
put
(
"code"
,
1
);
ret
.
put
(
"msg"
,
model
.
remove
(
"message_info"
));
ret
.
put
(
"dict"
,
model
.
remove
(
"dict"
));
return
ret
.
toJSONString
();
}
}
}
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/h5/web/PerformErrorMessagePerformApiController.java
0 → 100644
View file @
eb645521
package
com.mortals.xhx.busiz.h5.web
;
import
com.alibaba.fastjson.JSONObject
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.util.DateUtils
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.xhx.busiz.h5.req.PerformReq
;
import
com.mortals.xhx.common.code.AppealStatusEnum
;
import
com.mortals.xhx.module.perform.model.PerformErrorMessageEntity
;
import
com.mortals.xhx.module.perform.service.PerformErrorMessageService
;
import
com.mortals.xhx.module.staff.model.StaffPerformSummaryEntity
;
import
com.mortals.xhx.module.staff.service.StaffPerformSummaryService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
@RestController
@Slf4j
@RequestMapping
(
"/api/v1/perform/error/message"
)
public
class
PerformErrorMessagePerformApiController
extends
AbstractBaseController
<
PerformReq
>{
@Autowired
private
StaffPerformSummaryService
staffPerformSummaryService
;
@Autowired
private
PerformErrorMessageService
performErrorMessageService
;
/**
* 个人绩效汇总分数信息
* @param query
* @return
*/
@PostMapping
({
"summary"
})
public
String
getSummary
(
@RequestBody
PerformErrorMessageEntity
query
){
JSONObject
ret
=
new
JSONObject
();
String
busiDesc
=
"查看个人绩效汇总"
;
Context
context
=
this
.
getContext
();
Map
<
String
,
Object
>
model
=
new
HashMap
();
if
(
query
.
getStaffId
()==
null
){
return
this
.
createFailJsonResp
(
"绩效人员信息不能为空"
);
}
else
{
StaffPerformSummaryEntity
summaryQuery
=
new
StaffPerformSummaryEntity
();
summaryQuery
.
setStaffId
(
query
.
getStaffId
());
if
(
StringUtils
.
isNotEmpty
(
query
.
getErrorTimeStart
())){
try
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Date
date
=
sdf
.
parse
(
query
.
getYearmonth
());
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
date
);
summaryQuery
.
setYear
(
calendar
.
get
(
Calendar
.
YEAR
));
summaryQuery
.
setMonth
(
calendar
.
get
(
Calendar
.
MONTH
)+
1
);
}
catch
(
Exception
e
){
}
}
else
{
query
.
setErrorTimeStart
(
DateUtils
.
getCurrDateTime
(
"yyyy-MM"
)+
"-01"
);
Calendar
calendar
=
Calendar
.
getInstance
();
summaryQuery
.
setYear
(
calendar
.
get
(
Calendar
.
YEAR
));
summaryQuery
.
setMonth
(
calendar
.
get
(
Calendar
.
MONTH
)+
1
);
}
StaffPerformSummaryEntity
staffPerformSummaryEntity
=
staffPerformSummaryService
.
selectOne
(
summaryQuery
);
if
(
staffPerformSummaryEntity
!=
null
)
{
model
.
put
(
"totalScore"
,
staffPerformSummaryEntity
.
getTotalScore
());
}
int
errorCount
=
performErrorMessageService
.
count
(
query
,
null
);
model
.
put
(
"errorCount"
,
errorCount
);
List
<
Integer
>
appeal
=
Arrays
.
asList
(
1
,
2
,
3
);
query
.
setAppealStatusList
(
appeal
);
int
appealCount
=
performErrorMessageService
.
count
(
query
,
null
);
model
.
put
(
"appealCount"
,
appealCount
);
ret
.
put
(
"data"
,
model
);
ret
.
put
(
"code"
,
1
);
ret
.
put
(
"msg"
,
model
.
remove
(
"message_info"
));
ret
.
put
(
"dict"
,
model
.
remove
(
"dict"
));
return
ret
.
toJSONString
();
}
}
/**
* 个人绩效申诉情况
* @param query
* @return
*/
@PostMapping
({
"appeal"
})
public
String
getAppeal
(
@RequestBody
PerformErrorMessageEntity
query
){
JSONObject
ret
=
new
JSONObject
();
String
busiDesc
=
"查看个人申诉情况"
;
Context
context
=
this
.
getContext
();
Map
<
String
,
Object
>
model
=
new
HashMap
();
if
(
query
.
getStaffId
()==
null
){
return
this
.
createFailJsonResp
(
"绩效人员信息不能为空"
);
}
else
{
if
(
CollectionUtils
.
isEmpty
(
query
.
getAppealStatusList
()))
{
List
<
Integer
>
appeal
=
Arrays
.
asList
(
1
,
2
,
3
);
query
.
setAppealStatusList
(
appeal
);
}
List
<
PerformErrorMessageEntity
>
list
=
performErrorMessageService
.
find
(
query
);
int
appeal1
=
0
;
int
appeal2
=
0
;
int
appeal3
=
0
;
for
(
PerformErrorMessageEntity
item:
list
){
if
(
item
.
getAppealStatus
()==
AppealStatusEnum
.
申诉中
.
getValue
()){
appeal1
++;
}
if
(
item
.
getAppealStatus
()==
AppealStatusEnum
.
申诉拒绝
.
getValue
()){
appeal2
++;
}
if
(
item
.
getAppealStatus
()==
AppealStatusEnum
.
申诉通过
.
getValue
()){
appeal3
++;
}
}
model
.
put
(
"shensuzhong"
,
appeal1
);
model
.
put
(
"shensujujue"
,
appeal2
);
model
.
put
(
"shensutongguo"
,
appeal3
);
// int errorCount = performErrorMessageService.count(query,null);
// model.put("errorCount", errorCount);
//
// int appealCount = performErrorMessageService.count(query,null);
// model.put("appealCount", appealCount);
ret
.
put
(
"data"
,
model
);
ret
.
put
(
"code"
,
1
);
ret
.
put
(
"msg"
,
model
.
remove
(
"message_info"
));
ret
.
put
(
"dict"
,
model
.
remove
(
"dict"
));
return
ret
.
toJSONString
();
}
}
}
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