|  |  | 
 |  |  | import com.mzl.flower.dto.response.system.MenuTreeDTO; | 
 |  |  | import com.mzl.flower.dto.response.system.UserDetailsDTO; | 
 |  |  | import com.mzl.flower.dto.response.system.UserListDTO; | 
 |  |  | import com.mzl.flower.entity.point.CustomerPoint; | 
 |  |  | import com.mzl.flower.entity.system.*; | 
 |  |  | import com.mzl.flower.enums.TrueOrFalseEnum; | 
 |  |  | import com.mzl.flower.mapper.point.CustomerPointMapper; | 
 |  |  | import com.mzl.flower.mapper.system.*; | 
 |  |  | import com.mzl.flower.service.customer.CustomerService; | 
 |  |  | import com.mzl.flower.service.partner.PartnerService; | 
 |  |  | import com.mzl.flower.service.point.CustomerPointService; | 
 |  |  | import com.mzl.flower.service.supplier.StationService; | 
 |  |  | import com.mzl.flower.service.supplier.SupplierService; | 
 |  |  | import com.mzl.flower.utils.TreeBuilderUtil; | 
 |  |  | import com.mzl.flower.utils.UUIDGenerator; | 
 |  |  | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private EmployeeMapper employeeMapper; | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private CustomerPointMapper customerPointMapper; | 
 |  |  |     @Autowired | 
 |  |  |     private StationService stationService; | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     public User findUserByOpenId(String openId, String sessionKey, String unionId | 
 |  |  |             , String imgUrl, String nickname,String userType){ | 
 |  |  | 
 |  |  |  | 
 |  |  |         if(Constants.USER_TYPE.customer.name().equals(user.getType())){ | 
 |  |  |             result.setCustomerDTO(customerService.getCurrentCustomer()); | 
 |  |  |             //查询积分 | 
 |  |  |             CustomerPoint customerPoint = customerPointMapper.selectOne(new LambdaQueryWrapper<CustomerPoint>() | 
 |  |  |                     .eq(CustomerPoint::getUserId, userId)); | 
 |  |  |             if(customerPoint == null){ | 
 |  |  |                 result.setCurrentPoint(0); | 
 |  |  |             }else{ | 
 |  |  |                 Integer currentPoint =customerPoint.getTotalPoint()-customerPoint.getUsedPoint()-customerPoint.getExpiredPoint()-customerPoint.getDeductionPoint(); | 
 |  |  |                 result.setCurrentPoint(currentPoint>=0?currentPoint:0); | 
 |  |  |             } | 
 |  |  |         }else if(Constants.USER_TYPE.supplier.name().equals(user.getType())){ | 
 |  |  |             result.setSupplierDTO(supplierService.getCurrentSupplier()); | 
 |  |  |         }else if(Constants.USER_TYPE.partner.name().equals(user.getType())){ | 
 |  |  |             result.setPartnerDTO(partnerService.getCurrentPartner()); | 
 |  |  |         }else if (Constants.USER_TYPE.admin.name().equals(user.getType())){ | 
 |  |  |             result.setMainWarehouse(stationService.getMainWarehouse(user.getId())); | 
 |  |  |         } | 
 |  |  |         result.setBindWechat(wechatMapper.selectCount(new LambdaQueryWrapper<UserWechat>() | 
 |  |  |                 .eq(UserWechat::getUserId, userId)) > 0); |