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
628e1c4d
Commit
628e1c4d
authored
Sep 21, 2024
by
wei
🎱
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
供方预警列表分页
parent
7dc713b3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
14 deletions
+26
-14
ExtSupplierManageController.java
...dcs/plan/core/controller/ExtSupplierManageController.java
+4
-2
ExtSupplierManageService.java
...yonde/dcs/plan/core/service/ExtSupplierManageService.java
+9
-1
ExtSupplierManageServiceImpl.java
.../plan/core/service/impl/ExtSupplierManageServiceImpl.java
+13
-11
No files found.
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/controller/ExtSupplierManageController.java
View file @
628e1c4d
...
@@ -42,8 +42,10 @@ public class ExtSupplierManageController<V extends ExtSupplierManageVO, S extend
...
@@ -42,8 +42,10 @@ public class ExtSupplierManageController<V extends ExtSupplierManageVO, S extend
@ApiOperation
(
"供方预警列表"
)
@ApiOperation
(
"供方预警列表"
)
@PostMapping
({
"earlyWarning"
})
@PostMapping
({
"earlyWarning"
})
public
ApiResult
earlyWarning
(
@RequestParam
(
"warningDay"
)
Integer
warningDay
)
{
public
ApiResult
earlyWarning
(
@RequestParam
(
value
=
"warningDay"
,
defaultValue
=
"30"
)
int
warningDay
,
return
ApiResult
.
ok
(
extSupplierManageService
.
earlyWarning
(
warningDay
),
"查询成功"
);
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"10"
)
int
pageSize
,
@RequestParam
(
value
=
"pageNumber"
,
defaultValue
=
"1"
)
int
pageNumber
)
{
return
ApiResult
.
ok
(
extSupplierManageService
.
earlyWarning
(
pageSize
,
pageNumber
,
warningDay
),
"查询成功"
);
}
}
@ApiOperation
(
"导出供方预警列表"
)
@ApiOperation
(
"导出供方预警列表"
)
...
...
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/ExtSupplierManageService.java
View file @
628e1c4d
...
@@ -16,7 +16,15 @@ public interface ExtSupplierManageService<V extends ExtSupplierManageVO> extends
...
@@ -16,7 +16,15 @@ public interface ExtSupplierManageService<V extends ExtSupplierManageVO> extends
ExtSupplierManageVO
startWorkflow
(
Long
id
);
ExtSupplierManageVO
startWorkflow
(
Long
id
);
List
<
SupplierEarlyWarningVO
>
earlyWarning
(
Integer
warningDay
);
/**
* 获取预警列表
*
* @param pageSize 每页大小
* @param pageNumber 第几页
* @param warningDay 预警天数
* @return
*/
List
<
SupplierEarlyWarningVO
>
earlyWarning
(
int
pageSize
,
int
pageNumber
,
int
warningDay
);
List
<
SupplierEarlyWarningVO
>
exportEarlyWarningData
(
List
<
Long
>
ids
);
List
<
SupplierEarlyWarningVO
>
exportEarlyWarningData
(
List
<
Long
>
ids
);
}
}
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/impl/ExtSupplierManageServiceImpl.java
View file @
628e1c4d
...
@@ -15,14 +15,13 @@ import com.yonde.dex.basedata.data.search.SearchQueryCondition;
...
@@ -15,14 +15,13 @@ import com.yonde.dex.basedata.data.search.SearchQueryCondition;
import
com.yonde.dex.basedata.exception.DxBusinessException
;
import
com.yonde.dex.basedata.exception.DxBusinessException
;
import
com.yonde.dex.wfc.feign.api.WfcProcessFeign
;
import
com.yonde.dex.wfc.feign.api.WfcProcessFeign
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDate
;
import
java.time.LocalDate
;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
/**
* @description: ExtSupplierManage-ServiceImpl
* @description: ExtSupplierManage-ServiceImpl
...
@@ -58,16 +57,19 @@ public class ExtSupplierManageServiceImpl<V extends ExtSupplierManageVO> impleme
...
@@ -58,16 +57,19 @@ public class ExtSupplierManageServiceImpl<V extends ExtSupplierManageVO> impleme
}
}
@Override
@Override
public
List
<
SupplierEarlyWarningVO
>
earlyWarning
(
Integer
warningDay
)
{
public
List
<
SupplierEarlyWarningVO
>
earlyWarning
(
int
pageSize
,
int
pageNumber
,
int
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
<
SupplierEarlyWarningVO
>
list
=
Lists
.
newArrayList
();
LocalDate
warningDate
=
LocalDate
.
now
().
minusDays
(
warningDay
);
List
<
ExtSupplierManageLinkVO
>
extSupplierManageLinkVOS
=
this
.
recursionSupplierManageLinks
(
warningDate
.
toString
());
List
<
ExtSupplierManageLinkVO
>
extSupplierManageLinkVOS
=
this
.
recursionSupplierManageLinks
(
warningDate
.
toString
());
// 分页
if
(
pageSize
>
0
&&
pageNumber
>
0
)
{
int
fromIndex
=
(
pageNumber
-
1
)
*
pageSize
;
//int toIndex = fromIndex + pageSize;
if
(
fromIndex
>=
extSupplierManageLinkVOS
.
size
())
{
return
list
;
}
extSupplierManageLinkVOS
=
extSupplierManageLinkVOS
.
stream
().
skip
(
fromIndex
).
limit
(
pageSize
).
collect
(
Collectors
.
toList
());
}
for
(
ExtSupplierManageLinkVO
extSupplierManageLinkVO
:
extSupplierManageLinkVOS
)
{
for
(
ExtSupplierManageLinkVO
extSupplierManageLinkVO
:
extSupplierManageLinkVOS
)
{
ExtSupplierManageVO
source
=
extSupplierManageLinkVO
.
getSource
();
ExtSupplierManageVO
source
=
extSupplierManageLinkVO
.
getSource
();
ExtQualificationsVO
target
=
extSupplierManageLinkVO
.
getTarget
();
ExtQualificationsVO
target
=
extSupplierManageLinkVO
.
getTarget
();
...
@@ -78,7 +80,7 @@ public class ExtSupplierManageServiceImpl<V extends ExtSupplierManageVO> impleme
...
@@ -78,7 +80,7 @@ public class ExtSupplierManageServiceImpl<V extends ExtSupplierManageVO> impleme
@Override
@Override
public
List
<
SupplierEarlyWarningVO
>
exportEarlyWarningData
(
List
<
Long
>
ids
)
{
public
List
<
SupplierEarlyWarningVO
>
exportEarlyWarningData
(
List
<
Long
>
ids
)
{
return
this
.
earlyWarning
(
30
);
return
this
.
earlyWarning
(
0
,
0
,
30
);
}
}
private
SupplierEarlyWarningVO
buildSupplierEarlyWarningVO
(
ExtSupplierManageVO
source
,
ExtQualificationsVO
target
)
{
private
SupplierEarlyWarningVO
buildSupplierEarlyWarningVO
(
ExtSupplierManageVO
source
,
ExtQualificationsVO
target
)
{
...
...
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