Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
freemud.be.toolbox
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
陈宁
freemud.be.toolbox
Commits
d9b7ec5a
Commit
d9b7ec5a
authored
Jul 22, 2020
by
陈宁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
# dev 门店信息
parent
69160f37
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
636 additions
and
58 deletions
+636
-58
Freemud.BE.Toolbox.Testing/GeneralTest.cs
+107
-0
Freemud.BE.Toolbox.WebApi/Controllers/RequestResourceController.cs
+3
-3
Freemud.BE.Toolbox.WebApi/Model/Request/GetStoreInfoRequest.cs
+7
-3
Freemud.BE.Toolbox.WebApi/Proxy/FmStoreProxy.cs
+50
-2
Freemud.BE.Toolbox.WebApi/Services/IRequestResourceService.cs
+1
-1
Freemud.BE.Toolbox.WebApi/Services/Impl/RequestResourceService.cs
+47
-16
Freemud.BE.Toolbox.WebApi/appsettings.json
+13
-0
freemud.be.toolboxview/src/views/requestresource/CanDaoStoreSearch.vue
+371
-1
freemud.be.toolboxview/src/views/requestresource/CouponProductSearch.vue
+19
-17
freemud.be.toolboxview/src/views/requestresource/ProductSearch.vue
+14
-11
freemud.be.toolboxview/src/views/requestresource/RequestResource.vue
+4
-4
No files found.
Freemud.BE.Toolbox.Testing/GeneralTest.cs
View file @
d9b7ec5a
...
...
@@ -4,6 +4,7 @@ using Newtonsoft.Json.Linq;
using
System
;
using
System.Collections.Generic
;
using
System.Dynamic
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
Freemud.BE.Toolbox.Testing
...
...
@@ -17,6 +18,9 @@ namespace Freemud.BE.Toolbox.Testing
Console
.
WriteLine
(
ChannelEnum
.
Delivery
);
Console
.
WriteLine
(
ChannelEnum
.
Delivery
.
ToString
());
Console
.
WriteLine
((
int
)
ChannelEnum
.
Delivery
);
Console
.
WriteLine
(
ChannelEnum
.
Delivery
.
GetValueString
());
Console
.
WriteLine
(
ChannelEnum
.
Kiosk
.
GetValueString
());
Console
.
WriteLine
(
DateTime
.
Now
);
Console
.
WriteLine
(
DateTime
.
Now
.
ToString
());
...
...
@@ -82,6 +86,100 @@ namespace Freemud.BE.Toolbox.Testing
c
.
Channel
=
5
;
Console
.
WriteLine
(
c
?.
Channel
==
(
int
)
ChannelEnum
.
Delivery
);
}
[
TestMethod
]
public
void
alskdjaslkdj
()
{
int
returnCode
=
1
;
Customer
customer
=
null
;
if
(
returnCode
==
customer
?.
Channel
)
Console
.
WriteLine
(
"相同"
);
else
Console
.
WriteLine
(
"不同"
);
if
(
customer
?.
Channel
.
Equals
(
returnCode
)
??
false
)
Console
.
WriteLine
(
"相同"
);
else
Console
.
WriteLine
(
"不同"
);
customer
=
new
Customer
{
Channel
=
1
};
if
(
returnCode
==
customer
?.
Channel
)
Console
.
WriteLine
(
"相同"
);
else
Console
.
WriteLine
(
"不同"
);
var
deliveryHours
=
"06:30-23:00;06:30;06:30-23:00;06:30-23:00;06:30-23:00;06:30-23:00;06:30-23:00"
;
var
dhs
=
deliveryHours
.
Split
(
';'
,
';'
);
foreach
(
var
d
in
dhs
)
{
var
ts
=
d
.
Split
(
'-'
);
if
(
ts
.
Length
==
2
)
{
var
workingStartTime
=
d
.
Split
(
'-'
)[
0
].
Trim
();
var
workingEndTime
=
d
.
Split
(
'-'
)[
1
].
Trim
();
Console
.
WriteLine
(
$"workingStartTime:
{
workingStartTime
}
, workingEndTime:
{
workingEndTime
}
"
);
}
else
{
Console
.
WriteLine
(
$"时间区间有误; ts: "
+
d
);
}
}
Console
.
WriteLine
(
$"
{
DateTime
.
Now
.
ToString
(
"yyyyMMdd"
)}{
Guid
.
NewGuid
().
ToString
().
Replace
(
"-"
,
""
)}{
DateTime
.
Now
.
ToString
(
"HHmmss"
)}
"
);
Console
.
WriteLine
(
$"
{
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmss"
)}{
Guid
.
NewGuid
().
ToString
().
Replace
(
"-"
,
""
)}
"
);
Console
.
WriteLine
(
$"
{
Guid
.
NewGuid
().
ToString
().
Replace
(
"-"
,
""
)}{
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmss"
)}
"
);
Console
.
WriteLine
(
$"
{
DateTime
.
Now
.
ToString
(
"MMdd"
)}{
Guid
.
NewGuid
().
ToString
().
Replace
(
"-"
,
""
)}{
DateTime
.
Now
.
ToString
(
"HHmm"
)}
"
);
Console
.
WriteLine
(
$"
{
DateTime
.
Now
.
ToString
(
"MMddHHmm"
)}{
Guid
.
NewGuid
().
ToString
().
Replace
(
"-"
,
""
)}
"
);
Console
.
WriteLine
(
$"
{
DateTime
.
Now
.
ToString
(
"yyMMddHHmm"
)}{
Guid
.
NewGuid
().
ToString
().
Replace
(
"-"
,
""
)}
"
);
Console
.
WriteLine
(
$"
{
Guid
.
NewGuid
().
ToString
().
Replace
(
"-"
,
""
)}{
DateTime
.
Now
.
ToString
(
"MMddHHmm"
)}
"
);
var
datetime
=
new
DateTime
(
2021
,
1
,
1
);
Console
.
WriteLine
(
datetime
.
ToString
(
"yyyyMMddHHmmss"
));
Console
.
WriteLine
(
datetime
.
ToString
(
"yyMMddHHmmss"
));
Console
.
WriteLine
(
datetime
.
ToString
(
"YMDHHmmss"
));
string
a
=
null
;
Console
.
WriteLine
(
"a"
.
Equals
(
null
));
Console
.
WriteLine
(
"a"
.
Equals
(
string
.
Empty
));
Console
.
WriteLine
(
a
?.
Equals
(
"a"
));
Console
.
WriteLine
(
a
?.
Equals
(
"a"
)
??
false
);
}
[
TestMethod
]
public
void
askdasldas
()
{
var
names
=
new
List
<
string
>
{
"a"
,
"b"
,
"c"
};
Parallel
.
ForEach
(
names
,
n
=>
{
Console
.
WriteLine
(
n
);
Thread
.
Sleep
(
1000
);
});
Console
.
WriteLine
(
"执行完毕"
);
}
[
TestMethod
]
public
void
asdkljaslkdjaslkj
()
{
var
terms
=
"113.9371337890625,22.575050354003906"
;
var
longtitude
=
decimal
.
Parse
(
terms
.
Split
(
","
)[
0
]);
var
latitude
=
decimal
.
Parse
(
terms
.
Split
(
","
)[
1
]);
Console
.
WriteLine
(
longtitude
);
Console
.
WriteLine
(
latitude
);
}
}
public
class
Customer
...
...
@@ -100,4 +198,13 @@ namespace Freemud.BE.Toolbox.Testing
Kiosk
=
3
,
Mcoffee
=
4
}
public
static
class
ChannelEnumExtensions
{
public
static
string
GetValueString
(
this
ChannelEnum
channel
)
{
return
((
int
)
channel
).
ToString
();
}
}
}
Freemud.BE.Toolbox.WebApi/Controllers/RequestResourceController.cs
View file @
d9b7ec5a
...
...
@@ -29,10 +29,10 @@ namespace Freemud.BE.Toolbox.WebApi.Controllers
return
Ok
(
data
:
await
requestResourceService
.
GetProductInfo
(
request
));
}
[
HttpPost
(
"get-store
-by-position
"
)]
public
async
Task
<
IActionResult
>
GetStore
ByPosition
([
FromBody
]
GetProduct
InfoRequest
request
)
[
HttpPost
(
"get-store"
)]
public
async
Task
<
IActionResult
>
GetStore
Info
([
FromBody
]
GetStore
InfoRequest
request
)
{
return
Ok
(
data
:
await
requestResourceService
.
Get
Product
Info
(
request
));
return
Ok
(
data
:
await
requestResourceService
.
Get
Store
Info
(
request
));
}
}
}
Freemud.BE.Toolbox.WebApi/Model/Request/GetStore
ByPosition
Request.cs
→
Freemud.BE.Toolbox.WebApi/Model/Request/GetStore
Info
Request.cs
View file @
d9b7ec5a
...
...
@@ -5,10 +5,14 @@ using System.Threading.Tasks;
namespace
Freemud.BE.Toolbox.WebApi.Model.Request
{
public
class
GetStore
ByPosition
Request
:
BaseRequestResourceRequest
public
class
GetStore
Info
Request
:
BaseRequestResourceRequest
{
public
long
l
ongitude
{
get
;
set
;
}
//public long L
ongitude { get; set; }
public
long
latitude
{
get
;
set
;
}
//public long Latitude { get; set; }
public
string
Terms
{
get
;
set
;
}
public
long
Timestamp
{
get
;
set
;
}
}
}
Freemud.BE.Toolbox.WebApi/Proxy/FmStoreProxy.cs
View file @
d9b7ec5a
using
Freemud.BE.Toolbox.WebApi.Model
;
using
Freemud.BE.Toolbox.WebApi.Infrastructure.Helpers
;
using
Freemud.BE.Toolbox.WebApi.Model
;
using
Freemud.BE.Toolbox.WebApi.Model.Response
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
...
...
@@ -8,8 +10,54 @@ namespace Freemud.BE.Toolbox.WebApi.Proxy
{
public
class
FmStoreProxy
:
BaseProxy
{
public
FmStoreProxy
(
ToolboxConfiguration
toolboxConfiguration
)
:
base
(
toolboxConfiguration
)
public
FmStoreProxy
(
ToolboxConfiguration
toolboxConfiguration
)
:
base
(
toolboxConfiguration
)
{
}
/// <summary>
/// 请求餐道根据经纬度获取门店编号
/// </summary>
/// <returns></returns>
public
async
Task
<
RequestResourceResponse
>
GetStoreCodeFromCandao
(
string
env
,
decimal
longitude
,
decimal
latitude
)
{
var
url
=
GetUrl
(
env
,
"CanDao"
,
"getByPosition"
);
var
body
=
new
{
longitude
,
latitude
};
var
response
=
await
HttpHeper
.
Post
(
url
,
jsonBody
:
body
);
return
new
RequestResourceResponse
{
Name
=
"请求餐道根据经纬度获取门店编号"
,
Url
=
url
,
RequestBody
=
body
,
ResponseContent
=
response
.
Content
,
ResponseError
=
response
.
ErrorMessage
};
}
/// <summary>
/// 请求门店服务获取门店详情
/// </summary>
/// <returns></returns>
public
async
Task
<
RequestResourceResponse
>
GetStoreInfo
(
string
channel
,
string
env
,
string
storeCode
,
long
timeStamp
)
{
var
url
=
GetUrl
(
env
,
"FreemudStore"
,
"storeGet"
);
var
body
=
new
{
partnerId
=
GetChannelUnifyId
(
channel
,
env
),
storeCode
,
activeFlag
=
1
,
// 有效标识(1:有效 0:无效)
typeFlag
=
3
,
// 1:总公司 2:公司 3:门店
delivery
=
"1"
,
// 是否开通delivery{1.是;2.否} 不传查询全部
appointmentTime
=
timeStamp
// 时间戳(期望配送时间)
};
var
response
=
await
HttpHeper
.
Post
(
url
,
jsonBody
:
body
);
return
new
RequestResourceResponse
{
Name
=
"请求门店服务获取门店详情"
,
Url
=
url
,
RequestBody
=
body
,
ResponseContent
=
response
.
Content
,
ResponseError
=
response
.
ErrorMessage
};
}
}
}
Freemud.BE.Toolbox.WebApi/Services/IRequestResourceService.cs
View file @
d9b7ec5a
...
...
@@ -13,6 +13,6 @@ namespace Freemud.BE.Toolbox.WebApi.Services
Task
<
List
<
RequestResourceResponse
>>
GetProductInfo
(
GetProductInfoRequest
request
);
Task
<
RequestResourceResponse
>
GetStoreByPosition
(
GetStoreByPosition
Request
request
);
Task
<
List
<
RequestResourceResponse
>>
GetStoreInfo
(
GetStoreInfo
Request
request
);
}
}
Freemud.BE.Toolbox.WebApi/Services/Impl/RequestResourceService.cs
View file @
d9b7ec5a
...
...
@@ -85,7 +85,6 @@ namespace Freemud.BE.Toolbox.WebApi.Services
public
async
Task
<
List
<
RequestResourceResponse
>>
GetProductInfo
(
GetProductInfoRequest
request
)
{
var
products
=
await
fmProductProxy
.
GetProductBaseInfos
(
request
);
var
extendsions
=
await
fmProductProxy
.
GetProductExtensionInfo
(
request
.
Env
,
request
.
ProductId
);
...
...
@@ -95,27 +94,58 @@ namespace Freemud.BE.Toolbox.WebApi.Services
#
endregion
#
region
门店
public
async
Task
<
RequestResourceResponse
>
GetStoreByPosition
(
GetStoreByPositionRequest
request
)
public
async
Task
<
List
<
RequestResourceResponse
>>
GetStoreInfo
(
GetStoreInfoRequest
request
)
{
throw
new
NotImplementedException
();
//var candaoResponse = await GetCanDaoStoreByPosition(request);
//return Response("未统计", responseBody: candaoResponse);
}
logger
.
LogInformation
(
"[GetStoreInfo] request: "
+
JsonConvert
.
SerializeObject
(
request
));
var
result
=
new
List
<
RequestResourceResponse
>();
var
storeCodes
=
string
.
Empty
;
var
isPosition
=
request
.
Terms
.
Contains
(
"."
);
RequestResourceResponse
candaoResponse
=
null
;
if
(
isPosition
)
{
// 经纬度查询
var
longitude
=
decimal
.
Parse
(
request
.
Terms
.
Split
(
","
)[
0
]);
var
latitude
=
decimal
.
Parse
(
request
.
Terms
.
Split
(
","
)[
1
]);
candaoResponse
=
await
fmStoreProxy
.
GetStoreCodeFromCandao
(
request
.
Env
,
longitude
,
latitude
);
private
async
Task
<
dynamic
>
GetCanDaoStoreByPosition
(
GetStoreByPositionRequest
request
)
var
jo
=
JObject
.
Parse
(
candaoResponse
.
ResponseContent
);
if
(
jo
.
ContainsKey
(
"data"
))
{
throw
new
NotImplementedException
();
//var url = GetUrl(request.Env, "CanDao", "getByPosition");
//var body = new
//{
// request.longitude,
// request.latitude
//};
var
jStores
=
JArray
.
Parse
(
jo
[
"data"
].
ToString
());
if
(
jStores
?.
Any
()
??
false
)
storeCodes
=
jStores
.
Select
(
d
=>
d
[
"extraId"
].
ToString
()).
ToList
()?.
Aggregate
((
p
,
n
)
=>
$"
{
p
}
,
{
n
}
"
);
}
}
else
{
candaoResponse
=
new
RequestResourceResponse
{
Name
=
"请求餐道根据经纬度获取门店编号"
,
ResponseError
=
"无需查询餐道"
};
storeCodes
=
request
.
Terms
;
}
//var response = await HttpHeper.Post<dynamic>(url, jsonBody: body
);
result
.
Add
(
candaoResponse
);
//return response.Data;
if
(!
string
.
IsNullOrWhiteSpace
(
storeCodes
))
{
var
sotreInfoResponse
=
await
fmStoreProxy
.
GetStoreInfo
(
request
.
Channel
,
request
.
Env
,
storeCodes
,
request
.
Timestamp
);
result
.
Add
(
sotreInfoResponse
);
}
else
{
result
.
Add
(
new
RequestResourceResponse
{
Name
=
"请求门店服务获取门店详情"
,
ResponseError
=
"未查询门店服务"
});
}
return
result
;
}
#
endregion
}
}
\ No newline at end of file
Freemud.BE.Toolbox.WebApi/appsettings.json
View file @
d9b7ec5a
...
...
@@ -89,6 +89,19 @@
]
},
{
"Name"
:
"FreemudStore"
,
"DevBaseUrl"
:
"http://10.54.2.115"
,
"ProdBaseUrl"
:
"http://10.52.16.31"
,
"Description"
:
"非码门店服务"
,
"Resources"
:
[
{
"Name"
:
"storeGet"
,
"Path"
:
"/api/v2/organization/get"
,
"Description"
:
"获取门店信息"
}
]
},
{
"Name"
:
"CanDao"
,
"DevBaseUrl"
:
"https://qc.can-dao.com:3900"
,
"ProdBaseUrl"
:
"https://mcdmap.can-dao.com"
,
...
...
freemud.be.toolboxview/src/views/requestresource/CanDaoStoreSearch.vue
View file @
d9b7ec5a
<
template
>
<div>
<h1>
can-dao store search
</h1>
<Form
:label-width=
"110"
>
<Row>
<Col
span=
"12"
>
<FormItem
label=
"渠道"
>
<RadioGroup
type=
"button"
v-model=
"channel"
>
<Radio
label=
"delivery"
>
<Icon
type=
"md-bicycle"
/>
麦乐送
</Radio>
<Radio
label=
"mcoffee"
>
<Icon
type=
"md-cafe"
/>
麦咖啡
</Radio>
<Radio
label=
"kiosk"
>
<Icon
type=
"md-ice-cream"
/>
甜品站
</Radio>
</RadioGroup>
</FormItem>
</Col>
<Col
span=
"12"
>
<FormItem
label=
"环境"
>
<RadioGroup
type=
"button"
v-model=
"env"
>
<Radio
label=
"dev"
>
开发环境
</Radio>
<Radio
label=
"prod"
>
生产环境
</Radio>
</RadioGroup>
</FormItem>
</Col>
<Col
span=
"12"
>
<FormItem
label=
"门店号 / 经纬度"
>
<AutoComplete
v-model=
"terms"
:data=
"[1450026, 1450217, 99998, 99995, 99992]"
placeholder=
"门店号(eg. 1450026) / 经纬度(eg. 113.9371337890625,22.575050354003906)"
clearable
></AutoComplete>
</FormItem>
</Col>
<Col
span=
"12"
>
<FormItem
label=
"时间"
>
<DatePicker
type=
"datetime"
placeholder=
"选择时间"
:value=
"time"
@
on-change=
"onTimeChange"
></DatePicker>
</FormItem>
</Col>
<Col
span=
"12"
>
<FormItem>
<Button
type=
"primary"
icon=
"ios-search"
:loading=
"loadingSearch"
@
click=
"search()"
>
<span
v-if=
"!loadingSearch"
>
查 询
</span>
<span
v-else
>
查询中
</span>
</Button>
</FormItem>
</Col>
</Row>
</Form>
<div
class=
"resource-result"
>
<Tabs
:animated=
"false"
>
<TabPane
label=
"结果"
icon=
"md-list-box"
>
<Row
class=
"coupon-line"
:gutter=
"16"
>
<Col
span=
"12"
>
<Card
dis-hover
>
<p
slot=
"title"
>
餐道
</p>
<div
v-for=
"candao in retCandaos"
:key=
"candao.storeCode"
>
<Table
v-if=
"candao.ret"
border
size=
"small"
:columns=
"colCoupons"
:data=
"candao.data"
:show-header=
"false"
>
<template
slot-scope=
"
{ row }" slot="name">
<div
class=
"xxx"
>
<strong>
{{
row
.
name
}}
</strong>
<Tag
color=
"geekblue"
>
{{
row
.
field
}}
</Tag>
</div>
</
template
>
<
template
slot-scope=
"{ row }"
slot=
"val"
>
<div
v-if=
"row.field === 'longitude-latitude'"
>
<Tag
color=
"purple"
>
经度 -
{{
row
.
val
.
longitude
}}
</Tag>
<Tag
color=
"purple"
>
维度 -
{{
row
.
val
.
latitude
}}
</Tag>
</div>
<div
v-else-if=
"row.field === 'address'"
>
<p>
{{
row
.
val
.
province
}}
-
{{
row
.
val
.
city
}}
-
{{
row
.
val
.
district
}}
-
{{
row
.
val
.
address
}}
</p>
</div>
<div
v-else
>
{{
row
.
val
}}
<Tooltip
v-if=
"row.descriptor"
max-width=
"200"
placement=
"right"
transfer
>
<span
style=
"color:#ed4014"
>
(
{{
row
.
descriptor
.
memo
}}
)
</span>
<Icon
type=
"md-information-circle"
/>
<div
slot=
"content"
>
{{
row
.
descriptor
.
desc
}}
</div>
</Tooltip>
</div>
</
template
>
</Table>
<div
v-else
>
<Alert
banner
type=
"warning"
>
{{candao.data}}
</Alert>
</div>
</div>
</Card>
</Col>
<Col
span=
"12"
>
<Card
dis-hover
>
<p
slot=
"title"
>
门店
</p>
<div
v-for=
"store in retStores"
:key=
"store.storeCode"
>
<div
v-if=
"store.ret"
>
<Alert
show-icon
>
<Icon
type=
"ios-bulb-outline"
slot=
"icon"
></Icon>
聚合层门店是否营业
<p>
<b>
Pickup
</b>
activeFlag = 1
&&
placeOrderFlag = 1
&&
state = 1
</p>
<p>
<b>
Delivery
</b>
activeFlag = 1
&&
delivery = 1
</p>
<p>
<b>
Mcoffee
</b>
activeFlag = 1
&&
delivery = 1
</p>
<p>
<b>
Kiosk
</b>
placeOrderFlag = 1
&&
state = 1
</p>
</Alert>
<Table
border
size=
"small"
:columns=
"colCoupons"
:data=
"store.data"
:show-header=
"false"
>
<
template
slot-scope=
"{ row }"
slot=
"name"
>
<div
class=
"xxx"
>
<strong>
{{
row
.
name
}}
</strong>
<Tag
color=
"geekblue"
>
{{
row
.
field
}}
</Tag>
</div>
</
template
>
<
template
slot-scope=
"{ row }"
slot=
"val"
>
<div
v-if=
"row.field === 'longitude-latitude'"
>
<Tag
color=
"purple"
>
经度 -
{{
row
.
val
.
longitude
}}
</Tag>
<Tag
color=
"purple"
>
维度 -
{{
row
.
val
.
latitude
}}
</Tag>
</div>
<div
v-else
>
{{
row
.
val
}}
<Tooltip
v-if=
"row.descriptor"
max-width=
"200"
placement=
"right"
transfer
>
<span
style=
"color:#ed4014"
>
(
{{
row
.
descriptor
.
memo
}}
)
</span>
<Icon
type=
"md-information-circle"
/>
<div
slot=
"content"
>
{{
row
.
descriptor
.
desc
}}
</div>
</Tooltip>
</div>
</
template
>
</Table>
</div>
<div
v-else
>
<Alert
banner
type=
"warning"
>
{{store.data}}
</Alert>
</div>
</div>
</Card>
</Col>
</Row>
</TabPane>
<TabPane
label=
"元信息"
icon=
"md-code"
>
<div
class=
"resource-result-metadata-panel"
>
<div
v-for=
"item in metaData"
:key=
"item.name"
class=
"resource-result-metadata-item"
>
<span
class=
"resource-result-metadata-item-title"
>
{{item.name}}
</span>
<codemirror
:value=
"buildMetaData(item)"
:options=
"cmOptions"
></codemirror>
</div>
</div>
</TabPane>
</Tabs>
</div>
</div>
</template>
<
script
>
// require component And styles And Themes
import
{
codemirror
}
from
'vue-codemirror'
import
'codemirror/mode/javascript/javascript.js'
import
'codemirror/lib/codemirror.css'
import
'codemirror/theme/the-matrix.css'
export
default
{
components
:
{
codemirror
},
data
()
{
return
{
loadingSearch
:
false
,
channel
:
'delivery'
,
env
:
'dev'
,
time
:
new
Date
(),
terms
:
'113.9371337890625,22.575050354003906'
,
metaData
:
[],
vData
:
[],
retCandaos
:
[],
retStores
:
[],
cmOptions
:
{
lineNumbers
:
true
,
readOnly
:
true
,
tabSize
:
2
,
model
:
'text/javascript'
,
theme
:
'the-matrix'
},
colCoupons
:
[{
slot
:
'name'
},
{
slot
:
'val'
}]
}
},
methods
:
{
async
search
()
{
if
(
!
this
.
terms
)
{
this
.
$Message
.
warning
(
'请输入门店号 或 经纬度'
)
return
}
if
(
!
this
.
time
)
{
this
.
$Message
.
warning
(
'请输入时间'
)
return
}
this
.
loadingSearch
=
true
const
params
=
{
env
:
this
.
env
,
channel
:
this
.
channel
,
terms
:
this
.
terms
,
timestamp
:
this
.
_moment
(
this
.
time
).
format
(
'X'
)
}
const
{
data
:
response
}
=
await
this
.
$http
.
post
(
'/requestresource/get-store'
,
params
)
if
(
response
.
code
!==
200
)
{
this
.
$Message
.
error
(
response
.
message
)
}
else
{
this
.
metaData
=
response
.
data
this
.
bindData
(
response
.
data
)
}
this
.
loadingSearch
=
false
},
bindData
(
data
)
{
const
candaos
=
[]
if
(
data
[
0
].
responseContent
)
{
const
responseCandaos
=
JSON
.
parse
(
data
[
0
].
responseContent
)
if
(
responseCandaos
.
data
)
{
responseCandaos
.
data
.
forEach
(
c
=>
{
const
data
=
[
{
name
:
'编号'
,
field
:
'storeId'
,
val
:
c
.
storeId
},
{
name
:
'门店号'
,
field
:
'extraId'
,
val
:
c
.
extraId
},
{
name
:
'名称'
,
field
:
'storeName'
,
val
:
c
.
storeName
},
{
name
:
'地址'
,
field
:
'address'
,
val
:
{
province
:
c
.
provinceName
,
city
:
c
.
cityName
,
district
:
c
.
districtName
,
address
:
c
.
storeAddress
}
},
{
name
:
'经纬度'
,
field
:
'longitude-latitude'
,
val
:
{
longitude
:
c
.
longitude
,
latitude
:
c
.
latitude
}
}
]
candaos
.
push
({
ret
:
true
,
storeCode
:
c
.
extraId
,
storeName
:
c
.
storeName
,
data
:
data
})
})
}
else
{
candaos
.
push
({
ret
:
false
,
storeCode
:
''
,
data
:
responseCandaos
.
msg
})
}
}
else
{
candaos
.
push
({
ret
:
false
,
storeCode
:
''
,
data
:
data
[
0
].
responseError
})
}
this
.
retCandaos
=
candaos
const
stores
=
[]
if
(
data
[
1
].
responseContent
)
{
const
responseStores
=
JSON
.
parse
(
data
[
1
].
responseContent
)
if
(
responseStores
.
bizVO
)
{
const
vo
=
responseStores
.
bizVO
const
data
=
[
{
name
:
'门店号'
,
field
:
'storeCode'
,
val
:
vo
.
storeCode
},
{
name
:
'名称'
,
field
:
'storeName'
,
val
:
vo
.
storeName
},
{
name
:
'地址'
,
field
:
'address'
,
val
:
vo
.
address
},
{
name
:
'经纬度'
,
field
:
'longitude-latitude'
,
val
:
{
longitude
:
vo
.
longitude
,
latitude
:
vo
.
latitude
}
},
{
name
:
'电话'
,
field
:
'phone'
,
val
:
vo
.
phone
},
{
name
:
'营业时间'
,
field
:
'businessHours'
,
val
:
vo
.
businessHours
},
{
name
:
'配送时间'
,
field
:
'deliveryHours'
,
val
:
vo
.
deliveryHours
},
{
name
:
'状态'
,
field
:
'activeFlag'
,
val
:
vo
.
activeFlag
},
{
name
:
'营业状态'
,
field
:
'state'
,
val
:
vo
.
state
},
{
name
:
'下单平台'
,
field
:
'placeOrderFlag'
,
val
:
vo
.
placeOrderFlag
},
{
name
:
'是否配送'
,
field
:
'delivery'
,
val
:
vo
.
delivery
},
{
name
:
'配送费'
,
field
:
'deliveryPrice'
,
val
:
vo
.
deliveryPrice
}
]
data
.
forEach
(
d
=>
{
d
.
descriptor
=
this
.
buildStoreDescriptor
(
d
.
field
,
d
.
val
)
})
stores
.
push
({
ret
:
true
,
storeCode
:
vo
.
storeCode
,
storeName
:
vo
.
storeName
,
data
:
data
})
}
else
{
stores
.
push
({
ret
:
false
,
storeCode
:
''
,
data
:
responseStores
.
msg
})
}
}
else
{
stores
.
push
({
ret
:
false
,
storeCode
:
''
,
data
:
data
[
1
].
responseError
})
}
this
.
retStores
=
stores
},
buildMetaData
(
data
)
{
return
'================ URL ================
\
r
\
n'
+
data
.
url
+
'
\
n
\
n'
+
'================ HEADERS ============
\
r
\
n'
+
JSON
.
stringify
(
data
.
requestHeaders
,
null
,
'
\
t'
)
+
'
\
r
\
n'
+
'================ DATA ===============
\
r
\
n'
+
JSON
.
stringify
(
data
.
requestBody
,
null
,
'
\
t'
)
+
'
\
r
\
n'
+
'================ RESPONSE ===============
\
r
\
n'
+
JSON
.
stringify
(
JSON
.
parse
(
data
.
responseContent
),
null
,
'
\
t'
)
},
onTimeChange
(
datetime
)
{
this
.
time
=
datetime
},
buildStoreDescriptor
(
field
,
val
)
{
let
memo
=
''
let
desc
=
''
if
(
field
===
'activeFlag'
)
{
switch
(
parseInt
(
val
))
{
case
1
:
memo
=
'有效'
break
case
2
:
memo
=
'无效'
break
default
:
break
}
desc
=
'1)有效, 2)无效'
}
else
if
(
field
===
'state'
)
{
switch
(
parseInt
(
val
))
{
case
1
:
memo
=
'营业'
break
case
2
:
memo
=
'歇业'
break
case
3
:
memo
=
'停业'
break
default
:
break
}
desc
=
'1)营业, 2)歇业, 3)停业'
}
else
if
(
field
===
'placeOrderFlag'
)
{
switch
(
parseInt
(
val
))
{
case
1
:
memo
=
'是'
break
case
2
:
memo
=
'否'
break
default
:
break
}
desc
=
'1)是, 2)否'
}
else
if
(
field
===
'delivery'
)
{
switch
(
parseInt
(
val
))
{
case
1
:
memo
=
'是'
break
case
2
:
memo
=
'否'
break
default
:
break
}
desc
=
'1)是, 2)否'
}
if
(
memo
||
desc
)
{
return
{
memo
,
desc
}
}
return
null
}
}
}
</
script
>
<
style
lang=
"less"
scope
>
.coupon-line
{
margin-bottom
:
15px
;
.xxx
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
}
.ivu-table-cell
{
padding-right
:
0px
;
}
}
</
style
>
freemud.be.toolboxview/src/views/requestresource/CouponProductSearch.vue
View file @
d9b7ec5a
...
...
@@ -31,12 +31,13 @@
v-model=
"storeId"
:data=
"[1450026, 1450217, 99998, 99995, 99992]"
placeholder=
"门店编号"
clearable
></AutoComplete>
</FormItem>
</Col>
<Col
span=
"12"
>
<FormItem
label=
"券号"
>
<Input
type=
"text"
v-model=
"couponCode"
placeholder=
"券号"
></Input>
<Input
type=
"text"
v-model=
"couponCode"
placeholder=
"券号"
clearable
></Input>
</FormItem>
</Col>
<Col
span=
"12"
>
...
...
@@ -232,17 +233,14 @@ export default {
{
name
:
'对应商品编号'
,
field
:
'mcd_productCode'
,
val
:
c
.
codeInfo
.
products
[
0
].
mcd_productCode
},
{
name
:
'mcd_tenderCode'
,
field
:
'mcd_tenderCode'
,
val
:
c
.
codeInfo
.
products
[
0
].
mcd_tenderCode
}
]
coupons
.
push
({
ret
:
true
,
couponCode
:
c
.
code
,
couponName
:
c
.
codeInfo
.
act_name
,
productId
:
c
.
codeInfo
.
products
[
0
].
mcd_productCode
,
data
:
data
})
}
else
{
coupons
.
push
({
ret
:
false
,
couponCode
:
c
.
code
,
data
:
c
.
msg
})
}
})
coupons
.
forEach
(
coup
=>
{
if
(
coup
.
ret
)
{
coup
.
data
.
forEach
(
d
=>
{
data
.
forEach
(
d
=>
{
d
.
descriptor
=
this
.
buildCouponDescriptor
(
d
.
field
,
d
.
val
)
})
coupons
.
push
({
ret
:
true
,
couponCode
:
c
.
code
,
couponName
:
c
.
codeInfo
.
act_name
,
productId
:
c
.
codeInfo
.
products
[
0
].
mcd_productCode
,
data
:
data
})
}
else
{
coupons
.
push
({
ret
:
false
,
couponCode
:
c
.
code
,
data
:
c
.
msg
})
}
})
...
...
@@ -263,13 +261,12 @@ export default {
{
name
:
'状态'
,
field
:
'status'
,
val
:
p
.
status
},
{
name
:
'菜品类型'
,
field
:
'type'
,
val
:
p
.
type
}
]
products
.
push
({
id
:
p
.
pid
,
name
:
p
.
name
,
data
:
data
})
})
products
.
forEach
(
p
=>
{
p
.
data
.
forEach
(
d
=>
{
data
.
forEach
(
d
=>
{
d
.
descriptor
=
this
.
buildProductDescriptor
(
d
.
field
,
d
.
val
)
})
products
.
push
({
id
:
p
.
pid
,
name
:
p
.
name
,
data
:
data
})
})
this
.
retProducts
=
products
...
...
@@ -301,10 +298,15 @@ export default {
let
memo
=
''
let
desc
=
''
if
(
field
===
'couponType'
)
{
if
(
val
===
0
)
{
switch
(
parseInt
(
val
))
{
case
0
:
memo
=
'商品券'
}
else
if
(
val
===
1
)
{
break
case
1
:
memo
=
'代金券'
break
default
:
break
}
desc
=
'0)商品券, 1)代金券;'
}
...
...
@@ -323,7 +325,7 @@ export default {
}
desc
=
'1)饮品, 2)非饮品'
}
else
if
(
field
===
'status'
)
{
switch
(
val
)
{
switch
(
parseInt
(
val
)
)
{
case
1
:
memo
=
'下架'
break
...
...
@@ -338,7 +340,7 @@ export default {
}
desc
=
'1)下架, 2)上架, 3)售罄'
}
else
if
(
field
===
'type'
)
{
switch
(
val
)
{
switch
(
parseInt
(
val
)
)
{
case
1
:
memo
=
'普通商品'
break
...
...
freemud.be.toolboxview/src/views/requestresource/ProductSearch.vue
View file @
d9b7ec5a
...
...
@@ -31,12 +31,13 @@
v-model=
"storeId"
:data=
"[1450026, 1450217, 99998, 99995, 99992]"
placeholder=
"门店编号"
clearable
></AutoComplete>
</FormItem>
</Col>
<Col
span=
"12"
>
<FormItem
label=
"商品编号"
>
<Input
type=
"text"
v-model=
"productId"
placeholder=
"商品编号"
></Input>
<Input
type=
"text"
v-model=
"productId"
placeholder=
"商品编号"
clearable
></Input>
</FormItem>
</Col>
<Col
span=
"12"
>
...
...
@@ -374,13 +375,12 @@ export default {
{
name
:
'多规格信息'
,
field
:
'productSpecification'
,
val
:
p
.
productSpecification
},
{
name
:
'扩展信息'
,
field
:
'productExendsions'
,
val
:
pExendsions
}
]
products
.
push
({
id
:
p
.
pid
,
name
:
p
.
name
,
data
:
data
})
})
products
.
forEach
(
p
=>
{
p
.
data
.
forEach
(
d
=>
{
data
.
forEach
(
d
=>
{
d
.
descriptor
=
this
.
buildProductDescriptor
(
d
.
field
,
d
.
val
)
})
products
.
push
({
id
:
p
.
pid
,
name
:
p
.
name
,
data
:
data
})
})
// const extendsions = []
...
...
@@ -416,8 +416,6 @@ export default {
})
this
.
vData
=
vdata
console
.
info
(
this
.
vData
)
},
buildGroupProductData
(
data
)
{
const
products
=
[]
...
...
@@ -481,10 +479,15 @@ export default {
let
memo
=
''
let
desc
=
''
if
(
field
===
'couponType'
)
{
if
(
val
===
0
)
{
switch
(
parseInt
(
val
))
{
case
0
:
memo
=
'商品券'
}
else
if
(
val
===
1
)
{
break
case
1
:
memo
=
'代金券'
break
default
:
break
}
desc
=
'0)商品券, 1)代金券;'
}
...
...
@@ -503,7 +506,7 @@ export default {
}
desc
=
'1)饮品, 2)非饮品'
}
else
if
(
field
===
'status'
)
{
switch
(
val
)
{
switch
(
parseInt
(
val
)
)
{
case
1
:
memo
=
'下架'
break
...
...
@@ -518,7 +521,7 @@ export default {
}
desc
=
'1)下架, 2)上架, 3)售罄'
}
else
if
(
field
===
'type'
)
{
switch
(
val
)
{
switch
(
parseInt
(
val
)
)
{
case
1
:
memo
=
'普通商品'
break
...
...
freemud.be.toolboxview/src/views/requestresource/RequestResource.vue
View file @
d9b7ec5a
...
...
@@ -8,12 +8,12 @@
<MenuItem
name=
"/coupon-product"
to=
"/request-resource/coupon-product"
>
<Icon
type=
"md-cube"
/>
码券商品信息
</MenuItem>
<MenuItem
name=
"/user-coupons"
to=
"/request-resource/user-coupons"
>
<
!--
<
MenuItem
name=
"/user-coupons"
to=
"/request-resource/user-coupons"
>
<Icon
type=
"md-cube"
/>
用户券数据
</MenuItem>
<MenuItem
name=
"/coupon-freeze"
to=
"/request-resource/coupon-freeze"
>
<Icon
type=
"md-cube"
/>
激活
&
冻结
</MenuItem>
</MenuItem>
-->
</MenuGroup>
<MenuGroup
title=
"商品"
>
<MenuItem
name=
"/product"
to=
"/request-resource/product"
>
...
...
@@ -27,7 +27,7 @@
</MenuGroup>
<MenuGroup
title=
"门店"
>
<MenuItem
name=
"/candao-store"
to=
"/request-resource/candao-store"
>
<Icon
type=
"md-cube"
/>
餐道经纬度查询门店
<Icon
type=
"md-cube"
/>
门店信息
</MenuItem>
</MenuGroup>
</Menu>
...
...
@@ -54,7 +54,7 @@ export default {
{
name
:
'/coupon-freeze'
,
text
:
'激活&冻结'
},
{
name
:
'/product'
,
text
:
'商品信息查询'
},
{
name
:
'/order'
,
text
:
'根据订单编号查询订单'
},
{
name
:
'/candao-store'
,
text
:
'
餐道经纬度查询门店
'
}
{
name
:
'/candao-store'
,
text
:
'
门店信息
'
}
],
currentPage
:
''
}
...
...
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