Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ufo
/
ufo-platform
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
mali
7 years ago
Commit
29ecdf90f495649a3fe7514e57761e2778e8bbb6
1 parent
2832dd87
根据品类查询其尺码的集合
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
0 deletions
dal/src/main/java/com/yoho/ufo/dal/UfoSizeMapper.java
dal/src/main/resources/META-INF/mybatis/UfoSizeMapper.xml
product/src/main/java/com/yoho/ufo/controller/commoditybasicrules/size/SizeController.java
product/src/main/java/com/yoho/ufo/service/ISizeService.java
product/src/main/java/com/yoho/ufo/service/impl/SizeServiceImpl.java
dal/src/main/java/com/yoho/ufo/dal/UfoSizeMapper.java
View file @
29ecdf9
...
...
@@ -56,4 +56,11 @@ public interface UfoSizeMapper {
* @return
*/
List
<
Size
>
getSizePageList
(
@Param
(
"size"
)
Size
size
,
@Param
(
"page"
)
PageModel
pageModel
);
/**
* 根据品类查询所有的尺码
* @param sortId
* @return
*/
List
<
Size
>
selectAllSizeBySortId
(
@Param
(
"sortId"
)
Integer
sortId
);
}
...
...
dal/src/main/resources/META-INF/mybatis/UfoSizeMapper.xml
View file @
29ecdf9
...
...
@@ -78,4 +78,9 @@
limit #{page.startIndex}, #{page.pageSize}
</select>
<select
id=
"selectAllSizeBySortId"
resultMap=
"sizeMap"
>
select
<include
refid=
"queryColumns"
/>
from size where sort_id = #{sortId}
</select>
</mapper>
\ No newline at end of file
...
...
product/src/main/java/com/yoho/ufo/controller/commoditybasicrules/size/SizeController.java
View file @
29ecdf9
...
...
@@ -49,4 +49,10 @@ public class SizeController {
LOGGER
.
info
(
"getSizePageList param = {}"
,
sizeRequestBo
);
return
new
ApiResponse
<>(
sizeService
.
getSizePageList
(
sizeRequestBo
));
}
@RequestMapping
(
value
=
"/queryAllSize4Goods"
,
method
=
RequestMethod
.
GET
)
public
ApiResponse
<
Object
>
queryAllSize4Goods
(
Integer
sortId
)
{
LOGGER
.
info
(
"queryAllSize4Goods method in."
);
return
new
ApiResponse
<>(
sizeService
.
queryAllSize4Goods
(
sortId
));
}
}
...
...
product/src/main/java/com/yoho/ufo/service/ISizeService.java
View file @
29ecdf9
package
com
.
yoho
.
ufo
.
service
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yohobuy.ufo.model.common.PageResponseBO
;
import
com.yohobuy.ufo.model.request.productcolor.ProductColorRequestBo
;
import
com.yohobuy.ufo.model.request.productcolor.ProductColorResponsetBo
;
import
com.yohobuy.ufo.model.request.size.SizeRequestBo
;
import
com.yohobuy.ufo.model.request.size.SizeResponseBo
;
import
java.util.List
;
/**
* 品类接口
* @author kun.wang
...
...
@@ -34,4 +37,9 @@ public interface ISizeService {
*/
PageResponseBO
<
SizeResponseBo
>
getSizePageList
(
SizeRequestBo
sizeRequestBo
);
/**
* 查询所有的颜色,下拉框使用
* @return
*/
List
<
JSONObject
>
queryAllSize4Goods
(
Integer
sortId
);
}
...
...
product/src/main/java/com/yoho/ufo/service/impl/SizeServiceImpl.java
View file @
29ecdf9
package
com
.
yoho
.
ufo
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yoho.core.common.utils.DateUtil
;
import
com.yoho.ufo.dal.UfoSizeMapper
;
import
com.yoho.ufo.model.brand.BrandSeries
;
import
com.yoho.ufo.model.commoditybasicrole.size.Size
;
import
com.yoho.ufo.service.ISizeService
;
import
com.yoho.ufo.util.OrikaUtils
;
...
...
@@ -14,6 +16,7 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
...
...
@@ -64,4 +67,22 @@ public class SizeServiceImpl implements ISizeService {
List
<
SizeResponseBo
>
responseBos
=
OrikaUtils
.
mapToList
(
sizeList
,
SizeResponseBo
.
class
);
return
new
PageResponseBO
<>(
count
,
responseBos
,
pageModel
.
getCurrentPage
(),
pageModel
.
getPageSize
());
}
/**
* 查询所有的颜色,下拉框使用
* @return
*/
public
List
<
JSONObject
>
queryAllSize4Goods
(
Integer
sortId
)
{
// TODO 可以添加缓存
List
<
Size
>
sizes
=
ufoSizeMapper
.
selectAllSizeBySortId
(
sortId
);
List
<
JSONObject
>
result
=
new
ArrayList
<>();
JSONObject
jsonObject
;
for
(
Size
item
:
sizes
)
{
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"id"
,
item
.
getId
());
jsonObject
.
put
(
"text"
,
item
.
getSizeName
());
result
.
add
(
jsonObject
);
}
return
result
;
}
}
...
...
Please
register
or
login
to post a comment