Commit 072a1385 authored by zhangjianqian's avatar zhangjianqian

隐患详情修改

parent 14227427
...@@ -2,6 +2,7 @@ package com.zehong.system.mapper; ...@@ -2,6 +2,7 @@ package com.zehong.system.mapper;
import java.util.List; import java.util.List;
import com.zehong.system.domain.THiddenTroubleAssessment; import com.zehong.system.domain.THiddenTroubleAssessment;
import org.apache.ibatis.annotations.Param;
/** /**
* 排查评估Mapper接口 * 排查评估Mapper接口
...@@ -60,4 +61,6 @@ public interface THiddenTroubleAssessmentMapper ...@@ -60,4 +61,6 @@ public interface THiddenTroubleAssessmentMapper
* @return 结果 * @return 结果
*/ */
public int deleteTHiddenTroubleAssessmentByIds(Long[] assessmentIds); public int deleteTHiddenTroubleAssessmentByIds(Long[] assessmentIds);
public int inserts(@Param("workId")Long workId, @Param("ids")String[] ids);
} }
...@@ -7,7 +7,9 @@ import java.util.List; ...@@ -7,7 +7,9 @@ import java.util.List;
import com.zehong.common.utils.DateUtils; import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.THiddenTroubleAssessment;
import com.zehong.system.domain.TStaningBook; import com.zehong.system.domain.TStaningBook;
import com.zehong.system.mapper.THiddenTroubleAssessmentMapper;
import com.zehong.system.mapper.TStaningBookMapper; import com.zehong.system.mapper.TStaningBookMapper;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -31,6 +33,8 @@ public class THiddenTroubleWorkServiceImpl implements ITHiddenTroubleWorkService ...@@ -31,6 +33,8 @@ public class THiddenTroubleWorkServiceImpl implements ITHiddenTroubleWorkService
private THiddenTroubleWorkMapper tHiddenTroubleWorkMapper; private THiddenTroubleWorkMapper tHiddenTroubleWorkMapper;
@Autowired @Autowired
private TStaningBookMapper tStaningBookMapper; private TStaningBookMapper tStaningBookMapper;
@Autowired
private THiddenTroubleAssessmentMapper tHiddenTroubleAssessmentMapper;
private static Logger logger = LoggerFactory.getLogger(THiddenTroubleWorkServiceImpl.class); private static Logger logger = LoggerFactory.getLogger(THiddenTroubleWorkServiceImpl.class);
/** /**
...@@ -80,23 +84,10 @@ public class THiddenTroubleWorkServiceImpl implements ITHiddenTroubleWorkService ...@@ -80,23 +84,10 @@ public class THiddenTroubleWorkServiceImpl implements ITHiddenTroubleWorkService
{ {
tHiddenTroubleWork.setCreateTime(DateUtils.getNowDate()); tHiddenTroubleWork.setCreateTime(DateUtils.getNowDate());
int a = tHiddenTroubleWorkMapper.insertTHiddenTroubleWork(tHiddenTroubleWork); int a = tHiddenTroubleWorkMapper.insertTHiddenTroubleWork(tHiddenTroubleWork);
if(tHiddenTroubleWork.getBookId()!=null&&(tHiddenTroubleWork.getWorkCycle()==1||tHiddenTroubleWork.getParentId()!=0L)){ // if(tHiddenTroubleWork.getWorkCycle()==1||tHiddenTroubleWork.getParentId()!=0L){
TStaningBook book = tStaningBookMapper.selectTStaningBookById(tHiddenTroubleWork.getBookId()); // String[] ids = tHiddenTroubleWork.getContent().split(",");
if(book!=null){ // tHiddenTroubleAssessmentMapper.inserts(tHiddenTroubleWork.getWorkId(),ids);
if(book.getWorkId()==null){ // }
book.setWorkId(tHiddenTroubleWork.getWorkId());
tStaningBookMapper.updateTStaningBook(book);
}else {
THiddenTroubleWork work = tHiddenTroubleWorkMapper.selectTHiddenTroubleWorkById(book.getWorkId());
if(work==null||work.getWorkStep()==4){
book.setWorkId(tHiddenTroubleWork.getWorkId());
tStaningBookMapper.updateTStaningBook(book);
}else {
return -2;
}
}
}
}
return a; return a;
} }
......
...@@ -121,4 +121,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -121,4 +121,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{assessmentId} #{assessmentId}
</foreach> </foreach>
</delete> </delete>
<insert id="inserts" >
insert into t_hidden_trouble_assessment (library_id,work_id) VALUES
<foreach collection="ids" item="item" index="index" separator=",">
(${item},workId)
</foreach>
</insert>
</mapper> </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