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
5385b57d
Commit
5385b57d
authored
Feb 28, 2023
by
caiyt
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/v2' into v2
parents
a84ed29e
4556b8d9
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
63 additions
and
16 deletions
+63
-16
soss-system/src/main/java/com/soss/system/domain/Goods.java
+7
-0
soss-system/src/main/java/com/soss/system/domain/ShopRecommend.java
+14
-0
soss-system/src/main/java/com/soss/system/domain/po/BannerListPo.java
+1
-1
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
+10
-4
soss-system/src/main/resources/mapper/system/SysBannerMapper.xml
+1
-1
No files found.
soss-system/src/main/java/com/soss/system/domain/Goods.java
View file @
5385b57d
...
...
@@ -67,6 +67,11 @@ public class Goods extends BaseEntity {
*/
@Excel
(
name
=
"特惠标签"
)
private
String
recommendTag
;
/**
* 特惠标签
*/
@Excel
(
name
=
"特惠标签"
)
private
List
<
String
>
recommendTagList
;
/**
* 制作用时 单位 秒
...
...
@@ -126,8 +131,10 @@ public class Goods extends BaseEntity {
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:dd"
)
private
Date
recommendDate
;
/** 是否推荐 */
private
String
recommend
;
/** 是否特惠 */
private
String
preferential
;
/** 商品sku数量 */
...
...
soss-system/src/main/java/com/soss/system/domain/ShopRecommend.java
View file @
5385b57d
...
...
@@ -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/po/BannerListPo.java
View file @
5385b57d
...
...
@@ -30,5 +30,5 @@ public class BannerListPo {
private
String
area
;
@ApiModelProperty
(
"店铺ID"
)
private
String
shopId
;
private
String
shopId
s
;
}
soss-system/src/main/java/com/soss/system/domain/vo/orderTaking/GoodsVo.java
View file @
5385b57d
...
...
@@ -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 @
5385b57d
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 @
5385b57d
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 @
5385b57d
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
;
...
...
@@ -287,16 +288,21 @@ public class ShopServiceImpl implements IShopService {
shopRecommend
.
setShopId
(
String
.
valueOf
(
shopId
));
shopRecommend
.
setGoodsId
(
String
.
valueOf
(
goods
.
getId
()));
shopRecommend
.
setType
(
"1"
);
goods
.
setPreferential
(
"1"
);
goods
.
setRecommend
(
"1"
);
List
<
ShopRecommend
>
shopRecommends
=
shopRecommendMapper
.
selectShopRecommendList
(
shopRecommend
);
if
(
shopRecommends
.
size
()
>
0
)
{
if
(
CollectionUtils
.
isEmpty
(
shopRecommends
)
)
{
goods
.
setRecommend
(
"0"
);
}
else
{
goods
.
setRecommend
(
"1"
);
}
shopRecommend
.
setType
(
"2"
);
shopRecommends
=
shopRecommendMapper
.
selectShopRecommendList
(
shopRecommend
);
if
(
shopRecommends
.
size
()
>
0
)
{
if
(
CollectionUtils
.
isEmpty
(
shopRecommends
)
)
{
goods
.
setPreferential
(
"0"
);
}
else
{
goods
.
setPreferential
(
"1"
);
}
if
(!
StringUtils
.
isEmpty
(
goods
.
getRecommendTag
()))
{
goods
.
setRecommendTagList
(
JSON
.
parseArray
(
goods
.
getRecommendTag
(),
String
.
class
));
}
goods
.
setSalesVolume
(
orderMapper
.
selectSalesVolume
(
shopId
,
goods
.
getId
()));
...
...
soss-system/src/main/resources/mapper/system/SysBannerMapper.xml
View file @
5385b57d
...
...
@@ -27,7 +27,7 @@
<if
test=
"province != null and province != ''"
>
and province like concat('%,', #{province}, ',%')
</if>
<if
test=
"city != null and city != ''"
>
and city like concat('%,', #{city}, ',%')
</if>
<if
test=
"area != null and area != ''"
>
and area like concat('%,', #{area}, ',%')
</if>
<if
test=
"shopId
!= null and shopId != ''"
>
and shop_ids like concat('%,', #{shopId
}, ',%')
</if>
<if
test=
"shopId
s != null and shopIds != ''"
>
and shop_ids like concat('%,', #{shopIds
}, ',%')
</if>
<if
test=
"state != null "
>
and state = #{state}
</if>
</where>
order by created_at desc
...
...
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