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
7f450eda
Commit
7f450eda
authored
Jan 27, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加窗口编码
parent
a05c5027
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
18 deletions
+64
-18
attendance-performance-manager/src/main/java/com/mortals/xhx/module/window/service/impl/WindowWorkmanPerformServiceImpl.java
.../window/service/impl/WindowWorkmanPerformServiceImpl.java
+48
-15
common-lib/src/main/java/com/mortals/xhx/feign/window/IWindowFeign.java
.../main/java/com/mortals/xhx/feign/window/IWindowFeign.java
+16
-3
No files found.
attendance-performance-manager/src/main/java/com/mortals/xhx/module/window/service/impl/WindowWorkmanPerformServiceImpl.java
View file @
7f450eda
package
com.mortals.xhx.module.window.service.impl
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.xhx.common.code.FillStatusEnum
;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.common.pdu.window.WindowPdu
;
import
com.mortals.xhx.common.utils.BeanUtil
;
import
com.mortals.xhx.feign.window.IWindowFeign
;
import
com.mortals.xhx.module.check.model.CheckWindowPerformEntity
;
import
com.mortals.xhx.module.check.model.CheckWindowPerformQuery
;
import
com.mortals.xhx.module.check.model.CheckWindowWorkmanPerformEntity
;
...
...
@@ -21,18 +26,19 @@ import com.mortals.xhx.module.window.dao.WindowWorkmanPerformDao;
import
com.mortals.xhx.module.window.model.WindowWorkmanPerformEntity
;
import
com.mortals.xhx.module.window.service.WindowWorkmanPerformService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.util.ObjectUtils
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
/**
* WindowWorkmanPerformService
* 窗口人员考核汇总登记 service实现
*
* @author zxfei
* @date 2024-01-17
*/
* WindowWorkmanPerformService
* 窗口人员考核汇总登记 service实现
*
* @author zxfei
* @date 2024-01-17
*/
@Service
(
"windowWorkmanPerformService"
)
@Slf4j
public
class
WindowWorkmanPerformServiceImpl
extends
AbstractCRUDServiceImpl
<
WindowWorkmanPerformDao
,
WindowWorkmanPerformEntity
,
Long
>
implements
WindowWorkmanPerformService
{
...
...
@@ -43,17 +49,44 @@ public class WindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImpl<Win
private
CheckWindowWorkmanPerformService
checkWindowWorkmanPerformService
;
@Autowired
private
IWindowFeign
windowFeign
;
@Override
protected
void
saveBefore
(
WindowWorkmanPerformEntity
entity
,
Context
context
)
throws
AppException
{
buildWindowInfo
(
entity
);
super
.
saveBefore
(
entity
,
context
);
}
private
void
buildWindowInfo
(
WindowWorkmanPerformEntity
entity
)
{
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getWindowId
()))
{
Rest
<
WindowPdu
>
rest
=
windowFeign
.
info
(
entity
.
getWindowId
());
if
(
YesNoEnum
.
YES
.
getValue
()
==
rest
.
getCode
())
{
entity
.
setWindowName
(
rest
.
getData
().
getName
());
entity
.
setWindowCode
(
rest
.
getData
().
getFromnum
());
}
}
}
@Override
protected
void
updateBefore
(
WindowWorkmanPerformEntity
entity
,
Context
context
)
throws
AppException
{
buildWindowInfo
(
entity
);
super
.
updateBefore
(
entity
,
context
);
}
@Override
protected
void
saveAfter
(
WindowWorkmanPerformEntity
entity
,
Context
context
)
throws
AppException
{
if
(
CollectionUtils
.
isNotEmpty
(
entity
.
getWorkmanPerformDetailList
()))
{
entity
.
getWorkmanPerformDetailList
().
forEach
(
item
->
{
if
(
CollectionUtils
.
isNotEmpty
(
entity
.
getWorkmanPerformDetailList
()))
{
entity
.
getWorkmanPerformDetailList
().
forEach
(
item
->
{
item
.
setPerformId
(
entity
.
getId
());
item
.
setCreateUserId
(
this
.
getContextUserId
(
context
));
item
.
setCreateTime
(
new
Date
());
});
windowWorkmanPerformDetailService
.
save
(
entity
.
getWorkmanPerformDetailList
());
}
if
(
entity
.
getFillStatus
()==
FillStatusEnum
.
提交
.
getValue
())
{
if
(
entity
.
getFillStatus
()
==
FillStatusEnum
.
提交
.
getValue
())
{
saveToCheck
(
entity
);
}
super
.
saveAfter
(
entity
,
context
);
...
...
@@ -61,10 +94,10 @@ public class WindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImpl<Win
@Override
protected
void
updateAfter
(
WindowWorkmanPerformEntity
entity
,
Context
context
)
throws
AppException
{
if
(
CollectionUtils
.
isNotEmpty
(
entity
.
getWorkmanPerformDetailList
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
entity
.
getWorkmanPerformDetailList
()))
{
Long
[]
detailList
=
windowWorkmanPerformDetailService
.
find
(
new
WindowWorkmanPerformDetailQuery
().
performId
(
entity
.
getId
())).
stream
().
map
(
WindowWorkmanPerformDetailEntity:
:
getId
).
toArray
(
Long
[]::
new
);
windowWorkmanPerformDetailService
.
remove
(
detailList
,
context
);
entity
.
getWorkmanPerformDetailList
().
forEach
(
item
->
{
windowWorkmanPerformDetailService
.
remove
(
detailList
,
context
);
entity
.
getWorkmanPerformDetailList
().
forEach
(
item
->
{
item
.
setPerformId
(
entity
.
getId
());
item
.
setCreateUserId
(
this
.
getContextUserId
(
context
));
item
.
setCreateTime
(
new
Date
());
...
...
@@ -73,7 +106,7 @@ public class WindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImpl<Win
});
windowWorkmanPerformDetailService
.
save
(
entity
.
getWorkmanPerformDetailList
());
}
if
(
entity
.
getFillStatus
()==
FillStatusEnum
.
提交
.
getValue
())
{
if
(
entity
.
getFillStatus
()
==
FillStatusEnum
.
提交
.
getValue
())
{
saveToCheck
(
entity
);
}
super
.
updateAfter
(
entity
,
context
);
...
...
@@ -84,11 +117,11 @@ public class WindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImpl<Win
List
<
WindowWorkmanPerformDetailEntity
>
detailEntities
=
windowWorkmanPerformDetailService
.
find
(
new
WindowWorkmanPerformDetailQuery
().
performIdList
(
Arrays
.
asList
(
ids
)));
windowWorkmanPerformDetailService
.
removeList
(
detailEntities
,
context
);
List
<
CheckWindowWorkmanPerformEntity
>
performEntitys
=
checkWindowWorkmanPerformService
.
find
(
new
CheckWindowWorkmanPerformQuery
().
recordIdList
(
Arrays
.
asList
(
ids
)));
checkWindowWorkmanPerformService
.
removeList
(
performEntitys
,
context
);
checkWindowWorkmanPerformService
.
removeList
(
performEntitys
,
context
);
super
.
removeAfter
(
ids
,
context
,
result
);
}
private
void
saveToCheck
(
WindowWorkmanPerformEntity
entity
){
private
void
saveToCheck
(
WindowWorkmanPerformEntity
entity
)
{
CheckWindowWorkmanPerformEntity
perform
=
new
CheckWindowWorkmanPerformEntity
();
perform
.
initAttrValue
();
BeanUtils
.
copyProperties
(
entity
,
perform
,
BeanUtil
.
getNullPropertyNames
(
entity
));
...
...
common-lib/src/main/java/com/mortals/xhx/feign/window/IWindowFeign.java
View file @
7f450eda
...
...
@@ -9,8 +9,10 @@ import feign.hystrix.FallbackFactory;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.List
;
...
...
@@ -23,9 +25,14 @@ public interface IWindowFeign extends IFeign {
@PostMapping
(
value
=
"/window/interlist"
)
Rest
<
RespData
<
List
<
WindowPdu
>>>
list
(
@RequestBody
WindowPdu
windowPdu
);
/**
* 查看站点部门窗口
*
* @param id
* @return
*/
@GetMapping
(
value
=
"/window/interinfo"
)
Rest
<
WindowPdu
>
info
(
@RequestParam
(
value
=
"id"
)
Long
id
);
}
...
...
@@ -41,6 +48,12 @@ class WindowFeignFallbackFactory implements FallbackFactory<IWindowFeign> {
public
Rest
<
RespData
<
List
<
WindowPdu
>>>
list
(
WindowPdu
windowPdu
)
{
return
Rest
.
fail
(
"暂时无法访问窗口列表接口,请稍后再试!"
);
}
@Override
public
Rest
<
WindowPdu
>
info
(
Long
id
)
{
return
Rest
.
fail
(
"暂时无法获取站点部门窗口详细,请稍后再试!"
);
}
};
}
}
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