管道基础大数据平台系统开发-【后端】-Server
13693261870
2024-03-13 faf2f21a483e5b90bb15457f4edb37e37705aaee
修改计算数据接口
已修改1个文件
27 ■■■■■ 文件已修改
src/main/java/com/lf/server/service/show/OneMapService.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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,29 +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) {
            try {
                String rootPath = pathHelper.getConfig().getUploadPath();
                for (Map<String, Object> map : list) {
            String rootPath = pathHelper.getConfig().getUploadPath();
            for (Map<String, Object> map : list) {
                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()) {
                    if (!file.exists()) {
                        continue;
                    }
                    String str = fmeService.calcArea(sjfl, id, wjlj);
                    if (null != str) {
                        System.out.println(str);
                    String guid = fmeService.calcArea(sjfl, id, wjlj);
                    if (StringUtils.isEmpty(guid)) {
                        ids.add(guid);
                        rows++;
                    }
                    rows++;
                } catch (Exception ex) {
                    log.error(ex.getMessage(), ex);
                }
            } catch (Exception ex) {
                log.error(ex.getMessage(), ex);
            }
            System.out.println(StringHelper.join(ids, ","));
        }
        return String.format("共处理了 %d 条记录", rows);