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
92a601fc
Commit
92a601fc
authored
Sep 23, 2024
by
wei
🎱
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
定时任务
parent
d0e1ceaf
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
168 additions
and
94 deletions
+168
-94
ExtSupplierManageVO.java
...ava/com/yonde/dcs/plan/common/vo/ExtSupplierManageVO.java
+73
-91
SupplierEarlyWarningVO.java
.../com/yonde/dcs/plan/common/vo/SupplierEarlyWarningVO.java
+1
-1
ExecutorPoolConfig.java
...va/com/yonde/dcs/plan/core/config/ExecutorPoolConfig.java
+37
-0
ChangeSupplierStatus.java
...m/yonde/dcs/plan/core/scheduled/ChangeSupplierStatus.java
+31
-0
ExtSupplierManageService.java
...yonde/dcs/plan/core/service/ExtSupplierManageService.java
+2
-0
ExtSupplierManageServiceImpl.java
.../plan/core/service/impl/ExtSupplierManageServiceImpl.java
+19
-1
ExtSupplierManage.java
.../java/com/yonde/dcs/plan/entity/po/ExtSupplierManage.java
+1
-1
ServerApplication.java
...ain/java/com/yonde/dcs/plan/server/ServerApplication.java
+4
-0
No files found.
dcs-plan-common/src/main/java/com/yonde/dcs/plan/common/vo/ExtSupplierManageVO.java
View file @
92a601fc
package
com
.
yonde
.
dcs
.
plan
.
common
.
vo
;
import
javax.validation.constraints.NotBlank
;
import
java.util.Date
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
cn.hutool.core.convert.Convert
;
import
com.yonde.dex.basedata.entity.annotation.XmlElementProperty
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.annotation.JsonUnwrapped
;
import
lombok.ToString
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter
;
import
java.math.BigInteger
;
import
org.springframework.data.annotation.Transient
;
import
lombok.experimental.Delegate
;
import
javax.xml.bind.annotation.*
;
import
javax.xml.bind.annotation.XmlAttribute
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.EqualsAndHashCode
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
import
com.fasterxml.jackson.annotation.JsonTypeInfo
;
import
com.yonde.dex.basedata.entity.xmladapters.LocalDateTimeXmlAdapter
;
import
lombok.Data
;
import
com.yonde.dex.basedata.entity.annotation.*
;
import
lombok.AllArgsConstructor
;
import
lombok.NoArgsConstructor
;
import
com.yonde.dex.basedata.entity.vo.IdOnlyVO
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.lang.TypeReference
;
import
com.yonde.dcs.document.common.entity.vo.DxDocumentVO
;
import
com.yonde.dex.basedata.entity.annotation.DexEmbedded
;
import
com.yonde.dex.basedata.entity.annotation.ReferenceProperty
;
import
com.yonde.dex.basedata.entity.annotation.RelationProperty
;
import
com.yonde.dex.basedata.entity.annotation.VersionProperty
;
import
com.yonde.dex.basedata.entity.data.VersionRelationType
;
import
com.yonde.dex.basedata.entity.vo.DxIdVOEmbeddable
;
import
com.yonde.dex.secretcode.plugin.common.entity.DxSecretVOHolder
;
import
com.yonde.dex.basedata.entity.vo.IdOnlyVO
;
import
com.yonde.dex.basedata.entity.vo.IdVO
;
import
com.yonde.dex.dfs.objfilelink.plugin.common.entity.DxObjFileLinkVOEmbeddable
;
import
com.yonde.dex.dfs.objfilelink.plugin.common.entity.DxObjFileLinkVOHolder
;
import
com.yonde.dex.version.plugin.common.entity.DxIterationVOEmbeddable
;
import
com.yonde.dex.basedata.entity.users.DxUserVO
;
import
com.yonde.dex.lcycle.plugin.common.entity.DxLifecycleManageBaseVOHolder
;
import
com.yonde.dex.lcycle.plugin.common.entity.DxLifecycleManageBaseVOEmbeddable
;
import
com.yonde.dex.logicdelete.plugin.common.entity.DxLogicDeleteVOHolder
;
import
com.yonde.dcs.plan.common.vo.ExtSupplierManageLinkVO
;
import
com.yonde.dex.lcycle.plugin.common.entity.DxLifecycleManageBaseVOHolder
;
import
com.yonde.dex.logicdelete.plugin.common.entity.DxLogicDeleteVOEmbeddable
;
import
com.yonde.dex.
basedata.entity.vo.IdVO
;
import
com.yonde.dex.
logicdelete.plugin.common.entity.DxLogicDeleteVOHolder
;
import
com.yonde.dex.secretcode.plugin.common.entity.DxSecretVOEmbeddable
;
import
com.yonde.d
cs.document.common.entity.vo.DxDocumentVO
;
import
com.yonde.dex.
dfs.objfilelink.plugin.common.entity.DxObjFileLink
VOEmbeddable
;
import
com.yonde.d
ex.secretcode.plugin.common.entity.DxSecretVOHolder
;
import
com.yonde.dex.
version.plugin.common.entity.DxIteration
VOEmbeddable
;
import
com.yonde.dex.version.plugin.common.entity.DxIterationVOHolder
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.ToString
;
import
java.time.LocalDateTime
;
import
java.util.List
;
/**
* @description: ExtSupplierManage-VO
* @author: dexadmin
* @version: V
* @date: 2024-9-19 11:25:51
**/
@JsonTypeInfo
(
use
=
JsonTypeInfo
.
Id
.
CLASS
,
property
=
"dxClassname"
,
visible
=
true
,
defaultImpl
=
ExtSupplierManageVO
.
class
)
* @description: ExtSupplierManage-VO
* @author: dexadmin
* @version: V
* @date: 2024-9-19 11:25:51
**/
@JsonTypeInfo
(
use
=
JsonTypeInfo
.
Id
.
CLASS
,
property
=
"dxClassname"
,
visible
=
true
,
defaultImpl
=
ExtSupplierManageVO
.
class
)
@EqualsAndHashCode
(
callSuper
=
true
)
@Data
@ToString
(
callSuper
=
true
)
public
class
ExtSupplierManageVO
extends
IdOnlyVO
implements
DxIterationVOHolder
<
ExtSupplierManageVO
>
,
IdVO
,
DxLifecycleManageBaseVOHolder
,
DxObjFileLinkVOHolder
,
DxLogicDeleteVOHolder
,
DxSecretVOHolder
{
public
class
ExtSupplierManageVO
extends
IdOnlyVO
implements
DxIterationVOHolder
<
ExtSupplierManageVO
>
,
IdVO
,
DxLifecycleManageBaseVOHolder
,
DxObjFileLinkVOHolder
,
DxLogicDeleteVOHolder
,
DxSecretVOHolder
{
public
static
final
String
DX_OBJ_FILE_LINK_EMBEDDABLE_PROP_NAME
=
"dxObjFileLinkEmbeddable"
;
public
static
final
String
DX_LIFECYCLE_MANAGE_BASE_EMBEDDABLE_PROP_NAME
=
"dxLifecycleManageBaseEmbeddable"
;
...
...
@@ -127,7 +109,7 @@ public class ExtSupplierManageVO extends IdOnlyVO implements DxIterationVOHolder
/**
* 名录有效期
*/
private
String
directoryValidity
;
private
LocalDateTime
directoryValidity
;
/**
* 文档
...
...
@@ -218,7 +200,7 @@ public class ExtSupplierManageVO extends IdOnlyVO implements DxIterationVOHolder
private
String
unifiedSocietyCode
;
/**
*
supplierNumber
*
供方编码
*/
private
String
supplierNumber
;
}
...
...
dcs-plan-common/src/main/java/com/yonde/dcs/plan/common/vo/SupplierEarlyWarningVO.java
View file @
92a601fc
...
...
@@ -74,7 +74,7 @@ public class SupplierEarlyWarningVO implements Serializable {
* 名录有效期
*/
@ExcelProperty
(
"名录有效期"
)
private
String
directoryValidity
;
private
LocalDateTime
directoryValidity
;
/**
* 资质内容
...
...
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/config/ExecutorPoolConfig.java
0 → 100644
View file @
92a601fc
package
com
.
yonde
.
dcs
.
plan
.
core
.
config
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
;
import
java.util.concurrent.Executor
;
/**
* @author weihongda
* @date 2024/09/23
*/
@Configuration
@EnableAsync
public
class
ExecutorPoolConfig
{
@Bean
(
"customThreadPool"
)
public
Executor
customThreadPool
()
{
return
createExecutor
(
"CustomThreadPool-"
);
}
/*@Bean("refreshThreadPool")
public ThreadPoolTaskExecutor refreshThreadPool() {
return createExecutor("refreshing-");
}*/
private
ThreadPoolTaskExecutor
createExecutor
(
String
threadNamePrefix
)
{
ThreadPoolTaskExecutor
executor
=
new
ThreadPoolTaskExecutor
();
executor
.
setCorePoolSize
(
5
);
executor
.
setMaxPoolSize
(
20
);
executor
.
setQueueCapacity
(
1000
);
executor
.
setThreadNamePrefix
(
threadNamePrefix
);
executor
.
initialize
();
return
executor
;
}
}
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/scheduled/ChangeSupplierStatus.java
0 → 100644
View file @
92a601fc
package
com
.
yonde
.
dcs
.
plan
.
core
.
scheduled
;
import
com.yonde.dcs.plan.core.service.ExtSupplierManageService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
/**
* @author weihongda
* @Date 2024/9/23 17:21
* @Description: 供应商定时任务
*/
@Component
@Slf4j
public
class
ChangeSupplierStatus
{
@Autowired
private
ExtSupplierManageService
extSupplierManageService
;
@Scheduled
(
cron
=
"0 0 0 * * ? "
)
@Async
(
"customThreadPool"
)
public
void
changeStatus
()
{
log
.
info
(
"定时执行更新供应商过期状态开始==========="
);
long
begin
=
System
.
currentTimeMillis
();
extSupplierManageService
.
changeStatus
();
long
end
=
System
.
currentTimeMillis
();
log
.
info
(
"定时执行更新供应商过期状态结束,共耗时:["
+
(
end
-
begin
)
/
1000
+
"]秒"
);
}
}
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/ExtSupplierManageService.java
View file @
92a601fc
...
...
@@ -23,4 +23,6 @@ public interface ExtSupplierManageService<V extends ExtSupplierManageVO> extends
List
<
SupplierEarlyWarningVO
>
exportEarlyWarningData
(
SearchQueryCondition
searchQueryCondition
,
int
warningDay
);
void
generateSupplierNumber
(
ExtSupplierManageVO
extSupplierManageVO
);
void
changeStatus
();
}
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/impl/ExtSupplierManageServiceImpl.java
View file @
92a601fc
...
...
@@ -10,6 +10,7 @@ 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.entity.data.DxPageImpl
;
import
com.yonde.dex.basedata.exception.DxBusinessException
;
...
...
@@ -46,7 +47,7 @@ public class ExtSupplierManageServiceImpl<V extends ExtSupplierManageVO> impleme
@Override
public
ExtSupplierManageVO
startWorkflow
(
Long
id
)
{
ExtSupplierManageVO
extSupplierManageVO
=
this
.
get
(
id
);
ExtSupplierManageVO
extSupplierManageVO
=
this
.
get
(
id
);
if
(
extSupplierManageVO
==
null
)
{
throw
new
DxBusinessException
(
"500"
,
"获取不到对象"
);
}
...
...
@@ -115,6 +116,23 @@ public class ExtSupplierManageServiceImpl<V extends ExtSupplierManageVO> impleme
this
.
saveRecursion
((
V
)
extSupplierManageVO
);
log
.
info
(
"generateEncode.supplierNumber={}"
,
supplierNumber
);
}
@Override
public
void
changeStatus
()
{
LocalDateTime
localDateTime
=
LocalDate
.
now
().
atStartOfDay
();
SearchQueryCondition
condition
=
SearchQueryCondition
.
builder
()
.
searchItems
(
SearchItems
.
builder
()
.
item
(
new
SearchItem
(
"state"
,
SearchItem
.
Operator
.
EQ
,
"release"
,
null
))
.
item
(
new
SearchItem
(
"directoryValidity"
,
SearchItem
.
Operator
.
GT
,
localDateTime
,
null
))
.
build
())
.
build
();
List
<
ExtSupplierManageVO
>
content
=
(
List
<
ExtSupplierManageVO
>)
this
.
findRecursion
(
condition
).
getContent
();
log
.
info
(
"changeStatus.条数:{}"
,
content
.
size
());
for
(
ExtSupplierManageVO
extSupplierManageVO
:
content
)
{
Long
id
=
extSupplierManageVO
.
getId
();
this
.
changeStatus
(
id
,
"Expired"
,
true
);
}
}
}
dcs-plan-entity/src/main/java/com/yonde/dcs/plan/entity/po/ExtSupplierManage.java
View file @
92a601fc
...
...
@@ -76,7 +76,7 @@ public class ExtSupplierManage extends IdOnlyEntity implements DxObjFileLinkHold
/**
* 名录有效期
*/
private
String
directoryValidity
;
private
LocalDateTime
directoryValidity
;
/**
* 文档的id
*/
...
...
dcs-plan-server/src/main/java/com/yonde/dcs/plan/server/ServerApplication.java
View file @
92a601fc
...
...
@@ -6,6 +6,8 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.data.jpa.repository.config.EnableJpaAuditing
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
@ComponentScan
(
basePackages
=
{
"com.yonde"
}
...
...
@@ -20,6 +22,8 @@ import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
feignReplaceBasePackages
=
{
"com.yonde"
},
entityCollectorBasePackages
=
{
"com.yonde"
}
)
@EnableScheduling
@EnableAsync
public
class
ServerApplication
{
public
static
void
main
(
String
[]
args
)
{
...
...
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