| | |
| | | import com.lf.server.service.all.ScheduleService; |
| | | import com.lf.server.service.all.WebSocketService; |
| | | import com.lf.server.service.show.AutoQueryService; |
| | | import com.lf.server.service.show.OneMapService; |
| | | import com.lf.server.service.sys.AttachService; |
| | | import org.apache.commons.logging.Log; |
| | | import org.apache.commons.logging.LogFactory; |
| | | import org.apache.ibatis.annotations.Result; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | @Resource |
| | | AutoQueryService autoQueryService; |
| | | |
| | | @Resource |
| | | OneMapService oneMapService; |
| | | |
| | | private static boolean isBusy = false; |
| | | |
| | | private static final Log log = LogFactory.getLog(ScheduleConfig.class); |
| | |
| | | autoQueryService.autoQuery(); |
| | | } |
| | | |
| | | @Scheduled(cron = "0 0 2 * * ?") |
| | | public void calcData() { |
| | | oneMapService.calcData(); |
| | | } |
| | | |
| | | @Scheduled(fixedRate = 15 * 1000) |
| | | public void pushMonitorInfo() { |
| | | try { |
| | |
| | | return fail(ex.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询计算数据") |
| | | @GetMapping("/selectCalcData") |
| | | public ResponseMsg<Object> selectCalcData(){ |
| | | try { |
| | | String rs = oneMapService.calcData(); |
| | | |
| | | return success(rs); |
| | | }catch (Exception ex){ |
| | | log.error(ex.getMessage(), ex); |
| | | return fail(ex.getMessage()); |
| | | } |
| | | } |
| | | } |
| | |
| | | /** |
| | | * f.计算面积 |
| | | */ |
| | | public String calcArea(String sjfl, String id, String wjlj, HttpServletRequest req) { |
| | | String url = getUrl("datax/task/run/数据占地面积计算", req); |
| | | public String calcArea(String sjfl, String id, String wjlj) { |
| | | String url = getUrl("datax/task/run/数据占地面积计算"); |
| | | |
| | | List<NameValueEntity> list = new ArrayList<>(); |
| | | list.add(new NameValueEntity("_name", String.format("%s_%s", "数据占地面积计算", StringHelper.YMDHMS2_FORMAT.format(new Date())))); |
| | |
| | | */ |
| | | public String calcData() { |
| | | Integer rows = selectLineBuffer(); |
| | | |
| | | List<Map<String, Object>> list = selectMetaByType(); |
| | | if (null != list && list.size() > 0) { |
| | | HttpServletRequest req = WebHelper.getRequest(); |
| | | String rootPath = pathHelper.getUploadFullPath(); |
| | | try { |
| | | String rootPath = pathHelper.getConfig().getUploadPath(); |
| | | for (Map<String, Object> map : list) { |
| | | String sjfl = map.get("type").toString(); |
| | | String id = map.get("id").toString(); |
| | |
| | | continue; |
| | | } |
| | | |
| | | String str = fmeService.calcArea(sjfl, id, wjlj, req); |
| | | String str = fmeService.calcArea(sjfl, id, wjlj); |
| | | if (null != str) { |
| | | System.out.println(str); |
| | | } |
| | | rows++; |
| | | } |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | |
| | | return String.format("共处理了 %d 条记录", rows); |