安全事故接口优化
This commit is contained in:
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
@ -25,6 +26,7 @@ import org.dromara.system.service.impl.SysDeptServiceImpl;
|
||||
import org.dromara.system.service.impl.SysUserServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@ -170,6 +172,7 @@ public class HseSafetySgdcServiceImpl extends ServiceImpl<HseSafetySgdcMapper, H
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean updateByBo(HseSafetySgdcBo bo) {
|
||||
HseSafetySgdc update = MapstructUtils.convert(bo, HseSafetySgdc.class);
|
||||
validEntityBeforeSave(update);
|
||||
@ -285,19 +288,25 @@ public class HseSafetySgdcServiceImpl extends ServiceImpl<HseSafetySgdcMapper, H
|
||||
*/
|
||||
public void addZgxx(Long id){
|
||||
if (id == null){
|
||||
return;
|
||||
throw new ServiceException("调查id不能为空");
|
||||
}
|
||||
HseSafetySgzgbh sgzg = new HseSafetySgzgbh();
|
||||
//调查
|
||||
HseSafetySgdcVo sgdc = queryById(id);
|
||||
if (sgdc == null){
|
||||
throw new ServiceException("找不到事故调查信息,请联系管理员");
|
||||
}
|
||||
//事故id
|
||||
sgzg.setSgId(sgdc.getSgId());
|
||||
//事故编号
|
||||
sgzg.setSgbh(sgdc.getSgbh());
|
||||
sgzg.setProjectId(sgdc.getProjectId());
|
||||
String banBen = BatchNumberGenerator.generateBatchNumber("ZGYBH-");
|
||||
sgzg.setZgbhbh(banBen);
|
||||
//事发地点 需要查询
|
||||
HseSafetySgsb sgsb = baseMapper.getSgsb(sgdc.getSgId());
|
||||
if (sgsb == null){
|
||||
return;
|
||||
throw new ServiceException("找不到事故信息,请联系管理员");
|
||||
}
|
||||
sgzg.setSfdd(sgsb.getSfdd());
|
||||
//事故类型
|
||||
|
||||
@ -5,7 +5,7 @@ public enum AqEnums {
|
||||
AQJDZT_S("是否交底", "1"),
|
||||
AQJDZT_F("是否交底", "2"),
|
||||
AQWXJX_S("是否存在危险迹象", "1"),
|
||||
AQWXJX_F("是否存在危险迹象", "2");
|
||||
AQWXJX_F("是否存在危险迹象", "0");
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user