PySpark学习---销售情况数据统计分析案例

需求分析:

某公司是做零售相关业务,旗下出品各类收银机.
目前公司的收银机已经在全国铺开,在各个省份均有店铺使用.机器是联网的,每一次使用都会将售卖商品数据上传到公司后台.老板现在想对省份维度的销售情况进行统计分析

 逻辑需求:

1.各省销售指标每个省份的销售额统计
2.TOP3销售省份中,有多少家店铺日均销售额1000+
3.TOP3省份中各个省份的平均单价
4.TOP3省份中,各个省份的支付类型比例


操作需求:

1.将需求结果写出到mysql
2.将数据写入到Spark On Hive

 数据来源:mini.json -------mini.json数据源下载:

{"discountRate": 1, "dayOrderSeq": 8, "storeDistrict": "雨花区", "isSigned": 0, "storeProvince": "湖南省", "origin": 0, "storeGPSLongitude": "113.01567856440359", "discount": 0, "storeID": 4064, "productCount": 4, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "corporator": "hnzy", "serverSaved": true, "payType": "alipay", "discountType": 2, "storeName": "杨光峰南食店", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1563758583000, "smallChange": 0, "storeGPSName": "", "erase": 0, "product": [{"count": 1, "name": "百事可乐可乐型汽水", "unitID": 0, "barcode": "6940159410029", "pricePer": 3, "retailPrice": 3, "tradePrice": 0, "categoryID": 1}, {"count": 1, "name": "馋大嘴盐焗鸡筋110g", "unitID": 0, "barcode": "6951027300076", "pricePer": 2.5, "retailPrice": 2.5, "tradePrice": 0, "categoryID": 1}, {"count": 2, "name": "糯米锅巴", "unitID": 0, "barcode": "6970362690000", "pricePer": 2.5, "retailPrice": 2.5, "tradePrice": 0, "categoryID": 1}, {"count": 1, "name": "南京包装", "unitID": 0, "barcode": "6901028300056", "pricePer": 12, "retailPrice": 12, "tradePrice": 0, "categoryID": 1}], "storeGPSAddress": "", "orderID": "156375858240940641230", "moneyBeforeWholeDiscount": 22.5, "storeCategory": "normal", "receivable": 22.5, "faceID": "", "storeOwnUserId": 4082, "paymentChannel": 0, "paymentScenarios": "PASV", "storeAddress": "StoreAddress", "totalNoDiscount": 22.5, "payedTotal": 22.5, "storeGPSLatitude": "28.121213726311993", "storeCreateDateTS": 1557733046000, "payStatus": -1, "storeCity": "长沙市", "memberID": "0"}
{"discountRate": 1, "storeShopNo": "277551253310005", "dayOrderSeq": 6, "storeDistrict": "岳麓区", "isSigned": 1, "storeProvince": "湖南省", "origin": 0, "storeGPSLongitude": "112.95106", "discount": 0, "storeID": 718, "productCount": 1, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "payType": "alipay", "discountType": 2, "storeName": "芙蓉兴盛汶强食品店", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1546737450000, "smallChange": 0, "storeGPSName": "None", "erase": 0, "product": [{"count": 1, "name": "白沙", "unitID": 8, "barcode": "6901028191012", "pricePer": 7, "retailPrice": 7, "tradePrice": 0, "categoryID": 21}], "storeGPSAddress": "None", "orderID": "15467374316307186813", "moneyBeforeWholeDiscount": 7, "storeCategory": "normal", "receivable": 7, "faceID": "", "storeOwnUserId": 577, "paymentChannel": 0, "paymentScenarios": "PASV", "storeAddress": "StoreAddress", "totalNoDiscount": 7, "payedTotal": 7, "storeGPSLatitude": "28.158909", "storeCreateDateTS": 1534920455000, "storeCity": "长沙市", "memberID": "0"}
{"discountRate": 1, "storeShopNo": "None", "dayOrderSeq": 26, "storeDistrict": "芙蓉区", "isSigned": 0, "storeProvince": "湖南省", "origin": 0, "storeGPSLongitude": "113.03312", "discount": 0, "storeID": 1786, "productCount": 1, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "payType": "cash", "discountType": 2, "storeName": "裕丰超市", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1546478081000, "smallChange": 0, "storeGPSName": "None", "erase": 0, "product": [{"count": 1, "name": "双喜经典包装", "unitID": 8, "barcode": "6901028000826", "pricePer": 10, "retailPrice": 10, "tradePrice": 8.58, "categoryID": 21}], "storeGPSAddress": "None", "orderID": "154647808086017867144", "moneyBeforeWholeDiscount": 10, "storeCategory": "normal", "receivable": 10, "faceID": "", "storeOwnUserId": 1714, "paymentChannel": 0, "paymentScenarios": "OTHER", "storeAddress": "StoreAddress", "totalNoDiscount": 10, "payedTotal": 10, "storeGPSLatitude": "28.198982", "storeCreateDateTS": 1540802164000, "storeCity": "长沙市", "memberID": "0"}
{"discountRate": 1, "dayOrderSeq": 144, "storeDistrict": "龙华区", "isSigned": 0, "storeProvince": "广东省", "origin": 0, "storeGPSLongitude": "", "discount": 0, "storeID": 3702, "productCount": 2, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "corporator": "hnzy", "serverSaved": true, "payType": "wechat", "discountType": 2, "storeName": "天福便利店", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1559133703000, "smallChange": 0, "storeGPSName": "", "erase": 0, "product": [{"count": 1, "name": "自然食用盐250g", "unitID": 8, "barcode": "6970855690265", "pricePer": 2, "retailPrice": 2, "tradePrice": 0, "categoryID": 2}, {"count": 1, "name": "吉祥好日子", "unitID": 4, "barcode": "6901028942843", "pricePer": 8.5, "retailPrice": 8.5, "tradePrice": 0, "categoryID": 2}], "storeGPSAddress": "", "orderID": "155913370213437026067", "moneyBeforeWholeDiscount": 10.5, "storeCategory": "normal", "receivable": 10.5, "faceID": "", "storeOwnUserId": 3692, "paymentChannel": 0, "paymentScenarios": "PASV", "storeAddress": "StoreAddress", "totalNoDiscount": 10.5, "payedTotal": 10.5, "storeGPSLatitude": "", "storeCreateDateTS": 1552977317000, "payStatus": -1, "storeCity": "深圳市", "memberID": "0"}
{"discountRate": 1, "storeShopNo": "None", "dayOrderSeq": 57, "storeDistrict": "象山区", "isSigned": 0, "storeProvince": "广西壮族自治区", "origin": 0, "storeGPSLongitude": "110.28186410665509", "discount": 0, "storeID": 1156, "productCount": 1, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "payType": "cash", "discountType": 2, "storeName": "吉顺食品自选商店", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1548594458000, "smallChange": 0, "storeGPSName": "None", "erase": 0, "product": [{"count": 1, "name": "中南海8包装", "unitID": 8, "barcode": "6901028010108", "pricePer": 10, "retailPrice": 10, "tradePrice": 8.8, "categoryID": 21}], "storeGPSAddress": "None", "orderID": "154859445786811565860", "moneyBeforeWholeDiscount": 10, "storeCategory": "normal", "receivable": 10, "faceID": "", "storeOwnUserId": 1040, "paymentChannel": 0, "paymentScenarios": "OTHER", "storeAddress": "StoreAddress", "totalNoDiscount": 10, "payedTotal": 10, "storeGPSLatitude": "25.248390759610427", "storeCreateDateTS": 1537601490000, "storeCity": "桂林市", "memberID": "0"}
{"discountRate": 1, "storeShopNo": "277585253310024", "dayOrderSeq": 36, "storeDistrict": "香洲区", "isSigned": 1, "storeProvince": "广东省", "origin": 0, "storeGPSLongitude": "113.51813376850318", "discount": 0, "storeID": 318, "productCount": 1, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "payType": "wechat", "discountType": 2, "storeName": "芙蓉兴盛3626", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1548292824000, "smallChange": 0, "storeGPSName": "None", "erase": 0, "product": [{"count": 1, "name": "进口维他奶原味250ml", "unitID": 3, "barcode": "4891028164395", "pricePer": 3, "retailPrice": 3, "tradePrice": 2, "categoryID": 1}], "storeGPSAddress": "None", "orderID": "15482928201153183933", "moneyBeforeWholeDiscount": 3, "storeCategory": "normal", "receivable": 3, "faceID": "", "storeOwnUserId": 229, "paymentChannel": 1, "paymentScenarios": "PURC", "storeAddress": "StoreAddress", "totalNoDiscount": 3, "payedTotal": 3, "storeGPSLatitude": "22.274088374908985", "storeCreateDateTS": 1518114308000, "storeCity": "珠海市", "memberID": "0"}
{"discountRate": 1, "storeShopNo": "None", "dayOrderSeq": 12, "storeDistrict": "芙蓉区", "isSigned": 0, "storeProvince": "湖南省", "origin": 0, "storeGPSLongitude": "113.01619246602056", "discount": 0, "storeID": 1699, "productCount": 1, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "payType": "cash", "discountType": 2, "storeName": "亿户便利海欣食品店", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1545356344000, "smallChange": 0, "storeGPSName": "None", "erase": 0, "product": [{"count": 1, "name": "白沙包装", "unitID": 8, "barcode": "6901028191012", "pricePer": 6.5, "retailPrice": 6.5, "tradePrice": 3.81, "categoryID": 1}], "storeGPSAddress": "None", "orderID": "154535634370716996481", "moneyBeforeWholeDiscount": 6.5, "storeCategory": "normal", "receivable": 6.5, "faceID": "", "storeOwnUserId": 1620, "paymentChannel": 0, "paymentScenarios": "OTHER", "storeAddress": "StoreAddress", "totalNoDiscount": 6.5, "payedTotal": 6.5, "storeGPSLatitude": "28.214493749156052", "storeCreateDateTS": 1540530941000, "storeCity": "长沙市", "memberID": "0"}
{"discountRate": 1, "storeShopNo": "None", "dayOrderSeq": 111, "storeDistrict": "武陵区", "isSigned": 0, "storeProvince": "湖南省", "origin": 0, "storeGPSLongitude": "111.68978109955786", "discount": 0, "storeID": 1167, "productCount": 2, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "payType": "alipay", "discountType": 2, "storeName": "芙蓉兴盛子轩商行", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1547284514000, "smallChange": 0, "storeGPSName": "None", "erase": 0, "product": [{"count": 1, "name": "无码商品", "unitID": 0, "barcode": "99999999-1", "pricePer": 2, "retailPrice": 2, "tradePrice": 0, "categoryID": 1}, {"count": 1, "name": "15元叼嘴巴食用槟榔", "unitID": 8, "barcode": "6958214656787", "pricePer": 15, "retailPrice": 15, "tradePrice": 12, "categoryID": 1}], "storeGPSAddress": "None", "orderID": "154728450254711678227", "moneyBeforeWholeDiscount": 17, "storeCategory": "normal", "receivable": 17, "faceID": "", "storeOwnUserId": 1051, "paymentChannel": 0, "paymentScenarios": "PASV", "storeAddress": "StoreAddress", "totalNoDiscount": 17, "payedTotal": 17, "storeGPSLatitude": "29.05939118356865", "storeCreateDateTS": 1537621831000, "storeCity": "常德市", "memberID": "0"}
{"discountRate": 1, "dayOrderSeq": 10, "storeDistrict": "开福区", "isSigned": 0, "storeProvince": "湖南省", "origin": 0, "storeGPSLongitude": "112.99777", "discount": 0, "storeID": 3466, "productCount": 2, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "corporator": "hnzy", "serverSaved": true, "payType": "cash", "discountType": 2, "storeName": "芙蓉兴盛蔡兰食品店", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1563845059000, "smallChange": 0, "storeGPSName": "", "erase": 0, "product": [{"count": 1, "name": "小洋人妙恋大果粒原味420ml", "unitID": 0, "barcode": "6932452818091", "pricePer": 5, "retailPrice": 5, "tradePrice": 0, "categoryID": 1}, {"count": 1, "name": "利群版包装", "unitID": 8, "barcode": "6901028118170", "pricePer": 14, "retailPrice": 14, "tradePrice": 0, "categoryID": 2}], "storeGPSAddress": "", "orderID": "156384505862634667509", "moneyBeforeWholeDiscount": 19, "storeCategory": "normal", "receivable": 19, "faceID": "", "storeOwnUserId": 3434, "paymentChannel": 0, "paymentScenarios": "OTHER", "storeAddress": "StoreAddress", "totalNoDiscount": 19, "payedTotal": 19, "storeGPSLatitude": "28.340324", "storeCreateDateTS": 1547892928000, "payStatus": -1, "storeCity": "长沙市", "memberID": "0"}
{"discountRate": 1, "storeShopNo": "227585253310046", "dayOrderSeq": 337, "storeDistrict": "香洲区", "isSigned": 0, "storeProvince": "广东省", "origin": 0, "storeGPSLongitude": "113.55951672652247", "discount": 0, "storeID": 333, "productCount": 1, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "corporator": "hft", "serverSaved": true, "payType": "wechat", "discountType": 2, "storeName": "3A福利社", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1557231358000, "smallChange": 0, "storeGPSName": "", "erase": 0, "product": [{"count": 1, "name": "福隆红油鸡90g", "unitID": 8, "barcode": "6936455900067", "pricePer": 4, "retailPrice": 4, "tradePrice": 0, "categoryID": 2}], "storeGPSAddress": "", "orderID": "15572313547723331851", "moneyBeforeWholeDiscount": 4, "storeCategory": "normal", "receivable": 4, "faceID": "", "storeOwnUserId": 235, "paymentChannel": 0, "paymentScenarios": "PASV", "storeAddress": "StoreAddress", "totalNoDiscount": 4, "payedTotal": 4, "storeGPSLatitude": "22.280635051859548", "storeCreateDateTS": 1520206281000, "storeCity": "珠海市", "memberID": "0"}
{"discountRate": 1, "dayOrderSeq": 47, "storeDistrict": "岳麓区", "isSigned": 0, "storeProvince": "湖南省", "origin": 0, "storeGPSLongitude": "112.9422938816664", "discount": 0, "storeID": 3354, "productCount": 2, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "corporator": "hnzy", "serverSaved": true, "payType": "cash", "discountType": 2, "storeName": "雅堂小超龙凌云食品店", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1560692925000, "smallChange": 0, "storeGPSName": "", "erase": 0, "product": [{"count": 1, "name": "白沙品包装", "unitID": 8, "barcode": "6901028191043", "pricePer": 10, "retailPrice": 10, "tradePrice": 0, "categoryID": 2}, {"count": 1, "name": "双喜经典包装", "unitID": 8, "barcode": "6901028000642", "pricePer": 12, "retailPrice": 12, "tradePrice": 0, "categoryID": 2}], "storeGPSAddress": "", "orderID": "156069292447933547332", "moneyBeforeWholeDiscount": 22, "storeCategory": "normal", "receivable": 22, "faceID": "", "storeOwnUserId": 3324, "paymentChannel": 0, "paymentScenarios": "OTHER", "storeAddress": "StoreAddress", "totalNoDiscount": 22, "payedTotal": 22, "storeGPSLatitude": "28.14020117156302", "storeCreateDateTS": 1546940546000, "payStatus": -1, "storeCity": "长沙市", "memberID": "0"}
{"discountRate": 1, "storeShopNo": "None", "dayOrderSeq": 3, "storeDistrict": "龙华区", "isSigned": 0, "storeProvince": "广东省", "origin": 0, "storeGPSLongitude": "113.99223893880843", "discount": 0, "storeID": 3367, "productCount": 1, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "payType": "cash", "discountType": 2, "storeName": "58优品便利店", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1552019799000, "smallChange": 0, "storeGPSName": "None", "erase": 0, "product": [{"count": 1, "name": "无码商品", "unitID": 0, "barcode": "99999999-1", "pricePer": 19, "retailPrice": 19, "tradePrice": 0, "categoryID": 1}], "storeGPSAddress": "None", "orderID": "155201979900933677797", "moneyBeforeWholeDiscount": 19, "storeCategory": "normal", "receivable": 19, "faceID": "", "storeOwnUserId": 3337, "paymentChannel": 0, "paymentScenarios": "OTHER", "storeAddress": "StoreAddress", "totalNoDiscount": 19, "payedTotal": 19, "storeGPSLatitude": "22.68867017558772", "storeCreateDateTS": 1547023238000, "storeCity": "深圳市", "memberID": "0"}
{"discountRate": 1, "dayOrderSeq": 20, "storeDistrict": "石峰区", "isSigned": 0, "storeProvince": "湖南省", "origin": 0, "storeGPSLongitude": "113.0943855643273", "discount": 0, "storeID": 832, "productCount": 4, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "corporator": "hnzy", "serverSaved": true, "payType": "wechat", "discountType": 2, "storeName": "四季春商店", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1563413959000, "smallChange": 0, "storeGPSName": "", "erase": 0, "product": [{"count": 1, "name": "百事可乐可乐型汽水", "unitID": 2, "barcode": "6940159410029", "pricePer": 3, "retailPrice": 3, "tradePrice": 0, "categoryID": 2}, {"count": 1, "name": "白沙精品三代包装", "unitID": 8, "barcode": "6901028192729", "pricePer": 15, "retailPrice": 15, "tradePrice": 0, "categoryID": 2}, {"count": 1, "name": "张新发槟榔35g20元的", "unitID": 8, "barcode": "6925909980151", "pricePer": 17, "retailPrice": 17, "tradePrice": 0, "categoryID": 2}, {"count": 1, "name": "娇子阳光包装", "unitID": 8, "barcode": "6901028084314", "pricePer": 10, "retailPrice": 10, "tradePrice": 0, "categoryID": 2}], "storeGPSAddress": "", "orderID": "15634139565318326739", "moneyBeforeWholeDiscount": 45, "storeCategory": "normal", "receivable": 45, "faceID": "", "storeOwnUserId": 690, "paymentChannel": 0, "paymentScenarios": "PASV", "storeAddress": "StoreAddress", "totalNoDiscount": 45, "payedTotal": 45, "storeGPSLatitude": "27.88922284307604", "storeCreateDateTS": 1535856054000, "payStatus": -1, "storeCity": "株洲市", "memberID": "0"}
{"discountRate": 1, "storeShopNo": "277551753310007", "dayOrderSeq": 46, "storeDistrict": "开福区", "isSigned": 1, "storeProvince": "湖南省", "origin": 0, "storeGPSLongitude": "112.97533", "discount": 0, "storeID": 949, "productCount": 1, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "corporator": "hnzy", "serverSaved": true, "payType": "cash", "discountType": 2, "storeName": "天猫小超(英桥便利店)", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1565683992000, "smallChange": 0, "storeGPSName": "", "erase": 0, "product": [{"count": 1, "name": "星球筒", "unitID": 0, "barcode": "6926617930049", "pricePer": 6, "retailPrice": 6, "tradePrice": 0, "categoryID": 1}], "storeGPSAddress": "", "orderID": "15656839914979495195", "moneyBeforeWholeDiscount": 6, "storeCategory": "normal", "receivable": 6, "faceID": "", "storeOwnUserId": 809, "paymentChannel": 0, "paymentScenarios": "OTHER", "storeAddress": "StoreAddress", "totalNoDiscount": 6, "payedTotal": 6, "storeGPSLatitude": "28.211737", "storeCreateDateTS": 1536655716000, "payStatus": -1, "storeCity": "长沙市", "memberID": "0"}
{"discountRate": -1, "storeShopNo": "277584553310040", "dayOrderSeq": 200, "storeDistrict": "宝安区", "isSigned": 1, "storeProvince": "广东省", "origin": 0, "storeGPSLongitude": "114.014565", "discount": 1.5, "storeID": 4213, "productCount": 2, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "corporator": "hnzy", "serverSaved": true, "payType": "cash", "discountType": 4, "storeName": "云兜便利店", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1561301033000, "smallChange": 0, "storeGPSName": "", "erase": 0, "product": [{"count": 3, "name": "红牛维生素功能饮料", "unitID": 0, "barcode": "6920202888883", "pricePer": 6, "retailPrice": 6, "tradePrice": 0, "categoryID": 1}, {"count": 1, "name": "优益C活菌型乳酸菌饮品原味340ml", "unitID": 0, "barcode": "6934665087653", "pricePer": 6, "retailPrice": 6, "tradePrice": 0, "categoryID": 1}], "storeGPSAddress": "", "orderID": "156130102845742139251", "moneyBeforeWholeDiscount": 24, "storeCategory": "normal", "receivable": 22.5, "faceID": "", "storeOwnUserId": 4250, "paymentChannel": 0, "paymentScenarios": "OTHER", "storeAddress": "StoreAddress", "totalNoDiscount": 24, "payedTotal": 22.5, "storeGPSLatitude": "22.630766", "storeCreateDateTS": 1558930437000, "payStatus": -1, "storeCity": "深圳市", "memberID": "0"}
{"discountRate": 1, "dayOrderSeq": 209, "storeDistrict": "龙华区", "isSigned": 0, "storeProvince": "广东省", "origin": 0, "storeGPSLongitude": "114.03267357993454", "discount": 0, "storeID": 3487, "productCount": 1, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "corporator": "hnzy", "serverSaved": true, "payType": "cash", "discountType": 2, "storeName": "友淇便利店(富联店)", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1563104184000, "smallChange": 0, "storeGPSName": "", "erase": 0, "product": [{"count": 1, "name": "炫迈水蜜西瓜味无糖口香糖", "unitID": 0, "barcode": "6954432710249", "pricePer": 6, "retailPrice": 6, "tradePrice": 0, "categoryID": 2}], "storeGPSAddress": "", "orderID": "156310418355034879683", "moneyBeforeWholeDiscount": 6, "storeCategory": "normal", "receivable": 6, "faceID": "", "storeOwnUserId": 3456, "paymentChannel": 0, "paymentScenarios": "OTHER", "storeAddress": "StoreAddress", "totalNoDiscount": 6, "payedTotal": 6, "storeGPSLatitude": "22.669731307672212", "storeCreateDateTS": 1548392420000, "payStatus": -1, "storeCity": "深圳市", "memberID": "0"}
{"discountRate": 1, "dayOrderSeq": 1, "storeDistrict": "天心区", "isSigned": 0, "storeProvince": "湖南省", "origin": 0, "storeGPSLongitude": "", "discount": 0, "storeID": 2583, "productCount": 1, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "corporator": "hnzy", "serverSaved": true, "payType": "cash", "discountType": 2, "storeName": "保富烟酒店", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1557558714000, "smallChange": 0, "storeGPSName": "", "erase": 0, "product": [{"count": 2, "name": "中华条装", "unitID": 10, "barcode": "6901028075015", "pricePer": 450, "retailPrice": 450, "tradePrice": 0, "categoryID": 2}], "storeGPSAddress": "", "orderID": "155755871335925837481", "moneyBeforeWholeDiscount": 900, "storeCategory": "normal", "receivable": 900, "faceID": "", "storeOwnUserId": 2534, "paymentChannel": 0, "paymentScenarios": "OTHER", "storeAddress": "StoreAddress", "totalNoDiscount": 900, "payedTotal": 900, "storeGPSLatitude": "", "storeCreateDateTS": 1542779631000, "storeCity": "长沙市", "memberID": "0"}
{"discountRate": 1, "dayOrderSeq": 92, "storeDistrict": "福田区", "isSigned": 0, "storeProvince": "广东省", "origin": 0, "storeGPSLongitude": "", "discount": 0, "storeID": 3561, "productCount": 1, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "payType": "cash", "discountType": 2, "storeName": "新安喜乐惠(友捷)", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1552703028000, "smallChange": 0, "storeGPSName": "", "erase": 0, "product": [{"count": 1, "name": "玉溪条装", "unitID": 0, "barcode": "6901028316866", "pricePer": 215, "retailPrice": 215, "tradePrice": 0, "categoryID": 1}], "storeGPSAddress": "", "orderID": "155270302815435615521", "moneyBeforeWholeDiscount": 215, "storeCategory": "normal", "receivable": 215, "faceID": "", "storeOwnUserId": 3541, "paymentChannel": 0, "paymentScenarios": "OTHER", "storeAddress": "StoreAddress", "totalNoDiscount": 215, "payedTotal": 215, "storeGPSLatitude": "", "storeCreateDateTS": 1551762981000, "storeCity": "深圳市", "memberID": "0"}
{"discountRate": 1, "dayOrderSeq": 15, "storeDistrict": "芙蓉区", "isSigned": 0, "storeProvince": "湖南省", "origin": 0, "storeGPSLongitude": "113.03765", "discount": 0, "storeID": 1975, "productCount": 1, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "corporator": "hnzy", "serverSaved": true, "payType": "cash", "discountType": 2, "storeName": "鼎亨烟酒", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1560845929000, "smallChange": 0, "storeGPSName": "", "erase": 0, "product": [{"count": 1, "name": "食用槟榔运当头8g", "unitID": 8, "barcode": "6931273213559", "pricePer": 15, "retailPrice": 15, "tradePrice": 0, "categoryID": 2}], "storeGPSAddress": "", "orderID": "156084592836019756928", "moneyBeforeWholeDiscount": 15, "storeCategory": "normal", "receivable": 15, "faceID": "", "storeOwnUserId": 1913, "paymentChannel": 0, "paymentScenarios": "OTHER", "storeAddress": "StoreAddress", "totalNoDiscount": 15, "payedTotal": 15, "storeGPSLatitude": "28.201408", "storeCreateDateTS": 1541145961000, "payStatus": -1, "storeCity": "长沙市", "memberID": "0"}
{"discountRate": 1, "storeShopNo": "277585253310012", "dayOrderSeq": 283, "storeDistrict": "香洲区", "isSigned": 1, "storeProvince": "广东省", "origin": 0, "storeGPSLongitude": "113.53829251118407", "discount": 0, "storeID": 389, "productCount": 1, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "payType": "cash", "discountType": 2, "storeName": "日日佳超市", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1542464496000, "smallChange": 0, "storeGPSName": "None", "erase": 0, "product": [{"count": 4, "name": "冰蓝薄荷万宝路", "unitID": 8, "barcode": "7622100916345", "pricePer": 18, "retailPrice": 18, "tradePrice": 16.2, "categoryID": 1}], "storeGPSAddress": "None", "orderID": "15424644956013899408", "moneyBeforeWholeDiscount": 72, "storeCategory": "normal", "receivable": 72, "faceID": "", "storeOwnUserId": 285, "paymentChannel": 0, "paymentScenarios": "OTHER", "storeAddress": "StoreAddress", "totalNoDiscount": 72, "payedTotal": 72, "storeGPSLatitude": "22.219455067668832", "storeCreateDateTS": 1522260134000, "storeCity": "珠海市", "memberID": "0"}
{"discountRate": 1, "storeShopNo": "None", "dayOrderSeq": 6, "storeDistrict": "斗门区", "isSigned": 0, "storeProvince": "广东省", "origin": 0, "storeGPSLongitude": "None", "discount": 0, "storeID": 528, "productCount": 1, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "payType": "wechat", "discountType": 2, "storeName": "日兴旺商店", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1551943482000, "smallChange": 0, "storeGPSName": "None", "erase": 0, "product": [{"count": 1, "name": "硬白沙(单盒)", "unitID": 0, "barcode": "6901028191029", "pricePer": 6, "retailPrice": 6, "tradePrice": 0, "categoryID": 1}], "storeGPSAddress": "None", "orderID": "15519434816425281813", "moneyBeforeWholeDiscount": 6, "storeCategory": "normal", "receivable": 6, "faceID": "", "storeOwnUserId": 378, "paymentChannel": 0, "paymentScenarios": "PASV", "storeAddress": "StoreAddress", "totalNoDiscount": 6, "payedTotal": 6, "storeGPSLatitude": "None", "storeCreateDateTS": 1525635891000, "storeCity": "珠海市", "memberID": "0"}
{"discountRate": 1, "dayOrderSeq": 2, "storeDistrict": "坪山区", "isSigned": 0, "storeProvince": "广东省", "origin": 0, "storeGPSLongitude": "114.34535", "discount": 0, "storeID": 3848, "productCount": 3, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "corporator": "hnzy", "serverSaved": true, "payType": "wechat", "discountType": 2, "storeName": "福家百货", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1560617096000, "smallChange": 0, "storeGPSName": "", "erase": 0, "product": [{"count": 8, "name": "盐焗鱼棒", "unitID": 3, "barcode": "6933213200933", "pricePer": 1, "retailPrice": 1, "tradePrice": 0, "categoryID": 2}, {"count": 2, "name": "硬云烟", "unitID": 0, "barcode": "6901028046886", "pricePer": 11, "retailPrice": 11, "tradePrice": 0, "categoryID": 1}, {"count": 4, "name": "9度珠江0度精品啤酒600ml", "unitID": 2, "barcode": "6970644591117", "pricePer": 4, "retailPrice": 4, "tradePrice": 0, "categoryID": 2}], "storeGPSAddress": "", "orderID": "156061709472738486267", "moneyBeforeWholeDiscount": 46, "storeCategory": "normal", "receivable": 46, "faceID": "", "storeOwnUserId": 3846, "paymentChannel": 0, "paymentScenarios": "PASV", "storeAddress": "StoreAddress", "totalNoDiscount": 46, "payedTotal": 46, "storeGPSLatitude": "22.694502", "storeCreateDateTS": 1554968575000, "payStatus": -1, "storeCity": "深圳市", "memberID": "0"}
{"discountRate": 1, "storeShopNo": "None", "dayOrderSeq": 360, "storeDistrict": "岳麓区", "isSigned": 0, "storeProvince": "湖南省", "origin": 0, "storeGPSLongitude": "112.91247278451918", "discount": 0, "storeID": 2541, "productCount": 1, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "payType": "wechat", "discountType": 2, "storeName": "芙蓉兴盛兢业商店", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1551441739000, "smallChange": 0, "storeGPSName": "None", "erase": 0, "product": [{"count": 1, "name": "吉列威锋剃须刀架", "unitID": 9, "barcode": "6900068900035", "pricePer": 10, "retailPrice": 10, "tradePrice": 7.9, "categoryID": 8}], "storeGPSAddress": "None", "orderID": "155144173636925411265", "moneyBeforeWholeDiscount": 10, "storeCategory": "normal", "receivable": 10, "faceID": "", "storeOwnUserId": 2491, "paymentChannel": 0, "paymentScenarios": "PASV", "storeAddress": "StoreAddress", "totalNoDiscount": 10, "payedTotal": 10, "storeGPSLatitude": "28.21208175040942", "storeCreateDateTS": 1542692669000, "storeCity": "长沙市", "memberID": "0"}
{"discountRate": 1, "storeShopNo": "277584253310011", "dayOrderSeq": 285, "storeDistrict": "龙华区", "isSigned": 0, "storeProvince": "广东省", "origin": 0, "storeGPSLongitude": "114.03908", "discount": 0, "storeID": 3981, "productCount": 2, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "corporator": "hnzy", "serverSaved": true, "payType": "wechat", "discountType": 2, "storeName": "阿里之门(共和新村)", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1558796138000, "smallChange": 0, "storeGPSName": "", "erase": 0, "product": [{"count": 1, "name": "南街村北京干吃便面65g", "unitID": 0, "barcode": "6904417011274", "pricePer": 1, "retailPrice": 1, "tradePrice": 0, "categoryID": 1}, {"count": 1, "name": "红塔山经典包装", "unitID": 0, "barcode": "6901028314978", "pricePer": 8, "retailPrice": 8, "tradePrice": 0, "categoryID": 1}], "storeGPSAddress": "", "orderID": "155879613075539818016", "moneyBeforeWholeDiscount": 9, "storeCategory": "normal", "receivable": 9, "faceID": "", "storeOwnUserId": 3994, "paymentChannel": 1, "paymentScenarios": "PURC", "storeAddress": "StoreAddress", "totalNoDiscount": 9, "payedTotal": 9, "storeGPSLatitude": "22.652893", "storeCreateDateTS": 1557041947000, "storeCity": "深圳市", "memberID": "0"}
{"discountRate": 1, "dayOrderSeq": 555, "storeDistrict": "南山区", "isSigned": 0, "storeProvince": "广东省", "origin": 0, "storeGPSLongitude": "113.99646351072916", "discount": 0, "storeID": 3921, "productCount": 1, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "corporator": "hnzy", "serverSaved": true, "payType": "cash", "discountType": 2, "storeName": "每易分便利店", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1561902475000, "smallChange": 0, "storeGPSName": "", "erase": 0, "product": [{"count": 2, "name": "N哈尔滨冰纯啤酒", "unitID": 0, "barcode": "6948960100221", "pricePer": 5.5, "retailPrice": 5.5, "tradePrice": 0, "categoryID": 1}], "storeGPSAddress": "", "orderID": "156190247503339219232", "moneyBeforeWholeDiscount": 11, "storeCategory": "normal", "receivable": 11, "faceID": "", "storeOwnUserId": 3928, "paymentChannel": 0, "paymentScenarios": "OTHER", "storeAddress": "StoreAddress", "totalNoDiscount": 11, "payedTotal": 11, "storeGPSLatitude": "22.585739888612377", "storeCreateDateTS": 1555918632000, "payStatus": -1, "storeCity": "深圳市", "memberID": "0"}
{"discountRate": 1, "dayOrderSeq": 36, "storeDistrict": "宝安区", "isSigned": 0, "storeProvince": "广东省", "origin": 0, "storeGPSLongitude": "113.79651", "discount": 0, "storeID": 4187, "productCount": 1, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "corporator": "hnzy", "serverSaved": true, "payType": "wechat", "discountType": 2, "storeName": "真心美百货", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1562584535000, "smallChange": 0, "storeGPSName": "", "erase": 0, "product": [{"count": 1, "name": "双喜精品好日子包装", "unitID": 0, "barcode": "6901028942898", "pricePer": 11, "retailPrice": 11, "tradePrice": 0, "categoryID": 1}], "storeGPSAddress": "", "orderID": "156258453426641873476", "moneyBeforeWholeDiscount": 11, "storeCategory": "normal", "receivable": 11, "faceID": "", "storeOwnUserId": 4224, "paymentChannel": 0, "paymentScenarios": "PASV", "storeAddress": "StoreAddress", "totalNoDiscount": 11, "payedTotal": 11, "storeGPSLatitude": "22.727442", "storeCreateDateTS": 1558750396000, "payStatus": -1, "storeCity": "深圳市", "memberID": "0"}
{"discountRate": 1, "dayOrderSeq": 21, "storeDistrict": "天心区", "isSigned": 0, "storeProvince": "湖南省", "origin": 0, "storeGPSLongitude": "", "discount": 0, "storeID": 2484, "productCount": 2, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "payType": "wechat", "discountType": 2, "storeName": "芙蓉兴盛桢红便利店", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1554514709000, "smallChange": 0, "storeGPSName": "", "erase": 0, "product": [{"count": 1, "name": "张新发木糖醇20元槟榔", "unitID": 4, "barcode": "6925909980342", "pricePer": 18, "retailPrice": 18, "tradePrice": 0, "categoryID": 2}, {"count": 1, "name": "小郎酒100ml4", "unitID": 2, "barcode": "6901683821255", "pricePer": 12, "retailPrice": 12, "tradePrice": 0, "categoryID": 2}], "storeGPSAddress": "", "orderID": "155451470752024843308", "moneyBeforeWholeDiscount": 30, "storeCategory": "normal", "receivable": 30, "faceID": "", "storeOwnUserId": 2431, "paymentChannel": 0, "paymentScenarios": "PASV", "storeAddress": "StoreAddress", "totalNoDiscount": 30, "payedTotal": 30, "storeGPSLatitude": "", "storeCreateDateTS": 1542598441000, "storeCity": "长沙市", "memberID": "0"}
{"discountRate": 1, "storeShopNo": "277584553310011", "dayOrderSeq": 56, "storeDistrict": "龙华区", "isSigned": 1, "storeProvince": "广东省", "origin": 0, "storeGPSLongitude": "114.00903", "discount": 0, "storeID": 3108, "productCount": 1, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "corporator": "hnzy", "serverSaved": true, "payType": "cash", "discountType": 2, "storeName": "喜洋洋便利店", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1566007335000, "smallChange": 0, "storeGPSName": "", "erase": 0, "product": [{"count": 1, "name": "红双喜上海包装", "unitID": 8, "barcode": "6901028018425", "pricePer": 11, "retailPrice": 11, "tradePrice": 0, "categoryID": 2}], "storeGPSAddress": "", "orderID": "156600733456431083481", "moneyBeforeWholeDiscount": 11, "storeCategory": "normal", "receivable": 11, "faceID": "", "storeOwnUserId": 3080, "paymentChannel": 0, "paymentScenarios": "OTHER", "storeAddress": "StoreAddress", "totalNoDiscount": 11, "payedTotal": 11, "storeGPSLatitude": "22.68606", "storeCreateDateTS": 1544672005000, "payStatus": -1, "storeCity": "深圳市", "memberID": "0"}
{"discountRate": 1, "dayOrderSeq": 43, "storeDistrict": "南山区", "isSigned": 0, "storeProvince": "广东省", "origin": 0, "storeGPSLongitude": "113.939705", "discount": 0, "storeID": 3722, "productCount": 1, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "corporator": "hnzy", "serverSaved": true, "payType": "cash", "discountType": 2, "storeName": "顺百旺商店", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1563710919000, "smallChange": 15, "storeGPSName": "", "erase": 0, "product": [{"count": 1, "name": "红双喜条装", "unitID": 0, "barcode": "6901028075084", "pricePer": 85, "retailPrice": 85, "tradePrice": 0, "categoryID": 2}], "storeGPSAddress": "", "orderID": "156371091810237225374", "moneyBeforeWholeDiscount": 85, "storeCategory": "normal", "receivable": 85, "faceID": "", "storeOwnUserId": 3709, "paymentChannel": 0, "paymentScenarios": "OTHER", "storeAddress": "StoreAddress", "totalNoDiscount": 85, "payedTotal": 100, "storeGPSLatitude": "22.621307", "storeCreateDateTS": 1553073703000, "payStatus": -1, "storeCity": "深圳市", "memberID": "0"}
{"discountRate": 1, "storeShopNo": "277552953310010", "dayOrderSeq": 13, "storeDistrict": "天元区", "isSigned": 1, "storeProvince": "湖南省", "origin": 0, "storeGPSLongitude": "undefined", "discount": 0, "storeID": 793, "productCount": 1, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "payType": "cash", "discountType": 2, "storeName": "天元区汇惠佳商行", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1546571056000, "smallChange": 0, "storeGPSName": "None", "erase": 0, "product": [{"count": 1, "name": "白沙包装", "unitID": 8, "barcode": "6901028191012", "pricePer": 4.5, "retailPrice": 4.5, "tradePrice": 3.81, "categoryID": 1}], "storeGPSAddress": "None", "orderID": "15465710556637938315", "moneyBeforeWholeDiscount": 4.5, "storeCategory": "normal", "receivable": 4.5, "faceID": "", "storeOwnUserId": 650, "paymentChannel": 0, "paymentScenarios": "OTHER", "storeAddress": "StoreAddress", "totalNoDiscount": 4.5, "payedTotal": 4.5, "storeGPSLatitude": "undefined", "storeCreateDateTS": 1535530065000, "storeCity": "株洲市", "memberID": "0"}
{"discountRate": -1, "storeShopNo": "None", "dayOrderSeq": 17, "storeDistrict": "宝安区", "isSigned": 0, "storeProvince": "广东省", "origin": 0, "storeGPSLongitude": "undefined", "discount": 31.5, "storeID": 2146, "productCount": 2, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "payType": "cash", "discountType": 1, "storeName": "旺竹商行", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1544420438000, "smallChange": 0, "storeGPSName": "None", "erase": 0, "product": [{"count": 1, "name": "双喜(硬经典)【条装】", "unitID": 4, "barcode": "6901028000659", "pricePer": 120, "retailPrice": 120, "tradePrice": 100.17, "categoryID": 21}, {"count": 1, "name": "双喜软经典条装", "unitID": 4, "barcode": "6901028000833", "pricePer": 110, "retailPrice": 110, "tradePrice": 85.86, "categoryID": 21}], "storeGPSAddress": "None", "orderID": "154442043410321468951", "moneyBeforeWholeDiscount": 198.5, "storeCategory": "normal", "receivable": 198.5, "faceID": "", "storeOwnUserId": 2093, "paymentChannel": 0, "paymentScenarios": "OTHER", "storeAddress": "StoreAddress", "totalNoDiscount": 230, "payedTotal": 198.5, "storeGPSLatitude": "undefined", "storeCreateDateTS": 1541659036000, "storeCity": "深圳市", "memberID": "0"}
{"discountRate": 1, "dayOrderSeq": 58, "storeDistrict": "宝安区", "isSigned": 0, "storeProvince": "广东省", "origin": 0, "storeGPSLongitude": "113.85742434240024", "discount": 0, "storeID": 3810, "productCount": 1, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "corporator": "hnzy", "serverSaved": true, "payType": "cash", "discountType": 2, "storeName": "快乐购便利店", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1565941171000, "smallChange": 16, "storeGPSName": "", "erase": 0, "product": [{"count": 2, "name": "中怡宝", "unitID": 4, "barcode": "33", "pricePer": 2, "retailPrice": 2, "tradePrice": 0, "categoryID": 2}], "storeGPSAddress": "", "orderID": "156594117071738108450", "moneyBeforeWholeDiscount": 4, "storeCategory": "normal", "receivable": 4, "faceID": "", "storeOwnUserId": 3806, "paymentChannel": 0, "paymentScenarios": "OTHER", "storeAddress": "StoreAddress", "totalNoDiscount": 4, "payedTotal": 20, "storeGPSLatitude": "22.706607254239632", "storeCreateDateTS": 1554275574000, "payStatus": -1, "storeCity": "深圳市", "memberID": "0"}
{"discountRate": 1, "dayOrderSeq": 15, "storeDistrict": "宝安区", "isSigned": 0, "storeProvince": "广东省", "origin": 0, "storeGPSLongitude": "113.84907", "discount": 0, "storeID": 3812, "productCount": 3, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "corporator": "hnzy", "serverSaved": true, "payType": "cash", "discountType": 2, "storeName": "诚信达便利店", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1557505263000, "smallChange": 0, "storeGPSName": "", "erase": 0, "product": [{"count": 1, "name": "无码商品", "unitID": 0, "barcode": "99999999-1", "pricePer": 12, "retailPrice": 12, "tradePrice": 0, "categoryID": 1}, {"count": 1, "name": "康师傅茉莉清茶", "unitID": 0, "barcode": "6921294398434", "pricePer": 3, "retailPrice": 3, "tradePrice": 0, "categoryID": 1}, {"count": 2, "name": "大瓶东鹏", "unitID": 0, "barcode": "6934502301850", "pricePer": 5, "retailPrice": 5, "tradePrice": 0, "categoryID": 1}], "storeGPSAddress": "", "orderID": "155750526255838124039", "moneyBeforeWholeDiscount": 25, "storeCategory": "normal", "receivable": 25, "faceID": "", "storeOwnUserId": 3808, "paymentChannel": 0, "paymentScenarios": "OTHER", "storeAddress": "StoreAddress", "totalNoDiscount": 25, "payedTotal": 25, "storeGPSLatitude": "22.609636", "storeCreateDateTS": 1554353157000, "storeCity": "深圳市", "memberID": "0"}
{"discountRate": 1, "dayOrderSeq": 47, "storeDistrict": "雨花区", "isSigned": 0, "storeProvince": "湖南省", "origin": 0, "storeGPSLongitude": "113.00244882702829", "discount": 0, "storeID": 2071, "productCount": 1, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "corporator": "hnzy", "serverSaved": true, "payType": "wechat", "discountType": 2, "storeName": "紫荆卷烟零售店庆誉园南食店", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1564998316000, "smallChange": 0, "storeGPSName": "", "erase": 0, "product": [{"count": 1, "name": "白沙软包装", "unitID": 4, "barcode": "6901028191012", "pricePer": 7, "retailPrice": 7, "tradePrice": 0, "categoryID": 2}], "storeGPSAddress": "", "orderID": "156499831475020713883", "moneyBeforeWholeDiscount": 7, "storeCategory": "normal", "receivable": 7, "faceID": "", "storeOwnUserId": 2013, "paymentChannel": 0, "paymentScenarios": "PASV", "storeAddress": "StoreAddress", "totalNoDiscount": 7, "payedTotal": 7, "storeGPSLatitude": "28.184128846471438", "storeCreateDateTS": 1541492605000, "payStatus": -1, "storeCity": "长沙市", "memberID": "0"}
{"discountRate": 1, "storeShopNo": "277617253310001", "dayOrderSeq": 89, "storeDistrict": "秀峰区", "isSigned": 1, "storeProvince": "广西壮族自治区", "origin": 0, "storeGPSLongitude": "110.26522502303122", "discount": 0, "storeID": 1260, "productCount": 1, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "payType": "cash", "discountType": 2, "storeName": "黄玲丽烟酒店", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1553349153000, "smallChange": 0, "storeGPSName": "", "erase": 0, "product": [{"count": 1, "name": "双喜包装", "unitID": 8, "barcode": "6901028001489", "pricePer": 6.5, "retailPrice": 6.5, "tradePrice": 0, "categoryID": 2}], "storeGPSAddress": "", "orderID": "155334915334912606819", "moneyBeforeWholeDiscount": 6.5, "storeCategory": "normal", "receivable": 6.5, "faceID": "", "storeOwnUserId": 1142, "paymentChannel": 0, "paymentScenarios": "OTHER", "storeAddress": "StoreAddress", "totalNoDiscount": 6.5, "payedTotal": 6.5, "storeGPSLatitude": "25.26454421886171", "storeCreateDateTS": 1537933327000, "storeCity": "桂林市", "memberID": "0"}
{"discountRate": 1, "dayOrderSeq": 50, "storeDistrict": "芙蓉区", "isSigned": 0, "storeProvince": "湖南省", "origin": 0, "storeGPSLongitude": "113.0332370325186", "discount": 0, "storeID": 2658, "productCount": 1, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "corporator": "hnzy", "serverSaved": true, "payType": "cash", "discountType": 2, "storeName": "蔚然锦和厚千批发", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1558531377000, "smallChange": 0, "storeGPSName": "", "erase": 0, "product": [{"count": 1, "name": "油炸休闲小食品味油炸糕点", "unitID": 0, "barcode": "6921527220525", "pricePer": 2, "retailPrice": 2, "tradePrice": 0, "categoryID": 1}], "storeGPSAddress": "", "orderID": "155853137686226583820", "moneyBeforeWholeDiscount": 2, "storeCategory": "normal", "receivable": 2, "faceID": "", "storeOwnUserId": 2612, "paymentChannel": 0, "paymentScenarios": "OTHER", "storeAddress": "StoreAddress", "totalNoDiscount": 2, "payedTotal": 2, "storeGPSLatitude": "28.19972922323995", "storeCreateDateTS": 1542950224000, "storeCity": "长沙市", "memberID": "0"}
{"discountRate": 1, "storeShopNo": "None", "dayOrderSeq": 13, "storeDistrict": "斗门区", "isSigned": 0, "storeProvince": "广东省", "origin": 0, "storeGPSLongitude": "113.27462", "discount": 0, "storeID": 1286, "productCount": 1, "operatorName": "OperatorName", "operator": "NameStr", "storeStatus": "open", "storeOwnUserTel": 12345678910, "payType": "cash", "discountType": 2, "storeName": "丰辉超市", "storeOwnUserName": "OwnUserNameStr", "dateTS": 1546442282000, "smallChange": 0, "storeGPSName": "None", "erase": 0, "product": [{"count": 1, "name": "统一阿萨姆原味奶茶500ml", "unitID": 2, "barcode": "6925303730574", "pricePer": 4, "retailPrice": 4, "tradePrice": 3, "categoryID": 1}], "storeGPSAddress": "None", "orderID": "154644228136112861470", "moneyBeforeWholeDiscount": 4, "storeCategory": "normal", "receivable": 4, "faceID": "", "storeOwnUserId": 1168, "paymentChannel": 0, "paymentScenarios": "OTHER", "storeAddress": "StoreAddress", "totalNoDiscount": 4, "payedTotal": 4, "storeGPSLatitude": "22.173456", "storeCreateDateTS": 1537952224000, "storeCity": "珠海市", "memberID": "0"}

