Browse Source

部门信息简报查询最新五条任务列表

tags/v1.0.0^2
chengwang 1 year ago
parent
commit
6673a41258
5 changed files with 60 additions and 8 deletions
  1. +2
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/InspectionController.java
  2. +1
    -1
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/controller/InspectionFileController.java
  3. +31
    -0
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/enums/InspectionFileStatusEnum.java
  4. +7
    -2
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/InspectionFileServiceImpl.java
  5. +19
    -5
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/WorkOrderServiceImpl.java

+ 2
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/InspectionController.java View File

@@ -134,6 +134,8 @@ public class InspectionController {

/**
* 立即执行
* @param id
* @return
*/
@PostMapping("/execute/{id}")
public JsonResult execute(@PathVariable("id") String id) {

+ 1
- 1
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/controller/InspectionFileController.java View File

@@ -99,7 +99,7 @@ public class InspectionFileController {
* @param id
* @return
*/
@GetMapping("/Navigation/{id}")
@GetMapping("/navigation/{id}")
public JsonResult navigation(@PathVariable("id") String id){
return iInspectionFileService.navigation(id);
}

+ 31
- 0
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/enums/InspectionFileStatusEnum.java View File

@@ -0,0 +1,31 @@
package com.tuoheng.miniprogram.enums;

import lombok.Getter;

/**
* 巡检任务问题状态
*
* @author wanjing
* @team tuoheng
* @date 2022-11-24
*/
public enum InspectionFileStatusEnum {

WAIT_CONFIRMED(5,"待确认"),
IGNORED(10,"已忽略"),
CONFIRMED(15,"已确认"),
GENERATE_ORDER(20,"已生成工单"),
PROCESSED(25,"已处理"); ;

InspectionFileStatusEnum(int code, String description){
this.code = code;
this.description = description;
}

@Getter
private int code;

@Getter
private String description;

}

+ 7
- 2
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/InspectionFileServiceImpl.java View File

@@ -285,8 +285,13 @@ public class InspectionFileServiceImpl implements IInspectionFileService {
*/
@Override
public JsonResult navigation(String id) {

return null;
if(StringUtils.isEmpty(id)){
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
InspectionFile inspectionFile = inspectionFileMapper.selectOne(Wrappers.<InspectionFile>lambdaQuery()
.eq(InspectionFile::getMark, 1)
.eq(InspectionFile::getId, id));
return JsonResult.success(inspectionFile);
}

/**

+ 19
- 5
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/WorkOrderServiceImpl.java View File

@@ -1,20 +1,21 @@
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.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.tuoheng.common.core.common.BaseServiceImpl;
import com.tuoheng.common.core.utils.DateUtils;
import com.tuoheng.common.core.utils.JsonResult;
import com.tuoheng.common.core.utils.SecurityUserUtils;
import com.tuoheng.common.core.utils.StringUtils;
import com.tuoheng.miniprogram.dao.DeptMapper;
import com.tuoheng.miniprogram.dao.UserMapper;
import com.tuoheng.miniprogram.dao.WorkOrderFileMapper;
import com.tuoheng.miniprogram.dao.WorkOrderMapper;
import com.tuoheng.miniprogram.dao.*;
import com.tuoheng.miniprogram.entity.InspectionFile;
import com.tuoheng.miniprogram.entity.User;
import com.tuoheng.miniprogram.entity.WorkOrder;
import com.tuoheng.miniprogram.entity.WorkOrderFile;
import com.tuoheng.miniprogram.entity.dto.WorkOrderDto;
import com.tuoheng.miniprogram.enums.InspectionFileStatusEnum;
import com.tuoheng.miniprogram.enums.WorkOrderEnum;
import com.tuoheng.miniprogram.enums.WorkOrderStatusEnum;
import com.tuoheng.miniprogram.service.IWorkOrderService;
@@ -42,6 +43,9 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
@Autowired
private WorkOrderFileMapper workOrderFileMapper;

@Autowired
private InspectionFileMapper inspectionFileMapper;

@Autowired
private DeptMapper deptMapper;

@@ -96,7 +100,17 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
workOrderFile.setTenantId(dto.getTenantId());
workOrderFile.setInspectionFileId(dto.getInspectionFileId());
workOrderFile.setWorkOrderId(workOrder.getId());
workOrderFileMapper.insert(workOrderFile);
int num = workOrderFileMapper.insert(workOrderFile);
if(num<=0){
return JsonResult.error();
}
//更新问题状态为工单已生成
InspectionFile inspectionFile = inspectionFileMapper.selectById(dto.getInspectionFileId());
inspectionFile.setStatus(InspectionFileStatusEnum.GENERATE_ORDER.getCode());
int count = inspectionFileMapper.updateById(inspectionFile);
if(count<=0){
return JsonResult.error();
}

return JsonResult.success();
}

Loading…
Cancel
Save