|
@@ -0,0 +1,107 @@
|
|
|
+package cn.cslg.report.service.business.InvalidReReport;
|
|
|
+
|
|
|
+import cn.cslg.report.common.model.dto.ShareReportDTO;
|
|
|
+import cn.cslg.report.common.model.dto.invalidReReport.InvalidReasonDTO;
|
|
|
+import cn.cslg.report.common.utils.Response;
|
|
|
+import cn.cslg.report.entity.Template;
|
|
|
+import cn.cslg.report.entity.invalidReReport.InvalidReason;
|
|
|
+import cn.cslg.report.mapper.InvalidReReport.InvalidReasonMapper;
|
|
|
+import cn.cslg.report.mapper.TemplateMapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import io.swagger.v3.oas.annotations.Operation;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.context.annotation.Lazy;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+
|
|
|
+import java.io.IOException;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+
|
|
|
+@Service
|
|
|
+@Slf4j
|
|
|
+@RequiredArgsConstructor(onConstructor_ = {@Lazy})
|
|
|
+public class InvalidReasonService extends ServiceImpl<InvalidReasonMapper, InvalidReason> {
|
|
|
+ /**
|
|
|
+ * 添加无效理由和证据
|
|
|
+ * @param invalidReasonDTO 无效理由和证据Dto类
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public String addInvalidReason(InvalidReasonDTO invalidReasonDTO) {
|
|
|
+ //判断invalidName的类型
|
|
|
+ // 若类型为2,3则proofGroups不能为空,features不能为空
|
|
|
+
|
|
|
+ //复制DTO类字段到InvalidReason实体类并保存入库
|
|
|
+ //若类型为2,3根据proofGroups保存 proofGroup
|
|
|
+ //若类型为2,3检查features是否有交集(根据位置和字符串长度判断)若有则返回
|
|
|
+ //若类型为2,3根据features保存 Feature(标的专利号(根据报告id查询标的专利号),权要id(DTO类的content字段),特征内容,报告id)
|
|
|
+ //若类型为2,3根据features保存 feature和 invalidReson关联表(特征id,invalidReasonId,位置)
|
|
|
+ return Response.success();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param ids 无效理由id
|
|
|
+ * @return
|
|
|
+ * @throws IOException
|
|
|
+ */
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public String deleteInvalidReason(List<Integer> ids) {
|
|
|
+ //判断ids是否为空 ,为空则返回
|
|
|
+ //根据ids删除feature和 invalidReson关联表内容
|
|
|
+ //根据ids删除proofGroup表内容
|
|
|
+ //根据ids删除InvalidReason内容
|
|
|
+ return Response.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 更新无效理由和证据
|
|
|
+ * @param invalidReasonDTO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public String updateInvalidReason(@RequestBody InvalidReasonDTO invalidReasonDTO) {
|
|
|
+ //判断invalidName的类型
|
|
|
+ // 若类型为2,3则proofGroups不能为空,features不能为空
|
|
|
+ //复制DTO类字段到InvalidReason实体类并更新入库
|
|
|
+ //若类型为2,3根据proofGroups更新 proofGroup
|
|
|
+ //查询该无效应对报告的所有证据组合
|
|
|
+ //过滤出proofGroups的id,和无效应对报告的所有证据组合id作差,并且删除所有的差值证据组合
|
|
|
+ //若 proofGroups里的对象的id为空则直接插入
|
|
|
+ //若 proofGroups里的对象的id不为空则更新
|
|
|
+ //若类型为2,3检查features是否有交集(根据位置和字符串长度判断)若有则返回
|
|
|
+ //查询该无效应对报告的所有特征和无效理由关联记录
|
|
|
+ //过滤出features的id,和无效应对报告的所有特征和无效理由关联记录的特征id作差,并且删除所有的差值的特征和无效理由关联记录;
|
|
|
+ //若类型为2,3检查id为空的features和查出来的features以及本列表中的features是否有交集(根据位置和字符串长度判断)若有则抛出异常
|
|
|
+ //无则插入
|
|
|
+ return Response.success();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 更新无效理由和证据
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public String queryInvalidReason(int reportId) {
|
|
|
+ //根据报告id查询无效理由
|
|
|
+ ///若类型为2,3则查询证据组合和特征并装载
|
|
|
+ return Response.success();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ public String queryInvalidReasonDetail(@RequestBody ShareReportDTO shareReportDTO) throws IOException {
|
|
|
+ //根据报告id查询无效理由
|
|
|
+ ///若类型为2,3则查询证据组合和特征并装载
|
|
|
+ return Response.success();
|
|
|
+ }
|
|
|
+}
|