Commit 9b0abed6 authored by zhangjianqian's avatar zhangjianqian

隐患台账 指定整改人,选择部门筛选整改人,默认上报人当人登录人

parent 5d640131
...@@ -44,8 +44,9 @@ public class TStaningBookController extends BaseController ...@@ -44,8 +44,9 @@ public class TStaningBookController extends BaseController
{ {
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
SysUser user = loginUser.getUser(); SysUser user = loginUser.getUser();
tStaningBook.setUserId(user.getUserId());
startPage(); startPage();
List<TStaningBook> list = tStaningBookService.selectTStaningBookList(tStaningBook,user.getDeptId()); List<TStaningBook> list = tStaningBookService.selectTStaningBookList(tStaningBook,user.getRoles().get(0).getRoleId());
return getDataTable(list); return getDataTable(list);
} }
...@@ -60,7 +61,7 @@ public class TStaningBookController extends BaseController ...@@ -60,7 +61,7 @@ public class TStaningBookController extends BaseController
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
SysUser user = loginUser.getUser(); SysUser user = loginUser.getUser();
startPage(); startPage();
List<TStaningBook> list = tStaningBookService.selectTStaningBookList(tStaningBook,user.getDeptId()); List<TStaningBook> list = tStaningBookService.selectTStaningBookList(tStaningBook,user.getRoles().get(0).getRoleId());
ExcelUtil<TStaningBook> util = new ExcelUtil<TStaningBook>(TStaningBook.class); ExcelUtil<TStaningBook> util = new ExcelUtil<TStaningBook>(TStaningBook.class);
return util.exportExcel(list, "隐患台账数据"); return util.exportExcel(list, "隐患台账数据");
} }
...@@ -83,6 +84,9 @@ public class TStaningBookController extends BaseController ...@@ -83,6 +84,9 @@ public class TStaningBookController extends BaseController
@PostMapping @PostMapping
public AjaxResult add(@RequestBody TStaningBook tStaningBook) public AjaxResult add(@RequestBody TStaningBook tStaningBook)
{ {
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
SysUser user = loginUser.getUser();
tStaningBook.setCreateId(user.getUserId());
return toAjax(tStaningBookService.insertTStaningBook(tStaningBook)); return toAjax(tStaningBookService.insertTStaningBook(tStaningBook));
} }
......
...@@ -145,6 +145,26 @@ public class TStaningBook extends BaseEntity ...@@ -145,6 +145,26 @@ public class TStaningBook extends BaseEntity
private List<Long> deptList; private List<Long> deptList;
private Long userId;
private Long createId;
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getCreateId() {
return createId;
}
public void setCreateId(Long createId) {
this.createId = createId;
}
public List<Long> getDeptList() { public List<Long> getDeptList() {
return deptList; return deptList;
} }
......
...@@ -28,7 +28,7 @@ public interface ITStaningBookService ...@@ -28,7 +28,7 @@ public interface ITStaningBookService
* @param tStaningBook 隐患台账 * @param tStaningBook 隐患台账
* @return 隐患台账集合 * @return 隐患台账集合
*/ */
public List<TStaningBook> selectTStaningBookList(TStaningBook tStaningBook,Long deptId); public List<TStaningBook> selectTStaningBookList(TStaningBook tStaningBook,Long roleId);
/** /**
* 新增隐患台账 * 新增隐患台账
......
...@@ -239,7 +239,7 @@ public class LedserviceImpl { ...@@ -239,7 +239,7 @@ public class LedserviceImpl {
led.AddSinglelineTextToImageTextArea(hProgram,0,1,0,"上海灵信视觉","宋体",12,0xff,0,0,0,6,8,0); led.AddSinglelineTextToImageTextArea(hProgram,0,1,0,"上海灵信视觉","宋体",12,0xff,0,0,0,6,8,0);
//添加数字时钟节目 //添加数字时钟节目
led.AddProgram(hProgram, 1, 0, 1); led.AddProgram(hProgram, 1, 0, 1);
led.AddDigitalClockArea(hProgram,1,1,0,0,ledWidth,ledHeight,"宋体",8,0xff,0,0,0,0,0,0,0,1,1,0,0,0xff,0,0xff,0,0xff,1); led.AddDigitalClockArea(hProgram,1,1,0,0,ledWidth,ledHeight,"宋体",9,0xff,0,0,0,1,0,1,1,1,1,1,0,0xff,0,0xff,3,0xff,0);
int errCode = led.NetWorkSend(strIp, hProgram); int errCode = led.NetWorkSend(strIp, hProgram);
led.DeleteProgram(hProgram); led.DeleteProgram(hProgram);
......
...@@ -51,13 +51,11 @@ public class TStaningBookServiceImpl implements ITStaningBookService ...@@ -51,13 +51,11 @@ public class TStaningBookServiceImpl implements ITStaningBookService
* @return 隐患台账 * @return 隐患台账
*/ */
@Override @Override
public List<TStaningBook> selectTStaningBookList(TStaningBook tStaningBook,Long deptId) public List<TStaningBook> selectTStaningBookList(TStaningBook tStaningBook,Long roleId)
{ {
List<Long> oneList = new ArrayList<>(); if(roleId!=3){//当角色是管理员时候查询全部
oneList.add(deptId); tStaningBook.setUserId(0l);
List<Long> deptIds = selectDeptIds(new ArrayList<>(),oneList); }
deptIds.add(deptId);
tStaningBook.setDeptList(deptIds);
List<TStaningBook> list = tStaningBookMapper.selectTStaningBookList(tStaningBook); List<TStaningBook> list = tStaningBookMapper.selectTStaningBookList(tStaningBook);
return list; return list;
} }
......
...@@ -37,6 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -37,6 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="workId" column="work_id" /> <result property="workId" column="work_id" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
<result property="createId" column="create_id" />
<result property="isDel" column="is_del" /> <result property="isDel" column="is_del" />
<result property="deptName" column="deptName" /> <result property="deptName" column="deptName" />
</resultMap> </resultMap>
...@@ -57,9 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -57,9 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN sys_dept d ON d.`dept_id` = b.`dept_id` LEFT JOIN sys_dept d ON d.`dept_id` = b.`dept_id`
<where> <where>
<foreach collection="deptList" item="deptId" open="AND b.dept_id in (" separator="," close=")"> <if test="userId != null and userId != 0"> and (b.escalation=#{userId}||b.rectification = #{userId}||b.create_id = #{userId} ) </if>
#{deptId}
</foreach>
<if test="troubleName != null and troubleName != ''"> and b.trouble_name like concat('%', #{troubleName}, '%')</if> <if test="troubleName != null and troubleName != ''"> and b.trouble_name like concat('%', #{troubleName}, '%')</if>
<if test="findTime != null "> and b.find_time &gt; #{findTime}</if> <if test="findTime != null "> and b.find_time &gt; #{findTime}</if>
<if test="rectificationTime != null "> and b.find_time &lt; #{rectificationTime}</if> <if test="rectificationTime != null "> and b.find_time &lt; #{rectificationTime}</if>
...@@ -103,6 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -103,6 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="workId != null">work_id,</if> <if test="workId != null">work_id,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="createId != null">create_id,</if>
<if test="isDel != null">is_del,</if> <if test="isDel != null">is_del,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
...@@ -134,6 +134,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -134,6 +134,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="workId != null">#{workId},</if> <if test="workId != null">#{workId},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createId != null">#{createId},</if>
<if test="isDel != null">#{isDel},</if> <if test="isDel != null">#{isDel},</if>
</trim> </trim>
</insert> </insert>
...@@ -169,6 +170,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -169,6 +170,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="workId != null">work_id = #{workId},</if> <if test="workId != null">work_id = #{workId},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="createId != null">create_id = #{createId},</if>
<if test="isDel != null">is_del = #{isDel},</if> <if test="isDel != null">is_del = #{isDel},</if>
</trim> </trim>
where book_id = #{bookId} where book_id = #{bookId}
......
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