Skip to content

Commit

Permalink
update model
Browse files Browse the repository at this point in the history
  • Loading branch information
lcstore committed Nov 19, 2015
1 parent b4f54b7 commit f243210
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import java.util.Iterator;
import java.util.Map;

import org.junit.Assert;

import com.google.common.collect.Maps;
import com.taobao.securityjni.impl.CImplSecretUtil;
import com.taobao.securityjni.tools.DataContext;
Expand Down Expand Up @@ -42,6 +40,6 @@ public static void main(String[] args) throws Exception {
String sign = CImplSecretUtil.getSign(localBytes, dataBytes, paramDataContext);
sign = sign.toLowerCase();
System.err.println("sign:" + sign);
Assert.assertEquals("8f4bf0b894ab0a8e6e0de10dc46460a9", sign);
// Assert.assertEquals("8f4bf0b894ab0a8e6e0de10dc46460a9", sign);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public int compare(Entry<CellStat, Integer> o1, Entry<CellStat, Integer> o2) {
}
};
private static final int MIN_LEN = 2;
private static final int MAX_LEN = 100;

@Override
public CellAssort analyse(List<CellToken> tokens) {
Expand Down Expand Up @@ -103,7 +104,7 @@ private boolean isSkipLen(String sVal) {
if (StringUtils.isBlank(sVal)) {
return true;
}
return sVal.trim().length() <= MIN_LEN;
sVal = sVal.trim();
return sVal.length() <= MIN_LEN || sVal.length() > MAX_LEN;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ public void run() {
log.warn("empty brand...");
continue;
}
// if (!hasDo) {
// hasDo = "brother".equals(brand);
// }
// if (!hasDo) {
// continue;
// }
if (!hasDo) {
hasDo = "玛丽黛佳".equals(brand);
}
if (!hasDo) {
continue;
}
fromId = 0L;
Map<String, List<SimilarDto>> skuMap = Maps.newHashMap();
while (true) {
Expand Down Expand Up @@ -250,9 +250,6 @@ private List<MatchDto> toMatchDtos(List<SimilarCenter> centers, List<SimilarDto>
skuCodeMap.put(dto.getSkuCode(), dto);
}
for (SimilarCenter center : centers) {
if (CollectionUtils.isEmpty(center.getOuts())) {
continue;
}
MatchDto referDto = new MatchDto();
copyProperties(referDto, center.getValue(), skuCodeMap);
referDto.setId(null);
Expand All @@ -262,16 +259,18 @@ private List<MatchDto> toMatchDtos(List<SimilarCenter> centers, List<SimilarDto>
referDto.setSimilarScore(100);
referDto.setCaption("center");
referDto.setArbiterId(MatchDto.ARBITER_NAME);
for (SimilarOut out : center.getOuts()) {
MatchDto currentDto = new MatchDto();
copyProperties(currentDto, out.getCurrent(), skuCodeMap);
currentDto.setMatchCode(referDto.getMatchCode());
currentDto.setCreateTime(currentDate);
currentDto.setUpdateTime(currentDate);
currentDto.setSimilarScore(out.getScore());
currentDto.setArbiterId(MatchDto.ARBITER_NAME);
currentDto.setId(null);
matchDtos.add(currentDto);
if (CollectionUtils.isNotEmpty(center.getOuts())) {
for (SimilarOut out : center.getOuts()) {
MatchDto currentDto = new MatchDto();
copyProperties(currentDto, out.getCurrent(), skuCodeMap);
currentDto.setMatchCode(referDto.getMatchCode());
currentDto.setCreateTime(currentDate);
currentDto.setUpdateTime(currentDate);
currentDto.setSimilarScore(out.getScore());
currentDto.setArbiterId(MatchDto.ARBITER_NAME);
currentDto.setId(null);
matchDtos.add(currentDto);
}
}
matchDtos.add(referDto);
}
Expand Down

0 comments on commit f243210

Please sign in to comment.