From f6e52bce9475f2602e963b6d24c1732aaaef9783 Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期五, 15 三月 2024 14:31:46 +0800 Subject: [PATCH] 修改统计方法、数据的精度 --- src/main/java/com/lf/server/controller/sys/ReportController.java | 50 ++++++++++++-------------------------------------- 1 files changed, 12 insertions(+), 38 deletions(-) diff --git a/src/main/java/com/lf/server/controller/sys/ReportController.java b/src/main/java/com/lf/server/controller/sys/ReportController.java index 1ac223a..c8e88ad 100644 --- a/src/main/java/com/lf/server/controller/sys/ReportController.java +++ b/src/main/java/com/lf/server/controller/sys/ReportController.java @@ -5,7 +5,6 @@ import com.lf.server.entity.all.ResponseMsg; import com.lf.server.entity.sys.ReportEntity; import com.lf.server.entity.sys.UserEntity; -import com.lf.server.helper.StringHelper; import com.lf.server.service.all.UploadAttachService; import com.lf.server.service.sys.ReportService; import com.lf.server.service.sys.TokenService; @@ -13,10 +12,10 @@ import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; +import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.List; @@ -29,13 +28,13 @@ @RestController @RequestMapping("/report") public class ReportController extends BaseController { - @Autowired + @Resource ReportService reportService; - @Autowired + @Resource TokenService tokenService; - @Autowired + @Resource UploadAttachService uploadAttachService; private final static String TAB_NAME = "lf.sys_report"; @@ -54,16 +53,16 @@ return fail("姣忛〉椤垫暟鎴栧垎椤垫暟灏忎簬1", null); } - int count = reportService.selectCount(name); + int count = reportService.selectCount(name, null); if (count == 0) { return success(0, null); } - List<ReportEntity> rs = reportService.selectByPage(name, pageSize, pageSize * (pageIndex - 1)); + List<ReportEntity> rs = reportService.selectByPage(name, null, pageSize, pageSize * (pageIndex - 1)); return success(count, rs); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } } @@ -79,7 +78,7 @@ return success(entity); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } } @@ -100,7 +99,7 @@ return success(count); } catch (Exception ex) { - return fail(ex.getMessage(), -1); + return fail(ex, -1); } } @@ -116,7 +115,7 @@ return success(count); } catch (Exception ex) { - return fail(ex.getMessage(), -1); + return fail(ex, -1); } } @@ -136,7 +135,7 @@ return success(count); } catch (Exception ex) { - return fail(ex.getMessage(), -1); + return fail(ex, -1); } } @@ -158,7 +157,7 @@ return success(count); } catch (Exception ex) { - return fail(ex.getMessage(), -1); + return fail(ex, -1); } } @@ -180,30 +179,5 @@ @GetMapping(value = "/download") public void download(String guid, HttpServletResponse res) { uploadAttachService.download(guid, res); - } - - @SysLog() - @ApiOperation(value = "涓嬭浇鎶ュ憡") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "鎶ュ憡ID", dataType = "Integer", paramType = "7") - }) - @GetMapping(value = "/downloadReport") - public void downloadReport(Integer id, HttpServletRequest req, HttpServletResponse res) { - try { - if (null == id || id < 1) { - return; - } - - ReportEntity re = reportService.selectById(id); - if (null == re || StringHelper.isEmpty(re.getGuid()) || StringHelper.isEmpty(re.getType()) || StringHelper.isEmpty(re.getCode())) { - return; - } - - UserEntity ue = tokenService.getCurrentUser(req); - - reportService.createReport(ue, re, res); - } catch (Exception ex) { - log.error(ex.getMessage(), ex); - } } } -- Gitblit v1.9.3