Authored by 胡古飞

异常数据处理

package com.yoho.search.dal.model;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* Created by wangnan on 2016/6/30.
*/
public class BasePinRatio implements Serializable {
private Integer productSkn;
private Integer basePinRatio;
public Integer getProductSkn() {
return productSkn;
}
private static final long serialVersionUID = -4200090776085802343L;
private Integer productSkn;
private BigDecimal basePinRatio;
public void setProductSkn(Integer productSkn) {
this.productSkn = productSkn;
}
public Integer getProductSkn() {
return productSkn;
}
public Integer getBasePinRatio() {
return basePinRatio;
}
public void setProductSkn(Integer productSkn) {
this.productSkn = productSkn;
}
public void setBasePinRatio(Integer basePinRatio) {
this.basePinRatio = basePinRatio;
}
public BigDecimal getBasePinRatio() {
return basePinRatio;
}
public void setBasePinRatio(BigDecimal basePinRatio) {
this.basePinRatio = basePinRatio;
}
}
... ...
... ... @@ -3,7 +3,7 @@
<mapper namespace="com.yoho.search.dal.BasePinRatioMapper">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.BasePinRatio">
<result column="product_skn" property="productSkn" jdbcType="INTEGER"/>
<result column="base_pin_ratio" property="basePinRatio" jdbcType="INTEGER"/>
<result column="base_pin_ratio" property="basePinRatio" jdbcType="DECIMAL"/>
</resultMap>
<select id="getBasePinRatio" resultMap="BaseResultMap" timeout="20000">
<![CDATA[
... ...
... ... @@ -733,8 +733,8 @@ public class ProductIndexLogicService {
*/
private ProductIndexBO buildBasePinRatio(ProductIBO p, ProductIndexBO pi, Map<Integer, BasePinRatio> basePinRatiosMap) {
BasePinRatio bpr = basePinRatiosMap.get(p.getProductSkn());
if (bpr != null) {
pi.setBasePinRatio(bpr.getBasePinRatio());
if (bpr != null && bpr.getBasePinRatio()!=null) {
pi.setBasePinRatio(bpr.getBasePinRatio().doubleValue());
}
return pi;
}
... ...
... ... @@ -364,8 +364,12 @@ public class StorageSkuLogicService {
BasePinRatio bpr = basePinRatioMap.get(storageSkuBO.getProductSkn());
BrokenCode bc = brokenCodesMap.get(storageSkuBO.getProductSkn());
storageSkuBO.setBreaking(0);
if ((null != bpr && bpr.getBasePinRatio() >= 3.5) || (null != bc && bc.getBreakingRate() >= 50)) {
storageSkuBO.setBreaking(1);
try {
if ((null != bpr && bpr.getBasePinRatio().doubleValue() >= 3.5) || (null != bc && bc.getBreakingRate() >= 50)) {
storageSkuBO.setBreaking(1);
}
} catch (Exception e) {
logger.error(e.getMessage(),e);
}
}
... ...