| | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | import com.sandu.ximon.admin.param.ClientPrarm; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | |
| | | |
| | | public boolean addClient(ClientPrarm clientPrarm) { |
| | | Client client = new Client(); |
| | | if (clientPrarm.getClientSuperior() != null) { |
| | | if (clientPrarm.getClientSuperior() != null&&!"".equals(clientPrarm.getClientSuperior())) { |
| | | Client one = getOne(Wrappers.lambdaQuery(Client.class).eq(Client::getClientName, clientPrarm.getClientSuperior())); |
| | | if (one != null) { |
| | | client.setSuperiorId(one.getId()); |
| | |
| | | return removeById(id); |
| | | } |
| | | |
| | | public List<Client> clientList(Long userId) { |
| | | return clientMapper.clientList(userId); |
| | | public List<Client> clientList(Long userId, BaseConditionVO baseConditionVO) { |
| | | return clientMapper.clientList(userId,baseConditionVO.getPageNo(),baseConditionVO.getPageSize()); |
| | | } |
| | | |
| | | public Client findByPhone(String phone) { |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 一级客户返回false 二级客户返回true |
| | | * @return |
| | | */ |
| | | public boolean findClientId(){ |
| | | Long userId = SecurityUtils.getUserId(); |
| | | Client one = getOne(Wrappers.lambdaQuery(Client.class).eq(Client::getId, userId)); |
| | | if(one!=null&&one.getSuperiorId()!=null){ |
| | | return true; |
| | | }else { |
| | | return false; |
| | | } |
| | | |
| | | } |
| | | } |