|
@@ -10,6 +10,9 @@ import java.util.Map;
|
|
|
|
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
+import com.ym.mec.auth.api.enums.YesOrNoEnum;
|
|
|
+import com.ym.mec.biz.dal.dao.TeacherDao;
|
|
|
+import com.ym.mec.biz.dal.entity.Teacher;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.HttpEntity;
|
|
|
import org.springframework.http.HttpHeaders;
|
|
@@ -18,6 +21,7 @@ import org.springframework.http.MediaType;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.MultiValueMap;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
|
|
@@ -48,6 +52,8 @@ public class EmployeeServiceImpl extends BaseServiceImpl<Integer, Employee> imp
|
|
|
private ObjectMapper objectMapper;
|
|
|
@Autowired
|
|
|
private SysUserFeignService sysUserFeignService;
|
|
|
+ @Autowired
|
|
|
+ private TeacherDao teacherDao;
|
|
|
|
|
|
@Override
|
|
|
public BaseDAO<Integer, Employee> getDAO() {
|
|
@@ -69,6 +75,21 @@ public class EmployeeServiceImpl extends BaseServiceImpl<Integer, Employee> imp
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public void updateEmployee(Employee employee) {
|
|
|
+ employeeDao.update(employee);
|
|
|
+ teacherDao.updateUser(employee);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void deleteEmployee(Long userId) {
|
|
|
+ SysUser sysUser=new SysUser();
|
|
|
+ sysUser.setId(userId.intValue());
|
|
|
+ sysUser.setDelFlag(YesOrNoEnum.YES);
|
|
|
+ teacherDao.updateUser(sysUser);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public PageInfo queryEmployByOrganId(EmployeeQueryInfo queryInfo) throws IOException {
|
|
|
String url = "http://auth-server/queryUserInfo";
|
|
|
|