| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.mzl.flower.base.cache.StringCacheClient; |
| | | import com.mzl.flower.config.GlobalSupplierVariables; |
| | | import com.mzl.flower.config.exception.ValidationException; |
| | | import com.mzl.flower.config.security.SecurityUtils; |
| | | import com.mzl.flower.constant.Constants; |
| | |
| | | private final PartnerService partnerService; |
| | | private final StationService stationService; |
| | | private final UserWechatMapper wechatMapper; |
| | | |
| | | private final GlobalSupplierVariables globalSupplierVariables; |
| | | |
| | | |
| | | |
| | |
| | | String userId = ""; |
| | | if (type == 1) { |
| | | userId = SecurityUtils.getUserId(); |
| | | }else { |
| | | SupplierDTO currentSupplier = supplierMapper.getCurrentSupplier(userId); |
| | | //切换主账号 |
| | | String supplier = globalSupplierVariables.getSupplier(String.valueOf(currentSupplier.getId())); |
| | | if (StringUtils.isEmpty(supplier)) { |
| | | globalSupplierVariables.removeSupplier(String.valueOf(currentSupplier.getId())); |
| | | } |
| | | } else { |
| | | SupplierSub supplierSub = supplierSubMapper.selectById(id); |
| | | supplierSub.setType(0); |
| | | userId = supplierSub.getUserId(); |
| | | //切换子账号 |
| | | String supplier = globalSupplierVariables.getSupplier(String.valueOf(supplierSub.getSupplierId())); |
| | | if (StringUtils.isEmpty(supplier)) { |
| | | globalSupplierVariables.removeSupplier(String.valueOf(supplierSub.getSupplierId())); |
| | | } |
| | | globalSupplierVariables.setSupplier(String.valueOf(supplierSub.getSupplierId()), userId); |
| | | } |
| | | |
| | | CurrentUserDTO result = new CurrentUserDTO(); |