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
351baab7
Commit
351baab7
authored
Mar 03, 2023
by
caiyt
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/v2' into v2
parents
5385b57d
f20d798f
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
63 additions
and
29 deletions
+63
-29
soss-system/src/main/java/com/soss/system/domain/Goods.java
+2
-2
soss-system/src/main/java/com/soss/system/domain/SysBanner.java
+1
-1
soss-system/src/main/java/com/soss/system/domain/po/BannerListPo.java
+1
-1
soss-system/src/main/java/com/soss/system/domain/po/BannerPo.java
+1
-1
soss-system/src/main/java/com/soss/system/domain/vo/BannerVo.java
+2
-1
soss-system/src/main/java/com/soss/system/mapper/ShopGoodsSkuMapper.java
+0
-3
soss-system/src/main/java/com/soss/system/service/impl/AppServiceImpl.java
+7
-2
soss-system/src/main/java/com/soss/system/service/impl/ShopServiceImpl.java
+18
-4
soss-system/src/main/java/com/soss/system/service/impl/SysBannerServiceImpl.java
+25
-4
soss-system/src/main/resources/mapper/system/ShopGoodsSkuMapper.xml
+0
-8
soss-system/src/main/resources/mapper/system/SysBannerMapper.xml
+6
-2
No files found.
soss-system/src/main/java/com/soss/system/domain/Goods.java
View file @
351baab7
...
...
@@ -138,10 +138,10 @@ public class Goods extends BaseEntity {
private
String
preferential
;
/** 商品sku数量 */
private
Integer
skuCount
;
private
Integer
skuCount
=
0
;
/** 商品售罄sku数量 */
private
Integer
selloutCount
;
private
Integer
selloutCount
=
0
;
/**
* 总销量
...
...
soss-system/src/main/java/com/soss/system/domain/SysBanner.java
View file @
351baab7
...
...
@@ -33,7 +33,7 @@ public class SysBanner extends BaseEntity {
/**
* 目标:1-小程序首页,2-小程序我的,0-其它
*/
private
Integer
target
;
private
String
target
;
/**
* 省份列表
*/
...
...
soss-system/src/main/java/com/soss/system/domain/po/BannerListPo.java
View file @
351baab7
...
...
@@ -14,7 +14,7 @@ public class BannerListPo {
/**
* 目标:1-小程序首页,2-小程序我的,0-其它
*/
private
Integer
target
;
private
String
target
;
/**
* 状态
*/
...
...
soss-system/src/main/java/com/soss/system/domain/po/BannerPo.java
View file @
351baab7
...
...
@@ -24,7 +24,7 @@ public class BannerPo {
/**
* 目标:1-小程序首页,2-小程序我的,0-其它
*/
private
Integer
target
;
private
String
[]
target
;
/**
* 排序
*/
...
...
soss-system/src/main/java/com/soss/system/domain/vo/BannerVo.java
View file @
351baab7
...
...
@@ -27,7 +27,8 @@ public class BannerVo {
/**
* 目标:1-小程序首页,2-小程序我的,0-其它
*/
private
Integer
target
;
private
String
[]
target
;
private
String
targetStr
;
/**
* 排序
*/
...
...
soss-system/src/main/java/com/soss/system/mapper/ShopGoodsSkuMapper.java
View file @
351baab7
...
...
@@ -31,9 +31,6 @@ public interface ShopGoodsSkuMapper {
*/
public
List
<
ShopGoodsSku
>
selectShopGoodsSkuList
(
ShopGoodsSku
shopGoodsSku
);
Integer
getSellinSkuCount
(
@Param
(
"shopId"
)
Long
shopId
,
@Param
(
"goodsId"
)
Long
goodsId
);
Integer
getSelloutSkuCount
(
@Param
(
"shopId"
)
Long
shopId
,
@Param
(
"goodsId"
)
Long
goodsId
);
/**
* 新增从店铺到sku关联
*
...
...
soss-system/src/main/java/com/soss/system/service/impl/AppServiceImpl.java
View file @
351baab7
...
...
@@ -109,8 +109,13 @@ public class AppServiceImpl {
if
(!
StringUtils
.
isEmpty
(
lng
)
&&
!
StringUtils
.
isEmpty
(
lat
))
{
double
realDistance
=
DistanceUtil
.
getRealDistance
(
Double
.
parseDouble
(
lng
),
Double
.
parseDouble
(
lat
),
Double
.
parseDouble
(
shop
.
getLng
()),
Double
.
parseDouble
(
shop
.
getLat
()));
double
realKm
=
realDistance
/
1000
;
double
shopLimit
=
shop
.
getDistanceLimit
()
==
null
?
0
:
shop
.
getDistanceLimit
();
if
(
realKm
>
10
||
realKm
>
shopLimit
)
{
if
(
realKm
>
10
)
{
shop
.
setOrderState
(
0
);
shop
.
setStateDesc
(
"距离较远,门店暂停接单"
);
return
false
;
}
Double
shopLimit
=
shop
.
getDistanceLimit
();
if
(
shopLimit
!=
null
&&
shopLimit
>
0
&&
realKm
>
shopLimit
)
{
shop
.
setOrderState
(
0
);
shop
.
setStateDesc
(
"距离较远,门店暂停接单"
);
return
false
;
...
...
soss-system/src/main/java/com/soss/system/service/impl/ShopServiceImpl.java
View file @
351baab7
...
...
@@ -57,6 +57,8 @@ public class ShopServiceImpl implements IShopService {
private
JiGuangPushServiceImpl
jiGuangPushService
;
@Autowired
private
GoodsTagMapper
goodsTagMapper
;
@Autowired
private
ShopGoodsServiceImpl
shopGoodsService
;
/**
* 查询店铺
...
...
@@ -279,10 +281,22 @@ public class ShopServiceImpl implements IShopService {
}
}
Integer
selloutCount
=
shopGoodsSkuMapper
.
getSelloutSkuCount
(
shopId
,
goods
.
getId
());
Integer
sellinCount
=
shopGoodsSkuMapper
.
getSellinSkuCount
(
shopId
,
goods
.
getId
());
goods
.
setSelloutCount
(
selloutCount
);
goods
.
setSkuCount
(
sellinCount
+
selloutCount
);
List
<
Spec
>
specs
=
shopGoodsService
.
getShopGoodsSpecs
(
shopId
,
goods
.
getId
());
if
(
CollectionUtils
.
isEmpty
(
specs
))
{
goods
.
setSelloutCount
(
0
);
goods
.
setSkuCount
(
0
);
}
specs
.
forEach
(
spec
->
{
if
(
CollectionUtils
.
isEmpty
(
spec
.
getSpecRules
()))
{
return
;
}
spec
.
getSpecRules
().
forEach
(
rule
->
{
goods
.
setSkuCount
(
goods
.
getSkuCount
()
+
1
);
if
(
rule
.
getState
()
==
0
)
{
goods
.
setSelloutCount
(
goods
.
getSelloutCount
()
+
1
);
}
});
});
ShopRecommend
shopRecommend
=
new
ShopRecommend
();
shopRecommend
.
setShopId
(
String
.
valueOf
(
shopId
));
...
...
soss-system/src/main/java/com/soss/system/service/impl/SysBannerServiceImpl.java
View file @
351baab7
...
...
@@ -56,7 +56,7 @@ public class SysBannerServiceImpl implements ISysBannerService {
if
(
banner
.
getType
()
==
null
||
banner
.
getType
()
<
1
||
banner
.
getType
()
>
3
)
{
throw
new
ServiceException
(
"类型不正确,1-小程序,2-KDS,3-点单屏"
);
}
if
(
banner
.
getTarget
()
==
null
||
banner
.
getTarget
()
<
0
||
banner
.
getTarget
()
>
2
)
{
if
(
StringUtils
.
isEmpty
(
banner
.
getTarget
())
)
{
throw
new
ServiceException
(
"轮播位置不正确,1-小程序首页,2-小程序我的,0-其它"
);
}
if
(
banner
.
getSort
()
==
null
)
{
...
...
@@ -88,7 +88,7 @@ public class SysBannerServiceImpl implements ISysBannerService {
if
(
banner
.
getType
()
==
null
||
banner
.
getType
()
<
1
||
banner
.
getType
()
>
3
)
{
throw
new
ServiceException
(
"类型不正确,1-小程序,2-KDS,3-点单屏"
);
}
if
(
banner
.
getTarget
()
==
null
||
banner
.
getTarget
()
<
0
||
banner
.
getTarget
()
>
2
)
{
if
(
StringUtils
.
isEmpty
(
banner
.
getTarget
())
)
{
throw
new
ServiceException
(
"轮播位置不正确,1-小程序首页,2-小程序我的,0-其它"
);
}
if
(
banner
.
getSort
()
==
null
)
{
...
...
@@ -110,9 +110,12 @@ public class SysBannerServiceImpl implements ISysBannerService {
banner
.
setImage
(
bannerPo
.
getImage
());
banner
.
setPage
(
bannerPo
.
getPage
());
banner
.
setType
(
bannerPo
.
getType
());
banner
.
setTarget
(
bannerPo
.
getTarget
());
banner
.
setSort
(
bannerPo
.
getSort
());
banner
.
setState
(
bannerPo
.
getState
());
// banner.setTarget(bannerPo.getTarget());
if
(
bannerPo
.
getTarget
()
!=
null
&&
bannerPo
.
getTarget
().
length
>
0
)
{
banner
.
setTarget
(
","
+
Arrays
.
asList
(
bannerPo
.
getTarget
()).
stream
().
collect
(
Collectors
.
joining
(
","
))
+
","
);
}
if
(
bannerPo
.
getProvince
()
!=
null
&&
bannerPo
.
getProvince
().
length
>
0
)
{
banner
.
setProvince
(
","
+
Arrays
.
asList
(
bannerPo
.
getProvince
()).
stream
().
collect
(
Collectors
.
joining
(
","
))
+
","
);
}
...
...
@@ -134,10 +137,28 @@ public class SysBannerServiceImpl implements ISysBannerService {
bannerVo
.
setImage
(
banner
.
getImage
());
bannerVo
.
setPage
(
banner
.
getPage
());
bannerVo
.
setType
(
banner
.
getType
());
bannerVo
.
setTarget
(
banner
.
getTarget
());
bannerVo
.
setSort
(
banner
.
getSort
());
bannerVo
.
setState
(
banner
.
getState
());
// bannerVo.setTarget(banner.getTarget());
if
(!
StringUtils
.
isEmpty
(
banner
.
getTarget
()))
{
String
str
=
trim
(
banner
.
getTarget
());
bannerVo
.
setTarget
(
str
.
split
(
","
));
String
targetStr
=
""
;
for
(
String
s
:
bannerVo
.
getTarget
())
{
if
(!
StringUtils
.
isEmpty
(
targetStr
))
{
targetStr
+=
","
;
}
if
(
s
.
equals
(
"1"
))
{
targetStr
+=
"菜单页顶部"
;
}
else
if
(
s
.
equals
(
"2"
))
{
targetStr
+=
"我的页banner"
;
}
else
if
(
s
.
equals
(
"0"
))
{
targetStr
+=
"菜单轮播"
;
}
}
bannerVo
.
setTargetStr
(
targetStr
);
}
if
(!
StringUtils
.
isEmpty
(
banner
.
getProvince
()))
{
String
str
=
trim
(
banner
.
getProvince
());
bannerVo
.
setProvinceStr
(
str
);
...
...
soss-system/src/main/resources/mapper/system/ShopGoodsSkuMapper.xml
View file @
351baab7
...
...
@@ -33,14 +33,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"updatedAt != null "
>
and updated_at = #{updatedAt}
</if>
</where>
</select>
<select
id=
"getSelloutSkuCount"
resultType=
"Integer"
>
select count(1) from shop_goods_sku where shop_id=#{shopId} and goods_id=#{goodsId} and `state`!=1
</select>
<select
id=
"getSellinSkuCount"
resultType=
"Integer"
>
select count(1) from shop_goods_sku where shop_id=#{shopId} and goods_id=#{goodsId} and `state`=1
</select>
<select
id=
"selectShopGoodsSkuById"
parameterType=
"String"
resultMap=
"ShopGoodsSkuResult"
>
<include
refid=
"selectShopGoodsSkuVo"
/>
...
...
soss-system/src/main/resources/mapper/system/SysBannerMapper.xml
View file @
351baab7
...
...
@@ -23,7 +23,7 @@
select * from sys_banner
<where>
<if
test=
"type != null "
>
type = #{type}
</if>
<if
test=
"target != null
"
>
and target = #{target}
</if>
<if
test=
"target != null
and target != ''"
>
and target like concat('%,', #{target}, ',%')
</if>
<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>
...
...
@@ -62,6 +62,9 @@
</insert>
<select
id=
"selectBanners"
resultMap=
"BannerResult"
>
select * from sys_banner where `type` = #{type} and `target` = #{target} and `state` = 0 order by sort, created_at
select * from sys_banner
where `type` = #{type}
<if
test=
"target != null and target != ''"
>
and target like concat('%,', #{target}, ',%')
</if>
and `state` = 0 order by sort, created_at
</select>
</mapper>
\ 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