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 { ...@@ -6,21 +6,15 @@ public class AddWarehouseVo {
private String country; private String country;
private String province;
private String city; private String city;
private String district; private String addressDetail;
private String address;
private String regionCN;//区域中文
private String regionEN;//区域英文 private String lng;
private String longitude;//经度 private String lat;
private String latitude;//纬度 private String regionName;//
private String property;//属性 private String property;//属性
...@@ -42,8 +36,6 @@ public class AddWarehouseVo { ...@@ -42,8 +36,6 @@ public class AddWarehouseVo {
private Integer timeZone;//时区 private Integer timeZone;//时区
private String weatherInfo;//区域气象信息
private String warehouseInfo;//基础描述 private String warehouseInfo;//基础描述
private String remark; private String remark;
...@@ -64,14 +56,6 @@ public class AddWarehouseVo { ...@@ -64,14 +56,6 @@ public class AddWarehouseVo {
this.country = country; this.country = country;
} }
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getCity() { public String getCity() {
return city; return city;
} }
...@@ -80,52 +64,36 @@ public class AddWarehouseVo { ...@@ -80,52 +64,36 @@ public class AddWarehouseVo {
this.city = city; this.city = city;
} }
public String getDistrict() { public String getAddressDetail() {
return district; return addressDetail;
}
public void setDistrict(String district) {
this.district = district;
} }
public String getAddress() { public void setAddressDetail(String addressDetail) {
return address; this.addressDetail = addressDetail;
} }
public void setAddress(String address) { public String getLng() {
this.address = address; return lng;
} }
public String getRegionCN() { public void setLng(String lng) {
return regionCN; this.lng = lng;
} }
public void setRegionCN(String regionCN) { public String getLat() {
this.regionCN = regionCN; return lat;
} }
public String getRegionEN() { public void setLat(String lat) {
return regionEN; this.lat = lat;
} }
public void setRegionEN(String regionEN) { public String getRegionName() {
this.regionEN = regionEN; return regionName;
} }
public String getLongitude() { public void setRegionName(String regionName) {
return longitude; this.regionName = regionName;
}
public void setLongitude(String longitude) {
this.longitude = longitude;
}
public String getLatitude() {
return latitude;
}
public void setLatitude(String latitude) {
this.latitude = latitude;
} }
public String getProperty() { public String getProperty() {
...@@ -208,14 +176,6 @@ public class AddWarehouseVo { ...@@ -208,14 +176,6 @@ public class AddWarehouseVo {
this.timeZone = timeZone; this.timeZone = timeZone;
} }
public String getWeatherInfo() {
return weatherInfo;
}
public void setWeatherInfo(String weatherInfo) {
this.weatherInfo = weatherInfo;
}
public String getWarehouseInfo() { public String getWarehouseInfo() {
return warehouseInfo; 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; ...@@ -2,27 +2,23 @@ package com.example.tdl.domain.vo;
public class ResultWarehouseVo { public class ResultWarehouseVo {
private String warehouseName;
private String warehouseNo;//仓库编号 private String warehouseNo;//仓库编号
private String country; private String warehouseName;
private String province; private String country;
private String city; private String city;
private String district; private String regions;
private String address;
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;//属性 private String property;//属性
...@@ -30,8 +26,6 @@ public class ResultWarehouseVo { ...@@ -30,8 +26,6 @@ public class ResultWarehouseVo {
private String alarmType; private String alarmType;
private String alarmScene;
private String hardwareLevel;//硬件等级 private String hardwareLevel;//硬件等级
private Double areaIndoor;//室内平面面积 private Double areaIndoor;//室内平面面积
...@@ -46,19 +40,11 @@ public class ResultWarehouseVo { ...@@ -46,19 +40,11 @@ public class ResultWarehouseVo {
private Integer timeZone;//时区 private Integer timeZone;//时区
private String weatherInfo;//区域气象信息
private String warehouseInfo;//基础描述 private String warehouseInfo;//基础描述
private String remark; private String companyName;
public String getWarehouseName() { private String remark;
return warehouseName;
}
public void setWarehouseName(String warehouseName) {
this.warehouseName = warehouseName;
}
public String getWarehouseNo() { public String getWarehouseNo() {
return warehouseNo; return warehouseNo;
...@@ -68,20 +54,20 @@ public class ResultWarehouseVo { ...@@ -68,20 +54,20 @@ public class ResultWarehouseVo {
this.warehouseNo = warehouseNo; this.warehouseNo = warehouseNo;
} }
public String getCountry() { public String getWarehouseName() {
return country; return warehouseName;
} }
public void setCountry(String country) { public void setWarehouseName(String warehouseName) {
this.country = country; this.warehouseName = warehouseName;
} }
public String getProvince() { public String getCountry() {
return province; return country;
} }
public void setProvince(String province) { public void setCountry(String country) {
this.province = province; this.country = country;
} }
public String getCity() { public String getCity() {
...@@ -92,52 +78,44 @@ public class ResultWarehouseVo { ...@@ -92,52 +78,44 @@ public class ResultWarehouseVo {
this.city = city; this.city = city;
} }
public String getDistrict() { public String getRegions() {
return district; return regions;
} }
public void setDistrict(String district) { public void setRegions(String regions) {
this.district = district; this.regions = regions;
} }
public String getAddress() { public String getAddressDetail() {
return address; return addressDetail;
} }
public void setAddress(String address) { public void setAddressDetail(String addressDetail) {
this.address = address; this.addressDetail = addressDetail;
} }
public String getRegionCN() { public String getRegionName() {
return regionCN; return regionName;
} }
public void setRegionCN(String regionCN) { public void setRegionName(String regionName) {
this.regionCN = regionCN; this.regionName = regionName;
} }
public String getRegionEN() { public String getLng() {
return regionEN; return lng;
} }
public void setRegionEN(String regionEN) { public void setLng(String lng) {
this.regionEN = regionEN; this.lng = lng;
} }
public String getLongitude() { public String getLat() {
return longitude; return lat;
} }
public void setLongitude(String longitude) { public void setLat(String lat) {
this.longitude = longitude; this.lat = lat;
}
public String getLatitude() {
return latitude;
}
public void setLatitude(String latitude) {
this.latitude = latitude;
} }
public String getProperty() { public String getProperty() {
...@@ -164,14 +142,6 @@ public class ResultWarehouseVo { ...@@ -164,14 +142,6 @@ public class ResultWarehouseVo {
this.alarmType = alarmType; this.alarmType = alarmType;
} }
public String getAlarmScene() {
return alarmScene;
}
public void setAlarmScene(String alarmScene) {
this.alarmScene = alarmScene;
}
public String getHardwareLevel() { public String getHardwareLevel() {
return hardwareLevel; return hardwareLevel;
} }
...@@ -228,14 +198,6 @@ public class ResultWarehouseVo { ...@@ -228,14 +198,6 @@ public class ResultWarehouseVo {
this.timeZone = timeZone; this.timeZone = timeZone;
} }
public String getWeatherInfo() {
return weatherInfo;
}
public void setWeatherInfo(String weatherInfo) {
this.weatherInfo = weatherInfo;
}
public String getWarehouseInfo() { public String getWarehouseInfo() {
return warehouseInfo; return warehouseInfo;
} }
...@@ -244,6 +206,14 @@ public class ResultWarehouseVo { ...@@ -244,6 +206,14 @@ public class ResultWarehouseVo {
this.warehouseInfo = warehouseInfo; this.warehouseInfo = warehouseInfo;
} }
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public String getRemark() { public String getRemark() {
return remark; 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 { ...@@ -7,21 +7,15 @@ public class UpdateWarehouseVo {
private String country; private String country;
private String province;
private String city; private String city;
private String district; private String addressDetail;
private String address;
private String regionCN;//区域中文
private String regionEN;//区域英文 private String lng;
private String longitude;//经度 private String lat;
private String latitude;//纬度 private String regionName;
private String property;//属性 private String property;//属性
...@@ -43,8 +37,6 @@ public class UpdateWarehouseVo { ...@@ -43,8 +37,6 @@ public class UpdateWarehouseVo {
private Integer timeZone;//时区 private Integer timeZone;//时区
private String weatherInfo;//区域气象信息
private String warehouseInfo;//基础描述 private String warehouseInfo;//基础描述
private Long updateTime; private Long updateTime;
...@@ -75,14 +67,6 @@ public class UpdateWarehouseVo { ...@@ -75,14 +67,6 @@ public class UpdateWarehouseVo {
this.country = country; this.country = country;
} }
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getCity() { public String getCity() {
return city; return city;
} }
...@@ -91,52 +75,36 @@ public class UpdateWarehouseVo { ...@@ -91,52 +75,36 @@ public class UpdateWarehouseVo {
this.city = city; this.city = city;
} }
public String getDistrict() { public String getAddressDetail() {
return district; return addressDetail;
}
public void setDistrict(String district) {
this.district = district;
} }
public String getAddress() { public void setAddressDetail(String addressDetail) {
return address; this.addressDetail = addressDetail;
} }
public void setAddress(String address) { public String getLng() {
this.address = address; return lng;
} }
public String getRegionCN() { public void setLng(String lng) {
return regionCN; this.lng = lng;
} }
public void setRegionCN(String regionCN) { public String getLat() {
this.regionCN = regionCN; return lat;
} }
public String getRegionEN() { public void setLat(String lat) {
return regionEN; this.lat = lat;
} }
public void setRegionEN(String regionEN) { public String getRegionName() {
this.regionEN = regionEN; return regionName;
} }
public String getLongitude() { public void setRegionName(String regionName) {
return longitude; this.regionName = regionName;
}
public void setLongitude(String longitude) {
this.longitude = longitude;
}
public String getLatitude() {
return latitude;
}
public void setLatitude(String latitude) {
this.latitude = latitude;
} }
public String getProperty() { public String getProperty() {
...@@ -219,14 +187,6 @@ public class UpdateWarehouseVo { ...@@ -219,14 +187,6 @@ public class UpdateWarehouseVo {
this.timeZone = timeZone; this.timeZone = timeZone;
} }
public String getWeatherInfo() {
return weatherInfo;
}
public void setWeatherInfo(String weatherInfo) {
this.weatherInfo = weatherInfo;
}
public String getWarehouseInfo() { public String getWarehouseInfo() {
return warehouseInfo; 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 { ...@@ -5,8 +5,6 @@ public class WarehouseTermVo {
private String country; private String country;
private String province;
private String city; private String city;
private String property; private String property;
...@@ -15,6 +13,8 @@ public class WarehouseTermVo { ...@@ -15,6 +13,8 @@ public class WarehouseTermVo {
private String hardwareLevel; private String hardwareLevel;
private String companyName;
public String getWarehouseName() { public String getWarehouseName() {
return warehouseName; return warehouseName;
} }
...@@ -31,14 +31,6 @@ public class WarehouseTermVo { ...@@ -31,14 +31,6 @@ public class WarehouseTermVo {
this.country = country; this.country = country;
} }
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getCity() { public String getCity() {
return city; return city;
} }
...@@ -70,4 +62,12 @@ public class WarehouseTermVo { ...@@ -70,4 +62,12 @@ public class WarehouseTermVo {
public void setHardwareLevel(String hardwareLevel) { public void setHardwareLevel(String hardwareLevel) {
this.hardwareLevel = 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 { ...@@ -16,23 +16,15 @@ public class Warehouse implements Serializable {
private String warehouseNo;//仓库编号 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 regionName;
private String regionCN;//区域中文
private String regionEN;//区域英文
private String longitude;//经度
private String latitude;//纬度
private String property;//属性 private String property;//属性
...@@ -54,47 +46,16 @@ public class Warehouse implements Serializable { ...@@ -54,47 +46,16 @@ public class Warehouse implements Serializable {
private Integer timeZone;//时区 private Integer timeZone;//时区
private String weatherInfo;//区域气象信息
private String warehouseInfo;//基础描述 private String warehouseInfo;//基础描述
private Company company;
private Long createTime; private Long createTime;
private Long updateTime; private Long updateTime;
private String remark; 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() { public Integer getId() {
return id; return id;
...@@ -120,76 +81,44 @@ public class Warehouse implements Serializable { ...@@ -120,76 +81,44 @@ public class Warehouse implements Serializable {
this.warehouseNo = warehouseNo; this.warehouseNo = warehouseNo;
} }
public String getCountry() { public City getCity() {
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() {
return city; return city;
} }
public void setCity(String city) { public void setCity(City city) {
this.city = city; this.city = city;
} }
public String getDistrict() { public String getAddressDetail() {
return district; return addressDetail;
}
public void setDistrict(String district) {
this.district = district;
}
public String getAddress() {
return address;
} }
public void setAddress(String address) { public void setAddressDetail(String addressDetail) {
this.address = address; this.addressDetail = addressDetail;
} }
public String getRegionCN() { public String getLng() {
return regionCN; return lng;
} }
public void setRegionCN(String regionCN) { public void setLng(String lng) {
this.regionCN = regionCN; this.lng = lng;
} }
public String getRegionEN() { public String getLat() {
return regionEN; return lat;
} }
public void setRegionEN(String regionEN) { public void setLat(String lat) {
this.regionEN = regionEN; this.lat = lat;
} }
public String getLongitude() { public String getRegionName() {
return longitude; return regionName;
} }
public void setLongitude(String longitude) { public void setRegionName(String regionName) {
this.longitude = longitude; this.regionName = regionName;
}
public String getLatitude() {
return latitude;
}
public void setLatitude(String latitude) {
this.latitude = latitude;
} }
public String getProperty() { public String getProperty() {
...@@ -272,14 +201,6 @@ public class Warehouse implements Serializable { ...@@ -272,14 +201,6 @@ public class Warehouse implements Serializable {
this.timeZone = timeZone; this.timeZone = timeZone;
} }
public String getWeatherInfo() {
return weatherInfo;
}
public void setWeatherInfo(String weatherInfo) {
this.weatherInfo = weatherInfo;
}
public String getWarehouseInfo() { public String getWarehouseInfo() {
return warehouseInfo; return warehouseInfo;
} }
...@@ -288,6 +209,14 @@ public class Warehouse implements Serializable { ...@@ -288,6 +209,14 @@ public class Warehouse implements Serializable {
this.warehouseInfo = warehouseInfo; this.warehouseInfo = warehouseInfo;
} }
public Company getCompany() {
return company;
}
public void setCompany(Company company) {
this.company = company;
}
public Long getCreateTime() { public Long getCreateTime() {
return createTime; return createTime;
} }
......
package com.example.tdl.mapper; package com.example.tdl.mapper;
import com.example.tdl.domain.vo.AddAlarmVo; import com.example.tdl.domain.vo.*;
import com.example.tdl.domain.vo.DelAlarmVo;
import com.example.tdl.domain.vo.ResultAlarmVo;
import com.example.tdl.domain.vo.UpdateAlarmVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -24,7 +21,7 @@ public interface AlarmMapper { ...@@ -24,7 +21,7 @@ public interface AlarmMapper {
ResultAlarmVo getByTypeAndScene(@Param("alarmType") String alarmType,@Param("alarmScene") String alarmScene,@Param("companyName") String companyName); 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; 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.ResultGatewayVo;
import com.example.tdl.domain.vo.TDLLogVo; import com.example.tdl.domain.vo.TDLLogVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
...@@ -17,4 +18,6 @@ public interface TDLLogMapper { ...@@ -17,4 +18,6 @@ public interface TDLLogMapper {
String getSN(String transportationNo); String getSN(String transportationNo);
List<String> getByAlarm(DelAlarmVo delAlarmVo);
} }
package com.example.tdl.mapper; package com.example.tdl.mapper;
import com.example.tdl.domain.vo.DelAlarmVo; import com.example.tdl.domain.vo.*;
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.entity.Warehouse; import com.example.tdl.entity.Warehouse;
import org.apache.ibatis.annotations.Mapper; 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.List;
import java.util.Map;
@Mapper @Mapper
public interface WarehouseMapper { public interface WarehouseMapper {
List<ResultWarehouseVo> getAll(); List<ResultWarehouseVo> getAll(String companyName);
List<ResultWarehouseVo> getAllByTerm(WarehouseTermVo warehouseTermVo); 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<ResultWarehouseVo> getByAlarm(DelAlarmVo delAlarmVo);
List<GatewaySNVo> getGateway(String warehouseNo);
} }
package com.example.tdl.service; package com.example.tdl.service;
import com.example.tdl.domain.vo.AddAlarmVo; import com.example.tdl.domain.vo.*;
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.mapper.AlarmMapper; import com.example.tdl.mapper.AlarmMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -41,11 +38,11 @@ public class AlarmService { ...@@ -41,11 +38,11 @@ public class AlarmService {
return alarmMapper.getByTypeAndScene(alarmType,alarmScene,companyName); return alarmMapper.getByTypeAndScene(alarmType,alarmScene,companyName);
} }
public List<String> getForWarehouse(String companyName){ public List<AlarmTypeVo> getForWarehouse(String companyName){
return alarmMapper.getForWarehouse(companyName); return alarmMapper.getForWarehouse(companyName);
} }
public List<String> getForTransportation(String companyName){ public List<AlarmTypeVo> getForTransportation(String companyName){
return alarmMapper.getForTransportation(companyName); return alarmMapper.getForTransportation(companyName);
} }
......
package com.example.tdl.service; 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.ResultGatewayVo;
import com.example.tdl.domain.vo.TDLLogVo; import com.example.tdl.domain.vo.TDLLogVo;
import com.example.tdl.mapper.TDLLogMapper; import com.example.tdl.mapper.TDLLogMapper;
...@@ -31,4 +32,8 @@ public class TDLLogService { ...@@ -31,4 +32,8 @@ public class TDLLogService {
return tdlLogMapper.getSN(transportationNo); return tdlLogMapper.getSN(transportationNo);
} }
public List<String> getByAlarm(DelAlarmVo delAlarmVo){
return tdlLogMapper.getByAlarm(delAlarmVo);
}
} }
package com.example.tdl.service; package com.example.tdl.service;
import com.example.tdl.domain.vo.DelAlarmVo; import com.example.tdl.domain.vo.*;
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.entity.Warehouse; import com.example.tdl.entity.Warehouse;
import com.example.tdl.mapper.WarehouseMapper; import com.example.tdl.mapper.WarehouseMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
import java.util.Map;
@Service @Service
public class WarehouseService { public class WarehouseService {
@Autowired @Autowired
private WarehouseMapper warehouseMapper; private WarehouseMapper warehouseMapper;
public List<ResultWarehouseVo> getAll(){ public List<ResultWarehouseVo> getAll(String companyName){
return warehouseMapper.getAll(); return warehouseMapper.getAll(companyName);
} }
public List<ResultWarehouseVo> getAllByTerm(WarehouseTermVo warehouseTermVo){ public List<ResultWarehouseVo> getAllByTerm(WarehouseTermVo warehouseTermVo){
return warehouseMapper.getAllByTerm(warehouseTermVo); return warehouseMapper.getAllByTerm(warehouseTermVo);
} }
public int addWarehouse(Warehouse warehouse){ public List<String> getByWarehouse(WareHouseByTermVo wareHouseByTermVo){
return warehouseMapper.addWarehouse(warehouse); return warehouseMapper.getByWarehouse(wareHouseByTermVo);
} }
public int updateWarehouse(UpdateWarehouseVo updateWarehouseVo){ public Integer getWarehouseNo(String warehouseNo){
return warehouseMapper.updateWarehouse(updateWarehouseVo); return warehouseMapper.getWarehouseNo(warehouseNo);
} }
public int delWarehouse(String warehouseNo){ public Integer getByWarehouseNoAndSN(String warehouseNo,String SN){
return warehouseMapper.delWarehouse(warehouseNo); return warehouseMapper.getByWarehouseNoAndSN(warehouseNo,SN);
} }
public ResultWarehouseVo getByWarehouseName(String warehouseName){ public int addWarehouse(Map<Object,Object> map){
return warehouseMapper.getByWarehouseName(warehouseName); 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){ public List<ResultWarehouseVo> getByAlarm(DelAlarmVo delAlarmVo){
return warehouseMapper.getByAlarm(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; ...@@ -6,6 +6,7 @@ import com.example.tdl.domain.dto.CommFeedback;
import com.example.tdl.domain.vo.*; import com.example.tdl.domain.vo.*;
import com.example.tdl.service.AlarmService; import com.example.tdl.service.AlarmService;
import com.example.tdl.service.TDLLogService;
import com.example.tdl.service.WarehouseService; import com.example.tdl.service.WarehouseService;
import com.example.tdl.service.redis.TokenRedisService; import com.example.tdl.service.redis.TokenRedisService;
import com.google.gson.Gson; import com.google.gson.Gson;
...@@ -42,6 +43,9 @@ public class AlarmController { ...@@ -42,6 +43,9 @@ public class AlarmController {
@Autowired @Autowired
private TokenRedisService tokenRedisService; private TokenRedisService tokenRedisService;
@Autowired
private TDLLogService tdlLogService;
@Autowired @Autowired
private I18nController i18n; private I18nController i18n;
...@@ -139,6 +143,11 @@ public class AlarmController { ...@@ -139,6 +143,11 @@ public class AlarmController {
fb.setMessage(i18n.getMessage(request,"temMin")); fb.setMessage(i18n.getMessage(request,"temMin"));
return gson.toJson(fb); 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){ if (addAlarmVo.getHumidityMax()==null){
fb.setCode(0); fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"humidityMax")); fb.setMessage(i18n.getMessage(request,"humidityMax"));
...@@ -149,6 +158,11 @@ public class AlarmController { ...@@ -149,6 +158,11 @@ public class AlarmController {
fb.setMessage(i18n.getMessage(request,"humidityMin")); fb.setMessage(i18n.getMessage(request,"humidityMin"));
return gson.toJson(fb); 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){ if (addAlarmVo.getTilt()==null){
fb.setCode(0); fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"tilt")); fb.setMessage(i18n.getMessage(request,"tilt"));
...@@ -201,13 +215,6 @@ public class AlarmController { ...@@ -201,13 +215,6 @@ public class AlarmController {
String port = request.getHeader("AccountLanguage"); String port = request.getHeader("AccountLanguage");
if (StringUtils.isEmpty(updateAlarmVo.getOldAlarmType())){ if (StringUtils.isEmpty(updateAlarmVo.getOldAlarmType())){
fb.setCode(0); 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")); fb.setMessage(i18n.getMessage(request,"modifiedAlarmType"));
return gson.toJson(fb); return gson.toJson(fb);
} }
...@@ -246,6 +253,11 @@ public class AlarmController { ...@@ -246,6 +253,11 @@ public class AlarmController {
fb.setMessage(i18n.getMessage(request,"temMin")); fb.setMessage(i18n.getMessage(request,"temMin"));
return gson.toJson(fb); 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){ if (updateAlarmVo.getHumidityMax()==null){
fb.setCode(0); fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"humidityMax")); fb.setMessage(i18n.getMessage(request,"humidityMax"));
...@@ -256,6 +268,11 @@ public class AlarmController { ...@@ -256,6 +268,11 @@ public class AlarmController {
fb.setMessage(i18n.getMessage(request,"humidityMin")); fb.setMessage(i18n.getMessage(request,"humidityMin"));
return gson.toJson(fb); 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){ if (updateAlarmVo.getTilt()==null){
fb.setCode(0); fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"tilt")); fb.setMessage(i18n.getMessage(request,"tilt"));
...@@ -275,7 +292,6 @@ public class AlarmController { ...@@ -275,7 +292,6 @@ public class AlarmController {
int a=alarmService.updateAlarm(updateAlarmVo); int a=alarmService.updateAlarm(updateAlarmVo);
if (a>0){ if (a>0){
fb.setCode(1); fb.setCode(1);
fb.setMessage("修改预警信息成功");
fb.setMessage(i18n.getMessage(request,"modifiedSuccess")); fb.setMessage(i18n.getMessage(request,"modifiedSuccess"));
}else{ }else{
fb.setCode(0); fb.setCode(0);
...@@ -310,11 +326,19 @@ public class AlarmController { ...@@ -310,11 +326,19 @@ public class AlarmController {
return gson.toJson(fb); return gson.toJson(fb);
} }
delAlarmVo.setCompanyName(user.getCompanyName()); 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){ if (warehouseService.getByAlarm(delAlarmVo).size()>0){
fb.setCode(0); fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"dusedAlarm")); fb.setMessage(i18n.getMessage(request,"dusedAlarm"));
return gson.toJson(fb); return gson.toJson(fb);
} }
}
int a=alarmService.delAlarm(delAlarmVo); int a=alarmService.delAlarm(delAlarmVo);
if (a>0){ if (a>0){
fb.setCode(1); fb.setCode(1);
...@@ -338,6 +362,7 @@ public class AlarmController { ...@@ -338,6 +362,7 @@ public class AlarmController {
String datum = tokenRedisService.get("TOKEN_" +token); String datum = tokenRedisService.get("TOKEN_" +token);
UserRedisVo user = gson.fromJson(datum,UserRedisVo.class); UserRedisVo user = gson.fromJson(datum,UserRedisVo.class);
return alarmService.getForWarehouse(user.getCompanyName()); return alarmService.getForWarehouse(user.getCompanyName());
} }
......
...@@ -636,16 +636,16 @@ public class CircuitController { ...@@ -636,16 +636,16 @@ public class CircuitController {
return gson.toJson(fb); return gson.toJson(fb);
} }
Long time = System.currentTimeMillis(); Long time = System.currentTimeMillis();
String countryVar=addCircuitVo.getStartAddressVo().getCountry()+" "; String countryVar=addCircuitVo.getStartAddressVo().getCountry()+"&";
String cityVar=addCircuitVo.getStartAddressVo().getCity()+ " "; String cityVar=addCircuitVo.getStartAddressVo().getCity()+ "&";
String addressDetailVar=addCircuitVo.getStartAddressVo().getAddressDetail() +" "; String addressDetailVar=addCircuitVo.getStartAddressVo().getAddressDetail() +"&";
String lngVar=addCircuitVo.getStartAddressVo().getLng()+" "; String lngVar=addCircuitVo.getStartAddressVo().getLng()+"&";
String latVar = addCircuitVo.getStartAddressVo().getLat()+" "; String latVar = addCircuitVo.getStartAddressVo().getLat()+"&";
String postCodeVar = addCircuitVo.getStartAddressVo().getPostCode()+" "; String postCodeVar = addCircuitVo.getStartAddressVo().getPostCode()+"&";
String expTimeVar = addCircuitVo.getStartAddressVo().getExpTime()+" "; String expTimeVar = addCircuitVo.getStartAddressVo().getExpTime()+"&";
String compTimeVar = "0 "; String compTimeVar = "0&";
String arrivalTimeVar=time +" "; String arrivalTimeVar=time +"&";
String startTimeVar=0 +" "; String startTimeVar=0 +"&";
if(addCircuitVo.getAddressVoList() != null){ if(addCircuitVo.getAddressVoList() != null){
if(addCircuitVo.getAddressVoList().size()>3){ if(addCircuitVo.getAddressVoList().size()>3){
fb.setCode(0); fb.setCode(0);
...@@ -715,16 +715,16 @@ public class CircuitController { ...@@ -715,16 +715,16 @@ public class CircuitController {
return gson.toJson(fb); return gson.toJson(fb);
} }
} }
countryVar=countryVar +addCircuitVo.getAddressVoList().get(i).getCountry() +" "; countryVar=countryVar +addCircuitVo.getAddressVoList().get(i).getCountry() +"&";
cityVar=cityVar +addCircuitVo.getAddressVoList().get(i).getCity() +" "; cityVar=cityVar +addCircuitVo.getAddressVoList().get(i).getCity() +"&";
addressDetailVar =addressDetailVar +addCircuitVo.getAddressVoList().get(i).getAddressDetail() +" "; addressDetailVar =addressDetailVar +addCircuitVo.getAddressVoList().get(i).getAddressDetail() +"&";
lngVar = lngVar + addCircuitVo.getAddressVoList().get(i).getLng() +" "; lngVar = lngVar + addCircuitVo.getAddressVoList().get(i).getLng() +"&";
latVar = latVar + addCircuitVo.getAddressVoList().get(i).getLat() +" "; latVar = latVar + addCircuitVo.getAddressVoList().get(i).getLat() +"&";
postCodeVar=postCodeVar + addCircuitVo.getAddressVoList().get(i).getPostCode() +" "; postCodeVar=postCodeVar + addCircuitVo.getAddressVoList().get(i).getPostCode() +"&";
expTimeVar = expTimeVar +addCircuitVo.getAddressVoList().get(i).getExpTime() +" "; expTimeVar = expTimeVar +addCircuitVo.getAddressVoList().get(i).getExpTime() +"&";
compTimeVar = compTimeVar +addCircuitVo.getAddressVoList().get(i).getCompTime() +" "; compTimeVar = compTimeVar +addCircuitVo.getAddressVoList().get(i).getCompTime() +"&";
startTimeVar =startTimeVar + "0 "; startTimeVar =startTimeVar + "0&";
arrivalTimeVar = arrivalTimeVar +"0 "; arrivalTimeVar = arrivalTimeVar +"0&";
} }
} }
if(StringUtils.isEmpty(addCircuitVo.getEndAddressVo().getCountry())){ if(StringUtils.isEmpty(addCircuitVo.getEndAddressVo().getCountry())){
...@@ -782,16 +782,16 @@ public class CircuitController { ...@@ -782,16 +782,16 @@ public class CircuitController {
fb.setMessage(i18n.getMessage(request,"gateway")); fb.setMessage(i18n.getMessage(request,"gateway"));
return gson.toJson(fb); return gson.toJson(fb);
} }
countryVar=countryVar +addCircuitVo.getEndAddressVo().getCountry() +" "; countryVar=countryVar +addCircuitVo.getEndAddressVo().getCountry() +"&";
cityVar=cityVar +addCircuitVo.getEndAddressVo().getCity() +" "; cityVar=cityVar +addCircuitVo.getEndAddressVo().getCity() +"&";
addressDetailVar =addressDetailVar +addCircuitVo.getEndAddressVo().getAddressDetail() +" "; addressDetailVar =addressDetailVar +addCircuitVo.getEndAddressVo().getAddressDetail() +"&";
lngVar = lngVar + addCircuitVo.getEndAddressVo().getLng() +" "; lngVar = lngVar + addCircuitVo.getEndAddressVo().getLng() +"&";
latVar = latVar + addCircuitVo.getEndAddressVo().getLat() +" "; latVar = latVar + addCircuitVo.getEndAddressVo().getLat() +"&";
postCodeVar=postCodeVar + addCircuitVo.getEndAddressVo().getPostCode() +" "; postCodeVar=postCodeVar + addCircuitVo.getEndAddressVo().getPostCode() +"&";
expTimeVar = expTimeVar +"0 "; expTimeVar = expTimeVar +"0&";
compTimeVar = compTimeVar +addCircuitVo.getEndAddressVo().getCompTime() +" "; compTimeVar = compTimeVar +addCircuitVo.getEndAddressVo().getCompTime() +"&";
startTimeVar =startTimeVar + "0 "; startTimeVar =startTimeVar + "0&";
arrivalTimeVar = arrivalTimeVar +"0 "; arrivalTimeVar = arrivalTimeVar +"0&";
String type =gatewayService.getBySN(addCircuitVo.getSN()); String type =gatewayService.getBySN(addCircuitVo.getSN());
//判断当前gateWay是否存在 //判断当前gateWay是否存在
if(StringUtils.isEmpty(type)){ if(StringUtils.isEmpty(type)){
...@@ -834,14 +834,13 @@ public class CircuitController { ...@@ -834,14 +834,13 @@ public class CircuitController {
fb.setMessage(i18n.getMessage(request,args,"tdlUsed")); fb.setMessage(i18n.getMessage(request,args,"tdlUsed"));
return gson.toJson(fb); return gson.toJson(fb);
} }
if(StringUtils.isEmpty(addCircuitVo.getTdlAlarmList().get(j).getAlarmType())){ if(StringUtils.isEmpty(addCircuitVo.getTdlAlarmList().get(j).getAlarmType())){
fb.setCode(0); fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"alarmType")); fb.setMessage(i18n.getMessage(request,"alarmType"));
return gson.toJson(fb); return gson.toJson(fb);
} }
alarmTypeVar =alarmTypeVar + addCircuitVo.getTdlAlarmList().get(j).getAlarmType() +" "; alarmTypeVar =alarmTypeVar + addCircuitVo.getTdlAlarmList().get(j).getAlarmType() +"&";
TDLSNVar =TDLSNVar + addCircuitVo.getTdlAlarmList().get(j).getTDLSN() +" "; TDLSNVar =TDLSNVar + addCircuitVo.getTdlAlarmList().get(j).getTDLSN() +"&";
devList.add("TDL-"+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); saveAlarmRule("TDL/"+type+"/" +addCircuitVo.getSN()+"/Data",addCircuitVo.getTdlAlarmList().get(j).getTDLSN(),addCircuitVo.getTdlAlarmList().get(j).getAlarmType(),request);
} }
...@@ -1333,13 +1332,13 @@ public class CircuitController { ...@@ -1333,13 +1332,13 @@ public class CircuitController {
fb.setMessage(i18n.getMessage(request,"noCircuit")); fb.setMessage(i18n.getMessage(request,"noCircuit"));
return gson.toJson(fb); return gson.toJson(fb);
} }
if (resultCircuitVo.getCircuitState()!=0){ if (resultCircuitVo.getCircuitState()==1){
fb.setCode(0); fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"inTransit")); fb.setMessage(i18n.getMessage(request,"inTransit"));
return gson.toJson(fb); return gson.toJson(fb);
} }
TDLLogVo tdlLogVo = tdlLogService.getByTransportationNo(transportationNo); TDLLogVo tdlLogVo = tdlLogService.getByTransportationNo(transportationNo);
if(tdlLogVo != null){ if(tdlLogVo != null && resultCircuitVo.getCircuitState() == 0){
List<String> dev = tdlLogService.getTdlSN(transportationNo); List<String> dev = tdlLogService.getTdlSN(transportationNo);
if(dev == null){ if(dev == null){
fb.setCode(0); fb.setCode(0);
......
...@@ -89,14 +89,17 @@ public class DataController { ...@@ -89,14 +89,17 @@ public class DataController {
@ApiImplicitParam(paramType="header", name = "Account_token", value = "token", required = true, dataType = "String"), @ApiImplicitParam(paramType="header", name = "Account_token", value = "token", required = true, dataType = "String"),
@ApiImplicitParam(paramType="header", name = "AccountLanguage", value = "language", required = false, 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 token = request.getHeader("Account_token");
String datum = tokenRedisService.get("TOKEN_" +token); String datum = tokenRedisService.get("TOKEN_" +token);
UserRedisVo user = gson.fromJson(datum,UserRedisVo.class); UserRedisVo user = gson.fromJson(datum,UserRedisVo.class);
JSONObject jsonObject= JSON.parseObject(transportationNo); if(StringUtils.isEmpty(searchLocationVo.getTransportationNo())){
transportationNo=jsonObject.getString("transportationNo"); 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<>(); List<LocationDataVo> locationDataVoList =new ArrayList<>();
if(resultCircuitVo == null){ if(resultCircuitVo == null){
return gson.toJson(locationDataVoList); return gson.toJson(locationDataVoList);
...@@ -105,12 +108,12 @@ public class DataController { ...@@ -105,12 +108,12 @@ public class DataController {
return gson.toJson(locationDataVoList); return gson.toJson(locationDataVoList);
} }
Long startTime = resultCircuitVo.getStartTime() *1000000l; Long startTime = resultCircuitVo.getStartTime() *1000000l;
if(resultCircuitVo.getEndTime() !=null && infoRedisService.hasHashKey("TransportConfig",transportationNo)){ if(resultCircuitVo.getEndTime() !=null && infoRedisService.hasHashKey("TransportConfig",searchLocationVo.getTransportationNo())){
Object ret = infoRedisService.getHash("TransportConfig",transportationNo); Object ret = infoRedisService.getHash("TransportConfig",searchLocationVo.getTransportationNo());
return ret; return ret;
} }
//获取gateway的信息 //获取gateway的信息
TDLLogVo tdlLogVo = tdlLogService.getByTransportationNo(transportationNo); TDLLogVo tdlLogVo = tdlLogService.getByTransportationNo(searchLocationVo.getTransportationNo());
if(tdlLogVo==null){ if(tdlLogVo==null){
return gson.toJson(locationDataVoList); return gson.toJson(locationDataVoList);
} }
...@@ -118,9 +121,21 @@ public class DataController { ...@@ -118,9 +121,21 @@ public class DataController {
String sql =""; String sql ="";
if(resultCircuitVo.getEndTime() != null && resultCircuitVo.getEndTime() != 0){ if(resultCircuitVo.getEndTime() != null && resultCircuitVo.getEndTime() != 0){
Long time = resultCircuitVo.getEndTime()*1000000l; 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 "; sql = "SELECT \"lng\",\"lat\" FROM \"tdl_policy\".\""+device+"\"where time >= "+startTime +" and time<= "+time+" ORDER BY time ";
}
}else{ }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信息 //获取tdl信息
QueryResult queryResult = influxDBTemplate.query(new Query(sql,database)); QueryResult queryResult = influxDBTemplate.query(new Query(sql,database));
...@@ -149,8 +164,12 @@ public class DataController { ...@@ -149,8 +164,12 @@ public class DataController {
String sql3 =""; String sql3 ="";
for(String time : timeList){ for(String time : timeList){
Long t = Long.valueOf(time) *1000000l; 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; 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)); QueryResult queryResult3 = influxDBTemplate.query(new Query(sql3,database));
List<String> time= new ArrayList<>(); List<String> time= new ArrayList<>();
if(queryResult3.getResults() !=null){ if(queryResult3.getResults() !=null){
...@@ -168,7 +187,7 @@ public class DataController { ...@@ -168,7 +187,7 @@ public class DataController {
//如果是已经完结保存到redis中 //如果是已经完结保存到redis中
if(resultCircuitVo.getEndTime() != null && resultCircuitVo.getEndTime() != 0){ if(resultCircuitVo.getEndTime() != null && resultCircuitVo.getEndTime() != 0){
Map<Object,Object> map=new HashMap<>(); Map<Object,Object> map=new HashMap<>();
map.put(transportationNo,locationDataVoList.toString()); map.put(searchLocationVo.getTransportationNo(),locationDataVoList.toString());
infoRedisService.setHash("TransportConfig",map,System.currentTimeMillis()); infoRedisService.setHash("TransportConfig",map,System.currentTimeMillis());
} }
return gson.toJson(locationDataVoList); return gson.toJson(locationDataVoList);
...@@ -176,7 +195,7 @@ public class DataController { ...@@ -176,7 +195,7 @@ public class DataController {
//如果是已经完结保存到redis中 //如果是已经完结保存到redis中
if (resultCircuitVo.getEndTime() != null && resultCircuitVo.getEndTime() != 0) { if (resultCircuitVo.getEndTime() != null && resultCircuitVo.getEndTime() != 0) {
Map<Object, Object> map = new HashMap<>(); Map<Object, Object> map = new HashMap<>();
map.put(transportationNo, locationDataVos.toString()); map.put(searchLocationVo.getTransportationNo(), locationDataVos.toString());
infoRedisService.setHash("TransportConfig", map,System.currentTimeMillis()); infoRedisService.setHash("TransportConfig", map,System.currentTimeMillis());
} }
return gson.toJson(locationDataVos); return gson.toJson(locationDataVos);
......
...@@ -5,10 +5,7 @@ import com.alibaba.fastjson.JSON; ...@@ -5,10 +5,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.example.tdl.domain.dto.CommFeedback; import com.example.tdl.domain.dto.CommFeedback;
import com.example.tdl.domain.vo.*; import com.example.tdl.domain.vo.*;
import com.example.tdl.service.AlarmService; import com.example.tdl.service.*;
import com.example.tdl.service.ConfigService;
import com.example.tdl.service.GatewayService;
import com.example.tdl.service.TDLDeviceService;
import com.example.tdl.service.redis.AlarmRedisService; import com.example.tdl.service.redis.AlarmRedisService;
import com.example.tdl.service.redis.TokenRedisService; import com.example.tdl.service.redis.TokenRedisService;
import com.google.gson.Gson; import com.google.gson.Gson;
...@@ -57,6 +54,9 @@ public class EquipmentBindingController { ...@@ -57,6 +54,9 @@ public class EquipmentBindingController {
@Autowired @Autowired
private TokenRedisService tokenRedisService; private TokenRedisService tokenRedisService;
@Autowired
private WarehouseService warehouseService;
@Autowired @Autowired
private I18nController i18n; private I18nController i18n;
...@@ -234,14 +234,63 @@ public class EquipmentBindingController { ...@@ -234,14 +234,63 @@ public class EquipmentBindingController {
msg.put("msg",map.get("msg")); msg.put("msg",map.get("msg"));
if (msg.get("msg").equals("解除网关成功")){ if (msg.get("msg").equals("解除网关成功")){
fb.setCode(1); fb.setCode(1);
fb.setMessage("解除tdl成功");
fb.setMessage("解除网关成功");
String key ="TDL/"+resultTDLDeviceVo.getGatewayType()+"/" +resultTDLDeviceVo.getGatewaySN() +"/Data"; String key ="TDL/"+resultTDLDeviceVo.getGatewayType()+"/" +resultTDLDeviceVo.getGatewaySN() +"/Data";
alarmRedisService.delKey(key); alarmRedisService.delKey(key);
}else{ }else{
fb.setCode(0); 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); return gson.toJson(fb);
} }
......
...@@ -64,7 +64,7 @@ completedCircuit=The line can be evaluated when the transportation has been comp ...@@ -64,7 +64,7 @@ completedCircuit=The line can be evaluated when the transportation has been comp
evaluateSuccess=Evaluation is successful evaluateSuccess=Evaluation is successful
evaluateFailure=Evaluation failed evaluateFailure=Evaluation failed
circuitState=The transport number cannot be empty 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 bindTDL=The line is not bound to tdl
bindGateway=The line is not bound to the gateway bindGateway=The line is not bound to the gateway
circuitDeleteSuccess=You have deleted the line successfully circuitDeleteSuccess=You have deleted the line successfully
...@@ -160,3 +160,5 @@ illegal=IllegalArgumentException ...@@ -160,3 +160,5 @@ illegal=IllegalArgumentException
sql=SQLException sql=SQLException
badSql=BadSqlGrammarException badSql=BadSqlGrammarException
error=The server code has been exceptions, please contact the administrator 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 ...@@ -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 sql=\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u30A2\u30AF\u30BB\u30B9\u7570\u5E38
badSql=\u30C7\u30FC\u30BF\u306E\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 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 ...@@ -4,8 +4,10 @@ alarmScene = \u9884\u8B66\u573A\u666F\u4E0D\u80FD\u4E3A\u7A7A
wrongAlarmScene = \u8BF7\u9009\u62E9\u6B63\u786E\u7684\u9884\u8B66\u573A\u666F wrongAlarmScene = \u8BF7\u9009\u62E9\u6B63\u786E\u7684\u9884\u8B66\u573A\u666F
temMax = \u6E29\u5EA6\u4E0A\u9650\u4E0D\u80FD\u4E3A\u7A7A temMax = \u6E29\u5EA6\u4E0A\u9650\u4E0D\u80FD\u4E3A\u7A7A
temMin = \u6E29\u5EA6\u4E0B\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 humidityMax = \u6E7F\u5EA6\u4E0A\u9650\u4E0D\u80FD\u4E3A\u7A7A
humidityMin = \u6E7F\u5EA6\u4E0B\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 tilt = \u503E\u659C\u5EA6\u4E0D\u80FD\u4E3A\u7A7A
shock = \u9707\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 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 ...@@ -81,7 +83,7 @@ completedCircuit = \u7EBF\u8DEF\u5B8C\u6210\u8FD0\u8F93\u624D\u80FD\u8BC4\u4EF7
evaluateSuccess = \u8BC4\u4EF7\u6210\u529F evaluateSuccess = \u8BC4\u4EF7\u6210\u529F
evaluateFailure =\u8BC4\u4EF7\u5931\u8D25 evaluateFailure =\u8BC4\u4EF7\u5931\u8D25
circuitState = \u9700\u8981\u67E5\u8BE2\u7684\u7EBF\u8DEF\u72B6\u6001\u4E0D\u80FD\u4E3A\u7A7A 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 bindTDL = \u8BE5\u7EBF\u8DEF\u672A\u7ED1\u5B9Atdl
bindGateway = \u8BE5\u7EBF\u8DEF\u672A\u7ED1\u5B9A\u7F51\u5173 bindGateway = \u8BE5\u7EBF\u8DEF\u672A\u7ED1\u5B9A\u7F51\u5173
circuitDeleteSuccess = \u7EBF\u8DEF\u5220\u9664\u6210\u529F circuitDeleteSuccess = \u7EBF\u8DEF\u5220\u9664\u6210\u529F
......
...@@ -85,6 +85,7 @@ ...@@ -85,6 +85,7 @@
from alarm_log al,circuit c,company co from alarm_log al,circuit c,company co
where al.transportationNo =c.transportationNo where al.transportationNo =c.transportationNo
and c.company_id = co.id and c.company_id = co.id
and co.companyName =#{companyName,jdbcType=VARCHAR}
<if test="transportationNo!=null"> <if test="transportationNo!=null">
AND c.transportationNo = #{transportationNo,jdbcType=VARCHAR} AND c.transportationNo = #{transportationNo,jdbcType=VARCHAR}
</if> </if>
......
...@@ -67,12 +67,12 @@ ...@@ -67,12 +67,12 @@
</select> </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 alarmType from alarm WHERE alarmScene="仓库" AND company_id=(SELECT id from company where companyName=#{companyName,jdbcType=VARCHAR})
</select> </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 alarmType from alarm WHERE alarmScene="运输" AND company_id=(SELECT id from company where companyName=#{companyName,jdbcType=VARCHAR})
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -25,4 +25,14 @@ ...@@ -25,4 +25,14 @@
where transportationNo = #{transportationNo,jdbcType=VARCHAR} where transportationNo = #{transportationNo,jdbcType=VARCHAR}
</select> </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> </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