Commit 1c10b076 authored by zhuangzhuang's avatar zhuangzhuang

5.24--仓库的增删改查,gateway和tdl的绑定与解绑

parent 227333db
package com.example.tdl.domain.vo;
public class AddWarehouseGatewayVo {
private String warehouseNo;
private String SN;
public String getWarehouseNo() {
return warehouseNo;
}
public void setWarehouseNo(String warehouseNo) {
this.warehouseNo = warehouseNo;
}
public String getSN() {
return SN;
}
public void setSN(String SN) {
this.SN = SN;
}
}
......@@ -6,21 +6,15 @@ public class AddWarehouseVo {
private String country;
private String province;
private String city;
private String district;
private String address;
private String regionCN;//区域中文
private String addressDetail;
private String regionEN;//区域英文
private String lng;
private String longitude;//经度
private String lat;
private String latitude;//纬度
private String regionName;//
private String property;//属性
......@@ -42,8 +36,6 @@ public class AddWarehouseVo {
private Integer timeZone;//时区
private String weatherInfo;//区域气象信息
private String warehouseInfo;//基础描述
private String remark;
......@@ -64,14 +56,6 @@ public class AddWarehouseVo {
this.country = country;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getCity() {
return city;
}
......@@ -80,52 +64,36 @@ public class AddWarehouseVo {
this.city = city;
}
public String getDistrict() {
return district;
}
public void setDistrict(String district) {
this.district = district;
public String getAddressDetail() {
return addressDetail;
}
public String getAddress() {
return address;
public void setAddressDetail(String addressDetail) {
this.addressDetail = addressDetail;
}
public void setAddress(String address) {
this.address = address;
public String getLng() {
return lng;
}
public String getRegionCN() {
return regionCN;
public void setLng(String lng) {
this.lng = lng;
}
public void setRegionCN(String regionCN) {
this.regionCN = regionCN;
public String getLat() {
return lat;
}
public String getRegionEN() {
return regionEN;
public void setLat(String lat) {
this.lat = lat;
}
public void setRegionEN(String regionEN) {
this.regionEN = regionEN;
public String getRegionName() {
return regionName;
}
public String getLongitude() {
return longitude;
}
public void setLongitude(String longitude) {
this.longitude = longitude;
}
public String getLatitude() {
return latitude;
}
public void setLatitude(String latitude) {
this.latitude = latitude;
public void setRegionName(String regionName) {
this.regionName = regionName;
}
public String getProperty() {
......@@ -208,14 +176,6 @@ public class AddWarehouseVo {
this.timeZone = timeZone;
}
public String getWeatherInfo() {
return weatherInfo;
}
public void setWeatherInfo(String weatherInfo) {
this.weatherInfo = weatherInfo;
}
public String getWarehouseInfo() {
return warehouseInfo;
}
......
package com.example.tdl.domain.vo;
public class AlarmTypeVo {
private String alarmType;
public String getAlarmType() {
return alarmType;
}
public void setAlarmType(String alarmType) {
this.alarmType = alarmType;
}
}
......@@ -2,27 +2,23 @@ package com.example.tdl.domain.vo;
public class ResultWarehouseVo {
private String warehouseName;
private String warehouseNo;//仓库编号
private String country;
private String warehouseName;
private String province;
private String country;
private String city;
private String district;
private String address;
private String regions;
private String regionCN;//区域中文
private String addressDetail;
private String regionEN;//区域英文
private String regionName;
private String longitude;//经度
private String lng;//经度
private String latitude;//纬度
private String lat;//纬度
private String property;//属性
......@@ -30,8 +26,6 @@ public class ResultWarehouseVo {
private String alarmType;
private String alarmScene;
private String hardwareLevel;//硬件等级
private Double areaIndoor;//室内平面面积
......@@ -46,19 +40,11 @@ public class ResultWarehouseVo {
private Integer timeZone;//时区
private String weatherInfo;//区域气象信息
private String warehouseInfo;//基础描述
private String remark;
private String companyName;
public String getWarehouseName() {
return warehouseName;
}
public void setWarehouseName(String warehouseName) {
this.warehouseName = warehouseName;
}
private String remark;
public String getWarehouseNo() {
return warehouseNo;
......@@ -68,20 +54,20 @@ public class ResultWarehouseVo {
this.warehouseNo = warehouseNo;
}
public String getCountry() {
return country;
public String getWarehouseName() {
return warehouseName;
}
public void setCountry(String country) {
this.country = country;
public void setWarehouseName(String warehouseName) {
this.warehouseName = warehouseName;
}
public String getProvince() {
return province;
public String getCountry() {
return country;
}
public void setProvince(String province) {
this.province = province;
public void setCountry(String country) {
this.country = country;
}
public String getCity() {
......@@ -92,52 +78,44 @@ public class ResultWarehouseVo {
this.city = city;
}
public String getDistrict() {
return district;
public String getRegions() {
return regions;
}
public void setDistrict(String district) {
this.district = district;
public void setRegions(String regions) {
this.regions = regions;
}
public String getAddress() {
return address;
public String getAddressDetail() {
return addressDetail;
}
public void setAddress(String address) {
this.address = address;
public void setAddressDetail(String addressDetail) {
this.addressDetail = addressDetail;
}
public String getRegionCN() {
return regionCN;
public String getRegionName() {
return regionName;
}
public void setRegionCN(String regionCN) {
this.regionCN = regionCN;
public void setRegionName(String regionName) {
this.regionName = regionName;
}
public String getRegionEN() {
return regionEN;
public String getLng() {
return lng;
}
public void setRegionEN(String regionEN) {
this.regionEN = regionEN;
public void setLng(String lng) {
this.lng = lng;
}
public String getLongitude() {
return longitude;
public String getLat() {
return lat;
}
public void setLongitude(String longitude) {
this.longitude = longitude;
}
public String getLatitude() {
return latitude;
}
public void setLatitude(String latitude) {
this.latitude = latitude;
public void setLat(String lat) {
this.lat = lat;
}
public String getProperty() {
......@@ -164,14 +142,6 @@ public class ResultWarehouseVo {
this.alarmType = alarmType;
}
public String getAlarmScene() {
return alarmScene;
}
public void setAlarmScene(String alarmScene) {
this.alarmScene = alarmScene;
}
public String getHardwareLevel() {
return hardwareLevel;
}
......@@ -228,14 +198,6 @@ public class ResultWarehouseVo {
this.timeZone = timeZone;
}
public String getWeatherInfo() {
return weatherInfo;
}
public void setWeatherInfo(String weatherInfo) {
this.weatherInfo = weatherInfo;
}
public String getWarehouseInfo() {
return warehouseInfo;
}
......@@ -244,6 +206,14 @@ public class ResultWarehouseVo {
this.warehouseInfo = warehouseInfo;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public String getRemark() {
return remark;
}
......
package com.example.tdl.domain.vo;
public class SearchLocationVo {
private String transportationNo;
private String type;
public String getTransportationNo() {
return transportationNo;
}
public void setTransportationNo(String transportationNo) {
this.transportationNo = transportationNo;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}
......@@ -7,21 +7,15 @@ public class UpdateWarehouseVo {
private String country;
private String province;
private String city;
private String district;
private String address;
private String regionCN;//区域中文
private String addressDetail;
private String regionEN;//区域英文
private String lng;
private String longitude;//经度
private String lat;
private String latitude;//纬度
private String regionName;
private String property;//属性
......@@ -43,8 +37,6 @@ public class UpdateWarehouseVo {
private Integer timeZone;//时区
private String weatherInfo;//区域气象信息
private String warehouseInfo;//基础描述
private Long updateTime;
......@@ -75,14 +67,6 @@ public class UpdateWarehouseVo {
this.country = country;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getCity() {
return city;
}
......@@ -91,52 +75,36 @@ public class UpdateWarehouseVo {
this.city = city;
}
public String getDistrict() {
return district;
}
public void setDistrict(String district) {
this.district = district;
public String getAddressDetail() {
return addressDetail;
}
public String getAddress() {
return address;
public void setAddressDetail(String addressDetail) {
this.addressDetail = addressDetail;
}
public void setAddress(String address) {
this.address = address;
public String getLng() {
return lng;
}
public String getRegionCN() {
return regionCN;
public void setLng(String lng) {
this.lng = lng;
}
public void setRegionCN(String regionCN) {
this.regionCN = regionCN;
public String getLat() {
return lat;
}
public String getRegionEN() {
return regionEN;
public void setLat(String lat) {
this.lat = lat;
}
public void setRegionEN(String regionEN) {
this.regionEN = regionEN;
public String getRegionName() {
return regionName;
}
public String getLongitude() {
return longitude;
}
public void setLongitude(String longitude) {
this.longitude = longitude;
}
public String getLatitude() {
return latitude;
}
public void setLatitude(String latitude) {
this.latitude = latitude;
public void setRegionName(String regionName) {
this.regionName = regionName;
}
public String getProperty() {
......@@ -219,14 +187,6 @@ public class UpdateWarehouseVo {
this.timeZone = timeZone;
}
public String getWeatherInfo() {
return weatherInfo;
}
public void setWeatherInfo(String weatherInfo) {
this.weatherInfo = weatherInfo;
}
public String getWarehouseInfo() {
return warehouseInfo;
}
......
package com.example.tdl.domain.vo;
public class WareHouseByTermVo {
private String warehouseName;
private String country;
private String city;
private String alarm;
private String companyName;
public String getWarehouseName() {
return warehouseName;
}
public void setWarehouseName(String warehouseName) {
this.warehouseName = warehouseName;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getAlarm() {
return alarm;
}
public void setAlarm(String alarm) {
this.alarm = alarm;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
}
......@@ -5,8 +5,6 @@ public class WarehouseTermVo {
private String country;
private String province;
private String city;
private String property;
......@@ -15,6 +13,8 @@ public class WarehouseTermVo {
private String hardwareLevel;
private String companyName;
public String getWarehouseName() {
return warehouseName;
}
......@@ -31,14 +31,6 @@ public class WarehouseTermVo {
this.country = country;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getCity() {
return city;
}
......@@ -70,4 +62,12 @@ public class WarehouseTermVo {
public void setHardwareLevel(String hardwareLevel) {
this.hardwareLevel = hardwareLevel;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
}
package com.example.tdl.domain.vo;
import java.util.List;
public class WarehouseUserVo {
private String warehouseNo;
private List<String> userNameList;
public String getWarehouseNo() {
return warehouseNo;
}
public void setWarehouseNo(String warehouseNo) {
this.warehouseNo = warehouseNo;
}
public List<String> getUserNameList() {
return userNameList;
}
public void setUserNameList(List<String> userNameList) {
this.userNameList = userNameList;
}
}
package com.example.tdl.entity;
import java.io.Serializable;
public class Company implements Serializable {
private Serializable serializable = 1L;
private Integer id;
private String companyNo;
private String companyName;
private String country;
private String city;
private String addressDetail;
private String tel;
private String manager;
private Integer state;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getCompanyNo() {
return companyNo;
}
public void setCompanyNo(String companyNo) {
this.companyNo = companyNo;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getAddressDetail() {
return addressDetail;
}
public void setAddressDetail(String addressDetail) {
this.addressDetail = addressDetail;
}
public String getTel() {
return tel;
}
public void setTel(String tel) {
this.tel = tel;
}
public String getManager() {
return manager;
}
public void setManager(String manager) {
this.manager = manager;
}
public Integer getState() {
return state;
}
public void setState(Integer state) {
this.state = state;
}
}
......@@ -16,23 +16,15 @@ public class Warehouse implements Serializable {
private String warehouseNo;//仓库编号
private String country;
private City city;
private String province;
private String addressDetail;
private String city;
private String lng;
private String district;
private String lat;
private String address;
private String regionCN;//区域中文
private String regionEN;//区域英文
private String longitude;//经度
private String latitude;//纬度
private String regionName;
private String property;//属性
......@@ -54,47 +46,16 @@ public class Warehouse implements Serializable {
private Integer timeZone;//时区
private String weatherInfo;//区域气象信息
private String warehouseInfo;//基础描述
private Company company;
private Long createTime;
private Long updateTime;
private String remark;
public Warehouse() {
}
public Warehouse( String warehouseName, String warehouseNo, String country, String province, String city, String district, String address, String regionCN, String regionEN, String longitude, String latitude, String property, String type, String alarmType, String hardwareLevel, Double areaIndoor, Double areaRack, Double areaOutdoor, Double areaPlanIndoor, String office, Integer timeZone, String weatherInfo, String warehouseInfo, Long createTime, Long updateTime, String remark) {
this.warehouseName = warehouseName;
this.warehouseNo = warehouseNo;
this.country = country;
this.province = province;
this.city = city;
this.district = district;
this.address = address;
this.regionCN = regionCN;
this.regionEN = regionEN;
this.longitude = longitude;
this.latitude = latitude;
this.property = property;
this.type = type;
this.alarmType = alarmType;
this.hardwareLevel = hardwareLevel;
this.areaIndoor = areaIndoor;
this.areaRack = areaRack;
this.areaOutdoor = areaOutdoor;
this.areaPlanIndoor = areaPlanIndoor;
this.office = office;
this.timeZone = timeZone;
this.weatherInfo = weatherInfo;
this.warehouseInfo = warehouseInfo;
this.createTime = createTime;
this.updateTime = updateTime;
this.remark = remark;
}
public Integer getId() {
return id;
......@@ -120,76 +81,44 @@ public class Warehouse implements Serializable {
this.warehouseNo = warehouseNo;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getCity() {
public City getCity() {
return city;
}
public void setCity(String city) {
public void setCity(City city) {
this.city = city;
}
public String getDistrict() {
return district;
}
public void setDistrict(String district) {
this.district = district;
}
public String getAddress() {
return address;
public String getAddressDetail() {
return addressDetail;
}
public void setAddress(String address) {
this.address = address;
public void setAddressDetail(String addressDetail) {
this.addressDetail = addressDetail;
}
public String getRegionCN() {
return regionCN;
public String getLng() {
return lng;
}
public void setRegionCN(String regionCN) {
this.regionCN = regionCN;
public void setLng(String lng) {
this.lng = lng;
}
public String getRegionEN() {
return regionEN;
public String getLat() {
return lat;
}
public void setRegionEN(String regionEN) {
this.regionEN = regionEN;
public void setLat(String lat) {
this.lat = lat;
}
public String getLongitude() {
return longitude;
public String getRegionName() {
return regionName;
}
public void setLongitude(String longitude) {
this.longitude = longitude;
}
public String getLatitude() {
return latitude;
}
public void setLatitude(String latitude) {
this.latitude = latitude;
public void setRegionName(String regionName) {
this.regionName = regionName;
}
public String getProperty() {
......@@ -272,14 +201,6 @@ public class Warehouse implements Serializable {
this.timeZone = timeZone;
}
public String getWeatherInfo() {
return weatherInfo;
}
public void setWeatherInfo(String weatherInfo) {
this.weatherInfo = weatherInfo;
}
public String getWarehouseInfo() {
return warehouseInfo;
}
......@@ -288,6 +209,14 @@ public class Warehouse implements Serializable {
this.warehouseInfo = warehouseInfo;
}
public Company getCompany() {
return company;
}
public void setCompany(Company company) {
this.company = company;
}
public Long getCreateTime() {
return createTime;
}
......
package com.example.tdl.mapper;
import com.example.tdl.domain.vo.AddAlarmVo;
import com.example.tdl.domain.vo.DelAlarmVo;
import com.example.tdl.domain.vo.ResultAlarmVo;
import com.example.tdl.domain.vo.UpdateAlarmVo;
import com.example.tdl.domain.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -24,7 +21,7 @@ public interface AlarmMapper {
ResultAlarmVo getByTypeAndScene(@Param("alarmType") String alarmType,@Param("alarmScene") String alarmScene,@Param("companyName") String companyName);
List<String> getForWarehouse(String companyName);
List<AlarmTypeVo> getForWarehouse(String companyName);
List<String> getForTransportation(String companyName);
List<AlarmTypeVo> getForTransportation(String companyName);
}
package com.example.tdl.mapper;
import com.example.tdl.domain.vo.DelAlarmVo;
import com.example.tdl.domain.vo.ResultGatewayVo;
import com.example.tdl.domain.vo.TDLLogVo;
import org.apache.ibatis.annotations.Mapper;
......@@ -17,4 +18,6 @@ public interface TDLLogMapper {
String getSN(String transportationNo);
List<String> getByAlarm(DelAlarmVo delAlarmVo);
}
package com.example.tdl.mapper;
import com.example.tdl.domain.vo.DelAlarmVo;
import com.example.tdl.domain.vo.ResultWarehouseVo;
import com.example.tdl.domain.vo.UpdateWarehouseVo;
import com.example.tdl.domain.vo.WarehouseTermVo;
import com.example.tdl.domain.vo.*;
import com.example.tdl.entity.Warehouse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.PostMapping;
import java.util.List;
import java.util.Map;
@Mapper
public interface WarehouseMapper {
List<ResultWarehouseVo> getAll();
List<ResultWarehouseVo> getAll(String companyName);
List<ResultWarehouseVo> getAllByTerm(WarehouseTermVo warehouseTermVo);
int addWarehouse(Warehouse warehouse);
List<String> getByWarehouse(WareHouseByTermVo wareHouseByTermVo);
int updateWarehouse(UpdateWarehouseVo updateWarehouseVo);
Integer getWarehouseNo(String warehouseNo);
int delWarehouse(String warehouseNo);
Integer getByWarehouseNoAndSN(@Param("warehouseNo") String warehouseNo,@Param("SN") String SN);
ResultWarehouseVo getByWarehouseName(String warehouseName);
int addWarehouse(Map<Object,Object> map);
int updateWarehouse(Map<Object,Object> map);
int delWarehouse(Map<Object,Object> map);
int addGateway(Map<Object,Object> map);
int untieGateway(Map<Object,Object> map);
int addUser(Map<Object,Object> map);
ResultWarehouseVo getByWarehouseName(@Param("warehouseName") String warehouseName, @Param("companyName") String companyName);
List<ResultWarehouseVo> getByAlarm(DelAlarmVo delAlarmVo);
List<GatewaySNVo> getGateway(String warehouseNo);
}
package com.example.tdl.service;
import com.example.tdl.domain.vo.AddAlarmVo;
import com.example.tdl.domain.vo.DelAlarmVo;
import com.example.tdl.domain.vo.ResultAlarmVo;
import com.example.tdl.domain.vo.UpdateAlarmVo;
import com.example.tdl.domain.vo.*;
import com.example.tdl.mapper.AlarmMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -41,11 +38,11 @@ public class AlarmService {
return alarmMapper.getByTypeAndScene(alarmType,alarmScene,companyName);
}
public List<String> getForWarehouse(String companyName){
public List<AlarmTypeVo> getForWarehouse(String companyName){
return alarmMapper.getForWarehouse(companyName);
}
public List<String> getForTransportation(String companyName){
public List<AlarmTypeVo> getForTransportation(String companyName){
return alarmMapper.getForTransportation(companyName);
}
......
package com.example.tdl.service;
import com.example.tdl.domain.vo.DelAlarmVo;
import com.example.tdl.domain.vo.ResultGatewayVo;
import com.example.tdl.domain.vo.TDLLogVo;
import com.example.tdl.mapper.TDLLogMapper;
......@@ -31,4 +32,8 @@ public class TDLLogService {
return tdlLogMapper.getSN(transportationNo);
}
public List<String> getByAlarm(DelAlarmVo delAlarmVo){
return tdlLogMapper.getByAlarm(delAlarmVo);
}
}
package com.example.tdl.service;
import com.example.tdl.domain.vo.DelAlarmVo;
import com.example.tdl.domain.vo.ResultWarehouseVo;
import com.example.tdl.domain.vo.UpdateWarehouseVo;
import com.example.tdl.domain.vo.WarehouseTermVo;
import com.example.tdl.domain.vo.*;
import com.example.tdl.entity.Warehouse;
import com.example.tdl.mapper.WarehouseMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
@Service
public class WarehouseService {
@Autowired
private WarehouseMapper warehouseMapper;
public List<ResultWarehouseVo> getAll(){
return warehouseMapper.getAll();
public List<ResultWarehouseVo> getAll(String companyName){
return warehouseMapper.getAll(companyName);
}
public List<ResultWarehouseVo> getAllByTerm(WarehouseTermVo warehouseTermVo){
return warehouseMapper.getAllByTerm(warehouseTermVo);
}
public int addWarehouse(Warehouse warehouse){
return warehouseMapper.addWarehouse(warehouse);
public List<String> getByWarehouse(WareHouseByTermVo wareHouseByTermVo){
return warehouseMapper.getByWarehouse(wareHouseByTermVo);
}
public int updateWarehouse(UpdateWarehouseVo updateWarehouseVo){
return warehouseMapper.updateWarehouse(updateWarehouseVo);
public Integer getWarehouseNo(String warehouseNo){
return warehouseMapper.getWarehouseNo(warehouseNo);
}
public int delWarehouse(String warehouseNo){
return warehouseMapper.delWarehouse(warehouseNo);
public Integer getByWarehouseNoAndSN(String warehouseNo,String SN){
return warehouseMapper.getByWarehouseNoAndSN(warehouseNo,SN);
}
public ResultWarehouseVo getByWarehouseName(String warehouseName){
return warehouseMapper.getByWarehouseName(warehouseName);
public int addWarehouse(Map<Object,Object> map){
return warehouseMapper.addWarehouse(map);
}
public int updateWarehouse(Map<Object,Object> map){
return warehouseMapper.updateWarehouse(map);
}
public int delWarehouse(Map<Object,Object> map){
return warehouseMapper.delWarehouse(map);
}
public int addGateway(Map<Object,Object> map){
return warehouseMapper.addGateway(map);
}
public int untieGateway(Map<Object,Object> map){
return warehouseMapper.untieGateway(map);
}
public int addUser(Map<Object,Object> map){
return warehouseMapper.addUser(map);
}
public ResultWarehouseVo getByWarehouseName(String warehouseName,String companyName){
return warehouseMapper.getByWarehouseName(warehouseName,companyName);
}
public List<ResultWarehouseVo> getByAlarm(DelAlarmVo delAlarmVo){
return warehouseMapper.getByAlarm(delAlarmVo);
}
public List<GatewaySNVo> getGateway(String warehouseNo){
return warehouseMapper.getGateway(warehouseNo);
}
}
......@@ -6,6 +6,7 @@ import com.example.tdl.domain.dto.CommFeedback;
import com.example.tdl.domain.vo.*;
import com.example.tdl.service.AlarmService;
import com.example.tdl.service.TDLLogService;
import com.example.tdl.service.WarehouseService;
import com.example.tdl.service.redis.TokenRedisService;
import com.google.gson.Gson;
......@@ -42,6 +43,9 @@ public class AlarmController {
@Autowired
private TokenRedisService tokenRedisService;
@Autowired
private TDLLogService tdlLogService;
@Autowired
private I18nController i18n;
......@@ -139,6 +143,11 @@ public class AlarmController {
fb.setMessage(i18n.getMessage(request,"temMin"));
return gson.toJson(fb);
}
if(addAlarmVo.getTemMin() >addAlarmVo.getTemMax()){
fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"wrongTemp"));
return gson.toJson(fb);
}
if (addAlarmVo.getHumidityMax()==null){
fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"humidityMax"));
......@@ -149,6 +158,11 @@ public class AlarmController {
fb.setMessage(i18n.getMessage(request,"humidityMin"));
return gson.toJson(fb);
}
if(addAlarmVo.getHumidityMin() >addAlarmVo.getHumidityMax()){
fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"wrongHumidity"));
return gson.toJson(fb);
}
if (addAlarmVo.getTilt()==null){
fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"tilt"));
......@@ -201,13 +215,6 @@ public class AlarmController {
String port = request.getHeader("AccountLanguage");
if (StringUtils.isEmpty(updateAlarmVo.getOldAlarmType())){
fb.setCode(0);
if(!StringUtils.isEmpty(port) &&port.equals("en")){
fb.setMessage("The type of early warning that needs to be modified can not be empty");
}else if(!StringUtils.isEmpty(port) && port .equals("jp")){
fb.setMessage("アラームタイプを入力してください。");
}else{
fb.setMessage("需要修改的预警类型不能为空");
}
fb.setMessage(i18n.getMessage(request,"modifiedAlarmType"));
return gson.toJson(fb);
}
......@@ -246,6 +253,11 @@ public class AlarmController {
fb.setMessage(i18n.getMessage(request,"temMin"));
return gson.toJson(fb);
}
if(updateAlarmVo.getTemMin() >updateAlarmVo.getTemMax()){
fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"wrongTemp"));
return gson.toJson(fb);
}
if (updateAlarmVo.getHumidityMax()==null){
fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"humidityMax"));
......@@ -256,6 +268,11 @@ public class AlarmController {
fb.setMessage(i18n.getMessage(request,"humidityMin"));
return gson.toJson(fb);
}
if(updateAlarmVo.getHumidityMin()>updateAlarmVo.getHumidityMax()){
fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"wrongHumidity"));
return gson.toJson(fb);
}
if (updateAlarmVo.getTilt()==null){
fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"tilt"));
......@@ -275,7 +292,6 @@ public class AlarmController {
int a=alarmService.updateAlarm(updateAlarmVo);
if (a>0){
fb.setCode(1);
fb.setMessage("修改预警信息成功");
fb.setMessage(i18n.getMessage(request,"modifiedSuccess"));
}else{
fb.setCode(0);
......@@ -310,11 +326,19 @@ public class AlarmController {
return gson.toJson(fb);
}
delAlarmVo.setCompanyName(user.getCompanyName());
if("运输".equals(delAlarmVo.getAlarmScene())){
if(tdlLogService.getByAlarm(delAlarmVo).size()>0){
fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"dusedAlarm"));
return gson.toJson(fb);
}
}else{
if (warehouseService.getByAlarm(delAlarmVo).size()>0){
fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"dusedAlarm"));
return gson.toJson(fb);
}
}
int a=alarmService.delAlarm(delAlarmVo);
if (a>0){
fb.setCode(1);
......@@ -338,6 +362,7 @@ public class AlarmController {
String datum = tokenRedisService.get("TOKEN_" +token);
UserRedisVo user = gson.fromJson(datum,UserRedisVo.class);
return alarmService.getForWarehouse(user.getCompanyName());
}
......
......@@ -636,16 +636,16 @@ public class CircuitController {
return gson.toJson(fb);
}
Long time = System.currentTimeMillis();
String countryVar=addCircuitVo.getStartAddressVo().getCountry()+" ";
String cityVar=addCircuitVo.getStartAddressVo().getCity()+ " ";
String addressDetailVar=addCircuitVo.getStartAddressVo().getAddressDetail() +" ";
String lngVar=addCircuitVo.getStartAddressVo().getLng()+" ";
String latVar = addCircuitVo.getStartAddressVo().getLat()+" ";
String postCodeVar = addCircuitVo.getStartAddressVo().getPostCode()+" ";
String expTimeVar = addCircuitVo.getStartAddressVo().getExpTime()+" ";
String compTimeVar = "0 ";
String arrivalTimeVar=time +" ";
String startTimeVar=0 +" ";
String countryVar=addCircuitVo.getStartAddressVo().getCountry()+"&";
String cityVar=addCircuitVo.getStartAddressVo().getCity()+ "&";
String addressDetailVar=addCircuitVo.getStartAddressVo().getAddressDetail() +"&";
String lngVar=addCircuitVo.getStartAddressVo().getLng()+"&";
String latVar = addCircuitVo.getStartAddressVo().getLat()+"&";
String postCodeVar = addCircuitVo.getStartAddressVo().getPostCode()+"&";
String expTimeVar = addCircuitVo.getStartAddressVo().getExpTime()+"&";
String compTimeVar = "0&";
String arrivalTimeVar=time +"&";
String startTimeVar=0 +"&";
if(addCircuitVo.getAddressVoList() != null){
if(addCircuitVo.getAddressVoList().size()>3){
fb.setCode(0);
......@@ -715,16 +715,16 @@ public class CircuitController {
return gson.toJson(fb);
}
}
countryVar=countryVar +addCircuitVo.getAddressVoList().get(i).getCountry() +" ";
cityVar=cityVar +addCircuitVo.getAddressVoList().get(i).getCity() +" ";
addressDetailVar =addressDetailVar +addCircuitVo.getAddressVoList().get(i).getAddressDetail() +" ";
lngVar = lngVar + addCircuitVo.getAddressVoList().get(i).getLng() +" ";
latVar = latVar + addCircuitVo.getAddressVoList().get(i).getLat() +" ";
postCodeVar=postCodeVar + addCircuitVo.getAddressVoList().get(i).getPostCode() +" ";
expTimeVar = expTimeVar +addCircuitVo.getAddressVoList().get(i).getExpTime() +" ";
compTimeVar = compTimeVar +addCircuitVo.getAddressVoList().get(i).getCompTime() +" ";
startTimeVar =startTimeVar + "0 ";
arrivalTimeVar = arrivalTimeVar +"0 ";
countryVar=countryVar +addCircuitVo.getAddressVoList().get(i).getCountry() +"&";
cityVar=cityVar +addCircuitVo.getAddressVoList().get(i).getCity() +"&";
addressDetailVar =addressDetailVar +addCircuitVo.getAddressVoList().get(i).getAddressDetail() +"&";
lngVar = lngVar + addCircuitVo.getAddressVoList().get(i).getLng() +"&";
latVar = latVar + addCircuitVo.getAddressVoList().get(i).getLat() +"&";
postCodeVar=postCodeVar + addCircuitVo.getAddressVoList().get(i).getPostCode() +"&";
expTimeVar = expTimeVar +addCircuitVo.getAddressVoList().get(i).getExpTime() +"&";
compTimeVar = compTimeVar +addCircuitVo.getAddressVoList().get(i).getCompTime() +"&";
startTimeVar =startTimeVar + "0&";
arrivalTimeVar = arrivalTimeVar +"0&";
}
}
if(StringUtils.isEmpty(addCircuitVo.getEndAddressVo().getCountry())){
......@@ -782,16 +782,16 @@ public class CircuitController {
fb.setMessage(i18n.getMessage(request,"gateway"));
return gson.toJson(fb);
}
countryVar=countryVar +addCircuitVo.getEndAddressVo().getCountry() +" ";
cityVar=cityVar +addCircuitVo.getEndAddressVo().getCity() +" ";
addressDetailVar =addressDetailVar +addCircuitVo.getEndAddressVo().getAddressDetail() +" ";
lngVar = lngVar + addCircuitVo.getEndAddressVo().getLng() +" ";
latVar = latVar + addCircuitVo.getEndAddressVo().getLat() +" ";
postCodeVar=postCodeVar + addCircuitVo.getEndAddressVo().getPostCode() +" ";
expTimeVar = expTimeVar +"0 ";
compTimeVar = compTimeVar +addCircuitVo.getEndAddressVo().getCompTime() +" ";
startTimeVar =startTimeVar + "0 ";
arrivalTimeVar = arrivalTimeVar +"0 ";
countryVar=countryVar +addCircuitVo.getEndAddressVo().getCountry() +"&";
cityVar=cityVar +addCircuitVo.getEndAddressVo().getCity() +"&";
addressDetailVar =addressDetailVar +addCircuitVo.getEndAddressVo().getAddressDetail() +"&";
lngVar = lngVar + addCircuitVo.getEndAddressVo().getLng() +"&";
latVar = latVar + addCircuitVo.getEndAddressVo().getLat() +"&";
postCodeVar=postCodeVar + addCircuitVo.getEndAddressVo().getPostCode() +"&";
expTimeVar = expTimeVar +"0&";
compTimeVar = compTimeVar +addCircuitVo.getEndAddressVo().getCompTime() +"&";
startTimeVar =startTimeVar + "0&";
arrivalTimeVar = arrivalTimeVar +"0&";
String type =gatewayService.getBySN(addCircuitVo.getSN());
//判断当前gateWay是否存在
if(StringUtils.isEmpty(type)){
......@@ -834,14 +834,13 @@ public class CircuitController {
fb.setMessage(i18n.getMessage(request,args,"tdlUsed"));
return gson.toJson(fb);
}
if(StringUtils.isEmpty(addCircuitVo.getTdlAlarmList().get(j).getAlarmType())){
fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"alarmType"));
return gson.toJson(fb);
}
alarmTypeVar =alarmTypeVar + addCircuitVo.getTdlAlarmList().get(j).getAlarmType() +" ";
TDLSNVar =TDLSNVar + addCircuitVo.getTdlAlarmList().get(j).getTDLSN() +" ";
alarmTypeVar =alarmTypeVar + addCircuitVo.getTdlAlarmList().get(j).getAlarmType() +"&";
TDLSNVar =TDLSNVar + addCircuitVo.getTdlAlarmList().get(j).getTDLSN() +"&";
devList.add("TDL-"+addCircuitVo.getTdlAlarmList().get(j).getTDLSN());
saveAlarmRule("TDL/"+type+"/" +addCircuitVo.getSN()+"/Data",addCircuitVo.getTdlAlarmList().get(j).getTDLSN(),addCircuitVo.getTdlAlarmList().get(j).getAlarmType(),request);
}
......@@ -1333,13 +1332,13 @@ public class CircuitController {
fb.setMessage(i18n.getMessage(request,"noCircuit"));
return gson.toJson(fb);
}
if (resultCircuitVo.getCircuitState()!=0){
if (resultCircuitVo.getCircuitState()==1){
fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"inTransit"));
return gson.toJson(fb);
}
TDLLogVo tdlLogVo = tdlLogService.getByTransportationNo(transportationNo);
if(tdlLogVo != null){
if(tdlLogVo != null && resultCircuitVo.getCircuitState() == 0){
List<String> dev = tdlLogService.getTdlSN(transportationNo);
if(dev == null){
fb.setCode(0);
......
......@@ -89,14 +89,17 @@ public class DataController {
@ApiImplicitParam(paramType="header", name = "Account_token", value = "token", required = true, dataType = "String"),
@ApiImplicitParam(paramType="header", name = "AccountLanguage", value = "language", required = false, dataType = "String"),
})
public Object getLocation(@RequestBody String transportationNo,HttpServletRequest request){
public Object getLocation(@RequestBody SearchLocationVo searchLocationVo,HttpServletRequest request){
String token = request.getHeader("Account_token");
String datum = tokenRedisService.get("TOKEN_" +token);
UserRedisVo user = gson.fromJson(datum,UserRedisVo.class);
JSONObject jsonObject= JSON.parseObject(transportationNo);
transportationNo=jsonObject.getString("transportationNo");
if(StringUtils.isEmpty(searchLocationVo.getTransportationNo())){
fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"transportationNo"));
return gson.toJson(fb);
}
//根据运输编号获取线路信息
ResultCircuitVo resultCircuitVo = circuitService.getByTransportationNo(transportationNo,user.getCompanyName());
ResultCircuitVo resultCircuitVo = circuitService.getByTransportationNo(searchLocationVo.getTransportationNo(),user.getCompanyName());
List<LocationDataVo> locationDataVoList =new ArrayList<>();
if(resultCircuitVo == null){
return gson.toJson(locationDataVoList);
......@@ -105,12 +108,12 @@ public class DataController {
return gson.toJson(locationDataVoList);
}
Long startTime = resultCircuitVo.getStartTime() *1000000l;
if(resultCircuitVo.getEndTime() !=null && infoRedisService.hasHashKey("TransportConfig",transportationNo)){
Object ret = infoRedisService.getHash("TransportConfig",transportationNo);
if(resultCircuitVo.getEndTime() !=null && infoRedisService.hasHashKey("TransportConfig",searchLocationVo.getTransportationNo())){
Object ret = infoRedisService.getHash("TransportConfig",searchLocationVo.getTransportationNo());
return ret;
}
//获取gateway的信息
TDLLogVo tdlLogVo = tdlLogService.getByTransportationNo(transportationNo);
TDLLogVo tdlLogVo = tdlLogService.getByTransportationNo(searchLocationVo.getTransportationNo());
if(tdlLogVo==null){
return gson.toJson(locationDataVoList);
}
......@@ -118,9 +121,21 @@ public class DataController {
String sql ="";
if(resultCircuitVo.getEndTime() != null && resultCircuitVo.getEndTime() != 0){
Long time = resultCircuitVo.getEndTime()*1000000l;
if("baidu".equals(searchLocationVo.getType())){
sql = "SELECT \"bdlng\",\"bdlat\" FROM \"tdl_policy\".\""+device+"\"where time >= "+startTime +" and time<= "+time+" ORDER BY time ";
}else{
sql = "SELECT \"lng\",\"lat\" FROM \"tdl_policy\".\""+device+"\"where time >= "+startTime +" and time<= "+time+" ORDER BY time ";
}
}else{
sql = "SELECT \"lng\",\"lat\" FROM \"tdl_policy\".\""+device+"\"where time >= "+startTime +" ORDER BY time ";
if("baidu".equals(searchLocationVo.getType())){
sql = "SELECT \"bdlng\",\"bdlat\" FROM \"tdl_policy\".\"" + device + "\"where time >= " + startTime + " ORDER BY time ";
}else {
sql = "SELECT \"lng\",\"lat\" FROM \"tdl_policy\".\"" + device + "\"where time >= " + startTime + " ORDER BY time ";
}
}
//获取tdl信息
QueryResult queryResult = influxDBTemplate.query(new Query(sql,database));
......@@ -149,8 +164,12 @@ public class DataController {
String sql3 ="";
for(String time : timeList){
Long t = Long.valueOf(time) *1000000l;
if("baidu".equals(searchLocationVo.getType())){
sql3 = "SELECT \"bdlng\",\"bdlat\" FROM \"tdl_policy\".\""+device+"\" where time >= "+startTime +" and time<="+ t +" ORDER BY time desc limit 1;" +sql3;
}else{
sql3 = "SELECT \"lng\",\"lat\" FROM \"tdl_policy\".\""+device+"\" where time >= "+startTime +" and time<="+ t +" ORDER BY time desc limit 1;" +sql3;
}
}
QueryResult queryResult3 = influxDBTemplate.query(new Query(sql3,database));
List<String> time= new ArrayList<>();
if(queryResult3.getResults() !=null){
......@@ -168,7 +187,7 @@ public class DataController {
//如果是已经完结保存到redis中
if(resultCircuitVo.getEndTime() != null && resultCircuitVo.getEndTime() != 0){
Map<Object,Object> map=new HashMap<>();
map.put(transportationNo,locationDataVoList.toString());
map.put(searchLocationVo.getTransportationNo(),locationDataVoList.toString());
infoRedisService.setHash("TransportConfig",map,System.currentTimeMillis());
}
return gson.toJson(locationDataVoList);
......@@ -176,7 +195,7 @@ public class DataController {
//如果是已经完结保存到redis中
if (resultCircuitVo.getEndTime() != null && resultCircuitVo.getEndTime() != 0) {
Map<Object, Object> map = new HashMap<>();
map.put(transportationNo, locationDataVos.toString());
map.put(searchLocationVo.getTransportationNo(), locationDataVos.toString());
infoRedisService.setHash("TransportConfig", map,System.currentTimeMillis());
}
return gson.toJson(locationDataVos);
......
......@@ -5,10 +5,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.example.tdl.domain.dto.CommFeedback;
import com.example.tdl.domain.vo.*;
import com.example.tdl.service.AlarmService;
import com.example.tdl.service.ConfigService;
import com.example.tdl.service.GatewayService;
import com.example.tdl.service.TDLDeviceService;
import com.example.tdl.service.*;
import com.example.tdl.service.redis.AlarmRedisService;
import com.example.tdl.service.redis.TokenRedisService;
import com.google.gson.Gson;
......@@ -57,6 +54,9 @@ public class EquipmentBindingController {
@Autowired
private TokenRedisService tokenRedisService;
@Autowired
private WarehouseService warehouseService;
@Autowired
private I18nController i18n;
......@@ -234,14 +234,63 @@ public class EquipmentBindingController {
msg.put("msg",map.get("msg"));
if (msg.get("msg").equals("解除网关成功")){
fb.setCode(1);
fb.setMessage("解除网关成功");
fb.setMessage("解除tdl成功");
String key ="TDL/"+resultTDLDeviceVo.getGatewayType()+"/" +resultTDLDeviceVo.getGatewaySN() +"/Data";
alarmRedisService.delKey(key);
}else{
fb.setCode(0);
fb.setMessage("解除tdl失败");
}
return gson.toJson(fb);
}
fb.setMessage("解除网关失败");
@ApiOperation(value = "解绑网关",notes = "解绑网关")
@ApiImplicitParams({
@ApiImplicitParam(paramType="header", name = "Account_token", value = "token", required = true, dataType = "String"),
})
@PostMapping("/untieGateway")
public Object untieGateway(@RequestBody AddWarehouseGatewayVo addWarehouseGatewayVo,HttpServletRequest request){
if(StringUtils.isEmpty(addWarehouseGatewayVo.getWarehouseNo())){
fb.setCode(0);
fb.setMessage("仓库编号不能为空");
return gson.toJson(fb);
}
if(warehouseService.getWarehouseNo(addWarehouseGatewayVo.getWarehouseNo()) ==0){
fb.setCode(0);
fb.setMessage("仓库编号不存在");
return gson.toJson(fb);
}
if (StringUtils.isEmpty(addWarehouseGatewayVo.getSN())){
fb.setCode(0);
fb.setMessage("网关编号不能为空");
return gson.toJson(fb);
}
if( gatewayService.getBySN(addWarehouseGatewayVo.getSN())==null){
fb.setCode(0);
fb.setMessage("该网关不存在");
return gson.toJson(fb);
}
//判断该网关是否属于当前仓库
Integer i = warehouseService.getByWarehouseNoAndSN(addWarehouseGatewayVo.getWarehouseNo(),addWarehouseGatewayVo.getSN());
if(i == 0){
fb.setCode(0);
fb.setMessage("该网关不属于该仓库");
return gson.toJson(fb);
}
Map<Object,Object> map=new HashMap<>();
map.put("warehouseNo",addWarehouseGatewayVo.getWarehouseNo());
map.put("gSN",addWarehouseGatewayVo.getSN());
map.put("gType","WTD93LG");
warehouseService.untieGateway(map);
Map<Object,Object> msg=new HashMap<>();
msg.put("msg",map.get("msg"));
if(msg.get("msg").equals("删除网关成功")){
fb.setCode(1);
fb.setMessage(msg.get("msg").toString());
}else{
fb.setCode(0);
fb.setMessage(msg.get("msg").toString());
}
return gson.toJson(fb);
}
......
......@@ -64,7 +64,7 @@ completedCircuit=The line can be evaluated when the transportation has been comp
evaluateSuccess=Evaluation is successful
evaluateFailure=Evaluation failed
circuitState=The transport number cannot be empty
inTransit=The line is in transit or has been shipped
inTransit=The line is in transit and can not be deleted
bindTDL=The line is not bound to tdl
bindGateway=The line is not bound to the gateway
circuitDeleteSuccess=You have deleted the line successfully
......@@ -160,3 +160,5 @@ illegal=IllegalArgumentException
sql=SQLException
badSql=BadSqlGrammarException
error=The server code has been exceptions, please contact the administrator
wrongTemp=The upper limit of temperature should not be less than the limit of temperature
wrongHumidity=The lower humidity limit is not greater than the upper limit of humidity
\ No newline at end of file
......@@ -159,3 +159,5 @@ illegal=\u30D1\u30E9\u30E1\u30FC\u30BF\u30BF\u30A4\u30D7\u306E\u4E0D\u4E00\u81F4
sql=\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u30A2\u30AF\u30BB\u30B9\u7570\u5E38
badSql=\u30C7\u30FC\u30BF\u306E\u7570\u5E38
error=\u30B5\u30FC\u30D0\u30FC\u30B3\u30FC\u30C9\u304C\u7570\u5E38\u306B\u767A\u751F\u3057\u305F\u5834\u5408\u3001\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3057\u3066\u304F\u3060\u3055\u3044
wrongTemp=\u6E29\u5EA6\u4E0B\u9650\u3088\u308A\u306A\u3044\u6E29\u5EA6\u306E\u4E0A\u9650
wrongHumidity=\u6E7F\u5EA6\u306E\u4E0A\u9650\u306F\u6E7F\u5EA6\u306E\u4E0B\u9650\u3088\u308A\u5C0F\u3055\u304F\u306F\u3042\u308A\u307E\u305B\u3093
......@@ -4,8 +4,10 @@ alarmScene = \u9884\u8B66\u573A\u666F\u4E0D\u80FD\u4E3A\u7A7A
wrongAlarmScene = \u8BF7\u9009\u62E9\u6B63\u786E\u7684\u9884\u8B66\u573A\u666F
temMax = \u6E29\u5EA6\u4E0A\u9650\u4E0D\u80FD\u4E3A\u7A7A
temMin = \u6E29\u5EA6\u4E0B\u9650\u4E0D\u80FD\u4E3A\u7A7A
wrongTemp=\u6E29\u5EA6\u4E0A\u9650\u4E0D\u80FD\u5C0F\u4E8E\u6E29\u5EA6\u4E0B\u9650
humidityMax = \u6E7F\u5EA6\u4E0A\u9650\u4E0D\u80FD\u4E3A\u7A7A
humidityMin = \u6E7F\u5EA6\u4E0B\u9650\u4E0D\u80FD\u4E3A\u7A7A
wrongHumidity=\u6E7F\u5EA6\u4E0A\u9650\u4E0D\u80FD\u5C0F\u4E8E\u6E7F\u5EA6\u4E0B\u9650
tilt = \u503E\u659C\u5EA6\u4E0D\u80FD\u4E3A\u7A7A
shock = \u9707\u5EA6\u4E0D\u80FD\u4E3A\u7A7A
alarmExist = \u6DFB\u52A0\u7684\u9884\u8B66\u7C7B\u578B\u5728\u8BE5\u573A\u666F\u4E2D\u5DF2\u5B58\u5728
......@@ -81,7 +83,7 @@ completedCircuit = \u7EBF\u8DEF\u5B8C\u6210\u8FD0\u8F93\u624D\u80FD\u8BC4\u4EF7
evaluateSuccess = \u8BC4\u4EF7\u6210\u529F
evaluateFailure =\u8BC4\u4EF7\u5931\u8D25
circuitState = \u9700\u8981\u67E5\u8BE2\u7684\u7EBF\u8DEF\u72B6\u6001\u4E0D\u80FD\u4E3A\u7A7A
inTransit = \u8BE5\u7EBF\u8DEF\u5728\u8FD0\u8F93\u4E2D\u6216\u5DF2\u7ECF\u5B8C\u6210\u8FD0\u8F93
inTransit = \u8BE5\u7EBF\u8DEF\u6B63\u5728\u8FD0\u8F93\u4E2D\uFF0C\u4E0D\u80FD\u5220\u9664
bindTDL = \u8BE5\u7EBF\u8DEF\u672A\u7ED1\u5B9Atdl
bindGateway = \u8BE5\u7EBF\u8DEF\u672A\u7ED1\u5B9A\u7F51\u5173
circuitDeleteSuccess = \u7EBF\u8DEF\u5220\u9664\u6210\u529F
......
......@@ -85,6 +85,7 @@
from alarm_log al,circuit c,company co
where al.transportationNo =c.transportationNo
and c.company_id = co.id
and co.companyName =#{companyName,jdbcType=VARCHAR}
<if test="transportationNo!=null">
AND c.transportationNo = #{transportationNo,jdbcType=VARCHAR}
</if>
......
......@@ -67,12 +67,12 @@
</select>
<!--查询仓库的预警类型-->
<select id="getForWarehouse" resultType="String">
<select id="getForWarehouse" parameterType="String" resultType="com.example.tdl.domain.vo.AlarmTypeVo">
SELECT alarmType from alarm WHERE alarmScene="仓库" AND company_id=(SELECT id from company where companyName=#{companyName,jdbcType=VARCHAR})
</select>
<!--查询仓库的预警类型-->
<select id="getForTransportation" resultType="String">
<select id="getForTransportation" parameterType="String" resultType="com.example.tdl.domain.vo.AlarmTypeVo">
SELECT alarmType from alarm WHERE alarmScene="运输" AND company_id=(SELECT id from company where companyName=#{companyName,jdbcType=VARCHAR})
</select>
</mapper>
\ No newline at end of file
......@@ -25,4 +25,14 @@
where transportationNo = #{transportationNo,jdbcType=VARCHAR}
</select>
<select id="getByAlarm" parameterType="com.example.tdl.domain.vo.DelAlarmVo" resultType="String">
select DISTINCT transportationNo
from tdl_gateway_log tgl ,alarm a ,company c
where a.id=tgl.alarm_id
and a.company_id =c.id
AND a.alarmType=#{alarmType,jdbcType=VARCHAR}
AND a.alarmScene=#{alarmScene,jdbcType=VARCHAR}
and c.companyName=#{companyName,jdbcType=VARCHAR}
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment