修改通知公告

This commit is contained in:
cuibaocheng 2022-06-23 11:30:04 +08:00
parent 897b3948a6
commit 996fcfee8d
14 changed files with 148 additions and 75 deletions

View File

@ -35,7 +35,6 @@
<version>5.3.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
@ -46,7 +45,6 @@
<artifactId>httpclient</artifactId>
<version>4.5.6</version>
</dependency>
<dependency>
<groupId>cn.com.tenlion</groupId>
<artifactId>module-config-table</artifactId>

View File

@ -35,7 +35,6 @@
<version>5.3.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
@ -46,7 +45,6 @@
<artifactId>httpclient</artifactId>
<version>4.5.6</version>
</dependency>
<dependency>
<groupId>com.belerweb</groupId>
<artifactId>pinyin4j</artifactId>
@ -57,16 +55,16 @@
<artifactId>java-emoji-converter</artifactId>
<version>0.1.1</version>
</dependency>
<dependency>
<groupId>ink.wgink</groupId>
<artifactId>basic-app</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>ink.wgink</groupId>
<artifactId>login-wechat</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>ink.wgink</groupId>-->
<!-- <artifactId>basic-app</artifactId>-->
<!-- <version>1.0-SNAPSHOT</version>-->
<!-- <scope>compile</scope>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>ink.wgink</groupId>-->
<!-- <artifactId>login-wechat</artifactId>-->
<!-- <version>1.0-SNAPSHOT</version>-->
<!-- </dependency>-->
</dependencies>
</project>

View File

