修改文档对比-添加对比结果全文评论列表
This commit is contained in:
+14
@@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import com.jero.common.api.vo.Result;
|
import com.jero.common.api.vo.Result;
|
||||||
import com.jero.common.system.query.QueryGenerator;
|
import com.jero.common.system.query.QueryGenerator;
|
||||||
|
import com.jero.modules.compare.entity.SarFileCompareResComVO;
|
||||||
import com.jero.modules.compare.entity.SarFileCompareResComment;
|
import com.jero.modules.compare.entity.SarFileCompareResComment;
|
||||||
import com.jero.modules.compare.service.ISarFileCompareResCommentService;
|
import com.jero.modules.compare.service.ISarFileCompareResCommentService;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
@@ -167,4 +168,17 @@ public class SarFileCompareResCommentController extends JeroController<SarFileCo
|
|||||||
return super.importExcel(request, response, SarFileCompareResComment.class);
|
return super.importExcel(request, response, SarFileCompareResComment.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表查询
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "文档对比信息结果评论表-根据infoId查询列表")
|
||||||
|
@ApiOperation(value="文档对比信息结果评论表-列表查询", notes="文档对比信息结果评论表-列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<List<SarFileCompareResComVO>> queryListByInfoId(@RequestParam(name="id",required=true) String id) {
|
||||||
|
List<SarFileCompareResComVO> list = sarFileCompareResCommentService.queryListByInfoId(id);
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+59
@@ -0,0 +1,59 @@
|
|||||||
|
package com.jero.modules.compare.entity;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class SarFileCompareResComVO {
|
||||||
|
private String id;
|
||||||
|
private String name;
|
||||||
|
private String createTime;
|
||||||
|
private String content;
|
||||||
|
private List<SarFileCompareResComVO> resComVoList;
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateTime(String createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getContent() {
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContent(String content) {
|
||||||
|
this.content = content;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<SarFileCompareResComVO> getResComVoList() {
|
||||||
|
return resComVoList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setResComVoList(List<SarFileCompareResComVO> resComVoList) {
|
||||||
|
this.resComVoList = resComVoList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addResComVo(SarFileCompareResComVO resComVo) {
|
||||||
|
if (null == this.resComVoList) {
|
||||||
|
this.resComVoList = new ArrayList<>();
|
||||||
|
}
|
||||||
|
this.resComVoList.add(resComVo);
|
||||||
|
}
|
||||||
|
}
|
||||||
+9
@@ -11,6 +11,7 @@ public class SarFileCompareResultVO {
|
|||||||
private String serialNumberRight;
|
private String serialNumberRight;
|
||||||
private String fileNameRight;
|
private String fileNameRight;
|
||||||
private List<SarFileCompareItemComVO> resList;
|
private List<SarFileCompareItemComVO> resList;
|
||||||
|
private String comments;
|
||||||
|
|
||||||
public SarFileCompareResultVO() {
|
public SarFileCompareResultVO() {
|
||||||
}
|
}
|
||||||
@@ -69,4 +70,12 @@ public class SarFileCompareResultVO {
|
|||||||
}
|
}
|
||||||
this.resList.add(item);
|
this.resList.add(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getComments() {
|
||||||
|
return comments;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setComments(String comments) {
|
||||||
|
this.comments = comments;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
@@ -1,5 +1,6 @@
|
|||||||
package com.jero.modules.compare.service;
|
package com.jero.modules.compare.service;
|
||||||
|
|
||||||
|
import com.jero.modules.compare.entity.SarFileCompareResComVO;
|
||||||
import com.jero.modules.compare.entity.SarFileCompareResComment;
|
import com.jero.modules.compare.entity.SarFileCompareResComment;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -58,4 +59,6 @@ public interface ISarFileCompareResCommentService extends IService<SarFileCompar
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<SarFileCompareResComment> queryList();
|
List<SarFileCompareResComment> queryList();
|
||||||
|
|
||||||
|
List<SarFileCompareResComVO> queryListByInfoId(String id);
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-3
@@ -67,9 +67,11 @@ public class SarFileCompareItemCommentServiceImpl extends ServiceImpl<SarFileCom
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void editById(SarFileCompareItemComment sarFileCompareItemComment) {
|
public void editById(SarFileCompareItemComment sarFileCompareItemComment) {
|
||||||
|
SarFileCompareItemComment ic = queryById(sarFileCompareItemComment.getId());
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
sarFileCompareItemComment.setUpdateTime(now);
|
ic.setUpdateTime(now);
|
||||||
saveOrUpdate(sarFileCompareItemComment);
|
ic.setComment(sarFileCompareItemComment.getComment());
|
||||||
|
saveOrUpdate(ic);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -124,7 +126,7 @@ public class SarFileCompareItemCommentServiceImpl extends ServiceImpl<SarFileCom
|
|||||||
resultVO.setFileNameLeft(sfcInfo.getFileNameLeft());
|
resultVO.setFileNameLeft(sfcInfo.getFileNameLeft());
|
||||||
resultVO.setSerialNumberRight(sfcInfo.getSerialNumberRight());
|
resultVO.setSerialNumberRight(sfcInfo.getSerialNumberRight());
|
||||||
resultVO.setFileNameRight(sfcInfo.getFileNameRight());
|
resultVO.setFileNameRight(sfcInfo.getFileNameRight());
|
||||||
|
resultVO.setComments(sfcInfo.getComments());
|
||||||
|
|
||||||
List<SarFileCompareItemComment> list = queryListByInfoId(infoId);
|
List<SarFileCompareItemComment> list = queryListByInfoId(infoId);
|
||||||
Map<String, SarFileCompareItem> sfcItemMap = SarFileCompareItemServiceImpl.queryMapByInfoId(infoId);
|
Map<String, SarFileCompareItem> sfcItemMap = SarFileCompareItemServiceImpl.queryMapByInfoId(infoId);
|
||||||
|
|||||||
+85
-45
@@ -1,29 +1,37 @@
|
|||||||
package com.jero.modules.compare.service.impl;
|
package com.jero.modules.compare.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.jero.modules.compare.entity.SarFileCompareResComVO;
|
||||||
import com.jero.modules.compare.entity.SarFileCompareResComment;
|
import com.jero.modules.compare.entity.SarFileCompareResComment;
|
||||||
import com.jero.modules.compare.mapper.SarFileCompareResCommentMapper;
|
import com.jero.modules.compare.mapper.SarFileCompareResCommentMapper;
|
||||||
import com.jero.modules.compare.service.ISarFileCompareResCommentService;
|
import com.jero.modules.compare.service.ISarFileCompareResCommentService;
|
||||||
|
import com.jero.modules.system.util.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import java.util.List;
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 文档对比信息结果评论表
|
* @Description: 文档对比信息结果评论表
|
||||||
* @Author: jero-boot
|
* @Author: jero-boot
|
||||||
* @Date: 2022-08-05
|
* @Date: 2022-08-05
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SarFileCompareResCommentServiceImpl extends ServiceImpl<SarFileCompareResCommentMapper, SarFileCompareResComment> implements ISarFileCompareResCommentService {
|
public class SarFileCompareResCommentServiceImpl extends ServiceImpl<SarFileCompareResCommentMapper, SarFileCompareResComment> implements ISarFileCompareResCommentService {
|
||||||
|
|
||||||
/**
|
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
* 保存
|
|
||||||
*
|
/**
|
||||||
* @param sarFileCompareResComment
|
* 保存
|
||||||
* @return
|
*
|
||||||
*/
|
* @param sarFileCompareResComment
|
||||||
@Override
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public void add(SarFileCompareResComment sarFileCompareResComment) {
|
public void add(SarFileCompareResComment sarFileCompareResComment) {
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
sarFileCompareResComment.setCreateTime(now);
|
sarFileCompareResComment.setCreateTime(now);
|
||||||
@@ -31,59 +39,91 @@ public class SarFileCompareResCommentServiceImpl extends ServiceImpl<SarFileComp
|
|||||||
save(sarFileCompareResComment);
|
save(sarFileCompareResComment);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新
|
* 更新
|
||||||
*
|
*
|
||||||
* @param sarFileCompareResComment
|
* @param sarFileCompareResComment
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void editById(SarFileCompareResComment sarFileCompareResComment) {
|
public void editById(SarFileCompareResComment sarFileCompareResComment) {
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
sarFileCompareResComment.setUpdateTime(now);
|
sarFileCompareResComment.setUpdateTime(now);
|
||||||
saveOrUpdate(sarFileCompareResComment);
|
saveOrUpdate(sarFileCompareResComment);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过id删除
|
* 通过id删除
|
||||||
*
|
*
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void deleteById(String id) {
|
public void deleteById(String id) {
|
||||||
removeById(id);
|
removeById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除
|
* 批量删除
|
||||||
*
|
*
|
||||||
* @param ids
|
* @param ids
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void deleteByIds(List<String> ids) {
|
public void deleteByIds(List<String> ids) {
|
||||||
removeByIds(ids);
|
removeByIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过id查询
|
* 通过id查询
|
||||||
*
|
*
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SarFileCompareResComment queryById(String id) {
|
public SarFileCompareResComment queryById(String id) {
|
||||||
return getById(id);
|
return getById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表查询
|
* 列表查询
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SarFileCompareResComment> queryList() {
|
public List<SarFileCompareResComment> queryList() {
|
||||||
return list();
|
return list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SarFileCompareResComVO> queryListByInfoId(String id) {
|
||||||
|
LambdaQueryWrapper<SarFileCompareResComment> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(SarFileCompareResComment::getInfoId, id);
|
||||||
|
queryWrapper.orderBy(true, true, SarFileCompareResComment::getCreateTime);
|
||||||
|
List<SarFileCompareResComVO> resList = new ArrayList<>();
|
||||||
|
List<SarFileCompareResComment> list = this.list(queryWrapper);
|
||||||
|
for (SarFileCompareResComment rc : list) {
|
||||||
|
if (StringUtils.isEmpty(rc.getParentId())) {
|
||||||
|
SarFileCompareResComVO resComVO = wrapperSarFileCompareResComVO(rc);
|
||||||
|
for (SarFileCompareResComment rc1 : list) {
|
||||||
|
if (!StringUtils.isEmpty(rc.getParentId()) && rc.getParentId().equals(resComVO.getId())) {
|
||||||
|
resComVO.addResComVo(wrapperSarFileCompareResComVO(rc1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resList.add(resComVO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return resList;
|
||||||
|
}
|
||||||
|
|
||||||
|
private SarFileCompareResComVO wrapperSarFileCompareResComVO(SarFileCompareResComment rc) {
|
||||||
|
SarFileCompareResComVO resComVO = new SarFileCompareResComVO();
|
||||||
|
resComVO.setId(rc.getId());
|
||||||
|
resComVO.setName(rc.getCreateBy());
|
||||||
|
resComVO.setCreateTime(sdf.format(rc.getCreateTime()));
|
||||||
|
resComVO.setContent(rc.getComment());
|
||||||
|
return resComVO;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user