修改查询部门接口逻辑
This commit is contained in:
parent
ba5ed7fe1d
commit
1b2eec230d
|
@ -8,6 +8,7 @@ import com.chint.domain.repository.UserRepository;
|
||||||
import com.chint.infrastructure.util.BaseContext;
|
import com.chint.infrastructure.util.BaseContext;
|
||||||
import com.chint.infrastructure.util.Result;
|
import com.chint.infrastructure.util.Result;
|
||||||
import com.chint.interfaces.rest.user.PushUser;
|
import com.chint.interfaces.rest.user.PushUser;
|
||||||
|
import com.chint.interfaces.rest.user.UserHttpRequest;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
@ -26,6 +27,9 @@ public class UserController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserRepository userRepository;
|
private UserRepository userRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UserHttpRequest userHttpRequest;
|
||||||
|
|
||||||
@ApiOperation("根据Id查询用户信息")
|
@ApiOperation("根据Id查询用户信息")
|
||||||
@PostMapping("/query")
|
@PostMapping("/query")
|
||||||
public Result<UserRes> getUserByEmployeeNo() {
|
public Result<UserRes> getUserByEmployeeNo() {
|
||||||
|
@ -46,6 +50,10 @@ public class UserController {
|
||||||
@GetMapping("/public/query/dept/{employeeNo}")
|
@GetMapping("/public/query/dept/{employeeNo}")
|
||||||
public Result<List<UserDepartmentInfo>> getUserDeptInfoByEmployeeNo(@PathVariable String employeeNo) {
|
public Result<List<UserDepartmentInfo>> getUserDeptInfoByEmployeeNo(@PathVariable String employeeNo) {
|
||||||
User byUserEmployeeNo = userRepository.findByUserEmployeeNo(employeeNo);
|
User byUserEmployeeNo = userRepository.findByUserEmployeeNo(employeeNo);
|
||||||
return Result.Success(SUCCESS, byUserEmployeeNo.getUserDepartmentInfoList());
|
List<UserDepartmentInfo> userDepartmentInfoList = byUserEmployeeNo.getUserDepartmentInfoList();
|
||||||
|
if (userDepartmentInfoList == null || userDepartmentInfoList.isEmpty()) {
|
||||||
|
userDepartmentInfoList = userHttpRequest.loadUserDeptInfo(User.withEmployeeNo(employeeNo)).getUserDepartmentInfoList();
|
||||||
|
}
|
||||||
|
return Result.Success(SUCCESS, userDepartmentInfoList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -271,6 +271,10 @@ public class UserHttpRequestImpl implements UserHttpRequest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(user.getName() == null || user.getName().isEmpty() || user.getName().isBlank()){
|
||||||
|
getDataFromUserSFData(user,userDataDTOList.get(0));
|
||||||
|
}
|
||||||
|
|
||||||
return userRepository.save(user);
|
return userRepository.save(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue