Browse Source

增加查询热成像信息

logistics
ma 4 years ago
parent
commit
a4bb33d09b
  1. 3
      cloudutil/src/main/resources/application-util-test.yml
  2. 26
      logistics/src/main/java/com/ccsens/logistics/api/DebugController.java
  3. 9
      logistics/src/main/java/com/ccsens/logistics/api/MbpsController.java
  4. 7
      logistics/src/main/java/com/ccsens/logistics/bean/dto/MbpsDto.java
  5. 11
      logistics/src/main/java/com/ccsens/logistics/bean/po/LogisticsHeatImagingRecord.java
  6. 60
      logistics/src/main/java/com/ccsens/logistics/bean/po/LogisticsHeatImagingRecordExample.java
  7. 21
      logistics/src/main/java/com/ccsens/logistics/bean/vo/MbpsVo.java
  8. 18
      logistics/src/main/java/com/ccsens/logistics/persist/dao/LogisticsHeatImagingRecordDao.java
  9. 7
      logistics/src/main/java/com/ccsens/logistics/service/IMbpsService.java
  10. 8
      logistics/src/main/java/com/ccsens/logistics/service/MbpsService.java
  11. 6
      logistics/src/main/resources/application-test.yml
  12. 24
      logistics/src/main/resources/mapper_dao/LogisticsHeatImagingRecordDao.xml
  13. 33
      logistics/src/main/resources/mapper_raw/LogisticsHeatImagingRecordMapper.xml

3
cloudutil/src/main/resources/application-util-test.yml

@ -85,7 +85,8 @@ eureka:
# defaultZone: http://admin:admin@49.232.6.143:7010/eureka/
# defaultZone: http://admin:admin@192.168.0.99:7010/eureka/
defaultZone: http://admin:admin@192.168.31.13:7010/eureka/
defaultZone: http://admin:admin@192.168.4.113:7010/eureka/
# defaultZone: http://admin:admin@192.168.31.13:7010/eureka/
# defaultZone: http://admin:admin@test.tall.wiki:7010/eureka/
instance:
# 是否注册IP到eureka server,如不指定或设为false,那就回注册主机名到eureka server

26
logistics/src/main/java/com/ccsens/logistics/api/DebugController.java

@ -1,13 +1,20 @@
package com.ccsens.logistics.api;
import cn.hutool.core.lang.Snowflake;
import com.ccsens.logistics.bean.po.LogisticsCarRecord;
import com.ccsens.logistics.bean.po.LogisticsEnvironmentRecord;
import com.ccsens.logistics.persist.dao.LogisticsCarRecordDao;
import com.ccsens.logistics.persist.dao.LogisticsEnvironmentRecordDao;
import com.ccsens.util.JsonResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.RandomUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
@Slf4j
@ -16,12 +23,29 @@ import javax.servlet.http.HttpServletRequest;
@RequestMapping("/debug")
public class DebugController {
@Resource
private LogisticsCarRecordDao carRecordDao;
@Resource
private Snowflake snowflake;
@ApiOperation(value = "/测试",notes = "")
@ApiOperation(value = "/测试添加假数据",notes = "")
@ApiImplicitParams({
})
@RequestMapping(value="",produces = {"application/json;charset=UTF-8"})
public JsonResponse getSmsCode(HttpServletRequest request) throws Exception {
Long currentTime = 1620632535000L;
for (int i = 0; i < 100; i++) {
Byte carType = Math.random()*10 < 5 ? (byte)0 :(byte) 1;
LogisticsCarRecord logisticsCarRecord = new LogisticsCarRecord();
logisticsCarRecord.setId(snowflake.nextId());
logisticsCarRecord.setCarWeight(RandomUtils.nextLong(1,9));
logisticsCarRecord.setLicensePlate("未知");
logisticsCarRecord.setCarType(carType);
logisticsCarRecord.setInOut(carType);
logisticsCarRecord.setRecordTime(currentTime);
currentTime = currentTime-86400000;
carRecordDao.insertSelective(logisticsCarRecord);
}
return JsonResponse.newInstance().ok("测试");
}

9
logistics/src/main/java/com/ccsens/logistics/api/MbpsController.java

@ -57,4 +57,13 @@ public class MbpsController {
return JsonResponse.newInstance().ok(teamAndHumidity);
}
@ApiOperation(value = "查询热成像信息", notes = "mz:查询热成像信息")
@RequestMapping(value = "/selHeatImaging", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<MbpsVo.SelHeatImaging> selHeatImaging(@ApiParam @Validated @RequestBody QueryDto<MbpsDto.SelHeatImaging> params) {
log.info("查询热成像信息:{}",params);
MbpsVo.SelHeatImaging heatImaging = iMbpsService.selHeatImaging(params.getParam());
log.info("查询热成像信息:{}",heatImaging);
return JsonResponse.newInstance().ok(heatImaging);
}
}

7
logistics/src/main/java/com/ccsens/logistics/bean/dto/MbpsDto.java

@ -43,4 +43,11 @@ public class MbpsDto {
private Long endTime;
}
@Data
@ApiModel(value = "查询热成像信息")
public static class SelHeatImaging{
@ApiModelProperty("热成像设备id")
private Long id;
}
}

