Commit e75d5d77 authored by 刘林's avatar 刘林

fix(cylinder):气瓶区域信息查询

parent f2d9eafe
...@@ -51,4 +51,7 @@ public class CylinderAreaDataDto extends BaseDto { ...@@ -51,4 +51,7 @@ public class CylinderAreaDataDto extends BaseDto {
@ApiModelProperty(value = "纬度") @ApiModelProperty(value = "纬度")
private String latitude; private String latitude;
@ApiModelProperty(value = "超期数量")
private Integer outOfDateNum;
} }
...@@ -80,4 +80,10 @@ public class CylinderAreaData extends BaseEntity { ...@@ -80,4 +80,10 @@ public class CylinderAreaData extends BaseEntity {
*/ */
@TableField("latitude") @TableField("latitude")
private String latitude; private String latitude;
/**
* 超期数量
*/
@TableField("out_of_date_num")
private Integer outOfDateNum;
} }
...@@ -55,6 +55,14 @@ public interface CylinderInfoMapper extends BaseMapper<CylinderInfo> { ...@@ -55,6 +55,14 @@ public interface CylinderInfoMapper extends BaseMapper<CylinderInfo> {
Integer getWarnNum(String code); Integer getWarnNum(String code);
/**
* 查询超期数量
* @author LiuLin
* @param code 区域code
* @return
*/
Integer getOutOfDateNum(String code);
Integer getMonthInfoTotalUnit(@Param("appId") String appId); Integer getMonthInfoTotalUnit(@Param("appId") String appId);
......
...@@ -62,6 +62,11 @@ ...@@ -62,6 +62,11 @@
select count(1) from view_cylider_outofdate v where v.app_id in (<include refid="selectAPPIdByRegionCode"/>) select count(1) from view_cylider_outofdate v where v.app_id in (<include refid="selectAPPIdByRegionCode"/>)
</select> </select>
<select id="getOutOfDateNum" resultType="java.lang.Integer">
select count(1) from view_cylider_outofdate v where v.app_id in (<include refid="selectAPPIdByRegionCode"/>)
and v.next_inspection_date <![CDATA[ > ]]> now()
</select>
<select id="getMonthInfoTotalUnit" resultType="java.lang.Integer"> <select id="getMonthInfoTotalUnit" resultType="java.lang.Integer">
select select
IFNULL(count(sequence_nbr), 0) IFNULL(count(sequence_nbr), 0)
......
...@@ -40,7 +40,7 @@ public class CylinderAreaDataServiceImpl extends BaseService<CylinderAreaDataDto ...@@ -40,7 +40,7 @@ public class CylinderAreaDataServiceImpl extends BaseService<CylinderAreaDataDto
.regionCode(v.getRegionCode()) .regionCode(v.getRegionCode())
.longitude(v.getLongitude()) .longitude(v.getLongitude())
.latitude(v.getLatitude()) .latitude(v.getLatitude())
.isAlarm(v.getWarnNum() != 0) .isAlarm(v.getOutOfDateNum() != 0)
.cylindersCount(v.getCylinderNum()) .cylindersCount(v.getCylinderNum())
.stationCount(v.getUnitNum()) .stationCount(v.getUnitNum())
.build()) .build())
......
...@@ -214,6 +214,10 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind ...@@ -214,6 +214,10 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
return baseMapper.getWarnNum(code); return baseMapper.getWarnNum(code);
} }
public Integer getOutOfDateNum(String code) {
return baseMapper.getOutOfDateNum(code);
}
/** /**
* 按单位统计 * 按单位统计
*/ */
...@@ -250,7 +254,7 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind ...@@ -250,7 +254,7 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
* 按区域统计 * 按区域统计
*/ */
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Scheduled(cron = "0 0 2 * * ?") @Scheduled(cron = "0 0 4 * * ?")
@SchedulerLock(name = "synAreaDataTask", lockAtMostFor = "PT60M") @SchedulerLock(name = "synAreaDataTask", lockAtMostFor = "PT60M")
public void synAreaDataJob() { public void synAreaDataJob() {
this.synAreaData(); this.synAreaData();
...@@ -284,6 +288,7 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind ...@@ -284,6 +288,7 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
temp.setLevel(regionModel.getLevel().trim()); temp.setLevel(regionModel.getLevel().trim());
temp.setLatitude(regionModel.getLatitude()); temp.setLatitude(regionModel.getLatitude());
temp.setLongitude(regionModel.getLongitude()); temp.setLongitude(regionModel.getLongitude());
temp.setOutOfDateNum(this.getOutOfDateNum(code));
cylinderAreaDataServiceImpl.createWithModel(temp); cylinderAreaDataServiceImpl.createWithModel(temp);
}); });
} }
......
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