Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
soss
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hooloo
ms
soss
Commits
6a086d5e
Commit
6a086d5e
authored
Feb 27, 2023
by
weijiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
下单时校验订单中sku数量
parent
3f8740d0
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
53 additions
and
10 deletions
+53
-10
soss-system/src/main/java/com/soss/system/domain/Goods.java
+5
-0
soss-system/src/main/java/com/soss/system/domain/ShopRecommend.java
+14
-0
soss-system/src/main/java/com/soss/system/domain/vo/orderTaking/GoodsVo.java
+1
-1
soss-system/src/main/java/com/soss/system/service/impl/OrderTakingServiceImpl.java
+17
-9
soss-system/src/main/java/com/soss/system/service/impl/ShopRecommendServiceImpl.java
+12
-0
soss-system/src/main/java/com/soss/system/service/impl/ShopServiceImpl.java
+4
-0
No files found.
soss-system/src/main/java/com/soss/system/domain/Goods.java
View file @
6a086d5e
...
...
@@ -67,6 +67,11 @@ public class Goods extends BaseEntity {
*/
@Excel
(
name
=
"特惠标签"
)
private
String
recommendTag
;
/**
* 特惠标签
*/
@Excel
(
name
=
"特惠标签"
)
private
List
<
String
>
recommendTagList
;
/**
* 制作用时 单位 秒
...
...
soss-system/src/main/java/com/soss/system/domain/ShopRecommend.java
View file @
6a086d5e
...
...
@@ -8,6 +8,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
/**
* 推荐和今日特惠对象 shop_recommend
...
...
@@ -54,6 +55,11 @@ public class ShopRecommend extends BaseEntity
/**
* 特惠标签
*/
private
List
<
String
>
recommendTagList
;
/**
* 特惠标签
*/
private
String
recommendTag
;
/** 描述 */
...
...
@@ -203,6 +209,14 @@ public class ShopRecommend extends BaseEntity
return
updatedAt
;
}
public
List
<
String
>
getRecommendTagList
()
{
return
recommendTagList
;
}
public
void
setRecommendTagList
(
List
<
String
>
recommendTagList
)
{
this
.
recommendTagList
=
recommendTagList
;
}
public
BigDecimal
getRecommendPrice
()
{
return
recommendPrice
;
}
...
...
soss-system/src/main/java/com/soss/system/domain/vo/orderTaking/GoodsVo.java
View file @
6a086d5e
...
...
@@ -30,7 +30,7 @@ public class GoodsVo {
private
String
isRecommend
;
/** 特惠标签 */
private
String
recommendTag
;
private
List
<
String
>
recommendTagList
;
private
String
category
;
}
soss-system/src/main/java/com/soss/system/service/impl/OrderTakingServiceImpl.java
View file @
6a086d5e
package
com
.
soss
.
system
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.soss.common.exception.ServiceException
;
...
...
@@ -12,7 +13,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@Service
...
...
@@ -40,6 +44,7 @@ public class OrderTakingServiceImpl {
/**
* 获取机器上的点单信息
*
* @param machineCode
* @return
*/
...
...
@@ -178,7 +183,11 @@ public class OrderTakingServiceImpl {
goodsVo
.
setCategory
(
good
.
getCategory
());
goodsVo
.
setSpecString
(
null
);
goodsVo
.
setIsRecommend
(
good
.
getIsRecommend
());
goodsVo
.
setRecommendTag
(
good
.
getRecommendTag
());
if
(!
StringUtils
.
isEmpty
(
good
.
getRecommendTag
()))
{
goodsVo
.
setRecommendTagList
(
JSON
.
parseArray
(
good
.
getRecommendTag
(),
String
.
class
));
// goodsVo.setRecommendTag(good.getRecommendTag());
}
// if(recommendGoodsId.contains(String.valueOf(good.getId()))){
// goodsVo.setIsRecommend("1");
// }else{
...
...
@@ -207,13 +216,13 @@ public class OrderTakingServiceImpl {
}
private
void
buildSkuRules
(
List
<
SkuVo
>
skuVos
)
{
if
(
CollectionUtils
.
isEmpty
(
skuVos
))
{
if
(
CollectionUtils
.
isEmpty
(
skuVos
))
{
return
;
}
for
(
SkuVo
skuVo
:
skuVos
)
{
String
rules
=
skuVo
.
getRulesString
();
List
<
SpecRule
>
specRuleList
=
JSONObject
.
parseArray
(
rules
,
SpecRule
.
class
);
boolean
boo
=
true
;
boolean
boo
=
true
;
List
<
SkuRuleVo
>
skuRuleVos
=
new
ArrayList
<>();
for
(
SpecRule
specRule
:
specRuleList
)
{
SkuRuleVo
skuRuleVo
=
new
SkuRuleVo
();
...
...
@@ -222,12 +231,12 @@ public class OrderTakingServiceImpl {
skuRuleVo
.
setRuleId
(
String
.
valueOf
(
specRule
.
getId
()));
skuRuleVo
.
setSpecId
(
String
.
valueOf
(
specRule
.
getSpecId
()));
skuRuleVo
.
setRuleName
(
specRule
.
getName
());
if
(
0L
==
specRule
.
getIsDefault
())
{
boo
=
false
;
if
(
0L
==
specRule
.
getIsDefault
())
{
boo
=
false
;
}
}
skuVo
.
setIsDefault
(
"0"
);
if
(
boo
)
{
if
(
boo
)
{
skuVo
.
setIsDefault
(
"1"
);
}
skuVo
.
setRules
(
JSONObject
.
parseArray
(
JSONObject
.
toJSONString
(
skuRuleVos
)));
...
...
@@ -235,10 +244,9 @@ public class OrderTakingServiceImpl {
}
}
private
JSONArray
buildGoodsSpec
(
String
specs
)
{
List
<
Spec
>
specList
=
JSONObject
.
parseArray
(
specs
,
Spec
.
class
);
List
<
Spec
>
specList
=
JSONObject
.
parseArray
(
specs
,
Spec
.
class
);
List
<
SpecVo
>
specVos
=
new
ArrayList
<>();
for
(
Spec
spec
:
specList
)
{
SpecVo
specVo
=
new
SpecVo
();
...
...
soss-system/src/main/java/com/soss/system/service/impl/ShopRecommendServiceImpl.java
View file @
6a086d5e
package
com
.
soss
.
system
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.soss.common.exception.ServiceException
;
import
com.soss.common.utils.StringUtils
;
...
...
@@ -14,6 +15,7 @@ import com.soss.system.mapper.ShopRecommendMapper;
import
com.soss.system.service.IShopRecommendService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -61,6 +63,13 @@ public class ShopRecommendServiceImpl implements IShopRecommendService {
public
List
<
Goods
>
selectShopRecommendList
(
ShopRecommend
shopRecommend
)
{
List
<
Goods
>
goodsList
=
shopRecommendMapper
.
selectShopRecommendGoods
(
shopRecommend
.
getShopId
(),
shopRecommend
.
getType
());
goodsList
=
goodsList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
if
(!
CollectionUtils
.
isEmpty
(
goodsList
))
{
goodsList
.
forEach
(
goods
->
{
if
(!
StringUtils
.
isEmpty
(
goods
.
getRecommendTag
()))
{
goods
.
setRecommendTagList
(
JSON
.
parseArray
(
goods
.
getRecommendTag
(),
String
.
class
));
}
});
}
/*for (Goods goods : goodsList) {
goods.setCategoryName(goodsCategoryMapper.selectGoodsCategoryById(String.valueOf(goods.getCategory())).getName());
goods.setSalesVolume(orderMapper.selectSalesVolume(Long.parseLong(shopRecommend.getShopId()),goods.getId()));
...
...
@@ -87,6 +96,9 @@ public class ShopRecommendServiceImpl implements IShopRecommendService {
machine
.
setShopId
(
Long
.
parseLong
(
shopRecommend
.
getShopId
()));
shopRecommend
.
setCreatedAt
(
new
Date
());
shopRecommend
.
setRecDate
(
new
Date
());
if
(!
CollectionUtils
.
isEmpty
(
shopRecommend
.
getRecommendTagList
()))
{
shopRecommend
.
setRecommendTag
(
JSON
.
toJSONString
(
shopRecommend
.
getRecommendTagList
()));
}
shopRecommendMapper
.
insertShopRecommend
(
shopRecommend
);
updateApplication
(
Long
.
parseLong
(
shopRecommend
.
getShopId
()));
shopRecommend
.
setTurn
(
shopRecommend
.
getId
());
...
...
soss-system/src/main/java/com/soss/system/service/impl/ShopServiceImpl.java
View file @
6a086d5e
package
com
.
soss
.
system
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.soss.common.core.domain.AjaxResult
;
...
...
@@ -293,6 +294,9 @@ public class ShopServiceImpl implements IShopService {
if
(
shopRecommends
.
size
()
>
0
)
{
goods
.
setRecommend
(
"0"
);
}
if
(!
StringUtils
.
isEmpty
(
goods
.
getRecommendTag
()))
{
goods
.
setRecommendTagList
(
JSON
.
parseArray
(
goods
.
getRecommendTag
(),
String
.
class
));
}
shopRecommend
.
setType
(
"2"
);
shopRecommends
=
shopRecommendMapper
.
selectShopRecommendList
(
shopRecommend
);
if
(
shopRecommends
.
size
()
>
0
)
{
...
...
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