| | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | queryWrapper.orderByAsc(sortData.getProperty()); |
| | | } |
| | | } |
| | | return PageData.from(baseDataMapper.selectPage(page, queryWrapper)); |
| | | IPage<BaseData> result =baseDataMapper.selectPage(page, queryWrapper); |
| | | if(result!=null && result.getRecords()!=null){ |
| | | for(BaseData data :result.getRecords()){ |
| | | //多图,英文逗号隔开 |
| | | if(StringUtils.isNotBlank(data.getBgImg())){ |
| | | String tImg = data.getBgImg().replace(",", ",").replace(".avif", ""); |
| | | String[] imgs =tImg.split(","); |
| | | data.setBgImgs(imgs); |
| | | |
| | | } |
| | | } |
| | | } |
| | | return PageData.from(result); |
| | | } |
| | | |
| | | @Override |
| | |
| | | public static boolean IS_RUNNING = false; |
| | | @Override |
| | | @Transactional |
| | | @Async |
| | | public void dealBaseData() { |
| | | if(IS_RUNNING){ |
| | | return; |
| | |
| | | int i =0; |
| | | //多图,英文逗号隔开 |
| | | if(StringUtils.isNotBlank(data.getBgImg())){ |
| | | String tImg = data.getBgImg().replace(",", ","); |
| | | String tImg = data.getBgImg().replace(",", ",").replace(".avif", ""); |
| | | String[] imgs =tImg.split(","); |
| | | for (int j = 0; j < imgs.length; j++) { |
| | | if(StringUtils.isNotBlank(imgs[j])){ |