Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rs-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
周健威
rs-cloud-platform
Commits
e85fee64
Commit
e85fee64
authored
Jan 15, 2021
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
fd1e5130
7fc0aaab
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
70 additions
and
17 deletions
+70
-17
ShoppingCartInfo.java
...m/upyuns/platform/rs/website/entity/ShoppingCartInfo.java
+5
-0
ImageImgStorageBiz.java
...om/upyuns/platform/rs/website/biz/ImageImgStorageBiz.java
+26
-5
IndustryApplicationInfoBiz.java
...s/platform/rs/website/biz/IndustryApplicationInfoBiz.java
+9
-0
ShoppingCartInfoBiz.java
...m/upyuns/platform/rs/website/biz/ShoppingCartInfoBiz.java
+28
-10
ShoppingCartInfoWebController.java
...website/controller/web/ShoppingCartInfoWebController.java
+1
-1
ImageImgStorageMapper.xml
...erver/src/main/resources/mapper/ImageImgStorageMapper.xml
+1
-1
No files found.
rs-website/rs-website-api/src/main/java/com/upyuns/platform/rs/website/entity/ShoppingCartInfo.java
View file @
e85fee64
...
...
@@ -148,6 +148,11 @@ public class ShoppingCartInfo implements Serializable {
private
BigDecimal
totalAmount
;
/**
* 1、上架,2、下架
*/
private
Integer
status
;
public
static
OrderItem
convertToOrderItem
(
ShoppingCartInfo
shoppingCartInfo
)
{
OrderItem
orderItem
=
new
OrderItem
();
orderItem
.
setDetailId
(
shoppingCartInfo
.
getDetailId
());
...
...
rs-website/rs-website-server/src/main/java/com/upyuns/platform/rs/website/biz/ImageImgStorageBiz.java
View file @
e85fee64
...
...
@@ -18,10 +18,7 @@ import com.upyuns.platform.rs.website.mapper.ImageImgStorageMapper;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
tk.mybatis.mapper.entity.Example
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.*
;
/**
* 影像图库
...
...
@@ -36,6 +33,9 @@ public class ImageImgStorageBiz extends BaseBiz<ImageImgStorageMapper,ImageImgSt
@Autowired
ImageInfoRelationBiz
imageInfoRelationBiz
;
@Autowired
ShoppingCartInfoBiz
shoppingCartInfoBiz
;
/**
* 新增或者编辑图像库信息
* @param imageImgStorage
...
...
@@ -61,6 +61,9 @@ public class ImageImgStorageBiz extends BaseBiz<ImageImgStorageMapper,ImageImgSt
}
else
{
BeanUtil
.
copyProperties
(
imageImgStorage
,
old
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
).
setIgnoreError
(
true
));
updateSelectiveByIdRe
(
old
);
if
(
imageImgStorage
.
getIsDel
()
!=
null
)
{
shoppingCartInfoBiz
.
updateObj
(
old
.
getId
(),
null
,
imageImgStorage
.
getIsDel
());
}
}
imageInfoRelationBiz
.
deleteAll
(
old
.
getId
());
if
(
old
.
getImageInfoRelationList
()
!=
null
&&
old
.
getImageInfoRelationList
().
size
()
>
0
)
{
...
...
@@ -86,6 +89,12 @@ public class ImageImgStorageBiz extends BaseBiz<ImageImgStorageMapper,ImageImgSt
}
else
{
BeanUtil
.
copyProperties
(
imageImgStorage
,
old
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
).
setIgnoreError
(
true
));
updateSelectiveByIdRe
(
old
);
List
<
ImageInfoRelation
>
imageInfoRelationList
=
imageInfoRelationBiz
.
getAllById
(
imageImgStorage
.
getId
(),
1
);
if
(
imageInfoRelationList
!=
null
&&
imageInfoRelationList
.
size
()
>
0
)
{
imageInfoRelationList
.
parallelStream
().
forEach
(
imageInfoRelation
->
{
shoppingCartInfoBiz
.
updateObj
(
imageInfoRelation
.
getId
(),
old
.
getStatus
(),
null
);
});
}
}
return
ObjectRestResponse
.
succ
();
}
...
...
@@ -136,7 +145,7 @@ public class ImageImgStorageBiz extends BaseBiz<ImageImgStorageMapper,ImageImgSt
for
(
String
id
:
arr
)
{
if
(
StringUtils
.
isNotBlank
(
id
))
{
ImageImgStorage
imageImgStorage
=
selectById
(
Integer
.
valueOf
(
id
));
if
(
imageImgStorage
!=
null
)
{
if
(
imageImgStorage
!=
null
&&
imageImgStorage
.
getIsDel
()
==
0
&&
imageImgStorage
.
getStatus
()
==
1
)
{
List
<
ImageInfoRelation
>
imageInfoRelationList
=
imageInfoRelationBiz
.
getAllById
(
imageImgStorage
.
getId
(),
1
);
if
(
imageInfoRelationList
!=
null
)
{
imageImgStorage
.
setImageInfoRelationList
(
imageInfoRelationList
);
...
...
@@ -234,9 +243,21 @@ public class ImageImgStorageBiz extends BaseBiz<ImageImgStorageMapper,ImageImgSt
imageImgStorageList
.
parallelStream
().
forEach
(
imageImgStorage
->
{
if
(
imageStorageImgDto
.
getStatus
()
!=
null
)
{
imageImgStorage
.
setStatus
(
imageStorageImgDto
.
getStatus
());
List
<
ImageInfoRelation
>
imageInfoRelationList
=
imageInfoRelationBiz
.
getAllById
(
imageImgStorage
.
getId
(),
1
);
if
(
imageInfoRelationList
!=
null
&&
imageInfoRelationList
.
size
()
>
0
)
{
imageInfoRelationList
.
parallelStream
().
forEach
(
imageInfoRelation
->
{
shoppingCartInfoBiz
.
updateObj
(
imageInfoRelation
.
getId
(),
imageImgStorage
.
getStatus
(),
null
);
});
}
}
if
(
imageStorageImgDto
.
getIsDel
()
!=
null
)
{
imageImgStorage
.
setIsDel
(
imageStorageImgDto
.
getIsDel
());
List
<
ImageInfoRelation
>
imageInfoRelationList
=
imageInfoRelationBiz
.
getAllById
(
imageImgStorage
.
getId
(),
1
);
if
(
imageInfoRelationList
!=
null
&&
imageInfoRelationList
.
size
()
>
0
)
{
imageInfoRelationList
.
parallelStream
().
forEach
(
imageInfoRelation
->
{
shoppingCartInfoBiz
.
updateObj
(
imageInfoRelation
.
getId
(),
null
,
imageImgStorage
.
getIsDel
());
});
}
}
});
mapper
.
batchSave
(
imageImgStorageList
);
...
...
rs-website/rs-website-server/src/main/java/com/upyuns/platform/rs/website/biz/IndustryApplicationInfoBiz.java
View file @
e85fee64
...
...
@@ -38,6 +38,9 @@ public class IndustryApplicationInfoBiz extends BaseBiz<IndustryApplicationInfoM
@Autowired
IndustryApplicationTypeBiz
industryApplicationTypeBiz
;
@Autowired
ShoppingCartInfoBiz
shoppingCartInfoBiz
;
/**
* 行业应用信息
* @param industryApplicationInfo
...
...
@@ -54,6 +57,12 @@ public class IndustryApplicationInfoBiz extends BaseBiz<IndustryApplicationInfoM
}
BeanUtil
.
copyProperties
(
industryApplicationInfo
,
old
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
).
setIgnoreError
(
true
));
updateSelectiveByIdRe
(
old
);
if
(
industryApplicationInfo
.
getIsDel
()
!=
null
)
{
shoppingCartInfoBiz
.
updateObj
(
old
.
getId
(),
null
,
industryApplicationInfo
.
getIsDel
());
}
if
(
industryApplicationInfo
.
getStatus
()
!=
null
)
{
shoppingCartInfoBiz
.
updateObj
(
old
.
getId
(),
industryApplicationInfo
.
getStatus
(),
null
);
}
}
else
{
insertSelectiveRe
(
industryApplicationInfo
);
}
...
...
rs-website/rs-website-server/src/main/java/com/upyuns/platform/rs/website/biz/ShoppingCartInfoBiz.java
View file @
e85fee64
...
...
@@ -41,18 +41,15 @@ import java.util.Set;
*/
@Service
public
class
ShoppingCartInfoBiz
extends
BaseBiz
<
ShoppingCartInfoMapper
,
ShoppingCartInfo
>
{
@Autowired
OrderInfoBiz
orderInfoBiz
;
@Autowired
OrderItemBiz
orderItemBiz
;
@Autowired
IndustryApplicationInfoBiz
industryApplicationInfoBiz
;
@Autowired
ImageImgStorageBiz
imageImgStorageBiz
;
ImageImgStorageBiz
imageImgStorageBiz
;
@Autowired
UserFeign
userFeign
;
...
...
@@ -85,6 +82,7 @@ public class ShoppingCartInfoBiz extends BaseBiz<ShoppingCartInfoMapper, Shoppin
ShoppingCartInfo
old
=
selectById
(
shoppingCartInfo
.
getCartId
());
BeanUtil
.
copyProperties
(
shoppingCartInfo
,
old
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
).
setIgnoreError
(
true
));
updateSelectiveByIdRe
(
old
);
}
return
ObjectRestResponse
.
succ
();
}
...
...
@@ -101,7 +99,7 @@ public class ShoppingCartInfoBiz extends BaseBiz<ShoppingCartInfoMapper, Shoppin
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
RSTOKEN_EXPIRED_CODE
,
ResultCode
.
getMsg
(
ResultCode
.
RSTOKEN_EXPIRED_CODE
));
}
Example
example
=
new
Example
(
ShoppingCartInfo
.
class
);
example
.
createCriteria
().
andEqualTo
(
"userId"
,
appUserDTO
.
getUserid
()).
andEqualTo
(
"isDel"
,
0
);
example
.
createCriteria
().
andEqualTo
(
"userId"
,
appUserDTO
.
getUserid
()).
andEqualTo
(
"isDel"
,
0
)
.
andEqualTo
(
"status"
,
1
)
;
example
.
orderBy
(
"updTime"
).
desc
();
Query
query
=
new
Query
(
orderInfoDto
);
PageDataVO
<
ShoppingCartInfo
>
pageDataVO
=
PageDataVO
.
pageInfo
(
query
,
()
->
mapper
.
selectByExample
(
example
));
...
...
@@ -237,7 +235,7 @@ public class ShoppingCartInfoBiz extends BaseBiz<ShoppingCartInfoMapper, Shoppin
public
ShoppingCartInfo
selectByUser
(
Integer
userId
,
Long
detailId
)
{
Example
example
=
new
Example
(
ShoppingCartInfo
.
class
);
example
.
createCriteria
().
andEqualTo
(
"detailId"
,
detailId
)
.
andEqualTo
(
"userId"
,
userId
).
andEqualTo
(
"isDel"
,
0
);
.
andEqualTo
(
"userId"
,
userId
).
andEqualTo
(
"isDel"
,
0
)
.
andEqualTo
(
"status"
,
1
)
;
return
mapper
.
selectOneByExample
(
example
);
}
...
...
@@ -260,7 +258,7 @@ public class ShoppingCartInfoBiz extends BaseBiz<ShoppingCartInfoMapper, Shoppin
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
ResultCode
.
getMsg
(
ResultCode
.
NOTEXIST_CODE
));
}
Example
example
=
new
Example
(
ShoppingCartInfo
.
class
);
example
.
createCriteria
().
andIn
(
"cartId"
,
Arrays
.
asList
(
cartIds
)).
andEqualTo
(
"isDel"
,
0
);
example
.
createCriteria
().
andIn
(
"cartId"
,
Arrays
.
asList
(
cartIds
)).
andEqualTo
(
"isDel"
,
0
)
.
andEqualTo
(
"status"
,
1
)
;
List
<
ShoppingCartInfo
>
cartInfoList
=
mapper
.
selectByExample
(
example
);
if
(
cartInfoList
!=
null
&&
cartInfoList
.
size
()
>
0
)
{
convertToOrderInfo
(
cartInfoList
,
cartOrderDto
,
appUserDTO
);
...
...
@@ -309,7 +307,7 @@ public class ShoppingCartInfoBiz extends BaseBiz<ShoppingCartInfoMapper, Shoppin
* @param id
* @return
*/
public
ObjectRestResponse
deleteOne
(
Integer
id
)
{
public
ObjectRestResponse
deleteOne
(
Long
id
)
{
if
(
id
==
null
)
{
return
ObjectRestResponse
.
paramIsEmpty
();
}
...
...
@@ -338,7 +336,7 @@ public class ShoppingCartInfoBiz extends BaseBiz<ShoppingCartInfoMapper, Shoppin
}
for
(
String
id
:
idArr
)
{
if
(
StringUtils
.
isNotBlank
(
id
))
{
deleteOne
(
Integer
.
parseInt
(
id
));
deleteOne
(
Long
.
valueOf
(
id
));
}
}
return
ObjectRestResponse
.
succ
();
...
...
@@ -351,8 +349,28 @@ public class ShoppingCartInfoBiz extends BaseBiz<ShoppingCartInfoMapper, Shoppin
*/
public
List
<
ShoppingCartInfo
>
getAllByIds
(
Set
<
Integer
>
idList
)
{
Example
example
=
new
Example
(
ShoppingCartInfo
.
class
);
example
.
createCriteria
().
andIn
(
"id"
,
idList
);
example
.
createCriteria
().
andIn
(
"id"
,
idList
)
.
andEqualTo
(
"status"
,
1
).
andEqualTo
(
"isDel"
,
0
)
;
return
mapper
.
selectByExample
(
example
);
}
/**
* 购物车下架
* @param detailId
*/
public
void
updateObj
(
Integer
detailId
,
Integer
status
,
Integer
isDel
)
{
Example
example
=
new
Example
(
ShoppingCartInfo
.
class
);
example
.
createCriteria
().
andEqualTo
(
"detailId"
,
detailId
)
.
andEqualTo
(
"status"
,
1
).
andEqualTo
(
"isDel"
,
0
);
ShoppingCartInfo
shoppingCartInfo
=
mapper
.
selectOneByExample
(
example
);
if
(
shoppingCartInfo
!=
null
)
{
if
(
status
!=
null
)
{
shoppingCartInfo
.
setStatus
(
status
);
}
if
(
isDel
!=
null
)
{
shoppingCartInfo
.
setIsDel
(
1
);
}
updateSelectiveByIdRe
(
shoppingCartInfo
);
}
}
}
\ No newline at end of file
rs-website/rs-website-server/src/main/java/com/upyuns/platform/rs/website/controller/web/ShoppingCartInfoWebController.java
View file @
e85fee64
...
...
@@ -28,7 +28,7 @@ public class ShoppingCartInfoWebController extends BaseController<ShoppingCartIn
}
@DeleteMapping
(
value
=
"deleteOne"
)
public
ObjectRestResponse
deleteOne
(
Integer
id
)
{
public
ObjectRestResponse
deleteOne
(
Long
id
)
{
return
baseBiz
.
deleteOne
(
id
);
}
...
...
rs-website/rs-website-server/src/main/resources/mapper/ImageImgStorageMapper.xml
View file @
e85fee64
...
...
@@ -13,7 +13,7 @@
</foreach>
ON DUPLICATE KEY UPDATE
is_del = values(is_del),
status = values(
amount
)
status = values(
status
)
</insert>
</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