|
@@ -10,9 +10,14 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.jeeplus.core.query.QueryWrapperGenerator;
|
|
|
import com.jeeplus.sys.domain.User;
|
|
|
+import com.jeeplus.sys.mapper.UserMapper;
|
|
|
import com.jeeplus.sys.service.dto.UserDTO;
|
|
|
import com.jeeplus.sys.utils.StringUtils;
|
|
|
import com.jeeplus.sys.utils.UserUtils;
|
|
|
+import com.jeeplus.test.editor.domain.EditorFiles;
|
|
|
+import com.jeeplus.test.editor.mapper.EditorFilesMapper;
|
|
|
+import com.jeeplus.test.editor.service.EditorFilesService;
|
|
|
+import com.jeeplus.test.editor.service.dto.EditorFilesDTO;
|
|
|
import com.jeeplus.test.finance.invoice.domain.*;
|
|
|
import com.jeeplus.test.finance.invoice.service.dto.FinanceInvoiceBaseDTO;
|
|
|
import com.jeeplus.test.finance.invoice.service.dto.FinanceInvoiceDTO;
|
|
@@ -62,17 +67,82 @@ public class KlgBaseQuestionsService extends ServiceImpl<KlgBaseQuestionsMapper,
|
|
|
@Resource
|
|
|
private OssService ossService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private UserMapper userMapper;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private EditorFilesService editorFilesService;
|
|
|
+
|
|
|
public IPage<KlgBaseQuestionsDTO> findList(Page<KlgBaseQuestionsDTO> page, KlgBaseQuestionsDTO klgBaseQuestionsDTO) throws Exception{
|
|
|
QueryWrapper<KlgBaseQuestions> queryWrapper = QueryWrapperGenerator.buildQueryCondition ( KlgBaseQuestionsWrapper.INSTANCE.toEntity(klgBaseQuestionsDTO), KlgBaseQuestions.class );
|
|
|
queryWrapper.eq("kbq.del_flag","0");
|
|
|
queryWrapper.orderByDesc("kbq.create_date");
|
|
|
- return klgBaseQuestionsMapper.findList(page,queryWrapper);
|
|
|
+ if (ObjectUtil.isNotEmpty(klgBaseQuestionsDTO)){
|
|
|
+ if(ObjectUtil.isNotEmpty(klgBaseQuestionsDTO.getCreateDateBegin())&&ObjectUtil.isNotEmpty(klgBaseQuestionsDTO.getCreateDateEnd())){
|
|
|
+ queryWrapper.between("kbq.create_date",klgBaseQuestionsDTO.getCreateDateBegin(),klgBaseQuestionsDTO.getCreateDateEnd());
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(klgBaseQuestionsDTO.getStatus())) {
|
|
|
+ if ("2".equals(klgBaseQuestionsDTO.getStatus())){
|
|
|
+ queryWrapper.eq("kbq.status","2").or().eq("kbq.status","5");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ IPage<KlgBaseQuestionsDTO> list = klgBaseQuestionsMapper.findList(page, queryWrapper);
|
|
|
+ list.getRecords().stream().forEach(item->{
|
|
|
+ if(StringUtils.isNotBlank(item.getDisposeBy())) {
|
|
|
+ String disposeByName = new String();
|
|
|
+ String[] split = item.getDisposeBy().split(",");
|
|
|
+ for (int i = 0; i < split.length; i++) {
|
|
|
+ User user = userMapper.selectById(split[i]);
|
|
|
+ if (i != split.length-1) {
|
|
|
+ disposeByName = disposeByName + user.getName() + ",";
|
|
|
+ } else {
|
|
|
+ disposeByName = disposeByName + user.getName();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ item.setDisposeByName(disposeByName);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return list;
|
|
|
}
|
|
|
|
|
|
public KlgBaseQuestionsDTO queryById(String id) {
|
|
|
|
|
|
KlgBaseQuestionsDTO klgBaseQuestionsDTO = klgBaseQuestionsMapper.queryById(id);
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(klgBaseQuestionsDTO)) {
|
|
|
+ if(StringUtils.isNotBlank(klgBaseQuestionsDTO.getContent())){
|
|
|
+ klgBaseQuestionsDTO.setContent(editorFilesService.getNewContent(klgBaseQuestionsDTO.getContent(), id));
|
|
|
+ List<EditorFiles> list = editorFilesService.list(new QueryWrapper<EditorFiles>().lambda().eq(EditorFiles::getSourceId, id));
|
|
|
+ List<EditorFilesDTO> editorFilesDTOList = new ArrayList<>();
|
|
|
+ list.stream().forEach(item->{
|
|
|
+ EditorFilesDTO editorFilesDTO = new EditorFilesDTO();
|
|
|
+ editorFilesDTO.setSourceId(item.getSourceId());
|
|
|
+ editorFilesDTO.setTemporaryUrl(item.getTemporaryUrl());
|
|
|
+ editorFilesDTO.setUrl(item.getUrl());
|
|
|
+ editorFilesDTOList.add(editorFilesDTO);
|
|
|
+ });
|
|
|
+ klgBaseQuestionsDTO.setEditorFilesDTOList(editorFilesDTOList);
|
|
|
+ }
|
|
|
+ if (CollectionUtil.isNotEmpty(klgBaseQuestionsDTO.getKlgBaseReplyDTOList())){
|
|
|
+ klgBaseQuestionsDTO.getKlgBaseReplyDTOList().stream().forEach(item->{
|
|
|
+ if (StringUtils.isNotBlank(item.getContent())){
|
|
|
+ item.setContent(editorFilesService.getNewContent(item.getContent(), item.getId()));
|
|
|
+ List<EditorFiles> list = editorFilesService.list(new QueryWrapper<EditorFiles>().lambda().eq(EditorFiles::getSourceId, item.getId()));
|
|
|
+ List<EditorFilesDTO> editorFilesDTOS = new ArrayList<>();
|
|
|
+ list.stream().forEach(i->{
|
|
|
+ EditorFilesDTO editorFilesDTO = new EditorFilesDTO();
|
|
|
+ editorFilesDTO.setSourceId(i.getSourceId());
|
|
|
+ editorFilesDTO.setTemporaryUrl(i.getTemporaryUrl());
|
|
|
+ editorFilesDTO.setUrl(i.getUrl());
|
|
|
+ editorFilesDTOS.add(editorFilesDTO);
|
|
|
+ });
|
|
|
+ item.setEditorFilesDTOList(editorFilesDTOS);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return klgBaseQuestionsDTO;
|
|
|
}
|
|
|
|
|
@@ -80,6 +150,13 @@ public class KlgBaseQuestionsService extends ServiceImpl<KlgBaseQuestionsMapper,
|
|
|
KlgBaseQuestions klgBaseQuestions = KlgBaseQuestionsWrapper.INSTANCE.toEntity(klgBaseQuestionsDTO);
|
|
|
this.saveOrUpdate(klgBaseQuestions);
|
|
|
if (ObjectUtil.isNotEmpty(klgBaseQuestionsDTO)) {
|
|
|
+ //问题内容
|
|
|
+ editorFilesService.remove(new QueryWrapper<EditorFiles>().lambda().eq(EditorFiles::getSourceId,klgBaseQuestions.getId()));
|
|
|
+ if (CollectionUtil.isNotEmpty(klgBaseQuestionsDTO.getEditorFilesDTOList())) {
|
|
|
+ klgBaseQuestionsDTO.getEditorFilesDTOList().stream().forEach(item->{
|
|
|
+ editorFilesService.saveUrl(item.getTemporaryUrl(),item.getUrl(),klgBaseQuestions.getId());
|
|
|
+ });
|
|
|
+ }
|
|
|
//附件
|
|
|
ossService.saveOrUpdateFileList(klgBaseQuestionsDTO.getWorkAttachmentDtoList(),klgBaseQuestions.getId(),"klg_question");
|
|
|
//处理人
|
|
@@ -110,6 +187,12 @@ public class KlgBaseQuestionsService extends ServiceImpl<KlgBaseQuestionsMapper,
|
|
|
klgBaseReply.setQuestionId(klgBaseQuestions.getId());
|
|
|
klgBaseReplyMapper.insert(klgBaseReply);
|
|
|
}
|
|
|
+ editorFilesService.remove(new QueryWrapper<EditorFiles>().lambda().eq(EditorFiles::getSourceId,klgBaseReply.getId()));
|
|
|
+ if (CollectionUtil.isNotEmpty(item.getEditorFilesDTOList())){
|
|
|
+ item.getEditorFilesDTOList().stream().forEach(file->{
|
|
|
+ editorFilesService.saveUrl(file.getTemporaryUrl(),file.getUrl(),klgBaseReply.getId());
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
}
|