解决流量统计app趋势中app名称特殊符号跟国际化标签写法的冲突bug

This commit is contained in:
dongxiaoyan
2019-02-27 17:43:54 +08:00
parent 322e5ba8a8
commit e98c8f2f2a
3 changed files with 26 additions and 11 deletions

View File

@@ -464,7 +464,7 @@ public class TrafficStatisticsInfoController extends BaseController {
* App趋势界面 独立IP访问数量趋势图
*/
@RequestMapping(value="appTrendList")
public String appTrendList(Model model,String beginDate,String endDate,String appName,Integer appType,Integer entranceId){
public String appTrendList(Model model,String beginDate,String endDate,Integer appType,Integer entranceId){
if(StringUtil.isBlank(beginDate)||StringUtil.isBlank(endDate)){
Calendar cal = Calendar. getInstance ();
cal.setTime(new Date());
@@ -472,6 +472,20 @@ public class TrafficStatisticsInfoController extends BaseController {
cal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY) - 2);
beginDate = new SimpleDateFormat( "yyyy-MM-dd HH:mm:00" ).format(cal.getTime());
}
//标签集合
List<CodeResult> codeList = CodeDicUtils.getCodeList("appCode");
//将数字替换为标签文字
String appName="";
if(appType!=null){
Double value1 = Double.valueOf(appType);
for (CodeResult code : codeList) {
Double value2 = Double.valueOf(code.getCode().trim());
if(value1.equals(value2)){
appName= code.getItem().trim();
break;
}
}
}
model.addAttribute("appName", appName);
model.addAttribute("appType", appType);
model.addAttribute("entranceId", entranceId);