本文整理汇总了Java中logbook.gui.logic.CreateReportLogic.storeMaterialReport方法的典型用法代码示例。如果您正苦于以下问题:Java CreateReportLogic.storeMaterialReport方法的具体用法?Java CreateReportLogic.storeMaterialReport怎么用?Java CreateReportLogic.storeMaterialReport使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类logbook.gui.logic.CreateReportLogic
的用法示例。
在下文中一共展示了CreateReportLogic.storeMaterialReport方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doMaterialSub
import logbook.gui.logic.CreateReportLogic; //导入方法依赖的package包/类
/**
* 保有資材を更新する
*
* @param apidata
*/
private void doMaterialSub(JsonArray apidata) {
Date time = Calendar.getInstance().getTime();
MaterialDto dto = new MaterialDto();
dto.setTime(time);
for (JsonValue value : apidata) {
JsonObject entry = (JsonObject) value;
switch (entry.getInt("api_id")) {
case AppConstants.MATERIAL_FUEL:
dto.setFuel(entry.getInt("api_value"));
break;
case AppConstants.MATERIAL_AMMO:
dto.setAmmo(entry.getInt("api_value"));
break;
case AppConstants.MATERIAL_METAL:
dto.setMetal(entry.getInt("api_value"));
break;
case AppConstants.MATERIAL_BAUXITE:
dto.setBauxite(entry.getInt("api_value"));
break;
case AppConstants.MATERIAL_BURNER:
dto.setBurner(entry.getInt("api_value"));
break;
case AppConstants.MATERIAL_BUCKET:
dto.setBucket(entry.getInt("api_value"));
break;
case AppConstants.MATERIAL_RESEARCH:
dto.setResearch(entry.getInt("api_value"));
break;
default:
break;
}
}
this.material = dto;
// 資材ログに書き込む
if ((this.materialLogLastUpdate == null)
|| (TimeUnit.MILLISECONDS.toSeconds(time.getTime() - this.materialLogLastUpdate.getTime()) >
AppConfig.get().getMaterialLogInterval())) {
CreateReportLogic.storeMaterialReport(this.material);
this.materialLogLastUpdate = time;
}
}
示例2: doMaterialSub
import logbook.gui.logic.CreateReportLogic; //导入方法依赖的package包/类
/**
* 保有資材を更新する
*
* @param apidata
*/
private static void doMaterialSub(JsonArray apidata) {
Date time = Calendar.getInstance().getTime();
MaterialDto dto = new MaterialDto();
dto.setTime(time);
for (JsonValue value : apidata) {
JsonObject entry = (JsonObject) value;
switch (entry.getInt("api_id")) {
case AppConstants.MATERIAL_FUEL:
dto.setFuel(entry.getInt("api_value"));
break;
case AppConstants.MATERIAL_AMMO:
dto.setAmmo(entry.getInt("api_value"));
break;
case AppConstants.MATERIAL_METAL:
dto.setMetal(entry.getInt("api_value"));
break;
case AppConstants.MATERIAL_BAUXITE:
dto.setBauxite(entry.getInt("api_value"));
break;
case AppConstants.MATERIAL_BURNER:
dto.setBurner(entry.getInt("api_value"));
break;
case AppConstants.MATERIAL_BUCKET:
dto.setBucket(entry.getInt("api_value"));
break;
case AppConstants.MATERIAL_RESEARCH:
dto.setResearch(entry.getInt("api_value"));
break;
default:
break;
}
}
material = dto;
// 資材ログに書き込む
if ((materialLogLastUpdate == null)
|| (TimeUnit.MILLISECONDS.toSeconds(time.getTime() - materialLogLastUpdate.getTime()) >
AppConfig.get().getMaterialLogInterval())) {
CreateReportLogic.storeMaterialReport(material);
materialLogLastUpdate = time;
}
}