Commit bbf58d98 authored by tangwei's avatar tangwei

序列化

parent 37f34095
...@@ -10,6 +10,7 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController; ...@@ -10,6 +10,7 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertFormService; import com.yeejoin.amos.boot.module.jcs.api.service.IAlertFormService;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertFormVo; import com.yeejoin.amos.boot.module.jcs.api.vo.AlertFormVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.FormList; import com.yeejoin.amos.boot.module.jcs.api.vo.FormList;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
...@@ -23,6 +24,8 @@ import com.yeejoin.amos.boot.biz.common.utils.NameUtils; ...@@ -23,6 +24,8 @@ import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
...@@ -108,7 +111,7 @@ public class AlertFormController extends BaseController { ...@@ -108,7 +111,7 @@ public class AlertFormController extends BaseController {
@RequestMapping(value = "/form/{code}", method = RequestMethod.GET) @RequestMapping(value = "/form/{code}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据表态类型code查询表单数据项", notes = "根据表态类型code查询表单数据项") @ApiOperation(httpMethod = "GET", value = "根据表态类型code查询表单数据项", notes = "根据表态类型code查询表单数据项")
public ResponseModel selectFormdItem(HttpServletRequest request, @PathVariable String code){ public ResponseModel selectFormdItem(HttpServletRequest request, @PathVariable String code){
List<AlertFormVo> list=null; List<AlertFormVo> list=new ArrayList<AlertFormVo>();
if(redisUtils.hasKey("form_"+code)){ if(redisUtils.hasKey("form_"+code)){
Object obj= redisUtils.get("form_"+code); Object obj= redisUtils.get("form_"+code);
return CommonResponseUtil.success(obj); return CommonResponseUtil.success(obj);
...@@ -118,7 +121,7 @@ public class AlertFormController extends BaseController { ...@@ -118,7 +121,7 @@ public class AlertFormController extends BaseController {
//警情动态表单数据 //警情动态表单数据
List<AlertForm> alertFormValue = iAlertFormService.list(queryWrapper); List<AlertForm> alertFormValue = iAlertFormService.list(queryWrapper);
list= FormList.getFormlist(alertFormValue); list= FormList.getFormlist(alertFormValue);
redisUtils.set("form_"+code,list,86400); redisUtils.set("form_"+code,JSON.toJSON(list),86400);
return CommonResponseUtil.success(list); return CommonResponseUtil.success(list);
} }
} }
......
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