Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
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
8timerv2
8timerapiv200
Commits
308ddd7e
Commit
308ddd7e
authored
May 21, 2020
by
lal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交考勤报表
parent
3c13519b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
182 additions
and
41 deletions
+182
-41
src/main/java/cn/timer/api/bean/kqmk/KqglAssoRelationSummary.java
+16
-9
src/main/java/cn/timer/api/controller/kqgl/ClockInTool.java
+52
-1
src/main/java/cn/timer/api/controller/kqgl/TimeCardController.java
+0
-3
src/main/java/cn/timer/api/controller/kqgl/atttimer/AttendanceTaskTiming.java
+0
-0
src/main/java/cn/timer/api/controller/kqgl/service/KqglServiceImpl.java
+9
-16
src/main/java/cn/timer/api/dao/kqmk/KqglAssoDkmxMapper.java
+5
-2
src/main/java/cn/timer/api/dao/kqmk/KqglAssoRelationSummaryMapper.java
+8
-2
src/main/java/cn/timer/api/dao/kqmk/KqglAssoTeshuMapper.java
+1
-1
src/main/java/cn/timer/api/dto/kqmk/AttSubsidiaryDto.java
+26
-0
src/main/resources/mapping/kqmk/KqglAssoDkmxMapper.xml
+18
-0
src/main/resources/mapping/kqmk/KqglAssoRelationSummaryMapper.xml
+46
-6
src/main/resources/mapping/kqmk/KqglAssoTeshuMapper.xml
+1
-1
No files found.
src/main/java/cn/timer/api/bean/kqmk/KqglAssoRelationSummary.java
View file @
308ddd7e
...
...
@@ -51,13 +51,19 @@ public class KqglAssoRelationSummary extends Model<KqglAssoRelationSummary> {
@ApiModelProperty
(
value
=
"时长 时长"
,
example
=
"101"
)
private
double
duration
;
@ApiModelProperty
(
value
=
"假期类型id"
,
example
=
"101"
)
private
Integer
leaveTypeId
;
@ApiModelProperty
(
value
=
"加班类型id"
,
example
=
"101"
)
private
Integer
overtimeTypeId
;
@ApiModelProperty
(
value
=
"加班补偿方式 1:转调休;2:转加班费;3:转调休或加班费"
,
example
=
"101"
)
private
Integer
compensateId
;
@ApiModelProperty
(
value
=
"假期类型id"
,
example
=
"101"
)
private
Integer
leaveTypeId
;
@ApiModelProperty
(
value
=
"加班类型id"
,
example
=
"101"
)
private
Integer
overtimeTypeId
;
@ApiModelProperty
(
value
=
"加班补偿方式 1:转调休;2:转加班费;3:转调休或加班费"
,
example
=
"101"
)
private
Integer
compensateId
;
@ApiModelProperty
(
value
=
"开始时间 "
,
example
=
"开始时间"
)
private
String
startTime
;
@ApiModelProperty
(
value
=
"结束时间 "
,
example
=
"结束时间"
)
private
String
endTime
;
}
\ No newline at end of file
src/main/java/cn/timer/api/controller/kqgl/ClockInTool.java
View file @
308ddd7e
package
cn
.
timer
.
api
.
controller
.
kqgl
;
import
java.text.DateFormat
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
...
...
@@ -9,6 +8,7 @@ import java.util.Arrays;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.HashSet
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Locale
;
import
java.util.Set
;
...
...
@@ -21,6 +21,57 @@ public class ClockInTool {
static
SimpleDateFormat
famt
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
// 数组容量的扩容,当空间(.length)不够的时候,增加一
public
static
String
[]
arrycopy
(
String
[]
ss
)
{
// TODO Auto-generated method stub
String
[]
ii
=
new
String
[
ss
.
length
+
1
];
System
.
arraycopy
(
ss
,
0
,
ii
,
0
,
ss
.
length
);
return
ii
;
}
public
static
String
[]
replaceNull
(
String
[]
str
)
{
// 用StringBuffer来存放数组中的非空元素,用“;”分隔
StringBuffer
sb
=
new
StringBuffer
();
for
(
int
i
=
0
;
i
<
str
.
length
;
i
++)
{
if
(
""
.
equals
(
str
[
i
]))
{
continue
;
}
sb
.
append
(
str
[
i
]);
if
(
i
!=
str
.
length
-
1
)
{
sb
.
append
(
";"
);
}
}
// 用String的split方法分割,得到数组
str
=
sb
.
toString
().
split
(
";"
);
return
str
;
}
/**
* 删除数组中的指定值 或者数组中的元素包含指定值
*
* @param filters 数组
* @param target 指定值
* @return
*/
public
static
String
[]
doChinFilters
(
String
[]
filters
,
String
target
)
{
String
[]
res
=
null
;
if
(
filters
.
length
>
0
)
{
List
<
String
>
tempList
=
Arrays
.
asList
(
filters
);
// Arrays.asList(filters) 迭代器实现类 不支持remove() 删除,多一步转化
List
<
String
>
arrList
=
new
ArrayList
<
String
>(
tempList
);
Iterator
<
String
>
it
=
arrList
.
iterator
();
while
(
it
.
hasNext
())
{
String
x
=
it
.
next
();
if
(
x
.
indexOf
(
target
)
!=
-
1
)
{
it
.
remove
();
}
}
res
=
new
String
[
arrList
.
size
()];
arrList
.
toArray
(
res
);
}
return
res
;
}
/**
* 获取两个日期之间的所有日期
*/
...
...
src/main/java/cn/timer/api/controller/kqgl/TimeCardController.java
View file @
308ddd7e
...
...
@@ -928,9 +928,6 @@ public class TimeCardController {
return
ResultUtil
.
data
(
yggl
);
}
//用户和考勤组关系
@Autowired
private
UserAttendanceRelMapper
userattendancerelservice
;
//用户与设备关系表
@Autowired
private
UserEquiRelationMapper
userequirelationmapper
;
...
...
src/main/java/cn/timer/api/controller/kqgl/atttimer/AttendanceTaskTiming.java
View file @
308ddd7e
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/controller/kqgl/service/KqglServiceImpl.java
View file @
308ddd7e
...
...
@@ -33,16 +33,15 @@ public class KqglServiceImpl implements KqglService {
*/
@Override
public
boolean
attleaveapproval
(
AttLeaveApprovalDto
leaveappr
)
{
String
startdate
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
format
(
leaveappr
.
getStarttime
());
String
enddate
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
format
(
leaveappr
.
getEndtime
());
String
[]
days
=
ClockInTool
.
listToString
(
ClockInTool
.
getDays
(
startdate
,
enddate
)).
split
(
";"
);
for
(
String
num
:
days
)
{
//记入打卡月汇总关联表
KqglAssoRelationSummary
.
builder
().
userId
(
leaveappr
.
getUserid
()).
appTime
(
num
).
approvalId
(
leaveappr
.
getLeaveid
()).
approvalType
(
2
).
duration
(
leaveappr
.
getDuration
())
.
leaveTypeId
(
leaveappr
.
getLeavetype
()).
build
().
insert
();
.
leaveTypeId
(
leaveappr
.
getLeavetype
()).
startTime
(
new
SimpleDateFormat
(
"yyyy-MM-dd' 'HH:mm:ss"
).
format
(
leaveappr
.
getStarttime
()))
.
endTime
(
new
SimpleDateFormat
(
"yyyy-MM-dd' 'HH:mm:ss"
).
format
(
leaveappr
.
getEndtime
())).
build
().
insert
();
}
YgglMainEmp
emp
=
YgglMainEmp
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
YgglMainEmp
>().
lambda
().
eq
(
YgglMainEmp:
:
getEmpNum
,
leaveappr
.
getUserid
()));
int
modifynumber
=
1
;
KqglAssoLeaveBalance
balan
=
kqglassoleavebalancemapper
.
selectOne
(
new
QueryWrapper
<
KqglAssoLeaveBalance
>().
lambda
().
eq
(
KqglAssoLeaveBalance:
:
getUserid
,
leaveappr
.
getUserid
())
...
...
@@ -50,10 +49,8 @@ public class KqglServiceImpl implements KqglService {
if
(
balan
!=
null
)
{
modifynumber
=
balan
.
getModifyNumber
()+
1
;
}
KqglAssoLeaveBalance
.
builder
().
leaveRulesId
(
leaveappr
.
getLeavetype
()).
userid
(
leaveappr
.
getUserid
()).
modifyAction
(
2
).
balanceDays
(
"-"
+
leaveappr
.
getDuration
())
.
reason
(
"系统按照规则自动"
).
modifyUserid
(
emp
.
getEmpNum
()).
modifyTimer
(
new
Date
().
getTime
()).
orgCode
(
emp
.
getOrgCode
()).
isAutomatic
(
1
).
modifyNumber
(
modifynumber
).
build
().
insert
();
//员工假期余额
return
true
;
}
...
...
@@ -62,7 +59,6 @@ public class KqglServiceImpl implements KqglService {
*/
@Override
public
boolean
attovertimeapproval
(
AttOvertimeApprovalDto
overappr
)
{
String
startdate
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
format
(
overappr
.
getStarttime
());
String
enddate
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
format
(
overappr
.
getEndtime
());
String
[]
days
=
ClockInTool
.
listToString
(
ClockInTool
.
getDays
(
startdate
,
enddate
)).
split
(
";"
);
...
...
@@ -70,11 +66,9 @@ public class KqglServiceImpl implements KqglService {
//记入打卡月汇总关联表
KqglAssoRelationSummary
.
builder
().
userId
(
overappr
.
getUserid
()).
appTime
(
num
).
approvalId
(
overappr
.
getOvertimeid
()).
approvalType
(
1
).
duration
(
overappr
.
getDuration
())
.
overtimeTypeId
(
overappr
.
getOvertimetype
()).
compensateId
(
overappr
.
getCompensate
()).
build
().
insert
();
.
overtimeTypeId
(
overappr
.
getOvertimetype
()).
compensateId
(
overappr
.
getCompensate
()).
startTime
(
new
SimpleDateFormat
(
"yyyy-MM-dd' 'HH:mm:ss"
).
format
(
overappr
.
getStarttime
()))
.
endTime
(
new
SimpleDateFormat
(
"yyyy-MM-dd' 'HH:mm:ss"
).
format
(
overappr
.
getEndtime
())).
build
().
insert
();
}
return
true
;
}
...
...
@@ -89,7 +83,8 @@ public class KqglServiceImpl implements KqglService {
String
[]
days
=
ClockInTool
.
listToString
(
ClockInTool
.
getDays
(
startdate
,
enddate
)).
split
(
";"
);
for
(
String
num
:
days
)
{
//记入打卡月汇总关联表
KqglAssoRelationSummary
.
builder
().
userId
(
evecappr
.
getUserid
()).
appTime
(
num
).
approvalId
(
evecappr
.
getEvectionid
()).
approvalType
(
3
).
build
().
insert
();
KqglAssoRelationSummary
.
builder
().
userId
(
evecappr
.
getUserid
()).
appTime
(
num
).
approvalId
(
evecappr
.
getEvectionid
()).
approvalType
(
3
)
.
startTime
(
new
SimpleDateFormat
(
"yyyy-MM-dd' 'HH:mm:ss"
).
format
(
evecappr
.
getStarttime
())).
endTime
(
new
SimpleDateFormat
(
"yyyy-MM-dd' 'HH:mm:ss"
).
format
(
evecappr
.
getEndtime
())).
build
().
insert
();
}
}
else
{
//外出
String
startdate
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
format
(
evecappr
.
getStarttime
());
...
...
@@ -97,7 +92,8 @@ public class KqglServiceImpl implements KqglService {
String
[]
days
=
ClockInTool
.
listToString
(
ClockInTool
.
getDays
(
startdate
,
enddate
)).
split
(
";"
);
for
(
String
num
:
days
)
{
//记入打卡月汇总关联表
KqglAssoRelationSummary
.
builder
().
userId
(
evecappr
.
getUserid
()).
appTime
(
num
).
approvalId
(
evecappr
.
getEvectionid
()).
approvalType
(
4
).
build
().
insert
();
KqglAssoRelationSummary
.
builder
().
userId
(
evecappr
.
getUserid
()).
appTime
(
num
).
approvalId
(
evecappr
.
getEvectionid
()).
approvalType
(
4
)
.
startTime
(
new
SimpleDateFormat
(
"yyyy-MM-dd' 'HH:mm:ss"
).
format
(
evecappr
.
getStarttime
())).
endTime
(
new
SimpleDateFormat
(
"yyyy-MM-dd' 'HH:mm:ss"
).
format
(
evecappr
.
getEndtime
())).
build
().
insert
();
}
}
return
true
;
...
...
@@ -108,12 +104,9 @@ public class KqglServiceImpl implements KqglService {
*/
@Override
public
boolean
attrepairapproval
(
AttRepairApprovalDto
repaappr
)
{
String
cardrepltime
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
format
(
repaappr
.
getCardrepltime
());
//补卡时间
//记入打卡月汇总关联表
KqglAssoRelationSummary
.
builder
().
userId
(
repaappr
.
getUserid
()).
appTime
(
cardrepltime
).
approvalId
(
repaappr
.
getRepairid
()).
approvalType
(
5
).
build
().
insert
();
KqglAssoRelationSummary
.
builder
().
userId
(
repaappr
.
getUserid
()).
appTime
(
cardrepltime
).
approvalId
(
repaappr
.
getRepairid
()).
approvalType
(
5
).
startTime
(
new
SimpleDateFormat
(
"yyyy-MM-dd' 'HH:mm:ss"
).
format
(
repaappr
.
getCardrepltime
())).
build
().
insert
();
return
true
;
}
...
...
src/main/java/cn/timer/api/dao/kqmk/KqglAssoDkmxMapper.java
View file @
308ddd7e
package
cn
.
timer
.
api
.
dao
.
kqmk
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.springframework.stereotype.Repository
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
cn.timer.api.bean.kqmk.KqglAssoDkmx
;
import
cn.timer.api.dto.kqmk.AttSubsidiaryDto
;
/**
* 打卡明细表
...
...
@@ -12,5 +14,6 @@ import cn.timer.api.bean.kqmk.KqglAssoDkmx;
*/
@Repository
public
interface
KqglAssoDkmxMapper
extends
BaseMapper
<
KqglAssoDkmx
>
{
AttSubsidiaryDto
subsidiary
(
int
userid
,
String
data
);
}
src/main/java/cn/timer/api/dao/kqmk/KqglAssoRelationSummaryMapper.java
View file @
308ddd7e
package
cn
.
timer
.
api
.
dao
.
kqmk
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
java.util.List
;
import
org.springframework.stereotype.Repository
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
cn.timer.api.bean.kqmk.KqglAssoRelationSummary
;
/**
...
...
@@ -12,5 +15,8 @@ import cn.timer.api.bean.kqmk.KqglAssoRelationSummary;
*/
@Repository
public
interface
KqglAssoRelationSummaryMapper
extends
BaseMapper
<
KqglAssoRelationSummary
>
{
KqglAssoRelationSummary
SecondaryValue
(
int
userid
,
int
approvaltype
,
String
time
);
List
<
KqglAssoRelationSummary
>
SpecificLeave
(
int
userid
,
int
approvaltype
,
String
apptime
);
}
src/main/java/cn/timer/api/dao/kqmk/KqglAssoTeshuMapper.java
View file @
308ddd7e
...
...
@@ -18,6 +18,6 @@ public interface KqglAssoTeshuMapper extends BaseMapper<KqglAssoTeshu> {
int
insertKqglAssoTeshuList
(
List
<
KqglAssoTeshu
>
kqglassoteshu
);
List
<
KqglAssoTeshu
>
ShouldSpecialDatessetByKqzid
(
int
kqzid
,
int
tsrq
,
int
type
);
List
<
KqglAssoTeshu
>
ShouldSpecialDatessetByKqzid
(
int
kqzid
,
String
tsrq
,
int
type
);
}
src/main/java/cn/timer/api/dto/kqmk/AttSubsidiaryDto.java
0 → 100644
View file @
308ddd7e
package
cn
.
timer
.
api
.
dto
.
kqmk
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
AttSubsidiaryDto
{
@ApiModelProperty
(
value
=
"工作总时长"
,
example
=
"字段说明"
)
private
double
gzsctotalgzsc
;
@ApiModelProperty
(
value
=
"严重迟到总次数"
,
example
=
"字段说明"
)
private
double
yzcdcstotal
;
@ApiModelProperty
(
value
=
"严重迟到总时长(分钟) "
,
example
=
"字段说明"
)
private
double
yzcdsctotal
;
@ApiModelProperty
(
value
=
"旷工迟到总次数"
,
example
=
"字段说明"
)
private
double
kgcdfzstotal
;
}
src/main/resources/mapping/kqmk/KqglAssoDkmxMapper.xml
View file @
308ddd7e
...
...
@@ -27,6 +27,13 @@
<result
column=
"yzcdsc"
property=
"yzcdsc"
/>
<result
column=
"kgcdfzs"
property=
"kgcdfzs"
/>
</resultMap>
<resultMap
id=
"AttSubsidiary"
type=
"cn.timer.api.dto.kqmk.AttSubsidiaryDto"
>
<result
column=
"gzsctotalgzsc"
property=
"gzsctotalgzsc"
/>
<result
column=
"yzcdcstotal"
property=
"yzcdcstotal"
/>
<result
column=
"yzcdsctotal"
property=
"yzcdsctotal"
/>
<result
column=
"kgcdfzstotal"
property=
"kgcdfzstotal"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id,
...
...
@@ -78,6 +85,17 @@
kgcdfzs KqglAssoDkmx_kgcdfzs
</sql>
<select
id=
"subsidiary"
resultMap=
"AttSubsidiary"
>
select SUM(dk.gzsc) as gzsctotalgzsc,
SUM(dk.yzcdcs) as yzcdcstotal,
SUM(dk.yzcdsc) as yzcdsctotal,
SUM(dk.kgcdfzs) as kgcdfzstotal
from kqgl_asso_dkmx dk
where dk.userid = #{userid}
and SUBSTR(dk.`data`,1,7) = #{data}
GROUP BY dk.userid
</select>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.kqmk.KqglAssoDkmx">
...
...
src/main/resources/mapping/kqmk/KqglAssoRelationSummaryMapper.xml
View file @
308ddd7e
...
...
@@ -13,6 +13,8 @@
<result
column=
"leave_type_id"
property=
"leaveTypeId"
/>
<result
column=
"overtime_type_id"
property=
"overtimeTypeId"
/>
<result
column=
"compensate_id"
property=
"compensateId"
/>
<result
column=
"start_time"
property=
"startTime"
/>
<result
column=
"end_time"
property=
"endTime"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
...
...
@@ -24,7 +26,9 @@
duration,
leave_type_id,
overtime_type_id,
compensate_id
compensate_id,
start_time,
end_time
</sql>
<sql
id=
"Base_Column_List_Alias"
>
...
...
@@ -36,9 +40,31 @@
duration KqglAssoRelationSummary_duration,
leave_type_id KqglAssoRelationSummary_leave_type_id,
overtime_type_id KqglAssoRelationSummary_overtime_type_id,
compensate_id KqglAssoRelationSummary_compensate_id
compensate_id KqglAssoRelationSummary_compensate_id,
start_time KqglAssoRelationSummary_start_time,
end_time KqglAssoRelationSummary_end_time
</sql>
<select
id=
"SecondaryValue"
resultMap=
"BaseResultMap"
>
select a.user_id,
SUM(a.duration) as duration
from (select res.user_id,res.duration
from kqgl_asso_relation_summary res
where res.user_id = #{userid}
and res.approval_type = #{approvaltype}
and SUBSTR(res.app_time,1,7) = #{time}
GROUP BY res.approval_id) as a
GROUP BY a.user_id
</select>
<select
id=
"SpecificLeave"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from kqgl_asso_relation_summary res
where res.user_id = #{userid}
and res.approval_type = #{approvaltype}
and SUBSTR(res.app_time,1,7) = #{apptime}
</select>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.kqmk.KqglAssoRelationSummary">
...
...
@@ -66,7 +92,13 @@
overtime_type_id,
</if>
<if test ='null != compensateId'>
compensate_id
compensate_id,
</if>
<if test ='null != startTime'>
start_time,
</if>
<if test ='null != endTime'>
end_time
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
...
...
@@ -92,7 +124,13 @@
#{overtimeTypeId},
</if>
<if test ='null != compensateId'>
#{compensateId}
#{compensateId},
</if>
<if test ='null != startTime'>
#{startTime},
</if>
<if test ='null != endTime'>
#{endTime}
</if>
</trim>
</insert>
...
...
@@ -112,7 +150,9 @@
<if test ='null != duration'>duration = #{duration},</if>
<if test ='null != leaveTypeId'>leave_type_id = #{leaveTypeId},</if>
<if test ='null != overtimeTypeId'>overtime_type_id = #{overtimeTypeId},</if>
<if test ='null != compensateId'>compensate_id = #{compensateId}</if>
<if test ='null != compensateId'>compensate_id = #{compensateId},</if>
<if test ='null != startTime'>start_time = #{startTime},</if>
<if test ='null != endTime'>end_time = #{endTime}</if>
</set>
WHERE id = #{id}
</update>
...
...
src/main/resources/mapping/kqmk/KqglAssoTeshuMapper.xml
View file @
308ddd7e
...
...
@@ -63,7 +63,7 @@
select
<include
refid=
"Base_Column_List"
/>
from kqgl_asso_teshu teshu
where teshu.kqzid = #{kqzid}
and
substring(teshu.tsrq,6,2
) = #{tsrq}
and
SUBSTR(teshu.tsrq,1,7
) = #{tsrq}
and teshu.type = #{type}
</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