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
0cf502e8
Commit
0cf502e8
authored
May 15, 2020
by
邓实川
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
http://120.24.24.239:8082/8timerv2/8timerapiv200.git
into dsc
parents
2c462840
344b7d3d
Show whitespace changes
Inline
Side-by-side
Showing
83 changed files
with
5492 additions
and
238 deletions
+5492
-238
src/main/java/cn/timer/api/aspect/LogAspect.java
+235
-0
src/main/java/cn/timer/api/aspect/lang/annotation/Log.java
+42
-0
src/main/java/cn/timer/api/aspect/lang/enums/BusinessStatus.java
+20
-0
src/main/java/cn/timer/api/aspect/lang/enums/BusinessType.java
+59
-0
src/main/java/cn/timer/api/aspect/lang/enums/OperatorType.java
+24
-0
src/main/java/cn/timer/api/bean/kqgl/AttendanceAssistant.java
+2
-0
src/main/java/cn/timer/api/bean/kqgl/AttendanceGroup.java
+1
-0
src/main/java/cn/timer/api/bean/kqmk/KqglAssoLeaveBalance.java
+5
-1
src/main/java/cn/timer/api/bean/kqmk/KqglAssoLeaveRules.java
+4
-1
src/main/java/cn/timer/api/bean/kqmk/KqglAssoMonthPunchSummary.java
+233
-0
src/main/java/cn/timer/api/bean/kqmk/KqglAssoOvertimeRange.java
+47
-0
src/main/java/cn/timer/api/bean/kqmk/KqglAssoOvertimeRules.java
+2
-2
src/main/java/cn/timer/api/bean/kqmk/KqglAssoTeshu.java
+1
-1
src/main/java/cn/timer/api/bean/kqmk/KqglAssoYhkqz.java
+50
-0
src/main/java/cn/timer/api/bean/kqmk/KqglMainKqz.java
+4
-0
src/main/java/cn/timer/api/bean/qyzx/QyzxOperLog.java
+96
-0
src/main/java/cn/timer/api/bean/spmk/SpmkExecutor.java
+1
-1
src/main/java/cn/timer/api/config/Initialization/InitializeSetting.java
+1
-1
src/main/java/cn/timer/api/config/enuminterface/SpmkEnumInterface.java
+25
-0
src/main/java/cn/timer/api/config/enuminterface/YgEnumInterface.java
+19
-8
src/main/java/cn/timer/api/config/enums/HttpMethod.java
+36
-0
src/main/java/cn/timer/api/config/thread/ThreadPoolConfig.java
+63
-0
src/main/java/cn/timer/api/controller/LoginController.java
+18
-30
src/main/java/cn/timer/api/controller/kqgl/AttController.java
+0
-0
src/main/java/cn/timer/api/controller/kqgl/ClockInController.java
+15
-18
src/main/java/cn/timer/api/controller/kqgl/ClockInTool.java
+113
-0
src/main/java/cn/timer/api/controller/kqgl/TimeCardController.java
+1236
-66
src/main/java/cn/timer/api/controller/qyzx/QyzxController.java
+45
-7
src/main/java/cn/timer/api/controller/qyzx/service/QyzxOperLogService.java
+52
-0
src/main/java/cn/timer/api/controller/qyzx/service/QyzxOperLogServiceImpl.java
+80
-0
src/main/java/cn/timer/api/controller/spmk/SpmkController.java
+61
-10
src/main/java/cn/timer/api/controller/yggl/YgglController.java
+108
-46
src/main/java/cn/timer/api/controller/zzgl/ZzglController.java
+78
-8
src/main/java/cn/timer/api/dao/kqmk/KqglAssoBcszMapper.java
+5
-1
src/main/java/cn/timer/api/dao/kqmk/KqglAssoKqzdkfsMapper.java
+5
-0
src/main/java/cn/timer/api/dao/kqmk/KqglAssoLeaveBalanceMapper.java
+7
-1
src/main/java/cn/timer/api/dao/kqmk/KqglAssoMonthPunchSummaryMapper.java
+16
-0
src/main/java/cn/timer/api/dao/kqmk/KqglAssoOvertimeRangeMapper.java
+20
-0
src/main/java/cn/timer/api/dao/kqmk/KqglAssoPbmxMapper.java
+7
-0
src/main/java/cn/timer/api/dao/kqmk/KqglAssoTeshuMapper.java
+6
-1
src/main/java/cn/timer/api/dao/kqmk/KqglAssoYhkqzMapper.java
+20
-0
src/main/java/cn/timer/api/dao/kqmk/KqglAssoZhoupaibanMapper.java
+5
-1
src/main/java/cn/timer/api/dao/kqmk/KqglMainKqzMapper.java
+6
-0
src/main/java/cn/timer/api/dao/qyzx/QyzxOperLogMapper.java
+52
-0
src/main/java/cn/timer/api/dto/kqmk/AttSchedulingDto.java
+21
-0
src/main/java/cn/timer/api/dto/kqmk/AttendanceAssistantDto.java
+57
-0
src/main/java/cn/timer/api/dto/kqmk/AttendanceGroupDto.java
+4
-3
src/main/java/cn/timer/api/dto/kqmk/BalanceSheetDataDto.java
+20
-0
src/main/java/cn/timer/api/dto/kqmk/EmployeeLeaveBalanceDto.java
+31
-0
src/main/java/cn/timer/api/dto/kqmk/KqglAssoLeaveRulesDto.java
+5
-1
src/main/java/cn/timer/api/dto/kqmk/KqglAssoOvertimeRulesDto.java
+2
-2
src/main/java/cn/timer/api/dto/kqmk/KqglMainKqzDto.java
+3
-0
src/main/java/cn/timer/api/dto/kqmk/KqzAttendanceGroupSearchDto.java
+21
-0
src/main/java/cn/timer/api/dto/kqmk/SetConditionsDto.java
+17
-0
src/main/java/cn/timer/api/dto/qyzx/QyzxOperLogQuaryDto.java
+38
-0
src/main/java/cn/timer/api/dto/yggl/AddygdaDto.java
+14
-0
src/main/java/cn/timer/api/dto/yggl/YgDrjqbDto.java
+1
-1
src/main/java/cn/timer/api/manager/AsyncManager.java
+61
-0
src/main/java/cn/timer/api/manager/ShutdownManager.java
+39
-0
src/main/java/cn/timer/api/manager/factory/AsyncFactory.java
+51
-0
src/main/java/cn/timer/api/utils/AddressUtils.java
+41
-0
src/main/java/cn/timer/api/utils/HttpUtils.java
+249
-0
src/main/java/cn/timer/api/utils/LogUtils.java
+18
-0
src/main/java/cn/timer/api/utils/ServletUtils.java
+138
-0
src/main/java/cn/timer/api/utils/SpringUtils.java
+114
-0
src/main/java/cn/timer/api/utils/Threads.java
+99
-0
src/main/java/cn/timer/api/utils/UserIp.java
+120
-0
src/main/java/cn/timer/api/utils/router/RouterUtils.java
+12
-13
src/main/resources/application-dev.yml
+1
-1
src/main/resources/application-pro.yml
+2
-0
src/main/resources/application-test.yml
+2
-0
src/main/resources/mapping/kqgl/AttendanceGroupMapper.xml
+13
-2
src/main/resources/mapping/kqmk/KqglAssoBcszMapper.xml
+11
-0
src/main/resources/mapping/kqmk/KqglAssoKqzdkfsMapper.xml
+23
-0
src/main/resources/mapping/kqmk/KqglAssoLeaveBalanceMapper.xml
+49
-5
src/main/resources/mapping/kqmk/KqglAssoMonthPunchSummaryMapper.xml
+701
-0
src/main/resources/mapping/kqmk/KqglAssoOvertimeRangeMapper.xml
+94
-0
src/main/resources/mapping/kqmk/KqglAssoPbmxMapper.xml
+35
-0
src/main/resources/mapping/kqmk/KqglAssoTeshuMapper.xml
+25
-0
src/main/resources/mapping/kqmk/KqglAssoYhkqzMapper.xml
+107
-0
src/main/resources/mapping/kqmk/KqglAssoZhoupaibanMapper.xml
+17
-0
src/main/resources/mapping/kqmk/KqglMainKqzMapper.xml
+43
-6
src/main/resources/mapping/qyzx/QyzxOperLogMapper.xml
+268
-0
No files found.
src/main/java/cn/timer/api/aspect/LogAspect.java
0 → 100644
View file @
0cf502e8
package
cn
.
timer
.
api
.
aspect
;
import
java.lang.reflect.Method
;
import
java.util.Date
;
import
java.util.Map
;
import
java.util.TimerTask
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpSession
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.Signature
;
import
org.aspectj.lang.annotation.AfterReturning
;
import
org.aspectj.lang.annotation.AfterThrowing
;
import
org.aspectj.lang.annotation.Aspect
;
import
org.aspectj.lang.annotation.Pointcut
;
import
org.aspectj.lang.reflect.MethodSignature
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.servlet.HandlerMapping
;
import
com.alibaba.fastjson.JSON
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONUtil
;
import
cn.timer.api.aspect.lang.annotation.Log
;
import
cn.timer.api.aspect.lang.enums.BusinessStatus
;
import
cn.timer.api.bean.qyzx.QyzxEmpLogin
;
import
cn.timer.api.bean.qyzx.QyzxOperLog
;
import
cn.timer.api.config.enums.HttpMethod
;
import
cn.timer.api.manager.AsyncManager
;
import
cn.timer.api.manager.factory.AsyncFactory
;
import
cn.timer.api.utils.ServletUtils
;
import
cn.timer.api.utils.UserIp
;
/**
* 操作日志记录处理
*
* @author Tang
*/
@Aspect
@Component
public
class
LogAspect
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
LogAspect
.
class
);
@Resource
private
HttpSession
session
;
// 配置织入点
@Pointcut
(
"@annotation(cn.timer.api.aspect.lang.annotation.Log)"
)
public
void
logPointCut
()
{
}
/**
* 处理完请求后执行
*
* @param joinPoint 切点
*/
@AfterReturning
(
pointcut
=
"logPointCut()"
,
returning
=
"jsonResult"
)
public
void
doAfterReturning
(
JoinPoint
joinPoint
,
Object
jsonResult
)
{
handleLog
(
joinPoint
,
null
,
jsonResult
);
}
/**
* 拦截异常操作
*
* @param joinPoint 切点
* @param e 异常
*/
@AfterThrowing
(
value
=
"logPointCut()"
,
throwing
=
"e"
)
public
void
doAfterThrowing
(
JoinPoint
joinPoint
,
Exception
e
)
{
handleLog
(
joinPoint
,
e
,
null
);
}
protected
void
handleLog
(
final
JoinPoint
joinPoint
,
final
Exception
e
,
Object
jsonResult
)
{
try
{
// 获得注解
Log
controllerLog
=
getAnnotationLog
(
joinPoint
);
if
(
controllerLog
==
null
)
{
return
;
}
// 获取当前的用户
// LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
QyzxEmpLogin
eld
=
(
QyzxEmpLogin
)
session
.
getAttribute
(
"ui"
);
System
.
out
.
println
(
eld
);
// *========数据库日志=========*//
QyzxOperLog
operLog
=
new
QyzxOperLog
();
operLog
.
setOrgCode
(
eld
.
getOrgId
());
operLog
.
setEmpNum
(
eld
.
getId
());
// 请求的地址
String
ip
=
UserIp
.
getIpAddr
(
ServletUtils
.
getRequest
());
operLog
.
setOperIp
(
ip
);
// 返回参数
String
jsonResultStr
=
JSON
.
toJSONString
(
jsonResult
);
operLog
.
setJsonResult
(
jsonResultStr
.
length
()
<=
10000
?
jsonResultStr
:
""
);
operLog
.
setOperUrl
(
ServletUtils
.
getRequest
().
getRequestURI
());
if
(
eld
!=
null
)
{
operLog
.
setOperName
(
eld
.
getUsername
());
}
if
(
e
!=
null
)
{
operLog
.
setStatus
(
BusinessStatus
.
FAIL
.
ordinal
());
operLog
.
setErrorMsg
(
StrUtil
.
sub
(
e
.
getMessage
(),
0
,
2000
));
}
else
{
operLog
.
setStatus
(
BusinessStatus
.
SUCCESS
.
ordinal
());
}
// 设置方法名称
String
className
=
joinPoint
.
getTarget
().
getClass
().
getName
();
String
methodName
=
joinPoint
.
getSignature
().
getName
();
operLog
.
setMethod
(
className
+
"."
+
methodName
+
"()"
);
// 设置请求方式
operLog
.
setRequestMethod
(
ServletUtils
.
getRequest
().
getMethod
());
operLog
.
setOperTime
(
new
Date
());
// 处理设置注解上的参数
getControllerMethodDescription
(
joinPoint
,
controllerLog
,
operLog
);
// 保存数据库
AsyncManager
.
me
().
execute
(
AsyncFactory
.
recordOper
(
operLog
));
}
catch
(
Exception
exp
)
{
// 记录本地异常日志
log
.
error
(
"==前置通知异常=="
);
log
.
error
(
"异常信息:{}"
,
exp
.
getMessage
());
exp
.
printStackTrace
();
}
}
/**
* 获取注解中对方法的描述信息 用于Controller层注解
*
* @param log 日志
* @param operLog 操作日志
* @throws Exception
*/
public
void
getControllerMethodDescription
(
JoinPoint
joinPoint
,
Log
log
,
QyzxOperLog
operLog
)
throws
Exception
{
// 设置action动作
operLog
.
setBusinessType
(
log
.
businessType
().
ordinal
());
// 设置标题
operLog
.
setTitle
(
log
.
title
());
// 设置操作人类别
operLog
.
setOperatorType
(
log
.
operatorType
().
ordinal
());
// 是否需要保存request,参数和值
if
(
log
.
isSaveRequestData
())
{
// 获取参数的信息,传入到数据库中。
setRequestValue
(
joinPoint
,
operLog
);
}
}
/**
* 获取请求的参数,放到log中
*
* @param operLog 操作日志
* @throws Exception 异常
*/
private
void
setRequestValue
(
JoinPoint
joinPoint
,
QyzxOperLog
operLog
)
throws
Exception
{
String
requestMethod
=
operLog
.
getRequestMethod
();
if
(
HttpMethod
.
PUT
.
name
().
equals
(
requestMethod
)
||
HttpMethod
.
POST
.
name
().
equals
(
requestMethod
))
{
// JSONObject jsonObj = JSONUtil.parseObj(joinPoint.getArgs());
String
params
=
argsArrayToString
(
joinPoint
.
getArgs
());
operLog
.
setOperParam
(
StrUtil
.
sub
(
params
,
0
,
10000
));
}
else
{
Map
<?,
?>
paramsMap
=
(
Map
<?,
?>)
ServletUtils
.
getRequest
().
getAttribute
(
HandlerMapping
.
URI_TEMPLATE_VARIABLES_ATTRIBUTE
);
operLog
.
setOperParam
(
StrUtil
.
sub
(
paramsMap
.
toString
(),
0
,
10000
));
}
}
/**
* 是否存在注解,如果存在就获取
*/
private
Log
getAnnotationLog
(
JoinPoint
joinPoint
)
throws
Exception
{
Signature
signature
=
joinPoint
.
getSignature
();
MethodSignature
methodSignature
=
(
MethodSignature
)
signature
;
Method
method
=
methodSignature
.
getMethod
();
if
(
method
!=
null
)
{
return
method
.
getAnnotation
(
Log
.
class
);
}
return
null
;
}
/**
* 参数拼装
*/
private
String
argsArrayToString
(
Object
[]
paramsArray
)
{
String
params
=
""
;
if
(
paramsArray
!=
null
&&
paramsArray
.
length
>
0
)
{
for
(
int
i
=
0
;
i
<
paramsArray
.
length
;
i
++)
{
if
(!
isFilterObject
(
paramsArray
[
i
]))
{
Object
jsonObj
=
JSON
.
toJSON
(
paramsArray
[
i
]);
params
+=
jsonObj
.
toString
()
+
" "
;
}
}
}
return
params
.
trim
();
}
/**
* 判断是否需要过滤的对象。
*
* @param o 对象信息。
* @return 如果是需要过滤的对象,则返回true;否则返回false。
*/
public
boolean
isFilterObject
(
final
Object
o
)
{
return
o
instanceof
MultipartFile
||
o
instanceof
HttpServletRequest
||
o
instanceof
HttpServletResponse
;
}
}
src/main/java/cn/timer/api/aspect/lang/annotation/Log.java
0 → 100644
View file @
0cf502e8
package
cn
.
timer
.
api
.
aspect
.
lang
.
annotation
;
import
java.lang.annotation.Documented
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.Target
;
import
cn.timer.api.aspect.lang.enums.BusinessType
;
import
cn.timer.api.aspect.lang.enums.OperatorType
;
/**
* 自定义操作日志记录注解
*
* @author ruoyi
*
*/
@Target
({
ElementType
.
PARAMETER
,
ElementType
.
METHOD
})
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Documented
public
@interface
Log
{
/**
* 模块
*/
public
String
title
()
default
""
;
/**
* 功能
*/
public
BusinessType
businessType
()
default
BusinessType
.
OTHER
;
/**
* 操作人类别
*/
public
OperatorType
operatorType
()
default
OperatorType
.
MANAGE
;
/**
* 是否保存请求的参数
*/
public
boolean
isSaveRequestData
()
default
true
;
}
src/main/java/cn/timer/api/aspect/lang/enums/BusinessStatus.java
0 → 100644
View file @
0cf502e8
package
cn
.
timer
.
api
.
aspect
.
lang
.
enums
;
/**
* 操作状态
*
* @author ruoyi
*
*/
public
enum
BusinessStatus
{
/**
* 成功
*/
SUCCESS
,
/**
* 失败
*/
FAIL
,
}
src/main/java/cn/timer/api/aspect/lang/enums/BusinessType.java
0 → 100644
View file @
0cf502e8
package
cn
.
timer
.
api
.
aspect
.
lang
.
enums
;
/**
* 业务操作类型
*
* @author Tang
*/
public
enum
BusinessType
{
/**
* 其它
*/
OTHER
,
/**
* 新增
*/
INSERT
,
/**
* 修改
*/
UPDATE
,
/**
* 删除
*/
DELETE
,
/**
* 授权
*/
GRANT
,
/**
* 导出
*/
EXPORT
,
/**
* 导入
*/
IMPORT
,
/**
* 强退
*/
FORCE
,
/**
* 生成代码
*/
GENCODE
,
/**
* 清空数据
*/
CLEAN
,
}
src/main/java/cn/timer/api/aspect/lang/enums/OperatorType.java
0 → 100644
View file @
0cf502e8
package
cn
.
timer
.
api
.
aspect
.
lang
.
enums
;
/**
* 操作人类别
*
* @author ruoyi
*/
public
enum
OperatorType
{
/**
* 其它
*/
OTHER
,
/**
* 后台用户
*/
MANAGE
,
/**
* 手机端用户
*/
MOBILE
}
src/main/java/cn/timer/api/bean/kqgl/AttendanceAssistant.java
View file @
0cf502e8
...
...
@@ -49,5 +49,7 @@ public class AttendanceAssistant implements Serializable{
String
attgroupid
;
int
overtimeRulesId
;
//加班id
int
fieldpersonnel
;
//外勤
}
src/main/java/cn/timer/api/bean/kqgl/AttendanceGroup.java
View file @
0cf502e8
...
...
@@ -43,6 +43,7 @@ public class AttendanceGroup implements Serializable{
private
String
dkfs
;
// 打卡方式
private
Integer
isWq
;
//外勤
private
Integer
overtimeRulesId
;
private
Integer
kqjid
;
...
...
src/main/java/cn/timer/api/bean/kqmk/KqglAssoLeaveBalance.java
View file @
0cf502e8
...
...
@@ -61,7 +61,10 @@ public class KqglAssoLeaveBalance extends Model<KqglAssoLeaveBalance> {
@ApiModelProperty
(
value
=
"修改序号 修改序号"
,
example
=
"101"
)
private
Integer
modifyNumber
;
@ApiModelProperty
(
value
=
"企业组织代码 企业组织代码"
,
example
=
"101"
)
@ApiModelProperty
(
value
=
"企业组织代码 企业组织代码"
,
example
=
"101"
)
private
Integer
orgCode
;
@ApiModelProperty
(
value
=
"是否为系统自动 0:否;1:是"
,
example
=
"101"
)
private
Integer
isAutomatic
;
}
\ No newline at end of file
src/main/java/cn/timer/api/bean/kqmk/KqglAssoLeaveRules.java
View file @
0cf502e8
...
...
@@ -47,7 +47,7 @@ public class KqglAssoLeaveRules extends Model<KqglAssoLeaveRules> {
private
Integer
leaveType
;
@ApiModelProperty
(
value
=
"适用范围 "
,
example
=
"0:全公司 >0:考勤组id"
)
private
String
apply
;
private
Integer
apply
;
@ApiModelProperty
(
value
=
"创建时间 创建时间"
,
example
=
"101"
)
private
Long
createTime
;
...
...
@@ -64,4 +64,6 @@ public class KqglAssoLeaveRules extends Model<KqglAssoLeaveRules> {
@ApiModelProperty
(
value
=
"假期余额 0:关(该项余额为“不限余额”);1:开(该项余额为“0”)"
,
example
=
"101"
)
private
Integer
leaveBalance
;
}
\ No newline at end of file
src/main/java/cn/timer/api/bean/kqmk/KqglAssoMonthPunchSummary.java
0 → 100644
View file @
0cf502e8
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-15
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table
(
name
=
"kqgl_asso_month_punch_summary"
)
@ApiModel
(
"打卡月汇总"
)
public
class
KqglAssoMonthPunchSummary
extends
Model
<
KqglAssoMonthPunchSummary
>
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
@TableId
(
type
=
IdType
.
AUTO
)
@ApiModelProperty
(
value
=
"id id"
,
example
=
"101"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"姓名 "
,
example
=
"姓名"
)
private
String
name
;
@ApiModelProperty
(
value
=
"工号 工号"
,
example
=
"101"
)
private
Integer
num
;
@ApiModelProperty
(
value
=
"部门 "
,
example
=
"部门"
)
private
String
dept
;
@ApiModelProperty
(
value
=
"职位 "
,
example
=
"职位"
)
private
String
post
;
@ApiModelProperty
(
value
=
"考勤组id 考勤组id"
,
example
=
"101"
)
private
Integer
attGroup
;
@ApiModelProperty
(
value
=
"班次id 班次id"
,
example
=
"101"
)
private
Integer
shift
;
@ApiModelProperty
(
value
=
"应出勤天数 "
,
example
=
"应出勤天数"
)
private
Double
daysOnDuty
;
@ApiModelProperty
(
value
=
"实际出勤天数 "
,
example
=
"实际出勤天数"
)
private
Double
actualAttDays
;
@ApiModelProperty
(
value
=
"休息天数 "
,
example
=
"休息天数"
)
private
Double
daysOff
;
@ApiModelProperty
(
value
=
"工作时长(分钟) "
,
example
=
"工作时长(分钟)"
)
private
Double
workingHours
;
@ApiModelProperty
(
value
=
"迟到次数 "
,
example
=
"迟到次数"
)
private
Double
lateTimes
;
@ApiModelProperty
(
value
=
"迟到时长(分钟) "
,
example
=
"迟到时长(分钟)"
)
private
Double
lateHours
;
@ApiModelProperty
(
value
=
"严重迟到次数 "
,
example
=
"严重迟到次数"
)
private
Double
seriousLateTimes
;
@ApiModelProperty
(
value
=
"严重迟到时长(分钟) "
,
example
=
"严重迟到时长(分钟)"
)
private
Double
seriousLateHours
;
@ApiModelProperty
(
value
=
"旷工迟到次数 "
,
example
=
"旷工迟到次数"
)
private
Double
absenLateTimes
;
@ApiModelProperty
(
value
=
"早退次数 "
,
example
=
"早退次数"
)
private
Double
earlyLeaveTimes
;
@ApiModelProperty
(
value
=
"早退时长(分钟) "
,
example
=
"早退时长(分钟)"
)
private
Double
lengthEarlyLeave
;
@ApiModelProperty
(
value
=
"上班缺卡次数 "
,
example
=
"上班缺卡次数"
)
private
Double
numberWorkCardShortage
;
@ApiModelProperty
(
value
=
"下班缺卡次数 "
,
example
=
"下班缺卡次数"
)
private
Double
numberDutyCardShortage
;
@ApiModelProperty
(
value
=
"旷工天数 "
,
example
=
"旷工天数"
)
private
Double
absenteeismDays
;
@ApiModelProperty
(
value
=
"出差时长 "
,
example
=
"出差时长"
)
private
Double
lengthBusinessTrip
;
@ApiModelProperty
(
value
=
"外出时长 "
,
example
=
"外出时长"
)
private
Double
timeOut
;
@ApiModelProperty
(
value
=
"加班总时长 "
,
example
=
"加班总时长"
)
private
Double
totalOvertimeHours
;
@ApiModelProperty
(
value
=
"工作日(转调休) "
,
example
=
"工作日(转调休)"
)
private
Double
workingTurnCompenLeave
;
@ApiModelProperty
(
value
=
"休息日(转调休) "
,
example
=
"休息日(转调休)"
)
private
Double
restTurnCompenLeave
;
@ApiModelProperty
(
value
=
"节假日(转调休) "
,
example
=
"节假日(转调休)"
)
private
Double
holidayTurnCompenLeave
;
@ApiModelProperty
(
value
=
"工作日(转加班费) "
,
example
=
"工作日(转加班费)"
)
private
Double
workingTransferOvertime
;
@ApiModelProperty
(
value
=
"休息日(转加班费) "
,
example
=
"休息日(转加班费)"
)
private
Double
restTransferOvertime
;
@ApiModelProperty
(
value
=
"节假日(转加班费) "
,
example
=
"节假日(转加班费)"
)
private
Double
holidayTransferOvertime
;
@ApiModelProperty
(
value
=
"day1 "
,
example
=
"day1"
)
private
String
day1
;
@ApiModelProperty
(
value
=
"day2 "
,
example
=
"day2"
)
private
String
day2
;
@ApiModelProperty
(
value
=
"day3 "
,
example
=
"day3"
)
private
String
day3
;
@ApiModelProperty
(
value
=
"day4 "
,
example
=
"day4"
)
private
String
day4
;
@ApiModelProperty
(
value
=
"day5 "
,
example
=
"day5"
)
private
String
day5
;
@ApiModelProperty
(
value
=
"day6 "
,
example
=
"day6"
)
private
String
day6
;
@ApiModelProperty
(
value
=
"day7 "
,
example
=
"day7"
)
private
String
day7
;
@ApiModelProperty
(
value
=
"day8 "
,
example
=
"day8"
)
private
String
day8
;
@ApiModelProperty
(
value
=
"day9 "
,
example
=
"day9"
)
private
String
day9
;
@ApiModelProperty
(
value
=
"day10 "
,
example
=
"day10"
)
private
String
day10
;
@ApiModelProperty
(
value
=
"day11 "
,
example
=
"day11"
)
private
String
day11
;
@ApiModelProperty
(
value
=
"day12 "
,
example
=
"day12"
)
private
String
day12
;
@ApiModelProperty
(
value
=
"day13 "
,
example
=
"day13"
)
private
String
day13
;
@ApiModelProperty
(
value
=
"day14 "
,
example
=
"day14"
)
private
String
day14
;
@ApiModelProperty
(
value
=
"day15 "
,
example
=
"day15"
)
private
String
day15
;
@ApiModelProperty
(
value
=
"day16 "
,
example
=
"day16"
)
private
String
day16
;
@ApiModelProperty
(
value
=
"day17 "
,
example
=
"day17"
)
private
String
day17
;
@ApiModelProperty
(
value
=
"day18 "
,
example
=
"day18"
)
private
String
day18
;
@ApiModelProperty
(
value
=
"day19 "
,
example
=
"day19"
)
private
String
day19
;
@ApiModelProperty
(
value
=
"day20 "
,
example
=
"day20"
)
private
String
day20
;
@ApiModelProperty
(
value
=
"day21 "
,
example
=
"day21"
)
private
String
day21
;
@ApiModelProperty
(
value
=
"day22 "
,
example
=
"day22"
)
private
String
day22
;
@ApiModelProperty
(
value
=
"day23 "
,
example
=
"day23"
)
private
String
day23
;
@ApiModelProperty
(
value
=
"day24 "
,
example
=
"day24"
)
private
String
day24
;
@ApiModelProperty
(
value
=
"day25 "
,
example
=
"day25"
)
private
String
day25
;
@ApiModelProperty
(
value
=
"day26 "
,
example
=
"day26"
)
private
String
day26
;
@ApiModelProperty
(
value
=
"day27 "
,
example
=
"day27"
)
private
String
day27
;
@ApiModelProperty
(
value
=
"day28 "
,
example
=
"day28"
)
private
String
day28
;
@ApiModelProperty
(
value
=
"day29 "
,
example
=
"day29"
)
private
String
day29
;
@ApiModelProperty
(
value
=
"day30 "
,
example
=
"day30"
)
private
String
day30
;
@ApiModelProperty
(
value
=
"day31 "
,
example
=
"day31"
)
private
String
day31
;
@ApiModelProperty
(
value
=
"年 年"
,
example
=
"101"
)
private
Integer
belongYear
;
@ApiModelProperty
(
value
=
"月 月"
,
example
=
"101"
)
private
Integer
belongMonth
;
@ApiModelProperty
(
value
=
"企业组织代码 企业组织代码"
,
example
=
"101"
)
private
Integer
orgCode
;
@ApiModelProperty
(
value
=
"最后修改时间 最后修改时间"
,
example
=
"101"
)
private
Integer
lastModified
;
}
\ No newline at end of file
src/main/java/cn/timer/api/bean/kqmk/KqglAssoOvertimeRange.java
0 → 100644
View file @
0cf502e8
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-13
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table
(
name
=
"kqgl_asso_overtime_range"
)
@ApiModel
(
"加班规则-应用范围"
)
public
class
KqglAssoOvertimeRange
extends
Model
<
KqglAssoOvertimeRange
>
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
@TableId
(
type
=
IdType
.
AUTO
)
@ApiModelProperty
(
value
=
"编号 编号"
,
example
=
"101"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"加班规则id 加班规则id"
,
example
=
"101"
)
private
Integer
overtimeRulesId
;
@ApiModelProperty
(
value
=
"应用的考勤组id 应用的考勤组id"
,
example
=
"101"
)
private
Integer
attgroupId
;
}
\ No newline at end of file
src/main/java/cn/timer/api/bean/kqmk/KqglAssoOvertimeRules.java
View file @
0cf502e8
...
...
@@ -40,8 +40,8 @@ public class KqglAssoOvertimeRules extends Model<KqglAssoOvertimeRules> {
@ApiModelProperty
(
value
=
"规则名称 "
,
example
=
"以审批时间计算加班"
)
private
String
name
;
@ApiModelProperty
(
value
=
"应用范围"
,
example
=
"
1
"
)
private
String
appliedScope
;
@ApiModelProperty
(
value
=
"应用范围"
,
example
=
"
(0:全公司 >0:考勤组id)
"
)
private
Integer
appliedScope
;
@ApiModelProperty
(
value
=
"工作日是否允许加班 0:否;1:是"
,
example
=
"1"
)
private
Integer
isWorkovertime
;
...
...
src/main/java/cn/timer/api/bean/kqmk/KqglAssoTeshu.java
View file @
0cf502e8
...
...
@@ -47,7 +47,7 @@ public class KqglAssoTeshu extends Model<KqglAssoTeshu> {
private
Integer
bcid
;
@ApiModelProperty
(
value
=
"录入时间 录入时间"
,
example
=
"101"
)
private
Integer
lusjTime
;
private
Long
lusjTime
;
@ApiModelProperty
(
value
=
"录入人员 录入人员"
,
example
=
"101"
)
private
Integer
luryid
;
...
...
src/main/java/cn/timer/api/bean/kqmk/KqglAssoYhkqz.java
0 → 100644
View file @
0cf502e8
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/bean/kqmk/KqglMainKqz.java
View file @
0cf502e8
...
...
@@ -94,4 +94,7 @@ public class KqglMainKqz extends Model<KqglMainKqz> {
@ApiModelProperty
(
value
=
"外勤 外勤"
,
example
=
"101"
)
private
Integer
isWq
;
@ApiModelProperty
(
value
=
"加班规则 加班规则"
,
example
=
"101"
)
private
Integer
overtimeRulesId
;
}
\ No newline at end of file
src/main/java/cn/timer/api/bean/qyzx/QyzxOperLog.java
0 → 100644
View file @
0cf502e8
package
cn
.
timer
.
api
.
bean
.
qyzx
;
import
java.util.Date
;
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
;
/**
* 操作日志记录表 oper_log
*
* @author Tang
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
(
toBuilder
=
true
)
@Table
(
name
=
"qyzx_oper_log"
)
@ApiModel
(
"操作日志"
)
public
class
QyzxOperLog
extends
Model
<
QyzxOperLog
>{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
/** 日志主键 */
@Id
@GeneratedValue
@TableId
(
type
=
IdType
.
AUTO
)
@ApiModelProperty
(
value
=
"编号"
,
example
=
"101"
)
private
Integer
operId
;
@ApiModelProperty
(
value
=
"企业id"
,
example
=
"101"
)
private
Integer
orgCode
;
@ApiModelProperty
(
value
=
"员工id"
,
example
=
"101"
)
private
Integer
empNum
;
@ApiModelProperty
(
value
=
"标题 "
,
example
=
"操作模块"
)
private
String
title
;
@ApiModelProperty
(
value
=
"业务类型(0其它 1新增 2修改 3删除)"
,
example
=
"101"
)
private
Integer
businessType
;
@ApiModelProperty
(
value
=
"请求方法"
,
example
=
"请求方法"
)
private
String
method
;
@ApiModelProperty
(
value
=
"请求方式"
,
example
=
"请求方式"
)
private
String
requestMethod
;
@ApiModelProperty
(
value
=
"操作类别(0其它 1后台用户 2手机端用户)"
,
example
=
"101"
)
private
Integer
operatorType
;
@ApiModelProperty
(
value
=
"操作人员"
,
example
=
"操作人员"
)
private
String
operName
;
@ApiModelProperty
(
value
=
"部门名称"
,
example
=
"部门名称"
)
private
String
deptName
;
@ApiModelProperty
(
value
=
"请求url"
,
example
=
"请求url"
)
private
String
operUrl
;
@ApiModelProperty
(
value
=
"操作地址"
,
example
=
"操作地址"
)
private
String
operIp
;
@ApiModelProperty
(
value
=
"操作地点"
,
example
=
"操作地点"
)
private
String
operLocation
;
@ApiModelProperty
(
value
=
"请求参数"
,
example
=
"请求参数"
)
private
String
operParam
;
@ApiModelProperty
(
value
=
"返回参数"
,
example
=
"返回参数"
)
private
String
jsonResult
;
@ApiModelProperty
(
value
=
"操作状态(0正常 1异常)"
,
example
=
"101"
)
private
Integer
status
;
@ApiModelProperty
(
value
=
"错误消息"
,
example
=
"错误消息"
)
private
String
errorMsg
;
@ApiModelProperty
(
value
=
"操作时间"
,
example
=
"操作时间"
)
private
Date
operTime
;
}
src/main/java/cn/timer/api/bean/spmk/SpmkExecutor.java
View file @
0cf502e8
...
...
@@ -58,7 +58,7 @@ public class SpmkExecutor extends Model<SpmkExecutor> {
@ApiModelProperty
(
value
=
"意见 "
,
example
=
"意见"
)
private
String
opinion
;
@ApiModelProperty
(
value
=
"状态 0未执行 1执行中 2同意 3拒接"
,
example
=
"101"
)
@ApiModelProperty
(
value
=
"状态 0未执行 1执行中 2同意 3拒接
4转派
"
,
example
=
"101"
)
private
Integer
sts
;
@TableField
(
fill
=
FieldFill
.
INSERT
)
...
...
src/main/java/cn/timer/api/config/Initialization/InitializeSetting.java
View file @
0cf502e8
...
...
@@ -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/config/enuminterface/SpmkEnumInterface.java
0 → 100644
View file @
0cf502e8
package
cn
.
timer
.
api
.
config
.
enuminterface
;
import
lombok.Getter
;
public
interface
SpmkEnumInterface
{
/**
* 员工类型
*/
@Getter
enum
ExecutorSts
implements
SpmkEnumInterface
{
NON_EXECUTION
(
0
,
"未执行"
),
IN_EXECUTION
(
1
,
"执行中"
),
AGREE
(
2
,
"同意"
),
REFUSE
(
3
,
"拒绝"
),
REDEPLOY
(
4
,
"转派"
);
private
Integer
type
;
private
String
name
;
ExecutorSts
(
Integer
type
,
String
name
)
{
this
.
type
=
type
;
this
.
name
=
name
;
}
}
}
src/main/java/cn/timer/api/config/enuminterface/YgEnumInterface.java
View file @
0cf502e8
/**
* @date 2020年3月23日
* @author 翁东州
* @方法中文名称:
*/
package
cn
.
timer
.
api
.
config
.
enuminterface
;
import
java.text.DateFormat
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.HashMap
;
...
...
@@ -48,6 +41,24 @@ public interface YgEnumInterface {
}
/**
* 部门 岗位
*/
@Getter
enum
OrgType
implements
YgEnumInterface
{
DEPARTMENT
(
0
,
"部门"
),
POST
(
1
,
"岗位"
);
private
Integer
type
;
private
String
name
;
OrgType
(
Integer
type
,
String
name
)
{
this
.
type
=
type
;
this
.
name
=
name
;
}
}
/**
* 员工类型
*/
@Getter
...
...
@@ -81,7 +92,7 @@ public interface YgEnumInterface {
*/
@Getter
enum
jobStatus
implements
YgEnumInterface
{
SHIYONG
(
0
,
"试用"
),
ZHENSHI
(
1
,
"正式"
),
LIZHIZHONG
(
2
,
"离职中"
),
YILIZHI
(
3
,
"已离职"
);
SHIYONG
(
1
,
"试用"
),
ZHENSHI
(
2
,
"正式"
),
LIZHIZHONG
(
3
,
"离职中"
),
YILIZHI
(
4
,
"已离职"
);
private
Integer
type
;
...
...
src/main/java/cn/timer/api/config/enums/HttpMethod.java
0 → 100644
View file @
0cf502e8
package
cn
.
timer
.
api
.
config
.
enums
;
import
java.util.HashMap
;
import
java.util.Map
;
import
org.springframework.lang.Nullable
;
/**
* 请求方式
*
* @author ruoyi
*/
public
enum
HttpMethod
{
GET
,
HEAD
,
POST
,
PUT
,
PATCH
,
DELETE
,
OPTIONS
,
TRACE
;
private
static
final
Map
<
String
,
HttpMethod
>
mappings
=
new
HashMap
<>(
16
);
static
{
for
(
HttpMethod
httpMethod
:
values
())
{
mappings
.
put
(
httpMethod
.
name
(),
httpMethod
);
}
}
@Nullable
public
static
HttpMethod
resolve
(
@Nullable
String
method
)
{
return
(
method
!=
null
?
mappings
.
get
(
method
)
:
null
);
}
public
boolean
matches
(
String
method
)
{
return
(
this
==
resolve
(
method
));
}
}
src/main/java/cn/timer/api/config/thread/ThreadPoolConfig.java
0 → 100644
View file @
0cf502e8
package
cn
.
timer
.
api
.
config
.
thread
;
import
java.util.concurrent.ScheduledExecutorService
;
import
java.util.concurrent.ScheduledThreadPoolExecutor
;
import
java.util.concurrent.ThreadPoolExecutor
;
import
org.apache.commons.lang3.concurrent.BasicThreadFactory
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
;
import
cn.timer.api.utils.Threads
;
/**
* 线程池配置
*
* @author Tang
**/
@Configuration
public
class
ThreadPoolConfig
{
// 核心线程池大小
private
int
corePoolSize
=
50
;
// 最大可创建的线程数
private
int
maxPoolSize
=
200
;
// 队列最大长度
private
int
queueCapacity
=
1000
;
// 线程池维护线程所允许的空闲时间
private
int
keepAliveSeconds
=
300
;
@Bean
(
name
=
"threadPoolTaskExecutor"
)
public
ThreadPoolTaskExecutor
threadPoolTaskExecutor
()
{
ThreadPoolTaskExecutor
executor
=
new
ThreadPoolTaskExecutor
();
executor
.
setMaxPoolSize
(
maxPoolSize
);
executor
.
setCorePoolSize
(
corePoolSize
);
executor
.
setQueueCapacity
(
queueCapacity
);
executor
.
setKeepAliveSeconds
(
keepAliveSeconds
);
// 线程池对拒绝任务(无线程可用)的处理策略
executor
.
setRejectedExecutionHandler
(
new
ThreadPoolExecutor
.
CallerRunsPolicy
());
return
executor
;
}
/**
* 执行周期性或定时任务
*/
@Bean
(
name
=
"scheduledExecutorService"
)
protected
ScheduledExecutorService
scheduledExecutorService
()
{
return
new
ScheduledThreadPoolExecutor
(
corePoolSize
,
new
BasicThreadFactory
.
Builder
().
namingPattern
(
"schedule-pool-%d"
).
daemon
(
true
).
build
())
{
@Override
protected
void
afterExecute
(
Runnable
r
,
Throwable
t
)
{
super
.
afterExecute
(
r
,
t
);
Threads
.
printException
(
r
,
t
);
}
};
}
}
src/main/java/cn/timer/api/controller/LoginController.java
View file @
0cf502e8
...
...
@@ -28,6 +28,8 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.timer.api.aspect.lang.annotation.Log
;
import
cn.timer.api.aspect.lang.enums.BusinessType
;
import
cn.timer.api.bean.qyzx.QyzxEmpEntAsso
;
import
cn.timer.api.bean.qyzx.QyzxEmpLogin
;
import
cn.timer.api.bean.qyzx.QyzxEntInfoM
;
...
...
@@ -121,29 +123,6 @@ public class LoginController {
@Value
(
"${config-8timer.Aliyun.expirationTime_pri}"
)
private
String
expirationTime_pri
;
@GetMapping
(
value
=
"/test"
)
public
Map
<
String
,
Object
>
test
()
{
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
"1"
,
offset
);
map
.
put
(
"2"
,
PROJECT_NAME
);
map
.
put
(
"3"
,
REGION_ID
);
map
.
put
(
"4"
,
ACCESSKEY_ID
);
map
.
put
(
"5"
,
SECRET
);
// map.put("6", host);
// map.put("7", PROJECT_ID);
// map.put("8", PROJECT_SECRET);
map
.
put
(
"9"
,
endpoint
);
map
.
put
(
"10"
,
accessKeyId
);
map
.
put
(
"11"
,
accessKeySecret
);
map
.
put
(
"12"
,
bucketName
);
map
.
put
(
"13"
,
bucketName_pri
);
map
.
put
(
"14"
,
project_package
);
map
.
put
(
"15"
,
expirationTime
);
map
.
put
(
"16"
,
expirationTime_pri
);
map
.
put
(
"test1"
,
max
);
return
map
;
}
@Autowired
private
HttpSession
session
;
...
...
@@ -168,6 +147,7 @@ public class LoginController {
@PostMapping
(
value
=
"/sendcode"
)
@ApiOperation
(
value
=
"1.发送验证码"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
1
)
@Log
(
title
=
"发送验证码"
,
businessType
=
BusinessType
.
UPDATE
)
public
Result
<
String
>
sendCode
(
@RequestBody
EntRegisterDto
entRegisterDto
)
{
String
phone
=
entRegisterDto
.
getPhone
();
...
...
@@ -307,6 +287,7 @@ public class LoginController {
@PostMapping
(
value
=
"/updatePwd"
)
@ApiOperation
(
value
=
"4.修改密码(新)"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
4
)
@Log
(
title
=
"修改密码"
,
businessType
=
BusinessType
.
UPDATE
)
public
Result
<
String
>
updatepwd
(
@RequestBody
EntRegisterDto
entRegisterDto
)
{
String
oldPwd
=
entRegisterDto
.
getOldPwd
();
// 输入的原密码
String
pw
=
entRegisterDto
.
getPw
();
// 输入的新密码
...
...
@@ -344,8 +325,8 @@ public class LoginController {
* @return
*/
@PostMapping
(
value
=
"/updatepassword"
)
@ApiOperation
(
value
=
"
4
.修改密码"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
4
)
@ApiOperation
(
value
=
"
3
.修改密码"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
3
)
public
Result
<
String
>
updatepassword
(
@RequestBody
EntRegisterDto
entRegisterDto
)
{
String
phone
=
entRegisterDto
.
getPhone
();
String
pw
=
entRegisterDto
.
getPw
();
...
...
@@ -402,7 +383,8 @@ public class LoginController {
* @return
*/
@PostMapping
(
value
=
"/updatephone"
)
@ApiOperation
(
value
=
"修改手机号/用户名"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperation
(
value
=
"5.修改手机号/用户名"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
5
)
public
Result
<
String
>
updatephone
(
@CurrentUser
UserBean
userBean
,
@RequestBody
EntRegisterDto
entRegisterDto
)
{
/*
...
...
@@ -447,7 +429,9 @@ public class LoginController {
* @return
*/
@PostMapping
(
value
=
"/register"
)
@ApiOperation
(
value
=
"注册企业"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperation
(
value
=
"6.注册企业"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
6
)
@Log
(
title
=
"企业注册"
,
businessType
=
BusinessType
.
INSERT
)
public
Result
<
String
>
register
(
@RequestBody
EntRegisterDto
entRegisterDto
)
{
// 事务回滚
/*
...
...
@@ -508,7 +492,7 @@ public class LoginController {
}
boolean
b4
=
YgglMainEmp
.
builder
().
orgCode
(
qyzxEntInfoM
.
getId
()).
empNum
(
login
.
getId
()).
rzTime
(
new
Date
())
.
name
(
username
).
build
().
insert
();
.
name
(
username
).
jobStatus
(
1
).
build
().
insert
();
if
(!
b4
)
{
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
return
ResultUtil
.
error
(
"注册企业失败3"
);
...
...
@@ -540,7 +524,9 @@ public class LoginController {
* @return
*/
@PostMapping
(
value
=
"/code"
)
@ApiOperation
(
value
=
"验证码登录"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperation
(
value
=
"7.验证码登录"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
7
)
@Log
(
title
=
"用户登录"
,
businessType
=
BusinessType
.
OTHER
)
public
Result
<
QyzxEmpLogin
>
codelogin
(
@RequestBody
EntRegisterDto
entRegisterDto
,
HttpServletRequest
request
)
{
String
code
=
entRegisterDto
.
getCode
();
...
...
@@ -636,7 +622,9 @@ public class LoginController {
* @return
*/
@PostMapping
(
value
=
"/password"
)
@ApiOperation
(
value
=
"密码登录"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperation
(
value
=
"8.密码登录"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
8
)
@Log
(
title
=
"用户登录"
,
businessType
=
BusinessType
.
OTHER
)
public
Result
<
QyzxEmpLogin
>
passwordlogin
(
@RequestBody
EntRegisterDto
entRegisterDto
,
HttpServletRequest
request
)
{
String
phone
=
entRegisterDto
.
getPhone
();
...
...
src/main/java/cn/timer/api/controller/kqgl/AttController.java
View file @
0cf502e8
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/main/java/cn/timer/api/controller/kqgl/ClockInController.java
View file @
0cf502e8
...
...
@@ -16,7 +16,6 @@ import org.springframework.web.bind.annotation.RequestParam;
import
org.springframework.web.bind.annotation.RestController
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper
;
import
com.github.xiaoymin.knife4j.annotations.ApiOperationSupport
;
import
cn.hutool.json.JSONObject
;
...
...
@@ -25,6 +24,7 @@ import cn.timer.api.bean.kqmk.KqglAssoDkjl;
import
cn.timer.api.bean.kqmk.KqglAssoDkmx
;
import
cn.timer.api.bean.kqmk.KqglAssoKqj
;
import
cn.timer.api.bean.kqmk.KqglAssoKqzdkfs
;
import
cn.timer.api.bean.kqmk.KqglAssoMonthPunchSummary
;
import
cn.timer.api.bean.kqmk.KqglAssoTeshu
;
import
cn.timer.api.bean.kqmk.KqglAssoZhoupaiban
;
import
cn.timer.api.bean.kqmk.KqglMainKqz
;
...
...
@@ -32,7 +32,6 @@ import cn.timer.api.bean.yggl.YgglMainEmp;
import
cn.timer.api.config.exception.CustomException
;
import
cn.timer.api.dao.kqmk.KqglAssoPbmxMapper
;
import
cn.timer.api.dao.kqmk.KqglMainKqzMapper
;
import
cn.timer.api.dao.yggl.YgglMainEmpMapper
;
import
cn.timer.api.dto.kqmk.AttLateLate
;
import
cn.timer.api.dto.kqmk.AttSchedule
;
import
cn.timer.api.dto.kqmk.AttendanceCardListDto
;
...
...
@@ -44,15 +43,13 @@ import cn.timer.api.utils.ResultUtil;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
@Api
(
tags
=
"3.0考勤打卡"
)
@Api
(
tags
=
"3.0
[3]
考勤打卡"
)
@RestController
@Transactional
@RequestMapping
(
value
=
"/kqdk"
,
produces
=
{
"application/json"
,
"multipart/form-data"
})
public
class
ClockInController
{
@Autowired
private
KqglMainKqzMapper
kqglmainkqzmapper
;
/**
* 考勤打卡
*
...
...
@@ -65,24 +62,18 @@ public class ClockInController {
@ApiOperationSupport
(
order
=
1
)
public
Result
<
Object
>
punchclock
(
@RequestParam
String
json
)
throws
Exception
{
JSONObject
jsonArray
=
new
JSONObject
(
json
);
String
asDevId
=
jsonArray
.
get
(
"dev_id"
).
toString
();
String
asUserId
=
jsonArray
.
get
(
"user_id"
).
toString
();
String
asVerifyMode
=
jsonArray
.
get
(
"verify_mode"
).
toString
();
String
asIOMode
=
"0"
;
String
sStdIoTime
=
jsonArray
.
get
(
"io_time"
).
toString
();
String
asDevId
=
jsonArray
.
get
(
"dev_id"
).
toString
();
//考勤机编码
String
asUserId
=
jsonArray
.
get
(
"user_id"
).
toString
();
//打卡用户id
String
asVerifyMode
=
jsonArray
.
get
(
"verify_mode"
).
toString
();
//考勤机打卡方式(1:指纹;20:人脸;40:掌纹;60:密码(猜的^v^))
String
sStdIoTime
=
jsonArray
.
get
(
"io_time"
).
toString
();
//打卡时间
KqglAssoKqj
kqjdev
=
KqglAssoKqj
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoKqj
>().
lambda
().
eq
(
KqglAssoKqj:
:
getCode
,
asDevId
));
if
(
kqjdev
==
null
)
return
ResultUtil
.
error
(
"考勤机不存在!"
);
// YgglMainEmp user = new LambdaQueryChainWrapper<YgglMainEmp>(ygglmainempmapper).eq(YgglMainEmp::getEmpNum, asUserId).eq(YgglMainEmp::getOrgCode, kqjdev.getQyid()).one();
YgglMainEmp
user
=
YgglMainEmp
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
YgglMainEmp
>().
lambda
().
eq
(
YgglMainEmp:
:
getEmpNum
,
asUserId
).
eq
(
YgglMainEmp:
:
getOrgCode
,
kqjdev
.
getQyid
()));
if
(
user
!=
null
)
{
int
qyid
=
user
.
getOrgCode
();
//坏小孩【企业id】
int
userid
=
user
.
getEmpNum
();
//用户id
int
qyid
=
user
.
getOrgCode
();
int
userid
=
user
.
getEmpNum
();
KqglMainKqz
attgro
=
kqglmainkqzmapper
.
getAttendanceGroupInformationByUserid
(
userid
,
qyid
);
//考勤组信息
//pbfs;// 排班方式 1:固定排班;2:自由排班;3:自由工时
if
(
attgro
!=
null
)
{
...
...
@@ -248,6 +239,12 @@ public class ClockInController {
KqglAssoDkmx
.
builder
().
id
(
dkmc
.
getId
()).
build
().
updateById
();
}
}
//具体打卡时间入汇总表(打卡成功才会录入汇总表)
KqglAssoMonthPunchSummary
summary
=
KqglAssoMonthPunchSummary
.
builder
().
build
();
}
else
{
System
.
out
.
println
(
"当前打卡时间不在范围内"
);
}
//原始打卡记录数据录入**************************************************************************************************************************************
...
...
@@ -282,7 +279,7 @@ public class ClockInController {
long
attime
;
if
(
punchcardtime
==
0
&&
!
isRange
){
attime
=
new
Date
().
getTime
();}
else
{
attime
=
punchcardtime
;}
// 考勤时间(应打卡时间)
String
remarks
=
""
;
if
((
"1"
).
equals
(
asVerifyMode
))
{
remarks
=
"考勤机指纹打卡"
;}
else
if
((
"20"
).
equals
(
asVerifyMode
))
{
remarks
=
"考勤机人脸打卡"
;}
if
((
"1"
).
equals
(
asVerifyMode
))
{
remarks
=
"考勤机指纹打卡"
;}
else
if
((
"20"
).
equals
(
asVerifyMode
))
{
remarks
=
"考勤机人脸打卡"
;}
else
if
((
"40"
).
equals
(
asVerifyMode
))
{
remarks
=
"考勤机掌纹打卡"
;}
else
if
((
"60"
).
equals
(
asVerifyMode
))
{
remarks
=
"考勤机密码打卡"
;}
//cardtype--1:GPS,2:WIFI,3:考勤机
KqglAssoDkjl
pre
=
KqglAssoDkjl
.
builder
().
dktime
(
time_
).
results
(
results
).
userId
(
userid
).
type
(
type
).
status
(
status
).
sort
(
atttype
)
.
cardType
(
3
).
qyid
(
qyid
).
attdate
(
attdate_
+
" "
+
ClockInTool
.
dateToWeek2
(
putime
)).
attime
(
attime
).
dkmxid
(
dkmx
).
bcid
(
clockt
.
getShifid
()).
remarks
(
remarks
).
punchmode
(
Integer
.
valueOf
(
asVerifyMode
))
...
...
src/main/java/cn/timer/api/controller/kqgl/ClockInTool.java
View file @
0cf502e8
...
...
@@ -4,9 +4,14 @@ import java.text.DateFormat;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Locale
;
import
java.util.Set
;
/**
* @author Yl123 2020-05-11
...
...
@@ -14,6 +19,114 @@ import java.util.Locale;
*/
public
class
ClockInTool
{
static
SimpleDateFormat
famt
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
/**
* 根据 年、月 获取对应的月份 的 天数
*/
public
static
int
getDaysByYearMonth
(
int
year
,
int
month
)
{
Calendar
a
=
Calendar
.
getInstance
();
a
.
set
(
Calendar
.
YEAR
,
year
);
a
.
set
(
Calendar
.
MONTH
,
month
-
1
);
a
.
set
(
Calendar
.
DATE
,
1
);
a
.
roll
(
Calendar
.
DATE
,
-
1
);
int
maxDate
=
a
.
get
(
Calendar
.
DATE
);
return
maxDate
;
}
/**
* 获取月份起始日期
*
* @param date
* @return
* @throws ParseException
*/
public
static
String
getMinMonthDate
(
String
date
)
throws
ParseException
{
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
famt
.
parse
(
date
));
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
calendar
.
getActualMinimum
(
Calendar
.
DAY_OF_MONTH
));
return
famt
.
format
(
calendar
.
getTime
());
}
/**
* 获取月份最后日期
*
* @param date
* @return
* @throws ParseException
*/
public
static
String
getMaxMonthDate
(
String
date
)
throws
ParseException
{
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
famt
.
parse
(
date
));
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
calendar
.
getActualMaximum
(
Calendar
.
DAY_OF_MONTH
));
return
famt
.
format
(
calendar
.
getTime
());
}
/**
* 对比两个字符串数组
* @param t1
* @param t2
* @return
*/
public
static
<
T
>
List
<
T
>
compare
(
T
[]
t1
,
T
[]
t2
)
{
List
<
T
>
list1
=
Arrays
.
asList
(
t1
);
//将t1数组转成list数组
List
<
T
>
list2
=
new
ArrayList
<
T
>();
//用来存放2个数组中不相同的元素
for
(
T
t
:
t2
)
{
if
(!
list1
.
contains
(
t
))
{
list2
.
add
(
t
);
}
}
return
list2
;
}
public
static
String
[]
array_unique
(
String
[]
ss
)
{
Set
<
String
>
set
=
new
HashSet
<
String
>(
Arrays
.
asList
(
ss
));
return
set
.
toArray
(
new
String
[
set
.
size
()]);
//或者return new HashSet<String>(Arrays.asList(ss)).toArray(new String[0]);
}
public
static
byte
[]
CreateBSCommBufferFromString
(
String
sCmdParam
,
byte
[]
bytCmd
)
{
try
{
if
(
sCmdParam
.
length
()
==
0
){
return
bytCmd
;
}
byte
[]
bytText
=
sCmdParam
.
getBytes
(
"UTF-8"
);
byte
[]
bytTextLen
=
int2byte
(
bytText
.
length
+
1
);
bytCmd
=
new
byte
[
4
+
bytText
.
length
+
1
];
System
.
arraycopy
(
bytTextLen
,
0
,
bytCmd
,
0
,
bytTextLen
.
length
);
System
.
arraycopy
(
bytText
,
0
,
bytCmd
,
4
,
bytText
.
length
);
bytCmd
[
4
+
bytText
.
length
]
=
0
;
return
bytCmd
;
}
catch
(
Exception
e
){
e
.
printStackTrace
();
bytCmd
=
new
byte
[
0
];
return
bytCmd
;
}
}
public
static
byte
[]
int2byte
(
int
res
)
{
byte
[]
targets
=
new
byte
[
4
];
targets
[
0
]
=
(
byte
)
(
res
&
0xff
);
targets
[
1
]
=
(
byte
)
((
res
>>
8
)
&
0xff
);
targets
[
2
]
=
(
byte
)
((
res
>>
16
)
&
0xff
);
targets
[
3
]
=
(
byte
)
(
res
>>>
24
);
return
targets
;
}
public
static
byte
[]
ConcateByteArray
(
byte
[]
abytDest
,
byte
[]
abytSrc
)
{
int
len_dest
=
abytDest
.
length
+
abytSrc
.
length
;
if
(
abytSrc
.
length
==
0
)
return
abytDest
;
byte
[]
bytTmp
=
new
byte
[
len_dest
];
System
.
arraycopy
(
abytDest
,
0
,
bytTmp
,
0
,
abytDest
.
length
);
System
.
arraycopy
(
abytSrc
,
0
,
bytTmp
,
abytDest
.
length
,
abytSrc
.
length
);
return
bytTmp
;
}
public
static
String
dateToWeek2
(
String
datetime
)
{
SimpleDateFormat
f
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
...
...
src/main/java/cn/timer/api/controller/kqgl/TimeCardController.java
View file @
0cf502e8
package
cn
.
timer
.
api
.
controller
.
kqgl
;
import
java.lang.reflect.InvocationTargetException
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.
Arrays
;
import
java.util.
Comparator
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.util.MultiValueMap
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
...
...
@@ -15,8 +24,9 @@ import org.springframework.web.bind.annotation.PostMapping;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.client.RestClientException
;
import
org.springframework.web.client.RestTemplate
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
...
...
@@ -26,51 +36,84 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.lang.Console
;
import
cn.hutool.json.JSONObject
;
import
cn.timer.api.bean.kqgl.AttConditions
;
import
cn.timer.api.bean.kqgl.AttendanceCardList
;
import
cn.timer.api.bean.kqgl.AttGroupBinPunchMode
;
import
cn.timer.api.bean.kqgl.AttendanceMachine
;
import
cn.timer.api.bean.kqgl.PunchCardDetails
;
import
cn.timer.api.bean.kqgl.PunchRecord
;
import
cn.timer.api.bean.kqgl.UserAttendanceRel
;
import
cn.timer.api.bean.kqgl.UserEquiRelation
;
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.KqglAssoDkjl
;
import
cn.timer.api.bean.kqmk.KqglAssoDkmx
;
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.KqglAssoOvertimeRange
;
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.KqglAssoYhsb
;
import
cn.timer.api.bean.kqmk.KqglAssoZhoupaiban
;
import
cn.timer.api.bean.kqmk.KqglMainKqz
;
import
cn.timer.api.bean.spmk.SpmkInitiatorConfig
;
import
cn.timer.api.bean.yggl.YgglMainEmp
;
import
cn.timer.api.config.Initialization.StaticVariable
;
import
cn.timer.api.config.annotation.CurrentUser
;
import
cn.timer.api.config.annotation.UserBean
;
import
cn.timer.api.dao.kqgl.PunchCardDetailsMapper
;
import
cn.timer.api.dao.kqgl.PunchRecordMapper
;
import
cn.timer.api.dao.kqgl.UserAttendanceRelMapper
;
import
cn.timer.api.dao.kqgl.UserEquiRelationMapper
;
import
cn.timer.api.dao.kqmk.KqglAssOvertimeViceMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoBcszMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoDkdzMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoDkjlMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoDkwxMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoKqjMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoKqzdkfsMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoLeaveBalanceMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoLeaveRulesMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoOvertimeRangeMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoOvertimeRulesMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoPbmxMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoRulesViceMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoTeshuMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoYhkqzMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoYhsbMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoZhoupaibanMapper
;
import
cn.timer.api.dao.kqmk.KqglMainKqzMapper
;
import
cn.timer.api.dto.kqgl.AttemacDto
;
import
cn.timer.api.dto.kqmk.AttSchedulingDto
;
import
cn.timer.api.dto.kqmk.AttendanceAssistantDto
;
import
cn.timer.api.dto.kqmk.AttqueryCriteriaDto
;
import
cn.timer.api.dto.kqmk.CompensateDto
;
import
cn.timer.api.dto.kqmk.EmployeeLeaveBalanceDto
;
import
cn.timer.api.dto.kqmk.IndividualOvertimeRuleDto
;
import
cn.timer.api.dto.kqmk.KqglAssoLeaveRulesDto
;
import
cn.timer.api.dto.kqmk.KqglAssoOvertimeRulesDto
;
import
cn.timer.api.dto.kqmk.KqglAssoPbmxDto
;
import
cn.timer.api.dto.kqmk.KqglMainKqzDto
;
import
cn.timer.api.dto.kqmk.KqzAttendanceGroupSearchDto
;
import
cn.timer.api.dto.kqmk.LeaveTypeDto
;
import
cn.timer.api.dto.kqmk.MachinememberDto
;
import
cn.timer.api.dto.kqmk.SetConditionsDto
;
import
cn.timer.api.dto.kqmk.StartTimeRestDto
;
import
cn.timer.api.dto.kqmk.VacationInformationDto
;
import
cn.timer.api.utils.DateUtil
;
import
cn.timer.api.utils.ResponseResult
;
import
cn.timer.api.utils.Result
;
import
cn.timer.api.utils.ResultUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
net.sf.json.JSONObject
;
@Api
(
tags
=
"3.0考勤模块"
)
@Api
(
tags
=
"3.0
[1]
考勤模块"
)
@RestController
@Transactional
@RequestMapping
(
value
=
"/kqmk"
,
produces
=
{
"application/json"
,
"multipart/form-data"
})
...
...
@@ -85,7 +128,7 @@ public class TimeCardController {
/**
* 查询列表-获取班次数据-分页
*/
@PostMapping
(
value
=
"/
select_shifts
"
)
@PostMapping
(
value
=
"/
ShiftDataList
"
)
@ApiOperation
(
value
=
"1.获取班次数据-根据 组织机构代码-分页"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
1
)
public
Result
<
Object
>
selectShifts
(
@CurrentUser
UserBean
userBean
,
@RequestBody
AttqueryCriteriaDto
attquerycriteriadto
)
{
...
...
@@ -94,7 +137,6 @@ public class TimeCardController {
attquerycriteriadto
.
getTotalPage
()
==
null
?
10
:
attquerycriteriadto
.
getTotalPage
());
attquerycriteriadto
.
setOrgCode
(
userBean
.
getOrgCode
());
attquerycriteriadto
.
setEmpNum
(
userBean
.
getEmpNum
());
// IPage<KqglAssoBcsz> pageAs = kqglassobcszmapper.selectPage(page, attquerycriteriadto);//用于SQL语句
IPage
<
KqglAssoBcsz
>
pageAs
=
kqglassobcszmapper
.
selectPage
(
page
,
new
QueryWrapper
<
KqglAssoBcsz
>().
lambda
().
eq
(
KqglAssoBcsz:
:
getQyid
,
userBean
.
getOrgCode
()));
List
<
KqglAssoBcsz
>
listAs
=
pageAs
.
getRecords
();
return
ResultUtil
.
data
(
pageAs
,
listAs
,
"操作成功!"
);
...
...
@@ -134,7 +176,6 @@ public class TimeCardController {
@ApiOperation
(
value
=
"4:获取班次信息-根据班次id"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
4
)
public
Result
<
Object
>
getShiftCenter
(
@PathVariable
(
"id"
)
Integer
id
)
{
return
ResultUtil
.
data
(
KqglAssoBcsz
.
builder
().
id
(
id
).
build
().
selectById
(),
"操作成功!"
);
}
...
...
@@ -154,11 +195,13 @@ public class TimeCardController {
/**
* 查询列表-获取加班规则数据-分页
* @throws InvocationTargetException
* @throws IllegalAccessException
*/
@PostMapping
(
value
=
"/select_overtime_rules"
)
@ApiOperation
(
value
=
"6.获取加班规则数据-根据 组织机构代码-分页"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
6
)
public
Result
<
Object
>
selectOvertimeRules
(
@CurrentUser
UserBean
userBean
,
@RequestBody
AttqueryCriteriaDto
attquerycriteriadto
)
{
public
Result
<
Object
>
selectOvertimeRules
(
@CurrentUser
UserBean
userBean
,
@RequestBody
AttqueryCriteriaDto
attquerycriteriadto
)
throws
IllegalAccessException
,
InvocationTargetException
{
IPage
<
KqglAssoOvertimeRules
>
page
=
new
Page
<
KqglAssoOvertimeRules
>(
attquerycriteriadto
.
getCurrentPage
()
==
null
?
1
:
attquerycriteriadto
.
getCurrentPage
(),
attquerycriteriadto
.
getTotalPage
()
==
null
?
10
:
attquerycriteriadto
.
getTotalPage
());
...
...
@@ -166,9 +209,31 @@ public class TimeCardController {
attquerycriteriadto
.
setEmpNum
(
userBean
.
getEmpNum
());
IPage
<
KqglAssoOvertimeRules
>
pageAs
=
kqglassoovertimerulesmapper
.
selectPage
(
page
,
new
QueryWrapper
<
KqglAssoOvertimeRules
>().
lambda
().
eq
(
KqglAssoOvertimeRules:
:
getOrgCode
,
userBean
.
getOrgCode
()));
List
<
KqglAssoOvertimeRules
>
listAs
=
pageAs
.
getRecords
();
return
ResultUtil
.
data
(
pageAs
,
listAs
,
"操作成功!"
);
List
<
KqglAssoOvertimeRulesDto
>
rulesdto
=
new
ArrayList
<
KqglAssoOvertimeRulesDto
>();
for
(
int
i
=
0
,
n
=
listAs
.
size
();
i
<
n
;
i
++)
{
String
[]
nary
=
null
;
if
(
listAs
.
get
(
i
).
getAppliedScope
()
==
0
)
{
//全公司
nary
=
new
String
[
1
];
//用户名
nary
[
0
]
=
"全公司"
;
}
else
{
List
<
KqglAssoOvertimeRange
>
overtim
=
kqglassoovertimerangemapper
.
selectList
(
new
QueryWrapper
<
KqglAssoOvertimeRange
>().
lambda
().
eq
(
KqglAssoOvertimeRange:
:
getOvertimeRulesId
,
listAs
.
get
(
i
).
getId
()));
nary
=
new
String
[
overtim
.
size
()];
//用户名
for
(
int
y
=
0
,
l
=
overtim
.
size
();
y
<
l
;
y
++)
{
KqglMainKqz
kqzmc
=
kqglmainkqzmapper
.
selectOne
(
new
QueryWrapper
<
KqglMainKqz
>().
lambda
().
eq
(
KqglMainKqz:
:
getId
,
overtim
.
get
(
y
).
getAttgroupId
()));
nary
[
y
]
=
kqzmc
.
getName
();
}
}
KqglAssoOvertimeRulesDto
ruldto
=
KqglAssoOvertimeRulesDto
.
builder
().
build
();
ruldto
.
setApplyrange
(
nary
);
BeanUtil
.
copyProperties
(
listAs
.
get
(
i
),
ruldto
,
"starttime"
,
"applyrange"
);
rulesdto
.
add
(
ruldto
);
}
return
ResultUtil
.
data
(
pageAs
,
rulesdto
,
"操作成功!"
);
}
@Autowired
private
KqglAssoOvertimeRangeMapper
kqglassoovertimerangemapper
;
/**
* 新增/修改--加班规则
*/
...
...
@@ -179,21 +244,28 @@ public class TimeCardController {
overrules
.
setCreateTime
(
new
Date
().
getTime
());
overrules
.
setOrgCode
(
userBean
.
getOrgCode
());
overrules
.
setCreateUserid
(
userBean
.
getEmpNum
());
String
[]
launchs
=
overrules
.
getApplyrange
();
String
appliedscope
=
StringUtils
.
join
(
launchs
,
","
);
// rul.setAppliedScope(appliedscope);//应用范围
overrules
.
setAppliedScope
(
appliedscope
);
KqglAssoOvertimeRules
rul
=
KqglAssoOvertimeRules
.
builder
().
build
();
// 克隆 KqglAssoOvertimeRulesDto对象 到 KqglAssoOvertimeRules对象
BeanUtil
.
copyProperties
(
overrules
,
rul
,
"starttime"
,
"applyrange"
);
if
(!
rul
.
insertOrUpdate
())
return
ResultUtil
.
error
(
"操作失败"
);
Integer
id
=
rul
.
getId
();
Console
.
log
(
"新增/修改加班规则id: "
+
id
);
List
<
KqglAssoOvertimeRange
>
overatts
=
new
ArrayList
<
KqglAssoOvertimeRange
>();
String
[]
launchs
=
overrules
.
getApplyrange
();
if
(
launchs
.
length
==
0
)
{
KqglAssoOvertimeRange
.
builder
().
build
().
delete
(
new
QueryWrapper
<
KqglAssoOvertimeRange
>().
lambda
().
eq
(
KqglAssoOvertimeRange:
:
getOvertimeRulesId
,
id
));
}
else
if
(
launchs
!=
null
&&
launchs
.
length
>
0
){
for
(
int
p
=
0
;
p
<
launchs
.
length
;
p
++){
KqglAssoOvertimeRange
.
builder
().
build
().
delete
(
new
QueryWrapper
<
KqglAssoOvertimeRange
>().
lambda
().
eq
(
KqglAssoOvertimeRange:
:
getOvertimeRulesId
,
id
));
KqglAssoOvertimeRange
vice
=
KqglAssoOvertimeRange
.
builder
().
build
();
vice
.
setOvertimeRulesId
(
id
);
vice
.
setAttgroupId
(
Integer
.
valueOf
(
launchs
[
p
]));
overatts
.
add
(
vice
);
}
}
if
(
overatts
.
size
()
>
0
)
{
kqglassoovertimerangemapper
.
insertovertimerangelist
(
overatts
);
}
List
<
KqglAssOvertimeVice
>
overtimes
=
new
ArrayList
<
KqglAssOvertimeVice
>();
StartTimeRestDto
[]
rest
=
overrules
.
getStarttime
();
if
(
rest
!=
null
&&
rest
.
length
>
0
){
...
...
@@ -222,8 +294,11 @@ public class TimeCardController {
public
Result
<
IndividualOvertimeRuleDto
>
getOvertimeRules
(
@PathVariable
(
"id"
)
Integer
id
)
{
IndividualOvertimeRuleDto
overrule
=
IndividualOvertimeRuleDto
.
builder
().
build
();
KqglAssoOvertimeRules
rules
=
KqglAssoOvertimeRules
.
builder
().
id
(
id
).
build
().
selectById
();
String
str
=
rules
.
getAppliedScope
();
String
[]
arr
=
str
.
split
(
","
);
// 用,分割
List
<
KqglAssoOvertimeRange
>
overtim
=
kqglassoovertimerangemapper
.
selectList
(
new
QueryWrapper
<
KqglAssoOvertimeRange
>().
lambda
().
eq
(
KqglAssoOvertimeRange:
:
getOvertimeRulesId
,
rules
.
getId
()));
String
[]
arr
=
new
String
[
overtim
.
size
()];
//用户名
for
(
int
i
=
0
,
n
=
overtim
.
size
();
i
<
n
;
i
++)
{
arr
[
i
]
=
overtim
.
get
(
i
).
getAttgroupId
().
toString
();
}
KqglAssoOvertimeRulesDto
ruldto
=
KqglAssoOvertimeRulesDto
.
builder
().
build
();
ruldto
.
setApplyrange
(
arr
);
BeanUtil
.
copyProperties
(
rules
,
ruldto
,
"starttime"
,
"applyrange"
);
...
...
@@ -312,18 +387,24 @@ public class TimeCardController {
BeanUtil
.
copyProperties
(
leaverules
,
learul
,
"starttime"
);
if
(!
learul
.
insertOrUpdate
())
return
ResultUtil
.
error
(
"操作失败"
);
Integer
id
=
learul
.
getId
();
Console
.
log
(
"新增/修改--假期规则id: "
+
id
);
if
(
leaverules
.
getLeaveBalance
()
==
0
)
{
//假期余额 0:关(该项余额为“不限余额”);1:开(该项余额为“0”)
KqglAssoLeaveBalance
.
builder
().
build
().
delete
(
new
QueryWrapper
<
KqglAssoLeaveBalance
>().
lambda
().
eq
(
KqglAssoLeaveBalance:
:
getLeaveRulesId
,
id
)
.
eq
(
KqglAssoLeaveBalance
::
getOrgCode
,
userBean
.
getOrgCode
()));
if
(
leaverules
.
getLeaveBalance
()
==
1
)
{
//假期余额 0:关(该项余额为“不限余额”);1:开(该项余额为“0”)
//该项公司员工余额为“0”
List
<
YgglMainEmp
>
yggl
=
YgglMainEmp
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
YgglMainEmp
>().
lambda
().
eq
(
YgglMainEmp:
:
getOrgCode
,
userBean
.
getOrgCode
()));
for
(
YgglMainEmp
ye:
yggl
)
{
KqglAssoLeaveBalance
.
builder
().
leaveRulesId
(
id
).
userid
(
ye
.
getEmpNum
()).
modifyAction
(
1
).
balanceDays
(
"+0"
)
.
reason
(
"系统按照规则自动"
).
modifyUserid
(
userBean
.
getEmpNum
()).
modifyTimer
(
new
Date
().
getTime
()).
orgCode
(
userBean
.
getOrgCode
()).
isAutomatic
(
1
).
modifyNumber
(
1
).
build
().
insert
();
//员工假期余额
}
}
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
();
...
...
@@ -387,6 +468,103 @@ public class TimeCardController {
return
ResultUtil
.
data
(
attendanList
,
"操作成功!"
);
}
@GetMapping
(
value
=
"/synchrotime/{code}"
)
@ApiOperation
(
value
=
"考勤机一键同步"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
public
Result
<
Object
>
SynchronizationTime
(
@CurrentUser
UserBean
userBean
,
@PathVariable
(
"code"
)
String
code
)
{
JSONObject
vResultJson
=
new
JSONObject
();
vResultJson
.
put
(
"devId"
,
code
);
String
sFinal
=
vResultJson
.
toString
();
String
url
=
StaticVariable
.
mac_command
+
"/setTime"
;
HttpHeaders
headers
=
new
HttpHeaders
();
MultiValueMap
<
String
,
Object
>
params
=
new
LinkedMultiValueMap
<>();
params
.
add
(
"json"
,
sFinal
);
RestTemplate
restTemplate
=
new
RestTemplate
();
HttpEntity
httpEntity
=
new
HttpEntity
(
params
,
headers
);
try
{
ResponseEntity
<
String
>
request
=
restTemplate
.
postForEntity
(
url
,
httpEntity
,
String
.
class
);
}
catch
(
RestClientException
e
)
{
System
.
err
.
println
(
"提示:考勤机服务出错"
);
return
ResultUtil
.
success
(
"失败"
);
}
return
ResultUtil
.
success
(
"成功"
);
}
/**
* 移除考勤机管理员
*/
@PostMapping
(
value
=
"/removeadministrator/{kqjid}/{id}"
)
@ApiOperation
(
value
=
"移除考勤机管理员"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
public
Result
<
Object
>
RemoveAdministrator
(
@PathVariable
int
kqjid
,
@PathVariable
int
id
,
@RequestBody
Map
<
String
,
String
>
mmd
)
{
String
[]
xgyh
=
mmd
.
get
(
"a"
).
split
(
","
);
if
(
xgyh
.
length
>
0
){
KqglAssoKqj
kqj
=
KqglAssoKqj
.
builder
().
id
(
kqjid
).
build
().
selectById
();
//查询考勤机“序列号”
for
(
int
a
=
0
;
a
<
xgyh
.
length
;
a
++){
JSONObject
vResultJson
=
new
JSONObject
();
vResultJson
.
put
(
"devId"
,
kqj
.
getCode
());
vResultJson
.
put
(
"userId"
,
xgyh
[
a
]);
vResultJson
.
put
(
"privilege"
,
1
);
String
sFinal
=
vResultJson
.
toString
();
String
url
=
StaticVariable
.
mac_command
+
"/addUserPrivilege"
;
HttpHeaders
headers
=
new
HttpHeaders
();
MultiValueMap
<
String
,
Object
>
params
=
new
LinkedMultiValueMap
<>();
params
.
add
(
"json"
,
sFinal
);
RestTemplate
restTemplate
=
new
RestTemplate
();
HttpEntity
httpEntity
=
new
HttpEntity
(
params
,
headers
);
try
{
ResponseEntity
<
String
>
request
=
restTemplate
.
postForEntity
(
url
,
httpEntity
,
String
.
class
);
}
catch
(
RestClientException
e
)
{
System
.
err
.
println
(
"提示:考勤机服务出错"
);
return
ResultUtil
.
success
(
"失败"
);
}
KqglAssoYhsb
.
builder
().
id
(
id
).
isGly
(
0
).
build
().
updateById
();
}
}
return
ResultUtil
.
success
(
"成功"
);
}
@PostMapping
(
value
=
"/modifyauthority/{kqjid}/{id}"
)
@ApiOperation
(
value
=
"添加考勤机管理员"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
public
Result
<
Object
>
ModifyAuthority
(
@CurrentUser
UserBean
userBean
,
@PathVariable
int
kqjid
,
@PathVariable
int
id
,
@RequestBody
Map
<
String
,
String
>
mmd
)
{
String
[]
xgyh
=
mmd
.
get
(
"a"
).
split
(
","
);
if
(
xgyh
.
length
>
0
){
KqglAssoKqj
kqj
=
KqglAssoKqj
.
builder
().
id
(
kqjid
).
build
().
selectById
();
//查询考勤机“序列号”
for
(
int
a
=
0
;
a
<
xgyh
.
length
;
a
++){
JSONObject
vResultJson
=
new
JSONObject
();
vResultJson
.
put
(
"devId"
,
kqj
.
getCode
());
vResultJson
.
put
(
"userId"
,
xgyh
[
a
]);
vResultJson
.
put
(
"privilege"
,
2
);
String
sFinal
=
vResultJson
.
toString
();
String
url
=
StaticVariable
.
mac_command
+
"/addUserPrivilege"
;
HttpHeaders
headers
=
new
HttpHeaders
();
MultiValueMap
<
String
,
Object
>
params
=
new
LinkedMultiValueMap
<>();
params
.
add
(
"json"
,
sFinal
);
RestTemplate
restTemplate
=
new
RestTemplate
();
HttpEntity
httpEntity
=
new
HttpEntity
(
params
,
headers
);
try
{
ResponseEntity
<
String
>
request
=
restTemplate
.
postForEntity
(
url
,
httpEntity
,
String
.
class
);
}
catch
(
RestClientException
e
)
{
System
.
err
.
println
(
"提示:考勤机服务出错"
);
return
ResultUtil
.
success
(
"失败"
);
}
UserEquiRelation
kqjry
=
new
UserEquiRelation
();
kqjry
.
setId
(
id
);
kqjry
.
setIsGly
(
1
);
userequirelationmapper
.
updateByPrimaryKeySelective
(
kqjry
);
}
}
return
ResultUtil
.
success
(
"成功"
);
}
/**
* 新增考勤机
*/
...
...
@@ -397,7 +575,29 @@ public class TimeCardController {
kqglassokqj
.
setLuryid
(
userBean
.
getEmpNum
());
kqglassokqj
.
setLusjTime
(
new
Date
().
getTime
());
kqglassokqj
.
setQyid
(
userBean
.
getOrgCode
());
return
kqglassokqj
.
insert
()
?
ResultUtil
.
success
(
"操作成功!"
)
:
ResultUtil
.
error
(
"操作失败!"
);
if
(!
kqglassokqj
.
insert
())
return
ResultUtil
.
error
(
"操作失败--新增考勤机"
);
JSONObject
vResultJson
=
new
JSONObject
();
vResultJson
.
put
(
"devId"
,
kqglassokqj
.
getCode
());
vResultJson
.
put
(
"orgCode"
,
userBean
.
getOrgCode
());
String
sFinal
=
vResultJson
.
toString
();
String
url
=
StaticVariable
.
mac_command
+
"/addDev"
;
HttpHeaders
headers
=
new
HttpHeaders
();
MultiValueMap
<
String
,
Object
>
params
=
new
LinkedMultiValueMap
<>();
params
.
add
(
"json"
,
sFinal
);
RestTemplate
restTemplate
=
new
RestTemplate
();
HttpEntity
httpEntity
=
new
HttpEntity
(
params
,
headers
);
try
{
ResponseEntity
<
String
>
request
=
restTemplate
.
postForEntity
(
url
,
httpEntity
,
String
.
class
);
}
catch
(
RestClientException
e
)
{
System
.
err
.
println
(
"提示:考勤机服务出错"
);
return
ResultUtil
.
success
(
"失败"
);
}
return
ResultUtil
.
success
(
"操作成功!"
);
}
/**
...
...
@@ -489,21 +689,6 @@ public class TimeCardController {
return
KqglAssoDkdz
.
builder
().
id
(
id
).
build
().
deleteById
()
?
ResultUtil
.
success
(
"删除成功!"
)
:
ResultUtil
.
error
(
"没有找到该对象"
);
}
/**
* 获取打卡地址所在考勤组数据*********
*/
// @GetMapping(value="/PunchAddressGroup/{id}")
// @ApiOperation(value = "获取打卡地址所在考勤组数据", httpMethod = "GET", notes = "接口发布说明")
// @ApiOperationSupport(order = 14)
// public Result<List<AttendanceGroup>> getPunchAddressGroup(@CurrentUser UserBean userBean,@PathVariable("id") Integer id) {
//
// int qyid = userBean.getOrgCode();//坏小孩【企业id】
// int userid = userBean.getEmpNum();//用户id
//
// List<AttendanceGroup> attaddressownlist = attendancegroupservice.selectByPrimaryAttAddressOwn(qyid,id);
// return ResultUtil.data(attaddressownlist);
// }
/*********打卡WIFI***********/
/**
* 获取打卡WIFI数据
...
...
@@ -562,19 +747,6 @@ public class TimeCardController {
return
KqglAssoDkwx
.
builder
().
id
(
id
).
build
().
deleteById
()
?
ResultUtil
.
success
(
"删除成功!"
)
:
ResultUtil
.
error
(
"没有找到该对象"
);
}
/**
* 获取打卡WIFI所在考勤组数据*****
*/
// @GetMapping(value="/PunchWIFIGroup/{id}")
// @ApiOperation(value = "获取打卡WIFI所在考勤组数据", httpMethod = "GET", notes = "接口发布说明")
// @ApiOperationSupport(order = 20)
// public Result<List<AttendanceGroup>> getPunchWIFIGroup(@CurrentUser UserBean userBean,@PathVariable("id") Integer id) {
// int qyid = userBean.getOrgCode();//坏小孩【企业id】
//
// List<AttendanceGroup> attwifiownlist = attendancegroupservice.selectByPrimaryAttWIFIOwn(qyid,id);
// return ResultUtil.data(attwifiownlist);
// }
@Autowired
private
KqglAssoLeaveBalanceMapper
kqglassoleavebalancemapper
;
/**
...
...
@@ -606,7 +778,6 @@ public class TimeCardController {
public
Result
<
Object
>
BalanceHeader
(
@CurrentUser
UserBean
userBean
)
{
List
<
KqglAssoLeaveRules
>
balheas
=
new
LambdaQueryChainWrapper
<
KqglAssoLeaveRules
>(
kqglassoleaverulesmapper
).
eq
(
KqglAssoLeaveRules
::
getOrgCode
,
userBean
.
getOrgCode
())
.
eq
(
KqglAssoLeaveRules
::
getLeaveType
,
2
).
or
().
eq
(
KqglAssoLeaveRules
::
getIsOpen
,
1
).
list
();
return
ResultUtil
.
data
(
balheas
,
"操作成功!"
);
}
...
...
@@ -617,10 +788,8 @@ public class TimeCardController {
@ApiOperation
(
value
=
"30: 查询列表-假期规则"
,
httpMethod
=
"GET"
,
notes
=
" 查询列表-假期规则"
)
@ApiOperationSupport
(
order
=
30
)
public
Result
<
Object
>
selectListLeaveRules
(
@CurrentUser
UserBean
userBean
)
{
List
<
KqglAssoLeaveRules
>
balheas
=
new
LambdaQueryChainWrapper
<
KqglAssoLeaveRules
>(
kqglassoleaverulesmapper
).
eq
(
KqglAssoLeaveRules
::
getOrgCode
,
userBean
.
getOrgCode
())
.
eq
(
KqglAssoLeaveRules
::
getLeaveType
,
2
).
or
().
eq
(
KqglAssoLeaveRules
::
getIsOpen
,
1
).
list
();
List
<
LeaveTypeDto
>
leas
=
new
ArrayList
<
LeaveTypeDto
>();
for
(
KqglAssoLeaveRules
rul
:
balheas
)
{
LeaveTypeDto
lea
=
LeaveTypeDto
.
builder
().
build
();
...
...
@@ -638,9 +807,7 @@ public class TimeCardController {
@ApiOperation
(
value
=
"31:根据组织机构代码 获取考勤组"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
31
)
public
Result
<
Object
>
CheckWorkatt
(
@CurrentUser
UserBean
userBean
)
{
List
<
KqglMainKqz
>
kqzs
=
KqglMainKqz
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
KqglMainKqz
>().
lambda
().
eq
(
KqglMainKqz:
:
getQyid
,
userBean
.
getOrgCode
()));
List
<
LeaveTypeDto
>
leas
=
new
ArrayList
<
LeaveTypeDto
>();
for
(
KqglMainKqz
rul
:
kqzs
)
{
LeaveTypeDto
lea
=
LeaveTypeDto
.
builder
().
build
();
...
...
@@ -648,7 +815,6 @@ public class TimeCardController {
lea
.
setValue
(
rul
.
getName
());
leas
.
add
(
lea
);
}
return
ResultUtil
.
data
(
leas
,
"操作成功!"
);
}
...
...
@@ -659,9 +825,7 @@ public class TimeCardController {
@ApiOperation
(
value
=
"32:根据组织机构代码 获取加班基础设置信息"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
32
)
public
Result
<
Object
>
overtimebasicinformation
(
@CurrentUser
UserBean
userBean
)
{
KqglAssoOvertimeBasics
kqjdev
=
KqglAssoOvertimeBasics
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoOvertimeBasics
>().
lambda
().
eq
(
KqglAssoOvertimeBasics:
:
getOrgCode
,
userBean
.
getOrgCode
()));
return
ResultUtil
.
data
(
kqjdev
,
"操作成功!"
);
}
...
...
@@ -672,7 +836,6 @@ public class TimeCardController {
@ApiOperation
(
value
=
"33:获取假期规则数据-分页"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
33
)
public
Result
<
Object
>
selectleaverules
(
@CurrentUser
UserBean
userBean
,
@RequestBody
AttqueryCriteriaDto
attquerycriteriadto
)
{
IPage
<
KqglAssoLeaveRules
>
page
=
new
Page
<
KqglAssoLeaveRules
>(
attquerycriteriadto
.
getCurrentPage
()
==
null
?
1
:
attquerycriteriadto
.
getCurrentPage
(),
attquerycriteriadto
.
getTotalPage
()
==
null
?
10
:
attquerycriteriadto
.
getTotalPage
());
...
...
@@ -680,9 +843,1016 @@ public class TimeCardController {
attquerycriteriadto
.
setEmpNum
(
userBean
.
getEmpNum
());
IPage
<
KqglAssoLeaveRules
>
pageAs
=
kqglassoleaverulesmapper
.
selectPage
(
page
,
new
QueryWrapper
<
KqglAssoLeaveRules
>().
lambda
().
eq
(
KqglAssoLeaveRules:
:
getOrgCode
,
userBean
.
getOrgCode
()));
List
<
KqglAssoLeaveRules
>
listAs
=
pageAs
.
getRecords
();
List
<
KqglAssoLeaveRulesDto
>
leadto
=
new
ArrayList
<
KqglAssoLeaveRulesDto
>();
for
(
int
i
=
0
,
n
=
listAs
.
size
();
i
<
n
;
i
++)
{
String
[]
nary
=
null
;
if
(
listAs
.
get
(
i
).
getApply
()
==
0
)
{
//全公司
nary
=
new
String
[
1
];
//用户名
nary
[
0
]
=
"全公司"
;
}
else
{
//考勤组
List
<
KqglAssoRulesVice
>
vice
=
kqglassorulesvicemapper
.
selectList
(
new
QueryWrapper
<
KqglAssoRulesVice
>().
lambda
().
eq
(
KqglAssoRulesVice:
:
getLeaveRulesId
,
listAs
.
get
(
i
).
getId
()));
nary
=
new
String
[
vice
.
size
()];
//用户名
for
(
int
y
=
0
,
l
=
vice
.
size
();
y
<
l
;
y
++)
{
KqglMainKqz
kqzmc
=
kqglmainkqzmapper
.
selectOne
(
new
QueryWrapper
<
KqglMainKqz
>().
lambda
().
eq
(
KqglMainKqz:
:
getId
,
vice
.
get
(
y
).
getAttgroupId
()));
nary
[
y
]
=
kqzmc
.
getName
();
}
}
KqglAssoLeaveRulesDto
learul
=
KqglAssoLeaveRulesDto
.
builder
().
build
();
learul
.
setApplyrange
(
nary
);
BeanUtil
.
copyProperties
(
listAs
.
get
(
i
),
learul
,
"range"
,
"applyrange"
);
leadto
.
add
(
learul
);
}
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
);
}
//用户和考勤组关系
@Autowired
private
UserAttendanceRelMapper
userattendancerelservice
;
//用户与设备关系表
@Autowired
private
UserEquiRelationMapper
userequirelationmapper
;
/**
* 删除考勤组
*/
@DeleteMapping
(
value
=
"/AttendanceGroup/{id}"
)
@ApiOperation
(
value
=
"39:删除考勤组"
,
httpMethod
=
"DELETE"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
39
)
public
Result
<
Integer
>
DelAttendanceGroup
(
@CurrentUser
UserBean
userBean
,
@PathVariable
(
"id"
)
Integer
id
)
{
if
(
KqglMainKqz
.
builder
().
id
(
id
).
build
().
deleteById
())
{
// List<UserAttendanceRel> attusers = userattendancerelservice.selectAttendanceOfficerByKqzid(id, userBean.getOrgCode());//该考勤组人数
// //该考勤组所绑定的考勤机
// List<KqglAssoKqzdkfs> kqjs = kqglassokqzdkfsmapper.selectList(new QueryWrapper<KqglAssoKqzdkfs>().lambda().eq(KqglAssoKqzdkfs::getKqzId, id).eq(KqglAssoKqzdkfs::getType, 1));
// String DevId = "";
// for(KqglAssoKqzdkfs abp:kqjs) {
// KqglAssoKqj kqj = KqglAssoKqj.builder().id(abp.getDkfsid()).build().selectById();//查询考勤机“序列号”
// DevId = kqj.getCode();
// for(UserAttendanceRel user:attusers) {
// String user_id = user.getEmpnum();//"1692";//要删除的考勤组里面用户ID
// JSONObject vResultJson = new JSONObject();
// vResultJson.put("devId", DevId);
// vResultJson.put("userId", user_id);
// String sFinal = vResultJson.toString();
// String url = StaticVariable.mac_command+"/deleteUser";
// HttpHeaders headers = new HttpHeaders();
// MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
// params.add("json", sFinal);
// RestTemplate restTemplate = new RestTemplate();
// HttpEntity httpEntity = new HttpEntity(params, headers);
// ResponseEntity<String> request = restTemplate.postForEntity(url, httpEntity, String.class);
// }
// }
// userequirelationmapper.deleteBykqzid(id);
//删除考勤组绑定的打卡方式
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
));
//刪除加班规则-应用范围
KqglAssoOvertimeRange
.
builder
().
build
().
delete
(
new
QueryWrapper
<
KqglAssoOvertimeRange
>().
lambda
().
eq
(
KqglAssoOvertimeRange:
:
getAttgroupId
,
id
));
//刪除假期规则-适用范围
KqglAssoRulesVice
.
builder
().
build
().
delete
(
new
QueryWrapper
<
KqglAssoRulesVice
>().
lambda
().
eq
(
KqglAssoRulesVice:
:
getAttgroupId
,
id
));
return
ResultUtil
.
data
(
id
,
"删除成功"
);
}
return
ResultUtil
.
error
(
"删除失败"
);
}
@Autowired
private
KqglAssoKqzdkfsMapper
kqglassokqzdkfsmapper
;
@Autowired
private
KqglAssoYhkqzMapper
kqglassoyhkqzmapper
;
@Autowired
private
KqglAssoZhoupaibanMapper
kqglassozhoupaibanmapper
;
@Autowired
private
KqglAssoTeshuMapper
kqglassoteshumapper
;
@Autowired
private
KqglAssoPbmxMapper
kqglassopbmxmapper
;
/**
* 新建考勤组
*/
@PostMapping
(
value
=
"/AttendanceGroup"
)
@ApiOperation
(
value
=
"40:新增考勤组数据"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
40
)
public
Result
<
Object
>
AttendanceGroupList
(
@CurrentUser
UserBean
userBean
,
@RequestBody
AttendanceAssistantDto
attass
)
{
KqglMainKqz
attgro
=
KqglMainKqz
.
builder
().
name
(
attass
.
getName
()).
kqbz
(
attass
.
getRemarks
()).
pbfs
(
attass
.
getAtttype
()).
qyid
(
userBean
.
getOrgCode
())
.
isWq
(
attass
.
getFieldpersonnel
()).
isFdjjr
(
attass
.
getLegalholidays
()).
isXzbcdk
(
attass
.
getOptscheduling
()).
sybc
(
String
.
join
(
","
,
attass
.
getAttShifts
()))
.
isDqtx
(
attass
.
getAttRemind
()).
txry
(
String
.
join
(
","
,
attass
.
getAttRemindUserids
())).
txfs
(
attass
.
getAdvanceDays
()).
txxhts
(
attass
.
getRemCycleDays
())
.
txsjTime
(
attass
.
getReminderTime
()).
tsfs
(
String
.
join
(
","
,
attass
.
getPromptingMode
())).
isWpbsdk
(
attass
.
getAttRemind
()).
kqkssjTime
(
attass
.
getNewAttTime
())
.
zsgzsc
(
attass
.
getLeastworkTime
()).
zcgzsc
(
attass
.
getNormalWorkTime
()).
jbzdsc
(
attass
.
getMaxOvertimeTime
()).
overtimeRulesId
(
attass
.
getOvertimeRulesId
()).
build
();
// if (!attgro.insertOrUpdate())
if
(!
attgro
.
insert
())
return
ResultUtil
.
error
(
"操作失败--新增考勤组"
);
Integer
attid
=
attgro
.
getId
();
Console
.
log
(
"新增--考勤组id: "
+
attid
);
List
<
KqglAssoKqzdkfs
>
kqzdkfslist
=
new
ArrayList
<
KqglAssoKqzdkfs
>();
String
[]
attmac
=
attass
.
getAttmachines
();
//考勤机
if
(
attmac
.
length
>
0
){
for
(
int
i
=
0
;
i
<
attmac
.
length
;
i
++)
{
KqglAssoKqzdkfs
attgbpmac
=
KqglAssoKqzdkfs
.
builder
().
dkfsid
(
Integer
.
valueOf
(
attmac
[
i
])).
kqzId
(
attid
).
type
(
1
).
qyid
(
userBean
.
getOrgCode
()).
state
(
1
).
build
();
kqzdkfslist
.
add
(
attgbpmac
);
}
}
String
[]
atad
=
attass
.
getAttadds
();
//考勤地址
if
(
atad
.
length
>
0
){
for
(
int
a
=
0
;
a
<
atad
.
length
;
a
++){
KqglAssoKqzdkfs
attgbpadd
=
KqglAssoKqzdkfs
.
builder
().
dkfsid
(
Integer
.
valueOf
(
atad
[
a
])).
kqzId
(
attid
).
type
(
2
).
qyid
(
userBean
.
getOrgCode
()).
state
(
1
).
build
();
kqzdkfslist
.
add
(
attgbpadd
);
}
}
String
[]
atwf
=
attass
.
getAttwifis
();
//考勤WIFI
if
(
atwf
.
length
>
0
){
for
(
int
f
=
0
;
f
<
atwf
.
length
;
f
++){
KqglAssoKqzdkfs
attgbpwf
=
KqglAssoKqzdkfs
.
builder
().
dkfsid
(
Integer
.
valueOf
(
atwf
[
f
])).
kqzId
(
attid
).
type
(
3
).
qyid
(
userBean
.
getOrgCode
()).
state
(
1
).
build
();
kqzdkfslist
.
add
(
attgbpwf
);
}
}
if
(
kqzdkfslist
.
size
()>
0
){
kqglassokqzdkfsmapper
.
insertKqglAssokqzdKfsList
(
kqzdkfslist
);
}
//用户和考勤组关系
List
<
KqglAssoYhkqz
>
yhkqzlist
=
new
ArrayList
<
KqglAssoYhkqz
>();
String
[]
attser
=
attass
.
getAttuserids
();
if
(
attser
.
length
>
0
){
for
(
int
u
=
0
;
u
<
attser
.
length
;
u
++){
if
(
attass
.
getAtttype
()
==
2
){
KqglAssoPbmx
.
builder
().
build
().
delete
(
new
QueryWrapper
<
KqglAssoPbmx
>().
lambda
().
eq
(
KqglAssoPbmx:
:
getUserid
,
Integer
.
valueOf
(
attser
[
u
])));}
KqglAssoYhkqz
.
builder
().
build
().
delete
(
new
QueryWrapper
<
KqglAssoYhkqz
>().
lambda
().
eq
(
KqglAssoYhkqz:
:
getUserid
,
Integer
.
valueOf
(
attser
[
u
])));
KqglAssoYhkqz
kquser
=
KqglAssoYhkqz
.
builder
().
kqzid
(
attid
).
userid
(
Integer
.
valueOf
(
attser
[
u
])).
qyid
(
userBean
.
getOrgCode
()).
build
();
yhkqzlist
.
add
(
kquser
);
List
<
KqglAssoKqzdkfs
>
kqjs
=
kqglassokqzdkfsmapper
.
selectList
(
new
QueryWrapper
<
KqglAssoKqzdkfs
>().
lambda
().
eq
(
KqglAssoKqzdkfs:
:
getKqzId
,
attid
).
eq
(
KqglAssoKqzdkfs:
:
getType
,
1
));
for
(
KqglAssoKqzdkfs
abp:
kqjs
)
{
KqglAssoKqj
kqj
=
KqglAssoKqj
.
builder
().
id
(
abp
.
getDkfsid
()).
build
().
selectById
();
KqglAssoYhsb
kqjry
=
KqglAssoYhsb
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoYhsb
>().
lambda
().
eq
(
KqglAssoYhsb:
:
getUserId
,
Integer
.
valueOf
(
attser
[
u
])).
eq
(
KqglAssoYhsb:
:
getKqjid
,
kqj
.
getId
()));
if
(
kqjry
==
null
)
{
KqglAssoYhsb
uskqj
=
KqglAssoYhsb
.
builder
().
userId
(
Integer
.
valueOf
(
attser
[
u
])).
kqjid
(
kqj
.
getId
()).
type
(
1
).
isGly
(
kqjry
.
getIsGly
()).
build
();
if
(!
uskqj
.
insert
())
return
ResultUtil
.
error
(
"操作失败--新增用户与设备关系"
);
YgglMainEmp
yggluser
=
YgglMainEmp
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
YgglMainEmp
>().
lambda
().
eq
(
YgglMainEmp:
:
getOrgCode
,
userBean
.
getOrgCode
()).
eq
(
YgglMainEmp:
:
getEmpNum
,
attser
[
u
]));
JSONObject
vResultJson
=
new
JSONObject
();
vResultJson
.
put
(
"devId"
,
kqj
.
getCode
());
vResultJson
.
put
(
"userId"
,
attser
[
u
]);
vResultJson
.
put
(
"userName"
,
yggluser
.
getName
());
String
sFinal
=
vResultJson
.
toString
();
String
url
=
StaticVariable
.
mac_command
+
"/addUserName"
;
HttpHeaders
headers
=
new
HttpHeaders
();
MultiValueMap
<
String
,
Object
>
params
=
new
LinkedMultiValueMap
<>();
params
.
add
(
"json"
,
sFinal
);
RestTemplate
restTemplate
=
new
RestTemplate
();
HttpEntity
httpEntity
=
new
HttpEntity
(
params
,
headers
);
ResponseEntity
<
String
>
request
=
restTemplate
.
postForEntity
(
url
,
httpEntity
,
String
.
class
);
}
}
}
}
if
(
yhkqzlist
.
size
()>
0
){
kqglassoyhkqzmapper
.
insertKqglAssoKqzdkfsList
(
yhkqzlist
);
}
List
<
KqglAssoZhoupaiban
>
attweeklist
=
new
ArrayList
<
KqglAssoZhoupaiban
>();
//固定排版周记录
String
[]
weektime
=
attass
.
getAttWeekdays
();
//周工作日【固定排班】
String
[]
weekshif
=
attass
.
getAttWeekdaysShifts
();
//周工作日班次【固定排班】
if
(
weektime
.
length
>
0
&&
weekshif
.
length
>
0
&&
attass
.
getAtttype
()
==
1
){
for
(
int
h
=
0
;
h
<
weektime
.
length
;
h
++){
KqglAssoZhoupaiban
attweek
=
KqglAssoZhoupaiban
.
builder
().
kqzid
(
attid
).
type
(
Integer
.
valueOf
(
weektime
[
h
])).
bcid
(
Integer
.
valueOf
(
weekshif
[
h
])).
build
();
attweeklist
.
add
(
attweek
);
}
}
String
[]
attFrWorkdays
=
attass
.
getAttFreeWorkdays
();
// 周工作日【自由工时】
if
(
attFrWorkdays
.
length
>
0
&&
attass
.
getAtttype
()
==
3
){
for
(
int
w
=
0
;
w
<
attFrWorkdays
.
length
;
w
++){
KqglAssoZhoupaiban
attfrwor
=
KqglAssoZhoupaiban
.
builder
().
kqzid
(
attid
).
type
(
Integer
.
valueOf
(
attFrWorkdays
[
w
])).
bcid
(
0
).
build
();
attweeklist
.
add
(
attfrwor
);
}
}
if
(
attweeklist
.
size
()>
0
){
kqglassozhoupaibanmapper
.
insertKqglAssoZhoupaibanList
(
attweeklist
);
}
List
<
KqglAssoTeshu
>
speclist
=
new
ArrayList
<
KqglAssoTeshu
>();
String
[]
attmuspudata
=
attass
.
getAttMustPunchData
();
// 必须打卡的日期【固定排班】
String
[]
attmuspushifid
=
attass
.
getAttMustPunchShifid
();
// 必须打卡的班次id【固定排班】
String
[]
attnonpudata
=
attass
.
getAttNonPunchData
();
// 不用打卡的日期【固定排班】
if
(
attmuspudata
.
length
>
0
&&
attmuspushifid
.
length
>
0
&&
attass
.
getAtttype
()
==
1
){
for
(
int
m
=
0
;
m
<
attmuspudata
.
length
;
m
++){
KqglAssoTeshu
mut
=
KqglAssoTeshu
.
builder
().
kqzid
(
attid
).
tsrq
(
attmuspudata
[
m
]).
bcid
(
Integer
.
valueOf
(
attmuspushifid
[
m
])).
lusjTime
(
new
Date
().
getTime
()).
luryid
(
userBean
.
getEmpNum
()).
type
(
1
).
build
();
speclist
.
add
(
mut
);
}
}
if
(
attnonpudata
.
length
>
0
&&
attass
.
getAtttype
()
==
1
){
for
(
int
n
=
0
;
n
<
attnonpudata
.
length
;
n
++){
KqglAssoTeshu
non
=
KqglAssoTeshu
.
builder
().
kqzid
(
attid
).
tsrq
(
attnonpudata
[
n
]).
bcid
(
0
).
lusjTime
(
new
Date
().
getTime
()).
luryid
(
userBean
.
getEmpNum
()).
type
(
2
).
build
();
speclist
.
add
(
non
);
}
}
if
(
speclist
.
size
()>
0
){
kqglassoteshumapper
.
insertKqglAssoTeshuList
(
speclist
);
}
//记录排班(排班制)
List
<
KqglAssoPbmxDto
>
schlist
=
new
ArrayList
<
KqglAssoPbmxDto
>();
KqglAssoPbmxDto
[]
schedules
=
attass
.
getSchedules
();
// 排班日期【排班制】--班次id、日期
if
(
schedules
.
length
>
0
&&
attass
.
getAtttype
()
==
2
){
for
(
int
p
=
0
;
p
<
schedules
.
length
;
p
++){
KqglAssoPbmxDto
sch
=
KqglAssoPbmxDto
.
builder
().
userid
(
schedules
[
p
].
getUserid
()).
data
(
schedules
[
p
].
getData
()).
bcid
(
schedules
[
p
].
getBcid
()).
kqzid
(
attid
).
build
();
schlist
.
add
(
sch
);
}
}
if
(
schlist
.
size
()>
0
){
kqglassopbmxmapper
.
insertKqglAssoPbmxList
(
schlist
);
}
return
ResultUtil
.
data
(
attgro
,
"操作成功!"
);
}
@PutMapping
(
value
=
"/switch"
)
@ApiOperation
(
value
=
"41:设置假期规则开关"
,
httpMethod
=
"PUT"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
41
)
public
Result
<
Object
>
setswitch
(
@CurrentUser
UserBean
userBean
,
@RequestBody
SetConditionsDto
setconditionsdto
)
{
return
KqglAssoLeaveRules
.
builder
().
id
(
setconditionsdto
.
getId
()).
isOpen
(
setconditionsdto
.
getParameters
()).
build
().
updateById
()
?
ResultUtil
.
success
(
"操作成功!"
)
:
ResultUtil
.
error
(
"操作失败!"
);
}
/**
* 获取修改的排班明细--【修改考勤组】--------------------------------------------------------------------------------------
*/
@PostMapping
(
value
=
"/AttGroupSchedulingList"
)
@ApiOperation
(
value
=
"42:获取修改的排班明细"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
42
)
public
Result
<
Object
>
getAttGroupSchedulingList
(
@CurrentUser
UserBean
userBean
,
@RequestBody
AttSchedulingDto
attscheduling
)
{
String
str
=
new
SimpleDateFormat
(
"yyyy-MM"
).
format
(
new
Date
());
if
((
""
).
equals
(
attscheduling
.
getDate
())
||
attscheduling
.
getDate
()
==
null
){
attscheduling
.
setDate
(
str
);
}
attscheduling
.
setQyid
(
userBean
.
getOrgCode
());
List
<
KqglAssoPbmxDto
>
schlist
=
kqglassopbmxmapper
.
selectAttGroupScheduling
(
attscheduling
);
return
ResultUtil
.
data
(
schlist
);
}
/**
* 根据考勤组id获取班次信息--【修改考勤组】
*/
@GetMapping
(
value
=
"/roster/{id}/{date}"
)
@ApiOperation
(
value
=
"43:根据考勤组id获取班次信息"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
43
)
public
Result
<
Object
>
getRosterList
(
@PathVariable
(
"id"
)
Integer
id
,
@PathVariable
(
"date"
)
String
date
)
{
KqzAttendanceGroupSearchDto
jycx
=
KqzAttendanceGroupSearchDto
.
builder
().
overall
(
date
).
qyid
(
id
).
build
();
List
<
KqglAssoBcsz
>
shifs
=
kqglassobcszmapper
.
selectRosterByKqzid
(
jycx
);
return
ResultUtil
.
data
(
shifs
);
}
private
SimpleDateFormat
mat
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
@Autowired
private
KqglAssoDkjlMapper
kqglassodkjlmapper
;
//打卡记录
@Autowired
private
PunchRecordMapper
punchrecordservice
;
//打卡明细表
@Autowired
private
PunchCardDetailsMapper
punchcarddetailsservice
;
/**
* 修改考勤组排班(修改排班后,需判断是否有打卡记录,有则匹配当天修改后的班次,无则不需要修改)
* @throws ParseException
*/
@PutMapping
(
value
=
"/attscheduling"
)
@ApiOperation
(
value
=
"44:修改考勤组排班"
,
httpMethod
=
"PUT"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
44
)
public
Result
<
Object
>
updateAttscheduling
(
@CurrentUser
UserBean
userBean
,
@RequestBody
AttendanceAssistantDto
attass
)
throws
ParseException
{
int
id
=
Integer
.
valueOf
(
attass
.
getAttgroupid
());
//修改数据id
List
<
KqglAssoPbmxDto
>
schlist
=
new
ArrayList
<
KqglAssoPbmxDto
>();
KqglAssoPbmxDto
[]
schedules
=
attass
.
getSchedules
();
// 排班日期【排班制】--班次id、日期
if
(
schedules
.
length
>
0
&&
attass
.
getAtttype
()
==
2
){
for
(
int
p
=
0
;
p
<
schedules
.
length
;
p
++){
KqglAssoPbmxDto
sch
=
KqglAssoPbmxDto
.
builder
().
userid
(
schedules
[
p
].
getUserid
()).
data
(
schedules
[
p
].
getData
()).
bcid
(
schedules
[
p
].
getBcid
()).
kqzid
(
Integer
.
valueOf
(
attass
.
getAttgroupid
())).
build
();
schlist
.
add
(
sch
);
String
data
=
mat
.
format
(
new
Date
(
schedules
[
p
].
getData
().
toString
()));
Long
startDate
=
DateUtil
.
getStartTime
(
0
,
DateUtil
.
getStringTime
(
data
,
"yyyy-MM-dd"
)).
getTime
();
Long
endDate
=
DateUtil
.
getnowEndTime
(
23
,
DateUtil
.
getStringTime
(
data
,
"yyyy-MM-dd"
)).
getTime
();
KqglAssoBcsz
banci
=
KqglAssoBcsz
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoBcsz
>().
lambda
().
eq
(
KqglAssoBcsz:
:
getId
,
schedules
[
p
].
getBcid
()));
Long
sbdk1
=
0
l
,
xbdk1
=
0
l
,
sbdk2
=
0
l
,
xbdk2
=
0
l
,
sbdk3
=
0
l
,
xbdk3
=
0
l
;
if
(
banci
!=
null
){
if
(
banci
.
getSxbcs
()==
1
||
banci
.
getSxbcs
()==
2
||
banci
.
getSxbcs
()==
3
){
sbdk1
=
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
data
+
" "
+
ClockInTool
.
dealDateFormat
(
banci
.
getSbdk1
(),
2
)+
":00"
));
xbdk1
=
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
data
+
" "
+
ClockInTool
.
dealDateFormat
(
banci
.
getXbdk1
(),
2
)+
":00"
));
}
if
(
banci
.
getSxbcs
()==
2
||
banci
.
getSxbcs
()==
3
){
sbdk2
=
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
data
+
" "
+
ClockInTool
.
dealDateFormat
(
banci
.
getSbdk2
(),
2
)+
":00"
));
xbdk2
=
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
data
+
" "
+
ClockInTool
.
dealDateFormat
(
banci
.
getXbdk2
(),
2
)+
":00"
));
}
if
(
banci
.
getSxbcs
()==
3
){
sbdk3
=
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
data
+
" "
+
ClockInTool
.
dealDateFormat
(
banci
.
getSbdk3
(),
2
)+
":00"
));
xbdk3
=
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
data
+
" "
+
ClockInTool
.
dealDateFormat
(
banci
.
getXbdk3
(),
2
)+
":00"
));
}
}
KqglAssoDkjl
mapuca
=
KqglAssoDkjl
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoDkjl
>().
lambda
().
gt
(
KqglAssoDkjl:
:
getAttime
,
startDate
).
lt
(
KqglAssoDkjl:
:
getAttime
,
endDate
).
eq
(
KqglAssoDkjl:
:
getUserId
,
schedules
[
p
].
getUserid
()).
last
(
"LIMIT 1"
));
List
<
KqglAssoDkjl
>
mapucalist
=
kqglassodkjlmapper
.
selectList
(
new
QueryWrapper
<
KqglAssoDkjl
>().
lambda
().
gt
(
KqglAssoDkjl:
:
getAttime
,
startDate
).
lt
(
KqglAssoDkjl:
:
getAttime
,
endDate
).
eq
(
KqglAssoDkjl:
:
getUserId
,
schedules
[
p
].
getUserid
()).
orderByAsc
(
KqglAssoDkjl:
:
getId
));
if
(
mapuca
!=
null
&&
!(
schedules
[
p
].
getBcid
()).
equals
(
mapuca
.
getBcid
())){
// List<KqglAssoDkjl> initial = kqglassodkjlmapper.selectList(new QueryWrapper<KqglAssoDkjl>().lambda().gt(KqglAssoDkjl::getAttime, startDate).lt(KqglAssoDkjl::getAttime, endDate).eq(KqglAssoDkjl::getUserId, schedules[p].getUserid()).orderByAsc(KqglAssoDkjl::getId));
if
(
mapucalist
.
size
()
>
0
){
RestMethod
(
mapucalist
,
mapucalist
.
get
(
0
).
getDkmxid
());
}
}
KqglAssoDkjl
minAttid
=
null
,
maxAttid
=
null
;
int
dkmxid
=
0
;
if
(
mapucalist
.
size
()
>
0
){
//最小值
minAttid
=
mapucalist
.
stream
().
min
(
Comparator
.
comparing
(
KqglAssoDkjl:
:
getId
)).
get
();
//最大值
maxAttid
=
mapucalist
.
stream
().
max
(
Comparator
.
comparing
(
KqglAssoDkjl:
:
getId
)).
get
();
//对应打卡明细表id
dkmxid
=
maxAttid
.
getDkmxid
();
}
//当天有打卡记录且当天打卡班次和当前修改后的班次不匹配再进行重新维护
if
(
mapuca
!=
null
&&
!(
schedules
[
p
].
getBcid
()).
equals
(
mapuca
.
getBcid
())){
if
(
banci
!=
null
){
//修改后有班次打卡
if
(
banci
.
getSxbcs
()
==
1
){
//修改后一天打两次
if
(
mapucalist
.
size
()
>
2
){
/////当天打卡多条的话 取最开始打的卡和最后打的卡 作为新一轮的上下班考勤
for
(
KqglAssoDkjl
pre
:
mapucalist
){
if
(
pre
.
getId
()
!=
minAttid
.
getId
()
&&
pre
.
getId
()
!=
maxAttid
.
getId
()){
//去除最大和最小 其他均改为“打卡无效:此记录已被更新”
int
results
=
0
;
long
attime
;
if
((
pre
.
getSort
())%
2
>
0
){
Long
time
=
(
pre
.
getDktime
()
-
sbdk1
)/
1000
/
60
;
if
(
time
>
0
){
results
=
Integer
.
valueOf
(
time
.
toString
());}
attime
=
sbdk1
;
//上班应打卡时间
}
else
{
Long
time
=
(
pre
.
getDktime
()
-
xbdk1
)/
1000
/
60
;
if
(
time
>
0
){}
else
{
results
=
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
()));}
attime
=
xbdk1
;
//下班应打卡时间
}
KqglAssoDkjl
.
builder
().
id
(
pre
.
getId
()).
status
(
0
).
sort
(
0
).
results
(
results
).
attime
(
attime
).
bcid
(
banci
.
getId
()).
build
().
updateById
();
}
else
{
if
(
pre
.
getId
()
==
minAttid
.
getId
()){
//上班
Long
time
=
(
pre
.
getDktime
()
-
sbdk1
)/
1000
/
60
;
int
status
=
0
,
results
=
0
;
//状态(0:打卡无效:此记录已被更新 1:正常 2:异常 3:迟到 4:早退 5:补卡 6:请假 7:加班 8:调休)
if
(
time
>
0
){
status
=
3
;
results
=
Integer
.
valueOf
(
time
.
toString
());}
else
{
status
=
1
;
results
=
0
;}
KqglAssoDkjl
.
builder
().
id
(
pre
.
getId
()).
type
(
1
).
status
(
status
).
results
(
results
).
attime
(
sbdk1
).
bcid
(
banci
.
getId
()).
build
().
updateById
();
}
else
if
(
pre
.
getId
()
==
maxAttid
.
getId
()){
//下班
Long
time
=
(
pre
.
getDktime
()
-
xbdk1
)/
1000
/
60
;
int
status
=
0
,
results
=
0
;
if
(
time
>
0
){
status
=
1
;
results
=
0
;}
else
{
status
=
4
;
results
=
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
()));}
KqglAssoDkjl
.
builder
().
id
(
pre
.
getId
()).
type
(
2
).
status
(
status
).
results
(
results
).
attime
(
xbdk1
).
bcid
(
banci
.
getId
()).
sort
(
2
).
build
().
updateById
();
}
}
}
KqglAssoDkjl
mindata
=
KqglAssoDkjl
.
builder
().
id
(
minAttid
.
getId
()).
build
().
selectById
();
KqglAssoDkmx
.
builder
().
id
(
dkmxid
).
sbdk1
(
mindata
.
getDktime
()).
sbdk1jg
(
mindata
.
getResults
()).
xbdk1
(
null
).
xbdk1jg
(
0
).
sbdk2
(
null
).
sbdk2jg
(
0
).
xbdk2
(
null
)
.
xbdk2jg
(
0
).
sbdk3
(
null
).
sbdk3jg
(
0
).
ydkcs
(
banci
.
getSxbcs
()*
2
).
gzsc
(
Double
.
valueOf
(
"0"
)).
build
().
updateById
();
KqglAssoDkjl
maxdata
=
KqglAssoDkjl
.
builder
().
id
(
maxAttid
.
getId
()).
build
().
selectById
();
Long
woktimes
=
(
maxdata
.
getDktime
()
-
mindata
.
getDktime
())/
1000
/
60
;
KqglAssoDkmx
.
builder
().
id
(
dkmxid
).
xbdk1
(
maxdata
.
getDktime
()).
xbdk1jg
(
maxdata
.
getResults
()).
gzsc
(
Double
.
valueOf
(
woktimes
)).
build
().
updateById
();
}
else
{
KqglAssoDkjl
mindataone
=
null
;
if
(
minAttid
!=
null
||
maxAttid
!=
null
){
int
status
=
0
,
results
=
0
;
Long
time
=
(
mapucalist
.
get
(
0
).
getDktime
()
-
sbdk1
)/
1000
/
60
;
if
(
time
>
0
){
status
=
3
;
results
=
Integer
.
valueOf
(
time
.
toString
());
}
else
{
status
=
1
;
results
=
0
;
}
KqglAssoDkjl
.
builder
().
id
(
mapucalist
.
get
(
0
).
getId
()).
type
(
1
).
status
(
status
).
results
(
results
).
attime
(
sbdk1
).
bcid
(
banci
.
getId
()).
build
().
updateById
();
mindataone
=
KqglAssoDkjl
.
builder
().
id
(
minAttid
.
getId
()).
build
().
selectById
();
KqglAssoDkmx
.
builder
().
id
(
dkmxid
).
sbdk1
(
mindataone
.
getDktime
()).
sbdk1jg
(
mindataone
.
getResults
()).
ydkcs
(
banci
.
getSxbcs
()*
2
).
gzsc
(
Double
.
valueOf
(
"0"
)).
build
().
updateById
();
}
if
(
maxAttid
!=
null
&&
minAttid
.
getId
()
!=
maxAttid
.
getId
()){
int
status
=
0
,
results
=
0
;
Long
time
=
(
mapucalist
.
get
(
1
).
getDktime
()
-
xbdk1
)/
1000
/
60
;
if
(
time
>
0
){
status
=
1
;
results
=
0
;
}
else
{
status
=
4
;
results
=
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
()));
}
KqglAssoDkjl
.
builder
().
id
(
mapucalist
.
get
(
1
).
getId
()).
type
(
2
).
status
(
status
).
results
(
results
).
attime
(
xbdk1
).
bcid
(
banci
.
getId
()).
sort
(
2
).
build
().
updateById
();
KqglAssoDkjl
maxdata
=
KqglAssoDkjl
.
builder
().
id
(
maxAttid
.
getId
()).
build
().
selectById
();
Long
woktimes
=
(
maxdata
.
getDktime
()
-
mindataone
.
getDktime
())/
1000
/
60
;
KqglAssoDkmx
.
builder
().
id
(
dkmxid
).
xbdk1
(
maxdata
.
getDktime
()).
xbdk1jg
(
maxdata
.
getResults
()).
gzsc
(
Double
.
valueOf
(
woktimes
)).
build
().
updateById
();
}
}
}
else
if
(
banci
.
getSxbcs
()
==
2
){
//修改后一天打四次
if
(
mapucalist
.
size
()
>
4
){
//当天打卡多次
String
[]
str
=
new
String
[
3
];
for
(
int
y
=
0
;
y
<
mapucalist
.
size
();
y
++){
if
(
y
==
0
){
//上班
PunchRecord
mindata
=
punchrecordservice
.
selectByPrimaryKey
(
minAttid
.
getId
());
//上班
PunchRecord
record
=
new
PunchRecord
();
record
.
setId
(
mapucalist
.
get
(
y
).
getId
());
Long
time
=
(
mindata
.
getDktime
()
-
sbdk1
)/
1000
/
60
;
if
(
time
>
0
){
record
.
setStatus
(
3
);
//状态(0:打卡无效:此记录已被更新 1:正常 2:异常 3:迟到 4:早退 5:补卡 6:请假 7:加班 8:调休)
record
.
setResults
(
Integer
.
valueOf
(
time
.
toString
()));
// 打卡结果
}
else
{
record
.
setStatus
(
1
);
record
.
setResults
(
0
);
// 打卡结果
}
record
.
setAttime
(
sbdk1
);
record
.
setBcid
(
banci
.
getId
());
//班次id
punchrecordservice
.
updateByPrimaryKeySelective
(
record
);
}
if
(
y
==
1
||
y
==
2
){
PunchRecord
record
=
new
PunchRecord
();
record
.
setId
(
mapucalist
.
get
(
y
).
getId
());
if
((
mapucalist
.
get
(
y
).
getSort
())%
2
==
0
){
//下班
Long
time
=
(
mapucalist
.
get
(
y
).
getDktime
()
-
xbdk1
)/
1000
/
60
;
if
(
time
>
0
){
record
.
setStatus
(
1
);
record
.
setResults
(
0
);
// 打卡结果
}
else
{
record
.
setStatus
(
4
);
record
.
setResults
(
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
())));
// 打卡结果
}
record
.
setAttime
(
xbdk1
);
//下班应打卡时间
str
[
0
]
=
String
.
valueOf
(
mapucalist
.
get
(
y
).
getId
());
}
else
{
//上班
Long
time
=
(
mapucalist
.
get
(
y
).
getDktime
()
-
sbdk2
)/
1000
/
60
;
if
(
time
>
0
){
record
.
setStatus
(
3
);
record
.
setResults
(
Integer
.
valueOf
(
time
.
toString
()));
// 打卡结果
}
else
{
record
.
setStatus
(
1
);
record
.
setResults
(
0
);
// 打卡结果
}
record
.
setAttime
(
sbdk2
);
//上班应打卡时间
str
[
1
]
=
String
.
valueOf
(
mapucalist
.
get
(
y
).
getId
());
}
record
.
setBcid
(
banci
.
getId
());
//班次id
punchrecordservice
.
updateByPrimaryKeySelective
(
record
);
}
PunchRecord
maxdata
=
punchrecordservice
.
selectByPrimaryKey
(
maxAttid
.
getId
());
//下班
if
(
mapucalist
.
get
(
y
).
getId
()
==
maxdata
.
getId
()){
//下班
PunchRecord
record
=
new
PunchRecord
();
record
.
setId
(
maxdata
.
getId
());
record
.
setType
(
2
);
//下班
Long
time
=
(
maxdata
.
getDktime
()
-
xbdk2
)/
1000
/
60
;
if
(
time
>
0
){
record
.
setStatus
(
1
);
record
.
setResults
(
0
);
// 打卡结果
}
else
{
record
.
setStatus
(
4
);
record
.
setResults
(
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
())));
// 打卡结果
}
record
.
setSort
(
4
);
record
.
setAttime
(
xbdk2
);
record
.
setBcid
(
banci
.
getId
());
//班次id
punchrecordservice
.
updateByPrimaryKeySelective
(
record
);
str
[
2
]
=
String
.
valueOf
(
maxdata
.
getId
());
}
if
(
y
==
3
||
y
>
3
&&
mapucalist
.
get
(
y
).
getId
()
!=
maxdata
.
getId
()){
PunchRecord
record
=
new
PunchRecord
();
record
.
setId
(
mapucalist
.
get
(
y
).
getId
());
record
.
setStatus
(
0
);
//状态(0:打卡无效:此记录已被更新 1:正常 2:异常 3:迟到 4:早退 5:补卡 6:请假 7:加班 8:调休)
record
.
setSort
(
0
);
//序号(0:打卡无效:此记录已被更新)
record
.
setResults
(
0
);
// 打卡结果
record
.
setAttime
(
mapucalist
.
get
(
y
).
getDktime
());
//上班应打卡时间
record
.
setBcid
(
banci
.
getId
());
//班次id
punchrecordservice
.
updateByPrimaryKeySelective
(
record
);
}
}
//修改打卡明细
PunchRecord
mindata
=
punchrecordservice
.
selectByPrimaryKey
(
minAttid
.
getId
());
//上班
PunchCardDetails
record
=
new
PunchCardDetails
();
record
.
setId
(
dkmxid
);
//需修改的明细id
record
.
setSbdk1
(
mindata
.
getDktime
());
record
.
setSbdk1jg
(
mindata
.
getResults
());
// 上班1打卡结果
record
.
setXbdk1
(
null
);
record
.
setXbdk1jg
(
0
);
// 下班1打卡结果
record
.
setSbdk2
(
null
);
record
.
setSbdk2jg
(
0
);
// 上班2打卡结果
record
.
setXbdk2
(
null
);
record
.
setXbdk2jg
(
0
);
// 下班2打卡结果
record
.
setSbdk3
(
null
);
record
.
setSbdk3jg
(
0
);
// 上班3打卡结果
record
.
setXbdk3
(
null
);
record
.
setXbdk3jg
(
0
);
// 下班3打卡结果
record
.
setYdkcs
(
banci
.
getSxbcs
()*
2
);
//应打卡次数
record
.
setGzsc
(
Double
.
valueOf
(
"0"
));
punchcarddetailsservice
.
ModifyPunchDetails
(
record
);
for
(
int
t
=
0
;
t
<
str
.
length
;
t
++){
PunchRecord
dtdkmx
=
punchrecordservice
.
selectByPrimaryKey
(
Integer
.
valueOf
(
str
[
t
]));
//单条打卡明细
PunchCardDetails
dkmx
=
new
PunchCardDetails
();
dkmx
.
setId
(
dkmxid
);
//需修改的明细id
if
(
t
==
0
){
dkmx
.
setXbdk1
(
dtdkmx
.
getDktime
());
dkmx
.
setXbdk1jg
(
dtdkmx
.
getResults
());
// 下班1打卡结果
}
else
if
(
t
==
1
){
dkmx
.
setSbdk2
(
dtdkmx
.
getDktime
());
dkmx
.
setSbdk2jg
(
dtdkmx
.
getResults
());
// 上班2打卡结果
}
else
{
dkmx
.
setXbdk2
(
dtdkmx
.
getDktime
());
dkmx
.
setXbdk2jg
(
dtdkmx
.
getResults
());
// 下班2打卡结果
}
Long
woktimes
=
(
dtdkmx
.
getDktime
()
-
mindata
.
getDktime
())/
1000
/
60
;
dkmx
.
setGzsc
(
Double
.
valueOf
(
woktimes
));
punchcarddetailsservice
.
updateByPrimaryKeySelective
(
dkmx
);
}
}
else
{
//打卡小于4次
PunchRecord
mindataone
=
null
;
if
(
minAttid
!=
null
||
maxAttid
!=
null
){
PunchRecord
record
=
new
PunchRecord
();
record
.
setId
(
mapucalist
.
get
(
0
).
getId
());
//当天一条记录的id
record
.
setType
(
1
);
//上班
Long
time
=
(
mapucalist
.
get
(
0
).
getDktime
()
-
sbdk1
)/
1000
/
60
;
if
(
time
>
0
){
record
.
setStatus
(
3
);
//状态(0:打卡无效:此记录已被更新 1:正常 2:异常 3:迟到 4:早退 5:补卡 6:请假 7:加班 8:调休)
record
.
setResults
(
Integer
.
valueOf
(
time
.
toString
()));
// 打卡结果
}
else
{
record
.
setStatus
(
1
);
record
.
setResults
(
0
);
// 打卡结果
}
record
.
setAttime
(
sbdk1
);
//当天应打卡时间
record
.
setBcid
(
banci
.
getId
());
//班次id
punchrecordservice
.
updateByPrimaryKeySelective
(
record
);
mindataone
=
punchrecordservice
.
selectByPrimaryKey
(
minAttid
.
getId
());
//上班
PunchCardDetails
dan
=
new
PunchCardDetails
();
dan
.
setId
(
dkmxid
);
//需修改的明细id
dan
.
setSbdk1
(
mindataone
.
getDktime
());
dan
.
setSbdk1jg
(
mindataone
.
getResults
());
// 上班1打卡结果
dan
.
setYdkcs
(
banci
.
getSxbcs
()*
2
);
//应打卡次数
dan
.
setGzsc
(
Double
.
valueOf
(
"0"
));
punchcarddetailsservice
.
updateByPrimaryKeySelective
(
dan
);
}
PunchCardDetails
pcd
=
new
PunchCardDetails
();
if
(
mapucalist
.
size
()
>=
2
){
PunchRecord
record
=
new
PunchRecord
();
record
.
setId
(
mapucalist
.
get
(
1
).
getId
());
//当天一条记录的id
record
.
setType
(
2
);
Long
time
=
(
mapucalist
.
get
(
1
).
getDktime
()
-
xbdk1
)/
1000
/
60
;
if
(
time
>
0
){
record
.
setStatus
(
1
);
record
.
setResults
(
0
);
// 打卡结果
}
else
{
record
.
setStatus
(
4
);
record
.
setResults
(
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
())));
// 打卡结果
}
record
.
setAttime
(
xbdk1
);
//当天应打卡时间
record
.
setBcid
(
banci
.
getId
());
//班次id
punchrecordservice
.
updateByPrimaryKeySelective
(
record
);
PunchRecord
dtdkmx
=
punchrecordservice
.
selectByPrimaryKey
(
mapucalist
.
get
(
1
).
getId
());
//单条打卡明细
pcd
.
setXbdk1
(
dtdkmx
.
getDktime
());
pcd
.
setXbdk1jg
(
dtdkmx
.
getResults
());
}
if
(
mapucalist
.
size
()
>=
3
){
PunchRecord
record
=
new
PunchRecord
();
record
.
setId
(
mapucalist
.
get
(
2
).
getId
());
//当天一条记录的id
record
.
setType
(
1
);
Long
time
=
(
mapucalist
.
get
(
2
).
getDktime
()
-
sbdk2
)/
1000
/
60
;
if
(
time
>
0
){
record
.
setStatus
(
3
);
//状态(0:打卡无效:此记录已被更新 1:正常 2:异常 3:迟到 4:早退 5:补卡 6:请假 7:加班 8:调休)
record
.
setResults
(
Integer
.
valueOf
(
time
.
toString
()));
// 打卡结果
}
else
{
record
.
setStatus
(
1
);
record
.
setResults
(
0
);
// 打卡结果
}
record
.
setAttime
(
sbdk2
);
//当天应打卡时间
record
.
setBcid
(
banci
.
getId
());
//班次id
punchrecordservice
.
updateByPrimaryKeySelective
(
record
);
PunchRecord
dtdkmx
=
punchrecordservice
.
selectByPrimaryKey
(
mapucalist
.
get
(
2
).
getId
());
//单条打卡明细
pcd
.
setSbdk2
(
dtdkmx
.
getDktime
());
pcd
.
setSbdk2jg
(
dtdkmx
.
getResults
());
}
if
(
mapucalist
.
size
()
>=
4
){
PunchRecord
record
=
new
PunchRecord
();
record
.
setId
(
maxAttid
.
getId
());
//当天一条记录的id
record
.
setType
(
2
);
Long
time
=
(
maxAttid
.
getDktime
()
-
xbdk2
)/
1000
/
60
;
if
(
time
>
0
){
record
.
setStatus
(
1
);
record
.
setResults
(
0
);
// 打卡结果
}
else
{
record
.
setStatus
(
4
);
record
.
setResults
(
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
())));
// 打卡结果
}
record
.
setAttime
(
xbdk2
);
//当天应打卡时间
record
.
setBcid
(
banci
.
getId
());
//班次id
punchrecordservice
.
updateByPrimaryKeySelective
(
record
);
PunchRecord
dtdkmx
=
punchrecordservice
.
selectByPrimaryKey
(
maxAttid
.
getId
());
//单条打卡明细
pcd
.
setXbdk2
(
dtdkmx
.
getDktime
());
pcd
.
setXbdk2jg
(
dtdkmx
.
getResults
());
}
pcd
.
setId
(
dkmxid
);
punchcarddetailsservice
.
updateByPrimaryKeySelective
(
pcd
);
}
}
else
if
(
banci
.
getSxbcs
()
==
3
){
//修改后一天打六次
if
(
mapucalist
.
size
()
>
6
){
//当天打卡多次
String
[]
str
=
new
String
[
5
];
for
(
int
y
=
0
;
y
<
mapucalist
.
size
();
y
++){
if
(
y
==
0
){
//上班
PunchRecord
mindata
=
punchrecordservice
.
selectByPrimaryKey
(
minAttid
.
getId
());
//上班
PunchRecord
record
=
new
PunchRecord
();
record
.
setId
(
mapucalist
.
get
(
y
).
getId
());
Long
time
=
(
mindata
.
getDktime
()
-
sbdk1
)/
1000
/
60
;
if
(
time
>
0
){
record
.
setStatus
(
3
);
//状态(0:打卡无效:此记录已被更新 1:正常 2:异常 3:迟到 4:早退 5:补卡 6:请假 7:加班 8:调休)
record
.
setResults
(
Integer
.
valueOf
(
time
.
toString
()));
// 打卡结果
}
else
{
record
.
setStatus
(
1
);
record
.
setResults
(
0
);
// 打卡结果
}
record
.
setAttime
(
sbdk1
);
record
.
setBcid
(
banci
.
getId
());
//班次id
punchrecordservice
.
updateByPrimaryKeySelective
(
record
);
}
if
(
y
==
1
||
y
==
2
||
y
==
3
||
y
==
4
){
PunchRecord
record
=
new
PunchRecord
();
record
.
setId
(
mapucalist
.
get
(
y
).
getId
());
if
((
mapucalist
.
get
(
y
).
getSort
())%
2
==
0
){
//下班
if
(
y
==
1
){
Long
time
=
(
mapucalist
.
get
(
y
).
getDktime
()
-
xbdk1
)/
1000
/
60
;
if
(
time
>
0
){
record
.
setStatus
(
1
);
record
.
setResults
(
0
);
// 打卡结果
}
else
{
record
.
setStatus
(
4
);
record
.
setResults
(
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
())));
// 打卡结果
}
record
.
setAttime
(
xbdk1
);
//下班应打卡时间
str
[
0
]
=
String
.
valueOf
(
mapucalist
.
get
(
y
).
getId
());
}
if
(
y
==
3
){
Long
time
=
(
mapucalist
.
get
(
y
).
getDktime
()
-
xbdk2
)/
1000
/
60
;
if
(
time
>
0
){
record
.
setStatus
(
1
);
record
.
setResults
(
0
);
// 打卡结果
}
else
{
record
.
setStatus
(
4
);
record
.
setResults
(
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
())));
// 打卡结果
}
record
.
setAttime
(
xbdk2
);
//下班应打卡时间
str
[
2
]
=
String
.
valueOf
(
mapucalist
.
get
(
y
).
getId
());
}
}
else
{
//上班
if
(
y
==
2
){
Long
time
=
(
mapucalist
.
get
(
y
).
getDktime
()
-
sbdk2
)/
1000
/
60
;
if
(
time
>
0
){
record
.
setStatus
(
3
);
record
.
setResults
(
Integer
.
valueOf
(
time
.
toString
()));
// 打卡结果
}
else
{
record
.
setStatus
(
1
);
record
.
setResults
(
0
);
// 打卡结果
}
record
.
setAttime
(
sbdk2
);
//上班应打卡时间
str
[
1
]
=
String
.
valueOf
(
mapucalist
.
get
(
y
).
getId
());
}
if
(
y
==
4
){
Long
time
=
(
mapucalist
.
get
(
y
).
getDktime
()
-
sbdk3
)/
1000
/
60
;
if
(
time
>
0
){
record
.
setStatus
(
3
);
record
.
setResults
(
Integer
.
valueOf
(
time
.
toString
()));
// 打卡结果
}
else
{
record
.
setStatus
(
1
);
record
.
setResults
(
0
);
// 打卡结果
}
record
.
setAttime
(
sbdk3
);
//上班应打卡时间
str
[
3
]
=
String
.
valueOf
(
mapucalist
.
get
(
y
).
getId
());
}
}
record
.
setBcid
(
banci
.
getId
());
//班次id
punchrecordservice
.
updateByPrimaryKeySelective
(
record
);
}
PunchRecord
maxdata
=
punchrecordservice
.
selectByPrimaryKey
(
maxAttid
.
getId
());
//下班
if
(
mapucalist
.
get
(
y
).
getId
()
==
maxdata
.
getId
()){
//下班
PunchRecord
record
=
new
PunchRecord
();
record
.
setId
(
maxdata
.
getId
());
record
.
setType
(
2
);
//下班
Long
time
=
(
maxdata
.
getDktime
()
-
xbdk3
)/
1000
/
60
;
if
(
time
>
0
){
record
.
setStatus
(
1
);
record
.
setResults
(
0
);
// 打卡结果
}
else
{
record
.
setStatus
(
4
);
record
.
setResults
(
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
())));
// 打卡结果
}
record
.
setSort
(
6
);
record
.
setAttime
(
xbdk3
);
record
.
setBcid
(
banci
.
getId
());
//班次id
punchrecordservice
.
updateByPrimaryKeySelective
(
record
);
str
[
4
]
=
String
.
valueOf
(
maxdata
.
getId
());
}
if
(
y
==
5
||
y
>
5
&&
mapucalist
.
get
(
y
).
getId
()
!=
maxdata
.
getId
()){
PunchRecord
record
=
new
PunchRecord
();
record
.
setId
(
mapucalist
.
get
(
y
).
getId
());
record
.
setStatus
(
0
);
//状态(0:打卡无效:此记录已被更新 1:正常 2:异常 3:迟到 4:早退 5:补卡 6:请假 7:加班 8:调休)
record
.
setSort
(
0
);
//序号(0:打卡无效:此记录已被更新)
record
.
setResults
(
0
);
// 打卡结果
record
.
setAttime
(
mapucalist
.
get
(
y
).
getDktime
());
//上班应打卡时间
record
.
setBcid
(
banci
.
getId
());
//班次id
punchrecordservice
.
updateByPrimaryKeySelective
(
record
);
}
}
//修改打卡明细
PunchRecord
mindata
=
punchrecordservice
.
selectByPrimaryKey
(
minAttid
.
getId
());
//上班
PunchCardDetails
record
=
new
PunchCardDetails
();
record
.
setId
(
dkmxid
);
//需修改的明细id
record
.
setSbdk1
(
mindata
.
getDktime
());
record
.
setSbdk1jg
(
mindata
.
getResults
());
// 上班1打卡结果
record
.
setXbdk1
(
null
);
record
.
setXbdk1jg
(
0
);
// 下班1打卡结果
record
.
setSbdk2
(
null
);
record
.
setSbdk2jg
(
0
);
// 上班2打卡结果
record
.
setXbdk2
(
null
);
record
.
setXbdk2jg
(
0
);
// 下班2打卡结果
record
.
setSbdk3
(
null
);
record
.
setSbdk3jg
(
0
);
// 上班3打卡结果
record
.
setXbdk3
(
null
);
record
.
setXbdk3jg
(
0
);
// 下班3打卡结果
record
.
setYdkcs
(
banci
.
getSxbcs
()*
2
);
//应打卡次数
record
.
setGzsc
(
Double
.
valueOf
(
"0"
));
punchcarddetailsservice
.
ModifyPunchDetails
(
record
);
for
(
int
t
=
0
;
t
<
str
.
length
;
t
++){
PunchRecord
dtdkmx
=
punchrecordservice
.
selectByPrimaryKey
(
Integer
.
valueOf
(
str
[
t
]));
//单条打卡明细
PunchCardDetails
dkmx
=
new
PunchCardDetails
();
dkmx
.
setId
(
dkmxid
);
//需修改的明细id
if
(
t
==
0
){
dkmx
.
setXbdk1
(
dtdkmx
.
getDktime
());
dkmx
.
setXbdk1jg
(
dtdkmx
.
getResults
());
// 下班1打卡结果
}
else
if
(
t
==
1
){
dkmx
.
setSbdk2
(
dtdkmx
.
getDktime
());
dkmx
.
setSbdk2jg
(
dtdkmx
.
getResults
());
// 上班2打卡结果
}
else
if
(
t
==
2
){
dkmx
.
setXbdk2
(
dtdkmx
.
getDktime
());
dkmx
.
setXbdk2jg
(
dtdkmx
.
getResults
());
// 下班2打卡结果
}
else
if
(
t
==
3
){
dkmx
.
setSbdk3
(
dtdkmx
.
getDktime
());
dkmx
.
setSbdk3jg
(
dtdkmx
.
getResults
());
// 上班3打卡结果
}
else
{
dkmx
.
setXbdk3
(
dtdkmx
.
getDktime
());
dkmx
.
setXbdk3jg
(
dtdkmx
.
getResults
());
// 下班3打卡结果
}
Long
woktimes
=
(
dtdkmx
.
getDktime
()
-
mindata
.
getDktime
())/
1000
/
60
;
dkmx
.
setGzsc
(
Double
.
valueOf
(
woktimes
));
punchcarddetailsservice
.
updateByPrimaryKeySelective
(
dkmx
);
}
}
else
{
PunchRecord
mindataone
=
null
;
if
(
minAttid
!=
null
||
maxAttid
!=
null
){
PunchRecord
record
=
new
PunchRecord
();
record
.
setId
(
mapucalist
.
get
(
0
).
getId
());
//当天一条记录的id
record
.
setType
(
1
);
//上班
Long
time
=
(
mapucalist
.
get
(
0
).
getDktime
()
-
sbdk1
)/
1000
/
60
;
if
(
time
>
0
){
record
.
setStatus
(
3
);
//状态(0:打卡无效:此记录已被更新 1:正常 2:异常 3:迟到 4:早退 5:补卡 6:请假 7:加班 8:调休)
record
.
setResults
(
Integer
.
valueOf
(
time
.
toString
()));
// 打卡结果
}
else
{
record
.
setStatus
(
1
);
record
.
setResults
(
0
);
// 打卡结果
}
record
.
setAttime
(
sbdk1
);
//当天应打卡时间
record
.
setBcid
(
banci
.
getId
());
//班次id
punchrecordservice
.
updateByPrimaryKeySelective
(
record
);
mindataone
=
punchrecordservice
.
selectByPrimaryKey
(
minAttid
.
getId
());
//上班
PunchCardDetails
dan
=
new
PunchCardDetails
();
dan
.
setId
(
dkmxid
);
//需修改的明细id
dan
.
setSbdk1
(
mindataone
.
getDktime
());
dan
.
setSbdk1jg
(
mindataone
.
getResults
());
// 上班1打卡结果
dan
.
setYdkcs
(
banci
.
getSxbcs
()*
2
);
//应打卡次数
dan
.
setGzsc
(
Double
.
valueOf
(
"0"
));
punchcarddetailsservice
.
updateByPrimaryKeySelective
(
dan
);
}
PunchCardDetails
pcd
=
new
PunchCardDetails
();
if
(
mapucalist
.
size
()
>=
2
){
PunchRecord
record
=
new
PunchRecord
();
record
.
setId
(
mapucalist
.
get
(
1
).
getId
());
//当天一条记录的id
record
.
setType
(
2
);
Long
time
=
(
mapucalist
.
get
(
1
).
getDktime
()
-
xbdk1
)/
1000
/
60
;
if
(
time
>
0
){
record
.
setStatus
(
1
);
record
.
setResults
(
0
);
// 打卡结果
}
else
{
record
.
setStatus
(
4
);
record
.
setResults
(
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
())));
// 打卡结果
}
record
.
setAttime
(
xbdk1
);
//当天应打卡时间
record
.
setBcid
(
banci
.
getId
());
//班次id
punchrecordservice
.
updateByPrimaryKeySelective
(
record
);
PunchRecord
dtdkmx
=
punchrecordservice
.
selectByPrimaryKey
(
mapucalist
.
get
(
1
).
getId
());
//单条打卡明细
pcd
.
setXbdk1
(
dtdkmx
.
getDktime
());
pcd
.
setXbdk1jg
(
dtdkmx
.
getResults
());
}
if
(
mapucalist
.
size
()
>=
3
){
PunchRecord
record
=
new
PunchRecord
();
record
.
setId
(
mapucalist
.
get
(
2
).
getId
());
//当天一条记录的id
record
.
setType
(
1
);
Long
time
=
(
mapucalist
.
get
(
2
).
getDktime
()
-
sbdk2
)/
1000
/
60
;
if
(
time
>
0
){
record
.
setStatus
(
3
);
//状态(0:打卡无效:此记录已被更新 1:正常 2:异常 3:迟到 4:早退 5:补卡 6:请假 7:加班 8:调休)
record
.
setResults
(
Integer
.
valueOf
(
time
.
toString
()));
// 打卡结果
}
else
{
record
.
setStatus
(
1
);
record
.
setResults
(
0
);
// 打卡结果
}
record
.
setAttime
(
sbdk2
);
//当天应打卡时间
record
.
setBcid
(
banci
.
getId
());
//班次id
punchrecordservice
.
updateByPrimaryKeySelective
(
record
);
PunchRecord
dtdkmx
=
punchrecordservice
.
selectByPrimaryKey
(
mapucalist
.
get
(
2
).
getId
());
//单条打卡明细
pcd
.
setSbdk2
(
dtdkmx
.
getDktime
());
pcd
.
setSbdk2jg
(
dtdkmx
.
getResults
());
}
if
(
mapucalist
.
size
()
>=
4
){
PunchRecord
record
=
new
PunchRecord
();
record
.
setId
(
mapucalist
.
get
(
3
).
getId
());
//当天一条记录的id
record
.
setType
(
1
);
Long
time
=
(
mapucalist
.
get
(
3
).
getDktime
()
-
xbdk2
)/
1000
/
60
;
if
(
time
>
0
){
record
.
setStatus
(
3
);
//状态(0:打卡无效:此记录已被更新 1:正常 2:异常 3:迟到 4:早退 5:补卡 6:请假 7:加班 8:调休)
record
.
setResults
(
Integer
.
valueOf
(
time
.
toString
()));
// 打卡结果
}
else
{
record
.
setStatus
(
1
);
record
.
setResults
(
0
);
// 打卡结果
}
record
.
setAttime
(
xbdk2
);
//当天应打卡时间
record
.
setBcid
(
banci
.
getId
());
//班次id
punchrecordservice
.
updateByPrimaryKeySelective
(
record
);
PunchRecord
dtdkmx
=
punchrecordservice
.
selectByPrimaryKey
(
mapucalist
.
get
(
3
).
getId
());
//单条打卡明细
pcd
.
setXbdk2
(
dtdkmx
.
getDktime
());
pcd
.
setXbdk2jg
(
dtdkmx
.
getResults
());
}
if
(
mapucalist
.
size
()
>=
5
){
PunchRecord
record
=
new
PunchRecord
();
record
.
setId
(
mapucalist
.
get
(
4
).
getId
());
//当天一条记录的id
record
.
setType
(
1
);
Long
time
=
(
mapucalist
.
get
(
4
).
getDktime
()
-
sbdk3
)/
1000
/
60
;
if
(
time
>
0
){
record
.
setStatus
(
3
);
//状态(0:打卡无效:此记录已被更新 1:正常 2:异常 3:迟到 4:早退 5:补卡 6:请假 7:加班 8:调休)
record
.
setResults
(
Integer
.
valueOf
(
time
.
toString
()));
// 打卡结果
}
else
{
record
.
setStatus
(
1
);
record
.
setResults
(
0
);
// 打卡结果
}
record
.
setAttime
(
sbdk3
);
//当天应打卡时间
record
.
setBcid
(
banci
.
getId
());
//班次id
punchrecordservice
.
updateByPrimaryKeySelective
(
record
);
PunchRecord
dtdkmx
=
punchrecordservice
.
selectByPrimaryKey
(
mapucalist
.
get
(
4
).
getId
());
//单条打卡明细
pcd
.
setSbdk3
(
dtdkmx
.
getDktime
());
pcd
.
setSbdk3jg
(
dtdkmx
.
getResults
());
}
if
(
mapucalist
.
size
()
>=
6
){
PunchRecord
record
=
new
PunchRecord
();
record
.
setId
(
maxAttid
.
getId
());
//当天一条记录的id
record
.
setType
(
2
);
Long
time
=
(
maxAttid
.
getDktime
()
-
xbdk3
)/
1000
/
60
;
if
(
time
>
0
){
record
.
setStatus
(
1
);
record
.
setResults
(
0
);
// 打卡结果
}
else
{
record
.
setStatus
(
4
);
record
.
setResults
(
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
())));
// 打卡结果
}
record
.
setAttime
(
xbdk3
);
//当天应打卡时间
record
.
setBcid
(
banci
.
getId
());
//班次id
punchrecordservice
.
updateByPrimaryKeySelective
(
record
);
PunchRecord
dtdkmx
=
punchrecordservice
.
selectByPrimaryKey
(
maxAttid
.
getId
());
//单条打卡明细
pcd
.
setXbdk3
(
dtdkmx
.
getDktime
());
pcd
.
setXbdk3jg
(
dtdkmx
.
getResults
());
}
pcd
.
setId
(
dkmxid
);
punchcarddetailsservice
.
updateByPrimaryKeySelective
(
pcd
);
}
}
}
else
{
////修改后班次为休息的
RestMethod
(
mapucalist
,
dkmxid
);
}
}
}
}
if
(
schlist
.
size
()>
0
){
//删除排班明细表(自由排班)
KqglAssoPbmx
.
builder
().
build
().
delete
(
new
QueryWrapper
<
KqglAssoPbmx
>().
lambda
().
eq
(
KqglAssoPbmx:
:
getKqzid
,
id
));
kqglassopbmxmapper
.
insertKqglAssoPbmxList
(
schlist
);
return
ResultUtil
.
data
(
schlist
,
"修改考勤组排班成功"
);
}
return
ResultUtil
.
error
(
"修改考勤组排班失败"
);
}
/**
* 班次修改调用方法
*/
public
void
RestMethod
(
List
<
KqglAssoDkjl
>
mapucalist
,
int
dkmxid
){
int
q
=
1
;
for
(
KqglAssoDkjl
pres
:
mapucalist
){
int
type
=
0
;
if
(
q
%
2
>
0
){
type
=
1
;}
else
{
type
=
2
;}
KqglAssoDkjl
.
builder
().
id
(
pres
.
getId
()).
results
(
0
).
type
(
type
).
status
(
1
).
sort
(
q
).
attime
(
pres
.
getDktime
()).
bcid
(
0
).
build
().
updateById
();
q
++;
}
if
(
mapucalist
.
size
()
>
0
){
/*******修改打卡明细数据****/
KqglAssoDkmx
pcd
=
KqglAssoDkmx
.
builder
().
build
();
if
(
mapucalist
.
size
()
>=
1
){
pcd
.
setSbdk1
(
mapucalist
.
get
(
0
).
getDktime
());
pcd
.
setSbdk1jg
(
0
);}
if
(
mapucalist
.
size
()
>=
2
){
pcd
.
setXbdk1
(
mapucalist
.
get
(
1
).
getDktime
());
pcd
.
setXbdk1jg
(
0
);}
if
(
mapucalist
.
size
()
>=
3
){
pcd
.
setSbdk2
(
mapucalist
.
get
(
2
).
getDktime
());
pcd
.
setSbdk2jg
(
0
);}
if
(
mapucalist
.
size
()
>=
4
){
pcd
.
setXbdk2
(
mapucalist
.
get
(
3
).
getDktime
());
pcd
.
setXbdk2jg
(
0
);}
if
(
mapucalist
.
size
()
>=
5
){
pcd
.
setSbdk3
(
mapucalist
.
get
(
4
).
getDktime
());
pcd
.
setSbdk3jg
(
0
);}
if
(
mapucalist
.
size
()
>=
6
){
pcd
.
setXbdk3
(
mapucalist
.
get
(
5
).
getDktime
());
pcd
.
setXbdk3jg
(
0
);}
pcd
.
setId
(
dkmxid
);
pcd
.
updateById
();
}
}
@PostMapping
(
value
=
"/leave_balance_list"
)
@ApiOperation
(
value
=
"45:获取修改的排班明细"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
45
)
public
Result
<
Object
>
LeaveBalanceList
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
AttqueryCriteriaDto
attquerycriteriadto
)
{
IPage
<
EmployeeLeaveBalanceDto
>
page
=
new
Page
<
EmployeeLeaveBalanceDto
>(
attquerycriteriadto
.
getCurrentPage
()
==
null
?
1
:
attquerycriteriadto
.
getCurrentPage
(),
attquerycriteriadto
.
getTotalPage
()
==
null
?
10
:
attquerycriteriadto
.
getTotalPage
());
attquerycriteriadto
.
setOrgCode
(
userBean
.
getOrgCode
());
attquerycriteriadto
.
setEmpNum
(
userBean
.
getEmpNum
());
// 缺-部门id 搜索
IPage
<
EmployeeLeaveBalanceDto
>
pageAs
=
kqglassoleavebalancemapper
.
selectPageByQueryLeaveBalance
(
page
,
attquerycriteriadto
);
List
<
EmployeeLeaveBalanceDto
>
listAs
=
pageAs
.
getRecords
();
return
ResultUtil
.
data
(
pageAs
,
listAs
,
"操作成功!"
);
}
/**************************/
/**
* 查询列表-加班补偿方式
*/
...
...
src/main/java/cn/timer/api/controller/qyzx/QyzxController.java
View file @
0cf502e8
...
...
@@ -9,6 +9,7 @@ import javax.servlet.http.HttpSession;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
...
@@ -32,8 +33,10 @@ import cn.timer.api.bean.qyzx.QyzxEntInfoM;
import
cn.timer.api.bean.qyzx.QyzxFeebackAccessory
;
import
cn.timer.api.bean.qyzx.QyzxInvoiceUsual
;
import
cn.timer.api.bean.qyzx.QyzxLogBuy
;
import
cn.timer.api.bean.qyzx.QyzxOperLog
;
import
cn.timer.api.bean.qyzx.QyzxPayServe
;
import
cn.timer.api.bean.qyzx.QyzxSuggestionFeeback
;
import
cn.timer.api.bean.spmk.SpmkApproveSummary
;
import
cn.timer.api.bean.zzgl.ZzglAuth
;
import
cn.timer.api.bean.zzgl.ZzglBmgwM
;
import
cn.timer.api.config.annotation.CurrentUser
;
...
...
@@ -46,6 +49,7 @@ import cn.timer.api.dao.qyzx.QyzxEntInfoMMapper;
import
cn.timer.api.dao.qyzx.QyzxFeebackAccessoryMapper
;
import
cn.timer.api.dao.qyzx.QyzxInvoiceUsualMapper
;
import
cn.timer.api.dao.qyzx.QyzxLogBuyMapper
;
import
cn.timer.api.dao.qyzx.QyzxOperLogMapper
;
import
cn.timer.api.dao.qyzx.QyzxPayServeMapper
;
import
cn.timer.api.dao.qyzx.QyzxSuggestionFeebackMapper
;
import
cn.timer.api.dao.zzgl.ZzglBmgwMMapper
;
...
...
@@ -55,6 +59,7 @@ import cn.timer.api.dto.qyzx.AttaFpglQueryDto;
import
cn.timer.api.dto.qyzx.EntauthDto
;
import
cn.timer.api.dto.qyzx.FeebackDto
;
import
cn.timer.api.dto.qyzx.LogBuyDto
;
import
cn.timer.api.dto.qyzx.QyzxOperLogQuaryDto
;
import
cn.timer.api.utils.Result
;
import
cn.timer.api.utils.ResultUtil
;
import
cn.timer.api.utils.aliyun.OSSUtil
;
...
...
@@ -65,9 +70,6 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
@RestController
@Api
(
tags
=
"4.0企业中心"
)
// @RequestMapping(value = "/qyzx", produces = { "application/json",
// "multipart/form-data", "form-data" }, consumes = { "application/json",
// "multipart/form-data" })
@RequestMapping
(
value
=
"/qyzx"
,
produces
=
{
"application/json"
})
public
class
QyzxController
{
@Autowired
...
...
@@ -325,11 +327,8 @@ public class QyzxController {
wp
.
select
(
ZzglAuth:
:
getMenuId
).
eq
(
ZzglAuth:
:
getOrgCode
,
ctrl
.
getId
())
.
and
(
i
->
i
.
in
(
ZzglAuth:
:
getBmgwId
,
list
.
toArray
()));
List
<
ZzglAuth
>
zas
=
ZzglAuth
.
builder
().
build
().
selectList
(
wp
);
if
(
zas
.
size
()
==
0
)
return
ResultUtil
.
error
(
null
,
"切换企业失败,在该公司没有权限"
);
if
(
zas
!=
null
&&
zas
.
size
()
!=
0
)
zas
.
stream
().
forEach
(
o
->
menus
.
add
(
o
.
getMenuId
()));
}
else
{
return
ResultUtil
.
error
(
null
,
"切换企业失败,在该公司没有权限"
);
}
}
emp
.
setOrgId
(
orgCode
);
...
...
@@ -515,4 +514,43 @@ public class QyzxController {
return
ResultUtil
.
data
(
page1
,
qyzxEmpEntAssoMapper
.
adminlist
(
page1
,
userBean
.
getOrgCode
()),
"获取账号"
);
}
@Autowired
private
QyzxOperLogMapper
qyzxOperLogMapper
;
/**
* 查询-操作日志
*
* @param
* @return
*/
@PostMapping
(
value
=
"/select_oper_log"
)
@ApiOperation
(
value
=
"查询-操作日志"
,
httpMethod
=
"POST"
,
notes
=
"查询-操作日志"
)
public
Result
<
Object
>
selectOperLog
(
@CurrentUser
UserBean
userBean
,
@RequestBody
QyzxOperLogQuaryDto
qyzxOperLogQuaryDto
)
{
IPage
<
QyzxOperLog
>
page
=
new
Page
<
QyzxOperLog
>(
qyzxOperLogQuaryDto
.
getCurrentPage
()
==
null
?
1
:
qyzxOperLogQuaryDto
.
getCurrentPage
(),
qyzxOperLogQuaryDto
.
getTotalPage
()
==
null
?
10
:
qyzxOperLogQuaryDto
.
getTotalPage
());
qyzxOperLogQuaryDto
.
setOrgCode
(
userBean
.
getOrgCode
());
IPage
<
QyzxOperLog
>
pages
=
qyzxOperLogMapper
.
selectPageByQuery
(
page
,
qyzxOperLogQuaryDto
);
List
<
QyzxOperLog
>
listOl
=
pages
.
getRecords
();
return
ResultUtil
.
data
(
pages
,
listOl
,
"操作成功!"
);
}
/**
* 删除-操作日志
*
* @param
* @return
*/
@DeleteMapping
(
value
=
"/delete_oper_log"
)
@ApiOperation
(
value
=
"删除-操作日志"
,
httpMethod
=
"DELETE"
,
notes
=
"查询-操作日志"
)
public
Result
<
Object
>
deleteOperLog
(
@CurrentUser
UserBean
userBean
,
@RequestBody
Integer
[]
ids
)
{
ArrayList
<
Integer
>
list
=
CollUtil
.
toList
(
ids
);
int
delCount
=
qyzxOperLogMapper
.
deleteBatchIds
(
list
);
return
ResultUtil
.
data
(
delCount
,
"操作成功!"
);
}
}
src/main/java/cn/timer/api/controller/qyzx/service/QyzxOperLogService.java
0 → 100644
View file @
0cf502e8
package
cn
.
timer
.
api
.
controller
.
qyzx
.
service
;
import
java.util.List
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
cn.timer.api.bean.qyzx.QyzxOperLog
;
import
cn.timer.api.dto.qyzx.QyzxOperLogQuaryDto
;
/**
* 操作日志 服务层
*
* @author ruoyi
*/
public
interface
QyzxOperLogService
{
/**
* 新增操作日志
*
* @param operLog 操作日志对象
*/
public
void
insertOperlog
(
QyzxOperLog
operLog
);
/**
* 查询系统操作日志集合
*
* @param operLog 操作日志对象
* @return 操作日志集合
*/
public
IPage
<
QyzxOperLog
>
selectPageByQuery
(
IPage
<
QyzxOperLog
>
page
,
QyzxOperLogQuaryDto
operLog
);
/**
* 批量删除系统操作日志
*
* @param operIds 需要删除的操作日志ID
* @return 结果
*/
public
int
deleteOperLogByIds
(
List
<
QyzxOperLog
>
idList
);
/**
* 查询操作日志详细
*
* @param operId 操作ID
* @return 操作日志对象
*/
public
QyzxOperLog
selectOperLogById
(
Long
operId
);
/**
* 清空操作日志
*/
public
void
cleanOperLog
();
}
src/main/java/cn/timer/api/controller/qyzx/service/QyzxOperLogServiceImpl.java
0 → 100644
View file @
0cf502e8
package
cn
.
timer
.
api
.
controller
.
qyzx
.
service
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
cn.timer.api.bean.qyzx.QyzxOperLog
;
import
cn.timer.api.dao.qyzx.QyzxOperLogMapper
;
import
cn.timer.api.dto.qyzx.QyzxOperLogQuaryDto
;
/**
* 操作日志 服务层处理
*
* @author Tang
*/
@Service
public
class
QyzxOperLogServiceImpl
implements
QyzxOperLogService
{
@Autowired
private
QyzxOperLogMapper
operLogMapper
;
/**
* 新增操作日志
*
* @param operLog 操作日志对象
*/
@Override
public
void
insertOperlog
(
QyzxOperLog
operLog
)
{
operLogMapper
.
insert
(
operLog
);
}
/**
* 查询系统操作日志集合
*
* @param operLog 操作日志对象
* @return 操作日志集合
*/
@Override
public
IPage
<
QyzxOperLog
>
selectPageByQuery
(
IPage
<
QyzxOperLog
>
page
,
QyzxOperLogQuaryDto
operLog
)
{
return
operLogMapper
.
selectPageByQuery
(
page
,
operLog
);
}
/**
* 批量删除系统操作日志
*
* @param operIds 需要删除的操作日志ID
* @return 结果
*/
public
int
deleteOperLogByIds
(
List
<
QyzxOperLog
>
idList
)
{
return
operLogMapper
.
deleteBatchIds
(
idList
);
}
/**
* 查询操作日志详细
*
* @param operId 操作ID
* @return 操作日志对象
*/
@Override
public
QyzxOperLog
selectOperLogById
(
Long
operId
)
{
return
operLogMapper
.
selectById
(
operId
);
}
/**
* 清空操作日志
*/
@Override
public
void
cleanOperLog
()
{
operLogMapper
.
delete
(
null
);
}
}
src/main/java/cn/timer/api/controller/spmk/SpmkController.java
View file @
0cf502e8
...
...
@@ -4,11 +4,8 @@ import java.util.ArrayList;
import
java.util.Date
;
import
java.util.List
;
import
javax.validation.Valid
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.MethodArgumentNotValidException
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
...
...
@@ -21,8 +18,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.alibaba.druid.sql.visitor.functions.Nil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.github.xiaoymin.knife4j.annotations.ApiOperationSupport
;
...
...
@@ -32,6 +31,8 @@ import cn.hutool.core.lang.Console;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONObject
;
import
cn.timer.api.aspect.lang.annotation.Log
;
import
cn.timer.api.aspect.lang.enums.BusinessType
;
import
cn.timer.api.bean.spmk.SpmkApprovalG
;
import
cn.timer.api.bean.spmk.SpmkApprovalTemplate
;
import
cn.timer.api.bean.spmk.SpmkApprovalTemplateG
;
...
...
@@ -45,6 +46,8 @@ import cn.timer.api.bean.spmk.SpmkInitiatorConfig;
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.config.enuminterface.SpmkEnumInterface
;
import
cn.timer.api.config.enuminterface.SpmkEnumInterface.ExecutorSts
;
import
cn.timer.api.config.exception.CustomException
;
import
cn.timer.api.controller.spmk.service.SpmkServiceImpl
;
import
cn.timer.api.controller.zzgl.service.ZzglBmgwMService
;
...
...
@@ -118,6 +121,12 @@ public class SpmkController {
@ApiOperationSupport
(
order
=
1
)
public
Result
<
Object
>
saveAtg
(
@RequestBody
SpmkApprovalTemplateG
spmkApprovalTemplateG
){
if
(
spmkApprovalTemplateG
.
selectCount
(
new
QueryWrapper
<
SpmkApprovalTemplateG
>().
lambda
()
.
ne
(
SpmkApprovalTemplateG:
:
getId
,
spmkApprovalTemplateG
.
getId
())
.
eq
(
SpmkApprovalTemplateG:
:
getName
,
spmkApprovalTemplateG
.
getName
()))
>
0
)
{
return
ResultUtil
.
error
(
"审批模板组名重复!"
);
}
return
spmkApprovalTemplateG
.
insertOrUpdate
()
?
ResultUtil
.
data
(
spmkApprovalTemplateG
,
"操作成功!"
)
:
ResultUtil
.
error
(
"操作失败!"
);
...
...
@@ -170,6 +179,7 @@ public class SpmkController {
@ApiOperation
(
value
=
"5.新增或编辑-审批模板"
,
httpMethod
=
"POST"
,
notes
=
"新增或编辑-审批模板"
)
@ApiOperationSupport
(
order
=
5
)
public
Result
<
Object
>
saveAt
(
@Validated
@RequestBody
SpmkApprovalTemplateDto
spmkApprovalTemplateDto
){
Integer
approvalTemplateGId
=
spmkApprovalTemplateDto
.
getApprovalTemplateGId
();
if
(
ObjectUtil
.
isNull
(
approvalTemplateGId
))
return
ResultUtil
.
error
(
"操作失败!-1"
);
...
...
@@ -182,6 +192,12 @@ public class SpmkController {
at
.
setFroms
(
ObjectUtil
.
serialize
((
List
<
JSONObject
>)
spmkApprovalTemplateDto
.
getFroms
()));
at
.
setRouter
(
ObjectUtil
.
serialize
(
spmkApprovalTemplateDto
.
getRouter
()));
if
(
at
.
selectCount
(
new
QueryWrapper
<
SpmkApprovalTemplate
>().
lambda
()
.
ne
(
SpmkApprovalTemplate:
:
getId
,
at
.
getId
())
.
eq
(
SpmkApprovalTemplate:
:
getName
,
at
.
getName
()))
>
0
)
{
return
ResultUtil
.
error
(
"审批模板名重复!"
);
}
if
(!
at
.
insertOrUpdate
())
return
ResultUtil
.
error
(
"操作失败!-2"
);
...
...
@@ -243,6 +259,14 @@ public class SpmkController {
@ApiOperation
(
value
=
"9.新增或编辑-审批组"
,
httpMethod
=
"POST"
,
notes
=
"新增或编辑-审批组"
)
@ApiOperationSupport
(
order
=
9
)
public
Result
<
Object
>
saveAg
(
@CurrentUser
UserBean
userBean
,
@RequestBody
SpmkApprovalG
spmkApprovalG
){
if
(
spmkApprovalG
.
selectCount
(
new
QueryWrapper
<
SpmkApprovalG
>().
lambda
()
.
ne
(
SpmkApprovalG:
:
getId
,
spmkApprovalG
.
getId
())
.
eq
(
SpmkApprovalG:
:
getName
,
spmkApprovalG
.
getName
())
.
eq
(
SpmkApprovalG:
:
getOrgCode
,
userBean
.
getOrgCode
()))
>
0
)
{
return
ResultUtil
.
error
(
"审批组名重复!"
);
}
spmkApprovalG
.
setOrgCode
(
userBean
.
getOrgCode
());
return
spmkApprovalG
.
insertOrUpdate
()
?
ResultUtil
.
data
(
spmkApprovalG
,
"操作成功!"
)
:
ResultUtil
.
error
(
"操作失败!"
);
...
...
@@ -310,7 +334,7 @@ public class SpmkController {
@ApiOperation
(
value
=
"13.新增或编辑-自定义审批"
,
httpMethod
=
"POST"
,
notes
=
"新增或编辑-自定义审批"
)
@ApiOperationSupport
(
order
=
13
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Result
<
Object
>
saveCa
(
@RequestBody
SpmkCustomApprovalDto
spmkCustomApprovalDto
)
throws
Exception
{
public
Result
<
Object
>
saveCa
(
@
CurrentUser
UserBean
userBean
,
@
RequestBody
SpmkCustomApprovalDto
spmkCustomApprovalDto
)
throws
Exception
{
Integer
approvalGId
=
spmkCustomApprovalDto
.
getApprovalGId
();
if
(
ObjectUtil
.
isNull
(
approvalGId
))
return
ResultUtil
.
error
(
"操作失败!-1"
);
...
...
@@ -318,6 +342,14 @@ public class SpmkController {
SpmkCustomApproval
ca
=
SpmkCustomApproval
.
builder
().
build
();
BeanUtil
.
copyProperties
(
spmkCustomApprovalDto
,
ca
,
"froms"
,
"router"
,
"initiatorConfigs"
);
if
(
ca
.
selectCount
(
new
QueryWrapper
<
SpmkCustomApproval
>().
lambda
()
.
ne
(
SpmkCustomApproval:
:
getId
,
ca
.
getId
())
.
eq
(
SpmkCustomApproval:
:
getName
,
ca
.
getName
())
.
eq
(
SpmkCustomApproval:
:
getOrgCode
,
userBean
.
getOrgCode
()))
>
0
)
{
return
ResultUtil
.
error
(
"自定义审批名重复!"
);
}
ca
.
setFroms
(
ObjectUtil
.
serialize
(
spmkCustomApprovalDto
.
getFroms
()));
ca
.
setRouter
(
ObjectUtil
.
serialize
(
spmkCustomApprovalDto
.
getRouter
()));
...
...
@@ -417,6 +449,7 @@ public class SpmkController {
@ApiOperation
(
value
=
"17.发起审批"
,
httpMethod
=
"POST"
,
notes
=
"发起审批"
)
@ApiOperationSupport
(
order
=
17
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Log
(
title
=
"审批-发起审批"
,
businessType
=
BusinessType
.
INSERT
)
public
Result
<
Object
>
saveCa
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
SpmkApproveSummaryDto
spmkApproveSummaryDto
)
throws
Exception
{
YgglMainEmp
ygglMainEmp
=
YgglMainEmp
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
YgglMainEmp
>()
.
lambda
()
...
...
@@ -484,6 +517,7 @@ public class SpmkController {
@PostMapping
(
value
=
"/select_approve_summary"
)
@ApiOperation
(
value
=
"18.审批汇总"
,
httpMethod
=
"POST"
,
notes
=
"审批汇总"
)
@ApiOperationSupport
(
order
=
18
)
@Log
(
title
=
"审批-审批汇总"
,
businessType
=
BusinessType
.
OTHER
)
public
Result
<
Object
>
selectAs
(
@CurrentUser
UserBean
userBean
,
@RequestBody
SummaryQueryDto
summaryQueryDto
)
{
IPage
<
SpmkApproveSummary
>
page
=
new
Page
<
SpmkApproveSummary
>(
...
...
@@ -519,6 +553,7 @@ public class SpmkController {
@GetMapping
(
value
=
"/select_approve_detail/{id}"
)
@ApiOperation
(
value
=
"19.审批详情"
,
httpMethod
=
"GET"
,
notes
=
"审批详情"
)
@ApiOperationSupport
(
order
=
19
)
@Log
(
title
=
"审批-审批详情"
,
businessType
=
BusinessType
.
OTHER
)
public
Result
<
Object
>
selectAd
(
@PathVariable
(
required
=
true
)
Integer
id
)
{
SpmkApproveDetail
ad
=
spmkApproveDetailMapper
.
selectOne
(
new
QueryWrapper
<
SpmkApproveDetail
>().
lambda
().
eq
(
SpmkApproveDetail:
:
getApproveSummaryId
,
id
));
...
...
@@ -545,8 +580,10 @@ public class SpmkController {
@ApiOperation
(
value
=
"20.审批人审批"
,
httpMethod
=
"POST"
,
notes
=
"审批人审批"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
@ApiOperationSupport
(
order
=
20
)
@Log
(
title
=
"审批-审批流程"
,
businessType
=
BusinessType
.
UPDATE
)
// @BindingResultCtrol(title = "审批人审批")
public
Result
<
Object
>
approving
(
@Validated
@RequestBody
ApprovingDto
approvingDto
)
throws
Exception
{
public
Result
<
Object
>
approving
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
ApprovingDto
approvingDto
)
throws
Exception
{
SpmkApproveDetail
ad
=
SpmkApproveDetail
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
SpmkApproveDetail
>()
.
lambda
()
.
select
(
SpmkApproveDetail:
:
getId
,
...
...
@@ -559,6 +596,8 @@ public class SpmkController {
.
select
(
SpmkApproveSummary:
:
getSts
)
.
eq
(
SpmkApproveSummary:
:
getId
,
approvingDto
.
getAsId
()));
if
(
aSummary
.
getSts
()
==
1
||
aSummary
.
getSts
()
==
2
||
aSummary
.
getSts
()
==
3
)
{
return
ResultUtil
.
error
(
"该审批已结束!"
);
}
...
...
@@ -566,12 +605,20 @@ public class SpmkController {
// 查询该 审批的状态 是否为 1 审批中
Integer
count
=
SpmkExecutor
.
builder
().
build
().
selectCount
(
new
QueryWrapper
<
SpmkExecutor
>().
lambda
()
.
eq
(
SpmkExecutor:
:
getId
,
approvingDto
.
getExecutorId
())
.
eq
(
SpmkExecutor:
:
getSts
,
"1"
));
.
eq
(
SpmkExecutor:
:
getSts
,
ExecutorSts
.
IN_EXECUTION
.
ordinal
()
));
if
(
count
==
0
)
{
return
ResultUtil
.
error
(
"您已审批过!"
);
}
if
(
spmkExecutorMapper
.
selectCount
(
new
QueryWrapper
<
SpmkExecutor
>().
lambda
()
.
eq
(
SpmkExecutor:
:
getId
,
approvingDto
.
getExecutorId
())
.
eq
(
SpmkExecutor:
:
getEmpNum
,
userBean
.
getEmpNum
())
.
eq
(
SpmkExecutor:
:
getSts
,
SpmkEnumInterface
.
ExecutorSts
.
IN_EXECUTION
.
ordinal
()))
==
0
)
{
return
ResultUtil
.
error
(
"非当前审批人,无法审批!"
);
}
if
(
aSummary
.
getSts
()
==
0
)
{
List
<
FlowChildren
>
listFlowChildren
=
ObjectUtil
.
deserialize
(
ad
.
getFlowChildren
());
RouterUtils
.
approving
(
...
...
@@ -593,8 +640,9 @@ public class SpmkController {
aSummary
=
spmkApproveSummaryMapper
.
selectOne
(
new
QueryWrapper
<
SpmkApproveSummary
>().
lambda
()
.
select
(
SpmkApproveSummary:
:
getSts
,
SpmkApproveSummary:
:
getAssoType
)
.
eq
(
SpmkApproveSummary:
:
getId
,
approvingDto
.
getAsId
()));
if
(
aSummary
.
getSts
()
!=
3
)
{
SpmkApproveSummary
.
builder
().
id
(
approvingDto
.
getAsId
()).
endTime
(
new
Date
()).
sts
(
2
).
build
().
updateById
();
SpmkApproveSummary
.
builder
().
id
(
approvingDto
.
getAsId
()).
currentApprover
(
""
).
endTime
(
new
Date
()).
sts
(
2
).
build
().
updateById
();
//审批完成后 业务
SpmkAssoBusiness
sab
=
SpmkAssoBusinessFactory
.
createSpmkAssoType
(
ApproveEnum
.
getEnums
(
aSummary
.
getAssoType
()));
...
...
@@ -611,11 +659,12 @@ public class SpmkController {
//TODO 我审批的/抄送我的
/**
* 查询列表-我审批的/抄送我的-分页
* 查询列表-我
发起的/我
审批的/抄送我的-分页
*/
@PostMapping
(
value
=
"/select_my_approve"
)
@ApiOperation
(
value
=
"21.查询列表-我审批的/抄送我的-分页"
,
httpMethod
=
"POST"
,
notes
=
"查询列表-我审批的-关键字、审批状态、发起时间-分页"
)
@ApiOperation
(
value
=
"21.查询列表-我
发起的/我
审批的/抄送我的-分页"
,
httpMethod
=
"POST"
,
notes
=
"查询列表-我审批的-关键字、审批状态、发起时间-分页"
)
@ApiOperationSupport
(
order
=
21
)
@Log
(
title
=
"审批-我发起的/我审批的/抄送我的"
,
businessType
=
BusinessType
.
OTHER
)
public
Result
<
Object
>
selectMyAs
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
MySummaryQueryDto
mySummaryQueryDto
)
throws
MethodArgumentNotValidException
{
IPage
<
SpmkApproveSummary
>
page
=
new
Page
<
SpmkApproveSummary
>(
mySummaryQueryDto
.
getCurrentPage
()
==
null
?
1
:
mySummaryQueryDto
.
getCurrentPage
(),
...
...
@@ -637,6 +686,7 @@ public class SpmkController {
@ApiOperation
(
value
=
"22.撤销审批"
,
httpMethod
=
"PUT"
,
notes
=
"撤销审批"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
@ApiOperationSupport
(
order
=
22
)
@Log
(
title
=
"审批-撤销审批"
,
businessType
=
BusinessType
.
UPDATE
)
public
Result
<
Object
>
revokeApproval
(
@PathVariable
Integer
id
)
throws
Exception
{
SpmkApproveSummary
as
=
spmkApproveSummaryMapper
.
selectOne
(
new
QueryWrapper
<
SpmkApproveSummary
>()
...
...
@@ -645,7 +695,7 @@ public class SpmkController {
.
eq
(
SpmkApproveSummary:
:
getId
,
id
));
return
as
!=
null
&&
as
.
getSts
()
!=
2
?
(
SpmkApproveSummary
.
builder
().
id
(
id
).
endTime
(
new
Date
()).
sts
(
1
).
build
().
updateById
()
?
ResultUtil
.
success
(
"操作成功!"
)
:
ResultUtil
.
error
(
"操作失败_1!"
))
:
ResultUtil
.
error
(
"
操作失败_2
!"
);
ResultUtil
.
success
(
"操作成功!"
)
:
ResultUtil
.
error
(
"操作失败_1!"
))
:
ResultUtil
.
error
(
"
审批已结束,无法撤销
!"
);
}
/**
...
...
@@ -654,6 +704,7 @@ public class SpmkController {
@DeleteMapping
(
value
=
"/delete_approval/{id}"
)
@ApiOperation
(
value
=
"23.删除-审批(发起的审批)-根据审批汇总id"
,
httpMethod
=
"DELETE"
,
notes
=
"删除-审批(发起的审批)-根据审批汇总id"
)
@ApiOperationSupport
(
order
=
23
)
@Log
(
title
=
"审批-删除审批"
,
businessType
=
BusinessType
.
DELETE
)
public
Result
<
Object
>
deleteApprovalData
(
@PathVariable
Integer
id
){
List
<
SpmkApproveExecuteRecord
>
listAer
=
spmkApproveExecuteRecordMapper
.
selectList
(
new
QueryWrapper
<
SpmkApproveExecuteRecord
>()
.
lambda
()
...
...
src/main/java/cn/timer/api/controller/yggl/YgglController.java
View file @
0cf502e8
...
...
@@ -22,7 +22,9 @@ import java.util.stream.Collectors;
import
javax.transaction.Transactional
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
...
...
@@ -50,6 +52,8 @@ import cn.hutool.core.lang.tree.Tree;
import
cn.hutool.core.lang.tree.TreeNodeConfig
;
import
cn.hutool.core.lang.tree.TreeUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONUtil
;
import
cn.timer.api.bean.clazz.CommonArea
;
import
cn.timer.api.bean.clazz.SysRegion
;
import
cn.timer.api.bean.qyzx.QyzxEmpEntAsso
;
...
...
@@ -113,10 +117,13 @@ import io.swagger.annotations.ApiOperation;
*/
@Api
(
tags
=
"3.员工管理"
)
@RestController
@Transactional
@Transactional
(
rollbackOn
=
Exception
.
class
)
@RequestMapping
(
value
=
"/yggl"
,
produces
=
{
"application/json"
})
public
class
YgglController
{
@Value
(
value
=
"${config-8timer.init-password}"
)
private
String
pwd
;
@Autowired
private
YgglMainEmpMapper
ygglMainEmpMapper
;
...
...
@@ -160,17 +167,19 @@ public class YgglController {
.
eq
(
YgglMainEmp:
:
getEmpNum
,
empNum
).
eq
(
YgglMainEmp:
:
getOrgCode
,
orgCode
).
one
();
if
(
ygglMainEmp
!=
null
)
{
Integer
gw
=
ygglMainEmp
.
getBmgwId
();
ZzglBmgwM
gwObj
=
new
LambdaQueryChainWrapper
<
ZzglBmgwM
>(
zzglBmgwMMapper
)
.
select
(
ZzglBmgwM:
:
getUpId
,
ZzglBmgwM:
:
getName
).
eq
(
ZzglBmgwM:
:
getId
,
gw
)
.
eq
(
ZzglBmgwM:
:
getOrgCode
,
orgCode
).
one
();
ZzglBmgwM
bmObj
=
new
LambdaQueryChainWrapper
<
ZzglBmgwM
>(
zzglBmgwMMapper
)
.
select
(
ZzglBmgwM:
:
getId
,
ZzglBmgwM:
:
getName
).
eq
(
ZzglBmgwM:
:
getId
,
gwObj
.
getUpId
())
.
eq
(
ZzglBmgwM:
:
getOrgCode
,
orgCode
).
one
();
loginInfo
.
setEmpNum
(
ygglMainEmp
.
getEmpNum
());
loginInfo
.
setName
(
ygglMainEmp
.
getName
());
ZzglBmgwM
gwObj
=
new
LambdaQueryChainWrapper
<
ZzglBmgwM
>(
zzglBmgwMMapper
).
select
(
ZzglBmgwM:
:
getUpId
,
ZzglBmgwM:
:
getName
)
.
eq
(
ZzglBmgwM:
:
getId
,
gw
).
eq
(
ZzglBmgwM:
:
getOrgCode
,
orgCode
).
one
();
if
(
gwObj
!=
null
)
{
ZzglBmgwM
bmObj
=
new
LambdaQueryChainWrapper
<
ZzglBmgwM
>(
zzglBmgwMMapper
).
select
(
ZzglBmgwM:
:
getId
,
ZzglBmgwM:
:
getName
)
.
eq
(
ZzglBmgwM:
:
getId
,
gwObj
.
getUpId
()).
eq
(
ZzglBmgwM:
:
getOrgCode
,
orgCode
).
one
();
loginInfo
.
setBmId
(
bmObj
!=
null
?
bmObj
.
getId
()
:
null
);
loginInfo
.
setBmName
(
bmObj
!=
null
?
bmObj
.
getName
()
:
null
);
}
loginInfo
.
setEmpNum
(
ygglMainEmp
.
getEmpNum
());
loginInfo
.
setName
(
ygglMainEmp
.
getName
());
loginInfo
.
setGwId
(
gw
);
loginInfo
.
setGwName
(
gwObj
!=
null
?
gwObj
.
getName
()
:
""
);
loginInfo
.
setEntryTime
(
ygglMainEmp
.
getRzTime
());
...
...
@@ -329,8 +338,6 @@ public class YgglController {
gw
=
zzglBmgwM
.
getName
();
bmid
=
zzglBmgwM
.
getUpId
();
}
// QueryWrapper<ZzglBmgwM> queryWrapper1 = new QueryWrapper<>();
// queryWrapper1.eq("org_code", orgCode).eq("up_dept_id", gwid);
ZzglBmgwM
z
=
ZzglBmgwM
.
builder
().
build
()
.
selectOne
(
new
QueryWrapper
<
ZzglBmgwM
>().
eq
(
"org_code"
,
orgCode
).
eq
(
"id"
,
bmid
));
String
bm
=
null
;
...
...
@@ -342,22 +349,21 @@ public class YgglController {
}
/**
* 添加员工档案
(weng)
*
* @param
* 添加员工档案
*
@param userBean
* @param
addygdaDto
* @return
*/
@PostMapping
(
value
=
"/addygda"
)
@ApiOperation
(
value
=
"添加员工档案"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
4
)
public
Result
<
Object
>
addygda
(
@CurrentUser
UserBean
userBean
,
@RequestBody
AddygdaDto
addygdaDto
)
{
public
Result
<
Object
>
addygda
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
AddygdaDto
addygdaDto
)
throws
Exception
{
Integer
orgCode
=
userBean
.
getOrgCode
();
String
name
=
addygdaDto
.
getName
();
String
phone
=
addygdaDto
.
getPhone
();
Integer
zjType
=
addygdaDto
.
getZjType
();
String
zjNum
=
addygdaDto
.
getZjNum
();
Integer
jobType
=
addygdaDto
.
getJobType
();
// Date rzTime = addygdaDto.getRzTime();// ?????????????为什么新添加员工不给默认入职日期?????????????????????????
Date
rzTime
=
new
Date
();
Integer
syq
=
addygdaDto
.
getSyq
();
Integer
sex
=
addygdaDto
.
getSex
();
...
...
@@ -367,7 +373,8 @@ public class YgglController {
QyzxEmpLogin
login
=
new
LambdaQueryChainWrapper
<
QyzxEmpLogin
>(
qyzxEmpLoginMapper
)
.
eq
(!
StrUtil
.
hasBlank
(
phone
),
QyzxEmpLogin:
:
getPhone
,
phone
).
one
();
if
(
login
==
null
)
{
QyzxEmpLogin
qyzxEmpLogin
=
QyzxEmpLogin
.
builder
().
phone
(
phone
).
pw
(
Md5
.
md5
(
"123456"
))
// 初始化密码 pwd
QyzxEmpLogin
qyzxEmpLogin
=
QyzxEmpLogin
.
builder
().
phone
(
phone
).
pw
(
Md5
.
md5
(
pwd
))
.
sts
(
CommonEnum
.
U_STS_ON
.
getType
()).
orgId
(
userBean
.
getOrgCode
()).
username
(
name
).
build
();
if
(!
qyzxEmpLogin
.
insert
())
{
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
...
...
@@ -376,38 +383,72 @@ public class YgglController {
// 添加三张表
// 员工权限表(未定)
// 员工企业关联表和员工档案,员工成长表(未定)
QyzxEmpEntAsso
.
builder
().
empNum
(
qyzxEmpLogin
.
getId
()).
orgCode
(
orgCode
)
.
userType
(
CommonEnum
.
U_TYPE_EMP
.
getType
()).
status
(
1
).
build
().
insert
();
// usertype2普通员工 status1正常
YgglMainEmp
ygglMainEmp
=
YgglMainEmp
.
builder
().
name
(
name
).
phone
(
phone
).
zjType
(
zjType
).
zjNum
(
zjNum
)
.
jobType
(
jobType
).
rzTime
(
rzTime
).
syq
(
syq
).
sex
(
sex
).
empNum
(
qyzxEmpLogin
.
getId
()).
orgCode
(
orgCode
)
QyzxEmpEntAsso
.
builder
()
.
empNum
(
qyzxEmpLogin
.
getId
())
.
orgCode
(
orgCode
)
.
userType
(
CommonEnum
.
U_TYPE_EMP
.
getType
())
.
status
(
1
)
.
build
()
.
insert
();
// usertype2普通员工 status1正常
YgglMainEmp
ygglMainEmp
=
YgglMainEmp
.
builder
()
.
name
(
name
)
.
phone
(
phone
)
.
zjType
(
zjType
)
.
zjNum
(
zjNum
)
.
jobType
(
jobType
)
.
jobStatus
(
YgEnumInterface
.
jobStatus
.
SHIYONG
.
getType
())
.
rzTime
(
rzTime
)
.
syq
(
syq
)
.
sex
(
sex
)
.
empNum
(
qyzxEmpLogin
.
getId
())
.
orgCode
(
orgCode
)
.
build
();
ygglMainEmp
.
insert
();
if
(
addygdaDto
.
getBmgwId
()
!=
null
)
{
new
LambdaUpdateChainWrapper
<
YgglMainEmp
>(
ygglMainEmpMapper
)
.
set
(
addygdaDto
.
getBmgwId
()
!=
null
,
YgglMainEmp:
:
getBmgwId
,
addygdaDto
.
getBmgwId
())
.
set
(
YgglMainEmp:
:
getBmgwId
,
addygdaDto
.
getBmgwId
())
.
eq
(
YgglMainEmp:
:
getOrgCode
,
orgCode
).
eq
(
YgglMainEmp:
:
getId
,
ygglMainEmp
.
getId
()).
update
();
}
return
ResultUtil
.
data
(
ygglMainEmp
,
"新添加员工档案成功!"
);
}
else
{
YgglMainEmp
ishad
=
YgglMainEmp
.
builder
().
build
()
.
selectOne
(
new
QueryWrapper
<
YgglMainEmp
>().
eq
(
"phone"
,
phone
).
eq
(
"org_code"
,
orgCode
));
YgglMainEmp
ishad
=
ygglMainEmpMapper
.
selectOne
(
new
QueryWrapper
<
YgglMainEmp
>()
.
lambda
()
.
eq
(
YgglMainEmp:
:
getPhone
,
phone
)
.
eq
(
YgglMainEmp:
:
getOrgCode
,
orgCode
));
if
(
ishad
==
null
)
{
// 添加三张表
// 员工权限表(未定)
QyzxEmpEntAsso
.
builder
().
empNum
(
login
.
getId
()).
orgCode
(
orgCode
).
userType
(
2
).
status
(
1
).
build
().
insert
();
// usertype2普通员工
QyzxEmpEntAsso
.
builder
()
.
empNum
(
login
.
getId
())
.
orgCode
(
orgCode
)
.
userType
(
2
)
.
status
(
1
)
.
build
()
.
insert
();
// usertype2普通员工
// status1正常
YgglMainEmp
ygglMainEmp
=
YgglMainEmp
.
builder
().
name
(
name
).
phone
(
phone
).
zjType
(
zjType
).
zjNum
(
zjNum
)
.
jobType
(
jobType
).
rzTime
(
rzTime
).
syq
(
syq
).
sex
(
sex
).
empNum
(
login
.
getId
()).
orgCode
(
orgCode
)
YgglMainEmp
ygglMainEmp
=
YgglMainEmp
.
builder
()
.
name
(
name
)
.
phone
(
phone
)
.
zjType
(
zjType
)
.
zjNum
(
zjNum
)
.
jobType
(
jobType
)
.
jobStatus
(
YgEnumInterface
.
jobStatus
.
SHIYONG
.
getType
())
.
rzTime
(
rzTime
)
.
syq
(
syq
)
.
sex
(
sex
)
.
empNum
(
login
.
getId
())
.
orgCode
(
orgCode
)
.
build
();
ygglMainEmp
.
insert
();
if
(
addygdaDto
.
getBmgwId
()
!=
null
)
{
new
LambdaUpdateChainWrapper
<
YgglMainEmp
>(
ygglMainEmpMapper
)
.
set
(
addygdaDto
.
getBmgwId
()
!=
null
,
YgglMainEmp:
:
getBmgwId
,
addygdaDto
.
getBmgwId
())
.
set
(
YgglMainEmp:
:
getBmgwId
,
addygdaDto
.
getBmgwId
())
.
eq
(
YgglMainEmp:
:
getOrgCode
,
orgCode
).
eq
(
YgglMainEmp:
:
getId
,
ygglMainEmp
.
getId
()).
update
();
}
return
ResultUtil
.
data
(
ygglMainEmp
,
"添加员工档案成功!"
);
}
else
{
return
ResultUtil
.
error
(
"该手机号已被使用,请输入正确手机号"
);
...
...
@@ -482,6 +523,35 @@ public class YgglController {
}
/**
* 导入员工档案
*/
@PostMapping
(
value
=
"/import_emp_record"
)
@ApiOperation
(
value
=
"导入员工档案"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
7
)
public
Result
<
List
<
YgDrjqbDto
>>
importEmpRecord
(
@CurrentUser
UserBean
userBean
/* ,@Validated @RequestBody List<AddygdaDto> listAddygdaDto */
)
{
List
<
QyzxEmpLogin
>
listEl
=
qyzxEmpLoginMapper
.
selectList
(
new
QueryWrapper
<
QyzxEmpLogin
>().
lambda
()
.
select
(
QyzxEmpLogin:
:
getPhone
));
// listEl.stream().filter(predicate)
// listEl.stream().filter(item -> objId.equals(item.getUpId())).forEach(zzglBmgwM -> {
// list.add(zzglBmgwM.getId());
// getDepts(list, zzglBmgwM.getId(), objs);
// });
//抽取 登录表 的phone的集合
List
<
String
>
listPhone
=
listEl
.
stream
()
.
filter
(
o
->
o
.
getPhone
()
!=
null
)
.
map
(
QyzxEmpLogin:
:
getPhone
)
.
collect
(
Collectors
.
toList
());
System
.
out
.
println
(
JSONUtil
.
parseObj
(
listPhone
));
listEl
.
stream
().
filter
(
i
->
i
!=
null
).
collect
(
Collectors
.<
QyzxEmpLogin
>
toList
());
return
null
;
}
/**
* 导入威力加强版
*
* @param
...
...
@@ -489,7 +559,6 @@ public class YgglController {
*/
@PostMapping
(
value
=
"/ygdas"
)
@ApiOperation
(
value
=
"导入威力加强版"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
7
)
public
Result
<
List
<
YgDrjqbDto
>>
ygdr
(
@CurrentUser
UserBean
userBean
,
@RequestBody
YgDrsDto
drList
)
{
drList
.
setErrorList
(
new
ArrayList
<
YgDrjqbDto
>());
drList
.
setOrgCode
(
userBean
.
getOrgCode
());
...
...
@@ -507,7 +576,7 @@ public class YgglController {
// 证件类型为0
Integer
jobType
=
Integer
.
valueOf
(
e
.
getJobType
());
// 工作类型
Integer
syq
=
Integer
.
valueOf
(
e
.
getSyq
());
// 试用期
Integer
sex
=
Integer
.
valueOf
(
e
.
getSex
());
// 性别
,还差一个岗位
Integer
sex
=
Integer
.
valueOf
(
e
.
getSex
());
// 性别
Integer
gw
=
e
.
getHavebmid
();
String
jobNum
=
e
.
getYgnbgh
();
Integer
jg
=
e
.
getJg
();
...
...
@@ -782,7 +851,7 @@ public class YgglController {
if
(
ygnbgh
!=
null
&&
ygnbgh
.
length
()
!=
0
)
{
d
.
setYgnbgh
(
ygnbgh
.
trim
());
}
else
{
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyyMMdd
"
);
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyyMMdd
HH:mm:ss"
);
String
bh
=
format
.
format
(
new
Date
())
+
orgCode
+
i
+
System
.
currentTimeMillis
();
d
.
setYgnbgh
(
bh
);
}
...
...
@@ -1564,22 +1633,15 @@ public class YgglController {
@ApiOperationSupport
(
order
=
55
)
public
Result
<
Void
>
addlzb
(
@CurrentUser
UserBean
userBean
,
@RequestBody
LzygQueryDto
lzygQueryDto
)
{
Integer
empNum
=
lzygQueryDto
.
getEmpNum
();
QueryWrapper
<
YgglMainEmp
>
queryWrapper
=
new
QueryWrapper
<
YgglMainEmp
>();
queryWrapper
.
eq
(
"emp_num"
,
empNum
);
UpdateWrapper
<
YgglMainEmp
>
updateWrapper
=
new
UpdateWrapper
<
YgglMainEmp
>();
updateWrapper
.
eq
(
"emp_num"
,
empNum
);
UpdateWrapper
<
YgglMainLzb
>
updateWrapper1
=
new
UpdateWrapper
<
YgglMainLzb
>();
updateWrapper1
.
eq
(
"emp_num"
,
empNum
);
YgglMainEmp
.
builder
().
empNum
(
empNum
).
jobStatus
(
YgEnumInterface
.
jobStatus
.
YILIZHI
.
getType
()).
build
()
.
update
(
updateWrapper
);
// 删除员工档案表
ygglMainEmpMapper
.
delete
(
new
QueryWrapper
<
YgglMainEmp
>().
lambda
().
eq
(
YgglMainEmp:
:
getEmpNum
,
empNum
));
YgglMainLzb
.
builder
().
empNum
(
empNum
).
jobStatus
(
YgEnumInterface
.
jobStatus
.
YILIZHI
.
getType
()).
sjlzTime
(
new
Date
())
.
build
().
update
(
updateWrapper1
);
// 查询该员工的关联表
QueryWrapper
<
QyzxEmpEntAsso
>
queryWrapper1
=
new
QueryWrapper
<
QyzxEmpEntAsso
>();
queryWrapper1
.
eq
(
"emp_num"
,
empNum
);
.
build
().
update
(
new
UpdateWrapper
<
YgglMainLzb
>().
lambda
().
eq
(
YgglMainLzb:
:
getEmpNum
,
empNum
));
// 确认离职 删除员工关联表
QyzxEmpEntAsso
qyzxEmpEntAsso
=
QyzxEmpEntAsso
.
builder
().
empNum
(
lzygQueryDto
.
getEmpNum
()).
build
();
qyzxEmpEntAsso
.
delete
(
queryWrapper1
);
QyzxEmpEntAsso
.
builder
().
empNum
(
lzygQueryDto
.
getEmpNum
()).
build
()
.
delete
(
new
QueryWrapper
<
QyzxEmpEntAsso
>().
lambda
().
eq
(
QyzxEmpEntAsso:
:
getEmpNum
,
empNum
));
// 初始化 部门主管
zzglBmgwMMapper
.
update
(
ZzglBmgwM
.
builder
().
leader
(
null
).
build
(),
...
...
src/main/java/cn/timer/api/controller/zzgl/ZzglController.java
View file @
0cf502e8
package
cn
.
timer
.
api
.
controller
.
zzgl
;
import
java.lang.reflect.Type
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
javax.transaction.Transactional
;
...
...
@@ -22,13 +25,25 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.github.xiaoymin.knife4j.annotations.ApiOperationSupport
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
cn.hutool.core.bean.copier.ValueProvider
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.collection.ListUtil
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.lang.tree.Tree
;
import
cn.hutool.core.lang.tree.TreeNode
;
import
cn.hutool.core.lang.tree.TreeNodeConfig
;
import
cn.hutool.core.lang.tree.TreeUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.timer.api.bean.yggl.YgglMainEmp
;
import
cn.timer.api.bean.zzgl.ZzglAuth
;
import
cn.timer.api.bean.zzgl.ZzglBmgwM
;
import
cn.timer.api.config.annotation.CurrentUser
;
import
cn.timer.api.config.annotation.UserBean
;
import
cn.timer.api.config.enuminterface.YgEnumInterface
;
import
cn.timer.api.dao.yggl.YgglMainEmpMapper
;
import
cn.timer.api.dao.zzgl.ZzglBmgwMMapper
;
import
cn.timer.api.dao.zzgl.ZzglLogDgjlMapper
;
...
...
@@ -70,12 +85,59 @@ public class ZzglController {
return
ResultUtil
.
data
(
zzglBmgwMs
);
}
/**
* 架构树/架构图/导出
*
* @param
* @return
*/
@GetMapping
(
value
=
"/deptlist_plus"
)
@ApiOperation
(
value
=
"1.获取部门岗位-升级版"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
1
)
public
Result
<
List
<
Tree
<
String
>>>
selectlistdept2
(
@CurrentUser
UserBean
userBean
)
{
Integer
orgCode
=
userBean
.
getOrgCode
();
List
<
ZzglBmgwM
>
zzglBmgwMs
=
new
LambdaQueryChainWrapper
<
ZzglBmgwM
>(
zzglBmgwMMapper
)
.
eq
(
ZzglBmgwM:
:
getOrgCode
,
orgCode
).
list
();
// 构建node列表
List
<
TreeNode
<
String
>>
nodeList
=
CollUtil
.
newArrayList
();
zzglBmgwMs
.
forEach
(
z
->
{
nodeList
.
add
(
new
TreeNode
<>(
Convert
.
toStr
(
z
.
getId
()),
Convert
.
toStr
(
z
.
getUpId
()),
z
.
getName
(),
0
));
});
//配置
TreeNodeConfig
treeNodeConfig
=
new
TreeNodeConfig
();
// 自定义属性名 都要默认值的
treeNodeConfig
.
setIdKey
(
"id"
);
treeNodeConfig
.
setParentIdKey
(
"upId"
);
// 最大递归深度
// treeNodeConfig.setDeep(10);
//转换器
List
<
Tree
<
String
>>
treeNodes
=
TreeUtil
.
build
(
nodeList
,
"0"
,
treeNodeConfig
,
(
treeNode
,
tree
)
->
{
tree
.
setId
(
treeNode
.
getId
());
tree
.
setParentId
(
treeNode
.
getParentId
());
tree
.
setWeight
(
treeNode
.
getWeight
());
tree
.
setName
(
treeNode
.
getName
());
// 扩展属性 ...
// tree.putExtra("extraField", 666);
// tree.putExtra("other", new Object());
});
return
ResultUtil
.
data
(
treeNodes
);
}
@GetMapping
(
value
=
"/depts"
)
@ApiOperation
(
value
=
"只获取部门"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperation
(
value
=
"2.获取部门"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
2
)
public
Result
<
List
<
ZzglBmgwM
>>
selectdepts
(
@CurrentUser
UserBean
userBean
)
{
Integer
orgCode
=
userBean
.
getOrgCode
();
List
<
ZzglBmgwM
>
zzglBmgwMs
=
new
LambdaQueryChainWrapper
<
ZzglBmgwM
>(
zzglBmgwMMapper
)
.
eq
(
ZzglBmgwM:
:
getOrgCode
,
orgCode
).
eq
(
ZzglBmgwM:
:
getType
,
0
).
list
();
//0:部门;1:岗位
.
eq
(
ZzglBmgwM:
:
getOrgCode
,
orgCode
)
.
eq
(
ZzglBmgwM:
:
getType
,
YgEnumInterface
.
OrgType
.
DEPARTMENT
)
.
list
();
return
ResultUtil
.
data
(
zzglBmgwMs
);
}
...
...
@@ -176,16 +238,24 @@ public class ZzglController {
@PostMapping
(
value
=
"/dept"
)
@ApiOperation
(
value
=
"添加/修改部门"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
public
Result
<
ZzglBmgwM
>
adddept
(
@CurrentUser
UserBean
userBean
,
@RequestBody
ZzglBmgwM
zzglBmgwM
)
{
if
(
zzglBmgwM
.
getName
().
trim
().
length
()==
0
)
Integer
count
=
zzglBmgwMMapper
.
selectCount
(
new
QueryWrapper
<
ZzglBmgwM
>().
lambda
()
.
eq
(
ZzglBmgwM:
:
getOrgCode
,
userBean
.
getOrgCode
()));
if
(
count
<=
0
)
{
// 根部门upId 默认为0
zzglBmgwM
.
setUpId
(
0
);
}
if
(
zzglBmgwM
.
getLeader
()
==
null
&&
StrUtil
.
length
(
StrUtil
.
trim
(
zzglBmgwM
.
getName
()))
==
0
)
return
ResultUtil
.
error
(
"部门岗位名称不能为空"
);
Boolean
a
=
zzglBmgwM
.
getId
()
==
null
;
if
(
a
&&
zzglBmgwM
.
getType
()
==
null
)
Boolean
notId
=
zzglBmgwM
.
getId
()
==
null
;
if
(
notId
&&
zzglBmgwM
.
getType
()
==
null
)
zzglBmgwM
.
setType
((
Integer
)
0
);
zzglBmgwM
.
setOrgCode
(
userBean
.
getOrgCode
());
zzglBmgwM
.
insertOrUpdate
();
if
(
a
)
return
ResultUtil
.
data
(
zzglBmgwM
);
return
ResultUtil
.
success
();
return
notId
?
ResultUtil
.
data
(
zzglBmgwM
)
:
ResultUtil
.
success
();
}
...
...
src/main/java/cn/timer/api/dao/kqmk/KqglAssoBcszMapper.java
View file @
0cf502e8
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.KqglAssoBcsz
;
import
cn.timer.api.dto.kqmk.KqzAttendanceGroupSearchDto
;
/**
...
...
@@ -17,4 +19,6 @@ public interface KqglAssoBcszMapper extends BaseMapper<KqglAssoBcsz> {
int
insert
(
KqglAssoBcsz
kqglassobcsz
);
int
update
(
KqglAssoBcsz
kqglassobcsz
);
List
<
KqglAssoBcsz
>
selectRosterByKqzid
(
KqzAttendanceGroupSearchDto
kqzattendancegroupsearchdto
);
}
src/main/java/cn/timer/api/dao/kqmk/KqglAssoKqzdkfsMapper.java
View file @
0cf502e8
package
cn
.
timer
.
api
.
dao
.
kqmk
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
java.util.List
;
import
org.springframework.stereotype.Repository
;
import
cn.timer.api.bean.kqmk.KqglAssoKqzdkfs
;
...
...
@@ -13,4 +16,6 @@ import cn.timer.api.bean.kqmk.KqglAssoKqzdkfs;
@Repository
public
interface
KqglAssoKqzdkfsMapper
extends
BaseMapper
<
KqglAssoKqzdkfs
>
{
int
insertKqglAssokqzdKfsList
(
List
<
KqglAssoKqzdkfs
>
kqglassokqzdkfs
);
}
src/main/java/cn/timer/api/dao/kqmk/KqglAssoLeaveBalanceMapper.java
View file @
0cf502e8
package
cn
.
timer
.
api
.
dao
.
kqmk
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
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.KqglAssoLeaveBalance
;
import
cn.timer.api.dto.kqmk.AttqueryCriteriaDto
;
import
cn.timer.api.dto.kqmk.EmployeeLeaveBalanceDto
;
/**
* 员工假期余额
...
...
@@ -13,4 +18,5 @@ import cn.timer.api.bean.kqmk.KqglAssoLeaveBalance;
@Repository
public
interface
KqglAssoLeaveBalanceMapper
extends
BaseMapper
<
KqglAssoLeaveBalance
>
{
IPage
<
EmployeeLeaveBalanceDto
>
selectPageByQueryLeaveBalance
(
IPage
<
EmployeeLeaveBalanceDto
>
page
,
@Param
(
"param"
)
AttqueryCriteriaDto
attquerycriteriadto
);
}
src/main/java/cn/timer/api/dao/kqmk/KqglAssoMonthPunchSummaryMapper.java
0 → 100644
View file @
0cf502e8
package
cn
.
timer
.
api
.
dao
.
kqmk
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.springframework.stereotype.Repository
;
import
cn.timer.api.bean.kqmk.KqglAssoMonthPunchSummary
;
/**
* 打卡月汇总
*
* @author Tang 2020-05-15
*/
@Repository
public
interface
KqglAssoMonthPunchSummaryMapper
extends
BaseMapper
<
KqglAssoMonthPunchSummary
>
{
}
src/main/java/cn/timer/api/dao/kqmk/KqglAssoOvertimeRangeMapper.java
0 → 100644
View file @
0cf502e8
package
cn
.
timer
.
api
.
dao
.
kqmk
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
java.util.List
;
import
org.springframework.stereotype.Repository
;
import
cn.timer.api.bean.kqmk.KqglAssoOvertimeRange
;
/**
* 加班规则-应用范围
*
* @author LAL 2020-05-13
*/
@Repository
public
interface
KqglAssoOvertimeRangeMapper
extends
BaseMapper
<
KqglAssoOvertimeRange
>
{
int
insertovertimerangelist
(
List
<
KqglAssoOvertimeRange
>
kqglassoovertimerange
);
}
src/main/java/cn/timer/api/dao/kqmk/KqglAssoPbmxMapper.java
View file @
0cf502e8
package
cn
.
timer
.
api
.
dao
.
kqmk
;
import
java.util.List
;
import
org.springframework.stereotype.Repository
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
cn.timer.api.bean.kqmk.KqglAssoPbmx
;
import
cn.timer.api.dto.kqmk.AttSchedulingDto
;
import
cn.timer.api.dto.kqmk.KqglAssoPbmxDto
;
/**
...
...
@@ -16,4 +19,8 @@ import cn.timer.api.dto.kqmk.KqglAssoPbmxDto;
public
interface
KqglAssoPbmxMapper
extends
BaseMapper
<
KqglAssoPbmx
>
{
KqglAssoPbmxDto
getScheduleSpecificAttendance
(
Integer
kqzid
,
Integer
userid
,
String
date
);
int
insertKqglAssoPbmxList
(
List
<
KqglAssoPbmxDto
>
kqglassopbmxdto
);
List
<
KqglAssoPbmxDto
>
selectAttGroupScheduling
(
AttSchedulingDto
attschedulingdto
);
}
src/main/java/cn/timer/api/dao/kqmk/KqglAssoTeshuMapper.java
View file @
0cf502e8
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.KqglAssoTeshu
;
/**
...
...
@@ -13,4 +16,6 @@ import cn.timer.api.bean.kqmk.KqglAssoTeshu;
@Repository
public
interface
KqglAssoTeshuMapper
extends
BaseMapper
<
KqglAssoTeshu
>
{
int
insertKqglAssoTeshuList
(
List
<
KqglAssoTeshu
>
kqglassoteshu
);
}
src/main/java/cn/timer/api/dao/kqmk/KqglAssoYhkqzMapper.java
0 → 100644
View file @
0cf502e8
package
cn
.
timer
.
api
.
dao
.
kqmk
;
import
java.util.List
;
import
org.springframework.stereotype.Repository
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
cn.timer.api.bean.kqmk.KqglAssoYhkqz
;
/**
* 用户和考勤组关系表
*
* @author LAL 2020-05-12
*/
@Repository
public
interface
KqglAssoYhkqzMapper
extends
BaseMapper
<
KqglAssoYhkqz
>
{
int
insertKqglAssoKqzdkfsList
(
List
<
KqglAssoYhkqz
>
kqglassoyhkqz
);
}
src/main/java/cn/timer/api/dao/kqmk/KqglAssoZhoupaibanMapper.java
View file @
0cf502e8
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.KqglAssoZhoupaiban
;
/**
...
...
@@ -13,4 +16,5 @@ import cn.timer.api.bean.kqmk.KqglAssoZhoupaiban;
@Repository
public
interface
KqglAssoZhoupaibanMapper
extends
BaseMapper
<
KqglAssoZhoupaiban
>
{
int
insertKqglAssoZhoupaibanList
(
List
<
KqglAssoZhoupaiban
>
kqglassozhoupaiban
);
}
src/main/java/cn/timer/api/dao/kqmk/KqglMainKqzMapper.java
View file @
0cf502e8
...
...
@@ -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/dao/qyzx/QyzxOperLogMapper.java
0 → 100644
View file @
0cf502e8
package
cn
.
timer
.
api
.
dao
.
qyzx
;
import
org.apache.ibatis.annotations.Param
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
cn.timer.api.bean.qyzx.QyzxOperLog
;
import
cn.timer.api.dto.qyzx.QyzxOperLogQuaryDto
;
/**
* 操作日志 数据层
*
* @author ruoyi
*/
public
interface
QyzxOperLogMapper
extends
BaseMapper
<
QyzxOperLog
>
{
// /**
// * 新增操作日志
// *
// * @param operLog 操作日志对象
// */
// public void insertOperlog(QyzxOperLog operLog);
//
/**
* 查询系统操作日志集合
*
* @param operLog 操作日志对象
* @return 操作日志集合
*/
public
IPage
<
QyzxOperLog
>
selectPageByQuery
(
IPage
<
QyzxOperLog
>
page
,
@Param
(
"param"
)
QyzxOperLogQuaryDto
operLog
);
//
// /**
// * 批量删除系统操作日志
// *
// * @param operIds 需要删除的操作日志ID
// * @return 结果
// */
// public int deleteOperLogByIds(Long[] operIds);
//
// /**
// * 查询操作日志详细
// *
// * @param operId 操作ID
// * @return 操作日志对象
// */
// public QyzxOperLog selectOperLogById(Long operId);
//
// /**
// * 清空操作日志
// */
// public void cleanOperLog();
}
src/main/java/cn/timer/api/dto/kqmk/AttSchedulingDto.java
0 → 100644
View file @
0cf502e8
package
cn
.
timer
.
api
.
dto
.
kqmk
;
import
java.io.Serializable
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
AttSchedulingDto
implements
Serializable
{
private
static
final
long
serialVersionUID
=
5519260557957197035L
;
private
Integer
qyid
;
private
String
date
;
private
Integer
kqzid
;
}
src/main/java/cn/timer/api/dto/kqmk/AttendanceAssistantDto.java
0 → 100644
View file @
0cf502e8
package
cn
.
timer
.
api
.
dto
.
kqmk
;
import
java.io.Serializable
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
AttendanceAssistantDto
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
3561517817976805144L
;
String
name
;
// 考勤组名称 *
String
remarks
;
// 备注 *
String
[]
attmachines
;
// 考勤机
String
[]
attadds
;
// 办公地点考勤
String
[]
attwifis
;
// WiFi考勤
String
[]
attuserids
;
// 考勤成员
int
atttype
;
// 考勤类型:1-固定排班、2-排班制、3-自由工时 *
int
legalholidays
;
// 是否开启法定节假日:0-否、1-是 *
String
[]
attWeekdays
;
// 周工作日【固定排班】
String
[]
attWeekdaysShifts
;
// 周工作日班次【固定排班】
String
[]
attMustPunchData
;
// 必须打卡的日期【固定排班】
String
[]
attMustPunchShifid
;
// 必须打卡的班次id【固定排班】
String
[]
attNonPunchData
;
// 不用打卡的日期【固定排班】
String
[]
attShifts
;
// 排班制 选择的班次【排班制】
int
attRemind
;
// 是否开启提醒:0-否、1-是【排班制】
String
[]
attRemindUserids
;
// 提醒人员【排班制】
int
advanceDays
;
// 提前多少天数提醒【排班制】
int
remCycleDays
;
// 提醒循环天数【排班制】
String
reminderTime
;
// 提醒时间【排班制】
String
[]
promptingMode
;
// 提醒方式:PC端、APP客户端、短信、邮件【排班制】
KqglAssoPbmxDto
[]
schedules
;
// 排班日期【排班制】--班次id、日期
// SchedulesUserids[] schedulesUserids;// 排班【排班制】----用户id
int
optscheduling
;
// 未排班时,员工可选择班次打卡
String
newAttTime
;
// 每天几点开始新的考勤【自由工时】
String
[]
attFreeWorkdays
;
// 周工作日【自由工时】
String
leastworkTime
;
// 至少需工作时间【自由工时】
String
normalWorkTime
;
// 正常工作时长【自由工时】
String
maxOvertimeTime
;
// 加班最大时长【自由工时】
String
attgroupid
;
int
overtimeRulesId
;
//加班id
int
fieldpersonnel
;
//外勤
}
src/main/java/cn/timer/api/dto/kqmk/AttendanceGroupDto.java
View file @
0cf502e8
...
...
@@ -14,7 +14,7 @@ import lombok.NoArgsConstructor;
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
AttendanceGroupDto
implements
Serializable
{
public
class
AttendanceGroupDto
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
5573272776427338217L
;
...
...
@@ -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/java/cn/timer/api/dto/kqmk/BalanceSheetDataDto.java
0 → 100644
View file @
0cf502e8
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
BalanceSheetDataDto
{
@ApiModelProperty
(
value
=
"假期规则id"
,
example
=
"字段说明"
)
private
Integer
leaverulesid
;
@ApiModelProperty
(
value
=
"余额天数 "
,
example
=
"字段说明"
)
private
Integer
balancedays
;
}
src/main/java/cn/timer/api/dto/kqmk/EmployeeLeaveBalanceDto.java
0 → 100644
View file @
0cf502e8
package
cn
.
timer
.
api
.
dto
.
kqmk
;
import
java.util.List
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
EmployeeLeaveBalanceDto
{
@ApiModelProperty
(
value
=
"员工工号 "
,
example
=
"字段说明"
)
private
Integer
empnum
;
@ApiModelProperty
(
value
=
"员工名称 "
,
example
=
"字段说明"
)
private
String
empname
;
@ApiModelProperty
(
value
=
"部门 "
,
example
=
"字段说明"
)
private
String
department
;
@ApiModelProperty
(
value
=
"入职日期 "
,
example
=
"字段说明"
)
private
String
rztime
;
@ApiModelProperty
(
value
=
"表数据"
,
example
=
"字段说明"
)
List
<
BalanceSheetDataDto
>
balanceTo
;
}
src/main/java/cn/timer/api/dto/kqmk/KqglAssoLeaveRulesDto.java
View file @
0cf502e8
...
...
@@ -28,7 +28,7 @@ public class KqglAssoLeaveRulesDto {
private
Integer
leaveType
;
@ApiModelProperty
(
value
=
"适用范围 "
,
example
=
"0:全公司 -1:考勤组id"
)
private
String
apply
;
private
Integer
apply
;
@ApiModelProperty
(
value
=
"创建时间 创建时间"
,
example
=
"101"
)
private
Long
createTime
;
...
...
@@ -48,4 +48,7 @@ public class KqglAssoLeaveRulesDto {
@ApiModelProperty
(
value
=
"适用范围集合"
,
example
=
"101"
)
private
String
[]
range
;
@ApiModelProperty
(
value
=
"适用范围名称"
,
example
=
"101"
)
private
String
[]
applyrange
;
}
\ No newline at end of file
src/main/java/cn/timer/api/dto/kqmk/KqglAssoOvertimeRulesDto.java
View file @
0cf502e8
...
...
@@ -20,8 +20,8 @@ public class KqglAssoOvertimeRulesDto {
@ApiModelProperty
(
value
=
"规则名称 "
,
example
=
"以审批时间计算加班"
)
private
String
name
;
@ApiModelProperty
(
value
=
"应用范围"
,
example
=
"
1
"
)
private
String
appliedScope
;
@ApiModelProperty
(
value
=
"应用范围"
,
example
=
"
(0:全公司 >0:考勤组id)
"
)
private
Integer
appliedScope
;
@ApiModelProperty
(
value
=
"工作日是否允许加班 0:否;1:是"
,
example
=
"1"
)
private
Integer
isWorkovertime
;
...
...
src/main/java/cn/timer/api/dto/kqmk/KqglMainKqzDto.java
View file @
0cf502e8
...
...
@@ -75,6 +75,9 @@ public class KqglMainKqzDto {
@ApiModelProperty
(
value
=
"外勤 外勤"
,
example
=
"101"
)
private
Integer
isWq
;
@ApiModelProperty
(
value
=
"加班规则 加班规则"
,
example
=
"101"
)
private
Integer
overtimeRulesId
;
@ApiModelProperty
(
value
=
"考勤组人员数"
,
example
=
"100"
)
private
Integer
kqznum
;
...
...
src/main/java/cn/timer/api/dto/kqmk/KqzAttendanceGroupSearchDto.java
0 → 100644
View file @
0cf502e8
package
cn
.
timer
.
api
.
dto
.
kqmk
;
import
java.io.Serializable
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
KqzAttendanceGroupSearchDto
implements
Serializable
{
private
static
final
long
serialVersionUID
=
4927912739465404926L
;
private
String
overall
;
private
Integer
qyid
;
}
src/main/java/cn/timer/api/dto/kqmk/SetConditionsDto.java
0 → 100644
View file @
0cf502e8
package
cn
.
timer
.
api
.
dto
.
kqmk
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
SetConditionsDto
{
private
Integer
id
;
private
Integer
parameters
;
}
src/main/java/cn/timer/api/dto/qyzx/QyzxOperLogQuaryDto.java
0 → 100644
View file @
0cf502e8
package
cn
.
timer
.
api
.
dto
.
qyzx
;
import
cn.timer.api.dto.spmk.MySummaryQueryDto
;
import
cn.timer.api.utils.Page
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
QyzxOperLogQuaryDto
extends
Page
{
@ApiModelProperty
(
value
=
"标题/操作人员/编号"
,
example
=
"1"
)
private
String
query
;
@ApiModelProperty
(
value
=
"企业id"
,
example
=
"101"
)
private
Integer
orgCode
;
@ApiModelProperty
(
value
=
"业务类型(0其它 1新增 2修改 3删除)"
,
example
=
"101"
)
private
Integer
businessType
;
@ApiModelProperty
(
value
=
"操作类别(0其它 1后台用户 2手机端用户)"
,
example
=
"101"
)
private
Integer
operatorType
;
@ApiModelProperty
(
value
=
"请求方式"
,
example
=
"请求方式"
)
private
String
requestMethod
;
@ApiModelProperty
(
value
=
"开始时间 "
,
example
=
"2000-10-10 10:10:10"
)
private
String
startTime
;
@ApiModelProperty
(
value
=
"结束时间 "
,
example
=
"2020-10-10 10:10:10"
)
private
String
endTime
;
}
src/main/java/cn/timer/api/dto/yggl/AddygdaDto.java
View file @
0cf502e8
...
...
@@ -8,6 +8,11 @@ package cn.timer.api.dto.yggl;
import
java.io.Serializable
;
import
java.util.Date
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotNull
;
import
cn.timer.api.config.exception.ValidationMsg
;
import
cn.timer.api.utils.Page
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
...
...
@@ -28,30 +33,39 @@ public class AddygdaDto extends Page implements Serializable{
private
static
final
long
serialVersionUID
=
-
1230023773946170942L
;
@NotBlank
(
message
=
ValidationMsg
.
NOTBLANK
)
@ApiModelProperty
(
value
=
"员工姓名"
,
example
=
"华仔"
)
private
String
name
;
@NotBlank
(
message
=
ValidationMsg
.
NOTBLANK
)
@ApiModelProperty
(
value
=
"手机号"
,
example
=
"101"
)
private
String
phone
;
@NotNull
(
message
=
ValidationMsg
.
NOTNULL
)
@ApiModelProperty
(
value
=
"证件类型 0:身份证;1:港澳居民来往内地通行证;2:台湾居民来往大陆通行证;3:外国护照;4:其他"
,
example
=
"0"
)
private
Integer
zjType
;
@NotBlank
(
message
=
ValidationMsg
.
NOTBLANK
)
@ApiModelProperty
(
value
=
"证件号码 "
,
example
=
"证件号码"
)
private
String
zjNum
;
@NotNull
(
message
=
ValidationMsg
.
NOTNULL
)
@ApiModelProperty
(
value
=
"工作性质 0全职、1实习生、2兼职、3劳务派遣、4劳务、5派遣、6外包、7退休返聘"
,
example
=
"0"
)
private
Integer
jobType
;
@NotNull
(
message
=
ValidationMsg
.
NOTNULL
)
@ApiModelProperty
(
value
=
"入职日期 "
,
example
=
"客户注册后的时间为入职时间"
)
private
Date
rzTime
;
@NotNull
(
message
=
ValidationMsg
.
NOTNULL
)
@ApiModelProperty
(
value
=
"试用期 0:无试用期;1:1个月;2:2个月;3:3个月;4:4个月;5:5个月;6:6个月(有试用期显示选项)"
,
example
=
"0"
)
private
Integer
syq
;
@NotNull
(
message
=
ValidationMsg
.
NOTNULL
)
@ApiModelProperty
(
value
=
"性别 0:男;1:女"
,
example
=
"0"
)
private
Integer
sex
;
@NotNull
(
message
=
ValidationMsg
.
NOTNULL
)
@ApiModelProperty
(
value
=
"部门岗位id"
,
example
=
"0"
)
private
Integer
bmgwId
;
...
...
src/main/java/cn/timer/api/dto/yggl/YgDrjqbDto.java
View file @
0cf502e8
...
...
@@ -61,7 +61,7 @@ public class YgDrjqbDto {
@ApiModelProperty
(
value
=
"员工状态 "
,
example
=
"1"
)
private
String
jobStatus
;
@ApiModelProperty
(
value
=
"入职日期 "
,
example
=
"2020-3-12"
)
@ApiModelProperty
(
value
=
"入职日期 "
,
example
=
"2020-3-12
10:10:10
"
)
private
String
rzTime
;
@ApiModelProperty
(
value
=
"试用期 "
,
example
=
"试用期"
)
...
...
src/main/java/cn/timer/api/manager/AsyncManager.java
0 → 100644
View file @
0cf502e8
package
cn
.
timer
.
api
.
manager
;
import
java.util.TimerTask
;
import
java.util.concurrent.ScheduledExecutorService
;
import
java.util.concurrent.TimeUnit
;
import
cn.timer.api.utils.SpringUtils
;
import
cn.timer.api.utils.Threads
;
/**
* 异步任务管理器
*
* @author Tang
*/
public
class
AsyncManager
{
/**
* 操作延迟10毫秒
*/
private
final
int
OPERATE_DELAY_TIME
=
10
;
/**
* 异步操作任务调度线程池
*/
private
ScheduledExecutorService
executor
=
SpringUtils
.
getBean
(
"scheduledExecutorService"
);
/**
* 单例模式
*/
private
AsyncManager
(){}
private
static
AsyncManager
me
;
static
{
me
=
new
AsyncManager
();
}
public
static
AsyncManager
me
()
{
return
me
;
}
/**
* 执行任务
*
* @param task 任务
*/
public
void
execute
(
TimerTask
task
)
{
executor
.
schedule
(
task
,
OPERATE_DELAY_TIME
,
TimeUnit
.
MILLISECONDS
);
}
/**
* 停止任务线程池
*/
public
void
shutdown
()
{
Threads
.
shutdownAndAwaitTermination
(
executor
);
}
}
src/main/java/cn/timer/api/manager/ShutdownManager.java
0 → 100644
View file @
0cf502e8
package
cn
.
timer
.
api
.
manager
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.PreDestroy
;
/**
* 确保应用退出时能关闭后台线程
*
* @author Tang
*/
@Component
public
class
ShutdownManager
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
"sys-user"
);
@PreDestroy
public
void
destroy
()
{
shutdownAsyncManager
();
}
/**
* 停止异步执行任务
*/
private
void
shutdownAsyncManager
()
{
try
{
logger
.
info
(
"====关闭后台任务任务线程池===="
);
AsyncManager
.
me
().
shutdown
();
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
(),
e
);
}
}
}
src/main/java/cn/timer/api/manager/factory/AsyncFactory.java
0 → 100644
View file @
0cf502e8
package
cn
.
timer
.
api
.
manager
.
factory
;
import
java.util.TimerTask
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
cn.hutool.extra.spring.SpringUtil
;
import
cn.timer.api.bean.qyzx.QyzxOperLog
;
import
cn.timer.api.controller.qyzx.service.QyzxOperLogService
;
import
cn.timer.api.utils.AddressUtils
;
import
cn.timer.api.utils.SpringUtils
;
/**
* 异步工厂(产生任务用)
*
* @author Tang
*/
public
class
AsyncFactory
{
/**
* 记录登陆信息
*
* @param username 用户名
* @param status 状态
* @param message 消息
* @param args 列表
* @return 任务task
*/
// public static TimerTask recordLogininfor(final String username, final String status, final String message,final Object... args){}
/**
* 操作日志记录
*
* @param operLog 操作日志信息
* @return 任务task
*/
public
static
TimerTask
recordOper
(
final
QyzxOperLog
operLog
)
{
return
new
TimerTask
()
{
@Override
public
void
run
()
{
// 远程查询操作地点
operLog
.
setOperLocation
(
AddressUtils
.
getRealAddressByIP
(
operLog
.
getOperIp
()));
SpringUtils
.
getBean
(
QyzxOperLogService
.
class
).
insertOperlog
(
operLog
);
}
};
}
}
src/main/java/cn/timer/api/utils/AddressUtils.java
0 → 100644
View file @
0cf502e8
package
cn
.
timer
.
api
.
utils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
com.alibaba.fastjson.JSONObject
;
import
cn.hutool.core.util.StrUtil
;
/**
* 获取地址类
*
* @author Tang
*/
public
class
AddressUtils
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
AddressUtils
.
class
);
public
static
final
String
IP_URL
=
"http://ip.taobao.com/service/getIpInfo.php"
;
public
static
String
getRealAddressByIP
(
String
ip
)
{
String
address
=
"XX XX"
;
// 内网不查询
if
(
UserIp
.
internalIp
(
ip
))
{
return
"内网IP"
;
}
String
rspStr
=
HttpUtils
.
sendPost
(
IP_URL
,
"ip="
+
ip
);
if
(
StrUtil
.
isEmpty
(
rspStr
))
{
log
.
error
(
"获取地理位置异常 {}"
,
ip
);
return
address
;
}
JSONObject
obj
=
JSONObject
.
parseObject
(
rspStr
);
JSONObject
data
=
obj
.
getObject
(
"data"
,
JSONObject
.
class
);
String
region
=
data
.
getString
(
"region"
);
String
city
=
data
.
getString
(
"city"
);
address
=
region
+
" "
+
city
;
return
address
;
}
}
src/main/java/cn/timer/api/utils/HttpUtils.java
0 → 100644
View file @
0cf502e8
package
cn
.
timer
.
api
.
utils
;
import
java.io.BufferedReader
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStreamReader
;
import
java.io.PrintWriter
;
import
java.net.ConnectException
;
import
java.net.SocketTimeoutException
;
import
java.net.URL
;
import
java.net.URLConnection
;
import
java.security.cert.X509Certificate
;
import
javax.net.ssl.HostnameVerifier
;
import
javax.net.ssl.HttpsURLConnection
;
import
javax.net.ssl.SSLContext
;
import
javax.net.ssl.SSLSession
;
import
javax.net.ssl.TrustManager
;
import
javax.net.ssl.X509TrustManager
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
/**
* 通用http发送方法
*
* @author ruoyi
*/
public
class
HttpUtils
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
HttpUtils
.
class
);
/**
* 向指定 URL 发送GET方法的请求
*
* @param url 发送请求的 URL
* @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
* @return 所代表远程资源的响应结果
*/
public
static
String
sendGet
(
String
url
,
String
param
)
{
StringBuilder
result
=
new
StringBuilder
();
BufferedReader
in
=
null
;
try
{
String
urlNameString
=
url
+
"?"
+
param
;
log
.
info
(
"sendGet - {}"
,
urlNameString
);
URL
realUrl
=
new
URL
(
urlNameString
);
URLConnection
connection
=
realUrl
.
openConnection
();
connection
.
setRequestProperty
(
"accept"
,
"*/*"
);
connection
.
setRequestProperty
(
"connection"
,
"Keep-Alive"
);
connection
.
setRequestProperty
(
"user-agent"
,
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"
);
connection
.
connect
();
in
=
new
BufferedReader
(
new
InputStreamReader
(
connection
.
getInputStream
()));
String
line
;
while
((
line
=
in
.
readLine
())
!=
null
)
{
result
.
append
(
line
);
}
log
.
info
(
"recv - {}"
,
result
);
}
catch
(
ConnectException
e
)
{
log
.
error
(
"调用HttpUtils.sendGet ConnectException, url="
+
url
+
",param="
+
param
,
e
);
}
catch
(
SocketTimeoutException
e
)
{
log
.
error
(
"调用HttpUtils.sendGet SocketTimeoutException, url="
+
url
+
",param="
+
param
,
e
);
}
catch
(
IOException
e
)
{
log
.
error
(
"调用HttpUtils.sendGet IOException, url="
+
url
+
",param="
+
param
,
e
);
}
catch
(
Exception
e
)
{
log
.
error
(
"调用HttpsUtil.sendGet Exception, url="
+
url
+
",param="
+
param
,
e
);
}
finally
{
try
{
if
(
in
!=
null
)
{
in
.
close
();
}
}
catch
(
Exception
ex
)
{
log
.
error
(
"调用in.close Exception, url="
+
url
+
",param="
+
param
,
ex
);
}
}
return
result
.
toString
();
}
/**
* 向指定 URL 发送POST方法的请求
*
* @param url 发送请求的 URL
* @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
* @return 所代表远程资源的响应结果
*/
public
static
String
sendPost
(
String
url
,
String
param
)
{
PrintWriter
out
=
null
;
BufferedReader
in
=
null
;
StringBuilder
result
=
new
StringBuilder
();
try
{
String
urlNameString
=
url
+
"?"
+
param
;
log
.
info
(
"sendPost - {}"
,
urlNameString
);
URL
realUrl
=
new
URL
(
urlNameString
);
URLConnection
conn
=
realUrl
.
openConnection
();
conn
.
setRequestProperty
(
"accept"
,
"*/*"
);
conn
.
setRequestProperty
(
"connection"
,
"Keep-Alive"
);
conn
.
setRequestProperty
(
"user-agent"
,
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"
);
conn
.
setRequestProperty
(
"Accept-Charset"
,
"utf-8"
);
conn
.
setRequestProperty
(
"contentType"
,
"utf-8"
);
conn
.
setDoOutput
(
true
);
conn
.
setDoInput
(
true
);
out
=
new
PrintWriter
(
conn
.
getOutputStream
());
out
.
print
(
param
);
out
.
flush
();
in
=
new
BufferedReader
(
new
InputStreamReader
(
conn
.
getInputStream
(),
"utf-8"
));
String
line
;
while
((
line
=
in
.
readLine
())
!=
null
)
{
result
.
append
(
line
);
}
log
.
info
(
"recv - {}"
,
result
);
}
catch
(
ConnectException
e
)
{
log
.
error
(
"调用HttpUtils.sendPost ConnectException, url="
+
url
+
",param="
+
param
,
e
);
}
catch
(
SocketTimeoutException
e
)
{
log
.
error
(
"调用HttpUtils.sendPost SocketTimeoutException, url="
+
url
+
",param="
+
param
,
e
);
}
catch
(
IOException
e
)
{
log
.
error
(
"调用HttpUtils.sendPost IOException, url="
+
url
+
",param="
+
param
,
e
);
}
catch
(
Exception
e
)
{
log
.
error
(
"调用HttpsUtil.sendPost Exception, url="
+
url
+
",param="
+
param
,
e
);
}
finally
{
try
{
if
(
out
!=
null
)
{
out
.
close
();
}
if
(
in
!=
null
)
{
in
.
close
();
}
}
catch
(
IOException
ex
)
{
log
.
error
(
"调用in.close Exception, url="
+
url
+
",param="
+
param
,
ex
);
}
}
return
result
.
toString
();
}
public
static
String
sendSSLPost
(
String
url
,
String
param
)
{
StringBuilder
result
=
new
StringBuilder
();
String
urlNameString
=
url
+
"?"
+
param
;
try
{
log
.
info
(
"sendSSLPost - {}"
,
urlNameString
);
SSLContext
sc
=
SSLContext
.
getInstance
(
"SSL"
);
sc
.
init
(
null
,
new
TrustManager
[]
{
new
TrustAnyTrustManager
()
},
new
java
.
security
.
SecureRandom
());
URL
console
=
new
URL
(
urlNameString
);
HttpsURLConnection
conn
=
(
HttpsURLConnection
)
console
.
openConnection
();
conn
.
setRequestProperty
(
"accept"
,
"*/*"
);
conn
.
setRequestProperty
(
"connection"
,
"Keep-Alive"
);
conn
.
setRequestProperty
(
"user-agent"
,
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"
);
conn
.
setRequestProperty
(
"Accept-Charset"
,
"utf-8"
);
conn
.
setRequestProperty
(
"contentType"
,
"utf-8"
);
conn
.
setDoOutput
(
true
);
conn
.
setDoInput
(
true
);
conn
.
setSSLSocketFactory
(
sc
.
getSocketFactory
());
conn
.
setHostnameVerifier
(
new
TrustAnyHostnameVerifier
());
conn
.
connect
();
InputStream
is
=
conn
.
getInputStream
();
BufferedReader
br
=
new
BufferedReader
(
new
InputStreamReader
(
is
));
String
ret
=
""
;
while
((
ret
=
br
.
readLine
())
!=
null
)
{
if
(
ret
!=
null
&&
!
ret
.
trim
().
equals
(
""
))
{
result
.
append
(
new
String
(
ret
.
getBytes
(
"ISO-8859-1"
),
"utf-8"
));
}
}
log
.
info
(
"recv - {}"
,
result
);
conn
.
disconnect
();
br
.
close
();
}
catch
(
ConnectException
e
)
{
log
.
error
(
"调用HttpUtils.sendSSLPost ConnectException, url="
+
url
+
",param="
+
param
,
e
);
}
catch
(
SocketTimeoutException
e
)
{
log
.
error
(
"调用HttpUtils.sendSSLPost SocketTimeoutException, url="
+
url
+
",param="
+
param
,
e
);
}
catch
(
IOException
e
)
{
log
.
error
(
"调用HttpUtils.sendSSLPost IOException, url="
+
url
+
",param="
+
param
,
e
);
}
catch
(
Exception
e
)
{
log
.
error
(
"调用HttpsUtil.sendSSLPost Exception, url="
+
url
+
",param="
+
param
,
e
);
}
return
result
.
toString
();
}
private
static
class
TrustAnyTrustManager
implements
X509TrustManager
{
@Override
public
void
checkClientTrusted
(
X509Certificate
[]
chain
,
String
authType
)
{
}
@Override
public
void
checkServerTrusted
(
X509Certificate
[]
chain
,
String
authType
)
{
}
@Override
public
X509Certificate
[]
getAcceptedIssuers
()
{
return
new
X509Certificate
[]
{};
}
}
private
static
class
TrustAnyHostnameVerifier
implements
HostnameVerifier
{
@Override
public
boolean
verify
(
String
hostname
,
SSLSession
session
)
{
return
true
;
}
}
}
\ No newline at end of file
src/main/java/cn/timer/api/utils/LogUtils.java
0 → 100644
View file @
0cf502e8
package
cn
.
timer
.
api
.
utils
;
/**
* 处理并记录日志文件
*
* @author ruoyi
*/
public
class
LogUtils
{
public
static
String
getBlock
(
Object
msg
)
{
if
(
msg
==
null
)
{
msg
=
""
;
}
return
"["
+
msg
.
toString
()
+
"]"
;
}
}
src/main/java/cn/timer/api/utils/ServletUtils.java
0 → 100644
View file @
0cf502e8
package
cn
.
timer
.
api
.
utils
;
import
java.io.IOException
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpSession
;
import
org.springframework.web.context.request.RequestAttributes
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.util.StrUtil
;
/**
* 客户端工具类
*
* @author ruoyi
*/
public
class
ServletUtils
{
/**
* 获取String参数
*/
public
static
String
getParameter
(
String
name
)
{
return
getRequest
().
getParameter
(
name
);
}
/**
* 获取String参数
*/
public
static
String
getParameter
(
String
name
,
String
defaultValue
)
{
return
Convert
.
toStr
(
getRequest
().
getParameter
(
name
),
defaultValue
);
}
/**
* 获取Integer参数
*/
public
static
Integer
getParameterToInt
(
String
name
)
{
return
Convert
.
toInt
(
getRequest
().
getParameter
(
name
));
}
/**
* 获取Integer参数
*/
public
static
Integer
getParameterToInt
(
String
name
,
Integer
defaultValue
)
{
return
Convert
.
toInt
(
getRequest
().
getParameter
(
name
),
defaultValue
);
}
/**
* 获取request
*/
public
static
HttpServletRequest
getRequest
()
{
return
getRequestAttributes
().
getRequest
();
}
/**
* 获取response
*/
public
static
HttpServletResponse
getResponse
()
{
return
getRequestAttributes
().
getResponse
();
}
/**
* 获取session
*/
public
static
HttpSession
getSession
()
{
return
getRequest
().
getSession
();
}
public
static
ServletRequestAttributes
getRequestAttributes
()
{
RequestAttributes
attributes
=
RequestContextHolder
.
getRequestAttributes
();
return
(
ServletRequestAttributes
)
attributes
;
}
/**
* 将字符串渲染到客户端
*
* @param response 渲染对象
* @param string 待渲染的字符串
* @return null
*/
public
static
String
renderString
(
HttpServletResponse
response
,
String
string
)
{
try
{
response
.
setStatus
(
200
);
response
.
setContentType
(
"application/json"
);
response
.
setCharacterEncoding
(
"utf-8"
);
response
.
getWriter
().
print
(
string
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
null
;
}
/**
* 是否是Ajax异步请求
*
* @param request
*/
public
static
boolean
isAjaxRequest
(
HttpServletRequest
request
)
{
String
accept
=
request
.
getHeader
(
"accept"
);
if
(
accept
!=
null
&&
accept
.
indexOf
(
"application/json"
)
!=
-
1
)
{
return
true
;
}
String
xRequestedWith
=
request
.
getHeader
(
"X-Requested-With"
);
if
(
xRequestedWith
!=
null
&&
xRequestedWith
.
indexOf
(
"XMLHttpRequest"
)
!=
-
1
)
{
return
true
;
}
String
uri
=
request
.
getRequestURI
();
if
(
StrUtil
.
containsAnyIgnoreCase
(
uri
,
".json"
,
".xml"
))
{
return
true
;
}
String
ajax
=
request
.
getParameter
(
"__ajax"
);
if
(
StrUtil
.
containsAnyIgnoreCase
(
ajax
,
"json"
,
"xml"
))
{
return
true
;
}
return
false
;
}
}
src/main/java/cn/timer/api/utils/SpringUtils.java
0 → 100644
View file @
0cf502e8
package
cn
.
timer
.
api
.
utils
;
import
org.springframework.aop.framework.AopContext
;
import
org.springframework.beans.BeansException
;
import
org.springframework.beans.factory.NoSuchBeanDefinitionException
;
import
org.springframework.beans.factory.config.BeanFactoryPostProcessor
;
import
org.springframework.beans.factory.config.ConfigurableListableBeanFactory
;
import
org.springframework.stereotype.Component
;
/**
* spring工具类 方便在非spring管理环境中获取bean
*
* @author ruoyi
*/
@Component
public
final
class
SpringUtils
implements
BeanFactoryPostProcessor
{
/** Spring应用上下文环境 */
private
static
ConfigurableListableBeanFactory
beanFactory
;
@Override
public
void
postProcessBeanFactory
(
ConfigurableListableBeanFactory
beanFactory
)
throws
BeansException
{
SpringUtils
.
beanFactory
=
beanFactory
;
}
/**
* 获取对象
*
* @param name
* @return Object 一个以所给名字注册的bean的实例
* @throws org.springframework.beans.BeansException
*
*/
@SuppressWarnings
(
"unchecked"
)
public
static
<
T
>
T
getBean
(
String
name
)
throws
BeansException
{
return
(
T
)
beanFactory
.
getBean
(
name
);
}
/**
* 获取类型为requiredType的对象
*
* @param clz
* @return
* @throws org.springframework.beans.BeansException
*
*/
public
static
<
T
>
T
getBean
(
Class
<
T
>
clz
)
throws
BeansException
{
T
result
=
(
T
)
beanFactory
.
getBean
(
clz
);
return
result
;
}
/**
* 如果BeanFactory包含一个与所给名称匹配的bean定义,则返回true
*
* @param name
* @return boolean
*/
public
static
boolean
containsBean
(
String
name
)
{
return
beanFactory
.
containsBean
(
name
);
}
/**
* 判断以给定名字注册的bean定义是一个singleton还是一个prototype。 如果与给定名字相应的bean定义没有被找到,将会抛出一个异常(NoSuchBeanDefinitionException)
*
* @param name
* @return boolean
* @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
*
*/
public
static
boolean
isSingleton
(
String
name
)
throws
NoSuchBeanDefinitionException
{
return
beanFactory
.
isSingleton
(
name
);
}
/**
* @param name
* @return Class 注册对象的类型
* @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
*
*/
public
static
Class
<?>
getType
(
String
name
)
throws
NoSuchBeanDefinitionException
{
return
beanFactory
.
getType
(
name
);
}
/**
* 如果给定的bean名字在bean定义中有别名,则返回这些别名
*
* @param name
* @return
* @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
*
*/
public
static
String
[]
getAliases
(
String
name
)
throws
NoSuchBeanDefinitionException
{
return
beanFactory
.
getAliases
(
name
);
}
/**
* 获取aop代理对象
*
* @param invoker
* @return
*/
@SuppressWarnings
(
"unchecked"
)
public
static
<
T
>
T
getAopProxy
(
T
invoker
)
{
return
(
T
)
AopContext
.
currentProxy
();
}
}
src/main/java/cn/timer/api/utils/Threads.java
0 → 100644
View file @
0cf502e8
package
cn
.
timer
.
api
.
utils
;
import
java.util.concurrent.CancellationException
;
import
java.util.concurrent.ExecutionException
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Future
;
import
java.util.concurrent.TimeUnit
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
/**
* 线程相关工具类.
*
* @author Tang
*/
public
class
Threads
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
Threads
.
class
);
/**
* sleep等待,单位为毫秒
*/
public
static
void
sleep
(
long
milliseconds
)
{
try
{
Thread
.
sleep
(
milliseconds
);
}
catch
(
InterruptedException
e
)
{
return
;
}
}
/**
* 停止线程池
* 先使用shutdown, 停止接收新任务并尝试完成所有已存在任务.
* 如果超时, 则调用shutdownNow, 取消在workQueue中Pending的任务,并中断所有阻塞函数.
* 如果仍人超時,則強制退出.
* 另对在shutdown时线程本身被调用中断做了处理.
*/
public
static
void
shutdownAndAwaitTermination
(
ExecutorService
pool
)
{
if
(
pool
!=
null
&&
!
pool
.
isShutdown
())
{
pool
.
shutdown
();
try
{
if
(!
pool
.
awaitTermination
(
120
,
TimeUnit
.
SECONDS
))
{
pool
.
shutdownNow
();
if
(!
pool
.
awaitTermination
(
120
,
TimeUnit
.
SECONDS
))
{
logger
.
info
(
"Pool did not terminate"
);
}
}
}
catch
(
InterruptedException
ie
)
{
pool
.
shutdownNow
();
Thread
.
currentThread
().
interrupt
();
}
}
}
/**
* 打印线程异常信息
*/
public
static
void
printException
(
Runnable
r
,
Throwable
t
)
{
if
(
t
==
null
&&
r
instanceof
Future
<?>)
{
try
{
Future
<?>
future
=
(
Future
<?>)
r
;
if
(
future
.
isDone
())
{
future
.
get
();
}
}
catch
(
CancellationException
ce
)
{
t
=
ce
;
}
catch
(
ExecutionException
ee
)
{
t
=
ee
.
getCause
();
}
catch
(
InterruptedException
ie
)
{
Thread
.
currentThread
().
interrupt
();
}
}
if
(
t
!=
null
)
{
logger
.
error
(
t
.
getMessage
(),
t
);
}
}
}
src/main/java/cn/timer/api/utils/UserIp.java
View file @
0cf502e8
...
...
@@ -11,6 +11,7 @@ import java.util.regex.Pattern;
import
javax.servlet.http.HttpServletRequest
;
import
cn.hutool.core.util.StrUtil
;
import
nl.bitwalker.useragentutils.Browser
;
import
nl.bitwalker.useragentutils.OperatingSystem
;
import
nl.bitwalker.useragentutils.UserAgent
;
...
...
@@ -185,6 +186,125 @@ public class UserIp {
return
strings
;
}
/**
* 将IPv4地址转换成字节
*
* @param text IPv4地址
* @return byte 字节
*/
public
static
byte
[]
textToNumericFormatV4
(
String
text
)
{
if
(
text
.
length
()
==
0
)
{
return
null
;
}
byte
[]
bytes
=
new
byte
[
4
];
String
[]
elements
=
text
.
split
(
"\\."
,
-
1
);
try
{
long
l
;
int
i
;
switch
(
elements
.
length
)
{
case
1
:
l
=
Long
.
parseLong
(
elements
[
0
]);
if
((
l
<
0L
)
||
(
l
>
4294967295L
))
return
null
;
bytes
[
0
]
=
(
byte
)
(
int
)
(
l
>>
24
&
0xFF
);
bytes
[
1
]
=
(
byte
)
(
int
)
((
l
&
0xFFFFFF
)
>>
16
&
0xFF
);
bytes
[
2
]
=
(
byte
)
(
int
)
((
l
&
0xFFFF
)
>>
8
&
0xFF
);
bytes
[
3
]
=
(
byte
)
(
int
)
(
l
&
0xFF
);
break
;
case
2
:
l
=
Integer
.
parseInt
(
elements
[
0
]);
if
((
l
<
0L
)
||
(
l
>
255L
))
return
null
;
bytes
[
0
]
=
(
byte
)
(
int
)
(
l
&
0xFF
);
l
=
Integer
.
parseInt
(
elements
[
1
]);
if
((
l
<
0L
)
||
(
l
>
16777215L
))
return
null
;
bytes
[
1
]
=
(
byte
)
(
int
)
(
l
>>
16
&
0xFF
);
bytes
[
2
]
=
(
byte
)
(
int
)
((
l
&
0xFFFF
)
>>
8
&
0xFF
);
bytes
[
3
]
=
(
byte
)
(
int
)
(
l
&
0xFF
);
break
;
case
3
:
for
(
i
=
0
;
i
<
2
;
++
i
)
{
l
=
Integer
.
parseInt
(
elements
[
i
]);
if
((
l
<
0L
)
||
(
l
>
255L
))
return
null
;
bytes
[
i
]
=
(
byte
)
(
int
)
(
l
&
0xFF
);
}
l
=
Integer
.
parseInt
(
elements
[
2
]);
if
((
l
<
0L
)
||
(
l
>
65535L
))
return
null
;
bytes
[
2
]
=
(
byte
)
(
int
)
(
l
>>
8
&
0xFF
);
bytes
[
3
]
=
(
byte
)
(
int
)
(
l
&
0xFF
);
break
;
case
4
:
for
(
i
=
0
;
i
<
4
;
++
i
)
{
l
=
Integer
.
parseInt
(
elements
[
i
]);
if
((
l
<
0L
)
||
(
l
>
255L
))
return
null
;
bytes
[
i
]
=
(
byte
)
(
int
)
(
l
&
0xFF
);
}
break
;
default
:
return
null
;
}
}
catch
(
NumberFormatException
e
)
{
return
null
;
}
return
bytes
;
}
public
static
boolean
internalIp
(
String
ip
)
{
byte
[]
addr
=
textToNumericFormatV4
(
ip
);
return
internalIp
(
addr
)
||
"127.0.0.1"
.
equals
(
ip
);
}
private
static
boolean
internalIp
(
byte
[]
addr
)
{
if
(
StrUtil
.
isEmptyIfStr
(
addr
)
||
addr
.
length
<
2
)
{
return
true
;
}
final
byte
b0
=
addr
[
0
];
final
byte
b1
=
addr
[
1
];
// 10.x.x.x/8
final
byte
SECTION_1
=
0x0A
;
// 172.16.x.x/12
final
byte
SECTION_2
=
(
byte
)
0xAC
;
final
byte
SECTION_3
=
(
byte
)
0x10
;
final
byte
SECTION_4
=
(
byte
)
0x1F
;
// 192.168.x.x/16
final
byte
SECTION_5
=
(
byte
)
0xC0
;
final
byte
SECTION_6
=
(
byte
)
0xA8
;
switch
(
b0
)
{
case
SECTION_1:
return
true
;
case
SECTION_2:
if
(
b1
>=
SECTION_3
&&
b1
<=
SECTION_4
)
{
return
true
;
}
case
SECTION_5:
switch
(
b1
)
{
case
SECTION_6:
return
true
;
}
default
:
return
false
;
}
}
public
static
String
getMACAddress
(
String
ip
)
throws
Exception
{
...
...
src/main/java/cn/timer/api/utils/router/RouterUtils.java
View file @
0cf502e8
...
...
@@ -19,6 +19,7 @@ import cn.timer.api.bean.spmk.SpmkApproveSummary;
import
cn.timer.api.bean.spmk.SpmkExecutor
;
import
cn.timer.api.bean.yggl.YgglMainEmp
;
import
cn.timer.api.bean.zzgl.ZzglBmgwM
;
import
cn.timer.api.config.enuminterface.SpmkEnumInterface.ExecutorSts
;
import
cn.timer.api.dto.spmk.Condition
;
import
cn.timer.api.dto.spmk.FlowChildren
;
import
cn.timer.api.dto.spmk.FromData
;
...
...
@@ -289,6 +290,7 @@ public class RouterUtils {
// 审批执行记录 持久化
public
static
void
insertogExecuteRecord
(
List
<
FlowChildren
>
listFlowChildren
,
Integer
asId
)
throws
Exception
{
for_insert:
for
(
int
i
=
0
,
m
=
listFlowChildren
.
size
()
;
i
<
m
;
i
++)
{
if
(
UNEXECUTED
.
equals
(
listFlowChildren
.
get
(
i
).
getExecute
()))
{
i
++;
...
...
@@ -315,7 +317,7 @@ public class RouterUtils {
.
empNum
(
Integer
.
parseInt
(
user
.
getId
()))
.
operatorHeaderUrl
(
user
.
getHeadUrl
())
.
executorName
(
user
.
getName
())
.
sts
(
2
)
.
sts
(
ExecutorSts
.
AGREE
.
ordinal
()
)
.
build
()
.
insert
();
break
;
...
...
@@ -333,7 +335,6 @@ public class RouterUtils {
// 新增 执行人
List
<
User
>
listUser
=
listFlowChildren
.
get
(
i
).
getRelation
().
get
(
0
).
getUsers
();
executor:
for
(
User
user2
:
listUser
)
{
SpmkExecutor
executor
=
SpmkExecutor
.
builder
()
.
approveExecuteRecordId
(
aer2
.
getId
())
...
...
@@ -343,16 +344,14 @@ public class RouterUtils {
.
build
();
switch
(
user2
.
getExecute
())
{
case
EXECUTING:
executor
.
setSts
(
1
);
executor
.
setSts
(
ExecutorSts
.
IN_EXECUTION
.
ordinal
()
);
executor
.
insert
();
break
executor
;
break
for_insert
;
case
EXECUTED:
executor
.
setSts
(
2
);
executor
.
setSts
(
ExecutorSts
.
AGREE
.
ordinal
()
);
executor
.
insert
();
break
;
}
}
break
;
case
COPY:
...
...
@@ -378,7 +377,7 @@ public class RouterUtils {
.
empNum
(
Integer
.
parseInt
(
user2
.
getId
()))
.
executorName
(
user2
.
getName
())
.
operatorHeaderUrl
(
user2
.
getHeadUrl
())
.
sts
(
2
)
.
sts
(
ExecutorSts
.
AGREE
.
ordinal
()
)
.
build
();
executor
.
insert
();
}
...
...
@@ -428,7 +427,7 @@ public class RouterUtils {
// 0未执行 1执行中 2同意 3拒绝 4 转派
if
(
sts
==
3
)
{
// 更新 审批汇总 状态
SpmkApproveSummary
.
builder
().
id
(
asId
).
endTime
(
new
Date
()).
sts
(
sts
).
build
().
updateById
();
SpmkApproveSummary
.
builder
().
id
(
asId
).
currentApprover
(
""
).
endTime
(
new
Date
()).
sts
(
sts
).
build
().
updateById
();
SpmkApproveExecuteRecord
.
builder
()
.
id
(
executeRecordId
)
...
...
@@ -452,7 +451,7 @@ public class RouterUtils {
.
empNum
(
Integer
.
parseInt
(
listUser
.
get
(
i_user
).
getId
()))
.
executorName
(
listUser
.
get
(
i_user
).
getName
())
.
operatorHeaderUrl
(
listUser
.
get
(
i_user
).
getHeadUrl
())
.
sts
(
1
)
.
sts
(
ExecutorSts
.
IN_EXECUTION
.
ordinal
()
)
.
build
()
.
insert
();
hasNextApprover
=
true
;
...
...
@@ -499,7 +498,7 @@ public class RouterUtils {
.
empNum
(
Integer
.
parseInt
(
user
.
getId
()))
.
executorName
(
user
.
getName
())
.
operatorHeaderUrl
(
user
.
getHeadUrl
())
.
sts
(
2
)
.
sts
(
ExecutorSts
.
AGREE
.
ordinal
()
)
.
build
()
.
insert
();
...
...
@@ -522,7 +521,7 @@ public class RouterUtils {
.
empNum
(
Integer
.
parseInt
(
listUser
.
get
(
i_user2
).
getId
()))
.
executorName
(
listUser
.
get
(
i_user2
).
getName
())
.
operatorHeaderUrl
(
listUser
.
get
(
i_user2
).
getHeadUrl
())
.
sts
(
1
)
.
sts
(
ExecutorSts
.
IN_EXECUTION
.
ordinal
()
)
.
build
();
executor
.
insert
();
...
...
@@ -554,7 +553,7 @@ public class RouterUtils {
.
empNum
(
Integer
.
parseInt
(
user2
.
getId
()))
.
executorName
(
user2
.
getName
())
.
operatorHeaderUrl
(
user2
.
getHeadUrl
())
.
sts
(
2
)
.
sts
(
ExecutorSts
.
AGREE
.
ordinal
()
)
.
build
();
executor
.
insert
();
}
...
...
src/main/resources/application-dev.yml
View file @
0cf502e8
...
...
@@ -175,7 +175,7 @@ config-8timer:
one
:
3
two
:
7
three
:
30
init-password
:
123456
src/main/resources/application-pro.yml
View file @
0cf502e8
...
...
@@ -147,3 +147,4 @@ config-8timer:
one
:
3
two
:
7
three
:
30
init-password
:
123456
\ No newline at end of file
src/main/resources/application-test.yml
View file @
0cf502e8
...
...
@@ -147,3 +147,4 @@ config-8timer:
one
:
3
two
:
7
three
:
30
init-password
:
123456
\ No newline at end of file
src/main/resources/mapping/kqgl/AttendanceGroupMapper.xml
View file @
0cf502e8
...
...
@@ -29,6 +29,7 @@
<result
column=
"dkfs"
property=
"dkfs"
jdbcType=
"VARCHAR"
/>
<result
column=
"kqjid"
property=
"kqjid"
jdbcType=
"INTEGER"
/>
<result
column=
"is_wq"
property=
"isWq"
jdbcType=
"INTEGER"
/>
<result
column=
"overtime_rules_id"
property=
"overtimeRulesId"
/>
<collection
property=
"kqzdkfslist"
ofType=
"cn.timer.api.bean.kqgl.AttGroupBinPunchMode"
>
<result
column=
"kqzId"
property=
"kqzId"
jdbcType=
"INTEGER"
/>
...
...
@@ -92,7 +93,7 @@
<sql
id=
"Base_Column_List"
>
id, name, kqbz, pbfs, qyid, is_fdjjr, kqkssj_time, zsgzsc, zcgzsc, jbzdsc, is_dqtx,
txry, txfs, txxhts, txsj_time, tsfs, is_wpbsdk,sybc,is_xzbcdk,is_wq
txry, txfs, txxhts, txsj_time, tsfs, is_wpbsdk,sybc,is_xzbcdk,is_wq
,overtime_rules_id
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Integer"
>
select
...
...
@@ -180,6 +181,9 @@
<if
test=
"isWq != null"
>
is_wq,
</if>
<if
test=
"overtimeRulesId != null"
>
overtime_rules_id,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
...
...
@@ -240,6 +244,9 @@
<if
test=
"isWq != null"
>
#{isWq,jdbcType=INTEGER},
</if>
<if
test=
"overtimeRulesId != null"
>
#{overtimeRulesId,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"cn.timer.api.bean.kqgl.AttendanceGroup"
>
...
...
@@ -302,6 +309,9 @@
<if
test=
"isWq != null"
>
is_wq = #{isWq,jdbcType=INTEGER},
</if>
<if
test=
"overtimeRulesId != null"
>
overtime_rules_id = #{overtimeRulesId,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
...
...
@@ -325,7 +335,8 @@
is_wpbsdk = #{isWpbsdk,jdbcType=INTEGER},
sybc = #{sybc,jdbcType=VARCHAR},
is_xzbcdk = #{isXzbcdk,jdbcType=INTEGER},
is_wq = #{isWq,jdbcType=INTEGER}
is_wq = #{isWq,jdbcType=INTEGER},
overtime_rules_id = #{overtimeRulesId,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
...
...
src/main/resources/mapping/kqmk/KqglAssoBcszMapper.xml
View file @
0cf502e8
...
...
@@ -147,6 +147,17 @@
luryid KqglAssoBcsz_luryid
</sql>
<select
id=
"selectRosterByKqzid"
resultMap=
"BaseResultMap"
>
select bcsz.* from kqgl_asso_bcsz bcsz
where bcsz.id in (
select pbmx.bcid from kqgl_asso_pbmx pbmx
where pbmx.kqzid = #{qyid,jdbcType=INTEGER}
<if
test=
"overall != null"
>
and SUBSTR(pbmx.`data`,1,7) = #{overall,jdbcType=VARCHAR}
</if>
GROUP BY pbmx.bcid
)
</select>
<insert
id=
"insert"
useGeneratedKeys=
"true"
keyProperty=
"id"
parameterType=
"cn.timer.api.bean.kqmk.KqglAssoBcsz"
>
...
...
src/main/resources/mapping/kqmk/KqglAssoKqzdkfsMapper.xml
View file @
0cf502e8
...
...
@@ -30,6 +30,29 @@
state KqglAssoKqzdkfs_state
</sql>
<insert
id=
"insertKqglAssokqzdKfsList"
parameterType=
"java.util.List"
>
insert into kqgl_asso_kqzdkfs (dkfsid, kqz_id, type, qyid, state)
<foreach
collection=
"list"
item=
"item"
index=
"index"
open=
"values "
close=
""
separator=
","
>
(
<if
test=
"item.dkfsid != null"
>
#{item.dkfsid,jdbcType=INTEGER},
</if>
<if
test=
"item.kqzId != null"
>
#{item.kqzId,jdbcType=INTEGER},
</if>
<if
test=
"item.type != null"
>
#{item.type,jdbcType=INTEGER},
</if>
<if
test=
"item.qyid != null"
>
#{item.qyid,jdbcType=INTEGER},
</if>
<if
test=
"item.state != null"
>
#{item.state,jdbcType=INTEGER}
</if>
)
</foreach>
</insert>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.kqmk.KqglAssoKqzdkfs">
...
...
src/main/resources/mapping/kqmk/KqglAssoLeaveBalanceMapper.xml
View file @
0cf502e8
...
...
@@ -14,6 +14,18 @@
<result
column=
"modify_timer"
property=
"modifyTimer"
/>
<result
column=
"modify_number"
property=
"modifyNumber"
/>
<result
column=
"org_code"
property=
"orgCode"
/>
<result
column=
"is_automatic"
property=
"isAutomatic"
/>
</resultMap>
<resultMap
id=
"LeaveBalanceMap"
type=
"cn.timer.api.dto.kqmk.EmployeeLeaveBalanceDto"
>
<result
column=
"empnum"
property=
"empnum"
/>
<result
column=
"empname"
property=
"empname"
/>
<result
column=
"department"
property=
"department"
/>
<result
column=
"rztime"
property=
"rztime"
/>
<collection
property=
"balanceTo"
ofType=
"cn.timer.api.dto.kqmk.BalanceSheetDataDto"
>
<result
column=
"leaverulesid"
property=
"leaverulesid"
/>
<result
column=
"balancedays"
property=
"balancedays"
/>
</collection>
</resultMap>
<sql
id=
"Base_Column_List"
>
...
...
@@ -26,7 +38,8 @@
modify_userid,
modify_timer,
modify_number,
org_code
org_code,
is_automatic
</sql>
<sql
id=
"Base_Column_List_Alias"
>
...
...
@@ -39,9 +52,33 @@
modify_userid KqglAssoLeaveBalance_modify_userid,
modify_timer KqglAssoLeaveBalance_modify_timer,
modify_number KqglAssoLeaveBalance_modify_number,
org_code KqglAssoLeaveBalance_org_code
org_code KqglAssoLeaveBalance_org_code,
is_automatic KqglAssoLeaveBalance_is_automatic
</sql>
<select
id=
"selectPageByQueryLeaveBalance"
resultMap=
"LeaveBalanceMap"
>
SELECT emp.emp_num as empnum,
emp.`name` as empname,
IFNULL(c.name,'') as department,
IFNULL(emp.rz_time,'') as rztime,
yz.leave_rules_id as leaverulesid,
yz.balancedays
from yggl_main_emp emp
LEFT JOIN zzgl_bmgw_m as gw on gw.id = emp.bmgw_id
LEFT JOIN zzgl_bmgw_m as c ON c.id = gw.up_id
LEFT JOIN (select bal.leave_rules_id,bal.userid,SUM(bal.balance_days) as balancedays
from kqgl_asso_leave_balance bal
where bal.org_code = #{param.orgCode}
GROUP BY bal.userid,bal.leave_rules_id) as yz on yz.userid = emp.emp_num
where emp.org_code = #{param.orgCode}
<if
test=
"param.query != null and param.query != ''"
>
and ( emp.`name` like CONCAT('%',#{param.query},'%') or
emp.emp_num like CONCAT('%',#{param.query},'%') or
c.name like CONCAT('%',#{param.query},'%'))
</if>
ORDER BY emp.emp_num DESC
</select>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.kqmk.KqglAssoLeaveBalance">
...
...
@@ -72,7 +109,10 @@
modify_number,
</if>
<if test ='null != orgCode'>
org_code
org_code,
</if>
<if test ='null != isAutomatic'>
is_automatic
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
...
...
@@ -101,7 +141,10 @@
#{modifyNumber},
</if>
<if test ='null != orgCode'>
#{orgCode}
#{orgCode},
</if>
<if test ='null != isAutomatic'>
#{isAutomatic}
</if>
</trim>
</insert>
...
...
@@ -122,7 +165,8 @@
<if test ='null != modifyUserid'>modify_userid = #{modifyUserid},</if>
<if test ='null != modifyTimer'>modify_timer = #{modifyTimer},</if>
<if test ='null != modifyNumber'>modify_number = #{modifyNumber},</if>
<if test ='null != orgCode'>org_code = #{orgCode}</if>
<if test ='null != orgCode'>org_code = #{orgCode},</if>
<if test ='null != isAutomatic'>is_automatic = #{isAutomatic}</if>
</set>
WHERE id = #{id}
</update>
...
...
src/main/resources/mapping/kqmk/KqglAssoMonthPunchSummaryMapper.xml
0 → 100644
View file @
0cf502e8
<?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.KqglAssoMonthPunchSummaryMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"cn.timer.api.bean.kqmk.KqglAssoMonthPunchSummary"
>
<id
column=
"id"
property=
"id"
/>
<result
column=
"name"
property=
"name"
/>
<result
column=
"num"
property=
"num"
/>
<result
column=
"dept"
property=
"dept"
/>
<result
column=
"post"
property=
"post"
/>
<result
column=
"att_group"
property=
"attGroup"
/>
<result
column=
"shift"
property=
"shift"
/>
<result
column=
"days_on_duty"
property=
"daysOnDuty"
/>
<result
column=
"actual_att_days"
property=
"actualAttDays"
/>
<result
column=
"days_off"
property=
"daysOff"
/>
<result
column=
"working_hours"
property=
"workingHours"
/>
<result
column=
"late_times"
property=
"lateTimes"
/>
<result
column=
"late_hours"
property=
"lateHours"
/>
<result
column=
"serious_late_times"
property=
"seriousLateTimes"
/>
<result
column=
"serious_late_hours"
property=
"seriousLateHours"
/>
<result
column=
"absen_late_times"
property=
"absenLateTimes"
/>
<result
column=
"early_leave_times"
property=
"earlyLeaveTimes"
/>
<result
column=
"length_early_leave"
property=
"lengthEarlyLeave"
/>
<result
column=
"number_work_card_shortage"
property=
"numberWorkCardShortage"
/>
<result
column=
"number_duty_card_shortage"
property=
"numberDutyCardShortage"
/>
<result
column=
"absenteeism_days"
property=
"absenteeismDays"
/>
<result
column=
"length_business_trip"
property=
"lengthBusinessTrip"
/>
<result
column=
"time_out"
property=
"timeOut"
/>
<result
column=
"total_overtime_hours"
property=
"totalOvertimeHours"
/>
<result
column=
"working_turn_compen_leave"
property=
"workingTurnCompenLeave"
/>
<result
column=
"rest_turn_compen_leave"
property=
"restTurnCompenLeave"
/>
<result
column=
"holiday_turn_compen_leave"
property=
"holidayTurnCompenLeave"
/>
<result
column=
"working_transfer_overtime"
property=
"workingTransferOvertime"
/>
<result
column=
"rest_transfer_overtime"
property=
"restTransferOvertime"
/>
<result
column=
"holiday_transfer_overtime"
property=
"holidayTransferOvertime"
/>
<result
column=
"day1"
property=
"day1"
/>
<result
column=
"day2"
property=
"day2"
/>
<result
column=
"day3"
property=
"day3"
/>
<result
column=
"day4"
property=
"day4"
/>
<result
column=
"day5"
property=
"day5"
/>
<result
column=
"day6"
property=
"day6"
/>
<result
column=
"day7"
property=
"day7"
/>
<result
column=
"day8"
property=
"day8"
/>
<result
column=
"day9"
property=
"day9"
/>
<result
column=
"day10"
property=
"day10"
/>
<result
column=
"day11"
property=
"day11"
/>
<result
column=
"day12"
property=
"day12"
/>
<result
column=
"day13"
property=
"day13"
/>
<result
column=
"day14"
property=
"day14"
/>
<result
column=
"day15"
property=
"day15"
/>
<result
column=
"day16"
property=
"day16"
/>
<result
column=
"day17"
property=
"day17"
/>
<result
column=
"day18"
property=
"day18"
/>
<result
column=
"day19"
property=
"day19"
/>
<result
column=
"day20"
property=
"day20"
/>
<result
column=
"day21"
property=
"day21"
/>
<result
column=
"day22"
property=
"day22"
/>
<result
column=
"day23"
property=
"day23"
/>
<result
column=
"day24"
property=
"day24"
/>
<result
column=
"day25"
property=
"day25"
/>
<result
column=
"day26"
property=
"day26"
/>
<result
column=
"day27"
property=
"day27"
/>
<result
column=
"day28"
property=
"day28"
/>
<result
column=
"day29"
property=
"day29"
/>
<result
column=
"day30"
property=
"day30"
/>
<result
column=
"day31"
property=
"day31"
/>
<result
column=
"belong_year"
property=
"belongYear"
/>
<result
column=
"belong_month"
property=
"belongMonth"
/>
<result
column=
"org_code"
property=
"orgCode"
/>
<result
column=
"last_modified"
property=
"lastModified"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id,
name,
num,
dept,
post,
att_group,
shift,
days_on_duty,
actual_att_days,
days_off,
working_hours,
late_times,
late_hours,
serious_late_times,
serious_late_hours,
absen_late_times,
early_leave_times,
length_early_leave,
number_work_card_shortage,
number_duty_card_shortage,
absenteeism_days,
length_business_trip,
time_out,
total_overtime_hours,
working_turn_compen_leave,
rest_turn_compen_leave,
holiday_turn_compen_leave,
working_transfer_overtime,
rest_transfer_overtime,
holiday_transfer_overtime,
day1,
day2,
day3,
day4,
day5,
day6,
day7,
day8,
day9,
day10,
day11,
day12,
day13,
day14,
day15,
day16,
day17,
day18,
day19,
day20,
day21,
day22,
day23,
day24,
day25,
day26,
day27,
day28,
day29,
day30,
day31,
belong_year,
belong_month,
org_code,
last_modified
</sql>
<sql
id=
"Base_Column_List_Alias"
>
id KqglAssoMonthPunchSummary_id,
name KqglAssoMonthPunchSummary_name,
num KqglAssoMonthPunchSummary_num,
dept KqglAssoMonthPunchSummary_dept,
post KqglAssoMonthPunchSummary_post,
att_group KqglAssoMonthPunchSummary_att_group,
shift KqglAssoMonthPunchSummary_shift,
days_on_duty KqglAssoMonthPunchSummary_days_on_duty,
actual_att_days KqglAssoMonthPunchSummary_actual_att_days,
days_off KqglAssoMonthPunchSummary_days_off,
working_hours KqglAssoMonthPunchSummary_working_hours,
late_times KqglAssoMonthPunchSummary_late_times,
late_hours KqglAssoMonthPunchSummary_late_hours,
serious_late_times KqglAssoMonthPunchSummary_serious_late_times,
serious_late_hours KqglAssoMonthPunchSummary_serious_late_hours,
absen_late_times KqglAssoMonthPunchSummary_absen_late_times,
early_leave_times KqglAssoMonthPunchSummary_early_leave_times,
length_early_leave KqglAssoMonthPunchSummary_length_early_leave,
number_work_card_shortage KqglAssoMonthPunchSummary_number_work_card_shortage,
number_duty_card_shortage KqglAssoMonthPunchSummary_number_duty_card_shortage,
absenteeism_days KqglAssoMonthPunchSummary_absenteeism_days,
length_business_trip KqglAssoMonthPunchSummary_length_business_trip,
time_out KqglAssoMonthPunchSummary_time_out,
total_overtime_hours KqglAssoMonthPunchSummary_total_overtime_hours,
working_turn_compen_leave KqglAssoMonthPunchSummary_working_turn_compen_leave,
rest_turn_compen_leave KqglAssoMonthPunchSummary_rest_turn_compen_leave,
holiday_turn_compen_leave KqglAssoMonthPunchSummary_holiday_turn_compen_leave,
working_transfer_overtime KqglAssoMonthPunchSummary_working_transfer_overtime,
rest_transfer_overtime KqglAssoMonthPunchSummary_rest_transfer_overtime,
holiday_transfer_overtime KqglAssoMonthPunchSummary_holiday_transfer_overtime,
day1 KqglAssoMonthPunchSummary_day1,
day2 KqglAssoMonthPunchSummary_day2,
day3 KqglAssoMonthPunchSummary_day3,
day4 KqglAssoMonthPunchSummary_day4,
day5 KqglAssoMonthPunchSummary_day5,
day6 KqglAssoMonthPunchSummary_day6,
day7 KqglAssoMonthPunchSummary_day7,
day8 KqglAssoMonthPunchSummary_day8,
day9 KqglAssoMonthPunchSummary_day9,
day10 KqglAssoMonthPunchSummary_day10,
day11 KqglAssoMonthPunchSummary_day11,
day12 KqglAssoMonthPunchSummary_day12,
day13 KqglAssoMonthPunchSummary_day13,
day14 KqglAssoMonthPunchSummary_day14,
day15 KqglAssoMonthPunchSummary_day15,
day16 KqglAssoMonthPunchSummary_day16,
day17 KqglAssoMonthPunchSummary_day17,
day18 KqglAssoMonthPunchSummary_day18,
day19 KqglAssoMonthPunchSummary_day19,
day20 KqglAssoMonthPunchSummary_day20,
day21 KqglAssoMonthPunchSummary_day21,
day22 KqglAssoMonthPunchSummary_day22,
day23 KqglAssoMonthPunchSummary_day23,
day24 KqglAssoMonthPunchSummary_day24,
day25 KqglAssoMonthPunchSummary_day25,
day26 KqglAssoMonthPunchSummary_day26,
day27 KqglAssoMonthPunchSummary_day27,
day28 KqglAssoMonthPunchSummary_day28,
day29 KqglAssoMonthPunchSummary_day29,
day30 KqglAssoMonthPunchSummary_day30,
day31 KqglAssoMonthPunchSummary_day31,
belong_year KqglAssoMonthPunchSummary_belong_year,
belong_month KqglAssoMonthPunchSummary_belong_month,
org_code KqglAssoMonthPunchSummary_org_code,
last_modified KqglAssoMonthPunchSummary_last_modified
</sql>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.kqmk.KqglAssoMonthPunchSummary">
INSERT INTO kqgl_asso_month_punch_summary
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test ='null != name'>
name,
</if>
<if test ='null != num'>
num,
</if>
<if test ='null != dept'>
dept,
</if>
<if test ='null != post'>
post,
</if>
<if test ='null != attGroup'>
att_group,
</if>
<if test ='null != shift'>
shift,
</if>
<if test ='null != daysOnDuty'>
days_on_duty,
</if>
<if test ='null != actualAttDays'>
actual_att_days,
</if>
<if test ='null != daysOff'>
days_off,
</if>
<if test ='null != workingHours'>
working_hours,
</if>
<if test ='null != lateTimes'>
late_times,
</if>
<if test ='null != lateHours'>
late_hours,
</if>
<if test ='null != seriousLateTimes'>
serious_late_times,
</if>
<if test ='null != seriousLateHours'>
serious_late_hours,
</if>
<if test ='null != absenLateTimes'>
absen_late_times,
</if>
<if test ='null != earlyLeaveTimes'>
early_leave_times,
</if>
<if test ='null != lengthEarlyLeave'>
length_early_leave,
</if>
<if test ='null != numberWorkCardShortage'>
number_work_card_shortage,
</if>
<if test ='null != numberDutyCardShortage'>
number_duty_card_shortage,
</if>
<if test ='null != absenteeismDays'>
absenteeism_days,
</if>
<if test ='null != lengthBusinessTrip'>
length_business_trip,
</if>
<if test ='null != timeOut'>
time_out,
</if>
<if test ='null != totalOvertimeHours'>
total_overtime_hours,
</if>
<if test ='null != workingTurnCompenLeave'>
working_turn_compen_leave,
</if>
<if test ='null != restTurnCompenLeave'>
rest_turn_compen_leave,
</if>
<if test ='null != holidayTurnCompenLeave'>
holiday_turn_compen_leave,
</if>
<if test ='null != workingTransferOvertime'>
working_transfer_overtime,
</if>
<if test ='null != restTransferOvertime'>
rest_transfer_overtime,
</if>
<if test ='null != holidayTransferOvertime'>
holiday_transfer_overtime,
</if>
<if test ='null != day1'>
day1,
</if>
<if test ='null != day2'>
day2,
</if>
<if test ='null != day3'>
day3,
</if>
<if test ='null != day4'>
day4,
</if>
<if test ='null != day5'>
day5,
</if>
<if test ='null != day6'>
day6,
</if>
<if test ='null != day7'>
day7,
</if>
<if test ='null != day8'>
day8,
</if>
<if test ='null != day9'>
day9,
</if>
<if test ='null != day10'>
day10,
</if>
<if test ='null != day11'>
day11,
</if>
<if test ='null != day12'>
day12,
</if>
<if test ='null != day13'>
day13,
</if>
<if test ='null != day14'>
day14,
</if>
<if test ='null != day15'>
day15,
</if>
<if test ='null != day16'>
day16,
</if>
<if test ='null != day17'>
day17,
</if>
<if test ='null != day18'>
day18,
</if>
<if test ='null != day19'>
day19,
</if>
<if test ='null != day20'>
day20,
</if>
<if test ='null != day21'>
day21,
</if>
<if test ='null != day22'>
day22,
</if>
<if test ='null != day23'>
day23,
</if>
<if test ='null != day24'>
day24,
</if>
<if test ='null != day25'>
day25,
</if>
<if test ='null != day26'>
day26,
</if>
<if test ='null != day27'>
day27,
</if>
<if test ='null != day28'>
day28,
</if>
<if test ='null != day29'>
day29,
</if>
<if test ='null != day30'>
day30,
</if>
<if test ='null != day31'>
day31,
</if>
<if test ='null != belongYear'>
belong_year,
</if>
<if test ='null != belongMonth'>
belong_month,
</if>
<if test ='null != orgCode'>
org_code,
</if>
<if test ='null != lastModified'>
last_modified
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test ='null != name'>
#{name},
</if>
<if test ='null != num'>
#{num},
</if>
<if test ='null != dept'>
#{dept},
</if>
<if test ='null != post'>
#{post},
</if>
<if test ='null != attGroup'>
#{attGroup},
</if>
<if test ='null != shift'>
#{shift},
</if>
<if test ='null != daysOnDuty'>
#{daysOnDuty},
</if>
<if test ='null != actualAttDays'>
#{actualAttDays},
</if>
<if test ='null != daysOff'>
#{daysOff},
</if>
<if test ='null != workingHours'>
#{workingHours},
</if>
<if test ='null != lateTimes'>
#{lateTimes},
</if>
<if test ='null != lateHours'>
#{lateHours},
</if>
<if test ='null != seriousLateTimes'>
#{seriousLateTimes},
</if>
<if test ='null != seriousLateHours'>
#{seriousLateHours},
</if>
<if test ='null != absenLateTimes'>
#{absenLateTimes},
</if>
<if test ='null != earlyLeaveTimes'>
#{earlyLeaveTimes},
</if>
<if test ='null != lengthEarlyLeave'>
#{lengthEarlyLeave},
</if>
<if test ='null != numberWorkCardShortage'>
#{numberWorkCardShortage},
</if>
<if test ='null != numberDutyCardShortage'>
#{numberDutyCardShortage},
</if>
<if test ='null != absenteeismDays'>
#{absenteeismDays},
</if>
<if test ='null != lengthBusinessTrip'>
#{lengthBusinessTrip},
</if>
<if test ='null != timeOut'>
#{timeOut},
</if>
<if test ='null != totalOvertimeHours'>
#{totalOvertimeHours},
</if>
<if test ='null != workingTurnCompenLeave'>
#{workingTurnCompenLeave},
</if>
<if test ='null != restTurnCompenLeave'>
#{restTurnCompenLeave},
</if>
<if test ='null != holidayTurnCompenLeave'>
#{holidayTurnCompenLeave},
</if>
<if test ='null != workingTransferOvertime'>
#{workingTransferOvertime},
</if>
<if test ='null != restTransferOvertime'>
#{restTransferOvertime},
</if>
<if test ='null != holidayTransferOvertime'>
#{holidayTransferOvertime},
</if>
<if test ='null != day1'>
#{day1},
</if>
<if test ='null != day2'>
#{day2},
</if>
<if test ='null != day3'>
#{day3},
</if>
<if test ='null != day4'>
#{day4},
</if>
<if test ='null != day5'>
#{day5},
</if>
<if test ='null != day6'>
#{day6},
</if>
<if test ='null != day7'>
#{day7},
</if>
<if test ='null != day8'>
#{day8},
</if>
<if test ='null != day9'>
#{day9},
</if>
<if test ='null != day10'>
#{day10},
</if>
<if test ='null != day11'>
#{day11},
</if>
<if test ='null != day12'>
#{day12},
</if>
<if test ='null != day13'>
#{day13},
</if>
<if test ='null != day14'>
#{day14},
</if>
<if test ='null != day15'>
#{day15},
</if>
<if test ='null != day16'>
#{day16},
</if>
<if test ='null != day17'>
#{day17},
</if>
<if test ='null != day18'>
#{day18},
</if>
<if test ='null != day19'>
#{day19},
</if>
<if test ='null != day20'>
#{day20},
</if>
<if test ='null != day21'>
#{day21},
</if>
<if test ='null != day22'>
#{day22},
</if>
<if test ='null != day23'>
#{day23},
</if>
<if test ='null != day24'>
#{day24},
</if>
<if test ='null != day25'>
#{day25},
</if>
<if test ='null != day26'>
#{day26},
</if>
<if test ='null != day27'>
#{day27},
</if>
<if test ='null != day28'>
#{day28},
</if>
<if test ='null != day29'>
#{day29},
</if>
<if test ='null != day30'>
#{day30},
</if>
<if test ='null != day31'>
#{day31},
</if>
<if test ='null != belongYear'>
#{belongYear},
</if>
<if test ='null != belongMonth'>
#{belongMonth},
</if>
<if test ='null != orgCode'>
#{orgCode},
</if>
<if test ='null != lastModified'>
#{lastModified}
</if>
</trim>
</insert>
<delete id="delete" >
DELETE FROM kqgl_asso_month_punch_summary
WHERE id = #{id}
</delete>
<update id="update" parameterType="cn.timer.api.bean.kqmk.KqglAssoMonthPunchSummary">
UPDATE kqgl_asso_month_punch_summary
<set>
<if test ='null != name'>name = #{name},</if>
<if test ='null != num'>num = #{num},</if>
<if test ='null != dept'>dept = #{dept},</if>
<if test ='null != post'>post = #{post},</if>
<if test ='null != attGroup'>att_group = #{attGroup},</if>
<if test ='null != shift'>shift = #{shift},</if>
<if test ='null != daysOnDuty'>days_on_duty = #{daysOnDuty},</if>
<if test ='null != actualAttDays'>actual_att_days = #{actualAttDays},</if>
<if test ='null != daysOff'>days_off = #{daysOff},</if>
<if test ='null != workingHours'>working_hours = #{workingHours},</if>
<if test ='null != lateTimes'>late_times = #{lateTimes},</if>
<if test ='null != lateHours'>late_hours = #{lateHours},</if>
<if test ='null != seriousLateTimes'>serious_late_times = #{seriousLateTimes},</if>
<if test ='null != seriousLateHours'>serious_late_hours = #{seriousLateHours},</if>
<if test ='null != absenLateTimes'>absen_late_times = #{absenLateTimes},</if>
<if test ='null != earlyLeaveTimes'>early_leave_times = #{earlyLeaveTimes},</if>
<if test ='null != lengthEarlyLeave'>length_early_leave = #{lengthEarlyLeave},</if>
<if test ='null != numberWorkCardShortage'>number_work_card_shortage = #{numberWorkCardShortage},</if>
<if test ='null != numberDutyCardShortage'>number_duty_card_shortage = #{numberDutyCardShortage},</if>
<if test ='null != absenteeismDays'>absenteeism_days = #{absenteeismDays},</if>
<if test ='null != lengthBusinessTrip'>length_business_trip = #{lengthBusinessTrip},</if>
<if test ='null != timeOut'>time_out = #{timeOut},</if>
<if test ='null != totalOvertimeHours'>total_overtime_hours = #{totalOvertimeHours},</if>
<if test ='null != workingTurnCompenLeave'>working_turn_compen_leave = #{workingTurnCompenLeave},</if>
<if test ='null != restTurnCompenLeave'>rest_turn_compen_leave = #{restTurnCompenLeave},</if>
<if test ='null != holidayTurnCompenLeave'>holiday_turn_compen_leave = #{holidayTurnCompenLeave},</if>
<if test ='null != workingTransferOvertime'>working_transfer_overtime = #{workingTransferOvertime},</if>
<if test ='null != restTransferOvertime'>rest_transfer_overtime = #{restTransferOvertime},</if>
<if test ='null != holidayTransferOvertime'>holiday_transfer_overtime = #{holidayTransferOvertime},</if>
<if test ='null != day1'>day1 = #{day1},</if>
<if test ='null != day2'>day2 = #{day2},</if>
<if test ='null != day3'>day3 = #{day3},</if>
<if test ='null != day4'>day4 = #{day4},</if>
<if test ='null != day5'>day5 = #{day5},</if>
<if test ='null != day6'>day6 = #{day6},</if>
<if test ='null != day7'>day7 = #{day7},</if>
<if test ='null != day8'>day8 = #{day8},</if>
<if test ='null != day9'>day9 = #{day9},</if>
<if test ='null != day10'>day10 = #{day10},</if>
<if test ='null != day11'>day11 = #{day11},</if>
<if test ='null != day12'>day12 = #{day12},</if>
<if test ='null != day13'>day13 = #{day13},</if>
<if test ='null != day14'>day14 = #{day14},</if>
<if test ='null != day15'>day15 = #{day15},</if>
<if test ='null != day16'>day16 = #{day16},</if>
<if test ='null != day17'>day17 = #{day17},</if>
<if test ='null != day18'>day18 = #{day18},</if>
<if test ='null != day19'>day19 = #{day19},</if>
<if test ='null != day20'>day20 = #{day20},</if>
<if test ='null != day21'>day21 = #{day21},</if>
<if test ='null != day22'>day22 = #{day22},</if>
<if test ='null != day23'>day23 = #{day23},</if>
<if test ='null != day24'>day24 = #{day24},</if>
<if test ='null != day25'>day25 = #{day25},</if>
<if test ='null != day26'>day26 = #{day26},</if>
<if test ='null != day27'>day27 = #{day27},</if>
<if test ='null != day28'>day28 = #{day28},</if>
<if test ='null != day29'>day29 = #{day29},</if>
<if test ='null != day30'>day30 = #{day30},</if>
<if test ='null != day31'>day31 = #{day31},</if>
<if test ='null != belongYear'>belong_year = #{belongYear},</if>
<if test ='null != belongMonth'>belong_month = #{belongMonth},</if>
<if test ='null != orgCode'>org_code = #{orgCode},</if>
<if test ='null != lastModified'>last_modified = #{lastModified}</if>
</set>
WHERE id = #{id}
</update>
<select id="load" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM kqgl_asso_month_punch_summary
WHERE id = #{id}
</select>
<select id="pageList" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM kqgl_asso_month_punch_summary
LIMIT #{offset}, #{pageSize}
</select>
<select id="pageListCount" resultType="java.lang.Integer">
SELECT count(1)
FROM kqgl_asso_month_punch_summary
</select>
-->
</mapper>
\ No newline at end of file
src/main/resources/mapping/kqmk/KqglAssoOvertimeRangeMapper.xml
0 → 100644
View file @
0cf502e8
<?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.KqglAssoOvertimeRangeMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"cn.timer.api.bean.kqmk.KqglAssoOvertimeRange"
>
<id
column=
"id"
property=
"id"
/>
<result
column=
"overtime_rules_id"
property=
"overtimeRulesId"
/>
<result
column=
"attgroup_id"
property=
"attgroupId"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id,
overtime_rules_id,
attgroup_id
</sql>
<sql
id=
"Base_Column_List_Alias"
>
id KqglAssoOvertimeRange_id,
overtime_rules_id KqglAssoOvertimeRange_overtime_rules_id,
attgroup_id KqglAssoOvertimeRange_attgroup_id
</sql>
<insert
id=
"insertovertimerangelist"
parameterType=
"java.util.List"
>
insert into kqgl_asso_overtime_range (overtime_rules_id, attgroup_id)
<foreach
collection=
"list"
item=
"item"
index=
"index"
open=
"values "
close=
""
separator=
","
>
(
<if
test=
"item.overtimeRulesId != null"
>
#{item.overtimeRulesId,jdbcType=INTEGER},
</if>
<if
test=
"item.attgroupId != null"
>
#{item.attgroupId,jdbcType=INTEGER}
</if>
)
</foreach>
</insert>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.kqmk.KqglAssoOvertimeRange">
INSERT INTO kqgl_asso_overtime_range
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test ='null != overtimeRulesId'>
overtime_rules_id,
</if>
<if test ='null != attgroupId'>
attgroup_id
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test ='null != overtimeRulesId'>
#{overtimeRulesId},
</if>
<if test ='null != attgroupId'>
#{attgroupId}
</if>
</trim>
</insert>
<delete id="delete" >
DELETE FROM kqgl_asso_overtime_range
WHERE id = #{id}
</delete>
<update id="update" parameterType="cn.timer.api.bean.kqmk.KqglAssoOvertimeRange">
UPDATE kqgl_asso_overtime_range
<set>
<if test ='null != overtimeRulesId'>overtime_rules_id = #{overtimeRulesId},</if>
<if test ='null != attgroupId'>attgroup_id = #{attgroupId}</if>
</set>
WHERE id = #{id}
</update>
<select id="load" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM kqgl_asso_overtime_range
WHERE id = #{id}
</select>
<select id="pageList" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM kqgl_asso_overtime_range
LIMIT #{offset}, #{pageSize}
</select>
<select id="pageListCount" resultType="java.lang.Integer">
SELECT count(1)
FROM kqgl_asso_overtime_range
</select>
-->
</mapper>
\ No newline at end of file
src/main/resources/mapping/kqmk/KqglAssoPbmxMapper.xml
View file @
0cf502e8
...
...
@@ -94,6 +94,41 @@
and pbmx.`data` = #{date}
</select>
<insert
id=
"insertKqglAssoPbmxList"
parameterType=
"java.util.List"
>
insert into kqgl_asso_pbmx (userid, data, bcid, kqzid)
<foreach
collection=
"list"
item=
"item"
index=
"index"
open=
"values "
close=
""
separator=
","
>
(
<if
test=
"item.userid != null"
>
#{item.userid,jdbcType=INTEGER},
</if>
<if
test=
"item.data != null"
>
#{item.data,jdbcType=DATE},
</if>
<if
test=
"item.bcid != null"
>
#{item.bcid,jdbcType=INTEGER},
</if>
<if
test=
"item.kqzid != null"
>
#{item.kqzid,jdbcType=INTEGER}
</if>
)
</foreach>
</insert>
<select
id=
"selectAttGroupScheduling"
resultMap=
"AssoPbmxMap"
>
select pbmx.*,
info.`name` as username,
bcsz.`name` bcname,
SUBSTR(pbmx.`data`,1,7) as yemo,
SUBSTR(pbmx.`data`,9,10) as xsrq
from kqgl_asso_pbmx pbmx
LEFT JOIN yggl_main_emp as info on info.emp_num = pbmx.userid
LEFT JOIN kqgl_asso_bcsz as bcsz on bcsz.id = pbmx.bcid
where info.org_code = #{qyid,jdbcType=INTEGER}
<if
test=
"date != null"
>
and SUBSTR(pbmx.`data`,1,7) = #{date,jdbcType=VARCHAR}
</if>
and pbmx.kqzid = #{kqzid,jdbcType=INTEGER}
</select>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.kqmk.KqglAssoPbmx">
...
...
src/main/resources/mapping/kqmk/KqglAssoTeshuMapper.xml
View file @
0cf502e8
...
...
@@ -33,6 +33,31 @@
type KqglAssoTeshu_type
</sql>
<insert
id=
"insertKqglAssoTeshuList"
parameterType=
"java.util.List"
>
insert into kqgl_asso_teshu (kqzid, tsrq, bcid, lusj_time, luryid, type)
<foreach
collection=
"list"
item=
"item"
index=
"index"
open=
"values "
close=
""
separator=
","
>
(
<if
test=
"item.kqzid != null"
>
#{item.kqzid,jdbcType=INTEGER},
</if>
<if
test=
"item.tsrq != null"
>
#{item.tsrq,jdbcType=VARCHAR},
</if>
<if
test=
"item.bcid != null"
>
#{item.bcid,jdbcType=INTEGER},
</if>
<if
test=
"item.lusjTime != null"
>
#{item.lusjTime,jdbcType=BIGINT},
</if>
<if
test=
"item.luryid != null"
>
#{item.luryid,jdbcType=INTEGER},
</if>
<if
test=
"item.type != null"
>
#{item.type,jdbcType=INTEGER}
</if>
)
</foreach>
</insert>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.kqmk.KqglAssoTeshu">
...
...
src/main/resources/mapping/kqmk/KqglAssoYhkqzMapper.xml
0 → 100644
View file @
0cf502e8
<?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=
"insertKqglAssoKqzdkfsList"
parameterType=
"java.util.List"
>
insert into kqgl_asso_yhkqz (kqzid, userid, qyid)
<foreach
collection=
"list"
item=
"item"
index=
"index"
open=
"values "
close=
""
separator=
","
>
(
<if
test=
"item.kqzid != null"
>
#{item.kqzid,jdbcType=INTEGER},
</if>
<if
test=
"item.userid != null"
>
#{item.userid,jdbcType=INTEGER},
</if>
<if
test=
"item.qyid != null"
>
#{item.qyid,jdbcType=INTEGER}
</if>
)
</foreach>
</insert>
<!--
<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/KqglAssoZhoupaibanMapper.xml
View file @
0cf502e8
...
...
@@ -24,6 +24,23 @@
bcid KqglAssoZhoupaiban_bcid
</sql>
<insert
id=
"insertKqglAssoZhoupaibanList"
parameterType=
"java.util.List"
>
insert into kqgl_asso_zhoupaiban (kqzid, type, bcid)
<foreach
collection=
"list"
item=
"item"
index=
"index"
open=
"values "
close=
""
separator=
","
>
(
<if
test=
"item.kqzid != null"
>
#{item.kqzid,jdbcType=INTEGER},
</if>
<if
test=
"item.type != null"
>
#{item.type,jdbcType=INTEGER},
</if>
<if
test=
"item.bcid != null"
>
#{item.bcid,jdbcType=INTEGER}
</if>
)
</foreach>
</insert>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.kqmk.KqglAssoZhoupaiban">
...
...
src/main/resources/mapping/kqmk/KqglMainKqzMapper.xml
View file @
0cf502e8
...
...
@@ -24,6 +24,7 @@
<result
column=
"sybc"
property=
"sybc"
/>
<result
column=
"is_xzbcdk"
property=
"isXzbcdk"
/>
<result
column=
"is_wq"
property=
"isWq"
/>
<result
column=
"overtime_rules_id"
property=
"overtimeRulesId"
/>
</resultMap>
<resultMap
id=
"AuxiliaryMap"
type=
"cn.timer.api.dto.kqmk.KqglMainKqzDto"
>
...
...
@@ -47,6 +48,7 @@
<result
column=
"sybc"
property=
"sybc"
/>
<result
column=
"is_xzbcdk"
property=
"isXzbcdk"
/>
<result
column=
"is_wq"
property=
"isWq"
/>
<result
column=
"overtime_rules_id"
property=
"overtimeRulesId"
/>
<result
column=
"kqznum"
property=
"kqznum"
/>
<result
column=
"pbfsnm"
property=
"pbfsnm"
/>
...
...
@@ -74,7 +76,8 @@
is_wpbsdk,
sybc,
is_xzbcdk,
is_wq
is_wq,
overtime_rules_id
</sql>
<sql
id=
"Base_Column_List_Alias"
>
...
...
@@ -97,7 +100,8 @@
is_wpbsdk KqglMainKqz_is_wpbsdk,
sybc KqglMainKqz_sybc,
is_xzbcdk KqglMainKqz_is_xzbcdk,
is_wq KqglMainKqz_is_wq
is_wq KqglMainKqz_is_wq,
overtime_rules_id KqglMainKqz_overtime_rules_id
</sql>
<sql
id=
"Base_Column_List_a"
>
...
...
@@ -120,7 +124,8 @@
a.is_wpbsdk,
a.sybc,
a.is_xzbcdk,
a.is_wq
a.is_wq,
a.overtime_rules_id
</sql>
<select
id=
"selectAttGroupMachineByQyid"
resultMap=
"AuxiliaryMap"
>
...
...
@@ -138,6 +143,31 @@
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>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.kqmk.KqglMainKqz">
...
...
@@ -198,7 +228,10 @@
is_xzbcdk,
</if>
<if test ='null != isWq'>
is_wq
is_wq,
</if>
<if test ='null != overtimeRulesId'>
overtime_rules_id
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
...
...
@@ -257,7 +290,10 @@
#{isXzbcdk},
</if>
<if test ='null != isWq'>
#{isWq}
#{isWq},
</if>
<if test ='null != overtimeRulesId'>
#{overtimeRulesId}
</if>
</trim>
</insert>
...
...
@@ -288,7 +324,8 @@
<if test ='null != isWpbsdk'>is_wpbsdk = #{isWpbsdk},</if>
<if test ='null != sybc'>sybc = #{sybc},</if>
<if test ='null != isXzbcdk'>is_xzbcdk = #{isXzbcdk},</if>
<if test ='null != isWq'>is_wq = #{isWq}</if>
<if test ='null != isWq'>is_wq = #{isWq},</if>
<if test ='null != overtimeRulesId'>overtime_rules_id = #{overtimeRulesId}</if>
</set>
WHERE id = #{id}
</update>
...
...
src/main/resources/mapping/qyzx/QyzxOperLogMapper.xml
0 → 100644
View file @
0cf502e8
<?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.qyzx.QyzxOperLogMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"cn.timer.api.bean.qyzx.QyzxOperLog"
>
<result
column=
"oper_id"
property=
"operId"
/>
<result
column=
"org_code"
property=
"orgCode"
/>
<result
column=
"emp_num"
property=
"empNum"
/>
<result
column=
"title"
property=
"title"
/>
<result
column=
"business_type"
property=
"businessType"
/>
<result
column=
"method"
property=
"method"
/>
<result
column=
"request_method"
property=
"requestMethod"
/>
<result
column=
"operator_type"
property=
"operatorType"
/>
<result
column=
"oper_name"
property=
"operName"
/>
<result
column=
"dept_name"
property=
"deptName"
/>
<result
column=
"oper_url"
property=
"operUrl"
/>
<result
column=
"oper_ip"
property=
"operIp"
/>
<result
column=
"oper_location"
property=
"operLocation"
/>
<result
column=
"oper_param"
property=
"operParam"
/>
<result
column=
"json_result"
property=
"jsonResult"
/>
<result
column=
"status"
property=
"status"
/>
<result
column=
"error_msg"
property=
"errorMsg"
/>
<result
column=
"oper_time"
property=
"operTime"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
oper_id,
org_code,
emp_num,
title,
business_type,
method,
request_method,
operator_type,
oper_name,
dept_name,
oper_url,
oper_ip,
oper_location,
<!-- oper_param, -->
json_result,
status,
error_msg,
oper_time
</sql>
<sql
id=
"Base_Column_List_Alias"
>
oper_id QyzxOperLog_oper_id,
org_code QyzxOperLog_org_code,
emp_num QyzxOperLog_emp_num,
title QyzxOperLog_title,
business_type QyzxOperLog_business_type,
method QyzxOperLog_method,
request_method QyzxOperLog_request_method,
operator_type QyzxOperLog_operator_type,
oper_name QyzxOperLog_oper_name,
dept_name QyzxOperLog_dept_name,
oper_url QyzxOperLog_oper_url,
oper_ip QyzxOperLog_oper_ip,
oper_location QyzxOperLog_oper_location,
oper_param QyzxOperLog_oper_param,
json_result QyzxOperLog_json_result,
status QyzxOperLog_status,
error_msg QyzxOperLog_error_msg,
oper_time QyzxOperLog_oper_time
</sql>
<select
id=
"selectPageByQuery"
resultMap=
"BaseResultMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM qyzx_oper_log a
WHERE a.org_code = #{param.orgCode}
<if
test=
"param.query != null and param.query != ''"
>
and (
a.title like CONCAT('%',#{param.query},'%') or
a.oper_name like CONCAT('%',#{param.query},'%') or
a.oper_id like CONCAT('%',#{param.query},'%')
)
</if>
<if
test=
"param.businessType != null"
>
and a.business_type = #{param.businessType}
</if>
<if
test=
"param.operatorType != null"
>
and a.operator_type = #{param.operatorType}
</if>
<if
test=
"param.requestMethod != null"
>
and a.request_method = #{param.requestMethod}
</if>
<if
test=
"param.startTime != null and param.startTime != ''"
>
and a.oper_time
<![CDATA[ >= ]]>
#{param.startTime}
</if>
<if
test=
"param.endTime != null and param.endTime != ''"
>
and a.oper_time
<![CDATA[ <= ]]>
#{param.endTime}
</if>
ORDER BY a.oper_time DESC
</select>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.qyzx.QyzxOperLog">
INSERT INTO qyzx_oper_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test ='null != operId'>
oper_id,
</if>
<if test ='null != orgCode'>
org_code,
</if>
<if test ='null != empNum'>
emp_num,
</if>
<if test ='null != title'>
title,
</if>
<if test ='null != businessType'>
business_type,
</if>
<if test ='null != method'>
method,
</if>
<if test ='null != requestMethod'>
request_method,
</if>
<if test ='null != operatorType'>
operator_type,
</if>
<if test ='null != operName'>
oper_name,
</if>
<if test ='null != deptName'>
dept_name,
</if>
<if test ='null != operUrl'>
oper_url,
</if>
<if test ='null != operIp'>
oper_ip,
</if>
<if test ='null != operLocation'>
oper_location,
</if>
<if test ='null != operParam'>
oper_param,
</if>
<if test ='null != jsonResult'>
json_result,
</if>
<if test ='null != status'>
status,
</if>
<if test ='null != errorMsg'>
error_msg,
</if>
<if test ='null != operTime'>
oper_time
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test ='null != operId'>
#{operId},
</if>
<if test ='null != orgCode'>
#{orgCode},
</if>
<if test ='null != empNum'>
#{empNum},
</if>
<if test ='null != title'>
#{title},
</if>
<if test ='null != businessType'>
#{businessType},
</if>
<if test ='null != method'>
#{method},
</if>
<if test ='null != requestMethod'>
#{requestMethod},
</if>
<if test ='null != operatorType'>
#{operatorType},
</if>
<if test ='null != operName'>
#{operName},
</if>
<if test ='null != deptName'>
#{deptName},
</if>
<if test ='null != operUrl'>
#{operUrl},
</if>
<if test ='null != operIp'>
#{operIp},
</if>
<if test ='null != operLocation'>
#{operLocation},
</if>
<if test ='null != operParam'>
#{operParam},
</if>
<if test ='null != jsonResult'>
#{jsonResult},
</if>
<if test ='null != status'>
#{status},
</if>
<if test ='null != errorMsg'>
#{errorMsg},
</if>
<if test ='null != operTime'>
#{operTime}
</if>
</trim>
</insert>
<delete id="delete" >
DELETE FROM qyzx_oper_log
WHERE id = #{id}
</delete>
<update id="update" parameterType="cn.timer.api.bean.qyzx.QyzxOperLog">
UPDATE qyzx_oper_log
<set>
<if test ='null != operId'>oper_id = #{operId},</if>
<if test ='null != orgCode'>org_code = #{orgCode},</if>
<if test ='null != empNum'>emp_num = #{empNum},</if>
<if test ='null != title'>title = #{title},</if>
<if test ='null != businessType'>business_type = #{businessType},</if>
<if test ='null != method'>method = #{method},</if>
<if test ='null != requestMethod'>request_method = #{requestMethod},</if>
<if test ='null != operatorType'>operator_type = #{operatorType},</if>
<if test ='null != operName'>oper_name = #{operName},</if>
<if test ='null != deptName'>dept_name = #{deptName},</if>
<if test ='null != operUrl'>oper_url = #{operUrl},</if>
<if test ='null != operIp'>oper_ip = #{operIp},</if>
<if test ='null != operLocation'>oper_location = #{operLocation},</if>
<if test ='null != operParam'>oper_param = #{operParam},</if>
<if test ='null != jsonResult'>json_result = #{jsonResult},</if>
<if test ='null != status'>status = #{status},</if>
<if test ='null != errorMsg'>error_msg = #{errorMsg},</if>
<if test ='null != operTime'>oper_time = #{operTime}</if>
</set>
WHERE id = #{id}
</update>
<select id="load" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM qyzx_oper_log
WHERE id = #{id}
</select>
<select id="pageList" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM qyzx_oper_log
LIMIT #{offset}, #{pageSize}
</select>
<select id="pageListCount" resultType="java.lang.Integer">
SELECT count(1)
FROM qyzx_oper_log
</select>
-->
</mapper>
\ No newline at end of file
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