员工登录主店不需要展示主店下面的分店

This commit is contained in:
Tankaikai
2025-04-12 11:17:44 +08:00
parent 69ba9ec48c
commit c660421d39

View File

@@ -16,6 +16,7 @@ import com.czg.enums.YesNoEnum;
import com.czg.exception.ApiNotPrintException;
import com.czg.exception.CzgException;
import com.czg.resp.CzgResult;
import com.czg.sa.MyStpLogic;
import com.czg.sa.StpKit;
import com.czg.service.RedisService;
import com.czg.service.account.mapper.ShopInfoMapper;
@@ -380,6 +381,10 @@ public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> i
head.setShopId(shopInfo.getId());
head.setShopName(shopInfo.getShopName());
list.add(head);
MyStpLogic.LoginType loginType = (MyStpLogic.LoginType) StpKit.USER.getSession().get("loginType");
if(loginType.compareTo(MyStpLogic.LoginType.STAFF) == 0){
return list;
}
List<ShopInfo> branchList = mapper.selectListByQuery(query().select(ShopInfo::getId, ShopInfo::getShopName).eq(ShopInfo::getMainId, shopId).orderBy(ShopInfo::getId, true));
for (ShopInfo info : branchList) {
ShopBranchSelectDTO branch = new ShopBranchSelectDTO();