Переглянути джерело

Merge branch 'develop' of gitadmin/tuoheng_telecomumale into release

tags/v1.3.1^2
wanjing 1 рік тому
джерело
коміт
622c63b249
5 змінених файлів з 141 додано та 0 видалено
  1. +10
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/InspectionFileController.java
  2. +10
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/IInspectionFileService.java
  3. +15
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/InspectionFileServiceImpl.java
  4. +105
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/deleted/InspectionFileDeletedService.java
  5. +1
    -0
      tuoheng-service/tuoheng-admin/src/main/resources/mapper/InspectionFileMapper.xml

+ 10
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/InspectionFileController.java Переглянути файл

@@ -84,6 +84,16 @@ public class InspectionFileController {
return iInspectionFileService.ignore(idList);
}

/**
* 任务问题删除
*
* @return
*/
@PostMapping("/delete/{idList}")
public JsonResult deleted(@PathVariable("idList") List<String> idList){
return iInspectionFileService.deleted(idList);
}

/**
*
* 查看问题处理

+ 10
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/IInspectionFileService.java Переглянути файл

@@ -12,6 +12,7 @@ import java.util.List;
* @Date 2022/11/29
*/
public interface IInspectionFileService {

JsonResult getQuestionList();

JsonResult getListByDeptUserType(InspectionFileQuery query);
@@ -52,6 +53,15 @@ public interface IInspectionFileService {
*/
JsonResult ignore(List<String> idList);

/**
*
* 删除
*
* @param idList
* @return
*/
JsonResult deleted(List<String> idList);

/**
*
* 获取任务问题处理结果

+ 15
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/InspectionFileServiceImpl.java Переглянути файл

@@ -17,6 +17,7 @@ import com.tuoheng.admin.request.inspectionfile.*;
import com.tuoheng.admin.service.inspectionfile.confirm.InspectionFileConfirmService;
import com.tuoheng.admin.service.inspectionfile.handle.QueryInspectionFileHandleByInspectionFileIdService;
import com.tuoheng.admin.service.inspectionfile.ignore.InspectionFileIgnoreService;
import com.tuoheng.admin.service.inspectionfile.deleted.InspectionFileDeletedService;
import com.tuoheng.admin.service.inspectionfile.processing.InspectionFileProcessingService;
import com.tuoheng.admin.service.inspectionfile.query.QueryInspectionFileDistributionListService;
import com.tuoheng.admin.service.inspectionfile.query.QueryInspectionFilePageListByInspectionIdService;
@@ -79,6 +80,9 @@ public class InspectionFileServiceImpl implements IInspectionFileService {
@Autowired
private InspectionFileConfirmService inspectionFileConfirmService;

@Autowired
private InspectionFileDeletedService inspectionFileDeletedService;

@Autowired
private QueryInspectionFileHandleByInspectionFileIdService queryInspectionFileHandleByInspectionFileIdService;

@@ -389,6 +393,17 @@ public class InspectionFileServiceImpl implements IInspectionFileService {
return inspectionFileIgnoreService.ignore(idList);
}

/**
* 删除
*
* @param idList
* @return
*/
@Override
public JsonResult deleted(List<String> idList) {
return inspectionFileDeletedService.deleted(idList);
}

/**
* 获取任务问题处理结果
*

+ 105
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/deleted/InspectionFileDeletedService.java Переглянути файл

@@ -0,0 +1,105 @@
package com.tuoheng.admin.service.inspectionfile.deleted;

import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.admin.entity.InspectionFile;
import com.tuoheng.admin.enums.InspectionFileStatusEnum;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.enums.code.inspectionfile.InspectionFileIgnoreCodeEnum;
import com.tuoheng.admin.mapper.InspectionFileMapper;
import com.tuoheng.admin.mapper.InspectionMapper;
import com.tuoheng.admin.utils.CurrentUserUtil;
import com.tuoheng.common.core.utils.DateUtils;
import com.tuoheng.common.core.utils.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
* 任务问题删除业务层处理
*
* @author wanjing
* @team tuoheng
* @date 2023-09-19
*/
@Slf4j
@Service
public class InspectionFileDeletedService {

@Autowired
private InspectionMapper inspectionMapper;

@Autowired
private InspectionFileMapper inspectionFileMapper;

public JsonResult deleted(List<String> idList) {
log.info("进入任务问题删除业务, idList:{}", idList.toString());
String userId = CurrentUserUtil.getUserId();
JsonResult result = this.check(idList);
if (0 != result.getCode()) {
log.info("进入任务问题删除业务:校验失败:{}", result.getMsg());
return result;
}

// 忽略任务问题
result = this.updateInspectionFileStatus(userId, idList);

return result;
}

/**
* 检查参数
*
* @param idList
* @return
*/
private JsonResult check(List<String> idList) {
// 判断任务id是否为空
if (CollectionUtil.isEmpty(idList)) {
return JsonResult.error(InspectionFileIgnoreCodeEnum.INSPECTION_FILE_ID_IS_NULL.getCode(), InspectionFileIgnoreCodeEnum.INSPECTION_FILE_ID_IS_NULL.getMsg());
}

// 判断任务是否存在
List<InspectionFile> inspectionFileList = inspectionFileMapper.selectList(new LambdaQueryWrapper<InspectionFile>()
.in(InspectionFile::getId, idList)
.eq(InspectionFile::getMark, MarkEnum.VALID.getCode()));

if (CollectionUtil.isEmpty(inspectionFileList)) {
return JsonResult.error(InspectionFileIgnoreCodeEnum.INSPECTION_FILE_IS_NOT_EXIST.getCode(), InspectionFileIgnoreCodeEnum.INSPECTION_FILE_IS_NOT_EXIST.getMsg());
}

for (InspectionFile inspectionFile : inspectionFileList) {
if (InspectionFileStatusEnum.WAIT_CONFIRMED.getCode() != inspectionFile.getStatus() && InspectionFileStatusEnum.CONFIRMED.getCode() != inspectionFile.getStatus()) {
return JsonResult.error(InspectionFileIgnoreCodeEnum.NOT_WAIT_CONFIRMED_OR_CONFIRMED_CAN_IGNORED.getCode(), InspectionFileIgnoreCodeEnum.NOT_WAIT_CONFIRMED_OR_CONFIRMED_CAN_IGNORED.getMsg());
}
}

return JsonResult.success();
}

/**
*
* 删除问题
*
* @param userId
* @param idList
*/
private JsonResult updateInspectionFileStatus(String userId, List<String> idList) {
Map<String, Object> map = new HashMap<>();
map.put("mark", MarkEnum.NOTVALID.getCode());
map.put("updateUser", userId);
map.put("updateTime", DateUtils.now());
map.put("idList", idList);
Integer rowCount = inspectionFileMapper.updateByIdList(map);
if (rowCount <= 0) {
log.info("删除问题失败");
return JsonResult.error(InspectionFileIgnoreCodeEnum.IGNORE_IS_FAILED.getCode(), InspectionFileIgnoreCodeEnum.IGNORE_IS_FAILED.getMsg());
}
return JsonResult.success();
}

}

+ 1
- 0
tuoheng-service/tuoheng-admin/src/main/resources/mapper/InspectionFileMapper.xml Переглянути файл

@@ -266,6 +266,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null"> update_time = #{updateTime}, </if>
<if test="checkUser != null and checkUser != ''"> check_user = #{checkUser}, </if>
<if test="checkTime != null"> check_time = #{checkTime}, </if>
<if test="mark != null"> mark = #{mark}, </if>
</trim>
<where>
<if test="idList != null and idList.size() > 0">

Завантаження…
Відмінити
Зберегти