public Map<String, Object> queryReportingMonth() { Map<String, Object> map = new HashMap<>(3); map.put("month", null); String deptId = SecurityUtils.getUser().getDeptId(); ConstructionProgress one = baseMapper.selectOne(Wrappers.lambdaQuery() .eq(ConstructionProgress::getReportingUnit, deptId) .orderByDesc(ConstructionProgress::getReportDate) .last("LIMIT 1")); if (one != null) { Date reportDate = one.getReportDate(); if (reportDate != null && DateUtil.compare(reportDate, DateUtil.parseDate("2023-06-01"), "yyyy-MM") < 0) { map.put("month", "2023-06"); return map; } if (DictEnum.GENERATE_STATUS_AUDITED.getValue().equals(one.getApprovalStatus()) && reportDate.before(new Date())) { reportDate = DateUtil.offsetMonth(reportDate, 1); } map.put("month", DateUtil.format(reportDate, DatePattern.NORM_MONTH_PATTERN)); } return map;

优化一下代码:public MapString Object queryReportingMonth 		MapString Object map = new HashMap3;		mapputmonth null;		ConstructionProgress one = baseMapperselectOneWrappersConstructionProgresslambdaQuery				e

原文地址: https://www.cveoy.top/t/topic/fG9X 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录