bug修复
This commit is contained in:
parent
522e3caac6
commit
45ffe8907f
@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.google.common.base.Objects;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.xmgl.async.AsyncDoubleCarbon;
|
||||
import com.zhgd.xmgl.device.ammeter.util.AmmeterUtils;
|
||||
@ -196,22 +195,19 @@ public class AmmeterCallBackController {
|
||||
*
|
||||
* @param d
|
||||
*/
|
||||
@PostMapping("/xmgl/callback/ammeterRecord/status")
|
||||
public Result updateAmmeterRecordStatus(@RequestBody AmmeterRecordDetail d) {
|
||||
log.info("updateAmmeterRecordStatus:{}", JSON.toJSONString(d));
|
||||
@PostMapping("/xmgl/callback/ammeter/status")
|
||||
public Result updateAmmeterStatus(@RequestBody Ammeter d) {
|
||||
log.info("updateAmmeterStatus:{}", JSON.toJSONString(d));
|
||||
QueryWrapper<Ammeter> ammeterQueryWrapper = new QueryWrapper<>();
|
||||
ammeterQueryWrapper.lambda().eq(Ammeter::getAmmeterNo, d.getAmmeterNo());
|
||||
Ammeter one = ammeterService.getOne(ammeterQueryWrapper);
|
||||
if (one == null) {
|
||||
return Result.error("电表号ammeterNo不存在");
|
||||
}
|
||||
|
||||
if (!Objects.equal(d.getOnline(), one.getOnline())) {
|
||||
Ammeter a = new Ammeter();
|
||||
a.setId(one.getId());
|
||||
a.setOnline(d.getOnline());
|
||||
ammeterService.updateById(a);
|
||||
}
|
||||
one.setOnline(d.getOnline());
|
||||
one.setGateStatus(d.getGateStatus());
|
||||
one.setDeviceStatus(d.getDeviceStatus());
|
||||
ammeterService.updateById(one);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
|
||||
@ -54,7 +54,7 @@ public class AmmeterMonthRecordServiceImpl extends ServiceImpl<AmmeterMonthRecor
|
||||
Double use = ammeterRecordDetailMapper.queryUseDegreeOnCurrentMonth(ad);
|
||||
Double thresholdValue = MapUtils.getDouble(count, "thresholdValue");
|
||||
count.put("month_user_water", use);
|
||||
count.put("exceed_quota_num", use - thresholdValue);
|
||||
count.put("exceed_quota_num", use.compareTo(thresholdValue) > 0 ? use - thresholdValue : 0);
|
||||
data.put("count", count);
|
||||
return data;
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
@ApiModel(value="BigDeviceVideo实体类",description="BigDeviceVideo")
|
||||
public class BigDeviceVideo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value="id")
|
||||
@ -39,14 +39,20 @@ public class BigDeviceVideo implements Serializable {
|
||||
/**项目sn*/
|
||||
@Excel(name = "项目sn", width = 15)
|
||||
@ApiModelProperty(value="项目sn")
|
||||
private java.lang.String projectSn ;
|
||||
/**videoItemId*/
|
||||
private java.lang.String projectSn;
|
||||
/**
|
||||
* videoItemId
|
||||
*/
|
||||
@Excel(name = "videoItemId", width = 15)
|
||||
@ApiModelProperty(value="视频ID")
|
||||
@ApiModelProperty(value = "视频ID")
|
||||
|
||||
private java.lang.Long videoItemId ;
|
||||
private java.lang.Long videoItemId;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value="视频名称")
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "视频名称")
|
||||
private String videoName;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "视频设备序列号")
|
||||
private java.lang.String serialNumber;
|
||||
}
|
||||
|
||||
@ -3,6 +3,8 @@ package com.zhgd.xmgl.modules.bigdevice.mapper;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.BigDeviceVideo;
|
||||
@ -31,4 +33,6 @@ public interface BigDeviceVideoMapper extends BaseMapper<BigDeviceVideo> {
|
||||
List<BigDeviceVideo> selectBigDeviceVideoByTypeList(@Param("devSn") String devSn, @Param("type") int type);
|
||||
|
||||
List<EntityMap> selectVideoISCPlayConfigList(@Param("devSn") String devSn, @Param("type") int type);
|
||||
|
||||
List<BigDeviceVideo> selectListExt(@Param(Constants.WRAPPER) QueryWrapper<BigDeviceVideo> queryWrapper2);
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
FROM video_item t1 INNER JOIN project_video_config t2 ON t2.id=t1.video_id
|
||||
INNER JOIN big_device_video t3 ON t1.item_id=t3.video_item_id
|
||||
WHERE t2.is_enable=1 AND t3.dev_sn=#{devSn} and t3.type=3
|
||||
|
||||
|
||||
</select>
|
||||
<select id="selectGantryCraneVideoList" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
|
||||
SELECT t1.*,t2.*,t3.id big_device_video_id,t3.dev_sn
|
||||
@ -40,14 +40,18 @@
|
||||
<select id="selectBigDeviceVideoByTypeList" resultType="com.zhgd.xmgl.modules.bigdevice.entity.BigDeviceVideo">
|
||||
SELECT t3.*,t1.video_name
|
||||
FROM video_item t1 INNER JOIN project_video_config t2 ON t2.id=t1.video_id
|
||||
INNER JOIN big_device_video t3 ON t1.item_id=t3.video_item_id
|
||||
INNER JOIN big_device_video t3 ON t1.item_id=t3.video_item_id
|
||||
WHERE t2.is_enable=1 AND t3.dev_sn=#{devSn} and t3.type=#{type}
|
||||
</select>
|
||||
<select id="selectVideoISCPlayConfigList" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
|
||||
SELECT t2.app_secret,t2.app_id,t2.account ip,t2.password port,t1.serial_number
|
||||
FROM video_item t1 INNER JOIN project_video_config t2 ON t2.id=t1.video_id
|
||||
INNER JOIN big_device_video t3 ON t1.item_id=t3.video_item_id
|
||||
INNER JOIN big_device_video t3 ON t1.item_id=t3.video_item_id
|
||||
WHERE t2.is_enable=1 AND t3.dev_sn=#{devSn} and t3.type=#{type} and t2.video_type=3
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
<select id="selectListExt" resultType="com.zhgd.xmgl.modules.bigdevice.entity.BigDeviceVideo">
|
||||
select bdv.*,vi.serial_number from video_item vi join big_device_video bdv on vi.item_id = bdv.video_item_id
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -21,7 +21,9 @@ import com.zhgd.xmgl.modules.bigdevice.mapper.*;
|
||||
import com.zhgd.xmgl.modules.bigdevice.service.ITowerService;
|
||||
import com.zhgd.xmgl.modules.bigdevice.service.ITowerVisualizeService;
|
||||
import com.zhgd.xmgl.modules.project.mapper.ProjectDevStatisticsMapper;
|
||||
import com.zhgd.xmgl.modules.video.mapper.VideoItemMapper;
|
||||
import com.zhgd.xmgl.util.MessageUtil;
|
||||
import com.zhgd.xmgl.util.ReflectionUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -208,10 +210,11 @@ public class TowerServiceImpl extends ServiceImpl<TowerMapper, Tower> implements
|
||||
tower.setTowerDriverList(devSn);
|
||||
}
|
||||
QueryWrapper<BigDeviceVideo> queryWrapper2 = new QueryWrapper<>();
|
||||
queryWrapper2.lambda().eq(BigDeviceVideo::getDevSn, tower.getDevSn())
|
||||
.eq(BigDeviceVideo::getProjectSn, tower.getProjectSn())
|
||||
.eq(BigDeviceVideo::getType, 1);
|
||||
List<BigDeviceVideo> videoList = bigDeviceVideoMapper.selectList(queryWrapper2);
|
||||
String bdv = "bdv.";
|
||||
queryWrapper2.eq(bdv + ReflectionUtil.getFieldNameToUlc(BigDeviceVideo::getDevSn), tower.getDevSn())
|
||||
.eq(bdv + ReflectionUtil.getFieldNameToUlc(BigDeviceVideo::getProjectSn), tower.getProjectSn())
|
||||
.eq(bdv + ReflectionUtil.getFieldNameToUlc(BigDeviceVideo::getType), 1);
|
||||
List<BigDeviceVideo> videoList = bigDeviceVideoMapper.selectListExt(queryWrapper2);
|
||||
tower.setVideoList(videoList);
|
||||
QueryWrapper<TowerVisualize> queryWrapper3 = new QueryWrapper<>();
|
||||
queryWrapper3.lambda().eq(TowerVisualize::getTowerSn, tower.getDevSn())
|
||||
|
||||
@ -156,15 +156,10 @@ public class ProjectFileServiceImpl extends ServiceImpl<ProjectFileMapper, Proje
|
||||
throw new OpenAlertException("未选中需要移动的文件");
|
||||
}
|
||||
ProjectFile old = projectFileMapper.selectById(list.get(0).getFileId());
|
||||
if (list.stream().anyMatch(e -> (e.getFilePath() + e.getFileName()).equals(old.getFilePath() + old.getFileName()))) {
|
||||
throw new OpenAlertException("目标文件夹和源文件夹相同");
|
||||
}
|
||||
if (list.stream().anyMatch(e -> {
|
||||
String source = e.getFilePath() + e.getFileName();
|
||||
String target = old.getFilePath() + old.getFileName();
|
||||
return source.equals(target);
|
||||
})) {
|
||||
throw new OpenAlertException("目标文件夹是源文件夹的子文件夹");
|
||||
if (list.stream().anyMatch(e -> StringUtils.startsWith(e.getFilePath(), old.getFilePath() + old.getFileName())
|
||||
&& StringUtils.substringAfter(e.getFilePath(), old.getFilePath() + old.getFileName()).startsWith("/")
|
||||
)) {
|
||||
throw new OpenAlertException("移动失败,目标文件夹是源文件夹的子文件夹");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user