Commit 3d5e9ab3 authored by suhuiguang's avatar suhuiguang

1.问题生成适配详情打开修改

parent ae37be46
...@@ -468,29 +468,28 @@ ...@@ -468,29 +468,28 @@
</select> </select>
<select id="queryCylinderOfInspectionOverdue" resultType="com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderInfoDto"> <select id="queryCylinderOfInspectionOverdue" resultType="com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderInfoDto">
SELECT SELECT
a.app_id, a.sequence_nbr,
u.unit_name,
u.region_code,
a.factory_num, a.factory_num,
a.sequence_code u.unit_name,
u.app_id,
u.region_code
FROM FROM
tz_cylinder_info a, tz_cylinder_info a,
tz_cylinder_inspection b, tz_cylinder_unit u,
tz_cylinder_unit u tz_cylinder_inspection b
where where
a.sequence_code = b.sequence_code 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 date_gt(CURRENT_DATE, cast(b.next_inspection_date as date)) and date_gt(CURRENT_DATE, cast(b.next_inspection_date as date))
</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
b.sequence_nbr, a.sequence_nbr,
a.sequence_code, a.factory_num,
a.app_id, u.app_id,
u.unit_name, u.unit_name,
u.region_code, u.region_code,
a.factory_num a.last_inspection_id
FROM FROM
tz_cylinder_info a, tz_cylinder_info a,
tz_cylinder_inspection b, tz_cylinder_inspection b,
...@@ -499,6 +498,7 @@ ...@@ -499,6 +498,7 @@
a.sequence_code = b.sequence_code a.sequence_code = b.sequence_code
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.is_deal_question = false or b.is_deal_question is null) and (b.is_deal_question = false or b.is_deal_question is null)
</select> </select>
......
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
tz_cylinder_unit u tz_cylinder_unit u
where where
date_gt(CURRENT_DATE, expire_date) 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} ) and not EXISTS (select 1 from tz_cylinder_question_info q where u.sequence_nbr = q.question_object_id and q.question_type = #{questionType} )
</select> </select>
<insert id="saveOrUpdateBatch" parameterType="com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylinderUnit"> <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") 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")
......
...@@ -38,7 +38,7 @@ public class CompanyQuestionJob { ...@@ -38,7 +38,7 @@ public class CompanyQuestionJob {
/** /**
* 资质超期 * 资质超期
*/ */
@SchedulerLock(name = "genCompanyQuestionOfPermissionExpireJob", lockAtMostFor = "PT4M") @SchedulerLock(name = "genCompanyQuestionOfPermissionExpireJob", lockAtMostFor = "PT30M")
@Scheduled(cron = "${inspection.cert.expire.job.cron:0 0 5 * * ?}") @Scheduled(cron = "${inspection.cert.expire.job.cron:0 0 5 * * ?}")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void genCompanyQuestionOfPermissionExpire() { public void genCompanyQuestionOfPermissionExpire() {
......
...@@ -49,8 +49,8 @@ public class InspectionQuestionJob { ...@@ -49,8 +49,8 @@ public class InspectionQuestionJob {
/** /**
* 检验超期 * 检验超期
*/ */
@SchedulerLock(name = "genOverdueQuestionJobCylinder2", lockAtMostFor = "PT1H") @SchedulerLock(name = "genOverdueQuestionJobCylinder", lockAtMostFor = "PT15M")
@Scheduled(cron = "${inspection.overdue.job.cron:0 0 1 * * ?}") @Scheduled(cron = "${inspection.overdue.job.cron:0 0/30 * * * ?}")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void genOverdueQuestion() { public void genOverdueQuestion() {
List<CylinderInfoDto> cylinderList = cylinderInfoMapper.queryCylinderOfInspectionOverdue(); List<CylinderInfoDto> cylinderList = cylinderInfoMapper.queryCylinderOfInspectionOverdue();
...@@ -70,14 +70,12 @@ public class InspectionQuestionJob { ...@@ -70,14 +70,12 @@ public class InspectionQuestionJob {
private List<CylinderQuestionInfo> removeRepeatData(List<CylinderQuestionInfo> cylinderQuestionInfos) { 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()); Set<String> questionObjectIds = cylinderQuestionInfos.stream().map(CylinderQuestionInfo::getQuestionObjectId).collect(Collectors.toSet());
Set<String> appIds = cylinderQuestionInfos.stream().map(CylinderQuestionInfo::getQuestionAttributionId).collect(Collectors.toSet());
// 已经生成问题的气瓶 // 已经生成问题的气瓶
List<CylinderQuestionInfo> questionInfos = questionInfoService.list(new LambdaQueryWrapper<CylinderQuestionInfo>() List<CylinderQuestionInfo> haveCreateQuestionInfos = questionInfoService.list(new LambdaQueryWrapper<CylinderQuestionInfo>()
.in(CylinderQuestionInfo::getQuestionObjectId, questionObjectIds) .in(CylinderQuestionInfo::getQuestionObjectId, questionObjectIds)
.in(CylinderQuestionInfo::getQuestionAttributionId, appIds).eq(CylinderQuestionInfo::getQuestionType, QuestionTypeEnum.JYCQ.getCode())); .eq(CylinderQuestionInfo::getQuestionType, QuestionTypeEnum.JYCQ.getCode()));
// 去掉已经生成的气瓶问题,不在重复生成问题 // 去掉已经生成的气瓶问题,不在重复生成问题
return cylinderQuestionInfos.stream().filter(c -> questionInfos.stream().noneMatch(d -> d.getQuestionObjectId().equals(c.getQuestionObjectId()) && return cylinderQuestionInfos.stream().filter(c -> haveCreateQuestionInfos.stream().noneMatch(d -> d.getQuestionObjectId().equals(c.getQuestionObjectId()))).collect(Collectors.toList());
d.getQuestionAttributionId().equals(c.getQuestionAttributionId()))).collect(Collectors.toList());
} }
return new ArrayList<>(); return new ArrayList<>();
} }
...@@ -86,8 +84,8 @@ public class InspectionQuestionJob { ...@@ -86,8 +84,8 @@ public class InspectionQuestionJob {
/** /**
* 检验不合格任务 * 检验不合格任务
*/ */
@SchedulerLock(name = "genInspectionUnqualifiedQuestionJobCylinder2", lockAtMostFor = "PT20M") @SchedulerLock(name = "genInspectionUnqualifiedQuestionJobCylinder", lockAtMostFor = "PT15M")
@Scheduled(cron = "${inspection.unqualified.job.cron:0 0/10 * * * ?}") @Scheduled(cron = "${inspection.unqualified.job.cron:0 0/30 * * * ?}")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void genInspectionUnqualifiedQuestion() { public void genInspectionUnqualifiedQuestion() {
List<CylinderInfoDto> cylinderList = cylinderInfoMapper.queryCylinderOfUnqualifiedQuestion(); List<CylinderInfoDto> cylinderList = cylinderInfoMapper.queryCylinderOfUnqualifiedQuestion();
...@@ -106,7 +104,7 @@ public class InspectionQuestionJob { ...@@ -106,7 +104,7 @@ public class InspectionQuestionJob {
private void updateDealStatusAfterJobDeal(List<CylinderInfoDto> cylinderList) { private void updateDealStatusAfterJobDeal(List<CylinderInfoDto> cylinderList) {
LambdaUpdateWrapper<CylinderInspection> updateWrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<CylinderInspection> updateWrapper = new LambdaUpdateWrapper<>();
cylinderList.forEach(cylinder -> { cylinderList.forEach(cylinder -> {
updateWrapper.eq(BaseEntity::getSequenceNbr, cylinder.getSequenceNbr()); updateWrapper.eq(BaseEntity::getSequenceNbr, cylinder.getLastInspectionId());
updateWrapper.set(CylinderInspection::getIsDealQuestion, true); updateWrapper.set(CylinderInspection::getIsDealQuestion, true);
cylinderInspectionService.update(updateWrapper); cylinderInspectionService.update(updateWrapper);
}); });
...@@ -117,7 +115,7 @@ public class InspectionQuestionJob { ...@@ -117,7 +115,7 @@ public class InspectionQuestionJob {
cylinderQuestionInfo.setHappenDate(new Date()); cylinderQuestionInfo.setHappenDate(new Date());
cylinderQuestionInfo.setRecDate(new Date()); cylinderQuestionInfo.setRecDate(new Date());
cylinderQuestionInfo.setRegionCode(cylinderInfoDto.getRegionCode()); cylinderQuestionInfo.setRegionCode(cylinderInfoDto.getRegionCode());
cylinderQuestionInfo.setQuestionObjectId(cylinderInfoDto.getSequenceCode()); cylinderQuestionInfo.setQuestionObjectId(cylinderInfoDto.getSequenceNbr() + "");
cylinderQuestionInfo.setQuestionObjectName(cylinderInfoDto.getFactoryNum()); cylinderQuestionInfo.setQuestionObjectName(cylinderInfoDto.getFactoryNum());
cylinderQuestionInfo.setQuestionAttributionId(cylinderInfoDto.getAppId()); cylinderQuestionInfo.setQuestionAttributionId(cylinderInfoDto.getAppId());
cylinderQuestionInfo.setQuestionAttributionName(cylinderInfoDto.getUnitName()); cylinderQuestionInfo.setQuestionAttributionName(cylinderInfoDto.getUnitName());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment