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
2729e34e
Commit
2729e34e
authored
Jun 20, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改减库存
parent
153b3c43
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
11 deletions
+24
-11
TourFeign.java
...src/main/java/com/xxfc/platform/tour/feign/TourFeign.java
+1
-1
TourGoodSpeBiz.java
.../main/java/com/xxfc/platform/tour/biz/TourGoodSpeBiz.java
+10
-6
TourGoodSpePriceMapper.java
...com/xxfc/platform/tour/mapper/TourGoodSpePriceMapper.java
+1
-1
TourGoodSpeController.java
...va/com/xxfc/platform/tour/rest/TourGoodSpeController.java
+4
-2
TourGoodSpePriceMapper.xml
...rver/src/main/resources/mapper/TourGoodSpePriceMapper.xml
+8
-1
No files found.
xx-tour/xx-tour-api/src/main/java/com/xxfc/platform/tour/feign/TourFeign.java
View file @
2729e34e
...
...
@@ -36,7 +36,7 @@ public interface TourFeign {
public
ObjectRestResponse
<
TourSpePriceVo
>
refund
(
@RequestBody
TourSpePriceDTO
spePriceDto
);
@RequestMapping
(
value
=
"/spe/stock"
,
method
=
RequestMethod
.
GET
)
public
ObjectRestResponse
<
TourSpePriceVo
>
stock
(
@RequestParam
Integer
speId
,
@RequestParam
Integer
number
);
public
ObjectRestResponse
<
TourSpePriceVo
>
stock
(
@RequestParam
Integer
speId
,
@RequestParam
Integer
number
,
@RequestParam
Integer
type
);
@RequestMapping
(
value
=
"/tourGood/app/unauth/usable/{id}"
,
method
=
RequestMethod
.
GET
)
...
...
xx-tour/xx-tour-server/src/main/java/com/xxfc/platform/tour/biz/TourGoodSpeBiz.java
View file @
2729e34e
...
...
@@ -83,14 +83,18 @@ public class TourGoodSpeBiz extends BaseBiz<TourGoodSpePriceMapper, TourGoodSpeP
}
//减库存
public
ObjectRestResponse
cutStock
(
Integer
speId
,
Integer
number
)
{
public
ObjectRestResponse
cutStock
(
Integer
speId
,
Integer
number
,
Integer
type
)
{
TourGoodSpePrice
spePrice
=
mapper
.
selectByPrimaryKey
(
speId
);
if
(
spePrice
!=
null
&&
spePrice
.
getStock
()
>
0
&&
spePrice
.
getStock
()
>=
number
)
{
mapper
.
updStockById
(
speId
,
number
);
return
ObjectRestResponse
.
succ
();
}
else
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
STOCK_CODE
,
"库存不足"
);
if
(
type
==
1
){
if
(
spePrice
!=
null
&&
spePrice
.
getStock
()
>
0
&&
spePrice
.
getStock
()
>=
number
)
{
mapper
.
updStockById
(
speId
,
number
,
type
);
}
else
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
STOCK_CODE
,
"库存不足"
);
}
}
else
{
mapper
.
updStockById
(
speId
,
number
,
type
);
}
return
ObjectRestResponse
.
succ
();
}
//删除
...
...
xx-tour/xx-tour-server/src/main/java/com/xxfc/platform/tour/mapper/TourGoodSpePriceMapper.java
View file @
2729e34e
...
...
@@ -19,7 +19,7 @@ public interface TourGoodSpePriceMapper extends Mapper<TourGoodSpePrice> {
List
<
TourDepartTimeVo
>
getAllByGoodId
(
@Param
(
"goodId"
)
Integer
goodId
);
//减库存
int
updStockById
(
@Param
(
"id"
)
Integer
id
,
@Param
(
"number"
)
Integer
number
);
int
updStockById
(
@Param
(
"id"
)
Integer
id
,
@Param
(
"number"
)
Integer
number
,
@Param
(
"type"
)
Integer
type
);
//删除站点
public
int
delSpe
(
@Param
(
"goodId"
)
Integer
goodId
,
@Param
(
"list"
)
List
<
Integer
>
ids
);
...
...
xx-tour/xx-tour-server/src/main/java/com/xxfc/platform/tour/rest/TourGoodSpeController.java
View file @
2729e34e
...
...
@@ -26,8 +26,10 @@ public class TourGoodSpeController extends TourBaseController<TourGoodSpeBiz> {
@RequestMapping
(
value
=
"/stock"
,
method
=
RequestMethod
.
GET
)
public
ObjectRestResponse
<
TourSpePriceVo
>
stock
(
@RequestParam
(
value
=
"speId"
,
defaultValue
=
"0"
)
Integer
speId
,
@RequestParam
(
value
=
"number"
,
defaultValue
=
"0"
)
Integer
number
){
return
baseBiz
.
cutStock
(
speId
,
number
);
@RequestParam
(
value
=
"number"
,
defaultValue
=
"0"
)
Integer
number
,
@RequestParam
(
value
=
"type"
,
defaultValue
=
"1"
)
Integer
type
){
return
baseBiz
.
cutStock
(
speId
,
number
,
type
);
}
}
\ No newline at end of file
xx-tour/xx-tour-server/src/main/resources/mapper/TourGoodSpePriceMapper.xml
View file @
2729e34e
...
...
@@ -43,7 +43,14 @@
<!-- 减库存-->
<update
id=
"updStockById"
>
update tour_good_spe_price set stock=stock-#{number} where id=#{id}
update tour_good_spe_price set
<if
test=
"type==1"
>
stock=stock-#{number}
</if>
<if
test=
"type==2"
>
stock=stock+#{number}
</if>
where id=#{id}
</update>
<update
id=
"delSpe"
>
...
...
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