Commit ef5922d8 authored by 赵啸非's avatar 赵啸非

添加首页统计报表

parent 33300799
package com.mortals.xhx.module.company.web;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.mortals.framework.common.Rest;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.module.company.model.vo.HomeStatInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.converter.json.JsonbHttpMessageConverter;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
......@@ -66,22 +69,22 @@ public class CompanyController extends BaseCRUDJsonBodyMappingController<Company
@PostMapping(value = "stat")
public String indexStat() {
JSONObject jsonObject = new JSONObject();
Map<String, Object> model = new HashMap<>();
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
jsonObject.put(KEY_RESULT_MSG, "");
try {
Rest<HomeStatInfo> rest = this.service.indexStat(getContext());
if (YesNoEnum.YES.getValue() == rest.getCode()) {
model.put("stat", rest.getData());
jsonObject.put(KEY_RESULT_DATA, rest.getData());
}
jsonObject.put(KEY_RESULT_DATA, model);
recordSysLog(request, "首页统计 【成功】");
} catch (Exception e) {
log.error("异常", e);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
jsonObject.put(KEY_RESULT_MSG, super.convertException(e));
}
return jsonObject.toJSONString();
return JSON.toJSONString(jsonObject, SerializerFeature.DisableCircularReferenceDetect);
}
......
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