Commit aef092bd authored by chenying's avatar chenying

3.15线路的增删改查和路由的修改

parent 26c69007
This diff is collapsed.
package com.example.tdl.domain.vo;
public class AddCircuitVo {
private String routeNumber;
private String startCountry;
private String startProvince;
private String startCity;
private String endCountry;
private String endProvince;
private String endCity;
private String transport;
private String rRemark;
private String startLongitude;
private String startLatitude;
private String startAddress;
private String endLongitude;
private String endLatitude;
private String endAddress;
private String boxNo;
private String containerNo;
private String deliveryAddress;
private String transportationType;
private String remark;
public String getrRemark() {
return rRemark;
}
public void setrRemark(String rRemark) {
this.rRemark = rRemark;
}
public String getRouteNumber() {
return routeNumber;
}
public void setRouteNumber(String routeNumber) {
this.routeNumber = routeNumber;
}
public String getStartCountry() {
return startCountry;
}
public void setStartCountry(String startCountry) {
this.startCountry = startCountry;
}
public String getStartProvince() {
return startProvince;
}
public void setStartProvince(String startProvince) {
this.startProvince = startProvince;
}
public String getStartCity() {
return startCity;
}
public void setStartCity(String startCity) {
this.startCity = startCity;
}
public String getEndCountry() {
return endCountry;
}
public void setEndCountry(String endCountry) {
this.endCountry = endCountry;
}
public String getEndProvince() {
return endProvince;
}
public void setEndProvince(String endProvince) {
this.endProvince = endProvince;
}
public String getEndCity() {
return endCity;
}
public void setEndCity(String endCity) {
this.endCity = endCity;
}
public String getTransport() {
return transport;
}
public void setTransport(String transport) {
this.transport = transport;
}
public String getStartLongitude() {
return startLongitude;
}
public void setStartLongitude(String startLongitude) {
this.startLongitude = startLongitude;
}
public String getStartLatitude() {
return startLatitude;
}
public void setStartLatitude(String startLatitude) {
this.startLatitude = startLatitude;
}
public String getStartAddress() {
return startAddress;
}
public void setStartAddress(String startAddress) {
this.startAddress = startAddress;
}
public String getEndLongitude() {
return endLongitude;
}
public void setEndLongitude(String endLongitude) {
this.endLongitude = endLongitude;
}
public String getEndLatitude() {
return endLatitude;
}
public void setEndLatitude(String endLatitude) {
this.endLatitude = endLatitude;
}
public String getEndAddress() {
return endAddress;
}
public void setEndAddress(String endAddress) {
this.endAddress = endAddress;
}
public String getBoxNo() {
return boxNo;
}
public void setBoxNo(String boxNo) {
this.boxNo = boxNo;
}
public String getContainerNo() {
return containerNo;
}
public void setContainerNo(String containerNo) {
this.containerNo = containerNo;
}
public String getDeliveryAddress() {
return deliveryAddress;
}
public void setDeliveryAddress(String deliveryAddress) {
this.deliveryAddress = deliveryAddress;
}
public String getTransportationType() {
return transportationType;
}
public void setTransportationType(String transportationType) {
this.transportationType = transportationType;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
}
......@@ -2,52 +2,22 @@ package com.example.tdl.domain.vo;
public class AddRouteVo {
private String startLongitude;
private String startLatitude;
private String startCountry;
private String startProvince;
private String startCity;
private String startAddress;
private String endLongitude;
private String endLatitude;
private String endCountry;
private String endProvince;
private String endCity;
private String endAddress;
private String transport;
private String transportRemark;
private String remark;
public String getStartLongitude() {
return startLongitude;
}
public void setStartLongitude(String startLongitude) {
this.startLongitude = startLongitude;
}
public String getStartLatitude() {
return startLatitude;
}
public void setStartLatitude(String startLatitude) {
this.startLatitude = startLatitude;
}
public String getStartCountry() {
return startCountry;
}
......@@ -72,30 +42,6 @@ public class AddRouteVo {
this.startCity = startCity;
}
public String getStartAddress() {
return startAddress;
}
public void setStartAddress(String startAddress) {
this.startAddress = startAddress;
}
public String getEndLongitude() {
return endLongitude;
}
public void setEndLongitude(String endLongitude) {
this.endLongitude = endLongitude;
}
public String getEndLatitude() {
return endLatitude;
}
public void setEndLatitude(String endLatitude) {
this.endLatitude = endLatitude;
}
public String getEndCountry() {
return endCountry;
}
......@@ -120,14 +66,6 @@ public class AddRouteVo {
this.endCity = endCity;
}
public String getEndAddress() {
return endAddress;
}
public void setEndAddress(String endAddress) {
this.endAddress = endAddress;
}
public String getTransport() {
return transport;
}
......@@ -136,14 +74,6 @@ public class AddRouteVo {
this.transport = transport;
}
public String getTransportRemark() {
return transportRemark;
}
public void setTransportRemark(String transportRemark) {
this.transportRemark = transportRemark;
}
public String getRemark() {
return remark;
}
......
package com.example.tdl.domain.vo;
public class CircuitTermVo {
private String transportationNo;
private String routeNumber;
private Integer alarmType;
private Integer circuitState;
private String startCity;
private String endCity;
private Long startTimeMin;
private Long startTimeMax;
private Long endTimeMin;
private Long endTimeMax;
public String getTransportationNo() {
return transportationNo;
}
public void setTransportationNo(String transportationNo) {
this.transportationNo = transportationNo;
}
public String getRouteNumber() {
return routeNumber;
}
public void setRouteNumber(String routeNumber) {
this.routeNumber = routeNumber;
}
public Integer getAlarmType() {
return alarmType;
}
public void setAlarmType(Integer alarmType) {
this.alarmType = alarmType;
}
public Integer getCircuitState() {
return circuitState;
}
public void setCircuitState(Integer circuitState) {
this.circuitState = circuitState;
}
public String getStartCity() {
return startCity;
}
public void setStartCity(String startCity) {
this.startCity = startCity;
}
public String getEndCity() {
return endCity;
}
public void setEndCity(String endCity) {
this.endCity = endCity;
}
public Long getStartTimeMin() {
return startTimeMin;
}
public void setStartTimeMin(Long startTimeMin) {
this.startTimeMin = startTimeMin;
}
public Long getStartTimeMax() {
return startTimeMax;
}
public void setStartTimeMax(Long startTimeMax) {
this.startTimeMax = startTimeMax;
}
public Long getEndTimeMin() {
return endTimeMin;
}
public void setEndTimeMin(Long endTimeMin) {
this.endTimeMin = endTimeMin;
}
public Long getEndTimeMax() {
return endTimeMax;
}
public void setEndTimeMax(Long endTimeMax) {
this.endTimeMax = endTimeMax;
}
}
package com.example.tdl.domain.vo;
public class ResultCircuitVo {
private String transportationNo;
private String routeNumber;
private String routeName;
private String startLongitude;
private String startLatitude;
private String startCity;
private String startAddress;
private String startTime;
private String endLongitude;
private String endLatitude;
private String endCity;
private String endAddress;
private String endTime;
private String transport;
private String alarmType;
private String boxNo;
private String containerNo;
private String deliveryAddress;
private String transportationType;
private int circuitState;
private String remark;
public String getStartLongitude() {
return startLongitude;
}
public void setStartLongitude(String startLongitude) {
this.startLongitude = startLongitude;
}
public String getStartLatitude() {
return startLatitude;
}
public void setStartLatitude(String startLatitude) {
this.startLatitude = startLatitude;
}
public String getStartAddress() {
return startAddress;
}
public void setStartAddress(String startAddress) {
this.startAddress = startAddress;
}
public String getEndLongitude() {
return endLongitude;
}
public void setEndLongitude(String endLongitude) {
this.endLongitude = endLongitude;
}
public String getEndLatitude() {
return endLatitude;
}
public void setEndLatitude(String endLatitude) {
this.endLatitude = endLatitude;
}
public String getEndAddress() {
return endAddress;
}
public void setEndAddress(String endAddress) {
this.endAddress = endAddress;
}
public String getTransport() {
return transport;
}
public void setTransport(String transport) {
this.transport = transport;
}
public String getBoxNo() {
return boxNo;
}
public void setBoxNo(String boxNo) {
this.boxNo = boxNo;
}
public String getContainerNo() {
return containerNo;
}
public void setContainerNo(String containerNo) {
this.containerNo = containerNo;
}
public String getDeliveryAddress() {
return deliveryAddress;
}
public void setDeliveryAddress(String deliveryAddress) {
this.deliveryAddress = deliveryAddress;
}
public String getTransportationType() {
return transportationType;
}
public void setTransportationType(String transportationType) {
this.transportationType = transportationType;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getTransportationNo() {
return transportationNo;
}
public void setTransportationNo(String transportationNo) {
this.transportationNo = transportationNo;
}
public String getRouteNumber() {
return routeNumber;
}
public void setRouteNumber(String routeNumber) {
this.routeNumber = routeNumber;
}
public String getRouteName() {
return routeName;
}
public void setRouteName(String routeName) {
this.routeName = routeName;
}
public String getStartCity() {
return startCity;
}
public void setStartCity(String startCity) {
this.startCity = startCity;
}
public String getStartTime() {
return startTime;
}
public void setStartTime(String startTime) {
this.startTime = startTime;
}
public String getEndCity() {
return endCity;
}
public void setEndCity(String endCity) {
this.endCity = endCity;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
public String getAlarmType() {
return alarmType;
}
public void setAlarmType(String alarmType) {
this.alarmType = alarmType;
}
public int getCircuitState() {
return circuitState;
}
public void setCircuitState(int circuitState) {
this.circuitState = circuitState;
}
}
......@@ -5,36 +5,20 @@ public class ResultRouteVo {
private String routeName;
private String abbreviation;
private String startLongitude;
private String startLatitude;
private String startCountry;
private String startProvince;
private String startCity;
private String startAddress;
private String endLongitude;
private String endLatitude;
private String endCountry;
private String endProvince;
private String endCity;
private String endAddress;
private String transport;
private String transportRemark;
private String remark;
public String getRouteNumber() {
......@@ -53,30 +37,6 @@ public class ResultRouteVo {
this.routeName = routeName;
}
public String getAbbreviation() {
return abbreviation;
}
public void setAbbreviation(String abbreviation) {
this.abbreviation = abbreviation;
}
public String getStartLongitude() {
return startLongitude;
}
public void setStartLongitude(String startLongitude) {
this.startLongitude = startLongitude;
}
public String getStartLatitude() {
return startLatitude;
}
public void setStartLatitude(String startLatitude) {
this.startLatitude = startLatitude;
}
public String getStartCountry() {
return startCountry;
}
......@@ -101,30 +61,6 @@ public class ResultRouteVo {
this.startCity = startCity;
}
public String getStartAddress() {
return startAddress;
}
public void setStartAddress(String startAddress) {
this.startAddress = startAddress;
}
public String getEndLongitude() {
return endLongitude;
}
public void setEndLongitude(String endLongitude) {
this.endLongitude = endLongitude;
}
public String getEndLatitude() {
return endLatitude;
}
public void setEndLatitude(String endLatitude) {
this.endLatitude = endLatitude;
}
public String getEndCountry() {
return endCountry;
}
......@@ -149,14 +85,6 @@ public class ResultRouteVo {
this.endCity = endCity;
}
public String getEndAddress() {
return endAddress;
}
public void setEndAddress(String endAddress) {
this.endAddress = endAddress;
}
public String getTransport() {
return transport;
}
......@@ -165,14 +93,6 @@ public class ResultRouteVo {
this.transport = transport;
}
public String getTransportRemark() {
return transportRemark;
}
public void setTransportRemark(String transportRemark) {
this.transportRemark = transportRemark;
}
public String getRemark() {
return remark;
}
......
package com.example.tdl.domain.vo;
public class UpdateCircuitInfo {
private String transportationNo;
private String routeNumber;
private String startCountry;
private String startProvince;
private String startCity;
private String endCountry;
private String endProvince;
private String endCity;
private String transport;
private String rRemark;
private String startLongitude;
private String startLatitude;
private String startAddress;
private String endLongitude;
private String endLatitude;
private String endAddress;
private String boxNo;
private String containerNo;
private String deliveryAddress;
private String transportationType;
private String remark;
public String getTransportationNo() {
return transportationNo;
}
public void setTransportationNo(String transportationNo) {
this.transportationNo = transportationNo;
}
public String getRouteNumber() {
return routeNumber;
}
public void setRouteNumber(String routeNumber) {
this.routeNumber = routeNumber;
}
public String getStartCountry() {
return startCountry;
}
public void setStartCountry(String startCountry) {
this.startCountry = startCountry;
}
public String getStartProvince() {
return startProvince;
}
public void setStartProvince(String startProvince) {
this.startProvince = startProvince;
}
public String getStartCity() {
return startCity;
}
public void setStartCity(String startCity) {
this.startCity = startCity;
}
public String getEndCountry() {
return endCountry;
}
public void setEndCountry(String endCountry) {
this.endCountry = endCountry;
}
public String getEndProvince() {
return endProvince;
}
public void setEndProvince(String endProvince) {
this.endProvince = endProvince;
}
public String getEndCity() {
return endCity;
}
public void setEndCity(String endCity) {
this.endCity = endCity;
}
public String getTransport() {
return transport;
}
public void setTransport(String transport) {
this.transport = transport;
}
public String getrRemark() {
return rRemark;
}
public void setrRemark(String rRemark) {
this.rRemark = rRemark;
}
public String getStartLongitude() {
return startLongitude;
}
public void setStartLongitude(String startLongitude) {
this.startLongitude = startLongitude;
}
public String getStartLatitude() {
return startLatitude;
}
public void setStartLatitude(String startLatitude) {
this.startLatitude = startLatitude;
}
public String getStartAddress() {
return startAddress;
}
public void setStartAddress(String startAddress) {
this.startAddress = startAddress;
}
public String getEndLongitude() {
return endLongitude;
}
public void setEndLongitude(String endLongitude) {
this.endLongitude = endLongitude;
}
public String getEndLatitude() {
return endLatitude;
}
public void setEndLatitude(String endLatitude) {
this.endLatitude = endLatitude;
}
public String getEndAddress() {
return endAddress;
}
public void setEndAddress(String endAddress) {
this.endAddress = endAddress;
}
public String getBoxNo() {
return boxNo;
}
public void setBoxNo(String boxNo) {
this.boxNo = boxNo;
}
public String getContainerNo() {
return containerNo;
}
public void setContainerNo(String containerNo) {
this.containerNo = containerNo;
}
public String getDeliveryAddress() {
return deliveryAddress;
}
public void setDeliveryAddress(String deliveryAddress) {
this.deliveryAddress = deliveryAddress;
}
public String getTransportationType() {
return transportationType;
}
public void setTransportationType(String transportationType) {
this.transportationType = transportationType;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
}
package com.example.tdl.domain.vo;
public class UpdateCircuitVo {
private Long endTime;
private String transportationNo;
public Long getEndTime() {
return endTime;
}
public void setEndTime(Long endTime) {
this.endTime = endTime;
}
public String getTransportationNo() {
return transportationNo;
}
public void setTransportationNo(String transportationNo) {
this.transportationNo = transportationNo;
}
}
package com.example.tdl.domain.vo;
public class UpdatePasswordVo {
private String userNumber;
private String password;
public String getUserNumber() {
return userNumber;
}
public void setUserNumber(String userNumber) {
this.userNumber = userNumber;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
......@@ -21,10 +21,78 @@ public class Circuit implements Serializable {
private Long endTime;
private Alarm alarm;
private String boxNo;
private String containerNo;
private String deliveryAddress;
private String transportationType;
private boolean circuitState;//线路完成状态
private String routeNumber;
private String remark;
public Serializable getSerializable() {
return serializable;
}
public void setSerializable(Serializable serializable) {
this.serializable = serializable;
}
public Alarm getAlarm() {
return alarm;
}
public void setAlarm(Alarm alarm) {
this.alarm = alarm;
}
public String getBoxNo() {
return boxNo;
}
public void setBoxNo(String boxNo) {
this.boxNo = boxNo;
}
public String getContainerNo() {
return containerNo;
}
public void setContainerNo(String containerNo) {
this.containerNo = containerNo;
}
public String getDeliveryAddress() {
return deliveryAddress;
}
public void setDeliveryAddress(String deliveryAddress) {
this.deliveryAddress = deliveryAddress;
}
public String getTransportationType() {
return transportationType;
}
public void setTransportationType(String transportationType) {
this.transportationType = transportationType;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Integer getId() {
return id;
}
......
......@@ -5,16 +5,36 @@ public class Gateway {
private String SN;
private String name;
private String type;
private boolean state;
private boolean bConfig;
private int useScene;
private Long createTime;
private Long updateTime;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getUseScene() {
return useScene;
}
public void setUseScene(int useScene) {
this.useScene = useScene;
}
public int getId() {
return id;
}
......
package com.example.tdl.entity;
public class UserRoute {
private Integer id;
private String userNumber;
private String routeNumber;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getUserNumber() {
return userNumber;
}
public void setUserNumber(String userNumber) {
this.userNumber = userNumber;
}
public String getRouteNumber() {
return routeNumber;
}
public void setRouteNumber(String routeNumber) {
this.routeNumber = routeNumber;
}
}
package com.example.tdl.mapper;
import com.example.tdl.domain.vo.CircuitTermVo;
import com.example.tdl.domain.vo.ResultCircuitVo;
import com.example.tdl.domain.vo.ResultRouteVo;
import com.example.tdl.domain.vo.UpdateCircuitVo;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
@Mapper
public interface CircuitMapper {
List<ResultCircuitVo> getAll();
List<ResultCircuitVo> getByTerm(CircuitTermVo circuitTermVo);
int addCircuit(Map<Object,Object> map);
int updateCircuit(Map<Object,Object> map);
int updateEndTime(UpdateCircuitVo updateCircuitVo);
int delCircuit(String transportationNo);
ResultCircuitVo getByTransportationNo(String transportation);
}
package com.example.tdl.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface CityConfigMapper {
Integer getIdByCountryAndCity(@Param("country") String country,@Param("city") String city);
}
......@@ -7,6 +7,7 @@ import com.example.tdl.entity.Route;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
@Mapper
......@@ -14,15 +15,19 @@ public interface RouteMapper {
List<ResultRouteVo> getAll();
List<ResultRouteVo> getAllRoute(String time);
List<ResultRouteVo> getRouteByTerm(RouteTermVo routeTermVo);
int addRoute(Route route);
int updateRoute(Route route);
int addRoute(Map<Object,Object> map);
int delRoute(String routeNumber);
int getByRouteNumber(String routeNumber);
ResultRouteVo getInfoByRouteNumber(String routeNumber);
ResultRouteVo getInfoByRouteName(String routeName);
// List<ResultRouteVo> getAllRoute(String time);
// int updateRoute(Route route);
}
......@@ -30,4 +30,6 @@ public interface UserMapper {
int delUser(String userNumber);
int resetPassword(@Param("userNumber") String userNumber,@Param("password") String password);
int updatePassword(UpdatePasswordVo updatePasswordVo);
}
package com.example.tdl.service;
import com.example.tdl.domain.vo.AddCircuitVo;
import com.example.tdl.domain.vo.CircuitTermVo;
import com.example.tdl.domain.vo.ResultCircuitVo;
import com.example.tdl.domain.vo.UpdateCircuitVo;
import com.example.tdl.mapper.CircuitMapper;
import com.example.tdl.mapper.RoleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
@Service
public class CircuitService {
@Autowired
private CircuitMapper circuitMapper;
public List<ResultCircuitVo> getAll(){
return circuitMapper.getAll();
}
public List<ResultCircuitVo> getByTerm(CircuitTermVo circuitTermVo){
return circuitMapper.getByTerm(circuitTermVo);
}
public int addCircuit(Map<Object,Object> map){
return circuitMapper.addCircuit(map);
}
public int updateCircuit(Map<Object,Object> map){
return circuitMapper.updateCircuit(map);
}
public int updateEndTime(UpdateCircuitVo updateCircuitVo){
return circuitMapper.updateEndTime(updateCircuitVo);
}
public int delCircuit(String transportationNo){
return circuitMapper.delCircuit(transportationNo);
}
public ResultCircuitVo getByTransportationNo(String transportationNo){
return circuitMapper.getByTransportationNo(transportationNo);
}
}
package com.example.tdl.service;
import com.example.tdl.mapper.CityConfigMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class CityConfigService {
@Autowired
private CityConfigMapper cityConfigMapper;
public Integer getIdByCountryAndCity(String country ,String city){
return cityConfigMapper.getIdByCountryAndCity(country, city);
}
}
......@@ -11,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
@Service
public class RouteService {
......@@ -21,20 +22,12 @@ public class RouteService {
return routeMapper.getAll();
}
public List<ResultRouteVo> getAllRoute(String time){
return routeMapper.getAllRoute(time);
}
public List<ResultRouteVo> getRouteByTerm(RouteTermVo routeTermVo){
return routeMapper.getRouteByTerm(routeTermVo);
}
public int addRoute(Route route){
return routeMapper.addRoute(route);
}
public int updateRoute(Route route){
return routeMapper.updateRoute(route);
public int addRoute(Map<Object,Object> map){
return routeMapper.addRoute(map);
}
public int delRoute(String routeNumber){
......@@ -44,4 +37,20 @@ public class RouteService {
public int getByRouteNumber(String routeNumber){
return routeMapper.getByRouteNumber(routeNumber);
}
public ResultRouteVo getInfoByRouteNumber(String routeNumber){
return routeMapper.getInfoByRouteNumber(routeNumber);
}
public ResultRouteVo getInfoByRouteName(String routeName){
return routeMapper.getInfoByRouteName(routeName);
}
// public List<ResultRouteVo> getAllRoute(String time){
// return routeMapper.getAllRoute(time);
// }
// public int updateRoute(Route route){
// return routeMapper.updateRoute(route);
// }
}
......@@ -66,6 +66,10 @@ public class UserService {
return userMapper.resetPassword(userNumber,password);
}
public int updatePassword(UpdatePasswordVo updatePasswordVo){
return userMapper.updatePassword(updatePasswordVo);
}
//登录
public String getUser(LoginUserVo loginUserVo) {
......
This diff is collapsed.
......@@ -93,7 +93,7 @@ public class HomePageController {
public Object getByTerm(@RequestBody TermVo termVo){
HomePageDataVo dataVo = new HomePageDataVo();
List<ResultRouteVo> routeVos = routeService.getAll();//所有的路线
List<ResultRouteVo> routeVoList = routeService.getAllRoute(termVo.getTime());//根据条件获取数据
// List<ResultRouteVo> routeVoList = routeService.getAllRoute(termVo.getTime());//根据条件获取数据
List<AlarmLogVo> alarmLogVos = alarmLogServcie.getAlarmLog(termVo.getTime());
dataVo.setRouteVoList(routeVos);//路线列表
dataVo.setAlarmLogVoList(alarmLogVos);//报警列表
......
......@@ -282,7 +282,7 @@ public class UserController {
String pwd=DigestUtils.sha256Hex("Witium123");
int a = userService.resetPassword(userNumber,pwd);
if (a>0){
fb.setCode(0);
fb.setCode(1);
fb.setMessage("重置密码成功");
}else{
fb.setCode(0);
......@@ -291,6 +291,36 @@ public class UserController {
return gson.toJson(fb);
}
//修改密码
@ApiOperation(value = "修改密码",notes = "修改密码")
@ApiImplicitParams({
@ApiImplicitParam(paramType="header", name = "Account_token", value = "token", required = true, dataType = "String"),
})
@RequestMapping(value="/updatePassword",method = RequestMethod.POST)
public Object updatePassword(@RequestBody UpdatePasswordVo updatePasswordVo){
if (StringUtils.isEmpty(updatePasswordVo.getUserNumber())) {
fb.setCode(0);
fb.setMessage("需要重置密码的用户编号不能为空");
return gson.toJson(fb);
}
if (StringUtils.isEmpty(updatePasswordVo.getPassword())) {
fb.setCode(0);
fb.setMessage("修改的密码不能为空");
return gson.toJson(fb);
}
String pwd=DigestUtils.sha256Hex(updatePasswordVo.getPassword());
updatePasswordVo.setPassword(pwd);
int a = userService.updatePassword(updatePasswordVo);
if (a>0){
fb.setCode(1);
fb.setMessage("修改密码成功");
}else{
fb.setCode(0);
fb.setMessage("修改密码失败");
}
return gson.toJson(fb);
}
//获取当前的用户名
@ApiOperation(value = "获取当前的用户名",notes = "获取当前的用户名")
@ApiImplicitParams({
......
spring.datasource.url=jdbc:mysql://192.168.1.200:3306/tdlCloud?useUnicode=true&characterEncoding=utf-8&useSSL=false
spring.datasource.url=jdbc:mysql://192.168.1.16:3306/tdlCloud?useUnicode=true&characterEncoding=utf-8&useSSL=false
spring.datasource.username=root
spring.datasource.password=37774020
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.tdl.mapper.CircuitMapper">
<!--根据报警信息查询线路-->
<select id="getAll" resultType="com.example.tdl.domain.vo.ResultCircuitVo">
SELECT transportationNo,routeNumber,routeName,startLongitude,startLatitude,(select city from city_config where id=r.start_id) startCity, startAddress,
IFNULL(from_unixtime((startTime/1000),'%Y-%m-%d %T'),"-") startTime,endLongitude,endLatitude,(select city from city_config where id=r.end_id) endCity,
endAddress,IFNULL(from_unixtime((endTime/1000),'%Y-%m-%d %T'),"-") endTime,transport,(SELECT alarmType FROM alarm WHERE id=c.alarm_id) alarmType,
boxNo,containerNo,deliveryAddress,transportationType,circuitState,c.remark
from circuit c,route r WHERE c.route_id=r.id AND r.state=1 AND c.state=1 order BY c.id DESC
</select>
<select id="getByTerm" resultType="com.example.tdl.domain.vo.ResultCircuitVo" parameterType="com.example.tdl.domain.vo.CircuitTermVo">
SELECT transportationNo,routeNumber,routeName,abbreviation,startCity,IFNULL(from_unixtime((startTime/1000),'%Y-%m-%d %T'),"-") startTime,endCity,
IFNULL(from_unixtime((endTime/1000),'%Y-%m-%d %T'),"-") endTime,transport,(SELECT alarmType FROM alarm WHERE id=c.alarm_id) alarmType,
boxNo,containerNo,deliveryAddress,transportationType,circuitState,c.remark
from circuit c,route r WHERE c.route_id=r.id AND r.state=1 AND c.state=1
<if test="transportationNo!=null">
AND transportationNo like CONCAT(CONCAT('%',#{transportationNo,jdbcType=VARCHAR}),'%')
</if>
<if test="routeNumber!=null">
AND routeNumber like CONCAT(CONCAT('%',#{routeNumber,jdbcType=VARCHAR}),'%')
</if>
<if test="alarmType!=null and alarmType==0">
AND alarm_id is NULL
</if>
<if test="alarmType!=null and alarmType==1">
AND alarm_id is NOT NULL
</if>
<if test="circuitState!=null">
AND circuitState=#{circuitState,jdbcType=INTEGER}
</if>
<if test="startCity!=null">
AND startCity like CONCAT(CONCAT('%',#{startCity,jdbcType=VARCHAR}),'%')
</if>
<if test="endCity!=null">
AND endCity like CONCAT(CONCAT('%',#{endCity,jdbcType=VARCHAR}),'%')
</if>
<if test="startTimeMin!=null">
AND startTime BETWEEN #{startTimeMin,jdbcType=BIGINT} AND #{startTimeMax,jdbcType=BIGINT}
</if>
<if test="endTimeMin!=null">
AND endTime BETWEEN #{endTimeMin,jdbcType=BIGINT} AND #{endTimeMax,jdbcType=BIGINT}
</if>
</select>
<insert id="addCircuit" parameterType="java.util.Map" statementType="CALLABLE">
<![CDATA[
{
call pro_addCircuit(
#{routeNumber,mode=IN,jdbcType=VARCHAR},
#{routeName,mode=IN,jdbcType=VARCHAR},
#{startCountry,mode=IN,jdbcType=VARCHAR},
#{startProvince,mode=IN,jdbcType=VARCHAR},
#{startCity,mode=IN,jdbcType=VARCHAR},
#{endCountry,mode=IN,jdbcType=VARCHAR},
#{endProvince,mode=IN,jdbcType=VARCHAR},
#{endCity,mode=IN,jdbcType=VARCHAR},
#{transport,mode=IN,jdbcType=VARCHAR},
#{createTime,mode=IN,jdbcType=BIGINT},
#{updateTime,mode=IN,jdbcType=BIGINT},
#{rRemark,mode=IN,jdbcType=BIGINT},
#{transportationNo,mode=IN,jdbcType=VARCHAR},
#{startLongitude,mode=IN,jdbcType=VARCHAR},
#{startLatitude,mode=IN,jdbcType=VARCHAR},
#{startAddress,mode=IN,jdbcType=VARCHAR},
#{startTime,mode=IN,jdbcType=BIGINT},
#{endLongitude,mode=IN,jdbcType=VARCHAR},
#{endLatitude,mode=IN,jdbcType=VARCHAR},
#{endAddress,mode=IN,jdbcType=VARCHAR},
#{endTime,mode=IN,jdbcType=BIGINT},
#{boxNo,mode=IN,jdbcType=VARCHAR},
#{containerNo,mode=IN,jdbcType=VARCHAR},
#{deliveryAddress,mode=IN,jdbcType=VARCHAR},
#{transportationType,mode=IN,jdbcType=VARCHAR},
#{remark,mode=IN,jdbcType=VARCHAR},
#{msg,mode=OUT,jdbcType=VARCHAR}
)
}
]]>
</insert>
<update id="updateEndTime" parameterType="com.example.tdl.domain.vo.UpdateCircuitVo">
UPDATE circuit set
endTime=#{endTime,jdbcType=BIGINT}
WHERE transportationNo=#{transportationNo,jdbcType=VARCHAR}
</update>
<update id="updateCircuit" parameterType="java.util.Map" statementType="CALLABLE">
<![CDATA[
{
call pro_updateCircuit(
#{routeNumber,mode=IN,jdbcType=VARCHAR},
#{routeName,mode=IN,jdbcType=VARCHAR},
#{startCountry,mode=IN,jdbcType=VARCHAR},
#{startProvince,mode=IN,jdbcType=VARCHAR},
#{startCity,mode=IN,jdbcType=VARCHAR},
#{endCountry,mode=IN,jdbcType=VARCHAR},
#{endProvince,mode=IN,jdbcType=VARCHAR},
#{endCity,mode=IN,jdbcType=VARCHAR},
#{transport,mode=IN,jdbcType=VARCHAR},
#{createTime,mode=IN,jdbcType=BIGINT},
#{updateTime,mode=IN,jdbcType=BIGINT},
#{rRemark,mode=IN,jdbcType=BIGINT},
#{transportationNo,mode=IN,jdbcType=VARCHAR},
#{startLongitude,mode=IN,jdbcType=VARCHAR},
#{startLatitude,mode=IN,jdbcType=VARCHAR},
#{startAddress,mode=IN,jdbcType=VARCHAR},
#{startTime,mode=IN,jdbcType=VARCHAR},
#{endLongitude,mode=IN,jdbcType=VARCHAR},
#{endLatitude,mode=IN,jdbcType=VARCHAR},
#{endAddress,mode=IN,jdbcType=VARCHAR},
#{endTime,mode=IN,jdbcType=VARCHAR},
#{boxNo,mode=IN,jdbcType=VARCHAR},
#{containerNo,mode=IN,jdbcType=VARCHAR},
#{deliveryAddress,mode=IN,jdbcType=VARCHAR},
#{transportationType,mode=IN,jdbcType=VARCHAR},
#{remark,mode=IN,jdbcType=VARCHAR},
#{msg,mode=OUT,jdbcType=VARCHAR}
)
}
]]>
</update>
<delete id="delCircuit" parameterType="String">
UPDATE circuit set state=0
WHERE transportationNo=#{transportationNo,jdbcType=VARCHAR}
</delete>
<select id="getByTransportationNo" resultType="com.example.tdl.domain.vo.ResultCircuitVo" parameterType="String">
SELECT transportationNo,routeNumber,routeName,startLongitude,startLatitude,(select city from city_config where id=r.start_id) startCity, startAddress,
IFNULL(from_unixtime((startTime/1000),'%Y-%m-%d %T'),"-") startTime,endLongitude,endLatitude,(select city from city_config where id=r.end_id) endCity,
endAddress,IFNULL(from_unixtime((endTime/1000),'%Y-%m-%d %T'),"-") endTime,transport,(SELECT alarmType FROM alarm WHERE id=c.alarm_id) alarmType,
boxNo,containerNo,deliveryAddress,transportationType,circuitState,c.remark
from circuit c,route r WHERE c.route_id=r.id AND r.state=1 AND c.state=1 AND transportationNo=#{transportationNo,jdbcType=VARCHAR}
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.tdl.mapper.CityConfigMapper">
<select id="getIdByCountryAndCity" parameterType="String" resultType="java.lang.Integer">
SELECT id from city_config WHERE country=#{country,jdbcType=VARCHAR}
AND city=#{city,jdbcType=VARCHAR}
</select>
</mapper>
\ No newline at end of file
......@@ -3,15 +3,18 @@
<mapper namespace="com.example.tdl.mapper.RouteMapper">
<!--查询所有路由信息-->
<select id="getAll" resultType="com.example.tdl.domain.vo.ResultRouteVo">
SELECT routeNumber,routeName,abbreviation,startLongitude,startLatitude,startCountry,startProvince,startCity,startAddress,
endLongitude,endLatitude,endCountry,endProvince,endCity,endAddress,transport,transportRemark,remark FROM route
SELECT routeNumber,routeName,c.country startCountry,IFNULL(c.province,"") startProvince,c.city startCity,
f.country endCountry,IFNULL(f.province,"") endProvince,f.city endCity,transport,remark
FROM city_config f,route r INNER JOIN city_config c ON r.start_id=c.id
WHERE r.end_id=f.id AND state=1
</select>
<!--根据条件查询路由信息-->
<select id="getRouteByTerm" resultType="com.example.tdl.domain.vo.ResultRouteVo" parameterType="com.example.tdl.domain.vo.RouteTermVo">
SELECT routeNumber,routeName,abbreviation,startLongitude,startLatitude,startCountry,startProvince,startCity,startAddress,
endLongitude,endLatitude,endCountry,endProvince,endCity,endAddress,transport,transportRemark,remark FROM route
WHERE 1=1
SELECT routeNumber,routeName,c.country startCountry,IFNULL(c.province,"") startProvince,c.city startCity,
f.country endCountry,IFNULL(f.province,"") endProvince,f.city endCity,transport,remark
FROM city_config f,route r INNER JOIN city_config c ON r.start_id=c.id
WHERE r.end_id=f.id AND state=1
<if test="routeNumber!=null">
AND routeNumber like CONCAT(CONCAT('%',#{routeNumber,jdbcType=VARCHAR}), '%')
</if>
......@@ -30,34 +33,60 @@
</select>
<!--添加路由信息-->
<insert id="addRoute" parameterType="com.example.tdl.entity.Route">
INSERT INTO route VALUES (
NULL ,
#{routeNumber,jdbcType=VARCHAR},
#{routeName,jdbcType=VARCHAR},
#{abbreviation,jdbcType=VARCHAR},
#{startLongitude,jdbcType=VARCHAR},
#{startLatitude,jdbcType=VARCHAR},
#{startCountry,jdbcType=VARCHAR},
#{startProvince,jdbcType=VARCHAR},
#{startCity,jdbcType=VARCHAR},
#{startAddress,jdbcType=VARCHAR},
#{endLongitude,jdbcType=VARCHAR},
#{endLatitude,jdbcType=VARCHAR},
#{endCountry,jdbcType=VARCHAR},
#{endProvince,jdbcType=VARCHAR},
#{endCity,jdbcType=VARCHAR},
#{endAddress,jdbcType=VARCHAR},
#{transport,jdbcType=VARCHAR},
#{transportRemark,jdbcType=VARCHAR},
#{createTime,jdbcType=BIGINT},
#{updateTime,jdbcType=BIGINT},
#{remark,jdbcType=VARCHAR}
<insert id="addRoute" parameterType="java.util.Map" statementType="CALLABLE">
<![CDATA[
{
call pro_addRoute(
#{routeNumber,mode=IN,jdbcType=VARCHAR},
#{routeName,mode=IN,jdbcType=VARCHAR},
#{startCountry,mode=IN,jdbcType=VARCHAR},
#{startProvince,mode=IN,jdbcType=VARCHAR},
#{startCity,mode=IN,jdbcType=VARCHAR},
#{endCountry,mode=IN,jdbcType=VARCHAR},
#{endProvince,mode=IN,jdbcType=VARCHAR},
#{endCity,mode=IN,jdbcType=VARCHAR},
#{transport,mode=IN,jdbcType=VARCHAR},
#{createTime,mode=IN,jdbcType=BIGINT},
#{updateTime,mode=IN,jdbcType=BIGINT},
#{remark,mode=IN,jdbcType=VARCHAR},
#{msg,mode=OUT,jdbcType=VARCHAR}
)
}
]]>
</insert>
<delete id="delRoute" parameterType="String">
UPDATE route set state=0 WHERE routeNumber=#{routeNumber,jdbcType=VARCHAR}
</delete>
<select id="getByRouteNumber" resultType="java.lang.Integer" parameterType="String">
SELECT COUNT(routeNumber) FROM route WHERE routeNumber=#{routeNumber,jdbcType=VARCHAR} AND state=1
</select>
<select id="getInfoByRouteNumber" resultType="com.example.tdl.domain.vo.ResultRouteVo" parameterType="String">
SELECT routeNumber,routeName,c.country startCountry,IFNULL(c.province,"") startProvince,c.city startCity,
f.country endCountry,IFNULL(f.province,"") endProvince,f.city endCity,transport,remark
FROM city_config f,route r INNER JOIN city_config c ON r.start_id=c.id
WHERE r.end_id=f.id AND routeNumber=#{routeNumber,jdbcType=VARCHAR} AND state=1
</select>
<select id="getInfoByRouteName" resultType="com.example.tdl.domain.vo.ResultRouteVo" parameterType="String">
SELECT routeNumber,routeName,c.country startCountry,IFNULL(c.province,"") startProvince,c.city startCity,
f.country endCountry,IFNULL(f.province,"") endProvince,f.city endCity,transport,remark
FROM city_config f,route r INNER JOIN city_config c ON r.start_id=c.id
WHERE r.end_id=f.id AND routeName=#{routeName,jdbcType=VARCHAR} AND state=1
</select>
<!-- <select id="getAllRoute" resultType="com.example.tdl.domain.vo.ResultRouteVo">
SELECT routeNumber,routeName,abbreviation,startLongitude,startLatitude,startCountry,startProvince,startCity,startAddress,
endLongitude,endLatitude,endCountry,endProvince,endCity,endAddress,transport,transportRemark,remark FROM route
where DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(createTime/1000,'%Y-%m-%d %H:%i:%s'))
AND state=1 order by createTime desc limit 10;
</select>-->
<!--修改路由信息-->
<update id="updateRoute" parameterType="com.example.tdl.entity.Route">
<!-- <update id="updateRoute" parameterType="com.example.tdl.entity.Route">
UPDATE route SET
routeName=#{routeName,jdbcType=VARCHAR},
abbreviation=#{abbreviation,jdbcType=VARCHAR},
......@@ -78,21 +107,8 @@
updateTime=#{updateTime,jdbcType=BIGINT},
remark=#{remark,jdbcType=VARCHAR}
WHERE routeNumber=#{routeNumber,jdbcType=VARCHAR}
</update>
</update>-->
<delete id="delRoute" parameterType="String">
DELETE from route WHERE routeNumber=#{routeNumber,jdbcType=VARCHAR}
</delete>
<!--根据条件查询路由信息-->
<select id="getByRouteNumber" resultType="java.lang.Integer" parameterType="String">
SELECT COUNT(routeNumber) FROM route WHERE routeNumber=#{routeNumber,jdbcType=VARCHAR}
</select>
<select id="getAllRoute" resultType="com.example.tdl.domain.vo.ResultRouteVo">
SELECT routeNumber,routeName,abbreviation,startLongitude,startLatitude,startCountry,startProvince,startCity,startAddress,
endLongitude,endLatitude,endCountry,endProvince,endCity,endAddress,transport,transportRemark,remark FROM route
where DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(createTime/1000,'%Y-%m-%d %H:%i:%s'))
order by createTime desc limit 10;
</select>
</mapper>
\ No newline at end of file
......@@ -100,6 +100,14 @@
DELETE FROM `user` WHERE userNumber=#{userNumber}
</delete>
<!--修改密码-->
<update id="updatePassword" parameterType="String">
update `user` SET
password=#{password,jdbcType=VARCHAR},
updateTime=(unix_timestamp(now())*1000)
WHERE userNumber=#{userNumber,jdbcType=VARCHAR}
</update>
<!--重置密码-->
<update id="resetPassword" parameterType="String">
update `user` SET
......
......@@ -46,5 +46,6 @@
<mapper resource="mapper/ProbesMapper.xml"/>
<mapper resource="mapper/TopicMapper.xml"/>
<mapper resource="mapper/TopicConfigMapper.xml"/>
<mapper resource="mapper/CityConfigMapper.xml"/>
</mappers>
</configuration>
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