|
@@ -1,12 +1,14 @@
|
|
|
package com.ims.eval.service.impl;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.ims.common.utils.StringUtils;
|
|
|
import com.ims.eval.entity.Myuser;
|
|
|
import com.ims.eval.dao.UserMapper;
|
|
|
-import com.ims.eval.entity.PersonnelEvaluationRule;
|
|
|
+import com.ims.eval.feign.RemoteServiceBuilder;
|
|
|
import com.ims.eval.service.IUserService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.List;
|
|
@@ -22,6 +24,9 @@ import java.util.List;
|
|
|
@Service
|
|
|
public class UserServiceImpl extends ServiceImpl<UserMapper, Myuser> implements IUserService {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private RemoteServiceBuilder remoteServiceBuilder;
|
|
|
+
|
|
|
@Override
|
|
|
public List<Myuser> listAll(String id, String orgId,String unitId) {
|
|
|
|
|
@@ -43,4 +48,32 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, Myuser> implements
|
|
|
|
|
|
return list;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Myuser getUser(String username) {
|
|
|
+ QueryWrapper<Myuser> qw = new QueryWrapper<>();
|
|
|
+ qw.lambda().eq(Myuser::getLoginName,username);
|
|
|
+ List<Myuser> list = baseMapper.selectList(qw);
|
|
|
+ if(list.size()<=0){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ return list.get(0);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void updateUser(Myuser user) {
|
|
|
+ super.saveOrUpdate(user);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public JSONObject getSysUser(String code) {
|
|
|
+ JSONObject json = remoteServiceBuilder.getGatewayUrl().getSysUser(code);
|
|
|
+ return json;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public JSONObject getCodeByToken(String token) {
|
|
|
+ JSONObject json = remoteServiceBuilder.getGatewayUrl().getCodeByToken(token);
|
|
|
+ return json;
|
|
|
+ }
|
|
|
}
|