称重信息带图片代码

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,79 +12,81 @@ import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.List;
/**
* @Description: 称重记录表
* @author pds
* @date 2023-03-21
* @date 2023-03-21
* @version V1.0
*/
@Data
@TableName("weigh_info")
@ApiModel(value="WeighInfo实体类",description="WeighInfo")
@ApiModel(value = "WeighInfo实体类", description = "WeighInfo")
public class WeighInfo implements Serializable {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
/**id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value="id")
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value="id")
private java.lang.Long id ;
/**流水号*/
@Excel(name = "流水号", width = 15)
@ApiModelProperty(value="流水号")
@ApiModelProperty(value="流水号")
private java.lang.String serialNo ;
/**车牌号码*/
@Excel(name = "车牌号码", width = 15)
@ApiModelProperty(value="车牌号码")
@ApiModelProperty(value="车牌号码")
private java.lang.String licensePlate ;
/**发货单位*/
@Excel(name = "发货单位", width = 15)
@ApiModelProperty(value="发货单位")
@ApiModelProperty(value="发货单位")
private java.lang.String forwardingUnit ;
/**收货单位*/
@Excel(name = "收货单位", width = 15)
@ApiModelProperty(value="收货单位")
@ApiModelProperty(value="收货单位")
private java.lang.String receivingUnit ;
/**货名*/
@Excel(name = "货名", width = 15)
@ApiModelProperty(value="货名")
@ApiModelProperty(value="货名")
private java.lang.String goodsName ;
/**规格*/
@Excel(name = "规格", width = 15)
@ApiModelProperty(value="规格")
@ApiModelProperty(value="规格")
private java.lang.String specifications ;
/**备注*/
@Excel(name = "备注", width = 15)
@ApiModelProperty(value="备注")
@ApiModelProperty(value="备注")
private java.lang.String reserve ;
/**毛重*/
@Excel(name = "毛重", width = 15)
@ApiModelProperty(value="毛重")
@ApiModelProperty(value="毛重")
private java.math.BigDecimal tare ;
/**皮重*/
@Excel(name = "皮重", width = 15)
@ApiModelProperty(value="皮重")
@ApiModelProperty(value="皮重")
private java.math.BigDecimal grossWeight ;
/**净重*/
@Excel(name = "净重", width = 15)
@ApiModelProperty(value="净重")
@ApiModelProperty(value="净重")
private java.math.BigDecimal netWeight ;
/**皮重时间*/
@Excel(name = "皮重时间", width = 20, format = "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")
@ApiModelProperty(value="皮重时间")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value="皮重时间")
private java.util.Date grossTime ;
/**毛重时间*/
@Excel(name = "毛重时间", width = 20, format = "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")
@ApiModelProperty(value="毛重时间")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value="毛重时间")
private java.util.Date tareTime ;
/**一磅时间*/
@Excel(name = "一磅时间", width = 20, format = "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")
@ApiModelProperty(value="一磅时间")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value="一磅时间")
private java.util.Date aCheckTime ;
/**
* 二磅时间
@ -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,19 +1,57 @@
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: 称重记录表
* @author pds
* @date 2023-03-21
* @date 2023-03-21
* @version V1.0
*/
@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;
}
}