Selaa lähdekoodia

巡检问题批量标记完成和批量指派

master
牧羊人 4 vuotta sitten
vanhempi
commit
bfa819a78b
6 muutettua tiedostoa jossa 84 lisäystä ja 23 poistoa
  1. +5
    -0
      src/main/java/com/taauav/admin/entity/TauvInspectQuestion.java
  2. +4
    -3
      src/main/java/com/taauav/front/controller/UserInspectQuestionController.java
  3. +1
    -1
      src/main/java/com/taauav/front/dto/inspectquestion/InspectQuestionDto.java
  4. +21
    -0
      src/main/java/com/taauav/front/dto/inspectquestion/InspectQuestionFinishedDto.java
  5. +5
    -2
      src/main/java/com/taauav/front/service/IUserInspectQuestionService.java
  6. +48
    -17
      src/main/java/com/taauav/front/service/impl/UserInspectQuestionServiceImpl.java

+ 5
- 0
src/main/java/com/taauav/admin/entity/TauvInspectQuestion.java Näytä tiedosto

@@ -67,4 +67,9 @@ public class TauvInspectQuestion extends Entity {
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date handlerTime;

/**
* 备注
*/
private String note;
}

+ 4
- 3
src/main/java/com/taauav/front/controller/UserInspectQuestionController.java Näytä tiedosto

@@ -4,6 +4,7 @@ package com.taauav.front.controller;
import com.taauav.common.bean.Response;
import com.taauav.front.dto.inspectquestion.InspectQuestionDealwithDto;
import com.taauav.front.dto.inspectquestion.InspectQuestionDto;
import com.taauav.front.dto.inspectquestion.InspectQuestionFinishedDto;
import com.taauav.front.query.UserInspectQuestionQuery;
import com.taauav.front.service.IUserInspectQuestionService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -71,12 +72,12 @@ public class UserInspectQuestionController extends FrontBaseController {
/**
* 标记完成
*
* @param id 问题ID
* @param inspectQuestionFinishedDto 问题ID
* @return
*/
@PostMapping("/finished")
public Response finished(Integer id) {
return inspectQuestionService.finished(id);
public Response finished(@RequestBody InspectQuestionFinishedDto inspectQuestionFinishedDto) {
return inspectQuestionService.finished(inspectQuestionFinishedDto);
}

}

+ 1
- 1
src/main/java/com/taauav/front/dto/inspectquestion/InspectQuestionDto.java Näytä tiedosto

@@ -11,7 +11,7 @@ public class InspectQuestionDto {
/**
* 问题ID
*/
private Integer id;
private String id;

/**
* 指派责任人

+ 21
- 0
src/main/java/com/taauav/front/dto/inspectquestion/InspectQuestionFinishedDto.java Näytä tiedosto

@@ -0,0 +1,21 @@
package com.taauav.front.dto.inspectquestion;

import lombok.Data;

/**
* 标记完成Dto
*/
@Data
public class InspectQuestionFinishedDto {

/**
* 问题ID
*/
private String id;

/**
* 完成备注
*/
private String note;

}

+ 5
- 2
src/main/java/com/taauav/front/service/IUserInspectQuestionService.java Näytä tiedosto

@@ -7,6 +7,7 @@ import com.taauav.common.service.IBaseService;
import com.taauav.front.dto.IndexQuestionDto;
import com.taauav.front.dto.inspectquestion.InspectQuestionDealwithDto;
import com.taauav.front.dto.inspectquestion.InspectQuestionDto;
import com.taauav.front.dto.inspectquestion.InspectQuestionFinishedDto;
import com.taauav.front.query.UserInspectQuestionQuery;

/**
@@ -54,13 +55,14 @@ public interface IUserInspectQuestionService extends IBaseService<TauvInspectQue
/**
* 标记完成
*
* @param id 问题ID
* @param inspectQuestionFinishedDto 问题ID
* @return
*/
Response finished(Integer id);
Response finished(InspectQuestionFinishedDto inspectQuestionFinishedDto);

/**
* 获取指挥大屏问题清单分页列表数据
*
* @param indexQuestionDto
* @return
*/
@@ -68,6 +70,7 @@ public interface IUserInspectQuestionService extends IBaseService<TauvInspectQue

/**
* 获取指挥大屏问题详情
*
* @param id
* @return
*/

+ 48
- 17
src/main/java/com/taauav/front/service/impl/UserInspectQuestionServiceImpl.java Näytä tiedosto

@@ -15,6 +15,7 @@ import com.taauav.front.constant.UserInspectQuestionConstant;
import com.taauav.front.dto.IndexQuestionDto;
import com.taauav.front.dto.inspectquestion.InspectQuestionDealwithDto;
import com.taauav.front.dto.inspectquestion.InspectQuestionDto;
import com.taauav.front.dto.inspectquestion.InspectQuestionFinishedDto;
import com.taauav.front.mapper.UserInspectQuestionMapper;
import com.taauav.front.query.UserInspectQuestionQuery;
import com.taauav.front.service.IUserInspectQuestionService;
@@ -107,7 +108,7 @@ public class UserInspectQuestionServiceImpl extends BaseServiceImpl<UserInspectQ
*/
@Override
public Response assign(InspectQuestionDto inspectQuestionDto) {
if (inspectQuestionDto.getId() == null || inspectQuestionDto.getId() <= 0) {
if (StringUtils.isEmpty(inspectQuestionDto.getId())) {
return response.failure("巡检问题ID不能为空");
}
if (StringUtils.isEmpty(inspectQuestionDto.getAssignUser())) {
@@ -120,14 +121,29 @@ public class UserInspectQuestionServiceImpl extends BaseServiceImpl<UserInspectQ
if (inspectQuestion.getStatus() == 3) {
return response.failure("巡检问题已处理完成,无法指派");
}
TauvInspectQuestion entity = new TauvInspectQuestion();
entity.setId(inspectQuestionDto.getId());
entity.setAssignUser(inspectQuestionDto.getAssignUser());
entity.setAssignContact(inspectQuestionDto.getAssignContact());
entity.setAssignNote(inspectQuestionDto.getAssignNote());
entity.setAssignTime(DateUtil.now());
entity.setStatus(2);
boolean result = editData(entity);
boolean result = false;
if (inspectQuestionDto.getId().contains(",")) {
String[] strings = inspectQuestionDto.getId().split(",");
for (String string : strings) {
TauvInspectQuestion entity = new TauvInspectQuestion();
entity.setId(Integer.valueOf(string));
entity.setAssignUser(inspectQuestionDto.getAssignUser());
entity.setAssignContact(inspectQuestionDto.getAssignContact());
entity.setAssignNote(inspectQuestionDto.getAssignNote());
entity.setAssignTime(DateUtil.now());
entity.setStatus(2);
result = editData(entity);
}
} else {
TauvInspectQuestion entity = new TauvInspectQuestion();
entity.setId(Integer.valueOf(inspectQuestionDto.getId()));
entity.setAssignUser(inspectQuestionDto.getAssignUser());
entity.setAssignContact(inspectQuestionDto.getAssignContact());
entity.setAssignNote(inspectQuestionDto.getAssignNote());
entity.setAssignTime(DateUtil.now());
entity.setStatus(2);
result = editData(entity);
}
if (!result) {
return response.failure("问题指派失败");
}
@@ -230,20 +246,35 @@ public class UserInspectQuestionServiceImpl extends BaseServiceImpl<UserInspectQ
/**
* 标记完成
*
* @param id 问题ID
* @param inspectQuestionFinishedDto 问题ID
* @return
*/
@Override
public Response finished(Integer id) {
if (id == null || id <= 0) {
public Response finished(InspectQuestionFinishedDto inspectQuestionFinishedDto) {
if (StringUtils.isEmpty(inspectQuestionFinishedDto.getId())) {
return response.failure("问题ID不能为空");
}
TauvInspectQuestion entity = inspectQuestionMapper.selectById(id);
if (entity == null) {
return response.failure("巡检问题信息不存在");
boolean result = false;
if (inspectQuestionFinishedDto.getId().contains(",")) {
String[] strings = inspectQuestionFinishedDto.getId().split(",");
for (String string : strings) {
TauvInspectQuestion entity = inspectQuestionMapper.selectById(Integer.valueOf(string));
if (entity == null) {
return response.failure("巡检问题信息不存在");
}
entity.setStatus(3);
entity.setNote(inspectQuestionFinishedDto.getNote());
result = this.editData(entity);
}
} else {
TauvInspectQuestion entity = inspectQuestionMapper.selectById(Integer.valueOf(inspectQuestionFinishedDto.getId()));
if (entity == null) {
return response.failure("巡检问题信息不存在");
}
entity.setStatus(3);
entity.setNote(inspectQuestionFinishedDto.getNote());
result = this.editData(entity);
}
entity.setStatus(3);
boolean result = this.editData(entity);
if (!result) {
return response.failure("操作失败");
}

Loading…
Peruuta
Tallenna