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
3c897d11
Commit
3c897d11
authored
Mar 27, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改标签
parent
5730b15f
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
84 additions
and
9 deletions
+84
-9
ch-dao/src/main/java/com/wwdz/ch/db/dao/distribution/CollectionBookDao.java
...va/com/wwdz/ch/db/dao/distribution/CollectionBookDao.java
+9
-0
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/CollectionBookDaoImpl.java
...m/wwdz/ch/db/impl/distribution/CollectionBookDaoImpl.java
+6
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/request/SelfPageRequestDto.java
...ava/com/wwdz/ch/wx/entity/request/SelfPageRequestDto.java
+13
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/CollectionBookServiceImpl.java
...dz/ch/wx/impl/distribution/CollectionBookServiceImpl.java
+19
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SelfPageServiceImpl.java
...com/wwdz/ch/wx/impl/distribution/SelfPageServiceImpl.java
+15
-5
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/distribution/CollectionBookService.java
...wdz/ch/wx/service/distribution/CollectionBookService.java
+8
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/CollectionBookController.java
...wwdz/ch/wx/web/distribution/CollectionBookController.java
+10
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/SelfPageController.java
...a/com/wwdz/ch/wx/web/distribution/SelfPageController.java
+0
-1
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/SupplierItemController.java
...m/wwdz/ch/wx/web/distribution/SupplierItemController.java
+1
-0
ch-wx-api/src/test/java/com/wwdz/ch/wx/api/WxPayServiceTest.java
...pi/src/test/java/com/wwdz/ch/wx/api/WxPayServiceTest.java
+3
-3
No files found.
ch-dao/src/main/java/com/wwdz/ch/db/dao/distribution/CollectionBookDao.java
View file @
3c897d11
...
@@ -15,6 +15,15 @@ public interface CollectionBookDao {
...
@@ -15,6 +15,15 @@ public interface CollectionBookDao {
*/
*/
int
insert
(
CollectionBook
collectionBook
);
int
insert
(
CollectionBook
collectionBook
);
/**
* 更新记录
*
* @param collectionBook
* @return
*/
int
update
(
CollectionBook
collectionBook
);
/**
/**
* 查询记录
* 查询记录
* @param dto
* @param dto
...
...
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/CollectionBookDaoImpl.java
View file @
3c897d11
...
@@ -24,6 +24,12 @@ public class CollectionBookDaoImpl implements CollectionBookDao {
...
@@ -24,6 +24,12 @@ public class CollectionBookDaoImpl implements CollectionBookDao {
return
collectionBookMapper
.
insert
(
collectionBook
);
return
collectionBookMapper
.
insert
(
collectionBook
);
}
}
@Override
public
int
update
(
CollectionBook
collectionBook
)
{
return
collectionBookMapper
.
updateByPrimaryKeySelective
(
collectionBook
);
}
@Override
@Override
public
List
<
CollectionBook
>
find
(
CollectionBookRequestDto
dto
)
{
public
List
<
CollectionBook
>
find
(
CollectionBookRequestDto
dto
)
{
CollectionBookExample
example
=
new
CollectionBookExample
();
CollectionBookExample
example
=
new
CollectionBookExample
();
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/request/SelfPageRequestDto.java
View file @
3c897d11
...
@@ -6,7 +6,20 @@ import lombok.Data;
...
@@ -6,7 +6,20 @@ import lombok.Data;
@Data
@Data
public
class
SelfPageRequestDto
implements
Entity
{
public
class
SelfPageRequestDto
implements
Entity
{
/**
* 要查看的用户id
*/
private
Long
targetUserId
;
/**
* 发起请求的用户id
*/
private
Long
userId
;
private
Long
userId
;
private
String
shareRecordId
;
private
String
shareRecordId
;
/**
* 是否主态
*/
private
Boolean
isMine
;
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/CollectionBookServiceImpl.java
View file @
3c897d11
...
@@ -52,6 +52,25 @@ public class CollectionBookServiceImpl implements CollectionBookService {
...
@@ -52,6 +52,25 @@ public class CollectionBookServiceImpl implements CollectionBookService {
return
Result
.
failed
();
return
Result
.
failed
();
}
}
@Override
public
Result
update
(
CollectionBookRequestDto
dto
)
{
try
{
if
(
collectionBookDao
.
isExisted
(
dto
.
getUserId
(),
dto
.
getTitle
()))
{
return
Result
.
failed
(
"标签名称已存在"
);
}
CollectionBook
collectionBook
=
new
CollectionBook
();
collectionBook
.
setId
(
dto
.
getId
());
collectionBook
.
setTitle
(
dto
.
getTitle
());
collectionBook
.
setUpdateTime
(
new
Date
());
collectionBookDao
.
update
(
collectionBook
);
return
Result
.
success
();
}
catch
(
Exception
e
)
{
logger
.
error
(
"修改收藏册 error: {}"
,
e
);
}
return
Result
.
failed
();
}
@Override
@Override
public
Result
findList
(
CollectionBookRequestDto
dto
)
{
public
Result
findList
(
CollectionBookRequestDto
dto
)
{
try
{
try
{
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SelfPageServiceImpl.java
View file @
3c897d11
...
@@ -155,12 +155,22 @@ public class SelfPageServiceImpl implements SelfPageService {
...
@@ -155,12 +155,22 @@ public class SelfPageServiceImpl implements SelfPageService {
public
Result
checkIsMine
(
SelfPageRequestDto
dto
)
{
public
Result
checkIsMine
(
SelfPageRequestDto
dto
)
{
try
{
try
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
CollectionShareRecord
collectionShareRecord
=
collectionShareRecordDao
.
findById
(
dto
.
getShareRecordId
());
Long
itemUserId
;
long
itemUserId
=
collectionShareRecord
.
getItemUserId
();
if
(
dto
.
getTargetUserId
()
!=
null
)
{
if
(
itemUserId
!=
dto
.
getUserId
())
{
itemUserId
=
dto
.
getTargetUserId
();
map
.
put
(
"isMine"
,
false
);
if
(
itemUserId
.
longValue
()
!=
dto
.
getUserId
())
{
map
.
put
(
"isMine"
,
false
);
}
else
{
map
.
put
(
"isMine"
,
true
);
}
}
else
{
}
else
{
map
.
put
(
"isMine"
,
true
);
CollectionShareRecord
collectionShareRecord
=
collectionShareRecordDao
.
findById
(
dto
.
getShareRecordId
());
itemUserId
=
collectionShareRecord
.
getItemUserId
();
if
(
itemUserId
!=
dto
.
getUserId
())
{
map
.
put
(
"isMine"
,
false
);
}
else
{
map
.
put
(
"isMine"
,
true
);
}
}
}
User
user
=
cacheUtil
.
getAppletUserById
(
itemUserId
);
User
user
=
cacheUtil
.
getAppletUserById
(
itemUserId
);
map
.
put
(
"avatar"
,
StringUtils
.
isEmpty
(
user
.
getAvatar
())
?
CommConsts
.
DEFAULT_AVATAR_URL
:
user
.
getAvatar
());
map
.
put
(
"avatar"
,
StringUtils
.
isEmpty
(
user
.
getAvatar
())
?
CommConsts
.
DEFAULT_AVATAR_URL
:
user
.
getAvatar
());
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/distribution/CollectionBookService.java
View file @
3c897d11
...
@@ -13,6 +13,14 @@ public interface CollectionBookService {
...
@@ -13,6 +13,14 @@ public interface CollectionBookService {
*/
*/
Result
create
(
CollectionBookRequestDto
dto
);
Result
create
(
CollectionBookRequestDto
dto
);
/**
* 编辑收藏册
* @param dto
* @return
*/
Result
update
(
CollectionBookRequestDto
dto
);
/**
/**
* 查询收藏册
* 查询收藏册
* @param dto
* @param dto
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/CollectionBookController.java
View file @
3c897d11
...
@@ -33,6 +33,16 @@ public class CollectionBookController {
...
@@ -33,6 +33,16 @@ public class CollectionBookController {
return
collectionBookService
.
create
(
dto
);
return
collectionBookService
.
create
(
dto
);
}
}
@ApiOperation
(
value
=
"编辑藏品标签"
)
@PostMapping
(
"/update"
)
public
Result
update
(
@RequestBody
CollectionBookRequestDto
dto
)
{
logger
.
info
(
"编辑藏品标签,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
if
(
dto
.
getId
()
==
null
||
dto
.
getUserId
()
==
null
)
{
return
Result
.
failed
(
ResultCode
.
PARAM_ERROR
);
}
return
collectionBookService
.
update
(
dto
);
}
@ApiOperation
(
value
=
"查询藏品标签"
)
@ApiOperation
(
value
=
"查询藏品标签"
)
@PostMapping
(
"/findList"
)
@PostMapping
(
"/findList"
)
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/SelfPageController.java
View file @
3c897d11
...
@@ -77,7 +77,6 @@ public class SelfPageController {
...
@@ -77,7 +77,6 @@ public class SelfPageController {
logger
.
info
(
"分销商查询自己购买的订单信息,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
logger
.
info
(
"分销商查询自己购买的订单信息,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
validator
.
set
(
"userId"
,
"用户id"
).
must
().
number
()
validator
.
set
(
"userId"
,
"用户id"
).
must
().
number
()
.
set
(
"shareRecordId"
,
"分享记录id"
).
must
().
string
()
.
end
();
.
end
();
if
(!
validator
.
isValid
())
{
if
(!
validator
.
isValid
())
{
return
Result
.
failed
(
validator
.
getErrorInfo
());
return
Result
.
failed
(
validator
.
getErrorInfo
());
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/SupplierItemController.java
View file @
3c897d11
...
@@ -88,6 +88,7 @@ public class SupplierItemController {
...
@@ -88,6 +88,7 @@ public class SupplierItemController {
logger
.
info
(
"上传藏品,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
logger
.
info
(
"上传藏品,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
validator
.
set
(
"name"
,
"商品名称"
).
must
().
string
()
validator
.
set
(
"name"
,
"商品名称"
).
must
().
string
()
.
set
(
"images"
,
"图片"
).
must
().
string
()
.
end
();
.
end
();
if
(!
validator
.
isValid
())
{
if
(!
validator
.
isValid
())
{
return
Result
.
failed
(
validator
.
getErrorInfo
());
return
Result
.
failed
(
validator
.
getErrorInfo
());
...
...
ch-wx-api/src/test/java/com/wwdz/ch/wx/api/WxPayServiceTest.java
View file @
3c897d11
...
@@ -89,12 +89,12 @@ public class WxPayServiceTest {
...
@@ -89,12 +89,12 @@ public class WxPayServiceTest {
@Test
@Test
public
void
refund
()
{
public
void
refund
()
{
List
<
String
>
list
=
Arrays
.
asList
(
"DA2403
111801535237724
"
);
List
<
String
>
list
=
Arrays
.
asList
(
"DA2403
261800370990846
"
);
list
.
forEach
(
orderId
->{
list
.
forEach
(
orderId
->{
DistributionOrderRequestDto
dto
=
new
DistributionOrderRequestDto
();
DistributionOrderRequestDto
dto
=
new
DistributionOrderRequestDto
();
dto
.
setDistributionOrderId
(
orderId
);
dto
.
setDistributionOrderId
(
orderId
);
dto
.
setAmount
(
"
3
.0"
);
dto
.
setAmount
(
"
1
.0"
);
dto
.
setRefundPrice
(
"
3
.0"
);
dto
.
setRefundPrice
(
"
1
.0"
);
Result
result
=
wxPayServiceApi
.
refund
(
dto
);
Result
result
=
wxPayServiceApi
.
refund
(
dto
);
logger
.
info
(
"申请微信支付退款:{}"
,
result
);
logger
.
info
(
"申请微信支付退款:{}"
,
result
);
});
});
...
...
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