27 changed files with 681 additions and 33 deletions
@ -0,0 +1,42 @@ |
|||
package com.ccsens.logistics.api; |
|||
|
|||
import com.ccsens.logistics.bean.dto.EquipmentDto; |
|||
import com.ccsens.logistics.bean.vo.EquipmentVo; |
|||
import com.ccsens.logistics.service.IEquipmentService; |
|||
import com.ccsens.util.JsonResponse; |
|||
import com.ccsens.util.bean.dto.QueryDto; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import io.swagger.annotations.ApiParam; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestMethod; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import javax.annotation.Resource; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author 马 |
|||
*/ |
|||
@Slf4j |
|||
@Api(tags = "设备相关接口") |
|||
@RestController |
|||
@RequestMapping("/equipment") |
|||
public class EquipmentController { |
|||
|
|||
@Resource |
|||
private IEquipmentService iEquipmentService; |
|||
|
|||
@ApiOperation(value = "查询摄像头列表(暂不使用)", notes = "mz:查询摄像头列表") |
|||
@RequestMapping(value = "/selCamera", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
|||
public JsonResponse<List<EquipmentVo.AllCamera>> selCamera(@ApiParam @Validated @RequestBody QueryDto<EquipmentDto.SelCamera> params) { |
|||
log.info("查看交付物的历史记录:{}",params); |
|||
// List<EquipmentVo.AllCamera> allCamera = iEquipmentService.selCamera(params.getParam());
|
|||
// log.info("查看交付物的历史记录:{}",allCamera);
|
|||
return JsonResponse.newInstance().ok(); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,44 @@ |
|||
package com.ccsens.logistics.api; |
|||
|
|||
import com.ccsens.logistics.bean.dto.MbpsDto; |
|||
import com.ccsens.logistics.bean.dto.WarehouseDto; |
|||
import com.ccsens.logistics.bean.vo.MbpsVo; |
|||
import com.ccsens.logistics.bean.vo.WarehouseVo; |
|||
import com.ccsens.logistics.service.IWarehouseService; |
|||
import com.ccsens.util.JsonResponse; |
|||
import com.ccsens.util.bean.dto.QueryDto; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import io.swagger.annotations.ApiParam; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestMethod; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import javax.annotation.Resource; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author 马 |
|||
*/ |
|||
@Slf4j |
|||
@Api(tags = "仓库相关接口" , description = "") |
|||
@RestController |
|||
@RequestMapping("/warehouse") |
|||
public class WarehouseController { |
|||
|
|||
@Resource |
|||
private IWarehouseService iWarehouseService; |
|||
|
|||
@ApiOperation(value = "查询仓库列表及仓库下的摄像头", notes = "mz:查询仓库列表及仓库下的摄像头") |
|||
@RequestMapping(value = "/selAllWarehouse", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
|||
public JsonResponse<WarehouseVo.AllWarehouse> selAllWarehouse(@ApiParam @Validated @RequestBody QueryDto<WarehouseDto.SelWarehouse> params) { |
|||
log.info("查看交付物的历史记录:{}",params); |
|||
List<WarehouseVo.AllWarehouse> warehouse = iWarehouseService.selAllWarehouse(params.getParam()); |
|||
log.info("查看交付物的历史记录:{}",warehouse); |
|||
return JsonResponse.newInstance().ok(warehouse); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.ccsens.logistics.bean.dto; |
|||
|
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author 马 |
|||
*/ |
|||
@Data |
|||
public class EquipmentDto { |
|||
|
|||
@Data |
|||
@ApiModel("查询摄像头") |
|||
public static class SelCamera{ |
|||
@ApiModelProperty("仓库id") |
|||
private Long warehouseId; |
|||
} |
|||
} |
@ -0,0 +1,21 @@ |
|||
package com.ccsens.logistics.bean.dto; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author 马 |
|||
*/ |
|||
@Data |
|||
public class WarehouseDto { |
|||
|
|||
@Data |
|||
@ApiModel("查询仓库") |
|||
public static class SelWarehouse{ |
|||
@ApiModelProperty("园区id") |
|||
private Long parkId; |
|||
@ApiModelProperty("仓库id") |
|||
private Long warehouseId; |
|||
} |
|||
} |
@ -0,0 +1,27 @@ |
|||
package com.ccsens.logistics.bean.vo; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author 马 |
|||
*/ |
|||
@Data |
|||
public class EquipmentVo { |
|||
|
|||
@Data |
|||
@ApiModel("摄像头列表") |
|||
public static class AllCamera{ |
|||
@ApiModelProperty("设备id") |
|||
private Long equipmentId; |
|||
@ApiModelProperty("设备名称") |
|||
private String equipmentName; |
|||
@ApiModelProperty("设备编号") |
|||
private Integer equipmentNumber; |
|||
@ApiModelProperty("设备类型(0-摄像头,1-温度测试,2-湿度测试,3-漏水检测)") |
|||
private Byte equipmentType; |
|||
@ApiModelProperty("设备地址") |
|||
private String equipmentLocation; |
|||
} |
|||
} |
@ -0,0 +1,26 @@ |
|||
package com.ccsens.logistics.bean.vo; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author 马 |
|||
*/ |
|||
@Data |
|||
public class WarehouseVo { |
|||
|
|||
@Data |
|||
@ApiModel("仓库及摄像头") |
|||
public static class AllWarehouse{ |
|||
@ApiModelProperty("仓库id") |
|||
private Long warehouseId; |
|||
@ApiModelProperty("仓库名称") |
|||
private String warehouseName; |
|||
@ApiModelProperty("摄像头列表") |
|||
private List<EquipmentVo.AllCamera> cameras; |
|||
} |
|||
|
|||
} |
@ -1,11 +1,33 @@ |
|||
package com.ccsens.logistics.persist.dao; |
|||
|
|||
import com.ccsens.logistics.bean.vo.MbpsVo; |
|||
import com.ccsens.logistics.persist.mapper.LogisticsEnvironmentRecordMapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author 马 |
|||
*/ |
|||
@Repository |
|||
public interface LogisticsEnvironmentRecordDao extends LogisticsEnvironmentRecordMapper { |
|||
|
|||
/** |
|||
* 查询温度变化 |
|||
* @param warehouseId 仓库id |
|||
* @param startTime 开始时间 |
|||
* @param endTime 结束时间 |
|||
* @return 温度列表 |
|||
*/ |
|||
List<MbpsVo.Temps> selTempByTime(@Param("warehouseId") Long warehouseId,@Param("startTime") Long startTime,@Param("endTime") Long endTime); |
|||
|
|||
/** |
|||
* 查询湿度变化 |
|||
* @param warehouseId 仓库id |
|||
* @param startTime 开始时间 |
|||
* @param endTime 结束时间 |
|||
* @return 湿度列表 |
|||
*/ |
|||
List<MbpsVo.Humiditys> selHumidityByTime(@Param("warehouseId") Long warehouseId,@Param("startTime") Long startTime,@Param("endTime") Long endTime); |
|||
} |
|||
|
@ -1,11 +1,24 @@ |
|||
package com.ccsens.logistics.persist.dao; |
|||
|
|||
import com.ccsens.logistics.bean.vo.WarehouseVo; |
|||
import com.ccsens.logistics.persist.mapper.LogisticsWarehouseMapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author 马 |
|||
*/ |
|||
@Repository |
|||
public interface LogisticsWarehouseDao extends LogisticsWarehouseMapper { |
|||
|
|||
/** |
|||
* 查询仓库及下面的摄像头 |
|||
* @param parkId 园区id |
|||
* @param warehouseId 仓库id |
|||
* @return 仓库及摄像头 |
|||
*/ |
|||
List<WarehouseVo.AllWarehouse> selWarehouseAndCamera(@Param("parkId") Long parkId,@Param("warehouseId") Long warehouseId); |
|||
|
|||
} |
|||
|
@ -0,0 +1,19 @@ |
|||
package com.ccsens.logistics.service; |
|||
|
|||
|
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Propagation; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
|
|||
/** |
|||
* 设备相关 |
|||
* @author 马 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class) |
|||
public class EquipmentService implements IEquipmentService { |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.ccsens.logistics.service; |
|||
|
|||
import com.ccsens.logistics.bean.dto.EquipmentDto; |
|||
import com.ccsens.logistics.bean.vo.EquipmentVo; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 设备相关 |
|||
* @author 马 |
|||
*/ |
|||
public interface IEquipmentService { |
|||
|
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.ccsens.logistics.service; |
|||
|
|||
import com.ccsens.logistics.bean.dto.WarehouseDto; |
|||
import com.ccsens.logistics.bean.vo.MbpsVo; |
|||
import com.ccsens.logistics.bean.vo.WarehouseVo; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author 马 |
|||
*/ |
|||
public interface IWarehouseService { |
|||
|
|||
/** |
|||
* 查询仓库及摄像头 |
|||
* @param param 园区id 仓库id |
|||
* @return 仓库及摄像头 |
|||
*/ |
|||
List<WarehouseVo.AllWarehouse> selAllWarehouse(WarehouseDto.SelWarehouse param); |
|||
} |
@ -0,0 +1,33 @@ |
|||
package com.ccsens.logistics.service; |
|||
|
|||
import com.ccsens.logistics.bean.dto.WarehouseDto; |
|||
import com.ccsens.logistics.bean.vo.WarehouseVo; |
|||
import com.ccsens.logistics.persist.dao.LogisticsWarehouseDao; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Propagation; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import javax.annotation.Resource; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author 马 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class) |
|||
public class WarehouseService implements IWarehouseService { |
|||
|
|||
@Resource |
|||
private LogisticsWarehouseDao warehouseDao; |
|||
|
|||
@Override |
|||
public List<WarehouseVo.AllWarehouse> selAllWarehouse(WarehouseDto.SelWarehouse param) { |
|||
//查询仓库及摄像头
|
|||
List<WarehouseVo.AllWarehouse> warehouses = warehouseDao.selWarehouseAndCamera(param.getParkId(),param.getWarehouseId()); |
|||
|
|||
return warehouses; |
|||
} |
|||
|
|||
} |
@ -1,6 +1,6 @@ |
|||
spring: |
|||
profiles: |
|||
active: dev |
|||
include: common, util-dev |
|||
active: test |
|||
include: common,util-test |
|||
|
|||
|
|||
|
Loading…
Reference in new issue