From b2d9bfc0dd2f94f90d1a8cd7397e9d7aa4863fad Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Wed, 11 Jan 2023 15:31:47 +0800 Subject: [PATCH] Merge branch 'dev_yy' into 2.0-dev MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * dev_yy: (25 commits) 提交代理商 1 1 提交实物 提交代码 提交代码 提交代码 提交抽奖代码 1 提交代码 提交代码 提交代码 提交代码 提交代码 提交 1 1 修改首页没有积分专区 提交代码 修改小程序注册用券 ... # Conflicts: # hai-cweb/src/main/java/com/cweb/controller/HighTestController.java # hai-service/src/main/java/com/hai/common/utils/DateUtil.java # hai-service/src/main/java/com/hai/common/utils/RequestUtils.java # hai-service/src/main/java/com/hai/dao/HighChildOrderMapper.java # hai-service/src/main/java/com/hai/dao/HighChildOrderSqlProvider.java # hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java # hai-service/src/main/java/com/hai/entity/HighChildOrder.java # hai-service/src/main/java/com/hai/entity/HighChildOrderExample.java # hai-service/src/main/java/com/hai/entity/HighOrder.java # hai-service/src/main/java/com/hai/entity/OutRechargeOrder.java # hai-service/src/main/java/com/hai/service/HighUserService.java # hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java # hai-service/src/main/java/com/hai/service/impl/BsDistributionUserRelServiceImpl.java # hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java # hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java --- .../com/cweb/controller/BsMsgController.java | 79 ++++++------------- .../cweb/controller/CmsContentController.java | 21 ++--- 2 files changed, 34 insertions(+), 66 deletions(-) diff --git a/hai-cweb/src/main/java/com/cweb/controller/BsMsgController.java b/hai-cweb/src/main/java/com/cweb/controller/BsMsgController.java index 54f53e3e..7a188c11 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/BsMsgController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/BsMsgController.java @@ -23,10 +23,8 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.stream.Collectors; /** * @author sum1dream @@ -49,9 +47,6 @@ public class BsMsgController { @ApiOperation(value = "查询站内信列表") public ResponseData getMsgByList( @RequestParam(value = "type", required = false) Integer type, - @RequestParam(value = "jumpType", required = false) Integer jumpType, - @RequestParam(value = "msgType", required = false) Integer msgType, - @RequestParam(value = "title", required = false) String title, @RequestParam(value = "companyId", required = true) String companyId, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request @@ -61,17 +56,30 @@ public class BsMsgController { SessionObject sessionObject = userCenter.getSessionObject(request); HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); - Map map = new HashMap<>(5); - map.put("type", type); - map.put("jumpType", jumpType); - map.put("msgType", msgType); - map.put("title", title); + // 查询个人信息 + Map mapUser = new HashMap<>(); + mapUser.put("companyId" , companyId); + mapUser.put("msgType" , 1); + mapUser.put("type" , type); + mapUser.put("userId" , userInfoModel.getHighUser().getId()); + mapUser.put("num" , 1000); + List listUser = bsMsgService.queryMsgByList(mapUser); + + // 查询全局信息 + Map map = new HashMap<>(); map.put("companyId" , companyId); + map.put("type" , type); + map.put("msgType" , 2); + map.put("num" , 1000); + List list = bsMsgService.queryMsgByList(map); - PageHelper.startPage(pageNum,pageSize); + list.addAll(listUser); + + list = list.stream().sorted(Comparator.comparing(BsMsg::getCreateTime).reversed()) + .collect(Collectors.toList()); - List list = bsMsgService.getMsgByList(map); + PageHelper.startPage(pageNum,pageSize); return ResponseMsgUtil.success(new PageInfo<>(list)); } catch (Exception e) { @@ -100,47 +108,4 @@ public class BsMsgController { } } - @RequestMapping(value = "/queryMsgByList", method = RequestMethod.GET) - @ResponseBody - @ApiOperation(value = "查询站内信列表") - public ResponseData queryMsgByList( - @RequestParam(value = "companyId", required = false) Long companyId, - @RequestParam(value = "type", required = false) Long type, - HttpServletRequest request) { - try { - - // 用户 - SessionObject sessionObject = userCenter.getSessionObject(request); - HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); - - Map mapUser = new HashMap<>(); - - mapUser.put("companyId" , companyId); - mapUser.put("type" , type); - mapUser.put("userId" , userInfoModel.getHighUser().getId()); - mapUser.put("msgType" , 1); - - // 查询个人站内信 - List userMsg = bsMsgService.queryMsgByList(mapUser); - - // 查询全局站内信 - Map map = new HashMap<>(); - - map.put("companyId" , companyId); - map.put("type" , type); - map.put("msgType" , 2); - - // 查询个人站内信 - List msgList = bsMsgService.queryMsgByList(map); - - msgList.addAll(userMsg); - - return ResponseMsgUtil.success(msgList); - - } catch (Exception e) { - log.error("HighOrderController -> addOrder() error!", e); - return ResponseMsgUtil.exception(e); - } - } - } diff --git a/hai-cweb/src/main/java/com/cweb/controller/CmsContentController.java b/hai-cweb/src/main/java/com/cweb/controller/CmsContentController.java index e5f82a01..70cd0bb7 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/CmsContentController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/CmsContentController.java @@ -28,6 +28,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.util.*; +import java.util.stream.Collectors; @Controller @Api(value = "内容管理 内容发布") @@ -113,7 +114,7 @@ public class CmsContentController { object.put("jumpType" , cmsContent.get(0).getJumpType()); object.put("jumpUrl" , cmsContent.get(0).getJumpUrl()); } - List listUser = new ArrayList<>(); + List list = new ArrayList<>(); if (sessionObject != null) { Map mapUser = new HashMap<>(); @@ -121,20 +122,22 @@ public class CmsContentController { mapUser.put("companyId" , companyId); mapUser.put("msgType" , 1); mapUser.put("userId" , userInfoModel.getHighUser().getId()); - mapUser.put("num" , 3); - listUser = bsMsgService.queryMsgByList(mapUser); + mapUser.put("num" , 6); + list = bsMsgService.queryMsgByList(mapUser); } Map map = new HashMap<>(); - map.put("companyId" , companyId); - map.put("msgType" , 2); - map.put("num" , 3); - List list = bsMsgService.queryMsgByList(map); - - list.addAll(listUser); + if (list.size() == 0) { + map.put("companyId" , companyId); + map.put("msgType" , 2); + map.put("num" , 6); + list = bsMsgService.queryMsgByList(map); + } + list = list.stream().sorted(Comparator.comparing(BsMsg::getCreateTime).reversed()) + .collect(Collectors.toList()); for (BsMsg bsMsg : list) { bsMsg.setTimeData( DateUtil.timeDifference(bsMsg.getCreateTime(), new Date() )); }