Commit 005f9b8f by 宋珺琪

同步接口(重庆)

parent ef4307b7
......@@ -82,6 +82,8 @@ public class SkServiceCache implements Serializable {
@TableField(exist = false)
private int pageSize;
@TableField(exist = false)
private String xslx;
/**
* 导出时间格式转换备用字段
*/
......
package com.founder.commonutils.model.newPublicEntity.suggestionEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sk_comment")
@ApiModel(value="反馈意见评论表", description="")
public class CommentEntity implements Serializable {
@TableId(type = IdType.INPUT)
private String plId; // 评论ID
private String content; // 评论内容
private String userName; // 评论作者姓名
private String createTime; // 评论时间
private String isDelete; // 是否删除(0:未删除;1:已删除)
private String blogId; // 文章ID
private String parentId; // 父评论ID(被回复的评论)
private String rootParentId; // 根评论ID(最顶级的评论)
private String userPhoto; // 作者照片
@TableField(exist = false)
private String parentName; // 父评论名字(被回复的评论)
@TableField(exist = false)
private List<CommentEntity> child; // 本评论下的子评论
}
package com.founder.commonutils.model.newPublicEntity.suggestionEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sk_paper")
@ApiModel(value="反馈意见文章", description="")
public class PaperEntity implements Serializable {
@TableId(type = IdType.INPUT)
private String id; // 文章id
private String userName; // 文章作者姓名
private String content; // 文章内容
private String title; // 文章标题
private Integer count; // 文章评论次数
private String createTime; // 创建时间
private String updateTime; //修改时间
private String isDelete; // 是否删除(0:未删除;1:已删除)
private String photo; //图片地址
private String fileName;//文件名
private String userPhoto; // 作者照片
@TableField(exist = false)
private int page;//当前第几页
@TableField(exist = false)
private int limit;//每页多少行
}
......@@ -9,6 +9,7 @@ import com.founder.commonutils.model.newPublicEntity.MapRestResult;
import com.founder.publicapi.service.OrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
......@@ -178,6 +179,13 @@ public class OrderController {
Map<String,Object> mapResult = new HashMap<>();
Map<String,Object> objectMap = new HashMap<>();
try{
if (StringUtils.isEmpty(orderCode)){
mapResult.put("data","");
mapResult.put("msg","获取申请详情失败");
mapResult.put("status",200);
mapResult.put("count","");
return mapResult;
}
TbstApproveOrder tbstApproveOrder = new TbstApproveOrder();
tbstApproveOrder.setOrderCode(orderCode);
objectMap = orderService.getSqdDteail(tbstApproveOrder);
......
......@@ -138,7 +138,7 @@ public class SkServiceSqController {
if (updateById) {
return new MapRestResult();
} else {
return new MapRestResult().error();
return new MapRestResult(200,"此xxzjbh不存在",null);
}
}
}
......@@ -94,7 +94,12 @@ public class SkServiceCacheController extends ApiController {
if (skServiceCache.getYpmc()!=null&& !"".equals(skServiceCache.getYpmc())){ // 研判名称
queryWrapper.like("ypmc",skServiceCache.getYpmc());
}
if (skServiceCache.getObjecttype()!=null&& !"".equals(skServiceCache.getObjecttype())){ // 研判类型
// 线索类型
if (skServiceCache.getXslx()!=null&& !"".equals(skServiceCache.getXslx())){
queryWrapper.eq("ypmc",skServiceCache.getXslx());
}
// 研判类型
if (skServiceCache.getObjecttype()!=null&& !"".equals(skServiceCache.getObjecttype())){
queryWrapper.like("objecttype",skServiceCache.getObjecttype());
}
//时间
......@@ -148,7 +153,12 @@ public class SkServiceCacheController extends ApiController {
if (skServiceCache.getYpmc()!=null&& !"".equals(skServiceCache.getYpmc())){ // 研判名称
queryWrapper.like("ypmc",skServiceCache.getYpmc());
}
if (skServiceCache.getObjecttype()!=null&& !"".equals(skServiceCache.getObjecttype())){ // 研判类型
// 线索类型
if (skServiceCache.getXslx()!=null&& !"".equals(skServiceCache.getXslx())){
queryWrapper.eq("ypmc",skServiceCache.getXslx());
}
// 研判类型
if (skServiceCache.getObjecttype()!=null&& !"".equals(skServiceCache.getObjecttype())){
queryWrapper.like("objecttype",skServiceCache.getObjecttype());
}
//时间
......
package com.founder.publicapi.controller.SuggestionService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.founder.commonutils.model.newPublicEntity.MapRestResult;
import com.founder.commonutils.model.newPublicEntity.suggestionEntity.CommentEntity;
import com.founder.commonutils.util.KeyUtilNaotu;
import com.founder.publicapi.mapper.mysqlMapper.CommentMapper;
import com.founder.servicebase.logs.OperLog;
import com.founder.servicebase.logs.OperationType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@RestController
@RequestMapping("/comment")
@Api(tags = "反馈意见文章评论")
public class CommentController {
@Autowired
CommentMapper commentMapper;
/**
* 评论发表、评论回复
* 发表评论的时候 不传parentId和rootParentId
* 回复评论时候 传
* @return
*/
@PostMapping("commentAdd")
@ApiOperation(value = "评论新增")
@OperLog(message = "评论新增", operation = OperationType.ADD)
public MapRestResult commentAdd(@RequestBody CommentEntity commentEntity){
commentEntity.setPlId(KeyUtilNaotu.getJzKey("pl"));
commentEntity.setCreateTime(nowTime());
commentEntity.setIsDelete("0");
int insert = commentMapper.insert(commentEntity);
if (insert > 0){
return new MapRestResult(200,"新增成功",null);
} else {
return new MapRestResult().error("保存失败");
}
}
/**
* 评论回复
* @return
*/
@PostMapping("commentReply")
@ApiOperation(value = "评论回复")
@OperLog(message = "评论回复", operation = OperationType.ADD)
public MapRestResult commentReply(@RequestBody CommentEntity commentEntity){
commentEntity.setPlId(KeyUtilNaotu.getJzKey("pl"));
commentEntity.setCreateTime(nowTime());
commentEntity.setIsDelete("0");
int insert = commentMapper.insert(commentEntity);
if (insert > 0){
return new MapRestResult(200,"回复成功",null);
} else {
return new MapRestResult().error("回复失败");
}
}
/**
* 评论删除
* @return
*/
@PostMapping("commentDelete")
@ApiOperation(value = "评论删除")
@OperLog(message = "评论删除", operation = OperationType.DELETE)
public MapRestResult commentDelete(@RequestParam(name = "plId") String plId , @RequestParam(name = "userName") String userName, @RequestParam(name = "user") String user){
if (userName.equals(user)){
CommentEntity comment = new CommentEntity();
comment.setIsDelete("1");
UpdateWrapper<CommentEntity> wrapper = new UpdateWrapper<>();
wrapper.eq("pl_id", plId)
.or().eq("parent_id", plId)
.or().eq("root_parent_id", plId);
int update = commentMapper.update(comment, wrapper);
if ( update > 0 ){
return new MapRestResult(200,"删除成功",null);
}else {
return new MapRestResult(200,"删除失败",null);
}
}else return new MapRestResult(200,"不是你写的评论,你不能删",null);
}
/**
* 评论列表
* @return
*/
@PostMapping("commentQuery")
@ApiOperation(value = "评论列表")
@OperLog(message = "评论列表", operation = OperationType.QUERY)
public MapRestResult commentQuery(@RequestBody CommentEntity commentEntity){
QueryWrapper<CommentEntity> wrapper = new QueryWrapper<>();
wrapper.eq("blog_id",commentEntity.getBlogId());
wrapper.eq("is_delete","0");
List<CommentEntity> list = commentMapper.selectList(wrapper);
// 对评论时间进行排序
list = list.stream().sorted(Comparator.comparing(CommentEntity::getCreateTime).reversed()).collect(Collectors.toList());
Map<String, CommentEntity> map = new HashMap<>();
List<CommentEntity> result = new ArrayList<>();
// 将所有根评论加入 map
for(CommentEntity comment : list) {
if(comment.getParentId() == null){
result.add(comment);
}
map.put(comment.getPlId(), comment);
}
// 子评论加入到父评论的 child 中
for(CommentEntity comment : list) {
String id = comment.getParentId();
if(id != null) { // 当前评论为子评论
CommentEntity name = commentMapper.selectById(id);
comment.setParentName(name.getUserName());
CommentEntity p = map.get(id);
if(p.getChild() == null) { // child 为空,则创建
p.setChild(new ArrayList<>());
}else {
p.getChild().add(comment);
}
}
}
return new MapRestResult(200,"ok",list.size(),result);
}
/**
* 评论详情
* @return
*/
@PostMapping("commentDetails")
@ApiOperation(value = "评论详情")
@OperLog(message = "评论详情", operation = OperationType.QUERY)
public MapRestResult commentDetails(@RequestBody CommentEntity commentEntity){
CommentEntity commentEntity1 = commentMapper.selectById(commentEntity.getPlId());
return new MapRestResult(200,"ok",commentEntity1);
}
/**
* 当前时间
* @return
*/
public String nowTime(){
Date date = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return formatter.format(date);
}
}
package com.founder.publicapi.mapper.mysqlMapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.founder.commonutils.model.newPublicEntity.suggestionEntity.CommentEntity;
public interface CommentMapper extends BaseMapper<CommentEntity> {
}
package com.founder.publicapi.mapper.mysqlMapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.founder.commonutils.model.newPublicEntity.suggestionEntity.PaperEntity;
public interface PaperMapper extends BaseMapper<PaperEntity> {
}
......@@ -300,8 +300,15 @@ public class UserServiceImpl implements UserService {
roleId=DLYJ_ROLEID;
}
TbStApproveUserRole userRoleInfo = userMapper.getUserRoleInfoByRoleId(agentUser.getId(),roleId);
paramMap.put("id",userRoleInfo.getId());
paramMap.put("scbz","1");
if (userRoleInfo!= null){
paramMap.put("id",userRoleInfo.getId());
paramMap.put("scbz","1");
}else {
resultMap.put("msg","获取id失败");
resultMap.put("data","");
resultMap.put("status",200);
return resultMap;
}
int r =userMapper.deleteApproveUserRole(paramMap);
if(r>0){
resultMap.put("msg","success");
......
......@@ -41,6 +41,11 @@ approvalDownload = http://47.92.48.137:1009/excel/approvalWord/
#\u65B0\u589E\u5377\u5B97\u5927\u6570\u636E\u6A21\u578B\u4E0B\u8F7D\u6A21\u677F\u7684\u8DEF\u5F84
approvalDownloadTemplate = http://47.92.48.137:1009/excel/approvalWord/ApprovalWordTemplate.docx
#\u4FE1\u606F\u53CD\u9988\u4E0A\u4F20\u7684\u8DEF\u5F84
suggestionFilePath = /data/excel/suggestion/
#\u4FE1\u606F\u53CD\u9988\u4E0B\u8F7D\u8DEF\u5F84
suggestionDownload = http://47.92.48.137:1009/excel/suggestion/
#\u8D44\u6E90\u7BA1\u7406\u4E0A\u4F20\u8DEF\u5F84
ResourceManagerUpload = /data/excel/ResourceManager/
#\u8D44\u6E90\u7BA1\u7406\u4E0B\u8F7D\u8DEF\u5F84
......
......@@ -41,6 +41,11 @@ approvalDownload = http://77.1.24.19:1009/excel/approvalWord/
#\u65B0\u589E\u5377\u5B97\u5927\u6570\u636E\u6A21\u578B\u4E0B\u8F7D\u6A21\u677F\u7684\u8DEF\u5F84
approvalDownloadTemplate = http://77.1.24.19:1009/excel/approvalWord/ApprovalWordTemplate.docx
#\u4FE1\u606F\u53CD\u9988\u4E0A\u4F20\u7684\u8DEF\u5F84
suggestionFilePath = /data/excel/suggestion/
#\u4FE1\u606F\u53CD\u9988\u4E0B\u8F7D\u8DEF\u5F84
suggestionDownload = http://47.92.48.137:1009/excel/suggestion/
#\u8D44\u6E90\u7BA1\u7406\u4E0A\u4F20\u8DEF\u5F84
ResourceManagerUpload = /data/excel/ResourceManager/
#\u8D44\u6E90\u7BA1\u7406\u4E0B\u8F7D\u8DEF\u5F84
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment