diff --git a/conf/dadi.json b/conf/dadi.json index 940a5ab..a5ede55 100644 --- a/conf/dadi.json +++ b/conf/dadi.json @@ -1,7 +1,7 @@ { "enable": true, - "bidProfit": -50, - "couponCost": 3000, + "bidProfit": 0, + "couponCost": 0, "discount": 1, "token": "321566:7b84a0b1-832a-4492-a96a-23002d6c8715" } \ No newline at end of file diff --git a/data/dadi_query_order_detail.json b/data/dadi_query_order_detail.json new file mode 100644 index 0000000..3371827 --- /dev/null +++ b/data/dadi_query_order_detail.json @@ -0,0 +1,169 @@ +{ + "code": 200, + "data": { + "activityIsRefund": 1, + "allReject": false, + "autoUnlockTime": "1681021713000", + "billCode": "M202304091418335394912", + "billCouponAmount": 45, + "businessOrderUid": "676069431606861824", + "canRefundFlag": true, + "cinemaAddress": "顺义区新顺南大街11号隆华购物中心", + "cinemaCode": "11120681", + "cinemaName": "大地影院(北京顺义隆华CINITY店)", + "cinemaUid": 108, + "consumerCode": "32156612304084000136", + "createTime": "2023-04-09 14:18:33", + "filmPostURL": "https://dadicinema.obs.cn-north-4.myhuaweicloud.com:443/uploadFile%2Ffile%2F294c66cb-23f4-4738-9f2c-bf82e69154c3%2Ffb73869a2c90fabe2a16bdde720daad61675b.jpg", + "getCode": "1112068139367713", + "id": "676069431606861824", + "limitToTime": "2023-04-09 14:28:33", + "memberClassName": "龙马精神影票", + "mobile": "17610351227", + "notPayAmount": 45, + "orderMovieTicketVOList": [{ + "disVersion": "2D", + "filmPostURL": "https://dadicinema.obs.cn-north-4.myhuaweicloud.com:443/uploadFile%2Ffile%2F294c66cb-23f4-4738-9f2c-bf82e69154c3%2Ffb73869a2c90fabe2a16bdde720daad61675b.jpg", + "hallCode": "42", + "hallName": "4号厅", + "hallTypeName": "普通厅", + "hallUid": "42", + "makeDate": "2023-04-09 00:00:00", + "minPrice": 0, + "movieClass": "2D", + "movieCode": "2178", + "movieDescLanguage": "国语", + "movieName": "龙马精神", + "movieType": "动作,喜剧", + "planCode": "7104842304090001", + "planDate": "2023-04-09 00:00:00", + "planTimeUid": "7104842304090001", + "planType": "1", + "planTypeName": "国语2D", + "planUid": "7104842304090001", + "priceId": "2_2", + "priceType": 2, + "rejectNum": 0, + "showTime": "2023-04-09 15:10:00", + "showTimeEnd": "2023-04-09 17:16:00", + "ticketPickStatus": 0 + }, { + "disVersion": "2D", + "filmPostURL": "https://dadicinema.obs.cn-north-4.myhuaweicloud.com:443/uploadFile%2Ffile%2F294c66cb-23f4-4738-9f2c-bf82e69154c3%2Ffb73869a2c90fabe2a16bdde720daad61675b.jpg", + "hallCode": "42", + "hallName": "4号厅", + "hallTypeName": "普通厅", + "hallUid": "42", + "makeDate": "2023-04-09 00:00:00", + "minPrice": 0, + "movieClass": "2D", + "movieCode": "2178", + "movieDescLanguage": "国语", + "movieName": "龙马精神", + "movieType": "动作,喜剧", + "planCode": "7104842304090001", + "planDate": "2023-04-09 00:00:00", + "planTimeUid": "7104842304090001", + "planType": "1", + "planTypeName": "国语2D", + "planUid": "7104842304090001", + "priceId": "2_2", + "priceType": 2, + "rejectNum": 0, + "showTime": "2023-04-09 15:10:00", + "showTimeEnd": "2023-04-09 17:16:00", + "ticketPickStatus": 0 + }], + "orderStatus": 2, + "orderStatusName": "已完成", + "orderSubVOs": [{ + "createTime": "2023-04-09 14:18:34", + "goodsAmount": 2, + "goodsDesc": "4号厅", + "goodsName": "龙马精神[8排,4号]", + "id": "676069432886124544", + "orderMasterId": "676069431606861824", + "orderSubNo": "S202304091418339966092", + "orderTypeId": 1, + "price": 45, + "refund": "4500", + "sessionShowTime": "2023-04-09 15:10:00", + "status": 107, + "updateTime": "2023-04-09 14:19:20" + }, { + "createTime": "2023-04-09 14:18:34", + "goodsAmount": 2, + "goodsDesc": "4号厅", + "goodsName": "龙马精神[7排,4号]", + "id": "676069432886124544", + "orderMasterId": "676069431606861824", + "orderSubNo": "S202304091418339966092", + "orderTypeId": 1, + "price": 45, + "refund": "4500", + "sessionShowTime": "2023-04-09 15:10:00", + "status": 107, + "updateTime": "2023-04-09 14:19:20" + }], + "orderType": 1, + "orderTypeName": "影票", + "originalAmount": 90, + "originalPrice": 90, + "payAmount": 90, + "pickStatus": 0, + "pickUpMethod": 2, + "preferentialTotalPrice": "4500", + "printNo": "1112068139367713", + "refundBeforeTime": "2023-04-09 14:40", + "rejectAmount": 0, + "rejectStatus": 0, + "scribing": false, + "seatArray": [{ + "addPrice": 0, + "cinemaTicketPay": 0, + "infoQrCode": "11120681ZMp3NKeiekJrsYi/zNJ7y2qgHF4THVQfZuKk075NLuTT1nFicexGt+qr7+5UryxsCbx9kl/fq4RpZKAuThHnqO8Wf9+KfLF/J9CU6NawQdyDk1PRwznKHR0wnFAj1gdMuWxaNMpoQitiyJDuo1GDQMsbfgUaombIWKLUqdWxLho=", + "phyColId": "8", + "phyRowId": "4", + "platServiceFee": 0, + "rejectNum": 0, + "seatCode": "1112068104#04#08", + "servicePrice": 0, + "subAreaFlag": 0, + "thirdPayAmount": 0, + "ticketCheckStatus": 0, + "ticketPrice": 45 + }, { + "addPrice": 0, + "cinemaTicketPay": 0, + "infoQrCode": "11120681OjMKfxxrtZO989crQ/yJS0IafH1h+bbpH4ktazbE1cIiNdXyihJn6Gc+oURXxOBo2J5j72HSckZWKtTb/tO57T5h981AIT5po+Tf3lNtTVvQrZ5JLYekz9HWNCFSLaGGWwlBWlWKEPPQtDnGddBoVqHoEU+LZeE/iFOATYl5aQ4=", + "phyColId": "7", + "phyRowId": "4", + "platServiceFee": 4, + "rejectNum": 0, + "seatCode": "1112068104#04#07", + "servicePrice": 0, + "subAreaFlag": 0, + "thirdPayAmount": 0, + "ticketCheckStatus": 0, + "ticketPrice": 45 + }], + "sessionId": "7104842304090001", + "sessionShowTime": "2023-04-09 15:10:00", + "showFilmPritNo": "1112068139367713", + "status": 2, + "subAreaFlag": 1, + "tenantId": "321566", + "ticketCouponPrice": 45, + "ticketOriPrice": 90, + "ticketPickStatus": 0, + "ticketRealPayPrice": 45, + "ticketTotalServicePrice": 7, + "ticketUnitServiceFee": 3.5, + "updateTime": "2023-04-09 14:19:20", + "viewStatusStrSon": "已完成" + }, + "msg": "操作成功", + "success": true, + "successCode": true, + "timestamp": 1681021764995 +} \ No newline at end of file diff --git a/data/film_and_session.json b/data/film_and_session.json new file mode 100644 index 0000000..6f6a680 --- /dev/null +++ b/data/film_and_session.json @@ -0,0 +1,585 @@ +{ + "code": 200, + "data": { + "cinemaId": "53080401", + "cinemaName": "大地影院(普洱新天地店)", + "cinemaSystemId": "192", + "filmList": [{ + "actor": "克里斯帕拉特/安雅泰勒乔伊/查理戴", + "director": "亚伦霍瓦斯/迈克尔杰勒尼克", + "displayList": [], + "filmLength": "92", + "filmSort": 1, + "filmType": "故事片", + "hasPromotion": true, + "hitOrPresell": 1, + "id": 2146, + "name": "超级马力欧兄弟大电影", + "poster": "https://dadi-prod-public.oss-cn-beijing.aliyuncs.com/cmc-background/2023-02-27/d25042ebcbbf4e219cf4d613040495aa/3db4ca28b8e8c719c6d21b4679236404", + "score": "94", + "showList": [{ + "dayStr": "2023-04-09", + "hasPromotion": true, + "orderDate": "2023-04-09", + "plist": [{ + "dimensional": "3D", + "endSellTime": "2023-04-09 16:08:00", + "endTime": "2023-04-09 17:38:00", + "existsAreasPrice": false, + "hallId": "1319", + "hallName": "3号激光厅", + "hallTypeId": 16, + "isNextDay": "true", + "language": "国语", + "price": "25", + "sceneTypePriceVOList": [{ + "priceId": "2_2", + "priceType": 1, + "scenePrice": 31, + "sceneType": 1 + }, { + "priceId": "2_1_16", + "priceType": 1, + "scenePrice": 27, + "sceneType": 3 + }], + "sessionId": "7451682304090038", + "startTime": "2023-04-09 16:05:00" + }], + "showDate": "今天04月09日" + }] + }, { + "actor": "成龙/郭麒麟/吴京/刘浩存", + "director": "杨子", + "displayList": [], + "filmLength": "126", + "filmSort": 1, + "filmType": "动作,喜剧", + "hasPromotion": true, + "hitOrPresell": 1, + "id": 2214, + "name": "龙马精神", + "poster": "https://dadicinema.obs.cn-north-4.myhuaweicloud.com:443/uploadFile%2Ffile%2F294c66cb-23f4-4738-9f2c-bf82e69154c3%2Ffb73869a2c90fabe2a16bdde720daad61675b.jpg", + "score": "0", + "showList": [{ + "dayStr": "2023-04-09", + "hasPromotion": true, + "orderDate": "2023-04-09", + "plist": [{ + "dimensional": "2D", + "endSellTime": "2023-04-09 14:53:00", + "endTime": "2023-04-09 16:56:00", + "existsAreasPrice": false, + "hallId": "1317", + "hallName": "1号激光厅", + "hallTypeId": 16, + "isNextDay": "true", + "language": "国语", + "price": "35", + "sceneTypePriceVOList": [{ + "priceId": "2_2", + "priceType": 1, + "scenePrice": 39, + "sceneType": 1 + }, { + "priceId": "2_1_16", + "priceType": 1, + "scenePrice": 34, + "sceneType": 3 + }], + "sessionId": "7451682304090021", + "startTime": "2023-04-09 14:50:00" + }, { + "dimensional": "2D", + "endSellTime": "2023-04-09 17:13:00", + "endTime": "2023-04-09 19:16:00", + "existsAreasPrice": false, + "hallId": "1317", + "hallName": "1号激光厅", + "hallTypeId": 16, + "isNextDay": "true", + "language": "国语", + "price": "35", + "sceneTypePriceVOList": [{ + "priceId": "2_2", + "priceType": 1, + "scenePrice": 39, + "sceneType": 1 + }, { + "priceId": "2_1_16", + "priceType": 1, + "scenePrice": 34, + "sceneType": 3 + }], + "sessionId": "7451682304090001", + "startTime": "2023-04-09 17:10:00" + }, { + "dimensional": "2D", + "endSellTime": "2023-04-09 18:18:00", + "endTime": "2023-04-09 20:21:00", + "existsAreasPrice": false, + "hallId": "1320", + "hallName": "4号激光厅", + "hallTypeId": 16, + "isNextDay": "true", + "language": "国语", + "price": "35", + "sceneTypePriceVOList": [{ + "priceId": "2_2", + "priceType": 1, + "scenePrice": 39, + "sceneType": 1 + }, { + "priceId": "2_1_16", + "priceType": 1, + "scenePrice": 34, + "sceneType": 3 + }], + "sessionId": "7451682304090024", + "startTime": "2023-04-09 18:15:00" + }, { + "dimensional": "2D", + "endSellTime": "2023-04-09 19:33:00", + "endTime": "2023-04-09 21:36:00", + "existsAreasPrice": false, + "hallId": "1317", + "hallName": "1号激光厅", + "hallTypeId": 16, + "isNextDay": "true", + "language": "国语", + "price": "35", + "sceneTypePriceVOList": [{ + "priceId": "2_2", + "priceType": 1, + "scenePrice": 39, + "sceneType": 1 + }, { + "priceId": "2_1_16", + "priceType": 1, + "scenePrice": 34, + "sceneType": 3 + }], + "sessionId": "7451682304090023", + "startTime": "2023-04-09 19:30:00" + }, { + "dimensional": "2D", + "endSellTime": "2023-04-09 20:33:00", + "endTime": "2023-04-09 22:36:00", + "existsAreasPrice": false, + "hallId": "1320", + "hallName": "4号激光厅", + "hallTypeId": 16, + "isNextDay": "true", + "language": "国语", + "price": "35", + "sceneTypePriceVOList": [{ + "priceId": "2_2", + "priceType": 1, + "scenePrice": 39, + "sceneType": 1 + }, { + "priceId": "2_1_16", + "priceType": 1, + "scenePrice": 34, + "sceneType": 3 + }], + "sessionId": "7451682304090022", + "startTime": "2023-04-09 20:30:00" + }, { + "dimensional": "2D", + "endSellTime": "2023-04-09 21:48:00", + "endTime": "2023-04-09 23:51:00", + "existsAreasPrice": false, + "hallId": "1317", + "hallName": "1号激光厅", + "hallTypeId": 16, + "isNextDay": "true", + "language": "国语", + "price": "35", + "sceneTypePriceVOList": [{ + "priceId": "2_2", + "priceType": 1, + "scenePrice": 39, + "sceneType": 1 + }, { + "priceId": "2_1_16", + "priceType": 1, + "scenePrice": 34, + "sceneType": 3 + }], + "sessionId": "7451682304090026", + "startTime": "2023-04-09 21:45:00" + }], + "showDate": "今天04月09日" + }] + }, { + "actor": "", + "director": "", + "displayList": [], + "filmLength": "122", + "filmSort": 2, + "filmType": "故事片", + "hasPromotion": true, + "hitOrPresell": 1, + "id": 2001, + "name": "铃芽之旅", + "poster": "https://dadicinema.obs.cn-north-4.myhuaweicloud.com:443/uploadFile%2Ffile%2F5641e844-777b-44c2-845a-582df2ba95d8%2Ffengmian.jpg", + "score": "95", + "showList": [{ + "dayStr": "2023-04-09", + "hasPromotion": true, + "orderDate": "2023-04-09", + "plist": [{ + "dimensional": "2D", + "endSellTime": "2023-04-09 16:03:00", + "endTime": "2023-04-09 18:02:00", + "existsAreasPrice": false, + "hallId": "1320", + "hallName": "4号激光厅", + "hallTypeId": 16, + "isNextDay": "true", + "language": "日语", + "price": "20", + "sceneTypePriceVOList": [{ + "priceId": "2_2", + "priceType": 1, + "scenePrice": 31, + "sceneType": 1 + }, { + "priceId": "2_1_16", + "priceType": 1, + "scenePrice": 27, + "sceneType": 3 + }], + "sessionId": "7451682304090039", + "startTime": "2023-04-09 16:00:00" + }, { + "dimensional": "2D", + "endSellTime": "2023-04-09 17:53:00", + "endTime": "2023-04-09 19:52:00", + "existsAreasPrice": false, + "hallId": "1319", + "hallName": "3号激光厅", + "hallTypeId": 16, + "isNextDay": "true", + "language": "日语", + "price": "20", + "sceneTypePriceVOList": [{ + "priceId": "2_2", + "priceType": 1, + "scenePrice": 31, + "sceneType": 1 + }, { + "priceId": "2_1_16", + "priceType": 1, + "scenePrice": 27, + "sceneType": 3 + }], + "sessionId": "7451682304090035", + "startTime": "2023-04-09 17:50:00" + }, { + "dimensional": "2D", + "endSellTime": "2023-04-09 20:03:00", + "endTime": "2023-04-09 22:02:00", + "existsAreasPrice": false, + "hallId": "1319", + "hallName": "3号激光厅", + "hallTypeId": 16, + "isNextDay": "true", + "language": "日语", + "price": "20", + "sceneTypePriceVOList": [{ + "priceId": "2_2", + "priceType": 1, + "scenePrice": 31, + "sceneType": 1 + }, { + "priceId": "2_1_16", + "priceType": 1, + "scenePrice": 27, + "sceneType": 3 + }], + "sessionId": "7451682304090036", + "startTime": "2023-04-09 20:00:00" + }, { + "dimensional": "2D", + "endSellTime": "2023-04-09 22:13:00", + "endTime": "2023-04-10 00:12:00", + "existsAreasPrice": false, + "hallId": "1319", + "hallName": "3号激光厅", + "hallTypeId": 16, + "isNextDay": "true", + "language": "日语", + "price": "20", + "sceneTypePriceVOList": [{ + "priceId": "2_2", + "priceType": 1, + "scenePrice": 31, + "sceneType": 1 + }, { + "priceId": "2_1_16", + "priceType": 1, + "scenePrice": 27, + "sceneType": 3 + }], + "sessionId": "7451682304090029", + "startTime": "2023-04-09 22:10:00" + }], + "showDate": "今天04月09日" + }] + }, { + "actor": "大黄(中华田园犬)/冯小刚/陈冲/白举纲", + "director": "徐昂", + "displayList": [], + "filmLength": "125", + "filmSort": 3, + "filmType": "故事片,剧情,家庭", + "hasPromotion": true, + "hitOrPresell": 1, + "id": 2104, + "name": "忠犬八公", + "poster": "https://dadicinema.obs.cn-north-4.myhuaweicloud.com:443/uploadFile%2Ffile%2Fa841751f-67ae-41a6-a5de-12ec677101ce%2Fzzz.jpeg", + "score": "92", + "showList": [{ + "dayStr": "2023-04-09", + "hasPromotion": true, + "orderDate": "2023-04-09", + "plist": [{ + "dimensional": "2D", + "endSellTime": "2023-04-09 14:33:00", + "endTime": "2023-04-09 16:35:00", + "existsAreasPrice": false, + "hallId": "1318", + "hallName": "2号厅", + "hallTypeId": 16, + "isNextDay": "true", + "language": "国语", + "price": "30", + "sceneTypePriceVOList": [{ + "priceId": "2_2", + "priceType": 1, + "scenePrice": 34, + "sceneType": 1 + }, { + "priceId": "2_1_16", + "priceType": 1, + "scenePrice": 30, + "sceneType": 3 + }], + "sessionId": "7451682304090030", + "startTime": "2023-04-09 14:30:00" + }, { + "dimensional": "2D", + "endSellTime": "2023-04-09 16:48:00", + "endTime": "2023-04-09 18:50:00", + "existsAreasPrice": false, + "hallId": "1318", + "hallName": "2号厅", + "hallTypeId": 16, + "isNextDay": "true", + "language": "国语", + "price": "30", + "sceneTypePriceVOList": [{ + "priceId": "2_2", + "priceType": 1, + "scenePrice": 34, + "sceneType": 1 + }, { + "priceId": "2_1_16", + "priceType": 1, + "scenePrice": 30, + "sceneType": 3 + }], + "sessionId": "7451682304090037", + "startTime": "2023-04-09 16:45:00" + }, { + "dimensional": "2D", + "endSellTime": "2023-04-09 19:03:00", + "endTime": "2023-04-09 21:05:00", + "existsAreasPrice": false, + "hallId": "1318", + "hallName": "2号厅", + "hallTypeId": 16, + "isNextDay": "true", + "language": "国语", + "price": "30", + "sceneTypePriceVOList": [{ + "priceId": "2_2", + "priceType": 1, + "scenePrice": 34, + "sceneType": 1 + }, { + "priceId": "2_1_16", + "priceType": 1, + "scenePrice": 30, + "sceneType": 3 + }], + "sessionId": "7451682304090033", + "startTime": "2023-04-09 19:00:00" + }, { + "dimensional": "2D", + "endSellTime": "2023-04-09 21:23:00", + "endTime": "2023-04-09 23:25:00", + "existsAreasPrice": false, + "hallId": "1318", + "hallName": "2号厅", + "hallTypeId": 16, + "isNextDay": "true", + "language": "国语", + "price": "30", + "sceneTypePriceVOList": [{ + "priceId": "2_2", + "priceType": 1, + "scenePrice": 34, + "sceneType": 1 + }, { + "priceId": "2_1_16", + "priceType": 1, + "scenePrice": 30, + "sceneType": 3 + }], + "sessionId": "7451682304090025", + "startTime": "2023-04-09 21:20:00" + }], + "showDate": "今天04月09日" + }] + }, { + "actor": "杨烁/李萌萌/刘流", + "director": "陈晨", + "displayList": [], + "filmLength": "111", + "filmSort": 9, + "filmType": "故事片", + "hasPromotion": true, + "hitOrPresell": 1, + "id": 2215, + "name": "不能错过的只有你", + "poster": "https://dadi-prod-public.oss-cn-beijing.aliyuncs.com/cmc-background/2023-03-15/1fef163aa41644deb2bef359110d3ce4/2013d35b7d56051fa966df3eba1c308c", + "score": "0", + "showList": [{ + "dayStr": "2023-04-09", + "hasPromotion": true, + "orderDate": "2023-04-09", + "plist": [{ + "dimensional": "2D", + "endSellTime": "2023-04-09 14:08:00", + "endTime": "2023-04-09 15:56:00", + "existsAreasPrice": false, + "hallId": "1319", + "hallName": "3号激光厅", + "hallTypeId": 16, + "isNextDay": "true", + "language": "国语", + "price": "30", + "sceneTypePriceVOList": [{ + "priceId": "2_2", + "priceType": 1, + "scenePrice": 34, + "sceneType": 1 + }, { + "priceId": "2_1_16", + "priceType": 1, + "scenePrice": 30, + "sceneType": 3 + }], + "sessionId": "7451682304090032", + "startTime": "2023-04-09 14:05:00" + }], + "showDate": "今天04月09日" + }] + }, { + "actor": "塞缪尔拉巴特/热雷米拉厄尔特/ 瓦西里施耐德/塞巴斯蒂安拉兰内", + "director": "让雅克阿诺", + "displayList": [], + "filmLength": "110", + "filmSort": 10, + "filmType": "剧情,惊悚,传记", + "hasPromotion": true, + "hitOrPresell": 1, + "id": 2237, + "name": "燃烧的巴黎圣母院", + "poster": "https://dadi-prod-public.oss-cn-beijing.aliyuncs.com/cmc-background/2023-03-22/62dbad42a4ac4a2eaa4b510af984779b/16bb1b9d437dc447172e9d9690f94610", + "score": "0", + "showList": [{ + "dayStr": "2023-04-09", + "hasPromotion": true, + "orderDate": "2023-04-09", + "plist": [{ + "dimensional": "2D", + "endSellTime": "2023-04-09 14:03:00", + "endTime": "2023-04-09 15:50:00", + "existsAreasPrice": false, + "hallId": "1320", + "hallName": "4号激光厅", + "hallTypeId": 16, + "isNextDay": "true", + "language": "法语", + "price": "20", + "sceneTypePriceVOList": [{ + "priceId": "2_2", + "priceType": 1, + "scenePrice": 31, + "sceneType": 1 + }, { + "priceId": "2_1_16", + "priceType": 1, + "scenePrice": 27, + "sceneType": 3 + }], + "sessionId": "7451682304090031", + "startTime": "2023-04-09 14:00:00" + }], + "showDate": "今天04月09日" + }] + }, { + "actor": "德瑞克贝尔/保利肖尔", + "director": "瓦西里罗文斯基", + "displayList": [], + "filmLength": "84", + "filmSort": 9999, + "filmType": "动画,喜剧,冒险,家庭", + "hasPromotion": true, + "hitOrPresell": 1, + "id": 2216, + "name": "大旅行", + "poster": "https://dadi-prod-public.oss-cn-beijing.aliyuncs.com/cmc-background/2023-03-16/07f75e0ab24c417b9760b0897f20ffbc/6c746bba474518c7b98f13df2f16c210", + "score": "0", + "showList": [{ + "dayStr": "2023-04-09", + "hasPromotion": true, + "orderDate": "2023-04-09", + "plist": [{ + "dimensional": "2D", + "endSellTime": "2023-04-09 22:48:00", + "endTime": "2023-04-10 00:09:00", + "existsAreasPrice": false, + "hallId": "1320", + "hallName": "4号激光厅", + "hallTypeId": 16, + "isNextDay": "true", + "language": "国语", + "price": "20", + "sceneTypePriceVOList": [{ + "priceId": "2_2", + "priceType": 1, + "scenePrice": 31, + "sceneType": 1 + }, { + "priceId": "2_1_16", + "priceType": 1, + "scenePrice": 27, + "sceneType": 3 + }], + "sessionId": "7451682304090028", + "startTime": "2023-04-09 22:45:00" + }], + "showDate": "今天04月09日" + }] + }] + }, + "msg": "操作成功", + "success": true, + "successCode": true, + "timestamp": 1681020193090 +} \ No newline at end of file diff --git a/worker/common/processor.go b/worker/common/processor.go index e70a915..82cce0d 100644 --- a/worker/common/processor.go +++ b/worker/common/processor.go @@ -6,7 +6,8 @@ type CheckInfo struct { TotalOriginPrice int64 TotalRealPrice int64 CouponPrice int64 - BillCode string + SessionCode string + SessionType string } type OrderInfo struct { diff --git a/worker/dadi/dadi_processor.go b/worker/dadi/dadi_processor.go index 8d265b0..27e1694 100644 --- a/worker/dadi/dadi_processor.go +++ b/worker/dadi/dadi_processor.go @@ -98,15 +98,16 @@ func (d *Processor) checkError(body []byte) (interface{}, error) { return result["data"], nil } -func (d *Processor) getBaseHeader() map[string]interface{} { +func (p *Processor) getBaseHeader() map[string]interface{} { return map[string]interface{}{ "User-Agent": "DaDiCinemaApp/8.7.3 (iPhone; iOS 15.2.1; Scale/3.00)", - "c-User-Token": d.token, - "c-tenantId": strings.Split(d.token, ":")[0], + "c-User-Token": p.token, + "c-tenantId": strings.Split(p.token, ":")[0], } } func (p *Processor) getBaseParam(cinema *Cinema) map[string]interface{} { + tenantId := strings.Split(p.token, ":")[0] params := map[string]interface{}{ "channelCode": "SYH-DDZY-DD", "channelName": "大地自营-大地", @@ -121,7 +122,7 @@ func (p *Processor) getBaseParam(cinema *Cinema) map[string]interface{} { "r": "1", "s": "iOS15.2.1", "t": "1", - "tenantId": "321566", + "tenantId": tenantId, "unifiedCinemaId": cast.ToString(cinema.Id), "unifiedCinemaName": cinema.Name, "unifiedCode": cast.ToString(cinema.UnifiedCode), @@ -186,6 +187,7 @@ func (d *Processor) getCinemaFilmShowHall(cinema *Cinema, filmName, startTime st } } } + log.Errorf("film[%s] startTime[%s] no exist", filmName, startTime) return nil, fmt.Errorf("film[%s] startTime[%s] no exist", filmName, startTime) } @@ -277,31 +279,87 @@ func (p *Processor) prevOrderInfo(cinema *Cinema, seatGoods []*SeatGoods) (*Prev return previewOrder, nil } +func (p *Processor) getUserPrice(cinema *Cinema, filmName, showTime string) (*FilmPrice, error) { + reqUrl := "https://appapi.dadicinema.com/app-web/v1/web/film/getHitFilmAndFilmSession" + baseReq := p.getBaseParam(cinema) + + body, err := httputil.HttpGet(reqUrl, baseReq, p.getBaseHeader()) + if err != nil { + log.Errorf("httpPost url[%s] error : %s", reqUrl, err.Error()) + return nil, err + } + data, err := p.checkError(body) + if err != nil { + return nil, err + } + for _, f := range cast.ToSlice(cast.ToStringMap(data)["filmList"]) { + film := cast.ToStringMap(f) + name := cast.ToString(film["name"]) + if name != filmName { + continue + } + for _, ds := range cast.ToSlice(film["showList"]) { + dayShow := cast.ToStringMap(ds) + for _, ts := range cast.ToSlice(dayShow["plist"]) { + timeShow := cast.ToStringMap(ts) + startTime := cast.ToString(timeShow["startTime"]) + if startTime != showTime { + continue + } + prices := cast.ToSlice(timeShow["sceneTypePriceVOList"]) + if len(prices) < 2 { + log.Errorf("cinema[%s] timeShow[%s]", cinema.Name, goutil.EncodeJSON(timeShow)) + return nil, err + } + result := new(FilmPrice) + result.OriginPrice = int64(100 * cast.ToFloat64(cast.ToStringMap(prices[0])["scenePrice"])) + result.VipPrice = int64(100 * cast.ToFloat64(cast.ToStringMap(prices[1])["scenePrice"])) + result.SessionId = cast.ToString(timeShow["sessionId"]) + return result, nil + } + } + } + + log.Errorf("[%s][%s][%s][%s] not exist", cinema.Name, cinema.Address, filmName, showTime) + return nil, fmt.Errorf("[%s][%s][%s][%s] not exist", cinema.Name, cinema.Address, filmName, showTime) +} + func (p *Processor) CheckOrder(order *model.Order) (*common.CheckInfo, error) { cinema, err := p.getCinema(order.CityName, order.CinemaName) if err != nil { return nil, err } + + /* 下单看实际价格 showHall, err := p.getCinemaFilmShowHall(cinema, order.MovieName, goutil.TimeToDateTime(order.ShowTime)) if err != nil { return nil, err } + seatGoods, err := p.getSeatGoods(cinema, showHall.SessionId, order.Seats) if err != nil { return nil, err } + previewOrder, err := p.prevOrderInfo(cinema, seatGoods) if err != nil { return nil, err } + */ + + filmPrice, err := p.getUserPrice(cinema, order.MovieName, goutil.TimeToDateTime(order.ShowTime)) + if err != nil { + return nil, err + } result := new(common.CheckInfo) - result.TotalRealPrice = previewOrder.TotalRealPrice - result.TotalOriginPrice = previewOrder.TotalOriginPrice - result.CouponPrice = previewOrder.CouponPrice - result.BillCode = previewOrder.BillCode + result.TotalRealPrice = filmPrice.VipPrice * int64(order.SeatNum) + result.TotalOriginPrice = filmPrice.OriginPrice * int64(order.SeatNum) + result.CouponPrice = 0 + result.SessionCode = filmPrice.SessionId + result.SessionType = "view" log.Infof("check order[%s][%s] previewOrder[%s] [%s][%s][%s] success", - order.OrderNo, result.BillCode, goutil.EncodeJSON(previewOrder), + order.OrderNo, result.SessionCode, goutil.EncodeJSON(filmPrice), order.CityName, order.CinemaName, order.MovieName) return result, nil } @@ -317,7 +375,7 @@ func (p *Processor) CancelOrder(order *model.Order, checkInfo *common.CheckInfo) } reqUrl := "https://appapi.dadicinema.com/app-web/v1/web/order/cancel" baseReq := p.getBaseParam(cinema) - baseReq["billCode"] = checkInfo.BillCode + baseReq["billCode"] = checkInfo.SessionCode body, err := httputil.HttpPostJson(reqUrl, nil, p.getBaseHeader(), []byte(goutil.EncodeJSON(baseReq))) if err != nil { @@ -329,6 +387,6 @@ func (p *Processor) CancelOrder(order *model.Order, checkInfo *common.CheckInfo) return err } log.Infof("cancel order[%s][%s] [%s][%s][%s] success", - order.OrderNo, checkInfo.BillCode, order.CityName, order.CinemaName, order.MovieName) + order.OrderNo, checkInfo.SessionCode, order.CityName, order.CinemaName, order.MovieName) return nil } diff --git a/worker/dadi/dadi_type.go b/worker/dadi/dadi_type.go index a082b69..4345c84 100644 --- a/worker/dadi/dadi_type.go +++ b/worker/dadi/dadi_type.go @@ -36,6 +36,12 @@ type Cinema struct { CityId int64 } +type FilmPrice struct { + OriginPrice int64 + VipPrice int64 + SessionId string +} + type City struct { Name string ShortName string diff --git a/worker/haha/haha_processor.go b/worker/haha/haha_processor.go index a2abb14..d6b6e49 100644 --- a/worker/haha/haha_processor.go +++ b/worker/haha/haha_processor.go @@ -57,24 +57,38 @@ func (p *Processor) BidPrice(id int64, price int64) error { return nil } -func (p *Processor) QueryBidding() error { +func (p *Processor) queryBid(params map[string]interface{}) ([]*BidOrder, error) { reqUrl := "https://hahapiao.cn/api/Synchro/getOrderList" header := map[string]interface{}{ "token": p.token, } - body, err := httputil.HttpPostForm(reqUrl, header, nil) + body, err := httputil.HttpPostForm(reqUrl, header, params) if err != nil { log.Error("httpPost error : %s", err.Error()) - return err + return nil, err } - data, err := p.checkError(body) + datas, err := p.checkError(body) if err != nil { - return err + return nil, err } - cast.ToSlice(data) + result := make([]*BidOrder, 0) + for _, d := range cast.ToSlice(datas) { + data := cast.ToStringMap(d) + o := new(BidOrder) + o.OrderId = cast.ToInt64(data["id"]) + o.OrderNo = cast.ToString(data["orderNumber"]) + o.Status = cast.ToString(data["status"]) + o.BidTime = cast.ToInt64(data["bindd_time"]) + o.BidPrice = int64(cast.ToFloat64(data["price"]) * 100) + result = append(result, o) + } + return result, nil +} + +func (p *Processor) QueryBidding() error { return nil } diff --git a/worker/haha/haha_type.go b/worker/haha/haha_type.go index ad11268..05791f3 100644 --- a/worker/haha/haha_type.go +++ b/worker/haha/haha_type.go @@ -1,5 +1,9 @@ package haha type BidOrder struct { - OrderId int64 + OrderId int64 + OrderNo string + Status string + BidPrice int64 + BidTime int64 } diff --git a/worker/worker.go b/worker/worker.go index 571fa75..82162c9 100644 --- a/worker/worker.go +++ b/worker/worker.go @@ -61,13 +61,12 @@ func (w *Worker) processorDadi(order *model.Order) { checkInfo, err := w.dadiProcessor.CheckOrder(order) if err != nil { log.Errorf("check orrder[%s] error : %s", order.String(), err.Error()) - w.sendOrderMessage(order, err.Error()) return } cfg := config.GetDadiConfig() bidStatus := false - realCost := int64(float64(checkInfo.TotalRealPrice)*cfg.Discount) + int64(goutil.If(checkInfo.CouponPrice > 0, cfg.CouponCost, 0)) + realCost := int64(float64(checkInfo.TotalRealPrice) * cfg.Discount) realUnitCost := realCost / int64(order.SeatNum) bidPrice := realUnitCost + config.GetDadiConfig().BidProfit if bidPrice < order.MaxPrice {