Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
shop
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
shop
Commits
9c4904a6
Commit
9c4904a6
authored
Oct 10, 2019
by
张永
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://zhangyong@gitlab.egolm.com/key/shop.git
parents
3e874082
3c90f13c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
0 deletions
+42
-0
AddressController.java
...ain/java/com/egolm/shop/controller/AddressController.java
+17
-0
AddressService.java
src/main/java/com/egolm/shop/service/AddressService.java
+1
-0
AddressServiceImpl.java
.../java/com/egolm/shop/service/impl/AddressServiceImpl.java
+24
-0
No files found.
src/main/java/com/egolm/shop/controller/AddressController.java
View file @
9c4904a6
...
...
@@ -191,4 +191,21 @@ public class AddressController {
TCustAddress
custAddress
=
addressService
.
getAddById
(
addId
);
return
Rjx
.
jsonOk
().
set
(
"detail"
,
custAddress
).
toJson
();
}
@ApiOperation
(
"获取默认地址"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"shopNo"
,
dataType
=
"String"
,
required
=
true
,
value
=
"店铺编码"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"custNo"
,
dataType
=
"String"
,
required
=
true
,
value
=
"用户编码"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
false
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
false
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/getDefaultAddress"
,
method
=
RequestMethod
.
GET
)
public
String
getDefaultAddress
(
String
custNo
,
String
shopNo
)
{
Map
<
String
,
Object
>
map
=
addressService
.
getDefaultAddress
(
custNo
,
shopNo
);
return
Rjx
.
jsonOk
().
setData
(
map
).
toJson
();
}
}
src/main/java/com/egolm/shop/service/AddressService.java
View file @
9c4904a6
...
...
@@ -12,4 +12,5 @@ public interface AddressService {
public
TCustAddress
getAddById
(
String
addId
);
public
String
delete
(
String
addId
,
String
userNO
,
String
shopNO
,
String
langID
);
public
String
defaultAdd
(
String
addId
,
String
userNO
,
String
shopNO
,
String
type
,
String
langID
)
;
public
Map
<
String
,
Object
>
getDefaultAddress
(
String
custNo
,
String
shopNo
);
}
src/main/java/com/egolm/shop/service/impl/AddressServiceImpl.java
View file @
9c4904a6
...
...
@@ -229,4 +229,28 @@ public class AddressServiceImpl implements AddressService {
return
Rjx
.
jsonErr
().
setCode
(-
100
).
setMessage
(
I18NUtils
.
getMessage
(
langID
,
"Msg_Operate_failure"
)).
set
(
"errorMsg"
,
I18NUtils
.
getMessage
(
langID
,
"Msg_Paramtype_error"
)).
toJson
();
}
}
@Override
public
Map
<
String
,
Object
>
getDefaultAddress
(
String
custNo
,
String
shopNo
)
{
String
sql
=
"select * from tCustAddress where nTag&1 = 0 and sCustNO = ? and (sShopNO = ? or sShopNO is null or sShopNO = '') order by nTag desc"
;
List
<
Map
<
String
,
Object
>>
list
=
jdbcTemplate
.
queryForList
(
sql
,
custNo
,
shopNo
);
Map
<
String
,
Object
>
defMap
=
null
;
Integer
nTag_Cur
=
0
;
for
(
Map
<
String
,
Object
>
map
:
list
)
{
Integer
nTag
=
(
Integer
)
map
.
get
(
"nTag"
);
if
(
nTag
!=
null
)
{
if
((
nTag
&
6
)
==
6
)
{
defMap
=
map
;
break
;
}
else
if
((
nTag
&
4
)
==
4
&&
nTag_Cur
<
4
)
{
defMap
=
map
;
}
else
if
((
nTag
&
4
)
==
2
&&
nTag_Cur
<
2
)
{
defMap
=
map
;
}
nTag_Cur
=
nTag
;
}
}
return
defMap
;
}
}
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