提交 7558ca15 authored 作者: gongwenjie's avatar gongwenjie

合并分支 'gwj' 到 'master'

Gwj 查看合并请求 !88
流水线 #134 已取消 于阶段
......@@ -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.service.ApprovalInformationService;
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.vo.PageResponse;
import io.swagger.annotations.Api;
......@@ -150,5 +151,19 @@ public class ApprovalController {
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;
import com.zjty.tynotes.attendance.entity.ApprovalInformation;
import com.zjty.tynotes.attendance.entity.WorkoverAppro;
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 java.util.List;
......@@ -78,4 +79,11 @@ public interface ApprovalInformationService {
* @return
*/
PageResponse<WorkoverAppro> findAllAuditWorkOverApproval(PageRequest pageRequest);
/**
* 查询申请单可选择的部门
* @return
*/
List<Department> findSelectDepartment();
}
......@@ -396,6 +396,16 @@ public class ApprovalInformationServiceImpl implements ApprovalInformationServic
return pageResponse;
}
/**
* 查询申请单可选择的部门
* @return
*/
@Override
public List<Department> findSelectDepartment() {
List<Department> departments = departmentDao.findByLevel("2");
return departments;
}
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");
......
......@@ -10,7 +10,7 @@ import java.util.List;
* @create 2020/2/29 9:42
*/
public interface DepartmentDao extends MongoRepository<Department,String> {
Department findByLevel(String level);
List<Department> findByLevel(String level);
List<Department> findAllByParentId(String parentId);
......
......@@ -67,10 +67,13 @@ public class DepartmentServiceImpl implements IDepartmentService {
@Override
@Transactional
public List<Department> findList() {
Department department = departmentDao.findByLevel("1");
if(department==null){
List<Department> departments = departmentDao.findByLevel("1");
Department department = null;
if(departments==null||departments.size()==0){
Department department1 = new Department(null,"泰源","1","泰源",null,null,null);
department = departmentDao.save(department1);
}else {
department = departments.get(0);
}
List<Department> departmentList = new ArrayList<>();
departmentList.add(department);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论