修改区域公司

dev-discount
袁野 2 years ago
parent a601a40abb
commit 0854ccf58b
  1. 26
      hai-cweb/src/main/java/com/cweb/controller/BsMsgController.java
  2. 30
      hai-cweb/src/main/java/com/cweb/controller/CmsContentController.java
  3. 7
      hai-msg/src/main/java/com/MsgApplication.java
  4. 50
      hai-msg/src/main/resources/dev/application.yml
  5. 10
      hai-service/src/main/java/com/hai/config/CmsContentConfig.java
  6. 41
      hai-service/src/main/java/com/hai/dao/BsMsgUserMapperExt.java
  7. 3
      hai-service/src/main/java/com/hai/enum_type/CmsContentDataEnum.java
  8. 2
      hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java
  9. 10
      hai-service/src/main/java/com/hai/service/BsMsgService.java
  10. 5
      hai-service/src/main/java/com/hai/service/impl/BsMsgServiceImpl.java

@ -89,10 +89,34 @@ public class BsMsgController {
SessionObject sessionObject = userCenter.getSessionObject(request); SessionObject sessionObject = userCenter.getSessionObject(request);
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject();
bsMsgService.checkMsg(userInfoModel.getHighUser(), msgId);
return ResponseMsgUtil.success(null);
} catch (Exception e) {
log.error("HighOrderController -> addOrder() error!", e);
return ResponseMsgUtil.exception(e);
}
}
return ResponseMsgUtil.success(null); @RequestMapping(value = "/queryMsgByList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询站内信列表")
public ResponseData queryMsgByList(@RequestParam(value = "companyId", required = false) Long companyId, HttpServletRequest request) {
try {
// 用户
SessionObject sessionObject = userCenter.getSessionObject(request);
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject();
Map<String, Object> map = new HashMap<>();
map.put("companyId" , companyId);
map.put("userId" , userInfoModel.getHighUser().getId());
bsMsgService.queryMsgByList(map);
return ResponseMsgUtil.success(bsMsgService.queryMsgByList(map));
} catch (Exception e) { } catch (Exception e) {
log.error("HighOrderController -> addOrder() error!", e); log.error("HighOrderController -> addOrder() error!", e);

@ -4,10 +4,13 @@ import com.alibaba.fastjson.JSONObject;
import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode; import com.hai.common.exception.SysCode;
import com.hai.common.security.SessionObject;
import com.hai.common.security.UserCenter;
import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.CmsContentConfig; import com.hai.config.CmsContentConfig;
import com.hai.entity.*; import com.hai.entity.*;
import com.hai.model.CmsContentModel; import com.hai.model.CmsContentModel;
import com.hai.model.HighUserModel;
import com.hai.model.ResponseData; import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel; import com.hai.model.UserInfoModel;
import com.hai.service.*; import com.hai.service.*;
@ -16,6 +19,7 @@ import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -45,14 +49,24 @@ public class CmsContentController {
@Resource @Resource
private CmsContentConfig cmsContentConfig; private CmsContentConfig cmsContentConfig;
@Resource
private BsMsgService bsMsgService;
@Autowired
private UserCenter userCenter;
@RequestMapping(value = "/getCmsContent", method = RequestMethod.GET) @RequestMapping(value = "/getCmsContent", method = RequestMethod.GET)
@ApiOperation(value = "查询首页轮播图") @ApiOperation(value = "查询cms内容")
@ResponseBody @ResponseBody
public ResponseData getCmsContent(@RequestParam(name = "companyId", required = true) Long companyId, public ResponseData getCmsContent(@RequestParam(name = "companyId", required = true) Long companyId,
@RequestParam(name = "platform", required = true) Integer platform, @RequestParam(name = "platform", required = true) Integer platform,
@RequestParam(name = "categoryCode", required = true) String categoryCode) { @RequestParam(name = "categoryCode", required = true) String categoryCode, HttpServletRequest request) {
try { try {
// 用户
SessionObject sessionObject = userCenter.getSessionObject(request);
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject();
CmsCategory category = cmsCategoryService.getCategoryByCode(categoryCode); CmsCategory category = cmsCategoryService.getCategoryByCode(categoryCode);
if (category == null) { if (category == null) {
@ -89,7 +103,17 @@ public class CmsContentController {
object.put("name" , cmsCategory.getName()); object.put("name" , cmsCategory.getName());
object.put("sort" , cmsCategory.getSort()); object.put("sort" , cmsCategory.getSort());
object.put("code" , cmsCategory.getCode()); object.put("code" , cmsCategory.getCode());
object.put("childDate" , null); List<CmsContent> cmsContent = cmsContentService.getListCmsContentByCategoryId(cmsCategory.getId() , companyId , platform);
object.put("jumpType" , cmsContent.get(0).getJumpType());
object.put("jumpUrl" , cmsContent.get(0).getJumpUrl());
Map<String, Object> map = new HashMap<>();
map.put("companyId" , companyId);
map.put("whereCheck" , false);
map.put("userId" , userInfoModel.getHighUser().getId());
object.put("childDate" , bsMsgService.queryMsgByList(map));
} }
objectList.add(object); objectList.add(object);
} }

@ -1,5 +1,7 @@
package com; package com;
import com.alicp.jetcache.anno.config.EnableCreateCacheAnnotation;
import com.alicp.jetcache.anno.config.EnableMethodCache;
import com.hai.common.utils.SpringContextUtil; import com.hai.common.utils.SpringContextUtil;
import org.mybatis.spring.annotation.MapperScan; import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
@ -11,11 +13,12 @@ import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.EnableTransactionManagement;
@SpringBootApplication @SpringBootApplication
// @ComponentScan //@ComponentScan
@EnableTransactionManagement @EnableTransactionManagement
@EnableScheduling @EnableScheduling
@EnableMethodCache(basePackages = "com.hai")
@EnableCreateCacheAnnotation
@ServletComponentScan @ServletComponentScan
@EnableAspectJAutoProxy(proxyTargetClass = true)
@MapperScan("com.hai.dao") @MapperScan("com.hai.dao")
public class MsgApplication public class MsgApplication
{ {

@ -9,7 +9,7 @@ debug: false
#datasource数据源设置 #datasource数据源设置
spring: spring:
datasource: datasource:
url: jdbc:mysql://139.159.177.244:3306/hfkj?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false url: jdbc:mysql://139.159.177.244:3306/hsg_order?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root username: root
password: HF123456. password: HF123456.
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
@ -32,13 +32,33 @@ spring:
host: 139.159.177.244 host: 139.159.177.244
port: 36379 port: 36379
password: HF123456.Redis password: HF123456.Redis
timeout: 36000000 timeout: 1000
jedis: jedis:
pool: pool:
max-active: 20 max-active: 20
max-wait: -1 max-wait: -1
max-idle: 10 max-idle: 10
min-idle: 0 min-idle: 0
#MQTT配置信息
mqtt:
#MQTT服务地址
url: ws://139.159.177.244:8083/mqtt
#用户名
username: printer_provider
#密码
password: 123654
#客户端id(不能重复)
# client:
# id: provider-id
#MQTT默认的消息推送主题,实际可在调用接口是指定
# default:
# topic: topic
rocketmq:
name-server: 139.159.177.244:9876
producer:
#必须指定group
group: default-group
#配置日期返回至前台为时间戳 #配置日期返回至前台为时间戳
jackson: jackson:
serialization: serialization:
@ -48,6 +68,32 @@ mybatis:
- classpath*:sqlmap*/*.xml - classpath*:sqlmap*/*.xml
type-aliases-package: type-aliases-package:
org.springboot.sample.entity org.springboot.sample.entity
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
#开启MyBatis的二级缓存
cache-enabled: true
jetcache:
statIntervalMinutes: 15
areaInCacheName: false
local:
default:
type: linkedhashmap
keyConvertor: fastjson
remote:
default:
type: redis
host: 139.159.177.244
port: 36379
password: HF123456.Redis
keyConvertor: fastjson
broadcastChannel: projectA
valueEncoder: java
valueDecoder: java
poolConfig:
minIdle: 5
maxIdle: 20
maxTotal: 50
pagehelper: pagehelper:
helperDialect: mysql helperDialect: mysql

@ -41,7 +41,14 @@ public class CmsContentConfig {
map.put("status" , 1); map.put("status" , 1);
PageHelper.startPage(1, 3); PageHelper.startPage(1, 3);
return new PageInfo<>( highDiscountPackageService.getDiscountPackageList(map)).getList(); return new PageInfo<>( highDiscountPackageService.getDiscountPackageList(map)).getList();
} else { } else if (CmsContentDataEnum.REFUEL.getName().equals(title)){
map.put("companyId", companyId);
map.put("displayArea", CmsContentDataEnum.getTypeByName(title));
map.put("notCouponSource", 2);
map.put("status", 2);
PageHelper.startPage(1, 3);
return new PageInfo<>(highCouponService.getCouponList(map)).getList();
} else if (CmsContentDataEnum.MSG.getName().equals(title)){
map.put("companyId", companyId); map.put("companyId", companyId);
map.put("displayArea", CmsContentDataEnum.getTypeByName(title)); map.put("displayArea", CmsContentDataEnum.getTypeByName(title));
map.put("notCouponSource", 2); map.put("notCouponSource", 2);
@ -49,6 +56,7 @@ public class CmsContentConfig {
PageHelper.startPage(1, 3); PageHelper.startPage(1, 3);
return new PageInfo<>(highCouponService.getCouponList(map)).getList(); return new PageInfo<>(highCouponService.getCouponList(map)).getList();
} }
return null;
} }

@ -1,7 +1,48 @@
package com.hai.dao; package com.hai.dao;
import com.hai.entity.BsMsg;
import com.hai.entity.OutRechargePrice;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.type.JdbcType;
import java.util.List;
import java.util.Map;
/** /**
* mapper扩展类 * mapper扩展类
*/ */
public interface BsMsgUserMapperExt { public interface BsMsgUserMapperExt {
@Select({"<script>" +
"select bs.* from bs_msg bs left join bs_msg_user bmu on bs.id = bmu.msg_id " +
"where status = 2 " +
"and company_id = #{param.companyId} " +
"<if test='param.userId != null'> and user_id = #{param.userId} </if>",
"<if test='param.whereCheck != null'> and where_check = #{param.whereCheck} </if>",
"order by create_time desc; " +
" </script>"})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="title", property="title", jdbcType=JdbcType.VARCHAR),
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="jump_type", property="jumpType", jdbcType=JdbcType.INTEGER),
@Result(column="msg_type", property="msgType", jdbcType=JdbcType.INTEGER),
@Result(column="object_id", property="objectId", jdbcType=JdbcType.BIGINT),
@Result(column="image", property="image", jdbcType=JdbcType.VARCHAR),
@Result(column="content", property="content", jdbcType=JdbcType.VARCHAR),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="op_name", property="opName", jdbcType=JdbcType.VARCHAR),
@Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="op_id", property="opId", jdbcType=JdbcType.BIGINT),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
List<BsMsg> queryMsgByList(@Param("param") Map<String, Object> param);
} }

@ -17,6 +17,7 @@ public enum CmsContentDataEnum {
PREFERABLY(4 , "优选商品"), PREFERABLY(4 , "优选商品"),
UNION_CARD(5 , "工会卡专区"), UNION_CARD(5 , "工会卡专区"),
DISCOUNT(6 , "天天好券"), DISCOUNT(6 , "天天好券"),
MSG(90 , "消息通知"),
; ;
private Integer type; private Integer type;
@ -34,6 +35,8 @@ public enum CmsContentDataEnum {
} }
return null; return null;
} }
public Integer getType() { public Integer getType() {
return type; return type;
} }

@ -286,4 +286,6 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
} }
} }
} }

@ -76,5 +76,15 @@ public interface BsMsgService {
*/ */
List<BsMsgUser> findMsgUserById(Long userId , Long msgId); List<BsMsgUser> findMsgUserById(Long userId , Long msgId);
/**
* @Author Sum1Dream
* @Name queryMsgByList
* @Description // 查询站内信
* @Date 16:29 2022/10/17
* @Param [map]
* @Return java.util.List<com.hai.entity.BsMsg>
*/
List<BsMsg> queryMsgByList(Map<String , Object> map);
} }

@ -127,4 +127,9 @@ public class BsMsgServiceImpl implements BsMsgService {
return bsMsgUserMapper.selectByExample(example); return bsMsgUserMapper.selectByExample(example);
} }
@Override
public List<BsMsg> queryMsgByList(Map<String, Object> map) {
return bsMsgUserMapper.queryMsgByList(map);
}
} }

Loading…
Cancel
Save