台站运行管理页面查询台站及核设施信息接口
台站运行管理查询关注台站信息接口 台站运行新增关注台站信息 台站运行移除关注台站信息
This commit is contained in:
parent
d93d24e003
commit
f45fee5d62
21
jeecg-module-station-operation/pom.xml
Normal file
21
jeecg-module-station-operation/pom.xml
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<artifactId>jeecg-boot-parent</artifactId>
|
||||
<version>3.5.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>jeecg-module-station-operation</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<artifactId>jeecg-boot-base-core</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,30 @@
|
|||
package org.jeecg.modules.controller;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.modules.entity.StationOperation;
|
||||
import org.jeecg.modules.service.IStationOperationService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("stationOperation")
|
||||
@Api(value = "台站运行管理", tags = "台站运行管理")
|
||||
public class StationOperationController {
|
||||
|
||||
@Autowired
|
||||
private IStationOperationService stationOperationService;
|
||||
|
||||
@GetMapping("findList")
|
||||
@ApiOperation(value = "查询所有台站,核设施信息", notes = "查询所有台站,核设施信息")
|
||||
public List<StationOperation> findList(String status){
|
||||
List<StationOperation> result = stationOperationService.findList(status);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package org.jeecg.modules.controller;
|
||||
|
||||
import org.jeecg.config.valid.InsertGroup;
|
||||
import org.jeecg.modules.entity.SysUserFocusStation;
|
||||
import org.jeecg.modules.service.ISysUserFocusStationService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("sysUserFocusStation")
|
||||
public class SysUserFocusStationController {
|
||||
|
||||
@Autowired
|
||||
private ISysUserFocusStationService sysUserFocusStationService;
|
||||
|
||||
@GetMapping("findList")
|
||||
public List<SysUserFocusStation> findList(){
|
||||
List<SysUserFocusStation> result = sysUserFocusStationService.findList();
|
||||
return result;
|
||||
}
|
||||
|
||||
@PostMapping("create")
|
||||
public void create(@RequestBody @Validated(value = InsertGroup.class) SysUserFocusStation sysUserFocusStation){
|
||||
sysUserFocusStationService.create(sysUserFocusStation);
|
||||
}
|
||||
|
||||
@DeleteMapping("deleteById")
|
||||
public void deleteById(String stationId){
|
||||
sysUserFocusStationService.deleteById(stationId);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
package org.jeecg.modules.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("GARDS_NUCLEARFACILITY")
|
||||
public class GardsNuclearfacility implements Serializable {
|
||||
|
||||
@TableField(value = "FACILITY_ID")
|
||||
private Integer facilityId;
|
||||
|
||||
@TableField(value = "FACILITY_NAME")
|
||||
private String facilityName;
|
||||
|
||||
@TableField(value = "TYPE")
|
||||
private String type;
|
||||
|
||||
@TableField(value = "LOCATION")
|
||||
private String location;
|
||||
|
||||
@TableField(value = "LONGITUDE")
|
||||
private String longitude;
|
||||
|
||||
@TableField(value = "LATITUDE")
|
||||
private String latitude;
|
||||
|
||||
@TableField(value = "STATUS")
|
||||
private String status;
|
||||
|
||||
@TableField(value = "BUILDDATE")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date buildDate;
|
||||
|
||||
@TableField(value = "CRITICALITYDATE")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date criticalityDate;
|
||||
|
||||
@TableField(value = "RETIREDATE")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date retireDate;
|
||||
|
||||
@TableField(value = "GRIDCONEETIONDATE")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date gridconeetionDate;
|
||||
|
||||
@TableField(value = "VENDOR")
|
||||
private String vendor;
|
||||
|
||||
@TableField(value = "OWNER")
|
||||
private String owner;
|
||||
|
||||
@TableField(value = "OPERARTOR")
|
||||
private String operartor;
|
||||
|
||||
@TableField(value = "CAPACITYGROSS")
|
||||
private Integer capacitygross;
|
||||
|
||||
@TableField(value = "CAPACITYNET")
|
||||
private Integer capacitynet;
|
||||
|
||||
@TableField(value = "CAPACITYTHERMAL")
|
||||
private Integer capacitythermal;
|
||||
|
||||
@TableField(value = "ACTIVITY_DAY")
|
||||
private Integer activityDay;
|
||||
|
||||
@TableField(value = "ACTIVITY_YEAR")
|
||||
private Integer activityYear;
|
||||
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
package org.jeecg.modules.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName(value = "GARDS_STATIONS")
|
||||
public class GardsStations implements Serializable {
|
||||
|
||||
@TableField(value = "STATION_ID")
|
||||
private Integer stationId;
|
||||
|
||||
@TableField(value = "STATION_CODE")
|
||||
private String stationCode;
|
||||
|
||||
@TableField(value = "COUNTRY_CODE")
|
||||
private String countryCode;
|
||||
|
||||
@TableField(value = "TYPE")
|
||||
private String type;
|
||||
|
||||
@TableField(value = "LON")
|
||||
private Double lon;
|
||||
|
||||
@TableField(value = "LAT")
|
||||
private Double lat;
|
||||
|
||||
@TableField(value = "ELEVATION")
|
||||
private Double elevation;
|
||||
|
||||
@TableField(value = "DESCRIPTION")
|
||||
private String description;
|
||||
|
||||
@TableField(value = "DATE_BEGIN")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date dateBegin;
|
||||
|
||||
@TableField(value = "DATE_END")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date dateEnd;
|
||||
|
||||
@TableField(value = "STATUS")
|
||||
private String status;
|
||||
|
||||
@TableField(value = "MODDATE")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date moddate;
|
||||
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package org.jeecg.modules.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class StationOperation implements Serializable {
|
||||
|
||||
private Integer stationId;
|
||||
|
||||
private String stationName;
|
||||
|
||||
private String stationType;
|
||||
|
||||
private String altitude;
|
||||
|
||||
private String lon;
|
||||
|
||||
private String lat;
|
||||
|
||||
private String status;
|
||||
|
||||
private String signal;
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package org.jeecg.modules.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@TableName("sys_user")
|
||||
public class SysUser implements Serializable {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 登录账号
|
||||
*/
|
||||
@Excel(name = "登录账号", width = 15)
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 真实姓名
|
||||
*/
|
||||
@Excel(name = "真实姓名", width = 15)
|
||||
private String realname;
|
||||
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package org.jeecg.modules.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import org.jeecg.config.valid.InsertGroup;
|
||||
import org.jeecg.config.valid.UpdateGroup;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("sys_user_focus_station")
|
||||
public class SysUserFocusStation implements Serializable {
|
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
@NotNull(message = "不能为空", groups = {InsertGroup.class, UpdateGroup.class})
|
||||
private Integer id;
|
||||
|
||||
@TableField(value = "user_id")
|
||||
@NotBlank(message = "不能为空", groups = {InsertGroup.class, UpdateGroup.class})
|
||||
private String userId;
|
||||
|
||||
@TableField(value = "station_id")
|
||||
@NotBlank(message = "不能为空", groups = {InsertGroup.class, UpdateGroup.class})
|
||||
private String stationId;
|
||||
|
||||
@TableField(value = "type")
|
||||
@NotBlank(message = "不能为空", groups = {InsertGroup.class, UpdateGroup.class})
|
||||
private String type;
|
||||
|
||||
@TableField(value = "create_time")
|
||||
private Date createTime;
|
||||
|
||||
@TableField(value = "create_by")
|
||||
private String createBy;
|
||||
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package org.jeecg.modules.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.modules.entity.GardsNuclearfacility;
|
||||
|
||||
public interface GardsNuclearfacilityMapper extends BaseMapper<GardsNuclearfacility> {
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package org.jeecg.modules.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.modules.entity.GardsStations;
|
||||
|
||||
public interface GardsStationsMapper extends BaseMapper<GardsStations> {
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package org.jeecg.modules.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.modules.entity.StationOperation;
|
||||
|
||||
public interface StationOperationMapper extends BaseMapper<StationOperation> {
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package org.jeecg.modules.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.modules.entity.SysUserFocusStation;
|
||||
|
||||
public interface SysUserFocusStationMapper extends BaseMapper<SysUserFocusStation> {
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package org.jeecg.modules.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.modules.entity.SysUser;
|
||||
|
||||
public interface SysUserMapper extends BaseMapper<SysUser> {
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package org.jeecg.modules.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.entity.StationOperation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IStationOperationService extends IService<StationOperation> {
|
||||
|
||||
List<StationOperation> findList(String status);
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package org.jeecg.modules.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.entity.SysUserFocusStation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ISysUserFocusStationService extends IService<SysUserFocusStation> {
|
||||
|
||||
/**
|
||||
* 查询当前用户的全部关注台站,核设施信息
|
||||
* @return
|
||||
*/
|
||||
List<SysUserFocusStation> findList();
|
||||
|
||||
/**
|
||||
* 新增关注的台站,核设施信息
|
||||
* @param sysUserFocusStation
|
||||
*/
|
||||
void create(SysUserFocusStation sysUserFocusStation);
|
||||
|
||||
/**
|
||||
* 取消关注
|
||||
* @param stationId
|
||||
*/
|
||||
void deleteById(String stationId);
|
||||
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
package org.jeecg.modules.service.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jeecg.modules.entity.GardsNuclearfacility;
|
||||
import org.jeecg.modules.entity.GardsStations;
|
||||
import org.jeecg.modules.entity.StationOperation;
|
||||
import org.jeecg.modules.mapper.GardsNuclearfacilityMapper;
|
||||
import org.jeecg.modules.mapper.GardsStationsMapper;
|
||||
import org.jeecg.modules.mapper.StationOperationMapper;
|
||||
import org.jeecg.modules.service.IStationOperationService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service("stationOperationService")
|
||||
@DS("ora")
|
||||
public class StationOperationServiceImpl extends ServiceImpl<StationOperationMapper, StationOperation> implements IStationOperationService {
|
||||
@Autowired
|
||||
private GardsStationsMapper gardsStationsMapper;
|
||||
@Autowired
|
||||
private GardsNuclearfacilityMapper gardsNuclearfacilityMapper;
|
||||
|
||||
@Override
|
||||
public List<StationOperation> findList(String status) {
|
||||
//声明结果集合
|
||||
List<StationOperation> result = new LinkedList<>();
|
||||
//查询全部台站信息
|
||||
List<GardsStations> stations = this.findStations();
|
||||
for (GardsStations gardsStation:stations) {
|
||||
StationOperation stationOperation = new StationOperation();
|
||||
stationOperation.setStationId(gardsStation.getStationId());
|
||||
stationOperation.setStationName(gardsStation.getStationCode());
|
||||
stationOperation.setStationType("IMS STATION");
|
||||
stationOperation.setAltitude(Objects.isNull(gardsStation.getElevation())?"":gardsStation.getElevation()+"米");
|
||||
stationOperation.setLon(String.valueOf(gardsStation.getLon()));
|
||||
stationOperation.setLat(String.valueOf(gardsStation.getLat()));
|
||||
stationOperation.setStatus(gardsStation.getStatus());
|
||||
result.add(stationOperation);
|
||||
}
|
||||
//查询全部核设施信息
|
||||
List<GardsNuclearfacility> nuclearfacilities = this.findNuclearfacilities();
|
||||
for (GardsNuclearfacility nuclearfacility:nuclearfacilities) {
|
||||
StationOperation stationOperation = new StationOperation();
|
||||
stationOperation.setStationId(nuclearfacility.getFacilityId());
|
||||
stationOperation.setStationName(nuclearfacility.getFacilityName());
|
||||
stationOperation.setStationType("Nuclear Facility");
|
||||
stationOperation.setAltitude("--");
|
||||
stationOperation.setLon(nuclearfacility.getLongitude());
|
||||
stationOperation.setLat(nuclearfacility.getLatitude());
|
||||
stationOperation.setStatus(nuclearfacility.getStatus());
|
||||
result.add(stationOperation);
|
||||
}
|
||||
//如果状态不为空
|
||||
if (StringUtils.isNotBlank(status)){
|
||||
result = result.stream().filter(item-> item.getStatus().equals(status)).collect(Collectors.toList());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询全部台站信息
|
||||
* @return
|
||||
*/
|
||||
private List<GardsStations> findStations(){
|
||||
LambdaQueryWrapper<GardsStations> queryWrapper = new LambdaQueryWrapper<>();
|
||||
List<GardsStations> gardsStations = gardsStationsMapper.selectList(queryWrapper);
|
||||
return gardsStations;
|
||||
}
|
||||
|
||||
private List<GardsNuclearfacility> findNuclearfacilities(){
|
||||
LambdaQueryWrapper<GardsNuclearfacility> queryWrapper = new LambdaQueryWrapper<>();
|
||||
List<GardsNuclearfacility> gardsNuclearfacilities = gardsNuclearfacilityMapper.selectList(queryWrapper);
|
||||
return gardsNuclearfacilities;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
package org.jeecg.modules.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.common.system.util.JwtUtil;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import org.jeecg.modules.entity.SysUser;
|
||||
import org.jeecg.modules.entity.SysUserFocusStation;
|
||||
import org.jeecg.modules.mapper.SysUserFocusStationMapper;
|
||||
import org.jeecg.modules.mapper.SysUserMapper;
|
||||
import org.jeecg.modules.service.ISysUserFocusStationService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Service("sysUserFocusStationService")
|
||||
public class SysUserFocusStationServiceImpl extends ServiceImpl<SysUserFocusStationMapper, SysUserFocusStation> implements ISysUserFocusStationService {
|
||||
|
||||
@Autowired
|
||||
private SysUserMapper sysUserMapper;
|
||||
|
||||
@Override
|
||||
public List<SysUserFocusStation> findList() {
|
||||
List<SysUserFocusStation> sysUserFocusStations = this.baseMapper.selectList(new LambdaQueryWrapper<>());
|
||||
if (CollectionUtils.isNotEmpty(sysUserFocusStations)){
|
||||
return sysUserFocusStations;
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void create(SysUserFocusStation sysUserFocusStation) {
|
||||
//获取request
|
||||
HttpServletRequest request = SpringContextUtils.getHttpServletRequest();
|
||||
//获取当前操作人用户名
|
||||
String username = JwtUtil.getUserNameByToken(request);
|
||||
//根据用户名称查询对应的用户信息
|
||||
LambdaQueryWrapper<SysUser> userQueryWrapper = new LambdaQueryWrapper<>();
|
||||
userQueryWrapper.eq(SysUser::getUsername, username);
|
||||
SysUser sysUser = sysUserMapper.selectOne(userQueryWrapper);
|
||||
if (Objects.isNull(sysUser)){
|
||||
throw new RuntimeException("当前用户不存在!");
|
||||
}
|
||||
Long id = IdWorker.getId();
|
||||
sysUserFocusStation.setId(Integer.valueOf(id.toString()));
|
||||
sysUserFocusStation.setUserId(sysUser.getId());
|
||||
sysUserFocusStation.setCreateTime(new Date());
|
||||
sysUserFocusStation.setCreateBy(username);
|
||||
this.baseMapper.insert(sysUserFocusStation);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void deleteById(String stationId) {
|
||||
//获取request
|
||||
HttpServletRequest request = SpringContextUtils.getHttpServletRequest();
|
||||
//获取当前操作人用户名
|
||||
String username = JwtUtil.getUserNameByToken(request);
|
||||
//根据用户名称查询对应的用户信息
|
||||
LambdaQueryWrapper<SysUser> userQueryWrapper = new LambdaQueryWrapper<>();
|
||||
userQueryWrapper.eq(SysUser::getUsername, username);
|
||||
SysUser sysUser = sysUserMapper.selectOne(userQueryWrapper);
|
||||
if (Objects.isNull(sysUser)){
|
||||
throw new RuntimeException("当前用户不存在!");
|
||||
}
|
||||
LambdaQueryWrapper<SysUserFocusStation> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(SysUserFocusStation::getUserId, sysUser.getId());
|
||||
queryWrapper.eq(SysUserFocusStation::getStationId, stationId);
|
||||
this.baseMapper.delete(queryWrapper);
|
||||
}
|
||||
|
||||
}
|
|
@ -10,7 +10,6 @@ import org.springframework.format.annotation.DateTimeFormat;
|
|||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Null;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
|
42
jeecg-server-cloud/jeecg-station-operation-start/pom.xml
Normal file
42
jeecg-server-cloud/jeecg-station-operation-start/pom.xml
Normal file
|
@ -0,0 +1,42 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<artifactId>jeecg-server-cloud</artifactId>
|
||||
<version>3.5.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>jeecg-station-operation-start</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<!-- 引入jeecg-boot-starter-cloud依赖 -->
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<artifactId>jeecg-boot-starter-cloud</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<artifactId>jeecg-boot-base-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<artifactId>jeecg-module-station-operation</artifactId>
|
||||
<version>3.5.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,47 @@
|
|||
package org.jeecg;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
|
||||
@Slf4j
|
||||
@SpringBootApplication
|
||||
@EnableFeignClients(basePackages = {"org.jeecg"})
|
||||
@EnableScheduling
|
||||
public class JeecgStationOperationApplication extends SpringBootServletInitializer implements CommandLineRunner {
|
||||
|
||||
@Override
|
||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
|
||||
return application.sources(JeecgStationOperationApplication.class);
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws UnknownHostException {
|
||||
ConfigurableApplicationContext application = SpringApplication.run(JeecgStationOperationApplication.class, args);
|
||||
Environment env = application.getEnvironment();
|
||||
String ip = InetAddress.getLocalHost().getHostAddress();
|
||||
String port = env.getProperty("server.port");
|
||||
String path = oConvertUtils.getString(env.getProperty("server.servlet.context-path"));
|
||||
log.info("\n----------------------------------------------------------\n\t" +
|
||||
"Application Jeecg-Boot is running! Access URLs:\n\t" +
|
||||
"Local: \t\thttp://localhost:" + port + path + "/doc.html\n" +
|
||||
"External: \thttp://" + ip + ":" + port + path + "/doc.html\n" +
|
||||
"Swagger文档: \thttp://" + ip + ":" + port + path + "/doc.html\n" +
|
||||
"----------------------------------------------------------");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(String... args) throws Exception {
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
server:
|
||||
port: 7002
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: jeecg-station-operation
|
||||
cloud:
|
||||
nacos:
|
||||
config:
|
||||
server-addr: @config.server-addr@
|
||||
group: @config.group@
|
||||
namespace: @config.namespace@
|
||||
discovery:
|
||||
server-addr: ${spring.cloud.nacos.config.server-addr}
|
||||
config:
|
||||
import:
|
||||
- optional:nacos:jeecg.yaml
|
||||
- optional:nacos:jeecg-station-operation-@profile.name@.yaml
|
|
@ -0,0 +1,29 @@
|
|||
#code_generate_project_path
|
||||
project_path=E:\\workspace\\jeecg-boot
|
||||
#bussi_package[User defined]
|
||||
bussi_package=org.jeecg.modules.demo
|
||||
|
||||
|
||||
#default code path
|
||||
#source_root_package=src
|
||||
#webroot_package=WebRoot
|
||||
|
||||
#maven code path
|
||||
source_root_package=src.main.java
|
||||
webroot_package=src.main.webapp
|
||||
|
||||
#ftl resource url
|
||||
templatepath=/jeecg/code-template
|
||||
system_encoding=utf-8
|
||||
|
||||
#db Table id [User defined]
|
||||
db_table_id=id
|
||||
|
||||
#db convert flag[true/false]
|
||||
db_filed_convert=true
|
||||
|
||||
#page Search Field num [User defined]
|
||||
page_search_filed_num=1
|
||||
#page_filter_fields
|
||||
page_filter_fields=create_time,create_by,update_time,update_by
|
||||
exclude_table=act_,ext_act_,design_,onl_,sys_,qrtz_
|
|
@ -0,0 +1,27 @@
|
|||
#mysql
|
||||
diver_name=com.mysql.jdbc.Driver
|
||||
url=jdbc:mysql://localhost:3306/jeecg-boot?useUnicode=true&characterEncoding=UTF-8
|
||||
username=root
|
||||
password=root
|
||||
database_name=jeecg-boot
|
||||
|
||||
#oracle
|
||||
#diver_name=oracle.jdbc.driver.OracleDriver
|
||||
#url=jdbc:oracle:thin:@192.168.1.200:1521:ORCL
|
||||
#username=scott
|
||||
#password=tiger
|
||||
#database_name=ORCL
|
||||
|
||||
#postgre
|
||||
#diver_name=org.postgresql.Driver
|
||||
#url=jdbc:postgresql://localhost:5432/jeecg
|
||||
#username=postgres
|
||||
#password=postgres
|
||||
#database_name=jeecg
|
||||
|
||||
#SQLServer2005\u4ee5\u4e0a
|
||||
#diver_name=org.hibernate.dialect.SQLServerDialect
|
||||
#url=jdbc:sqlserver://192.168.1.200:1433;DatabaseName=jeecg
|
||||
#username=sa
|
||||
#password=SA
|
||||
#database_name=jeecg
|
|
@ -0,0 +1,77 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration debug="false">
|
||||
<!--定义日志文件的存储地址 -->
|
||||
<property name="LOG_HOME" value="../logs" />
|
||||
|
||||
<!--<property name="COLOR_PATTERN" value="%black(%contextName-) %red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta( %replace(%caller{1}){'\t|Caller.{1}0|\r\n', ''})- %gray(%msg%xEx%n)" />-->
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50}:%L - %msg%n</pattern>-->
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %highlight(%-5level) %cyan(%logger{50}:%L) - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 按照每天生成日志文件 -->
|
||||
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--日志文件输出的文件名 -->
|
||||
<FileNamePattern>${LOG_HOME}/jeecg-system-%d{yyyy-MM-dd}.%i.log</FileNamePattern>
|
||||
<!--日志文件保留天数 -->
|
||||
<MaxHistory>30</MaxHistory>
|
||||
<maxFileSize>10MB</maxFileSize>
|
||||
</rollingPolicy>
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 -->
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50}:%L - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 生成 error html格式日志开始 -->
|
||||
<appender name="HTML" class="ch.qos.logback.core.FileAppender">
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<!--设置日志级别,过滤掉info日志,只输入error日志-->
|
||||
<level>ERROR</level>
|
||||
</filter>
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="ch.qos.logback.classic.html.HTMLLayout">
|
||||
<pattern>%p%d%msg%M%F{32}%L</pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
<file>${LOG_HOME}/error-log.html</file>
|
||||
</appender>
|
||||
<!-- 生成 error html格式日志结束 -->
|
||||
|
||||
<!-- 每天生成一个html格式的日志开始 -->
|
||||
<appender name="FILE_HTML" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--日志文件输出的文件名 -->
|
||||
<FileNamePattern>${LOG_HOME}/jeecg-system-%d{yyyy-MM-dd}.%i.html</FileNamePattern>
|
||||
<!--日志文件保留天数 -->
|
||||
<MaxHistory>30</MaxHistory>
|
||||
<MaxFileSize>10MB</MaxFileSize>
|
||||
</rollingPolicy>
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="ch.qos.logback.classic.html.HTMLLayout">
|
||||
<pattern>%p%d%msg%M%F{32}%L</pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
</appender>
|
||||
<!-- 每天生成一个html格式的日志结束 -->
|
||||
|
||||
<!--myibatis log configure -->
|
||||
<logger name="com.apache.ibatis" level="TRACE" />
|
||||
<logger name="java.sql.Connection" level="DEBUG" />
|
||||
<logger name="java.sql.Statement" level="DEBUG" />
|
||||
<logger name="java.sql.PreparedStatement" level="DEBUG" />
|
||||
|
||||
<!-- 日志输出级别 -->
|
||||
<root level="INFO">
|
||||
<appender-ref ref="STDOUT" />
|
||||
<appender-ref ref="FILE" />
|
||||
<appender-ref ref="HTML" />
|
||||
<appender-ref ref="FILE_HTML" />
|
||||
</root>
|
||||
|
||||
</configuration>
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
<!-- 监控和测试例子 -->
|
||||
<module>jeecg-visual</module>
|
||||
<module>jeecg-station-operation-start</module>
|
||||
</modules>
|
||||
|
||||
</project>
|
9
pom.xml
9
pom.xml
|
@ -79,7 +79,8 @@
|
|||
<module>jeecg-module-demo</module>
|
||||
<module>jeecg-module-system</module>
|
||||
<module>jeecg-module-log-manage</module>
|
||||
</modules>
|
||||
<module>jeecg-module-station-operation</module>
|
||||
</modules>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
|
@ -172,6 +173,12 @@
|
|||
<artifactId>jeecg-module-log-manage</artifactId>
|
||||
<version>${jeecgboot.version}</version>
|
||||
</dependency>
|
||||
<!-- station-operation 模块-->
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<artifactId>jeecg-module-station-operation</artifactId>
|
||||
<version>${jeecgboot.version}</version>
|
||||
</dependency>
|
||||
<!-- jeecg tools -->
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
|
|
Loading…
Reference in New Issue
Block a user