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
a54fe5ac
Commit
a54fe5ac
authored
May 12, 2020
by
ilal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交
parent
10068269
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
312 additions
and
8 deletions
+312
-8
src/main/java/cn/timer/api/bean/kqmk/KqglAssoYhkqz.java
+50
-0
src/main/java/cn/timer/api/config/Initialization/InitializeSetting.java
+1
-1
src/main/java/cn/timer/api/controller/kqgl/TimeCardController.java
+116
-1
src/main/java/cn/timer/api/dao/kqmk/KqglAssoYhkqzMapper.java
+16
-0
src/main/java/cn/timer/api/dao/kqmk/KqglMainKqzMapper.java
+6
-0
src/main/java/cn/timer/api/dto/kqmk/AttendanceGroupDto.java
+7
-6
src/main/resources/mapping/kqmk/KqglAssoYhkqzMapper.xml
+91
-0
src/main/resources/mapping/kqmk/KqglMainKqzMapper.xml
+25
-0
No files found.
src/main/java/cn/timer/api/bean/kqmk/KqglAssoYhkqz.java
0 → 100644
View file @
a54fe5ac
package
cn
.
timer
.
api
.
bean
.
kqmk
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.extension.activerecord.Model
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @author LAL 2020-05-12
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table
(
name
=
"kqgl_asso_yhkqz"
)
@ApiModel
(
"用户和考勤组关系表"
)
public
class
KqglAssoYhkqz
extends
Model
<
KqglAssoYhkqz
>
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
@TableId
(
type
=
IdType
.
AUTO
)
@ApiModelProperty
(
value
=
"id id"
,
example
=
"101"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"考勤组id 考勤组id"
,
example
=
"101"
)
private
Integer
kqzid
;
@ApiModelProperty
(
value
=
"用户id 用户id"
,
example
=
"101"
)
private
Integer
userid
;
@ApiModelProperty
(
value
=
"企业id 企业id"
,
example
=
"101"
)
private
Integer
qyid
;
}
\ No newline at end of file
src/main/java/cn/timer/api/config/Initialization/InitializeSetting.java
View file @
a54fe5ac
...
...
@@ -19,7 +19,7 @@ public class InitializeSetting implements ApplicationRunner {
@Override
public
void
run
(
ApplicationArguments
args
)
throws
Exception
{
StaticVariable
.
mac_command
=
"http://1
92.168.3.143:8088
/cmd"
;
//考勤机执行命令
StaticVariable
.
mac_command
=
"http://1
20.24.24.239:8095
/cmd"
;
//考勤机执行命令
}
}
src/main/java/cn/timer/api/controller/kqgl/TimeCardController.java
View file @
a54fe5ac
...
...
@@ -9,6 +9,8 @@ import org.apache.commons.beanutils.BeanUtils;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.MethodArgumentNotValidException
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
...
...
@@ -26,17 +28,27 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.lang.Console
;
import
cn.timer.api.bean.kqgl.PunchCardAddress
;
import
cn.timer.api.bean.kqgl.PunchCardWiFi
;
import
cn.timer.api.bean.kqgl.ShiftManagement
;
import
cn.timer.api.bean.kqmk.KqglAssOvertimeVice
;
import
cn.timer.api.bean.kqmk.KqglAssoBcsz
;
import
cn.timer.api.bean.kqmk.KqglAssoDkdz
;
import
cn.timer.api.bean.kqmk.KqglAssoDkwx
;
import
cn.timer.api.bean.kqmk.KqglAssoKqj
;
import
cn.timer.api.bean.kqmk.KqglAssoKqzdkfs
;
import
cn.timer.api.bean.kqmk.KqglAssoLeaveBalance
;
import
cn.timer.api.bean.kqmk.KqglAssoLeaveRules
;
import
cn.timer.api.bean.kqmk.KqglAssoOvertimeBasics
;
import
cn.timer.api.bean.kqmk.KqglAssoOvertimeRules
;
import
cn.timer.api.bean.kqmk.KqglAssoPbmx
;
import
cn.timer.api.bean.kqmk.KqglAssoRulesVice
;
import
cn.timer.api.bean.kqmk.KqglAssoTeshu
;
import
cn.timer.api.bean.kqmk.KqglAssoYhkqz
;
import
cn.timer.api.bean.kqmk.KqglAssoZhoupaiban
;
import
cn.timer.api.bean.kqmk.KqglMainKqz
;
import
cn.timer.api.bean.spmk.SpmkApproveSummary
;
import
cn.timer.api.bean.yggl.YgglMainEmp
;
import
cn.timer.api.config.annotation.CurrentUser
;
import
cn.timer.api.config.annotation.UserBean
;
import
cn.timer.api.dao.kqmk.KqglAssOvertimeViceMapper
;
...
...
@@ -60,6 +72,7 @@ import cn.timer.api.dto.kqmk.LeaveTypeDto;
import
cn.timer.api.dto.kqmk.MachinememberDto
;
import
cn.timer.api.dto.kqmk.StartTimeRestDto
;
import
cn.timer.api.dto.kqmk.VacationInformationDto
;
import
cn.timer.api.dto.spmk.MySummaryQueryDto
;
import
cn.timer.api.utils.ResponseResult
;
import
cn.timer.api.utils.Result
;
import
cn.timer.api.utils.ResultUtil
;
...
...
@@ -337,7 +350,9 @@ public class TimeCardController {
List
<
KqglAssoRulesVice
>
vices
=
new
ArrayList
<
KqglAssoRulesVice
>();
String
[]
rest
=
leaverules
.
getRange
();
if
(
rest
!=
null
&&
rest
.
length
>
0
){
if
(
rest
.
length
==
0
)
{
KqglAssoRulesVice
.
builder
().
build
().
delete
(
new
QueryWrapper
<
KqglAssoRulesVice
>().
lambda
().
eq
(
KqglAssoRulesVice:
:
getLeaveRulesId
,
id
));
}
else
if
(
rest
!=
null
&&
rest
.
length
>
0
){
for
(
int
p
=
0
;
p
<
rest
.
length
;
p
++){
KqglAssoRulesVice
.
builder
().
build
().
delete
(
new
QueryWrapper
<
KqglAssoRulesVice
>().
lambda
().
eq
(
KqglAssoRulesVice:
:
getLeaveRulesId
,
id
));
KqglAssoRulesVice
vice
=
KqglAssoRulesVice
.
builder
().
build
();
...
...
@@ -721,6 +736,106 @@ public class TimeCardController {
return
ResultUtil
.
data
(
pageAs
,
leadto
,
"操作成功!"
);
}
/**
* 查询列表-考勤组-分页
*/
@PostMapping
(
value
=
"/attendance_group"
)
@ApiOperation
(
value
=
"34:查询列表-我审批的/抄送我的-分页"
,
httpMethod
=
"POST"
,
notes
=
"查询列表-我审批的-关键字、审批状态、发起时间-分页"
)
@ApiOperationSupport
(
order
=
34
)
public
Result
<
Object
>
AttendanceGroup
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
AttqueryCriteriaDto
attquerycriteriadto
){
IPage
<
KqglMainKqzDto
>
page
=
new
Page
<
KqglMainKqzDto
>(
attquerycriteriadto
.
getCurrentPage
()
==
null
?
1
:
attquerycriteriadto
.
getCurrentPage
(),
attquerycriteriadto
.
getTotalPage
()
==
null
?
10
:
attquerycriteriadto
.
getTotalPage
());
attquerycriteriadto
.
setOrgCode
(
userBean
.
getOrgCode
());
attquerycriteriadto
.
setEmpNum
(
userBean
.
getEmpNum
());
// 缺-部门id 搜索
IPage
<
KqglMainKqzDto
>
pageAs
=
kqglmainkqzmapper
.
selectPageByQueryKqglMain
(
page
,
attquerycriteriadto
);
List
<
KqglMainKqzDto
>
listAs
=
pageAs
.
getRecords
();
return
ResultUtil
.
data
(
pageAs
,
listAs
,
"操作成功!"
);
}
/**
* 获取打卡地址数据
*/
@GetMapping
(
value
=
"/InGroupPunchAddress"
)
@ApiOperation
(
value
=
"35:获取打卡地址数据"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
35
)
public
Result
<
Object
>
getInGroupPunchAddress
(
@CurrentUser
UserBean
userBean
)
{
List
<
KqglAssoDkdz
>
shiftList
=
KqglAssoDkdz
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
KqglAssoDkdz
>().
lambda
().
eq
(
KqglAssoDkdz:
:
getQyid
,
userBean
.
getOrgCode
()));
return
ResultUtil
.
data
(
shiftList
);
}
/**
* 获取打卡WIFI数据
*/
@GetMapping
(
value
=
"/InGroupPunchWIFI"
)
@ApiOperation
(
value
=
"36:获取打卡WIFI数据"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
36
)
public
Result
<
Object
>
getInGroupPunchWIFI
(
@CurrentUser
UserBean
userBean
)
{
List
<
KqglAssoDkwx
>
shiftList
=
KqglAssoDkwx
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
KqglAssoDkwx
>().
lambda
().
eq
(
KqglAssoDkwx:
:
getQyid
,
userBean
.
getOrgCode
()));
return
ResultUtil
.
data
(
shiftList
);
}
/**
* 获取班次
*/
@GetMapping
(
value
=
"/AttShift"
)
@ApiOperation
(
value
=
"37:获取班次-根据 组织机构代码"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
37
)
public
Result
<
Object
>
getAttShiftList
(
@CurrentUser
UserBean
userBean
)
{
List
<
KqglAssoBcsz
>
attshiftList
=
KqglAssoBcsz
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
KqglAssoBcsz
>().
lambda
().
eq
(
KqglAssoBcsz:
:
getQyid
,
userBean
.
getOrgCode
()));
return
ResultUtil
.
data
(
attshiftList
);
}
/**
* 获取员工数据
*/
@GetMapping
(
value
=
"/Employee"
)
@ApiOperation
(
value
=
"38:获取员工数据-根据 组织机构代码"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
38
)
public
Result
<
Object
>
getEmployeeData
(
@CurrentUser
UserBean
userBean
)
{
List
<
YgglMainEmp
>
yggl
=
YgglMainEmp
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
YgglMainEmp
>().
lambda
().
eq
(
YgglMainEmp:
:
getOrgCode
,
userBean
.
getOrgCode
()));
return
ResultUtil
.
data
(
yggl
);
}
/**
* 删除考勤组
*/
@DeleteMapping
(
value
=
"/AttendanceGroup/{id}"
)
@ApiOperation
(
value
=
"39:删除考勤组"
,
httpMethod
=
"DELETE"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
39
)
public
Result
<
Integer
>
DelAttendanceGroup
(
@PathVariable
(
"id"
)
Integer
id
)
{
//删除组
if
(
KqglMainKqz
.
builder
().
id
(
id
).
build
().
deleteById
())
{
//删除考勤组绑定的打卡方式
KqglAssoKqzdkfs
.
builder
().
build
().
delete
(
new
QueryWrapper
<
KqglAssoKqzdkfs
>().
lambda
().
eq
(
KqglAssoKqzdkfs:
:
getKqzId
,
id
));
//删除用户和考勤组关系表
KqglAssoYhkqz
.
builder
().
build
().
delete
(
new
QueryWrapper
<
KqglAssoYhkqz
>().
lambda
().
eq
(
KqglAssoYhkqz:
:
getKqzid
,
id
));
//删除特殊日期表
KqglAssoTeshu
.
builder
().
build
().
delete
(
new
QueryWrapper
<
KqglAssoTeshu
>().
lambda
().
eq
(
KqglAssoTeshu:
:
getKqzid
,
id
));
//删除排班明细表(自由排班)
KqglAssoPbmx
.
builder
().
build
().
delete
(
new
QueryWrapper
<
KqglAssoPbmx
>().
lambda
().
eq
(
KqglAssoPbmx:
:
getKqzid
,
id
));
//删除考勤周排班
KqglAssoZhoupaiban
.
builder
().
build
().
delete
(
new
QueryWrapper
<
KqglAssoZhoupaiban
>().
lambda
().
eq
(
KqglAssoZhoupaiban:
:
getKqzid
,
id
));
return
ResultUtil
.
data
(
id
,
"删除成功"
);
}
return
ResultUtil
.
error
(
"删除失败"
);
}
/**
* 查询列表-加班补偿方式
*/
...
...
src/main/java/cn/timer/api/dao/kqmk/KqglAssoYhkqzMapper.java
0 → 100644
View file @
a54fe5ac
package
cn
.
timer
.
api
.
dao
.
kqmk
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.springframework.stereotype.Repository
;
import
cn.timer.api.bean.kqmk.KqglAssoYhkqz
;
/**
* 用户和考勤组关系表
*
* @author LAL 2020-05-12
*/
@Repository
public
interface
KqglAssoYhkqzMapper
extends
BaseMapper
<
KqglAssoYhkqz
>
{
}
src/main/java/cn/timer/api/dao/kqmk/KqglMainKqzMapper.java
View file @
a54fe5ac
...
...
@@ -2,11 +2,14 @@ package cn.timer.api.dao.kqmk;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
cn.timer.api.bean.kqmk.KqglMainKqz
;
import
cn.timer.api.dto.kqmk.AttqueryCriteriaDto
;
import
cn.timer.api.dto.kqmk.KqglMainKqzDto
;
/**
...
...
@@ -20,4 +23,7 @@ public interface KqglMainKqzMapper extends BaseMapper<KqglMainKqz> {
List
<
KqglMainKqzDto
>
selectAttGroupMachineByQyid
(
int
qyid
);
KqglMainKqz
getAttendanceGroupInformationByUserid
(
int
userid
,
int
qyid
);
IPage
<
KqglMainKqzDto
>
selectPageByQueryKqglMain
(
IPage
<
KqglMainKqzDto
>
page
,
@Param
(
"param"
)
AttqueryCriteriaDto
attquerycriteriadto
);
}
src/main/java/cn/timer/api/dto/kqmk/AttendanceGroupDto.java
View file @
a54fe5ac
...
...
@@ -14,10 +14,10 @@ import lombok.NoArgsConstructor;
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
AttendanceGroupDto
implements
Serializable
{
public
class
AttendanceGroupDto
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
5573272776427338217L
;
private
Integer
id
;
private
String
name
;
// 名称
private
String
kqbz
;
// 考勤备注
...
...
@@ -45,9 +45,9 @@ public class AttendanceGroupDto implements Serializable{
private
String
pbfsnm
;
// 排班方式
private
String
dkfs
;
// 打卡方式
private
Integer
isWq
;
//外勤
private
Integer
isWq
;
//
外勤
private
Integer
kqjid
;
private
List
<
AttGroupBinPunchMode
>
kqzdkfslist
=
new
ArrayList
<
AttGroupBinPunchMode
>()
;
private
List
<
AttGroupBinPunchMode
>
kqzdkfslist
;
}
\ No newline at end of file
src/main/resources/mapping/kqmk/KqglAssoYhkqzMapper.xml
0 → 100644
View file @
a54fe5ac
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.timer.api.dao.kqmk.KqglAssoYhkqzMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"cn.timer.api.bean.kqmk.KqglAssoYhkqz"
>
<id
column=
"id"
property=
"id"
/>
<result
column=
"kqzid"
property=
"kqzid"
/>
<result
column=
"userid"
property=
"userid"
/>
<result
column=
"qyid"
property=
"qyid"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id,
kqzid,
userid,
qyid
</sql>
<sql
id=
"Base_Column_List_Alias"
>
id KqglAssoYhkqz_id,
kqzid KqglAssoYhkqz_kqzid,
userid KqglAssoYhkqz_userid,
qyid KqglAssoYhkqz_qyid
</sql>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.kqmk.KqglAssoYhkqz">
INSERT INTO kqgl_asso_yhkqz
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test ='null != kqzid'>
kqzid,
</if>
<if test ='null != userid'>
userid,
</if>
<if test ='null != qyid'>
qyid
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test ='null != kqzid'>
#{kqzid},
</if>
<if test ='null != userid'>
#{userid},
</if>
<if test ='null != qyid'>
#{qyid}
</if>
</trim>
</insert>
<delete id="delete" >
DELETE FROM kqgl_asso_yhkqz
WHERE id = #{id}
</delete>
<update id="update" parameterType="cn.timer.api.bean.kqmk.KqglAssoYhkqz">
UPDATE kqgl_asso_yhkqz
<set>
<if test ='null != kqzid'>kqzid = #{kqzid},</if>
<if test ='null != userid'>userid = #{userid},</if>
<if test ='null != qyid'>qyid = #{qyid}</if>
</set>
WHERE id = #{id}
</update>
<select id="load" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM kqgl_asso_yhkqz
WHERE id = #{id}
</select>
<select id="pageList" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM kqgl_asso_yhkqz
LIMIT #{offset}, #{pageSize}
</select>
<select id="pageListCount" resultType="java.lang.Integer">
SELECT count(1)
FROM kqgl_asso_yhkqz
</select>
-->
</mapper>
\ No newline at end of file
src/main/resources/mapping/kqmk/KqglMainKqzMapper.xml
View file @
a54fe5ac
...
...
@@ -137,6 +137,31 @@
where kqz.id = (select yhkqz.kqzid from kqgl_asso_yhkqz yhkqz
where yhkqz.userid = #{userid,jdbcType=INTEGER} and yhkqz.qyid = #{qyid,jdbcType=INTEGER})
</select>
<select
id=
"selectPageByQueryKqglMain"
resultMap=
"AuxiliaryMap"
>
select kqz.*,
case kqz.pbfs
WHEN '1' then '固定排班'
WHEN '2' then '排班制'
else '自由工时'
end as pbfsnm,
znm.kqznum,
dkfs.type
from kqgl_main_kqz kqz
LEFT JOIN (select count(yhkqz.kqzid) as kqznum,
yhkqz.kqzid as kqzid
from kqgl_asso_yhkqz yhkqz
where yhkqz.qyid = #{param.orgCode}
GROUP BY yhkqz.kqzid) as znm on znm.kqzid = kqz.id
LEFT JOIN (select kqzdkfs.kqz_id as kqzId,kqzdkfs.type as type from kqgl_asso_kqzdkfs kqzdkfs
where kqzdkfs.qyid = #{param.orgCode} ) as dkfs on dkfs.kqzId = kqz.id
where 1=1
and kqz.qyid = #{param.orgCode}
<if
test=
"param.query != null and param.query != ''"
>
and kqz.`name` like CONCAT('%',#{param.query},'%')
</if>
</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