|
@@ -1,48 +1,55 @@
|
|
|
package cn.cslg.report.service.business;
|
|
|
|
|
|
+import cn.cslg.report.common.utils.DataUtils;
|
|
|
import cn.cslg.report.common.utils.Response;
|
|
|
import cn.cslg.report.entity.ImportTask;
|
|
|
import cn.cslg.report.entity.LitigationHistory;
|
|
|
+import cn.cslg.report.entity.Report;
|
|
|
import cn.cslg.report.mapper.ImportTaskMapper;
|
|
|
import cn.cslg.report.mapper.LitigationHistoryMapper;
|
|
|
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 lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import java.io.IOException;
|
|
|
+import java.util.List;
|
|
|
|
|
|
@Service
|
|
|
@Slf4j
|
|
|
@RequiredArgsConstructor(onConstructor_ = {@Lazy})
|
|
|
public class LitigationHistoryService extends ServiceImpl<LitigationHistoryMapper, LitigationHistory> {
|
|
|
public final LitigationHistoryMapper litigationHistoryMapper;
|
|
|
- public String deleteLitigationHistory(int id)throws IOException{
|
|
|
+ public String deleteLitigationHistory(int id){
|
|
|
this.removeById(id);
|
|
|
return Response.success();
|
|
|
|
|
|
}
|
|
|
- public String addLitigationHistory(LitigationHistory litigationHistory)throws IOException{
|
|
|
+ public String addLitigationHistory(LitigationHistory litigationHistory){
|
|
|
litigationHistory.insert();
|
|
|
return Response.success();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
- public String updateLitigationHistory(LitigationHistory litigationHistory)throws IOException{
|
|
|
+ public String updateLitigationHistory(LitigationHistory litigationHistory){
|
|
|
litigationHistory.updateById();
|
|
|
return Response.success();
|
|
|
|
|
|
}
|
|
|
- public String queryLitigationHistory(LitigationHistory litigationHistory)throws IOException{
|
|
|
+ public String queryLitigationHistory(LitigationHistory litigationHistory){
|
|
|
LambdaQueryWrapper<LitigationHistory> wrapper =new LambdaQueryWrapper<>();
|
|
|
wrapper.eq(LitigationHistory::getPatentNo,litigationHistory.getPatentNo());
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- return Response.success(this.list(wrapper));
|
|
|
-
|
|
|
+ if (litigationHistory.getSize() != null && litigationHistory.getSize() != null) {
|
|
|
+ IPage<LitigationHistory> pages = this.page(new Page<>(litigationHistory.getCurrent(), litigationHistory.getSize()), wrapper);
|
|
|
+ return Response.success(pages);
|
|
|
+ } else {
|
|
|
+ List<LitigationHistory> histories= this.list(wrapper);
|
|
|
+ return Response.success(histories);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|