Commit 87fcd234 authored by suhuiguang's avatar suhuiguang

1.气瓶pom整理

2.气瓶检验超期
parent 46737649
......@@ -22,14 +22,6 @@
<version>${amos-boot-biz.version}</version>
</dependency>
<dependency>
<groupId>net.javacrumbs.shedlock</groupId>
<artifactId>shedlock-spring</artifactId>
</dependency>
<dependency>
<groupId>net.javacrumbs.shedlock</groupId>
<artifactId>shedlock-provider-redis-spring</artifactId>
</dependency>
<dependency>
<artifactId>amos-component-rule</artifactId>
<groupId>com.yeejoin</groupId>
</dependency>
......
package com.yeejoin.amos.boot.module.cylinder.api.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @author Administrator
*/
@AllArgsConstructor
@Getter
public enum QuestionTypeEnum {
/**
* 问题类型
*/
WBLSYDJ("1", "未办理使用登记"),
XKCQ("2", "许可超期"),
JYCQ("3", "检验超期"),
JYBHG("4", "检验不合格"),
WJXCZJJ("5", "未进行充装检查"),
CZJCBHG("6", "充装检查不合格");
private String code;
private String name;
}
......@@ -157,4 +157,9 @@ public class CylinderInfoDto extends BaseDto {
private String inspectionDateEnd;
private String inspectionDateStart;
/**
* 最新检验一条数据
*/
private String lastInspectionId;
}
......@@ -123,4 +123,7 @@ public class CylinderInfo extends BaseEntity {
@ApiModelProperty(value = "是否保存到es(1标识已经保存过)")
private String isNotEs;
@ApiModelProperty(value = "最新检验一条数据")
private String lastInspectionId;
}
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.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderInfoDto;
......@@ -107,4 +108,5 @@ public interface CylinderInfoMapper extends BaseMapper<CylinderInfo> {
Map<String, Object> countFillingTimesAndQuantityByCompany(@Param("companyId") String companyId, @Param("startTime") String startTime, @Param("endTime") String endTime);
List<CylinderInfoDto> queryCylinderOfInspectionOverdue();
}
......@@ -438,6 +438,23 @@
</if>
</select>
<select id="queryCylinderOfInspectionOverdue" resultType="com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderInfoDto">
SELECT
a.app_id,
u.unit_name,
u.region_code,
a.factory_num,
a.sequence_code
FROM
tz_cylinder_info a,
tz_cylinder_inspection b,
tz_cylinder_unit u
where
a.sequence_code = b.sequence_code
and u.credit_code = a.credit_code
and a.last_inspection_id = b.sequence_nbr
and date_gt(CURRENT_DATE, cast(b.next_inspection_date as date))
</select>
<update id="updateEsCylinderInfoStatus">
UPDATE tz_cylinder_info SET "is_not_es" = 1 WHERE "sequence_nbr" IN
......
......@@ -30,6 +30,14 @@
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
</dependency>
<dependency>
<groupId>net.javacrumbs.shedlock</groupId>
<artifactId>shedlock-spring</artifactId>
</dependency>
<dependency>
<groupId>net.javacrumbs.shedlock</groupId>
<artifactId>shedlock-provider-redis-spring</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
......
......@@ -96,12 +96,13 @@ public class CylinderQuestionInfoController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "问题信息列表分页查询", notes = "问题信息列表分页查询")
public ResponseModel<Page<CylinderQuestionInfoDto>> queryForPage(@ApiParam(value = "页数") @RequestParam(value = "current") int current,
@ApiParam(value = "每页大小") @RequestParam(value = "size") int size,
@ApiParam(value = "appId") @RequestParam(value = "appId",required = false) String appId,
@ApiParam(value = "问题类型枚举") @RequestParam(value = "questionType",required = false) String questionType,
@ApiParam(value = "行政区域code") @RequestParam(value = "regionCode",required = false) String regionCode) {
Page<CylinderQuestionInfoDto> page = new Page<CylinderQuestionInfoDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(cylinderQuestionInfoServiceImpl.queryForCylinderQuestionInfoPage(page,questionType, regionCode));
return ResponseHelper.buildResponse(cylinderQuestionInfoServiceImpl.queryForCylinderQuestionInfoPage(page,questionType, regionCode, appId));
}
}
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.CylinderInfoDto;
import com.yeejoin.amos.boot.module.cylinder.flc.api.mapper.CylinderInfoMapper;
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 java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author Administrator
*/
@Component
@EnableScheduling
public class InspectionOverdueJob {
private CylinderInfoMapper cylinderInfoMapper;
private CylinderQuestionInfoServiceImpl questionInfoService;
public InspectionOverdueJob(CylinderInfoMapper cylinderInfoMapper,
CylinderQuestionInfoServiceImpl questionInfoService) {
this.cylinderInfoMapper = cylinderInfoMapper;
this.questionInfoService = questionInfoService;
}
@SchedulerLock(name = "overdueQuestionJobCylinder", lockAtMostFor = "PT1H")
@Scheduled(cron = "${inspection.overdue.job.cron:0 0 2 * * ?}")
public void genOverdueQuestion() {
List<CylinderInfoDto> cylinderInfo = cylinderInfoMapper.queryCylinderOfInspectionOverdue();
List<CylinderQuestionInfo> cylinderQuestionInfos = cylinderInfo.stream().map(cylinderInfoDto -> {
CylinderQuestionInfo cylinderQuestionInfo = new CylinderQuestionInfo();
cylinderQuestionInfo.setQuestionType(QuestionTypeEnum.JYCQ.getCode());
cylinderQuestionInfo.setQuestionTypeName(QuestionTypeEnum.JYCQ.getName());
cylinderQuestionInfo.setHappenDate(new Date());
cylinderQuestionInfo.setRecDate(new Date());
cylinderQuestionInfo.setRegionCode(cylinderInfoDto.getRegionCode());
cylinderQuestionInfo.setQuestionObjectId(cylinderInfoDto.getSequenceCode());
cylinderQuestionInfo.setQuestionObjectName(cylinderInfoDto.getFactoryNum());
cylinderQuestionInfo.setQuestionAttributionId(cylinderInfoDto.getAppId());
cylinderQuestionInfo.setQuestionAttributionName(cylinderInfoDto.getUnitName());
return cylinderQuestionInfo;
}).collect(Collectors.toList());
if (cylinderQuestionInfos.size() > 0) {
questionInfoService.saveBatch(cylinderQuestionInfos);
}
}
}
......@@ -21,8 +21,8 @@ public class CylinderQuestionInfoServiceImpl extends BaseService<CylinderQuestio
/**
* 分页查询
*/
public Page<CylinderQuestionInfoDto> queryForCylinderQuestionInfoPage(Page<CylinderQuestionInfoDto> page, String questionType, @Condition(value = Operator.like) String regionCode) {
return this.queryForPage(page, "happen_date", true, questionType, regionCode);
public Page<CylinderQuestionInfoDto> queryForCylinderQuestionInfoPage(Page<CylinderQuestionInfoDto> page, String questionType, @Condition(value = Operator.like) String regionCode, String questionAttributionId) {
return this.queryForPage(page, "happen_date", true, questionType, regionCode, questionAttributionId);
}
}
\ No newline at end of file
......@@ -62,7 +62,7 @@ public class InspectionExpireRemindJob {
}
@Scheduled(cron = "${inspection.expire.remind.job.cron:0 0 8 * * ?}")
@SchedulerLock(name = "sendReminderMessageJob", lockAtMostFor = "PT1H")
@SchedulerLock(name = "sendReminderMessage", lockAtMostFor = "PT1H")
public void sendReminderMessage() {
// 1.查询临期和超期的设备
List<NeedTipEquipInfo> needTipEquipList = getNeedTipEquipList();
......
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