称重信息带图片代码
This commit is contained in:
parent
74d51d6bed
commit
beab2dd5ce
@ -49,11 +49,19 @@
|
|||||||
ON des.sensor_sn = decd.sensor_sn
|
ON des.sensor_sn = decd.sensor_sn
|
||||||
INNER JOIN deep_excavation_measure_point t2
|
INNER JOIN deep_excavation_measure_point t2
|
||||||
ON des.measure_point_number = t2.measure_point_number
|
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 >=
|
AND decd.receive_time >=
|
||||||
CONCAT(DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -6 DAY), '%Y-%m-%d'), ' 00:00:00')
|
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
|
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>
|
||||||
<select id="selectMonitorTypeAlarmCountList" resultType="java.util.Map">
|
<select id="selectMonitorTypeAlarmCountList" resultType="java.util.Map">
|
||||||
SELECT demt.monitor_type_name monitorTypeName,
|
SELECT demt.monitor_type_name monitorTypeName,
|
||||||
|
|||||||
@ -217,5 +217,10 @@ public class ProgressTask implements Serializable {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
@ApiModelProperty(value = "任务进度详情列表")
|
@ApiModelProperty(value = "任务进度详情列表")
|
||||||
private List<ProgressItemFeedback> feedbackList;
|
private List<ProgressItemFeedback> feedbackList;
|
||||||
|
/**
|
||||||
|
* 相差时间(日:实际完成时间-计划完成时间)
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Long differDay;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package com.zhgd.xmgl.modules.project.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.date.DatePattern;
|
import cn.hutool.core.date.DatePattern;
|
||||||
|
import cn.hutool.core.date.DateUnit;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.text.CharSequenceUtil;
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
@ -668,6 +669,17 @@ public class ProgressTaskServiceImpl extends ServiceImpl<ProgressTaskMapper, Pro
|
|||||||
Page<ProgressTask> p = new Page<>();
|
Page<ProgressTask> p = new Page<>();
|
||||||
Page<ProgressTask> progressTaskPage = progressTaskMapper.selectPage(p, new LambdaQueryWrapper<ProgressTask>().eq(ProgressTask::getProjectSn, progressTask.getProjectSn())
|
Page<ProgressTask> progressTaskPage = progressTaskMapper.selectPage(p, new LambdaQueryWrapper<ProgressTask>().eq(ProgressTask::getProjectSn, progressTask.getProjectSn())
|
||||||
.eq(progressTask.getStatus() != null, ProgressTask::getStatus, progressTask.getStatus()));
|
.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);
|
return Result.success(progressTaskPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -66,13 +66,7 @@ public class WeighInfoController {
|
|||||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
HttpServletRequest req) {
|
HttpServletRequest req) {
|
||||||
Result<IPage<WeighInfo>> result = new Result<IPage<WeighInfo>>();
|
return weighInfoService.queryPageList(weighInfo, pageNo, pageSize, req);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package com.zhgd.xmgl.modules.weight.entity;
|
package com.zhgd.xmgl.modules.weight.entity;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
@ -11,6 +12,8 @@ import org.jeecgframework.poi.excel.annotation.Excel;
|
|||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 称重记录表
|
* @Description: 称重记录表
|
||||||
* @author: pds
|
* @author: pds
|
||||||
@ -19,7 +22,7 @@ import java.io.Serializable;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("weigh_info")
|
@TableName("weigh_info")
|
||||||
@ApiModel(value="WeighInfo实体类",description="WeighInfo")
|
@ApiModel(value = "WeighInfo实体类", description = "WeighInfo")
|
||||||
public class WeighInfo implements Serializable {
|
public class WeighInfo implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@ -103,4 +106,7 @@ public class WeighInfo implements Serializable {
|
|||||||
* 远程现场的weighdata_info的id
|
* 远程现场的weighdata_info的id
|
||||||
*/
|
*/
|
||||||
private java.lang.String removeWeighdataInfoId;
|
private java.lang.String removeWeighdataInfoId;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<WeighPic> weighPicList;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
package com.zhgd.xmgl.modules.weight.service;
|
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.zhgd.xmgl.modules.weight.entity.WeighInfo;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 称重记录表
|
* @Description: 称重记录表
|
||||||
* @author: pds
|
* @author: pds
|
||||||
@ -11,4 +15,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||||||
*/
|
*/
|
||||||
public interface IWeighInfoService extends IService<WeighInfo> {
|
public interface IWeighInfoService extends IService<WeighInfo> {
|
||||||
|
|
||||||
|
Result<IPage<WeighInfo>> queryPageList(WeighInfo weighInfo, Integer pageNo, Integer pageSize, HttpServletRequest req);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,25 @@
|
|||||||
package com.zhgd.xmgl.modules.weight.service.impl;
|
package com.zhgd.xmgl.modules.weight.service.impl;
|
||||||
|
|
||||||
import com.zhgd.xmgl.modules.weight.entity.WeighInfo;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.zhgd.xmgl.modules.weight.mapper.WeighInfoMapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.zhgd.xmgl.modules.weight.service.IWeighInfoService;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import org.springframework.stereotype.Service;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
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: 称重记录表
|
* @Description: 称重记录表
|
||||||
@ -15,5 +29,29 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class WeighInfoServiceImpl extends ServiceImpl<WeighInfoMapper, WeighInfo> implements IWeighInfoService {
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user