| | |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.doublePrevention.entity.PreventRiskCheckUnit; |
| | | import com.ruoyi.doublePrevention.enums.ErrorCodes; |
| | | import com.ruoyi.doublePrevention.repository.PreventRiskCheckUnitRepository; |
| | | import com.ruoyi.doublePrevention.service.baseService.PreventRiskCheckUnitService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.project.tr.baseCheckPoint.mapper.BaseCheckPointMapper; |
| | | import com.ruoyi.project.tr.baseCheckPoint.domain.BaseCheckPoint; |
| | | import com.ruoyi.project.tr.baseCheckPoint.service.IBaseCheckPointService; |
| | | import com.ruoyi.common.utils.text.Convert; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * 基础清单检查点Service业务层处理 |
| | |
| | | { |
| | | @Autowired |
| | | private BaseCheckPointMapper baseCheckPointMapper; |
| | | |
| | | @Autowired |
| | | private PreventRiskCheckUnitRepository riskCheckUnitRepository; |
| | | |
| | | /** |
| | | * 查询基础清单检查点 |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public int updateBaseCheckPoint(BaseCheckPoint baseCheckPoint) |
| | | { |
| | | baseCheckPoint.setUpdateTime(DateUtils.getNowDate()); |
| | | return baseCheckPointMapper.updateBaseCheckPoint(baseCheckPoint); |
| | | baseCheckPointMapper.updateBaseCheckPoint(baseCheckPoint); |
| | | |
| | | //todo-2022 对措施与检查点关联的措施id进行修改 |
| | | PreventRiskCheckUnit riskCheckUnit = riskCheckUnitRepository.getPointAndMeasureByPointId(baseCheckPoint.getCheckPointId()); |
| | | if (riskCheckUnit == null){ |
| | | throw new RuntimeException("查询不到对应的措施"); |
| | | } |
| | | |
| | | riskCheckUnit.setControlMeasureId(baseCheckPoint.getControlMeasureId()); |
| | | int riskCheckUnitUpdateResult = riskCheckUnitRepository.updateRiskCheckUnitById(riskCheckUnit); |
| | | return riskCheckUnitUpdateResult; |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public int deleteBaseCheckPointByIds(String ids) |
| | | { |
| | | return baseCheckPointMapper.deleteBaseCheckPointByIds(Convert.toStrArray(ids)); |
| | | baseCheckPointMapper.deleteBaseCheckPointByIds(Convert.toStrArray(ids)); |
| | | |
| | | //todo-2022 对措施与检查点关联的表根据原检查点id进行批量删除 |
| | | int deletePointAndMeasureResult = riskCheckUnitRepository.deleteRiskCheckUnitByCheckPointIds(Convert.toStrArray(ids)); |
| | | return deletePointAndMeasureResult; |
| | | } |
| | | |
| | | /** |