getOrgIdListByUserEffId

This commit is contained in:
sxu 2025-03-11 11:24:09 +08:00
parent 6f7ee75ae7
commit e4b64130c8
3 changed files with 21 additions and 9 deletions

View File

@ -19,6 +19,8 @@ public interface MktEffectiveMapper extends BaseMapper<MktEffective> {
List<MktEffectiveUserVO> 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<DrpWarehouseAllVO> selectAllWareHouse(Integer delFlag);

View File

@ -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<MktEffectiveMapper, Mkt
@Override
public List<Long> 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

View File

@ -26,6 +26,15 @@
and me.del_flag = #{delFlag}
</select>
<select id="getUserEffIdByCustId" resultType="java.lang.Long">
select med.eff_id
from cust_info ci
left join cust_org co on ci.org_id = co.org_id
left join mkt_effective_detail med on co.org_id = med.org_id
left join mkt_effective me on me.eff_id = med.eff_id
where me.del_flag = #{delFlag} and ci.cust_id = #{custId}
</select>
<!-- 获取生效范围名称根据范围id列表 -->
<select id="getEffNameStrByIdList" resultType="java.lang.String">
SELECT