Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
attendance-performance-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
attendance-performance-platform
Commits
18785865
Commit
18785865
authored
Jul 12, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加外部数据来源实现
parent
77293de4
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
498 additions
and
107 deletions
+498
-107
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/BaseReq.java
...-manager/src/main/java/com/mortals/xhx/busiz/BaseReq.java
+32
-2
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/dingtalk/api/TalkApiController.java
...com/mortals/xhx/busiz/dingtalk/api/TalkApiController.java
+2
-2
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/req/AttendSaveReq.java
...rc/main/java/com/mortals/xhx/busiz/req/AttendSaveReq.java
+52
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/req/ComplainSaveReq.java
.../main/java/com/mortals/xhx/busiz/req/ComplainSaveReq.java
+47
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/req/EffectSaveReq.java
...rc/main/java/com/mortals/xhx/busiz/req/EffectSaveReq.java
+30
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/req/GoWorkSaveReq.java
...rc/main/java/com/mortals/xhx/busiz/req/GoWorkSaveReq.java
+36
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/req/OtherSaveReq.java
...src/main/java/com/mortals/xhx/busiz/req/OtherSaveReq.java
+33
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/req/ReviewSaveReq.java
...rc/main/java/com/mortals/xhx/busiz/req/ReviewSaveReq.java
+5
-32
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/rsp/PerformDetailInfo.java
...ain/java/com/mortals/xhx/busiz/rsp/PerformDetailInfo.java
+2
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/web/ApiWebPerformController.java
...va/com/mortals/xhx/busiz/web/ApiWebPerformController.java
+258
-69
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/web/TestController.java
...c/main/java/com/mortals/xhx/busiz/web/TestController.java
+1
-2
No files found.
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/BaseReq.java
View file @
18785865
...
...
@@ -6,11 +6,10 @@ import com.mortals.xhx.common.code.ProcessStatusEnum;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
@Data
public
abstract
class
BaseReq
implements
Serializable
{
/**
* 当前页
*/
...
...
@@ -21,4 +20,35 @@ public abstract class BaseReq implements Serializable {
private
Integer
size
;
/**
* 工号
*/
private
String
workNum
;
/**
* 标题
*/
private
String
title
;
/**
* 扣分时间
*/
private
Date
happenTime
;
/**
* 规则编码
*/
private
String
ruleCode
;
private
String
phone
;
/**
* 类型
*/
private
String
performType
;
}
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/dingtalk/api/TalkApiController.java
View file @
18785865
...
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONObject
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.service.ICacheService
;
import
com.mortals.xhx.busiz.dingtalk.config.TalkConfiguration
;
import
com.mortals.xhx.busiz.dingtalk.req.DingTalkBaseReq
;
import
com.mortals.xhx.common.code.YesNoEnum
;
...
...
@@ -29,6 +30,7 @@ public class TalkApiController {
private
TalkConfiguration
talkConfiguration
;
/**
* 获取token
*
...
...
@@ -39,8 +41,6 @@ public class TalkApiController {
log
.
info
(
"收到【getToken】请求【请求体】--> {}"
,
JSON
.
toJSONString
(
dingTalkBaseReq
));
try
{
// DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/gettoken");
// OapiGettokenRequest req = new OapiGettokenRequest();
// req.setHttpMethod("GET");
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/req/AttendSaveReq.java
0 → 100644
View file @
18785865
package
com.mortals.xhx.busiz.req
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.mortals.xhx.busiz.BaseReq
;
import
lombok.Data
;
import
java.util.Date
;
@Data
public
class
AttendSaveReq
extends
BaseReq
{
/**
* 所属考勤组ID
*/
private
Long
attendanceGroupId
;
/**
* 所属考勤组名称
*/
private
String
attendanceGroupName
;
/**
* 考勤时间
*/
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
attendanceDate
;
/**
* 异常时间
*/
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
errorTime
;
/**
* 上下班时间
*/
private
String
goOffTimeStr
;
/**
* 实际打卡时间
*/
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
actualAttendTime
;
/**
* 异常处理结果
*/
private
String
errorResult
;
/**
* 扩展字段
*/
private
String
ext
;
}
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/req/ComplainSaveReq.java
0 → 100644
View file @
18785865
package
com.mortals.xhx.busiz.req
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.mortals.xhx.busiz.BaseReq
;
import
lombok.Data
;
import
java.util.Date
;
@Data
public
class
ComplainSaveReq
extends
BaseReq
{
/**
* 投诉标题
*/
private
String
complainTitle
;
/**
* 投诉内容
*/
private
String
complainContent
;
/**
* 投诉人真实姓名
*/
private
String
complainRealName
;
/**
* 联系电话
*/
private
String
contact
;
/**
* 投诉时间
*/
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
complainTime
;
/**
* 投诉来源
*/
private
String
complainSource
;
/**
* 投诉设备
*/
private
String
complainDevice
;
}
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/req/EffectSaveReq.java
0 → 100644
View file @
18785865
package
com.mortals.xhx.busiz.req
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.mortals.framework.annotation.Excel
;
import
com.mortals.xhx.busiz.BaseReq
;
import
lombok.Data
;
import
java.util.Date
;
@Data
public
class
EffectSaveReq
extends
BaseReq
{
/**
* 违规类型(1.脱岗,2.离岗,3.玩手机,4.睡觉)
*/
private
Integer
irregularType
;
/**
* 发生时间
*/
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
happenTime
;
/**
* 持续时间,秒
*/
private
Integer
duration
;
/**
* 报警时间
*/
private
Date
alarmTime
;
}
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/req/GoWorkSaveReq.java
0 → 100644
View file @
18785865
package
com.mortals.xhx.busiz.req
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.mortals.xhx.busiz.BaseReq
;
import
lombok.Data
;
import
java.util.Date
;
@Data
public
class
GoWorkSaveReq
extends
BaseReq
{
/**
* 办件编码
*/
private
String
goworkCode
;
/**
* 办件所属部门
*/
private
String
goworkDepts
;
/**
* 事项名称
*/
private
String
matterlName
;
/**
* 办理时间
*/
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
goworkTime
;
/**
* 扩展字段
*/
private
String
ext
;
}
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/req/OtherSaveReq.java
0 → 100644
View file @
18785865
package
com.mortals.xhx.busiz.req
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.mortals.xhx.busiz.BaseReq
;
import
lombok.Data
;
import
java.util.Date
;
@Data
public
class
OtherSaveReq
extends
BaseReq
{
/**
* 违规类型(1.工作纪律)
*/
private
Integer
irregularOtherType
;
/**
* 发生时间
*/
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
happenTime
;
/**
* 评分标准
*/
private
String
ruleDesc
;
/**
* 扩展字段
*/
private
String
ext
;
}
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/req/
Perform
SaveReq.java
→
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/req/
Review
SaveReq.java
View file @
18785865
package
com.mortals.xhx.busiz.req
;
import
com.
mortals.framework.annotation.Excel
;
import
com.
fasterxml.jackson.annotation.JsonFormat
;
import
com.mortals.xhx.busiz.BaseReq
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.util.Date
;
@Data
public
class
PerformSaveReq
extends
BaseReq
{
/**
* 工号
*/
private
String
workNum
;
/**
* 标题
*/
private
String
title
;
/**
* 扣分时间
*/
private
Date
happenTime
;
/**
* 规则编码
*/
private
String
ruleCode
;
private
String
phone
;
/**
* 类型
*/
private
String
performType
;
public
class
ReviewSaveReq
extends
BaseReq
{
/**
* 评价结果(1.非常不满意,2.差评)
...
...
@@ -47,6 +17,7 @@ public class PerformSaveReq extends BaseReq {
/**
* 评价时间
*/
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
reviewTime
;
/**
* 评价来源(窗口评价系统,导视系统,自助服务系统,微官网,其它)
...
...
@@ -57,4 +28,6 @@ public class PerformSaveReq extends BaseReq {
*/
private
String
reviewDevice
;
}
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/rsp/PerformDetailInfo.java
View file @
18785865
...
...
@@ -119,6 +119,8 @@ public class PerformDetailInfo {
*/
private
String
filePaths
;
/**
* 评价结果(1.非常不满意,2.差评)
*/
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/web/ApiWebPerformController.java
View file @
18785865
...
...
@@ -2,20 +2,20 @@ package com.mortals.xhx.busiz.web;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.mortals.framework.annotation.UnAuth
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.xhx.base.framework.annotation.ApiUserAuth
;
import
com.mortals.xhx.busiz.req.PerformReq
;
import
com.mortals.xhx.busiz.req.PerformSaveReq
;
import
com.mortals.xhx.busiz.req.*
;
import
com.mortals.xhx.busiz.rsp.ApiResp
;
import
com.mortals.xhx.common.code.ApiRespCodeEnum
;
import
com.mortals.xhx.common.code.PerformTypeEnum
;
import
com.mortals.xhx.module.perform.model.PerformAttendRecordEntity
;
import
com.mortals.xhx.module.perform.model.PerformReviewRecordEntity
;
import
com.mortals.xhx.module.perform.model.PerformRulesEntity
;
import
com.mortals.xhx.module.perform.model.*
;
import
com.mortals.xhx.module.perform.service.*
;
import
com.mortals.xhx.module.staff.model.StaffEntity
;
import
com.mortals.xhx.module.staff.model.StaffQuery
;
import
com.mortals.xhx.module.staff.service.StaffService
;
import
javafx.scene.effect.Effect
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -30,7 +30,7 @@ import java.util.Date;
@RestController
@Slf4j
@RequestMapping
(
"/api/v1/web/
perform
"
)
@RequestMapping
(
"/api/v1/web/"
)
public
class
ApiWebPerformController
extends
AbstractBaseController
<
PerformReq
>
{
@Autowired
...
...
@@ -52,65 +52,173 @@ public class ApiWebPerformController extends AbstractBaseController<PerformReq>
/**
*
绩效外部
新增
*
考勤
新增
*
* @param req
* @return
*/
@PostMapping
(
"save"
)
@
ApiUser
Auth
public
String
receive
(
HttpServletRequest
request
,
@RequestBody
Perform
SaveReq
req
)
{
ApiResp
<
String
>
rsp
=
new
ApiResp
<>();
rsp
.
setMsg
(
ApiRespCodeEnum
.
SUCCESS
.
getLabel
())
;
rsp
.
setCode
(
ApiRespCodeEnum
.
SUCCESS
.
getValue
()
);
@PostMapping
(
"
attend/
save"
)
@
Un
Auth
public
Rest
<
Void
>
attendSave
(
@RequestBody
Attend
SaveReq
req
)
{
String
busiDesc
=
"外部考勤新增"
;
Rest
rest
=
Rest
.
ok
(
busiDesc
+
"成功!"
);
StringBuilder
message
=
new
StringBuilder
();
message
.
append
(
String
.
format
(
"【外部请求】类型【%s】 内容:%s"
,
PerformTypeEnum
.
getByValue
(
req
.
getPerformType
()).
getDesc
(),
JSONObject
.
toJSONString
(
req
)));
try
{
if
(
ObjectUtils
.
isEmpty
(
req
.
getPhone
()))
throw
new
AppException
(
"手机号码不能为空!"
);
if
(
ObjectUtils
.
isEmpty
(
req
.
getRuleCode
()))
throw
new
AppException
(
"绩效规则编码不能为空!"
);
boolean
bool
=
attend
(
req
);
if
(!
bool
)
throw
new
AppException
(
busiDesc
+
"失败!"
);
}
catch
(
Exception
e
)
{
log
.
error
(
busiDesc
,
e
);
return
Rest
.
fail
(
e
.
getMessage
());
}
log
.
info
(
"响应【{}】【响应体】--> {} "
,
busiDesc
,
JSONObject
.
toJSONString
(
rest
));
return
rest
;
}
/**
* 评价新增
*
* @param req
* @return
*/
@PostMapping
(
"review/save"
)
@UnAuth
public
Rest
<
Void
>
reviewSave
(
@RequestBody
ReviewSaveReq
req
)
{
switch
(
PerformTypeEnum
.
getByValue
(
req
.
getPerformType
()))
{
case
考勤绩效:
attend
(
req
);
break
;
case
评价差评绩效:
review
(
req
);
break
;
case
评价投诉绩效:
complain
(
req
);
break
;
case
办件绩效:
gowork
(
req
);
break
;
case
效能绩效:
effect
(
req
);
break
;
case
其它绩效:
other
(
req
);
break
;
}
}
catch
(
AppException
e
)
{
log
.
error
(
"接收数据失败"
,
e
);
rsp
.
setCode
(
e
.
getCode
());
rsp
.
setMsg
(
e
.
getMessage
());
return
JSON
.
toJSONString
(
rsp
);
String
busiDesc
=
"外部评价新增"
;
Rest
rest
=
Rest
.
ok
(
busiDesc
+
"成功!"
);
StringBuilder
message
=
new
StringBuilder
();
message
.
append
(
String
.
format
(
"【外部请求】类型【%s】 内容:%s"
,
PerformTypeEnum
.
getByValue
(
req
.
getPerformType
()).
getDesc
(),
JSONObject
.
toJSONString
(
req
)));
try
{
if
(
ObjectUtils
.
isEmpty
(
req
.
getPhone
()))
throw
new
AppException
(
"手机号码不能为空!"
);
if
(
ObjectUtils
.
isEmpty
(
req
.
getRuleCode
()))
throw
new
AppException
(
"绩效规则编码不能为空!"
);
boolean
bool
=
review
(
req
);
if
(!
bool
)
throw
new
AppException
(
busiDesc
+
"失败!"
);
}
catch
(
Exception
e
)
{
log
.
error
(
busiDesc
,
e
);
return
Rest
.
fail
(
e
.
getMessage
());
}
log
.
info
(
"响应【{}】【响应体】--> {} "
,
busiDesc
,
JSONObject
.
toJSONString
(
rest
));
return
rest
;
}
/**
* 投诉新增
*
* @param req
* @return
*/
@PostMapping
(
"complain/save"
)
@UnAuth
public
Rest
<
Void
>
complainSave
(
@RequestBody
ComplainSaveReq
req
)
{
String
busiDesc
=
"外部投诉新增"
;
Rest
rest
=
Rest
.
ok
(
busiDesc
+
"成功!"
);
StringBuilder
message
=
new
StringBuilder
();
message
.
append
(
String
.
format
(
"【外部请求】类型【%s】 内容:%s"
,
PerformTypeEnum
.
getByValue
(
req
.
getPerformType
()).
getDesc
(),
JSONObject
.
toJSONString
(
req
)));
try
{
if
(
ObjectUtils
.
isEmpty
(
req
.
getPhone
()))
throw
new
AppException
(
"手机号码不能为空!"
);
if
(
ObjectUtils
.
isEmpty
(
req
.
getRuleCode
()))
throw
new
AppException
(
"绩效规则编码不能为空!"
);
boolean
bool
=
complain
(
req
);
if
(!
bool
)
throw
new
AppException
(
busiDesc
+
"失败!"
);
}
catch
(
Exception
e
)
{
log
.
error
(
busiDesc
,
e
);
return
Rest
.
fail
(
e
.
getMessage
());
}
log
.
info
(
"响应【{}】【响应体】--> {} "
,
busiDesc
,
JSONObject
.
toJSONString
(
rest
));
return
rest
;
}
/**
* 办件新增
*
* @param req
* @return
*/
@PostMapping
(
"gowork/save"
)
@UnAuth
public
Rest
<
Void
>
goworkSave
(
@RequestBody
GoWorkSaveReq
req
)
{
String
busiDesc
=
"外部办件新增"
;
Rest
rest
=
Rest
.
ok
(
busiDesc
+
"成功!"
);
StringBuilder
message
=
new
StringBuilder
();
message
.
append
(
String
.
format
(
"【外部请求】类型【%s】 内容:%s"
,
PerformTypeEnum
.
getByValue
(
req
.
getPerformType
()).
getDesc
(),
JSONObject
.
toJSONString
(
req
)));
try
{
if
(
ObjectUtils
.
isEmpty
(
req
.
getPhone
()))
throw
new
AppException
(
"手机号码不能为空!"
);
if
(
ObjectUtils
.
isEmpty
(
req
.
getRuleCode
()))
throw
new
AppException
(
"绩效规则编码不能为空!"
);
boolean
bool
=
gowork
(
req
);
if
(!
bool
)
throw
new
AppException
(
busiDesc
+
"失败!"
);
}
catch
(
Exception
e
)
{
log
.
error
(
busiDesc
,
e
);
return
Rest
.
fail
(
e
.
getMessage
());
}
log
.
info
(
"响应【{}】【响应体】--> {} "
,
busiDesc
,
JSONObject
.
toJSONString
(
rest
));
return
rest
;
}
/**
* 效能新增
*
* @param req
* @return
*/
@PostMapping
(
"effect/save"
)
@UnAuth
public
Rest
<
Void
>
effectSave
(
@RequestBody
EffectSaveReq
req
)
{
String
busiDesc
=
"外部效能新增"
;
Rest
rest
=
Rest
.
ok
(
busiDesc
+
"成功!"
);
StringBuilder
message
=
new
StringBuilder
();
message
.
append
(
String
.
format
(
"【外部请求】类型【%s】 内容:%s"
,
PerformTypeEnum
.
getByValue
(
req
.
getPerformType
()).
getDesc
(),
JSONObject
.
toJSONString
(
req
)));
try
{
if
(
ObjectUtils
.
isEmpty
(
req
.
getPhone
()))
throw
new
AppException
(
"手机号码不能为空!"
);
if
(
ObjectUtils
.
isEmpty
(
req
.
getRuleCode
()))
throw
new
AppException
(
"绩效规则编码不能为空!"
);
boolean
bool
=
effect
(
req
);
if
(!
bool
)
throw
new
AppException
(
busiDesc
+
"失败!"
);
}
catch
(
Exception
e
)
{
log
.
error
(
busiDesc
,
e
);
return
Rest
.
fail
(
e
.
getMessage
());
}
log
.
info
(
"响应【{}】【响应体】--> {} "
,
busiDesc
,
JSONObject
.
toJSONString
(
rest
));
return
rest
;
}
/**
* 其它新增
*
* @param req
* @return
*/
@PostMapping
(
"other/save"
)
@UnAuth
public
Rest
<
Void
>
otherSave
(
@RequestBody
OtherSaveReq
req
)
{
String
busiDesc
=
"外部其它绩效新增"
;
Rest
rest
=
Rest
.
ok
(
busiDesc
+
"成功!"
);
StringBuilder
message
=
new
StringBuilder
();
message
.
append
(
String
.
format
(
"【外部请求】类型【%s】 内容:%s"
,
PerformTypeEnum
.
getByValue
(
req
.
getPerformType
()).
getDesc
(),
JSONObject
.
toJSONString
(
req
)));
try
{
if
(
ObjectUtils
.
isEmpty
(
req
.
getPhone
()))
throw
new
AppException
(
"手机号码不能为空!"
);
if
(
ObjectUtils
.
isEmpty
(
req
.
getRuleCode
()))
throw
new
AppException
(
"绩效规则编码不能为空!"
);
boolean
bool
=
other
(
req
);
if
(!
bool
)
throw
new
AppException
(
busiDesc
+
"失败!"
);
}
catch
(
Exception
e
)
{
log
.
error
(
"接收数据失败"
,
e
);
rsp
.
setCode
(
ApiRespCodeEnum
.
FAILED
.
getValue
());
rsp
.
setMsg
(
e
.
getMessage
());
return
JSON
.
toJSONString
(
rsp
);
log
.
error
(
busiDesc
,
e
);
return
Rest
.
fail
(
e
.
getMessage
());
}
recordSysLog
(
request
,
message
.
toString
());
log
.
info
(
"响应【设备接收】【响应体】--> "
+
JSONObject
.
toJSONString
(
rsp
));
return
JSON
.
toJSONString
(
rsp
);
log
.
info
(
"响应【{}】【响应体】--> {} "
,
busiDesc
,
JSONObject
.
toJSONString
(
rest
));
return
rest
;
}
private
void
attend
(
PerformSaveReq
req
)
throws
AppException
{
private
boolean
attend
(
AttendSaveReq
req
)
throws
AppException
{
//考勤保存
//通过手机号码查询员工属性
StaffEntity
staffEntity
=
getStaff
(
req
);
PerformRulesEntity
rule
=
getRule
(
req
);
PerformRulesEntity
rule
=
getRule
(
req
.
getRuleCode
()
);
StaffEntity
staffEntity
=
getStaff
(
req
.
getPhone
()
);
PerformAttendRecordEntity
recordEntity
=
new
PerformAttendRecordEntity
();
recordEntity
.
initAttrValue
();
...
...
@@ -126,17 +234,19 @@ public class ApiWebPerformController extends AbstractBaseController<PerformReq>
recordEntity
.
setCategoryId
(
rule
.
getCategoryId
());
recordEntity
.
setCategoryName
(
rule
.
getCategoryName
());
recordEntity
.
setCreateUserId
(
1L
);
recordEntity
.
setCreateTime
(
new
Date
());
attendRecordService
.
save
(
recordEntity
);
PerformAttendRecordEntity
save
=
attendRecordService
.
save
(
recordEntity
);
return
save
.
newEntity
();
}
private
void
review
(
Perform
SaveReq
req
)
throws
AppException
{
private
boolean
review
(
Review
SaveReq
req
)
throws
AppException
{
//评价保存
StaffEntity
staffEntity
=
getStaff
(
req
);
PerformRulesEntity
rule
=
getRule
(
req
);
StaffEntity
staffEntity
=
getStaff
(
req
.
getPhone
()
);
PerformRulesEntity
rule
=
getRule
(
req
.
getRuleCode
()
);
PerformReviewRecordEntity
recordEntity
=
new
PerformReviewRecordEntity
();
...
...
@@ -144,8 +254,6 @@ public class ApiWebPerformController extends AbstractBaseController<PerformReq>
BeanUtils
.
copyProperties
(
req
,
recordEntity
);
recordEntity
.
setStaffId
(
staffEntity
.
getId
());
recordEntity
.
setStaffName
(
staffEntity
.
getName
());
recordEntity
.
setSubAddType
(
rule
.
getSubAddType
());
recordEntity
.
setScore
(
rule
.
getScore
());
recordEntity
.
setRuleId
(
rule
.
getId
());
...
...
@@ -153,49 +261,130 @@ public class ApiWebPerformController extends AbstractBaseController<PerformReq>
recordEntity
.
setCategoryId
(
rule
.
getCategoryId
());
recordEntity
.
setCategoryName
(
rule
.
getCategoryName
());
recordEntity
.
setCreateUserId
(
1L
);
recordEntity
.
setCreateTime
(
new
Date
());
reviewRecordService
.
save
(
recordEntity
);
PerformReviewRecordEntity
save
=
reviewRecordService
.
save
(
recordEntity
);
return
save
.
newEntity
();
}
private
void
complain
(
Perform
SaveReq
req
)
throws
AppException
{
private
boolean
complain
(
Complain
SaveReq
req
)
throws
AppException
{
//投诉保存
StaffEntity
staffEntity
=
getStaff
(
req
.
getPhone
());
PerformRulesEntity
rule
=
getRule
(
req
.
getRuleCode
());
PerformComplainRecordEntity
recordEntity
=
new
PerformComplainRecordEntity
();
recordEntity
.
initAttrValue
();
BeanUtils
.
copyProperties
(
req
,
recordEntity
);
recordEntity
.
setStaffId
(
staffEntity
.
getId
());
recordEntity
.
setStaffName
(
staffEntity
.
getName
());
recordEntity
.
setSubAddType
(
rule
.
getSubAddType
());
recordEntity
.
setScore
(
rule
.
getScore
());
recordEntity
.
setRuleId
(
rule
.
getId
());
recordEntity
.
setRuleName
(
rule
.
getName
());
recordEntity
.
setCategoryId
(
rule
.
getCategoryId
());
recordEntity
.
setCategoryName
(
rule
.
getCategoryName
());
recordEntity
.
setCreateUserId
(
1L
);
recordEntity
.
setCreateTime
(
new
Date
());
PerformComplainRecordEntity
save
=
complainRecordService
.
save
(
recordEntity
);
return
save
.
newEntity
();
}
private
void
gowork
(
Perform
SaveReq
req
)
throws
AppException
{
private
boolean
gowork
(
GoWork
SaveReq
req
)
throws
AppException
{
//办件保存
StaffEntity
staffEntity
=
getStaff
(
req
.
getPhone
());
PerformRulesEntity
rule
=
getRule
(
req
.
getRuleCode
());
PerformGoworkRecordEntity
recordEntity
=
new
PerformGoworkRecordEntity
();
recordEntity
.
initAttrValue
();
BeanUtils
.
copyProperties
(
req
,
recordEntity
);
recordEntity
.
setStaffId
(
staffEntity
.
getId
());
recordEntity
.
setStaffName
(
staffEntity
.
getName
());
recordEntity
.
setSubAddType
(
rule
.
getSubAddType
());
recordEntity
.
setScore
(
rule
.
getScore
());
recordEntity
.
setRuleId
(
rule
.
getId
());
recordEntity
.
setRuleName
(
rule
.
getName
());
recordEntity
.
setCategoryId
(
rule
.
getCategoryId
());
recordEntity
.
setCategoryName
(
rule
.
getCategoryName
());
recordEntity
.
setCreateUserId
(
1L
);
recordEntity
.
setCreateTime
(
new
Date
());
PerformGoworkRecordEntity
save
=
performGoworkRecordService
.
save
(
recordEntity
);
return
save
.
newEntity
();
}
private
void
effect
(
Perform
SaveReq
req
)
throws
AppException
{
private
boolean
effect
(
Effect
SaveReq
req
)
throws
AppException
{
//效能保存
StaffEntity
staffEntity
=
getStaff
(
req
.
getPhone
());
PerformRulesEntity
rule
=
getRule
(
req
.
getRuleCode
());
PerformEffectRecordEntity
recordEntity
=
new
PerformEffectRecordEntity
();
recordEntity
.
initAttrValue
();
BeanUtils
.
copyProperties
(
req
,
recordEntity
);
recordEntity
.
setStaffId
(
staffEntity
.
getId
());
recordEntity
.
setStaffName
(
staffEntity
.
getName
());
recordEntity
.
setSubAddType
(
rule
.
getSubAddType
());
recordEntity
.
setScore
(
rule
.
getScore
());
recordEntity
.
setRuleId
(
rule
.
getId
());
recordEntity
.
setRuleName
(
rule
.
getName
());
recordEntity
.
setCategoryId
(
rule
.
getCategoryId
());
recordEntity
.
setCategoryName
(
rule
.
getCategoryName
());
recordEntity
.
setCreateUserId
(
1L
);
recordEntity
.
setCreateTime
(
new
Date
());
PerformEffectRecordEntity
save
=
effectRecordService
.
save
(
recordEntity
);
return
save
.
newEntity
();
}
private
void
other
(
Perform
SaveReq
req
)
throws
AppException
{
private
boolean
other
(
Other
SaveReq
req
)
throws
AppException
{
//其它保存
}
StaffEntity
staffEntity
=
getStaff
(
req
.
getPhone
());
PerformRulesEntity
rule
=
getRule
(
req
.
getRuleCode
());
PerformOtherRecordEntity
recordEntity
=
new
PerformOtherRecordEntity
();
recordEntity
.
initAttrValue
();
BeanUtils
.
copyProperties
(
req
,
recordEntity
);
recordEntity
.
setStaffId
(
staffEntity
.
getId
());
recordEntity
.
setStaffName
(
staffEntity
.
getName
());
recordEntity
.
setSubAddType
(
rule
.
getSubAddType
());
recordEntity
.
setScore
(
rule
.
getScore
());
recordEntity
.
setRuleId
(
rule
.
getId
());
recordEntity
.
setRuleName
(
rule
.
getName
());
recordEntity
.
setCategoryId
(
rule
.
getCategoryId
());
recordEntity
.
setCategoryName
(
rule
.
getCategoryName
());
recordEntity
.
setCreateUserId
(
1L
);
recordEntity
.
setCreateTime
(
new
Date
());
PerformOtherRecordEntity
save
=
otherRecordService
.
save
(
recordEntity
);
return
save
.
newEntity
();
}
private
PerformRulesEntity
getRule
(
PerformSaveReq
req
)
{
PerformRulesEntity
rule
=
rulesService
.
getCache
(
r
eq
.
getRuleCode
()
);
private
PerformRulesEntity
getRule
(
String
ruleCode
)
{
PerformRulesEntity
rule
=
rulesService
.
getCache
(
r
uleCode
);
if
(
ObjectUtils
.
isEmpty
(
rule
))
throw
new
AppException
(
String
.
format
(
"当前手机号码未找到匹配的员工!rule:%s"
,
r
eq
.
getPhone
()
));
throw
new
AppException
(
String
.
format
(
"当前手机号码未找到匹配的员工!rule:%s"
,
r
uleCode
));
return
rule
;
}
private
StaffEntity
getStaff
(
PerformSaveReq
req
)
{
StaffEntity
staffEntity
=
staffService
.
selectOne
(
new
StaffQuery
().
phoneNumber
(
req
.
getPhone
()
));
private
StaffEntity
getStaff
(
String
phone
)
{
StaffEntity
staffEntity
=
staffService
.
selectOne
(
new
StaffQuery
().
phoneNumber
(
phone
));
if
(
ObjectUtils
.
isEmpty
(
staffEntity
))
throw
new
AppException
(
String
.
format
(
"当前手机号码未找到匹配的员工!phone:%s"
,
req
.
getPhone
()
));
throw
new
AppException
(
String
.
format
(
"当前手机号码未找到匹配的员工!phone:%s"
,
phone
));
return
staffEntity
;
}
public
static
void
main
(
String
[]
args
)
{
}
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/web/TestController.java
View file @
18785865
...
...
@@ -34,8 +34,7 @@ public class TestController {
public
String
idGens
()
{
log
.
info
(
"测试id生成"
);
String
stringId
=
idgeneratorService
.
getLongId
(
IdgeneratorServiceImpl
.
IdGeneratorKey
.
EFFECT
).
toString
();
String
stringId
=
idgeneratorService
.
getLongId
(
IdgeneratorServiceImpl
.
IdGeneratorKey
.
EFFECT_KEY
).
toString
();
return
stringId
;
}
...
...
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