diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/marketing/mapper/MktEffectiveMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/marketing/mapper/MktEffectiveMapper.java index d3e477d3..692bd915 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/marketing/mapper/MktEffectiveMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/marketing/mapper/MktEffectiveMapper.java @@ -19,6 +19,8 @@ public interface MktEffectiveMapper extends BaseMapper { List selectAllUserEff(@Param("effType") Integer effType, @Param("delFlag") Integer delFlag); + Long getUserEffIdByCustId(@Param("custId") Long custId, @Param("delFlag") Integer delFlag); + @Select({"select warehouse_id, warehouse_name from drp_warehouse where del_flag = #{delFlag}"}) List selectAllWareHouse(Integer delFlag); diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/marketing/service/impl/MktEffectiveServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/marketing/service/impl/MktEffectiveServiceImpl.java index a25e1736..b29b9084 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/marketing/service/impl/MktEffectiveServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/marketing/service/impl/MktEffectiveServiceImpl.java @@ -2,6 +2,7 @@ package com.bonus.canteen.core.marketing.service.impl; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; import cn.hutool.json.JSONUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; @@ -32,6 +33,7 @@ import com.bonus.common.houqin.i18n.I18n; import com.bonus.common.houqin.utils.CopyListUtil; import com.bonus.common.houqin.utils.id.Id; import com.bonus.common.security.utils.SecurityUtils; +import com.bonus.system.api.model.LoginUser; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -372,15 +374,14 @@ public class MktEffectiveServiceImpl extends ServiceImpl getOrgIdListByUser() { -// PigxUser user = SecurityUtils.getUser(); -// if (ObjectUtil.isNull(user)) { -// return new ArrayList(); -// } else { -// Long custEffId = user.getCustEffId(); -// return ((MktEffectiveMapper)this.baseMapper).selectOrgIdListByEffId(custEffId); -// } - //TODO SecurityUtils 里面需要 custEffId - return new ArrayList<>(); + LoginUser user = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(user)) { + return new ArrayList(); + } else { + long custId = user.getCustId(); + Long custEffId = ((MktEffectiveMapper)this.baseMapper).getUserEffIdByCustId(custId, LeConstants.COMMON_NO); + return ((MktEffectiveMapper)this.baseMapper).selectOrgIdListByEffId(custEffId); + } } @Override diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/marketing/MktEffectiveMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/marketing/MktEffectiveMapper.xml index 8a660d62..032a3b9b 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/marketing/MktEffectiveMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/marketing/MktEffectiveMapper.xml @@ -26,6 +26,15 @@ and me.del_flag = #{delFlag} + +