|
@@ -2,9 +2,11 @@ package cn.cslg.report.service.business.InvalidReReport;
|
|
|
|
|
|
import cn.cslg.report.common.model.dto.invalidReReport.ArgumentsScenarioDTO;
|
|
import cn.cslg.report.common.model.dto.invalidReReport.ArgumentsScenarioDTO;
|
|
import cn.cslg.report.common.utils.Response;
|
|
import cn.cslg.report.common.utils.Response;
|
|
|
|
+import cn.cslg.report.common.utils.SecurityUtils.LoginUtils;
|
|
import cn.cslg.report.entity.Template;
|
|
import cn.cslg.report.entity.Template;
|
|
import cn.cslg.report.entity.invalidReReport.Arguments;
|
|
import cn.cslg.report.entity.invalidReReport.Arguments;
|
|
import cn.cslg.report.entity.invalidReReport.ArgumentsScenarios;
|
|
import cn.cslg.report.entity.invalidReReport.ArgumentsScenarios;
|
|
|
|
+import cn.cslg.report.entity.invalidReReport.AssoArguments;
|
|
import cn.cslg.report.mapper.InvalidReReport.ArgumentsScenarioMapper;
|
|
import cn.cslg.report.mapper.InvalidReReport.ArgumentsScenarioMapper;
|
|
import cn.cslg.report.mapper.TemplateMapper;
|
|
import cn.cslg.report.mapper.TemplateMapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
@@ -13,6 +15,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
import org.springframework.context.annotation.Lazy;
|
|
import org.springframework.context.annotation.Lazy;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -25,19 +28,40 @@ import java.util.List;
|
|
@Slf4j
|
|
@Slf4j
|
|
@RequiredArgsConstructor(onConstructor_ = {@Lazy})
|
|
@RequiredArgsConstructor(onConstructor_ = {@Lazy})
|
|
public class ArgumentsScenarioService extends ServiceImpl<ArgumentsScenarioMapper, ArgumentsScenarios> {
|
|
public class ArgumentsScenarioService extends ServiceImpl<ArgumentsScenarioMapper, ArgumentsScenarios> {
|
|
|
|
+ private final LoginUtils loginUtils;
|
|
|
|
+ private final AssoArgumentsService assoArgumentsService;
|
|
//添加陈述意见方案
|
|
//添加陈述意见方案
|
|
public String addArgumentsScenario(ArgumentsScenarioDTO argumentsScenarioDTO) {
|
|
public String addArgumentsScenario(ArgumentsScenarioDTO argumentsScenarioDTO) {
|
|
- //判断argumentIds是否为空或者size=0
|
|
|
|
- //判断报告id和权要id是否传入
|
|
|
|
- //添加陈述意见方案
|
|
|
|
|
|
+ Integer loginId = loginUtils.getId();
|
|
|
|
+ List<Integer> argumentIds =argumentsScenarioDTO.getArgumentIds();
|
|
|
|
+ Integer reportId =argumentsScenarioDTO.getReportId();
|
|
|
|
+ Integer rightSort =argumentsScenarioDTO.getRightSort();
|
|
|
|
+ if(argumentIds==null||argumentIds.size()==0||reportId==null||rightSort==null){
|
|
|
|
+ return Response.error("请按要求输入参数");
|
|
|
|
+ }
|
|
|
|
+ ArgumentsScenarios argumentsScenarios =new ArgumentsScenarios();
|
|
|
|
+ BeanUtils.copyProperties(argumentsScenarioDTO,argumentsScenarios);
|
|
|
|
+ argumentsScenarios.setCreateId(loginId);
|
|
|
|
+ argumentsScenarios.insert();
|
|
//添加陈述意见方案和陈述意见关联关系
|
|
//添加陈述意见方案和陈述意见关联关系
|
|
-
|
|
|
|
-return "";
|
|
|
|
|
|
+ List<AssoArguments> assoArguments=new ArrayList<>();
|
|
|
|
+ argumentIds.forEach(item->{
|
|
|
|
+ AssoArguments assoArgument =new AssoArguments();
|
|
|
|
+ assoArgument.setArgumentId(item);
|
|
|
|
+ assoArgument.setCreateId(loginId);
|
|
|
|
+ assoArgument.setScenarioId(argumentsScenarios.getId());
|
|
|
|
+ assoArguments.add(assoArgument);
|
|
|
|
+ });
|
|
|
|
+ assoArgumentsService.saveBatch(assoArguments);
|
|
|
|
+return Response.success();
|
|
}
|
|
}
|
|
|
|
|
|
//删除陈述意见方案
|
|
//删除陈述意见方案
|
|
public String deleteArgumentsScenario(List<Integer> scenarioIds) {
|
|
public String deleteArgumentsScenario(List<Integer> scenarioIds) {
|
|
//若ids为空或者size=0则返回请至少选择一个方案进行删除
|
|
//若ids为空或者size=0则返回请至少选择一个方案进行删除
|
|
|
|
+ if(scenarioIds==null||scenarioIds.size()==0){
|
|
|
|
+ Response.error("请至少选择一个方案");
|
|
|
|
+ }
|
|
//根据陈述意见方案id批量删除陈述意见方案
|
|
//根据陈述意见方案id批量删除陈述意见方案
|
|
//根据陈述意见方案id批量删除陈述意见方案和陈述意见关联关系
|
|
//根据陈述意见方案id批量删除陈述意见方案和陈述意见关联关系
|
|
return "";
|
|
return "";
|