Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
3b64066a
o2oa
项目概览
ghsby
/
o2oa
落后 Fork 源项目 2880 个版本
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3b64066a
编写于
7月 21, 2020
作者:
L
luojing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
考勤,部分更新打卡记录接口修改
上级
ef6a23a5
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
104 addition
and
66 deletion
+104
-66
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/jaxrs/attendancedetail/ActionReciveSingleAttendance.java
.../jaxrs/attendancedetail/ActionReciveSingleAttendance.java
+54
-22
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/AttendanceDetailService.java
...nce/assemble/control/service/AttendanceDetailService.java
+50
-44
未找到文件。
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/jaxrs/attendancedetail/ActionReciveSingleAttendance.java
浏览文件 @
3b64066a
...
...
@@ -42,10 +42,11 @@ public class ActionReciveSingleAttendance extends BaseAction {
protected
ActionResult
<
Wo
>
execute
(
HttpServletRequest
request
,
EffectivePerson
effectivePerson
,
JsonElement
jsonElement
)
throws
Exception
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
DateOperation
dateOperation
=
new
DateOperation
();
AttendanceDetail
attendanceDetail
=
n
ull
;
AttendanceDetail
attendanceDetail
=
n
ew
AttendanceDetail
()
;
Boolean
check
=
true
;
List
<
String
>
ids
=
null
;
Wi
wrapIn
=
null
;
Date
datetime
=
null
;
try
{
wrapIn
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
}
catch
(
Exception
e
)
{
...
...
@@ -69,32 +70,19 @@ public class ActionReciveSingleAttendance extends BaseAction {
}
}
Date
datetime
=
null
;
if
(
check
)
{
/*if (check) {
try {
ids = attendanceDetailServiceAdv.listDetailByNameAndDate( wrapIn.getEmpName(), wrapIn.getRecordDateString() );
if(ListTools.isNotEmpty(ids)){
attendanceDetail = attendanceDetailServiceAdv.get(ids.get(0));
if(attendanceDetail==null){
/*try {
datetime = dateOperation.getDateFromString(wrapIn.getRecordDateString());
attendanceDetail.setRecordDate(datetime);
attendanceDetail.setRecordDateString(dateOperation.getDateStringFromDate(datetime, "YYYY-MM-DD"));
attendanceDetail.setYearString(dateOperation.getYear(datetime));
attendanceDetail.setMonthString(dateOperation.getMonth(datetime));
} catch (Exception e) {
check = false;
Exception exception = new ExceptionAttendanceDetailProcess(e, "员工打卡信息中打卡日期格式异常,格式: yyyy-mm-dd. 日期:" + wrapIn.getRecordDateString());
result.error(exception);
logger.error(e, effectivePerson, request, null);
}
}else{*/
check = false;
Exception exception = new ExceptionDetailNotExists(ids.get(0));
result.error(exception);
}
}else{
attendanceDetail = new AttendanceDetail();
check = false;
Exception exception = new ExceptionSingleDetailNotExists();
result.error(exception);
...
...
@@ -109,15 +97,59 @@ public class ActionReciveSingleAttendance extends BaseAction {
}
}*/
if
(
check
)
{
try
{
datetime
=
dateOperation
.
getDateFromString
(
wrapIn
.
getRecordDateString
());
attendanceDetail
.
setRecordDate
(
datetime
);
attendanceDetail
.
setRecordDateString
(
dateOperation
.
getDateStringFromDate
(
datetime
,
"YYYY-MM-DD"
));
attendanceDetail
.
setYearString
(
dateOperation
.
getYear
(
datetime
));
attendanceDetail
.
setMonthString
(
dateOperation
.
getMonth
(
datetime
));
}
catch
(
Exception
e
)
{
check
=
false
;
Exception
exception
=
new
ExceptionAttendanceDetailProcess
(
e
,
"员工打卡信息中打卡日期格式异常,格式: yyyy-mm-dd. 日期:"
+
wrapIn
.
getRecordDateString
());
result
.
error
(
exception
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
if
(
check
)
{
if
(
wrapIn
.
getOnDutyTime
()
!=
null
&&
wrapIn
.
getOnDutyTime
().
trim
().
length
()
>
0
)
{
try
{
datetime
=
dateOperation
.
getDateFromString
(
wrapIn
.
getOnDutyTime
());
attendanceDetail
.
setOnDutyTime
(
dateOperation
.
getDateStringFromDate
(
datetime
,
"HH:mm:ss"
));
// 上班打卡时间
attendanceDetail
.
setOnDutyTime
(
dateOperation
.
getDateStringFromDate
(
datetime
,
"HH:mm:ss"
));
// 上午上班打卡时间
}
catch
(
Exception
e
)
{
check
=
false
;
Exception
exception
=
new
ExceptionAttendanceDetailProcess
(
e
,
"员工上午上班打卡时间格式异常,格式: HH:mm:ss. 日期:"
+
wrapIn
.
getOnDutyTime
());
result
.
error
(
exception
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
}
if
(
check
)
{
if
(
wrapIn
.
getMorningOffdutyTime
()
!=
null
&&
wrapIn
.
getMorningOffdutyTime
().
trim
().
length
()
>
0
)
{
try
{
datetime
=
dateOperation
.
getDateFromString
(
wrapIn
.
getMorningOffdutyTime
());
attendanceDetail
.
setMorningOffDutyTime
(
dateOperation
.
getDateStringFromDate
(
datetime
,
"HH:mm:ss"
));
// 上午下班打卡时间
}
catch
(
Exception
e
)
{
check
=
false
;
Exception
exception
=
new
ExceptionAttendanceDetailProcess
(
e
,
"员工上午下班打卡时间格式异常,格式: HH:mm:ss. 日期:"
+
wrapIn
.
getMorningOffdutyTime
());
result
.
error
(
exception
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
}
if
(
check
)
{
if
(
wrapIn
.
getAfternoonOnDutyTime
()
!=
null
&&
wrapIn
.
getAfternoonOnDutyTime
().
trim
().
length
()
>
0
)
{
try
{
datetime
=
dateOperation
.
getDateFromString
(
wrapIn
.
getAfternoonOnDutyTime
());
attendanceDetail
.
setAfternoonOnDutyTime
(
dateOperation
.
getDateStringFromDate
(
datetime
,
"HH:mm:ss"
));
// 下午上班打卡时间
}
catch
(
Exception
e
)
{
check
=
false
;
Exception
exception
=
new
ExceptionAttendanceDetailProcess
(
e
,
"员工
上班打卡时间格式异常,格式: HH:mm:ss. 日期:"
+
wrapIn
.
get
OnDutyTime
());
Exception
exception
=
new
ExceptionAttendanceDetailProcess
(
e
,
"员工
下午上班打卡时间格式异常,格式: HH:mm:ss. 日期:"
+
wrapIn
.
getAfternoon
OnDutyTime
());
result
.
error
(
exception
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
...
...
@@ -128,7 +160,7 @@ public class ActionReciveSingleAttendance extends BaseAction {
if
(
wrapIn
.
getOffDutyTime
()
!=
null
&&
wrapIn
.
getOffDutyTime
().
trim
().
length
()
>
0
)
{
try
{
datetime
=
dateOperation
.
getDateFromString
(
wrapIn
.
getOffDutyTime
());
attendanceDetail
.
setOffDutyTime
(
dateOperation
.
getDateStringFromDate
(
datetime
,
"HH:mm:ss"
));
//
上
班打卡时间
attendanceDetail
.
setOffDutyTime
(
dateOperation
.
getDateStringFromDate
(
datetime
,
"HH:mm:ss"
));
//
下午下
班打卡时间
}
catch
(
Exception
e
)
{
check
=
false
;
Exception
exception
=
new
ExceptionAttendanceDetailProcess
(
e
,
"员工下班打卡时间格式异常,格式: HH:mm:ss. 日期:"
+
wrapIn
.
getOffDutyTime
());
...
...
@@ -169,7 +201,7 @@ public class ActionReciveSingleAttendance extends BaseAction {
if
(
check
)
{
try
{
attendanceDetail
=
attendanceDetailServiceAdv
.
save
(
attendanceDetail
);
attendanceDetail
=
attendanceDetailServiceAdv
.
save
Single
(
attendanceDetail
);
result
.
setData
(
new
Wo
(
attendanceDetail
.
getId
()
));
}
catch
(
Exception
e
)
{
check
=
false
;
...
...
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/AttendanceDetailService.java
浏览文件 @
3b64066a
...
...
@@ -235,54 +235,60 @@ public class AttendanceDetailService {
if
(
attendanceDetail
==
null
){
throw
new
Exception
(
"attendanceDetail can not be null!"
);
}
List
<
String
>
ids
=
null
;
List
<
AttendanceDetail
>
attendanceDetailList
=
null
;
AttendanceDetail
attendanceDetail_old
=
null
;
Business
business
=
new
Business
(
emc
);
//如果不存在,则看看该员工当天的打卡信息是否已经存在?
ids
=
business
.
getAttendanceDetailFactory
().
listByEmployeeNameAndDate
(
attendanceDetail
.
getEmpName
(),
attendanceDetail
.
getRecordDateString
()
);
if
(
ids
!=
null
&&
!
ids
.
isEmpty
()
){
attendanceDetailList
=
business
.
getAttendanceDetailFactory
().
list
(
ids
);
}
if
(
attendanceDetailList
!=
null
&&
!
attendanceDetailList
.
isEmpty
()
){
attendanceDetail_old
=
attendanceDetailList
.
get
(
0
);
}
if
(
attendanceDetail_old
!=
null
){
//需要进行数据更新
attendanceDetail_old
.
refresh
();
attendanceDetail_old
.
setEmpName
(
attendanceDetail
.
getEmpName
()
);
attendanceDetail_old
.
setEmpNo
(
attendanceDetail
.
getEmpNo
()
);
attendanceDetail_old
.
setRecordDate
(
attendanceDetail
.
getRecordDate
()
);
attendanceDetail_old
.
setRecordDateString
(
attendanceDetail
.
getRecordDateString
()
);
attendanceDetail_old
.
setRecordStatus
(
0
);
if
(
attendanceDetail
.
getOnDutyTime
()!=
null
&&
attendanceDetail
.
getOffDutyTime
().
trim
().
length
()
>
0
){
attendanceDetail_old
.
setOnDutyTime
(
attendanceDetail
.
getOnDutyTime
()
);
}
if
(
attendanceDetail
.
getMorningOffDutyTime
()!=
null
&&
attendanceDetail
.
getMorningOffDutyTime
().
trim
().
length
()
>
0
){
attendanceDetail_old
.
setMorningOffDutyTime
(
attendanceDetail
.
getMorningOffDutyTime
()
);
}
if
(
attendanceDetail
.
getAfternoonOnDutyTime
()!=
null
&&
attendanceDetail
.
getAfternoonOnDutyTime
().
trim
().
length
()
>
0
){
attendanceDetail_old
.
setAfternoonOnDutyTime
(
attendanceDetail
.
getAfternoonOnDutyTime
()
);
}
if
(
attendanceDetail
.
getOffDutyTime
()!=
null
&&
attendanceDetail
.
getOffDutyTime
().
trim
().
length
()
>
0
){
attendanceDetail_old
.
setOffDutyTime
(
attendanceDetail
.
getOffDutyTime
()
);
}
//emc.beginTransaction( AttendanceSetting.class );
emc
.
beginTransaction
(
AttendanceDetail
.
class
);
emc
.
check
(
attendanceDetail_old
,
CheckPersistType
.
all
);
emc
.
commit
();
attendanceDetail
=
attendanceDetail_old
;
}
else
{
//需要新增打卡信息数据
if
(
attendanceDetail
.
getId
()
==
null
)
{
attendanceDetail
.
setId
(
AttendanceDetail
.
createId
()
);
}
emc
.
beginTransaction
(
AttendanceDetail
.
class
);
emc
.
persist
(
attendanceDetail
,
CheckPersistType
.
all
);
emc
.
commit
();
}
return
attendanceDetail
;
}
// public AttendanceDetail save( EntityManagerContainer emc, AttendanceDetail attendanceDetail ) throws Exception {
// if( attendanceDetail == null ){
// throw new Exception("attendanceDetail can not be null!");
// }
// List<String> ids = null;
// List<AttendanceDetail> attendanceDetailList = null;
// AttendanceDetail attendanceDetail_old = null;
// Business business = new Business( emc );
// //先看看同一个ID是否存在
// attendanceDetail_old = emc.find( attendanceDetail.getId(), AttendanceDetail.class);
// //如果不存在,则看看该员工当天的打卡信息是否已经存在?
// if( attendanceDetail_old == null ){
// ids = business.getAttendanceDetailFactory().listByEmployeeNameAndDate( attendanceDetail.getEmpName(), attendanceDetail.getRecordDateString() );
// if( ids != null && !ids.isEmpty() ){
// attendanceDetailList = business.getAttendanceDetailFactory().list(ids);
// }
// if( attendanceDetailList != null && !attendanceDetailList.isEmpty() ){
// attendanceDetail_old = attendanceDetailList.get(0);
// }
// }
// if( attendanceDetail_old != null ){
// //需要进行数据更新
// emc.beginTransaction( AttendanceSetting.class );
// attendanceDetail_old.refresh();
// attendanceDetail_old.setEmpName( attendanceDetail.getEmpName() );
// attendanceDetail_old.setEmpNo( attendanceDetail.getEmpNo() );
// attendanceDetail_old.setRecordDate( attendanceDetail.getRecordDate() );
// attendanceDetail_old.setRecordDateString( attendanceDetail.getRecordDateString() );
// attendanceDetail_old.setRecordStatus( 0 );
// attendanceDetail_old.setOnDutyTime( attendanceDetail.getOnDutyTime() );
// attendanceDetail_old.setOffDutyTime( attendanceDetail.getOnWorkTime() );
// emc.check( attendanceDetail_old, CheckPersistType.all);
// emc.commit();
// }else{
// //需要新增打卡信息数据
// emc.beginTransaction( AttendanceDetail.class );
// emc.persist( attendanceDetail, CheckPersistType.all);
// emc.commit();
// }
// return attendanceDetail;
// }
public
AttendanceDetailMobile
save
(
EntityManagerContainer
emc
,
AttendanceDetailMobile
attendanceDetailMobile
)
throws
Exception
{
if
(
attendanceDetailMobile
==
null
){
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录