Commit c4352c26 authored by chenying's avatar chenying

5.28仓库实时数据

parent 43ef55d1
package com.example.tdl.domain.vo;
import java.util.List;
public class GatewayOnLineVo {
private String SN;
private String type;
private Integer state;
private String battery;
private List<TDLDeviceDetailVo> tdlDeviceDetailVos;
public List<TDLDeviceDetailVo> getTdlDeviceDetailVos() {
return tdlDeviceDetailVos;
}
public void setTdlDeviceDetailVos(List<TDLDeviceDetailVo> tdlDeviceDetailVos) {
this.tdlDeviceDetailVos = tdlDeviceDetailVos;
}
public String getBattery() {
return battery;
}
public void setBattery(String battery) {
this.battery = battery;
}
public String getSN() {
return SN;
}
public void setSN(String SN) {
this.SN = SN;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public Integer getState() {
return state;
}
public void setState(Integer state) {
this.state = state;
}
}
package com.example.tdl.domain.vo;
public class TDLDeviceDetailVo {
private String TDLSN;
private String pressure;
private String temperature;
private String humidity;
private String time;
public String getTDLSN() {
return TDLSN;
}
public void setTDLSN(String TDLSN) {
this.TDLSN = TDLSN;
}
public String getPressure() {
return pressure;
}
public void setPressure(String pressure) {
this.pressure = pressure;
}
public String getTemperature() {
return temperature;
}
public void setTemperature(String temperature) {
this.temperature = temperature;
}
public String getHumidity() {
return humidity;
}
public void setHumidity(String humidity) {
this.humidity = humidity;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
}
package com.example.tdl.domain.vo;
import java.util.List;
public class WarehouseDataVo {
private String TDLSN;
private List<WarehouseTDLDetailVo> warehouseTDLDetailVos;
public String getTDLSN() {
return TDLSN;
}
public void setTDLSN(String TDLSN) {
this.TDLSN = TDLSN;
}
public List<WarehouseTDLDetailVo> getWarehouseTDLDetailVos() {
return warehouseTDLDetailVos;
}
public void setWarehouseTDLDetailVos(List<WarehouseTDLDetailVo> warehouseTDLDetailVos) {
this.warehouseTDLDetailVos = warehouseTDLDetailVos;
}
}
package com.example.tdl.domain.vo;
import java.util.List;
public class WarehouseDetailVo {
private String warehouseNo;
private String warehouseName;
private String country;
private String city;
private String addressDetail;
private Integer gatewayCounts;
private Integer tdlCounts;
private List<GatewayOnLineVo> gatewayOnLineVos;
public List<GatewayOnLineVo> getGatewayOnLineVos() {
return gatewayOnLineVos;
}
public void setGatewayOnLineVos(List<GatewayOnLineVo> gatewayOnLineVos) {
this.gatewayOnLineVos = gatewayOnLineVos;
}
public String getWarehouseNo() {
return warehouseNo;
}
public void setWarehouseNo(String warehouseNo) {
this.warehouseNo = warehouseNo;
}
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 getAddressDetail() {
return addressDetail;
}
public void setAddressDetail(String addressDetail) {
this.addressDetail = addressDetail;
}
public Integer getGatewayCounts() {
return gatewayCounts;
}
public void setGatewayCounts(Integer gatewayCounts) {
this.gatewayCounts = gatewayCounts;
}
public Integer getTdlCounts() {
return tdlCounts;
}
public void setTdlCounts(Integer tdlCounts) {
this.tdlCounts = tdlCounts;
}
}
package com.example.tdl.domain.vo;
import java.util.List;
public class WarehouseGatewayDateVo {
private String gSN;
private String type;
private List<WarehouseDataVo> warehouseDataVos;
public String getgSN() {
return gSN;
}
public void setgSN(String gSN) {
this.gSN = gSN;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public List<WarehouseDataVo> getWarehouseDataVos() {
return warehouseDataVos;
}
public void setWarehouseDataVos(List<WarehouseDataVo> warehouseDataVos) {
this.warehouseDataVos = warehouseDataVos;
}
}
package com.example.tdl.domain.vo;
import java.util.List;
public class WarehouseTDLDetailVo {
private String description;
private List<WarehouseTimeAndDataVo> timeAndValuesVos;
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public List<WarehouseTimeAndDataVo> getTimeAndValuesVos() {
return timeAndValuesVos;
}
public void setTimeAndValuesVos(List<WarehouseTimeAndDataVo> timeAndValuesVos) {
this.timeAndValuesVos = timeAndValuesVos;
}
}
package com.example.tdl.domain.vo;
public class WarehouseTimeAndDataVo {
private String time;
private String value;
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
......@@ -32,4 +32,6 @@ public interface GatewayMapper {
List<GatewaySNVo> getUnusedGateway(@Param("SN") String SN,@Param("companyNo") String companyNo);
int updateCompany(UpdateGatewayCompanyVo updateGatewayCompanyVo);
List<GatewayOnLineVo> getByWarehouseNo(@Param("warehouseNo") String warehouseNo);
}
......@@ -32,4 +32,5 @@ public interface TDLDeviceMapper {
ResultTDLDeviceVo getByTransportationNo(String transportationNo);
int updateCompany(@Param("TDLSN") String TDLSN,@Param("companyNo") String companyNo);
}
......@@ -45,4 +45,5 @@ public interface WarehouseMapper {
Integer updateImg(@Param("warehouseNo")String warehouseNo,@Param("img")String img,@Param("updateTime") Long updateTime);
WarehouseDetailVo getWarehouseDetailByNo(@Param("warehouseNo") String warehouseNo);
}
......@@ -62,4 +62,8 @@ public class GatewayService {
public int updateCompany(UpdateGatewayCompanyVo updateGatewayCompanyVo){
return gatewayMapper.updateCompany(updateGatewayCompanyVo);
}
public List<GatewayOnLineVo> getByWarehouseNo(String warehouseNo){
return gatewayMapper.getByWarehouseNo(warehouseNo);
}
}
......@@ -60,4 +60,5 @@ public class TDLDeviceService {
public int updateCompany(String TDLSN,String companyNo){
return tdlDeviceMapper.updateCompany(TDLSN,companyNo);
}
}
......@@ -79,4 +79,8 @@ public class WarehouseService {
public Integer updateImg(String warehouseNo, String img, Long updateTime){
return warehouseMapper.updateImg(warehouseNo,img,updateTime);
}
public WarehouseDetailVo getWarehouseDetailByNo(String warehouseNo){
return warehouseMapper.getWarehouseDetailByNo(warehouseNo);
}
}
......@@ -179,6 +179,12 @@ public class TDLDeviceController {
fb.setMessage(i18n.getMessage(request,"TDLSN"));
return gson.toJson(fb);
}
Object[] o={TDLSN};
if (tdlDeviceService.getByTDLSN(TDLSN).getUseScene()!=0){
fb.setCode(0);
fb.setMessage(i18n.getMessage(request,o,"tdlUsed"));
return gson.toJson(fb);
}
int a = tdlDeviceService.delTDLDevice(TDLSN);
if (a>0){
fb.setCode(1);
......
......@@ -63,16 +63,16 @@ gateway = \u7F51\u5173\u5E8F\u5217\u53F7\u4E0D\u80FD\u4E3A\u7A7A
gatewayExist = \u8BE5\u7F51\u5173\u5E8F\u5217\u53F7\u4E0D\u5B58\u5728
gatewayMounted = \u8BE5\u7F51\u5173\u672A\u6302\u8F7D
gatewayConsistent = \u8BE5\u7F51\u5173\u7684\u4F7F\u7528\u573A\u666F\u4E0E\u5F53\u524D\u4E0D\u7B26
tdl = TDL\u5E8F\u5217\u53F7\u4E0D\u80FD\u4E3A\u7A7A
tdlExist={0}TDL\u4E0D\u5B58\u5728
tdlUsed={0}\u7684TDL\u5DF2\u7ECF\u88AB\u4F7F\u7528
tdl = \u4F20\u611F\u5668\u5E8F\u5217\u53F7\u4E0D\u80FD\u4E3A\u7A7A
tdlExist={0}\u4F20\u611F\u5668\u4E0D\u5B58\u5728
tdlUsed={0}\u7684\u4F20\u611F\u5668\u5DF2\u7ECF\u88AB\u4F7F\u7528
cargoNo = \u8D27\u7269\u7F16\u53F7\u4E0D\u80FD\u4E3A\u7A7A
plateNo = \u8F66\u724C\u53F7\u4E0D\u80FD\u4E3A\u7A7A
cargoName = \u8D27\u7269\u522B\u540D\u4E0D\u80FD\u4E3A\u7A7A
circuitSuccess = \u6DFB\u52A0\u7EBF\u8DEF\u6210\u529F
circuitFailure = \u6DFB\u52A0\u7EBF\u8DEF\u5931\u8D25
notStarted = \u7EBF\u8DEF\u672A\u5F00\u59CB\u8FD0\u8F93
notBound = \u8BE5\u7EBF\u8DEF\u672A\u7ED1\u5B9A\u7F51\u5173\u6216\u8005tdl
notBound = \u8BE5\u7EBF\u8DEF\u672A\u7ED1\u5B9A\u7F51\u5173\u6216\u8005\u4F20\u611F\u5668
endCircuitSuccess =\u7EBF\u8DEF\u7ED3\u675F\u6210\u529F
endCircuitFailure =\u7EBF\u8DEF\u7ED3\u675F\u5931\u8D25
transportation = \u8FD0\u8F93\u65B9\u5F0F\u4E0D\u80FD\u4E3A\u7A7A
......@@ -84,7 +84,7 @@ 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\u6B63\u5728\u8FD0\u8F93\u4E2D\uFF0C\u4E0D\u80FD\u5220\u9664
bindTDL = \u8BE5\u7EBF\u8DEF\u672A\u7ED1\u5B9Atdl
bindTDL = \u8BE5\u7EBF\u8DEF\u672A\u7ED1\u5B9A\u4F20\u611F\u5668
bindGateway = \u8BE5\u7EBF\u8DEF\u672A\u7ED1\u5B9A\u7F51\u5173
circuitDeleteSuccess = \u7EBF\u8DEF\u5220\u9664\u6210\u529F
circuitDeleteFailure = \u7EBF\u8DEF\u5220\u9664\u5931\u8D25
......@@ -209,8 +209,8 @@ isUseing=\u8BBE\u5907\u5728\u6302\u8F7D
updateGatewayCompanySuccess=\u7F51\u5173\u5206\u914D\u516C\u53F8\u6210\u529F
updateGatewayCompanyFailure=\u7F51\u5173\u5206\u914D\u516C\u53F8\u5931\u8D25
#TDL
TDLSN=TDL\u7F16\u53F7\u4E0D\u80FD\u4E3A\u7A7A
TDLName=TDL\u540D\u5B57\u4E0D\u80FD\u4E3A\u7A7A
TDLSN=\u4F20\u611F\u5668\u7F16\u53F7\u4E0D\u80FD\u4E3A\u7A7A
TDLName=\u4F20\u611F\u5668\u540D\u5B57\u4E0D\u80FD\u4E3A\u7A7A
updateTDLSuccess=\u4FEE\u6539\u7F51\u5173\u6210\u529F
updateTDLFailure=\u4FEE\u6539\u7F51\u5173\u5931\u8D25
deleteTDLSuccess=\u5220\u9664\u7F51\u5173\u6210\u529F
......
......@@ -108,6 +108,13 @@
WHERE SN=#{SN,jdbcType=VARCHAR} AND type=#{type,jdbcType=VARCHAR}
</update>
<!--根据仓库编号查询网关信息-->
<select id="getByWarehouseNo" parameterType="String" resultType="com.example.tdl.domain.vo.GatewayOnLineVo">
SELECT SN,type from gateway
WHERE id IN (SELECT gateway_id from gateway_warehouse where warehouse_id=(
SELECT id from warehouse WHERE warehouseNo=#{warehouseNo,jdbcType=VARCHAR}))
</select>
<!-- <insert id="addGateway" parameterType="com.example.tdl.domain.vo.AddGatewayVo">
INSERT into gateway VALUES (
......
......@@ -106,4 +106,5 @@
UPDATE tdldevice set company_id=(SELECT id from company where companyNo=#{companyNo,jdbcType=VARCHAR})
WHERE TDLSN=#{TDLSN,jdbcType=VARCHAR}
</update>
</mapper>
\ No newline at end of file
</mapper>
......@@ -47,17 +47,16 @@
select count(warehouseNo) from warehouse where warehouseNo=#{warehouseNo,jdbcType=VARCHAR}
</select>
<select id="getByWarehouseName" parameterType="String" resultType="com.example.tdl.domain.vo.ResultWarehouseVo">
select warehouseNo,w.img,warehouseName,c.country,c.city,CONCAT_WS("-",c.country,c.city) regions ,w.addressDetail,r.regionName,lng,lat,a.alarmType,property,
type,hardwareLevel,areaIndoor,areaRack,areaOutdoor,areaPlanIndoor,office,timeZone,warehouseInfo,companyName,w.remark
from warehouse w,alarm a,region r,city ct ,company c
where c.id = w.company_id
and a.id = w.alarm_id
and r.id = w.region_id
and ct.id = w.city_id
and c.companyName=#{companyName,jdbcType=VARCHAR}
AND warehouseName=#{warehouseName,jdbcType=VARCHAR}
from warehouse w,alarm a,region r,city ct ,company c
where c.id = w.company_id
and a.id = w.alarm_id
and r.id = w.region_id
and ct.id = w.city_id
and c.companyName=#{companyName,jdbcType=VARCHAR}
AND warehouseName=#{warehouseName,jdbcType=VARCHAR}
</select>
<insert id="addWarehouse" parameterType="java.util.Map" statementType="CALLABLE">
......@@ -202,7 +201,7 @@
type,hardwareLevel,areaIndoor,areaRack,areaOutdoor,areaPlanIndoor,office,timeZone,warehouseInfo,w.remark
from warehouse w,alarm a ,region r,company c,city ct
WHERE w.alarm_id=a.id
and w.city_id =ct.id
and w.city_id =ct.id
and w.region_id = r.id
and w.company_id= c.id
and a.company_id =c.id
......@@ -248,7 +247,15 @@
</select>
<update id="updateImg">
UPDATE warehouse set img = #{img,jdbcType=VARCHAR}, updateTime =#{updateTime,mode=IN,jdbcType=BIGINT} where warehouseNo= #{warehouseNo,jdbcType=VARCHAR}
UPDATE warehouse set img = #{img,jdbcType=VARCHAR}, updateTime =#{updateTime,mode=IN,jdbcType=BIGINT}
where warehouseNo= #{warehouseNo,jdbcType=VARCHAR}
</update>
<select id="getWarehouseDetailByNo" parameterType="String" resultType="com.example.tdl.domain.vo.WarehouseDetailVo">
SELECT warehouseNo,warehouseName,c.country,c.city,addressDetail,(SELECT COUNT(id) from gateway_warehouse WHERE warehouse_id=w.id) gatewayCounts,
(SELECT COUNT(id) FROM tdldevice WHERE warehouse_id=w.id) tdlCounts
from warehouse w INNER JOIN city c ON w.city_id=c.id
where warehouseNo=#{warehouseNo,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