Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
3e8d92b7
Commit
3e8d92b7
authored
Jun 01, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.增加定时任务生成资质过期问题
parent
e94990e4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
99 additions
and
2 deletions
+99
-2
QuestionTypeEnum.java
...amos/boot/module/cylinder/api/enums/QuestionTypeEnum.java
+2
-2
CylinderUnitDto.java
...mos/boot/module/cylinder/flc/api/dto/CylinderUnitDto.java
+5
-0
CylinderUnitMapper.java
...ot/module/cylinder/flc/api/mapper/CylinderUnitMapper.java
+9
-0
CylinderUnitMapper.xml
...nder-api/src/main/resources/mapper/CylinderUnitMapper.xml
+13
-0
CompanyQuestionJob.java
...amos/boot/module/cylinder/biz/job/CompanyQuestionJob.java
+70
-0
No files found.
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-api/src/main/java/com/yeejoin/amos/boot/module/cylinder/api/enums/QuestionTypeEnum.java
View file @
3e8d92b7
...
...
@@ -12,8 +12,8 @@ public enum QuestionTypeEnum {
/**
* 问题类型
*/
WBLSYDJ
(
"1"
,
"未办理使用登记
"
),
XKCQ
(
"2"
,
"许可超期
"
),
XKCQ
(
"1"
,
"许可超期
"
),
WBLSYDJ
(
"2"
,
"未办理使用登记
"
),
JYCQ
(
"3"
,
"检验超期"
),
JYBHG
(
"4"
,
"检验不合格"
),
WJXCZJJ
(
"5"
,
"未进行充装检查"
),
...
...
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-api/src/main/java/com/yeejoin/amos/boot/module/cylinder/flc/api/dto/CylinderUnitDto.java
View file @
3e8d92b7
...
...
@@ -109,4 +109,9 @@ public class CylinderUnitDto extends BaseDto {
@ApiModelProperty
(
value
=
"技术服务商"
)
private
String
developerAgency
;
/**
* 资质到期日期
*/
private
Date
expireDate
;
}
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-api/src/main/java/com/yeejoin/amos/boot/module/cylinder/flc/api/mapper/CylinderUnitMapper.java
View file @
3e8d92b7
...
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.cylinder.flc.api.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CityCylinderInfoDto
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderInfoDto
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderUnitDto
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylinderUnit
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -56,4 +57,12 @@ public interface CylinderUnitMapper extends BaseMapper<CylinderUnit> {
*/
List
<
CityCylinderInfoDto
>
getCylinderDataByLevel
(
@Param
(
"level"
)
String
level
);
void
saveOrUpdateBatch
(
@Param
(
"list"
)
List
<
CylinderUnit
>
list
);
/**
* 查询资质超期但是还没生成问题的单位
* @param questionType 问题类型
* @return List<CylinderInfoDto>
*/
List
<
CylinderUnitDto
>
queryCylinderUnitOfPermissionExpire
(
@Param
(
"questionType"
)
String
questionType
);
}
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-api/src/main/resources/mapper/CylinderUnitMapper.xml
View file @
3e8d92b7
...
...
@@ -65,6 +65,19 @@
FROM tz_cylinder_unit tcu
WHERE tcu.region_code like concat('%', #{regionCode}, '%')
</select>
<select
id=
"queryCylinderUnitOfPermissionExpire"
resultType=
"com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderUnitDto"
>
SELECT
(SELECT min(l.expiry_date) from tz_base_unit_licence l where l."UNIT_CODE" = u.credit_code) as expire_date,
u.app_id,
u.unit_name,
u.region_code,
u.credit_code
FROM
tz_cylinder_unit u
where
date_gt(CURRENT_DATE, expire_date)
and not EXISTS (select 1 from tz_cylinder_question_info q where u.credit_code = q.question_object_id and q.question_type = #{questionType} )
</select>
<insert
id=
"saveOrUpdateBatch"
parameterType=
"com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylinderUnit"
>
INSERT INTO "tz_cylinder_unit"(sequence_nbr,unit_id,region_code,unit_name,credit_code,address,unit_person,person_mobile_phone,person_telephone,postal_code,rec_date,rec_user_id,sync_date,sync_state,app_id,security_adm,security_adm_phone,region_name)
VALUES
...
...
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-biz/src/main/java/com/yeejoin/amos/boot/module/cylinder/biz/job/CompanyQuestionJob.java
0 → 100644
View file @
3e8d92b7
package
com
.
yeejoin
.
amos
.
boot
.
module
.
cylinder
.
biz
.
job
;
import
com.yeejoin.amos.boot.module.cylinder.api.entity.CylinderQuestionInfo
;
import
com.yeejoin.amos.boot.module.cylinder.api.enums.QuestionTypeEnum
;
import
com.yeejoin.amos.boot.module.cylinder.biz.service.impl.CylinderQuestionInfoServiceImpl
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderUnitDto
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.mapper.CylinderUnitMapper
;
import
net.javacrumbs.shedlock.spring.annotation.SchedulerLock
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.validation.constraints.NotNull
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* @author Administrator
*/
@Component
@EnableScheduling
public
class
CompanyQuestionJob
{
private
CylinderUnitMapper
cylinderUnitMapper
;
private
CylinderQuestionInfoServiceImpl
questionInfoService
;
public
CompanyQuestionJob
(
CylinderUnitMapper
cylinderUnitMapper
,
CylinderQuestionInfoServiceImpl
questionInfoService
)
{
this
.
cylinderUnitMapper
=
cylinderUnitMapper
;
this
.
questionInfoService
=
questionInfoService
;
}
/**
* 资质超期
*/
@SchedulerLock
(
name
=
"genCompanyQuestionOfPermissionExpireJob"
,
lockAtMostFor
=
"PT4M"
)
@Scheduled
(
cron
=
"${inspection.cert.expire.job.cron:0 0/2 * * * ?}"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
genCompanyQuestionOfPermissionExpire
()
{
List
<
CylinderUnitDto
>
cylinderUnitDtoList
=
cylinderUnitMapper
.
queryCylinderUnitOfPermissionExpire
(
QuestionTypeEnum
.
XKCQ
.
getCode
());
List
<
CylinderQuestionInfo
>
cylinderQuestionInfos
=
cylinderUnitDtoList
.
stream
().
map
(
cylinderUnitDto
->
{
CylinderQuestionInfo
cylinderQuestionInfo
=
new
CylinderQuestionInfo
();
cylinderQuestionInfo
.
setQuestionType
(
QuestionTypeEnum
.
XKCQ
.
getCode
());
cylinderQuestionInfo
.
setQuestionTypeName
(
QuestionTypeEnum
.
XKCQ
.
getName
());
return
this
.
fillCommonField
(
cylinderUnitDto
,
cylinderQuestionInfo
);
}).
collect
(
Collectors
.
toList
());
if
(
cylinderQuestionInfos
.
size
()
>
0
)
{
questionInfoService
.
saveBatch
(
cylinderQuestionInfos
);
}
}
@NotNull
private
CylinderQuestionInfo
fillCommonField
(
CylinderUnitDto
cylinderUnitDto
,
CylinderQuestionInfo
cylinderQuestionInfo
)
{
cylinderQuestionInfo
.
setHappenDate
(
new
Date
());
cylinderQuestionInfo
.
setRecDate
(
new
Date
());
cylinderQuestionInfo
.
setRegionCode
(
cylinderUnitDto
.
getRegionCode
());
cylinderQuestionInfo
.
setQuestionObjectId
(
cylinderUnitDto
.
getCreditCode
());
cylinderQuestionInfo
.
setQuestionObjectName
(
cylinderUnitDto
.
getUnitName
());
cylinderQuestionInfo
.
setQuestionAttributionId
(
cylinderUnitDto
.
getAppId
());
cylinderQuestionInfo
.
setQuestionAttributionName
(
cylinderUnitDto
.
getUnitName
());
return
cylinderQuestionInfo
;
}
}
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