| | |
| | | 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; |
| | |
| | | */ |
| | | 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) { |
| | | 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++; |
| | | } |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | System.out.println(StringHelper.join(ids, ",")); |
| | | } |
| | | |
| | | return String.format("共处理了 %d 条记录", rows); |
| | | } |