Commit 75e912d3 by huluobin

update

parent 1b514636
......@@ -4,7 +4,6 @@ package com.blt.other.module.auth.controller;
import com.bailuntec.cost.api.response.CostResult;
import com.blt.other.module.auth.model.OaCompany;
import com.blt.other.module.auth.model.OaDepartment;
import com.blt.other.module.auth.model.OaUser;
import com.blt.other.module.auth.service.IOaDepartmentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -40,6 +39,14 @@ public class OaDepartmentController {
return CostResult.success(oaDepartmentList);
}
@ApiOperation("获取一级部门下面的二级部门列表")
@GetMapping("/secondDepartment")
public CostResult<List<OaDepartment>> secondDepartment(@RequestParam Integer primaryDepartmentId) {
List<OaDepartment> oaDepartmentList = oaDepartmentService.secondDepartment(primaryDepartmentId);
return CostResult.success(oaDepartmentList);
}
@ApiOperation("获取公所有部门列表")
@GetMapping("/allOaDepartment")
public CostResult<List<OaDepartment>> allOaDepartment() {
......
......@@ -37,4 +37,7 @@ public interface OaDepartmentMapper extends BaseMapper<OaDepartment> {
List<OaDepartment> allOaDepartment();
List<OaDepartment> selectByIds(@Param("collect") List<Integer> collect);
//根据parentId获取
List<OaDepartment> selectByParentId(Integer primaryDepartmentId);
}
......@@ -62,4 +62,12 @@ public interface IOaDepartmentService extends IService<OaDepartment> {
* @return 部门树
*/
List<OaCompany> queryTree();
/**
* 获取二级部门
*
* @param primaryDepartmentId 一级部门id
* @return 二级部门列表
*/
List<OaDepartment> secondDepartment(Integer primaryDepartmentId);
}
......@@ -106,6 +106,11 @@ public class OaDepartmentServiceImpl extends ServiceImpl<OaDepartmentMapper, OaD
return oaCompanyList;
}
@Override
public List<OaDepartment> secondDepartment(Integer primaryDepartmentId) {
return baseMapper.selectByParentId(primaryDepartmentId);
}
/**
* 商品分类列表转成树形
......
......@@ -96,13 +96,13 @@ public class CostDetailController {
public ResponseEntity<InputStreamResource> download(HttpServletRequest request, HttpServletResponse response) throws IOException {
String detailNo = request.getParameter("detailNo");
CostDetailDomain detail = costDetailService.getCostDetailByDetailNo(detailNo);
String filePath = null;
String filePath;
String fileName = null;
if (null != detail) {
filePath = detail.getFilePath();
if (null != filePath) {
String[] split = filePath.split("&");
if (null != split && split.length >= 1) {
if (split.length >= 1) {
fileName = split[split.length - 1];
}
}
......
......@@ -59,6 +59,11 @@
<if test="departmentId != null and departmentId != 0">#{departmentId}</if>
</foreach>
</select>
<select id="selectByParentId" resultType="com.blt.other.module.auth.model.OaDepartment">
select *
from oa_department
where parent_id = #{primaryDepartmentId}
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment