Commit 0e8d9a28 authored by suhuiguang's avatar suhuiguang

1.问题生成增加未办理使用登记的问题

parent e1b7b1db
......@@ -66,4 +66,6 @@ public interface CylinderUnitMapper extends BaseMapper<CylinderUnit> {
* @return List<CylinderInfoDto>
*/
List<CylinderUnitDto> queryCylinderUnitOfPermissionExpire(@Param("questionType") String questionType);
List<CylinderUnitDto> queryCylinderUnitOfNoUseRegistration(@Param("questionType") String questionType);
}
......@@ -79,6 +79,19 @@
date_gt(CURRENT_DATE, expire_date)
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 id="queryCylinderUnitOfNoUseRegistration"
resultType="com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderUnitDto">
SELECT
u.sequence_nbr,
u.region_code,
u.unit_name,
u.app_id
FROM
tz_cylinder_unit u
WHERE
NOT EXISTS (select 1 from tzs_jg_use_registration r where r.use_unit_credit_code = u.credit_code and r.manage_type='unit' and r.status ='已完成')
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>
<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
......
......@@ -39,7 +39,7 @@ public class CompanyQuestionJob {
* 资质超期
*/
@SchedulerLock(name = "genCompanyQuestionOfPermissionExpireJob", lockAtMostFor = "PT30M")
@Scheduled(cron = "${inspection.cert.expire.job.cron:0 0 5 * * ?}")
@Scheduled(cron = "${company.cert.expire.job.cron:0 0 5 * * ?}")
@Transactional(rollbackFor = Exception.class)
public void genCompanyQuestionOfPermissionExpire() {
genCompanyQuestionOfPermissionExpireImpl();
......@@ -71,4 +71,31 @@ public class CompanyQuestionJob {
}
/**
* 未办理使用登记的问题生成
*/
@SchedulerLock(name = "genCompanyQuestionOfNoUseRegistrationJob", lockAtMostFor = "PT30M")
@Scheduled(cron = "${company.no-use.registration.job.cron:0 0 6 * * ?}")
@Transactional(rollbackFor = Exception.class)
public void genCompanyQuestionOfNoUseRegistration() {
genCompanyQuestionOfNoUseRegistrationImpl();
}
/**
* 生成未办理使用登记的问题
*/
public void genCompanyQuestionOfNoUseRegistrationImpl() {
List<CylinderUnitDto> cylinderUnitDtoList = cylinderUnitMapper.queryCylinderUnitOfNoUseRegistration(QuestionTypeEnum.WBLSYDJ.getCode());
List<CylinderQuestionInfo> cylinderQuestionInfos = cylinderUnitDtoList.stream().map(cylinderUnitDto -> {
CylinderQuestionInfo cylinderQuestionInfo = new CylinderQuestionInfo();
cylinderQuestionInfo.setQuestionType(QuestionTypeEnum.WBLSYDJ.getCode());
cylinderQuestionInfo.setQuestionTypeName(QuestionTypeEnum.WBLSYDJ.getName());
return this.fillCommonField(cylinderUnitDto, cylinderQuestionInfo);
}).collect(Collectors.toList());
if (cylinderQuestionInfos.size() > 0) {
questionInfoService.saveBatch(cylinderQuestionInfos);
}
}
}
......@@ -45,5 +45,7 @@ public class CylinderQuestionInfoServiceImpl extends BaseService<CylinderQuestio
inspectionQuestionJob.genOverdueQuestionImpl();
// 检验不合格类型问题数据生成
inspectionQuestionJob.genInspectionUnqualifiedQuestionImpl();
// 未办理使用登记单位问题数据生成
companyQuestionJob.genCompanyQuestionOfNoUseRegistrationImpl();
}
}
\ No newline at end of file
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