|
@@ -35,8 +35,8 @@ import java.util.stream.Collectors;
|
|
|
@RequiredArgsConstructor(onConstructor_ = {@Lazy})
|
|
|
@SuppressWarnings({"all"})
|
|
|
public class AssoTaskPersonelService extends ServiceImpl<AssoTaskPersonelMapper, AssoTaskPersonel> {
|
|
|
- private final AssoTaskPersonelMapper assoTaskPersonelMapper ;
|
|
|
- private final OutInterfaceService outInterfaceService;
|
|
|
+ private final AssoTaskPersonelMapper assoTaskPersonelMapper;
|
|
|
+ private final OutInterfaceService outInterfaceService;
|
|
|
public static final MediaType JSON = MediaType.parse("application/json; charset=utf-8");
|
|
|
@Value("${PCSUrl}")
|
|
|
private String PCSUrl;
|
|
@@ -44,32 +44,32 @@ public class AssoTaskPersonelService extends ServiceImpl<AssoTaskPersonelMapper,
|
|
|
private String PASUrl;
|
|
|
|
|
|
|
|
|
-
|
|
|
- public void test(){}
|
|
|
+ public void test() {
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
- * @function 根据报告id 删除任务人员关联表对应实体assoTaskPersonel
|
|
|
* @param reportId
|
|
|
* @return
|
|
|
* @throws IOException
|
|
|
+ * @function 根据报告id 删除任务人员关联表对应实体assoTaskPersonel
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public String deleAssoTaskPersonel(Integer reportId) throws IOException{
|
|
|
- LambdaQueryWrapper<AssoTaskPersonel> wrappers =new LambdaQueryWrapper();
|
|
|
- wrappers.eq(AssoTaskPersonel::getReportId,reportId);
|
|
|
- this.remove(wrappers);
|
|
|
+ public String deleAssoTaskPersonel(Integer reportId) throws IOException {
|
|
|
+ LambdaQueryWrapper<AssoTaskPersonel> wrappers = new LambdaQueryWrapper();
|
|
|
+ wrappers.eq(AssoTaskPersonel::getReportId, reportId);
|
|
|
+ this.remove(wrappers);
|
|
|
return Response.success();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @function:当前登陆人的id状态 任务id 状态 该条专利位置分页处理拿到专利号
|
|
|
* @param personelId当前登录人的id
|
|
|
- * @param state 状态 1已读 0 未读 3 全部
|
|
|
- * @param taskId 任务id
|
|
|
- * @param location 该条专利位置
|
|
|
+ * @param state 状态 1已读 0 未读 3 全部
|
|
|
+ * @param taskId 任务id
|
|
|
+ * @param location 该条专利位置
|
|
|
* @throws IOException
|
|
|
+ * @function:当前登陆人的id状态 任务id 状态 该条专利位置分页处理拿到专利号
|
|
|
*/
|
|
|
- public String pagination(PatentVO patentVO)throws IOException {
|
|
|
+ public String pagination(PatentVO patentVO) throws IOException {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
List<String> patentNumber = new ArrayList<>();
|
|
|
if (patentVO.getTaskStatus().equals(3)) {
|
|
@@ -100,44 +100,44 @@ public class AssoTaskPersonelService extends ServiceImpl<AssoTaskPersonelMapper,
|
|
|
JSONObject jsonObject = JSONObject.parseObject(res);
|
|
|
JSONObject jsonObject1 = JSONObject.parseObject(jsonObject.get("data").toString());
|
|
|
List<JSONObject> jsonObjects = JSONArray.parseArray(jsonObject1.get("records").toString(), JSONObject.class);
|
|
|
- List<Patents> list= new ArrayList<>();
|
|
|
+ List<Patents> list = new ArrayList<>();
|
|
|
|
|
|
- for(JSONObject obj:jsonObjects){
|
|
|
+ for (JSONObject obj : jsonObjects) {
|
|
|
|
|
|
- Patents patent = obj.toJavaObject(obj, Patents.class);
|
|
|
- list.add(patent);
|
|
|
+ Patents patent = obj.toJavaObject(obj, Patents.class);
|
|
|
+ list.add(patent);
|
|
|
|
|
|
- }
|
|
|
- if(list.size()==0){
|
|
|
+ }
|
|
|
+ if (list.size() == 0) {
|
|
|
|
|
|
return Response.success();
|
|
|
}
|
|
|
|
|
|
- if(list.size()==1){
|
|
|
- map.put("currentID", list.get(0).getId());
|
|
|
- map.put("behindID",null);
|
|
|
- map.put("frontID", null);
|
|
|
- map.put("totalNumber" , list.size());
|
|
|
- map.put("frontPatentNo",null);
|
|
|
- map.put("currentPatentNo",list.get(0).getPatentNo());
|
|
|
- map.put("behindPatentNo",null);
|
|
|
- map.put("frontNumber",0);
|
|
|
- map.put("behindNumber",0);
|
|
|
- return Response.success(map);
|
|
|
+ if (list.size() == 1) {
|
|
|
+ map.put("currentID", list.get(0).getId());
|
|
|
+ map.put("behindID", null);
|
|
|
+ map.put("frontID", null);
|
|
|
+ map.put("totalNumber", list.size());
|
|
|
+ map.put("frontPatentNo", null);
|
|
|
+ map.put("currentPatentNo", list.get(0).getPatentNo());
|
|
|
+ map.put("behindPatentNo", null);
|
|
|
+ map.put("frontNumber", 0);
|
|
|
+ map.put("behindNumber", 0);
|
|
|
+ return Response.success(map);
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
jsonObject1.put("type", "first");
|
|
|
map.put("currentID", list.get(0).getId());
|
|
|
- map.put("behindID",list.get(1).getId());
|
|
|
+ map.put("behindID", list.get(1).getId());
|
|
|
map.put("frontID", null);
|
|
|
- map.put("totalNumber" , list.size());
|
|
|
- map.put("frontNumber",0);
|
|
|
- map.put("behindNumber",list.size()-1);
|
|
|
- map.put("location",1);
|
|
|
- map.put("frontPatentNo",null);
|
|
|
- map.put("currentPatentNo",list.get(0).getPatentNo());
|
|
|
- map.put("behindPatentNo",list.get(1).getPatentNo());
|
|
|
- return Response.success(map);
|
|
|
+ map.put("totalNumber", list.size());
|
|
|
+ map.put("frontNumber", 0);
|
|
|
+ map.put("behindNumber", list.size() - 1);
|
|
|
+ map.put("location", 1);
|
|
|
+ map.put("frontPatentNo", null);
|
|
|
+ map.put("currentPatentNo", list.get(0).getPatentNo());
|
|
|
+ map.put("behindPatentNo", list.get(1).getPatentNo());
|
|
|
+ return Response.success(map);
|
|
|
} else {
|
|
|
patentVO.setStartNumber(patentVO.getLocPosition() - 2);
|
|
|
patentVO.setEndNumber(patentVO.getLocPosition());
|
|
@@ -145,50 +145,50 @@ public class AssoTaskPersonelService extends ServiceImpl<AssoTaskPersonelMapper,
|
|
|
JSONObject jsonObject = JSONObject.parseObject(res);
|
|
|
JSONObject jsonObject1 = JSONObject.parseObject(jsonObject.get("data").toString());
|
|
|
List<JSONObject> jsonObjects = JSONArray.parseArray(jsonObject1.get("records").toString(), JSONObject.class);
|
|
|
- List<Patents> list= new ArrayList<>();
|
|
|
- for(JSONObject obj:jsonObjects){
|
|
|
+ List<Patents> list = new ArrayList<>();
|
|
|
+ for (JSONObject obj : jsonObjects) {
|
|
|
Patents patent = obj.toJavaObject(obj, Patents.class);
|
|
|
list.add(patent);
|
|
|
|
|
|
}
|
|
|
|
|
|
- if(list.size()==1){
|
|
|
+ if (list.size() == 1) {
|
|
|
map.put("currentID", list.get(0).getId());
|
|
|
- map.put("behindID",null);
|
|
|
+ map.put("behindID", null);
|
|
|
map.put("frontID", null);
|
|
|
- map.put("totalNumber" , list.size());
|
|
|
- map.put("frontPatentNo",null);
|
|
|
- map.put("currentPatentNo",list.get(0).getPatentNo());
|
|
|
- map.put("behindPatentNo",null);
|
|
|
- map.put("frontNumber",0);
|
|
|
- map.put("behindNumber",0);
|
|
|
- return Response.success(map);
|
|
|
+ map.put("totalNumber", list.size());
|
|
|
+ map.put("frontPatentNo", null);
|
|
|
+ map.put("currentPatentNo", list.get(0).getPatentNo());
|
|
|
+ map.put("behindPatentNo", null);
|
|
|
+ map.put("frontNumber", 0);
|
|
|
+ map.put("behindNumber", 0);
|
|
|
+ return Response.success(map);
|
|
|
|
|
|
}
|
|
|
- if(patentVO.getLocPosition()>=list.size()) {
|
|
|
- map.put("currentID", list.get(list.size()-1).getId());
|
|
|
- map.put("behindID",null);
|
|
|
- map.put("frontID",list.get(list.size()-2).getId());
|
|
|
- map.put("totalNumber" , list.size());
|
|
|
- map.put("frontNumber",list.size()-1);
|
|
|
- map.put("behindNumber",0);
|
|
|
- map.put("location",list.size());
|
|
|
- map.put("frontPatentNo",list.get(list.size()-2).getPatentNo());
|
|
|
- map.put("currentPatentNo",list.get(list.size()-1).getPatentNo());
|
|
|
- map.put("behindPatentNo",null);
|
|
|
- return Response.success(map);
|
|
|
+ if (patentVO.getLocPosition() >= list.size()) {
|
|
|
+ map.put("currentID", list.get(list.size() - 1).getId());
|
|
|
+ map.put("behindID", null);
|
|
|
+ map.put("frontID", list.get(list.size() - 2).getId());
|
|
|
+ map.put("totalNumber", list.size());
|
|
|
+ map.put("frontNumber", list.size() - 1);
|
|
|
+ map.put("behindNumber", 0);
|
|
|
+ map.put("location", list.size());
|
|
|
+ map.put("frontPatentNo", list.get(list.size() - 2).getPatentNo());
|
|
|
+ map.put("currentPatentNo", list.get(list.size() - 1).getPatentNo());
|
|
|
+ map.put("behindPatentNo", null);
|
|
|
+ return Response.success(map);
|
|
|
}
|
|
|
- map.put("currentID", list.get(patentVO.getLocPosition()-1).getId());
|
|
|
- map.put("behindID",list.get(patentVO.getLocPosition()).getId());
|
|
|
- map.put("frontID",list.get(patentVO.getLocPosition()-2).getId());
|
|
|
- map.put("totalNumber" , list.size());
|
|
|
- map.put("frontNumber",patentVO.getLocPosition()-1);
|
|
|
- map.put("behindNumber", list.size()-patentVO.getLocPosition());
|
|
|
- map.put("location",patentVO.getLocPosition());
|
|
|
- map.put("frontPatentNo",list.get(patentVO.getLocPosition()-2).getPatentNo());
|
|
|
- map.put("currentPatentNo",list.get(patentVO.getLocPosition()-1).getPatentNo());
|
|
|
- map.put("behindPatentNo",list.get(patentVO.getLocPosition()).getPatentNo());
|
|
|
- return Response.success(map);
|
|
|
+ map.put("currentID", list.get(patentVO.getLocPosition() - 1).getId());
|
|
|
+ map.put("behindID", list.get(patentVO.getLocPosition()).getId());
|
|
|
+ map.put("frontID", list.get(patentVO.getLocPosition() - 2).getId());
|
|
|
+ map.put("totalNumber", list.size());
|
|
|
+ map.put("frontNumber", patentVO.getLocPosition() - 1);
|
|
|
+ map.put("behindNumber", list.size() - patentVO.getLocPosition());
|
|
|
+ map.put("location", patentVO.getLocPosition());
|
|
|
+ map.put("frontPatentNo", list.get(patentVO.getLocPosition() - 2).getPatentNo());
|
|
|
+ map.put("currentPatentNo", list.get(patentVO.getLocPosition() - 1).getPatentNo());
|
|
|
+ map.put("behindPatentNo", list.get(patentVO.getLocPosition()).getPatentNo());
|
|
|
+ return Response.success(map);
|
|
|
|
|
|
|
|
|
}
|