天气预报 将1-6天的数据源和7-9天的数据源的信息匹配起来了 代码

简介:

晚上吃了晚饭,拿出两张大白纸,对照中国天气网和好天气网,写了两份图片和信息的对比表,主要匹配的是天气情况图片和文字的对应关系。


然后在程序里,解析的那块,做了一个匹配的IF ELSE处理。把这个问题大致解决了。


并且将JSON接口中的NULL值,和一些DNULL.GIF,NNULL.GIF的BUG都处理为不显示


我的核心思路如下,不晓得有没有更好地解决办法:


/*以下为第七天上午信息*/
				/*
				 * 以下为雨夹雪
				 */
				if(weather_title71.equals("雨或雪")) {
					weather_title71="雨夹雪";
					report[0].setImg1("06");
				}
				/*
				 * 以下为晴朗
				 */
				if(weather_title71.equals("晴")) {
					weather_title71="晴";
					report[0].setImg1("00");
				}
				if(weather_title71.equals("晴朗")) {
					weather_title71="晴";
					report[0].setImg1("00");
				}
			    if(weather_title71.equals("大部晴朗")) {
					weather_title71="晴";
					report[0].setImg1("00");
				}
			    
			    /*
			     * 以下为多云
			     */
			    if(weather_title71.equals("多云")) {
					weather_title71="多云";
					report[0].setImg1("01");
				}
			    if(weather_title71.equals("局部多云")) {
					weather_title71="多云";
					report[0].setImg1("01");
				}
			    if(weather_title71.equals("大部多云")) {
					weather_title71="多云";
					report[0].setImg1("01");
				}
			    if(weather_title71.equals("晴时多云")) {
					weather_title71="多云";
					report[0].setImg1("01");
				}
			    if(weather_title71.equals("早多云/晚转晴")) {
					weather_title71="多云";
					report[0].setImg1("01");
				}
			    if(weather_title71.equals("上午有云/下午后晴")) {
					weather_title71="多云";
					report[0].setImg1("01");
				}
			    
			    /*
			     * 以下为阵雨
			     */
			    if(weather_title71.equals("阵雨")) {
					weather_title71="阵雨";
					report[0].setImg1("03");
				}
			    if(weather_title71.equals("零星阵雨")) {
					weather_title71="阵雨";
					report[0].setImg1("03");
				}
			    if(weather_title71.equals("短暂阵雨")) {
					weather_title71="阵雨";
					report[0].setImg1("03");
				}
			    /*
			     * 以下为阵雪
			     */
			    if(weather_title71.equals("阵雪")) {
					weather_title71="阵雪";
					report[0].setImg1("13");
				}
			    if(weather_title71.equals("雨或阵雪")) {
					weather_title71="阵雪";
					report[0].setImg1("13");
				}
			    if(weather_title71.equals("短暂降雪")) {
			    	weather_title71="阵雪";
			    	report[0].setImg1("13");
			    }
			    if(weather_title71.equals("短暂阵雪")) {
			    	weather_title71="阵雪";
			    	report[0].setImg1("13");
			    }
			    if(weather_title71.equals("零星阵雪")) {
			    	weather_title71="阵雪";
			    	report[0].setImg1("13");
			    }

/*以下为第八天上午信息*/
			    /*
				 * 以下为雨夹雪
				 */
				if(weather_title81.equals("雨或雪")) {
					weather_title81="雨夹雪";
					report[1].setImg1("06");
				}
				/*
				 * 以下为晴朗
				 */
				if(weather_title81.equals("晴")) {
					weather_title81="晴";
					report[1].setImg1("00");
				}
				if(weather_title81.equals("晴朗")) {
					weather_title81="晴";
					report[1].setImg1("00");
				}
			    if(weather_title81.equals("大部晴朗")) {
					weather_title81="晴";
					report[1].setImg1("00");
				}
			    
			    /*
			     * 以下为多云
			     */
			    if(weather_title81.equals("多云")) {
					weather_title81="多云";
					report[1].setImg1("01");
				}
			    if(weather_title81.equals("局部多云")) {
					weather_title81="多云";
					report[1].setImg1("01");
				}
			    if(weather_title81.equals("大部多云")) {
					weather_title81="多云";
					report[1].setImg1("01");
				}
			    if(weather_title81.equals("晴时多云")) {
					weather_title81="多云";
					report[1].setImg1("01");
				}
			    if(weather_title81.equals("早多云/晚转晴")) {
					weather_title81="多云";
					report[1].setImg1("01");
				}
			    if(weather_title81.equals("上午有云/下午后晴")) {
					weather_title81="多云";
					report[1].setImg1("01");
				}
			    
			    /*
			     * 以下为阵雨
			     */
			    if(weather_title81.equals("阵雨")) {
					weather_title81="阵雨";
					report[1].setImg1("03");
				}
			    if(weather_title81.equals("零星阵雨")) {
					weather_title81="阵雨";
					report[1].setImg1("03");
				}
			    if(weather_title81.equals("短暂阵雨")) {
					weather_title81="阵雨";
					report[1].setImg1("03");
				}
			    /*
			     * 以下为阵雪
			     */
			    if(weather_title81.equals("阵雪")) {
					weather_title81="阵雪";
					report[1].setImg1("13");
				}
			    if(weather_title81.equals("雨或阵雪")) {
					weather_title81="阵雪";
					report[1].setImg1("13");
				}
			    if(weather_title81.equals("短暂降雪")) {
			    	weather_title81="阵雪";
			    	report[1].setImg1("13");
			    }
			    if(weather_title81.equals("短暂阵雪")) {
			    	weather_title81="阵雪";
			    	report[1].setImg1("13");
			    }
			    if(weather_title81.equals("零星阵雪")) {
			    	weather_title81="阵雪";
			    	report[1].setImg1("13");
			    }				
				
/*以下为第九天上午信息*/
			    /*
				 * 以下为雨夹雪
				 */
				if(weather_title91.equals("雨或雪")) {
					weather_title91="雨夹雪";
					report[2].setImg1("06");
				}
				/*
				 * 以下为晴朗
				 */
				if(weather_title91.equals("晴")) {
					weather_title91="晴";
					report[2].setImg1("00");
				}
				if(weather_title91.equals("晴朗")) {
					weather_title91="晴";
					report[2].setImg1("00");
				}
			    if(weather_title91.equals("大部晴朗")) {
					weather_title91="晴";
					report[2].setImg1("00");
				}
			    
			    /*
			     * 以下为多云
			     */
			    if(weather_title91.equals("多云")) {
					weather_title91="多云";
					report[2].setImg1("01");
				}
			    if(weather_title91.equals("局部多云")) {
					weather_title91="多云";
					report[2].setImg1("01");
				}
			    if(weather_title91.equals("大部多云")) {
					weather_title91="多云";
					report[2].setImg1("01");
				}
			    if(weather_title91.equals("晴时多云")) {
					weather_title91="多云";
					report[2].setImg1("01");
				}
			    if(weather_title91.equals("早多云/晚转晴")) {
					weather_title91="多云";
					report[2].setImg1("01");
				}
			    if(weather_title91.equals("上午有云/下午后晴")) {
					weather_title91="多云";
					report[2].setImg1("01");
				}
			    
			    /*
			     * 以下为阵雨
			     */
			    if(weather_title91.equals("阵雨")) {
					weather_title91="阵雨";
					report[2].setImg1("03");
				}
			    if(weather_title91.equals("零星阵雨")) {
					weather_title91="阵雨";
					report[2].setImg1("03");
				}
			    if(weather_title91.equals("短暂阵雨")) {
					weather_title91="阵雨";
					report[0].setImg1("03");
				}
			    /*
			     * 以下为阵雪
			     */
			    if(weather_title91.equals("阵雪")) {
					weather_title91="阵雪";
					report[2].setImg1("13");
				}
			    if(weather_title91.equals("雨或阵雪")) {
					weather_title91="阵雪";
					report[2].setImg1("13");
				}
			    if(weather_title91.equals("短暂降雪")) {
			    	weather_title91="阵雪";
			    	report[2].setImg1("13");
			    }
			    if(weather_title91.equals("短暂阵雪")) {
			    	weather_title91="阵雪";
			    	report[2].setImg1("13");
			    }
			    if(weather_title91.equals("零星阵雪")) {
			    	weather_title91="阵雪";
			    	report[2].setImg1("13");
			    }
				
