Commit 9b0abed6 authored by zhangjianqian's avatar zhangjianqian

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

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