称重信息带图片代码

This commit is contained in:
Administrator 2023-03-24 18:43:35 +08:00
parent 74d51d6bed
commit beab2dd5ce
7 changed files with 105 additions and 37 deletions

View File

@ -49,11 +49,19 @@
ON des.sensor_sn = decd.sensor_sn
INNER JOIN deep_excavation_measure_point t2
ON des.measure_point_number = t2.measure_point_number
WHERE t2.deep_excavation_id = #{deepExcavationId}
<where>
<if test="deepExcavationId != null and deepExcavationId != ''">
t2.deep_excavation_id = #{deepExcavationId}
</if>
</where>
AND decd.receive_time >=
CONCAT(DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -6 DAY), '%Y-%m-%d'), ' 00:00:00')
GROUP BY t2.rela_id) c ON demtr.id = c.rela_id
where demtr.deep_excavation_id = #{deepExcavationId}
<where>
<if test="deepExcavationId != null and deepExcavationId != ''">
demtr.deep_excavation_id = #{deepExcavationId}
</if>
</where>
</select>
<select id="selectMonitorTypeAlarmCountList" resultType="java.util.Map">
SELECT demt.monitor_type_name monitorTypeName,

View File

@ -217,5 +217,10 @@ public class ProgressTask implements Serializable {
@TableField(exist = false)
@ApiModelProperty(value = "任务进度详情列表")
private List<ProgressItemFeedback> feedbackList;
/**
* 相差时间实际完成时间-计划完成时间
*/
@TableField(exist = false)
private Long differDay;
}

View File

@ -2,6 +2,7 @@ package com.zhgd.xmgl.modules.project.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.core.util.IdUtil;
@ -668,6 +669,17 @@ public class ProgressTaskServiceImpl extends ServiceImpl<ProgressTaskMapper, Pro
Page<ProgressTask> p = new Page<>();
Page<ProgressTask> progressTaskPage = progressTaskMapper.selectPage(p, new LambdaQueryWrapper<ProgressTask>().eq(ProgressTask::getProjectSn, progressTask.getProjectSn())
.eq(progressTask.getStatus() != null, ProgressTask::getStatus, progressTask.getStatus()));
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(progressTaskPage.getRecords())) {
for (ProgressTask record : progressTaskPage.getRecords()) {
if (Objects.equals(record.getStatus(),2)) {
//算提前延时多少天
Date actualFinishDate = record.getActualFinishDate();
Date finishDate = record.getFinishDate();
long between = DateUtil.between(actualFinishDate, finishDate, DateUnit.DAY);
record.setDifferDay(between);
}
}
}
return Result.success(progressTaskPage);
}

View File

@ -66,13 +66,7 @@ public class WeighInfoController {
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
Result<IPage<WeighInfo>> result = new Result<IPage<WeighInfo>>();
QueryWrapper<WeighInfo> queryWrapper = QueryGenerator.initQueryWrapper(weighInfo, req.getParameterMap());
Page<WeighInfo> page = new Page<WeighInfo>(pageNo, pageSize);
IPage<WeighInfo> pageList = weighInfoService.page(page, queryWrapper);
result.setSuccess(true);
result.setResult(pageList);
return result;
return weighInfoService.queryPageList(weighInfo, pageNo, pageSize, req);
}
/**

View File

@ -1,6 +1,7 @@
package com.zhgd.xmgl.modules.weight.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
@ -11,6 +12,8 @@ import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.List;
/**
* @Description: 称重记录表
* @author pds
@ -103,4 +106,7 @@ public class WeighInfo implements Serializable {
* 远程现场的weighdata_info的id
*/
private java.lang.String removeWeighdataInfoId;
@TableField(exist = false)
private List<WeighPic> weighPicList;
}

View File

@ -1,8 +1,12 @@
package com.zhgd.xmgl.modules.weight.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.xmgl.modules.weight.entity.WeighInfo;
import com.baomidou.mybatisplus.extension.service.IService;
import javax.servlet.http.HttpServletRequest;
/**
* @Description: 称重记录表
* @author pds
@ -11,4 +15,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface IWeighInfoService extends IService<WeighInfo> {
Result<IPage<WeighInfo>> queryPageList(WeighInfo weighInfo, Integer pageNo, Integer pageSize, HttpServletRequest req);
}

View File

@ -1,11 +1,25 @@
package com.zhgd.xmgl.modules.weight.service.impl;
import com.zhgd.xmgl.modules.weight.entity.WeighInfo;
import com.zhgd.xmgl.modules.weight.mapper.WeighInfoMapper;
import com.zhgd.xmgl.modules.weight.service.IWeighInfoService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.jeecg.common.system.query.QueryGenerator;
import com.zhgd.xmgl.modules.weight.entity.WeighInfo;
import com.zhgd.xmgl.modules.weight.entity.WeighPic;
import com.zhgd.xmgl.modules.weight.mapper.WeighInfoMapper;
import com.zhgd.xmgl.modules.weight.mapper.WeighPicMapper;
import com.zhgd.xmgl.modules.weight.service.IWeighInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Description: 称重记录表
@ -15,5 +29,29 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
*/
@Service
public class WeighInfoServiceImpl extends ServiceImpl<WeighInfoMapper, WeighInfo> implements IWeighInfoService {
@Autowired
private WeighInfoMapper weighInfoMapper;
@Autowired
private WeighPicMapper weighPicMapper;
@Override
public Result<IPage<WeighInfo>> queryPageList(WeighInfo weighInfo, Integer pageNo, Integer pageSize, HttpServletRequest req) {
Result<IPage<WeighInfo>> result = new Result<>();
QueryWrapper<WeighInfo> queryWrapper = QueryGenerator.initQueryWrapper(weighInfo, req.getParameterMap());
Page<WeighInfo> page = new Page<WeighInfo>(pageNo, pageSize);
IPage<WeighInfo> pageList = page(page, queryWrapper);
if (!CollectionUtils.isEmpty(pageList.getRecords())) {
List<Long> idList = pageList.getRecords().stream().map(WeighInfo::getId).collect(Collectors.toList());
List<WeighPic> weighPics = weighPicMapper.selectList(new LambdaQueryWrapper<WeighPic>().in(WeighPic::getWeighDataInfoId, idList));
if (!CollectionUtils.isEmpty(weighPics)) {
Map<Long, List<WeighPic>> weighDataInfoIdAndListMap = weighPics.stream().collect(Collectors.groupingBy(WeighPic::getWeighDataInfoId));
for (WeighInfo record : pageList.getRecords()) {
record.setWeighPicList(weighDataInfoIdAndListMap.get(record.getId()));
}
}
}
result.setSuccess(true);
result.setResult(pageList);
return result;
}
}