Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
邬吉朋
ops
Commits
2e5b6d80
"src/main/java/com/git@gitlab.ruzhoukj.com:wujipeng/ops.git" did not exist on "580a8793cbfb12fc040b24d160fc4d4e77a2708e"
Commit
2e5b6d80
authored
Apr 14, 2025
by
zhuxiang
Browse files
绩效分数保留两位小鼠
parent
893a37bc
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/ruzhoukj/sms/service/impl/ReportDataInfoServiceImpl.java
View file @
2e5b6d80
...
@@ -14,6 +14,7 @@ import com.ruzhoukj.sms.service.*;
...
@@ -14,6 +14,7 @@ import com.ruzhoukj.sms.service.*;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.text.DecimalFormat
;
import
java.time.LocalDate
;
import
java.time.LocalDate
;
import
java.util.List
;
import
java.util.List
;
...
@@ -92,11 +93,16 @@ public class ReportDataInfoServiceImpl extends ServiceImpl<ReportDataInfoDao, Re
...
@@ -92,11 +93,16 @@ public class ReportDataInfoServiceImpl extends ServiceImpl<ReportDataInfoDao, Re
}
}
}
}
if
(!
totalScore
.
equals
(
"0"
))
{
if
(!
totalScore
.
equals
(
"0"
))
{
// 将字符串转换为数值
double
value
=
Double
.
parseDouble
(
totalScore
);
// 使用 DecimalFormat 保留两位小数
DecimalFormat
df
=
new
DecimalFormat
(
"#.##"
);
String
formattedValue
=
df
.
format
(
value
);
//更新用户绩效分
//更新用户绩效分
UserPerformanceEntity
userPerformanceEntity
=
new
UserPerformanceEntity
();
UserPerformanceEntity
userPerformanceEntity
=
new
UserPerformanceEntity
();
userPerformanceEntity
.
setUserId
(
reportDataInfoEntity
.
getUserId
());
userPerformanceEntity
.
setUserId
(
reportDataInfoEntity
.
getUserId
());
userPerformanceEntity
.
setPerformanceDate
(
reportDataInfoEntity
.
getYear
(),
reportDataInfoEntity
.
getMonth
());
userPerformanceEntity
.
setPerformanceDate
(
reportDataInfoEntity
.
getYear
(),
reportDataInfoEntity
.
getMonth
());
userPerformanceEntity
.
setPerformanceScore
(
totalScor
e
);
userPerformanceEntity
.
setPerformanceScore
(
formattedValu
e
);
userPerformanceEntity
.
setDeptId
(
reportDataInfoEntity
.
getDeptId
());
userPerformanceEntity
.
setDeptId
(
reportDataInfoEntity
.
getDeptId
());
userPerformanceEntity
.
setReportDataId
(
reportDataInfoEntity
.
getId
());
userPerformanceEntity
.
setReportDataId
(
reportDataInfoEntity
.
getId
());
userPerformanceService
.
save
(
userPerformanceEntity
);
userPerformanceService
.
save
(
userPerformanceEntity
);
...
...
src/main/java/com/ruzhoukj/sms/service/impl/UserPerformanceServiceImpl.java
View file @
2e5b6d80
...
@@ -24,15 +24,6 @@ import java.util.List;
...
@@ -24,15 +24,6 @@ import java.util.List;
public
class
UserPerformanceServiceImpl
extends
ServiceImpl
<
UserPerformanceDao
,
UserPerformanceEntity
>
implements
UserPerformanceService
{
public
class
UserPerformanceServiceImpl
extends
ServiceImpl
<
UserPerformanceDao
,
UserPerformanceEntity
>
implements
UserPerformanceService
{
@Override
@Override
public
List
<
UserPerformanceVO
>
queryList
(
UserPerformanceDTO
userPerformanceDTO
)
{
public
List
<
UserPerformanceVO
>
queryList
(
UserPerformanceDTO
userPerformanceDTO
)
{
//获取当前年月
// 获取当前日期
LocalDate
now
=
LocalDate
.
now
();
// 获取上个月的日期
LocalDate
lastMonth
=
now
.
minusMonths
(
1
);
// 格式化为 "yyyy-MM"
DateTimeFormatter
formatter
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM"
);
String
lastYearMonth
=
lastMonth
.
format
(
formatter
);
userPerformanceDTO
.
setPerformanceDate
(
lastYearMonth
);
return
baseMapper
.
queryList
(
userPerformanceDTO
);
return
baseMapper
.
queryList
(
userPerformanceDTO
);
}
}
}
}
src/main/resources/com/ruzhoukj/sms/dao/ReportDataInfoDao.xml
View file @
2e5b6d80
...
@@ -24,13 +24,13 @@
...
@@ -24,13 +24,13 @@
r.user_id = u.id
r.user_id = u.id
<where>
<where>
<if
test=
"deptId != null and deptId != ''"
>
<if
test=
"deptId != null and deptId != ''"
>
r.dept_id = #{deptId}
and
r.dept_id = #{deptId}
</if>
</if>
<if
test=
"userId != null and userId != ''"
>
<if
test=
"userId != null and userId != ''"
>
r.user_id = #{userId}
and
r.user_id = #{userId}
</if>
</if>
<if
test=
"month != null and month != ''"
>
<if
test=
"month != null and month != ''"
>
r.month = #{month}
and
r.month = #{month}
</if>
</if>
</where>
</where>
</select>
</select>
...
...
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