@ -14,18 +14,20 @@ import cn.com.tenlion.configcontent.service.contentmeta.IContentMetaService;
import cn.com.tenlion.configcontent.service.contentscans.IContentScansService;
import cn.com.tenlion.configcontent.util.AntistopUtil;
import cn.com.tenlion.configcontent.util.IPUtils;
import cn.com.tenlion.configcontent.util.UserInfo;
import com.github.pagehelper.util.StringUtil;
import ink.wgink.app.AppTokenManager;
import ink.wgink.common.base.DefaultBaseService;
import ink.wgink.exceptions.RemoveException;
import ink.wgink.exceptions.SaveException;
import ink.wgink.module.wechat.pojo.pos.miniapp.MiniappUserPO;
import ink.wgink.module.wechat.service.miniapp.IMiniappUserService;
import ink.wgink.interfaces.user.IUserBaseService;
import ink.wgink.interfaces.user.wechat.miniapp.IMiniappUserBaseService;
import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.app.AppTokenUser;
import ink.wgink.pojo.bos.UserInfoBO;
import ink.wgink.pojo.dtos.miniapp.MiniappUserDTO;
import ink.wgink.pojo.dtos.user.UserDTO;
import ink.wgink.pojo.result.SuccessResult;
import ink.wgink.pojo.result.SuccessResultData;
import ink.wgink.pojo.result.SuccessResultList;
import ink.wgink.util.map.HashMapUtil;
import ink.wgink.util.UUIDUtil;
@ -34,7 +36,6 @@ import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
@ -53,7 +54,10 @@ public class ContentCommentServiceImpl extends DefaultBaseService implements ICo
private IContentCommentDao contentCommentDao;
@Autowired
private IMiniappUserService iMiniappUserService;
private IUserBaseService iUserBaseService;
@Autowired(required = false)
private IMiniappUserBaseService iMiniappUserBaseService;
@Autowired
private IContentLikeService contentLikeService;
@ -288,19 +292,33 @@ public class ContentCommentServiceImpl extends DefaultBaseService implements ICo
// 查询出人员的信息
List<String> userList = new ArrayList<String>();
userList.addAll(userSet);
List<MiniappUserPO> miniappUserPOS = iMiniappUserService.listPO(userList);
Map<String, MiniappUserPO> userPOMap = new HashMap<String, MiniappUserPO>();
for(MiniappUserPO userPO : miniappUserPOS) {
userPOMap.put(userPO.getUserId(), userPO);
// 封装系统人员头像信息
List<UserDTO> userDTOList = iUserBaseService.listByUserIds(userList);
Map<String, UserInfo> userMap = new HashMap<String, UserInfo>();
for(UserDTO userDTO : userDTOList) {
UserInfo userInfo = new UserInfo();
userInfo.setIcon(userDTO.getUserAvatar());
userInfo.setName(userDTO.getUserName());
userMap.put(userDTO.getUserId(), userInfo);
}
// 封装移动端人员头像信息
if (iMiniappUserBaseService != null) {
List<MiniappUserDTO> miniappUserDTOS = iMiniappUserBaseService.listByUserIds(userList);
for(MiniappUserDTO userDTO : miniappUserDTOS) {
UserInfo userInfo = new UserInfo();
userInfo.setIcon(userDTO.getNickName());
userInfo.setName(userDTO.getAvatarUrl());
userMap.put(userDTO.getUserId(), userInfo);
}
}
for(ContentCommentDTO dto : list) {
MiniappUserPO userPO = userPOMap.get(dto.getCreator());
if (userPO != null) {
UserInfo userInfo = userMap.get(dto.getCreator());
if (userInfo != null) {
/**
* 封装人员头像信息, 昵称信息
*/
dto.setContentCommentUserName(userPO.getNickName());
dto.setContentCommentUserIcon(userPO.getAvatarUrl());
dto.setContentCommentUserName(userInfo.getName());
dto.setContentCommentUserIcon(userInfo.getIcon());
}
// 封装时间
String shortTime = getShortTime(dto.getGmtCreate());

View File

@ -3,13 +3,16 @@ package cn.com.tenlion.configcontent.service.contentlike.impl;
import cn.com.tenlion.configcontent.pojo.dtos.contentcomment.ContentCommentDTO;
import cn.com.tenlion.configcontent.pojo.dtos.contentcommentlike.ContentCommentLikeDTO;
import cn.com.tenlion.configcontent.service.contentmeta.IContentMetaService;
import cn.com.tenlion.configcontent.util.UserInfo;
import ink.wgink.app.AppTokenManager;
import ink.wgink.common.base.DefaultBaseService;
import ink.wgink.module.wechat.pojo.pos.miniapp.MiniappUserPO;
import ink.wgink.module.wechat.service.miniapp.IMiniappUserService;
import ink.wgink.interfaces.user.IUserBaseService;
import ink.wgink.interfaces.user.wechat.miniapp.IMiniappUserBaseService;
import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.app.AppTokenUser;
import ink.wgink.pojo.bos.UserInfoBO;
import ink.wgink.pojo.dtos.miniapp.MiniappUserDTO;
import ink.wgink.pojo.dtos.user.UserDTO;
import ink.wgink.pojo.result.SuccessResult;
import ink.wgink.pojo.result.SuccessResultList;
import ink.wgink.util.map.HashMapUtil;
@ -41,7 +44,10 @@ public class ContentLikeServiceImpl extends DefaultBaseService implements IConte
private IContentLikeDao contentLikeDao;
@Autowired
private IMiniappUserService iMiniappUserService;
private IUserBaseService iUserBaseService;
@Autowired(required = false)
private IMiniappUserBaseService iMiniappUserBaseService;
@Autowired
private IContentMetaService iContentMetaService;
@ -194,19 +200,33 @@ public class ContentLikeServiceImpl extends DefaultBaseService implements IConte
// 查询出人员的信息
List<String> userList = new ArrayList<String>();
userList.addAll(userSet);
List<MiniappUserPO> miniappUserPOS = iMiniappUserService.listPO(userList);
Map<String, MiniappUserPO> userPOMap = new HashMap<String, MiniappUserPO>();
for(MiniappUserPO userPO : miniappUserPOS) {
userPOMap.put(userPO.getUserId(), userPO);
// 封装系统人员头像信息
List<UserDTO> userDTOList = iUserBaseService.listByUserIds(userList);
Map<String, UserInfo> userMap = new HashMap<String, UserInfo>();
for(UserDTO userDTO : userDTOList) {
UserInfo userInfo = new UserInfo();
userInfo.setIcon(userDTO.getUserAvatar());
userInfo.setName(userDTO.getUserName());
userMap.put(userDTO.getUserId(), userInfo);
}
// 封装移动端人员头像信息
if (iMiniappUserBaseService != null) {
List<MiniappUserDTO> miniappUserDTOS = iMiniappUserBaseService.listByUserIds(userList);
for(MiniappUserDTO userDTO : miniappUserDTOS) {
UserInfo userInfo = new UserInfo();
userInfo.setIcon(userDTO.getNickName());
userInfo.setName(userDTO.getAvatarUrl());
userMap.put(userDTO.getUserId(), userInfo);
}
}
for(ContentLikeDTO dto : list) {
MiniappUserPO userPO = userPOMap.get(dto.getCreator());
if (userPO != null) {
UserInfo userInfo = userMap.get(dto.getCreator());
if (userInfo != null) {
/**
* 封装人员头像信息, 昵称信息
*/
dto.setContentLikeUserName(userPO.getNickName());
dto.setContentLikeUserIcon(userPO.getAvatarUrl());
dto.setContentLikeUserName(userInfo.getName());
dto.setContentLikeUserIcon(userInfo.getIcon());
}
}
return list;

View File

@ -0,0 +1,24 @@
package cn.com.tenlion.configcontent.util;
public class UserInfo {
private String icon;
private String name;
public String getIcon() {
return icon == null ? "" : icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public String getName() {
return name == null ? "" : name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@ -58,10 +58,10 @@
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>ink.wgink</groupId>
<artifactId>basic-app</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>ink.wgink</groupId>-->
<!-- <artifactId>basic-app</artifactId>-->
<!-- <version>1.0-SNAPSHOT</version>-->
<!-- </dependency>-->
</dependencies>
</project>

View File

@ -1,6 +1,7 @@
package cn.com.tenlion.configtable.service.configtableoperation.impl;
import cn.com.tenlion.configcontent.util.AntistopUtil;
import cn.com.tenlion.configcontent.util.UserInfo;
import cn.com.tenlion.configtable.dao.configtableoperation.IConfigTableOperationDao;
import cn.com.tenlion.configtable.pojo.dtos.configtable.ConfigTableDTO;
import cn.com.tenlion.configtable.pojo.dtos.configtablefield.ConfigTableFieldDTO;
@ -16,18 +17,20 @@ import com.github.pagehelper.PageInfo;
import ink.wgink.common.base.DefaultBaseService;
import ink.wgink.exceptions.SaveException;
import ink.wgink.exceptions.UpdateException;
import ink.wgink.interfaces.user.IUserBaseService;
import ink.wgink.interfaces.user.wechat.miniapp.IMiniappUserBaseService;
import ink.wgink.module.dictionary.pojo.dtos.DataDTO;
import ink.wgink.module.dictionary.service.IDataService;
import ink.wgink.module.dictionary.service.impl.DataServiceImpl;
import ink.wgink.module.wechat.pojo.pos.miniapp.MiniappUserPO;
import ink.wgink.module.wechat.service.miniapp.IMiniappUserService;
import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.app.AppTokenUser;
import ink.wgink.pojo.bos.UserInfoBO;
import ink.wgink.pojo.dtos.miniapp.MiniappUserDTO;
import ink.wgink.pojo.dtos.user.UserDTO;
import ink.wgink.pojo.result.SuccessResultList;
import ink.wgink.util.UUIDUtil;
import ink.wgink.util.date.DateUtil;
import ink.wgink.util.map.HashMapUtil;
import org.apache.catalina.User;
import org.apache.commons.lang3.StringUtils;
import org.apache.xmlbeans.impl.jam.internal.parser.ParamStructPool;
import org.joda.time.DateTime;
@ -53,9 +56,10 @@ public class ConfigTableOperationServiceImpl extends DefaultBaseService implemen
private IConfigTableOperationDao iConfigTableOperationDao;
@Autowired
private IDataService iDataService;
@Autowired
private IMiniappUserService iMiniappUserService;
private IUserBaseService iUserBaseService;
@Autowired
private IMiniappUserBaseService iMiniappUserBaseService;
@Override
public void deleteDataById(String token, String configTableId, String uid) {
@ -613,11 +617,29 @@ public class ConfigTableOperationServiceImpl extends DefaultBaseService implemen
public SuccessResultList<List<Map<String, Object>>> listPage(ListPage page) {
PageHelper.startPage(page.getPage(), page.getRows());
List<Map<String, Object>> configTableOperationDTOs = list(page.getParams());
List<String> userIds = new ArrayList<String>();
for (Map<String, Object> map : configTableOperationDTOs) {
MiniappUserPO userPO = iMiniappUserService.getPO(map.get("creator").toString());
if(userPO != null) {
map.put("creatorIcon", userPO.getAvatarUrl());
map.put("creatorNickName", userPO.getNickName());
userIds.add(map.get("creator").toString());
}
List<MiniappUserDTO> userList = iMiniappUserBaseService.listByUserIds(userIds);
Map<String, UserInfo> userInfoMap = new HashMap<>();
for (MiniappUserDTO userDTO : userList) {
UserInfo userInfo = new UserInfo();
userInfo.setName(userDTO.getNickName());
userInfo.setIcon(userDTO.getAvatarUrl());
userInfoMap.put(userDTO.getUserId(), userInfo);
}
for (Map<String, Object> map : configTableOperationDTOs) {
UserInfo userInfo = userInfoMap.get(map.get("creator").toString());
if(userInfo != null) {
map.put("creatorIcon", userInfo.getIcon());
map.put("creatorNickName", userInfo.getName());
}else {
UserDTO userDTO = iUserBaseService.get(map.get("creator").toString());
if (userDTO != null) {
map.put("creatorIcon", userDTO.getUserAvatar());
map.put("creatorNickName", userDTO.getUserName());
}
}
}
PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(configTableOperationDTOs);

View File

@ -35,7 +35,6 @@
<version>5.3.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>

View File

@ -47,18 +47,12 @@
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<!-- <dependency>
<groupId>ink.wgink</groupId>
<artifactId>basic-app</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>ink.wgink</groupId>
<artifactId>service-user</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependency>-->
</dependencies>
</project>

View File

@ -37,12 +37,12 @@ import ink.wgink.exceptions.RemoveException;
import ink.wgink.exceptions.SaveException;
import ink.wgink.exceptions.SearchException;
import ink.wgink.exceptions.UpdateException;
import ink.wgink.interfaces.user.IUserBaseService;
import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.app.AppTokenUser;
import ink.wgink.pojo.result.SuccessResult;
import ink.wgink.pojo.result.SuccessResultData;
import ink.wgink.pojo.result.SuccessResultList;
import ink.wgink.service.user.service.IUserService;
import ink.wgink.util.UUIDUtil;
import ink.wgink.util.date.DateUtil;
import ink.wgink.util.map.HashMapUtil;
@ -78,7 +78,7 @@ public class NewsContentServiceImpl extends DefaultBaseService implements INewsC
@Autowired
private ITemplateConfigService iTemplateConfigService;
@Autowired
private IUserService iUserService;
private IUserBaseService iUserService;
@Autowired
private IContentMetaDataService iContentMetaDataService;

View File

@ -96,7 +96,7 @@ public class NoticeConfigServiceImpl extends DefaultBaseService implements INoti
checkMenuBO.setMenuName(noticeConfigVO.getMenuNameManager() + "");
checkMenuBO.setMenuOrder(noticeConfigVO.getConfigOrder().intValue()+"");
checkMenuBO.setMenuUrl("/route/notice/listcheck?noticeConfigId=" + noticeConfigId);
checkMenuBO.setMenuStatus(noticeConfigVO.getCheckSwitch().equals("1") ? noticeConfigVO.getConfigSwitch().equals("1") ? 0 : 1: 1);
checkMenuBO.setMenuStatus(noticeConfigVO.getCheckSwitch().equals("1") ? noticeConfigVO.getConfigSwitch().equals("1") ? 0 : 1 : 1);
checkMenuBO.setOpenType(1);
checkMenuBO.setMenuType(1);
String checkMenuId = iMenuBaseService.saveAndReturnId(checkMenuBO);
@ -182,6 +182,7 @@ public class NoticeConfigServiceImpl extends DefaultBaseService implements INoti
List<String> menuList = new ArrayList<String>();
idList.add("-1");
menuList.add("-1");
List<NoticeConfigMenuDTO> menuDTOList = new ArrayList<NoticeConfigMenuDTO>();
for(String id : ids) {
NoticeConfigDTO configDTO = get(id);
if (configDTO.getDeleteSwitch().equals("1")) {
@ -190,6 +191,7 @@ public class NoticeConfigServiceImpl extends DefaultBaseService implements INoti
menuList.add(menuDTO.getManagerMenuId());
menuList.add(menuDTO.getViewMenuId());
idList.add(id);
menuDTOList.add(menuDTO);
}
}
Map<String, Object> params = getHashMap(2);
@ -201,6 +203,9 @@ public class NoticeConfigServiceImpl extends DefaultBaseService implements INoti
}
iMenuBaseService.remove(menuList);
noticeConfigDao.remove(params);
for(NoticeConfigMenuDTO menuDTO : menuDTOList) {
updateMenu(menuDTO.getNoticeConfigId(), menuDTO.getManagerMenuId(), menuDTO.getViewMenuId(), menuDTO.getCheckMenuId());
}
}
@Override
@ -256,7 +261,7 @@ public class NoticeConfigServiceImpl extends DefaultBaseService implements INoti
checkMenuBO.setMenuName(noticeConfigVO.getMenuNameManager() + "");
checkMenuBO.setMenuOrder(noticeConfigVO.getConfigOrder().intValue() + "");
checkMenuBO.setMenuUrl("/route/notice/listcheck?noticeConfigId=" + noticeConfigId);
checkMenuBO.setMenuStatus(noticeConfigVO.getCheckSwitch().equals("1") ? noticeConfigVO.getConfigSwitch().equals("1") ? 0 : 1: 1);
checkMenuBO.setMenuStatus(noticeConfigVO.getCheckSwitch().equals("1") ? noticeConfigVO.getConfigSwitch().equals("1") ? 0 : 1 : 1);
checkMenuBO.setOpenType(1);
checkMenuBO.setMenuType(1);
iMenuBaseService.update(menuDTO.getCheckMenuId(), checkMenuBO);

View File

@ -169,7 +169,7 @@
{{# if (item.contentCommentUserIcon == '') { }}
<img src="assets/js/vendor/comment/images/1655798543918.jpg" style="height:50px;width:50px" alt="">
{{# }else { }}
<img src="{{item.contentCommentUserIcon }}" alt="">
<img src="route/file/download/false/{{item.contentCommentUserIcon }}" alt="">
{{# } }}
</div>
<div class="comment-show-con-list pull-left clearfix">

View File

@ -156,7 +156,7 @@
</div>
</div>
<div class=" layui-row layui-form-item" >
<div class=" layui-row " >
<div class="layui-col-lg6">
<div class="layui-form-item">
<label class="layui-form-label">排列顺序</label>

View File

@ -13,8 +13,8 @@
<dependencies>
<dependency>
<artifactId>interface-config-column</artifactId>
<groupId>cn.com.tenlion</groupId>
<artifactId>interface-project-config</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
@ -45,10 +45,5 @@
<artifactId>httpclient</artifactId>
<version>4.5.6</version>
</dependency>
<dependency>
<groupId>cn.com.tenlion</groupId>
<artifactId>interface-project-config</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>