代码:存入数据库和写入hive操作一样;

#coding:utf-8
from pyspark.sql import SparkSession
from pyspark.sql import functions as F
from pyspark.storagelevel import StorageLevel
from pyspark.sql.types import StringType"""
需求1.各省销售指标每个省份的销售额统计
需求2.TOP3销售省份中,有多少家店铺日均销售额1000+
需求3.TOP3省份中各个省份的平均单单价
需求4.TOP3省份中,各个省份的支付类型比例receivable:订单金额
storeprovince:店铺省份
dateType:支付类型
storeID:店铺ID
"""
if __name__ == '__main__':spark = SparkSession.builder. \appName("SparkSQL Example"). \master("local[*]"). \config("spark.sql.shuffle.partitions", "2"). \config("spark.sql.warehouse.dir", "hdfs://192.168.88.161:8020/user/hive/warehouse"). \config("hive.metastore.uris", "thrift://192.168.88.161:9083").\enableHiveSupport(). \getOrCreate()#1.读取数据#省份信息,缺失值过滤,null值过滤#订单金额单笔超过10000异常数据过滤#列值裁剪,将不需要的属性删除df =spark.read.format("json").load("../../data/input/mini.json"). \dropna(thresh=1, subset=['storeProvince']). \filter("storeProvince != 'null'"). \filter("receivable < 10000"). \select("storeProvince", "storeID", "receivable", "dateTS", "payType")# TODO 需求1: 各省 销售额统计province_sale_df = df.groupBy("storeProvince").sum("receivable"). \withColumnRenamed("sum(receivable)", "money"). \withColumn("money", F.round("money", 2)). \orderBy("money", ascending=False)# province_sale_df.show(truncate=False)# TODO 需求一写出到本地Mysql数据库try:province_sale_df.write.mode("overwrite"). \format("jdbc"). \option("driver", "com.mysql.jdbc.Driver"). \option("url", "jdbc:mysql://192.168.88.161:3306/bigdata?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=utf8"). \option("dbtable", "province_sale"). \option("user", "root"). \option("password", "123456"). \option("encoding", "utf-8"). \save()except Exception as e:print("-----数据加载失败,错误异常信息:", e)# TODO 写出Hive表 saveAsTable 可以写出表 要求已经配置好Spark On Hive, 配置好后会将表写入到Hive的数据仓库中province_sale_df.write.mode("overwrite").saveAsTable("default.province_sale", "parquet")#TODO 需求2:TOP3销售省份中,有多少家店铺日均销售额1000+#现过滤top3top3_province_df=province_sale_df.limit(3).select("storeProvince").withColumnRenamed("storeProvince", "top3_province")# 2.2 和 原始的DF进行内关联, 数据关联后, 就是全部都是TOP3省份的销售数据了top3_province_df_joined = df.join(top3_province_df, on = df['storeProvince'] == top3_province_df['top3_province'])top3_province_df_joined.persist(StorageLevel.MEMORY_AND_DISK)# from_unixtime时间戳的转换的精度是秒级, 数据的精度是毫秒级, 要对数据进行精度的裁剪province_hot_store_count_df = top3_province_df_joined.groupBy("storeProvince", "storeID",F.from_unixtime(df['dateTS'].substr(0, 10),"yyyy-MM-dd").alias("day")). \sum("receivable").withColumnRenamed("sum(receivable)", "money"). \filter("money > 1000"). \dropDuplicates(subset=["storeID"]). \groupBy("storeProvince").count()# TODO 需求二写出到本地Mysql数据库try:province_hot_store_count_df.write.mode("overwrite"). \format("jdbc"). \option("driver", "com.mysql.jdbc.Driver"). \option("url", "jdbc:mysql://192.168.88.161:3306/bigdata?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=utf8"). \option("dbtable", "province_hot_store_count"). \option("user", "root"). \option("password", "123456"). \option("encoding", "utf-8"). \save()except Exception as e:print("-----数据加载失败,错误异常信息:", e)# TODO 写出Hive表 saveAsTable 可以写出表 要求已经配置好Spark On Hive, 配置好后会将表写入到Hive的数据仓库中province_hot_store_count_df.write.mode("overwrite").saveAsTable("province_hot_store_count", "parquet")# TODO 需求3: TOP3 省份中 各个省份的平均订单价格(单价)top3_province_order_avg_df = top3_province_df_joined.groupBy("storeProvince"). \avg("receivable"). \withColumnRenamed("avg(receivable)", "money"). \withColumn("money", F.round("money", 2)). \orderBy("money", ascending=False)# TODO 需求三写出到本地Mysql数据库try:top3_province_order_avg_df.write.mode("overwrite"). \format("jdbc"). \option("driver", "com.mysql.jdbc.Driver"). \option("url","jdbc:mysql://192.168.88.161:3306/bigdata?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=utf8"). \option("dbtable", "top3_province_order_avg"). \option("user", "root"). \option("password", "123456"). \option("encoding", "utf-8"). \save()except Exception as e:print("-----数据加载失败,错误异常信息:", e)# TODO 写出Hive表 saveAsTable 可以写出表 要求已经配置好Spark On Hive, 配置好后会将表写入到Hive的数据仓库中top3_province_order_avg_df.write.mode("overwrite").saveAsTable("top3_province_order_avg", "parquet")# TODO 需求4: TOP3 省份中, 各个省份的支付比例#窗口函数,可以用sql语句top3_province_df_joined.createTempView("province_pay")def udf_func(percent):return str(round(percent * 100, 2)) + "%"# 注册UDFmy_udf = F.udf(udf_func, StringType())#可读性较差,大概是从一个表中抽取另一个表pay_type_df = spark.sql("""SELECT storeProvince, payType, (COUNT(payType) / total) AS percent FROM(SELECT storeProvince, payType, count(1) OVER(PARTITION BY storeProvince) AS total FROM province_pay) AS subGROUP BY storeProvince, payType, total""").withColumn("percent", my_udf("percent"))# TODO 需求四写出到本地Mysql数据库try:pay_type_df.write.mode("overwrite"). \format("jdbc"). \option("driver", "com.mysql.jdbc.Driver"). \option("url","jdbc:mysql://192.168.88.161:3306/bigdata?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=utf8"). \option("dbtable", "pay_type_df"). \option("user", "root"). \option("password", "123456"). \option("encoding", "utf-8"). \save()except Exception as e:print("-----数据加载失败,错误异常信息:", e)# TODO 写出Hive表 saveAsTable 可以写出表 要求已经配置好Spark On Hive, 配置好后会将表写入到Hive的数据仓库中pay_type_df.write.mode("overwrite").saveAsTable("pay_type_df", "parquet")top3_province_df_joined.unpersist()

 运行结果:

