管道基础大数据平台系统开发-【后端】-Server
13693261870
2024-03-13 fb4d9f5196471a7b202b3df69aaf9c8cf50b3377
src/main/java/com/lf/server/service/show/OneMapService.java
@@ -4,15 +4,15 @@
import com.lf.server.entity.ctrl.CountEntity;
import com.lf.server.entity.show.OneMapEntity;
import com.lf.server.helper.PathHelper;
import com.lf.server.helper.WebHelper;
import com.lf.server.helper.StringHelper;
import com.lf.server.mapper.show.OneMapMapper;
import com.lf.server.service.data.FmeService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
@@ -418,27 +418,32 @@
     */
    public String calcData() {
        Integer rows = selectLineBuffer();
        List<String> ids = new ArrayList<>();
        List<Map<String, Object>> list = selectMetaByType();
        if (null != list && list.size() > 0) {
            HttpServletRequest req = WebHelper.getRequest();
            String rootPath = pathHelper.getUploadFullPath();
            String rootPath = pathHelper.getConfig().getUploadPath();
            for (Map<String, Object> map : list) {
                String sjfl = map.get("type").toString();
                String id = map.get("id").toString();
                String wjlj = rootPath + File.separator + map.get("path").toString();
                try {
                    String sjfl = map.get("type").toString();
                    String id = map.get("id").toString();
                    String wjlj = rootPath + File.separator + map.get("path").toString();
                File file = new File(wjlj);
                if (!file.exists() || file.isDirectory()) {
                    continue;
                }
                    File file = new File(wjlj);
                    if (!file.exists()) {
                        continue;
                    }
                String str = fmeService.calcArea(sjfl, id, wjlj, req);
                if (null != str) {
                    System.out.println(str);
                    String guid = fmeService.calcArea(sjfl, id, wjlj);
                    if (!StringUtils.isEmpty(guid)) {
                        ids.add(map.get("id").toString());
                        rows++;
                    }
                } catch (Exception ex) {
                    log.error(ex.getMessage(), ex);
                }
                rows++;
            }
            log.info(StringHelper.join(ids, ","));
        }
        return String.format("共处理了 %d 条记录", rows);