Commit 162ac3ef authored by zhuangzhuang's avatar zhuangzhuang

4.13-- 增加开始线路,结束线路

parent 47563980
This diff is collapsed.
...@@ -16,6 +16,10 @@ public class CircuitMessageVo { ...@@ -16,6 +16,10 @@ public class CircuitMessageVo {
private String evaluate; private String evaluate;
private String SN;
private String TDLSN;
private List<ResultCityVo> list; private List<ResultCityVo> list;
private List<ResultAlarmLog> alarmLogList; private List<ResultAlarmLog> alarmLogList;
...@@ -23,13 +27,15 @@ public class CircuitMessageVo { ...@@ -23,13 +27,15 @@ public class CircuitMessageVo {
public CircuitMessageVo() { public CircuitMessageVo() {
} }
public CircuitMessageVo(String transportationNo, String cargoNo, String startCity, String endCity, Integer circuitState, String evaluate, List<ResultAlarmLog> alarmLogList) { public CircuitMessageVo(String transportationNo, String cargoNo, String startCity, String endCity, Integer circuitState, String evaluate, String SN, String TDLSN, List<ResultAlarmLog> alarmLogList) {
this.transportationNo = transportationNo; this.transportationNo = transportationNo;
this.cargoNo = cargoNo; this.cargoNo = cargoNo;
this.startCity = startCity; this.startCity = startCity;
this.endCity = endCity; this.endCity = endCity;
this.circuitState = circuitState; this.circuitState = circuitState;
this.evaluate = evaluate; this.evaluate = evaluate;
this.SN = SN;
this.TDLSN = TDLSN;
this.alarmLogList = alarmLogList; this.alarmLogList = alarmLogList;
} }
...@@ -81,6 +87,22 @@ public class CircuitMessageVo { ...@@ -81,6 +87,22 @@ public class CircuitMessageVo {
this.evaluate = evaluate; this.evaluate = evaluate;
} }
public String getSN() {
return SN;
}
public void setSN(String SN) {
this.SN = SN;
}
public String getTDLSN() {
return TDLSN;
}
public void setTDLSN(String TDLSN) {
this.TDLSN = TDLSN;
}
public List<ResultCityVo> getList() { public List<ResultCityVo> getList() {
return list; return list;
} }
......
...@@ -19,6 +19,8 @@ public class HomePageDataVo { ...@@ -19,6 +19,8 @@ public class HomePageDataVo {
private List<CircuitVo> circuitList; private List<CircuitVo> circuitList;
private List<HistogramData> histogramDataList;
public Integer getSum() { public Integer getSum() {
return sum; return sum;
} }
...@@ -74,4 +76,12 @@ public class HomePageDataVo { ...@@ -74,4 +76,12 @@ public class HomePageDataVo {
public void setCircuitList(List<CircuitVo> circuitList) { public void setCircuitList(List<CircuitVo> circuitList) {
this.circuitList = circuitList; this.circuitList = circuitList;
} }
public List<HistogramData> getHistogramDataList() {
return histogramDataList;
}
public void setHistogramDataList(List<HistogramData> histogramDataList) {
this.histogramDataList = histogramDataList;
}
} }
...@@ -47,7 +47,7 @@ public class LocationDataVo { ...@@ -47,7 +47,7 @@ public class LocationDataVo {
return "{" + return "{" +
"\"time\""+":\"" + time + '\"' + "\"time\""+":\"" + time + '\"' +
",\"lng\""+":" + lng + ",\"lng\""+":" + lng +
",\" lat\""+":" + lat + ",\"lat\""+":" + lat +
", \"error\""+":" + error + ", \"error\""+":" + error +
'}'; '}';
} }
......
...@@ -17,15 +17,11 @@ public class ResultCircuitForAppVo { ...@@ -17,15 +17,11 @@ public class ResultCircuitForAppVo {
private String transportationType; private String transportationType;
private String remark; private String SN;
public Long getStartTime() { private String TDLSN;
return startTime;
}
public void setStartTime(Long startTime) { private String remark;
this.startTime = startTime;
}
public String getTransportationNo() { public String getTransportationNo() {
return transportationNo; return transportationNo;
...@@ -43,6 +39,14 @@ public class ResultCircuitForAppVo { ...@@ -43,6 +39,14 @@ public class ResultCircuitForAppVo {
this.city = city; this.city = city;
} }
public Long getStartTime() {
return startTime;
}
public void setStartTime(Long startTime) {
this.startTime = startTime;
}
public String getCargoNo() { public String getCargoNo() {
return cargoNo; return cargoNo;
} }
...@@ -83,6 +87,22 @@ public class ResultCircuitForAppVo { ...@@ -83,6 +87,22 @@ public class ResultCircuitForAppVo {
this.transportationType = transportationType; this.transportationType = transportationType;
} }
public String getSN() {
return SN;
}
public void setSN(String SN) {
this.SN = SN;
}
public String getTDLSN() {
return TDLSN;
}
public void setTDLSN(String TDLSN) {
this.TDLSN = TDLSN;
}
public String getRemark() { public String getRemark() {
return remark; return remark;
} }
......
...@@ -23,6 +23,10 @@ public class ResultCircuitVo { ...@@ -23,6 +23,10 @@ public class ResultCircuitVo {
private String transportation; private String transportation;
private String SN;
private String TDLSN;
public String getTransportationNo() { public String getTransportationNo() {
return transportationNo; return transportationNo;
} }
...@@ -110,4 +114,20 @@ public class ResultCircuitVo { ...@@ -110,4 +114,20 @@ public class ResultCircuitVo {
public void setTransportation(String transportation) { public void setTransportation(String transportation) {
this.transportation = transportation; this.transportation = transportation;
} }
public String getSN() {
return SN;
}
public void setSN(String SN) {
this.SN = SN;
}
public String getTDLSN() {
return TDLSN;
}
public void setTDLSN(String TDLSN) {
this.TDLSN = TDLSN;
}
} }
\ No newline at end of file
package com.example.tdl.domain.vo;
public class StartCircuitVo {
private Long startTime;
private String transportationNo;
public Long getStartTime() {
return startTime;
}
public void setStartTime(Long startTime) {
this.startTime = startTime;
}
public String getTransportationNo() {
return transportationNo;
}
public void setTransportationNo(String transportationNo) {
this.transportationNo = transportationNo;
}
}
package com.example.tdl.domain.vo;
public class TDLLogVo {
private String gSN;
private String gType;
private String TDLSN;
public String getgSN() {
return gSN;
}
public void setgSN(String gSN) {
this.gSN = gSN;
}
public String getgType() {
return gType;
}
public void setgType(String gType) {
this.gType = gType;
}
public String getTDLSN() {
return TDLSN;
}
public void setTDLSN(String TDLSN) {
this.TDLSN = TDLSN;
}
}
package com.example.tdl.domain.vo; package com.example.tdl.domain.vo;
public class UpdateCircuitVo { public class UpdateCircuitVo {
private Long endTime; private Long endTime;
private String transportationNo; private String transportationNo;
......
...@@ -4,11 +4,14 @@ public class UserNameVo { ...@@ -4,11 +4,14 @@ public class UserNameVo {
private String UserName; private String UserName;
private String time;
public UserNameVo() { public UserNameVo() {
} }
public UserNameVo(String userName) { public UserNameVo(String userName, String time) {
UserName = userName; UserName = userName;
this.time = time;
} }
public String getUserName() { public String getUserName() {
...@@ -18,4 +21,12 @@ public class UserNameVo { ...@@ -18,4 +21,12 @@ public class UserNameVo {
public void setUserName(String userName) { public void setUserName(String userName) {
UserName = userName; UserName = userName;
} }
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
} }
...@@ -21,6 +21,8 @@ public interface CircuitMapper { ...@@ -21,6 +21,8 @@ public interface CircuitMapper {
int updateEndTime(UpdateCircuitVo updateCircuitVo); int updateEndTime(UpdateCircuitVo updateCircuitVo);
int updateStartTime(StartCircuitVo startCircuitVo);
int delCircuit(String transportationNo); int delCircuit(String transportationNo);
ResultCircuitVo getByTransportationNo(@Param("transportationNo") String transportationNo,@Param("companyName") String companyName); ResultCircuitVo getByTransportationNo(@Param("transportationNo") String transportationNo,@Param("companyName") String companyName);
......
...@@ -26,6 +26,7 @@ public interface TDLDeviceMapper { ...@@ -26,6 +26,7 @@ public interface TDLDeviceMapper {
List<String> getByGatewaySN(@Param("SN") String SN, @Param("type") String type); List<String> getByGatewaySN(@Param("SN") String SN, @Param("type") String type);
List<String> getTdlSN(@Param("SN") String SN, @Param("type") String type); List<String> getTdlSN(@Param("SN") String SN, @Param("type") String type);
String getTdl(@Param("SN") String SN, @Param("type") String type);
} }
package com.example.tdl.mapper; package com.example.tdl.mapper;
import com.example.tdl.domain.vo.ResultGatewayVo; import com.example.tdl.domain.vo.ResultGatewayVo;
import com.example.tdl.domain.vo.TDLLogVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper @Mapper
public interface TDLLogMapper { public interface TDLLogMapper {
ResultGatewayVo getByNo(String transportationNo); ResultGatewayVo getByNo(String transportationNo);
TDLLogVo getByTransportationNo(String transportationNo);
List<String> getTdlSN(String transportationNo);
} }
...@@ -21,7 +21,7 @@ public interface UserMapper { ...@@ -21,7 +21,7 @@ public interface UserMapper {
ResultUserVo getByEmail(@Param("email") String email,@Param("companyName") String companyName); ResultUserVo getByEmail(@Param("email") String email,@Param("companyName") String companyName);
ResultUserVo getByUserNumber(@Param("userNumber") String userNumber,@Param("companyName") String companyName); ResultUserVo getByUserNumber(String userNumber);
int addUser(AddUserVo addUserVo); int addUser(AddUserVo addUserVo);
......
...@@ -39,6 +39,10 @@ public class CircuitService { ...@@ -39,6 +39,10 @@ public class CircuitService {
return circuitMapper.updateEndTime(updateCircuitVo); return circuitMapper.updateEndTime(updateCircuitVo);
} }
public int updateStartTime(StartCircuitVo startCircuitVo){
return circuitMapper.updateStartTime(startCircuitVo);
}
public int delCircuit(String transportationNo){ public int delCircuit(String transportationNo){
return circuitMapper.delCircuit(transportationNo); return circuitMapper.delCircuit(transportationNo);
} }
......
...@@ -46,4 +46,8 @@ public class TDLDeviceService { ...@@ -46,4 +46,8 @@ public class TDLDeviceService {
public List<String> getTdlSN(String SN,String type){ public List<String> getTdlSN(String SN,String type){
return tdlDeviceMapper.getTdlSN(SN,type); return tdlDeviceMapper.getTdlSN(SN,type);
} }
public String getTdl(String SN,String type){
return tdlDeviceMapper.getTdl(SN,type);
}
} }
...@@ -2,10 +2,13 @@ package com.example.tdl.service; ...@@ -2,10 +2,13 @@ package com.example.tdl.service;
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.mapper.TDLLogMapper; import com.example.tdl.mapper.TDLLogMapper;
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;
@Service @Service
public class TDLLogService { public class TDLLogService {
...@@ -16,4 +19,12 @@ public class TDLLogService { ...@@ -16,4 +19,12 @@ public class TDLLogService {
return tdlLogMapper.getByNo(transportationNo); return tdlLogMapper.getByNo(transportationNo);
} }
public TDLLogVo getByTransportationNo(String transportationNo){
return tdlLogMapper.getByTransportationNo(transportationNo);
}
public List<String> getTdlSN(String transportationNo){
return tdlLogMapper.getTdlSN(transportationNo);
}
} }
...@@ -46,8 +46,8 @@ public class UserService { ...@@ -46,8 +46,8 @@ public class UserService {
return userMapper.getByEmail(email,companyName); return userMapper.getByEmail(email,companyName);
} }
public ResultUserVo getByUserNumber(String userNumber,String companyName){ public ResultUserVo getByUserNumber(String userNumber){
return userMapper.getByUserNumber(userNumber,companyName); return userMapper.getByUserNumber(userNumber);
} }
public int addUser(AddUserVo addUserVo){ public int addUser(AddUserVo addUserVo){
...@@ -66,7 +66,6 @@ public class UserService { ...@@ -66,7 +66,6 @@ public class UserService {
return userMapper.updatePassword(updatePasswordVo); return userMapper.updatePassword(updatePasswordVo);
} }
//登录 //登录
public String getUser(LoginUserVo loginUserVo) { public String getUser(LoginUserVo loginUserVo) {
//获取用户信息 //获取用户信息
......
...@@ -168,7 +168,6 @@ public class EquipmentBindingController { ...@@ -168,7 +168,6 @@ public class EquipmentBindingController {
ConfigVo configVo =configService.getConfig(resultTDLDeviceVo.getGatewaySN(),resultTDLDeviceVo.getGatewayType()); ConfigVo configVo =configService.getConfig(resultTDLDeviceVo.getGatewaySN(),resultTDLDeviceVo.getGatewayType());
ConfigCMDVo config = gson.fromJson(configVo.getMessage(),ConfigCMDVo.class); ConfigCMDVo config = gson.fromJson(configVo.getMessage(),ConfigCMDVo.class);
ConfigCMDVo configCMDVo ; ConfigCMDVo configCMDVo ;
Boolean untie = false;
if(devList.size()>1){ if(devList.size()>1){
devList.remove(TDLSN); devList.remove(TDLSN);
configCMDVo = new ConfigCMDVo("config",config.getGpsPeriod(),config.getGprsPeriod(),devList,config.getMode(),System.currentTimeMillis()/1000l); configCMDVo = new ConfigCMDVo("config",config.getGpsPeriod(),config.getGprsPeriod(),devList,config.getMode(),System.currentTimeMillis()/1000l);
...@@ -179,6 +178,7 @@ public class EquipmentBindingController { ...@@ -179,6 +178,7 @@ public class EquipmentBindingController {
map.put("gSN",resultTDLDeviceVo.getGatewaySN()); map.put("gSN",resultTDLDeviceVo.getGatewaySN());
map.put("gType",resultTDLDeviceVo.getGatewayType()); map.put("gType",resultTDLDeviceVo.getGatewayType());
map.put("message",gson.toJson(configCMDVo)); map.put("message",gson.toJson(configCMDVo));
map.put("untie",true);
map.put("TDLSN",TDLSN); map.put("TDLSN",TDLSN);
map.put("endTime",System.currentTimeMillis()); map.put("endTime",System.currentTimeMillis());
configService.updateConfig(map); configService.updateConfig(map);
......
...@@ -62,7 +62,7 @@ public class GatewayController { ...@@ -62,7 +62,7 @@ public class GatewayController {
" type:网关类型," + " type:网关类型," +
" state:网关状态," + " state:网关状态," +
" bConfig:是否配置通道," + " bConfig:是否配置通道," +
" useScene:使用场景") " useScene:使用场景(0为空闲,1为运输,2为仓库)")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType="header", name = "Account_token", value = "token", required = true, dataType = "String"), @ApiImplicitParam(paramType="header", name = "Account_token", value = "token", required = true, dataType = "String"),
}) })
......
...@@ -77,7 +77,10 @@ public class HomePageController { ...@@ -77,7 +77,10 @@ public class HomePageController {
"endTime:到达时间;" + "endTime:到达时间;" +
"lng:当前经度;" + "lng:当前经度;" +
"lat:当前纬度;" + "lat:当前纬度;" +
"time:当前时间;}") "time:当前时间;}" +
"histogramDataList{" +
" classify: 种类(1-温度,2-湿度,3-震动,4-倾角,5-延误,6-离线)" +
" count:数量}")
@PostMapping("/getAll") @PostMapping("/getAll")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType="header", name = "Account_token", value = "token", required = true, dataType = "String"), @ApiImplicitParam(paramType="header", name = "Account_token", value = "token", required = true, dataType = "String"),
...@@ -92,12 +95,15 @@ public class HomePageController { ...@@ -92,12 +95,15 @@ public class HomePageController {
HomePageDataVo dataVo = new HomePageDataVo(); HomePageDataVo dataVo = new HomePageDataVo();
//获取所有的线路数量 //获取所有的线路数量
dataVo.setSum(circuitService.getCount(time,user.getCompanyName()));//总数量 dataVo.setSum(circuitService.getCount(time,user.getCompanyName()));//总数量
//获取近几天的线路信息
dataVo.setOnRoute(circuitService.getOnRoute(time,user.getCompanyName()));//在途数量 dataVo.setOnRoute(circuitService.getOnRoute(time,user.getCompanyName()));//在途数量
dataVo.setDelay(circuitService.getDelayCount(System.currentTimeMillis(),time,user.getCompanyName()));//延误数量 dataVo.setDelay(circuitService.getDelayCount(System.currentTimeMillis(),time,user.getCompanyName()));//延误数量
dataVo.setAlarmed( alarmLogServcie.getCount(time));//报警数量 dataVo.setAlarmed( alarmLogServcie.getCount(time));//报警数量
dataVo.setBump(alarmLogServcie.getBumpCount(time)); //获取颠簸数量 dataVo.setBump(alarmLogServcie.getBumpCount(time)); //获取颠簸数量
dataVo.setAlarmLogVoList(alarmLogServcie.getAlarmLog(time));//报警列表 dataVo.setAlarmLogVoList(alarmLogServcie.getAlarmLog(time));//报警列表
List<HistogramData> list = alarmLogServcie.getByCount(time);//获取报警柱状图 List<HistogramData> list = alarmLogServcie.getByCount(time);//获取报警柱状图
dataVo.setHistogramDataList(list);
//获取设备的当前位置 //获取设备的当前位置
List<ResultCircuitVo> circuitVos = circuitService.getByTime(time,user.getCompanyName()); List<ResultCircuitVo> circuitVos = circuitService.getByTime(time,user.getCompanyName());
List<CircuitVo> circuitList = new ArrayList<>(); List<CircuitVo> circuitList = new ArrayList<>();
......
...@@ -43,7 +43,7 @@ public class TDLDeviceController { ...@@ -43,7 +43,7 @@ public class TDLDeviceController {
" TDLSN:TDL序列号," + " TDLSN:TDL序列号," +
" counts:使用次数," + " counts:使用次数," +
" lastTime:最后使用时间," + " lastTime:最后使用时间," +
" useScene:使用场景(0为空闲,1为仓库,2为运输)," + " useScene:使用场景(0为空闲,1为运输,2为仓库)," +
" warehouseName:仓库名," + " warehouseName:仓库名," +
" transportationNo:运输编号," + " transportationNo:运输编号," +
" gatewaySN:网关序列号," + " gatewaySN:网关序列号," +
......
...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON; ...@@ -5,6 +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.CompanyService;
import com.example.tdl.service.RoleHasPermissionService; import com.example.tdl.service.RoleHasPermissionService;
import com.example.tdl.service.RoleService; import com.example.tdl.service.RoleService;
...@@ -44,7 +45,8 @@ public class UserController { ...@@ -44,7 +45,8 @@ public class UserController {
@Autowired @Autowired
private RoleService roleService; private RoleService roleService;
@Autowired
private CompanyService companyService;
//获取所有用户信息 //获取所有用户信息
...@@ -176,6 +178,16 @@ public class UserController { ...@@ -176,6 +178,16 @@ public class UserController {
fb.setMessage("没有该角色"); fb.setMessage("没有该角色");
return gson.toJson(fb); return gson.toJson(fb);
} }
if (StringUtils.isEmpty(userVo.getCompanyName())){
fb.setCode(0);
fb.setMessage("公司名不能为空");
return gson.toJson(fb);
}
if (companyService.getByCompanyName(userVo.getCompanyName())==null){
fb.setCode(0);
fb.setMessage("没有该公司");
return gson.toJson(fb);
}
String userNumber="U"+System.currentTimeMillis(); String userNumber="U"+System.currentTimeMillis();
userVo.setUserNumber(userNumber); userVo.setUserNumber(userNumber);
userVo.setCreateTime(System.currentTimeMillis()); userVo.setCreateTime(System.currentTimeMillis());
...@@ -207,7 +219,12 @@ public class UserController { ...@@ -207,7 +219,12 @@ public class UserController {
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);
ResultUserVo userInfo=userService.getByUserNumber(userVo.getUserNumber(),user.getCompanyName()); if (StringUtils.isEmpty(userVo.getUserNumber())){
fb.setCode(0);
fb.setMessage("用户编号不能为空");
return gson.toJson(fb);
}
ResultUserVo userInfo=userService.getByUserNumber(userVo.getUserNumber());
if (StringUtils.isEmpty(userVo.getNickName())){ if (StringUtils.isEmpty(userVo.getNickName())){
fb.setCode(0); fb.setCode(0);
fb.setMessage("昵称不能为空"); fb.setMessage("昵称不能为空");
...@@ -223,7 +240,7 @@ public class UserController { ...@@ -223,7 +240,7 @@ public class UserController {
fb.setMessage("手机号不规范"); fb.setMessage("手机号不规范");
return gson.toJson(fb); return gson.toJson(fb);
} }
if (userInfo!=null&&userInfo.getPhone().equals(userVo.getPhone())){ if (userInfo!=null&& !userInfo.getPhone().equals(userVo.getPhone()) && userService.getByPhone(user.getPhone(),userInfo.getCompanyName()) !=null){
fb.setCode(0); fb.setCode(0);
fb.setMessage("该手机号已被注册"); fb.setMessage("该手机号已被注册");
return gson.toJson(fb); return gson.toJson(fb);
...@@ -238,7 +255,7 @@ public class UserController { ...@@ -238,7 +255,7 @@ public class UserController {
fb.setMessage("邮箱格式不规范"); fb.setMessage("邮箱格式不规范");
return gson.toJson(fb); return gson.toJson(fb);
} }
if (userInfo!=null&&userInfo.getEmail().equals(userVo.getEmail())){ if (userInfo!=null && !userInfo.getEmail().equals(userVo.getEmail()) && userService.getByEmail(userVo.getEmail(),userInfo.getCompanyName()) !=null){
fb.setCode(0); fb.setCode(0);
fb.setMessage("该邮箱已被注册"); fb.setMessage("该邮箱已被注册");
return gson.toJson(fb); return gson.toJson(fb);
...@@ -248,11 +265,7 @@ public class UserController { ...@@ -248,11 +265,7 @@ public class UserController {
fb.setMessage("角色名不能为空"); fb.setMessage("角色名不能为空");
return gson.toJson(fb); return gson.toJson(fb);
} }
if (StringUtils.isEmpty(userVo.getUserNumber())){
fb.setCode(0);
fb.setMessage("需要修改的用户编号不能为空");
return gson.toJson(fb);
}
if (roleService.getByRoleName(userVo.getRoleName())==0){ if (roleService.getByRoleName(userVo.getRoleName())==0){
fb.setCode(0); fb.setCode(0);
fb.setMessage("修改的角色名不存在"); fb.setMessage("修改的角色名不存在");
...@@ -359,7 +372,7 @@ public class UserController { ...@@ -359,7 +372,7 @@ public class UserController {
public Object getUserName(HttpServletRequest request){ public Object getUserName(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);
return new UserNameVo(gson.fromJson(datum,UserRedisVo.class).getUserName()); return new UserNameVo(gson.fromJson(datum,UserRedisVo.class).getUserName(),System.currentTimeMillis()+"");
} }
} }
...@@ -49,7 +49,6 @@ tdl.mqtt.cacrt = ca.crt ...@@ -49,7 +49,6 @@ tdl.mqtt.cacrt = ca.crt
tdl.mqtt.clientkey = witcd.pem tdl.mqtt.clientkey = witcd.pem
tdl.mqtt.clientcrt = witcd.crt tdl.mqtt.clientcrt = witcd.crt
# InfluxDB # InfluxDB
spring.influxdb.username=admin spring.influxdb.username=admin
spring.influxdb.password=37774020 spring.influxdb.password=37774020
......
...@@ -44,25 +44,22 @@ ...@@ -44,25 +44,22 @@
</select> </select>
<select id = "getByCount" parameterType="String" resultType="com.example.tdl.domain.vo.HistogramData" > <select id = "getByCount" parameterType="String" resultType="com.example.tdl.domain.vo.HistogramData" >
SELECT classify,count(description) FROM alarm_log WHERE classify = "1" SELECT ifnull(classify,"1") classify,count(description) count FROM alarm_log WHERE classify = "1"
AND DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(alarmTime/1000,'%Y-%m-%d %H:%i:%s')) AND DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(alarmTime/1000,'%Y-%m-%d %H:%i:%s'))
UNION ALL UNION ALL
SELECT classify,count(description) FROM alarm_log WHERE classify = "3" SELECT ifnull(classify,"2") classify,count(description) count FROM alarm_log WHERE classify = "2"
AND DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(alarmTime/1000,'%Y-%m-%d %H:%i:%s')) AND DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(alarmTime/1000,'%Y-%m-%d %H:%i:%s'))
UNION ALL UNION ALL
SELECT classify,count(description) FROM alarm_log WHERE classify = "2" SELECT ifnull(classify,"3") classify,count(description) count FROM alarm_log WHERE classify = "3"
AND DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(alarmTime/1000,'%Y-%m-%d %H:%i:%s')) AND DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(alarmTime/1000,'%Y-%m-%d %H:%i:%s'))
UNION ALL UNION ALL
SELECT classify,count(description) FROM alarm_log WHERE classify = "5" SELECT ifnull(classify,"4") classify,count(description) count FROM alarm_log WHERE classify = "4"
AND DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(alarmTime/1000,'%Y-%m-%d %H:%i:%s')) AND DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(alarmTime/1000,'%Y-%m-%d %H:%i:%s'))
UNION ALL UNION ALL
SELECT classify,count(description) FROM alarm_log WHERE classify = "4" SELECT ifnull(classify,"5") classify,count(description) count FROM alarm_log WHERE classify = "5"
AND DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(alarmTime/1000,'%Y-%m-%d %H:%i:%s')) AND DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(alarmTime/1000,'%Y-%m-%d %H:%i:%s'))
UNION ALL UNION ALL
SELECT classify,count(description) FROM alarm_log WHERE classify = "6" SELECT ifnull(classify,"6") classify,count(description) count FROM alarm_log WHERE classify = "6"
AND DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(alarmTime/1000,'%Y-%m-%d %H:%i:%s'))
UNION ALL
SELECT classify,count(description) FROM alarm_log WHERE classify = "倾角"
AND DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(alarmTime/1000,'%Y-%m-%d %H:%i:%s')) AND DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(alarmTime/1000,'%Y-%m-%d %H:%i:%s'))
</select> </select>
......
...@@ -152,6 +152,12 @@ ...@@ -152,6 +152,12 @@
WHERE transportationNo=#{transportationNo,jdbcType=VARCHAR} WHERE transportationNo=#{transportationNo,jdbcType=VARCHAR}
</update> </update>
<update id="updateStartTime" parameterType="com.example.tdl.domain.vo.StartCircuitVo">
UPDATE circuit set
startTime=#{startTime,jdbcType=BIGINT},circuitState=1
WHERE transportationNo=#{transportationNo,jdbcType=VARCHAR}
</update>
<!--删除线路--> <!--删除线路-->
<delete id="delCircuit" parameterType="String"> <delete id="delCircuit" parameterType="String">
UPDATE circuit set state=0 UPDATE circuit set state=0
...@@ -163,8 +169,10 @@ ...@@ -163,8 +169,10 @@
SELECT c.transportationNo,cargoNo,(SELECT city from city WHERE id =(SELECT city_id from circuit_transfer WHERE circuit_id=c.id ORDER BY sequence LIMIT 1)) startCity,startTime, SELECT c.transportationNo,cargoNo,(SELECT city from city WHERE id =(SELECT city_id from circuit_transfer WHERE circuit_id=c.id ORDER BY sequence LIMIT 1)) startCity,startTime,
(SELECT city from city WHERE id =(SELECT city_id from circuit_transfer WHERE circuit_id=c.id ORDER BY sequence DESC LIMIT 1)) endCity,endTime,circuitState, (SELECT city from city WHERE id =(SELECT city_id from circuit_transfer WHERE circuit_id=c.id ORDER BY sequence DESC LIMIT 1)) endCity,endTime,circuitState,
(SELECT alarmType FROM alarm WHERE id IN (SELECT alarm_id from tdl_gateway_log WHERE transportationNo=c.transportationNo)) alarmType, (SELECT alarmType FROM alarm WHERE id IN (SELECT alarm_id from tdl_gateway_log WHERE transportationNo=c.transportationNo)) alarmType,
(select GROUP_CONCAT(DISTINCT classify) from alarm_log al where al.transportationNo = c.transportationNo) alarm,ifnull(evaluate,"") evaluate,transportation (select GROUP_CONCAT(DISTINCT classify) from alarm_log al where al.transportationNo = c.transportationNo) alarm,ifnull(evaluate,"") evaluate,transportation,
from circuit c where c.state=1 (select gatewaySN FROM tdl_gateway_log WHERE transportationNo= #{transportationNo,jdbcType=VARCHAR} ) SN,(SELECT GROUP_CONCAT(TDLSN) FROM tdl_gateway_log WHERE transportationNo= #{transportationNo,jdbcType=VARCHAR}) TDLSN
from circuit c
where c.state=1
AND c.transportationNo=#{transportationNo,jdbcType=VARCHAR} AND c.transportationNo=#{transportationNo,jdbcType=VARCHAR}
AND company_id=(SELECT id from company where companyName=#{companyName,jdbcType=VARCHAR}) AND company_id=(SELECT id from company where companyName=#{companyName,jdbcType=VARCHAR})
</select> </select>
...@@ -172,7 +180,7 @@ ...@@ -172,7 +180,7 @@
<!--根据线路编号获取线路信息 app--> <!--根据线路编号获取线路信息 app-->
<select id="getByTransportationNoForApp" resultType="com.example.tdl.domain.vo.ResultCircuitForAppVo" parameterType="String"> <select id="getByTransportationNoForApp" resultType="com.example.tdl.domain.vo.ResultCircuitForAppVo" parameterType="String">
SELECT c.transportationNo,CONCAT_WS("-",(SELECT city from city WHERE id =(SELECT city_id from circuit_transfer WHERE circuit_id=c.id AND sequence =LEFT(s.sequence,1))),(SELECT city from city WHERE id =(SELECT city_id from circuit_transfer WHERE circuit_id=c.id AND sequence=RIGHT(s.sequence,1)))) city, SELECT c.transportationNo,CONCAT_WS("-",(SELECT city from city WHERE id =(SELECT city_id from circuit_transfer WHERE circuit_id=c.id AND sequence =LEFT(s.sequence,1))),(SELECT city from city WHERE id =(SELECT city_id from circuit_transfer WHERE circuit_id=c.id AND sequence=RIGHT(s.sequence,1)))) city,
cargoNo,plateNo,deliveryAddress,transportation,transportationType,remark cargoNo,plateNo,deliveryAddress,transportation,transportationType,(select gatewaySN FROM tdl_gateway_log WHERE transportationNo= #{transportationNo,jdbcType=VARCHAR} ) SN,(SELECT GROUP_CONCAT(TDLSN) FROM tdl_gateway_log WHERE transportationNo= #{transportationNo,jdbcType=VARCHAR}) TDLSN,remark
from circuit c,(SELECT GROUP_CONCAT(sequence) sequence from circuit_transfer where circuit_id=(SELECT id from circuit where transportationNo=#{transportationNo,jdbcType=VARCHAR})) s from circuit c,(SELECT GROUP_CONCAT(sequence) sequence from circuit_transfer where circuit_id=(SELECT id from circuit where transportationNo=#{transportationNo,jdbcType=VARCHAR})) s
where c.state=1 where c.state=1
AND c.transportationNo=#{transportationNo,jdbcType=VARCHAR} AND c.transportationNo=#{transportationNo,jdbcType=VARCHAR}
...@@ -181,7 +189,7 @@ ...@@ -181,7 +189,7 @@
<!-- 运输中数量--> <!-- 运输中数量-->
<select id="getOnRoute" resultType="java.lang.Integer" parameterType="String"> <select id="getOnRoute" resultType="java.lang.Integer" parameterType="String">
select count(startTime) from circuit where circuitState=1 select count(startTime) from circuit where circuitState=1 AND state = 1
and DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(createTime/1000,'%Y-%m-%d %H:%i:%s')) and DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(createTime/1000,'%Y-%m-%d %H:%i:%s'))
AND company_id=(SELECT id from company where companyName=#{companyName,jdbcType=VARCHAR}) AND company_id=(SELECT id from company where companyName=#{companyName,jdbcType=VARCHAR})
</select> </select>
...@@ -189,7 +197,8 @@ ...@@ -189,7 +197,8 @@
<!--延误数量--> <!--延误数量-->
<select id="getDelayCount" resultType="java.lang.Integer" > <select id="getDelayCount" resultType="java.lang.Integer" >
select count(id) from circuit where state =1 select count(id) from circuit where state =1
and endtime &lt;=compTime or compTime >= #{compTime,jdbcType=BIGINT} and endtime &lt; compTime or compTime &lt; #{compTime,jdbcType=BIGINT}
and DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(createTime/1000,'%Y-%m-%d %H:%i:%s'))
AND company_id=(SELECT id from company where companyName=#{companyName,jdbcType=VARCHAR}) AND company_id=(SELECT id from company where companyName=#{companyName,jdbcType=VARCHAR})
</select> </select>
...@@ -198,6 +207,7 @@ ...@@ -198,6 +207,7 @@
select count(id) from circuit select count(id) from circuit
where DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(createTime/1000,'%Y-%m-%d %H:%i:%s')) where DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(createTime/1000,'%Y-%m-%d %H:%i:%s'))
AND company_id=(SELECT id from company where companyName=#{companyName,jdbcType=VARCHAR}) AND company_id=(SELECT id from company where companyName=#{companyName,jdbcType=VARCHAR})
AND state =1
</select> </select>
<!--根据车牌号查线路--> <!--根据车牌号查线路-->
...@@ -210,7 +220,6 @@ ...@@ -210,7 +220,6 @@
AND company_id=(SELECT id from company where companyName=#{companyName,jdbcType=VARCHAR}) AND company_id=(SELECT id from company where companyName=#{companyName,jdbcType=VARCHAR})
</select> </select>
<!--根据运输状态查询线路信息--> <!--根据运输状态查询线路信息-->
<select id="getByCircuitState" resultType="com.example.tdl.domain.vo.ResultCircuitVo"> <select id="getByCircuitState" resultType="com.example.tdl.domain.vo.ResultCircuitVo">
SELECT c.transportationNo,cargoNo,(SELECT city from city WHERE id =(SELECT city_id from circuit_transfer WHERE circuit_id=c.id ORDER BY sequence LIMIT 1)) startCity,startTime, SELECT c.transportationNo,cargoNo,(SELECT city from city WHERE id =(SELECT city_id from circuit_transfer WHERE circuit_id=c.id ORDER BY sequence LIMIT 1)) startCity,startTime,
...@@ -245,6 +254,7 @@ ...@@ -245,6 +254,7 @@
(SELECT alarmType FROM alarm WHERE id IN (SELECT alarm_id from tdl_gateway_log WHERE transportationNo=c.transportationNo)) alarmType, (SELECT alarmType FROM alarm WHERE id IN (SELECT alarm_id from tdl_gateway_log WHERE transportationNo=c.transportationNo)) alarmType,
(select GROUP_CONCAT(DISTINCT classify) from alarm_log al where al.transportationNo = c.transportationNo) alarm,evaluate,transportation (select GROUP_CONCAT(DISTINCT classify) from alarm_log al where al.transportationNo = c.transportationNo) alarm,evaluate,transportation
from circuit c where c.state=1 from circuit c where c.state=1
and c.circuitState = 1
AND company_id=(SELECT id from company where companyName=#{companyName,jdbcType=VARCHAR}) AND company_id=(SELECT id from company where companyName=#{companyName,jdbcType=VARCHAR})
AND DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(createTime/1000,'%Y-%m-%d %H:%i:%s')) AND DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(createTime/1000,'%Y-%m-%d %H:%i:%s'))
</select> </select>
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#{gSN,mode=IN,jdbcType=VARCHAR}, #{gSN,mode=IN,jdbcType=VARCHAR},
#{gType,mode=IN,jdbcType=VARCHAR}, #{gType,mode=IN,jdbcType=VARCHAR},
#{message,mode=IN,jdbcType=VARCHAR}, #{message,mode=IN,jdbcType=VARCHAR},
#{untie,mode=IN,jdbcType=INTEGER},
#{TDLSN,mode=IN,jdbcType=VARCHAR}, #{TDLSN,mode=IN,jdbcType=VARCHAR},
#{endTime,mode=IN,jdbcType=BIGINT}, #{endTime,mode=IN,jdbcType=BIGINT},
#{msg,mode=OUT,jdbcType=VARCHAR} #{msg,mode=OUT,jdbcType=VARCHAR}
......
...@@ -69,4 +69,11 @@ ...@@ -69,4 +69,11 @@
and g.SN =#{SN,jdbcType=VARCHAR} and g.SN =#{SN,jdbcType=VARCHAR}
and g.type=#{type,jdbcType=VARCHAR} and g.type=#{type,jdbcType=VARCHAR}
</select> </select>
<select id="getTdl" parameterType="String" resultType="String">
select GROUP_CONCAT(TDLSN) from tdldevice t,gateway g
where t.gateway_id = g.id
and g.SN =#{SN,jdbcType=VARCHAR}
and g.type=#{type,jdbcType=VARCHAR}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -6,4 +6,16 @@ ...@@ -6,4 +6,16 @@
where transportationNo = #{transportationNo,jdbcType=VARCHAR} where transportationNo = #{transportationNo,jdbcType=VARCHAR}
GROUP BY gatewaySN GROUP BY gatewaySN
</select> </select>
<select id="getByTransportationNo" parameterType="String" resultType="com.example.tdl.domain.vo.TDLLogVo">
select gatewaySN gSN,gatewayType gType, GROUP_CONCAT(TDLSN) TDLSN
from tdl_gateway_log
where transportationNo = #{transportationNo,jdbcType=VARCHAR}
</select>
<select id="getTdlSN" parameterType="String" resultType="String">
select CONCAT("TDL-",TDLSN) TDLSN
from tdl_gateway_log
where transportationNo = #{transportationNo,jdbcType=VARCHAR}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<mapper namespace="com.example.tdl.mapper.UserMapper"> <mapper namespace="com.example.tdl.mapper.UserMapper">
<!--登录--> <!--登录-->
<select id="login" parameterType="com.example.tdl.domain.vo.LoginUserVo" resultType="java.lang.Integer"> <select id="login" parameterType="com.example.tdl.domain.vo.LoginUserVo" resultType="java.lang.Integer">
SELECT COUNT(*) from USER SELECT COUNT(userName) from USER
WHERE userName=#{userName,jdbcType=VARCHAR} WHERE userName=#{userName,jdbcType=VARCHAR}
AND password=#{password,jdbcType=VARCHAR} AND password=#{password,jdbcType=VARCHAR}
AND state=1 AND state=1
...@@ -73,7 +73,6 @@ ...@@ -73,7 +73,6 @@
select userNumber, userName,password,nickName,phone,email,roleName,c.companyName select userNumber, userName,password,nickName,phone,email,roleName,c.companyName
from company c,`user` u INNER JOIN role r ON u.role_id=r.id from company c,`user` u INNER JOIN role r ON u.role_id=r.id
WHERE u.company_id=c.id WHERE u.company_id=c.id
AND c.companyName=#{companyName,jdbcType=VARCHAR}
AND userNumber=#{userNumber,jdbcType=VARCHAR} AND userNumber=#{userNumber,jdbcType=VARCHAR}
AND u.state=1 AND u.state=1
</select> </select>
......
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