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
7a4da9e4
Commit
7a4da9e4
authored
Jun 04, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.问题生成数据量大检验超期检验不合格数据量大修改
parent
0e8d9a28
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
41 deletions
+7
-41
CylinderInfoMapper.java
...ot/module/cylinder/flc/api/mapper/CylinderInfoMapper.java
+2
-3
CylinderInfoMapper.xml
...nder-api/src/main/resources/mapper/CylinderInfoMapper.xml
+2
-1
InspectionQuestionJob.java
...s/boot/module/cylinder/biz/job/InspectionQuestionJob.java
+3
-37
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/flc/api/mapper/CylinderInfoMapper.java
View file @
7a4da9e4
package
com
.
yeejoin
.
amos
.
boot
.
module
.
cylinder
.
flc
.
api
.
mapper
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
cylinder
.
flc
.
api
.
mapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderInfoDto
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderInfoDto
;
...
@@ -116,9 +115,9 @@ public interface CylinderInfoMapper extends BaseMapper<CylinderInfo> {
...
@@ -116,9 +115,9 @@ public interface CylinderInfoMapper extends BaseMapper<CylinderInfo> {
Map
<
String
,
Object
>
countFillingTimesAndQuantityByCompany
(
@Param
(
"companyId"
)
String
companyId
,
@Param
(
"startTime"
)
String
startTime
,
@Param
(
"endTime"
)
String
endTime
);
Map
<
String
,
Object
>
countFillingTimesAndQuantityByCompany
(
@Param
(
"companyId"
)
String
companyId
,
@Param
(
"startTime"
)
String
startTime
,
@Param
(
"endTime"
)
String
endTime
);
List
<
CylinderInfoDto
>
queryCylinderOfInspectionOverdue
();
List
<
CylinderInfoDto
>
queryCylinderOfInspectionOverdue
(
@Param
(
"questionType"
)
String
questionType
);
List
<
CylinderInfoDto
>
queryCylinderOfUnqualifiedQuestion
();
List
<
CylinderInfoDto
>
queryCylinderOfUnqualifiedQuestion
(
@Param
(
"questionType"
)
String
questionType
);
List
<
Map
<
String
,
Object
>>
countFillingTimesAndQuantityByCity
();
List
<
Map
<
String
,
Object
>>
countFillingTimesAndQuantityByCity
();
...
...
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-api/src/main/resources/mapper/CylinderInfoMapper.xml
View file @
7a4da9e4
...
@@ -481,6 +481,7 @@
...
@@ -481,6 +481,7 @@
u.app_id = a.app_id
u.app_id = a.app_id
and a.last_inspection_id = b.sequence_nbr
and a.last_inspection_id = b.sequence_nbr
and date_gt(CURRENT_DATE, cast(b.next_inspection_date as date))
and date_gt(CURRENT_DATE, cast(b.next_inspection_date as date))
and not EXISTS (select 1 from tz_cylinder_question_info q where q.question_object_id = a.sequence_nbr and q.question_type = #{questionType})
</select>
</select>
<select
id=
"queryCylinderOfUnqualifiedQuestion"
resultType=
"com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderInfoDto"
>
<select
id=
"queryCylinderOfUnqualifiedQuestion"
resultType=
"com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderInfoDto"
>
SELECT
SELECT
...
@@ -499,7 +500,7 @@
...
@@ -499,7 +500,7 @@
and u.app_id = a.app_id
and u.app_id = a.app_id
and a.last_inspection_id = b.sequence_nbr
and a.last_inspection_id = b.sequence_nbr
and b.inspection_result = '3124'
and b.inspection_result = '3124'
and
(b.is_deal_question = false or b.is_deal_question is null
)
and
not EXISTS (select 1 from tz_cylinder_question_info q where q.question_object_id = a.sequence_nbr and q.question_type = #{questionType}
)
</select>
</select>
<update
id=
"updateEsCylinderInfoStatus"
>
<update
id=
"updateEsCylinderInfoStatus"
>
...
...
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-biz/src/main/java/com/yeejoin/amos/boot/module/cylinder/biz/job/InspectionQuestionJob.java
View file @
7a4da9e4
package
com
.
yeejoin
.
amos
.
boot
.
module
.
cylinder
.
biz
.
job
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
cylinder
.
biz
.
job
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.yeejoin.amos.boot.module.cylinder.api.entity.CylinderQuestionInfo
;
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.api.enums.QuestionTypeEnum
;
import
com.yeejoin.amos.boot.module.cylinder.biz.service.impl.CylinderQuestionInfoServiceImpl
;
import
com.yeejoin.amos.boot.module.cylinder.biz.service.impl.CylinderQuestionInfoServiceImpl
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderInfoDto
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderInfoDto
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylinderInspection
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.mapper.CylinderInfoMapper
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.mapper.CylinderInfoMapper
;
import
com.yeejoin.amos.boot.module.cylinder.flc.biz.service.impl.CylinderInspectionServiceImpl
;
import
net.javacrumbs.shedlock.spring.annotation.SchedulerLock
;
import
net.javacrumbs.shedlock.spring.annotation.SchedulerLock
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.NotNull
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -33,16 +26,12 @@ public class InspectionQuestionJob {
...
@@ -33,16 +26,12 @@ public class InspectionQuestionJob {
private
CylinderInfoMapper
cylinderInfoMapper
;
private
CylinderInfoMapper
cylinderInfoMapper
;
private
CylinderInspectionServiceImpl
cylinderInspectionService
;
private
CylinderQuestionInfoServiceImpl
questionInfoService
;
private
CylinderQuestionInfoServiceImpl
questionInfoService
;
public
InspectionQuestionJob
(
CylinderInfoMapper
cylinderInfoMapper
,
public
InspectionQuestionJob
(
CylinderInfoMapper
cylinderInfoMapper
,
CylinderInspectionServiceImpl
cylinderInspectionService
,
CylinderQuestionInfoServiceImpl
questionInfoService
)
{
CylinderQuestionInfoServiceImpl
questionInfoService
)
{
this
.
cylinderInfoMapper
=
cylinderInfoMapper
;
this
.
cylinderInfoMapper
=
cylinderInfoMapper
;
this
.
questionInfoService
=
questionInfoService
;
this
.
questionInfoService
=
questionInfoService
;
this
.
cylinderInspectionService
=
cylinderInspectionService
;
}
}
...
@@ -57,7 +46,7 @@ public class InspectionQuestionJob {
...
@@ -57,7 +46,7 @@ public class InspectionQuestionJob {
}
}
public
void
genOverdueQuestionImpl
()
{
public
void
genOverdueQuestionImpl
()
{
List
<
CylinderInfoDto
>
cylinderList
=
cylinderInfoMapper
.
queryCylinderOfInspectionOverdue
();
List
<
CylinderInfoDto
>
cylinderList
=
cylinderInfoMapper
.
queryCylinderOfInspectionOverdue
(
QuestionTypeEnum
.
JYCQ
.
getCode
()
);
List
<
CylinderQuestionInfo
>
cylinderQuestionInfos
=
cylinderList
.
stream
().
map
(
cylinderInfoDto
->
{
List
<
CylinderQuestionInfo
>
cylinderQuestionInfos
=
cylinderList
.
stream
().
map
(
cylinderInfoDto
->
{
CylinderQuestionInfo
cylinderQuestionInfo
=
new
CylinderQuestionInfo
();
CylinderQuestionInfo
cylinderQuestionInfo
=
new
CylinderQuestionInfo
();
cylinderQuestionInfo
.
setQuestionType
(
QuestionTypeEnum
.
JYCQ
.
getCode
());
cylinderQuestionInfo
.
setQuestionType
(
QuestionTypeEnum
.
JYCQ
.
getCode
());
...
@@ -65,23 +54,9 @@ public class InspectionQuestionJob {
...
@@ -65,23 +54,9 @@ public class InspectionQuestionJob {
return
fillCommonField
(
cylinderInfoDto
,
cylinderQuestionInfo
);
return
fillCommonField
(
cylinderInfoDto
,
cylinderQuestionInfo
);
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
// 已经生成的数据不再重复生成
// 已经生成的数据不再重复生成
List
<
CylinderQuestionInfo
>
needToDbQuestionInfos
=
this
.
removeRepeatData
(
cylinderQuestionInfos
);
if
(
needToDbQuestionInfos
.
size
()
>
0
)
{
questionInfoService
.
saveBatch
(
needToDbQuestionInfos
);
}
}
private
List
<
CylinderQuestionInfo
>
removeRepeatData
(
List
<
CylinderQuestionInfo
>
cylinderQuestionInfos
)
{
if
(
cylinderQuestionInfos
.
size
()
>
0
)
{
if
(
cylinderQuestionInfos
.
size
()
>
0
)
{
Set
<
String
>
questionObjectIds
=
cylinderQuestionInfos
.
stream
().
map
(
CylinderQuestionInfo:
:
getQuestionObjectId
).
collect
(
Collectors
.
toSet
());
questionInfoService
.
saveBatch
(
cylinderQuestionInfos
);
// 已经生成问题的气瓶
List
<
CylinderQuestionInfo
>
haveCreateQuestionInfos
=
questionInfoService
.
list
(
new
LambdaQueryWrapper
<
CylinderQuestionInfo
>()
.
in
(
CylinderQuestionInfo:
:
getQuestionObjectId
,
questionObjectIds
)
.
eq
(
CylinderQuestionInfo:
:
getQuestionType
,
QuestionTypeEnum
.
JYCQ
.
getCode
()));
// 去掉已经生成的气瓶问题,不在重复生成问题
return
cylinderQuestionInfos
.
stream
().
filter
(
c
->
haveCreateQuestionInfos
.
stream
().
noneMatch
(
d
->
d
.
getQuestionObjectId
().
equals
(
c
.
getQuestionObjectId
()))).
collect
(
Collectors
.
toList
());
}
}
return
new
ArrayList
<>();
}
}
...
@@ -96,7 +71,7 @@ public class InspectionQuestionJob {
...
@@ -96,7 +71,7 @@ public class InspectionQuestionJob {
}
}
public
void
genInspectionUnqualifiedQuestionImpl
()
{
public
void
genInspectionUnqualifiedQuestionImpl
()
{
List
<
CylinderInfoDto
>
cylinderList
=
cylinderInfoMapper
.
queryCylinderOfUnqualifiedQuestion
();
List
<
CylinderInfoDto
>
cylinderList
=
cylinderInfoMapper
.
queryCylinderOfUnqualifiedQuestion
(
QuestionTypeEnum
.
JYBHG
.
getCode
()
);
List
<
CylinderQuestionInfo
>
cylinderQuestionInfos
=
cylinderList
.
stream
().
map
(
cylinderInfoDto
->
{
List
<
CylinderQuestionInfo
>
cylinderQuestionInfos
=
cylinderList
.
stream
().
map
(
cylinderInfoDto
->
{
CylinderQuestionInfo
cylinderQuestionInfo
=
new
CylinderQuestionInfo
();
CylinderQuestionInfo
cylinderQuestionInfo
=
new
CylinderQuestionInfo
();
cylinderQuestionInfo
.
setQuestionType
(
QuestionTypeEnum
.
JYBHG
.
getCode
());
cylinderQuestionInfo
.
setQuestionType
(
QuestionTypeEnum
.
JYBHG
.
getCode
());
...
@@ -105,18 +80,9 @@ public class InspectionQuestionJob {
...
@@ -105,18 +80,9 @@ public class InspectionQuestionJob {
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
if
(
cylinderQuestionInfos
.
size
()
>
0
)
{
if
(
cylinderQuestionInfos
.
size
()
>
0
)
{
questionInfoService
.
saveBatch
(
cylinderQuestionInfos
);
questionInfoService
.
saveBatch
(
cylinderQuestionInfos
);
updateDealStatusAfterJobDeal
(
cylinderList
);
}
}
}
}
private
void
updateDealStatusAfterJobDeal
(
List
<
CylinderInfoDto
>
cylinderList
)
{
cylinderList
.
forEach
(
cylinder
->
{
LambdaUpdateWrapper
<
CylinderInspection
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
BaseEntity:
:
getSequenceNbr
,
cylinder
.
getLastInspectionId
());
updateWrapper
.
set
(
CylinderInspection:
:
getIsDealQuestion
,
true
);
cylinderInspectionService
.
update
(
updateWrapper
);
});
}
@NotNull
@NotNull
private
CylinderQuestionInfo
fillCommonField
(
CylinderInfoDto
cylinderInfoDto
,
CylinderQuestionInfo
cylinderQuestionInfo
)
{
private
CylinderQuestionInfo
fillCommonField
(
CylinderInfoDto
cylinderInfoDto
,
CylinderQuestionInfo
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