MySQL:

hive:

 可能遇到的错误:

一定看看对应的环境中有对应的mysql的jar包,MySQL-connector-java-jar,并且版本一定要对应,如果出现下面的情况一定是没有jar包或版本不一致,登录自己的数据库看一看:

com.mysql.cj.jdbc.Driver

对应数据库要写入的对象的编码规则要与写入的表的编码规则一致,否则会报下面的错:

Incorrect string value: '\\xE6\\xB5\\x8B\\xE8\\xAF\\x95...' for colu......

 其中所有的服务都要开启,尤其注意hive的元数据存储服务和远程jdbc连接服务,看看9083端口,可能是集群中的任何一个节点,所有节点试着找一遍。

端口查看命令:

netstat -anp|grep 9083

导包的时候最好一个一个功能的导,不要用import * ,这个可能会导致未知错误,一些重复命名等问题

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/831038.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

数据结构与算法实验题五道 A一元多项式的求导 B还原二叉树 C 六度空间 D 基于词频的文件相似度 E 模拟excel排序

A (1) 输入格式说明&#xff1a; 以指数递降方式输入多项式非零项系数和指数&#xff08;绝对值均为不超过1000的整数&#xff09;。数字间以空格分隔。 (2) 输出格式说明&#xff1a; 以与输入相同的格式输出导数多项式非零项的系数和指数。数字间以空格分隔&#xff0c;但…

第八篇:隔离即力量:Python虚拟环境的终极指南

隔离即力量&#xff1a;Python虚拟环境的终极指南 1 引言 在编程的多元宇宙中&#xff0c;Python语言犹如一颗闪耀的星辰&#xff0c;其魅力不仅仅在于简洁的语法&#xff0c;更在于其庞大而繁荣的生态系统。然而&#xff0c;随着应用的增长和复杂性的提升&#xff0c;开发者们…

ChatGPT 记忆功能上线 能记住你和GPT互动的所有内容

你和ChatGPT的互动从今天开始变得更加智能&#xff01;ChatGPT现在可以记住你的偏好和对话细节&#xff0c;为你提供更加相关的回应。和它聊天&#xff0c;你可以教它记住新的东西&#xff0c;例如&#xff1a;“记住我是素食主义者&#xff0c;当你推荐食谱时。”想了解ChatGP…

【15】Head First Java 学习笔记

HeadFirst Java 本人有C语言基础&#xff0c;通过阅读Java廖雪峰网站&#xff0c;简单速成了java&#xff0c;但对其中一些入门概念有所疏漏&#xff0c;阅读本书以弥补。 第一章 Java入门 第二章 面向对象 第三章 变量 第四章 方法操作实例变量 第五章 程序实战 第六章 Java…

