Commit 90c14366 authored by 耿迪迪's avatar 耿迪迪
parents ce82bcd4 c79f6cf8
......@@ -2,6 +2,7 @@ package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.THiddenTroubleAssessment;
import org.apache.ibatis.annotations.Param;
/**
* 排查评估Mapper接口
......@@ -60,4 +61,6 @@ public interface THiddenTroubleAssessmentMapper
* @return 结果
*/
public int deleteTHiddenTroubleAssessmentByIds(Long[] assessmentIds);
public int inserts(@Param("workId")Long workId, @Param("ids")String[] ids);
}
......@@ -7,7 +7,9 @@ import java.util.List;
import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.THiddenTroubleAssessment;
import com.zehong.system.domain.TStaningBook;
import com.zehong.system.mapper.THiddenTroubleAssessmentMapper;
import com.zehong.system.mapper.TStaningBookMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -31,6 +33,8 @@ public class THiddenTroubleWorkServiceImpl implements ITHiddenTroubleWorkService
private THiddenTroubleWorkMapper tHiddenTroubleWorkMapper;
@Autowired
private TStaningBookMapper tStaningBookMapper;
@Autowired
private THiddenTroubleAssessmentMapper tHiddenTroubleAssessmentMapper;
private static Logger logger = LoggerFactory.getLogger(THiddenTroubleWorkServiceImpl.class);
/**
......@@ -80,23 +84,10 @@ public class THiddenTroubleWorkServiceImpl implements ITHiddenTroubleWorkService
{
tHiddenTroubleWork.setCreateTime(DateUtils.getNowDate());
int a = tHiddenTroubleWorkMapper.insertTHiddenTroubleWork(tHiddenTroubleWork);
if(tHiddenTroubleWork.getBookId()!=null&&(tHiddenTroubleWork.getWorkCycle()==1||tHiddenTroubleWork.getParentId()!=0L)){
TStaningBook book = tStaningBookMapper.selectTStaningBookById(tHiddenTroubleWork.getBookId());
if(book!=null){
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;
}
}
}
}
// if(tHiddenTroubleWork.getWorkCycle()==1||tHiddenTroubleWork.getParentId()!=0L){
// String[] ids = tHiddenTroubleWork.getContent().split(",");
// tHiddenTroubleAssessmentMapper.inserts(tHiddenTroubleWork.getWorkId(),ids);
// }
return a;
}
......
......@@ -121,4 +121,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{assessmentId}
</foreach>
</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>
\ 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