/*以下是下午信息           
 * 
 *                                                                                                               
 *                                                                               
 *
 **/
/*以下为第七天下午信息*/
			    /*
				 * 以下为雨夹雪
				 */
				if(weather_title72.equals("雨或雪")) {
					weather_title72="雨夹雪";
					report[0].setImg2("06");
				}
				/*
				 * 以下为晴朗
				 */
				if(weather_title72.equals("晴")) {
					weather_title72="晴";
					report[0].setImg2("00");
				}
				if(weather_title72.equals("晴朗")) {
					weather_title72="晴";
					report[0].setImg2("00");
				}
			    if(weather_title72.equals("大部晴朗")) {
					weather_title72="晴";
					report[0].setImg2("00");
				}
			    
			    /*
			     * 以下为多云
			     */
			    if(weather_title72.equals("多云")) {
					weather_title72="多云";
					report[0].setImg2("01");
				}
			    if(weather_title72.equals("局部多云")) {
					weather_title72="多云";
					report[0].setImg2("01");
				}
			    if(weather_title72.equals("大部多云")) {
					weather_title72="多云";
					report[0].setImg2("01");
				}
			    if(weather_title72.equals("晴时多云")) {
					weather_title72="多云";
					report[0].setImg2("01");
				}
			    if(weather_title72.equals("早多云/晚转晴")) {
					weather_title72="晴";
					report[0].setImg2("00");
				}
			    if(weather_title72.equals("上午有云/下午后晴")) {
					weather_title72="晴";
					report[0].setImg2("00");
				}
			    
			    /*
			     * 以下为阵雨
			     */
			    if(weather_title72.equals("阵雨")) {
					weather_title72="阵雨";
					report[0].setImg2("03");
				}
			    if(weather_title72.equals("零星阵雨")) {
					weather_title72="阵雨";
					report[0].setImg2("03");
				}
			    if(weather_title72.equals("短暂阵雨")) {
					weather_title72="阵雨";
					report[0].setImg2("03");
				}
			    /*
			     * 以下为阵雪
			     */
			    if(weather_title72.equals("阵雪")) {
					weather_title72="阵雪";
					report[0].setImg2("13");
				}
			    if(weather_title72.equals("雨或阵雪")) {
					weather_title72="阵雪";
					report[0].setImg2("13");
				}
			    if(weather_title72.equals("短暂降雪")) {
			    	weather_title72="阵雪";
			    	report[0].setImg2("13");
			    }
			    if(weather_title72.equals("短暂阵雪")) {
			    	weather_title72="阵雪";
			    	report[0].setImg2("13");
			    }
			    if(weather_title72.equals("零星阵雪")) {
			    	weather_title72="阵雪";
			    	report[0].setImg2("13");
			    }

