package com.gkhy.safePlatform.doublePrevention.service.baseService.impl;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.gkhy.safePlatform.commons.enums.E;
|
import com.gkhy.safePlatform.commons.exception.AusinessException;
|
import com.gkhy.safePlatform.doublePrevention.entity.PreventReportRiskControlMeasure;
|
import com.gkhy.safePlatform.doublePrevention.entity.dto.report.req.PreventReportRiskControlMeasureReqDTO;
|
import com.gkhy.safePlatform.doublePrevention.repository.PreventReportRiskControlMeasureRepository;
|
import com.gkhy.safePlatform.doublePrevention.repository.param.HandlerReportParam;
|
import com.gkhy.safePlatform.doublePrevention.service.baseService.PreventReportRiskControlMeasureService;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
|
import java.util.List;
|
|
@Service("PreventReportRiskControlMeasureService")
|
public class PreventReportRiskControlMeasureServiceImpl
|
extends ServiceImpl<PreventReportRiskControlMeasureRepository, PreventReportRiskControlMeasure> implements PreventReportRiskControlMeasureService {
|
|
@Autowired
|
private PreventReportRiskControlMeasureRepository preventReportRiskControlMeasureRepository;
|
|
/**
|
* 批量插入
|
* */
|
@Override
|
public int insert(List<PreventReportRiskControlMeasure> measureLists) {
|
return preventReportRiskControlMeasureRepository.insertList(measureLists);
|
}
|
|
/**
|
* 上报数据-管控措施-分页查询
|
*/
|
@Override
|
public IPage<PreventReportRiskControlMeasure> getReportMeasurePage(Page<Object> objectPage, PreventReportRiskControlMeasureReqDTO queryReqDTO) {
|
return preventReportRiskControlMeasureRepository.getReportMeasurePage(objectPage, queryReqDTO);
|
}
|
/**
|
* 插入
|
* */
|
@Override
|
public int insertMeasureList(PreventReportRiskControlMeasure measure) {
|
int result = preventReportRiskControlMeasureRepository.insert(measure);
|
if (result < 1){
|
throw new AusinessException(E.ADD_FAIL, "保存风险单元失败");
|
}
|
return result;
|
}
|
|
/**
|
* 管控措施-上报数据
|
* */
|
@Override
|
public List<PreventReportRiskControlMeasure> listReportMeasureDate() {
|
return preventReportRiskControlMeasureRepository.listReportMeasureDate();
|
}
|
|
/**
|
* 管控措施-修改上报状态
|
* */
|
@Override
|
public void updateMeasureReportStatus(HandlerReportParam handlerReportParam) {
|
int result = preventReportRiskControlMeasureRepository.updateMeasureReportStatus(handlerReportParam);
|
if (result < 1){
|
throw new AusinessException(E.ADD_FAIL, "风险单元状态更新失败");
|
}
|
}
|
}
|