功能优化
This commit is contained in:
parent
40c7c19aa8
commit
dab38a5b9c
|
|
@ -86,6 +86,22 @@ public class SelectController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 领用工程下拉选
|
||||||
|
* @param bmProject
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "领用工程下拉选")
|
||||||
|
@PostMapping("getLeaseProjectList")
|
||||||
|
public AjaxResult getLeaseProjectList(@RequestBody BmProject bmProject) {
|
||||||
|
try {
|
||||||
|
return service.getLeaseProjectList(bmProject);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("获取数据失败");
|
||||||
|
return AjaxResult.error("获取数据失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "机具类型下拉选")
|
@ApiOperation(value = "机具类型下拉选")
|
||||||
@PostMapping("getMaTypeData")
|
@PostMapping("getMaTypeData")
|
||||||
public AjaxResult getMaTypeData(@RequestBody SelectDto dto){
|
public AjaxResult getMaTypeData(@RequestBody SelectDto dto){
|
||||||
|
|
|
||||||
|
|
@ -301,4 +301,11 @@ public interface SelectMapper {
|
||||||
List<TypeTreeNode> getBzUseTypeTreeL4(BackApplyInfo bean);
|
List<TypeTreeNode> getBzUseTypeTreeL4(BackApplyInfo bean);
|
||||||
|
|
||||||
List<TreeNode> getDeviceTypeTreeTwo(SelectDto dto);
|
List<TreeNode> getDeviceTypeTreeTwo(SelectDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取工程下拉选
|
||||||
|
* @param bmProject
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<ProjectTreeNode> getLeaseProjectList(BmProject bmProject);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -259,4 +259,11 @@ public interface SelectService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
AjaxResult getBzUseTypeTree(BackApplyInfo bean);
|
AjaxResult getBzUseTypeTree(BackApplyInfo bean);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 领用工程下拉选
|
||||||
|
* @param bmProject
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
AjaxResult getLeaseProjectList(BmProject bmProject);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -415,6 +415,36 @@ public class SelectServiceImpl implements SelectService {
|
||||||
return AjaxResult.success(groupList);
|
return AjaxResult.success(groupList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 领用工程下拉选
|
||||||
|
* @param bmProject
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult getLeaseProjectList(BmProject bmProject) {
|
||||||
|
// 获取登陆用户的组织ID
|
||||||
|
Long thisLoginUserDeptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
||||||
|
// 判断是否开启过滤
|
||||||
|
if (Objects.nonNull(bmProject) && Objects.nonNull(bmProject.getEnableFilter()) && bmProject.getEnableFilter()) {
|
||||||
|
bmProject.setDeptId(thisLoginUserDeptId);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<ProjectTreeNode> groupList = new ArrayList<>();
|
||||||
|
List<ProjectTreeNode> list = new ArrayList<>();
|
||||||
|
try {
|
||||||
|
list = mapper.getLeaseProjectList(bmProject);
|
||||||
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
|
// 创建树形结构(数据集合作为参数)
|
||||||
|
ProjectTreeBuild treeBuild = new ProjectTreeBuild(list);
|
||||||
|
// 原查询结果转换树形结构
|
||||||
|
groupList = treeBuild.buildTree();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("工程类型树-查询失败", e);
|
||||||
|
}
|
||||||
|
return AjaxResult.success(groupList);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult getDeviceTypeTree(SelectDto dto) {
|
public AjaxResult getDeviceTypeTree(SelectDto dto) {
|
||||||
List<TreeNode> groupList = new ArrayList<>();
|
List<TreeNode> groupList = new ArrayList<>();
|
||||||
|
|
|
||||||
|
|
@ -345,7 +345,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
UNION
|
UNION
|
||||||
SELECT DISTINCT
|
SELECT DISTINCT
|
||||||
concat( 'gs', sd.dept_id ) AS id,
|
concat( 'gs', sd.dept_id ) AS id,
|
||||||
sd.dept_name AS proName,
|
sd.dept_name AS name,
|
||||||
'0' AS parentId,
|
'0' AS parentId,
|
||||||
1 AS level
|
1 AS level
|
||||||
FROM
|
FROM
|
||||||
|
|
@ -925,4 +925,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</if>
|
</if>
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getLeaseProjectList" resultType="com.bonus.common.biz.domain.ProjectTreeNode">
|
||||||
|
/*根据往来单位id关联协议查询工程*/
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
bmp.pro_id AS id,
|
||||||
|
bmp.pro_name AS name,
|
||||||
|
concat( 'gs', bmp.imp_unit ) AS parentId,
|
||||||
|
2 AS level
|
||||||
|
FROM
|
||||||
|
bm_project bmp
|
||||||
|
LEFT JOIN sys_dept sd ON sd.dept_id = bmp.imp_unit
|
||||||
|
WHERE
|
||||||
|
sd.del_flag = '0'
|
||||||
|
AND sd.`status` = '0'
|
||||||
|
AND bmp.del_flag = '0'
|
||||||
|
<if test="deptId != null">
|
||||||
|
AND bmp.imp_unit = #{deptId}
|
||||||
|
</if>
|
||||||
|
UNION
|
||||||
|
SELECT DISTINCT
|
||||||
|
concat( 'gs', sd.dept_id ) AS id,
|
||||||
|
sd.dept_name AS name,
|
||||||
|
'0' AS parentId,
|
||||||
|
1 AS level
|
||||||
|
FROM
|
||||||
|
sys_dept sd
|
||||||
|
LEFT JOIN bm_project bmp ON sd.dept_id = bmp.imp_unit
|
||||||
|
WHERE
|
||||||
|
bmp.pro_id IS NOT NULL
|
||||||
|
AND sd.del_flag = '0'
|
||||||
|
AND sd.`status` = '0'
|
||||||
|
AND bmp.del_flag = '0'
|
||||||
|
<if test="deptId != null">
|
||||||
|
AND bmp.imp_unit = #{deptId}
|
||||||
|
</if>
|
||||||
|
) a
|
||||||
|
ORDER BY
|
||||||
|
level
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -875,6 +875,7 @@
|
||||||
select workflow_status from sys_workflow_record
|
select workflow_status from sys_workflow_record
|
||||||
where
|
where
|
||||||
task_id = #{taskId}
|
task_id = #{taskId}
|
||||||
|
Limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertWorkOrderPeople">
|
<insert id="insertWorkOrderPeople">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue