{"action":"created","comment":{"url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/pulls/comments/28940198","id":28940198,"diff_hunk":"@@ -1,343 +1,496 @@\n package com.ricoh.pos.model;\n-\n import android.content.ContentValues;\n import android.content.Context;\n-import android.content.res.AssetManager;\n import android.database.Cursor;\n+import android.database.DatabaseUtils;\n import android.database.sqlite.SQLiteDatabase;\n import android.os.Environment;\n import android.util.Log;\n-\n+import com.ricoh.pos.SalesDatabaseHelper;\n import com.ricoh.pos.data.Order;\n+import com.ricoh.pos.data.Product;\n import com.ricoh.pos.data.SingleSalesRecord;\n-import com.ricoh.pos.data.WomanShopFormatter;\n import com.ricoh.pos.data.WomanShopSalesDef;\n-\n-import java.io.BufferedReader;\n+import com.ricoh.pos.data.WomanShopSalesOrderDef;\n import java.io.File;\n import java.io.FileNotFoundException;\n import java.io.FileOutputStream;\n import java.io.IOException;\n-import java.io.InputStreamReader;\n import java.io.OutputStreamWriter;\n import java.io.UnsupportedEncodingException;\n+import java.sql.SQLException;\n+import java.text.ParseException;\n+import java.text.SimpleDateFormat;\n import java.util.ArrayList;\n import java.util.Date;\n-import java.util.Iterator;\n-\n-public class WomanShopSalesIOManager implements IOManager {\n-\n-\tprivate static WomanShopSalesIOManager instance = null;\n-\tprivate SQLiteDatabase salesDatabase;\n-\tprivate static String DATABASE_NAME = \"sales_dummy\";\n-\tprivate ArrayList<SingleSalesRecord> salesRecords;\n-\tprivate static String csvStorageFolder = \"/Ricoh\";\n-\n-\tprivate WomanShopSalesIOManager() {\n-\t\tthis.salesRecords = new ArrayList<SingleSalesRecord>();\n-\t}\n-\n-\tpublic static WomanShopSalesIOManager getInstance() {\n-\t\tif (instance == null) {\n-\t\t\tinstance = new WomanShopSalesIOManager();\n-\t\t}\n-\t\treturn instance;\n-\t}\n-\n-\tpublic static void resetInstance() {\n-\t\tLog.d(\"debug\", \"Reset Instance:\" + \"WomanShopSalesIOManager\");\n-\t\tinstance = null;\n-\t}\n-\n-\t@Override\n-\tpublic BufferedReader importCSVfromAssets(AssetManager assetManager) {\n-\t\tBufferedReader bufferReader = null;\n-\t\ttry {\n-\t\t\t// TODO: Should import & export data\n-\t\t\tbufferReader = new BufferedReader(new InputStreamReader(assetManager.open(DATABASE_NAME\n-\t\t\t\t\t+ \".csv\")));\n-\t\t} catch (IOException e) {\n-\t\t\tLog.d(\"debug\", \"\" + e + \"\");\n-\t\t}\n-\t\treturn bufferReader;\n-\t}\n-\n-\t@Override\n-\tpublic void insertRecords(BufferedReader bufferReader) {\n-\n-\t\tContentValues contentValue = new ContentValues();\n-\t\ttry {\n-\t\t\treadFieldName(bufferReader);\n-\n-\t\t\tString record;\n-\t\t\twhile ((record = bufferReader.readLine()) != null) {\n-\t\t\t\tString[] fieldValues = record.split(\",\");\n-\t\t\t\tLog.d(\"debug\", \"Product Code\" + fieldValues[0]);\n-\n-\t\t\t\tint i = 0;\n-\t\t\t\tfor (WomanShopSalesDef field : WomanShopSalesDef.values()) {\n-\t\t\t\t\tcontentValue.put(field.name(), fieldValues[i++]);\n-\t\t\t\t}\n-\n-\t\t\t\tsalesDatabase.insertWithOnConflict(DATABASE_NAME, null, contentValue,\n-\t\t\t\t\t\tSQLiteDatabase.CONFLICT_REPLACE);\n-\t\t\t}\n-\t\t} catch (IOException e) {\n-\t\t\tLog.d(\"debug\", \"\" + e + \"\");\n-\t\t}\n-\t}\n-\n-\t@Override\n-\tpublic String[] searchAlldata() {\n-\t\tCursor cursor = null;\n-\n-\t\ttry {\n-\t\t\tcursor = salesDatabase.query(\n-\t\t\t\t\tDATABASE_NAME,\n-\t\t\t\t\tnew String[]{WomanShopSalesDef.PRODUCT_CODE.name(),\n-\t\t\t\t\t\t\tWomanShopSalesDef.PRODUCT_CATEGORY.name(),\n-\t\t\t\t\t\t\tWomanShopSalesDef.ITEM_CATEGORY.name(),\n-\t\t\t\t\t\t\tWomanShopSalesDef.QTY.name(),\n-\t\t\t\t\t\t\tWomanShopSalesDef.SALE_PRICE.name(),\n-\t\t\t\t\t\t\tWomanShopSalesDef.TOTAL_SALE_PRICE.name(),\n-\t\t\t\t\t\t\tWomanShopSalesDef.DISCOUNT.name(),\n-\t\t\t\t\t\t\tWomanShopSalesDef.DATE.name(),\n-\t\t\t\t\t\t\tWomanShopSalesDef.USER_ATTRIBUTE.name()},\n-\t\t\t\t\tnull, null, null, null, null);\n-\t\t\tString[] results = new String[cursor.getCount()];\n-\t\t\tLog.d(\"debug\", \"count:\" + cursor.getCount());\n-\t\t\tfor (int i = 0; i < cursor.getCount(); i++) {\n-\t\t\t\tresults[i] = readCursor(cursor);\n-\t\t\t}\n-\t\t\treturn results;\n-\t\t} finally {\n-\t\t\tif (cursor != null) {\n-\t\t\t\tcursor.close();\n-\t\t\t}\n-\t\t}\n-\t}\n-\n-\t// TODO: Temporary function\n-\t@Override\n-\tpublic String searchByCode(String code) {\n-\t\tCursor cursor = null;\n-\t\ttry {\n-\t\t\tcursor = salesDatabase.query(\n-\t\t\t\t\tDATABASE_NAME,\n-\t\t\t\t\tnew String[]{WomanShopSalesDef.PRODUCT_CODE.name(),\n-\t\t\t\t\t\t\tWomanShopSalesDef.PRODUCT_CATEGORY.name(),\n-\t\t\t\t\t\t\tWomanShopSalesDef.ITEM_CATEGORY.name(),\n-\t\t\t\t\t\t\tWomanShopSalesDef.QTY.name(),\n-\t\t\t\t\t\t\tWomanShopSalesDef.SALE_PRICE.name(),\n-\t\t\t\t\t\t\tWomanShopSalesDef.TOTAL_SALE_PRICE.name(),\n-\t\t\t\t\t\t\tWomanShopSalesDef.DISCOUNT.name(),\n-\t\t\t\t\t\t\tWomanShopSalesDef.DATE.name(),\n-\t\t\t\t\t\t\tWomanShopSalesDef.USER_ATTRIBUTE.name()},\n-\t\t\t\t\tWomanShopSalesDef.PRODUCT_CODE.name() + \" = ?\",\n-\t\t\t\t\tnew String[]{code}, null, null, null);\n-\t\t\treturn readCursor(cursor);\n-\t\t} finally {\n-\t\t\tif (cursor != null) {\n-\t\t\t\tcursor.close();\n-\t\t\t}\n-\t\t}\n-\t}\n-\n-\tpublic void saveSalesRecord(SingleSalesRecord record) {\n-\t\tsalesRecords.add(record);\n-\n-\t\tArrayList<Order> orders = record.getAllOrders();\n-\t\tfor (Order order : orders) {\n-\t\t\tString salesRecord = order.getProductCode() + \",\" + order.getProductCategory() + \",\"\n-\t\t\t\t\t+ order.getProductName() + \",\" + order.getNumberOfOrder() + \",\"\n-\t\t\t\t\t+ order.getProductPrice() + \",\" + order.getTotalAmount() + \",\"\n-\t\t\t\t\t+ record.getDiscountValue() + \",\"\n-\t\t\t\t\t+ WomanShopFormatter.formatDate(record.getSalesDate()) + \",\"\n-\t\t\t\t\t+ record.getUserAttribute();\n-\t\t\tinsertSingleRecord(salesRecord);\n-\t\t}\n-\t}\n-\n-\tpublic int deleteSingleSalesRecordRelatedTo(Date date) {\n-\t\tString[] params = {WomanShopFormatter.formatDate(date)};\n-\t\tint delete = salesDatabase.delete(DATABASE_NAME, WomanShopSalesDef.DATE.name() + \"=?\", params);\n-\n-\t\tif (delete == 0) {\n-\t\t\treturn 0;\n-\t\t}\n-\n-\t\t// Delete the record from salesRecords\n-\t\tIterator<SingleSalesRecord> i = salesRecords.iterator();\n-\t\twhile (i.hasNext()) {\n-\t\t\tSingleSalesRecord record = i.next();\n-\t\t\tif (record.getSalesDate().equals(date)) {\n-\t\t\t\ti.remove();\n-\t\t\t}\n-\t\t}\n-\t\treturn delete;\n-\t}\n-\n-\t// TODO: Add this function to interface\n-\tpublic void setDatabase(SQLiteDatabase database) {\n-\t\tif (salesDatabase == null) {\n-\t\t\tLog.d(\"debug\", \"Database set:\" + DATABASE_NAME);\n-\t\t\tsalesDatabase = database;\n-\t\t} else if (!salesDatabase.isOpen()) {\n-\t\t\tLog.d(\"debug\", \"Database not open:\" + DATABASE_NAME);\n-\t\t}\n-\t}\n-\n-\t// TODO: Add this function to interface\n-\tpublic void closeDatabase() {\n-\t\tif (salesDatabase != null) {\n-\t\t\tLog.d(\"debug\", \"Database closed:\" + DATABASE_NAME);\n-\t\t\tsalesDatabase.close();\n-\t\t}\n-\t}\n-\n-\tpublic void exportCSV(Context context) throws IOException {\n-\t\tCursor cursor = null;\n-\n-\t\ttry {\n-\t\t\tcursor = salesDatabase.query(\n-\t\t\t\t\tDATABASE_NAME,\n-\t\t\t\t\tnew String[]{WomanShopSalesDef.PRODUCT_CODE.name(),\n-\t\t\t\t\t\t\tWomanShopSalesDef.PRODUCT_CATEGORY.name(),\n-\t\t\t\t\t\t\tWomanShopSalesDef.ITEM_CATEGORY.name(),\n-\t\t\t\t\t\t\tWomanShopSalesDef.QTY.name(),\n-\t\t\t\t\t\t\tWomanShopSalesDef.SALE_PRICE.name(),\n-\t\t\t\t\t\t\tWomanShopSalesDef.TOTAL_SALE_PRICE.name(),\n-\t\t\t\t\t\t\tWomanShopSalesDef.DISCOUNT.name(),\n-\t\t\t\t\t\t\tWomanShopSalesDef.DATE.name(),\n-\t\t\t\t\t\t\tWomanShopSalesDef.USER_ATTRIBUTE.name()},\n-\t\t\t\t\tnull, null, null, null, null);\n-\t\t\tString[] results = new String[cursor.getCount()];\n-\t\t\tLog.d(\"debug\", \"sales count:\" + cursor.getCount());\n-\t\t\tfor (int i = 0; i < cursor.getCount(); i++) {\n-\t\t\t\tresults[i] = readCursor(cursor);\n-\t\t\t}\n-\t\t\twriteSalesData(results, context);\n-\t\t} finally {\n-\t\t\tif (cursor != null) {\n-\t\t\t\tcursor.close();\n-\t\t\t}\n-\t\t}\n-\t}\n-\n-\tpublic ArrayList<SingleSalesRecord> getSalesRecords() {\n-\t\treturn salesRecords;\n-\t}\n-\n-\tprivate void readFieldName(BufferedReader bufferReader) throws IOException {\n-\t\tString record = bufferReader.readLine();\n-\n-\t\t// TODO: Show field name for debug\n-\t\tString[] fieldNames = record.split(\",\");\n-\t\tfor (String fieldName : fieldNames) {\n-\t\t\tLog.d(\"debug\", fieldName);\n-\t\t}\n-\t}\n-\n-\tprivate String readCursor(Cursor cursor) {\n-\t\tString result = \"\";\n-\n-\t\tint indexProductCode = cursor.getColumnIndex(WomanShopSalesDef.PRODUCT_CODE.name());\n-\t\tint indexProductCategory = cursor.getColumnIndex(WomanShopSalesDef.PRODUCT_CATEGORY.name());\n-\t\tint indexItemCategory = cursor.getColumnIndex(WomanShopSalesDef.ITEM_CATEGORY.name());\n-\t\tint indexQTY = cursor.getColumnIndex(WomanShopSalesDef.QTY.name());\n-\t\tint indexSalePrice = cursor.getColumnIndex(WomanShopSalesDef.SALE_PRICE.name());\n-\t\tint indexTotalSalePrice = cursor.getColumnIndex(WomanShopSalesDef.TOTAL_SALE_PRICE.name());\n-\t\tint indexDiscount = cursor.getColumnIndex(WomanShopSalesDef.DISCOUNT.name());\n-\t\tint indexDate = cursor.getColumnIndex(WomanShopSalesDef.DATE.name());\n-\t\tint indexUserAttribute = cursor.getColumnIndex(WomanShopSalesDef.USER_ATTRIBUTE.name());\n-\n-\t\tif (cursor.moveToNext()) {\n-\t\t\tString productCode = cursor.getString(indexProductCode);\n-\t\t\tString productCategory = cursor.getString(indexProductCategory);\n-\t\t\tString itemCategory = cursor.getString(indexItemCategory);\n-\t\t\tint qty = cursor.getInt(indexQTY);\n-\t\t\tdouble salePrice = cursor.getDouble(indexSalePrice);\n-\t\t\tdouble totalSalePrice = cursor.getDouble(indexTotalSalePrice);\n-\t\t\tdouble discount = cursor.getDouble(indexDiscount);\n-\t\t\tString date = cursor.getString(indexDate);\n-\t\t\tString userAttribute = cursor.getString(indexUserAttribute);\n-\n-\t\t\tresult += productCode + \",\" + productCategory + \",\" + itemCategory + \",\" + qty + \",\"\n-\t\t\t\t\t+ salePrice + \",\" + totalSalePrice + \",\" + discount + \",\" + date + \",\"\n-\t\t\t\t\t+ userAttribute + \"\\n\";\n-\t\t}\n-\t\treturn result;\n-\t}\n-\n-\tprivate void insertSingleRecord(String record) {\n-\n-\t\tContentValues contentValue = new ContentValues();\n-\n-\t\tString[] fieldValues = record.split(\",\");\n-\t\tLog.d(\"debug\", \"Product Code\" + fieldValues[0]);\n-\n-\t\tint i = 0;\n-\t\tfor (WomanShopSalesDef field : WomanShopSalesDef.values()) {\n-\t\t\tcontentValue.put(field.name(), fieldValues[i++]);\n-\t\t}\n-\n-\t\tsalesDatabase.insertWithOnConflict(DATABASE_NAME, null, contentValue,\n-\t\t\t\tSQLiteDatabase.CONFLICT_REPLACE);\n-\n-\t}\n-\n-\tprivate void writeSalesData(String[] salesData, Context context) throws IOException {\n-\n-\t\tString csvStoragePath = getCSVStoragePath();\n-\t\tFile csvStorage = new File(csvStoragePath);\n-\t\tif (!csvStorage.exists()) {\n-\t\t\tLog.d(\"debug\", \"make directory:\" + csvStoragePath);\n-\t\t\tcsvStorage.mkdir();\n-\t\t}\n-\t\tFile salesDataCSV = new File(csvStoragePath + \"/sales.csv\");\n-\t\tFileOutputStream fos = null;\n-\t\tOutputStreamWriter filewriter = null;\n-\t\ttry {\n-\t\t\ttry {\n-\t\t\t\tfos = new FileOutputStream(salesDataCSV);\n-\t\t\t\tfos.write(0xef);\n-\t\t\t\tfos.write(0xbb);\n-\t\t\t\tfos.write(0xbf);\n-\t\t\t\tfilewriter = new OutputStreamWriter(fos, \"UTF-8\");\n-\t\t\t} catch (FileNotFoundException e) {\n-\t\t\t\tLog.d(\"debug\", \"sales.csv is not found\", e);\n-\t\t\t\tthrow e;\n-\t\t\t} catch (UnsupportedEncodingException e) {\n-\t\t\t\tLog.d(\"debug\", \"UTF-8 unsupported\", e);\n-\t\t\t\tthrow e;\n-\t\t\t} catch (IOException e) {\n-\t\t\t\tLog.d(\"debug\", \"file write error\", e);\n-\t\t\t\tthrow e;\n-\t\t\t}\n-\n-\t\t\ttry {\n-\t\t\t\tfor (String singleSalesData : salesData) {\n-\t\t\t\t\tLog.d(\"debug\", \"write csv:\" + singleSalesData);\n-\t\t\t\t\tfilewriter.write(singleSalesData);\n-\t\t\t\t}\n-\t\t\t} catch (IOException e) {\n-\t\t\t\tLog.d(\"debug\", \"write error\", e);\n-\t\t\t\tthrow e;\n-\t\t\t}\n-\t\t} finally {\n-\t\t\tif (filewriter != null) {\n-\t\t\t\tfilewriter.flush();\n-\t\t\t\tfilewriter.close();\n-\t\t\t}\n-\t\t\tif (fos != null) {\n-\t\t\t\tfos.close();\n-\t\t\t}\n-\t\t}\n-\t}\n-\n-\tpublic String getCSVStoragePath() {\n-\t\tFile exterlStorage = Environment.getExternalStorageDirectory();\n-\t\tLog.d(\"debug\", \"Environment External:\" + exterlStorage.getAbsolutePath());\n-\t\treturn exterlStorage.getAbsolutePath() + csvStorageFolder;\n-\t}\n+import java.util.Calendar;\n+\n+/**\n+ * 販売実績DBのコントローラークラス。元の名前はWomanShopSalesIOManager\n+ * 必要な操作は大体ここで出来るはず\n+ */\n+public class WomanShopSalesIOManager {\n+    /** ドリシティ向けに出力する販売実績CSVのファイル名*/\n+    public static final String SalesCSVFileName = \"/sales.csv\";\n+\n+    /** 販売実績のCSV出力先フォルダ名 */\n+    public static final String csvStorageFolder = \"/Ricoh\";\n+\n+    /** DBに格納する時の日付けフォーマット */\n+    public static final String dateFormat = \"yyyy-MM-dd HH:mm:ss\";\n+\n+    //------------------------ private -----------------------------\n+    /** Singleton Instance */\n+    private static WomanShopSalesIOManager instance = null;\n+\n+    /** SQLite instance */\n+    private SQLiteDatabase salesDatabase;\n+\n+    private static String[] combinedColumns = new String[] {\n+            SalesDatabaseHelper.WS_SALES_TABLE_NAME + \".\" + WomanShopSalesDef.DATE.name(),\n+            SalesDatabaseHelper.WS_SALES_TABLE_NAME + \".\" + WomanShopSalesDef.DISCOUNT.name(),\n+            SalesDatabaseHelper.WS_SALES_TABLE_NAME + \".\" + WomanShopSalesDef.USER_AGES.name(),\n+            SalesDatabaseHelper.WS_SALES_ORDER_TABLE_NAME + \".\" + WomanShopSalesOrderDef.PRODUCT_CODE.name(),\n+            SalesDatabaseHelper.WS_SALES_ORDER_TABLE_NAME + \".\" + WomanShopSalesOrderDef.CATEGORY_NAME.name(),\n+            SalesDatabaseHelper.WS_SALES_ORDER_TABLE_NAME + \".\" + WomanShopSalesOrderDef.PRODUCT_NAME.name(),\n+            SalesDatabaseHelper.WS_SALES_ORDER_TABLE_NAME + \".\" + WomanShopSalesOrderDef.PURCHASE_PRICE.name(),\n+            SalesDatabaseHelper.WS_SALES_ORDER_TABLE_NAME + \".\" + WomanShopSalesOrderDef.UNIT_PRICE.name(),\n+            SalesDatabaseHelper.WS_SALES_ORDER_TABLE_NAME + \".\" + WomanShopSalesOrderDef.QTY.name(),\n+            SalesDatabaseHelper.WS_SALES_ORDER_TABLE_NAME + \".\" + WomanShopSalesOrderDef.SINGLE_SALES_ID.name()\n+    };\n+\n+    // ------------------------ methods -----------------------------\n+    private WomanShopSalesIOManager()\n+    {\n+    }\n+\n+    public static WomanShopSalesIOManager getInstance() {\n+        if (instance == null) {\n+            instance = new WomanShopSalesIOManager();\n+        }\n+        return instance;\n+    }\n+\n+    /**\n+     * デストラクタ代わりにインスタンスをnull化する。\n+     */\n+    public static void removeInstance() {\n+        Log.d(\"debug\", \"Reset Instance:\" + \"WomanShopSalesIOManager\");\n+        instance = null;\n+    }\n+\n+    /**\n+     * SalesDatabaseHelperからSQLiteのインスタンスを貰う。\n+     * このクラスはSingletonなので、これが実質の初期化処理。これを実施しないと他のメソッドが機能しない。\n+     * @param database Helperから貰うDBインスタンス\n+     */\n+    public void setDatabase(SQLiteDatabase database)\n+    {\n+        // 既に開いているのがある場合、一度クローズ\n+        if (salesDatabase != null)\n+        {\n+            if (salesDatabase.isOpen()) {\n+                salesDatabase.close();\n+            }\n+            salesDatabase = null;\n+        }\n+\n+        Log.d(\"debug\", \"Database set:\" + SalesDatabaseHelper.SALES_DB_NAME);\n+        salesDatabase = database;\n+    }\n+\n+    public void closeDatabase() {\n+        if (salesDatabase != null) {\n+            Log.d(\"debug\", \"Database closed:\" + SalesDatabaseHelper.SALES_DB_NAME);\n+            salesDatabase.close();\n+\n+        }\n+    }\n+\n+   /**\n+     * データ件数を返す\n+     * @return 全データ件数\n+     */\n+    public long getSalesCount() {\n+        return DatabaseUtils.queryNumEntries(salesDatabase,  SalesDatabaseHelper.WS_SALES_TABLE_NAME);\n+    }\n+\n+    private String makeBasicQuery()\n+    {\n+        return \"select \"\n+                + combinedColumns[0] + \", \"\n+                + combinedColumns[1] + \", \"\n+                + combinedColumns[2] + \", \"\n+                + combinedColumns[3] + \", \"\n+                + combinedColumns[4] + \", \"\n+                + combinedColumns[5] + \", \"\n+                + combinedColumns[6] + \", \"\n+                + combinedColumns[7] + \", \"\n+                + combinedColumns[8] + \", \"\n+                + combinedColumns[9]\n+                + \" from \" +  SalesDatabaseHelper.WS_SALES_TABLE_NAME\n+                + \" left join \"\n+                +  SalesDatabaseHelper.WS_SALES_ORDER_TABLE_NAME\n+                + \" on \"\n+                + SalesDatabaseHelper.WS_SALES_TABLE_NAME + \".ROWID = \"\n+                + combinedColumns[9];\n+    }\n+\n+\n+    /**\n+     * DBから全件検索\n+     * @return 検索結果のArrayList\n+     */\n+    public ArrayList<SingleSalesRecord> searchAll()\n+    {\n+        Cursor cursor = null;\n+        ArrayList<SingleSalesRecord> sales = new ArrayList<SingleSalesRecord>();\n+\n+        try {\n+            SimpleDateFormat sdf = new SimpleDateFormat(dateFormat);\n+            String query = makeBasicQuery();\n+            cursor = salesDatabase.rawQuery(query, new String[]{});\n+\n+            SingleSalesRecord record = null;\n+            int sales_id = 0;\n+\n+            cursor.moveToFirst();\n+            for (int i = 0; i < cursor.getCount(); i++) {\n+                if (record == null) {\n+                    sales_id = cursor.getInt(9);\n+                    Date salesDate = sdf.parse(cursor.getString(0));\n+\n+                    record = new SingleSalesRecord(salesDate);\n+                    record.setDiscountValue(cursor.getDouble(1));\n+                    record.setUserAttribute(cursor.getString(2));\n+                } else if (sales_id != cursor.getInt(9)) {\n+                    sales.add(record);\n+\n+                    sales_id = cursor.getInt(9);\n+                    Date salesDate = sdf.parse(cursor.getString(0));\n+                    record = new SingleSalesRecord(salesDate);\n+                    record.setDiscountValue(cursor.getDouble(1));\n+                    record.setUserAttribute(cursor.getString(2));\n+                }\n+\n+                Product product = new Product(cursor.getString(3), cursor.getString(4), cursor.getString(5));\n+                product.setOriginalCost(cursor.getDouble(6));\n+                product.setPrice(cursor.getDouble(7));\n+                Order order = new Order(product, cursor.getInt(8));\n+                record.addOrder(order);\n+                cursor.moveToNext();\n+            }\n+\n+            // 最後の1件を登録\n+            if (cursor.getCount() > 0) {\n+                sales.add(record);\n+            }\n+            cursor.close();\n+        } catch (ParseException pe) {\n+            Log.d(\"debug\", \"salseDate parse fail.\", pe);\n+        } finally {\n+            if (cursor != null) {\n+                cursor.close();\n+            }\n+        }\n+\n+        return sales;\n+    }\n+\n+    /**\n+     * 日付けを指定して検索を実施\n+     * @param date 日付け\n+     * @param effectiveDay TRUEだと、時分秒を無視して、今日の範囲を検索、falseだと、時分秒まで検索\n+     * @return 検索結果のArrayList\n+     */\n+    public ArrayList<SingleSalesRecord> searchByDate(Date date, boolean effectiveDay)\n+    {\n+        Cursor cursor = null;\n+        ArrayList<SingleSalesRecord> sales = new ArrayList<SingleSalesRecord>();\n+        SimpleDateFormat sdf = new SimpleDateFormat(dateFormat);\n+\n+        try {\n+            String query = makeBasicQuery();\n+\n+            if (effectiveDay) {\n+                Calendar start = Calendar.getInstance();\n+                start.setTime(date);\n+                start.set(Calendar.HOUR, 0);\n+                start.set(Calendar.MINUTE, 0);\n+                start.set(Calendar.SECOND, 0);\n+                start.set(Calendar.MILLISECOND, 0);\n+\n+                Calendar end = Calendar.getInstance();\n+                end.setTime(date);\n+                end.set(Calendar.HOUR, 23);\n+                end.set(Calendar.MINUTE, 59);\n+                end.set(Calendar.SECOND, 59);\n+                end.set(Calendar.MILLISECOND, 0);\n+\n+                query = query + \" where \"\n+                              + SalesDatabaseHelper.WS_SALES_TABLE_NAME + \".\" + WomanShopSalesDef.DATE.name() + \" >= ? and \"\n+                              + SalesDatabaseHelper.WS_SALES_TABLE_NAME + \".\" + WomanShopSalesDef.DATE.name() + \"<= ?\";\n+                String[] params = { sdf.format(start.getTime()) ,  sdf.format(end.getTime()) };\n+\n+                cursor = salesDatabase.rawQuery(query, params);\n+            }\n+            else {\n+                query = query + \" where \" + SalesDatabaseHelper.WS_SALES_TABLE_NAME + \".\" + WomanShopSalesDef.DATE.name() + \" = ?\";\n+                String[] params = { sdf.format(date) };\n+                cursor = salesDatabase.rawQuery(query, params);\n+            }\n+\n+            SingleSalesRecord record = null;\n+            int sales_id = 0;\n+\n+            cursor.moveToFirst();\n+            for (int i = 0; i < cursor.getCount(); i++)\n+            {\n+                if (record == null) {\n+                    sales_id = cursor.getInt(9);\n+                    Date salesDate = sdf.parse(cursor.getString(0));\n+                    record = new SingleSalesRecord(salesDate);\n+                    record.setDiscountValue(cursor.getDouble(1));\n+                    record.setUserAttribute(cursor.getString(2));\n+                }\n+                else if (sales_id != cursor.getInt(9)) {\n+                    sales.add(record);\n+\n+                    sales_id = cursor.getInt(9);\n+                    Date salesDate = sdf.parse(cursor.getString(0));\n+                    record = new SingleSalesRecord(salesDate);\n+                    record.setDiscountValue(cursor.getDouble(1));\n+                    record.setUserAttribute(cursor.getString(2));\n+                }\n+\n+                Product product = new Product(cursor.getString(3), cursor.getString(4), cursor.getString(5));\n+                product.setOriginalCost(cursor.getDouble(6));\n+                product.setPrice(cursor.getDouble(7));\n+                Order order = new Order(product, cursor.getInt(8));\n+                record.addOrder(order);\n+                cursor.moveToNext();\n+            }\n+\n+            // 0件でないなら、最後の1件を登録\n+            if ( cursor.getCount() > 0) {\n+                sales.add(record);\n+            }\n+        } catch (ParseException pe) {\n+            Log.d(\"debug\", \"salseDate parse fail.\", pe);\n+        } finally {\n+            if (cursor != null) {\n+                cursor.close();\n+            }\n+        }\n+\n+        return sales;\n+    }\n+\n+    /**\n+     * 決済が成立したら呼び出してDBに格納するメソッド\n+     * @param record　格納するデータを保持するインスタンス\n+     */\n+    public void insertSalesRecord(SingleSalesRecord record)\n+    {\n+        ContentValues singleRecord = new ContentValues();\n+        salesDatabase.beginTransaction();\n+\n+        try {\n+            SimpleDateFormat sdf = new SimpleDateFormat(dateFormat);\n+            String dateStr = sdf.format(record.getSalesDate());\n+\n+            singleRecord.put(WomanShopSalesDef.DATE.name(), dateStr);\n+            singleRecord.put(WomanShopSalesDef.DISCOUNT.name(), record.getDiscountValue());\n+            singleRecord.put(WomanShopSalesDef.USER_AGES.name(), record.getUserAttribute());\n+\n+            long rowID = salesDatabase.insertWithOnConflict(\n+                    SalesDatabaseHelper.WS_SALES_TABLE_NAME,\n+                    null,\n+                    singleRecord,\n+                    SQLiteDatabase.CONFLICT_REPLACE\n+            );\n+\n+            ArrayList<Order> orders = record.getAllOrders();\n+            for (int i = 0; i < orders.size(); i++) {\n+                Order order = orders.get(i);\n+                Product product = order.getProduct();\n+                ContentValues orderRecord = new ContentValues();\n+                orderRecord.put(WomanShopSalesOrderDef.PRODUCT_CODE.name(), product.getCode());\n+                orderRecord.put(WomanShopSalesOrderDef.CATEGORY_NAME.name(), product.getCategory());\n+                orderRecord.put(WomanShopSalesOrderDef.PRODUCT_NAME.name(), product.getName());\n+                orderRecord.put(WomanShopSalesOrderDef.PURCHASE_PRICE.name(), product.getOriginalCost());\n+                orderRecord.put(WomanShopSalesOrderDef.UNIT_PRICE.name(), product.getPrice());\n+                orderRecord.put(WomanShopSalesOrderDef.QTY.name(), order.getNumberOfOrder());\n+                orderRecord.put(WomanShopSalesOrderDef.SINGLE_SALES_ID.name(), rowID);\n+\n+                salesDatabase.insertWithOnConflict(\n+                        SalesDatabaseHelper.WS_SALES_ORDER_TABLE_NAME,\n+                        null,\n+                        orderRecord,\n+                        SQLiteDatabase.CONFLICT_REPLACE\n+                );\n+            }\n+\n+            salesDatabase.setTransactionSuccessful();\n+        }\n+        finally {\n+            salesDatabase.endTransaction();\n+        }\n+    }\n+\n+    /***\n+     * 日付けで指定された売り上げデータを削除する。\n+     * @param date　キーになる日付けと時刻のデータ。時刻込みなのでユニークキーになるはず。\n+     * @return 1なら削除成功。1以外だと想定外のエラー\n+     */\n+    public int deleteSingleSalesRecordRelatedTo(Date date)\n+    {\n+        int deleted = 0;\n+        SimpleDateFormat sdf = new SimpleDateFormat(dateFormat);\n+        String dateStr = sdf.format(date);\n+\n+        String[] params = { dateStr };\n+        salesDatabase.beginTransaction();\n+\n+        Cursor cursor;\n+        try {\n+            // まず指定されたデータがあるかどうか\n+            String[] columns = { \"ROWID\" };\n+            String query = WomanShopSalesDef.DATE.name() + \" = ?\";\n+            cursor = salesDatabase.query(\n+                    SalesDatabaseHelper.WS_SALES_TABLE_NAME,\n+                    columns,\n+                    query,\n+                    params,\n+                    null,\n+                    null,\n+                    null);\n+\n+            if (cursor.getCount() != 1) {\n+                throw new SQLException(\"No data from SingleSalesTable\");\n+            }\n+\n+            cursor.moveToFirst();\n+            long id = cursor.getLong(0);\n+            cursor.close();\n+\n+            // ここからdelete\n+            String[] deleteParams = new String[] { String.valueOf(id) };\n+            deleted = salesDatabase.delete(\n+                    SalesDatabaseHelper.WS_SALES_TABLE_NAME, \"ROWID=?\", deleteParams\n+            );\n+            if (deleted <= 0) {\n+                throw new SQLException(\"delete fail from SingleSalesTable id=\" + id);\n+            }\n+\n+            int deleted2 = salesDatabase.delete(\n+                    SalesDatabaseHelper.WS_SALES_ORDER_TABLE_NAME, WomanShopSalesOrderDef.SINGLE_SALES_ID.name() +  \" = ?\", deleteParams\n+            );\n+            if (deleted2 <= 0) {\n+                throw new SQLException(\"delete fail from SingleSalesOrderTable id=\" + id);\n+            }\n+            salesDatabase.setTransactionSuccessful();\n+        }\n+        catch (SQLException exp) {\n+            deleted = 0;\n+        }\n+        finally {\n+            salesDatabase.endTransaction();\n+        }\n+\n+        return deleted;\n+    }\n+\n+    public void exportCSV(Context context) throws IOException {","path":"AndroidPOS/src/com/ricoh/pos/model/WomanShopSalesIOManager.java","position":728,"original_position":728,"commit_id":"046eae08686ad106c62a2183794c5cb29779cc42","original_commit_id":"046eae08686ad106c62a2183794c5cb29779cc42","user":{"login":"arai-wa","id":5035113,"avatar_url":"https://avatars.githubusercontent.com/u/5035113?v=3","gravatar_id":"","url":"https://api.github.com/users/arai-wa","html_url":"https://github.com/arai-wa","followers_url":"https://api.github.com/users/arai-wa/followers","following_url":"https://api.github.com/users/arai-wa/following{/other_user}","gists_url":"https://api.github.com/users/arai-wa/gists{/gist_id}","starred_url":"https://api.github.com/users/arai-wa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arai-wa/subscriptions","organizations_url":"https://api.github.com/users/arai-wa/orgs","repos_url":"https://api.github.com/users/arai-wa/repos","events_url":"https://api.github.com/users/arai-wa/events{/privacy}","received_events_url":"https://api.github.com/users/arai-wa/received_events","type":"User","site_admin":false},"body":"このメソッドの中で呼び出している writeSalesData メソッドは Context を引数にとりますが、\r\nwriteSalesData の中では Context を使用していないようです。\r\nなので Context を渡さないように変更して、\r\nこの exportCSV メソッドも Context を受け取らないように変更できそうです","created_at":"2015-04-23T06:58:06Z","updated_at":"2015-04-23T06:58:06Z","html_url":"https://github.com/AndroidPOS/AndroidPOS/pull/10#discussion_r28940198","pull_request_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/AndroidPOS/AndroidPOS/pulls/comments/28940198"},"html":{"href":"https://github.com/AndroidPOS/AndroidPOS/pull/10#discussion_r28940198"},"pull_request":{"href":"https://api.github.com/repos/AndroidPOS/AndroidPOS/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/pulls/10","id":33926854,"html_url":"https://github.com/AndroidPOS/AndroidPOS/pull/10","diff_url":"https://github.com/AndroidPOS/AndroidPOS/pull/10.diff","patch_url":"https://github.com/AndroidPOS/AndroidPOS/pull/10.patch","issue_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/issues/10","number":10,"state":"open","locked":false,"title":"BOP-1対応","user":{"login":"dnaka","id":1124970,"avatar_url":"https://avatars.githubusercontent.com/u/1124970?v=3","gravatar_id":"","url":"https://api.github.com/users/dnaka","html_url":"https://github.com/dnaka","followers_url":"https://api.github.com/users/dnaka/followers","following_url":"https://api.github.com/users/dnaka/following{/other_user}","gists_url":"https://api.github.com/users/dnaka/gists{/gist_id}","starred_url":"https://api.github.com/users/dnaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnaka/subscriptions","organizations_url":"https://api.github.com/users/dnaka/orgs","repos_url":"https://api.github.com/users/dnaka/repos","events_url":"https://api.github.com/users/dnaka/events{/privacy}","received_events_url":"https://api.github.com/users/dnaka/received_events","type":"User","site_admin":false},"body":"・販売履歴DBのスキーマ変更\r\n　WomanShopSaleseOrderDefとWomanShopSalesDefに定義。\r\n　テーブル作成クエリはSalesDatabaseHelper参照\r\n・上記に伴い、CRUD処理を一新\r\n　主にWomanShopSalesIOManagerを、I/Fだけ残してほぼ一新\r\n・WomanShopSalesIOManagerのメソッド呼び出ししていた箇所を修正","created_at":"2015-04-23T06:13:36Z","updated_at":"2015-04-23T06:58:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eb52b23a554a7c63993af6e408b8e87efce591ea","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/pulls/10/commits","review_comments_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/pulls/10/comments","review_comment_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/issues/10/comments","statuses_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/statuses/046eae08686ad106c62a2183794c5cb29779cc42","head":{"label":"AndroidPOS:BOP-1","ref":"BOP-1","sha":"046eae08686ad106c62a2183794c5cb29779cc42","user":{"login":"AndroidPOS","id":11054772,"avatar_url":"https://avatars.githubusercontent.com/u/11054772?v=3","gravatar_id":"","url":"https://api.github.com/users/AndroidPOS","html_url":"https://github.com/AndroidPOS","followers_url":"https://api.github.com/users/AndroidPOS/followers","following_url":"https://api.github.com/users/AndroidPOS/following{/other_user}","gists_url":"https://api.github.com/users/AndroidPOS/gists{/gist_id}","starred_url":"https://api.github.com/users/AndroidPOS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndroidPOS/subscriptions","organizations_url":"https://api.github.com/users/AndroidPOS/orgs","repos_url":"https://api.github.com/users/AndroidPOS/repos","events_url":"https://api.github.com/users/AndroidPOS/events{/privacy}","received_events_url":"https://api.github.com/users/AndroidPOS/received_events","type":"Organization","site_admin":false},"repo":{"id":30951534,"name":"AndroidPOS","full_name":"AndroidPOS/AndroidPOS","owner":{"login":"AndroidPOS","id":11054772,"avatar_url":"https://avatars.githubusercontent.com/u/11054772?v=3","gravatar_id":"","url":"https://api.github.com/users/AndroidPOS","html_url":"https://github.com/AndroidPOS","followers_url":"https://api.github.com/users/AndroidPOS/followers","following_url":"https://api.github.com/users/AndroidPOS/following{/other_user}","gists_url":"https://api.github.com/users/AndroidPOS/gists{/gist_id}","starred_url":"https://api.github.com/users/AndroidPOS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndroidPOS/subscriptions","organizations_url":"https://api.github.com/users/AndroidPOS/orgs","repos_url":"https://api.github.com/users/AndroidPOS/repos","events_url":"https://api.github.com/users/AndroidPOS/events{/privacy}","received_events_url":"https://api.github.com/users/AndroidPOS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AndroidPOS/AndroidPOS","description":"","fork":true,"url":"https://api.github.com/repos/AndroidPOS/AndroidPOS","forks_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/forks","keys_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/teams","hooks_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/hooks","issue_events_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/issues/events{/number}","events_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/events","assignees_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/assignees{/user}","branches_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/branches{/branch}","tags_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/tags","blobs_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/git/refs{/sha}","trees_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/statuses/{sha}","languages_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/languages","stargazers_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/stargazers","contributors_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/contributors","subscribers_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/subscribers","subscription_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/subscription","commits_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/commits{/sha}","git_commits_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/git/commits{/sha}","comments_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/comments{/number}","issue_comment_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/issues/comments{/number}","contents_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/contents/{+path}","compare_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/merges","archive_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/downloads","issues_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/issues{/number}","pulls_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/pulls{/number}","milestones_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/milestones{/number}","notifications_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/labels{/name}","releases_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/releases{/id}","created_at":"2015-02-18T04:08:22Z","updated_at":"2015-02-18T04:08:25Z","pushed_at":"2015-04-23T06:30:19Z","git_url":"git://github.com/AndroidPOS/AndroidPOS.git","ssh_url":"git@github.com:AndroidPOS/AndroidPOS.git","clone_url":"https://github.com/AndroidPOS/AndroidPOS.git","svn_url":"https://github.com/AndroidPOS/AndroidPOS","homepage":null,"size":14415,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":2,"forks":6,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"AndroidPOS:develop","ref":"develop","sha":"2f5e7e73768fcdd95ea6754e73c2aa254c757471","user":{"login":"AndroidPOS","id":11054772,"avatar_url":"https://avatars.githubusercontent.com/u/11054772?v=3","gravatar_id":"","url":"https://api.github.com/users/AndroidPOS","html_url":"https://github.com/AndroidPOS","followers_url":"https://api.github.com/users/AndroidPOS/followers","following_url":"https://api.github.com/users/AndroidPOS/following{/other_user}","gists_url":"https://api.github.com/users/AndroidPOS/gists{/gist_id}","starred_url":"https://api.github.com/users/AndroidPOS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndroidPOS/subscriptions","organizations_url":"https://api.github.com/users/AndroidPOS/orgs","repos_url":"https://api.github.com/users/AndroidPOS/repos","events_url":"https://api.github.com/users/AndroidPOS/events{/privacy}","received_events_url":"https://api.github.com/users/AndroidPOS/received_events","type":"Organization","site_admin":false},"repo":{"id":30951534,"name":"AndroidPOS","full_name":"AndroidPOS/AndroidPOS","owner":{"login":"AndroidPOS","id":11054772,"avatar_url":"https://avatars.githubusercontent.com/u/11054772?v=3","gravatar_id":"","url":"https://api.github.com/users/AndroidPOS","html_url":"https://github.com/AndroidPOS","followers_url":"https://api.github.com/users/AndroidPOS/followers","following_url":"https://api.github.com/users/AndroidPOS/following{/other_user}","gists_url":"https://api.github.com/users/AndroidPOS/gists{/gist_id}","starred_url":"https://api.github.com/users/AndroidPOS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndroidPOS/subscriptions","organizations_url":"https://api.github.com/users/AndroidPOS/orgs","repos_url":"https://api.github.com/users/AndroidPOS/repos","events_url":"https://api.github.com/users/AndroidPOS/events{/privacy}","received_events_url":"https://api.github.com/users/AndroidPOS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AndroidPOS/AndroidPOS","description":"","fork":true,"url":"https://api.github.com/repos/AndroidPOS/AndroidPOS","forks_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/forks","keys_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/teams","hooks_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/hooks","issue_events_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/issues/events{/number}","events_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/events","assignees_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/assignees{/user}","branches_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/branches{/branch}","tags_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/tags","blobs_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/git/refs{/sha}","trees_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/statuses/{sha}","languages_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/languages","stargazers_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/stargazers","contributors_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/contributors","subscribers_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/subscribers","subscription_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/subscription","commits_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/commits{/sha}","git_commits_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/git/commits{/sha}","comments_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/comments{/number}","issue_comment_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/issues/comments{/number}","contents_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/contents/{+path}","compare_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/merges","archive_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/downloads","issues_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/issues{/number}","pulls_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/pulls{/number}","milestones_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/milestones{/number}","notifications_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/labels{/name}","releases_url":"https://api.github.com/repos/AndroidPOS/AndroidPOS/releases{/id}","created_at":"2015-02-18T04:08:22Z","updated_at":"2015-02-18T04:08:25Z","pushed_at":"2015-04-23T06:30:19Z","git_url":"git://github.com/AndroidPOS/AndroidPOS.git","ssh_url":"git@github.com:AndroidPOS/AndroidPOS.git","clone_url":"https://github.com/AndroidPOS/AndroidPOS.git","svn_url":"https://github.com/AndroidPOS/AndroidPOS","homepage":null,"size":14415,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":2,"forks":6,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AndroidPOS/AndroidPOS/pulls/10"},"html":{"href":"https://github.com/AndroidPOS/AndroidPOS/pull/10"},"issue":{"href":"https://api.github.com/repos/AndroidPOS/AndroidPOS/issues/10"},"comments":{"href":"https://api.github.com/repos/AndroidPOS/AndroidPOS/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/AndroidPOS/AndroidPOS/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/AndroidPOS/AndroidPOS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AndroidPOS/AndroidPOS/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/AndroidPOS/AndroidPOS/statuses/046eae08686ad106c62a2183794c5cb29779cc42"}}}}