|  |  |  | 
|---|
|  |  |  | package com.matrix.system.shopXcx.api.action; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.matrix.core.pojo.AjaxResult; | 
|---|
|  |  |  | import com.matrix.core.tools.StringUtils; | 
|---|
|  |  |  | import com.matrix.system.common.constance.AppConstance; | 
|---|
|  |  |  | import com.matrix.system.common.interceptor.HostInterceptor; | 
|---|
|  |  |  | import com.matrix.system.shopXcx.api.dto.SaleProductDto; | 
|---|
|  |  |  | import com.matrix.system.shopXcx.api.dto.ScoreProductDto; | 
|---|
|  |  |  | import com.matrix.system.shopXcx.bean.ShopProduct; | 
|---|
|  |  |  | import com.matrix.system.shopXcx.bean.ShopProductAttribute; | 
|---|
|  |  |  | import com.matrix.system.shopXcx.dao.ShopProductAttributeDao; | 
|---|
|  |  |  | import com.matrix.system.shopXcx.dao.ShopProductDao; | 
|---|
|  |  |  | import com.matrix.system.shopXcx.dao.ShopSkuDao; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private ShopSkuDao shopSkuDao; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | ShopProductAttributeDao shopProductAttributeDao; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "查询积分商品", notes = "") | 
|---|
|  |  |  | @PostMapping(value = "/getScoreProductList") | 
|---|
|  |  |  | @ApiResponses({ | 
|---|
|  |  |  | 
|---|
|  |  |  | shopProduct.setScoreCategoryId(scoreProductDto.getScoreCategoryId()); | 
|---|
|  |  |  | shopProduct.setDelFlag(AppConstance.DATA_USEABLE); | 
|---|
|  |  |  | shopProduct.setStatus(AppConstance.IS_PUTAWAY); | 
|---|
|  |  |  | shopProduct.setAbleSales(ShopProduct.NOT_ABLE_SALES); | 
|---|
|  |  |  | shopProduct.setMallType(ShopProduct.MALL_SCORE); | 
|---|
|  |  |  | shopProduct.setAbleScorePay(ShopProduct.PAYFOR_SCORE); | 
|---|
|  |  |  | shopProduct.setCompanyId(HostInterceptor.getCompanyId()); | 
|---|
|  |  |  | //根据属性查询 | 
|---|
|  |  |  | if(StringUtils.isNotBlank(scoreProductDto.getAttrCode())){ | 
|---|
|  |  |  | ShopProductAttribute jfscrmtj = shopProductAttributeDao.selectByCode("jfscrmtj", HostInterceptor.getCompanyId()); | 
|---|
|  |  |  | if(jfscrmtj!=null){ | 
|---|
|  |  |  | shopProduct.setAttrs(jfscrmtj.getAttrId()+""); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | List<ShopProduct> shopProducts = shopProductDao.selectByModelWx(shopProduct); | 
|---|
|  |  |  | shopProducts.forEach(item->item.setSkus(shopSkuDao.selectByPid(item.getId()))); | 
|---|
|  |  |  | return AjaxResult.buildSuccessInstance(shopProducts); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|