Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
e5928881
Commit
e5928881
authored
Mar 22, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
个人藏馆
parent
ae0c265c
Changes
23
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
766 additions
and
105 deletions
+766
-105
ch-core/src/main/java/com/wwdz/ch/core/consts/DistributionEnum.java
...c/main/java/com/wwdz/ch/core/consts/DistributionEnum.java
+41
-5
ch-core/src/main/java/com/wwdz/ch/core/entity/SupplierItemVo.java
...src/main/java/com/wwdz/ch/core/entity/SupplierItemVo.java
+5
-0
ch-dao/src/main/java/com/wwdz/ch/db/dao/distribution/ItemCollectedRecordDao.java
...m/wwdz/ch/db/dao/distribution/ItemCollectedRecordDao.java
+8
-0
ch-dao/src/main/java/com/wwdz/ch/db/dao/distribution/SupplierItemDao.java
...java/com/wwdz/ch/db/dao/distribution/SupplierItemDao.java
+7
-0
ch-dao/src/main/java/com/wwdz/ch/db/dao/distribution/UserRecentBrowseDao.java
.../com/wwdz/ch/db/dao/distribution/UserRecentBrowseDao.java
+11
-3
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/UserRecentBrowse.java
.../com/wwdz/ch/db/domain/distribution/UserRecentBrowse.java
+25
-6
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/UserRecentBrowseExample.java
...dz/ch/db/domain/distribution/UserRecentBrowseExample.java
+300
-36
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/distribution/CollectionItemsRelationRequestDto.java
...quest/distribution/CollectionItemsRelationRequestDto.java
+5
-0
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/ItemCollectedRecordDaoImpl.java
...z/ch/db/impl/distribution/ItemCollectedRecordDaoImpl.java
+20
-1
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/SupplierItemDaoImpl.java
...com/wwdz/ch/db/impl/distribution/SupplierItemDaoImpl.java
+10
-0
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/UserRecentBrowseDaoImpl.java
...wwdz/ch/db/impl/distribution/UserRecentBrowseDaoImpl.java
+11
-2
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/distribution/UserRecentBrowseMapper.xml
...wwdz/ch/db/mapper/distribution/UserRecentBrowseMapper.xml
+59
-24
ch-dao/src/main/resources/generatorConfig_new.xml
ch-dao/src/main/resources/generatorConfig_new.xml
+1
-1
ch-wx-api/src/main/java/com/wwdz/ch/wx/config/WebMvcConfiguration.java
.../main/java/com/wwdz/ch/wx/config/WebMvcConfiguration.java
+1
-1
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/vo/distribution/CollectionBookVo.java
...m/wwdz/ch/wx/entity/vo/distribution/CollectionBookVo.java
+5
-2
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/CollectionItemsRelationServiceImpl.java
...impl/distribution/CollectionItemsRelationServiceImpl.java
+57
-12
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/CollectionShareRecordServiceImpl.java
...x/impl/distribution/CollectionShareRecordServiceImpl.java
+1
-1
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/ItemCollectedRecordServiceImpl.java
.../wx/impl/distribution/ItemCollectedRecordServiceImpl.java
+1
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
...wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
+63
-11
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/distribution/SupplierItemService.java
.../wwdz/ch/wx/service/distribution/SupplierItemService.java
+7
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/CollectionShareRecordController.java
.../wx/web/distribution/CollectionShareRecordController.java
+45
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/ItemCollectedRecordController.java
...ch/wx/web/distribution/ItemCollectedRecordController.java
+57
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/SupplierItemController.java
...m/wwdz/ch/wx/web/distribution/SupplierItemController.java
+26
-0
No files found.
ch-core/src/main/java/com/wwdz/ch/core/consts/DistributionEnum.java
View file @
e5928881
...
...
@@ -199,7 +199,7 @@ public class DistributionEnum {
/**
* 藏品分享类型
*/
public
enum
CollectionShareType
State
Enum
{
public
enum
CollectionShareTypeEnum
{
ITEM
(
1
,
"藏品"
),
PAGE
(
2
,
"个人藏馆"
),
;
...
...
@@ -207,15 +207,15 @@ public class DistributionEnum {
private
int
code
;
private
String
des
;
CollectionShareType
State
Enum
(
int
code
,
String
des
)
{
CollectionShareTypeEnum
(
int
code
,
String
des
)
{
this
.
code
=
code
;
this
.
des
=
des
;
}
public
static
String
getNameByCode
(
int
code
)
{
for
(
CollectionShareType
StateEnum
collectionShareTypeStateEnum
:
CollectionShareTypeStat
eEnum
.
values
())
{
if
(
code
==
collectionShareType
State
Enum
.
getCode
())
{
return
collectionShareType
State
Enum
.
getDes
();
for
(
CollectionShareType
Enum
collectionShareTypeEnum
:
CollectionShareTyp
eEnum
.
values
())
{
if
(
code
==
collectionShareTypeEnum
.
getCode
())
{
return
collectionShareTypeEnum
.
getDes
();
}
}
return
null
;
...
...
@@ -233,4 +233,40 @@ public class DistributionEnum {
/**
* 用户浏览商品的类型
*/
public
enum
UserBrowseTypeEnum
{
USER_ITEM
(
1
,
"用户藏品"
),
PLATFORM_ITEM
(
2
,
"平台商品"
),
;
private
int
code
;
private
String
des
;
UserBrowseTypeEnum
(
int
code
,
String
des
)
{
this
.
code
=
code
;
this
.
des
=
des
;
}
public
static
String
getNameByCode
(
int
code
)
{
for
(
UserBrowseTypeEnum
userBrowseTypeEnum
:
UserBrowseTypeEnum
.
values
())
{
if
(
code
==
userBrowseTypeEnum
.
getCode
())
{
return
userBrowseTypeEnum
.
getDes
();
}
}
return
null
;
}
public
int
getCode
()
{
return
code
;
}
public
String
getDes
()
{
return
des
;
}
}
}
ch-core/src/main/java/com/wwdz/ch/core/entity/SupplierItemVo.java
View file @
e5928881
...
...
@@ -206,6 +206,11 @@ public class SupplierItemVo implements Entity {
private
String
creatorName
;
/**
* 藏品上传人的头像
*/
private
String
creatorAvatar
;
/**
* 收藏数
*/
...
...
ch-dao/src/main/java/com/wwdz/ch/db/dao/distribution/ItemCollectedRecordDao.java
View file @
e5928881
...
...
@@ -38,4 +38,12 @@ public interface ItemCollectedRecordDao {
* @return
*/
long
countByItemId
(
long
itemId
);
/**
* 该用户是否收藏了该商品
* @param itemId
* @param collectorsId
* @return
*/
boolean
isExisted
(
long
itemId
,
long
collectorsId
);
}
ch-dao/src/main/java/com/wwdz/ch/db/dao/distribution/SupplierItemDao.java
View file @
e5928881
...
...
@@ -38,5 +38,12 @@ public interface SupplierItemDao {
*/
int
updateStock
(
long
itemId
,
int
stock
);
/**
* 删除商品
* @param itemId
* @return
*/
int
delete
(
long
itemId
);
}
ch-dao/src/main/java/com/wwdz/ch/db/dao/distribution/UserRecentBrowseDao.java
View file @
e5928881
...
...
@@ -20,13 +20,21 @@ public interface UserRecentBrowseDao {
/**
* 根据用户
id查询最近浏览的记录
* @param userId,
distributorId
* 根据用户
浏览记录是否存在
* @param userId,
shara
* @return
*/
boolean
isExisted
(
long
userId
,
long
distributorId
);
boolean
isExisted
(
long
userId
,
long
sharerId
);
/**
* 根据用户id查询最近浏览的记录
* @param userId, sharedUserId
* @return
*/
boolean
isExistedBySharedUserId
(
long
userId
,
long
sharedUserId
);
/**
* 插入新记录
* @param userRecentBrowse
...
...
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/UserRecentBrowse.java
View file @
e5928881
package
com.wwdz.ch.db.domain.distribution
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
...
...
@@ -9,7 +10,7 @@ import lombok.Data;
/**
* @author shiyu
* @date 2024/0
2/23
* @date 2024/0
3/22
*/
@Data
public
class
UserRecentBrowse
implements
Entity
{
...
...
@@ -21,7 +22,7 @@ public class UserRecentBrowse implements Entity {
private
Long
userId
;
/**
* 分
销商
id
* 分
享人
id
*/
private
Long
sharerId
;
...
...
@@ -40,6 +41,16 @@ public class UserRecentBrowse implements Entity {
*/
private
String
shareRecordId
;
/**
* 类型1用户藏品2平台商品
*/
private
Integer
type
;
/**
* 被分享的用户id
*/
private
Long
sharedUserId
;
private
static
final
long
serialVersionUID
=
1L
;
@Override
...
...
@@ -50,10 +61,12 @@ public class UserRecentBrowse implements Entity {
sb
.
append
(
"Hash = "
).
append
(
hashCode
());
sb
.
append
(
", id="
).
append
(
id
);
sb
.
append
(
", userId="
).
append
(
userId
);
sb
.
append
(
",
distributo
rId="
).
append
(
sharerId
);
sb
.
append
(
",
share
rId="
).
append
(
sharerId
);
sb
.
append
(
", createTime="
).
append
(
createTime
);
sb
.
append
(
", updateTime="
).
append
(
updateTime
);
sb
.
append
(
", shareRecordId="
).
append
(
shareRecordId
);
sb
.
append
(
", type="
).
append
(
type
);
sb
.
append
(
", sharedUserId="
).
append
(
sharedUserId
);
sb
.
append
(
", serialVersionUID="
).
append
(
serialVersionUID
);
sb
.
append
(
"]"
);
return
sb
.
toString
();
...
...
@@ -76,7 +89,9 @@ public class UserRecentBrowse implements Entity {
&&
(
this
.
getSharerId
()
==
null
?
other
.
getSharerId
()
==
null
:
this
.
getSharerId
().
equals
(
other
.
getSharerId
()))
&&
(
this
.
getCreateTime
()
==
null
?
other
.
getCreateTime
()
==
null
:
this
.
getCreateTime
().
equals
(
other
.
getCreateTime
()))
&&
(
this
.
getUpdateTime
()
==
null
?
other
.
getUpdateTime
()
==
null
:
this
.
getUpdateTime
().
equals
(
other
.
getUpdateTime
()))
&&
(
this
.
getShareRecordId
()
==
null
?
other
.
getShareRecordId
()
==
null
:
this
.
getShareRecordId
().
equals
(
other
.
getShareRecordId
()));
&&
(
this
.
getShareRecordId
()
==
null
?
other
.
getShareRecordId
()
==
null
:
this
.
getShareRecordId
().
equals
(
other
.
getShareRecordId
()))
&&
(
this
.
getType
()
==
null
?
other
.
getType
()
==
null
:
this
.
getType
().
equals
(
other
.
getType
()))
&&
(
this
.
getSharedUserId
()
==
null
?
other
.
getSharedUserId
()
==
null
:
this
.
getSharedUserId
().
equals
(
other
.
getSharedUserId
()));
}
@Override
...
...
@@ -89,6 +104,8 @@ public class UserRecentBrowse implements Entity {
result
=
prime
*
result
+
((
getCreateTime
()
==
null
)
?
0
:
getCreateTime
().
hashCode
());
result
=
prime
*
result
+
((
getUpdateTime
()
==
null
)
?
0
:
getUpdateTime
().
hashCode
());
result
=
prime
*
result
+
((
getShareRecordId
()
==
null
)
?
0
:
getShareRecordId
().
hashCode
());
result
=
prime
*
result
+
((
getType
()
==
null
)
?
0
:
getType
().
hashCode
());
result
=
prime
*
result
+
((
getSharedUserId
()
==
null
)
?
0
:
getSharedUserId
().
hashCode
());
return
result
;
}
...
...
@@ -102,10 +119,12 @@ public class UserRecentBrowse implements Entity {
public
enum
Column
{
id
(
"id"
,
"id"
,
"INTEGER"
,
false
),
userId
(
"user_id"
,
"userId"
,
"BIGINT"
,
false
),
distributorId
(
"distributor_id"
,
"distributo
rId"
,
"BIGINT"
,
false
),
sharerId
(
"sharer_id"
,
"share
rId"
,
"BIGINT"
,
false
),
createTime
(
"create_time"
,
"createTime"
,
"TIMESTAMP"
,
false
),
updateTime
(
"update_time"
,
"updateTime"
,
"TIMESTAMP"
,
false
),
shareRecordId
(
"share_record_id"
,
"shareRecordId"
,
"VARCHAR"
,
false
);
shareRecordId
(
"share_record_id"
,
"shareRecordId"
,
"VARCHAR"
,
false
),
type
(
"type"
,
"type"
,
"INTEGER"
,
true
),
sharedUserId
(
"shared_user_id"
,
"sharedUserId"
,
"BIGINT"
,
false
);
/**
* This field was generated by MyBatis Generator.
...
...
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/UserRecentBrowseExample.java
View file @
e5928881
...
...
@@ -412,18 +412,18 @@ public class UserRecentBrowseExample {
return
(
Criteria
)
this
;
}
public
Criteria
and
Distributo
rIdIsNull
()
{
addCriterion
(
"
distributo
r_id is null"
);
public
Criteria
and
Share
rIdIsNull
()
{
addCriterion
(
"
share
r_id is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
Distributo
rIdIsNotNull
()
{
addCriterion
(
"
distributo
r_id is not null"
);
public
Criteria
and
Share
rIdIsNotNull
()
{
addCriterion
(
"
share
r_id is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
Distributo
rIdEqualTo
(
Long
value
)
{
addCriterion
(
"
distributor_id ="
,
value
,
"distributo
rId"
);
public
Criteria
and
Share
rIdEqualTo
(
Long
value
)
{
addCriterion
(
"
sharer_id ="
,
value
,
"share
rId"
);
return
(
Criteria
)
this
;
}
...
...
@@ -434,13 +434,13 @@ public class UserRecentBrowseExample {
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
and
Distributo
rIdEqualToColumn
(
UserRecentBrowse
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"
distributo
r_id = "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
public
Criteria
and
Share
rIdEqualToColumn
(
UserRecentBrowse
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"
share
r_id = "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
and
Distributo
rIdNotEqualTo
(
Long
value
)
{
addCriterion
(
"
distributor_id <>"
,
value
,
"distributo
rId"
);
public
Criteria
and
Share
rIdNotEqualTo
(
Long
value
)
{
addCriterion
(
"
sharer_id <>"
,
value
,
"share
rId"
);
return
(
Criteria
)
this
;
}
...
...
@@ -451,13 +451,13 @@ public class UserRecentBrowseExample {
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
and
Distributo
rIdNotEqualToColumn
(
UserRecentBrowse
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"
distributo
r_id <> "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
public
Criteria
and
Share
rIdNotEqualToColumn
(
UserRecentBrowse
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"
share
r_id <> "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
and
Distributo
rIdGreaterThan
(
Long
value
)
{
addCriterion
(
"
distributor_id >"
,
value
,
"distributo
rId"
);
public
Criteria
and
Share
rIdGreaterThan
(
Long
value
)
{
addCriterion
(
"
sharer_id >"
,
value
,
"share
rId"
);
return
(
Criteria
)
this
;
}
...
...
@@ -468,13 +468,13 @@ public class UserRecentBrowseExample {
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
and
Distributo
rIdGreaterThanColumn
(
UserRecentBrowse
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"
distributo
r_id > "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
public
Criteria
and
Share
rIdGreaterThanColumn
(
UserRecentBrowse
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"
share
r_id > "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
and
Distributo
rIdGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"
distributor_id >="
,
value
,
"distributo
rId"
);
public
Criteria
and
Share
rIdGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"
sharer_id >="
,
value
,
"share
rId"
);
return
(
Criteria
)
this
;
}
...
...
@@ -485,13 +485,13 @@ public class UserRecentBrowseExample {
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
and
Distributo
rIdGreaterThanOrEqualToColumn
(
UserRecentBrowse
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"
distributo
r_id >= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
public
Criteria
and
Share
rIdGreaterThanOrEqualToColumn
(
UserRecentBrowse
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"
share
r_id >= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
and
Distributo
rIdLessThan
(
Long
value
)
{
addCriterion
(
"
distributor_id <"
,
value
,
"distributo
rId"
);
public
Criteria
and
Share
rIdLessThan
(
Long
value
)
{
addCriterion
(
"
sharer_id <"
,
value
,
"share
rId"
);
return
(
Criteria
)
this
;
}
...
...
@@ -502,13 +502,13 @@ public class UserRecentBrowseExample {
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
and
Distributo
rIdLessThanColumn
(
UserRecentBrowse
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"
distributo
r_id < "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
public
Criteria
and
Share
rIdLessThanColumn
(
UserRecentBrowse
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"
share
r_id < "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
and
Distributo
rIdLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"
distributor_id <="
,
value
,
"distributo
rId"
);
public
Criteria
and
Share
rIdLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"
sharer_id <="
,
value
,
"share
rId"
);
return
(
Criteria
)
this
;
}
...
...
@@ -519,28 +519,28 @@ public class UserRecentBrowseExample {
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
and
Distributo
rIdLessThanOrEqualToColumn
(
UserRecentBrowse
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"
distributo
r_id <= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
public
Criteria
and
Share
rIdLessThanOrEqualToColumn
(
UserRecentBrowse
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"
share
r_id <= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
and
Distributo
rIdIn
(
List
<
Long
>
values
)
{
addCriterion
(
"
distributor_id in"
,
values
,
"distributo
rId"
);
public
Criteria
and
Share
rIdIn
(
List
<
Long
>
values
)
{
addCriterion
(
"
sharer_id in"
,
values
,
"share
rId"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
Distributo
rIdNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"
distributor_id not in"
,
values
,
"distributo
rId"
);
public
Criteria
and
Share
rIdNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"
sharer_id not in"
,
values
,
"share
rId"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
Distributo
rIdBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"
distributor_id between"
,
value1
,
value2
,
"distributo
rId"
);
public
Criteria
and
Share
rIdBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"
sharer_id between"
,
value1
,
value2
,
"share
rId"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
Distributo
rIdNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"
distributor_id not between"
,
value1
,
value2
,
"distributo
rId"
);
public
Criteria
and
Share
rIdNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"
sharer_id not between"
,
value1
,
value2
,
"share
rId"
);
return
(
Criteria
)
this
;
}
...
...
@@ -949,6 +949,270 @@ public class UserRecentBrowseExample {
addCriterion
(
"share_record_id not between"
,
value1
,
value2
,
"shareRecordId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeIsNull
()
{
addCriterion
(
"`type` is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeIsNotNull
()
{
addCriterion
(
"`type` is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeEqualTo
(
Integer
value
)
{
addCriterion
(
"`type` ="
,
value
,
"type"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_recent_browse
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andTypeEqualToColumn
(
UserRecentBrowse
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"`type` = "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andTypeNotEqualTo
(
Integer
value
)
{
addCriterion
(
"`type` <>"
,
value
,
"type"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_recent_browse
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andTypeNotEqualToColumn
(
UserRecentBrowse
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"`type` <> "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andTypeGreaterThan
(
Integer
value
)
{
addCriterion
(
"`type` >"
,
value
,
"type"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_recent_browse
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andTypeGreaterThanColumn
(
UserRecentBrowse
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"`type` > "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andTypeGreaterThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"`type` >="
,
value
,
"type"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_recent_browse
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andTypeGreaterThanOrEqualToColumn
(
UserRecentBrowse
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"`type` >= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andTypeLessThan
(
Integer
value
)
{
addCriterion
(
"`type` <"
,
value
,
"type"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_recent_browse
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andTypeLessThanColumn
(
UserRecentBrowse
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"`type` < "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andTypeLessThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"`type` <="
,
value
,
"type"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_recent_browse
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andTypeLessThanOrEqualToColumn
(
UserRecentBrowse
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"`type` <= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andTypeIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"`type` in"
,
values
,
"type"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeNotIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"`type` not in"
,
values
,
"type"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"`type` between"
,
value1
,
value2
,
"type"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeNotBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"`type` not between"
,
value1
,
value2
,
"type"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSharedUserIdIsNull
()
{
addCriterion
(
"shared_user_id is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSharedUserIdIsNotNull
()
{
addCriterion
(
"shared_user_id is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSharedUserIdEqualTo
(
Long
value
)
{
addCriterion
(
"shared_user_id ="
,
value
,
"sharedUserId"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_recent_browse
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andSharedUserIdEqualToColumn
(
UserRecentBrowse
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"shared_user_id = "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andSharedUserIdNotEqualTo
(
Long
value
)
{
addCriterion
(
"shared_user_id <>"
,
value
,
"sharedUserId"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_recent_browse
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andSharedUserIdNotEqualToColumn
(
UserRecentBrowse
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"shared_user_id <> "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andSharedUserIdGreaterThan
(
Long
value
)
{
addCriterion
(
"shared_user_id >"
,
value
,
"sharedUserId"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_recent_browse
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andSharedUserIdGreaterThanColumn
(
UserRecentBrowse
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"shared_user_id > "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andSharedUserIdGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"shared_user_id >="
,
value
,
"sharedUserId"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_recent_browse
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andSharedUserIdGreaterThanOrEqualToColumn
(
UserRecentBrowse
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"shared_user_id >= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andSharedUserIdLessThan
(
Long
value
)
{
addCriterion
(
"shared_user_id <"
,
value
,
"sharedUserId"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_recent_browse
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andSharedUserIdLessThanColumn
(
UserRecentBrowse
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"shared_user_id < "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andSharedUserIdLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"shared_user_id <="
,
value
,
"sharedUserId"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_recent_browse
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andSharedUserIdLessThanOrEqualToColumn
(
UserRecentBrowse
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"shared_user_id <= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andSharedUserIdIn
(
List
<
Long
>
values
)
{
addCriterion
(
"shared_user_id in"
,
values
,
"sharedUserId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSharedUserIdNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"shared_user_id not in"
,
values
,
"sharedUserId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSharedUserIdBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"shared_user_id between"
,
value1
,
value2
,
"sharedUserId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSharedUserIdNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"shared_user_id not between"
,
value1
,
value2
,
"sharedUserId"
);
return
(
Criteria
)
this
;
}
}
public
static
class
Criteria
extends
GeneratedCriteria
{
...
...
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/distribution/CollectionItemsRelationRequestDto.java
View file @
e5928881
...
...
@@ -50,4 +50,9 @@ public class CollectionItemsRelationRequestDto extends BaseRequestDto implements
* 是否删除
*/
private
Boolean
isDeleted
;
/**
* 分享id
*/
private
String
shareRecordId
;
}
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/ItemCollectedRecordDaoImpl.java
View file @
e5928881
package
com.wwdz.ch.db.impl.distribution
;
import
com.github.pagehelper.PageHelper
;
import
com.wwdz.ch.db.dao.distribution.ItemCollectedRecordDao
;
import
com.wwdz.ch.db.domain.distribution.ItemCollectedRecord
;
import
com.wwdz.ch.db.domain.distribution.ItemCollectedRecordExample
;
import
com.wwdz.ch.db.dto.request.distribution.ItemCollectedRecordRequestDto
;
import
com.wwdz.ch.db.mapper.distribution.ItemCollectedRecordMapper
;
import
com.xxdxxs.db.component.JdbcHelper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Repository
;
...
...
@@ -24,7 +26,14 @@ public class ItemCollectedRecordDaoImpl implements ItemCollectedRecordDao {
@Override
public
List
<
ItemCollectedRecord
>
find
(
ItemCollectedRecordRequestDto
dto
)
{
return
null
;
ItemCollectedRecordExample
example
=
new
ItemCollectedRecordExample
();
ItemCollectedRecordExample
.
Criteria
criteria
=
example
.
createCriteria
();
JdbcHelper
.
ifPresent
(
dto
.
getItemId
(),
criteria:
:
andItemIdEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getCollectorsId
(),
criteria:
:
andCollectorsIdEqualTo
);
criteria
.
andIsDeletedEqualTo
(
false
);
example
.
setOrderByClause
(
"update_time desc"
);
PageHelper
.
startPage
(
dto
.
getPage
(),
dto
.
getLimit
());
return
itemCollectedRecordMapper
.
selectByExample
(
example
);
}
@Override
...
...
@@ -47,4 +56,14 @@ public class ItemCollectedRecordDaoImpl implements ItemCollectedRecordDao {
criteria
.
andIsDeletedEqualTo
(
false
);
return
itemCollectedRecordMapper
.
countByExample
(
example
);
}
@Override
public
boolean
isExisted
(
long
itemId
,
long
collectorsId
)
{
ItemCollectedRecordExample
example
=
new
ItemCollectedRecordExample
();
ItemCollectedRecordExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andItemIdEqualTo
(
itemId
);
criteria
.
andCollectorsIdEqualTo
(
collectorsId
);
criteria
.
andIsDeletedEqualTo
(
false
);
return
itemCollectedRecordMapper
.
countByExample
(
example
)
>
0
;
}
}
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/SupplierItemDaoImpl.java
View file @
e5928881
...
...
@@ -70,4 +70,14 @@ public class SupplierItemDaoImpl implements SupplierItemDao {
criteria
.
andIdEqualTo
(
itemId
);
return
supplierItemMapper
.
updateByExampleSelective
(
supplierItem
,
supplierItemExample
);
}
@Override
public
int
delete
(
long
itemId
)
{
SupplierItem
supplierItem
=
new
SupplierItem
();
supplierItem
.
setId
(
itemId
);
supplierItem
.
setIsDeleted
(
true
);
supplierItem
.
setUpdateTime
(
new
Date
());
return
supplierItemMapper
.
updateByPrimaryKeySelective
(
supplierItem
);
}
}
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/UserRecentBrowseDaoImpl.java
View file @
e5928881
...
...
@@ -31,11 +31,20 @@ public class UserRecentBrowseDaoImpl implements UserRecentBrowseDao {
}
@Override
public
boolean
isExisted
(
long
userId
,
long
distributo
rId
)
{
public
boolean
isExisted
(
long
userId
,
long
share
rId
)
{
UserRecentBrowseExample
example
=
new
UserRecentBrowseExample
();
UserRecentBrowseExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andUserIdEqualTo
(
userId
);
criteria
.
andDistributorIdEqualTo
(
distributorId
);
criteria
.
andSharerIdEqualTo
(
sharerId
);
return
userRecentBrowseMapper
.
countByExample
(
example
)
>
0
;
}
@Override
public
boolean
isExistedBySharedUserId
(
long
userId
,
long
sharedUserId
)
{
UserRecentBrowseExample
example
=
new
UserRecentBrowseExample
();
UserRecentBrowseExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andUserIdEqualTo
(
userId
);
criteria
.
andSharedUserIdEqualTo
(
sharedUserId
);
return
userRecentBrowseMapper
.
countByExample
(
example
)
>
0
;
}
...
...
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/distribution/UserRecentBrowseMapper.xml
View file @
e5928881
...
...
@@ -4,10 +4,12 @@
<resultMap
id=
"BaseResultMap"
type=
"com.wwdz.ch.db.domain.distribution.UserRecentBrowse"
>
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"user_id"
jdbcType=
"BIGINT"
property=
"userId"
/>
<result
column=
"
distributor_id"
jdbcType=
"BIGINT"
property=
"distributo
rId"
/>
<result
column=
"
sharer_id"
jdbcType=
"BIGINT"
property=
"share
rId"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
<result
column=
"share_record_id"
jdbcType=
"VARCHAR"
property=
"shareRecordId"
/>
<result
column=
"type"
jdbcType=
"INTEGER"
property=
"type"
/>
<result
column=
"shared_user_id"
jdbcType=
"BIGINT"
property=
"sharedUserId"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<where>
...
...
@@ -68,7 +70,7 @@
</where>
</sql>
<sql
id=
"Base_Column_List"
>
id, user_id,
distributor_id, create_time, update_time, share_record
_id
id, user_id,
sharer_id, create_time, update_time, share_record_id, `type`, shared_user
_id
</sql>
<select
id=
"selectByExample"
parameterType=
"com.wwdz.ch.db.domain.distribution.UserRecentBrowseExample"
resultMap=
"BaseResultMap"
>
select
...
...
@@ -97,13 +99,14 @@
distinct
</if>
<choose>
<when
test=
"selective != null and selective.length
>
0"
>
<when
test=
"selective != null and selective.length
>
0"
>
<foreach
collection=
"selective"
item=
"column"
separator=
","
>
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, user_id, distributor_id, create_time, update_time, share_record_id
id, user_id, sharer_id, create_time, update_time, share_record_id, `type`, shared_user_id
</otherwise>
</choose>
from user_recent_browse
...
...
@@ -128,13 +131,14 @@
-->
select
<choose>
<when
test=
"selective != null and selective.length
>
0"
>
<when
test=
"selective != null and selective.length
>
0"
>
<foreach
collection=
"selective"
item=
"column"
separator=
","
>
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, user_id, distributor_id, create_time, update_time, share_record_id
id, user_id, sharer_id, create_time, update_time, share_record_id, `type`, shared_user_id
</otherwise>
</choose>
from user_recent_browse
...
...
@@ -154,10 +158,12 @@
<selectKey
keyProperty=
"id"
order=
"AFTER"
resultType=
"java.lang.Integer"
>
SELECT LAST_INSERT_ID()
</selectKey>
insert into user_recent_browse (user_id, distributor_id, create_time,
update_time, share_record_id)
values (#{userId,jdbcType=BIGINT}, #{distributorId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{shareRecordId,jdbcType=VARCHAR})
insert into user_recent_browse (user_id, sharer_id, create_time,
update_time, share_record_id, `type`,
shared_user_id)
values (#{userId,jdbcType=BIGINT}, #{sharerId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{shareRecordId,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER},
#{sharedUserId,jdbcType=BIGINT})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.wwdz.ch.db.domain.distribution.UserRecentBrowse"
>
<selectKey
keyProperty=
"id"
order=
"AFTER"
resultType=
"java.lang.Integer"
>
...
...
@@ -168,8 +174,8 @@
<if
test=
"userId != null"
>
user_id,
</if>
<if
test=
"
distributo
rId != null"
>
distributo
r_id,
<if
test=
"
share
rId != null"
>
share
r_id,
</if>
<if
test=
"createTime != null"
>
create_time,
...
...
@@ -180,13 +186,19 @@
<if
test=
"shareRecordId != null"
>
share_record_id,
</if>
<if
test=
"type != null"
>
`type`,
</if>
<if
test=
"sharedUserId != null"
>
shared_user_id,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"userId != null"
>
#{userId,jdbcType=BIGINT},
</if>
<if
test=
"
distributo
rId != null"
>
#{
distributo
rId,jdbcType=BIGINT},
<if
test=
"
share
rId != null"
>
#{
share
rId,jdbcType=BIGINT},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
...
...
@@ -197,6 +209,12 @@
<if
test=
"shareRecordId != null"
>
#{shareRecordId,jdbcType=VARCHAR},
</if>
<if
test=
"type != null"
>
#{type,jdbcType=INTEGER},
</if>
<if
test=
"sharedUserId != null"
>
#{sharedUserId,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"com.wwdz.ch.db.domain.distribution.UserRecentBrowseExample"
resultType=
"java.lang.Long"
>
...
...
@@ -214,8 +232,8 @@
<if
test=
"record.userId != null"
>
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if
test=
"record.
distributo
rId != null"
>
distributor_id = #{record.distributo
rId,jdbcType=BIGINT},
<if
test=
"record.
share
rId != null"
>
sharer_id = #{record.share
rId,jdbcType=BIGINT},
</if>
<if
test=
"record.createTime != null"
>
create_time = #{record.createTime,jdbcType=TIMESTAMP},
...
...
@@ -226,6 +244,12 @@
<if
test=
"record.shareRecordId != null"
>
share_record_id = #{record.shareRecordId,jdbcType=VARCHAR},
</if>
<if
test=
"record.type != null"
>
`type` = #{record.type,jdbcType=INTEGER},
</if>
<if
test=
"record.sharedUserId != null"
>
shared_user_id = #{record.sharedUserId,jdbcType=BIGINT},
</if>
</set>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
...
...
@@ -235,10 +259,12 @@
update user_recent_browse
set id = #{record.id,jdbcType=INTEGER},
user_id = #{record.userId,jdbcType=BIGINT},
distributor_id = #{record.distributo
rId,jdbcType=BIGINT},
sharer_id = #{record.share
rId,jdbcType=BIGINT},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
share_record_id = #{record.shareRecordId,jdbcType=VARCHAR}
share_record_id = #{record.shareRecordId,jdbcType=VARCHAR},
`type` = #{record.type,jdbcType=INTEGER},
shared_user_id = #{record.sharedUserId,jdbcType=BIGINT}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
...
...
@@ -249,8 +275,8 @@
<if
test=
"userId != null"
>
user_id = #{userId,jdbcType=BIGINT},
</if>
<if
test=
"
distributo
rId != null"
>
distributor_id = #{distributo
rId,jdbcType=BIGINT},
<if
test=
"
share
rId != null"
>
sharer_id = #{share
rId,jdbcType=BIGINT},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
...
...
@@ -261,16 +287,24 @@
<if
test=
"shareRecordId != null"
>
share_record_id = #{shareRecordId,jdbcType=VARCHAR},
</if>
<if
test=
"type != null"
>
`type` = #{type,jdbcType=INTEGER},
</if>
<if
test=
"sharedUserId != null"
>
shared_user_id = #{sharedUserId,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.wwdz.ch.db.domain.distribution.UserRecentBrowse"
>
update user_recent_browse
set user_id = #{userId,jdbcType=BIGINT},
distributor_id = #{distributo
rId,jdbcType=BIGINT},
sharer_id = #{share
rId,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
share_record_id = #{shareRecordId,jdbcType=VARCHAR}
share_record_id = #{shareRecordId,jdbcType=VARCHAR},
`type` = #{type,jdbcType=INTEGER},
shared_user_id = #{sharedUserId,jdbcType=BIGINT}
where id = #{id,jdbcType=INTEGER}
</update>
<select
id=
"selectOneByExample"
parameterType=
"com.wwdz.ch.db.domain.distribution.UserRecentBrowseExample"
resultMap=
"BaseResultMap"
>
...
...
@@ -300,13 +334,14 @@
select
'true' as QUERYID,
<choose>
<when
test=
"selective != null and selective.length
>
0"
>
<when
test=
"selective != null and selective.length
>
0"
>
<foreach
collection=
"selective"
item=
"column"
separator=
","
>
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, user_id, distributor_id, create_time, update_time, share_record_id
id, user_id, sharer_id, create_time, update_time, share_record_id, `type`, shared_user_id
</otherwise>
</choose>
from user_recent_browse
...
...
ch-dao/src/main/resources/generatorConfig_new.xml
View file @
e5928881
...
...
@@ -72,7 +72,7 @@
<javaClientGenerator
type=
"XMLMAPPER"
targetPackage=
"com.wwdz.ch.db.mapper.distribution"
targetProject=
"ch-dao/src/main/java"
/>
<table
tableName=
"
collection_share_record
"
enableCountByExample=
"true"
enableUpdateByExample=
"true"
enableDeleteByExample=
"true"
enableSelectByExample=
"true"
selectByExampleQueryId=
"true"
>
<table
tableName=
"
user_recent_browse
"
enableCountByExample=
"true"
enableUpdateByExample=
"true"
enableDeleteByExample=
"true"
enableSelectByExample=
"true"
selectByExampleQueryId=
"true"
>
<generatedKey
column=
"id"
sqlStatement=
"Mysql"
identity=
"true"
/>
</table>
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/config/WebMvcConfiguration.java
View file @
e5928881
...
...
@@ -47,7 +47,7 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
"/wx/supplierItem/findItemsOfCurrentDistributor"
//下列路径上线注释
,
"/wx/supplierItem/**"
,
"/wx/shareRecord/**"
,
"/wx/distributionOrder/**"
,
"/wx/selfPage/**"
,
"/wx/auctionRecord/**"
,
"/wx/shareRecord/**"
,
"/wx/collectionBook/**"
"/wx/shareRecord/**"
,
"/wx/collectionBook/**"
,
"/wx/collectedRecord/**"
,
"/wx/collectionItemsRelation/**"
,
"/wx/collectionShareRecord/**"
/* "/wx/officialAccount/**",
"/wx/item/**",
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/vo/distribution/CollectionBookVo.java
View file @
e5928881
package
com.wwdz.ch.wx.entity.vo.distribution
;
import
com.github.pagehelper.PageInfo
;
import
com.wwdz.ch.core.entity.SupplierItemVo
;
import
com.wwdz.ch.core.type.PageSearchResult
;
import
com.xxdxxs.entity.Entity
;
import
lombok.Data
;
...
...
@@ -21,4 +19,9 @@ public class CollectionBookVo implements Entity {
* 上传的所有藏品
*/
private
PageSearchResult
pageSearchResult
;
/**
* 是否主态
*/
private
Boolean
isMine
;
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/CollectionItemsRelationServiceImpl.java
View file @
e5928881
...
...
@@ -8,12 +8,13 @@ import com.wwdz.ch.core.type.Result;
import
com.wwdz.ch.core.util.MediaUtil
;
import
com.wwdz.ch.core.util.PriceUtil
;
import
com.wwdz.ch.db.dao.distribution.CollectionItemsRelationDao
;
import
com.wwdz.ch.db.dao.distribution.CollectionShareRecordDao
;
import
com.wwdz.ch.db.dao.distribution.ItemCollectedRecordDao
;
import
com.wwdz.ch.db.dao.distribution.SupplierItemDao
;
import
com.wwdz.ch.db.domain.distribution.CollectionBook
;
import
com.wwdz.ch.db.domain.distribution.CollectionItemsRelation
;
import
com.wwdz.ch.db.domain.distribution.SupplierItem
;
import
com.wwdz.ch.db.domain.distribution.*
;
import
com.wwdz.ch.db.dto.request.distribution.CollectionBookRequestDto
;
import
com.wwdz.ch.db.dto.request.distribution.CollectionItemsRelationRequestDto
;
import
com.wwdz.ch.db.dto.request.distribution.ItemCollectedRecordRequestDto
;
import
com.wwdz.ch.db.dto.request.distribution.SupplierItemRequestDto
;
import
com.wwdz.ch.wx.entity.vo.distribution.CollectionBookVo
;
import
com.wwdz.ch.wx.service.distribution.CollectionBookService
;
...
...
@@ -24,11 +25,9 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -46,6 +45,12 @@ public class CollectionItemsRelationServiceImpl implements CollectionItemsRelati
@Autowired
SupplierItemDao
supplierItemDao
;
@Autowired
CollectionShareRecordDao
collectionShareRecordDao
;
@Autowired
ItemCollectedRecordDao
itemCollectedRecordDao
;
@Override
public
Result
create
(
CollectionItemsRelationRequestDto
dto
)
{
try
{
...
...
@@ -69,22 +74,45 @@ public class CollectionItemsRelationServiceImpl implements CollectionItemsRelati
return
Result
.
failed
();
}
/**
* 查询个人藏馆页面信息
* @param dto
* @return
*/
@Override
public
Result
findInfos
(
CollectionItemsRelationRequestDto
dto
)
{
try
{
CollectionBookVo
collectionBookVo
=
new
CollectionBookVo
();
collectionBookVo
.
setIsMine
(
true
);
Long
searchUserId
=
dto
.
getUserId
();
//判断主态还是客态
if
(
StringUtils
.
hasLength
(
dto
.
getShareRecordId
()))
{
CollectionShareRecord
collectionShareRecord
=
collectionShareRecordDao
.
findById
(
dto
.
getShareRecordId
());
if
(
collectionShareRecord
.
getItemUserId
().
longValue
()
!=
dto
.
getUserId
().
longValue
())
{
collectionBookVo
.
setIsMine
(
false
);
searchUserId
=
collectionShareRecord
.
getItemUserId
();
}
}
//查询所有的标签
CollectionBookRequestDto
collectionBookRequestDto
=
new
CollectionBookRequestDto
();
collectionBookRequestDto
.
setUserId
(
dto
.
getUserId
()
);
collectionBookRequestDto
.
setUserId
(
searchUserId
);
Result
bookResult
=
collectionBookService
.
findList
(
collectionBookRequestDto
);
if
(
bookResult
.
getSuccess
())
{
List
<
Map
<
String
,
Object
>>
bookList
=
(
List
<
Map
<
String
,
Object
>>)
bookResult
.
getData
();
if
(
collectionBookVo
.
getIsMine
())
{
//是主态需要加上"我收藏的"这个默认标签,默认标签id为0
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"id"
,
0
);
map
.
put
(
"title"
,
"我收藏的"
);
bookList
.
add
(
0
,
map
);
}
collectionBookVo
.
setBookList
((
List
<
Map
<
String
,
Object
>>)
bookResult
.
getData
());
}
//查询所有的上传藏品
SupplierItemRequestDto
supplierItemRequestDto
=
new
SupplierItemRequestDto
();
supplierItemRequestDto
.
setType
(
DistributionEnum
.
DistributionTypeEnum
.
COLLECT
.
getCode
());
supplierItemRequestDto
.
setCreatorId
(
dto
.
getUserId
()
);
supplierItemRequestDto
.
setCreatorId
(
searchUserId
);
supplierItemRequestDto
.
setIsDeleted
(
false
);
List
<
SupplierItem
>
supplierItemList
=
supplierItemDao
.
findList
(
supplierItemRequestDto
);
List
<
SupplierItemVo
>
list
=
new
ArrayList
<>();
...
...
@@ -119,14 +147,31 @@ public class CollectionItemsRelationServiceImpl implements CollectionItemsRelati
supplierItemRequestDto
.
setIsDeleted
(
false
);
supplierItemList
=
supplierItemDao
.
findList
(
supplierItemRequestDto
);
pageInfo
=
new
PageInfo
<>(
supplierItemList
);
}
else
if
(
dto
.
getCollectionBookId
()
==
0
)
{
//0表示是"我收藏的"标签,则去查询收藏记录表
ItemCollectedRecordRequestDto
itemCollectedRecordRequestDto
=
new
ItemCollectedRecordRequestDto
();
itemCollectedRecordRequestDto
.
setPage
(
dto
.
getPage
());
itemCollectedRecordRequestDto
.
setLimit
(
dto
.
getLimit
());
itemCollectedRecordRequestDto
.
setCollectorsId
(
dto
.
getUserId
());
List
<
ItemCollectedRecord
>
itemCollectedRecordList
=
itemCollectedRecordDao
.
find
(
itemCollectedRecordRequestDto
);
pageInfo
=
new
PageInfo
<>(
itemCollectedRecordList
);
List
<
Long
>
itemIds
=
itemCollectedRecordList
.
stream
().
map
(
ItemCollectedRecord:
:
getItemId
).
collect
(
Collectors
.
toList
());
if
(!
CollectionUtils
.
isEmpty
(
itemIds
))
{
supplierItemRequestDto
.
setIds
(
itemIds
);
supplierItemRequestDto
.
setIsDeleted
(
false
);
supplierItemList
=
supplierItemDao
.
findList
(
supplierItemRequestDto
);
}
}
else
{
//查询对应标签下的商品
List
<
CollectionItemsRelation
>
collectionItemsRelationList
=
collectionItemsRelationDao
.
find
(
dto
);
pageInfo
=
new
PageInfo
<>(
collectionItemsRelationList
);
List
<
Long
>
itemIds
=
collectionItemsRelationList
.
stream
().
map
(
CollectionItemsRelation:
:
getItemId
).
collect
(
Collectors
.
toList
());
if
(!
CollectionUtils
.
isEmpty
(
itemIds
))
{
supplierItemRequestDto
.
setIds
(
itemIds
);
supplierItemRequestDto
.
setIsDeleted
(
false
);
supplierItemList
=
supplierItemDao
.
findList
(
supplierItemRequestDto
);
}
}
List
<
SupplierItemVo
>
list
=
new
ArrayList
<>();
supplierItemList
.
forEach
(
supplierItem
->
{
SupplierItemVo
supplierItemVo
=
new
SupplierItemVo
();
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/CollectionShareRecordServiceImpl.java
View file @
e5928881
...
...
@@ -39,7 +39,7 @@ public class CollectionShareRecordServiceImpl implements CollectionShareRecordSe
collectionShareRecordDao
.
insert
(
collectionShareRecord
);
return
Result
.
success
(
new
HashMap
<
String
,
String
>(){{
put
(
"shareId"
,
shareRecordId
);}});
}
catch
(
Exception
e
)
{
logger
.
error
(
"创建藏品分享链接失败 error: {}"
,
e
);
logger
.
error
(
"创建藏品
或藏馆
分享链接失败 error: {}"
,
e
);
}
return
Result
.
failed
();
}
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/ItemCollectedRecordServiceImpl.java
View file @
e5928881
...
...
@@ -30,6 +30,7 @@ public class ItemCollectedRecordServiceImpl implements ItemCollectedRecordServic
public
Result
createItemCollectedRecord
(
ItemCollectedRecordRequestDto
dto
)
{
try
{
ItemCollectedRecord
itemCollectedRecord
=
new
ItemCollectedRecord
();
EntityMapper
.
copyAttribute
(
dto
,
itemCollectedRecord
);
itemCollectedRecord
.
setIsDeleted
(
false
);
itemCollectedRecord
.
setCreateTime
(
new
Date
());
itemCollectedRecord
.
setUpdateTime
(
new
Date
());
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
View file @
e5928881
...
...
@@ -12,10 +12,7 @@ import com.wwdz.ch.db.dao.SwitchDao;
import
com.wwdz.ch.db.dao.distribution.*
;
import
com.wwdz.ch.db.domain.Switch
;
import
com.wwdz.ch.db.domain.distribution.*
;
import
com.wwdz.ch.db.dto.request.distribution.AuctionRecordRequestDto
;
import
com.wwdz.ch.db.dto.request.distribution.CollectionItemsRelationRequestDto
;
import
com.wwdz.ch.db.dto.request.distribution.DistributorShareRecordRequestDto
;
import
com.wwdz.ch.db.dto.request.distribution.SupplierItemRequestDto
;
import
com.wwdz.ch.db.dto.request.distribution.*
;
import
com.wwdz.ch.core.entity.SupplierItemVo
;
import
com.wwdz.ch.wx.entity.vo.distribution.AuctionDetailVo
;
import
com.wwdz.ch.wx.entity.vo.distribution.AuctionRecordRowVo
;
...
...
@@ -92,6 +89,9 @@ public class SupplierItemServiceImpl implements SupplierItemService {
@Autowired
ItemCollectedRecordDao
itemCollectedRecordDao
;
@Autowired
CollectionShareRecordDao
collectionShareRecordDao
;
@Override
public
Result
findList
(
SupplierItemRequestDto
dto
)
{
try
{
...
...
@@ -105,6 +105,7 @@ public class SupplierItemServiceImpl implements SupplierItemService {
supplierItemList
.
forEach
(
supplierItem
->
{
SupplierItemVo
supplierItemVo
=
new
SupplierItemVo
();
EntityMapper
.
copyAttribute
(
supplierItem
,
supplierItemVo
);
supplierItemVo
.
setItemId
(
supplierItem
.
getId
());
supplierItemVo
.
setSupplyPrice
(
PriceUtil
.
convertPriceFenToYuan
(
supplierItem
.
getSupplyPrice
()));
supplierItemVo
.
setDistributionPrice
(
PriceUtil
.
convertPriceFenToYuan
(
supplierItem
.
getDistributionPrice
()));
supplierItemVo
.
setHomePageImage
(
MediaUtil
.
getHomePageImage
(
supplierItem
.
getImages
(),
supplierItem
.
getVideos
()));
...
...
@@ -559,29 +560,80 @@ public class SupplierItemServiceImpl implements SupplierItemService {
try
{
SupplierItemVo
supplierItemVo
=
new
SupplierItemVo
();
long
userId
=
dto
.
getUserId
();
SupplierItem
supplierItem
=
supplierItemDao
.
findById
(
dto
.
getId
());
Long
itemId
=
null
;
CollectionShareRecord
collectionShareRecord
=
new
CollectionShareRecord
();
if
(
StringUtils
.
isEmpty
(
dto
.
getShareRecordId
()))
{
itemId
=
dto
.
getId
();
}
else
{
collectionShareRecord
=
collectionShareRecordDao
.
findById
(
dto
.
getShareRecordId
());
itemId
=
collectionShareRecord
.
getShareTargetId
();
}
SupplierItem
supplierItem
=
supplierItemDao
.
findById
(
itemId
);
if
(
supplierItem
.
getCreatorId
().
longValue
()
!=
userId
)
{
supplierItemVo
.
setIsMine
(
false
);
if
(
supplierItem
.
getIsDeleted
())
{
//判断是否有相关收藏记录,有则删除
if
(
itemCollectedRecordDao
.
isExisted
(
itemId
,
userId
))
{
itemCollectedRecordDao
.
cancel
(
itemId
,
userId
);
}
return
Result
.
failed
(
"该藏品已删除"
);
}
//如果是客态,需要记录浏览记录
if
(
StringUtils
.
hasLength
(
dto
.
getShareRecordId
()))
{
boolean
isExisted
=
userRecentBrowseDao
.
isExistedBySharedUserId
(
userId
,
collectionShareRecord
.
getItemUserId
());
if
(!
isExisted
)
{
UserRecentBrowse
userRecentBrowse
=
new
UserRecentBrowse
();
userRecentBrowse
.
setUserId
(
userId
);
userRecentBrowse
.
setSharerId
(
collectionShareRecord
.
getSharerId
());
userRecentBrowse
.
setCreateTime
(
new
Date
());
userRecentBrowse
.
setUpdateTime
(
new
Date
());
userRecentBrowse
.
setShareRecordId
(
dto
.
getShareRecordId
());
userRecentBrowse
.
setType
(
DistributionEnum
.
UserBrowseTypeEnum
.
USER_ITEM
.
getCode
());
userRecentBrowse
.
setSharedUserId
(
collectionShareRecord
.
getItemUserId
());
userRecentBrowseDao
.
insert
(
userRecentBrowse
);
}
}
}
else
{
supplierItemVo
.
setIsMine
(
true
);
//查询收藏该商品的最新的五个用户
ItemCollectedRecordRequestDto
itemCollectedRecordRequestDto
=
new
ItemCollectedRecordRequestDto
();
itemCollectedRecordRequestDto
.
setItemId
(
itemId
);
itemCollectedRecordRequestDto
.
setPage
(
1
);
itemCollectedRecordRequestDto
.
setLimit
(
5
);
List
<
ItemCollectedRecord
>
itemCollectedRecords
=
itemCollectedRecordDao
.
find
(
itemCollectedRecordRequestDto
);
List
<
Long
>
collectorIds
=
itemCollectedRecords
.
stream
().
map
(
ItemCollectedRecord:
:
getCollectorsId
).
collect
(
Collectors
.
toList
());
List
<
String
>
avatarList
=
new
ArrayList
<>();
for
(
Long
collectorId
:
collectorIds
)
{
avatarList
.
add
(
cacheUtil
.
getAppletUserById
(
collectorId
).
getAvatar
());
}
supplierItemVo
.
setCollectorsAvatar
(
avatarList
);
}
EntityMapper
.
copyAttribute
(
supplierItem
,
supplierItemVo
);
supplierItemVo
.
setItemId
(
supplierItem
.
getId
());
supplierItemVo
.
setDistributionPrice
(
PriceUtil
.
convertPriceFenToYuan
(
supplierItem
.
getDistributionPrice
()));
supplierItemVo
.
setHomePageImage
(
MediaUtil
.
getHomePageImage
(
supplierItem
.
getImages
(),
supplierItem
.
getVideos
()));
supplierItemVo
.
setCreatorName
(
cacheUtil
.
getAppletUserNameById
(
dto
.
getCreatorId
()));
supplierItemVo
.
setCreatorName
(
cacheUtil
.
getAppletUserNameById
(
supplierItem
.
getCreatorId
()));
supplierItemVo
.
setCreatorAvatar
(
cacheUtil
.
getAppletUserById
(
supplierItem
.
getCreatorId
()).
getAvatar
());
//查询藏品被收藏的次数
long
countNum
=
itemCollectedRecordDao
.
countByItemId
(
dto
.
getId
());
supplierItemVo
.
setCollectedNum
((
int
)
countNum
);
return
Result
.
success
(
supplierItemVo
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"查询上传的藏品详情 error : {}"
,
e
);
}
return
Result
.
failed
();
}
@Override
public
Result
delete
(
SupplierItemRequestDto
dto
)
{
try
{
supplierItemDao
.
delete
(
dto
.
getId
());
return
Result
.
success
();
}
catch
(
Exception
e
)
{
logger
.
error
(
"
查询藏品详情
error : {}"
,
e
);
logger
.
error
(
"
删除商品
error : {}"
,
e
);
}
return
Result
.
failed
();
}
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/distribution/SupplierItemService.java
View file @
e5928881
...
...
@@ -75,4 +75,11 @@ public interface SupplierItemService {
*/
Result
findCollectionItemDetail
(
SupplierItemRequestDto
dto
);
/**
* 删除商品
* @param dto
* @return
*/
Result
delete
(
SupplierItemRequestDto
dto
);
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/CollectionShareRecordController.java
0 → 100644
View file @
e5928881
package
com.wwdz.ch.wx.web.distribution
;
import
com.alibaba.fastjson.JSON
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.db.dto.request.distribution.CollectionShareRecordRequestDto
;
import
com.wwdz.ch.db.dto.request.distribution.ItemCollectedRecordRequestDto
;
import
com.wwdz.ch.wx.service.distribution.CollectionShareRecordService
;
import
com.wwdz.ch.wx.service.distribution.ItemCollectedRecordService
;
import
com.xxdxxs.service.FormHandler
;
import
com.xxdxxs.validation.Validator
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
(
"/wx/collectionShareRecord"
)
public
class
CollectionShareRecordController
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
CollectionShareRecordController
.
class
);
@Autowired
CollectionShareRecordService
collectionShareRecorService
;
@ApiOperation
(
value
=
"分享藏品或个人藏馆"
)
@PostMapping
(
"/createShareRecord"
)
public
Result
createShareRecord
(
@RequestBody
CollectionShareRecordRequestDto
dto
)
{
logger
.
info
(
"分享藏品或个人藏馆,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
validator
.
set
(
"sharerId"
,
"当前用户id"
).
must
().
number
()
.
set
(
"shareTargetId"
,
"分享的藏品或藏馆id"
).
must
().
number
()
.
set
(
"itemUserId"
,
"商品所属用户id"
).
must
().
number
()
.
set
(
"type"
,
"分享类型"
).
must
().
number
()
.
end
();
if
(!
validator
.
isValid
())
{
return
Result
.
failed
(
validator
.
getErrorInfo
());
}
return
collectionShareRecorService
.
createShareRecord
(
dto
);
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/ItemCollectedRecordController.java
0 → 100644
View file @
e5928881
package
com.wwdz.ch.wx.web.distribution
;
import
com.alibaba.fastjson.JSON
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.db.dto.request.distribution.ItemCollectedRecordRequestDto
;
import
com.wwdz.ch.wx.service.distribution.ItemCollectedRecordService
;
import
com.xxdxxs.service.FormHandler
;
import
com.xxdxxs.validation.Validator
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
(
"/wx/collectedRecord"
)
public
class
ItemCollectedRecordController
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ItemCollectedRecordController
.
class
);
@Autowired
ItemCollectedRecordService
itemCollectedRecordService
;
@ApiOperation
(
value
=
"收藏藏品"
)
@PostMapping
(
"/createItemCollectedRecord"
)
public
Result
createItemCollectedRecord
(
@RequestBody
ItemCollectedRecordRequestDto
dto
)
{
logger
.
info
(
"收藏藏品,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
validator
.
set
(
"collectorsId"
,
"用户id"
).
must
().
number
()
.
set
(
"itemId"
,
"商品id"
).
must
().
number
()
.
set
(
"itemUserId"
,
"商品所属用户id"
).
must
().
number
()
.
end
();
if
(!
validator
.
isValid
())
{
return
Result
.
failed
(
validator
.
getErrorInfo
());
}
return
itemCollectedRecordService
.
createItemCollectedRecord
(
dto
);
}
@ApiOperation
(
value
=
"取消收藏"
)
@PostMapping
(
"/cancel"
)
public
Result
cancel
(
@RequestBody
ItemCollectedRecordRequestDto
dto
)
{
logger
.
info
(
"取消收藏,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
validator
.
set
(
"collectorsId"
,
"用户id"
).
must
().
number
()
.
set
(
"itemId"
,
"商品id"
).
must
().
number
()
.
end
();
if
(!
validator
.
isValid
())
{
return
Result
.
failed
(
validator
.
getErrorInfo
());
}
return
itemCollectedRecordService
.
cancel
(
dto
);
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/SupplierItemController.java
View file @
e5928881
...
...
@@ -105,4 +105,30 @@ public class SupplierItemController {
}
return
supplierItemService
.
update
(
dto
);
}
@ApiOperation
(
value
=
"查询用户藏品详情"
)
@PostMapping
(
"/findCollectionItemDetail"
)
public
Result
findCollectionItemDetail
(
@RequestBody
SupplierItemRequestDto
dto
)
{
logger
.
info
(
"查询用户藏品详情,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
if
(
dto
.
getId
()
==
null
&&
StringUtils
.
isEmpty
(
dto
.
getShareRecordId
()))
{
return
Result
.
failed
(
ResultCode
.
PARAM_ERROR
);
}
if
(
dto
.
getUserId
()
==
null
)
{
return
Result
.
failed
(
"用户id不能为空"
);
}
return
supplierItemService
.
findCollectionItemDetail
(
dto
);
}
@ApiOperation
(
value
=
"删除用户藏品"
)
@PostMapping
(
"/deleteCollectionItem"
)
public
Result
deleteCollectionItem
(
@RequestBody
SupplierItemRequestDto
dto
)
{
logger
.
info
(
"删除用户藏品,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
if
(
dto
.
getId
()
==
null
)
{
return
Result
.
failed
(
ResultCode
.
PARAM_ERROR
);
}
return
supplierItemService
.
delete
(
dto
);
}
}
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