称重信息带图片代码
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,79 +12,81 @@ 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
|
||||||
* @date: 2023-03-21
|
* @date: 2023-03-21
|
||||||
* @version: V1.0
|
* @version: V1.0
|
||||||
*/
|
*/
|
||||||
@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;
|
||||||
|
|
||||||
/**id*/
|
/**id*/
|
||||||
@TableId(type = IdType.ASSIGN_ID)
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
@ApiModelProperty(value="id")
|
@ApiModelProperty(value="id")
|
||||||
private java.lang.Long id ;
|
private java.lang.Long id ;
|
||||||
/**流水号*/
|
/**流水号*/
|
||||||
@Excel(name = "流水号", width = 15)
|
@Excel(name = "流水号", width = 15)
|
||||||
@ApiModelProperty(value="流水号")
|
@ApiModelProperty(value="流水号")
|
||||||
private java.lang.String serialNo ;
|
private java.lang.String serialNo ;
|
||||||
/**车牌号码*/
|
/**车牌号码*/
|
||||||
@Excel(name = "车牌号码", width = 15)
|
@Excel(name = "车牌号码", width = 15)
|
||||||
@ApiModelProperty(value="车牌号码")
|
@ApiModelProperty(value="车牌号码")
|
||||||
private java.lang.String licensePlate ;
|
private java.lang.String licensePlate ;
|
||||||
/**发货单位*/
|
/**发货单位*/
|
||||||
@Excel(name = "发货单位", width = 15)
|
@Excel(name = "发货单位", width = 15)
|
||||||
@ApiModelProperty(value="发货单位")
|
@ApiModelProperty(value="发货单位")
|
||||||
private java.lang.String forwardingUnit ;
|
private java.lang.String forwardingUnit ;
|
||||||
/**收货单位*/
|
/**收货单位*/
|
||||||
@Excel(name = "收货单位", width = 15)
|
@Excel(name = "收货单位", width = 15)
|
||||||
@ApiModelProperty(value="收货单位")
|
@ApiModelProperty(value="收货单位")
|
||||||
private java.lang.String receivingUnit ;
|
private java.lang.String receivingUnit ;
|
||||||
/**货名*/
|
/**货名*/
|
||||||
@Excel(name = "货名", width = 15)
|
@Excel(name = "货名", width = 15)
|
||||||
@ApiModelProperty(value="货名")
|
@ApiModelProperty(value="货名")
|
||||||
private java.lang.String goodsName ;
|
private java.lang.String goodsName ;
|
||||||
/**规格*/
|
/**规格*/
|
||||||
@Excel(name = "规格", width = 15)
|
@Excel(name = "规格", width = 15)
|
||||||
@ApiModelProperty(value="规格")
|
@ApiModelProperty(value="规格")
|
||||||
private java.lang.String specifications ;
|
private java.lang.String specifications ;
|
||||||
/**备注*/
|
/**备注*/
|
||||||
@Excel(name = "备注", width = 15)
|
@Excel(name = "备注", width = 15)
|
||||||
@ApiModelProperty(value="备注")
|
@ApiModelProperty(value="备注")
|
||||||
private java.lang.String reserve ;
|
private java.lang.String reserve ;
|
||||||
/**毛重*/
|
/**毛重*/
|
||||||
@Excel(name = "毛重", width = 15)
|
@Excel(name = "毛重", width = 15)
|
||||||
@ApiModelProperty(value="毛重")
|
@ApiModelProperty(value="毛重")
|
||||||
private java.math.BigDecimal tare ;
|
private java.math.BigDecimal tare ;
|
||||||
/**皮重*/
|
/**皮重*/
|
||||||
@Excel(name = "皮重", width = 15)
|
@Excel(name = "皮重", width = 15)
|
||||||
@ApiModelProperty(value="皮重")
|
@ApiModelProperty(value="皮重")
|
||||||
private java.math.BigDecimal grossWeight ;
|
private java.math.BigDecimal grossWeight ;
|
||||||
/**净重*/
|
/**净重*/
|
||||||
@Excel(name = "净重", width = 15)
|
@Excel(name = "净重", width = 15)
|
||||||
@ApiModelProperty(value="净重")
|
@ApiModelProperty(value="净重")
|
||||||
private java.math.BigDecimal netWeight ;
|
private java.math.BigDecimal netWeight ;
|
||||||
/**皮重时间*/
|
/**皮重时间*/
|
||||||
@Excel(name = "皮重时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
@Excel(name = "皮重时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
@ApiModelProperty(value="皮重时间")
|
@ApiModelProperty(value="皮重时间")
|
||||||
private java.util.Date grossTime ;
|
private java.util.Date grossTime ;
|
||||||
/**毛重时间*/
|
/**毛重时间*/
|
||||||
@Excel(name = "毛重时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
@Excel(name = "毛重时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
@ApiModelProperty(value="毛重时间")
|
@ApiModelProperty(value="毛重时间")
|
||||||
private java.util.Date tareTime ;
|
private java.util.Date tareTime ;
|
||||||
/**一磅时间*/
|
/**一磅时间*/
|
||||||
@Excel(name = "一磅时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
@Excel(name = "一磅时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
@ApiModelProperty(value="一磅时间")
|
@ApiModelProperty(value="一磅时间")
|
||||||
private java.util.Date aCheckTime ;
|
private java.util.Date aCheckTime ;
|
||||||
/**
|
/**
|
||||||
* 二磅时间
|
* 二磅时间
|
||||||
@ -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,19 +1,57 @@
|
|||||||
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: 称重记录表
|
||||||
* @author: pds
|
* @author: pds
|
||||||
* @date: 2023-03-21
|
* @date: 2023-03-21
|
||||||
* @version: V1.0
|
* @version: V1.0
|
||||||
*/
|
*/
|
||||||
@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