Java基于微信小程序+uniapp的校园失物招领小程序(V3.0)

博主介绍&#xff1a;✌程序员徐师兄、7年大厂程序员经历。全网粉丝12w、csdn博客专家、掘金/华为云/阿里云/InfoQ等平台优质作者、专注于Java技术领域和毕业项目实战✌ &#x1f345;文末获取源码联系&#x1f345; &#x1f447;&#x1f3fb; 精彩专栏推荐订阅&#x1f447;…

微软如何打造数字零售力航母系列科普06 - 如何使用微软的Copilot人工智能

如何使用微软的Copilot人工智能&#xff1f; Copilot和ChatGPT有很多相似之处&#xff0c;但微软的聊天机器人本身就有一定的优势。以下是如何对其进行旋转&#xff0c;并查看其最引人注目的功能。 ​​​​​​​ &#xff08;资料来源&#xff1a;Lance Whitney/微软&…

NLP 笔记:TF-IDF

TF-IDF&#xff08;Term Frequency-Inverse Document Frequency&#xff0c;词频-逆文档频率&#xff09;是一种用于信息检索和文本挖掘的统计方法&#xff0c;用来评估一个词在一组文档中的重要性。TF-IDF的基本思想是&#xff0c;如果某个词在一篇文档中出现频率高&#xff0…

