Commit 255e086a authored by 耿迪迪's avatar 耿迪迪
parents ea4f77c8 fd8af6c4
......@@ -2,6 +2,7 @@ package com.zehong.web.controller.system;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -50,6 +51,12 @@ public class SysDeptController extends BaseController
List<SysDept> depts = deptService.selectDeptList(dept);
return AjaxResult.success(depts);
}
@GetMapping("/applist")
public AjaxResult applist(SysDept dept)
{
List<Map<String,Object>> depts = deptService.selectDeptAppList(dept);
return AjaxResult.success(depts);
}
/**
* 查询部门列表(排除节点)
......
......@@ -195,6 +195,16 @@ public class TWorkPermitController extends BaseController
return AjaxResult.success(workPermit);
}
/**
* app判断修改
* @param workPermitId
* @return
*/
@GetMapping(value = "/selectUpdate")
public AjaxResult selectUpdate(Long workPermitId)
{
return toAjax(tWorkPermitService.selectUpdate(workPermitId));
}
/**
* 新增作业许可证
*/
......
......@@ -3,6 +3,7 @@ package com.zehong.system.mapper;
import java.util.List;
import java.util.Map;
import com.zehong.system.domain.SysUserPost;
import org.apache.ibatis.annotations.Param;
import com.zehong.common.core.domain.entity.SysDept;
......@@ -20,6 +21,7 @@ public interface SysDeptMapper
* @return 部门信息集合
*/
public List<SysDept> selectDeptList(SysDept dept);
public List<Map<String,Object>> selectDeptAppList(SysDept dept);
/**
* 根据角色ID查询部门树信息
......
......@@ -65,4 +65,6 @@ public interface TWorkPermitMapper
* @return
*/
List<TWorkPermit> selectTWorkPermitListByLoginUser(TWorkPermit tWorkPermit);
Integer selectSign(Long workPermitId);
}
......@@ -5,6 +5,7 @@ import java.util.Map;
import com.zehong.common.core.domain.TreeSelect;
import com.zehong.common.core.domain.entity.SysDept;
import com.zehong.system.domain.SysUserPost;
/**
* 部门管理 服务层
......@@ -20,6 +21,7 @@ public interface ISysDeptService
* @return 部门信息集合
*/
public List<SysDept> selectDeptList(SysDept dept);
public List<Map<String,Object>> selectDeptAppList(SysDept dept);
/**
* 构建前端所需要树结构
......
......@@ -67,4 +67,11 @@ public interface ITWorkPermitService
* @return
*/
List<TWorkPermit> selectTWorkPermitListByLoginUser(TWorkPermit tWorkPermit);
/**
*
* @param workPermitId
* @return
*/
int selectUpdate(Long workPermitId);
}
......@@ -44,6 +44,11 @@ public class SysDeptServiceImpl implements ISysDeptService
{
return deptMapper.selectDeptList(dept);
}
@Override
public List<Map<String,Object>> selectDeptAppList(SysDept dept)
{
return deptMapper.selectDeptAppList(dept);
}
/**
* 构建前端所需要树结构
......
......@@ -172,4 +172,17 @@ public class TWorkPermitServiceImpl implements ITWorkPermitService
public List<TWorkPermit> selectTWorkPermitListByLoginUser(TWorkPermit tWorkPermit){
return tWorkPermitMapper.selectTWorkPermitListByLoginUser(tWorkPermit);
}
@Override
public int selectUpdate(Long workPermitId){
Integer a = tWorkPermitMapper.selectSign(workPermitId);
if(a==0){
TWorkPermit t = tWorkPermitMapper.selectTWorkPermitById(workPermitId);
t.setApplyStatus("2");
return tWorkPermitMapper.updateTWorkPermit(t);
}else {
return 1;
}
}
}
......@@ -43,7 +43,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
${params.dataScope}
order by d.parent_id, d.order_num
</select>
<select id="selectDeptAppList" parameterType="SysDept" resultType="java.util.HashMap">
SELECT dept_id as `value`,dept_name as text from sys_dept d
where d.del_flag = '0'
<if test="deptName != null and deptName != ''">
AND dept_name like concat('%', #{deptName}, '%')
</if>
<if test="status != null and status != ''">
AND status = #{status}
</if>
order by d.parent_id, d.order_num
</select>
<select id="selectDeptListByRoleId" resultType="Integer">
select d.dept_id
from sys_dept d
......
......@@ -209,4 +209,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
GROUP BY permit.work_permit_id
ORDER BY create_time DESC
</select>
<select id="selectSign" resultType="java.lang.Integer" parameterType="java.lang.Long">
SELECT COUNT(sign_id) FROM t_special_work_permit_sign WHERE
permit_id IN (SELECT special_work_permit_id FROM t_special_work_permit WHERE work_permit_id = #{workPermitId} )
AND sign_name IS NULL
</select>
</mapper>
\ No newline at end of file
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