jiaosong
2023-09-19 7fc79e5c6c98fa7fe1e2279572251a45f0970c65
server/service/src/main/java/com/doumee/service/business/impl/BaseDataServiceImpl.java
@@ -20,6 +20,7 @@
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;
@@ -290,7 +291,19 @@
                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
@@ -301,6 +314,7 @@
    public static   boolean IS_RUNNING = false;
    @Override
    @Transactional
    @Async
    public   void dealBaseData() {
        if(IS_RUNNING){
            return;
@@ -394,7 +408,7 @@
        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])){