| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import java.math.BigDecimal; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | |
| | | List<StatisticsPriceVO> statisticsPieBar =baseMapper.getStatisticsPieBars(statisticsParams); |
| | | return statisticsPieBar; |
| | | } |
| | | |
| | | @Override |
| | | public void updateallcheck() throws ParseException { |
| | | Date now = new Date(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String today = sdf.format(now); |
| | | |
| | | // 转换为年月格式,用于检查是否为月初 |
| | | String yearMonth = sdf.format(sdf.parse(today).getTime()).substring(0, 7); |
| | | // 检查当前日期是否为月初 |
| | | if (today.startsWith(yearMonth + "-01")) { |
| | | baseMapper.updateallcheck(); |
| | | } else { |
| | | System.out.println("不是月初,不予修改状态"); |
| | | } |
| | | |
| | | } |
| | | } |