package com.changhong.epc.form.rest.tenant.department; import java.util.Map; import javax.annotation.Resource; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import com.changhong.epc.constter.tenant.DepartmentRelationConst; import com.changhong.epc.form.service.budget.department.DepartmentRelationService; /** * 部门关系控制层 * @author liush * */ @RestController public class DepartmentRelationRest implements DepartmentRelationConst { @Resource private DepartmentRelationService departmentRelationService; /** * 获取传入上下级部门code判断其上级是否正确 * @param code * @param parentCode * @return */ @PostMapping(DEPARTMENT_RELATION_JUDGESUPERIOR) public boolean judgeSuperior(@RequestBody Map map) { return departmentRelationService.judgeSuperior(map.get("code"), map.get("parentCode")); } /** * 依据部门code获取上级部门code * @param departmentRelation * @return */ @PostMapping(DEPARTMENT_RELATION_GETPARENTCODE) public String getParentCode(@RequestBody Map map) { return departmentRelationService.getSuperiorDepartmentCode(map.get("code")); } }