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
2a5fba8f
Commit
2a5fba8f
authored
Sep 21, 2024
by
wei
🎱
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
供方预警接口
parent
c3239d70
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
2 deletions
+67
-2
ExtSupplierManageController.java
...dcs/plan/core/controller/ExtSupplierManageController.java
+5
-1
ExtSupplierManageService.java
...yonde/dcs/plan/core/service/ExtSupplierManageService.java
+4
-0
ExtSupplierManageServiceImpl.java
.../plan/core/service/impl/ExtSupplierManageServiceImpl.java
+58
-1
No files found.
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/controller/ExtSupplierManageController.java
View file @
2a5fba8f
...
...
@@ -35,7 +35,11 @@ public class ExtSupplierManageController<V extends ExtSupplierManageVO, S extend
return
ApiResult
.
ok
(
extSupplierManageService
.
startWorkflow
(
id
),
"操作完成"
);
}
@ApiOperation
(
"供方预警列表"
)
@PostMapping
({
"earlyWarning"
})
public
ApiResult
earlyWarning
(
@RequestParam
(
"warningDay"
)
Integer
warningDay
){
return
ApiResult
.
ok
(
extSupplierManageService
.
earlyWarning
(
warningDay
),
"查询成功"
);
}
}
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/ExtSupplierManageService.java
View file @
2a5fba8f
package
com
.
yonde
.
dcs
.
plan
.
core
.
service
;
import
com.yonde.dcs.plan.common.vo.ExtSupplierManageVO
;
import
com.yonde.dcs.plan.common.vo.SupplierEarlyWarningVO
;
import
com.yonde.dcs.plan.core.service.shadow.ExtSupplierManageServiceShadow
;
import
java.util.List
;
/**
* @description: ExtSupplierManage-service
* @author: dexadmin
...
...
@@ -13,4 +16,5 @@ public interface ExtSupplierManageService<V extends ExtSupplierManageVO> extends
ExtSupplierManageVO
startWorkflow
(
Long
id
);
List
<
SupplierEarlyWarningVO
>
earlyWarning
(
Integer
warningDay
);
}
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/impl/ExtSupplierManageServiceImpl.java
View file @
2a5fba8f
package
com
.
yonde
.
dcs
.
plan
.
core
.
service
.
impl
;
import
com.google.common.collect.Lists
;
import
com.yonde.dcs.plan.common.vo.ExtQualificationsVO
;
import
com.yonde.dcs.plan.common.vo.ExtSupplierManageLinkVO
;
import
com.yonde.dcs.plan.common.vo.ExtSupplierManageVO
;
import
com.yonde.dcs.plan.common.vo.SupplierEarlyWarningVO
;
import
com.yonde.dcs.plan.core.repository.ExtSupplierManageRepository
;
import
com.yonde.dcs.plan.core.service.ExtSupplierManageLinkService
;
import
com.yonde.dcs.plan.core.service.ExtSupplierManageService
;
import
com.yonde.dcs.plan.entity.po.ExtSupplierManage
;
import
com.yonde.dex.basedata.data.search.SearchItem
;
import
com.yonde.dex.basedata.data.search.SearchItems
;
import
com.yonde.dex.basedata.data.search.SearchQueryCondition
;
import
com.yonde.dex.basedata.exception.DxBusinessException
;
import
com.yonde.dex.wfc.feign.api.WfcProcessFeign
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDate
;
import
java.util.List
;
/**
* @description: ExtSupplierManage-ServiceImpl
* @author: dexadmin
...
...
@@ -27,9 +40,12 @@ public class ExtSupplierManageServiceImpl<V extends ExtSupplierManageVO> impleme
@Autowired
ExtSupplierManageRepository
<
ExtSupplierManage
>
extSupplierManageRepository
;
@Autowired
private
ExtSupplierManageLinkService
extSupplierManageLinkService
;
@Override
public
ExtSupplierManageVO
startWorkflow
(
Long
id
)
{
ExtSupplierManageVO
extSupplierManageVO
=
get
(
id
);
ExtSupplierManageVO
extSupplierManageVO
=
get
(
id
);
if
(
extSupplierManageVO
==
null
)
{
throw
new
DxBusinessException
(
"500"
,
"获取不到对象"
);
}
...
...
@@ -39,6 +55,47 @@ public class ExtSupplierManageServiceImpl<V extends ExtSupplierManageVO> impleme
wfcProcessFeign
.
startProcessByKey
(
"supplierQualificationReviewWF"
,
extSupplierManageVO
);
return
this
.
changeStatus
(
extSupplierManageVO
.
getId
(),
"submitReviewing"
,
true
);
}
@Override
public
List
<
SupplierEarlyWarningVO
>
earlyWarning
(
Integer
warningDay
)
{
LocalDate
warningDate
=
LocalDate
.
now
();
// 默认减30天
if
(
ObjectUtils
.
isEmpty
(
warningDay
))
{
warningDate
=
warningDate
.
minusDays
(
30
);
}
else
{
warningDate
=
warningDate
.
minusDays
(
warningDay
);
}
List
<
SupplierEarlyWarningVO
>
list
=
Lists
.
newArrayList
();
List
<
ExtSupplierManageLinkVO
>
extSupplierManageLinkVOS
=
this
.
recursionSupplierManageLinks
(
warningDate
.
toString
());
for
(
ExtSupplierManageLinkVO
extSupplierManageLinkVO
:
extSupplierManageLinkVOS
)
{
ExtSupplierManageVO
source
=
extSupplierManageLinkVO
.
getSource
();
ExtQualificationsVO
target
=
extSupplierManageLinkVO
.
getTarget
();
list
.
add
(
this
.
buildSupplierEarlyWarningVO
(
source
,
target
));
}
return
list
;
}
private
SupplierEarlyWarningVO
buildSupplierEarlyWarningVO
(
ExtSupplierManageVO
source
,
ExtQualificationsVO
target
)
{
SupplierEarlyWarningVO
supplierEarlyWarningVO
=
new
SupplierEarlyWarningVO
();
BeanUtils
.
copyProperties
(
source
,
supplierEarlyWarningVO
);
supplierEarlyWarningVO
.
setQualificationsContent
(
target
.
getQualificationsContent
());
supplierEarlyWarningVO
.
setCertificateNumber
(
target
.
getCertificateNumber
());
supplierEarlyWarningVO
.
setCertificateTime
(
target
.
getCertificateTime
());
return
supplierEarlyWarningVO
;
}
private
List
<
ExtSupplierManageLinkVO
>
recursionSupplierManageLinks
(
String
warningDate
)
{
SearchQueryCondition
condition
=
SearchQueryCondition
.
builder
().
searchItems
(
SearchItems
.
of
(
SearchItems
.
BooleanOperator
.
AND
,
new
SearchItem
(
"target.certificateTime"
,
SearchItem
.
Operator
.
GT
,
warningDate
,
null
)
)
).
openProp
(
SearchQueryCondition
.
builder
().
name
(
"target"
).
build
()
).
openProp
(
SearchQueryCondition
.
builder
().
name
(
"source"
).
build
()).
build
();
List
<
ExtSupplierManageLinkVO
>
content
=
extSupplierManageLinkService
.
findRecursion
(
condition
).
getContent
();
return
content
;
}
}
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