Commit 96593e85 by 陶湘宇

文件传阅每个人可以添加附件

parent a4349879
...@@ -11,6 +11,8 @@ import cn.timer.api.dto.qyxx.CmsContentReadDto; ...@@ -11,6 +11,8 @@ import cn.timer.api.dto.qyxx.CmsContentReadDto;
import cn.timer.api.utils.redis.RedisUtil; import cn.timer.api.utils.redis.RedisUtil;
import com.github.yulichang.query.MPJQueryWrapper; import com.github.yulichang.query.MPJQueryWrapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -415,7 +417,8 @@ public class CmsController { ...@@ -415,7 +417,8 @@ public class CmsController {
.between(!StrUtil.hasBlank(s) && !StrUtil.hasBlank(e), "releasetime", .between(!StrUtil.hasBlank(s) && !StrUtil.hasBlank(e), "releasetime",
!StrUtil.hasBlank(s) ? s : "1000-01-01 00:00:00", !StrUtil.hasBlank(s) ? s : "1000-01-01 00:00:00",
!StrUtil.hasBlank(e) ? e : "9999-01-01 00:00:00") !StrUtil.hasBlank(e) ? e : "9999-01-01 00:00:00")
.and(wq -> wq.like("publisher", userBean.getEmpNum()).or().like("author", userBean.getUserInfo().getName()).or().like("title", userBean.getUserInfo().getName())) .and(wq -> wq.eq("publisher", userBean.getEmpNum()).or().eq("author", userBean.getUserInfo().getName()).or().inSql("id","select cms_content_id from cms_content_read where user_id ="+userBean.getEmpNum()))
.orderByDesc("addeddate"); .orderByDesc("addeddate");
IPage<CmsContent> cmsContentPage = CmsContent.builder().build().selectPage(page, queryWrapper); IPage<CmsContent> cmsContentPage = CmsContent.builder().build().selectPage(page, queryWrapper);
List<CmsContent> cmsContents = cmsContentPage.getRecords(); List<CmsContent> cmsContents = cmsContentPage.getRecords();
...@@ -524,7 +527,6 @@ public class CmsController { ...@@ -524,7 +527,6 @@ public class CmsController {
* 添加已读 * 添加已读
* *
* @param userBean * @param userBean
* @param id
* @return * @return
*/ */
@GetMapping(value = "/isread") @GetMapping(value = "/isread")
...@@ -720,7 +722,27 @@ public class CmsController { ...@@ -720,7 +722,27 @@ public class CmsController {
} }
return ResultUtil.success(); return ResultUtil.success();
} }
/**
* 根据讯息id查传阅增加文件
* @return
*/
@PostMapping(value = "/cmsAddFile")
@ApiOperation(value = "文件传阅增加文件", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> cmsAddFile(@CurrentUser UserBean userBean, @RequestBody JSONObject request) {
String cmsContentId=request.getString("cmsContentId");
//用户id查询传阅消息
QueryWrapper<CmsContent> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("id", cmsContentId);
CmsContent cmsContent = CmsContent.builder().build().selectOne(queryWrapper);
JSONArray addjsonArray=JSONArray.fromObject(request.getString("filepathcms"));
JSONArray resjsonArray=JSONArray.fromObject(cmsContent.getFilepath());
resjsonArray.addAll(addjsonArray);
cmsContent.setFilepath(resjsonArray.toString());
cmsContentMapper.updateById(cmsContent);
return ResultUtil.data(resjsonArray.toString());
}
/** /**
* 添加传阅人员 * 添加传阅人员
* @return * @return
......
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