|
|
@@ -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("操作失败"); |
|
|
|
} |