Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform
Commits
1535edf6
Commit
1535edf6
authored
Jun 11, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改后台
parent
3f5111c7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
63 deletions
+57
-63
TourGoodBiz.java
...src/main/java/com/xxfc/platform/tour/biz/TourGoodBiz.java
+44
-13
TouGoodAdminController.java
...xxfc/platform/tour/rest/admin/TouGoodAdminController.java
+0
-31
TourGoodAdminController.java
...xfc/platform/tour/rest/admin/TourGoodAdminController.java
+13
-19
No files found.
xx-tour/xx-tour-server/src/main/java/com/xxfc/platform/tour/biz/TourGoodBiz.java
View file @
1535edf6
package
com
.
xxfc
.
platform
.
tour
.
biz
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.wxiaoqi.security.admin.entity.BaseUserMemberLevel
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.constant.RestCode
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
...
...
@@ -17,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
java.lang.reflect.InvocationTargetException
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -33,13 +38,16 @@ import java.util.Map;
public
class
TourGoodBiz
extends
BaseBiz
<
TourGoodMapper
,
TourGood
>
{
@Autowired
private
TourGoodBanner
Mapper
bannerMapper
;
private
TourGoodBanner
Biz
bannerBiz
;
@Autowired
private
TourGoodSite
Mapper
siteMapper
;
private
TourGoodSite
Biz
siteBiz
;
@Autowired
private
TourGoodTag
Mapper
tagMapper
;
private
TourGoodTag
Biz
tagBiz
;
@Autowired
private
TourGoodSpePriceMapper
priceMapper
;
private
TourGoodSpeBiz
speBiz
;
@Autowired
private
UserFeign
userFeign
;
/**
* 查询旅游路线列表
...
...
@@ -86,9 +94,12 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> {
}
TourGood
good
=
new
TourGood
();
try
{
Long
times
=
System
.
currentTimeMillis
();
BeanUtils
.
copyProperties
(
good
,
dto
);
Integer
goodId
=
good
.
getId
();
good
.
setUpdTime
(
times
);
if
(
goodId
==
null
||
goodId
==
0
){
good
.
setCrtTime
(
times
);
mapper
.
insertSelective
(
good
);
goodId
=
good
.
getId
();
}
else
{
...
...
@@ -103,9 +114,9 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> {
BeanUtils
.
copyProperties
(
goodBanner
,
bannerDTO
);
goodBanner
.
setGoodId
(
goodId
);
if
(
bannerId
==
null
||
bannerId
==
0
){
banner
Mapper
.
insertSelective
(
goodBanner
);
banner
Biz
.
insertSelective
(
goodBanner
);
}
else
{
banner
Mapper
.
updateByPrimaryKeySelective
(
goodBanner
);
banner
Biz
.
updateSelectiveById
(
goodBanner
);
}
}
}
...
...
@@ -117,9 +128,9 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> {
BeanUtils
.
copyProperties
(
site
,
siteDTO
);
site
.
setGoodId
(
goodId
);
if
(
siteId
==
null
||
siteId
==
0
){
site
Mapper
.
insertSelective
(
site
);
site
Biz
.
insertSelective
(
site
);
}
else
{
site
Mapper
.
updateByPrimaryKeySelective
(
site
);
site
Biz
.
updateById
(
site
);
}
}
}
...
...
@@ -132,9 +143,9 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> {
BeanUtils
.
copyProperties
(
tag
,
tagDTO
);
tag
.
setGoodId
(
goodId
);
if
(
tagId
==
null
||
tagId
==
0
){
tag
Mapper
.
insertSelective
(
tag
);
tag
Biz
.
insertSelective
(
tag
);
}
else
{
tag
Mapper
.
updateByPrimaryKeySelective
(
tag
);
tag
Biz
.
updateById
(
tag
);
}
}
}
...
...
@@ -149,11 +160,31 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> {
spePrice
.
setPrice
(
price
);
spePrice
.
setChildPrice
(
childPrice
);
spePrice
.
setGoodId
(
goodId
);
List
<
BaseUserMemberLevel
>
levelsList
=
userFeign
.
levels
();
if
(
levelsList
.
size
()>
0
){
JSONArray
array
=
new
JSONArray
();
for
(
BaseUserMemberLevel
memberLevel
:
levelsList
){
JSONObject
obj
=
new
JSONObject
();
Integer
level
=
memberLevel
.
getLevel
();
Integer
discount
=
memberLevel
.
getDiscount
();
BigDecimal
price1
=
price
.
multiply
(
new
BigDecimal
(
discount
+
""
)).
divide
(
new
BigDecimal
(
"100"
))
.
setScale
(
2
,
RoundingMode
.
HALF_UP
);
BigDecimal
price2
=
childPrice
.
multiply
(
new
BigDecimal
(
discount
+
""
)).
divide
(
new
BigDecimal
(
"100"
))
.
setScale
(
2
,
RoundingMode
.
HALF_UP
);
obj
.
put
(
"level"
,
level
);
obj
.
put
(
"price"
,
price1
);
obj
.
put
(
"childPrice"
,
price2
);
array
.
add
(
obj
);
}
if
(
array
.
size
()>
0
){
String
json
=
array
.
toJSONString
();
spePrice
.
setMemberPrice
(
json
);
}
}
if
(
priceId
==
null
||
priceId
==
0
){
priceMapper
.
insertSelective
(
spePrice
);
speBiz
.
insertSelective
(
spePrice
);
}
else
{
priceMapper
.
updateByPrimaryKeySelective
(
spePrice
);
speBiz
.
updateById
(
spePrice
);
}
}
}
...
...
xx-tour/xx-tour-server/src/main/java/com/xxfc/platform/tour/rest/admin/TouGoodAdminController.java
deleted
100644 → 0
View file @
3f5111c7
package
com
.
xxfc
.
platform
.
tour
.
rest
.
admin
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.xxfc.platform.tour.biz.TourGoodBiz
;
import
com.xxfc.platform.tour.dto.GoodSearchDTO
;
import
com.xxfc.platform.tour.dto.TourGoodDTO
;
import
com.xxfc.platform.tour.entity.TourGood
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.*
;
@RestController
@RequestMapping
(
"good"
)
@IgnoreClientToken
public
class
TouGoodAdminController
extends
BaseController
<
TourGoodBiz
,
TourGood
>
{
@ApiOperation
(
"后台查询旅游路线列表"
)
@RequestMapping
(
value
=
"/admin/goodList"
,
method
=
RequestMethod
.
GET
)
public
ObjectRestResponse
<
TourGood
>
goodList
(
@RequestBody
GoodSearchDTO
dto
)
{
return
ObjectRestResponse
.
succ
(
baseBiz
.
getAll
(
dto
));
}
@ApiOperation
(
"后台查询旅游路线列表"
)
@RequestMapping
(
value
=
"/admin/goodEdit"
,
method
=
RequestMethod
.
GET
)
public
ObjectRestResponse
<
TourGood
>
goodEdit
(
@RequestBody
TourGoodDTO
dto
)
{
return
ObjectRestResponse
.
succ
(
baseBiz
.
goodsEdit
(
dto
));
}
}
\ No newline at end of file
xx-tour/xx-tour-server/src/main/java/com/xxfc/platform/tour/rest/admin/TourGoodAdminController.java
View file @
1535edf6
...
...
@@ -4,6 +4,8 @@ import com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.xxfc.platform.tour.biz.TourGoodBiz
;
import
com.xxfc.platform.tour.dto.GoodSearchDTO
;
import
com.xxfc.platform.tour.dto.TourGoodDTO
;
import
com.xxfc.platform.tour.entity.TourGood
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -13,25 +15,17 @@ import org.springframework.web.bind.annotation.*;
@IgnoreClientToken
public
class
TourGoodAdminController
extends
BaseController
<
TourGoodBiz
,
TourGood
>
{
/**
* 查询旅游路线列表
*
* @param page
* @param limit
* @param query
* @param latitude
* @param longitude
* @param tagId
* @param distance
* @return
*/
@ApiOperation
(
"查询旅游路线列表"
)
@RequestMapping
(
value
=
"//getGoodList"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
"后台查询旅游路线列表"
)
@RequestMapping
(
value
=
"/admin/goodList"
,
method
=
RequestMethod
.
GET
)
public
ObjectRestResponse
<
TourGood
>
goodList
(
@RequestBody
GoodSearchDTO
dto
)
{
return
ObjectRestResponse
.
succ
(
baseBiz
.
getAll
(
dto
));
}
public
ObjectRestResponse
<
TourGood
>
getGoodList
(
@RequestParam
(
value
=
"page"
,
required
=
true
)
Integer
page
,
@RequestParam
(
value
=
"limit"
,
required
=
true
)
Integer
limit
,
@RequestParam
(
value
=
"query"
,
required
=
false
)
String
query
,
@RequestParam
(
value
=
"latitude"
,
required
=
false
)
Double
latitude
,
@RequestParam
(
value
=
"longitude"
,
required
=
false
)
Double
longitude
,
@RequestParam
(
value
=
"tagId"
,
required
=
false
)
Integer
tagId
,
@RequestParam
(
value
=
"distance"
,
defaultValue
=
"10.00"
)
Double
distance
)
{
return
baseBiz
.
getGoodList
(
page
,
limit
,
query
,
latitude
,
longitude
,
tagId
,
distance
);
@ApiOperation
(
"后台查询旅游路线列表"
)
@RequestMapping
(
value
=
"/admin/goodEdit"
,
method
=
RequestMethod
.
GET
)
public
ObjectRestResponse
<
TourGood
>
goodEdit
(
@RequestBody
TourGoodDTO
dto
)
{
return
ObjectRestResponse
.
succ
(
baseBiz
.
goodsEdit
(
dto
));
}
}
\ No newline at end of file
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