|
@@ -2,6 +2,7 @@ package com.pj.project.app_user;
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.pj.api.client.admin.AdminInterface;
|
|
import com.pj.api.client.admin.AdminInterface;
|
|
import com.pj.utils.so.SoMap;
|
|
import com.pj.utils.so.SoMap;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -9,11 +10,11 @@ import org.springframework.stereotype.Service;
|
|
import com.baomidou.mybatisplus.extension.service.IService;
|
|
import com.baomidou.mybatisplus.extension.service.IService;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
-import com.pj.utils.sg.*;
|
|
|
|
|
|
+
|
|
|
|
|
|
/**
|
|
/**
|
|
* Service: app_user -- 移动端账号
|
|
* Service: app_user -- 移动端账号
|
|
- * @author qzy
|
|
|
|
|
|
+ * @author qzy
|
|
*/
|
|
*/
|
|
@Service
|
|
@Service
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@@ -48,31 +49,25 @@ public class AppUserService extends ServiceImpl<AppUserMapper, AppUser> implemen
|
|
return super.getById(id);
|
|
return super.getById(id);
|
|
}
|
|
}
|
|
|
|
|
|
- /** 查集合 - 根据条件(参数为空时代表忽略指定条件) */
|
|
|
|
- List<AppUser> getList(SoMap so) {
|
|
|
|
- return appUserMapper.getList(so);
|
|
|
|
|
|
+ /** 查集合 - 根据条件(参数为空时代表忽略指定条件) */
|
|
|
|
+ List<AppUser> getList(SoMap so) {
|
|
|
|
+ return appUserMapper.getList(so);
|
|
}
|
|
}
|
|
|
|
|
|
/** 启/停边民的app账号登陆限制 */
|
|
/** 启/停边民的app账号登陆限制 */
|
|
- boolean isLock(String id,Integer status){
|
|
|
|
|
|
+ boolean isLock(String id, Integer type, Integer status){
|
|
//查询
|
|
//查询
|
|
- AppUser appUser1 = appUserMapper.selectById(id);
|
|
|
|
|
|
+ LambdaQueryWrapper<AppUser> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ queryWrapper.eq(AppUser::getFkId,id);
|
|
|
|
+ queryWrapper.eq(AppUser::getUserType,type);
|
|
|
|
+ AppUser appUser1 = appUserMapper.selectList(queryWrapper).get(0);
|
|
if(appUser1 == null)throw new RuntimeException("您进行修改的用户不存在!");
|
|
if(appUser1 == null)throw new RuntimeException("您进行修改的用户不存在!");
|
|
//设置状态
|
|
//设置状态
|
|
appUser1.setStatus(status.toString());
|
|
appUser1.setStatus(status.toString());
|
|
- //定义计数器
|
|
|
|
- int count = 0;
|
|
|
|
//保存
|
|
//保存
|
|
int i = appUserMapper.updateById(appUser1);
|
|
int i = appUserMapper.updateById(appUser1);
|
|
- count += i;
|
|
|
|
- if(i == 1){
|
|
|
|
- //远程调用
|
|
|
|
- int lock = adminInterface.isLock(id, status);
|
|
|
|
- count += lock;
|
|
|
|
- }
|
|
|
|
- if(count != 2)throw new RuntimeException("启/停状态修改失败!");
|
|
|
|
- return count == 2;
|
|
|
|
|
|
+ return i == 1;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
}
|
|
}
|