Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
6a822815
Commit
6a822815
authored
Jun 01, 2024
by
刘凡
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增:调整多数据源与气瓶企业数据校验
parent
87fcd234
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
147 additions
and
126 deletions
+147
-126
pom.xml
amos-boot-data/amos-boot-data-openapi/pom.xml
+9
-9
OpenapiApplication.java
...pi/src/main/java/com/yeejoin/amos/OpenapiApplication.java
+1
-1
DataSourceConfig.java
...com/yeejoin/amos/api/openapi/config/DataSourceConfig.java
+29
-16
CylinderController.java
...ejoin/amos/api/openapi/controller/CylinderController.java
+3
-0
BaseEnterpriseInfoService.java
...s/api/openapi/face/service/BaseEnterpriseInfoService.java
+1
-1
CylinderFillingDataValidationService.java
...pi/face/service/CylinderFillingDataValidationService.java
+78
-78
application-vb.properties
...data-openapi/src/main/resources/application-vb.properties
+26
-21
No files found.
amos-boot-data/amos-boot-data-openapi/pom.xml
View file @
6a822815
...
...
@@ -19,15 +19,15 @@
<artifactId>
spring-cloud-starter-netflix-eureka-client
</artifactId>
</dependency>
<!-- druid -->
<dependency
>
<groupId>
com.alibaba
</groupId
>
<artifactId>
druid-spring-boot-starter
</artifactId
>
<version>
1.1.10
</version
>
</dependency
>
<dependency
>
<groupId>
org.springframework.boot
</groupId
>
<artifactId>
spring-boot-starter-jdbc
</artifactId
>
</dependency
>
<!-- <dependency>--
>
<!-- <groupId>com.alibaba</groupId>--
>
<!-- <artifactId>druid-spring-boot-starter</artifactId>--
>
<!-- <version>1.1.10</version>--
>
<!-- </dependency>--
>
<!-- <dependency>--
>
<!-- <groupId>org.springframework.boot</groupId>--
>
<!-- <artifactId>spring-boot-starter-jdbc</artifactId>--
>
<!-- </dependency>--
>
<dependency>
<groupId>
com.baomidou
</groupId>
<artifactId>
dynamic-datasource-spring-boot-starter
</artifactId>
...
...
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/OpenapiApplication.java
View file @
6a822815
...
...
@@ -48,7 +48,7 @@ import org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler;
"com.yeejoin.amos.boot.biz.common.dao.mapper"
})
@ComponentScan
(
basePackages
=
{
"org.typroject"
,
"com.yeejoin.amos"
},
excludeFilters
=
@ComponentScan
.
Filter
(
type
=
FilterType
.
REGEX
,
pattern
=
"com.yeejoin.amos.boot.biz.common.controller.*|com.yeejoin.amos.boot.module.common.api.core.framework.*"
pattern
=
"com.yeejoin.amos.
component.config.TransactionalUntil|com.yeejoin.amos.
boot.biz.common.controller.*|com.yeejoin.amos.boot.module.common.api.core.framework.*"
))
public
class
OpenapiApplication
{
...
...
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/config/DataSourceConfig.java
View file @
6a822815
package
com
.
yeejoin
.
amos
.
api
.
openapi
.
config
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.jdbc.datasource.DataSourceTransactionManager
;
import
javax.sql.DataSource
;
@Configuration
public
class
DataSourceConfig
{
@Bean
public
DataSourceTransactionManager
transactionManager
(
DataSource
dataSource
)
{
return
new
DataSourceTransactionManager
(
dataSource
);
}
}
//package com.yeejoin.amos.api.openapi.config;
//
//import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.context.annotation.Primary;
//import org.springframework.jdbc.datasource.DataSourceTransactionManager;
//
//import javax.sql.DataSource;
//
//
//@Configuration
//public class DataSourceConfig {
//// @Bean
//// public DataSourceTransactionManager transactionManager(DataSource dataSource) {
//// return new DataSourceTransactionManager(dataSource);
//// }
//
//// @Bean
//// @Primary
//// public DataSourceTransactionManager openapiTransactionManager(@Qualifier("openapiDataSource") DataSource openapiDataSource) {
//// return new DataSourceTransactionManager(openapiDataSource);
//// }
////
//// @Bean(name = "tzsTransactionManager")
//// public DataSourceTransactionManager tzsTransactionManager(@Qualifier("tzsDataSource") DataSource tzsDataSource) {
//// return new DataSourceTransactionManager(tzsDataSource);
//// }
//}
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/controller/CylinderController.java
View file @
6a822815
...
...
@@ -48,12 +48,15 @@ public class CylinderController {
private
TmCylinderInspectionService
cylinderInspectionService
;
@Autowired
private
TmCylinderTagsService
cylinderTagsService
;
@Autowired
private
CylinderFillingDataValidationService
cylinderFillingDataValidationService
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
value
=
"气瓶企业信息"
)
@PostMapping
(
value
=
"/unit"
)
@RestEventTrigger
(
value
=
"openapiLogEventHandler"
)
public
ResponseModel
<
String
>
cylinderUnit
(
@RequestBody
List
<
TmCylinderUnitModel
>
unitData
)
throws
Exception
{
cylinderFillingDataValidationService
.
validatEcylinderUnit
(
unitData
);
return
ResponseHelper
.
buildResponse
(
cylinderUnitService
.
createCylinderUnit
(
unitData
));
}
...
...
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/BaseEnterpriseInfoService.java
View file @
6a822815
...
...
@@ -15,7 +15,7 @@ import java.util.Set;
@DS
(
"tzs"
)
@Component
public
class
BaseEnterpriseInfoService
extends
AppBaseService
<
TzBaseEnterpriseInfoDto
,
TzBaseEnterpriseInfo
,
TzBaseEnterpriseInfoMapper
>
{
@DS
(
"tzs"
)
public
List
<
TzBaseEnterpriseInfoDto
>
getEnterpriseInfoByCreditCode
(
@Condition
(
Operator
.
in
)
Set
<
String
>
useCode
)
{
return
this
.
queryForList
(
""
,
false
,
useCode
);
}
...
...
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/CylinderFillingDataValidationService.java
View file @
6a822815
...
...
@@ -39,19 +39,19 @@ public class CylinderFillingDataValidationService {
// 1.必填校验
List
<
String
>
errorRows
=
validateRequired
(
CylinderUnitFieldEnum
.
getAllRequireKeys
(),
jsonArray
);
if
(!
ObjectUtils
.
isEmpty
(
errorRows
))
{
throw
new
BadRequest
(
JSONArray
.
fromObject
(
errorRows
.
stream
().
map
(
e
->
"必填字段为空::"
+
e
).
collect
(
Collectors
.
toList
())).
toString
());
throw
new
BadRequest
(
JSONArray
.
fromObject
(
errorRows
.
stream
().
map
(
e
->
"必填字段
不能
为空::"
+
e
).
collect
(
Collectors
.
toList
())).
toString
());
}
// 2.本次上传数据唯一性校验
errorRows
=
validateUnique
(
CylinderUnitFieldEnum
.
getAllUniqueKeys
(),
jsonArray
);
if
(!
ObjectUtils
.
isEmpty
(
errorRows
))
{
throw
new
BadRequest
(
JSONArray
.
fromObject
(
errorRows
.
stream
().
map
(
e
->
"上传数据重复:"
+
e
).
collect
(
Collectors
.
toList
())).
toString
());
}
// 3.检查企业统一社会信用代码是否存在
Set
<
String
>
creditCodes
=
getAllData
(
FillingBeforeFieldEnum
.
creditCode
.
name
(),
jsonArray
);
errorRows
=
getNotExistEnterpriseInfoByCreditCode
(
creditCodes
);
if
(!
ObjectUtils
.
isEmpty
(
errorRows
))
{
throw
new
BadRequest
(
JSONArray
.
fromObject
(
errorRows
.
stream
().
map
(
e
->
"企业统一社会信用代码不存在:"
+
e
).
collect
(
Collectors
.
toList
())).
toString
());
}
//
// 3.检查企业统一社会信用代码是否存在
//
Set<String> creditCodes = getAllData(FillingBeforeFieldEnum.creditCode.name(), jsonArray);
//
errorRows = getNotExistEnterpriseInfoByCreditCode(creditCodes);
//
if (!ObjectUtils.isEmpty(errorRows)) {
//
throw new BadRequest(JSONArray.fromObject(errorRows.stream().map(e -> "企业统一社会信用代码不存在:" + e).collect(Collectors.toList())).toString());
//
}
return
true
;
}
...
...
@@ -66,25 +66,25 @@ public class CylinderFillingDataValidationService {
// 1.必填校验
List
<
String
>
errorRows
=
validateRequired
(
CylinderInfoFieldEnum
.
getAllRequireKeys
(),
jsonArray
);
if
(!
ObjectUtils
.
isEmpty
(
errorRows
))
{
throw
new
BadRequest
(
JSONArray
.
fromObject
(
errorRows
.
stream
().
map
(
e
->
"必填字段为空::"
+
e
).
collect
(
Collectors
.
toList
())).
toString
());
throw
new
BadRequest
(
JSONArray
.
fromObject
(
errorRows
.
stream
().
map
(
e
->
"必填字段
不能
为空::"
+
e
).
collect
(
Collectors
.
toList
())).
toString
());
}
// 2.本次上传数据唯一性校验
errorRows
=
validateUnique
(
CylinderInfoFieldEnum
.
getAllUniqueKeys
(),
jsonArray
);
if
(!
ObjectUtils
.
isEmpty
(
errorRows
))
{
throw
new
BadRequest
(
JSONArray
.
fromObject
(
errorRows
.
stream
().
map
(
e
->
"上传数据重复:"
+
e
).
collect
(
Collectors
.
toList
())).
toString
());
}
// 3.检查气瓶唯一标识码是否存在
Set
<
String
>
sequenceCodes
=
getAllData
(
FillingBeforeFieldEnum
.
sequenceCode
.
name
(),
jsonArray
);
errorRows
=
getNotExistSequenceCodes
(
sequenceCodes
);
if
(!
ObjectUtils
.
isEmpty
(
errorRows
))
{
throw
new
BadRequest
(
JSONArray
.
fromObject
(
errorRows
.
stream
().
map
(
e
->
"气瓶唯一标识码不存在:"
+
e
).
collect
(
Collectors
.
toList
())).
toString
());
}
// 4.检查企业统一社会信用代码是否存在
Set
<
String
>
creditCodes
=
getAllData
(
FillingBeforeFieldEnum
.
creditCode
.
name
(),
jsonArray
);
errorRows
=
getNotExistEnterpriseInfoByCreditCode
(
creditCodes
);
if
(!
ObjectUtils
.
isEmpty
(
errorRows
))
{
throw
new
BadRequest
(
JSONArray
.
fromObject
(
errorRows
.
stream
().
map
(
e
->
"企业统一社会信用代码不存在:"
+
e
).
collect
(
Collectors
.
toList
())).
toString
());
}
//
// 3.检查气瓶唯一标识码是否存在
//
Set<String> sequenceCodes = getAllData(FillingBeforeFieldEnum.sequenceCode.name(), jsonArray);
//
errorRows = getNotExistSequenceCodes(sequenceCodes);
//
if (!ObjectUtils.isEmpty(errorRows)) {
//
throw new BadRequest(JSONArray.fromObject( errorRows.stream().map(e -> "气瓶唯一标识码不存在:" + e).collect(Collectors.toList())).toString());
//
}
//
// 4.检查企业统一社会信用代码是否存在
//
Set<String> creditCodes = getAllData(FillingBeforeFieldEnum.creditCode.name(), jsonArray);
//
errorRows = getNotExistEnterpriseInfoByCreditCode(creditCodes);
//
if (!ObjectUtils.isEmpty(errorRows)) {
//
throw new BadRequest(JSONArray.fromObject( errorRows.stream().map(e -> "企业统一社会信用代码不存在:" + e).collect(Collectors.toList())).toString());
//
}
return
true
;
}
...
...
@@ -98,7 +98,7 @@ public class CylinderFillingDataValidationService {
// 1.必填校验
List
<
String
>
errorRows
=
validateRequired
(
CylinderTagFieldEnum
.
getAllRequireKeys
(),
jsonArray
);
if
(!
ObjectUtils
.
isEmpty
(
errorRows
))
{
throw
new
BadRequest
(
JSONArray
.
fromObject
(
errorRows
.
stream
().
map
(
e
->
"必填字段为空::"
+
e
).
collect
(
Collectors
.
toList
())).
toString
());
throw
new
BadRequest
(
JSONArray
.
fromObject
(
errorRows
.
stream
().
map
(
e
->
"必填字段
不能
为空::"
+
e
).
collect
(
Collectors
.
toList
())).
toString
());
}
// 2.本次上传数据唯一性校验
...
...
@@ -107,11 +107,11 @@ public class CylinderFillingDataValidationService {
throw
new
BadRequest
(
JSONArray
.
fromObject
(
errorRows
.
stream
().
map
(
e
->
"上传数据重复:"
+
e
).
collect
(
Collectors
.
toList
())).
toString
());
}
// 3.检查气瓶唯一标识码是否存在
Set
<
String
>
sequenceCodes
=
getAllData
(
FillingBeforeFieldEnum
.
sequenceCode
.
name
(),
jsonArray
);
errorRows
=
getNotExistSequenceCodes
(
sequenceCodes
);
if
(!
ObjectUtils
.
isEmpty
(
errorRows
))
{
throw
new
BadRequest
(
JSONArray
.
fromObject
(
errorRows
.
stream
().
map
(
e
->
"气瓶唯一标识码不存在:"
+
e
).
collect
(
Collectors
.
toList
())).
toString
());
}
//
Set<String> sequenceCodes = getAllData(FillingBeforeFieldEnum.sequenceCode.name(), jsonArray);
//
errorRows = getNotExistSequenceCodes(sequenceCodes);
//
if (!ObjectUtils.isEmpty(errorRows)) {
//
throw new BadRequest(JSONArray.fromObject( errorRows.stream().map(e -> "气瓶唯一标识码不存在:" + e).collect(Collectors.toList())).toString());
//
}
return
true
;
}
...
...
@@ -125,7 +125,7 @@ public class CylinderFillingDataValidationService {
// 1.必填校验
List
<
String
>
errorRows
=
validateRequired
(
CylinderInspectionFieldEnum
.
getAllRequireKeys
(),
jsonArray
);
if
(!
ObjectUtils
.
isEmpty
(
errorRows
))
{
throw
new
BadRequest
(
JSONArray
.
fromObject
(
errorRows
.
stream
().
map
(
e
->
"必填字段为空::"
+
e
).
collect
(
Collectors
.
toList
())).
toString
());
throw
new
BadRequest
(
JSONArray
.
fromObject
(
errorRows
.
stream
().
map
(
e
->
"必填字段
不能
为空::"
+
e
).
collect
(
Collectors
.
toList
())).
toString
());
}
// 2.本次上传数据唯一性校验
...
...
@@ -134,11 +134,11 @@ public class CylinderFillingDataValidationService {
throw
new
BadRequest
(
JSONArray
.
fromObject
(
errorRows
.
stream
().
map
(
e
->
"上传数据重复:"
+
e
).
collect
(
Collectors
.
toList
())).
toString
());
}
// 3.检查气瓶唯一标识码是否存在
Set
<
String
>
sequenceCodes
=
getAllData
(
FillingBeforeFieldEnum
.
sequenceCode
.
name
(),
jsonArray
);
errorRows
=
getNotExistSequenceCodes
(
sequenceCodes
);
if
(!
ObjectUtils
.
isEmpty
(
errorRows
))
{
throw
new
BadRequest
(
JSONArray
.
fromObject
(
errorRows
.
stream
().
map
(
e
->
"气瓶唯一标识码不存在:"
+
e
).
collect
(
Collectors
.
toList
())).
toString
());
}
//
Set<String> sequenceCodes = getAllData(FillingBeforeFieldEnum.sequenceCode.name(), jsonArray);
//
errorRows = getNotExistSequenceCodes(sequenceCodes);
//
if (!ObjectUtils.isEmpty(errorRows)) {
//
throw new BadRequest(JSONArray.fromObject( errorRows.stream().map(e -> "气瓶唯一标识码不存在:" + e).collect(Collectors.toList())).toString());
//
}
return
true
;
}
...
...
@@ -153,7 +153,7 @@ public class CylinderFillingDataValidationService {
// 1.必填校验
List
<
String
>
errorRows
=
validateRequired
(
CylinderFillingAuditFieldEnum
.
getAllRequireKeys
(),
jsonArray
);
if
(!
ObjectUtils
.
isEmpty
(
errorRows
))
{
throw
new
BadRequest
(
JSONArray
.
fromObject
(
errorRows
.
stream
().
map
(
e
->
"必填字段为空::"
+
e
).
collect
(
Collectors
.
toList
())).
toString
());
throw
new
BadRequest
(
JSONArray
.
fromObject
(
errorRows
.
stream
().
map
(
e
->
"必填字段
不能
为空::"
+
e
).
collect
(
Collectors
.
toList
())).
toString
());
}
// 2.本次上传数据唯一性校验
...
...
@@ -162,11 +162,11 @@ public class CylinderFillingDataValidationService {
throw
new
BadRequest
(
JSONArray
.
fromObject
(
errorRows
.
stream
().
map
(
e
->
"上传数据重复:"
+
e
).
collect
(
Collectors
.
toList
())).
toString
());
}
// 3.检查气瓶唯一标识码是否存在
Set
<
String
>
sequenceCodes
=
getAllData
(
FillingBeforeFieldEnum
.
sequenceCode
.
name
(),
jsonArray
);
errorRows
=
getNotExistSequenceCodes
(
sequenceCodes
);
if
(!
ObjectUtils
.
isEmpty
(
errorRows
))
{
throw
new
BadRequest
(
JSONArray
.
fromObject
(
errorRows
.
stream
().
map
(
e
->
"气瓶唯一标识码不存在:"
+
e
).
collect
(
Collectors
.
toList
())).
toString
());
}
//
Set<String> sequenceCodes = getAllData(FillingBeforeFieldEnum.sequenceCode.name(), jsonArray);
//
errorRows = getNotExistSequenceCodes(sequenceCodes);
//
if (!ObjectUtils.isEmpty(errorRows)) {
//
throw new BadRequest(JSONArray.fromObject( errorRows.stream().map(e -> "气瓶唯一标识码不存在:" + e).collect(Collectors.toList())).toString());
//
}
return
true
;
}
...
...
@@ -210,25 +210,25 @@ public class CylinderFillingDataValidationService {
// 1.必填校验
List
<
String
>
errorRows
=
validateRequired
(
FillingBeforeFieldEnum
.
getAllRequireKeys
(),
jsonArray
);
if
(!
ObjectUtils
.
isEmpty
(
errorRows
))
{
return
errorRows
.
stream
().
map
(
e
->
"必填字段
为空:
:"
+
e
).
collect
(
Collectors
.
toList
());
return
errorRows
.
stream
().
map
(
e
->
"必填字段
不能为空
:"
+
e
).
collect
(
Collectors
.
toList
());
}
// 2.本次上传数据唯一性校验
errorRows
=
validateUnique
(
FillingBeforeFieldEnum
.
getAllUniqueKeys
(),
jsonArray
);
if
(!
ObjectUtils
.
isEmpty
(
errorRows
))
{
return
errorRows
.
stream
().
map
(
e
->
"上传数据重复:"
+
e
).
collect
(
Collectors
.
toList
());
}
// 3.检查气瓶唯一标识码是否存在
Set
<
String
>
sequenceCodes
=
getAllData
(
FillingBeforeFieldEnum
.
sequenceCode
.
name
(),
jsonArray
);
errorRows
=
getNotExistSequenceCodes
(
sequenceCodes
);
if
(!
ObjectUtils
.
isEmpty
(
errorRows
))
{
return
errorRows
.
stream
().
map
(
e
->
"气瓶唯一标识码不存在:"
+
e
).
collect
(
Collectors
.
toList
());
}
// 4.检查企业统一社会信用代码是否存在
Set
<
String
>
creditCodes
=
getAllData
(
FillingBeforeFieldEnum
.
creditCode
.
name
(),
jsonArray
);
errorRows
=
getNotExistEnterpriseInfoByCreditCode
(
creditCodes
);
if
(!
ObjectUtils
.
isEmpty
(
errorRows
))
{
return
errorRows
.
stream
().
map
(
e
->
"企业统一社会信用代码不存在:"
+
e
).
collect
(
Collectors
.
toList
());
}
//
// 3.检查气瓶唯一标识码是否存在
//
Set<String> sequenceCodes = getAllData(FillingBeforeFieldEnum.sequenceCode.name(), jsonArray);
//
errorRows = getNotExistSequenceCodes(sequenceCodes);
//
if (!ObjectUtils.isEmpty(errorRows)) {
//
return errorRows.stream().map(e -> "气瓶唯一标识码不存在:" + e).collect(Collectors.toList());
//
}
//
// 4.检查企业统一社会信用代码是否存在
//
Set<String> creditCodes = getAllData(FillingBeforeFieldEnum.creditCode.name(), jsonArray);
//
errorRows = getNotExistEnterpriseInfoByCreditCode(creditCodes);
//
if (!ObjectUtils.isEmpty(errorRows)) {
//
return errorRows.stream().map(e -> "企业统一社会信用代码不存在:" + e).collect(Collectors.toList());
//
}
return
null
;
}
...
...
@@ -241,25 +241,25 @@ public class CylinderFillingDataValidationService {
// 1.必填校验
List
<
String
>
errorRows
=
validateRequired
(
FillingRecordFieldEnum
.
getAllRequireKeys
(),
jsonArray
);
if
(!
ObjectUtils
.
isEmpty
(
errorRows
))
{
return
errorRows
.
stream
().
map
(
e
->
"必填字段为空::"
+
e
).
collect
(
Collectors
.
toList
());
return
errorRows
.
stream
().
map
(
e
->
"必填字段
不能
为空::"
+
e
).
collect
(
Collectors
.
toList
());
}
// 2.本次上传数据唯一性校验
errorRows
=
validateUnique
(
FillingRecordFieldEnum
.
getAllUniqueKeys
(),
jsonArray
);
if
(!
ObjectUtils
.
isEmpty
(
errorRows
))
{
return
errorRows
.
stream
().
map
(
e
->
"上传数据重复:"
+
e
).
collect
(
Collectors
.
toList
());
}
// 3.检查气瓶唯一标识码是否存在
Set
<
String
>
sequenceCodes
=
getAllData
(
FillingBeforeFieldEnum
.
sequenceCode
.
name
(),
jsonArray
);
errorRows
=
getNotExistSequenceCodes
(
sequenceCodes
);
if
(!
ObjectUtils
.
isEmpty
(
errorRows
))
{
return
errorRows
.
stream
().
map
(
e
->
"气瓶唯一标识码不存在:"
+
e
).
collect
(
Collectors
.
toList
());
}
// 4.检查企业统一社会信用代码是否存在
Set
<
String
>
creditCodes
=
getAllData
(
FillingBeforeFieldEnum
.
creditCode
.
name
(),
jsonArray
);
errorRows
=
getNotExistEnterpriseInfoByCreditCode
(
creditCodes
);
if
(!
ObjectUtils
.
isEmpty
(
errorRows
))
{
return
errorRows
.
stream
().
map
(
e
->
"企业统一社会信用代码不存在:"
+
e
).
collect
(
Collectors
.
toList
());
}
//
// 3.检查气瓶唯一标识码是否存在
//
Set<String> sequenceCodes = getAllData(FillingBeforeFieldEnum.sequenceCode.name(), jsonArray);
//
errorRows = getNotExistSequenceCodes(sequenceCodes);
//
if (!ObjectUtils.isEmpty(errorRows)) {
//
return errorRows.stream().map(e -> "气瓶唯一标识码不存在:" + e).collect(Collectors.toList());
//
}
//
// 4.检查企业统一社会信用代码是否存在
//
Set<String> creditCodes = getAllData(FillingBeforeFieldEnum.creditCode.name(), jsonArray);
//
errorRows = getNotExistEnterpriseInfoByCreditCode(creditCodes);
//
if (!ObjectUtils.isEmpty(errorRows)) {
//
return errorRows.stream().map(e -> "企业统一社会信用代码不存在:" + e).collect(Collectors.toList());
//
}
return
null
;
}
...
...
@@ -273,25 +273,25 @@ public class CylinderFillingDataValidationService {
// 1.必填校验
List
<
String
>
errorRows
=
validateRequired
(
FillingAfterFieldEnum
.
getAllRequireKeys
(),
jsonArray
);
if
(!
ObjectUtils
.
isEmpty
(
errorRows
))
{
return
errorRows
.
stream
().
map
(
e
->
"必填字段为空::"
+
e
).
collect
(
Collectors
.
toList
());
return
errorRows
.
stream
().
map
(
e
->
"必填字段
不能
为空::"
+
e
).
collect
(
Collectors
.
toList
());
}
// 2.本次上传数据唯一性校验
errorRows
=
validateUnique
(
FillingAfterFieldEnum
.
getAllUniqueKeys
(),
jsonArray
);
if
(!
ObjectUtils
.
isEmpty
(
errorRows
))
{
return
errorRows
.
stream
().
map
(
e
->
"上传数据重复:"
+
e
).
collect
(
Collectors
.
toList
());
}
// 3.检查气瓶唯一标识码是否存在
Set
<
String
>
sequenceCodes
=
getAllData
(
FillingBeforeFieldEnum
.
sequenceCode
.
name
(),
jsonArray
);
errorRows
=
getNotExistSequenceCodes
(
sequenceCodes
);
if
(!
ObjectUtils
.
isEmpty
(
errorRows
))
{
return
errorRows
.
stream
().
map
(
e
->
"气瓶唯一标识码不存在:"
+
e
).
collect
(
Collectors
.
toList
());
}
// 4.检查企业统一社会信用代码是否存在
Set
<
String
>
creditCodes
=
getAllData
(
FillingBeforeFieldEnum
.
creditCode
.
name
(),
jsonArray
);
errorRows
=
getNotExistEnterpriseInfoByCreditCode
(
creditCodes
);
if
(!
ObjectUtils
.
isEmpty
(
errorRows
))
{
return
errorRows
.
stream
().
map
(
e
->
"企业统一社会信用代码不存在:"
+
e
).
collect
(
Collectors
.
toList
());
}
//
// 3.检查气瓶唯一标识码是否存在
//
Set<String> sequenceCodes = getAllData(FillingBeforeFieldEnum.sequenceCode.name(), jsonArray);
//
errorRows = getNotExistSequenceCodes(sequenceCodes);
//
if (!ObjectUtils.isEmpty(errorRows)) {
//
return errorRows.stream().map(e -> "气瓶唯一标识码不存在:" + e).collect(Collectors.toList());
//
}
//
// 4.检查企业统一社会信用代码是否存在
//
Set<String> creditCodes = getAllData(FillingBeforeFieldEnum.creditCode.name(), jsonArray);
//
errorRows = getNotExistEnterpriseInfoByCreditCode(creditCodes);
//
if (!ObjectUtils.isEmpty(errorRows)) {
//
return errorRows.stream().map(e -> "企业统一社会信用代码不存在:" + e).collect(Collectors.toList());
//
}
return
null
;
}
...
...
@@ -306,7 +306,7 @@ public class CylinderFillingDataValidationService {
for
(
int
i
=
0
;
i
<
jsonArray
.
size
();
i
++)
{
JSONObject
row
=
jsonArray
.
getJSONObject
(
i
);
for
(
String
key
:
keys
)
{
if
(!
row
.
containsKey
(
key
)
||
row
.
get
(
key
)
==
null
)
{
if
(!
row
.
containsKey
(
key
)
||
ObjectUtils
.
isEmpty
(
row
.
get
(
key
)
)
)
{
errorList
.
add
(
row
.
toString
());
}
}
...
...
amos-boot-data/amos-boot-data-openapi/src/main/resources/application-vb.properties
View file @
6a822815
...
...
@@ -2,33 +2,33 @@ spring.application.name=AMOS-API-OPENAPI
server.servlet.context-path
=
/openapi
server.port
=
11001
# jdbc_config
spring.datasource.url
=
jdbc:vastbase://172.16.10.243:5432/tzs_amos_tzs_biz_init?currentSchema=amos_openapi_cyl&allowMultiQueries=true
spring.datasource.username
=
admin
spring.datasource.password
=
Yeejoin@2023
spring.datasource.driver-class-name
=
cn.com.vastbase.Driver
spring.datasource.dynamic.primary
=
openapi
#spring.datasource.url=jdbc:vastbase://172.16.10.243:5432/tzs_amos_tzs_biz_init?currentSchema=amos_openapi_cyl&allowMultiQueries=true
#spring.datasource.username=admin
#spring.datasource.password=Yeejoin@2023
#spring.datasource.driver-class-name=cn.com.vastbase.Driver
#ds tzs
spring.datasource.dynamic.datasource.openapi.url
=
jdbc:vastbase://172.16.10.243:5432/tzs_amos_tzs_biz_init?currentSchema=amos_openapi_cyl&allowMultiQueries=true
spring.datasource.dynamic.datasource.openapi.username
=
admin
spring.datasource.dynamic.datasource.openapi.password
=
Yeejoin@2023
spring.datasource.dynamic.datasource.openapi.driver-class-name
=
cn.com.vastbase.Driver
#ds cyl
spring.datasource.dynamic.datasource.tzs.url
=
jdbc:vastbase://172.16.10.243:5432/tzs_amos_tzs_biz_init?currentSchema=amos_
openapi_cyl
&allowMultiQueries=true
spring.datasource.dynamic.datasource.tzs.url
=
jdbc:vastbase://172.16.10.243:5432/tzs_amos_tzs_biz_init?currentSchema=amos_
tzs_biz
&allowMultiQueries=true
spring.datasource.dynamic.datasource.tzs.username
=
admin
spring.datasource.dynamic.datasource.tzs.password
=
Yeejoin@2023
spring.datasource.dynamic.datasource.tzs.driver-class-name
=
cn.com.vastbase.Driver
spring.datasource.type
=
com.zaxxer.hikari.HikariDataSource
spring.datasource.
hikari.minimum-idle
=
5
spring.datasource.
hikari.maximum-pool-size
=
1
5
spring.datasource.hikari.auto-commit
=
true
spring.datasource.hikari.idle-timeout
=
30000
spring.datasource.hikari.pool-name
=
DatebookHikariCP
spring.datasource.hikari.max-lifetime
=
1800000
spring.datasource.hikari.connection-timeout
=
30000
spring.datasource.hikari.connection-test-query
=
SELECT 1
spring.datasource.
dynamic.
type
=
com.zaxxer.hikari.HikariDataSource
spring.datasource.
dynamic.hikari.minimum-idle
=
1
spring.datasource.
dynamic.hikari.maximum-pool-size
=
5
spring.datasource.
dynamic.
hikari.auto-commit
=
true
spring.datasource.
dynamic.
hikari.idle-timeout
=
30000
spring.datasource.
dynamic.
hikari.pool-name
=
DatebookHikariCP
spring.datasource.
dynamic.
hikari.max-lifetime
=
1800000
spring.datasource.
dynamic.
hikari.connection-timeout
=
30000
spring.datasource.
dynamic.
hikari.connection-test-query
=
SELECT 1
# REDIS (RedisProperties)
spring.redis.database
=
1
...
...
@@ -46,11 +46,11 @@ eureka.client.service-url.defaultZone =http://admin:a1234560@172.16.10.243:10001
eureka.instance.prefer-ip-address
=
true
management.endpoint.health.show-details
=
always
management.endpoints.web.exposure.include
=
*
eureka.instance.health-check-url
=
http://172.16.3.
89
:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.health-check-url
=
http://172.16.3.
7
:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.metadata-map.management.context-path
=
${server.servlet.context-path}/actuator
eureka.instance.status-page-url
=
http://172.16.3.
89
:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs
=
http://172.16.3.
89
:${server.port}${server.servlet.context-path}/doc.html
eureka.instance.ip-address
=
172.16.3.
89
eureka.instance.status-page-url
=
http://172.16.3.
7
:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs
=
http://172.16.3.
7
:${server.port}${server.servlet.context-path}/doc.html
eureka.instance.ip-address
=
172.16.3.
7
##emqx
emqx.clean-session
=
true
...
...
@@ -60,4 +60,9 @@ emqx.client-user-name=super
emqx.client-password
=
123456
##biz custem properties
biz.lxyd.lift.url
=
http://39.106.181.149:8088/elevatorapi
\ No newline at end of file
biz.lxyd.lift.url
=
http://39.106.181.149:8088/elevatorapi
## ES properties:
elasticsearch.username
=
elastic
elasticsearch.password
=
a123456
spring.elasticsearch.rest.uris
=
http://172.16.10.243:9200
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment