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
d6d0987c
Commit
d6d0987c
authored
Mar 21, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
个人藏馆
parent
3ee4cb6e
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
276 additions
and
79 deletions
+276
-79
ch-dao/src/main/java/com/wwdz/ch/db/dao/distribution/CollectionItemsRelationDao.java
...dz/ch/db/dao/distribution/CollectionItemsRelationDao.java
+2
-0
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/SupplierItem.java
...java/com/wwdz/ch/db/domain/distribution/SupplierItem.java
+6
-6
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/SupplierItemExample.java
...m/wwdz/ch/db/domain/distribution/SupplierItemExample.java
+36
-36
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/distribution/CollectionBookRequestDto.java
...db/dto/request/distribution/CollectionBookRequestDto.java
+3
-9
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/distribution/SupplierItemRequestDto.java
...h/db/dto/request/distribution/SupplierItemRequestDto.java
+4
-0
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/CollectionItemsRelationDaoImpl.java
.../db/impl/distribution/CollectionItemsRelationDaoImpl.java
+5
-0
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/distribution/SupplierItemMapper.xml
...com/wwdz/ch/db/mapper/distribution/SupplierItemMapper.xml
+19
-19
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
+4
-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
+16
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/CollectionBookServiceImpl.java
...dz/ch/wx/impl/distribution/CollectionBookServiceImpl.java
+14
-2
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/CollectionItemsRelationServiceImpl.java
...impl/distribution/CollectionItemsRelationServiceImpl.java
+96
-1
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
...wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
+2
-2
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/distribution/CollectionItemsRelationService.java
.../service/distribution/CollectionItemsRelationService.java
+16
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/CollectionBookController.java
...wwdz/ch/wx/web/distribution/CollectionBookController.java
+1
-2
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/CollectionItemsRelationController.java
...x/web/distribution/CollectionItemsRelationController.java
+51
-0
No files found.
ch-dao/src/main/java/com/wwdz/ch/db/dao/distribution/CollectionItemsRelationDao.java
View file @
d6d0987c
...
...
@@ -28,6 +28,8 @@ public interface CollectionItemsRelationDao {
*/
List
<
CollectionItemsRelation
>
findByItemId
(
long
itemId
);
boolean
isExisted
(
long
bookId
,
long
itemId
);
...
...
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/SupplierItem.java
View file @
d6d0987c
...
...
@@ -11,7 +11,7 @@ import lombok.Data;
/**
* @author shiyu
* @date 2024/03/2
0
* @date 2024/03/2
1
*/
@Data
public
class
SupplierItem
implements
Entity
{
...
...
@@ -90,7 +90,7 @@ public class SupplierItem implements Entity {
/**
* 用户id,非用户id的为系统账号
*/
private
Long
use
rId
;
private
Long
creato
rId
;
/**
* 商品图片,分号分隔
...
...
@@ -130,7 +130,7 @@ public class SupplierItem implements Entity {
sb
.
append
(
", buyLimitNum="
).
append
(
buyLimitNum
);
sb
.
append
(
", type="
).
append
(
type
);
sb
.
append
(
", rebate="
).
append
(
rebate
);
sb
.
append
(
",
userId="
).
append
(
use
rId
);
sb
.
append
(
",
creatorId="
).
append
(
creato
rId
);
sb
.
append
(
", images="
).
append
(
images
);
sb
.
append
(
", videos="
).
append
(
videos
);
sb
.
append
(
", description="
).
append
(
description
);
...
...
@@ -166,7 +166,7 @@ public class SupplierItem implements Entity {
&&
(
this
.
getBuyLimitNum
()
==
null
?
other
.
getBuyLimitNum
()
==
null
:
this
.
getBuyLimitNum
().
equals
(
other
.
getBuyLimitNum
()))
&&
(
this
.
getType
()
==
null
?
other
.
getType
()
==
null
:
this
.
getType
().
equals
(
other
.
getType
()))
&&
(
this
.
getRebate
()
==
null
?
other
.
getRebate
()
==
null
:
this
.
getRebate
().
equals
(
other
.
getRebate
()))
&&
(
this
.
get
UserId
()
==
null
?
other
.
getUserId
()
==
null
:
this
.
getUserId
().
equals
(
other
.
getUse
rId
()))
&&
(
this
.
get
CreatorId
()
==
null
?
other
.
getCreatorId
()
==
null
:
this
.
getCreatorId
().
equals
(
other
.
getCreato
rId
()))
&&
(
this
.
getImages
()
==
null
?
other
.
getImages
()
==
null
:
this
.
getImages
().
equals
(
other
.
getImages
()))
&&
(
this
.
getVideos
()
==
null
?
other
.
getVideos
()
==
null
:
this
.
getVideos
().
equals
(
other
.
getVideos
()))
&&
(
this
.
getDescription
()
==
null
?
other
.
getDescription
()
==
null
:
this
.
getDescription
().
equals
(
other
.
getDescription
()));
...
...
@@ -191,7 +191,7 @@ public class SupplierItem implements Entity {
result
=
prime
*
result
+
((
getBuyLimitNum
()
==
null
)
?
0
:
getBuyLimitNum
().
hashCode
());
result
=
prime
*
result
+
((
getType
()
==
null
)
?
0
:
getType
().
hashCode
());
result
=
prime
*
result
+
((
getRebate
()
==
null
)
?
0
:
getRebate
().
hashCode
());
result
=
prime
*
result
+
((
get
UserId
()
==
null
)
?
0
:
getUse
rId
().
hashCode
());
result
=
prime
*
result
+
((
get
CreatorId
()
==
null
)
?
0
:
getCreato
rId
().
hashCode
());
result
=
prime
*
result
+
((
getImages
()
==
null
)
?
0
:
getImages
().
hashCode
());
result
=
prime
*
result
+
((
getVideos
()
==
null
)
?
0
:
getVideos
().
hashCode
());
result
=
prime
*
result
+
((
getDescription
()
==
null
)
?
0
:
getDescription
().
hashCode
());
...
...
@@ -221,7 +221,7 @@ public class SupplierItem implements Entity {
buyLimitNum
(
"buy_limit_num"
,
"buyLimitNum"
,
"INTEGER"
,
false
),
type
(
"type"
,
"type"
,
"INTEGER"
,
true
),
rebate
(
"rebate"
,
"rebate"
,
"DECIMAL"
,
false
),
userId
(
"user_id"
,
"use
rId"
,
"BIGINT"
,
false
),
creatorId
(
"creator_id"
,
"creato
rId"
,
"BIGINT"
,
false
),
images
(
"images"
,
"images"
,
"LONGVARCHAR"
,
false
),
videos
(
"videos"
,
"videos"
,
"LONGVARCHAR"
,
false
),
description
(
"description"
,
"description"
,
"LONGVARCHAR"
,
false
);
...
...
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/SupplierItemExample.java
View file @
d6d0987c
...
...
@@ -2149,18 +2149,18 @@ public class SupplierItemExample {
return
(
Criteria
)
this
;
}
public
Criteria
and
Use
rIdIsNull
()
{
addCriterion
(
"
use
r_id is null"
);
public
Criteria
and
Creato
rIdIsNull
()
{
addCriterion
(
"
creato
r_id is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
Use
rIdIsNotNull
()
{
addCriterion
(
"
use
r_id is not null"
);
public
Criteria
and
Creato
rIdIsNotNull
()
{
addCriterion
(
"
creato
r_id is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
Use
rIdEqualTo
(
Long
value
)
{
addCriterion
(
"
user_id ="
,
value
,
"use
rId"
);
public
Criteria
and
Creato
rIdEqualTo
(
Long
value
)
{
addCriterion
(
"
creator_id ="
,
value
,
"creato
rId"
);
return
(
Criteria
)
this
;
}
...
...
@@ -2171,13 +2171,13 @@ public class SupplierItemExample {
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
and
Use
rIdEqualToColumn
(
SupplierItem
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"
use
r_id = "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
public
Criteria
and
Creato
rIdEqualToColumn
(
SupplierItem
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"
creato
r_id = "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
and
Use
rIdNotEqualTo
(
Long
value
)
{
addCriterion
(
"
user_id <>"
,
value
,
"use
rId"
);
public
Criteria
and
Creato
rIdNotEqualTo
(
Long
value
)
{
addCriterion
(
"
creator_id <>"
,
value
,
"creato
rId"
);
return
(
Criteria
)
this
;
}
...
...
@@ -2188,13 +2188,13 @@ public class SupplierItemExample {
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
and
Use
rIdNotEqualToColumn
(
SupplierItem
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"
use
r_id <> "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
public
Criteria
and
Creato
rIdNotEqualToColumn
(
SupplierItem
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"
creato
r_id <> "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
and
Use
rIdGreaterThan
(
Long
value
)
{
addCriterion
(
"
user_id >"
,
value
,
"use
rId"
);
public
Criteria
and
Creato
rIdGreaterThan
(
Long
value
)
{
addCriterion
(
"
creator_id >"
,
value
,
"creato
rId"
);
return
(
Criteria
)
this
;
}
...
...
@@ -2205,13 +2205,13 @@ public class SupplierItemExample {
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
and
Use
rIdGreaterThanColumn
(
SupplierItem
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"
use
r_id > "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
public
Criteria
and
Creato
rIdGreaterThanColumn
(
SupplierItem
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"
creato
r_id > "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
and
Use
rIdGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"
user_id >="
,
value
,
"use
rId"
);
public
Criteria
and
Creato
rIdGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"
creator_id >="
,
value
,
"creato
rId"
);
return
(
Criteria
)
this
;
}
...
...
@@ -2222,13 +2222,13 @@ public class SupplierItemExample {
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
and
Use
rIdGreaterThanOrEqualToColumn
(
SupplierItem
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"
use
r_id >= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
public
Criteria
and
Creato
rIdGreaterThanOrEqualToColumn
(
SupplierItem
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"
creato
r_id >= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
and
Use
rIdLessThan
(
Long
value
)
{
addCriterion
(
"
user_id <"
,
value
,
"use
rId"
);
public
Criteria
and
Creato
rIdLessThan
(
Long
value
)
{
addCriterion
(
"
creator_id <"
,
value
,
"creato
rId"
);
return
(
Criteria
)
this
;
}
...
...
@@ -2239,13 +2239,13 @@ public class SupplierItemExample {
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
and
Use
rIdLessThanColumn
(
SupplierItem
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"
use
r_id < "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
public
Criteria
and
Creato
rIdLessThanColumn
(
SupplierItem
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"
creato
r_id < "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
and
Use
rIdLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"
user_id <="
,
value
,
"use
rId"
);
public
Criteria
and
Creato
rIdLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"
creator_id <="
,
value
,
"creato
rId"
);
return
(
Criteria
)
this
;
}
...
...
@@ -2256,28 +2256,28 @@ public class SupplierItemExample {
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
and
Use
rIdLessThanOrEqualToColumn
(
SupplierItem
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"
use
r_id <= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
public
Criteria
and
Creato
rIdLessThanOrEqualToColumn
(
SupplierItem
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"
creato
r_id <= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
and
Use
rIdIn
(
List
<
Long
>
values
)
{
addCriterion
(
"
user_id in"
,
values
,
"use
rId"
);
public
Criteria
and
Creato
rIdIn
(
List
<
Long
>
values
)
{
addCriterion
(
"
creator_id in"
,
values
,
"creato
rId"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
Use
rIdNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"
user_id not in"
,
values
,
"use
rId"
);
public
Criteria
and
Creato
rIdNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"
creator_id not in"
,
values
,
"creato
rId"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
Use
rIdBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"
user_id between"
,
value1
,
value2
,
"use
rId"
);
public
Criteria
and
Creato
rIdBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"
creator_id between"
,
value1
,
value2
,
"creato
rId"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
Use
rIdNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"
user_id not between"
,
value1
,
value2
,
"use
rId"
);
public
Criteria
and
Creato
rIdNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"
creator_id not between"
,
value1
,
value2
,
"creato
rId"
);
return
(
Criteria
)
this
;
}
}
...
...
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/distribution/CollectionBookRequestDto.java
View file @
d6d0987c
...
...
@@ -8,6 +8,9 @@ import java.util.Date;
@Data
public
class
CollectionBookRequestDto
extends
BaseRequestDto
implements
Entity
{
/**
* 标签id
*/
private
Long
id
;
/**
...
...
@@ -20,11 +23,6 @@ public class CollectionBookRequestDto extends BaseRequestDto implements Entity
*/
private
String
title
;
/**
* 描述
*/
private
String
description
;
/**
* 排序
*/
...
...
@@ -45,9 +43,5 @@ public class CollectionBookRequestDto extends BaseRequestDto implements Entity
*/
private
Boolean
isDeleted
;
/**
* 收藏册图片,用;分隔
*/
private
String
images
;
}
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/distribution/SupplierItemRequestDto.java
View file @
d6d0987c
...
...
@@ -152,5 +152,9 @@ public class SupplierItemRequestDto extends BaseRequestDto implements Entity {
*/
private
String
collectionBookId
;
/**
* 上传人id
*/
private
Long
creatorId
;
}
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/CollectionItemsRelationDaoImpl.java
View file @
d6d0987c
package
com.wwdz.ch.db.impl.distribution
;
import
com.github.pagehelper.PageHelper
;
import
com.wwdz.ch.db.dao.distribution.CollectionItemsRelationDao
;
import
com.wwdz.ch.db.domain.distribution.CollectionItemsRelation
;
import
com.wwdz.ch.db.domain.distribution.CollectionItemsRelationExample
;
...
...
@@ -28,6 +29,9 @@ public class CollectionItemsRelationDaoImpl implements CollectionItemsRelationDa
JdbcHelper
.
ifPresent
(
dto
.
getUserId
(),
criteria:
:
andUserIdEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getCollectionBookId
(),
criteria:
:
andCollectionBookIdEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getItemId
(),
criteria:
:
andItemIdEqualTo
);
criteria
.
andIsDeletedEqualTo
(
false
);
example
.
setOrderByClause
(
"update_time desc"
);
PageHelper
.
startPage
(
dto
.
getPage
(),
dto
.
getLimit
());
return
collectionItemsRelationMapper
.
selectByExample
(
example
);
}
...
...
@@ -39,6 +43,7 @@ public class CollectionItemsRelationDaoImpl implements CollectionItemsRelationDa
return
collectionItemsRelationMapper
.
selectByExample
(
example
);
}
@Override
public
boolean
isExisted
(
long
bookId
,
long
itemId
)
{
CollectionItemsRelationExample
example
=
new
CollectionItemsRelationExample
();
...
...
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/distribution/SupplierItemMapper.xml
View file @
d6d0987c
...
...
@@ -17,7 +17,7 @@
<result
column=
"buy_limit_num"
jdbcType=
"INTEGER"
property=
"buyLimitNum"
/>
<result
column=
"type"
jdbcType=
"INTEGER"
property=
"type"
/>
<result
column=
"rebate"
jdbcType=
"DECIMAL"
property=
"rebate"
/>
<result
column=
"
user_id"
jdbcType=
"BIGINT"
property=
"use
rId"
/>
<result
column=
"
creator_id"
jdbcType=
"BIGINT"
property=
"creato
rId"
/>
</resultMap>
<resultMap
extends=
"BaseResultMap"
id=
"ResultMapWithBLOBs"
type=
"com.wwdz.ch.db.domain.distribution.SupplierItem"
>
<result
column=
"images"
jdbcType=
"LONGVARCHAR"
property=
"images"
/>
...
...
@@ -84,7 +84,7 @@
</sql>
<sql
id=
"Base_Column_List"
>
id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price,
stock, create_time, update_time, is_deleted, buy_limit_num, `type`, rebate,
use
r_id
stock, create_time, update_time, is_deleted, buy_limit_num, `type`, rebate,
creato
r_id
</sql>
<sql
id=
"Blob_Column_List"
>
images, videos, description
...
...
@@ -140,7 +140,7 @@
</when>
<otherwise>
id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price,
stock, create_time, update_time, is_deleted, buy_limit_num, `type`, rebate,
use
r_id,
stock, create_time, update_time, is_deleted, buy_limit_num, `type`, rebate,
creato
r_id,
images, videos, description
</otherwise>
</choose>
...
...
@@ -175,7 +175,7 @@
</when>
<otherwise>
id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price,
stock, create_time, update_time, is_deleted, buy_limit_num, `type`, rebate,
use
r_id,
stock, create_time, update_time, is_deleted, buy_limit_num, `type`, rebate,
creato
r_id,
images, videos, description
</otherwise>
</choose>
...
...
@@ -200,14 +200,14 @@
sort, top_image, distribution_price,
supply_price, stock, create_time,
update_time, is_deleted, buy_limit_num,
`type`, rebate,
use
r_id,
`type`, rebate,
creato
r_id,
images, videos, description
)
values (#{name,jdbcType=VARCHAR}, #{supplierId,jdbcType=BIGINT}, #{isOnSale,jdbcType=BIT},
#{sort,jdbcType=INTEGER}, #{topImage,jdbcType=VARCHAR}, #{distributionPrice,jdbcType=BIGINT},
#{supplyPrice,jdbcType=BIGINT}, #{stock,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{isDeleted,jdbcType=BIT}, #{buyLimitNum,jdbcType=INTEGER},
#{type,jdbcType=INTEGER}, #{rebate,jdbcType=DECIMAL}, #{
use
rId,jdbcType=BIGINT},
#{type,jdbcType=INTEGER}, #{rebate,jdbcType=DECIMAL}, #{
creato
rId,jdbcType=BIGINT},
#{images,jdbcType=LONGVARCHAR}, #{videos,jdbcType=LONGVARCHAR}, #{description,jdbcType=LONGVARCHAR}
)
</insert>
...
...
@@ -259,8 +259,8 @@
<if
test=
"rebate != null"
>
rebate,
</if>
<if
test=
"
use
rId != null"
>
use
r_id,
<if
test=
"
creato
rId != null"
>
creato
r_id,
</if>
<if
test=
"images != null"
>
images,
...
...
@@ -315,8 +315,8 @@
<if
test=
"rebate != null"
>
#{rebate,jdbcType=DECIMAL},
</if>
<if
test=
"
use
rId != null"
>
#{
use
rId,jdbcType=BIGINT},
<if
test=
"
creato
rId != null"
>
#{
creato
rId,jdbcType=BIGINT},
</if>
<if
test=
"images != null"
>
#{images,jdbcType=LONGVARCHAR},
...
...
@@ -383,8 +383,8 @@
<if
test=
"record.rebate != null"
>
rebate = #{record.rebate,jdbcType=DECIMAL},
</if>
<if
test=
"record.
use
rId != null"
>
user_id = #{record.use
rId,jdbcType=BIGINT},
<if
test=
"record.
creato
rId != null"
>
creator_id = #{record.creato
rId,jdbcType=BIGINT},
</if>
<if
test=
"record.images != null"
>
images = #{record.images,jdbcType=LONGVARCHAR},
...
...
@@ -417,7 +417,7 @@
buy_limit_num = #{record.buyLimitNum,jdbcType=INTEGER},
`type` = #{record.type,jdbcType=INTEGER},
rebate = #{record.rebate,jdbcType=DECIMAL},
user_id = #{record.use
rId,jdbcType=BIGINT},
creator_id = #{record.creato
rId,jdbcType=BIGINT},
images = #{record.images,jdbcType=LONGVARCHAR},
videos = #{record.videos,jdbcType=LONGVARCHAR},
description = #{record.description,jdbcType=LONGVARCHAR}
...
...
@@ -442,7 +442,7 @@
buy_limit_num = #{record.buyLimitNum,jdbcType=INTEGER},
`type` = #{record.type,jdbcType=INTEGER},
rebate = #{record.rebate,jdbcType=DECIMAL},
user_id = #{record.use
rId,jdbcType=BIGINT}
creator_id = #{record.creato
rId,jdbcType=BIGINT}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
...
...
@@ -492,8 +492,8 @@
<if
test=
"rebate != null"
>
rebate = #{rebate,jdbcType=DECIMAL},
</if>
<if
test=
"
use
rId != null"
>
user_id = #{use
rId,jdbcType=BIGINT},
<if
test=
"
creato
rId != null"
>
creator_id = #{creato
rId,jdbcType=BIGINT},
</if>
<if
test=
"images != null"
>
images = #{images,jdbcType=LONGVARCHAR},
...
...
@@ -523,7 +523,7 @@
buy_limit_num = #{buyLimitNum,jdbcType=INTEGER},
`type` = #{type,jdbcType=INTEGER},
rebate = #{rebate,jdbcType=DECIMAL},
user_id = #{use
rId,jdbcType=BIGINT},
creator_id = #{creato
rId,jdbcType=BIGINT},
images = #{images,jdbcType=LONGVARCHAR},
videos = #{videos,jdbcType=LONGVARCHAR},
description = #{description,jdbcType=LONGVARCHAR}
...
...
@@ -545,7 +545,7 @@
buy_limit_num = #{buyLimitNum,jdbcType=INTEGER},
`type` = #{type,jdbcType=INTEGER},
rebate = #{rebate,jdbcType=DECIMAL},
user_id = #{use
rId,jdbcType=BIGINT}
creator_id = #{creato
rId,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
<select
id=
"selectOneByExample"
parameterType=
"com.wwdz.ch.db.domain.distribution.SupplierItemExample"
resultMap=
"BaseResultMap"
>
...
...
@@ -602,7 +602,7 @@
</when>
<otherwise>
id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price,
stock, create_time, update_time, is_deleted, buy_limit_num, `type`, rebate,
use
r_id,
stock, create_time, update_time, is_deleted, buy_limit_num, `type`, rebate,
creato
r_id,
images, videos, description
</otherwise>
</choose>
...
...
ch-dao/src/main/resources/generatorConfig_new.xml
View file @
d6d0987c
...
...
@@ -72,7 +72,7 @@
<javaClientGenerator
type=
"XMLMAPPER"
targetPackage=
"com.wwdz.ch.db.mapper.distribution"
targetProject=
"ch-dao/src/main/java"
/>
<table
tableName=
"
collection_items_relation
"
enableCountByExample=
"true"
enableUpdateByExample=
"true"
enableDeleteByExample=
"true"
enableSelectByExample=
"true"
selectByExampleQueryId=
"true"
>
<table
tableName=
"
supplier_item
"
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 @
d6d0987c
...
...
@@ -45,7 +45,10 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
"/wx/returnOrder/**"
,
"/wx/distributionOrder/confirmSigned"
,
"/wx/distributionOrder/delivery"
,
"/wx/distributionOrder/cancel"
,
"/wx/distributionOrder/refund"
,
"/wx/supplierItem/findItemsOfCurrentDistributor"
,
"/wx/supplierItem/**"
,
"/wx/shareRecord/**"
,
"/wx/distributionOrder/**"
,
"/wx/selfPage/**"
,
"/wx/auctionRecord/**"
,
"/wx/shareRecord"
//下列路径上线注释
,
"/wx/supplierItem/**"
,
"/wx/shareRecord/**"
,
"/wx/distributionOrder/**"
,
"/wx/selfPage/**"
,
"/wx/auctionRecord/**"
,
"/wx/shareRecord/**"
,
"/wx/collectionBook/**"
/* "/wx/officialAccount/**",
"/wx/item/**",
"/wx/aiAssistant/**",
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/vo/distribution/CollectionBookVo.java
View file @
d6d0987c
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
;
import
java.util.List
;
import
java.util.Map
;
@Data
public
class
CollectionBookVo
implements
Entity
{
/**
* 标签
*/
private
List
<
Map
<
String
,
Object
>>
bookList
;
/**
* 上传的所有藏品
*/
private
PageSearchResult
pageSearchResult
;
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/CollectionBookServiceImpl.java
View file @
d6d0987c
...
...
@@ -3,8 +3,10 @@ package com.wwdz.ch.wx.impl.distribution;
import
com.github.pagehelper.PageInfo
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.db.dao.distribution.CollectionBookDao
;
import
com.wwdz.ch.db.dao.distribution.CollectionItemsRelationDao
;
import
com.wwdz.ch.db.domain.distribution.CollectionBook
;
import
com.wwdz.ch.db.dto.request.distribution.CollectionBookRequestDto
;
import
com.wwdz.ch.db.dto.request.distribution.CollectionItemsRelationRequestDto
;
import
com.wwdz.ch.wx.service.distribution.CollectionBookService
;
import
com.xxdxxs.utils.EntityMapper
;
import
org.slf4j.Logger
;
...
...
@@ -22,11 +24,15 @@ public class CollectionBookServiceImpl implements CollectionBookService {
@Autowired
CollectionBookDao
collectionBookDao
;
@Autowired
CollectionItemsRelationDao
collectionItemsRelationDao
;
@Override
public
Result
create
(
CollectionBookRequestDto
dto
)
{
try
{
CollectionBook
collectionBook
=
new
CollectionBook
();
EntityMapper
.
copyAttribute
(
dto
,
collectionBook
);
collectionBook
.
setSort
(
1
);
collectionBook
.
setCreateTime
(
new
Date
());
collectionBook
.
setUpdateTime
(
new
Date
());
collectionBook
.
setIsDeleted
(
false
);
...
...
@@ -42,12 +48,14 @@ public class CollectionBookServiceImpl implements CollectionBookService {
public
Result
findList
(
CollectionBookRequestDto
dto
)
{
try
{
List
<
CollectionBook
>
collectionBookList
=
collectionBookDao
.
findByUserId
(
dto
.
getUserId
());
Map
<
String
,
Object
>
map
=
new
LinkedHashMap
<>();
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
collectionBookList
.
forEach
(
collectionBook
->
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"id"
,
collectionBook
.
getId
());
map
.
put
(
"title"
,
collectionBook
.
getTitle
());
list
.
add
(
map
);
});
return
Result
.
success
(
map
);
return
Result
.
success
(
list
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"查询收藏册 error: {}"
,
e
);
}
...
...
@@ -59,6 +67,10 @@ public class CollectionBookServiceImpl implements CollectionBookService {
public
Result
delete
(
CollectionBookRequestDto
dto
)
{
try
{
collectionBookDao
.
delete
(
dto
.
getId
());
//删除标签关联的记录
CollectionItemsRelationRequestDto
collectionItemsRelationRequestDto
=
new
CollectionItemsRelationRequestDto
();
collectionItemsRelationRequestDto
.
setCollectionBookId
(
dto
.
getId
());
collectionItemsRelationDao
.
delete
(
collectionItemsRelationRequestDto
);
return
Result
.
success
();
}
catch
(
Exception
e
)
{
logger
.
error
(
"删除收藏册 error: {}"
,
e
);
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/CollectionItemsRelationServiceImpl.java
View file @
d6d0987c
package
com.wwdz.ch.wx.impl.distribution
;
import
com.github.pagehelper.PageInfo
;
import
com.wwdz.ch.core.consts.DistributionEnum
;
import
com.wwdz.ch.core.entity.SupplierItemVo
;
import
com.wwdz.ch.core.type.PageSearchResult
;
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.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.dto.request.distribution.CollectionBookRequestDto
;
import
com.wwdz.ch.db.dto.request.distribution.CollectionItemsRelationRequestDto
;
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
;
import
com.wwdz.ch.wx.service.distribution.CollectionItemsRelationService
;
import
com.xxdxxs.utils.EntityMapper
;
import
com.xxdxxs.utils.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@Service
...
...
@@ -23,6 +40,12 @@ public class CollectionItemsRelationServiceImpl implements CollectionItemsRelati
@Autowired
CollectionItemsRelationDao
collectionItemsRelationDao
;
@Autowired
CollectionBookService
collectionBookService
;
@Autowired
SupplierItemDao
supplierItemDao
;
@Override
public
Result
create
(
CollectionItemsRelationRequestDto
dto
)
{
try
{
...
...
@@ -41,10 +64,82 @@ public class CollectionItemsRelationServiceImpl implements CollectionItemsRelati
}
});
}
catch
(
Exception
e
)
{
logger
.
error
(
"查询收藏册 error: {}"
,
e
);
logger
.
error
(
"查询收藏册 error: {}"
,
e
);
}
return
Result
.
failed
();
}
@Override
public
Result
findInfos
(
CollectionItemsRelationRequestDto
dto
)
{
try
{
CollectionBookVo
collectionBookVo
=
new
CollectionBookVo
();
//查询所有的标签
CollectionBookRequestDto
collectionBookRequestDto
=
new
CollectionBookRequestDto
();
collectionBookRequestDto
.
setUserId
(
dto
.
getUserId
());
Result
bookResult
=
collectionBookService
.
findList
(
collectionBookRequestDto
);
if
(
bookResult
.
getSuccess
())
{
collectionBookVo
.
setBookList
((
List
<
Map
<
String
,
Object
>>)
bookResult
.
getData
());
}
//查询所有的上传藏品
SupplierItemRequestDto
supplierItemRequestDto
=
new
SupplierItemRequestDto
();
supplierItemRequestDto
.
setType
(
DistributionEnum
.
DistributionTypeEnum
.
COLLECT
.
getCode
());
supplierItemRequestDto
.
setCreatorId
(
dto
.
getUserId
());
supplierItemRequestDto
.
setIsDeleted
(
false
);
List
<
SupplierItem
>
supplierItemList
=
supplierItemDao
.
findList
(
supplierItemRequestDto
);
List
<
SupplierItemVo
>
list
=
new
ArrayList
<>();
PageInfo
<
SupplierItem
>
pageInfo
=
new
PageInfo
<>(
supplierItemList
);
supplierItemList
.
forEach
(
supplierItem
->
{
SupplierItemVo
supplierItemVo
=
new
SupplierItemVo
();
EntityMapper
.
copyAttribute
(
supplierItem
,
supplierItemVo
);
supplierItemVo
.
setDistributionPrice
(
PriceUtil
.
convertPriceFenToYuan
(
supplierItem
.
getDistributionPrice
()));
supplierItemVo
.
setHomePageImage
(
MediaUtil
.
getHomePageImage
(
supplierItem
.
getImages
(),
supplierItem
.
getVideos
()));
list
.
add
(
supplierItemVo
);
});
collectionBookVo
.
setPageSearchResult
(
PageSearchResult
.
of
(
pageInfo
,
list
));
return
Result
.
success
(
collectionBookVo
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"查询个人藏馆信息失败 error: {}"
,
e
);
}
return
Result
.
failed
();
}
@Override
public
Result
findList
(
CollectionItemsRelationRequestDto
dto
)
{
try
{
CollectionBookVo
collectionBookVo
=
new
CollectionBookVo
();
SupplierItemRequestDto
supplierItemRequestDto
=
new
SupplierItemRequestDto
();
List
<
SupplierItem
>
supplierItemList
=
new
ArrayList
<>();
PageInfo
pageInfo
=
null
;
//标签id为空则查询所有的藏品
if
(
dto
.
getCollectionBookId
()
==
null
)
{
//查询所有的上传藏品
supplierItemRequestDto
.
setType
(
DistributionEnum
.
DistributionTypeEnum
.
COLLECT
.
getCode
());
supplierItemRequestDto
.
setCreatorId
(
dto
.
getUserId
());
supplierItemRequestDto
.
setIsDeleted
(
false
);
supplierItemList
=
supplierItemDao
.
findList
(
supplierItemRequestDto
);
pageInfo
=
new
PageInfo
<>(
supplierItemList
);
}
else
{
//查询对应标签下的商品
List
<
CollectionItemsRelation
>
collectionItemsRelationList
=
collectionItemsRelationDao
.
find
(
dto
);
pageInfo
=
new
PageInfo
<>(
collectionItemsRelationList
);
List
<
Long
>
itemIds
=
collectionItemsRelationList
.
stream
().
map
(
CollectionItemsRelation:
:
getItemId
).
collect
(
Collectors
.
toList
());
supplierItemRequestDto
.
setIds
(
itemIds
);
supplierItemList
=
supplierItemDao
.
findList
(
supplierItemRequestDto
);
}
List
<
SupplierItemVo
>
list
=
new
ArrayList
<>();
supplierItemList
.
forEach
(
supplierItem
->
{
SupplierItemVo
supplierItemVo
=
new
SupplierItemVo
();
EntityMapper
.
copyAttribute
(
supplierItem
,
supplierItemVo
);
supplierItemVo
.
setDistributionPrice
(
PriceUtil
.
convertPriceFenToYuan
(
supplierItem
.
getDistributionPrice
()));
supplierItemVo
.
setHomePageImage
(
MediaUtil
.
getHomePageImage
(
supplierItem
.
getImages
(),
supplierItem
.
getVideos
()));
list
.
add
(
supplierItemVo
);
});
collectionBookVo
.
setPageSearchResult
(
PageSearchResult
.
of
(
pageInfo
,
list
));
return
Result
.
success
(
collectionBookVo
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"查询标签下的藏品失败 error: {}"
,
e
);
}
return
Result
.
failed
();
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
View file @
d6d0987c
...
...
@@ -473,7 +473,7 @@ public class SupplierItemServiceImpl implements SupplierItemService {
EntityMapper
.
copyAttribute
(
dto
,
supplierItem
);
supplierItem
.
setDistributionPrice
(
PriceUtil
.
convertPriceFromStr
(
StringUtils
.
isEmpty
(
dto
.
getDistributionPrice
())?
"0"
:
dto
.
getDistributionPrice
()));
supplierItem
.
setSupplyPrice
(
0L
);
supplierItem
.
setRebate
(
new
BigDecimal
(
dto
.
getRebate
()
));
supplierItem
.
setRebate
(
new
BigDecimal
(
"0"
));
supplierItem
.
setImages
(
dto
.
getImages
());
supplierItem
.
setVideos
(
dto
.
getVideos
());
supplierItem
.
setSort
(
1
);
...
...
@@ -484,7 +484,7 @@ public class SupplierItemServiceImpl implements SupplierItemService {
supplierItem
.
setUpdateTime
(
now
);
supplierItem
.
setIsOnSale
(
true
);
supplierItem
.
setIsDeleted
(
false
);
supplierItem
.
set
Use
rId
(
dto
.
getUserId
());
supplierItem
.
set
Creato
rId
(
dto
.
getUserId
());
supplierItem
.
setType
(
DistributionEnum
.
DistributionTypeEnum
.
COLLECT
.
getCode
());
long
itemId
=
supplierItemDao
.
insert
(
supplierItem
);
//商品对应收藏册关联
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/distribution/CollectionItemsRelationService.java
View file @
d6d0987c
...
...
@@ -12,4 +12,20 @@ public interface CollectionItemsRelationService {
* @return
*/
Result
create
(
CollectionItemsRelationRequestDto
dto
);
/**
* 查询个人藏馆页面信息
* @param dto
* @return
*/
Result
findInfos
(
CollectionItemsRelationRequestDto
dto
);
/**
* 查询对应标签下的藏品
* @param dto
* @return
*/
Result
findList
(
CollectionItemsRelationRequestDto
dto
);
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/CollectionBookController.java
View file @
d6d0987c
...
...
@@ -3,7 +3,6 @@ package com.wwdz.ch.wx.web.distribution;
import
com.alibaba.fastjson.JSON
;
import
com.wwdz.ch.core.consts.ResultCode
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.db.dto.request.distribution.AuctionRecordRequestDto
;
import
com.wwdz.ch.db.dto.request.distribution.CollectionBookRequestDto
;
import
com.wwdz.ch.wx.service.distribution.CollectionBookService
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -50,7 +49,7 @@ public class CollectionBookController {
@PostMapping
(
"/delete"
)
public
Result
delete
(
@RequestBody
CollectionBookRequestDto
dto
)
{
logger
.
info
(
"删除藏品标签,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
if
(
dto
.
get
User
Id
()
==
null
)
{
if
(
dto
.
getId
()
==
null
)
{
return
Result
.
failed
(
ResultCode
.
PARAM_ERROR
);
}
return
collectionBookService
.
delete
(
dto
);
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/CollectionItemsRelationController.java
0 → 100644
View file @
d6d0987c
package
com.wwdz.ch.wx.web.distribution
;
import
com.alibaba.fastjson.JSON
;
import
com.wwdz.ch.core.consts.ResultCode
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.db.dto.request.distribution.CollectionBookRequestDto
;
import
com.wwdz.ch.db.dto.request.distribution.CollectionItemsRelationRequestDto
;
import
com.wwdz.ch.wx.service.distribution.CollectionBookService
;
import
com.wwdz.ch.wx.service.distribution.CollectionItemsRelationService
;
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/collectionItemsRelation"
)
public
class
CollectionItemsRelationController
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
CollectionItemsRelationController
.
class
);
@Autowired
CollectionItemsRelationService
collectionItemsRelationService
;
@ApiOperation
(
value
=
"查询个人藏馆页面信息"
)
@PostMapping
(
"/findInfos"
)
public
Result
findInfos
(
@RequestBody
CollectionItemsRelationRequestDto
dto
)
{
logger
.
info
(
"查询标签下的藏品,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
if
(
dto
.
getUserId
()
==
null
)
{
return
Result
.
failed
(
ResultCode
.
PARAM_ERROR
);
}
return
collectionItemsRelationService
.
findInfos
(
dto
);
}
@ApiOperation
(
value
=
"查询标签下的藏品"
)
@PostMapping
(
"/findList"
)
public
Result
findList
(
@RequestBody
CollectionItemsRelationRequestDto
dto
)
{
logger
.
info
(
"查询标签下的藏品,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
if
(
dto
.
getUserId
()
==
null
)
{
return
Result
.
failed
(
ResultCode
.
PARAM_ERROR
);
}
return
collectionItemsRelationService
.
findList
(
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