提交 dee6ff1c authored 作者: gongwenjie's avatar gongwenjie

Merge branch 'master' of git.yfzx.zjtys.com.cn:zjm/notes2.0

# Conflicts: # notes-attendance/src/main/java/com/zjty/tynotes/attendance/controller/AttendanceController.java
上级 e346eb49
...@@ -5,6 +5,7 @@ import com.zjty.tynotes.attendance.entity.WorkoverAppro; ...@@ -5,6 +5,7 @@ import com.zjty.tynotes.attendance.entity.WorkoverAppro;
import com.zjty.tynotes.attendance.entity.vo.request.PageRequest; import com.zjty.tynotes.attendance.entity.vo.request.PageRequest;
import com.zjty.tynotes.attendance.service.ApprovalInformationService; import com.zjty.tynotes.attendance.service.ApprovalInformationService;
import com.zjty.tynotes.misc.config.AutoDocument; import com.zjty.tynotes.misc.config.AutoDocument;
import com.zjty.tynotes.pas.entity.Department;
import com.zjty.tynotes.pas.entity.User; import com.zjty.tynotes.pas.entity.User;
import com.zjty.tynotes.pas.entity.vo.PageResponse; import com.zjty.tynotes.pas.entity.vo.PageResponse;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -150,5 +151,19 @@ public class ApprovalController { ...@@ -150,5 +151,19 @@ public class ApprovalController {
return ok("查找所有我审核的审批"); return ok("查找所有我审核的审批");
} }
@ApiOperation(value = "申请单的选择部门")
@GetMapping("/departSelect")
public ResponseEntity findSelectDepartment() {
try {
List<Department> pageResponse = approvalInformationService.findSelectDepartment();
return ok(pageResponse);
} catch (Exception e) {
logger.error("查找所有我审核的审批");
}
return ok("查找所有我审核的审批");
}
} }
...@@ -3,6 +3,7 @@ package com.zjty.tynotes.attendance.service; ...@@ -3,6 +3,7 @@ package com.zjty.tynotes.attendance.service;
import com.zjty.tynotes.attendance.entity.ApprovalInformation; import com.zjty.tynotes.attendance.entity.ApprovalInformation;
import com.zjty.tynotes.attendance.entity.WorkoverAppro; import com.zjty.tynotes.attendance.entity.WorkoverAppro;
import com.zjty.tynotes.attendance.entity.vo.request.PageRequest; import com.zjty.tynotes.attendance.entity.vo.request.PageRequest;
import com.zjty.tynotes.pas.entity.Department;
import com.zjty.tynotes.pas.entity.vo.PageResponse; import com.zjty.tynotes.pas.entity.vo.PageResponse;
import java.util.List; import java.util.List;
...@@ -78,4 +79,11 @@ public interface ApprovalInformationService { ...@@ -78,4 +79,11 @@ public interface ApprovalInformationService {
* @return * @return
*/ */
PageResponse<WorkoverAppro> findAllAuditWorkOverApproval(PageRequest pageRequest); PageResponse<WorkoverAppro> findAllAuditWorkOverApproval(PageRequest pageRequest);
/**
* 查询申请单可选择的部门
* @return
*/
List<Department> findSelectDepartment();
} }
...@@ -396,6 +396,16 @@ public class ApprovalInformationServiceImpl implements ApprovalInformationServic ...@@ -396,6 +396,16 @@ public class ApprovalInformationServiceImpl implements ApprovalInformationServic
return pageResponse; return pageResponse;
} }
/**
* 查询申请单可选择的部门
* @return
*/
@Override
public List<Department> findSelectDepartment() {
List<Department> departments = departmentDao.findByLevel("2");
return departments;
}
public static void main(String[] args) throws Exception{ public static void main(String[] args) throws Exception{
Config config = new Config("1","09:00:00","17:00:00","2","3","15","17","1","1","1","1","1","1","1","1","1","1","1"); Config config = new Config("1","09:00:00","17:00:00","2","3","15","17","1","1","1","1","1","1","1","1","1","1","1");
......
...@@ -10,7 +10,7 @@ import java.util.List; ...@@ -10,7 +10,7 @@ import java.util.List;
* @create 2020/2/29 9:42 * @create 2020/2/29 9:42
*/ */
public interface DepartmentDao extends MongoRepository<Department,String> { public interface DepartmentDao extends MongoRepository<Department,String> {
Department findByLevel(String level); List<Department> findByLevel(String level);
List<Department> findAllByParentId(String parentId); List<Department> findAllByParentId(String parentId);
......
...@@ -67,10 +67,13 @@ public class DepartmentServiceImpl implements IDepartmentService { ...@@ -67,10 +67,13 @@ public class DepartmentServiceImpl implements IDepartmentService {
@Override @Override
@Transactional @Transactional
public List<Department> findList() { public List<Department> findList() {
Department department = departmentDao.findByLevel("1"); List<Department> departments = departmentDao.findByLevel("1");
if(department==null){ Department department = null;
if(departments==null||departments.size()==0){
Department department1 = new Department(null,"泰源","1","泰源",null,null,null); Department department1 = new Department(null,"泰源","1","泰源",null,null,null);
department = departmentDao.save(department1); department = departmentDao.save(department1);
}else {
department = departments.get(0);
} }
List<Department> departmentList = new ArrayList<>(); List<Department> departmentList = new ArrayList<>();
departmentList.add(department); departmentList.add(department);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论