| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | 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; |
| | | import com.mzl.flower.dto.request.BindWechatDTO; |
| | | import com.mzl.flower.dto.request.system.*; |
| | | import com.mzl.flower.dto.response.current.CurrentUserDTO; |
| | | import com.mzl.flower.dto.response.supplier.SupplierDTO; |
| | | import com.mzl.flower.dto.response.system.EmployeeDTO; |
| | | import com.mzl.flower.dto.response.system.MenuTreeDTO; |
| | | import com.mzl.flower.dto.response.system.UserDetailsDTO; |
| | |
| | | import com.mzl.flower.entity.system.*; |
| | | import com.mzl.flower.enums.TrueOrFalseEnum; |
| | | import com.mzl.flower.mapper.point.CustomerPointMapper; |
| | | import com.mzl.flower.mapper.supplier.SupplierMapper; |
| | | import com.mzl.flower.mapper.supplier.SupplierSubMapper; |
| | | import com.mzl.flower.mapper.system.*; |
| | | import com.mzl.flower.service.customer.CustomerService; |
| | |
| | | @Autowired |
| | | private SupplierSubMapper supplierSubMapper; |
| | | |
| | | @Autowired |
| | | private SupplierMapper supplierMapper; |
| | | |
| | | @Autowired |
| | | private GlobalSupplierVariables globalSupplierVariables; |
| | | |
| | | |
| | | public User findUserByOpenId(String openId, String sessionKey, String unionId |
| | | , String imgUrl, String nickname,String userType){ |
| | |
| | | } |
| | | |
| | | public CurrentUserDTO getCurrentUser() { |
| | | |
| | | String userId = SecurityUtils.getUserId(); |
| | | |
| | | CurrentUserDTO result = new CurrentUserDTO(); |
| | |
| | | }else if(Constants.USER_TYPE.supplier.name().equals(user.getType())){ |
| | | result.setSupplierDTO(supplierService.getCurrentSupplier()); |
| | | SupplierSub sub = supplierSubMapper.getCurrentSupplier(SecurityUtils.getUserId()); |
| | | SupplierDTO dto = supplierMapper.getCurrentSupplier(SecurityUtils.getUserId()); |
| | | String tempUserId = globalSupplierVariables.getSupplier(String.valueOf(dto.getId())); |
| | | if (!ObjectUtils.isEmpty(sub)) { |
| | | result.setIsSubSupplier(true); |
| | | result.setSupplierSub(sub); |
| | | //可切换 |
| | | result.setSwitchFlag(false); |
| | | } else { |
| | | result.setIsSubSupplier(false); |
| | | result.setSupplierSub(null); |
| | | //不可切换 |
| | | result.setSwitchFlag(true); |
| | | if (!StringUtils.isBlank(tempUserId)) { |
| | | SupplierSub temSub = supplierSubMapper.getCurrentSupplier(tempUserId); |
| | | result.setIsSubSupplier(true); |
| | | result.setSupplierSub(temSub); |
| | | result.setSwitchFlag(true); |
| | | } else { |
| | | result.setIsSubSupplier(false); |
| | | result.setSupplierSub(null); |
| | | result.setSwitchFlag(true); |
| | | } |
| | | } |
| | | }else if(Constants.USER_TYPE.partner.name().equals(user.getType())){ |
| | | result.setPartnerDTO(partnerService.getCurrentPartner()); |