Browse Source

Merge branch 'develop' of gitadmin/tuoheng_telecomumale into release

tags/v1.0.0^2
chengwang 1 year ago
parent
commit
47ac7a052b
1 changed files with 52 additions and 9 deletions
  1. +52
    -9
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/WorkOrderServiceImpl.java

+ 52
- 9
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/WorkOrderServiceImpl.java View File

@@ -770,18 +770,28 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
}
//根据用户角色判断 1超级管理员 2部门管理员 3普通用户
if (RoleEnum.SUPER_ADMIN.getCode() == type) {
//获取当前登录用户(超级管理员)已完成工单列表
//获取当前登录用户(被分配人员)的待处理工单列表
List<WorkOrder> workOrderData = workOrderMapper.selectList(Wrappers.<WorkOrder>lambdaQuery()
.eq(WorkOrder::getMark, MarkEnum.VALID.getCode())
.like(WorkOrder::getAssignUser, user.getId())
.eq(WorkOrder::getStatus, 10)
.eq(WorkOrder::getAssignDeptId, user.getDeptId())
.between(WorkOrder::getAssignTime, startTime, endTime));
if(CollectionUtil.isNotEmpty(workOrderData) || workOrderData.size() != 0){
vo.setWeekWorkOrderTodoSum(workOrderData.size());
}
//获取当前登录用户的租户下的已完成工单列表
List<WorkOrder> workOrders = workOrderMapper.selectList(Wrappers.<WorkOrder>lambdaQuery()
.eq(WorkOrder::getMark, MarkEnum.VALID.getCode())
.eq(WorkOrder::getTenantId, tenantId)
.eq(WorkOrder::getStatus, 15)
.between(WorkOrder::getUpdateTime, startTime, endTime));
if (StringUtils.isNotEmpty(workOrders)) {
if (CollectionUtil.isNotEmpty(workOrders) || workOrders.size() != 0) {
vo.setWeekWorkOrderFinishedSum(workOrders.size());
}
}
//部门管理员 普通用户
if (RoleEnum.ADMIN.getCode() == type || RoleEnum.ORDINARY_USER.getCode() == type) {
if (RoleEnum.ADMIN.getCode() == type) {
//获取部门id
if (StringUtils.isEmpty(user.getDeptId())) {
return JsonResult.error(WorkOrderEnum.DEPT_ID_IS_NULL.getCode(), WorkOrderEnum.DEPT_ID_IS_NULL.getMsg());
@@ -791,21 +801,54 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
.eq(WorkOrder::getMark, MarkEnum.VALID.getCode())
.like(WorkOrder::getAssignUser, user.getId())
.eq(WorkOrder::getStatus, 10)
.eq(WorkOrder::getTenantId, tenantId)
.eq(WorkOrder::getDeptId, user.getDeptId())
.eq(WorkOrder::getAssignDeptId, user.getDeptId())
.between(WorkOrder::getAssignTime, startTime, endTime));
if (StringUtils.isNotEmpty(workOrders)) {
if (CollectionUtil.isNotEmpty(workOrders) || workOrders.size() != 0) {
vo.setWeekWorkOrderTodoSum(workOrders.size());
}
//获取当前登录用户部门id
String deptId = user.getDeptId();
List<String> deptIdList = deptMapper.selectAllChildListById(deptId);
if(CollectionUtil.isEmpty(deptIdList) || deptIdList.size() == 0) {
return JsonResult.error(WorkOrderEnum.DATA_IS_NULL.getCode(),WorkOrderEnum.DATA_IS_NULL.getMsg());
}
//获取当前登录用户(被分配人员)的已完成工单列表
List<WorkOrder> result = workOrderMapper.selectList(Wrappers.<WorkOrder>lambdaQuery()
.eq(WorkOrder::getMark, MarkEnum.VALID.getCode())
.like(WorkOrder::getAssignUser, user.getId())
.eq(WorkOrder::getStatus, 15)
.eq(WorkOrder::getTenantId, tenantId)
.eq(WorkOrder::getDeptId, user.getDeptId())
.in(WorkOrder::getAssignDeptId, deptIdList)
.between(WorkOrder::getUpdateTime, startTime, endTime));
if (StringUtils.isNotEmpty(result)) {
if (CollectionUtil.isNotEmpty(result) || result.size() != 0) {
vo.setWeekWorkOrderFinishedSum(result.size());
}
}

if (RoleEnum.ORDINARY_USER.getCode() == type) {
//获取部门id
if (StringUtils.isEmpty(user.getDeptId())) {
return JsonResult.error(WorkOrderEnum.DEPT_ID_IS_NULL.getCode(), WorkOrderEnum.DEPT_ID_IS_NULL.getMsg());
}
//获取当前登录用户(被分配人员)的待处理工单列表
List<WorkOrder> workOrders = workOrderMapper.selectList(Wrappers.<WorkOrder>lambdaQuery()
.eq(WorkOrder::getMark, MarkEnum.VALID.getCode())
.like(WorkOrder::getAssignUser, user.getId())
.eq(WorkOrder::getStatus, 10)
.eq(WorkOrder::getAssignDeptId, user.getDeptId())
.between(WorkOrder::getAssignTime, startTime, endTime));
if (CollectionUtil.isNotEmpty(workOrders) || workOrders.size() != 0) {
vo.setWeekWorkOrderTodoSum(workOrders.size());
}
//获取当前登录用户部门id
String deptId = user.getDeptId();
//获取当前登录用户(被分配人员)的已完成工单列表
List<WorkOrder> result = workOrderMapper.selectList(Wrappers.<WorkOrder>lambdaQuery()
.eq(WorkOrder::getMark, MarkEnum.VALID.getCode())
.like(WorkOrder::getAssignUser, user.getId())
.eq(WorkOrder::getStatus, 15)
.eq(WorkOrder::getAssignDeptId, deptId)
.between(WorkOrder::getUpdateTime, startTime, endTime));
if (CollectionUtil.isNotEmpty(result) || result.size() != 0) {
vo.setWeekWorkOrderFinishedSum(result.size());
}
}

Loading…
Cancel
Save