Commit 65558931 authored by 廖旭伟's avatar 廖旭伟

用户收藏模块按收藏顺序展示

parent 987625c7
package com.mortals.xhx.module.user.web;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.RepeatSubmit;
import com.mortals.framework.exception.AppException;
......@@ -14,6 +15,7 @@ import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.pdu.ModelPdu;
import com.mortals.xhx.feign.model.IApiModelFeign;
import com.mortals.xhx.feign.model.vo.ModelFeignVO;
import com.mortals.xhx.feign.rsp.ApiResp;
import com.mortals.xhx.module.user.model.UserModelCollectEntity;
import com.mortals.xhx.module.user.service.UserModelCollectService;
......@@ -81,9 +83,22 @@ public class UserModelCollectController extends BaseCRUDJsonBodyMappingControlle
if (apiResp.getCode() != YesNoEnum.YES.getValue()) {
throw new AppException("获取站点列表信息失败:" + apiResp.getMsg());
}
try {
List<ModelFeignVO> modelFeignVOList = JSONArray.parseArray(JSONObject.toJSONString(apiResp.getData().get("data")), ModelFeignVO.class);
Map<Long,ModelFeignVO> map = new HashMap<>();
for (ModelFeignVO vo:modelFeignVOList){
map.put(vo.getId(),vo);
}
List<ModelFeignVO> result = new ArrayList<>();
for(Long id:idList){
result.add(map.get(id));
}
model.put("data", result);
}catch (Exception e){
model.put("data", apiResp.getData().get("data"));
}
}
}
model.put("message_info", busiDesc + "成功");
if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) {
this.recordSysLog(this.request, busiDesc + " 【成功】");
......
Markdown is supported
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