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
82eea33c
Commit
82eea33c
authored
Jul 12, 2023
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
部门考核、个人考核依据明细增加启停接口
parent
96b8a46f
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
167 additions
and
4 deletions
+167
-4
attendance-performance-manager/src/main/java/com/mortals/xhx/module/perform/service/PerformDeptConfDetailService.java
.../module/perform/service/PerformDeptConfDetailService.java
+10
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/perform/service/PerformStaffConfDetailService.java
...module/perform/service/PerformStaffConfDetailService.java
+10
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/perform/service/impl/PerformDeptConfDetailServiceImpl.java
...erform/service/impl/PerformDeptConfDetailServiceImpl.java
+27
-1
attendance-performance-manager/src/main/java/com/mortals/xhx/module/perform/service/impl/PerformDeptConfServiceImpl.java
...dule/perform/service/impl/PerformDeptConfServiceImpl.java
+9
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/perform/service/impl/PerformStaffConfDetailServiceImpl.java
...rform/service/impl/PerformStaffConfDetailServiceImpl.java
+30
-3
attendance-performance-manager/src/main/java/com/mortals/xhx/module/perform/service/impl/PerformStaffConfServiceImpl.java
...ule/perform/service/impl/PerformStaffConfServiceImpl.java
+21
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/perform/web/PerformDeptConfDetailController.java
...x/module/perform/web/PerformDeptConfDetailController.java
+30
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/perform/web/PerformStaffConfDetailController.java
.../module/perform/web/PerformStaffConfDetailController.java
+30
-0
No files found.
attendance-performance-manager/src/main/java/com/mortals/xhx/module/perform/service/PerformDeptConfDetailService.java
View file @
82eea33c
package
com.mortals.xhx.module.perform.service
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.xhx.module.perform.model.PerformDeptConfDetailEntity
;
import
com.mortals.xhx.module.perform.dao.PerformDeptConfDetailDao
;
...
...
@@ -13,4 +15,12 @@ import com.mortals.xhx.module.perform.dao.PerformDeptConfDetailDao;
public
interface
PerformDeptConfDetailService
extends
ICRUDService
<
PerformDeptConfDetailEntity
,
Long
>{
PerformDeptConfDetailDao
getDao
();
/**
* 启用停用规则
* @param id
* @return
* @throws AppException
*/
int
enable
(
Long
id
,
Context
context
)
throws
AppException
;
}
\ No newline at end of file
attendance-performance-manager/src/main/java/com/mortals/xhx/module/perform/service/PerformStaffConfDetailService.java
View file @
82eea33c
package
com.mortals.xhx.module.perform.service
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.xhx.module.perform.model.PerformStaffConfDetailEntity
;
import
com.mortals.xhx.module.perform.dao.PerformStaffConfDetailDao
;
...
...
@@ -13,4 +15,12 @@ import com.mortals.xhx.module.perform.dao.PerformStaffConfDetailDao;
public
interface
PerformStaffConfDetailService
extends
ICRUDService
<
PerformStaffConfDetailEntity
,
Long
>{
PerformStaffConfDetailDao
getDao
();
/**
* 启用停用规则
* @param id
* @return
* @throws AppException
*/
int
enable
(
Long
id
,
Context
context
)
throws
AppException
;
}
\ No newline at end of file
attendance-performance-manager/src/main/java/com/mortals/xhx/module/perform/service/impl/PerformDeptConfDetailServiceImpl.java
View file @
82eea33c
package
com.mortals.xhx.module.perform.service.impl
;
import
com.mortals.xhx.common.code.EnabledEnum
;
import
org.springframework.stereotype.Service
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.exception.AppException
;
...
...
@@ -7,6 +8,9 @@ import com.mortals.xhx.module.perform.dao.PerformDeptConfDetailDao;
import
com.mortals.xhx.module.perform.model.PerformDeptConfDetailEntity
;
import
com.mortals.xhx.module.perform.service.PerformDeptConfDetailService
;
import
lombok.extern.slf4j.Slf4j
;
import
java.util.Date
;
/**
* PerformDeptConfDetailService
* 部门考核内容详细信息 service实现
...
...
@@ -17,5 +21,27 @@ import lombok.extern.slf4j.Slf4j;
@Service
(
"performDeptConfDetailService"
)
@Slf4j
public
class
PerformDeptConfDetailServiceImpl
extends
AbstractCRUDServiceImpl
<
PerformDeptConfDetailDao
,
PerformDeptConfDetailEntity
,
Long
>
implements
PerformDeptConfDetailService
{
@Override
public
int
enable
(
Long
id
,
Context
context
)
throws
AppException
{
if
(
id
==
null
){
throw
new
AppException
(
"考核内容详细Id不能为空"
);
}
PerformDeptConfDetailEntity
temp
=
this
.
get
(
id
);
if
(
temp
==
null
){
throw
new
AppException
(
"考核内容详细Id不正确"
);
}
PerformDeptConfDetailEntity
entity
=
new
PerformDeptConfDetailEntity
();
entity
.
setId
(
id
);
if
(
temp
.
getEnable
()
==
EnabledEnum
.
停止
.
getValue
()){
entity
.
setEnable
(
EnabledEnum
.
启用
.
getValue
());
}
else
{
entity
.
setEnable
(
EnabledEnum
.
停止
.
getValue
());
}
if
(
context
!=
null
&&
context
.
getUser
()!=
null
){
entity
.
setUpdateTime
(
new
Date
());
entity
.
setUpdateUserId
(
context
.
getUser
().
getId
());
}
return
this
.
dao
.
update
(
entity
);
}
}
\ No newline at end of file
attendance-performance-manager/src/main/java/com/mortals/xhx/module/perform/service/impl/PerformDeptConfServiceImpl.java
View file @
82eea33c
...
...
@@ -51,6 +51,15 @@ public class PerformDeptConfServiceImpl extends AbstractCRUDServiceImpl<PerformD
}
}
@Override
protected
void
updateBefore
(
PerformDeptConfEntity
entity
,
Context
context
)
throws
AppException
{
super
.
updateBefore
(
entity
,
context
);
DeptEntity
deptEntity
=
deptService
.
get
(
entity
.
getDeptId
());
if
(
deptEntity
!=
null
)
{
entity
.
setDeptName
(
deptEntity
.
getDeptName
());
}
}
@Override
protected
void
saveBefore
(
PerformDeptConfEntity
entity
,
Context
context
)
throws
AppException
{
super
.
saveBefore
(
entity
,
context
);
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/perform/service/impl/PerformStaffConfDetailServiceImpl.java
View file @
82eea33c
package
com.mortals.xhx.module.perform.service.impl
;
import
org.springframework.stereotype.Service
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.xhx.common.code.EnabledEnum
;
import
com.mortals.xhx.module.perform.dao.PerformStaffConfDetailDao
;
import
com.mortals.xhx.module.perform.model.PerformStaffConfDetailEntity
;
import
com.mortals.xhx.module.perform.service.PerformStaffConfDetailService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
/**
* PerformStaffConfDetailService
* 人员考核内容详细信息 service实现
...
...
@@ -17,5 +22,27 @@ import lombok.extern.slf4j.Slf4j;
@Service
(
"performStaffConfDetailService"
)
@Slf4j
public
class
PerformStaffConfDetailServiceImpl
extends
AbstractCRUDServiceImpl
<
PerformStaffConfDetailDao
,
PerformStaffConfDetailEntity
,
Long
>
implements
PerformStaffConfDetailService
{
@Override
public
int
enable
(
Long
id
,
Context
context
)
throws
AppException
{
if
(
id
==
null
){
throw
new
AppException
(
"考核内容详细Id不能为空"
);
}
PerformStaffConfDetailEntity
temp
=
this
.
get
(
id
);
if
(
temp
==
null
){
throw
new
AppException
(
"考核内容详细Id不正确"
);
}
PerformStaffConfDetailEntity
entity
=
new
PerformStaffConfDetailEntity
();
entity
.
setId
(
id
);
if
(
temp
.
getEnable
()
==
EnabledEnum
.
停止
.
getValue
()){
entity
.
setEnable
(
EnabledEnum
.
启用
.
getValue
());
}
else
{
entity
.
setEnable
(
EnabledEnum
.
停止
.
getValue
());
}
if
(
context
!=
null
&&
context
.
getUser
()!=
null
){
entity
.
setUpdateTime
(
new
Date
());
entity
.
setUpdateUserId
(
context
.
getUser
().
getId
());
}
return
this
.
dao
.
update
(
entity
);
}
}
\ No newline at end of file
attendance-performance-manager/src/main/java/com/mortals/xhx/module/perform/service/impl/PerformStaffConfServiceImpl.java
View file @
82eea33c
...
...
@@ -92,6 +92,27 @@ public class PerformStaffConfServiceImpl extends AbstractCRUDServiceImpl<Perform
}
}
@Override
protected
void
updateBefore
(
PerformStaffConfEntity
entity
,
Context
context
)
throws
AppException
{
super
.
updateBefore
(
entity
,
context
);
if
(
StringUtils
.
isNotEmpty
(
entity
.
getStaffIds
())){
List
<
Long
>
staffIdList
=
StringUtils
.
converStr2Long
(
entity
.
getStaffIds
());
StaffQuery
staffQuery
=
new
StaffQuery
();
staffQuery
.
setIdList
(
staffIdList
);
List
<
StaffEntity
>
staffEntityList
=
staffService
.
find
(
staffQuery
);
if
(
CollectionUtils
.
isNotEmpty
(
staffEntityList
)){
String
names
=
""
;
for
(
StaffEntity
item:
staffEntityList
){
names
+=
item
.
getName
()+
","
;
}
entity
.
setStaffNames
(
names
.
substring
(
0
,
names
.
length
()-
1
));
entity
.
setStaffCount
(
staffEntityList
.
size
());
}
else
{
entity
.
setStaffCount
(
0
);
}
}
}
@Override
protected
void
saveAfter
(
PerformStaffConfEntity
entity
,
Context
context
)
throws
AppException
{
if
(
CollectionUtils
.
isNotEmpty
(
entity
.
getStaffConfDetail
())){
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/perform/web/PerformDeptConfDetailController.java
View file @
82eea33c
...
...
@@ -49,5 +49,35 @@ public class PerformDeptConfDetailController extends BaseCRUDJsonBodyMappingCont
super
.
init
(
model
,
context
);
}
/**
* 启用停用
* @param id
* @return
*/
@RequestMapping
(
value
=
{
"enable"
},
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
})
public
String
enable
(
Long
id
)
{
Context
context
=
this
.
getContext
();
if
(
id
==
null
)
{
return
this
.
createFailJsonResp
(
"请至少选择一条记录"
);
}
else
{
Map
<
String
,
Object
>
model
=
new
HashMap
();
int
code
=
1
;
String
busiDesc
=
"启用/停用"
+
this
.
getModuleDesc
();
try
{
int
iRet
=
this
.
service
.
enable
(
id
,
context
);
model
.
put
(
"message_info"
,
this
.
getModuleDesc
()
+
"启用/停用成功!"
);
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】 [id:"
+
id
+
"]"
);
}
catch
(
Exception
var7
)
{
code
=
-
1
;
this
.
doException
(
this
.
request
,
busiDesc
,
model
,
var7
);
}
JSONObject
ret
=
new
JSONObject
();
ret
.
put
(
"code"
,
Integer
.
valueOf
(
code
));
ret
.
put
(
"msg"
,
model
.
remove
(
"message_info"
));
ret
.
put
(
"data"
,
model
);
return
ret
.
toJSONString
();
}
}
}
\ No newline at end of file
attendance-performance-manager/src/main/java/com/mortals/xhx/module/perform/web/PerformStaffConfDetailController.java
View file @
82eea33c
...
...
@@ -49,5 +49,35 @@ public class PerformStaffConfDetailController extends BaseCRUDJsonBodyMappingCon
super
.
init
(
model
,
context
);
}
/**
* 启用停用
* @param id
* @return
*/
@RequestMapping
(
value
=
{
"enable"
},
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
})
public
String
enable
(
Long
id
)
{
Context
context
=
this
.
getContext
();
if
(
id
==
null
)
{
return
this
.
createFailJsonResp
(
"请至少选择一条记录"
);
}
else
{
Map
<
String
,
Object
>
model
=
new
HashMap
();
int
code
=
1
;
String
busiDesc
=
"启用/停用"
+
this
.
getModuleDesc
();
try
{
int
iRet
=
this
.
service
.
enable
(
id
,
context
);
model
.
put
(
"message_info"
,
this
.
getModuleDesc
()
+
"启用/停用成功!"
);
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】 [id:"
+
id
+
"]"
);
}
catch
(
Exception
var7
)
{
code
=
-
1
;
this
.
doException
(
this
.
request
,
busiDesc
,
model
,
var7
);
}
JSONObject
ret
=
new
JSONObject
();
ret
.
put
(
"code"
,
Integer
.
valueOf
(
code
));
ret
.
put
(
"msg"
,
model
.
remove
(
"message_info"
));
ret
.
put
(
"data"
,
model
);
return
ret
.
toJSONString
();
}
}
}
\ 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