Authored by Gino Zhang

Byte/Integer数值类型整改

Showing 25 changed files with 96 additions and 99 deletions
... ... @@ -6,13 +6,13 @@ import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface BrandMapper {
int deleteByPrimaryKey(Short id);
int deleteByPrimaryKey(Integer id);
int insert(Brand record);
int insertSelective(Brand record);
Brand selectByPrimaryKey(Short id);
Brand selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(Brand record);
... ...
... ... @@ -6,13 +6,13 @@ import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ProductColorMapper {
int deleteByPrimaryKey(Short id);
int deleteByPrimaryKey(Integer id);
int insert(ProductColor record);
int insertSelective(ProductColor record);
ProductColor selectByPrimaryKey(Short id);
ProductColor selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(ProductColor record);
... ...
... ... @@ -6,13 +6,13 @@ import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ProductSortMapper {
int deleteByPrimaryKey(Short id);
int deleteByPrimaryKey(Integer id);
int insert(ProductSort record);
int insertSelective(ProductSort record);
ProductSort selectByPrimaryKey(Short id);
ProductSort selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(ProductSort record);
... ...
... ... @@ -7,13 +7,13 @@ import java.util.List;
import java.util.Map;
public interface ProductStandardRelationMapper {
int deleteByPrimaryKey(@Param(value="productId")Integer productId, @Param(value="standardId")Short standardId);
int deleteByPrimaryKey(@Param(value="productId")Integer productId, @Param(value="standardId")Integer standardId);
int insert(ProductStandardRelation record);
int insertSelective(ProductStandardRelation record);
ProductStandardRelation selectByPrimaryKey(@Param(value="productId")Integer productId, @Param(value="standardId")Short standardId);
ProductStandardRelation selectByPrimaryKey(@Param(value="productId")Integer productId, @Param(value="standardId")Integer standardId);
int updateByPrimaryKeySelective(ProductStandardRelation record);
... ...
... ... @@ -6,13 +6,13 @@ import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface SizeMapper {
int deleteByPrimaryKey(Short id);
int deleteByPrimaryKey(Integer id);
int insert(Size record);
int insertSelective(Size record);
Size selectByPrimaryKey(Short id);
Size selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(Size record);
... ... @@ -20,7 +20,7 @@ public interface SizeMapper {
List<Size> getPageLists(@Param(value="offset")Integer offset, @Param(value="pageSize")Integer pageSize);
List<Size> getByIds(List<Short> ids);
List<Size> getByIds(List<Integer> ids);
int count();
}
\ No newline at end of file
... ...
package com.yoho.search.dal;
import java.util.List;
import com.yoho.search.dal.model.Style;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface StyleMapper {
int deleteByPrimaryKey(Short id);
int deleteByPrimaryKey(Integer id);
int insert(Style record);
int insertSelective(Style record);
Style selectByPrimaryKey(Short id);
Style selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(Style record);
... ...
... ... @@ -85,7 +85,7 @@ public class BrandMqListener extends AbstractMqListener implements ChannelAwareM
return;
}
long begin = System.currentTimeMillis();
brandService.delete(Short.parseShort(id));
brandService.delete(Integer.valueOf(id));
indexService.deleteIndexData(indexName, id);
logger.info("[func=deleteData][step=success][indexName={}][id={}][cost={}ms]", indexName, id, (System.currentTimeMillis() - begin));
}
... ...
... ... @@ -76,7 +76,7 @@ public class ProductColorMqListener extends AbstractMqListener implements Channe
return;
}
long begin = System.currentTimeMillis();
productColorService.delete(Short.parseShort(id));
productColorService.delete(Integer.valueOf(id));
indexService.deleteIndexData(indexName, id);
logger.info("[func=deleteData][step=success][indexName={}][id={}][cost={}ms]", indexName, id, (System.currentTimeMillis() - begin));
}
... ...
... ... @@ -75,7 +75,7 @@ public class ProductSortMqListener extends AbstractMqListener implements Channel
return;
}
long begin = System.currentTimeMillis();
productSortService.delete(Short.parseShort(id));
productSortService.delete(Integer.valueOf(id));
indexService.deleteIndexData(indexName, id);
logger.info("[func=deleteData][step=success][indexName={}][id={}][cost={}ms]", indexName, id, (System.currentTimeMillis() - begin));
}
... ...
... ... @@ -78,7 +78,7 @@ public class ProductStandardRelationMqListener extends AbstractMqListener implem
return;
}
int productId = psr.getProductId();
short standardId = psr.getStandardId();
Integer standardId = psr.getStandardId();
productStandardRelationService.delete(productId, standardId);
logger.info("[func=deleteData][step=deleteFromBb][key={}][cost={}ms]", key, System.currentTimeMillis() - begin);
this.updateProductIndex(productId, System.currentTimeMillis(), key);
... ...
... ... @@ -76,7 +76,7 @@ public class SizeMqListener extends AbstractMqListener implements ChannelAwareMe
return;
}
long begin = System.currentTimeMillis();
sizeService.delete(Short.parseShort(id));
sizeService.delete(Integer.valueOf(id));
logger.info("[func=deleteData][step=deleteFromDb][indexName={}] [id={}][cost={}ms]", indexName, id, (System.currentTimeMillis() - begin));
indexService.deleteIndexData(indexName, id);
logger.info("[func=deleteData][step=success][indexName={}][id={}][cost={}ms]", indexName, id, (System.currentTimeMillis() - begin));
... ...
... ... @@ -75,7 +75,7 @@ public class StyleMqListener extends AbstractMqListener implements ChannelAwareM
return;
}
long begin = System.currentTimeMillis();
styleService.delete(Short.parseShort(id));
styleService.delete(Integer.valueOf(id));
indexService.deleteIndexData(indexName, id);
logger.info("[func=deleteData][step=success][indexName={}][id={}][cost={}ms]", indexName, id, (System.currentTimeMillis() - begin));
}
... ...
package com.yoho.search.consumer.service.base;
import java.util.List;
import com.yoho.search.dal.BrandMapper;
import com.yoho.search.dal.model.Brand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.yoho.search.dal.BrandMapper;
import java.util.List;
@Component
public class BrandService {
... ... @@ -14,7 +13,7 @@ public class BrandService {
@Autowired
private BrandMapper brandMapper;
public Brand getById(Short id) {
public Brand getById(Integer id) {
return brandMapper.selectByPrimaryKey(id);
}
... ... @@ -34,7 +33,7 @@ public class BrandService {
}
}
public int delete(Short id) {
public int delete(Integer id) {
return brandMapper.deleteByPrimaryKey(id);
}
... ...
... ... @@ -14,7 +14,7 @@ public class ProductColorService {
@Autowired
private ProductColorMapper productColorMapper;
public ProductColor getById(Short id) {
public ProductColor getById(Integer id) {
return productColorMapper.selectByPrimaryKey(id);
}
... ... @@ -34,7 +34,7 @@ public class ProductColorService {
}
}
public int delete(Short id) {
public int delete(Integer id) {
return productColorMapper.deleteByPrimaryKey(id);
}
... ...
package com.yoho.search.consumer.service.base;
import java.util.List;
import com.yoho.search.dal.ProductSortMapper;
import com.yoho.search.dal.model.ProductSort;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
//@Transactional
public class ProductSortService {
... ... @@ -14,7 +14,7 @@ public class ProductSortService {
@Autowired
private ProductSortMapper productSortMapper;
public ProductSort getById(Short id) {
public ProductSort getById(Integer id) {
return productSortMapper.selectByPrimaryKey(id);
}
... ... @@ -34,7 +34,7 @@ public class ProductSortService {
}
}
public int delete(Short id) {
public int delete(Integer id) {
return productSortMapper.deleteByPrimaryKey(id);
}
... ...
... ... @@ -15,7 +15,7 @@ public class ProductStandardRelationService {
@Autowired
private ProductStandardRelationMapper productStandardRelationMapper;
public ProductStandardRelation getById(Integer productId, Short standardId) {
public ProductStandardRelation getById(Integer productId, Integer standardId) {
return productStandardRelationMapper.selectByPrimaryKey(productId, standardId);
}
... ... @@ -38,7 +38,7 @@ public class ProductStandardRelationService {
}
}
public int delete(Integer productId, Short standardId) {
public int delete(Integer productId, Integer standardId) {
return productStandardRelationMapper.deleteByPrimaryKey(productId, standardId);
}
... ...
package com.yoho.search.consumer.service.base;
import java.util.List;
import com.yoho.search.dal.SizeMapper;
import com.yoho.search.dal.model.Size;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.yoho.search.dal.model.Size;
import java.util.List;
@Component
//@Transactional
... ... @@ -15,7 +14,7 @@ public class SizeService {
@Autowired
private SizeMapper sizeMapper;
public Size getById(Short id) {
public Size getById(Integer id) {
return sizeMapper.selectByPrimaryKey(id);
}
... ... @@ -35,7 +34,7 @@ public class SizeService {
}
}
public int delete(Short id) {
public int delete(Integer id) {
return sizeMapper.deleteByPrimaryKey(id);
}
... ...
package com.yoho.search.consumer.service.base;
import java.util.List;
import com.yoho.search.dal.StyleMapper;
import com.yoho.search.dal.model.Style;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.yoho.search.dal.StyleMapper;
import java.util.List;
@Component
//@Transactional
... ... @@ -15,7 +14,7 @@ public class StyleService {
@Autowired
private StyleMapper styleMapper;
public Style getById(Short id) {
public Style getById(Integer id) {
return styleMapper.selectByPrimaryKey(id);
}
... ... @@ -35,7 +34,7 @@ public class StyleService {
}
}
public int delete(Short id) {
public int delete(Integer id) {
return styleMapper.deleteByPrimaryKey(id);
}
... ...
... ... @@ -18,10 +18,10 @@ public class ProductIBO implements Serializable {
private String productName;
private String cnAlphabet;
private String salesPhrase;
private Short brandId;
private Short maxSortId;
private Short middleSortId;
private Short smallSortId;
private Integer brandId;
private Integer maxSortId;
private Integer middleSortId;
private Integer smallSortId;
private Integer seriesId;
private String gender;
private String genderS;
... ... @@ -39,8 +39,8 @@ public class ProductIBO implements Serializable {
private String isAuditing;
private Integer isauditing;
private Integer isrecommend;
private Short ispromotion;
private Byte attribute;
private Integer ispromotion;
private Integer attribute;
private String seasons;
private Integer seasonsS;
private Integer firstShelveTime;
... ... @@ -49,7 +49,7 @@ public class ProductIBO implements Serializable {
private Integer editTime;
private String isDown;
private Integer isdown;
private Byte status;
private Integer status;
private Integer isOutlets;
private Integer folderId;
private String sellChannels;
... ... @@ -150,11 +150,11 @@ public class ProductIBO implements Serializable {
this.salesPhrase = salesPhrase == null ? null : salesPhrase.trim();
}
public Short getMaxSortId() {
public Integer getMaxSortId() {
return maxSortId;
}
public void setMaxSortId(Short maxSortId) {
public void setMaxSortId(Integer maxSortId) {
this.maxSortId = maxSortId;
}
... ... @@ -166,11 +166,11 @@ public class ProductIBO implements Serializable {
this.maxSortName = maxSortName == null ? null : maxSortName.trim();
}
public Short getMiddleSortId() {
public Integer getMiddleSortId() {
return middleSortId;
}
public void setMiddleSortId(Short middleSortId) {
public void setMiddleSortId(Integer middleSortId) {
this.middleSortId = middleSortId;
}
... ... @@ -182,11 +182,11 @@ public class ProductIBO implements Serializable {
this.middleSortName = middleSortName == null ? null : middleSortName.trim();
}
public Short getSmallSortId() {
public Integer getSmallSortId() {
return smallSortId;
}
public void setSmallSortId(Short smallSortId) {
public void setSmallSortId(Integer smallSortId) {
this.smallSortId = smallSortId;
}
... ... @@ -214,11 +214,11 @@ public class ProductIBO implements Serializable {
this.genderS = genderS == null ? null : genderS.trim();
}
public Short getBrandId() {
public Integer getBrandId() {
return brandId;
}
public void setBrandId(Short brandId) {
public void setBrandId(Integer brandId) {
this.brandId = brandId;
}
... ... @@ -230,11 +230,11 @@ public class ProductIBO implements Serializable {
this.isSpecial = isSpecial == null ? null : isSpecial.trim();
}
public Byte getStatus() {
public Integer getStatus() {
return status;
}
public void setStatus(Byte status) {
public void setStatus(Integer status) {
this.status = status;
}
... ... @@ -278,11 +278,11 @@ public class ProductIBO implements Serializable {
this.ishot = ishot;
}
public Short getIspromotion() {
public Integer getIspromotion() {
return ispromotion;
}
public void setIspromotion(Short ispromotion) {
public void setIspromotion(Integer ispromotion) {
this.ispromotion = ispromotion;
}
... ... @@ -342,11 +342,11 @@ public class ProductIBO implements Serializable {
this.isauditing = isauditing;
}
public Byte getAttribute() {
public Integer getAttribute() {
return attribute;
}
public void setAttribute(Byte attribute) {
public void setAttribute(Integer attribute) {
this.attribute = attribute;
}
... ...
... ... @@ -16,7 +16,7 @@ public class ProductIndexBO extends ProductIBO implements Serializable {
// from product_price
private BigDecimal specialPrice;
private BigDecimal marketPrice;
private Byte vipDiscountType;
private Integer vipDiscountType;
private BigDecimal vipPrice;
private BigDecimal vip1Price;
private BigDecimal vip2Price;
... ... @@ -103,7 +103,7 @@ public class ProductIndexBO extends ProductIBO implements Serializable {
return marketPrice;
}
public Byte getVipDiscountType() {
public Integer getVipDiscountType() {
return vipDiscountType;
}
... ... @@ -260,7 +260,7 @@ public class ProductIndexBO extends ProductIBO implements Serializable {
this.marketPrice = marketPrice;
}
public void setVipDiscountType(Byte vipDiscountType) {
public void setVipDiscountType(Integer vipDiscountType) {
this.vipDiscountType = vipDiscountType;
}
... ...
... ... @@ -13,17 +13,17 @@ public class ProductPoolBO {
private String sales;
private Short brandId;
private Integer brandId;
private Byte status;
private Integer status;
private Byte attribute;
private Integer attribute;
private Short smallSortId;
private Integer smallSortId;
private Short middleSortId;
private Integer middleSortId;
private Short maxSortId;
private Integer maxSortId;
private String gender;
... ... @@ -35,7 +35,7 @@ public class ProductPoolBO {
private BigDecimal salesPrice;
private Byte vipDiscountType;
private Integer vipDiscountType;
private String isDiscount;
... ... @@ -90,51 +90,51 @@ public class ProductPoolBO {
this.sales = sales == null ? null : sales.trim();
}
public Short getBrandId() {
public Integer getBrandId() {
return brandId;
}
public void setBrandId(Short brandId) {
public void setBrandId(Integer brandId) {
this.brandId = brandId;
}
public Byte getStatus() {
public Integer getStatus() {
return status;
}
public void setStatus(Byte status) {
public void setStatus(Integer status) {
this.status = status;
}
public Byte getAttribute() {
public Integer getAttribute() {
return attribute;
}
public void setAttribute(Byte attribute) {
public void setAttribute(Integer attribute) {
this.attribute = attribute;
}
public Short getSmallSortId() {
public Integer getSmallSortId() {
return smallSortId;
}
public void setSmallSortId(Short smallSortId) {
public void setSmallSortId(Integer smallSortId) {
this.smallSortId = smallSortId;
}
public Short getMiddleSortId() {
public Integer getMiddleSortId() {
return middleSortId;
}
public void setMiddleSortId(Short middleSortId) {
public void setMiddleSortId(Integer middleSortId) {
this.middleSortId = middleSortId;
}
public Short getMaxSortId() {
public Integer getMaxSortId() {
return maxSortId;
}
public void setMaxSortId(Short maxSortId) {
public void setMaxSortId(Integer maxSortId) {
this.maxSortId = maxSortId;
}
... ... @@ -178,11 +178,11 @@ public class ProductPoolBO {
this.salesPrice = salesPrice;
}
public Byte getVipDiscountType() {
public Integer getVipDiscountType() {
return vipDiscountType;
}
public void setVipDiscountType(Byte vipDiscountType) {
public void setVipDiscountType(Integer vipDiscountType) {
this.vipDiscountType = vipDiscountType;
}
... ...
... ... @@ -39,7 +39,7 @@ public class ProductGoodsLogicService {
// 解析product_good视图
// 获取ProductColor数据 41数据量
List<ProductColor> productColors = productColorMapper.getAll();
Map<Short, String> productColorsMap = new HashMap<>();
Map<Integer, String> productColorsMap = new HashMap<>();
for (ProductColor p : productColors) {
productColorsMap.put(p.getId(), p.getColorCode() == null ? "" : p.getColorCode());
}
... ...
... ... @@ -30,7 +30,7 @@ public class ProductILogicService {
* @return <br>
* @author wangnan<br>
*/
public List<Product> filterProductList(List<Product> products, Map<Short, ProductSort> ProductSortMap, Map<Short, Brand> brandMap) {
public List<Product> filterProductList(List<Product> products, Map<Integer, ProductSort> ProductSortMap, Map<Integer, Brand> brandMap) {
List<Product> productsNew = new ArrayList<>();
for (Product p : products) {
if (ProductSortMap.containsKey(p.getMaxSortId())) {
... ... @@ -56,7 +56,7 @@ public class ProductILogicService {
* @return <br>
* @author wangnan<br>
*/
public List<ProductIBO> buildProductI(List<Product> products, Map<Short, ProductSort> ProductSortMap, Map<Short, Brand> brandMap) {
public List<ProductIBO> buildProductI(List<Product> products, Map<Integer, ProductSort> ProductSortMap, Map<Integer, Brand> brandMap) {
logger.info("拼装ProductI数据开始");
List<ProductIBO> pdis = new ArrayList<>();
... ...
... ... @@ -124,13 +124,13 @@ public class ProductIndexLogicService {
if (productSorts == null || productSorts.size() == 0) {
logger.error("获取ProductSort列表失败");
}
Map<Short, ProductSort> ProductSortMap = productSorts.stream().parallel().collect(Collectors.toMap(ProductSort::getId, (p) -> p));
Map<Integer, ProductSort> ProductSortMap = productSorts.stream().parallel().collect(Collectors.toMap(ProductSort::getId, (p) -> p));
// 数据量1500,可以全量
List<Brand> brands = this.brandMapper.getAll();
if (brands == null || brands.size() == 0) {
logger.error("获取Brand列表失败");
}
Map<Short, Brand> brandMap = brands.stream().parallel().collect(Collectors.toMap(Brand::getId, (p) -> p));
Map<Integer, Brand> brandMap = brands.stream().parallel().collect(Collectors.toMap(Brand::getId, (p) -> p));
// 过滤Product数据
... ...
... ... @@ -62,26 +62,26 @@ public class ProductSizesLogicService {
List<ProductSizes> productSizess = storageMapper.getProductSizes(ids_);
if (CollectionUtils.isNotEmpty(productSizess)) {
List<Short> sizeIds = new ArrayList<>();
List<Integer> sizeIds = new ArrayList<>();
for (ProductSizes ps : productSizess) {
String sizeArray[] = ps.getSizeIds().split(",");
if (sizeArray != null) {
for (int i = 0; i < sizeArray.length; i++) {
sizeIds.add(Short.valueOf(sizeArray[i]));
sizeIds.add(Integer.valueOf(sizeArray[i]));
}
}
}
List<Size> sizes = sizeMapper.getByIds(sizeIds);
if (CollectionUtils.isNotEmpty(sizes)) {
Map<Short, String> sizeMap = sizes.stream().parallel().collect(Collectors.toMap(Size::getId, Size::getSizeName));
Map<Integer, String> sizeMap = sizes.stream().parallel().collect(Collectors.toMap(Size::getId, Size::getSizeName));
for (ProductSizes ps : productSizess) {
String sizeArray[] = ps.getSizeIds().split(",");
if (sizeArray != null) {
for (int i = 0; i < sizeArray.length; i++) {
if (i == 0) {
ps.setSizeNames(sizeMap.get(Short.valueOf(sizeArray[i])) + ",");
ps.setSizeNames(sizeMap.get(Integer.valueOf(sizeArray[i])) + ",");
} else {
ps.setSizeNames(ps.getSizeNames() + sizeMap.get(Short.valueOf(sizeArray[i])) + ",");
ps.setSizeNames(ps.getSizeNames() + sizeMap.get(Integer.valueOf(sizeArray[i])) + ",");
}
}
... ...