/*以下为第八天下午信息*/
			    /*
				 * 以下为雨夹雪
				 */
				if(weather_title82.equals("雨或雪")) {
					weather_title82="雨夹雪";
					report[1].setImg2("06");
				}
				/*
				 * 以下为晴朗
				 */
				if(weather_title82.equals("晴")) {
					weather_title82="晴";
					report[1].setImg2("00");
				}
				if(weather_title82.equals("晴朗")) {
					weather_title82="晴";
					report[1].setImg2("00");
				}
			    if(weather_title82.equals("大部晴朗")) {
					weather_title82="晴";
					report[1].setImg2("00");
				}
			    
			    /*
			     * 以下为多云
			     */
			    if(weather_title82.equals("多云")) {
					weather_title82="多云";
					report[1].setImg2("01");
				}
			    if(weather_title82.equals("局部多云")) {
					weather_title82="多云";
					report[1].setImg2("01");
				}
			    if(weather_title82.equals("大部多云")) {
					weather_title82="多云";
					report[1].setImg2("01");
				}
			    if(weather_title82.equals("晴时多云")) {
					weather_title82="多云";
					report[1].setImg2("01");
				}
			    if(weather_title82.equals("早多云/晚转晴")) {
					weather_title82="晴";
					report[1].setImg2("00");
				}
			    if(weather_title82.equals("上午有云/下午后晴")) {
					weather_title82="晴";
					report[1].setImg2("00");
				}
			    
			    /*
			     * 以下为阵雨
			     */
			    if(weather_title82.equals("阵雨")) {
					weather_title82="阵雨";
					report[1].setImg2("03");
				}
			    if(weather_title82.equals("零星阵雨")) {
					weather_title82="阵雨";
					report[1].setImg2("03");
				}
			    if(weather_title82.equals("短暂阵雨")) {
					weather_title82="阵雨";
					report[1].setImg2("03");
				}
			    /*
			     * 以下为阵雪
			     */
			    if(weather_title82.equals("阵雪")) {
					weather_title82="阵雪";
					report[1].setImg2("13");
				}
			    if(weather_title82.equals("雨或阵雪")) {
					weather_title82="阵雪";
					report[1].setImg2("13");
				}
			    if(weather_title82.equals("短暂降雪")) {
			    	weather_title82="阵雪";
			    	report[1].setImg2("13");
			    }
			    if(weather_title82.equals("短暂阵雪")) {
			    	weather_title82="阵雪";
			    	report[1].setImg2("13");
			    }
			    if(weather_title82.equals("零星阵雪")) {
			    	weather_title82="阵雪";
			    	report[1].setImg2("13");
			    }				
				
/*以下为第九天下午信息*/
			    /*
				 * 以下为雨夹雪
				 */
				if(weather_title92.equals("雨或雪")) {
					weather_title92="雨夹雪";
					report[2].setImg2("06");
				}
				/*
				 * 以下为晴朗
				 */
				if(weather_title92.equals("晴")) {
					weather_title92="晴";
					report[2].setImg2("00");
				}
				if(weather_title92.equals("晴朗")) {
					weather_title92="晴";
					report[2].setImg2("00");
				}
			    if(weather_title92.equals("大部晴朗")) {
					weather_title92="晴";
					report[2].setImg2("00");
				}
			    
			    /*
			     * 以下为多云
			     */
			    if(weather_title92.equals("多云")) {
					weather_title92="多云";
					report[2].setImg2("01");
				}
			    if(weather_title92.equals("局部多云")) {
					weather_title92="多云";
					report[2].setImg2("01");
				}
			    if(weather_title92.equals("大部多云")) {
					weather_title92="多云";
					report[2].setImg2("01");
				}
			    if(weather_title92.equals("晴时多云")) {
					weather_title92="多云";
					report[2].setImg2("01");
				}
			    if(weather_title92.equals("早多云/晚转晴")) {
					weather_title92="晴";
					report[2].setImg2("00");
				}
			    if(weather_title92.equals("上午有云/下午后晴")) {
					weather_title92="晴";
					report[2].setImg2("00");
				}
			    
			    /*
			     * 以下为阵雨
			     */
			    if(weather_title92.equals("阵雨")) {
					weather_title92="阵雨";
					report[2].setImg2("03");
				}
			    if(weather_title92.equals("零星阵雨")) {
					weather_title92="阵雨";
					report[2].setImg2("03");
				}
			    if(weather_title92.equals("短暂阵雨")) {
					weather_title92="阵雨";
					report[2].setImg2("03");
				}
			    /*
			     * 以下为阵雪
			     */
			    if(weather_title92.equals("阵雪")) {
					weather_title92="阵雪";
					report[2].setImg2("13");
				}
			    if(weather_title92.equals("雨或阵雪")) {
					weather_title92="阵雪";
					report[2].setImg2("13");
				}
			    if(weather_title92.equals("短暂降雪")) {
			    	weather_title92="阵雪";
			    	report[2].setImg2("13");
			    }
			    if(weather_title92.equals("短暂阵雪")) {
			    	weather_title92="阵雪";
			    	report[2].setImg2("13");
			    }
			    if(weather_title92.equals("零星阵雪")) {
			    	weather_title92="阵雪";
			    	report[2].setImg2("13");
			    }
			    


