|
@@ -4,7 +4,6 @@ import com.zd.common.core.annotation.DataScope;
|
|
|
import com.zd.common.core.exception.ServiceException;
|
|
import com.zd.common.core.exception.ServiceException;
|
|
|
import com.zd.common.core.security.TokenService;
|
|
import com.zd.common.core.security.TokenService;
|
|
|
import com.zd.common.core.utils.DateUtils;
|
|
import com.zd.common.core.utils.DateUtils;
|
|
|
-import com.zd.common.core.utils.StringUtils;
|
|
|
|
|
import com.zd.laboratory.domain.LabHazard;
|
|
import com.zd.laboratory.domain.LabHazard;
|
|
|
import com.zd.laboratory.domain.LabHazardSubjectRelation;
|
|
import com.zd.laboratory.domain.LabHazardSubjectRelation;
|
|
|
import com.zd.laboratory.domain.LabRiskPlan;
|
|
import com.zd.laboratory.domain.LabRiskPlan;
|
|
@@ -16,7 +15,6 @@ import com.zd.laboratory.domain.vo.LabHazardVO;
|
|
|
import com.zd.laboratory.mapper.LabHazardMapper;
|
|
import com.zd.laboratory.mapper.LabHazardMapper;
|
|
|
import com.zd.laboratory.mapper.LabHazardSubjectRelationMapper;
|
|
import com.zd.laboratory.mapper.LabHazardSubjectRelationMapper;
|
|
|
import com.zd.laboratory.mapper.LabRiskPlanMapper;
|
|
import com.zd.laboratory.mapper.LabRiskPlanMapper;
|
|
|
-import com.zd.laboratory.mapper.LabSafeClassifiedMapper;
|
|
|
|
|
import com.zd.laboratory.service.ILabHazardService;
|
|
import com.zd.laboratory.service.ILabHazardService;
|
|
|
import com.zd.model.domain.per.PerPrefix;
|
|
import com.zd.model.domain.per.PerPrefix;
|
|
|
import com.zd.model.entity.SysUser;
|
|
import com.zd.model.entity.SysUser;
|
|
@@ -25,7 +23,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
@@ -46,8 +43,6 @@ public class LabHazardServiceImpl implements ILabHazardService {
|
|
|
private LabHazardSubjectRelationMapper subjectRelationMapper;
|
|
private LabHazardSubjectRelationMapper subjectRelationMapper;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private LabRiskPlanMapper riskPlanMapper;
|
|
private LabRiskPlanMapper riskPlanMapper;
|
|
|
- @Autowired
|
|
|
|
|
- private LabSafeClassifiedMapper safeClassifiedMapper;
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 查询危险源
|
|
* 查询危险源
|
|
@@ -90,7 +85,6 @@ public class LabHazardServiceImpl implements ILabHazardService {
|
|
|
labHazard.setDeptId(user.getDeptId());
|
|
labHazard.setDeptId(user.getDeptId());
|
|
|
labHazard.setDeptName(user.getDeptName());
|
|
labHazard.setDeptName(user.getDeptName());
|
|
|
int rows = labHazardMapper.insertLabHazard(labHazard);
|
|
int rows = labHazardMapper.insertLabHazard(labHazard);
|
|
|
- //insertLabHazardSubjectRelation(labHazard);
|
|
|
|
|
return rows;
|
|
return rows;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -109,7 +103,6 @@ public class LabHazardServiceImpl implements ILabHazardService {
|
|
|
labHazard.setUpdateTime(DateUtils.getNowDate());
|
|
labHazard.setUpdateTime(DateUtils.getNowDate());
|
|
|
labHazard.setUpdateBy(user.getNickName());
|
|
labHazard.setUpdateBy(user.getNickName());
|
|
|
|
|
|
|
|
- // insertLabHazardSubjectRelation(labHazard);
|
|
|
|
|
return labHazardMapper.updateLabHazard(labHazard);
|
|
return labHazardMapper.updateLabHazard(labHazard);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -147,7 +140,6 @@ public class LabHazardServiceImpl implements ILabHazardService {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // labHazardMapper.deleteLabHazardSubjectRelationByIds(ids);
|
|
|
|
|
return labHazardMapper.deleteLabHazardByIds(ids);
|
|
return labHazardMapper.deleteLabHazardByIds(ids);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -167,33 +159,11 @@ public class LabHazardServiceImpl implements ILabHazardService {
|
|
|
* 查询危险源
|
|
* 查询危险源
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
-// @DataScope(deptAlias = "d", userAlias = "u", permi = PerPrefix.LABORATORY_HAZARD)
|
|
|
|
|
public List<LabHazardDTO> selectLabHazardAndContainerList(LabHazardDTO labHazard) {
|
|
public List<LabHazardDTO> selectLabHazardAndContainerList(LabHazardDTO labHazard) {
|
|
|
List<LabHazardDTO> list = labHazardMapper.selectLabHazardAndContainerList(labHazard);
|
|
List<LabHazardDTO> list = labHazardMapper.selectLabHazardAndContainerList(labHazard);
|
|
|
return list;
|
|
return list;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 新增危险源和实验室关联信息
|
|
|
|
|
- *
|
|
|
|
|
- * @param labHazard 危险源对象
|
|
|
|
|
- */
|
|
|
|
|
- public void insertLabHazardSubjectRelation(LabHazard labHazard) {
|
|
|
|
|
- List<LabHazardSubjectRelation> labHazardSubjectRelationList = labHazard.getLabHazardSubjectRelationList();
|
|
|
|
|
- Long id = labHazard.getId();
|
|
|
|
|
- // 先删除
|
|
|
|
|
- labHazardMapper.deleteLabHazardSubjectRelationBy(labHazard.getId());
|
|
|
|
|
- if (StringUtils.isNotNull(labHazardSubjectRelationList)) {
|
|
|
|
|
- List<LabHazardSubjectRelation> list = new ArrayList<>();
|
|
|
|
|
- for (LabHazardSubjectRelation labHazardSubjectRelation : labHazardSubjectRelationList) {
|
|
|
|
|
- labHazardSubjectRelation.setHazardId(id);
|
|
|
|
|
- list.add(labHazardSubjectRelation);
|
|
|
|
|
- }
|
|
|
|
|
- if (list.size() > 0) {
|
|
|
|
|
- labHazardMapper.batchLabHazardSubjectRelation(list);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|