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
a1d4936a
Commit
a1d4936a
authored
Sep 22, 2024
by
wei
🎱
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
供方预警列表导出
parent
628e1c4d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
40 deletions
+26
-40
SupplierEarlyWarningVO.java
.../com/yonde/dcs/plan/common/vo/SupplierEarlyWarningVO.java
+3
-0
ExtSupplierManageController.java
...dcs/plan/core/controller/ExtSupplierManageController.java
+8
-10
ExtSupplierManageService.java
...yonde/dcs/plan/core/service/ExtSupplierManageService.java
+3
-10
ExtSupplierManageServiceImpl.java
.../plan/core/service/impl/ExtSupplierManageServiceImpl.java
+12
-20
No files found.
dcs-plan-common/src/main/java/com/yonde/dcs/plan/common/vo/SupplierEarlyWarningVO.java
View file @
a1d4936a
...
@@ -13,6 +13,9 @@ import java.time.LocalDateTime;
...
@@ -13,6 +13,9 @@ import java.time.LocalDateTime;
*/
*/
@Data
@Data
public
class
SupplierEarlyWarningVO
implements
Serializable
{
public
class
SupplierEarlyWarningVO
implements
Serializable
{
private
long
id
;
/**
/**
* 供方编号
* 供方编号
*/
*/
...
...
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/controller/ExtSupplierManageController.java
View file @
a1d4936a
...
@@ -5,15 +5,13 @@ import com.yonde.dcs.plan.common.vo.ExtSupplierManageVO;
...
@@ -5,15 +5,13 @@ import com.yonde.dcs.plan.common.vo.ExtSupplierManageVO;
import
com.yonde.dcs.plan.common.vo.SupplierEarlyWarningVO
;
import
com.yonde.dcs.plan.common.vo.SupplierEarlyWarningVO
;
import
com.yonde.dcs.plan.core.controller.shadow.ExtSupplierManageControllerShadow
;
import
com.yonde.dcs.plan.core.controller.shadow.ExtSupplierManageControllerShadow
;
import
com.yonde.dcs.plan.core.service.ExtSupplierManageService
;
import
com.yonde.dcs.plan.core.service.ExtSupplierManageService
;
import
com.yonde.dex.basedata.data.search.SearchQueryCondition
;
import
com.yonde.dex.basedata.entity.api.ApiResult
;
import
com.yonde.dex.basedata.entity.api.ApiResult
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.io.IOException
;
...
@@ -43,17 +41,17 @@ public class ExtSupplierManageController<V extends ExtSupplierManageVO, S extend
...
@@ -43,17 +41,17 @@ public class ExtSupplierManageController<V extends ExtSupplierManageVO, S extend
@ApiOperation
(
"供方预警列表"
)
@ApiOperation
(
"供方预警列表"
)
@PostMapping
({
"earlyWarning"
})
@PostMapping
({
"earlyWarning"
})
public
ApiResult
earlyWarning
(
@RequestParam
(
value
=
"warningDay"
,
defaultValue
=
"30"
)
int
warningDay
,
public
ApiResult
earlyWarning
(
@RequestParam
(
value
=
"warningDay"
,
defaultValue
=
"30"
)
int
warningDay
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"10"
)
int
pageSize
,
@RequestBody
SearchQueryCondition
searchQueryCondition
)
{
@RequestParam
(
value
=
"pageNumber"
,
defaultValue
=
"1"
)
int
pageNumber
)
{
return
ApiResult
.
ok
(
extSupplierManageService
.
earlyWarning
(
searchQueryCondition
,
warningDay
),
"查询成功"
);
return
ApiResult
.
ok
(
extSupplierManageService
.
earlyWarning
(
pageSize
,
pageNumber
,
warningDay
),
"查询成功"
);
}
}
@ApiOperation
(
"导出供方预警列表"
)
@ApiOperation
(
"导出供方预警列表"
)
@PostMapping
(
value
=
"/exportEarlyWarningData"
)
@PostMapping
(
value
=
"/exportEarlyWarningData"
)
public
void
exportEarlyWarningData
(
@RequestParam
(
"fileName"
)
String
fileName
,
@RequestParam
(
"ids"
)
List
<
Long
>
ids
,
public
void
exportEarlyWarningData
(
@RequestParam
(
"fileName"
)
String
fileName
,
HttpServletResponse
response
,
HttpServletResponse
response
)
{
@RequestParam
(
value
=
"warningDay"
,
defaultValue
=
"30"
)
int
warningDay
,
@RequestBody
SearchQueryCondition
searchQueryCondition
)
{
try
{
try
{
List
<
SupplierEarlyWarningVO
>
list
=
extSupplierManageService
.
exportEarlyWarningData
(
ids
);
List
<
SupplierEarlyWarningVO
>
list
=
extSupplierManageService
.
exportEarlyWarningData
(
searchQueryCondition
,
warningDay
);
EasyExcelUtils
.
exportData
(
fileName
,
response
,
list
,
SupplierEarlyWarningVO
.
class
);
EasyExcelUtils
.
exportData
(
fileName
,
response
,
list
,
SupplierEarlyWarningVO
.
class
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
...
...
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/ExtSupplierManageService.java
View file @
a1d4936a
...
@@ -3,6 +3,7 @@ package com.yonde.dcs.plan.core.service;
...
@@ -3,6 +3,7 @@ package com.yonde.dcs.plan.core.service;
import
com.yonde.dcs.plan.common.vo.ExtSupplierManageVO
;
import
com.yonde.dcs.plan.common.vo.ExtSupplierManageVO
;
import
com.yonde.dcs.plan.common.vo.SupplierEarlyWarningVO
;
import
com.yonde.dcs.plan.common.vo.SupplierEarlyWarningVO
;
import
com.yonde.dcs.plan.core.service.shadow.ExtSupplierManageServiceShadow
;
import
com.yonde.dcs.plan.core.service.shadow.ExtSupplierManageServiceShadow
;
import
com.yonde.dex.basedata.data.search.SearchQueryCondition
;
import
java.util.List
;
import
java.util.List
;
...
@@ -16,15 +17,7 @@ public interface ExtSupplierManageService<V extends ExtSupplierManageVO> extends
...
@@ -16,15 +17,7 @@ public interface ExtSupplierManageService<V extends ExtSupplierManageVO> extends
ExtSupplierManageVO
startWorkflow
(
Long
id
);
ExtSupplierManageVO
startWorkflow
(
Long
id
);
/**
List
<
SupplierEarlyWarningVO
>
earlyWarning
(
SearchQueryCondition
searchQueryCondition
,
int
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
(
SearchQueryCondition
searchQueryCondition
,
int
warningDay
);
}
}
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/impl/ExtSupplierManageServiceImpl.java
View file @
a1d4936a
...
@@ -10,7 +10,6 @@ import com.yonde.dcs.plan.core.service.ExtSupplierManageLinkService;
...
@@ -10,7 +10,6 @@ import com.yonde.dcs.plan.core.service.ExtSupplierManageLinkService;
import
com.yonde.dcs.plan.core.service.ExtSupplierManageService
;
import
com.yonde.dcs.plan.core.service.ExtSupplierManageService
;
import
com.yonde.dcs.plan.entity.po.ExtSupplierManage
;
import
com.yonde.dcs.plan.entity.po.ExtSupplierManage
;
import
com.yonde.dex.basedata.data.search.SearchItem
;
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.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
;
...
@@ -21,7 +20,6 @@ import org.springframework.stereotype.Service;
...
@@ -21,7 +20,6 @@ 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
...
@@ -57,19 +55,10 @@ public class ExtSupplierManageServiceImpl<V extends ExtSupplierManageVO> impleme
...
@@ -57,19 +55,10 @@ public class ExtSupplierManageServiceImpl<V extends ExtSupplierManageVO> impleme
}
}
@Override
@Override
public
List
<
SupplierEarlyWarningVO
>
earlyWarning
(
int
pageSize
,
int
pageNumber
,
int
warningDay
)
{
public
List
<
SupplierEarlyWarningVO
>
earlyWarning
(
SearchQueryCondition
searchQueryCondition
,
int
warningDay
)
{
List
<
SupplierEarlyWarningVO
>
list
=
Lists
.
newArrayList
();
List
<
SupplierEarlyWarningVO
>
list
=
Lists
.
newArrayList
();
LocalDate
warningDate
=
LocalDate
.
now
().
minusDays
(
warningDay
);
LocalDate
warningDate
=
LocalDate
.
now
().
minusDays
(
warningDay
);
List
<
ExtSupplierManageLinkVO
>
extSupplierManageLinkVOS
=
this
.
recursionSupplierManageLinks
(
warningDate
.
toString
());
List
<
ExtSupplierManageLinkVO
>
extSupplierManageLinkVOS
=
this
.
recursionSupplierManageLinks
(
searchQueryCondition
,
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
();
...
@@ -79,8 +68,8 @@ public class ExtSupplierManageServiceImpl<V extends ExtSupplierManageVO> impleme
...
@@ -79,8 +68,8 @@ public class ExtSupplierManageServiceImpl<V extends ExtSupplierManageVO> impleme
}
}
@Override
@Override
public
List
<
SupplierEarlyWarningVO
>
exportEarlyWarningData
(
List
<
Long
>
ids
)
{
public
List
<
SupplierEarlyWarningVO
>
exportEarlyWarningData
(
SearchQueryCondition
searchQueryCondition
,
int
warningDay
)
{
return
this
.
earlyWarning
(
0
,
0
,
30
);
return
earlyWarning
(
searchQueryCondition
,
warningDay
);
}
}
private
SupplierEarlyWarningVO
buildSupplierEarlyWarningVO
(
ExtSupplierManageVO
source
,
ExtQualificationsVO
target
)
{
private
SupplierEarlyWarningVO
buildSupplierEarlyWarningVO
(
ExtSupplierManageVO
source
,
ExtQualificationsVO
target
)
{
...
@@ -89,19 +78,22 @@ public class ExtSupplierManageServiceImpl<V extends ExtSupplierManageVO> impleme
...
@@ -89,19 +78,22 @@ public class ExtSupplierManageServiceImpl<V extends ExtSupplierManageVO> impleme
supplierEarlyWarningVO
.
setQualificationsContent
(
target
.
getQualificationsContent
());
supplierEarlyWarningVO
.
setQualificationsContent
(
target
.
getQualificationsContent
());
supplierEarlyWarningVO
.
setCertificateNumber
(
target
.
getCertificateNumber
());
supplierEarlyWarningVO
.
setCertificateNumber
(
target
.
getCertificateNumber
());
supplierEarlyWarningVO
.
setCertificateTime
(
target
.
getCertificateTime
());
supplierEarlyWarningVO
.
setCertificateTime
(
target
.
getCertificateTime
());
supplierEarlyWarningVO
.
setId
(
target
.
getId
());
return
supplierEarlyWarningVO
;
return
supplierEarlyWarningVO
;
}
}
private
List
<
ExtSupplierManageLinkVO
>
recursionSupplierManageLinks
(
String
warningDate
)
{
private
List
<
ExtSupplierManageLinkVO
>
recursionSupplierManageLinks
(
S
earchQueryCondition
searchQueryCondition
,
S
tring
warningDate
)
{
SearchQueryCondition
condition
=
SearchQueryCondition
.
builder
().
searchItems
(
/*
SearchQueryCondition condition = SearchQueryCondition.builder().searchItems(
SearchItems.of(
SearchItems.of(
SearchItems.BooleanOperator.AND,
SearchItems.BooleanOperator.AND,
new SearchItem("target.certificateTime", SearchItem.Operator.GT, warningDate, null)
new SearchItem("target.certificateTime", SearchItem.Operator.GT, warningDate, null)
)
)
).openProp(SearchQueryCondition.builder().name("target").build()
).openProp(SearchQueryCondition.builder().name("target").build()
).
openProp
(
SearchQueryCondition
.
builder
().
name
(
"source"
).
build
()).
build
();
).openProp(SearchQueryCondition.builder().name("source").build()).build();*/
List
<
ExtSupplierManageLinkVO
>
content
=
extSupplierManageLinkService
.
findRecursion
(
condition
).
getContent
();
SearchItem
searchItem
=
new
SearchItem
(
"target.certificateTime"
,
SearchItem
.
Operator
.
GT
,
warningDate
);
searchQueryCondition
.
getSearchItems
().
getItems
().
add
(
searchItem
);
List
<
ExtSupplierManageLinkVO
>
content
=
extSupplierManageLinkService
.
findRecursion
(
searchQueryCondition
).
getContent
();
return
content
;
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