目录
相关文章
|
4月前
|
DataWorks 关系型数据库 MySQL
DataWorks数据源暂未绑定数据源,绑定时却显示已经有 1 个是什么回事?
DataWorks数据源暂未绑定数据源,绑定时却显示已经有 1 个是什么回事?
32 2
|
4月前
|
数据管理
宜搭流程中,数据管理批量发起如何成功导入 年-月-日 时:分格式数据 当前数据管理批量发起,Excel文本中编辑时间格式如2023-12-07 20:00,批量导入生成后显示为20231207 00:00,请问如何让时:分正确显示。
宜搭流程中,数据管理批量发起如何成功导入 年-月-日 时:分格式数据 当前数据管理批量发起,Excel文本中编辑时间格式如2023-12-07 20:00,批量导入生成后显示为20231207 00:00,请问如何让时:分正确显示。
61 2
|
4月前
|
运维 BI 调度
新增离线集成任务列表,支持快速筛选任务并进行批量操作 【V3.13】
离线集成任务列表提供了一个展示集成任务详细信息的页面,便于查看集成任务的各类信息。同时还支持根据任务的各类属性进行筛选。还支持根据来源与目标数据源或数据表进行任务的查找与筛选。便于在一些业务变更的时候,能快速筛选到所有任务,进行查看或批量修改的操作,提高开发与运维的效率。
|
9月前
|
JavaScript 数据可视化 搜索推荐
高德地图开发实战案例:使用Loca数据源展示海量点标注(海量点、自定义分类图标、聚合、信息提示、3D控件)
高德地图开发实战案例:使用Loca数据源展示海量点标注(海量点、自定义分类图标、聚合、信息提示、3D控件)
318 0
|
9月前
|
Java API Maven
Fink在处理DataHub数据源时无法正确识别RecordData类的字段
Fink在处理DataHub数据源时无法正确识别RecordData类的字段
77 1
|
10月前
|
JavaScript
阿里巴巴商品详情pachong数据字段解析 源代码分享 调用示例
阿里巴巴商品详情pachong数据字段解析 源代码分享 调用示例
|
11月前
|
Web App开发 人工智能 算法
为什么GNE 不做全自动提取列表页的功能
为什么GNE 不做全自动提取列表页的功能
78 0
|
开发者
【示例中心案例分享】表单中级联组件配置表单数据源
宜搭的级联组件不像下拉选择一样可配置关联其他选项,但是每次手动配置级联选项又很痛苦,我们如何借助宜搭的 OpenApi 去实现这个功能呢?我们的三方开发者 「苏灏」带来了他的案例。
392 1
“关联表单”组件文本数据筛选只支持包含条件的解决方案
在“关联表单”中使用数据筛选功能筛选文本时条件只有”包含“,此文章通过增加一个”下拉单选“组件,变相解决这个问题。
151 0
|
前端开发 JavaScript
数据工厂平台12:首页统计的数据关联(上)
数据工厂平台12:首页统计的数据关联(上)
数据工厂平台12:首页统计的数据关联(上)

热门文章

最新文章