使用c++类模板和迭代器进行List模拟实现

List 一、创建节点结构二、创建迭代器类1、类的结构2、一系列的运算符重载 三、创建list1、细节把握2、迭代器函数3、构造函数和析构函数4、增删查改的成员函数 一、创建节点结构 template <class T>//节点结构 struct ListNode {ListNode<T>* _next;ListNode<…

Springboot+vue+小程序+基于微信小程序的在线学习平台

一、项目介绍    基于Spring BootVue小程序的在线学习平台从实际情况出发&#xff0c;结合当前年轻人的学习环境喜好来开发。基于Spring BootVue小程序的在线学习平台在语言上使用Java语言进行开发&#xff0c;在数据库存储方面使用的MySQL数据库&#xff0c;开发工具是IDEA。…

APScheduler定时器使用:django中使用apscheduler,使用mysql做存储后端

一、基本环境 python版本&#xff1a;3.8.5 APScheduler3.10.4 Django3.2.7 djangorestframework3.15.1 SQLAlchemy2.0.29 PyMySQL1.1.0二、django基本设置 2.1、新增一个app 该app用来写apscheduler相关的代码 python manage.py startapp gs_scheduler 2.2、修改配置文件s…

Ollamallama

Olllama 直接下载ollama程序&#xff0c;安装后可在cmd里直接运行大模型&#xff1b; llama 3 meta 开源的最新llama大模型&#xff1b; 下载运行 1 ollama ollama run llama3 2 github 下载仓库&#xff0c;需要linux环境&#xff0c;windows可使用wsl&#xff1b; 接…

