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
49a25d0e
Commit
49a25d0e
authored
Mar 08, 2023
by
weijiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
恢复部分代码
parent
3eac39b6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
11 deletions
+42
-11
soss-admin/src/main/java/com/soss/web/controller/coffee/ShopController.java
+3
-5
soss-system/src/main/java/com/soss/system/mapper/ShopGoodsSkuMapper.java
+2
-0
soss-system/src/main/java/com/soss/system/service/IShopGoodsService.java
+1
-1
soss-system/src/main/java/com/soss/system/service/impl/ShopGoodsServiceImpl.java
+27
-5
soss-system/src/main/resources/mapper/system/ShopGoodsSkuMapper.xml
+9
-0
No files found.
soss-admin/src/main/java/com/soss/web/controller/coffee/ShopController.java
View file @
49a25d0e
...
@@ -217,13 +217,11 @@ public class ShopController extends BaseController {
...
@@ -217,13 +217,11 @@ public class ShopController extends BaseController {
}
}
@GetMapping
(
"/updateShopGoodsSkuState"
)
@GetMapping
(
"/updateShopGoodsSkuState"
)
public
AjaxResult
updateShopGoodsSkuState
(
@RequestParam
(
"ids"
)
List
<
Long
>
shopGoodsSkuIds
,
@RequestParam
(
"state"
)
Integer
state
)
{
public
AjaxResult
updateShopGoodsSkuState
(
@RequestParam
(
"shopId"
)
Long
shopId
,
@RequestParam
(
"goodsId"
)
Long
goodsId
,
@RequestParam
(
"ids"
)
List
<
Long
>
shopGoodsSkuIds
,
@RequestParam
(
"state"
)
Integer
state
)
{
if
(
CollectionUtils
.
isEmpty
(
shopGoodsSkuIds
))
{
if
(
CollectionUtils
.
isEmpty
(
shopGoodsSkuIds
))
{
return
AjaxResult
.
error
(
"id列表为空"
);
return
AjaxResult
.
error
(
"id列表为空"
);
}
}
for
(
Long
id
:
shopGoodsSkuIds
)
{
return
AjaxResult
.
success
(
shopGoodsService
.
updateShopGoodsSkuState
(
shopId
,
goodsId
,
shopGoodsSkuIds
,
state
));
shopGoodsService
.
updateShopGoodsSkuState
(
id
,
state
);
}
return
AjaxResult
.
success
();
}
}
}
}
soss-system/src/main/java/com/soss/system/mapper/ShopGoodsSkuMapper.java
View file @
49a25d0e
...
@@ -50,6 +50,8 @@ public interface ShopGoodsSkuMapper {
...
@@ -50,6 +50,8 @@ public interface ShopGoodsSkuMapper {
int
updateShopGoodsSkuState
(
@Param
(
"id"
)
Long
shopGoodsSkuId
,
@Param
(
"state"
)
Integer
state
);
int
updateShopGoodsSkuState
(
@Param
(
"id"
)
Long
shopGoodsSkuId
,
@Param
(
"state"
)
Integer
state
);
List
<
Long
>
selectSkuIds
(
@Param
(
"ids"
)
List
<
Long
>
ids
);
/**
/**
* 删除从店铺到sku关联
* 删除从店铺到sku关联
*
*
...
...
soss-system/src/main/java/com/soss/system/service/IShopGoodsService.java
View file @
49a25d0e
...
@@ -61,5 +61,5 @@ public interface IShopGoodsService {
...
@@ -61,5 +61,5 @@ public interface IShopGoodsService {
public
int
deleteShopGoodsById
(
String
id
);
public
int
deleteShopGoodsById
(
String
id
);
List
<
ShopGoodsSku
>
selectSkuByShopGoods
(
Long
shopId
,
Long
goodsId
);
List
<
ShopGoodsSku
>
selectSkuByShopGoods
(
Long
shopId
,
Long
goodsId
);
Boolean
updateShopGoodsSkuState
(
Long
shopGoodsSkuId
,
Integer
state
);
Boolean
updateShopGoodsSkuState
(
Long
shop
Id
,
Long
goodsId
,
List
<
Long
>
shop
GoodsSkuId
,
Integer
state
);
}
}
soss-system/src/main/java/com/soss/system/service/impl/ShopGoodsServiceImpl.java
View file @
49a25d0e
package
com
.
soss
.
system
.
service
.
impl
;
package
com
.
soss
.
system
.
service
.
impl
;
import
com.soss.system.domain.Machine
;
import
com.soss.system.domain.ShopGoods
;
import
com.soss.system.domain.ShopGoods
;
import
com.soss.system.domain.ShopGoodsSku
;
import
com.soss.system.domain.ShopGoodsSku
;
import
com.soss.system.mapper.*
;
import
com.soss.system.mapper.*
;
import
com.soss.system.service.IShopGoodsService
;
import
com.soss.system.service.IShopGoodsService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* 店铺和商品关联Service业务层处理
* 店铺和商品关联Service业务层处理
...
@@ -103,11 +107,29 @@ public class ShopGoodsServiceImpl implements IShopGoodsService {
...
@@ -103,11 +107,29 @@ public class ShopGoodsServiceImpl implements IShopGoodsService {
}
}
@Override
@Override
public
Boolean
updateShopGoodsSkuState
(
Long
shopGoodsSkuId
,
Integer
state
)
{
public
Boolean
updateShopGoodsSkuState
(
Long
shopId
,
Long
goodsId
,
List
<
Long
>
shopGoodsSkuIds
,
Integer
state
)
{
int
i
=
shopGoodsSkuMapper
.
updateShopGoodsSkuState
(
shopGoodsSkuId
,
state
);
// int i = shopGoodsSkuMapper.updateShopGoodsSkuState(shopGoodsSkuId, state);
if
(
i
>
0
)
{
// if (i > 0) {
return
true
;
// return true;
// }
for
(
Long
id
:
shopGoodsSkuIds
)
{
shopGoodsSkuMapper
.
updateShopGoodsSkuState
(
id
,
state
);
}
List
<
Long
>
skuIds
=
shopGoodsSkuMapper
.
selectSkuIds
(
shopGoodsSkuIds
);
if
(!
CollectionUtils
.
isEmpty
(
skuIds
))
{
//推送给极光
List
<
Machine
>
machines
=
machineMapper
.
selectMachineByShopId
(
shopId
);
if
(
CollectionUtils
.
isEmpty
(
machines
))
{
return
true
;
}
Machine
machine
=
machines
.
get
(
0
);
Map
<
Long
,
List
<
Long
>>
map
=
new
HashMap
<>();
map
.
put
(
goodsId
,
skuIds
);
machineApiService
.
push
(
machine
,
String
.
valueOf
(
state
),
map
);
}
}
return
fals
e
;
return
tru
e
;
}
}
}
}
soss-system/src/main/resources/mapper/system/ShopGoodsSkuMapper.xml
View file @
49a25d0e
...
@@ -84,6 +84,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -84,6 +84,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update
id=
"updateShopGoodsSkuState"
>
<update
id=
"updateShopGoodsSkuState"
>
update shop_goods_sku set `state`= #{state} where id = #{id}
update shop_goods_sku set `state`= #{state} where id = #{id}
</update>
</update>
<select
id=
"selectSkuIds"
>
select sku_id from shop_goods_sku
<if
test=
"ids!=null"
>
where id in
<foreach
collection=
"ids"
index=
"index"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</if>
</select>
<delete
id=
"deleteShopGoodsSkuById"
parameterType=
"String"
>
<delete
id=
"deleteShopGoodsSkuById"
parameterType=
"String"
>
delete from shop_goods_sku where id = #{id}
delete from shop_goods_sku where id = #{id}
...
...
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