/** * 生成图片的实体 * * <p>参数:视角 */ private PhotoEntity generatePhotoEntity(int flag) { PhotoEntity photoEntity = new PhotoEntity(); JSONObject jsonObject = new JSONObject(); try { JSONObject photoJsonObject = new JSONObject(); PosEntity posEntity = getPosEntity(flag); String fileName = posEntity.getImageFileName(); int index = PhotoLayout.photoIndex++; photoJsonObject.put("x", posEntity.getStartX()); photoJsonObject.put("y", posEntity.getStartY()); photoJsonObject.put("width", getBitmapWidth(AppCommon.photoDirectory, fileName)); photoJsonObject.put("height", getBitmapHeight(AppCommon.photoDirectory, fileName)); photoJsonObject.put("issueId", posEntity.getIssueId()); photoJsonObject.put("comment", posEntity.getComment()); jsonObject.put("Group", "frame"); jsonObject.put("Part", getPart(flag)); jsonObject.put("PhotoData", photoJsonObject); jsonObject.put("CarId", BasicInfoLayout.carId); jsonObject.put("UserId", UserInfo.getInstance().getId()); jsonObject.put("Key", UserInfo.getInstance().getKey()); jsonObject.put("Action", Action.MODIFY); jsonObject.put("Index", index); photoEntity = PhotoUtils.generatePhotoEntity( jsonObject, "结构缺陷", fileName, Action.MODIFY, index, posEntity.getComment()); } catch (JSONException e) { Log.d(AppCommon.TAG, e.getMessage()); } return photoEntity; }