| | |
| | | import org.apache.commons.logging.LogFactory; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | Double allSize = 0d, allArea = 0d; |
| | | for (CountEntity ce : list) { |
| | | ce.setNo(rows++); |
| | | if (StringUtils.isEmpty(ce.getM2())) { |
| | | ce.setM2(FileHelper.getSizes(ce.getSizes())); |
| | | } |
| | | ce.setM3(FileHelper.getSquareMeter(ce.getArea())); |
| | | allCount += ce.getCount(); |
| | | allSize += ce.getSizes(); |
| | |
| | | ce.setNo(rows); |
| | | ce.setM1("总计"); |
| | | ce.setCount(allCount); |
| | | if (StringUtils.isEmpty(ce.getM2())) { |
| | | ce.setM2(FileHelper.getSizes(allSize)); |
| | | } |
| | | ce.setM3(FileHelper.getSquareMeter(allArea)); |
| | | list.add(ce); |
| | | } |
| | |
| | | private List<CountEntity> selectListByMethodName(ReportEntity re) { |
| | | List<CountEntity> list = null; |
| | | try { |
| | | Method method = ReportService.class.getDeclaredMethod(re.getCode(), ReportService.class); |
| | | Method method = ReportService.class.getDeclaredMethod(re.getCode()); |
| | | Object obj = method.invoke(this); |
| | | if (obj instanceof List<?>) { |
| | | list = (List<CountEntity>) obj; |