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
64e4148e
Commit
64e4148e
authored
Apr 07, 2023
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
openApi赋码
parent
7f2bfc34
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
232 additions
and
82 deletions
+232
-82
SuperviseController.java
...join/amos/api/openapi/controller/SuperviseController.java
+13
-1
CreateCodeService.java
...join/amos/api/openapi/face/service/CreateCodeService.java
+17
-0
UnitLicenceService.java
...oin/amos/api/openapi/face/service/UnitLicenceService.java
+0
-1
TzsServiceFeignClient.java
...yeejoin/amos/api/openapi/feign/TzsServiceFeignClient.java
+10
-1
EquInfoDto.java
.../com/yeejoin/amos/boot/module/tzs/api/dto/EquInfoDto.java
+4
-0
SupervisoryCodeInfo.java
.../amos/boot/module/tzs/api/entity/SupervisoryCodeInfo.java
+32
-0
EquipmentCategoryEnum.java
...amos/boot/module/tzs/api/enums/EquipmentCategoryEnum.java
+4
-1
CategoryOtherInfoMapper.java
...s/boot/module/tzs/api/mapper/CategoryOtherInfoMapper.java
+4
-1
SupervisoryCodeInfoMapper.java
...boot/module/tzs/api/mapper/SupervisoryCodeInfoMapper.java
+14
-0
IEquipmentCategoryService.java
...oot/module/tzs/api/service/IEquipmentCategoryService.java
+1
-2
CategoryOtherInfoMapper.xml
...api/src/main/resources/mapper/CategoryOtherInfoMapper.xml
+23
-23
EquipmentCategoryMapper.xml
...api/src/main/resources/mapper/EquipmentCategoryMapper.xml
+1
-1
EquipmentCategoryController.java
...odule/tzs/biz/controller/EquipmentCategoryController.java
+2
-2
EquipmentCategoryServiceImpl.java
...le/tzs/biz/service/impl/EquipmentCategoryServiceImpl.java
+107
-49
No files found.
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/controller/SuperviseController.java
View file @
64e4148e
...
@@ -8,7 +8,6 @@ import com.yeejoin.amos.api.openapi.face.service.*;
...
@@ -8,7 +8,6 @@ import com.yeejoin.amos.api.openapi.face.service.*;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
net.sf.json.JSONObject
;
import
net.sf.json.JSONObject
;
import
org.checkerframework.checker.units.qual.A
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.component.event.RestEventTrigger
;
import
org.typroject.tyboot.component.event.RestEventTrigger
;
...
@@ -16,6 +15,7 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
...
@@ -16,6 +15,7 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* 监管业务数据对接
* 监管业务数据对接
...
@@ -75,6 +75,9 @@ public class SuperviseController {
...
@@ -75,6 +75,9 @@ public class SuperviseController {
@Autowired
@Autowired
private
TechInfoService
techInfoService
;
private
TechInfoService
techInfoService
;
@Autowired
private
CreateCodeService
createCodeService
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
value
=
"新增设计信息"
)
@ApiOperation
(
value
=
"新增设计信息"
)
@PostMapping
(
value
=
"/designInfo"
)
@PostMapping
(
value
=
"/designInfo"
)
...
@@ -217,4 +220,13 @@ public class SuperviseController {
...
@@ -217,4 +220,13 @@ public class SuperviseController {
{
{
return
ResponseHelper
.
buildResponse
(
techInfoService
.
saveTechInfo
(
techInfo
));
return
ResponseHelper
.
buildResponse
(
techInfoService
.
saveTechInfo
(
techInfo
));
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
value
=
"赋码"
)
@PostMapping
(
value
=
"/generation/code"
)
@RestEventTrigger
(
value
=
"openapiLogEventHandler"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
createCode
(
@RequestBody
Map
<
String
,
Object
>
map
){
return
ResponseHelper
.
buildResponse
(
createCodeService
.
createCode
(
map
));
}
}
}
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/CreateCodeService.java
0 → 100644
View file @
64e4148e
package
com
.
yeejoin
.
amos
.
api
.
openapi
.
face
.
service
;
import
com.yeejoin.amos.api.openapi.feign.TzsServiceFeignClient
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Map
;
@Service
public
class
CreateCodeService
{
@Autowired
TzsServiceFeignClient
tzsServiceFeignClient
;
public
Map
<
String
,
Object
>
createCode
(
Map
<
String
,
Object
>
map
)
{
return
tzsServiceFeignClient
.
createCode
(
map
).
getResult
();
}
}
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/UnitLicenceService.java
View file @
64e4148e
...
@@ -4,7 +4,6 @@ import com.yeejoin.amos.api.openapi.face.model.UnitLicenceModel;
...
@@ -4,7 +4,6 @@ import com.yeejoin.amos.api.openapi.face.model.UnitLicenceModel;
import
com.yeejoin.amos.api.openapi.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.api.openapi.feign.TzsServiceFeignClient
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.List
;
import
java.util.List
;
...
...
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/feign/TzsServiceFeignClient.java
View file @
64e4148e
...
@@ -3,7 +3,6 @@ package com.yeejoin.amos.api.openapi.feign;
...
@@ -3,7 +3,6 @@ package com.yeejoin.amos.api.openapi.feign;
import
com.yeejoin.amos.api.openapi.config.MultipartSupportConfig
;
import
com.yeejoin.amos.api.openapi.config.MultipartSupportConfig
;
import
com.yeejoin.amos.api.openapi.face.model.UnitLicenceModel
;
import
com.yeejoin.amos.api.openapi.face.model.UnitLicenceModel
;
import
net.sf.json.JSONObject
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -12,6 +11,7 @@ import org.springframework.web.bind.annotation.RequestParam;
...
@@ -12,6 +11,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
@FeignClient
(
name
=
"TZS"
,
path
=
"/tzs"
,
configuration
=
@FeignClient
(
name
=
"TZS"
,
path
=
"/tzs"
,
configuration
=
{
MultipartSupportConfig
.
class
})
{
MultipartSupportConfig
.
class
})
...
@@ -24,4 +24,13 @@ public interface TzsServiceFeignClient {
...
@@ -24,4 +24,13 @@ public interface TzsServiceFeignClient {
*/
*/
@RequestMapping
(
value
=
"/baseUnitLicence/licences"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/baseUnitLicence/licences"
,
method
=
RequestMethod
.
GET
)
ResponseModel
<
List
<
UnitLicenceModel
>>
getLicenceByUnitCode
(
@RequestParam
String
unitCode
);
ResponseModel
<
List
<
UnitLicenceModel
>>
getLicenceByUnitCode
(
@RequestParam
String
unitCode
);
/**
* 创建监管码及96333
* @param map 请求体
* @return
*/
@RequestMapping
(
value
=
"/equipment-category/createSupervisorCode"
,
method
=
RequestMethod
.
POST
)
ResponseModel
<
Map
<
String
,
Object
>>
createCode
(
@RequestBody
Map
<
String
,
Object
>
map
);
}
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/dto/EquInfoDto.java
View file @
64e4148e
...
@@ -44,4 +44,8 @@ public class EquInfoDto {
...
@@ -44,4 +44,8 @@ public class EquInfoDto {
*/
*/
private
String
status
;
private
String
status
;
/**
* 设备状态
*/
private
String
equState
;
}
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/entity/SupervisoryCodeInfo.java
0 → 100644
View file @
64e4148e
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
/**
* 八大类其他信息
*
*/
@Data
@Accessors
(
chain
=
true
)
@TableName
(
"biz_jg_supervisory_code"
)
@ApiModel
(
value
=
"SupervisoryCodeInfo"
,
description
=
"监管码"
)
public
class
SupervisoryCodeInfo
extends
BaseEntity
{
@ApiModelProperty
(
value
=
"监管码"
)
@TableField
(
"supervisory_code"
)
private
String
supervisoryCode
;
@ApiModelProperty
(
value
=
"电梯救援码"
)
@TableField
(
"code96333"
)
private
String
code96333
;
@ApiModelProperty
(
value
=
"使用状态(0-初始,1-已使用,2-未使用)"
)
@TableField
(
"status"
)
private
String
status
;
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/enums/EquipmentCategoryEnum.java
View file @
64e4148e
...
@@ -18,7 +18,10 @@ public enum EquipmentCategoryEnum {
...
@@ -18,7 +18,10 @@ public enum EquipmentCategoryEnum {
XZQH
(
"行政区划"
,
"XZQH"
),
XZQH
(
"行政区划"
,
"XZQH"
),
BLW
(
"补零位"
,
"0"
),
BLW
(
"补零位"
,
"0"
),
JGM
(
"监管码初始码"
,
"0000001"
),
JGM
(
"监管码初始码"
,
"0000001"
),
CSM
(
"96333初始码"
,
"00001"
);
CSM
(
"96333初始码"
,
"00001"
),
CSZT
(
"初始状态"
,
"0"
),
YSY
(
"已使用"
,
"1"
),
WSY
(
"未使用"
,
"2"
);
private
String
name
;
private
String
name
;
private
String
code
;
private
String
code
;
...
...
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/mapper/CategoryOtherInfoMapper.java
View file @
64e4148e
...
@@ -17,7 +17,10 @@ public interface CategoryOtherInfoMapper extends BaseMapper<CategoryOtherInfo> {
...
@@ -17,7 +17,10 @@ public interface CategoryOtherInfoMapper extends BaseMapper<CategoryOtherInfo> {
CategoryOtherInfo
selectSupervisorCode
(
@Param
(
"supervisorCode"
)
String
supervisorCode
);
CategoryOtherInfo
selectSupervisorCode
(
@Param
(
"supervisorCode"
)
String
supervisorCode
);
CategoryOtherInfo
selectElevatorCode
(
@Param
(
"elevatorCode"
)
String
elevatorCode
);
CategoryOtherInfo
selectElevatorCode
(
@Param
(
"elevatorCode"
)
String
elevatorCode
,
String
status
);
EquInfoDto
selectEquipInfo
(
String
record
);
EquInfoDto
selectEquipInfo
(
String
record
);
int
updateCode
(
String
supervisorCode
,
String
equState
);
}
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/mapper/SupervisoryCodeInfoMapper.java
0 → 100644
View file @
64e4148e
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.SupervisoryCodeInfo
;
/**
* 装备分类 Mapper 接口
*
* @author system_generator
* @date 2021-10-20
*/
public
interface
SupervisoryCodeInfoMapper
extends
BaseMapper
<
SupervisoryCodeInfo
>
{
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/service/IEquipmentCategoryService.java
View file @
64e4148e
...
@@ -19,12 +19,11 @@ public interface IEquipmentCategoryService {
...
@@ -19,12 +19,11 @@ public interface IEquipmentCategoryService {
Page
equipClaimOverview
();
Page
equipClaimOverview
();
int
createSupervisorCode
(
Map
<
String
,
Object
>
map
,
String
record
);
Map
<
String
,
String
>
createSupervisorCode
(
Map
<
String
,
Object
>
map
,
String
record
);
List
<
LinkedHashMap
>
getTree
();
List
<
LinkedHashMap
>
getTree
();
List
<
LinkedHashMap
>
creatTree
();
List
<
LinkedHashMap
>
creatTree
();
// List<LinkedHashMap> getRegion(String level, String parentId);
List
<
LinkedHashMap
>
getRegion
(
String
level
,
String
parentId
);
List
<
LinkedHashMap
>
getRegion
(
String
level
,
String
parentId
);
Map
<
String
,
Object
>
getCategoryAndDefineByRecord
(
String
rowId
);
Map
<
String
,
Object
>
getCategoryAndDefineByRecord
(
String
rowId
);
...
...
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/resources/mapper/CategoryOtherInfoMapper.xml
View file @
64e4148e
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.tzs.api.mapper.CategoryOtherInfoMapper"
>
<mapper
namespace=
"com.yeejoin.amos.boot.module.tzs.api.mapper.CategoryOtherInfoMapper"
>
<select
id=
"selectSupervisorCode"
resultType=
"com.yeejoin.amos.boot.module.tzs.api.entity.CategoryOtherInfo"
>
<select
id=
"selectSupervisorCode"
resultType=
"com.yeejoin.amos.boot.module.tzs.api.entity.CategoryOtherInfo"
>
SELECT SUPERVISORY_CODE
SELECT
FROM biz_jg_supervisory_code bjsc
SUPERVISORY_CODE
WHERE SUPERVISORY_CODE LIKE CONCAT(#{supervisorCode}, '%')
FROM
idx_biz_jg_other_info oi
WHERE
SUPERVISORY_CODE LIKE CONCAT ( #{supervisorCode}, '%' )
ORDER BY
ORDER BY
RIGHT ( SUPERVISORY_CODE, 5 ) DESC
RIGHT ( SUPERVISORY_CODE, 5 ) DESC
LIMIT 1
LIMIT 1
</select>
</select>
<update
id=
"updateSupervisorCode"
>
<update
id=
"updateSupervisorCode"
>
UPDATE idx_biz_jg_other_info
UPDATE idx_biz_jg_other_info
SET
SET
"RECORD" = #{record}
"RECORD" = #{record}
...
@@ -29,32 +24,37 @@
...
@@ -29,32 +24,37 @@
"RECORD" = #{record}
"RECORD" = #{record}
</update>
</update>
<select
id=
"selectElevatorCode"
resultType=
"com.yeejoin.amos.boot.module.tzs.api.entity.CategoryOtherInfo"
>
<select
id=
"selectElevatorCode"
resultType=
"com.yeejoin.amos.boot.module.tzs.api.entity.CategoryOtherInfo"
>
SELECT
SELECT CODE96333 code
CODE96333 code
FROM biz_jg_supervisory_code bjsc
FROM
WHERE CODE96333 LIKE CONCAT(#{elevatorCode}, '%')
idx_biz_jg_other_info oi
<if
test=
"status != null and status != ''"
>
WHERE
and status = #{status}
CODE96333 LIKE CONCAT ( #{elevatorCode}, '%' )
</if>
ORDER BY
ORDER BY
RIGHT ( CODE96333, 2 ) DESC
RIGHT ( CODE96333, 2 ) DESC
LIMIT 1
LIMIT 1
</select>
</select>
<select
id=
"selectEquipInfo"
resultType=
"com.yeejoin.amos.boot.module.tzs.api.dto.EquInfoDto"
>
<select
id=
"selectEquipInfo"
resultType=
"com.yeejoin.amos.boot.module.tzs.api.dto.EquInfoDto"
>
SELECT
SELECT "CITY",
"CITY",
"COUNTY",
"COUNTY",
"EQU_LIST" equipList,
"EQU_LIST" equipList,
"EQU_CATEGORY" equipCategory,
"EQU_CATEGORY" equipCategory,
ibjoi."CODE96333" code,
ibjoi."CODE96333" code,
ibjoi."CLAIM_STATUS" status,
ibjoi."CLAIM_STATUS" status,
ibjoi."SUPERVISORY_CODE" supervisor,
ibjoi."SUPERVISORY_CODE" supervisor,
ibjoi."RECORD"
ibjoi."RECORD",
FROM
ibjui."EQU_STATE" equState
idx_biz_jg_other_info ibjoi
FROM
idx_biz_jg_other_info ibjoi
LEFT JOIN idx_biz_jg_register_info ibjri ON ibjoi.RECORD = ibjri.RECORD
LEFT JOIN idx_biz_jg_register_info ibjri ON ibjoi.RECORD = ibjri.RECORD
LEFT JOIN idx_biz_jg_use_info ibjui ON ibjoi.RECORD = ibjui.RECORD
LEFT JOIN idx_biz_jg_use_info ibjui ON ibjoi.RECORD = ibjui.RECORD
WHERE ibjoi."RECORD" = #{record}
WHERE ibjoi."RECORD" = #{record}
</select>
</select>
<update
id=
"updateCode"
>
UPDATE biz_jg_supervisory_code bjsc
SET status = #{equState}
WHERE SUPERVISORY_CODE = #{supervisorCode}
</update>
</mapper>
</mapper>
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/resources/mapper/EquipmentCategoryMapper.xml
View file @
64e4148e
...
@@ -77,7 +77,7 @@
...
@@ -77,7 +77,7 @@
cb_data_dictionary
cb_data_dictionary
WHERE
WHERE
type= #{division}
type= #{division}
AND extend
= #{county}
AND extend
LIKE CONCAT('%',#{county},'%')
</select>
</select>
...
...
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/EquipmentCategoryController.java
View file @
64e4148e
...
@@ -189,8 +189,8 @@ public class EquipmentCategoryController extends BaseController {
...
@@ -189,8 +189,8 @@ public class EquipmentCategoryController extends BaseController {
*
*
* @return
* @return
*/
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@
PostMapping
(
value
=
"/createSupervisorCode"
)
@
RequestMapping
(
value
=
"/createSupervisorCode"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"生成监管码和96333码"
,
notes
=
"生成监管码和96333码"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"生成监管码和96333码"
,
notes
=
"生成监管码和96333码"
)
public
ResponseModel
<
Object
>
createSupervisorCode
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
public
ResponseModel
<
Object
>
createSupervisorCode
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
return
ResponseHelper
.
buildResponse
(
equipmentCategoryService
.
createSupervisorCode
(
map
,
null
));
return
ResponseHelper
.
buildResponse
(
equipmentCategoryService
.
createSupervisorCode
(
map
,
null
));
...
...
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/EquipmentCategoryServiceImpl.java
View file @
64e4148e
...
@@ -9,11 +9,13 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.EquInfoDto;
...
@@ -9,11 +9,13 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.EquInfoDto;
import
com.yeejoin.amos.boot.module.tzs.api.dto.EquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.EquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.CategoryOtherInfo
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.CategoryOtherInfo
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.EquipmentCategory
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.EquipmentCategory
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.SupervisoryCodeInfo
;
import
com.yeejoin.amos.boot.module.tzs.api.enums.EquimentEnum
;
import
com.yeejoin.amos.boot.module.tzs.api.enums.EquimentEnum
;
import
com.yeejoin.amos.boot.module.tzs.api.enums.EquipmentCategoryEnum
;
import
com.yeejoin.amos.boot.module.tzs.api.enums.EquipmentCategoryEnum
;
import
com.yeejoin.amos.boot.module.tzs.api.enums.EquipmentClassifityEnum
;
import
com.yeejoin.amos.boot.module.tzs.api.enums.EquipmentClassifityEnum
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.CategoryOtherInfoMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.CategoryOtherInfoMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.EquipmentCategoryMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.EquipmentCategoryMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.SupervisoryCodeInfoMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.service.IEquipmentCategoryService
;
import
com.yeejoin.amos.boot.module.tzs.api.service.IEquipmentCategoryService
;
import
com.yeejoin.amos.boot.module.tzs.biz.utils.JsonUtils
;
import
com.yeejoin.amos.boot.module.tzs.biz.utils.JsonUtils
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.feign.IdxFeignService
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.feign.IdxFeignService
;
...
@@ -54,6 +56,9 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
...
@@ -54,6 +56,9 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
CategoryOtherInfoMapper
categoryOtherInfoMapper
;
CategoryOtherInfoMapper
categoryOtherInfoMapper
;
@Autowired
@Autowired
SupervisoryCodeInfoMapper
supervisoryCodeInfoMapper
;
@Autowired
PrivilegeFeginService
privilegeFeginService
;
PrivilegeFeginService
privilegeFeginService
;
@Autowired
@Autowired
IdxFeignService
idxFeignService
;
IdxFeignService
idxFeignService
;
...
@@ -123,16 +128,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
...
@@ -123,16 +128,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
String
orgCode
=
object
.
getString
(
"orgCode"
);
String
orgCode
=
object
.
getString
(
"orgCode"
);
String
companyCode
=
object
.
getString
(
"companyCode"
);
String
companyCode
=
object
.
getString
(
"companyCode"
);
for
(
Map
map
:
mapList
)
{
for
(
Map
map
:
mapList
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
categoryCountMap
=
equipmentCategoryMapper
.
getCategoryCount
(
map
.
get
(
"code"
).
toString
(),
level
,
orgCode
,
companyCode
);
Map
<
String
,
Object
>
map1
=
equipmentCategoryMapper
.
getCategoryCount
(
map
.
get
(
"code"
).
toString
(),
level
,
orgCode
,
companyCode
);
categoryCountMap
.
put
(
"name"
,
map
.
get
(
"name"
));
resultMap
.
put
(
"name"
,
map
.
get
(
"name"
));
categoryCountMap
.
put
(
"image"
,
map
.
get
(
"image"
));
resultMap
.
put
(
"image"
,
map
.
get
(
"image"
));
Long
sum
=
Long
.
valueOf
(
categoryCountMap
.
get
(
"waitClaim"
).
toString
())
+
Long
.
valueOf
(
categoryCountMap
.
get
(
"alreadyClaim"
).
toString
())
+
Long
.
valueOf
(
categoryCountMap
.
get
(
"refuseClaim"
).
toString
());
resultMap
.
put
(
"waitClaim"
,
map1
.
get
(
"waitClaim"
));
categoryCountMap
.
put
(
"sum"
,
sum
);
resultMap
.
put
(
"alreadyClaim"
,
map1
.
get
(
"alreadyClaim"
));
list
.
add
(
categoryCountMap
);
resultMap
.
put
(
"refuseClaim"
,
map1
.
get
(
"refuseClaim"
));
Long
sum
=
Long
.
valueOf
(
map1
.
get
(
"waitClaim"
).
toString
())
+
Long
.
valueOf
(
map1
.
get
(
"alreadyClaim"
).
toString
())
+
Long
.
valueOf
(
map1
.
get
(
"refuseClaim"
).
toString
());
resultMap
.
put
(
"sum"
,
sum
);
list
.
add
(
resultMap
);
}
}
page
.
setCurrent
(
1
);
page
.
setCurrent
(
1
);
page
.
setTotal
(
list
.
size
());
page
.
setTotal
(
list
.
size
());
...
@@ -144,38 +145,53 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
...
@@ -144,38 +145,53 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
* 生成监管码和电梯96333识别码
* 生成监管码和电梯96333识别码
*/
*/
@Override
@Override
public
int
createSupervisorCode
(
Map
<
String
,
Object
>
map
,
String
record
)
{
public
Map
<
String
,
String
>
createSupervisorCode
(
Map
<
String
,
Object
>
map
,
String
record
)
{
String
city
,
county
,
equipCategory
,
equipList
;
String
city
,
county
,
equipCategory
;
if
(
ObjectUtils
.
isEmpty
(
record
))
{
if
(
ObjectUtils
.
isEmpty
(
record
))
{
//获取对应城市、区县值
//获取对应行政区划
city
=
map
.
get
(
"CITY"
).
toString
();
county
=
EquipmentCategoryEnum
.
XZQH
.
getCode
();
county
=
map
.
get
(
"COUNTY"
).
toString
();
city
=
map
.
get
(
"regionCode"
).
toString
();
//获取对应种类、类别值
//获取对应设备分类
equipCategory
=
map
.
get
(
"EQU_CATEGORY"
).
toString
();
equipCategory
=
map
.
get
(
"equCategory"
).
toString
();
equipList
=
map
.
get
(
"EQU_LIST"
).
toString
();
}
else
{
}
else
{
EquInfoDto
equInfoDto
=
categoryOtherInfoMapper
.
selectEquipInfo
(
record
);
EquInfoDto
equInfoDto
=
categoryOtherInfoMapper
.
selectEquipInfo
(
record
);
//判断这条数据认领状态是否为已认领(6035),且是否已经有电梯96333码和监管码
//判断这条数据认领状态是否为已认领(6035),且是否已经有电梯96333码和监管码
//如果都满足则直接返回不做生成码操作
//如果都满足则直接返回不做生成码操作
if
(!
ObjectUtils
.
isEmpty
(
equInfoDto
)
&&
"6035"
.
equals
(
equInfoDto
.
getStatus
())
&&
(
ObjectUtils
.
isEmpty
(
equInfoDto
.
getSupervisor
())
||
ObjectUtils
.
isEmpty
(
equInfoDto
.
getCode
()))
)
{
if
(!
ObjectUtils
.
isEmpty
(
equInfoDto
)
&&
"6035"
.
equals
(
equInfoDto
.
getStatus
()))
{
city
=
equInfoDto
.
getCity
();
city
=
equInfoDto
.
getCity
();
county
=
equInfoDto
.
getCounty
();
county
=
equInfoDto
.
getCounty
();
equipCategory
=
equInfoDto
.
getEquipCategory
();
equipCategory
=
equInfoDto
.
getEquipCategory
();
equipList
=
equInfoDto
.
getEquipList
();
}
else
{
}
else
{
return
0
;
return
new
HashMap
<>()
;
}
}
}
}
//生成码
//生成码
Map
<
String
,
String
>
codeMap
;
Map
<
String
,
String
>
codeMap
;
synchronized
(
EquipmentCategoryServiceImpl
.
class
)
{
synchronized
(
EquipmentCategoryServiceImpl
.
class
)
{
codeMap
=
creatCode
(
city
,
county
,
equipCategory
,
equipList
,
record
);
codeMap
=
creatCode
(
city
,
county
,
equipCategory
,
record
);
}
}
if
(
ObjectUtils
.
isEmpty
(
codeMap
))
{
if
(
ObjectUtils
.
isEmpty
(
codeMap
))
{
return
0
;
return
new
HashMap
<>()
;
}
}
log
.
info
(
record
+
"已生成对应监管码或96333电梯识别码"
);
log
.
info
(
record
+
"已生成对应监管码或96333电梯识别码"
);
return
categoryOtherInfoMapper
.
updateSupervisorCode
(
codeMap
.
get
(
"supervisorCode"
),
codeMap
.
get
(
"elevatorCode"
),
record
);
String
equState
=
EquipmentCategoryEnum
.
CSZT
.
getCode
();
if
(!
ObjectUtils
.
isEmpty
(
record
))
{
EquInfoDto
equInfoDto
=
categoryOtherInfoMapper
.
selectEquipInfo
(
record
);
String
supervisorCode
,
elevatorCode
;
equState
=
EquipmentCategoryEnum
.
WSY
.
getCode
().
equals
(
equInfoDto
.
getEquState
())
?
EquipmentCategoryEnum
.
WSY
.
getCode
()
:
EquipmentCategoryEnum
.
YSY
.
getCode
();
supervisorCode
=
EquipmentCategoryEnum
.
WSY
.
getCode
().
equals
(
equInfoDto
.
getEquState
())
?
null
:
codeMap
.
get
(
"supervisorCode"
);
elevatorCode
=
EquipmentCategoryEnum
.
WSY
.
getCode
().
equals
(
equInfoDto
.
getEquState
())
?
null
:
codeMap
.
get
(
"elevatorCode"
);
categoryOtherInfoMapper
.
updateCode
(
equInfoDto
.
getCode
(),
equState
);
categoryOtherInfoMapper
.
updateSupervisorCode
(
supervisorCode
,
elevatorCode
,
record
);
}
else
{
SupervisoryCodeInfo
supervisoryCodeInfo
=
new
SupervisoryCodeInfo
();
supervisoryCodeInfo
.
setCode96333
(
codeMap
.
get
(
"elevatorCode"
));
supervisoryCodeInfo
.
setSupervisoryCode
(
codeMap
.
get
(
"supervisorCode"
));
supervisoryCodeInfo
.
setStatus
(
equState
);
supervisoryCodeInfoMapper
.
insert
(
supervisoryCodeInfo
);
}
return
codeMap
;
}
}
@Override
@Override
...
@@ -310,22 +326,69 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
...
@@ -310,22 +326,69 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
/**
/**
* 具体生成监管码和电梯96333识别码逻辑
* 具体生成监管码和电梯96333识别码逻辑
*/
*/
private
Map
<
String
,
String
>
creatCode
(
String
city
,
String
county
,
String
equipCategory
,
String
equipList
,
String
record
)
{
private
Map
<
String
,
String
>
creatCode
(
String
city
,
String
county
,
String
equipCategory
,
String
record
)
{
Map
<
String
,
String
>
resultMap
=
new
HashMap
<>();
Map
<
String
,
String
>
resultMap
=
new
HashMap
<>();
//生成监管码前缀
Map
<
String
,
Object
>
divisionMap
=
equipmentCategoryMapper
.
getAdministrativeDivision
(
EquipmentCategoryEnum
.
XZQH
.
getCode
(),
county
);
String
division
=
ObjectUtils
.
isEmpty
(
divisionMap
)
?
equipmentCategoryMapper
.
getAdministrativeDivision
(
EquipmentCategoryEnum
.
XZQH
.
getCode
(),
city
).
get
(
"code"
).
toString
()
:
divisionMap
.
get
(
"code"
).
toString
();
StringBuilder
supervisorCode
=
new
StringBuilder
();
StringBuilder
supervisorCode
=
new
StringBuilder
();
supervisorCode
.
append
(
division
).
append
(
equipCategory
).
append
(
"-"
);
StringBuilder
elevatorCode
=
new
StringBuilder
();
//获取行政区划区县、市是否存在历史监管码
CategoryOtherInfo
otherInfo
;
CategoryOtherInfo
supervisor
=
categoryOtherInfoMapper
.
selectSupervisorCode
(
supervisorCode
.
toString
());
String
prefix
=
getPrefix
(
EquipmentCategoryEnum
.
XZQHDT
.
getCode
(),
city
);
CategoryOtherInfo
categoryOtherInfo
=
categoryOtherInfoMapper
.
selectElevatorCode
(
prefix
,
EquipmentCategoryEnum
.
WSY
.
getCode
());
if
(!
ObjectUtils
.
isEmpty
(
record
))
{
//查询对应record对应数据
//查询对应record对应数据
CategoryOtherInfo
otherInfo
=
categoryOtherInfoMapper
.
selectOne
(
new
QueryWrapper
<
CategoryOtherInfo
>().
eq
(
"RECORD"
,
record
));
otherInfo
=
categoryOtherInfoMapper
.
selectOne
(
new
QueryWrapper
<
CategoryOtherInfo
>().
eq
(
"RECORD"
,
record
));
if
(!
ObjectUtils
.
isEmpty
(
otherInfo
))
{
if
(!
ObjectUtils
.
isEmpty
(
otherInfo
))
{
//判断原数据是否存在监管码,存在则用原监管码即可,不存在则生成
//判断原数据是否存在监管码,存在则用原监管码即可,不存在则生成
if
(!
ObjectUtils
.
isEmpty
(
otherInfo
.
getSupervisoryCode
()))
{
if
(!
ObjectUtils
.
isEmpty
(
otherInfo
.
getSupervisoryCode
()))
{
supervisorCode
=
new
StringBuilder
(
otherInfo
.
getSupervisoryCode
());
supervisorCode
=
new
StringBuilder
(
otherInfo
.
getSupervisoryCode
());
}
else
{
}
else
{
String
supervisor
=
createSupervisorCode
(
city
,
county
,
equipCategory
);
supervisorCode
.
append
(
supervisor
);
}
//判断是否是否需要生成96333电梯码、这个record对应的otherInfo不为空
if
(
equipCategory
.
startsWith
(
"3"
)
&&
!
XIAN
.
equals
(
city
))
{
if
(!
ObjectUtils
.
isEmpty
(
otherInfo
.
getCode
()))
{
elevatorCode
.
append
(
new
StringBuilder
(
otherInfo
.
getCode
()));
}
else
{
String
elevator
=
ObjectUtils
.
isEmpty
(
categoryOtherInfo
)
?
createElevatorCode
(
city
,
county
)
:
categoryOtherInfo
.
getCode
();
elevatorCode
.
append
(
elevator
);
}
}
}
}
else
{
String
supervisor
=
createSupervisorCode
(
city
,
county
,
equipCategory
);
supervisorCode
.
append
(
supervisor
);
if
(
equipCategory
.
startsWith
(
"3"
)
&&
!
XIAN
.
equals
(
city
))
{
String
elevator
=
ObjectUtils
.
isEmpty
(
categoryOtherInfo
)
?
createElevatorCode
(
city
,
county
)
:
categoryOtherInfo
.
getCode
();
elevatorCode
.
append
(
elevator
);
}
}
if
(
ObjectUtils
.
isEmpty
(
supervisorCode
)
&&
ObjectUtils
.
isEmpty
(
elevatorCode
))
{
return
new
HashMap
<>();
}
resultMap
.
put
(
"supervisorCode"
,
ObjectUtils
.
isEmpty
(
supervisorCode
)
?
null
:
supervisorCode
.
toString
());
resultMap
.
put
(
"elevatorCode"
,
ObjectUtils
.
isEmpty
(
elevatorCode
)
?
null
:
elevatorCode
.
toString
());
return
resultMap
;
}
private
String
getPrefix
(
String
type
,
String
county
)
{
return
equipmentCategoryMapper
.
getAdministrativeDivision
(
type
,
county
).
get
(
"code"
).
toString
();
}
/**
* 生成监管码
*
* @param city 行政区划市
* @param county 行政区划区
* @return 监管码
*/
private
String
createSupervisorCode
(
String
city
,
String
county
,
String
equipCategory
)
{
StringBuilder
supervisorCode
=
new
StringBuilder
();
//生成监管码前缀
Map
<
String
,
Object
>
divisionMap
=
equipmentCategoryMapper
.
getAdministrativeDivision
(
EquipmentCategoryEnum
.
XZQH
.
getCode
(),
county
);
String
division
=
ObjectUtils
.
isEmpty
(
divisionMap
)
?
equipmentCategoryMapper
.
getAdministrativeDivision
(
EquipmentCategoryEnum
.
XZQH
.
getCode
(),
city
).
get
(
"code"
).
toString
()
:
divisionMap
.
get
(
"code"
).
toString
();
supervisorCode
.
append
(
division
).
append
(
equipCategory
).
append
(
"-"
);
//获取行政区划区县、市是否存在历史监管码
CategoryOtherInfo
supervisor
=
categoryOtherInfoMapper
.
selectSupervisorCode
(
supervisorCode
.
toString
());
//生成对应监管码
//生成对应监管码
if
(!
ObjectUtils
.
isEmpty
(
supervisor
)
&&
supervisor
.
getSupervisoryCode
()
!=
null
)
{
if
(!
ObjectUtils
.
isEmpty
(
supervisor
)
&&
supervisor
.
getSupervisoryCode
()
!=
null
)
{
//获取补零位长度
//获取补零位长度
...
@@ -342,23 +405,24 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
...
@@ -342,23 +405,24 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
}
else
{
}
else
{
supervisorCode
.
append
(
EquipmentCategoryEnum
.
JGM
.
getCode
());
supervisorCode
.
append
(
EquipmentCategoryEnum
.
JGM
.
getCode
());
}
}
}
return
supervisorCode
.
toString
();
}
else
{
supervisorCode
=
null
;
}
}
/**
* 生成96333电梯识别码
*
* @param city 行政区划市
* @param county 行政区划区
* @return 96333电梯识别码
*/
private
String
createElevatorCode
(
String
city
,
String
county
)
{
StringBuilder
elevatorCode
=
new
StringBuilder
();
StringBuilder
elevatorCode
=
new
StringBuilder
();
//判断是否是否需要生成96333电梯码、这个record对应的otherInfo不为空
if
(
EquipmentClassifityEnum
.
DT
.
getCode
().
equals
(
equipList
)
&&
!
XIAN
.
equals
(
city
)
&&
!
ObjectUtils
.
isEmpty
(
otherInfo
))
{
if
(!
ObjectUtils
.
isEmpty
(
otherInfo
.
getCode
()))
{
elevatorCode
.
append
(
new
StringBuilder
(
otherInfo
.
getCode
()));
}
else
{
//生成生成96333电梯码前缀
//生成生成96333电梯码前缀
Map
<
String
,
Object
>
elevatorMap
=
equipmentCategoryMapper
.
getAdministrativeDivision
(
EquipmentCategoryEnum
.
XZQHDT
.
getCode
(),
county
);
Map
<
String
,
Object
>
elevatorMap
=
equipmentCategoryMapper
.
getAdministrativeDivision
(
EquipmentCategoryEnum
.
XZQHDT
.
getCode
(),
county
);
String
elevator
=
ObjectUtils
.
isEmpty
(
elevatorMap
)
?
equipmentCategoryMapper
.
getAdministrativeDivision
(
EquipmentCategoryEnum
.
XZQHDT
.
getCode
(),
city
).
get
(
"code"
).
toString
()
:
elevatorMap
.
get
(
"code"
).
toString
();
String
elevator
=
ObjectUtils
.
isEmpty
(
elevatorMap
)
?
equipmentCategoryMapper
.
getAdministrativeDivision
(
EquipmentCategoryEnum
.
XZQHDT
.
getCode
(),
city
).
get
(
"code"
).
toString
()
:
elevatorMap
.
get
(
"code"
).
toString
();
elevatorCode
.
append
(
elevator
);
elevatorCode
.
append
(
elevator
);
//获取行政区划区县、市是否存在历史96333电梯码
//获取行政区划区县、市是否存在历史96333电梯码
CategoryOtherInfo
elevatorOtherInfo
=
categoryOtherInfoMapper
.
selectElevatorCode
(
elevatorCode
.
toString
()
);
CategoryOtherInfo
elevatorOtherInfo
=
categoryOtherInfoMapper
.
selectElevatorCode
(
elevatorCode
.
toString
(),
null
);
//生成对应96333电梯码
//生成对应96333电梯码
if
(!
ObjectUtils
.
isEmpty
(
elevatorOtherInfo
)
&&
elevatorOtherInfo
.
getCode
()
!=
null
)
{
if
(!
ObjectUtils
.
isEmpty
(
elevatorOtherInfo
)
&&
elevatorOtherInfo
.
getCode
()
!=
null
)
{
//获取补零位长度
//获取补零位长度
...
@@ -375,15 +439,9 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
...
@@ -375,15 +439,9 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
}
else
{
}
else
{
elevatorCode
.
append
(
EquipmentCategoryEnum
.
CSM
.
getCode
());
elevatorCode
.
append
(
EquipmentCategoryEnum
.
CSM
.
getCode
());
}
}
return
elevatorCode
.
toString
();
}
}
}
if
(
ObjectUtils
.
isEmpty
(
supervisorCode
)
&&
ObjectUtils
.
isEmpty
(
elevatorCode
))
{
return
new
HashMap
<>();
}
resultMap
.
put
(
"supervisorCode"
,
ObjectUtils
.
isEmpty
(
supervisorCode
)
?
null
:
supervisorCode
.
toString
());
resultMap
.
put
(
"elevatorCode"
,
ObjectUtils
.
isEmpty
(
elevatorCode
)
?
null
:
elevatorCode
.
toString
());
return
resultMap
;
}
/**
/**
* 获取当前登录人单位类型
* 获取当前登录人单位类型
...
...
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