C++浮点数format时的舍入问题

C浮点数format时的舍入问题 首先有这样一段代码&#xff1a; #include <iostream> #include <stdio.h> using namespace std;int main() {cout << " main begin : " << endl;printf("%.0f \r\n", 1.5);printf("%.0f \r\n&…

吴恩达2022机器学习专项课程(一)8.2 解决过拟合

目录 解决过拟合&#xff08;一&#xff09;&#xff1a;增加数据解决过拟合&#xff08;二&#xff09;&#xff1a;减少特征特征选择缺点 解决过拟合&#xff08;三&#xff09;&#xff1a;正则化总结 解决过拟合&#xff08;一&#xff09;&#xff1a;增加数据 收集更多训…

【c++】模板编程解密:C++中的特化、实例化和分离编译

&#x1f525;个人主页&#xff1a;Quitecoder &#x1f525;专栏&#xff1a;c笔记仓 朋友们大家好&#xff0c;本篇文章我们来学习模版的进阶部分 目录 1.非类型模版参数按需实例化 2.模版的特化函数模版特化函数模版的特化类模版全特化偏特化 3.分离编译模版分离编译 1.非类…

综合性练习(后端代码练习4)——图书管理系统

目录 一、准备工作 二、约定前后端交互接口 1、需求分析 2、接口定义 &#xff08;1&#xff09;登录接口 &#xff08;2&#xff09;图书列表接口 三、服务器代码 &#xff08;1&#xff09;创建一个UserController类&#xff0c;实现登录验证接口 &#xff…

