Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dcs-plan
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
INET-TWO
server
dcs-plan
Commits
3587066f
Commit
3587066f
authored
Sep 23, 2024
by
wei
🎱
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
属性对应字典名称
parent
982da293
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
4 deletions
+33
-4
Constants.java
...n/java/com/yonde/dcs/plan/common/constants/Constants.java
+8
-0
ExtSupplierManageServiceImpl.java
.../plan/core/service/impl/ExtSupplierManageServiceImpl.java
+25
-4
No files found.
dcs-plan-common/src/main/java/com/yonde/dcs/plan/common/constants/Constants.java
View file @
3587066f
...
...
@@ -319,6 +319,14 @@ public class Constants {
* 项目代号字典type
*/
public
static
final
String
PROJECT_CODE
=
"ProjectCode"
;
/**
* 供应商-资质内容
*/
public
static
final
String
QUALIFICATIONS_CONTENT
=
"qualificationsContent"
;
/**
* 供应商-供方类别
*/
public
static
final
String
SUPPLIER_TYPE
=
"supplierType"
;
/**
* 设计阶段字典type
*/
...
...
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/impl/ExtSupplierManageServiceImpl.java
View file @
3587066f
package
com
.
yonde
.
dcs
.
plan
.
core
.
service
.
impl
;
import
com.google.common.collect.Lists
;
import
com.yonde.dcs.plan.common.constants.Constants
;
import
com.yonde.dcs.plan.common.vo.ExtQualificationsVO
;
import
com.yonde.dcs.plan.common.vo.ExtSupplierManageLinkVO
;
import
com.yonde.dcs.plan.common.vo.ExtSupplierManageVO
;
...
...
@@ -14,6 +15,8 @@ import com.yonde.dex.basedata.data.search.SearchItems;
import
com.yonde.dex.basedata.data.search.SearchQueryCondition
;
import
com.yonde.dex.basedata.entity.data.DxPageImpl
;
import
com.yonde.dex.basedata.exception.DxBusinessException
;
import
com.yonde.dex.dict.feign.DictDataFeignService
;
import
com.yonde.dex.dict.service.vo.DictDataVO
;
import
com.yonde.dex.wfc.feign.api.WfcProcessFeign
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
...
...
@@ -24,6 +27,9 @@ import java.time.LocalDate;
import
java.time.LocalDateTime
;
import
java.time.Year
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
/**
* @description: ExtSupplierManage-ServiceImpl
...
...
@@ -45,6 +51,9 @@ public class ExtSupplierManageServiceImpl<V extends ExtSupplierManageVO> impleme
@Autowired
private
ExtSupplierManageLinkService
extSupplierManageLinkService
;
@Autowired
private
DictDataFeignService
dictDataService
;
@Override
public
ExtSupplierManageVO
startWorkflow
(
Long
id
)
{
ExtSupplierManageVO
extSupplierManageVO
=
this
.
get
(
id
);
...
...
@@ -65,28 +74,40 @@ public class ExtSupplierManageServiceImpl<V extends ExtSupplierManageVO> impleme
LocalDateTime
localDateTime
=
warningDate
.
atStartOfDay
();
DxPageImpl
dxPage
=
this
.
recursionSupplierManageLinks
(
searchQueryCondition
,
localDateTime
);
List
<
ExtSupplierManageLinkVO
>
content
=
dxPage
.
getContent
();
Map
<
String
,
DictDataVO
>
supplierTypeMap
=
this
.
getDictDataVO
(
Constants
.
SUPPLIER_TYPE
);
Map
<
String
,
DictDataVO
>
qualificationsContentMap
=
this
.
getDictDataVO
(
Constants
.
QUALIFICATIONS_CONTENT
);
for
(
ExtSupplierManageLinkVO
extSupplierManageLinkVO
:
content
)
{
ExtSupplierManageVO
source
=
extSupplierManageLinkVO
.
getSource
();
ExtQualificationsVO
target
=
extSupplierManageLinkVO
.
getTarget
();
list
.
add
(
this
.
buildSupplierEarlyWarningVO
(
source
,
target
));
list
.
add
(
this
.
buildSupplierEarlyWarningVO
(
source
,
target
,
qualificationsContentMap
,
supplierTypeMap
));
}
dxPage
.
setContent
(
list
);
return
dxPage
;
}
private
Map
<
String
,
DictDataVO
>
getDictDataVO
(
String
dictCode
)
{
List
<
DictDataVO
>
dictDatas
=
dictDataService
.
getDictDatas
(
dictCode
);
return
dictDatas
.
stream
().
collect
(
Collectors
.
toMap
(
DictDataVO:
:
getDictKey
,
Function
.
identity
(),
(
key1
,
key2
)
->
key2
));
}
@Override
public
List
<
SupplierEarlyWarningVO
>
exportEarlyWarningData
(
SearchQueryCondition
searchQueryCondition
,
int
warningDay
)
{
DxPageImpl
dxPage
=
this
.
earlyWarning
(
searchQueryCondition
,
warningDay
);
return
dxPage
.
getContent
();
}
private
SupplierEarlyWarningVO
buildSupplierEarlyWarningVO
(
ExtSupplierManageVO
source
,
ExtQualificationsVO
target
)
{
private
SupplierEarlyWarningVO
buildSupplierEarlyWarningVO
(
ExtSupplierManageVO
source
,
ExtQualificationsVO
target
,
Map
<
String
,
DictDataVO
>
qualificationsContentMap
,
Map
<
String
,
DictDataVO
>
supplierTypeMap
)
{
SupplierEarlyWarningVO
supplierEarlyWarningVO
=
new
SupplierEarlyWarningVO
();
BeanUtils
.
copyProperties
(
source
,
supplierEarlyWarningVO
);
supplierEarlyWarningVO
.
setQualificationsContent
(
target
.
getQualificationsContent
());
DictDataVO
qualificationsContent
=
qualificationsContentMap
.
get
(
target
.
getQualificationsContent
());
DictDataVO
supplierType
=
supplierTypeMap
.
get
(
target
.
getQualificationsContent
());
supplierEarlyWarningVO
.
setId
(
target
.
getId
());
supplierEarlyWarningVO
.
setSupplierType
(
supplierType
.
getDictValue
());
supplierEarlyWarningVO
.
setQualificationsContent
(
qualificationsContent
.
getDictValue
());
supplierEarlyWarningVO
.
setCertificateNumber
(
target
.
getCertificateNumber
());
supplierEarlyWarningVO
.
setCertificateTime
(
target
.
getCertificateTime
());
supplierEarlyWarningVO
.
setId
(
target
.
getId
());
return
supplierEarlyWarningVO
;
}
...
...
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