Browse Source

重构代码

tags/v1.2.0^2
wanjing 1 year ago
parent
commit
5bc83f41b5
7 changed files with 20 additions and 19 deletions
  1. +1
    -1
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/vo/warning/WarningListVo.java
  2. +2
    -4
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/camera/query/QueryCameraListService.java
  3. +1
    -1
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/mission/query/QueryEmergencyListService.java
  4. +4
    -4
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/mission/query/QueryMissionListService.java
  5. +4
    -3
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/warning/details/WarningDetailsService.java
  6. +4
    -3
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/warning/notice/WarningNoticeService.java
  7. +4
    -3
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/warning/query/QueryWarningPageListService.java

+ 1
- 1
tuoheng-admin/src/main/java/com/tuoheng/admin/entity/vo/warning/WarningListVo.java View File

@@ -19,7 +19,7 @@ import java.util.Date;
* @date 2023-02-07
*/
@Data
public class WarningListVo implements Serializable {
public class WarningListVo extends BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;

+ 2
- 4
tuoheng-admin/src/main/java/com/tuoheng/admin/service/camera/query/QueryCameraListService.java View File

@@ -29,10 +29,8 @@ public class QueryCameraListService {

public JsonResult getList(QueryCameraListRequest request) {
// log.info("进入查询监控列表业务");
// User user = ShiroUtils.getUserInfo();
// Integer tenantId = user.getTenantId();

Integer tenantId = 1;
User user = ShiroUtils.getUserInfo();
Integer tenantId = user.getTenantId();
request.setTenantId(tenantId);

JsonResult result = this.check(tenantId, request);

+ 1
- 1
tuoheng-admin/src/main/java/com/tuoheng/admin/service/mission/query/QueryEmergencyListService.java View File

@@ -40,7 +40,7 @@ public class QueryEmergencyListService {
// User user = ShiroUtils.getUserInfo();
// Integer tenantId = user.getTenantId();

Integer tenantId = 1;
throw new ServiceException(
request.setTenantId(tenantId);

JsonResult result = this.check(tenantId, request);

+ 4
- 4
tuoheng-admin/src/main/java/com/tuoheng/admin/service/mission/query/QueryMissionListService.java View File

@@ -8,6 +8,8 @@ import com.tuoheng.admin.entity.request.emergency.QueryMissionListRequest;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.mapper.ThMissionMapper;
import com.tuoheng.common.utils.JsonResult;
import com.tuoheng.system.entity.User;
import com.tuoheng.system.utils.ShiroUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -30,10 +32,8 @@ public class QueryMissionListService {

public JsonResult getList(QueryMissionListRequest request) {
// log.info("进入查询任务列表业务");
// User user = ShiroUtils.getUserInfo();
// Integer tenantId = user.getTenantId();

Integer tenantId = 1;
User user = ShiroUtils.getUserInfo();
Integer tenantId = user.getTenantId();
request.setTenantId(tenantId);

JsonResult result = this.check(tenantId, request);

+ 4
- 3
tuoheng-admin/src/main/java/com/tuoheng/admin/service/warning/details/WarningDetailsService.java View File

@@ -21,6 +21,8 @@ import com.tuoheng.common.config.CommonConfig;
import com.tuoheng.common.exception.ServiceException;
import com.tuoheng.common.utils.JsonResult;
import com.tuoheng.common.utils.StringUtils;
import com.tuoheng.system.entity.User;
import com.tuoheng.system.utils.ShiroUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -51,9 +53,8 @@ public class WarningDetailsService {
private ThMissionMapper missionMapper;

public JsonResult details(Integer id) {
//User user = ShiroUtils.getUserInfo();
// Integer tenantId = user.getTenantId();
Integer tenantId = 1;
User user = ShiroUtils.getUserInfo();
Integer tenantId = user.getTenantId();
//校验
if(null == id){
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);

+ 4
- 3
tuoheng-admin/src/main/java/com/tuoheng/admin/service/warning/notice/WarningNoticeService.java View File

@@ -7,6 +7,8 @@ import com.tuoheng.admin.enums.MarkTypeEnum;
import com.tuoheng.admin.enums.WarningStatusEnum;
import com.tuoheng.admin.mapper.WarningMapper;
import com.tuoheng.common.utils.JsonResult;
import com.tuoheng.system.entity.User;
import com.tuoheng.system.utils.ShiroUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -32,9 +34,8 @@ public class WarningNoticeService {
*/
public JsonResult notice() {
//当前登录用户
// User user = ShiroUtils.getUserInfo();
// Integer tenantId = ShiroUtils.getTenantId();
Integer tenantId = 1;
User user = ShiroUtils.getUserInfo();
Integer tenantId = ShiroUtils.getTenantId();
//查询预警表是否有预警数据
List<Warning> warningList = warningMapper.selectList(Wrappers.<Warning>lambdaQuery()
.eq(Warning::getTenantId, tenantId)

+ 4
- 3
tuoheng-admin/src/main/java/com/tuoheng/admin/service/warning/query/QueryWarningPageListService.java View File

@@ -16,6 +16,8 @@ import com.tuoheng.common.exception.ServiceException;
import com.tuoheng.common.utils.DateUtils;
import com.tuoheng.common.utils.JsonResult;
import com.tuoheng.common.utils.StringUtils;
import com.tuoheng.system.entity.User;
import com.tuoheng.system.utils.ShiroUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -47,9 +49,8 @@ public class QueryWarningPageListService {
if (query.getLimit() == null && query.getPage() == null) {
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
// User user = ShiroUtils.getUserInfo();
// Integer tenantId = user.getTenantId();
Integer tenantId = 1;
User user = ShiroUtils.getUserInfo();
Integer tenantId = user.getTenantId();


if (null == tenantId) {

Loading…
Cancel
Save