Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
jilinzhongdianrenqun
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
吴超
jilinzhongdianrenqun
Commits
02b5f427
Commit
02b5f427
authored
Dec 30, 2025
by
yubin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
c2f1eeab
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
20 行增加
和
33 行删除
+20
-33
src/main/java/com/scpyun/platform/jilinsscgsdp/service/impl/KeyDmLeaveServiceImpl.java
+8
-29
src/main/resources/mybatis/mappers/standard/jilinsscgsdp/KeyDmLeaveApplicationDao.xml
+7
-1
src/main/resources/mybatis/mappers/standard/jilinsscgsdp/KeyDmLeaveApprovalRecordDao.xml
+5
-3
没有找到文件。
src/main/java/com/scpyun/platform/jilinsscgsdp/service/impl/KeyDmLeaveServiceImpl.java
View file @
02b5f427
...
@@ -54,7 +54,15 @@ public class KeyDmLeaveServiceImpl {
...
@@ -54,7 +54,15 @@ public class KeyDmLeaveServiceImpl {
if
(
map
==
null
)
map
=
new
HashMap
<>();
if
(
map
==
null
)
map
=
new
HashMap
<>();
return
commonService
.
findList
(
namespace
+
"selectTransferApprovalList"
,
map
);
return
commonService
.
findList
(
namespace
+
"selectTransferApprovalList"
,
map
);
}
}
@ApiOperation
(
value
=
"待审核列表"
,
desc
=
"查询待审核数据"
)
public
String
deleteById
(
Map
<
String
,
Object
>
map
)
{
if
(
map
==
null
)
map
=
new
HashMap
<>();
int
aff
=
commonService
.
update
(
namespace
+
"deleteById"
,
map
);
commonService
.
findList
(
approvalRecordNamespace
+
"deleteById"
,
map
);
if
(
aff
<
0
)
throw
new
CustomException
(
"审批失败"
);
return
SUCCESS
;
}
@ApiOperation
(
value
=
"保存请假申请"
,
desc
=
"新增或修改,请假单保存"
)
@ApiOperation
(
value
=
"保存请假申请"
,
desc
=
"新增或修改,请假单保存"
)
public
String
save
(
Map
<
String
,
Object
>
map
)
{
public
String
save
(
Map
<
String
,
Object
>
map
)
{
if
(
map
==
null
)
throw
new
CustomException
(
"参数不能为空"
);
if
(
map
==
null
)
throw
new
CustomException
(
"参数不能为空"
);
...
@@ -75,35 +83,6 @@ public class KeyDmLeaveServiceImpl {
...
@@ -75,35 +83,6 @@ public class KeyDmLeaveServiceImpl {
map
.
put
(
"leave_type_name"
,
typeName
);
map
.
put
(
"leave_type_name"
,
typeName
);
map
.
put
(
"status"
,
0
);
// 默认保存状态为0
map
.
put
(
"status"
,
0
);
// 默认保存状态为0
Object
startDateObj
=
map
.
get
(
"start_time"
);
Object
endDateObj
=
map
.
get
(
"end_time"
);
double
durationDays
=
0
;
// 初始化天数为0
// 1. 非空判断 + 计算天数
if
(
startDateObj
!=
null
&&
endDateObj
!=
null
)
{
try
{
// 1. 解析字符串时间为DateTime
DateTimeFormatter
formatter
=
DateTimeFormat
.
forPattern
(
"yyyy-MM-dd HH:mm:ss"
);
DateTime
startDate
=
formatter
.
parseDateTime
(
startDateObj
.
toString
());
DateTime
endDate
=
formatter
.
parseDateTime
(
endDateObj
.
toString
());
// 2. 计算时间差(毫秒),转成带小数的天数
Duration
durationObj
=
new
Duration
(
startDate
,
endDate
);
long
totalMillis
=
durationObj
.
getMillis
();
// 关键:用86400000.0(浮点数)做除法,保留小数
durationDays
=
totalMillis
/
86400000.0
;
// 可选:保留1位小数(比如0.1天、4.5天),避免小数位数过多
durationDays
=
Math
.
round
(
durationDays
*
10
)
/
10.0
;
// 3. 存入map(小数天数)
map
.
put
(
"duration"
,
durationDays
);
}
catch
(
IllegalArgumentException
e
)
{
throw
new
CustomException
(
"时间格式错误,应为yyyy-MM-dd HH:mm:ss"
);
}
}
else
{
// 空值时默认存0.0,保持类型统一
map
.
put
(
"duration"
,
0.0
);
}
if
(
commonService
.
insert
(
namespace
+
"insert"
,
map
)
!=
1
)
{
if
(
commonService
.
insert
(
namespace
+
"insert"
,
map
)
!=
1
)
{
throw
new
CustomException
(
"保存失败"
);
throw
new
CustomException
(
"保存失败"
);
}
}
...
...
src/main/resources/mybatis/mappers/standard/jilinsscgsdp/KeyDmLeaveApplicationDao.xml
View file @
02b5f427
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
FROM jl_key_dm_leave_application
FROM jl_key_dm_leave_application
<where>
<where>
AND is_used = 1
AND is_used = 1
AND status !=0
<if
test=
"params.user_name != null and params.user_name != ''"
>
<if
test=
"params.user_name != null and params.user_name != ''"
>
AND user_name LIKE CONCAT('%', #{params.user_name}, '%')
AND user_name LIKE CONCAT('%', #{params.user_name}, '%')
</if>
</if>
...
@@ -77,7 +78,7 @@
...
@@ -77,7 +78,7 @@
AND a.status = #{params.params.status}
AND a.status = #{params.params.status}
</if>
</if>
</where>
</where>
ORDER BY a.s
ubmit_time DE
SC
ORDER BY a.s
tatus A
SC
</select>
</select>
<select
id=
"selectPendingList"
parameterType=
"page"
resultType=
"map"
>
<select
id=
"selectPendingList"
parameterType=
"page"
resultType=
"map"
>
...
@@ -230,6 +231,11 @@
...
@@ -230,6 +231,11 @@
WHERE id = #{leave_id}
WHERE id = #{leave_id}
</update>
</update>
<update
id=
"deleteById"
parameterType=
"map"
>
UPDATE jl_key_dm_leave_application set is_used=0 WHERE id = #{leave_id}
</update>
<!-- 提交:设置 status=1 (审核中),submit_time=NOW() -->
<!-- 提交:设置 status=1 (审核中),submit_time=NOW() -->
<update
id=
"submit"
parameterType=
"map"
>
<update
id=
"submit"
parameterType=
"map"
>
UPDATE jl_key_dm_leave_application
UPDATE jl_key_dm_leave_application
...
...
src/main/resources/mybatis/mappers/standard/jilinsscgsdp/KeyDmLeaveApprovalRecordDao.xml
View file @
02b5f427
...
@@ -19,9 +19,9 @@
...
@@ -19,9 +19,9 @@
<insert
id=
"insert"
parameterType=
"map"
>
<insert
id=
"insert"
parameterType=
"map"
>
INSERT INTO jl_key_dm_leave_approval_record(
INSERT INTO jl_key_dm_leave_approval_record(
id,leave_id,node_index,node_type,approver_id,approver_name,approver_result,
approver_time,
status,comment,transfer_to_id,transfer_to_name,transfer_reason,is_used,create_by,create_time,order_no
id,leave_id,node_index,node_type,approver_id,approver_name,approver_result,status,comment,transfer_to_id,transfer_to_name,transfer_reason,is_used,create_by,create_time,order_no
) VALUES (
) VALUES (
#{id},#{leave_id},#{node_index},#{node_type},#{approver_id},#{approver_name},#{approver_result},
NOW(),
#{status},#{comment},#{transfer_to_id},#{transfer_to_name},#{transfer_reason},1,#{_user.id},NOW(),#{order_no}
#{id},#{leave_id},#{node_index},#{node_type},#{approver_id},#{approver_name},#{approver_result},#{status},#{comment},#{transfer_to_id},#{transfer_to_name},#{transfer_reason},1,#{_user.id},NOW(),#{order_no}
)
)
</insert>
</insert>
...
@@ -82,7 +82,9 @@
...
@@ -82,7 +82,9 @@
SET status = 2, approver_time = NOW(), update_by = #{_user.id}, update_time = NOW(),approver_result = -1
SET status = 2, approver_time = NOW(), update_by = #{_user.id}, update_time = NOW(),approver_result = -1
WHERE id = #{id}
WHERE id = #{id}
</update>
</update>
<delete
id=
"deleteById"
parameterType=
"map"
>
UPDATE jl_key_dm_leave_approval_record set is_used=0 WHERE id = #{id}
</delete>
<update
id=
"update"
parameterType=
"map"
>
<update
id=
"update"
parameterType=
"map"
>
UPDATE jl_key_dm_leave_approval_record
UPDATE jl_key_dm_leave_approval_record
SET
SET
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论