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
f8cf0346
Commit
f8cf0346
authored
Aug 07, 2023
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加使用登记证编号和设备代码校验
parent
f4a6ddcf
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
26 deletions
+53
-26
CategoryOtherInfoMapper.java
...s/boot/module/ymt/api/mapper/CategoryOtherInfoMapper.java
+6
-0
IEquipmentCategoryService.java
...oot/module/ymt/api/service/IEquipmentCategoryService.java
+1
-1
CategoryOtherInfoMapper.xml
...api/src/main/resources/mapper/CategoryOtherInfoMapper.xml
+25
-0
EquipmentCategoryController.java
...odule/ymt/biz/controller/EquipmentCategoryController.java
+6
-6
EquipmentCategoryServiceImpl.java
...le/ymt/biz/service/impl/EquipmentCategoryServiceImpl.java
+15
-19
No files found.
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/mapper/CategoryOtherInfoMapper.java
View file @
f8cf0346
...
@@ -33,4 +33,10 @@ public interface CategoryOtherInfoMapper extends BaseMapper<CategoryOtherInfo> {
...
@@ -33,4 +33,10 @@ public interface CategoryOtherInfoMapper extends BaseMapper<CategoryOtherInfo> {
CategoryOtherInfo
queryInitCode
(
@Param
(
"initCode"
)
@NonNull
String
initCode
);
CategoryOtherInfo
queryInitCode
(
@Param
(
"initCode"
)
@NonNull
String
initCode
);
void
updateEsStatus
(
String
id
);
void
updateEsStatus
(
String
id
);
Map
<
String
,
Long
>
checkCode
(
@Param
(
"type"
)
String
type
,
@Param
(
"code96333"
)
String
code96333
,
@Param
(
"equCode"
)
String
equCode
,
@Param
(
"useOrgCode"
)
String
useOrgCode
,
@Param
(
"record"
)
String
record
);
}
}
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/service/IEquipmentCategoryService.java
View file @
f8cf0346
...
@@ -30,7 +30,7 @@ public interface IEquipmentCategoryService {
...
@@ -30,7 +30,7 @@ public interface IEquipmentCategoryService {
Map
<
String
,
Object
>
getCategoryAndDefineByRecord
(
String
rowId
);
Map
<
String
,
Object
>
getCategoryAndDefineByRecord
(
String
rowId
);
List
<
CategoryOtherInfo
>
checkCode
(
Map
<
String
,
Object
>
obj
);
String
checkCode
(
Map
<
String
,
Object
>
obj
);
List
<
String
>
updateOtherInfo
(
Map
<
String
,
Object
>
map
);
List
<
String
>
updateOtherInfo
(
Map
<
String
,
Object
>
map
);
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/resources/mapper/CategoryOtherInfoMapper.xml
View file @
f8cf0346
...
@@ -99,4 +99,29 @@
...
@@ -99,4 +99,29 @@
SET "IS_NOT_ES" = '1'
SET "IS_NOT_ES" = '1'
WHERE "RECORD" = #{id}
WHERE "RECORD" = #{id}
</update>
</update>
<select
id=
"checkCode"
resultType=
"java.util.Map"
>
SELECT
<if
test=
"equCode != null and equCode != ''"
>
(SELECT COUNT ( 1 ) FROM idx_biz_jg_register_info ibjri WHERE ibjri."EQU_CODE" = #{equCode}
<if
test=
"type != 'save' "
>
and ibjri."RECORD" != #{record}
</if>
) AS equCode,
</if>
<if
test=
"useOrgCode != null and useOrgCode != ''"
>
(SELECT COUNT ( 1 ) FROM idx_biz_jg_register_info ibjri WHERE ibjri."USE_ORG_CODE" = #{useOrgCode}
<if
test=
"type != 'save'"
>
and ibjri."RECORD" != #{record}
</if>
) AS useOrgCode,
</if>
<if
test=
"code96333 != null and code96333 != ''"
>
(SELECT COUNT ( 1 ) FROM idx_biz_jg_other_info ibjoi WHERE ibjoi."CODE96333" = #{code96333}
<if
test=
"type != 'save'"
>
and ibjoi."RECORD" != #{record}
</if>
) AS code
</if>
</select>
</mapper>
</mapper>
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-biz/src/main/java/com/yeejoin/amos/boot/module/ymt/biz/controller/EquipmentCategoryController.java
View file @
f8cf0346
...
@@ -235,17 +235,17 @@ public class EquipmentCategoryController extends BaseController {
...
@@ -235,17 +235,17 @@ public class EquipmentCategoryController extends BaseController {
return
ResponseHelper
.
buildResponse
(
equipmentCategoryService
.
getFormRecordById
(
map
));
return
ResponseHelper
.
buildResponse
(
equipmentCategoryService
.
getFormRecordById
(
map
));
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/checkCode"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/checkCode"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"post"
,
value
=
"校验
96333码"
,
notes
=
"校验96333码
"
)
@ApiOperation
(
httpMethod
=
"post"
,
value
=
"校验
使用登记证编号、设备代码、96333码重复"
,
notes
=
"校验使用登记证编号、设备代码、96333码重复
"
)
public
ResponseModel
<
Object
>
checkCode
(
@RequestBody
Map
<
String
,
Object
>
obj
){
public
ResponseModel
<
Object
>
checkCode
(
@RequestBody
Map
<
String
,
Object
>
obj
){
List
<
CategoryOtherInfo
>
categoryOtherInfos
=
equipmentCategoryService
.
checkCode
(
obj
);
String
message
=
equipmentCategoryService
.
checkCode
(
obj
);
if
(
categoryOtherInfos
.
size
()
==
0
){
if
(
ObjectUtils
.
isEmpty
(
message
)
){
return
ResponseHelper
.
buildResponse
(
categoryOtherInfos
);
return
ResponseHelper
.
buildResponse
(
true
);
}
else
{
}
else
{
ResponseModel
<
Object
>
response
=
new
ResponseModel
();
ResponseModel
<
Object
>
response
=
new
ResponseModel
();
response
.
setResult
(
null
);
response
.
setResult
(
null
);
response
.
setMessage
(
"96333码重复,请确认数据是否输入正确,或联系管辖机构处理。"
);
response
.
setMessage
(
message
);
response
.
setStatus
(
HttpStatus
.
BAD_REQUEST
.
value
());
response
.
setStatus
(
HttpStatus
.
BAD_REQUEST
.
value
());
return
response
;
return
response
;
}
}
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-biz/src/main/java/com/yeejoin/amos/boot/module/ymt/biz/service/impl/EquipmentCategoryServiceImpl.java
View file @
f8cf0346
...
@@ -25,17 +25,9 @@ import com.yeejoin.amos.boot.module.ymt.flc.api.feign.PrivilegeFeginService;
...
@@ -25,17 +25,9 @@ import com.yeejoin.amos.boot.module.ymt.flc.api.feign.PrivilegeFeginService;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.http.HttpHost
;
import
org.apache.http.auth.AuthScope
;
import
org.apache.http.auth.UsernamePasswordCredentials
;
import
org.apache.http.client.CredentialsProvider
;
import
org.apache.http.impl.client.BasicCredentialsProvider
;
import
org.apache.http.impl.nio.client.HttpAsyncClientBuilder
;
import
org.elasticsearch.action.search.SearchRequest
;
import
org.elasticsearch.action.search.SearchRequest
;
import
org.elasticsearch.action.search.SearchResponse
;
import
org.elasticsearch.action.search.SearchResponse
;
import
org.elasticsearch.client.RequestOptions
;
import
org.elasticsearch.client.RequestOptions
;
import
org.elasticsearch.client.RestClient
;
import
org.elasticsearch.client.RestClientBuilder
;
import
org.elasticsearch.client.RestHighLevelClient
;
import
org.elasticsearch.client.RestHighLevelClient
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.elasticsearch.index.query.QueryBuilders
;
...
@@ -85,10 +77,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
...
@@ -85,10 +77,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
private
SuperviseInfoMapper
superviseInfoMapper
;
private
SuperviseInfoMapper
superviseInfoMapper
;
@Autowired
@Autowired
private
UseInfoMapper
useInfoMapper
;
@Autowired
EquipmentCategoryMapper
equipmentCategoryMapper
;
EquipmentCategoryMapper
equipmentCategoryMapper
;
@Value
(
"classpath:/json/equipCategory.json"
)
@Value
(
"classpath:/json/equipCategory.json"
)
...
@@ -418,14 +406,22 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
...
@@ -418,14 +406,22 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
}
}
@Override
@Override
public
List
<
CategoryOtherInfo
>
checkCode
(
Map
<
String
,
Object
>
obj
)
{
public
String
checkCode
(
Map
<
String
,
Object
>
obj
)
{
List
<
CategoryOtherInfo
>
codeList
;
String
result
=
null
;
if
(
"save"
.
equals
(
obj
.
get
(
"type"
)))
{
String
type
=
(
String
)
obj
.
get
(
"type"
);
codeList
=
categoryOtherInfoMapper
.
selectList
(
new
QueryWrapper
<
CategoryOtherInfo
>().
eq
(
"CODE96333"
,
obj
.
get
(
"CODE96333"
)).
eq
(
"CLAIM_STATUS"
,
EquipmentCategoryEnum
.
YRL
.
getName
()));
String
code96333
=
String
.
valueOf
(
obj
.
get
(
"CODE96333"
));
}
else
{
String
equCode
=
(
String
)
obj
.
get
(
"EQU_CODE"
);
codeList
=
categoryOtherInfoMapper
.
selectList
(
new
QueryWrapper
<
CategoryOtherInfo
>().
ne
(
"RECORD"
,
obj
.
get
(
"id"
)).
eq
(
"CODE96333"
,
obj
.
get
(
"CODE96333"
)).
eq
(
"CLAIM_STATUS"
,
EquipmentCategoryEnum
.
YRL
.
getName
()));
String
useOrgCode
=
(
String
)
obj
.
get
(
"USE_ORG_CODE"
);
String
record
=
(
String
)
obj
.
get
(
"id"
);
Map
<
String
,
Long
>
map
=
categoryOtherInfoMapper
.
checkCode
(
type
,
code96333
,
equCode
,
useOrgCode
,
record
);
if
(
map
.
containsKey
(
"equCode"
)
&&
map
.
get
(
"equCode"
)
>
0
){
result
=
"设备代码重复,请确认数据是否输入正确,或联系管辖机构处理。"
;
}
else
if
(
map
.
containsKey
(
"useOrgCode"
)
&&
map
.
get
(
"useOrgCode"
)
>
0
){
result
=
"使用登记证编号重复,请确认数据是否输入正确,或联系管辖机构处理。"
;
}
else
if
(
map
.
containsKey
(
"code"
)
&&
map
.
get
(
"code"
)
>
0
){
result
=
"96333码重复,请确认数据是否输入正确,或联系管辖机构处理。"
;
}
}
return
codeLis
t
;
return
resul
t
;
}
}
@Override
@Override
...
...
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