diff --git a/module-config-column/pom.xml b/module-config-column/pom.xml index 8755ba1..588f0ad 100644 --- a/module-config-column/pom.xml +++ b/module-config-column/pom.xml @@ -35,7 +35,6 @@ 5.3.3 compile - org.apache.httpcomponents httpcore @@ -46,7 +45,6 @@ httpclient 4.5.6 - cn.com.tenlion module-config-table diff --git a/module-config-content/pom.xml b/module-config-content/pom.xml index 2b396bb..f220c83 100644 --- a/module-config-content/pom.xml +++ b/module-config-content/pom.xml @@ -35,7 +35,6 @@ 5.3.3 compile - org.apache.httpcomponents httpcore @@ -46,7 +45,6 @@ httpclient 4.5.6 - com.belerweb pinyin4j @@ -57,16 +55,16 @@ java-emoji-converter 0.1.1 - - ink.wgink - basic-app - 1.0-SNAPSHOT - compile - - - ink.wgink - login-wechat - 1.0-SNAPSHOT - + + + + + + + + + + + \ No newline at end of file diff --git a/module-config-content/src/main/java/cn/com/tenlion/configcontent/service/contentcomment/impl/ContentCommentServiceImpl.java b/module-config-content/src/main/java/cn/com/tenlion/configcontent/service/contentcomment/impl/ContentCommentServiceImpl.java index 10d2a06..c747685 100644 --- a/module-config-content/src/main/java/cn/com/tenlion/configcontent/service/contentcomment/impl/ContentCommentServiceImpl.java +++ b/module-config-content/src/main/java/cn/com/tenlion/configcontent/service/contentcomment/impl/ContentCommentServiceImpl.java @@ -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 userList = new ArrayList(); userList.addAll(userSet); - List miniappUserPOS = iMiniappUserService.listPO(userList); - Map userPOMap = new HashMap(); - for(MiniappUserPO userPO : miniappUserPOS) { - userPOMap.put(userPO.getUserId(), userPO); + // 封装系统人员头像信息 + List userDTOList = iUserBaseService.listByUserIds(userList); + Map userMap = new HashMap(); + 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 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()); diff --git a/module-config-content/src/main/java/cn/com/tenlion/configcontent/service/contentlike/impl/ContentLikeServiceImpl.java b/module-config-content/src/main/java/cn/com/tenlion/configcontent/service/contentlike/impl/ContentLikeServiceImpl.java index 314abeb..9cc52fc 100644 --- a/module-config-content/src/main/java/cn/com/tenlion/configcontent/service/contentlike/impl/ContentLikeServiceImpl.java +++ b/module-config-content/src/main/java/cn/com/tenlion/configcontent/service/contentlike/impl/ContentLikeServiceImpl.java @@ -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 userList = new ArrayList(); userList.addAll(userSet); - List miniappUserPOS = iMiniappUserService.listPO(userList); - Map userPOMap = new HashMap(); - for(MiniappUserPO userPO : miniappUserPOS) { - userPOMap.put(userPO.getUserId(), userPO); + // 封装系统人员头像信息 + List userDTOList = iUserBaseService.listByUserIds(userList); + Map userMap = new HashMap(); + 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 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; diff --git a/module-config-content/src/main/java/cn/com/tenlion/configcontent/util/UserInfo.java b/module-config-content/src/main/java/cn/com/tenlion/configcontent/util/UserInfo.java new file mode 100644 index 0000000..d4abe51 --- /dev/null +++ b/module-config-content/src/main/java/cn/com/tenlion/configcontent/util/UserInfo.java @@ -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; + } +} diff --git a/module-config-table/pom.xml b/module-config-table/pom.xml index 7b792fa..06e4626 100644 --- a/module-config-table/pom.xml +++ b/module-config-table/pom.xml @@ -58,10 +58,10 @@ 1.0-SNAPSHOT compile - - ink.wgink - basic-app - 1.0-SNAPSHOT - + + + + + \ No newline at end of file diff --git a/module-config-table/src/main/java/cn/com/tenlion/configtable/service/configtableoperation/impl/ConfigTableOperationServiceImpl.java b/module-config-table/src/main/java/cn/com/tenlion/configtable/service/configtableoperation/impl/ConfigTableOperationServiceImpl.java index 1a3aa38..cc3d860 100644 --- a/module-config-table/src/main/java/cn/com/tenlion/configtable/service/configtableoperation/impl/ConfigTableOperationServiceImpl.java +++ b/module-config-table/src/main/java/cn/com/tenlion/configtable/service/configtableoperation/impl/ConfigTableOperationServiceImpl.java @@ -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>> listPage(ListPage page) { PageHelper.startPage(page.getPage(), page.getRows()); List> configTableOperationDTOs = list(page.getParams()); + List userIds = new ArrayList(); for (Map 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 userList = iMiniappUserBaseService.listByUserIds(userIds); + Map 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 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> pageInfo = new PageInfo<>(configTableOperationDTOs); diff --git a/module-freemarker/pom.xml b/module-freemarker/pom.xml index 4f8bc51..03ba741 100644 --- a/module-freemarker/pom.xml +++ b/module-freemarker/pom.xml @@ -35,7 +35,6 @@ 5.3.3 compile - org.apache.httpcomponents httpcore diff --git a/module-news/pom.xml b/module-news/pom.xml index f05f24a..fffca20 100644 --- a/module-news/pom.xml +++ b/module-news/pom.xml @@ -47,18 +47,12 @@ 1.0-SNAPSHOT compile - + \ No newline at end of file diff --git a/module-news/src/main/java/cn/com/tenlion/news/service/newscontent/impl/NewsContentServiceImpl.java b/module-news/src/main/java/cn/com/tenlion/news/service/newscontent/impl/NewsContentServiceImpl.java index 9217766..f76ea3d 100644 --- a/module-news/src/main/java/cn/com/tenlion/news/service/newscontent/impl/NewsContentServiceImpl.java +++ b/module-news/src/main/java/cn/com/tenlion/news/service/newscontent/impl/NewsContentServiceImpl.java @@ -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; diff --git a/module-notice/src/main/java/cn/com/tenlion/notice/service/noticeconfig/impl/NoticeConfigServiceImpl.java b/module-notice/src/main/java/cn/com/tenlion/notice/service/noticeconfig/impl/NoticeConfigServiceImpl.java index da6c384..1c31d08 100644 --- a/module-notice/src/main/java/cn/com/tenlion/notice/service/noticeconfig/impl/NoticeConfigServiceImpl.java +++ b/module-notice/src/main/java/cn/com/tenlion/notice/service/noticeconfig/impl/NoticeConfigServiceImpl.java @@ -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 menuList = new ArrayList(); idList.add("-1"); menuList.add("-1"); + List menuDTOList = new ArrayList(); 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 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 @@ -233,7 +238,7 @@ public class NoticeConfigServiceImpl extends DefaultBaseService implements INoti } noticeConfigDao.update(params); // 管理菜单 - NoticeConfigMenuDTO menuDTO = getMenu(noticeConfigId); + NoticeConfigMenuDTO menuDTO = getMenu(noticeConfigId); UpdateMenuBO managerMenuBO = new UpdateMenuBO(); managerMenuBO.setMenuName(noticeConfigVO.getMenuNameManager() + ""); managerMenuBO.setMenuOrder(noticeConfigVO.getConfigOrder().intValue() + ""); @@ -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); diff --git a/module-notice/src/main/resources/templates/notice/view.html b/module-notice/src/main/resources/templates/notice/view.html index e0b1b7f..0b0f0c0 100644 --- a/module-notice/src/main/resources/templates/notice/view.html +++ b/module-notice/src/main/resources/templates/notice/view.html @@ -169,7 +169,7 @@ {{# if (item.contentCommentUserIcon == '') { }} {{# }else { }} - + {{# } }}
diff --git a/module-notice/src/main/resources/templates/noticeconfig/save.html b/module-notice/src/main/resources/templates/noticeconfig/save.html index 1269360..182c815 100644 --- a/module-notice/src/main/resources/templates/noticeconfig/save.html +++ b/module-notice/src/main/resources/templates/noticeconfig/save.html @@ -156,7 +156,7 @@
-
+
diff --git a/module-project-config/pom.xml b/module-project-config/pom.xml index 09c4d79..518a493 100644 --- a/module-project-config/pom.xml +++ b/module-project-config/pom.xml @@ -13,8 +13,8 @@ - interface-config-column cn.com.tenlion + interface-project-config 1.0-SNAPSHOT @@ -45,10 +45,5 @@ httpclient 4.5.6 - - cn.com.tenlion - interface-project-config - 1.0-SNAPSHOT - \ No newline at end of file