Commit 0c4f2337 authored by zhangjianqian's avatar zhangjianqian

小程序隐患排查任务

parent fc2b1ce8
package com.zehong.web.controller.hiddenDanger; package com.zehong.web.controller.hiddenDanger;
import java.util.List; import java.util.List;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.core.domain.model.LoginUser;
import com.zehong.common.utils.ServletUtils;
import com.zehong.framework.web.service.SysLoginService;
import com.zehong.framework.web.service.TokenService;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -32,6 +38,8 @@ public class THiddenTroubleWorkController extends BaseController ...@@ -32,6 +38,8 @@ public class THiddenTroubleWorkController extends BaseController
{ {
@Autowired @Autowired
private ITHiddenTroubleWorkService tHiddenTroubleWorkService; private ITHiddenTroubleWorkService tHiddenTroubleWorkService;
@Autowired
private TokenService tokenService;
/** /**
* 查询隐患排查任务列表 * 查询隐患排查任务列表
...@@ -44,7 +52,16 @@ public class THiddenTroubleWorkController extends BaseController ...@@ -44,7 +52,16 @@ public class THiddenTroubleWorkController extends BaseController
List<THiddenTroubleWork> list = tHiddenTroubleWorkService.selectTHiddenTroubleWorkList(tHiddenTroubleWork); List<THiddenTroubleWork> list = tHiddenTroubleWorkService.selectTHiddenTroubleWorkList(tHiddenTroubleWork);
return getDataTable(list); return getDataTable(list);
} }
@GetMapping("/listApp")
public TableDataInfo listApp(THiddenTroubleWork tHiddenTroubleWork)
{
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
SysUser user = loginUser.getUser();
tHiddenTroubleWork.setStaffId(user.getUserId());
startPage();
List<THiddenTroubleWork> list = tHiddenTroubleWorkService.selectTHiddenTroubleWorkListApp(tHiddenTroubleWork);
return getDataTable(list);
}
/** /**
* 导出隐患排查任务列表 * 导出隐患排查任务列表
*/ */
......
...@@ -33,4 +33,6 @@ public class UserCourseVo { ...@@ -33,4 +33,6 @@ public class UserCourseVo {
private Date createTime; private Date createTime;
private String dataKind; private String dataKind;
private Integer personnelType;
} }
...@@ -27,6 +27,7 @@ public interface THiddenTroubleWorkMapper ...@@ -27,6 +27,7 @@ public interface THiddenTroubleWorkMapper
* @return 隐患排查任务集合 * @return 隐患排查任务集合
*/ */
public List<THiddenTroubleWork> selectTHiddenTroubleWorkList(THiddenTroubleWork tHiddenTroubleWork); public List<THiddenTroubleWork> selectTHiddenTroubleWorkList(THiddenTroubleWork tHiddenTroubleWork);
public List<THiddenTroubleWork> selectTHiddenTroubleWorkListApp(THiddenTroubleWork tHiddenTroubleWork);
/** /**
* 新增隐患排查任务 * 新增隐患排查任务
......
...@@ -76,7 +76,7 @@ public interface TTrainCourseMapper ...@@ -76,7 +76,7 @@ public interface TTrainCourseMapper
* @param userId * @param userId
* @return * @return
*/ */
public List<UserCourseVo> userCourseList(@Param("userId")Long userId,@Param("type") Integer type); public List<UserCourseVo> userCourseList(@Param("userId")Long userId,@Param("type") Integer type,@Param("personnelType")Integer personnelType);
/** /**
* 考试统计接口 * 考试统计接口
......
...@@ -26,6 +26,8 @@ public interface ITHiddenTroubleWorkService ...@@ -26,6 +26,8 @@ public interface ITHiddenTroubleWorkService
* @return 隐患排查任务集合 * @return 隐患排查任务集合
*/ */
public List<THiddenTroubleWork> selectTHiddenTroubleWorkList(THiddenTroubleWork tHiddenTroubleWork); public List<THiddenTroubleWork> selectTHiddenTroubleWorkList(THiddenTroubleWork tHiddenTroubleWork);
public List<THiddenTroubleWork> selectTHiddenTroubleWorkListApp(THiddenTroubleWork tHiddenTroubleWork);
/** /**
* 新增隐患排查任务 * 新增隐患排查任务
......
...@@ -77,6 +77,7 @@ public interface ITTrainCourseService ...@@ -77,6 +77,7 @@ public interface ITTrainCourseService
* @return * @return
*/ */
public List<UserCourseVo> userCourseList(Long userId,Integer type); public List<UserCourseVo> userCourseList(Long userId,Integer type);
public List<UserCourseVo> youkeCourseList(Long userId,Integer type);
/** /**
* 考试 * 考试
*/ */
......
...@@ -77,19 +77,20 @@ public class THiddenTroubleAssessmentServiceImpl implements ITHiddenTroubleAsses ...@@ -77,19 +77,20 @@ public class THiddenTroubleAssessmentServiceImpl implements ITHiddenTroubleAsses
@Transactional @Transactional
public int updateTHiddenTroubleAssessment(THiddenTroubleAssessment tHiddenTroubleAssessment) public int updateTHiddenTroubleAssessment(THiddenTroubleAssessment tHiddenTroubleAssessment)
{ {
if(tHiddenTroubleAssessment.getUpdateType()==2){ // if(tHiddenTroubleAssessment.getUpdateType()==2){
tHiddenTroubleAssessment.setAssessmentTime(new Date()); // tHiddenTroubleAssessment.setAssessmentTime(new Date());
THiddenTroubleWork work = tHiddenTroubleWorkMapper.selectTHiddenTroubleWorkById(tHiddenTroubleAssessment.getWorkId()); // THiddenTroubleWork work = tHiddenTroubleWorkMapper.selectTHiddenTroubleWorkById(tHiddenTroubleAssessment.getWorkId());
work.setWorkStep(2); // work.setWorkStep(2);
tHiddenTroubleWorkMapper.updateTHiddenTroubleWork(work); // tHiddenTroubleWorkMapper.updateTHiddenTroubleWork(work);
if(work.getParentId()!=0L){ // if(work.getParentId()!=0L){
THiddenTroubleWork work1 = new THiddenTroubleWork(); // THiddenTroubleWork work1 = new THiddenTroubleWork();
work1.setWorkId(work.getParentId()); // work1.setWorkId(work.getParentId());
work1.setWorkStep(2); // work1.setWorkStep(2);
tHiddenTroubleWorkMapper.updateTHiddenTroubleWork(work1); // tHiddenTroubleWorkMapper.updateTHiddenTroubleWork(work1);
} // }
//
} // }
tHiddenTroubleAssessment.setCheckTime(new Date());
return tHiddenTroubleAssessmentMapper.updateTHiddenTroubleAssessment(tHiddenTroubleAssessment); return tHiddenTroubleAssessmentMapper.updateTHiddenTroubleAssessment(tHiddenTroubleAssessment);
} }
......
...@@ -73,6 +73,17 @@ public class THiddenTroubleWorkServiceImpl implements ITHiddenTroubleWorkService ...@@ -73,6 +73,17 @@ public class THiddenTroubleWorkServiceImpl implements ITHiddenTroubleWorkService
return list; return list;
} }
/**
* app接口
* @param tHiddenTroubleWork
* @return
*/
@Override
public List<THiddenTroubleWork> selectTHiddenTroubleWorkListApp(THiddenTroubleWork tHiddenTroubleWork)
{
List<THiddenTroubleWork> list = tHiddenTroubleWorkMapper.selectTHiddenTroubleWorkListApp(tHiddenTroubleWork);
return list;
}
/** /**
* 新增隐患排查任务 * 新增隐患排查任务
* *
......
...@@ -142,10 +142,19 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService ...@@ -142,10 +142,19 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService
*/ */
@Override @Override
public List<UserCourseVo> userCourseList(Long userId,Integer type){ public List<UserCourseVo> userCourseList(Long userId,Integer type){
List<UserCourseVo> list = tTrainCourseMapper.userCourseList(userId,type); List<UserCourseVo> list = tTrainCourseMapper.userCourseList(userId,type,1);
return list; return list;
} }
/**
* 承包商课程表
* @return
*/
@Override
public List<UserCourseVo> youkeCourseList(Long userId,Integer type){
List<UserCourseVo> list = tTrainCourseMapper.userCourseList(userId,type,2);
return list;
}
/** /**
* 考试判断 * 考试判断
* @param userCourseId * @param userCourseId
......
...@@ -36,9 +36,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -36,9 +36,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql> </sql>
<select id="selectTHiddenTroubleAssessmentList" parameterType="THiddenTroubleAssessment" resultMap="THiddenTroubleAssessmentResult"> <select id="selectTHiddenTroubleAssessmentList" parameterType="THiddenTroubleAssessment" resultMap="THiddenTroubleAssessmentResult">
SELECT a.`assessment_id`,a.library_id,a.is_xun,a.check_url,a.check_time,a.check_user,a.check_feedback, SELECT a.`assessment_id`,a.library_id,a.is_xun,a.check_url,a.check_time,a.check_feedback,
l.risk_point,l.inspect_term,l.inspect_basis,l.library_content l.risk_point,l.inspect_term,l.inspect_basis,l.library_content,u.`staff_name` AS check_user
FROM t_hidden_trouble_assessment a LEFT JOIN t_hidden_library l ON l.`library_id` = a.library_id FROM t_hidden_trouble_assessment a LEFT JOIN t_hidden_library l ON l.`library_id` = a.library_id
LEFT JOIN sys_user u ON u.`user_id` = a.check_user
<where> <where>
<if test="assessmentLevel != null "> and assessment_level = #{assessmentLevel}</if> <if test="assessmentLevel != null "> and assessment_level = #{assessmentLevel}</if>
<if test="workId != null "> and work_id = #{workId}</if> <if test="workId != null "> and work_id = #{workId}</if>
...@@ -100,6 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -100,6 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update t_hidden_trouble_assessment update t_hidden_trouble_assessment
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="workId != null">work_id = #{workId},</if> <if test="workId != null">work_id = #{workId},</if>
<if test="isXun != null">is_xun = #{isXun},</if>
<if test="checkFeedback != null">check_feedback = #{checkFeedback},</if> <if test="checkFeedback != null">check_feedback = #{checkFeedback},</if>
<if test="checkUrl != null">check_url = #{checkUrl},</if> <if test="checkUrl != null">check_url = #{checkUrl},</if>
<if test="checkTime != null">check_time = #{checkTime},</if> <if test="checkTime != null">check_time = #{checkTime},</if>
......
...@@ -53,7 +53,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -53,7 +53,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
limit 5 limit 5
</if> </if>
</select> </select>
<select id="selectTHiddenTroubleWorkListApp" parameterType="THiddenTroubleWork" resultMap="THiddenTroubleWorkResult">
SELECT tw.work_id, tw.parent_id, tw.book_id, tw.work_cycle, tw.work_name, tw.work_type, tw.work_form, tw.work_begin_time, tw.work_end_time,tw.finish_time,
tw.time_term, tw.work_range, tw.dept_id, tw.work_step, tw.content, tw.create_time, tw.create_by, tw.is_del,
d.dept_name,b.trouble_name,u.`staff_name`,tw.`staff_id`
FROM t_hidden_trouble_work tw
LEFT JOIN sys_dept d ON d.dept_id = tw.dept_id
LEFT JOIN sys_user u ON u.`user_id` = tw.`staff_id`
LEFT JOIN t_staning_book b ON b.book_id = tw.book_id
<where>
AND (tw.parent_id != 0 or tw.work_cycle = 1)
<if test="staffId != null"> and tw.`staff_id` = #{staffId}</if>
<if test="workName != null and workName != ''"> and tw.work_name like concat('%', #{workName}, '%')</if>
</where>
order by tw.create_time desc
</select>
<select id="selectTHiddenTroubleWorkById" parameterType="Long" resultMap="THiddenTroubleWorkResult"> <select id="selectTHiddenTroubleWorkById" parameterType="Long" resultMap="THiddenTroubleWorkResult">
SELECT tw.work_id, tw.parent_id, tw.book_id, tw.work_cycle, tw.work_name, tw.work_type, tw.work_form, tw.work_begin_time, tw.work_end_time,tw.finish_time, SELECT tw.work_id, tw.parent_id, tw.book_id, tw.work_cycle, tw.work_name, tw.work_type, tw.work_form, tw.work_begin_time, tw.work_end_time,tw.finish_time,
tw.time_term, tw.work_range, tw.dept_id, tw.work_step, tw.content, tw.create_time, tw.create_by, tw.is_del, tw.time_term, tw.work_range, tw.dept_id, tw.work_step, tw.content, tw.create_time, tw.create_by, tw.is_del,
......
...@@ -153,12 +153,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -153,12 +153,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="userCourseList" resultType="com.zehong.system.domain.vo.UserCourseVo"> <select id="userCourseList" resultType="com.zehong.system.domain.vo.UserCourseVo">
SELECT uc.user_course_id AS userCourseId,uc.state ,uc.examination_time AS examinationTime, SELECT uc.user_course_id AS userCourseId,uc.state ,uc.examination_time AS examinationTime,
uc.`examination_result` AS examinationResult,uc.`create_time` AS createTime, uc.`examination_result` AS examinationResult,uc.`create_time` AS createTime,
c.`course_name` AS courseName, c.`topic_num` AS topicNum,c.`release_time` AS releaseTime,c.data_kind as dataKind, c.`course_name` AS courseName, c.`topic_num` AS topicNum,c.`release_time` AS releaseTime,c.data_kind as dataKind,c.personnel_type as personnelType,
p.`plan_name` AS courseType,c.course_id as courseId,c.qualified_num as qualifiedNum p.`plan_name` AS courseType,c.course_id as courseId,c.qualified_num as qualifiedNum
FROM t_train_user_course uc FROM t_train_user_course uc
LEFT JOIN t_train_course c ON c.`course_id` = uc.`course_id` LEFT JOIN t_train_course c ON c.`course_id` = uc.`course_id`
LEFT JOIN t_train_plan p ON p.`plan_id` = c.`course_type` LEFT JOIN t_train_plan p ON p.`plan_id` = c.`course_type`
WHERE uc.user_id = #{userId} and uc.personnel_type =1 WHERE uc.user_id = #{userId} and uc.personnel_type =#{personnelType}
<if test="type!=null and type == 1"> <if test="type!=null and type == 1">
and uc.state !=2 and uc.state !=2
</if> </if>
......
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