Просмотр исходного кода

Merge branch 'develop' of gitadmin/tuoheng_freeway into release

tags/V1.3.3
wanjing 1 год назад
Родитель
Сommit
003af0fa84
2 измененных файлов: 16 добавлений и 35 удалений
  1. +11
    -19
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/InspectionServiceImpl.java
  2. +5
    -16
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/WorkOrderServiceImpl.java

+ 11
- 19
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/InspectionServiceImpl.java Просмотреть файл

@@ -1,6 +1,5 @@
package com.tuoheng.miniprogram.service.impl;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -64,29 +63,25 @@ public class InspectionServiceImpl implements IInspectionService {
*/
@Override
public JsonResult index(InspectionQuery query) {
log.info("获取任务分页列表,query={}", query);
if (null == query.getLimit() && null == query.getPage()) {
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
//登录用户信息
User userInfo = CurrentUserUtil.getUserInfo();
String username = userInfo.getUsername();
User user = userMapper.selectOne(Wrappers.<User>lambdaQuery()
.eq(StringUtils.isNotEmpty(username), User::getUsername, username)
.eq(User::getStatus, 1).eq(User::getMark, 1));
if (ObjectUtil.isNull(user)) {
return null;
User user = CurrentUserUtil.getUserInfo();
Integer type = user.getDataPermission();
if (null == type) {
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
String tenantId = user.getTenantId();
if (StringUtils.isEmpty(tenantId)) {
return null;
}

query.setTenantId(tenantId);
query.setDeptId(user.getDeptId());
query.setType(1);
//查询部门及下级部门列表
List<Dept> list = deptMapper.selectList(Wrappers.<Dept>lambdaQuery()
.eq(Dept::getMark, 1));

//初始部门id
String deptIdInt = query.getDeptId();

//获取当前部门对应的巡检任务
//获取分页数据
IPage<Inspection> page = new Page<>(query.getPage(), query.getLimit());
@@ -99,10 +94,7 @@ public class InspectionServiceImpl implements IInspectionService {
}
query.setStartTimeDate(startTime);
query.setEndTimeDate(endTime);
Integer type = user.getDataPermission();
if (null == type) {
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}

List<InspectionInfoVo> inspectionInfoVoList = new ArrayList<>();
//用户角色判断 1超级管理员 2部门管理员 3普通用户
if (DataPermissionEnum.ALL.getCode() == type) {
@@ -180,6 +172,7 @@ public class InspectionServiceImpl implements IInspectionService {

pageDataVo.setRecords(inspectionInfoVoList);

log.info("获取任务分页列表,pageDataVo={}", pageDataVo);

return JsonResult.success(pageDataVo);
}
@@ -241,7 +234,6 @@ public class InspectionServiceImpl implements IInspectionService {

}


/**
* 递归获取部门的子集
*

+ 5
- 16
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/WorkOrderServiceImpl.java Просмотреть файл

@@ -142,25 +142,14 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
*/
@Override
public JsonResult getTodoList(WorkOrderQuery query) {
log.info("获取代办工单列表,query={}", query);
if (query.getLimit() == null && query.getPage() == null) {
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
//登录用户信息
User userInfo1 = CurrentUserUtil.getUserInfo();
String username = userInfo1.getUsername();
if (null == username) {
return JsonResult.error(WorkOrderEnum.USER_NAME_IS_NULL.getCode(), WorkOrderEnum.USER_NAME_IS_NULL.getMsg());
}
User user = userMapper.selectOne(Wrappers.<User>lambdaQuery()
.eq(User::getMark, 1)
.eq(User::getUsername, username));
if (ObjectUtil.isNull(user)) {
return JsonResult.error(WorkOrderEnum.USER_IS_NOT_EXIST.getCode(), WorkOrderEnum.USER_IS_NOT_EXIST.getMsg());
}
String tenantId = userInfo1.getTenantId();
if (null == tenantId) {
return JsonResult.error(WorkOrderEnum.DEPT_ID_IS_NULL.getCode(), WorkOrderEnum.DEPT_ID_IS_NULL.getMsg());
}
User user = CurrentUserUtil.getUserInfo();
String tenantId = user.getTenantId();

query.setTenantId(tenantId);
//获取分页数据
IPage<WorkOrder> page = new Page<>(query.getPage(), query.getLimit());
@@ -194,7 +183,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
.like(StringUtils.isNotEmpty(user.getId()), WorkOrder::getAssignUser, user.getId())
.eq(WorkOrder::getTenantId, tenantId)
.between(null != query.getOrderStartTime() && null != query.getOrderEndTime(), WorkOrder::getCreateTime, query.getOrderStartTime(), query.getOrderEndTime())
.eq(WorkOrder::getMark, 1)
.eq(WorkOrder::getMark, MarkEnum.VALID.getCode())
.orderByDesc(WorkOrder::getCreateTime));
if (null == workPageData.getRecords()) {
return null;

Загрузка…
Отмена
Сохранить