11
logistics/src/main/java/com/ccsens/logistics/bean/po/LogisticsHeatImagingRecord.java

@ -17,6 +17,8 @@ public class LogisticsHeatImagingRecord implements Serializable {
private String maxTy;
private Long recordTime;
private Long equipmentId;
private Long warehouseId;
@ -79,6 +81,14 @@ public class LogisticsHeatImagingRecord implements Serializable {
this.maxTy = maxTy == null ? null : maxTy.trim();
}
public Long getRecordTime() {
return recordTime;
}
public void setRecordTime(Long recordTime) {
this.recordTime = recordTime;
}
public Long getEquipmentId() {
return equipmentId;
}
@ -139,6 +149,7 @@ public class LogisticsHeatImagingRecord implements Serializable {
sb.append(", maxT=").append(maxT);
sb.append(", maxTx=").append(maxTx);
sb.append(", maxTy=").append(maxTy);
sb.append(", recordTime=").append(recordTime);
sb.append(", equipmentId=").append(equipmentId);
sb.append(", warehouseId=").append(warehouseId);
sb.append(", createdAt=").append(createdAt);

60
logistics/src/main/java/com/ccsens/logistics/bean/po/LogisticsHeatImagingRecordExample.java

@ -486,6 +486,66 @@ public class LogisticsHeatImagingRecordExample {
return (Criteria) this;
}
public Criteria andRecordTimeIsNull() {
addCriterion("record_time is null");
return (Criteria) this;
}
public Criteria andRecordTimeIsNotNull() {
addCriterion("record_time is not null");
return (Criteria) this;
}
public Criteria andRecordTimeEqualTo(Long value) {
addCriterion("record_time =", value, "recordTime");
return (Criteria) this;
}
public Criteria andRecordTimeNotEqualTo(Long value) {
addCriterion("record_time <>", value, "recordTime");
return (Criteria) this;
}
public Criteria andRecordTimeGreaterThan(Long value) {
addCriterion("record_time >", value, "recordTime");
return (Criteria) this;
}
public Criteria andRecordTimeGreaterThanOrEqualTo(Long value) {
addCriterion("record_time >=", value, "recordTime");
return (Criteria) this;
}
public Criteria andRecordTimeLessThan(Long value) {
addCriterion("record_time <", value, "recordTime");
return (Criteria) this;
}
public Criteria andRecordTimeLessThanOrEqualTo(Long value) {
addCriterion("record_time <=", value, "recordTime");
return (Criteria) this;
}
public Criteria andRecordTimeIn(List<Long> values) {
addCriterion("record_time in", values, "recordTime");
return (Criteria) this;
}
public Criteria andRecordTimeNotIn(List<Long> values) {
addCriterion("record_time not in", values, "recordTime");
return (Criteria) this;
}
public Criteria andRecordTimeBetween(Long value1, Long value2) {
addCriterion("record_time between", value1, value2, "recordTime");
return (Criteria) this;
}
public Criteria andRecordTimeNotBetween(Long value1, Long value2) {
addCriterion("record_time not between", value1, value2, "recordTime");
return (Criteria) this;
}
public Criteria andEquipmentIdIsNull() {
addCriterion("equipment_id is null");
return (Criteria) this;

21
logistics/src/main/java/com/ccsens/logistics/bean/vo/MbpsVo.java

@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.sql.Date;
import java.util.ArrayList;
import java.util.List;
@ -89,7 +90,7 @@ public class MbpsVo {
@ApiModelProperty("时间")
private Date time;
@ApiModelProperty("温度")
private Long temp;
private BigDecimal temp;
}
@Data
@ApiModel("湿度变化")
@ -98,7 +99,23 @@ public class MbpsVo {
@ApiModelProperty("时间")
private Date time;
@ApiModelProperty("湿度")
private Long humidity;
private BigDecimal humidity;
}
@Data
@ApiModel("热成像")
public static class SelHeatImaging{
@ApiModelProperty("热成像的记录id")
private Long id;
@ApiModelProperty("测量数值")
private BigDecimal numValue;
@ApiModelProperty("图像数据最高温度横坐标位置")
private String maxTx;
@ApiModelProperty("图像数据最高温度纵坐标位置")
private String maxTy;
@ApiModelProperty("图像数据编码")
private String imageData;
}
}

18
logistics/src/main/java/com/ccsens/logistics/persist/dao/LogisticsHeatImagingRecordDao.java

@ -0,0 +1,18 @@
package com.ccsens.logistics.persist.dao;
import com.ccsens.logistics.bean.vo.MbpsVo;
import org.springframework.stereotype.Repository;
/**
* @author
*/
@Repository
public interface LogisticsHeatImagingRecordDao {
/**
* 查询热成像最新信息
* @param id 热成像设备id
* @return 热成像信息
*/
MbpsVo.SelHeatImaging selHeatImaging(Long id);
}

7
logistics/src/main/java/com/ccsens/logistics/service/IMbpsService.java

@ -29,4 +29,11 @@ public interface IMbpsService {
* @return 温度与湿度
*/
MbpsVo.SelTempAndHumidity selTeamAndHumidity(MbpsDto.SelTeamAndHumidity param);
/**
* 查询热成像最新信息
* @param param 热成像设备id
* @return 热成像信息
*/
MbpsVo.SelHeatImaging selHeatImaging(MbpsDto.SelHeatImaging param);
}

8
logistics/src/main/java/com/ccsens/logistics/service/MbpsService.java

@ -4,6 +4,7 @@ import com.ccsens.logistics.bean.dto.MbpsDto;
import com.ccsens.logistics.bean.vo.MbpsVo;
import com.ccsens.logistics.persist.dao.LogisticsCarRecordDao;
import com.ccsens.logistics.persist.dao.LogisticsEnvironmentRecordDao;
import com.ccsens.logistics.persist.dao.LogisticsHeatImagingRecordDao;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
@ -24,6 +25,8 @@ public class MbpsService implements IMbpsService {
private LogisticsCarRecordDao carRecordDao;
@Resource
private LogisticsEnvironmentRecordDao environmentRecordDao;
@Resource
private LogisticsHeatImagingRecordDao heatImagingRecordDao;
@Override
public MbpsVo.AllMbps selAllMbps(MbpsDto.SelAllMbpsSerch param) {
@ -75,4 +78,9 @@ public class MbpsService implements IMbpsService {
return tempAndHumidity;
}
@Override
public MbpsVo.SelHeatImaging selHeatImaging(MbpsDto.SelHeatImaging param) {
return heatImagingRecordDao.selHeatImaging(param.getId());
}
}

6
logistics/src/main/resources/application-test.yml

@ -9,9 +9,9 @@ spring:
type: com.alibaba.druid.pool.DruidDataSource
rabbitmq:
host: 127.0.0.1
password: 111111
password: guest
port: 5672
username: admin
username: guest
redis:
database: 0
host: 127.0.0.1
@ -28,7 +28,7 @@ swagger:
enable: true
eureka:
instance:
ip-address: 192.168.31.13
ip-address: 127.0.0.1
file:
path: /home/cloud/logistics/uploads/
signUpUrl: https://test.tall.wiki/compete/

24
logistics/src/main/resources/mapper_dao/LogisticsHeatImagingRecordDao.xml

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.logistics.persist.dao.LogisticsHeatImagingRecordDao">
<select id="selHeatImaging" resultType="com.ccsens.logistics.bean.vo.MbpsVo$SelHeatImaging">
SELECT
ir.id AS id,
ir.num_value AS numValue,
ir.max_tx AS maxTx,
ir.max_ty AS maxTy,
ir.image_data AS imageData
FROM
t_logistics_heat_imaging_record AS ir
LEFT JOIN t_logistics_equipment AS le ON ir.equipment_id = le.id
AND le.rec_status = 0
<if test="id!=null and id!=''">
AND le.id = #{id}
</if>
ORDER BY
ir.record_time DESC
LIMIT 1
</select>
</mapper>

33
logistics/src/main/resources/mapper_raw/LogisticsHeatImagingRecordMapper.xml

@ -8,6 +8,7 @@
<result column="max_t" jdbcType="DECIMAL" property="maxT" />
<result column="max_tx" jdbcType="VARCHAR" property="maxTx" />
<result column="max_ty" jdbcType="VARCHAR" property="maxTy" />
<result column="record_time" jdbcType="BIGINT" property="recordTime" />
<result column="equipment_id" jdbcType="BIGINT" property="equipmentId" />
<result column="warehouse_id" jdbcType="BIGINT" property="warehouseId" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
@ -76,8 +77,8 @@
</where>
</sql>
<sql id="Base_Column_List">
id, num_value, num_type, max_t, max_tx, max_ty, equipment_id, warehouse_id, created_at,
updated_at, rec_status
id, num_value, num_type, max_t, max_tx, max_ty, record_time, equipment_id, warehouse_id,
created_at, updated_at, rec_status
</sql>
<sql id="Blob_Column_List">
image_data
@ -133,14 +134,14 @@
<insert id="insert" parameterType="com.ccsens.logistics.bean.po.LogisticsHeatImagingRecord">
insert into t_logistics_heat_imaging_record (id, num_value, num_type,
max_t, max_tx, max_ty,
equipment_id, warehouse_id, created_at,
updated_at, rec_status, image_data
)
record_time, equipment_id, warehouse_id,
created_at, updated_at, rec_status,
image_data)
values (#{id,jdbcType=BIGINT}, #{numValue,jdbcType=DECIMAL}, #{numType,jdbcType=TINYINT},
#{maxT,jdbcType=DECIMAL}, #{maxTx,jdbcType=VARCHAR}, #{maxTy,jdbcType=VARCHAR},
#{equipmentId,jdbcType=BIGINT}, #{warehouseId,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP},
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}, #{imageData,jdbcType=LONGVARCHAR}
)
#{recordTime,jdbcType=BIGINT}, #{equipmentId,jdbcType=BIGINT}, #{warehouseId,jdbcType=BIGINT},
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT},
#{imageData,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.logistics.bean.po.LogisticsHeatImagingRecord">
insert into t_logistics_heat_imaging_record
@ -163,6 +164,9 @@
<if test="maxTy != null">
max_ty,
</if>
<if test="recordTime != null">
record_time,
</if>
<if test="equipmentId != null">
equipment_id,
</if>
@ -201,6 +205,9 @@
<if test="maxTy != null">
#{maxTy,jdbcType=VARCHAR},
</if>
<if test="recordTime != null">
#{recordTime,jdbcType=BIGINT},
</if>
<if test="equipmentId != null">
#{equipmentId,jdbcType=BIGINT},
</if>
@ -248,6 +255,9 @@
<if test="record.maxTy != null">
max_ty = #{record.maxTy,jdbcType=VARCHAR},
</if>
<if test="record.recordTime != null">
record_time = #{record.recordTime,jdbcType=BIGINT},
</if>
<if test="record.equipmentId != null">
equipment_id = #{record.equipmentId,jdbcType=BIGINT},
</if>
@ -279,6 +289,7 @@
max_t = #{record.maxT,jdbcType=DECIMAL},
max_tx = #{record.maxTx,jdbcType=VARCHAR},
max_ty = #{record.maxTy,jdbcType=VARCHAR},
record_time = #{record.recordTime,jdbcType=BIGINT},
equipment_id = #{record.equipmentId,jdbcType=BIGINT},
warehouse_id = #{record.warehouseId,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
@ -297,6 +308,7 @@
max_t = #{record.maxT,jdbcType=DECIMAL},
max_tx = #{record.maxTx,jdbcType=VARCHAR},
max_ty = #{record.maxTy,jdbcType=VARCHAR},
record_time = #{record.recordTime,jdbcType=BIGINT},
equipment_id = #{record.equipmentId,jdbcType=BIGINT},
warehouse_id = #{record.warehouseId,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
@ -324,6 +336,9 @@
<if test="maxTy != null">
max_ty = #{maxTy,jdbcType=VARCHAR},
</if>
<if test="recordTime != null">
record_time = #{recordTime,jdbcType=BIGINT},
</if>
<if test="equipmentId != null">
equipment_id = #{equipmentId,jdbcType=BIGINT},
</if>
@ -352,6 +367,7 @@
max_t = #{maxT,jdbcType=DECIMAL},
max_tx = #{maxTx,jdbcType=VARCHAR},
max_ty = #{maxTy,jdbcType=VARCHAR},
record_time = #{recordTime,jdbcType=BIGINT},
equipment_id = #{equipmentId,jdbcType=BIGINT},
warehouse_id = #{warehouseId,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
@ -367,6 +383,7 @@
max_t = #{maxT,jdbcType=DECIMAL},
max_tx = #{maxTx,jdbcType=VARCHAR},
max_ty = #{maxTy,jdbcType=VARCHAR},
record_time = #{recordTime,jdbcType=BIGINT},
equipment_id = #{equipmentId,jdbcType=BIGINT},
warehouse_id = #{warehouseId,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},

Loading…
Cancel
Save