|
|
|
@ -111,7 +111,19 @@ public class ThrOrderDownload implements IDownload {
|
|
|
|
|
collectOrderBiz.setRelId(entity.getRelId());
|
|
|
|
|
|
|
|
|
|
if (StrUtil.isNotEmpty(entity.getCheckCode())) {
|
|
|
|
|
basicProductsDao.selectOne(new LambdaQueryWrapper<BasicProductsEntity>().like(BasicProductsEntity::getYbbm,entity.getCheckCode()));
|
|
|
|
|
// 1. 先查询完全匹配的情况
|
|
|
|
|
LambdaQueryWrapper<BasicProductsEntity> exactMatchWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
exactMatchWrapper.eq(BasicProductsEntity::getYbbm, entity.getCheckCode());
|
|
|
|
|
List<BasicProductsEntity> exactMatches = basicProductsDao.selectList(exactMatchWrapper);
|
|
|
|
|
if (exactMatches.isEmpty()) {
|
|
|
|
|
// 2. 如果没有完全匹配,则查询前20位匹配的情况
|
|
|
|
|
LambdaQueryWrapper<BasicProductsEntity> prefixMatchWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
prefixMatchWrapper.apply("LEFT(ybbm, 20) = LEFT({0}, 20)", entity.getCheckCode());
|
|
|
|
|
exactMatches = basicProductsDao.selectList(prefixMatchWrapper);
|
|
|
|
|
}
|
|
|
|
|
if (exactMatches.isEmpty()) {
|
|
|
|
|
errorMsg.append(entity.getCpmctymc()).append("字典未对照").append(";");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
BasicProductsEntity basicProductsEntity = basicProductsDao.selectOne(new LambdaQueryWrapper<BasicProductsEntity>().eq(BasicProductsEntity::getYbbm, entity.getYbbm()).last("limit 1"));
|
|
|
|
|
if (basicProductsEntity == null || StrUtil.isEmpty(basicProductsEntity.getNameCode())) {
|
|
|
|
|