Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
familyMart_takeaway
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guanghui.cui
familyMart_takeaway
Commits
944ad6d4
Commit
944ad6d4
authored
Jul 07, 2023
by
wuyang.zou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、透传 中台订单 促销item合并数量
V1.4.0
parent
283e3ccb
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
99 additions
and
21 deletions
+99
-21
README.md
+4
-0
base/CommonStruct.h
+10
-16
bin/PosRequestInitData.json
+2
-2
bin/testOrderJson.json
+2
-2
bin/testOrderJson_bak.json
+2
-0
cmake_install.cmake
+54
-0
src/JsonModule.cpp
+22
-0
src/main.cpp
+3
-1
No files found.
README.md
View file @
944ad6d4
...
@@ -52,3 +52,7 @@ orderCoupons[i] 数组对象字段: 仅orderCoupons[i].type="P"->是商品券
...
@@ -52,3 +52,7 @@ orderCoupons[i] 数组对象字段: 仅orderCoupons[i].type="P"->是商品券
<4
.
0
.
3
>
插件兜底长连接假死的自检:存在待推送订单且长时间没有接受到推送则进行长连接主动断开后重连;【自测OK】
<4
.
0
.
3
>
插件兜底长连接假死的自检:存在待推送订单且长时间没有接受到推送则进行长连接主动断开后重连;【自测OK】
10倍心跳周期中无推送订单记录(6分钟) 读取ODS心跳数据待推送订单数量
[
wait_push_order_sum 小于10倍心跳周期前的数量
]
;
10倍心跳周期中无推送订单记录(6分钟) 读取ODS心跳数据待推送订单数量
[
wait_push_order_sum 小于10倍心跳周期前的数量
]
;
则断开重连(同时附带重连原因: KEY: plugin_relogin_reason );
则断开重连(同时附带重连原因: KEY: plugin_relogin_reason );
4.
1 2023-07-04 wuyang.zou Version: 1.4.0 RC //新增插件属性字段: "promotions"->"promtionDetails"-> add new property "qty"
[
int
]
;
base/CommonStruct.h
View file @
944ad6d4
...
@@ -102,16 +102,17 @@ struct promotions
...
@@ -102,16 +102,17 @@ struct promotions
{
{
std
::
string
pcode
;
//优惠码
std
::
string
pcode
;
//优惠码
std
::
string
proType
;
//类型: 00快速积点 ,20售价促销,30进价+售价促销,40组合促销,50整单促销,60厂区促销,70会员卡充值促销, 80电子点标
std
::
string
proType
;
//类型: 00快速积点 ,20售价促销,30进价+售价促销,40组合促销,50整单促销,60厂区促销,70会员卡充值促销, 80电子点标
std
::
string
type
;
//优惠子类型
std
::
string
type
;
//优惠-类型
std
::
string
desc
;
//优惠明细
std
::
string
desc
;
//优惠-描述
std
::
string
name
;
//名称
std
::
string
name
;
//优惠-名称
std
::
string
sku
;
//商品编号
std
::
string
sku
;
//优惠-商品编号
std
::
string
couponId
;
//券id
std
::
string
couponId
;
//优惠-券id
int
originalPrice
=
0
;
//原始价格
int
originalPrice
=
0
;
//原始价格
int
discount
=
0
;
//折扣
int
discount
=
0
;
//折扣
int
promotionPrice
=
0
;
//优惠价格
int
promotionPrice
=
0
;
//优惠-价格
int
qty
=
0
;
//优惠-数量
std
::
string
giftSku
;
//赠品的编码
std
::
string
giftSku
;
//赠品的编码
int
giftQty
=
0
;
//赠品的数量
int
giftQty
=
0
;
//赠品的数量
};
};
//积分
//积分
...
@@ -207,13 +208,6 @@ struct orderObj
...
@@ -207,13 +208,6 @@ struct orderObj
int
zhxPoint
=
0
;
//甄会选积分
int
zhxPoint
=
0
;
//甄会选积分
int
familyRice
=
0
;
//米粒數
int
familyRice
=
0
;
//米粒數
// Berry 新增3个积分字段,全家模式下注释这3个字段;
/*
int otherPoint = 0; //其他品牌积分
int remainingBrandPoint = 0; //品牌-剩余积分
int remainingNkbPoint = 0; //纳客宝集享-剩余积分
*/
store
storeInfo
;
//门店信息
store
storeInfo
;
//门店信息
delivery
deliveryInfo
;
//配送信息
delivery
deliveryInfo
;
//配送信息
customer
customerInfo
;
//顾客信息
customer
customerInfo
;
//顾客信息
...
...
bin/PosRequestInitData.json
View file @
944ad6d4
{
"fm_cmd"
:
1000
,
"listen_port"
:
24445
,
"storeId"
:
"208888"
,
"pos_id"
:
"5"
,
"operator_id"
:
"zouwuyang"
,
"is_master"
:
false
,
"plugin_comment"
:
"123.60.107.183"
,
"ver"
:
1
,
"version"
:
"1.3.1 RC"
}
{
"fm_cmd"
:
1000
,
"listen_port"
:
24445
,
"storeId"
:
"208888"
,
"pos_id"
:
"5"
,
"operator_id"
:
"zouwuyang"
,
"is_master"
:
false
,
"plugin_comment"
:
"123.60.107.183"
,
"ver"
:
1
,
"version"
:
"1.4.0 RC"
}
\ No newline at end of file
\ No newline at end of file
bin/testOrderJson.json
View file @
944ad6d4
{
"channel"
:
"219"
,
"cityId"
:
"003"
,
"delivery"
:{
"basicPrice"
:
0
,
"customerAddress"
:
""
,
"customerName"
:
""
,
"customerPhone"
:
"13119867445"
,
"deliveryFinishTime"
:
""
,
"deliveryId"
:
""
,
"deliveryTime"
:
""
,
"distancePrice"
:
0
,
"logisticsPhysicalCompany"
:
""
,
"name"
:
""
,
"phone"
:
""
,
"provinceName"
:
""
,
"sendOutTime"
:
""
,
"type"
:
""
},
"invoice"
:{
"companyName"
:
""
,
"invoiceType"
:
0
,
"taxNum"
:
""
,
"title"
:
""
,
"transNum"
:
"11014034019997000000501"
},
"offlinePoints"
:
false
,
"orderContent"
:{
"appointmentVO"
:{
"appointmentTime"
:
"20221101124000"
,
"isAppointment"
:
1
},
"createTime"
:
"20221101123427"
,
"customer"
:[{
"accountId"
:
"256334928765024804"
,
"accountType"
:
"1"
,
"cardNo"
:
"8610212009008790358"
,
"dyCode"
:
""
,
"level"
:
"1"
,
"mobileNo"
:
"13119867445"
}],
"deliveryFee"
:
0
,
"ecoupons"
:[],
"extendedAttributes"
:{
"activities"
:[],
"amountMax"
:
0
,
"discountAmount"
:
0
,
"discountMax"
:
0
,
"discountRate"
:
100
,
"discountThreshold"
:
0
,
"memberDay"
:
0
,
"memberDayPoint"
:
0
,
"performanceServiceFee"
:
0
,
"platformServiceFee"
:
0
,
"pointMemberDay"
:
0
,
"pointsMax"
:
0
,
"pointsMultiple"
:
0
,
"pointsSumMax"
:
0
,
"source"
:
4
,
"storehouseId"
:
""
},
"ignorePoints"
:
0
,
"orderCoupons"
:[{
"activityId"
:
"FM2210249003"
,
"bonusDayBusinessAmt"
:
0
,
"bonusDayBusinessType"
:
""
,
"campaignAmt"
:
0
,
"couponId"
:
"7100028567"
,
"couponName"
:
"每月礼包20-5元劵"
,
"couponProduct"
:[],
"discount"
:
-500
,
"ebcode"
:
"1000000001"
,
"orderId"
:
"219256353427933669163"
,
"paid"
:
0
,
"price"
:
0
,
"remainingAmt"
:
0
,
"securitiesTrader"
:
"N"
,
"sku"
:
""
,
"supplierNo"
:
"1000000001"
,
"totalAmount"
:
500
,
"transNum"
:
"801101000008"
,
"type"
:
"C"
,
"useAmount"
:
500
,
"usedNum"
:
1
}],
"orders"
:{
"cancelStatus"
:
""
,
"deliveryStatus"
:
""
,
"deliveryStatusDesc"
:
""
,
"id"
:
256354541336824349
,
"orderId"
:
"219256353427933669163"
,
"orderType"
:
"002"
,
"parentId"
:
""
,
"pickupCode"
:
"A0002"
,
"pickupPoint"
:
"002"
,
"products"
:[{
"activityId"
:
""
,
"additionalProducts"
:[],
"attributes"
:
""
,
"catgId"
:
"181003"
,
"couponQty"
:
0
,
"givePointApportion"
:
3
,
"groupIndex"
:
""
,
"groupName"
:
""
,
"id"
:
256354541336824350
,
"moneyApportion"
:
269
,
"name"
:
"冷冻烤红薯"
,
"originalPrice"
:
650
,
"price"
:
520
,
"productCode"
:
"20_0724500"
,
"productType"
:
"1"
,
"qty"
:
4
,
"realQty"
:
0
,
"refundQty"
:
0
,
"sku"
:
"26046561"
,
"source"
:
""
,
"specs"
:[],
"status"
:
""
,
"useCouponApportion"
:
124
,
"usePointApportion"
:
124
,
"usePromotionApportion"
:
130
,
"virtualCouponApportion"
:
0
,
"weight"
:
180
}],
"reason"
:
"支付已完成"
,
"reasonForFailure"
:
""
,
"remark"
:
""
,
"status"
:
"40004"
,
"statusDesc"
:
"已支付"
,
"storeType"
:
0
},
"payInfos"
:[{
"accountId"
:
"8610212009008790358"
,
"amount"
:
500
,
"fmId"
:
""
,
"payCode"
:
""
,
"payType"
:
"1010004"
,
"performanceServiceFee"
:
0
,
"platformServiceFee"
:
0
,
"transNum"
:
"801101000008"
},{
"accountId"
:
"8610212009008790358"
,
"amount"
:
500
,
"fmId"
:
"SXA1O37568633025"
,
"payCode"
:
""
,
"payType"
:
"1010005"
,
"performanceServiceFee"
:
0
,
"platformServiceFee"
:
0
,
"transNum"
:
"223051234321"
},{
"accountId"
:
"8610212009008790358"
,
"amount"
:
1080
,
"fmId"
:
"SXA1O37568625625"
,
"payCode"
:
""
,
"payType"
:
"20071"
,
"performanceServiceFee"
:
0
,
"platformServiceFee"
:
0
,
"transNum"
:
"2022110122001429921440751223"
}],
"payType"
:
"20071"
,
"points"
:{
"basicPoint"
:
15
,
"extraPoint"
:
0
,
"familyRice"
:
1
,
"nkbBasicPoint"
:
15
,
"nkbExtraPoint"
:
0
,
"pointDetails"
:[{
"desc"
:
""
,
"name"
:
"消费1元送1积分"
,
"pcode"
:
"202001010001"
,
"point"
:
20
,
"qty"
:
0
,
"sku"
:
"20383916"
,
"type"
:
"00"
}],
"totalPoint"
:
30
,
"zhxPoint"
:
0
},
"promotions"
:{
"promtionDetails"
:[{
"couponId"
:
""
,
"desc"
:
""
,
"discount"
:
130
,
"giftQty"
:
0
,
"giftSku"
:
""
,
"name"
:
""
,
"originalPrice"
:
650
,
"parentSku"
:
""
,
"pcode"
:
"202210140079"
,
"proType"
:
""
,
"promotionPrice"
:
520
,
"sku"
:
"26046561"
,
"type"
:
"40"
},{
"couponId"
:
""
,
"desc"
:
""
,
"discount"
:
130
,
"giftQty"
:
0
,
"giftSku"
:
""
,
"name"
:
""
,
"originalPrice"
:
650
,
"parentSku"
:
""
,
"pcode"
:
"202210140079"
,
"proType"
:
""
,
"promotionPrice"
:
520
,
"sku"
:
"26046561"
,
"type"
:
"40"
},{
"couponId"
:
""
,
"desc"
:
""
,
"discount"
:
130
,
"giftQty"
:
0
,
"giftSku"
:
""
,
"name"
:
""
,
"originalPrice"
:
650
,
"parentSku"
:
""
,
"pcode"
:
"202210140079"
,
"proType"
:
""
,
"promotionPrice"
:
520
,
"sku"
:
"26046561"
,
"type"
:
"40"
},{
"couponId"
:
""
,
"desc"
:
""
,
"discount"
:
130
,
"giftQty"
:
0
,
"giftSku"
:
""
,
"name"
:
""
,
"originalPrice"
:
650
,
"parentSku"
:
""
,
"pcode"
:
"202210140079"
,
"proType"
:
""
,
"promotionPrice"
:
520
,
"sku"
:
"26046561"
,
"type"
:
"40"
}],
"totalDiscount"
:
520
,
"totalOriginalPrice"
:
2600
,
"totalPromotionPrice"
:
2080
},
"sessionId"
:
"2194034012563534266449692570"
,
"totalAmount"
:
2080
,
"totalCouponDiscount"
:
0
,
"totalDiscount"
:
520
,
"totalExcessiveCharge"
:
0
,
"wmDiscount"
:
0
,
"wmPtSharedDiscount"
:
0
,
"wmSjSharedDiscount"
:
0
},
"orderIds"
:[],
"orderStatusList"
:[{
"channel"
:
"219"
,
"createTime"
:
1667277274514
,
"id"
:
0
,
"modifyTime"
:
1667277274514
,
"orderId"
:
"219256353427933669163"
,
"orderStatus"
:
"40004"
,
"reason"
:
"支付已完成"
,
"reasonForFailure"
:
""
},{
"channel"
:
"219"
,
"createTime"
:
1667277267832
,
"id"
:
0
,
"modifyTime"
:
1667277267832
,
"orderId"
:
"219256353427933669163"
,
"orderStatus"
:
"40001"
,
"reason"
:
""
,
"reasonForFailure"
:
""
}],
"pcId"
:
"20"
,
"sellerInfo"
:
null
,
"shopInfo"
:{
"barCounter"
:
""
,
"child_store_id"
:
""
,
"operator"
:
""
,
"posId"
:
""
,
"selfHelpMac"
:
null
,
"storeId"
:
"403401"
,
"store_type"
:
""
},
"token"
:
""
,
"ver"
:
1
,
"fm_cmd"
:
1001
,
"pk_id"
:
42348
,
"order_unique_id"
:
111
}
{
"channel"
:
"213"
,
"cityId"
:
""
,
"delivery"
:{
"basicPrice"
:
0
,
"customerAddress"
:
""
,
"customerName"
:
""
,
"customerPhone"
:
"18317291111"
,
"deliveryFinishTime"
:
""
,
"deliveryId"
:
""
,
"deliveryTime"
:
""
,
"distancePrice"
:
0
,
"logisticsPhysicalCompany"
:
""
,
"name"
:
""
,
"phone"
:
""
,
"provinceName"
:
""
,
"sendOutTime"
:
""
,
"sku"
:
""
,
"type"
:
""
},
"invoice"
:{
"companyName"
:
""
,
"invoiceType"
:
0
,
"taxNum"
:
""
,
"title"
:
""
,
"transNum"
:
"07032088889997000001433"
},
"logistics"
:[],
"offlinePoints"
:
false
,
"orderContent"
:{
"appointmentVO"
:{
"appointmentTime"
:
"20230703141000"
,
"isAppointment"
:
1
},
"createTime"
:
"20230703140129"
,
"customer"
:[{
"accountId"
:
"276687855704635941"
,
"accountType"
:
"0"
,
"cardNo"
:
"8110210002012845139"
,
"dyCode"
:
""
,
"level"
:
""
,
"mobileNo"
:
"18317290572"
}],
"deliveryFee"
:
0
,
"ecoupons"
:[],
"extendedAttributes"
:{
"activities"
:[],
"amountMax"
:
0
,
"discountAmount"
:
0
,
"discountMax"
:
0
,
"discountRate"
:
100
,
"discountThreshold"
:
0
,
"memberDay"
:
0
,
"memberDayPoint"
:
0
,
"performanceServiceFee"
:
0
,
"platformServiceFee"
:
0
,
"pointMemberDay"
:
0
,
"pointsMax"
:
0
,
"pointsMultiple"
:
0
,
"pointsSumMax"
:
0
,
"source"
:
3
,
"storehouseId"
:
""
},
"ignorePoints"
:
0
,
"orderCoupons"
:[],
"orders"
:{
"cancelStatus"
:
""
,
"deliveryStatus"
:
""
,
"deliveryStatusDesc"
:
""
,
"id"
:
278512114220446489
,
"orderId"
:
"213278510174699830541"
,
"orderType"
:
"002"
,
"parentId"
:
""
,
"pickupCode"
:
"A0004"
,
"pickupPoint"
:
"002"
,
"products"
:[{
"activityId"
:
""
,
"additionalProducts"
:[],
"attributes"
:
""
,
"categoryCouponApportion"
:
0
,
"catgId"
:
"433006"
,
"couponQty"
:
0
,
"givePointApportion"
:
4
,
"groupIndex"
:
""
,
"groupName"
:
""
,
"id"
:
278512114220446490
,
"moneyApportion"
:
365
,
"name"
:
"上好佳荷兰豆"
,
"originalPrice"
:
830
,
"price"
:
365
,
"productCode"
:
"10_0567466"
,
"productType"
:
"1"
,
"qty"
:
2
,
"realQty"
:
0
,
"refundQty"
:
0
,
"sku"
:
"20819552"
,
"source"
:
""
,
"specs"
:[],
"status"
:
""
,
"useCouponApportion"
:
0
,
"usePointApportion"
:
0
,
"usePromotionApportion"
:
465
,
"virtualCouponApportion"
:
0
,
"weight"
:
65
},{
"activityId"
:
""
,
"additionalProducts"
:[],
"attributes"
:
""
,
"categoryCouponApportion"
:
0
,
"catgId"
:
"042001"
,
"couponQty"
:
0
,
"givePointApportion"
:
5
,
"groupIndex"
:
""
,
"groupName"
:
""
,
"id"
:
278512114220446491
,
"moneyApportion"
:
528
,
"name"
:
"小番茄a"
,
"originalPrice"
:
600
,
"price"
:
528
,
"productCode"
:
"10_0541114"
,
"productType"
:
"1"
,
"qty"
:
6
,
"realQty"
:
0
,
"refundQty"
:
0
,
"sku"
:
"20793524"
,
"source"
:
""
,
"specs"
:[],
"status"
:
""
,
"useCouponApportion"
:
0
,
"usePointApportion"
:
0
,
"usePromotionApportion"
:
72
,
"virtualCouponApportion"
:
0
,
"weight"
:
155
}],
"reason"
:
"支付已完成"
,
"reasonForFailure"
:
""
,
"remark"
:
""
,
"status"
:
"40006"
,
"statusDesc"
:
"已接单"
,
"storeType"
:
0
,
"totalOriginalPrice"
:
6090
,
"totalPrmotionPrice"
:
4728
},
"payInfos"
:[{
"accountId"
:
"8022210002002815578"
,
"amount"
:
3898
,
"fmId"
:
"ZHA1O1301395222"
,
"payCode"
:
""
,
"payType"
:
"10219"
,
"performanceServiceFee"
:
0
,
"platformServiceFee"
:
0
,
"transNum"
:
"231841359421"
}],
"payType"
:
"10219"
,
"points"
:{
"basicPoint"
:
0
,
"extraPoint"
:
38
,
"familyRice"
:
0
,
"nkbBasicPoint"
:
38
,
"nkbExtraPoint"
:
0
,
"pointDetails"
:[{
"desc"
:
""
,
"name"
:
"消费1元送1积分"
,
"pcode"
:
"201812270015"
,
"point"
:
38
,
"qty"
:
0
,
"sku"
:
"20383916"
,
"type"
:
"00"
}],
"totalPoint"
:
76
,
"zhxPoint"
:
0
},
"promotions"
:{
"promtionDetails"
:[{
"couponId"
:
"7100037743"
,
"desc"
:
""
,
"discount"
:
50
,
"giftQty"
:
0
,
"giftSku"
:
""
,
"name"
:
""
,
"originalPrice"
:
415
,
"parentSku"
:
""
,
"pcode"
:
"202212060006"
,
"proType"
:
""
,
"promotionPrice"
:
365
,
"sku"
:
"20819552"
,
"type"
:
"40"
},{
"couponId"
:
"7100037743"
,
"desc"
:
""
,
"discount"
:
72
,
"giftQty"
:
0
,
"giftSku"
:
""
,
"name"
:
""
,
"originalPrice"
:
600
,
"parentSku"
:
""
,
"pcode"
:
"202212060006"
,
"proType"
:
""
,
"promotionPrice"
:
528
,
"sku"
:
"20793524"
,
"type"
:
"40"
},{
"couponId"
:
""
,
"desc"
:
""
,
"discount"
:
415
,
"giftQty"
:
0
,
"giftSku"
:
""
,
"name"
:
""
,
"originalPrice"
:
830
,
"parentSku"
:
""
,
"pcode"
:
"202304110001"
,
"proType"
:
""
,
"promotionPrice"
:
415
,
"qty"
:
20
,
"sku"
:
"20819552"
,
"type"
:
"40"
}],
"totalDiscount"
:
1362
,
"totalOriginalPrice"
:
6090
,
"totalPromotionPrice"
:
4728
},
"sessionId"
:
"2132088882785101741398909560"
,
"totalAmount"
:
3898
,
"totalCouponDiscount"
:
0
,
"totalDiscount"
:
1362
,
"totalExcessiveCharge"
:
0
,
"wmDiscount"
:
0
,
"wmPtSharedDiscount"
:
0
,
"wmSjSharedDiscount"
:
0
},
"orderIds"
:[],
"orderStatusList"
:[{
"channel"
:
"213"
,
"createTime"
:
1688364096000
,
"id"
:
278493122843930373
,
"modifyTime"
:
1688364096000
,
"orderId"
:
"213278510174699830541"
,
"orderStatus"
:
"40006"
,
"reason"
:
""
,
"reasonForFailure"
:
""
},{
"channel"
:
"213"
,
"createTime"
:
1688364091000
,
"id"
:
278493117330517762
,
"modifyTime"
:
1688364091000
,
"orderId"
:
"213278510174699830541"
,
"orderStatus"
:
"40004"
,
"reason"
:
"支付已完成"
,
"reasonForFailure"
:
""
},{
"channel"
:
"213"
,
"createTime"
:
1688364089000
,
"id"
:
278493115661184818
,
"modifyTime"
:
1688364089000
,
"orderId"
:
"213278510174699830541"
,
"orderStatus"
:
"40001"
,
"reason"
:
""
,
"reasonForFailure"
:
""
}],
"pcId"
:
"10"
,
"sellerInfo"
:
null
,
"shopInfo"
:{
"barCounter"
:
""
,
"child_store_id"
:
""
,
"operator"
:
""
,
"posId"
:
"1"
,
"selfHelpMac"
:{
"id"
:
""
,
"shelf"
:
""
},
"storeId"
:
"208888"
,
"store_type"
:
"null"
},
"token"
:
""
,
"ver"
:
0
}
\ No newline at end of file
\ No newline at end of file
bin/testOrderJson_bak.json
0 → 100644
View file @
944ad6d4
{
"channel"
:
"219"
,
"cityId"
:
"003"
,
"delivery"
:{
"basicPrice"
:
0
,
"customerAddress"
:
""
,
"customerName"
:
""
,
"customerPhone"
:
"13119867445"
,
"deliveryFinishTime"
:
""
,
"deliveryId"
:
""
,
"deliveryTime"
:
""
,
"distancePrice"
:
0
,
"logisticsPhysicalCompany"
:
""
,
"name"
:
""
,
"phone"
:
""
,
"provinceName"
:
""
,
"sendOutTime"
:
""
,
"type"
:
""
},
"invoice"
:{
"companyName"
:
""
,
"invoiceType"
:
0
,
"taxNum"
:
""
,
"title"
:
""
,
"transNum"
:
"11014034019997000000501"
},
"offlinePoints"
:
false
,
"orderContent"
:{
"appointmentVO"
:{
"appointmentTime"
:
"20221101124000"
,
"isAppointment"
:
1
},
"createTime"
:
"20221101123427"
,
"customer"
:[{
"accountId"
:
"256334928765024804"
,
"accountType"
:
"1"
,
"cardNo"
:
"8610212009008790358"
,
"dyCode"
:
""
,
"level"
:
"1"
,
"mobileNo"
:
"13119867445"
}],
"deliveryFee"
:
0
,
"ecoupons"
:[],
"extendedAttributes"
:{
"activities"
:[],
"amountMax"
:
0
,
"discountAmount"
:
0
,
"discountMax"
:
0
,
"discountRate"
:
100
,
"discountThreshold"
:
0
,
"memberDay"
:
0
,
"memberDayPoint"
:
0
,
"performanceServiceFee"
:
0
,
"platformServiceFee"
:
0
,
"pointMemberDay"
:
0
,
"pointsMax"
:
0
,
"pointsMultiple"
:
0
,
"pointsSumMax"
:
0
,
"source"
:
4
,
"storehouseId"
:
""
},
"ignorePoints"
:
0
,
"orderCoupons"
:[{
"activityId"
:
"FM2210249003"
,
"bonusDayBusinessAmt"
:
0
,
"bonusDayBusinessType"
:
""
,
"campaignAmt"
:
0
,
"couponId"
:
"7100028567"
,
"couponName"
:
"每月礼包20-5元劵"
,
"couponProduct"
:[],
"discount"
:
-500
,
"ebcode"
:
"1000000001"
,
"orderId"
:
"219256353427933669163"
,
"paid"
:
0
,
"price"
:
0
,
"remainingAmt"
:
0
,
"securitiesTrader"
:
"N"
,
"sku"
:
""
,
"supplierNo"
:
"1000000001"
,
"totalAmount"
:
500
,
"transNum"
:
"801101000008"
,
"type"
:
"C"
,
"useAmount"
:
500
,
"usedNum"
:
1
}],
"orders"
:{
"cancelStatus"
:
""
,
"deliveryStatus"
:
""
,
"deliveryStatusDesc"
:
""
,
"id"
:
256354541336824349
,
"orderId"
:
"219256353427933669163"
,
"orderType"
:
"002"
,
"parentId"
:
""
,
"pickupCode"
:
"A0002"
,
"pickupPoint"
:
"002"
,
"products"
:[{
"activityId"
:
""
,
"additionalProducts"
:[],
"attributes"
:
""
,
"catgId"
:
"181003"
,
"couponQty"
:
0
,
"givePointApportion"
:
3
,
"groupIndex"
:
""
,
"groupName"
:
""
,
"id"
:
256354541336824350
,
"moneyApportion"
:
269
,
"name"
:
"冷冻烤红薯"
,
"originalPrice"
:
650
,
"price"
:
520
,
"productCode"
:
"20_0724500"
,
"productType"
:
"1"
,
"qty"
:
4
,
"realQty"
:
0
,
"refundQty"
:
0
,
"sku"
:
"26046561"
,
"source"
:
""
,
"specs"
:[],
"status"
:
""
,
"useCouponApportion"
:
124
,
"usePointApportion"
:
124
,
"usePromotionApportion"
:
130
,
"virtualCouponApportion"
:
0
,
"weight"
:
180
}],
"reason"
:
"支付已完成"
,
"reasonForFailure"
:
""
,
"remark"
:
""
,
"status"
:
"40004"
,
"statusDesc"
:
"已支付"
,
"storeType"
:
0
},
"payInfos"
:[{
"accountId"
:
"8610212009008790358"
,
"amount"
:
500
,
"fmId"
:
""
,
"payCode"
:
""
,
"payType"
:
"1010004"
,
"performanceServiceFee"
:
0
,
"platformServiceFee"
:
0
,
"transNum"
:
"801101000008"
},{
"accountId"
:
"8610212009008790358"
,
"amount"
:
500
,
"fmId"
:
"SXA1O37568633025"
,
"payCode"
:
""
,
"payType"
:
"1010005"
,
"performanceServiceFee"
:
0
,
"platformServiceFee"
:
0
,
"transNum"
:
"223051234321"
},{
"accountId"
:
"8610212009008790358"
,
"amount"
:
1080
,
"fmId"
:
"SXA1O37568625625"
,
"payCode"
:
""
,
"payType"
:
"20071"
,
"performanceServiceFee"
:
0
,
"platformServiceFee"
:
0
,
"transNum"
:
"2022110122001429921440751223"
}],
"payType"
:
"20071"
,
"points"
:{
"basicPoint"
:
15
,
"extraPoint"
:
0
,
"familyRice"
:
1
,
"nkbBasicPoint"
:
15
,
"nkbExtraPoint"
:
0
,
"pointDetails"
:[{
"desc"
:
""
,
"name"
:
"消费1元送1积分"
,
"pcode"
:
"202001010001"
,
"point"
:
20
,
"qty"
:
0
,
"sku"
:
"20383916"
,
"type"
:
"00"
}],
"totalPoint"
:
30
,
"zhxPoint"
:
0
},
"promotions"
:{
"promtionDetails"
:[{
"couponId"
:
""
,
"desc"
:
""
,
"discount"
:
130
,
"qty"
:
2
,
"giftQty"
:
0
,
"giftSku"
:
""
,
"name"
:
""
,
"originalPrice"
:
650
,
"parentSku"
:
""
,
"pcode"
:
"202210140079"
,
"proType"
:
""
,
"promotionPrice"
:
520
,
"sku"
:
"26046561"
,
"type"
:
"40"
},{
"couponId"
:
""
,
"desc"
:
""
,
"discount"
:
130
,
"qty"
:
3
,
"giftQty"
:
0
,
"giftSku"
:
""
,
"name"
:
""
,
"originalPrice"
:
650
,
"parentSku"
:
""
,
"pcode"
:
"202210140079"
,
"proType"
:
""
,
"promotionPrice"
:
520
,
"sku"
:
"26046561"
,
"type"
:
"40"
},{
"couponId"
:
""
,
"desc"
:
""
,
"discount"
:
130
,
"qty"
:
4
,
"giftQty"
:
0
,
"giftSku"
:
""
,
"name"
:
""
,
"originalPrice"
:
650
,
"parentSku"
:
""
,
"pcode"
:
"202210140079"
,
"proType"
:
""
,
"promotionPrice"
:
520
,
"sku"
:
"26046561"
,
"type"
:
"40"
},{
"couponId"
:
""
,
"desc"
:
""
,
"discount"
:
130
,
"qty"
:
5
,
"giftQty"
:
0
,
"giftSku"
:
""
,
"name"
:
""
,
"originalPrice"
:
650
,
"parentSku"
:
""
,
"pcode"
:
"202210140079"
,
"proType"
:
""
,
"promotionPrice"
:
520
,
"sku"
:
"26046561"
,
"type"
:
"40"
}],
"totalDiscount"
:
520
,
"totalOriginalPrice"
:
2600
,
"totalPromotionPrice"
:
2080
},
"sessionId"
:
"2194034012563534266449692570"
,
"totalAmount"
:
2080
,
"totalCouponDiscount"
:
0
,
"totalDiscount"
:
520
,
"totalExcessiveCharge"
:
0
,
"wmDiscount"
:
0
,
"wmPtSharedDiscount"
:
0
,
"wmSjSharedDiscount"
:
0
},
"orderIds"
:[],
"orderStatusList"
:[{
"channel"
:
"219"
,
"createTime"
:
1667277274514
,
"id"
:
0
,
"modifyTime"
:
1667277274514
,
"orderId"
:
"219256353427933669163"
,
"orderStatus"
:
"40004"
,
"reason"
:
"支付已完成"
,
"reasonForFailure"
:
""
},{
"channel"
:
"219"
,
"createTime"
:
1667277267832
,
"id"
:
0
,
"modifyTime"
:
1667277267832
,
"orderId"
:
"219256353427933669163"
,
"orderStatus"
:
"40001"
,
"reason"
:
""
,
"reasonForFailure"
:
""
}],
"pcId"
:
"20"
,
"sellerInfo"
:
null
,
"shopInfo"
:{
"barCounter"
:
""
,
"child_store_id"
:
""
,
"operator"
:
""
,
"posId"
:
""
,
"selfHelpMac"
:
null
,
"storeId"
:
"403401"
,
"store_type"
:
""
},
"token"
:
""
,
"ver"
:
1
,
"fm_cmd"
:
1001
,
"pk_id"
:
42348
,
"order_unique_id"
:
111
}
\ No newline at end of file
cmake_install.cmake
0 → 100644
View file @
944ad6d4
# Install script for directory: /home/freemud/FamilyMart/familyMart_takeaway
# Set the install prefix
if
(
NOT DEFINED CMAKE_INSTALL_PREFIX
)
set
(
CMAKE_INSTALL_PREFIX
"/usr/local"
)
endif
()
string
(
REGEX REPLACE
"/$"
""
CMAKE_INSTALL_PREFIX
"
${
CMAKE_INSTALL_PREFIX
}
"
)
# Set the install configuration name.
if
(
NOT DEFINED CMAKE_INSTALL_CONFIG_NAME
)
if
(
BUILD_TYPE
)
string
(
REGEX REPLACE
"^[^A-Za-z0-9_]+"
""
CMAKE_INSTALL_CONFIG_NAME
"
${
BUILD_TYPE
}
"
)
else
()
set
(
CMAKE_INSTALL_CONFIG_NAME
""
)
endif
()
message
(
STATUS
"Install configuration:
\"
${
CMAKE_INSTALL_CONFIG_NAME
}
\"
"
)
endif
()
# Set the component getting installed.
if
(
NOT CMAKE_INSTALL_COMPONENT
)
if
(
COMPONENT
)
message
(
STATUS
"Install component:
\"
${
COMPONENT
}
\"
"
)
set
(
CMAKE_INSTALL_COMPONENT
"
${
COMPONENT
}
"
)
else
()
set
(
CMAKE_INSTALL_COMPONENT
)
endif
()
endif
()
# Install shared libraries without execute permission?
if
(
NOT DEFINED CMAKE_INSTALL_SO_NO_EXE
)
set
(
CMAKE_INSTALL_SO_NO_EXE
"1"
)
endif
()
# Is this installation the result of a crosscompile?
if
(
NOT DEFINED CMAKE_CROSSCOMPILING
)
set
(
CMAKE_CROSSCOMPILING
"FALSE"
)
endif
()
# Set default install directory permissions.
if
(
NOT DEFINED CMAKE_OBJDUMP
)
set
(
CMAKE_OBJDUMP
"/usr/bin/objdump"
)
endif
()
if
(
CMAKE_INSTALL_COMPONENT
)
set
(
CMAKE_INSTALL_MANIFEST
"install_manifest_
${
CMAKE_INSTALL_COMPONENT
}
.txt"
)
else
()
set
(
CMAKE_INSTALL_MANIFEST
"install_manifest.txt"
)
endif
()
string
(
REPLACE
";"
"
\n
"
CMAKE_INSTALL_MANIFEST_CONTENT
"
${
CMAKE_INSTALL_MANIFEST_FILES
}
"
)
file
(
WRITE
"/home/freemud/FamilyMart/familyMart_takeaway/
${
CMAKE_INSTALL_MANIFEST
}
"
"
${
CMAKE_INSTALL_MANIFEST_CONTENT
}
"
)
src/JsonModule.cpp
View file @
944ad6d4
...
@@ -46,6 +46,22 @@ int GetJsonIntSafe(rapidjson::Value& obj,const char* key)
...
@@ -46,6 +46,22 @@ int GetJsonIntSafe(rapidjson::Value& obj,const char* key)
return
0
;
return
0
;
}
}
int
GetJsonIntSafeWithDefault
(
rapidjson
::
Value
&
obj
,
const
char
*
key
,
const
int
def
)
{
if
(
!
obj
.
IsNull
())
{
if
(
obj
.
HasMember
(
key
))
{
rapidjson
::
Value
&
vObj
=
obj
[
key
];
if
(
vObj
.
IsInt
())
{
return
vObj
.
GetInt
();
}
}
}
return
def
;
}
int64_t
GetJsonInt64Safe
(
rapidjson
::
Value
&
obj
,
const
char
*
key
)
int64_t
GetJsonInt64Safe
(
rapidjson
::
Value
&
obj
,
const
char
*
key
)
{
{
if
(
!
obj
.
IsNull
())
{
if
(
!
obj
.
IsNull
())
{
...
@@ -316,6 +332,9 @@ bool JsonModule::getPushOrders(IN const char* json,OUT orderObj &order)
...
@@ -316,6 +332,9 @@ bool JsonModule::getPushOrders(IN const char* json,OUT orderObj &order)
detail
.
originalPrice
=
GetJsonIntSafe
(
promtionDetails_obj
,
"originalPrice"
);
detail
.
originalPrice
=
GetJsonIntSafe
(
promtionDetails_obj
,
"originalPrice"
);
detail
.
promotionPrice
=
GetJsonIntSafe
(
promtionDetails_obj
,
"promotionPrice"
);
detail
.
promotionPrice
=
GetJsonIntSafe
(
promtionDetails_obj
,
"promotionPrice"
);
detail
.
discount
=
GetJsonIntSafe
(
promtionDetails_obj
,
"discount"
);
detail
.
discount
=
GetJsonIntSafe
(
promtionDetails_obj
,
"discount"
);
// detail.qty = GetJsonIntSafe(promtionDetails_obj, "qty");
detail
.
qty
=
GetJsonIntSafeWithDefault
(
promtionDetails_obj
,
"qty"
,
1
);
if
(
promtionDetails_obj
.
HasMember
(
"gifts"
)
)
{
if
(
promtionDetails_obj
.
HasMember
(
"gifts"
)
)
{
rapidjson
::
Value
&
gifts_obj
=
orderContent_obj
[
"gifts"
];
rapidjson
::
Value
&
gifts_obj
=
orderContent_obj
[
"gifts"
];
if
(
gifts_obj
.
IsObject
()
)
{
if
(
gifts_obj
.
IsObject
()
)
{
...
@@ -363,6 +382,7 @@ bool JsonModule::getPushOrders(IN const char* json,OUT orderObj &order)
...
@@ -363,6 +382,7 @@ bool JsonModule::getPushOrders(IN const char* json,OUT orderObj &order)
detail
.
sku
=
GetJsonStringSafe
(
pointDetails_obj
,
"sku"
);
detail
.
sku
=
GetJsonStringSafe
(
pointDetails_obj
,
"sku"
);
detail
.
proType
=
GetJsonStringSafe
(
pointDetails_obj
,
"type"
);
detail
.
proType
=
GetJsonStringSafe
(
pointDetails_obj
,
"type"
);
detail
.
qty
=
GetJsonIntSafe
(
pointDetails_obj
,
"qty"
);
detail
.
qty
=
GetJsonIntSafe
(
pointDetails_obj
,
"qty"
);
if
(
"00"
==
detail
.
proType
)
{
if
(
"00"
==
detail
.
proType
)
{
detail
.
proType
=
"CP"
;
detail
.
proType
=
"CP"
;
}
}
...
@@ -1282,6 +1302,8 @@ std::string JsonModule::_convertToNewOrderJson(orderObj &obj)
...
@@ -1282,6 +1302,8 @@ std::string JsonModule::_convertToNewOrderJson(orderObj &obj)
writer
.
Int
(
obj
.
vecPromotions
[
i
].
discount
);
writer
.
Int
(
obj
.
vecPromotions
[
i
].
discount
);
writer
.
Key
(
"promotionPrice"
);
writer
.
Key
(
"promotionPrice"
);
writer
.
Int
(
obj
.
vecPromotions
[
i
].
promotionPrice
);
writer
.
Int
(
obj
.
vecPromotions
[
i
].
promotionPrice
);
writer
.
Key
(
"qty"
);
writer
.
Int
(
obj
.
vecPromotions
[
i
].
qty
);
writer
.
Key
(
"giftSku"
);
writer
.
Key
(
"giftSku"
);
writer
.
String
(
obj
.
vecPromotions
[
i
].
giftSku
.
c_str
());
writer
.
String
(
obj
.
vecPromotions
[
i
].
giftSku
.
c_str
());
writer
.
Key
(
"giftQty"
);
writer
.
Key
(
"giftQty"
);
...
...
src/main.cpp
View file @
944ad6d4
...
@@ -36,7 +36,7 @@ std::string g_plugin_auto_login_init;
...
@@ -36,7 +36,7 @@ std::string g_plugin_auto_login_init;
TCPClient
g_simulator_pos_client
;
TCPClient
g_simulator_pos_client
;
#endif
#endif
std
::
string
g_plugin_version
=
"1.
3.2
RC"
;
//插件版本号;
std
::
string
g_plugin_version
=
"1.
4.0
RC"
;
//插件版本号;
std
::
string
g_init_data
;
std
::
string
g_init_data
;
std
::
string
g_init_data_ods_back
;
std
::
string
g_init_data_ods_back
;
std
::
string
g_local_pos_init_data
;
// 上一次 POS 初始化请求报文 本地化数据;
std
::
string
g_local_pos_init_data
;
// 上一次 POS 初始化请求报文 本地化数据;
...
@@ -405,6 +405,8 @@ int main(int argc,char *argv[])
...
@@ -405,6 +405,8 @@ int main(int argc,char *argv[])
}
else
if
(
1
==
dataType
)
{
//ODS Send Heartbeat ReqCommand;
}
else
if
(
1
==
dataType
)
{
//ODS Send Heartbeat ReqCommand;
LOG
(
INFO
)
<<
"==== PosPlugin StoreId= "
<<
g_store_id
<<
" ; PosNum= "
<<
g_pos_id
<<
" ===="
;
if
(
!
bInitDone
)
{
if
(
!
bInitDone
)
{
longConnectionOds
.
setSocketTimeout
(
1
);
longConnectionOds
.
setSocketTimeout
(
1
);
longConnectionOds
.
setValid
(
false
);
longConnectionOds
.
setValid
(
false
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment