Skip to content
Snippets Groups Projects
Commit 987af830 authored by wxy0715's avatar wxy0715
Browse files

修改排序

parent 843db7bd
Branches
No related merge requests found
Pipeline #100801 failed with stage
package com.seasky.projectplan.infrastructure.reader.prediction;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.seasky.core.base.AbstractService;
import com.seasky.core.common.Pagination;
import com.seasky.core.common.Result;
import com.seasky.core.util.ExceptionUtil;
import com.seasky.micro.basedata.api.IUser;
import com.seasky.microflowapi.api.IFlow;
import com.seasky.microflowapi.dto.BtnStatesOut;
import com.seasky.microflowapi.dto.FlowCanShowOut;
import com.seasky.projectplan.application.query.prediction.QueryYBInfoService;
import com.seasky.projectplan.domain.aggregate.common.AuditEnum;
import com.seasky.projectplan.domain.aggregate.common.PlanBookTypeEnum;
import com.seasky.projectplan.domain.aggregate.common.PlanTypeEnum;
import com.seasky.projectplan.domain.aggregate.common.flowTypeEnum;
import com.seasky.projectplan.dto.prediction.PredictionCacheOut;
......@@ -21,25 +20,25 @@ import com.seasky.projectplan.dto.projectplan.quotadeclaration.*;
import com.seasky.projectplan.dto.projectplan.rpc.PageSelectModel;
import com.seasky.projectplan.infrastructure.dataobject.co.YBExamineDo;
import com.seasky.projectplan.infrastructure.dataobject.co.YBHisInfoDo;
import com.seasky.projectplan.infrastructure.dataobject.po.PredictionKZMoneyPo;
import com.seasky.projectplan.infrastructure.dataobject.po.ProjectDetialPo;
import com.seasky.projectplan.infrastructure.dataobject.po.ProjectPlanBookPo;
import com.seasky.projectplan.infrastructure.dataobject.po.ProjectPo;
import com.seasky.projectplan.infrastructure.db.mapper.table.PredictionKZMoneyMapper;
import com.seasky.projectplan.infrastructure.db.mapper.table.ProjectDetialMapper;
import com.seasky.projectplan.infrastructure.db.mapper.table.ProjectMapper;
import com.seasky.projectplan.infrastructure.db.mapper.table.ProjectPlanBookMapper;
import com.seasky.projectplan.infrastructure.rpc.FlowRpc;
import com.seasky.projectplan.infrastructure.rpc.TripartiteRPC;
import com.seasky.projectplan.infrastructure.util.BaseDataUtil;
import net.sf.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.function.Function;
import java.util.stream.Collectors;
......@@ -387,7 +386,7 @@ public class QueryYBInfoServiceImpl extends AbstractService<ProjectPlanBookPo, P
pageSelectModel.setPageNO(1);
String s = JSONObject.toJSONString(pageSelectModel);
String info = tripartiteRPC.GetPojectBudgetData_arrival(s);
JSONArray jsonArray = JSONArray.fromObject(info);
JSONArray jsonArray = JSONArray.parseArray(info);
boolean flag = false;
for (int i = 0; i < jsonArray.size(); i++) {
String s1 = jsonArray.getJSONObject(i).get("projectCode").toString();
......
......@@ -23,6 +23,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.URLEncoder;
import java.text.Collator;
import java.util.*;
import java.util.stream.Collectors;
......@@ -97,7 +98,9 @@ public class PredictionQueryServiceImpl implements PredictionQueryService {
List<String> listToPageData = PageUtil.getListToPageData(predictionQry.getPageIndex(), predictionQry.getPageSize(), projectCodeList).getRecords();
predictionOutList = predictionOutList.stream()
.filter(item->listToPageData.contains(item.getProjectCode()))
.sorted(Comparator.comparing(PredictionCacheOut::getProjectCode).reversed()
.sorted(Comparator.comparing(PredictionCacheOut::getProjectCode)
.thenComparing(PredictionCacheOut::getDepartmentName,Collator.getInstance(java.util.Locale.CHINA)).reversed()
.thenComparing(PredictionCacheOut::getProjectName,Collator.getInstance(java.util.Locale.CHINA)).reversed()
.thenComparing(PredictionCacheOut::getSapCode)
.thenComparing(PredictionCacheOut::getSapKMCode)
)
......@@ -108,6 +111,7 @@ public class PredictionQueryServiceImpl implements PredictionQueryService {
return pagination;
}
/**
* 导出批量预拨数据
* @param key 预拨缓存key
......
package com.seasky.projectplan.infrastructure.rpc;
import com.alibaba.fastjson.JSONObject;
import com.seasky.core.common.Error;
import com.seasky.core.common.ResponseCode;
import com.seasky.core.exception.DataAccessException;
import net.sf.json.JSONObject;
import org.springframework.stereotype.Repository;
import java.io.*;
......@@ -66,7 +66,7 @@ public class ExternalInterfaceImpl implements ExternalInterface {
while ((str = br.readLine()) != null){
result.append(str);
}
JSONObject jsonObject=JSONObject.fromObject(result.toString());
JSONObject jsonObject= JSONObject.parseObject(result.toString());
if (!(boolean)jsonObject.get("isSuccess")){
errorMessage = jsonObject.get("errorMessage").toString();
throw new DataAccessException(new Error(ResponseCode.DATA_ACCESS_EXCEPTION, null, "访问外部接口错误: "+errorMessage, ""));
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment