|
@@ -1,15 +1,20 @@
|
|
|
package cn.cslg.pas.service.business;
|
|
|
|
|
|
import cn.cslg.pas.common.dto.business.OtherReferencesDTO;
|
|
|
+import cn.cslg.pas.common.model.cronModel.Personnel;
|
|
|
import cn.cslg.pas.common.model.cronModel.PersonnelVO;
|
|
|
import cn.cslg.pas.common.utils.CacheUtils;
|
|
|
import cn.cslg.pas.common.utils.LoginUtils;
|
|
|
+import cn.cslg.pas.common.utils.StringUtils;
|
|
|
+import cn.cslg.pas.common.vo.business.LitigationHistoryVO;
|
|
|
+import cn.cslg.pas.common.vo.business.OtherReferencesVO;
|
|
|
import cn.cslg.pas.domain.business.AssoOtherReferencesFile;
|
|
|
import cn.cslg.pas.domain.business.LitigationHistory;
|
|
|
import cn.cslg.pas.domain.business.OtherReferences;
|
|
|
import cn.cslg.pas.exception.XiaoShiException;
|
|
|
import cn.cslg.pas.mapper.OtherReferencesMapper;
|
|
|
import cn.cslg.pas.service.permissions.PermissionService;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -17,8 +22,10 @@ import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.io.IOException;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* 其他参考资料
|
|
@@ -96,4 +103,70 @@ public class OtherReferencesService extends ServiceImpl<OtherReferencesMapper, O
|
|
|
}
|
|
|
return ids;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询
|
|
|
+ * @param patentNo
|
|
|
+ * @return
|
|
|
+ * @throws IOException
|
|
|
+ */
|
|
|
+ public List<OtherReferencesVO> getOtherReferences(String patentNo) throws IOException {
|
|
|
+ if (patentNo == null || StringUtils.isEmpty(patentNo)) {
|
|
|
+ throw new XiaoShiException("入参为空");
|
|
|
+ }
|
|
|
+ List<OtherReferencesVO> otherReferencesVOS = new ArrayList<>();
|
|
|
+ LambdaQueryWrapper<OtherReferences> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(OtherReferences::getPatentNo, patentNo);
|
|
|
+ List<OtherReferences> otherReferencesList = this.list(queryWrapper);
|
|
|
+
|
|
|
+ if (!otherReferencesList.isEmpty()) {
|
|
|
+ otherReferencesList.forEach(item -> {
|
|
|
+ OtherReferencesVO otherReferencesVO = new OtherReferencesVO();
|
|
|
+ BeanUtils.copyProperties(item, otherReferencesVO);
|
|
|
+ otherReferencesVOS.add(otherReferencesVO);
|
|
|
+ });
|
|
|
+ this.loadOtherReferencesVOS(otherReferencesVOS);
|
|
|
+ }
|
|
|
+ return otherReferencesVOS;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void loadOtherReferencesVOS(List<OtherReferencesVO> otherReferencesVOS) throws IOException {
|
|
|
+ List<String> createIds = new ArrayList<>();
|
|
|
+ otherReferencesVOS.forEach(item -> {
|
|
|
+ if (item.getCreateId() != null) {
|
|
|
+ createIds.add(item.getCreateId());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ List<Personnel> personnels = new ArrayList<>();
|
|
|
+ //查询发起人名称
|
|
|
+ if (createIds.size() != 0) {
|
|
|
+ String res = permissionService.getPersonnelByIdsFromPCS(createIds);
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(res);
|
|
|
+ personnels = JSONObject.parseArray(jsonObject.getString("data"), Personnel.class);
|
|
|
+ }
|
|
|
+ //装载信息
|
|
|
+ for (OtherReferencesVO otherReferencesVO : otherReferencesVOS) {
|
|
|
+ //装载人员信息
|
|
|
+ Personnel personnel = personnels.stream().filter(item -> item.getId().equals(otherReferencesVO.getCreateId())).findFirst().orElse(null);
|
|
|
+ if (personnel != null) {
|
|
|
+ otherReferencesVO.setCreateName(personnel.getPersonnelName());
|
|
|
+ }
|
|
|
+ LambdaQueryWrapper<AssoOtherReferencesFile> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(AssoOtherReferencesFile::getOtherReferencesId, otherReferencesVO.getId());
|
|
|
+ List<AssoOtherReferencesFile> assoOtherReferencesFiles = assoReferencesFileService.list(queryWrapper);
|
|
|
+ if (!assoOtherReferencesFiles.isEmpty()) {
|
|
|
+ List<String> fileGuids = assoOtherReferencesFiles.stream().map(AssoOtherReferencesFile::getFileGuid).collect(Collectors.toList());
|
|
|
+ otherReferencesVO.setFileGuids(fileGuids);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<Integer> deleteOtherReferences(List<Integer> ids) {
|
|
|
+ if (!ids.isEmpty()) {
|
|
|
+ this.removeBatchByIds(ids);
|
|
|
+ }
|
|
|
+ return ids;
|
|
|
+ }
|
|
|
+
|
|
|
}
|