网络应用层之(6)L2TP协议详解

网络应用层之(6)L2TP协议 Author: Once Day Date: 2024年5月1日 一位热衷于Linux学习和开发的菜鸟&#xff0c;试图谱写一场冒险之旅&#xff0c;也许终点只是一场白日梦… 漫漫长路&#xff0c;有人对你微笑过嘛… 全系列文档可参考专栏&#xff1a;通信网络技术_Once-Day的…

Apollo Dreamview+之播放离线数据包

前提条件 完成 Dreamview 插件安装&#xff0c;参见 Studio 插件安装 。 操作步骤 您可以通过包管理和源码两种方式快速体验离线数据包播放操作。其中进入 docker 环境和启动 dreamview 的命令有所区别&#xff0c;请您按照命令进行操作。 步骤一&#xff1a;启动并打开 Dr…

C++学习第十四课:运算符类型与运算符重载

C学习第十四课&#xff1a;运算符类型与运算符重载 在C中&#xff0c;运算符重载是一种使得自定义类型&#xff08;如类对象&#xff09;能够使用C内建运算符的能力。运算符重载允许程序员定义运算符对用户定义类型的特殊行为&#xff0c;这增加了程序的可读性和自然表达能力。…

PaLmTac嵌入软体手手掌的视触觉传感器

触觉是感知和操作之间的桥梁。触觉信息对于手部行为反馈和规划具有重要意义。软体手的柔性特性在人机交互、生物医学设备和假肢等方面具有潜在应用的优势。本文提出了一种名为 PaLmTac的嵌入软体手手掌的视触觉传感器&#xff08;vision-based tactile sensor, VBTS&#xff09…

LeetCode 198—— 打家劫舍

阅读目录 1. 题目2. 解题思路3. 代码实现 1. 题目 2. 解题思路 此题使用动态规划求解&#xff0c;假设 d p [ i ] [ 0 ] dp[i][0] dp[i][0] 代表不偷窃第 i i i 个房屋可以获得的最高金额&#xff0c;而 d p [ i ] [ 1 ] dp[i][1] dp[i][1] 代表偷窃第 i i i 个房屋可以获…