Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ufo
/
yohoufo-fore
·
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
Plain Diff
Browse Files
Authored by
tanling
5 years ago
Commit
0ec2af14959112c2006d2dcf66600c90ad3f0af1
2 parents
eab5093d
288815c1
Merge branch 'test6.9.17' of
http://git.yoho.cn/ufo/yohoufo-fore
into test6.9.17
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
30 deletions
product/src/main/java/com/yohoufo/product/controller/ProductController.java
product/src/main/java/com/yohoufo/product/service/ProductService.java
product/src/main/java/com/yohoufo/product/service/impl/ProductServiceImpl.java
product/src/main/java/com/yohoufo/product/controller/ProductController.java
View file @
0ec2af1
package
com
.
yohoufo
.
product
.
controller
;
import
java.lang.reflect.Method
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.servlet.ModelAndView
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.common.collect.Lists
;
import
com.yoho.core.config.ConfigReader
;
...
...
@@ -14,10 +34,9 @@ import com.yohobuy.ufo.model.request.StoragePriceBo;
import
com.yohobuy.ufo.model.request.product.ProductImportTranItemBo
;
import
com.yohobuy.ufo.model.request.product.ProductRequestBo
;
import
com.yohobuy.ufo.model.response.ProductDetailResp
;
import
com.yohobuy.ufo.model.response.StorageCheckResp
;
import
com.yohobuy.ufo.model.response.StorageDataResp
;
import
com.yohobuy.ufo.model.response.StorageInfoResp
;
import
com.yohobuy.ufo.model.response.StorageCheckResp
;
import
com.yohoufo.common.ApiResponse
;
import
com.yohoufo.common.annotation.IgnoreSession
;
import
com.yohoufo.common.annotation.IgnoreSignature
;
...
...
@@ -27,27 +46,18 @@ import com.yohoufo.common.caller.UfoServiceCaller;
import
com.yohoufo.dal.product.model.StoragePrice
;
import
com.yohoufo.product.constants.ProductConstants
;
import
com.yohoufo.product.model.SkupInfo
;
import
com.yohoufo.product.response.*
;
import
com.yohoufo.product.response.ProductSeriesTemplateResp
;
import
com.yohoufo.product.response.ProductSimpleResp
;
import
com.yohoufo.product.response.ProductSortTemplateResp
;
import
com.yohoufo.product.response.SaleCategoryBo
;
import
com.yohoufo.product.response.SecondHandProductResp
;
import
com.yohoufo.product.response.SkupDetailForScreenResp
;
import
com.yohoufo.product.response.StorageLeastPriceResp
;
import
com.yohoufo.product.service.ProductService
;
import
com.yohoufo.product.service.impl.ProductBatchService
;
import
com.yohoufo.product.service.impl.ProductPoolService
;
import
com.yohoufo.product.service.impl.SeekToBuyStorageService
;
import
com.yohoufo.product.service.impl.StoragePriceService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.servlet.ModelAndView
;
import
java.lang.reflect.Method
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@RestController
public
class
ProductController
{
...
...
@@ -1004,14 +1014,15 @@ public class ProductController {
@ApiOperation
(
name
=
"ufo.product.sizeImage"
,
desc
=
"查询尺码图片"
)
@RequestMapping
(
params
=
"method=ufo.product.sizeImage"
)
public
ApiResponse
getSizeImage
(
@RequestParam
(
value
=
"product_id"
)
Integer
productId
)
{
if
(
null
==
productId
)
{
LOG
.
info
(
"in method=ufo.product.sizeImage product_id Is Null or empty"
);
return
new
ApiResponse
(
400
,
"product_id Is Null or empty"
,
null
);
public
ApiResponse
getSizeImage
(
@RequestParam
(
value
=
"product_id"
)
Integer
productId
,
@RequestParam
(
value
=
"brand_id"
)
Integer
brandId
)
{
if
(
null
==
productId
||
null
==
brandId
)
{
LOG
.
info
(
"in method=ufo.product.sizeImage product_id and brand_id is Null or empty"
);
return
new
ApiResponse
(
400
,
"product_id and brand_id is Null or empty"
,
null
);
}
LOG
.
info
(
"in method=ufo.product.sizeImage product_id is {}"
,
productId
);
String
result
=
productService
.
getSizeImage
(
productId
);
String
result
=
productService
.
getSizeImage
(
productId
,
brandId
);
return
new
ApiResponse
.
ApiResponseBuilder
().
code
(
200
).
data
(
result
).
message
(
"getSizeImage success"
).
build
();
}
}
\ No newline at end of file
...
...
product/src/main/java/com/yohoufo/product/service/ProductService.java
View file @
0ec2af1
...
...
@@ -155,5 +155,5 @@ public interface ProductService {
*/
ProductDetailResp
queryProductDetail3ById
(
Integer
productId
);
String
getSizeImage
(
Integer
productId
);
String
getSizeImage
(
Integer
productId
,
Integer
brandId
);
}
...
...
product/src/main/java/com/yohoufo/product/service/impl/ProductServiceImpl.java
View file @
0ec2af1
...
...
@@ -1957,14 +1957,10 @@ public class ProductServiceImpl implements ProductService {
}
@Override
public
String
getSizeImage
(
Integer
productId
)
{
Product
product
=
productMapper
.
selectByPrimaryKey
(
productId
);
if
(
null
==
product
)
{
return
StringUtils
.
EMPTY
;
}
public
String
getSizeImage
(
Integer
productId
,
Integer
brandId
)
{
List
<
SizePoolDetail
>
list
=
sizePoolDetailMapper
.
queryByProductId
(
productId
);
if
(
CollectionUtils
.
isEmpty
(
list
))
{
list
=
sizePoolDetailMapper
.
queryByBrandId
(
product
.
getBrandId
()
);
list
=
sizePoolDetailMapper
.
queryByBrandId
(
brandId
);
}
if
(
CollectionUtils
.
isEmpty
(
list
))
{
...
...
Please
register
or
login
to post a comment