Commit bb59e340 by 刘栋

UDI-代码重整

parent a22aff01
Showing with 157 additions and 89 deletions
/saas-udi-api/target
/aas-udi-service/target
/saas-udi-service/target
/logs/
/.idea/
......@@ -12,65 +12,9 @@
<artifactId>saas-udi-api</artifactId>
<properties>
<jeecg-autopoi.version>1.3.6</jeecg-autopoi.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
<version>2.4.6</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
</dependency>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
</dependency>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>swagger-bootstrap-ui</artifactId>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-extension</artifactId>
</dependency>
<dependency>
<groupId>com.infynova</groupId>
<artifactId>saas-core</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/../libs/saas-core-1.0.0.jar</systemPath>
</dependency>
</dependencies>
</project>
\ No newline at end of file
......@@ -17,6 +17,14 @@
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
<exclusions>
......@@ -57,9 +65,19 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-extension</artifactId>
</dependency>
<dependency>
......@@ -72,13 +90,34 @@
<artifactId>jetcache-starter-redis</artifactId>
<version>${jetcache.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>p6spy</groupId>
<artifactId>p6spy</artifactId>
<version>3.7.0</version>
</dependency>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
</dependency>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>swagger-bootstrap-ui</artifactId>
</dependency>
<!-- sqlite jdbc 驱动 -->
<dependency>
......@@ -86,13 +125,13 @@
<artifactId>sqlite-jdbc</artifactId>
<version>3.45.1.0</version>
</dependency>
<!-- redis搜索 -->
<dependency>
<groupId>com.redislabs</groupId>
<artifactId>jredisearch</artifactId>
<version>2.0.0</version>
</dependency>
<!-- elasticsearch -->
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
......@@ -122,6 +161,11 @@
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
......@@ -132,10 +176,12 @@
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
</dependency>
<dependency>
<groupId>com.infynova</groupId>
<artifactId>saas-ucpm-api</artifactId>
......@@ -150,6 +196,13 @@
<scope>system</scope>
<systemPath>${project.basedir}/../libs/simmetrics-core-4.1.1.jar</systemPath>
</dependency>
<dependency>
<groupId>com.infynova</groupId>
<artifactId>saas-core</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/../libs/saas-core-1.0.0.jar</systemPath>
</dependency>
</dependencies>
<build>
......
/*
* Copyright [2021] [SaasPlatform ]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.infynova.udi.config;
import com.alibaba.fastjson.support.spring.GenericFastJsonRedisSerializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.RedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
/**
* @author zoupx
* @email
* @date 2021/8/5 10:57 下午
* @description:
*/
@SuppressWarnings("all")
@Configuration
public class RedisConfig {
@Bean
public RedisSerializer<String> redisKeySerializer() {
return new StringRedisSerializer();
}
/**
*
* @description 使用FastJson
* @param
* @author zoupx
* @date 2021/8/5
* @return org.springframework.data.redis.serializer.RedisSerializer<java.lang.Object>
*/
@Bean
public RedisSerializer<Object> redisValueSerializer() {
return new GenericFastJsonRedisSerializer();
}
/**
*
* @description RedisTemplate配置
* @param factory
* @param redisKeySerializer
* @param redisValueSerializer
* @author zoupx
* @date 2021/8/5
* @return org.springframework.data.redis.core.RedisTemplate<java.lang.String,java.lang.Object>
*/
@Bean
public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory factory, RedisSerializer<String> redisKeySerializer, RedisSerializer<Object> redisValueSerializer) {
RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
redisTemplate.setConnectionFactory(factory);
//设置Key的序列化采用StringRedisSerializer
redisTemplate.setKeySerializer(redisKeySerializer);
redisTemplate.setHashKeySerializer(redisKeySerializer);
//设置值的序列化
redisTemplate.setValueSerializer(redisValueSerializer);
redisTemplate.setHashValueSerializer(redisValueSerializer);
redisTemplate.afterPropertiesSet();
return redisTemplate;
}
}
......@@ -6,7 +6,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.infynova.common.core.api.ResponseData;
import com.infynova.udi.dto.UdiListQry;
import com.infynova.udi.helper.UdiEasyExcelHelper;
import com.infynova.udi.service.helper.UdiEasyExcelHelper;
import com.infynova.udi.service.UdiService;
import com.infynova.udi.vo.UdiExportVo;
import com.infynova.udi.vo.UdiVo;
......
......@@ -18,7 +18,6 @@ import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@Slf4j
@Api(tags = "对码平台-辅助",hidden = true)
......
......@@ -8,7 +8,7 @@ import com.infynova.common.core.api.ResponseData;
import com.infynova.udi.dto.*;
import com.infynova.udi.entity.MatchData;
import com.infynova.udi.entity.MatchTemp;
import com.infynova.udi.helper.UdiEasyExcelHelper;
import com.infynova.udi.service.helper.UdiEasyExcelHelper;
import com.infynova.udi.service.MatchDataService;
import com.infynova.udi.service.MatchTempService;
import com.infynova.udi.vo.UdiMatchDataExportVo;
......
......@@ -6,7 +6,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.infynova.common.core.api.ResponseData;
import com.infynova.udi.dto.*;
import com.infynova.udi.helper.UdiEasyExcelHelper;
import com.infynova.udi.service.helper.UdiEasyExcelHelper;
import com.infynova.udi.service.TaskImportService;
import com.infynova.udi.service.TaskService;
import com.infynova.udi.vo.*;
......
......@@ -2,7 +2,7 @@ package com.infynova.udi.dto;
import com.infynova.common.core.api.BaseVo;
import com.infynova.udi.helper.validator.FixedValueValidator;
import com.infynova.udi.exception.validator.FixedValueValidator;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......
......@@ -2,7 +2,7 @@ package com.infynova.udi.dto;
import com.infynova.common.core.api.BaseVo;
import com.infynova.udi.helper.validator.FixedValueValidator;
import com.infynova.udi.exception.validator.FixedValueValidator;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......
......@@ -4,7 +4,7 @@ package com.infynova.udi.dto;
import com.infynova.common.core.entity.PageVo;
import com.infynova.udi.enums.match.MatchStatusEnum;
import com.infynova.udi.enums.match.MatchUpdateStatusEnum;
import com.infynova.udi.helper.validator.FixedValueValidator;
import com.infynova.udi.exception.validator.FixedValueValidator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......
......@@ -2,7 +2,7 @@ package com.infynova.udi.dto;
import com.infynova.common.core.entity.PageVo;
import com.infynova.udi.helper.validator.FixedValueValidator;
import com.infynova.udi.exception.validator.FixedValueValidator;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......
package com.infynova.udi;
package com.infynova.udi.exception;
import com.infynova.common.core.api.ServiceCode;
......@@ -14,8 +14,6 @@ public enum UdiCode implements ServiceCode {
, IMPORT_ERROR(750003, "导入错误")
, IMPORT_NULL_ERROR(750004,"导入数据为空")
, FILE_IS_NOT_NULL(750005, "文件不允许为空")
, GET_REGION_ERROR(750006, "获取大区出现异常")
, GET_SELLER_ERROR(750007, "获取销售人员出现异常")
;
private int code;
......
package com.infynova.udi.helper.validator;
package com.infynova.udi.exception.validator;
import javax.validation.Constraint;
import javax.validation.ConstraintValidator;
......
package com.infynova.udi.helper.validator;
package com.infynova.udi.exception.validator;
import javax.validation.Constraint;
import javax.validation.ConstraintValidator;
......
......@@ -3,7 +3,7 @@ package com.infynova.udi.service.core;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.LocalDateTimeUtil;
import com.infynova.udi.entity.Udi;
import com.infynova.udi.utils.BooleanValueUtils;
import com.infynova.udi.service.helper.BooleanValueUtils;
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
import lombok.extern.slf4j.Slf4j;
......
......@@ -17,16 +17,11 @@ import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.action.update.UpdateRequest;
import org.elasticsearch.action.update.UpdateResponse;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.client.indices.CreateIndexRequest;
import org.elasticsearch.client.indices.CreateIndexResponse;
import org.elasticsearch.client.ml.PostDataRequest;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.index.query.*;
import org.elasticsearch.search.SearchHit;
......@@ -36,7 +31,6 @@ import org.springframework.util.StopWatch;
import javax.annotation.Resource;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.*;
/**
......
......@@ -136,12 +136,15 @@ public class MatchHelper {
if(StringUtils.isNotBlank(matchData.getUdiCode())){
// 去匹配udiCode
matchRateVoList = this.queryUdiNew(matchData);
matchRateVoList.forEach(i->i.setSource(1));
} else if(StringUtils.isNotBlank(matchData.getYiBaoCode())){
// 去匹配YiBaoCode
matchRateVoList = this.queryYiBaoCode(matchData);
matchRateVoList.forEach(i->i.setSource(2));
} else if(StringUtils.isNotBlank(matchData.getCompanyName()) || StringUtils.isNotBlank(matchData.getProductFactoryCode())){
// 厂家+产品货号/编号
matchRateVoList = matchESHelper.three(matchData.getCompanyName(), matchData.getProductFactoryCode());
matchRateVoList.forEach(i->i.setSource(3));
} else if (StringUtils.isNotBlank(matchData.getBrandName())
|| StringUtils.isNotBlank(matchData.getProductName())
|| StringUtils.isNotBlank(matchData.getSpecification())
......@@ -151,6 +154,7 @@ public class MatchHelper {
matchData.getProductName(),
matchData.getSpecification(),
matchData.getModel());
matchRateVoList.forEach(i->i.setSource(4));
}
// 计算匹配率
......
package com.infynova.udi.service.helper;
/**
* 计算匹配工具
* @author liudong
* 2024/5/15 18:20
* @version 1.0
......
......@@ -16,7 +16,6 @@ import com.infynova.udi.exception.UdiCodeException;
import com.infynova.udi.manager.OssManager;
import com.infynova.udi.mapper.MatchDataMapper;
import com.infynova.udi.service.TaskService;
import com.infynova.udi.utils.BooleanValueUtils;
import com.infynova.udi.vo.TaskUdiExcelImportVo;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
......
package com.infynova.udi.helper;
package com.infynova.udi.service.helper;
import com.alibaba.excel.EasyExcel;
import lombok.extern.slf4j.Slf4j;
......
......@@ -19,7 +19,7 @@ import com.infynova.udi.mapper.MatchDataMapper;
import com.infynova.udi.service.MatchDataService;
import com.infynova.udi.service.MatchTempService;
import com.infynova.udi.service.base.BaseService;
import com.infynova.udi.utils.BooleanValueUtils;
import com.infynova.udi.service.helper.BooleanValueUtils;
import com.infynova.udi.vo.TaskMatchStatisticVo;
import com.infynova.udi.vo.UdiMatchDataVo;
import lombok.extern.slf4j.Slf4j;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment