Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
f692b26e
Commit
f692b26e
authored
Feb 10, 2020
by
Junling Bu
Browse files
Merge branch 'yinggang' of
https://github.com/sunyinggang/litemall-1
into sunyinggang-yinggang
parents
73c938eb
4bbe33d7
Changes
10
Hide whitespace changes
Inline
Side-by-side
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/service/AdminOrderService.java
View file @
f692b26e
...
@@ -229,7 +229,7 @@ public class AdminOrderService {
...
@@ -229,7 +229,7 @@ public class AdminOrderService {
return
ResponseUtil
.
badArgument
();
return
ResponseUtil
.
badArgument
();
}
}
// 目前只支持回复一次
// 目前只支持回复一次
if
(
commentService
.
findById
(
commentId
)
!=
null
)
{
if
(
commentService
.
findById
(
commentId
)
.
getAdminContent
().
length
()
!=
0
)
{
return
ResponseUtil
.
fail
(
ORDER_REPLY_EXIST
,
"订单商品已回复!"
);
return
ResponseUtil
.
fail
(
ORDER_REPLY_EXIST
,
"订单商品已回复!"
);
}
}
String
content
=
JacksonUtil
.
parseString
(
body
,
"content"
);
String
content
=
JacksonUtil
.
parseString
(
body
,
"content"
);
...
@@ -238,14 +238,9 @@ public class AdminOrderService {
...
@@ -238,14 +238,9 @@ public class AdminOrderService {
}
}
// 创建评价回复
// 创建评价回复
LitemallComment
comment
=
new
LitemallComment
();
LitemallComment
comment
=
new
LitemallComment
();
comment
.
setType
((
byte
)
2
);
comment
.
setId
(
commentId
);
comment
.
setValueId
(
commentId
);
comment
.
setAdminContent
(
content
);
comment
.
setContent
(
content
);
commentService
.
updateById
(
comment
);
comment
.
setUserId
(
0
);
// 评价回复没有用
comment
.
setStar
((
short
)
0
);
// 评价回复没有用
comment
.
setHasPicture
(
false
);
// 评价回复没有用
comment
.
setPicUrls
(
new
String
[]{});
// 评价回复没有用
commentService
.
save
(
comment
);
return
ResponseUtil
.
ok
();
return
ResponseUtil
.
ok
();
}
}
...
...
litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallComment.java
View file @
f692b26e
...
@@ -57,6 +57,15 @@ public class LitemallComment {
...
@@ -57,6 +57,15 @@ public class LitemallComment {
*/
*/
private
String
content
;
private
String
content
;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_comment.admin_content
*
* @mbg.generated
*/
private
String
adminContent
;
/**
/**
*
*
* This field was generated by MyBatis Generator.
* This field was generated by MyBatis Generator.
...
@@ -216,6 +225,30 @@ public class LitemallComment {
...
@@ -216,6 +225,30 @@ public class LitemallComment {
this
.
content
=
content
;
this
.
content
=
content
;
}
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_comment.admin_content
*
* @return the value of litemall_comment.admin_content
*
* @mbg.generated
*/
public
String
getAdminContent
()
{
return
adminContent
;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_comment.admin_content
*
* @param adminContent the value for litemall_comment.admin_content
*
* @mbg.generated
*/
public
void
setAdminContent
(
String
adminContent
)
{
this
.
adminContent
=
adminContent
;
}
/**
/**
* This method was generated by MyBatis Generator.
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_comment.user_id
* This method returns the value of the database column litemall_comment.user_id
...
@@ -412,6 +445,7 @@ public class LitemallComment {
...
@@ -412,6 +445,7 @@ public class LitemallComment {
sb
.
append
(
", valueId="
).
append
(
valueId
);
sb
.
append
(
", valueId="
).
append
(
valueId
);
sb
.
append
(
", type="
).
append
(
type
);
sb
.
append
(
", type="
).
append
(
type
);
sb
.
append
(
", content="
).
append
(
content
);
sb
.
append
(
", content="
).
append
(
content
);
sb
.
append
(
", adminContent="
).
append
(
adminContent
);
sb
.
append
(
", userId="
).
append
(
userId
);
sb
.
append
(
", userId="
).
append
(
userId
);
sb
.
append
(
", hasPicture="
).
append
(
hasPicture
);
sb
.
append
(
", hasPicture="
).
append
(
hasPicture
);
sb
.
append
(
", picUrls="
).
append
(
picUrls
);
sb
.
append
(
", picUrls="
).
append
(
picUrls
);
...
@@ -445,6 +479,7 @@ public class LitemallComment {
...
@@ -445,6 +479,7 @@ public class LitemallComment {
&&
(
this
.
getValueId
()
==
null
?
other
.
getValueId
()
==
null
:
this
.
getValueId
().
equals
(
other
.
getValueId
()))
&&
(
this
.
getValueId
()
==
null
?
other
.
getValueId
()
==
null
:
this
.
getValueId
().
equals
(
other
.
getValueId
()))
&&
(
this
.
getType
()
==
null
?
other
.
getType
()
==
null
:
this
.
getType
().
equals
(
other
.
getType
()))
&&
(
this
.
getType
()
==
null
?
other
.
getType
()
==
null
:
this
.
getType
().
equals
(
other
.
getType
()))
&&
(
this
.
getContent
()
==
null
?
other
.
getContent
()
==
null
:
this
.
getContent
().
equals
(
other
.
getContent
()))
&&
(
this
.
getContent
()
==
null
?
other
.
getContent
()
==
null
:
this
.
getContent
().
equals
(
other
.
getContent
()))
&&
(
this
.
getAdminContent
()
==
null
?
other
.
getAdminContent
()
==
null
:
this
.
getAdminContent
().
equals
(
other
.
getAdminContent
()))
&&
(
this
.
getUserId
()
==
null
?
other
.
getUserId
()
==
null
:
this
.
getUserId
().
equals
(
other
.
getUserId
()))
&&
(
this
.
getUserId
()
==
null
?
other
.
getUserId
()
==
null
:
this
.
getUserId
().
equals
(
other
.
getUserId
()))
&&
(
this
.
getHasPicture
()
==
null
?
other
.
getHasPicture
()
==
null
:
this
.
getHasPicture
().
equals
(
other
.
getHasPicture
()))
&&
(
this
.
getHasPicture
()
==
null
?
other
.
getHasPicture
()
==
null
:
this
.
getHasPicture
().
equals
(
other
.
getHasPicture
()))
&&
(
Arrays
.
equals
(
this
.
getPicUrls
(),
other
.
getPicUrls
()))
&&
(
Arrays
.
equals
(
this
.
getPicUrls
(),
other
.
getPicUrls
()))
...
@@ -468,6 +503,7 @@ public class LitemallComment {
...
@@ -468,6 +503,7 @@ public class LitemallComment {
result
=
prime
*
result
+
((
getValueId
()
==
null
)
?
0
:
getValueId
().
hashCode
());
result
=
prime
*
result
+
((
getValueId
()
==
null
)
?
0
:
getValueId
().
hashCode
());
result
=
prime
*
result
+
((
getType
()
==
null
)
?
0
:
getType
().
hashCode
());
result
=
prime
*
result
+
((
getType
()
==
null
)
?
0
:
getType
().
hashCode
());
result
=
prime
*
result
+
((
getContent
()
==
null
)
?
0
:
getContent
().
hashCode
());
result
=
prime
*
result
+
((
getContent
()
==
null
)
?
0
:
getContent
().
hashCode
());
result
=
prime
*
result
+
((
getAdminContent
()
==
null
)
?
0
:
getAdminContent
().
hashCode
());
result
=
prime
*
result
+
((
getUserId
()
==
null
)
?
0
:
getUserId
().
hashCode
());
result
=
prime
*
result
+
((
getUserId
()
==
null
)
?
0
:
getUserId
().
hashCode
());
result
=
prime
*
result
+
((
getHasPicture
()
==
null
)
?
0
:
getHasPicture
().
hashCode
());
result
=
prime
*
result
+
((
getHasPicture
()
==
null
)
?
0
:
getHasPicture
().
hashCode
());
result
=
prime
*
result
+
(
Arrays
.
hashCode
(
getPicUrls
()));
result
=
prime
*
result
+
(
Arrays
.
hashCode
(
getPicUrls
()));
...
@@ -557,6 +593,7 @@ public class LitemallComment {
...
@@ -557,6 +593,7 @@ public class LitemallComment {
valueId
(
"value_id"
,
"valueId"
,
"INTEGER"
,
false
),
valueId
(
"value_id"
,
"valueId"
,
"INTEGER"
,
false
),
type
(
"type"
,
"type"
,
"TINYINT"
,
true
),
type
(
"type"
,
"type"
,
"TINYINT"
,
true
),
content
(
"content"
,
"content"
,
"VARCHAR"
,
false
),
content
(
"content"
,
"content"
,
"VARCHAR"
,
false
),
adminContent
(
"admin_content"
,
"adminContent"
,
"VARCHAR"
,
false
),
userId
(
"user_id"
,
"userId"
,
"INTEGER"
,
false
),
userId
(
"user_id"
,
"userId"
,
"INTEGER"
,
false
),
hasPicture
(
"has_picture"
,
"hasPicture"
,
"BIT"
,
false
),
hasPicture
(
"has_picture"
,
"hasPicture"
,
"BIT"
,
false
),
picUrls
(
"pic_urls"
,
"picUrls"
,
"VARCHAR"
,
false
),
picUrls
(
"pic_urls"
,
"picUrls"
,
"VARCHAR"
,
false
),
...
...
litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallCommentService.java
View file @
f692b26e
...
@@ -97,4 +97,8 @@ public class LitemallCommentService {
...
@@ -97,4 +97,8 @@ public class LitemallCommentService {
public
LitemallComment
findById
(
Integer
id
)
{
public
LitemallComment
findById
(
Integer
id
)
{
return
commentMapper
.
selectByPrimaryKey
(
id
);
return
commentMapper
.
selectByPrimaryKey
(
id
);
}
}
public
int
updateById
(
LitemallComment
comment
)
{
return
commentMapper
.
updateByPrimaryKeySelective
(
comment
);
}
}
}
litemall-db/src/main/resources/org/linlinjava/litemall/db/dao/LitemallCommentMapper.xml
View file @
f692b26e
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
<result
column=
"value_id"
jdbcType=
"INTEGER"
property=
"valueId"
/>
<result
column=
"value_id"
jdbcType=
"INTEGER"
property=
"valueId"
/>
<result
column=
"type"
jdbcType=
"TINYINT"
property=
"type"
/>
<result
column=
"type"
jdbcType=
"TINYINT"
property=
"type"
/>
<result
column=
"content"
jdbcType=
"VARCHAR"
property=
"content"
/>
<result
column=
"content"
jdbcType=
"VARCHAR"
property=
"content"
/>
<result
column=
"admin_content"
jdbcType=
"VARCHAR"
property=
"adminContent"
/>
<result
column=
"user_id"
jdbcType=
"INTEGER"
property=
"userId"
/>
<result
column=
"user_id"
jdbcType=
"INTEGER"
property=
"userId"
/>
<result
column=
"has_picture"
jdbcType=
"BIT"
property=
"hasPicture"
/>
<result
column=
"has_picture"
jdbcType=
"BIT"
property=
"hasPicture"
/>
<result
column=
"pic_urls"
jdbcType=
"VARCHAR"
property=
"picUrls"
typeHandler=
"org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler"
/>
<result
column=
"pic_urls"
jdbcType=
"VARCHAR"
property=
"picUrls"
typeHandler=
"org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler"
/>
...
@@ -127,7 +128,7 @@
...
@@ -127,7 +128,7 @@
WARNING - @mbg.generated
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element is automatically generated by MyBatis Generator, do not modify.
-->
-->
id, value_id, `type`, content, user_id, has_picture, pic_urls, star, add_time, update_time,
id, value_id, `type`, content,
admin_content,
user_id, has_picture, pic_urls, star, add_time, update_time,
deleted
deleted
</sql>
</sql>
<select
id=
"selectByExample"
parameterType=
"org.linlinjava.litemall.db.domain.LitemallCommentExample"
resultMap=
"BaseResultMap"
>
<select
id=
"selectByExample"
parameterType=
"org.linlinjava.litemall.db.domain.LitemallCommentExample"
resultMap=
"BaseResultMap"
>
...
@@ -249,11 +250,11 @@
...
@@ -249,11 +250,11 @@
<selectKey
keyProperty=
"id"
order=
"AFTER"
resultType=
"java.lang.Integer"
>
<selectKey
keyProperty=
"id"
order=
"AFTER"
resultType=
"java.lang.Integer"
>
SELECT LAST_INSERT_ID()
SELECT LAST_INSERT_ID()
</selectKey>
</selectKey>
insert into litemall_comment (value_id, `type`, content,
insert into litemall_comment (value_id, `type`, content,
admin_content,
user_id, has_picture, pic_urls,
user_id, has_picture, pic_urls,
star, add_time, update_time,
star, add_time, update_time,
deleted)
deleted)
values (#{valueId,jdbcType=INTEGER}, #{type,jdbcType=TINYINT}, #{content,jdbcType=VARCHAR},
values (#{valueId,jdbcType=INTEGER}, #{type,jdbcType=TINYINT}, #{content,jdbcType=VARCHAR},
#{adminContent,jdbcType=VARCHAR},
#{userId,jdbcType=INTEGER}, #{hasPicture,jdbcType=BIT}, #{picUrls,jdbcType=VARCHAR,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler},
#{userId,jdbcType=INTEGER}, #{hasPicture,jdbcType=BIT}, #{picUrls,jdbcType=VARCHAR,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler},
#{star,jdbcType=SMALLINT}, #{addTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{star,jdbcType=SMALLINT}, #{addTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{deleted,jdbcType=BIT})
#{deleted,jdbcType=BIT})
...
@@ -277,6 +278,9 @@
...
@@ -277,6 +278,9 @@
<if
test=
"content != null"
>
<if
test=
"content != null"
>
content,
content,
</if>
</if>
<if
test=
"adminContent != null"
>
admin_content,
</if>
<if
test=
"userId != null"
>
<if
test=
"userId != null"
>
user_id,
user_id,
</if>
</if>
...
@@ -361,6 +365,9 @@
...
@@ -361,6 +365,9 @@
<if
test=
"record.content != null"
>
<if
test=
"record.content != null"
>
content = #{record.content,jdbcType=VARCHAR},
content = #{record.content,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"record.adminContent != null"
>
admin_content = #{record.adminContent,jdbcType=VARCHAR},
</if>
<if
test=
"record.userId != null"
>
<if
test=
"record.userId != null"
>
user_id = #{record.userId,jdbcType=INTEGER},
user_id = #{record.userId,jdbcType=INTEGER},
</if>
</if>
...
@@ -397,6 +404,7 @@
...
@@ -397,6 +404,7 @@
value_id = #{record.valueId,jdbcType=INTEGER},
value_id = #{record.valueId,jdbcType=INTEGER},
`type` = #{record.type,jdbcType=TINYINT},
`type` = #{record.type,jdbcType=TINYINT},
content = #{record.content,jdbcType=VARCHAR},
content = #{record.content,jdbcType=VARCHAR},
admin_content = #{record.adminContent,jdbcType=VARCHAR},
user_id = #{record.userId,jdbcType=INTEGER},
user_id = #{record.userId,jdbcType=INTEGER},
has_picture = #{record.hasPicture,jdbcType=BIT},
has_picture = #{record.hasPicture,jdbcType=BIT},
pic_urls = #{record.picUrls,jdbcType=VARCHAR,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler},
pic_urls = #{record.picUrls,jdbcType=VARCHAR,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler},
...
@@ -424,6 +432,9 @@
...
@@ -424,6 +432,9 @@
<if
test=
"content != null"
>
<if
test=
"content != null"
>
content = #{content,jdbcType=VARCHAR},
content = #{content,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"adminContent != null"
>
admin_content = #{adminContent,jdbcType=VARCHAR},
</if>
<if
test=
"userId != null"
>
<if
test=
"userId != null"
>
user_id = #{userId,jdbcType=INTEGER},
user_id = #{userId,jdbcType=INTEGER},
</if>
</if>
...
@@ -457,6 +468,7 @@
...
@@ -457,6 +468,7 @@
set value_id = #{valueId,jdbcType=INTEGER},
set value_id = #{valueId,jdbcType=INTEGER},
`type` = #{type,jdbcType=TINYINT},
`type` = #{type,jdbcType=TINYINT},
content = #{content,jdbcType=VARCHAR},
content = #{content,jdbcType=VARCHAR},
admin_content = #{adminContent,jdbcType=VARCHAR},
user_id = #{userId,jdbcType=INTEGER},
user_id = #{userId,jdbcType=INTEGER},
has_picture = #{hasPicture,jdbcType=BIT},
has_picture = #{hasPicture,jdbcType=BIT},
pic_urls = #{picUrls,jdbcType=VARCHAR,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler},
pic_urls = #{picUrls,jdbcType=VARCHAR,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler},
...
...
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCommentController.java
View file @
f692b26e
...
@@ -141,6 +141,7 @@ public class WxCommentController {
...
@@ -141,6 +141,7 @@ public class WxCommentController {
Map
<
String
,
Object
>
commentVo
=
new
HashMap
<>();
Map
<
String
,
Object
>
commentVo
=
new
HashMap
<>();
commentVo
.
put
(
"addTime"
,
comment
.
getAddTime
());
commentVo
.
put
(
"addTime"
,
comment
.
getAddTime
());
commentVo
.
put
(
"content"
,
comment
.
getContent
());
commentVo
.
put
(
"content"
,
comment
.
getContent
());
commentVo
.
put
(
"adminContent"
,
comment
.
getAdminContent
());
commentVo
.
put
(
"picList"
,
comment
.
getPicUrls
());
commentVo
.
put
(
"picList"
,
comment
.
getPicUrls
());
UserInfo
userInfo
=
userInfoService
.
getInfo
(
comment
.
getUserId
());
UserInfo
userInfo
=
userInfoService
.
getInfo
(
comment
.
getUserId
());
...
...
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxGoodsController.java
View file @
f692b26e
...
@@ -128,6 +128,7 @@ public class WxGoodsController {
...
@@ -128,6 +128,7 @@ public class WxGoodsController {
c
.
put
(
"id"
,
comment
.
getId
());
c
.
put
(
"id"
,
comment
.
getId
());
c
.
put
(
"addTime"
,
comment
.
getAddTime
());
c
.
put
(
"addTime"
,
comment
.
getAddTime
());
c
.
put
(
"content"
,
comment
.
getContent
());
c
.
put
(
"content"
,
comment
.
getContent
());
c
.
put
(
"adminContent"
,
comment
.
getAdminContent
());
LitemallUser
user
=
userService
.
findById
(
comment
.
getUserId
());
LitemallUser
user
=
userService
.
findById
(
comment
.
getUserId
());
c
.
put
(
"nickname"
,
user
==
null
?
""
:
user
.
getNickname
());
c
.
put
(
"nickname"
,
user
==
null
?
""
:
user
.
getNickname
());
c
.
put
(
"avatar"
,
user
==
null
?
""
:
user
.
getAvatar
());
c
.
put
(
"avatar"
,
user
==
null
?
""
:
user
.
getAvatar
());
...
...
litemall-wx/pages/comment/comment.wxml
View file @
f692b26e
...
@@ -20,9 +20,9 @@
...
@@ -20,9 +20,9 @@
<view class="imgs" wx:if="{{item.picList.length > 0}}">
<view class="imgs" wx:if="{{item.picList.length > 0}}">
<image class="img" wx:for="{{item.picList}}" wx:key="*this" wx:for-item="pitem" src="{{pitem}}"></image>
<image class="img" wx:for="{{item.picList}}" wx:key="*this" wx:for-item="pitem" src="{{pitem}}"></image>
</view>
</view>
<view class="customer-service" wx:if="{{item.
reply
}}">
<view class="customer-service" wx:if="{{item.
adminContent
}}">
<text class="u">
小商场
回复:</text>
<text class="u">
商家
回复:</text>
<text class="c">{{item.
reply
}}</text>
<text class="c">{{item.
adminContent
}}</text>
</view>
</view>
</view>
</view>
...
...
litemall-wx/pages/goods/goods.wxml
View file @
f692b26e
...
@@ -75,6 +75,10 @@
...
@@ -75,6 +75,10 @@
<view class="imgs" wx:if="{{item.picList.length > 0}}">
<view class="imgs" wx:if="{{item.picList.length > 0}}">
<image class="img" wx:for="{{item.picList}}" wx:key="*this" wx:for-item="iitem" src="{{iitem}} "></image>
<image class="img" wx:for="{{item.picList}}" wx:key="*this" wx:for-item="iitem" src="{{iitem}} "></image>
</view>
</view>
<view class="customer-service" wx:if="{{item.adminContent}}">
<text class="u">商家回复:</text>
<text class="c">{{item.adminContent}}</text>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
...
...
litemall-wx/pages/goods/goods.wxss
View file @
f692b26e
...
@@ -321,6 +321,27 @@
...
@@ -321,6 +321,27 @@
margin-bottom: 30rpx;
margin-bottom: 30rpx;
}
}
.comments .customer-service {
width: 690rpx;
height: auto;
overflow: hidden;
margin-top: 23rpx;
background: rgba(0, 0, 0, 0.03);
padding: 21rpx;
}
.comments .customer-service .u {
font-size: 24rpx;
color: #333;
line-height: 37.5rpx;
}
.comments .customer-service .c {
font-size: 24rpx;
color: #999;
line-height: 37.5rpx;
}
.goods-attr {
.goods-attr {
width: 750rpx;
width: 750rpx;
height: auto;
height: auto;
...
...
litemall-wx/project.config.json
View file @
f692b26e
...
@@ -21,8 +21,8 @@
...
@@ -21,8 +21,8 @@
},
},
"compileType"
:
"miniprogram"
,
"compileType"
:
"miniprogram"
,
"libVersion"
:
"2.4.0"
,
"libVersion"
:
"2.4.0"
,
"appid"
:
"wx
a5b486c6b918ecfb
"
,
"appid"
:
"wx
1cd22d00f1fac673
"
,
"projectname"
:
"litemall-wx"
,
"projectname"
:
"litemall-wx
-l
"
,
"simulatorType"
:
"wechat"
,
"simulatorType"
:
"wechat"
,
"simulatorPluginLibVersion"
:
{},
"simulatorPluginLibVersion"
:
{},
"condition"
:
{
"condition"
:
{
...
...
Write
Preview
Supports
Markdown
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