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
e12280b4
Commit
e12280b4
authored
Aug 10, 2022
by
suhuiguang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' into develop_unit_register
parents
2cd7f6d9
46cbf3f3
Show whitespace changes
Inline
Side-by-side
Showing
39 changed files
with
3067 additions
and
61 deletions
+3067
-61
EnterpriseInfoModel.java
...join/amos/api/openapi/face/model/EnterpriseInfoModel.java
+4
-0
EnterpriseInfo.java
...join/amos/api/openapi/face/orm/entity/EnterpriseInfo.java
+2
-0
TzBaseEnterpriseInfoDto.java
...amos/boot/module/tzs/api/dto/TzBaseEnterpriseInfoDto.java
+85
-11
TzBaseEnterpriseInfo.java
...amos/boot/module/tzs/api/entity/TzBaseEnterpriseInfo.java
+65
-8
TzsJgConstructionInfo.java
...mos/boot/module/tzs/api/entity/TzsJgConstructionInfo.java
+1
-1
TzsJgDesignInfo.java
...join/amos/boot/module/tzs/api/entity/TzsJgDesignInfo.java
+1
-1
TzsJgElevatorTechInfo.java
...mos/boot/module/tzs/api/entity/TzsJgElevatorTechInfo.java
+1
-1
TzsJgEnclosureInfo.java
...n/amos/boot/module/tzs/api/entity/TzsJgEnclosureInfo.java
+1
-1
TzsJgFile.java
...om/yeejoin/amos/boot/module/tzs/api/entity/TzsJgFile.java
+1
-1
TzsJgInspectionInfo.java
.../amos/boot/module/tzs/api/entity/TzsJgInspectionInfo.java
+1
-1
TzsJgMaintenanceInfo.java
...amos/boot/module/tzs/api/entity/TzsJgMaintenanceInfo.java
+1
-1
TzsJgOtherInfo.java
...ejoin/amos/boot/module/tzs/api/entity/TzsJgOtherInfo.java
+1
-1
TzsJgProduceInfo.java
...oin/amos/boot/module/tzs/api/entity/TzsJgProduceInfo.java
+1
-1
TzsJgRegistrationInfo.java
...mos/boot/module/tzs/api/entity/TzsJgRegistrationInfo.java
+1
-1
TzsJgStaffBaseInfo.java
...n/amos/boot/module/tzs/api/entity/TzsJgStaffBaseInfo.java
+1
-1
TzsJgStaffQualifInfo.java
...amos/boot/module/tzs/api/entity/TzsJgStaffQualifInfo.java
+1
-1
TzsJgSuperviseInfo.java
...n/amos/boot/module/tzs/api/entity/TzsJgSuperviseInfo.java
+1
-1
TzsJgUseInfo.java
...yeejoin/amos/boot/module/tzs/api/entity/TzsJgUseInfo.java
+1
-1
TzBaseEnterpriseInfoMapper.java
...oot/module/tzs/api/mapper/TzBaseEnterpriseInfoMapper.java
+3
-3
ITzBaseEnterpriseInfoService.java
.../module/tzs/api/service/ITzBaseEnterpriseInfoService.java
+3
-3
TzCarcylFillInfoDto.java
...amos/boot/module/tzs/flc/api/dto/TzCarcylFillInfoDto.java
+69
-0
TzCarcylInspectDto.java
.../amos/boot/module/tzs/flc/api/dto/TzCarcylInspectDto.java
+79
-0
TzCarcylRegDto.java
...join/amos/boot/module/tzs/flc/api/dto/TzCarcylRegDto.java
+99
-0
TzCarcylTraceDto.java
...in/amos/boot/module/tzs/flc/api/dto/TzCarcylTraceDto.java
+18
-0
TzCarcylReg.java
...join/amos/boot/module/tzs/flc/api/entity/TzCarcylReg.java
+99
-0
TzCarcylMapper.java
...n/amos/boot/module/tzs/flc/api/mapper/TzCarcylMapper.java
+37
-0
ITzCarcylService.java
...mos/boot/module/tzs/flc/api/service/ITzCarcylService.java
+21
-0
TzBaseEnterpriseInfoMapper.xml
.../src/main/resources/mapper/TzBaseEnterpriseInfoMapper.xml
+1
-1
TzCarcylMapper.xml
...dule-tzs-api/src/main/resources/mapper/TzCarcylMapper.xml
+275
-0
AmosTzsApplication.java
...iz/src/main/java/com/yeejoin/amos/AmosTzsApplication.java
+48
-14
TzBaseEnterpriseInfoController.java
...le/tzs/biz/controller/TzBaseEnterpriseInfoController.java
+137
-0
BaseEnterpriseMqTtlListener.java
.../module/tzs/biz/listener/BaseEnterpriseMqTtlListener.java
+106
-0
CarcylUnitInspectMqTtlListener.java
...dule/tzs/biz/listener/CarcylUnitInspectMqTtlListener.java
+104
-0
StartPlatformTokenService.java
...odule/tzs/biz/service/impl/StartPlatformTokenService.java
+52
-0
TzBaseEnterpriseInfoServiceImpl.java
...tzs/biz/service/impl/TzBaseEnterpriseInfoServiceImpl.java
+8
-7
DesUtil.java
...a/com/yeejoin/amos/boot/module/tzs/biz/utils/DesUtil.java
+1056
-0
RedisUtil.java
...com/yeejoin/amos/boot/module/tzs/biz/utils/RedisUtil.java
+568
-0
CarCylController.java
.../boot/module/tzs/flc/biz/controller/CarCylController.java
+50
-0
TzCarcylServiceImpl.java
.../module/tzs/flc/biz/service/impl/TzCarcylServiceImpl.java
+64
-0
No files found.
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/model/EnterpriseInfoModel.java
View file @
e12280b4
...
@@ -22,6 +22,10 @@ public class EnterpriseInfoModel extends AbstractBaseModel {
...
@@ -22,6 +22,10 @@ public class EnterpriseInfoModel extends AbstractBaseModel {
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
private
String
superviseOrgCode
;
private
String
superviseOrgName
;
private
List
businessLicense
;
private
List
businessLicense
;
@ApiModelProperty
(
value
=
"使用单位唯一标识"
)
@ApiModelProperty
(
value
=
"使用单位唯一标识"
)
...
...
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/orm/entity/EnterpriseInfo.java
View file @
e12280b4
...
@@ -29,6 +29,8 @@ public class EnterpriseInfo extends AbstractBaseEntity {
...
@@ -29,6 +29,8 @@ public class EnterpriseInfo extends AbstractBaseEntity {
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
private
String
superviseOrgCode
;
private
String
superviseOrgName
;
@ApiModelProperty
(
value
=
"使用单位唯一标识"
)
@ApiModelProperty
(
value
=
"使用单位唯一标识"
)
...
...
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/dto/Tz
sJg
EnterpriseInfoDto.java
→
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/dto/Tz
Base
EnterpriseInfoDto.java
View file @
e12280b4
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
dto
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
dto
;
import
java.util.Date
;
import
java.util.Date
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
/**
/**
* 企业数据信息Dto
* 企业数据信息Dto
*
*
* @author duanwei
* @author duanwei
* @date 2022-07-26
* @date 2022-07-26
*/
*/
@Data
@Data
public
class
Tz
sJg
EnterpriseInfoDto
extends
BaseDto
{
public
class
Tz
Base
EnterpriseInfoDto
extends
BaseDto
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
...
@@ -37,9 +38,14 @@ public class TzsJgEnterpriseInfoDto extends BaseDto {
...
@@ -37,9 +38,14 @@ public class TzsJgEnterpriseInfoDto extends BaseDto {
* 使用单位证件类型
* 使用单位证件类型
*/
*/
private
String
useUnitCertificate
;
private
String
useUnitCertificate
;
@ApiModelProperty
(
value
=
"
使用单位代码
"
)
@ApiModelProperty
(
value
=
"
单位类型
"
)
/**
/**
* 使用单位代码
* 单位类型
*/
private
String
unitType
;
@ApiModelProperty
(
value
=
"使用单位统一信用代码"
)
/**
* 使用单位统一信用代码
*/
*/
private
String
useCode
;
private
String
useCode
;
@ApiModelProperty
(
value
=
"使用单位名称"
)
@ApiModelProperty
(
value
=
"使用单位名称"
)
...
@@ -47,6 +53,16 @@ public class TzsJgEnterpriseInfoDto extends BaseDto {
...
@@ -47,6 +53,16 @@ public class TzsJgEnterpriseInfoDto extends BaseDto {
* 使用单位名称
* 使用单位名称
*/
*/
private
String
useUnit
;
private
String
useUnit
;
@ApiModelProperty
(
value
=
"监管机构组织机构代码"
)
/**
* 监管机构组织机构代码
*/
private
String
superviseOrgCode
;
@ApiModelProperty
(
value
=
"监管机构名称"
)
/**
* 监管机构名称
*/
private
String
superviseOrgName
;
@ApiModelProperty
(
value
=
"是否重点监控单位"
)
@ApiModelProperty
(
value
=
"是否重点监控单位"
)
/**
/**
* 是否重点监控单位
* 是否重点监控单位
...
@@ -172,6 +188,64 @@ public class TzsJgEnterpriseInfoDto extends BaseDto {
...
@@ -172,6 +188,64 @@ public class TzsJgEnterpriseInfoDto extends BaseDto {
* 操作人员
* 操作人员
*/
*/
private
String
recUserId
;
private
String
recUserId
;
@ApiModelProperty
(
value
=
"管辖机构"
)
/**
* 管辖机构
*/
private
String
governingBody
;
@ApiModelProperty
(
value
=
"数据来源"
)
/**
* 数据来源
*/
private
String
dataSources
;
@ApiModelProperty
(
value
=
"所属行业"
)
/**
* 所属行业
*/
private
String
industry
;
@ApiModelProperty
(
value
=
"登记机关"
)
/**
* 登记机关
*/
private
String
registrationAuthority
;
@ApiModelProperty
(
value
=
"核准时间"
)
/**
* 核准时间
*/
private
Date
approvalTime
;
@ApiModelProperty
(
value
=
"经营状态"
)
/**
* 经营状态
*/
private
String
operatingStatus
;
@ApiModelProperty
(
value
=
"维保负责人"
)
/**
* 维保负责人
*/
private
String
maintenPerson
;
@ApiModelProperty
(
value
=
"维保负责人联系电话"
)
/**
* 维保负责人联系电话
*/
private
String
maintenTelephone
;
@ApiModelProperty
(
value
=
"质量保证工程师"
)
/**
* 质量保证工程师
*/
private
String
sqa
;
@ApiModelProperty
(
value
=
"质量负责人"
)
/**
* 质量负责人
*/
private
String
qualityPerson
;
@ApiModelProperty
(
value
=
"质量负责人电话"
)
/**
* 质量负责人电话
*/
private
String
qualityTelephone
;
@ApiModelProperty
(
value
=
"技术负责人"
)
/**
* 技术负责人
*/
private
String
technicalPerson
;
}
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/entity/Tz
sJg
EnterpriseInfo.java
→
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/entity/Tz
Base
EnterpriseInfo.java
View file @
e12280b4
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
entity
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
entity
;
import
java.util.Date
;
import
java.util.Date
;
import
org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity
;
/**
/**
* 企业数据信息
* 企业数据信息
*
*
* @author duanwei
* @author duanwei
* @date 2022-0
7-26
* @date 2022-0
8-10
*/
*/
@Data
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"tz
s
_jg_enterprise_info"
)
@TableName
(
"tz_jg_enterprise_info"
)
@ApiModel
(
value
=
"TzsJgEnterpriseInfo对象"
,
description
=
"企业数据信息"
)
@ApiModel
(
value
=
"TzsJgEnterpriseInfo对象"
,
description
=
"企业数据信息"
)
public
class
TzsJgEnterpriseInfo
extends
BaseEntity
{
public
class
TzsJgEnterpriseInfo
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"使用单位唯一标识"
)
@ApiModelProperty
(
value
=
"使用单位唯一标识"
)
private
String
useUnitCode
;
private
String
useUnitCode
;
...
@@ -33,12 +39,21 @@ public class TzsJgEnterpriseInfo extends BaseEntity {
...
@@ -33,12 +39,21 @@ public class TzsJgEnterpriseInfo extends BaseEntity {
@ApiModelProperty
(
value
=
"使用单位证件类型"
)
@ApiModelProperty
(
value
=
"使用单位证件类型"
)
private
String
useUnitCertificate
;
private
String
useUnitCertificate
;
@ApiModelProperty
(
value
=
"使用单位代码"
)
@ApiModelProperty
(
value
=
"单位类型"
)
private
String
unitType
;
@ApiModelProperty
(
value
=
"使用单位统一信用代码"
)
private
String
useCode
;
private
String
useCode
;
@ApiModelProperty
(
value
=
"使用单位名称"
)
@ApiModelProperty
(
value
=
"使用单位名称"
)
private
String
useUnit
;
private
String
useUnit
;
@ApiModelProperty
(
value
=
"监管机构组织机构代码"
)
private
String
superviseOrgCode
;
@ApiModelProperty
(
value
=
"监管机构名称"
)
private
String
superviseOrgName
;
@ApiModelProperty
(
value
=
"是否重点监控单位"
)
@ApiModelProperty
(
value
=
"是否重点监控单位"
)
private
String
keyUnit
;
private
String
keyUnit
;
...
@@ -108,4 +123,46 @@ public class TzsJgEnterpriseInfo extends BaseEntity {
...
@@ -108,4 +123,46 @@ public class TzsJgEnterpriseInfo extends BaseEntity {
@ApiModelProperty
(
value
=
"对接公司编码"
)
@ApiModelProperty
(
value
=
"对接公司编码"
)
private
String
appId
;
private
String
appId
;
@ApiModelProperty
(
value
=
"单位类型"
)
private
String
unitType
;
@ApiModelProperty
(
value
=
"管辖机构"
)
private
String
governingBody
;
@ApiModelProperty
(
value
=
"数据来源"
)
private
String
dataSources
;
@ApiModelProperty
(
value
=
"所属行业"
)
private
String
industry
;
@ApiModelProperty
(
value
=
"登记机关"
)
private
String
registrationAuthority
;
@ApiModelProperty
(
value
=
"核准时间"
)
private
Date
approvalTime
;
@ApiModelProperty
(
value
=
"经营状态"
)
private
String
operatingStatus
;
@ApiModelProperty
(
value
=
"维保负责人"
)
private
String
maintenPerson
;
@ApiModelProperty
(
value
=
"维保负责人联系电话"
)
private
String
maintenTelephone
;
@ApiModelProperty
(
value
=
"质量保证工程师"
)
private
String
sqa
;
@ApiModelProperty
(
value
=
"质量负责人"
)
private
String
qualityPerson
;
@ApiModelProperty
(
value
=
"质量负责人电话"
)
private
String
qualityTelephone
;
@ApiModelProperty
(
value
=
"技术负责人"
)
private
String
technicalPerson
;
}
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/entity/TzsJgConstructionInfo.java
View file @
e12280b4
...
@@ -19,7 +19,7 @@ import lombok.experimental.Accessors;
...
@@ -19,7 +19,7 @@ import lombok.experimental.Accessors;
*/
*/
@Data
@Data
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"tz
s
_jg_construction_info"
)
@TableName
(
"tz_jg_construction_info"
)
@ApiModel
(
value
=
"TzsJgConstructionInfo对象"
,
description
=
"特种设备基本信息-施工信息"
)
@ApiModel
(
value
=
"TzsJgConstructionInfo对象"
,
description
=
"特种设备基本信息-施工信息"
)
public
class
TzsJgConstructionInfo
extends
BaseEntity
{
public
class
TzsJgConstructionInfo
extends
BaseEntity
{
...
...
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/entity/TzsJgDesignInfo.java
View file @
e12280b4
...
@@ -19,7 +19,7 @@ import lombok.experimental.Accessors;
...
@@ -19,7 +19,7 @@ import lombok.experimental.Accessors;
*/
*/
@Data
@Data
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"tz
s
_jg_design_info"
)
@TableName
(
"tz_jg_design_info"
)
@ApiModel
(
value
=
"TzsJgDesignInfo对象"
,
description
=
"特种设备基本信息-设计信息"
)
@ApiModel
(
value
=
"TzsJgDesignInfo对象"
,
description
=
"特种设备基本信息-设计信息"
)
public
class
TzsJgDesignInfo
extends
BaseEntity
{
public
class
TzsJgDesignInfo
extends
BaseEntity
{
...
...
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/entity/TzsJgElevatorTechInfo.java
View file @
e12280b4
...
@@ -18,7 +18,7 @@ import lombok.experimental.Accessors;
...
@@ -18,7 +18,7 @@ import lombok.experimental.Accessors;
*/
*/
@Data
@Data
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"tz
s
_jg_elevator_tech_info"
)
@TableName
(
"tz_jg_elevator_tech_info"
)
@ApiModel
(
value
=
"TzsJgElevatorTechInfo对象"
,
description
=
"电梯技术参数"
)
@ApiModel
(
value
=
"TzsJgElevatorTechInfo对象"
,
description
=
"电梯技术参数"
)
public
class
TzsJgElevatorTechInfo
extends
BaseEntity
{
public
class
TzsJgElevatorTechInfo
extends
BaseEntity
{
...
...
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/entity/TzsJgEnclosureInfo.java
View file @
e12280b4
...
@@ -18,7 +18,7 @@ import lombok.experimental.Accessors;
...
@@ -18,7 +18,7 @@ import lombok.experimental.Accessors;
*/
*/
@Data
@Data
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"tz
s
_jg_enclosure_info"
)
@TableName
(
"tz_jg_enclosure_info"
)
@ApiModel
(
value
=
"TzsJgEnclosureInfo对象"
,
description
=
"特种设备附件资料信息"
)
@ApiModel
(
value
=
"TzsJgEnclosureInfo对象"
,
description
=
"特种设备附件资料信息"
)
public
class
TzsJgEnclosureInfo
extends
BaseEntity
{
public
class
TzsJgEnclosureInfo
extends
BaseEntity
{
...
...
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/entity/TzsJgFile.java
View file @
e12280b4
...
@@ -21,7 +21,7 @@ import lombok.experimental.Accessors;
...
@@ -21,7 +21,7 @@ import lombok.experimental.Accessors;
@Data
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"tz
s
_jg_file"
)
@TableName
(
"tz_jg_file"
)
@ApiModel
(
value
=
"TzsJgFile对象"
,
description
=
"附件表"
)
@ApiModel
(
value
=
"TzsJgFile对象"
,
description
=
"附件表"
)
public
class
TzsJgFile
extends
BaseEntity
{
public
class
TzsJgFile
extends
BaseEntity
{
...
...
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/entity/TzsJgInspectionInfo.java
View file @
e12280b4
...
@@ -20,7 +20,7 @@ import lombok.experimental.Accessors;
...
@@ -20,7 +20,7 @@ import lombok.experimental.Accessors;
@Data
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"tz
s
_jg_inspection_info"
)
@TableName
(
"tz_jg_inspection_info"
)
@ApiModel
(
value
=
"TzsJgInspectionInfo对象"
,
description
=
"特种设备检验信息"
)
@ApiModel
(
value
=
"TzsJgInspectionInfo对象"
,
description
=
"特种设备检验信息"
)
public
class
TzsJgInspectionInfo
extends
BaseEntity
{
public
class
TzsJgInspectionInfo
extends
BaseEntity
{
...
...
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/entity/TzsJgMaintenanceInfo.java
View file @
e12280b4
...
@@ -18,7 +18,7 @@ import lombok.experimental.Accessors;
...
@@ -18,7 +18,7 @@ import lombok.experimental.Accessors;
*/
*/
@Data
@Data
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"tz
s
_jg_maintenance_info"
)
@TableName
(
"tz_jg_maintenance_info"
)
@ApiModel
(
value
=
"TzsJgMaintenanceInfo对象"
,
description
=
"特种设备基本信息-维保备案信息"
)
@ApiModel
(
value
=
"TzsJgMaintenanceInfo对象"
,
description
=
"特种设备基本信息-维保备案信息"
)
public
class
TzsJgMaintenanceInfo
extends
BaseEntity
{
public
class
TzsJgMaintenanceInfo
extends
BaseEntity
{
...
...
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/entity/TzsJgOtherInfo.java
View file @
e12280b4
...
@@ -18,7 +18,7 @@ import lombok.experimental.Accessors;
...
@@ -18,7 +18,7 @@ import lombok.experimental.Accessors;
*/
*/
@Data
@Data
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"tz
s
_jg_other_info"
)
@TableName
(
"tz_jg_other_info"
)
@ApiModel
(
value
=
"TzsJgOtherInfo对象"
,
description
=
"特种设备基本信息-其他信息"
)
@ApiModel
(
value
=
"TzsJgOtherInfo对象"
,
description
=
"特种设备基本信息-其他信息"
)
public
class
TzsJgOtherInfo
extends
BaseEntity
{
public
class
TzsJgOtherInfo
extends
BaseEntity
{
...
...
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/entity/TzsJgProduceInfo.java
View file @
e12280b4
...
@@ -19,7 +19,7 @@ import lombok.experimental.Accessors;
...
@@ -19,7 +19,7 @@ import lombok.experimental.Accessors;
*/
*/
@Data
@Data
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"tz
s
_jg_produce_info"
)
@TableName
(
"tz_jg_produce_info"
)
@ApiModel
(
value
=
"TzsJgProduceInfo对象"
,
description
=
"特种设备基本信息-制造信息"
)
@ApiModel
(
value
=
"TzsJgProduceInfo对象"
,
description
=
"特种设备基本信息-制造信息"
)
public
class
TzsJgProduceInfo
extends
BaseEntity
{
public
class
TzsJgProduceInfo
extends
BaseEntity
{
...
...
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/entity/TzsJgRegistrationInfo.java
View file @
e12280b4
...
@@ -18,7 +18,7 @@ import lombok.experimental.Accessors;
...
@@ -18,7 +18,7 @@ import lombok.experimental.Accessors;
*/
*/
@Data
@Data
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"tz
s
_jg_registration_info"
)
@TableName
(
"tz_jg_registration_info"
)
@ApiModel
(
value
=
"TzsJgRegistrationInfo对象"
,
description
=
"特种设备基本信息-注册登记信息 "
)
@ApiModel
(
value
=
"TzsJgRegistrationInfo对象"
,
description
=
"特种设备基本信息-注册登记信息 "
)
public
class
TzsJgRegistrationInfo
extends
BaseEntity
{
public
class
TzsJgRegistrationInfo
extends
BaseEntity
{
...
...
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/entity/TzsJgStaffBaseInfo.java
View file @
e12280b4
...
@@ -18,7 +18,7 @@ import lombok.experimental.Accessors;
...
@@ -18,7 +18,7 @@ import lombok.experimental.Accessors;
*/
*/
@Data
@Data
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"tz
s
_jg_staff_base_info"
)
@TableName
(
"tz_jg_staff_base_info"
)
@ApiModel
(
value
=
"TzsJgStaffBaseInfo对象"
,
description
=
"人员数据信息-基本信息"
)
@ApiModel
(
value
=
"TzsJgStaffBaseInfo对象"
,
description
=
"人员数据信息-基本信息"
)
public
class
TzsJgStaffBaseInfo
extends
BaseEntity
{
public
class
TzsJgStaffBaseInfo
extends
BaseEntity
{
...
...
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/entity/TzsJgStaffQualifInfo.java
View file @
e12280b4
...
@@ -19,7 +19,7 @@ import lombok.experimental.Accessors;
...
@@ -19,7 +19,7 @@ import lombok.experimental.Accessors;
*/
*/
@Data
@Data
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"tz
s
_jg_staff_qualif_info"
)
@TableName
(
"tz_jg_staff_qualif_info"
)
@ApiModel
(
value
=
"TzsJgStaffQualifInfo对象"
,
description
=
"人员数据信息-资质信息"
)
@ApiModel
(
value
=
"TzsJgStaffQualifInfo对象"
,
description
=
"人员数据信息-资质信息"
)
public
class
TzsJgStaffQualifInfo
extends
BaseEntity
{
public
class
TzsJgStaffQualifInfo
extends
BaseEntity
{
...
...
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/entity/TzsJgSuperviseInfo.java
View file @
e12280b4
...
@@ -18,7 +18,7 @@ import lombok.experimental.Accessors;
...
@@ -18,7 +18,7 @@ import lombok.experimental.Accessors;
*/
*/
@Data
@Data
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"tz
s
_jg_supervise_info"
)
@TableName
(
"tz_jg_supervise_info"
)
@ApiModel
(
value
=
"TzsJgSuperviseInfo对象"
,
description
=
"特种设备基本信息-监督管理信息"
)
@ApiModel
(
value
=
"TzsJgSuperviseInfo对象"
,
description
=
"特种设备基本信息-监督管理信息"
)
public
class
TzsJgSuperviseInfo
extends
BaseEntity
{
public
class
TzsJgSuperviseInfo
extends
BaseEntity
{
...
...
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/entity/TzsJgUseInfo.java
View file @
e12280b4
...
@@ -21,7 +21,7 @@ import lombok.experimental.Accessors;
...
@@ -21,7 +21,7 @@ import lombok.experimental.Accessors;
@Data
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"tz
s
_jg_use_info"
)
@TableName
(
"tz_jg_use_info"
)
@ApiModel
(
value
=
"TzsJgUseInfo对象"
,
description
=
"特种设备基本信息-使用信息"
)
@ApiModel
(
value
=
"TzsJgUseInfo对象"
,
description
=
"特种设备基本信息-使用信息"
)
public
class
TzsJgUseInfo
extends
BaseEntity
{
public
class
TzsJgUseInfo
extends
BaseEntity
{
...
...
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/mapper/Tz
sJg
EnterpriseInfoMapper.java
→
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/mapper/Tz
Base
EnterpriseInfoMapper.java
View file @
e12280b4
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
mapper
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
mapper
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.TzBaseEnterpriseInfo
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.TzsJgEnterpriseInfo
;
/**
/**
* 企业数据信息 Mapper 接口
* 企业数据信息 Mapper 接口
*
*
* @author duanwei
* @author duanwei
* @date 2022-0
7-26
* @date 2022-0
8-10
*/
*/
public
interface
Tz
sJgEnterpriseInfoMapper
extends
BaseMapper
<
TzsJg
EnterpriseInfo
>
{
public
interface
Tz
BaseEnterpriseInfoMapper
extends
BaseMapper
<
TzBase
EnterpriseInfo
>
{
}
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/service/ITz
sJg
EnterpriseInfoService.java
→
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/service/ITz
Base
EnterpriseInfoService.java
View file @
e12280b4
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
service
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
service
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.TzBaseEnterpriseInfo
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.TzsJgEnterpriseInfo
;
/**
/**
* 企业数据信息 服务类
* 企业数据信息 服务类
*
*
* @author duanwei
* @author duanwei
* @date 2022-0
7-26
* @date 2022-0
8-10
*/
*/
public
interface
ITz
sJgEnterpriseInfoService
extends
IService
<
TzsJg
EnterpriseInfo
>
{
public
interface
ITz
BaseEnterpriseInfoService
extends
IService
<
TzBase
EnterpriseInfo
>
{
}
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/dto/TzCarcylFillInfoDto.java
0 → 100644
View file @
e12280b4
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
flc
.
api
.
dto
;
import
java.util.Date
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* 车用气瓶充装信息(清洗后)Dto
*
* @author duanwei
* @date 2022-08-08
*/
@Data
public
class
TzCarcylFillInfoDto
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"充装单位名称 "
)
/**
* 充装单位名称
*/
private
String
companyName
;
@ApiModelProperty
(
value
=
"单位统一信用代码 "
)
/**
* 单位统一信用代码
*/
private
String
companyCode
;
@ApiModelProperty
(
value
=
"所属机构 "
)
/**
* 所属机构
*/
private
String
dept
;
@ApiModelProperty
(
value
=
"使用登记证编号 "
)
/**
* 使用登记证编号
*/
private
String
useCode
;
@ApiModelProperty
(
value
=
"充装日期 "
)
/**
* 充装日期
*/
private
String
gasDate
;
@ApiModelProperty
(
value
=
"充装检查人员 "
)
/**
* 充装检查人员
*/
private
String
gasCheckName
;
@ApiModelProperty
(
value
=
"充装人员 "
)
/**
* 充装人员
*/
private
String
gasName
;
@ApiModelProperty
(
value
=
"充装介质 "
)
/**
* 充装介质
*/
private
String
gasMedia
;
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/dto/TzCarcylInspectDto.java
0 → 100644
View file @
e12280b4
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
flc
.
api
.
dto
;
import
java.util.Date
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* 车用气瓶检验信息(清洗后)Dto
*
* @author duanwei
* @date 2022-08-08
*/
@Data
public
class
TzCarcylInspectDto
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"检验机构名称 "
)
/**
* 检验机构名称
*/
private
String
checkDeptName
;
@ApiModelProperty
(
value
=
"机构核准证书编号 "
)
/**
* 机构核准证书编号
*/
private
String
organizationDeptCode
;
@ApiModelProperty
(
value
=
"组织机构代码 "
)
/**
* 组织机构代码
*/
private
String
organizationCode
;
@ApiModelProperty
(
value
=
"所属机构 "
)
/**
* 所属机构
*/
private
String
organizationName
;
private
String
userCode
;
@ApiModelProperty
(
value
=
"检验日期 "
)
/**
* 检验日期
*/
private
String
checkDate
;
@ApiModelProperty
(
value
=
"下次检验日期 "
)
/**
* 下次检验日期
*/
private
String
nextCheckDate
;
@ApiModelProperty
(
value
=
"检验结果 "
)
/**
* 检验结果
*/
private
String
checkResult
;
@ApiModelProperty
(
value
=
"气瓶报废日期 "
)
/**
* 气瓶报废日期
*/
private
Date
gasDisableDate
;
@ApiModelProperty
(
value
=
"检验发现的主要问题 "
)
/**
* 检验发现的主要问题
*/
private
String
mainProblem
;
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/dto/TzCarcylRegDto.java
0 → 100644
View file @
e12280b4
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
flc
.
api
.
dto
;
import
java.util.Date
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* 车用气瓶使用登记信息(清洗后)Dto
*
* @author duanwei
* @date 2022-08-08
*/
@Data
public
class
TzCarcylRegDto
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 地区代码
*/
private
String
regionCode
;
@ApiModelProperty
(
value
=
"id"
)
/**
* id
*/
private
Long
sequenceNbr
;
@ApiModelProperty
(
value
=
"使用单位名称"
)
/**
* 使用单位名称
*/
private
String
compontName
;
@ApiModelProperty
(
value
=
"单位统一信用代码"
)
/**
* 单位统一信用代码
*/
private
String
compontCode
;
@ApiModelProperty
(
value
=
"所属机构 "
)
/**
* 所属机构
*/
private
String
dept
;
@ApiModelProperty
(
value
=
"地址 "
)
/**
* 地址
*/
private
String
address
;
@ApiModelProperty
(
value
=
"联系人 "
)
/**
* 联系人
*/
private
String
legalPerson
;
@ApiModelProperty
(
value
=
"电话 "
)
/**
* 电话
*/
private
String
legalPhone
;
@ApiModelProperty
(
value
=
"车牌号 "
)
/**
* 车牌号
*/
private
String
carNum
;
@ApiModelProperty
(
value
=
"气瓶使用登记机关 "
)
/**
* 气瓶使用登记机关
*/
private
String
gasDeptName
;
@ApiModelProperty
(
value
=
"使用登记证编号 "
)
/**
* 使用登记证编号
*/
private
String
useNum
;
@ApiModelProperty
(
value
=
"投入使用日期 "
)
/**
* 投入使用日期
*/
private
String
startTime
;
@ApiModelProperty
(
value
=
"下次检验日期 "
)
/**
* 下次检验日期
*/
private
String
endTime
;
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/dto/TzCarcylTraceDto.java
0 → 100644
View file @
e12280b4
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
flc
.
api
.
dto
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
TzCarcylTraceDto
{
private
TzCarcylRegDto
tzCarcylRegDto
;
private
List
<
TzCarcylInspectDto
>
tzCarcylInspectDtoList
;
private
List
<
TzCarcylFillInfoDto
>
tzCarcylFillInfoDtoList
;
public
TzCarcylTraceDto
(
TzCarcylRegDto
tzCarcylRegDto
,
List
<
TzCarcylInspectDto
>
tzCarcylInspectDtoList
,
List
<
TzCarcylFillInfoDto
>
tzCarcylFillInfoDtoList
)
{
this
.
tzCarcylRegDto
=
tzCarcylRegDto
;
this
.
tzCarcylInspectDtoList
=
tzCarcylInspectDtoList
;
this
.
tzCarcylFillInfoDtoList
=
tzCarcylFillInfoDtoList
;
}
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/entity/TzCarcylReg.java
0 → 100644
View file @
e12280b4
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
flc
.
api
.
entity
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
/**
* 车用气瓶使用登记信息(清洗后)
*
* @author duanwei
* @date 2022-08-08
*/
@Data
public
class
TzCarcylReg
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"使用单位名称"
)
/**
* 使用单位名称
*/
private
String
compontName
;
@ApiModelProperty
(
value
=
"单位统一信用代码"
)
/**
* 单位统一信用代码
*/
private
String
compontCode
;
@ApiModelProperty
(
value
=
"所属机构 "
)
/**
* 所属机构
*/
private
String
dept
;
@ApiModelProperty
(
value
=
"地址 "
)
/**
* 地址
*/
private
String
address
;
@ApiModelProperty
(
value
=
"联系人 "
)
/**
* 联系人
*/
private
String
legalPerson
;
@ApiModelProperty
(
value
=
"电话 "
)
/**
* 电话
*/
private
String
legalPhone
;
@ApiModelProperty
(
value
=
"车牌号 "
)
/**
* 车牌号
*/
private
String
carNum
;
@ApiModelProperty
(
value
=
"气瓶使用登记机关 "
)
/**
* 气瓶使用登记机关
*/
private
String
gasDeptName
;
@ApiModelProperty
(
value
=
"使用登记证编号 "
)
/**
* 使用登记证编号
*/
private
String
useNum
;
@ApiModelProperty
(
value
=
"投入使用日期 "
)
/**
* 投入使用日期
*/
private
Date
startTime
;
@ApiModelProperty
(
value
=
"下次检验日期 "
)
/**
* 下次检验日期
*/
private
Date
endTime
;
@ApiModelProperty
(
value
=
"创建时间 "
)
/**
* 创建时间
*/
private
Date
recDate
;
@ApiModelProperty
(
value
=
"操作人员 "
)
/**
* 操作人员
*/
private
String
recUserId
;
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/mapper/TzCarcylMapper.java
0 → 100644
View file @
e12280b4
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
flc
.
api
.
mapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.TzCarcylFillInfoDto
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.TzCarcylInspectDto
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.TzCarcylRegDto
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.entity.TzCarcylReg
;
import
java.util.List
;
/**
* 车用气瓶使用登记信息(清洗后) Mapper 接口
*
* @author duanwei
* @date 2022-08-08
*/
public
interface
TzCarcylMapper
extends
BaseMapper
<
TzCarcylReg
>
{
/**
* @param page 分頁内容
* @param TzCarcylRegDto 筛选内容
* @return
*/
IPage
<
TzCarcylRegDto
>
pageByOrgCode
(
Page
<
TzCarcylRegDto
>
page
,
TzCarcylRegDto
TzCarcylRegDto
,
String
superviseOrgCode
);
IPage
<
TzCarcylRegDto
>
pageByCompanyCode
(
Page
<
TzCarcylRegDto
>
page
,
TzCarcylRegDto
TzCarcylRegDto
,
String
companyCode
);
TzCarcylRegDto
getUserInfoger
(
String
sequenceNbr
);
String
getUseNum
(
String
sequenceNbr
);
List
<
TzCarcylFillInfoDto
>
getFillingInfo
(
String
useCode
);
List
<
TzCarcylInspectDto
>
getCheckingInfo
(
String
useCode
);
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/service/ITzCarcylService.java
0 → 100644
View file @
e12280b4
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
flc
.
api
.
service
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.PageParam
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.TzCarcylRegDto
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.TzCarcylTraceDto
;
/**
* 车用气瓶使用登记信息(列表) 服务类
*
* @author duanwei
* @date 2022-08-08
*/
public
interface
ITzCarcylService
{
IPage
<
TzCarcylRegDto
>
page
(
PageParam
pageParam
,
TzCarcylRegDto
idxBizCarcylUserCompany
,
String
key
);
TzCarcylTraceDto
getTrace
(
String
sequenceNbr
);
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/resources/mapper/Tz
sJg
EnterpriseInfoMapper.xml
→
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/resources/mapper/Tz
Base
EnterpriseInfoMapper.xml
View file @
e12280b4
<?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.precontrol.common.mapper.Tz
sJg
EnterpriseInfoMapper"
>
<mapper
namespace=
"com.yeejoin.precontrol.common.mapper.Tz
Base
EnterpriseInfoMapper"
>
</mapper>
</mapper>
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/resources/mapper/TzCarcylMapper.xml
0 → 100644
View file @
e12280b4
<?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">
<mapper
namespace=
"com.yeejoin.amos.boot.module.tzs.flc.api.mapper.TzCarcylMapper"
>
<select
id=
"pageByOrgCode"
resultType=
"com.yeejoin.amos.boot.module.tzs.flc.api.dto.TzCarcylRegDto"
>
SELECT
UI.sequence_nbr,
UC.compont_name,
UC.compont_code,
UC.dept,
UC.address,
UC.legal_person,
UC.legal_phone,
UC.supervise_org_code,
UI.car_num,
UI.gas_dept_name,
UI.use_num,
UI.start_time,
UI.end_time
FROM
tz_carcyl_user_info UI
LEFT JOIN (
SELECT
UC.compont_name,
UC.compont_code,
UC.dept,
EI.address,
EI.legal_person,
EI.legal_phone,
UC.instance_id,
EI.supervise_org_code
FROM
tz_carcyl_user_company UC
LEFT JOIN tz_base_enterprise_info EI ON UC.compont_code = EI.use_code
) AS UC ON UC.instance_id = UI.instance_id
<where>
<if
test=
"TzCarcylRegDto.compontName!=null and TzCarcylRegDto.compontName!='' "
>
AND UC.compont_name LIKE
CONCAT('%',#{TzCarcylRegDto.compontName},'%')
</if>
<if
test=
"TzCarcylRegDto.compontCode!=null and TzCarcylRegDto.compontCode!='' "
>
AND UC.compont_code LIKE
CONCAT('%',#{TzCarcylRegDto.compontCode},'%')
</if>
<if
test=
"TzCarcylRegDto.dept!=null and TzCarcylRegDto.dept!='' "
>
AND UC.dept LIKE
CONCAT('%',#{TzCarcylRegDto.dept},'%')
</if>
<if
test=
"TzCarcylRegDto.address!=null and TzCarcylRegDto.address!='' "
>
AND UC.address LIKE
CONCAT('%',#{TzCarcylRegDto.address},'%')
</if>
<if
test=
"TzCarcylRegDto.legalPerson!=null and TzCarcylRegDto.legalPerson!='' "
>
AND UC.legal_person LIKE
CONCAT('%',#{TzCarcylRegDto.legalPerson},'%')
</if>
<if
test=
"TzCarcylRegDto.legalPhone!=null and TzCarcylRegDto.legalPhone!='' "
>
AND UC.legal_phone LIKE
CONCAT('%',#{TzCarcylRegDto.legalPhone},'%')
</if>
<if
test=
"TzCarcylRegDto.carNum!=null and TzCarcylRegDto.carNum!='' "
>
AND UI.car_num LIKE
CONCAT('%',#{TzCarcylRegDto.carNum},'%')
</if>
<if
test=
"TzCarcylRegDto.gasDeptName!=null and TzCarcylRegDto.gasDeptName!='' "
>
AND UI.gas_dept_name LIKE
CONCAT('%',#{TzCarcylRegDto.gasDeptName},'%')
</if>
<if
test=
"TzCarcylRegDto.useNum!=null and TzCarcylRegDto.useNum!='' "
>
AND UI.use_num LIKE
CONCAT('%',#{TzCarcylRegDto.useNum},'%')
</if>
<if
test=
"TzCarcylRegDto.startTime!=null and TzCarcylRegDto.startTime!='' "
>
AND UI.start_time LIKE
CONCAT('%',#{TzCarcylRegDto.startTime},'%')
</if>
<if
test=
"TzCarcylRegDto.endTime!=null and TzCarcylRegDto.endTime!='' "
>
AND UI.end_time LIKE
CONCAT('%',#{TzCarcylRegDto.endTime},'%')
</if>
<if
test=
"superviseOrgCode!=null and superviseOrgCode!='' "
>
AND UC.supervise_org_code LIKE
CONCAT('%',#{superviseOrgCode},'%')
</if>
</where>
</select>
<select
id=
"pageByCompanyCode"
resultType=
"com.yeejoin.amos.boot.module.tzs.flc.api.dto.TzCarcylRegDto"
>
SELECT
UI.sequence_nbr,
UC.compont_name,
UC.compont_code,
UC.dept,
UC.address,
UC.legal_person,
UC.legal_phone,
UC.supervise_org_code,
UI.car_num,
UI.gas_dept_name,
UI.use_num,
UI.start_time,
UI.end_time
FROM
tz_carcyl_user_info UI
LEFT JOIN (
SELECT
UC.compont_name,
UC.compont_code,
UC.dept,
EI.address,
EI.legal_person,
EI.legal_phone,
UC.instance_id,
EI.supervise_org_code
FROM
tz_carcyl_user_company UC
LEFT JOIN tz_base_enterprise_info EI ON UC.compont_code = EI.use_code
) AS UC ON UC.instance_id = UI.instance_id
<where>
<if
test=
"TzCarcylRegDto.compontName!=null and TzCarcylRegDto.compontName!='' "
>
AND UC.compont_name LIKE
CONCAT('%',#{TzCarcylRegDto.compontName},'%')
</if>
<if
test=
"TzCarcylRegDto.compontCode!=null and TzCarcylRegDto.compontCode!='' "
>
AND UC.compont_code LIKE
CONCAT('%',#{TzCarcylRegDto.compontCode},'%')
</if>
<if
test=
"TzCarcylRegDto.dept!=null and TzCarcylRegDto.dept!='' "
>
AND UC.dept LIKE
CONCAT('%',#{TzCarcylRegDto.dept},'%')
</if>
<if
test=
"TzCarcylRegDto.address!=null and TzCarcylRegDto.address!='' "
>
AND UC.address LIKE
CONCAT('%',#{TzCarcylRegDto.address},'%')
</if>
<if
test=
"TzCarcylRegDto.legalPerson!=null and TzCarcylRegDto.legalPerson!='' "
>
AND UC.legal_person LIKE
CONCAT('%',#{TzCarcylRegDto.legalPerson},'%')
</if>
<if
test=
"TzCarcylRegDto.legalPhone!=null and TzCarcylRegDto.legalPhone!='' "
>
AND UC.legal_phone LIKE
CONCAT('%',#{TzCarcylRegDto.legalPhone},'%')
</if>
<if
test=
"TzCarcylRegDto.carNum!=null and TzCarcylRegDto.carNum!='' "
>
AND UI.car_num LIKE
CONCAT('%',#{TzCarcylRegDto.carNum},'%')
</if>
<if
test=
"TzCarcylRegDto.gasDeptName!=null and TzCarcylRegDto.gasDeptName!='' "
>
AND UI.gas_dept_name LIKE
CONCAT('%',#{TzCarcylRegDto.gasDeptName},'%')
</if>
<if
test=
"TzCarcylRegDto.useNum!=null and TzCarcylRegDto.useNum!='' "
>
AND UI.use_num LIKE
CONCAT('%',#{TzCarcylRegDto.useNum},'%')
</if>
<if
test=
"TzCarcylRegDto.startTime!=null and TzCarcylRegDto.startTime!='' "
>
AND UI.start_time LIKE
CONCAT('%',#{TzCarcylRegDto.startTime},'%')
</if>
<if
test=
"TzCarcylRegDto.endTime!=null and TzCarcylRegDto.endTime!='' "
>
AND UI.end_time LIKE
CONCAT('%',#{TzCarcylRegDto.endTime},'%')
</if>
<if
test=
"companyCode!=null and companyCode!='' "
>
AND UC.compont_code LIKE
CONCAT('%',#{companyCode},'%')
</if>
</where>
</select>
<select
id=
"getUserInfoger"
resultType=
"com.yeejoin.amos.boot.module.tzs.flc.api.dto.TzCarcylRegDto"
>
SELECT
UI.sequence_nbr,
UC.compont_name,
UC.compont_code,
UC.dept,
UC.address,
UC.legal_person,
UC.legal_phone,
UI.car_num,
UI.gas_dept_name,
UI.use_num,
UI.start_time,
UI.end_time
FROM
tz_carcyl_user_info UI
LEFT JOIN (
SELECT
UC.compont_name,
UC.compont_code,
UC.dept,
EI.address,
EI.legal_person,
EI.legal_phone,
UC.instance_id
FROM
tz_carcyl_user_company UC
LEFT JOIN tz_base_enterprise_info EI ON UC.compont_code = EI.use_code
) AS UC ON UC.instance_id = UI.instance_id
WHERE UI.sequence_nbr = #{sequenceNbr}
</select>
<select
id=
"getUseNum"
resultType=
"java.lang.String"
>
SELECT
use_num
FROM
tz_carcyl_user_info
WHERE sequence_nbr = #{sequenceNbr}
</select>
<select
id=
"getFillingInfo"
resultType=
"com.yeejoin.amos.boot.module.tzs.flc.api.dto.TzCarcylFillInfoDto"
>
SELECT
FC.company_name,
FC.company_code,
FC.dept,
FI.sequence_nbr,
FI.instance_id,
FI.use_code,
FI.gas_date,
FI.gas_check_name,
FI.gas_check_name,
FI.gas_name,
FI.gas_media
FROM
tz_carcyl_filling_info AS FI
LEFT JOIN tz_carcyl_filling_company AS FC ON FC.instance_id=FI.instance_id
WHERE FI.use_code=#{useCode}
</select>
<select
id=
"getCheckingInfo"
resultType=
"com.yeejoin.amos.boot.module.tzs.flc.api.dto.TzCarcylInspectDto"
>
SELECT
CC.check_dept_name,
CC.organization_code,
CC.organization_dept_code,
CI.use_code,
CI.check_date,
CI.next_check_date,
CI.check_result,
CI.gas_disable_date,
CI.main_problem
FROM
tz_carcyl_check_info AS CI
LEFT JOIN tz_carcyl_check_company AS CC ON CC.instance_id = CI.instance_id
WHERE CI.use_code=#{useCode}
</select>
</mapper>
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/AmosTzsApplication.java
View file @
e12280b4
package
com
.
yeejoin
.
amos
;
package
com
.
yeejoin
.
amos
;
import
com.yeejoin.amos.boot.biz.common.utils.oConvertUtils
;
import
java.net.InetAddress
;
import
java.net.UnknownHostException
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
...
@@ -11,14 +16,18 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
...
@@ -11,14 +16,18 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import
org.springframework.cloud.netflix.eureka.EnableEurekaClient
;
import
org.springframework.cloud.netflix.eureka.EnableEurekaClient
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.core.env.Environment
;
import
org.springframework.core.env.Environment
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
java.net.InetAddress
;
import
com.yeejoin.amos.boot.biz.common.utils.oConvertUtils
;
import
java.net.UnknownHostException
;
import
com.yeejoin.amos.boot.module.tzs.biz.listener.BaseEnterpriseMqTtlListener
;
import
com.yeejoin.amos.boot.module.tzs.biz.listener.CarcylUnitInspectMqTtlListener
;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.StartPlatformTokenService
;
/**
/**
* <pre>
* <pre>
...
@@ -36,15 +45,23 @@ import java.net.UnknownHostException;
...
@@ -36,15 +45,23 @@ import java.net.UnknownHostException;
@EnableAsync
@EnableAsync
@EnableEurekaClient
@EnableEurekaClient
@EnableScheduling
@EnableScheduling
@MapperScan
({
"org.typroject.tyboot.demo.face.orm.dao*"
,
@MapperScan
({
"org.typroject.tyboot.demo.face.orm.dao*"
,
"org.typroject.tyboot.face.*.orm.dao*"
,
"org.typroject.tyboot.face.*.orm.dao*"
,
"org.typroject.tyboot.core.auth.face.orm.dao*"
,
"org.typroject.tyboot.component.*.face.orm.dao*"
,
"org.typroject.tyboot.core.auth.face.orm.dao*"
,
"com.yeejoin.amos.boot.module.**.api.mapper"
,
"com.yeejoin.amos.boot.biz.common.dao.mapper"
})
"org.typroject.tyboot.component.*.face.orm.dao*"
,
@ComponentScan
(
basePackages
=
{
"org.typroject"
,
"com.yeejoin.amos"
})
"com.yeejoin.amos.boot.module.**.api.mapper"
,
"com.yeejoin.amos.boot.biz.common.dao.mapper"
})
@ComponentScan
(
basePackages
=
{
"org.typroject"
,
"com.yeejoin.amos"
})
public
class
AmosTzsApplication
{
public
class
AmosTzsApplication
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
AmosTzsApplication
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
AmosTzsApplication
.
class
);
@Autowired
private
EmqKeeper
emqKeeper
;
@Autowired
private
CarcylUnitInspectMqTtlListener
carcylUnitInspectMqTtlListener
;
@Autowired
private
BaseEnterpriseMqTtlListener
baseEnterpriseMqTtlListener
;
@Autowired
private
StartPlatformTokenService
startPlatformTokenService
;
public
static
void
main
(
String
[]
args
)
throws
UnknownHostException
{
public
static
void
main
(
String
[]
args
)
throws
UnknownHostException
{
ConfigurableApplicationContext
context
=
SpringApplication
.
run
(
AmosTzsApplication
.
class
,
args
);
ConfigurableApplicationContext
context
=
SpringApplication
.
run
(
AmosTzsApplication
.
class
,
args
);
...
@@ -53,9 +70,26 @@ public class AmosTzsApplication {
...
@@ -53,9 +70,26 @@ public class AmosTzsApplication {
String
port
=
env
.
getProperty
(
"server.port"
);
String
port
=
env
.
getProperty
(
"server.port"
);
String
path
=
oConvertUtils
.
getString
(
env
.
getProperty
(
"server.servlet.context-path"
));
String
path
=
oConvertUtils
.
getString
(
env
.
getProperty
(
"server.servlet.context-path"
));
logger
.
info
(
"\n----------------------------------------------------------\n\t"
+
logger
.
info
(
"\n----------------------------------------------------------\n\t"
"Application Amos-Biz-Boot is running! Access URLs:\n\t"
+
+
"Application Amos-Biz-Boot is running! Access URLs:\n\t"
+
"Swagger文档: \thttp://"
+
ip
+
":"
+
port
"Swagger文档: \thttp://"
+
ip
+
":"
+
port
+
path
+
"/doc.html\n"
+
+
path
+
"/doc.html\n"
+
"----------------------------------------------------------"
);
"----------------------------------------------------------"
);
}
/**
* 初始化MQTT
*
* @throws MqttException
*/
@Bean
public
void
initMqtt
()
throws
MqttException
{
emqKeeper
.
getMqttClient
().
subscribe
(
"/idx/idx_biz_carcyl_unit_inspect"
,
1
,
carcylUnitInspectMqTtlListener
);
emqKeeper
.
getMqttClient
().
subscribe
(
"/tm/tz_base_enterprise_info"
,
1
,
baseEnterpriseMqTtlListener
);
// emqKeeper.getMqttClient().subscribe("topic_mqtt_exam", 1, examMqTtlListener);
// emqKeeper.getMqttClient().subscribe("topic_mqtt_exam_record", 1, examMqTtRecordListener);
}
@Bean
public
void
initToken
()
{
startPlatformTokenService
.
getToken
();
}
}
}
}
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/TzBaseEnterpriseInfoController.java
0 → 100644
View file @
e12280b4
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
controller
;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.TzBaseEnterpriseInfo
;
import
com.yeejoin.amos.boot.module.tzs.api.service.ITzBaseEnterpriseInfoService
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.servlet.http.HttpServletRequest
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
java.util.Arrays
;
/**
* 企业数据信息
*
* @author duanwei
* @date 2022-08-10
*/
@RestController
@Api
(
tags
=
"企业数据信息Api"
)
@RequestMapping
(
value
=
"/baseEnterprise"
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
class
TzBaseEnterpriseInfoController
{
@Autowired
ITzBaseEnterpriseInfoService
iTzBaseEnterpriseInfoService
;
/**
* 新增企业数据信息
* @return
*/
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增企业数据信息"
,
notes
=
"新增企业数据信息"
)
public
boolean
saveTzBaseEnterpriseInfo
(
HttpServletRequest
request
,
@RequestBody
TzBaseEnterpriseInfo
tzBaseEnterpriseInfo
){
return
iTzBaseEnterpriseInfoService
.
save
(
tzBaseEnterpriseInfo
);
}
/**
* 根据id删除
* @param id
* @return
*/
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据id删除"
,
notes
=
"根据id删除"
)
public
boolean
deleteById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
return
iTzBaseEnterpriseInfoService
.
removeById
(
id
);
}
/**
* 修改企业数据信息
* @return
*/
@RequestMapping
(
value
=
"/updateById"
,
method
=
RequestMethod
.
PUT
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"修改企业数据信息"
,
notes
=
"修改企业数据信息"
)
public
boolean
updateByIdTzBaseEnterpriseInfo
(
HttpServletRequest
request
,
@RequestBody
TzBaseEnterpriseInfo
tzBaseEnterpriseInfo
){
return
iTzBaseEnterpriseInfoService
.
updateById
(
tzBaseEnterpriseInfo
);
}
/**
* 根据id查询
* @param id
* @return
*/
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询"
,
notes
=
"根据id查询"
)
public
TzBaseEnterpriseInfo
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
return
iTzBaseEnterpriseInfoService
.
getById
(
id
);
}
/**
* 列表分页查询
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表分页查询"
,
notes
=
"列表分页查询"
)
public
IPage
<
TzBaseEnterpriseInfo
>
listPage
(
String
pageNum
,
String
pageSize
,
TzBaseEnterpriseInfo
tzBaseEnterpriseInfo
){
Page
<
TzBaseEnterpriseInfo
>
pageBean
;
QueryWrapper
<
TzBaseEnterpriseInfo
>
tzBaseEnterpriseInfoQueryWrapper
=
new
QueryWrapper
<>();
Class
<?
extends
TzBaseEnterpriseInfo
>
aClass
=
tzBaseEnterpriseInfo
.
getClass
();
Arrays
.
stream
(
aClass
.
getDeclaredFields
()).
forEach
(
field
->
{
try
{
field
.
setAccessible
(
true
);
Object
o
=
field
.
get
(
tzBaseEnterpriseInfo
);
if
(
o
!=
null
)
{
Class
<?>
type
=
field
.
getType
();
String
name
=
NameUtils
.
camel2Underline
(
field
.
getName
());
if
(
type
.
equals
(
Integer
.
class
))
{
Integer
fileValue
=
(
Integer
)
field
.
get
(
tzBaseEnterpriseInfo
);
tzBaseEnterpriseInfoQueryWrapper
.
eq
(
name
,
fileValue
);
}
else
if
(
type
.
equals
(
Long
.
class
))
{
Long
fileValue
=
(
Long
)
field
.
get
(
tzBaseEnterpriseInfo
);
tzBaseEnterpriseInfoQueryWrapper
.
eq
(
name
,
fileValue
);
}
else
if
(
type
.
equals
(
String
.
class
))
{
String
fileValue
=
(
String
)
field
.
get
(
tzBaseEnterpriseInfo
);
tzBaseEnterpriseInfoQueryWrapper
.
eq
(
name
,
fileValue
);
}
else
{
String
fileValue
=
(
String
)
field
.
get
(
tzBaseEnterpriseInfo
);
tzBaseEnterpriseInfoQueryWrapper
.
eq
(
name
,
fileValue
);
}
}
}
catch
(
Exception
e
)
{
}
});
IPage
<
TzBaseEnterpriseInfo
>
page
;
if
(
StringUtils
.
isBlank
(
pageNum
)
||
StringUtils
.
isBlank
(
pageSize
))
{
pageBean
=
new
Page
<>(
0
,
Long
.
MAX_VALUE
);
}
else
{
pageBean
=
new
Page
<>(
Integer
.
parseInt
(
pageNum
),
Integer
.
parseInt
(
pageSize
));
}
page
=
iTzBaseEnterpriseInfoService
.
page
(
pageBean
,
tzBaseEnterpriseInfoQueryWrapper
);
return
page
;
}
}
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/listener/BaseEnterpriseMqTtlListener.java
0 → 100644
View file @
e12280b4
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
listener
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
org.eclipse.paho.client.mqttv3.MqttMessage
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.tzs.biz.utils.DesUtil
;
import
com.yeejoin.amos.boot.module.tzs.biz.utils.RedisUtil
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.ApplicationModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
lombok.extern.slf4j.Slf4j
;
/**
* @Description: mqtt监听服务
* @Author: duanwei
* @Date: 2020/9/15
*/
@Component
@Slf4j
public
class
BaseEnterpriseMqTtlListener
extends
EmqxListener
{
@Value
(
"${amos.secret.key}"
)
String
secretKey
;
@Value
(
"${admin.product}"
)
String
product
;
@Value
(
"${admin.appkey}"
)
String
appkey
;
@Autowired
RedisUtil
redisUtil
;
@Override
public
void
processMessage
(
String
topic
,
MqttMessage
message
)
throws
Exception
{
System
.
out
.
println
(
message
);
JSONObject
object
=
null
;
try
{
object
=
JSONObject
.
parseObject
(
message
.
toString
());
}
catch
(
Exception
e
)
{
throw
new
Exception
(
"公司同步消息解析失败"
);
}
RequestContext
.
setAppKey
(
appkey
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setToken
(
String
.
valueOf
(
redisUtil
.
get
(
"platform_token"
)));
FeignClientResult
<
List
<
ApplicationModel
>>
aResult
=
Privilege
.
applicationClient
.
queryAgencyApplications
();
List
<
ApplicationModel
>
aList
=
aResult
.
getResult
();
List
<
String
>
appCodes
=
aList
.
stream
().
filter
(
i
->
"监管端,企业端"
.
indexOf
(
i
.
getAppName
())
!=
-
1
)
.
map
(
i
->
i
.
getAppCode
()).
collect
(
Collectors
.
toList
());
FeignClientResult
<
CompanyModel
>
cResult
=
Privilege
.
companyClient
.
seleteOne
(
object
.
getLong
(
"sequence_nbr"
));
if
(
cResult
.
getResult
()
==
null
)
{
CompanyModel
companyModel
=
new
CompanyModel
();
companyModel
.
setCompanyName
(
object
.
getString
(
"use_unit"
));
companyModel
.
setParentId
(
0L
);
companyModel
.
setLevel
(
"company"
);
companyModel
.
setSequenceNbr
(
object
.
getLong
(
"sequence_nbr"
));
companyModel
.
setCompanyCode
(
object
.
getString
(
"use_code"
));
FeignClientResult
<
HashMap
<
String
,
Object
>>
result
=
Privilege
.
companyClient
.
queryByOrgcode
(
object
.
getString
(
"supervise_org_code"
));
//JSONObject parent = JSONObject.parseObject(JSONObject.toJSONString(result.getResult()));
if
(
result
.
getResult
().
get
(
"sequenceNbr"
)!=
null
)
{
companyModel
.
setParentId
(
Long
.
valueOf
(
result
.
getResult
().
get
(
"sequenceNbr"
).
toString
()));
}
Privilege
.
companyClient
.
create
(
companyModel
);
}
String
unitCode
=
object
.
getString
(
"use_code"
);
if
(
unitCode
==
null
||
unitCode
.
length
()
<
6
)
{
log
.
error
(
"公司统一信用代码长度不够6位"
);
throw
new
Exception
(
"公司统一信用代码长度不够6位"
);
}
String
userName
=
unitCode
.
substring
(
unitCode
.
length
()
-
6
,
unitCode
.
length
());
FeignClientResult
<
AgencyUserModel
>
uResult
=
Privilege
.
agencyUserClient
.
queryByUserName
(
userName
);
if
(
uResult
.
getResult
()
==
null
)
{
AgencyUserModel
userModel
=
new
AgencyUserModel
();
userModel
.
setUserName
(
userName
);
userModel
.
setRealName
(
userName
);
userModel
.
setPassword
(
DesUtil
.
encode
(
userName
,
secretKey
));
userModel
.
setRePassword
(
DesUtil
.
encode
(
userName
,
secretKey
));
// userModel.setMobile(vo.getPhoneNo());
userModel
.
setLockStatus
(
"UNLOCK"
);
FeignClientResult
<
List
<
RoleModel
>>
list
=
Privilege
.
roleClient
.
queryRoleList
(
"使用单位"
,
"admin"
);
Map
<
Long
,
List
<
Long
>>
orgRoles
=
new
HashMap
<>();
List
<
Long
>
roleIds
=
new
ArrayList
<>();
roleIds
.
add
(
list
.
getResult
().
get
(
0
).
getSequenceNbr
());
orgRoles
.
put
(
object
.
getLong
(
"sequence_nbr"
),
roleIds
);
userModel
.
setAppCodes
(
appCodes
);
userModel
.
setOrgRoleSeqs
(
orgRoles
);
Privilege
.
agencyUserClient
.
create
(
userModel
);
}
}
}
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/listener/CarcylUnitInspectMqTtlListener.java
0 → 100644
View file @
e12280b4
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
listener
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
org.eclipse.paho.client.mqttv3.MqttMessage
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.exception.BaseException
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.tzs.biz.utils.DesUtil
;
import
com.yeejoin.amos.boot.module.tzs.biz.utils.RedisUtil
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.ApplicationModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
lombok.extern.slf4j.Slf4j
;
/**
* @Description: mqtt监听服务
* @Author: duanwei
* @Date: 2020/9/15
*/
@Component
@Slf4j
public
class
CarcylUnitInspectMqTtlListener
extends
EmqxListener
{
@Value
(
"${amos.secret.key}"
)
String
secretKey
;
@Value
(
"${admin.product}"
)
String
product
;
@Value
(
"${admin.appkey}"
)
String
appkey
;
@Autowired
RedisUtil
redisUtil
;
@Override
public
void
processMessage
(
String
topic
,
MqttMessage
message
)
throws
Exception
{
System
.
out
.
println
(
message
);
JSONObject
object
=
null
;
try
{
object
=
JSONObject
.
parseObject
(
message
.
toString
());
}
catch
(
Exception
e
)
{
throw
new
Exception
(
"公司同步消息解析失败"
);
}
RequestContext
.
setAppKey
(
appkey
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setToken
(
String
.
valueOf
(
redisUtil
.
get
(
"platform_token"
)));
FeignClientResult
<
List
<
ApplicationModel
>>
aResult
=
Privilege
.
applicationClient
.
queryAgencyApplications
();
List
<
ApplicationModel
>
aList
=
aResult
.
getResult
();
List
<
String
>
appCodes
=
aList
.
stream
().
filter
(
i
->
"监管端,企业端"
.
indexOf
(
i
.
getAppName
())
!=
-
1
)
.
map
(
i
->
i
.
getAppCode
()).
collect
(
Collectors
.
toList
());
String
uuid
=
object
.
getString
(
"id"
);
Long
id
=
Long
.
valueOf
(
uuid
.
replaceAll
(
"-"
,
""
).
hashCode
());
FeignClientResult
<
CompanyModel
>
cResult
=
Privilege
.
companyClient
.
seleteOne
(
id
);
if
(
cResult
.
getResult
()
==
null
)
{
CompanyModel
companyModel
=
new
CompanyModel
();
companyModel
.
setCompanyName
(
object
.
getString
(
"inspect_unit_name"
));
companyModel
.
setParentId
(
0L
);
companyModel
.
setLevel
(
"company"
);
companyModel
.
setSequenceNbr
(
id
);
companyModel
.
setCompanyCode
(
object
.
getString
(
"org_unit_name"
));
Privilege
.
companyClient
.
create
(
companyModel
);
}
String
unitCode
=
object
.
getString
(
"org_unit_name"
);
if
(
unitCode
==
null
||
unitCode
.
length
()
<
6
)
{
log
.
error
(
"公司统一信用代码长度不够6位"
);
throw
new
Exception
(
"公司统一信用代码长度不够6位"
);
}
String
userName
=
unitCode
.
substring
(
unitCode
.
length
()
-
6
,
unitCode
.
length
());
FeignClientResult
<
AgencyUserModel
>
uResult
=
Privilege
.
agencyUserClient
.
queryByUserName
(
userName
);
if
(
uResult
.
getResult
()
==
null
)
{
AgencyUserModel
userModel
=
new
AgencyUserModel
();
userModel
.
setUserName
(
userName
);
userModel
.
setRealName
(
userName
);
userModel
.
setPassword
(
DesUtil
.
encode
(
userName
,
secretKey
));
userModel
.
setRePassword
(
DesUtil
.
encode
(
userName
,
secretKey
));
// userModel.setMobile(vo.getPhoneNo());
userModel
.
setLockStatus
(
"UNLOCK"
);
FeignClientResult
<
List
<
RoleModel
>>
list
=
Privilege
.
roleClient
.
queryRoleList
(
"检验单位"
,
"admin"
);
Map
<
Long
,
List
<
Long
>>
orgRoles
=
new
HashMap
<>();
List
<
Long
>
roleIds
=
new
ArrayList
<>();
roleIds
.
add
(
list
.
getResult
().
get
(
0
).
getSequenceNbr
());
orgRoles
.
put
(
id
,
roleIds
);
userModel
.
setAppCodes
(
appCodes
);
userModel
.
setOrgRoleSeqs
(
orgRoles
);
Privilege
.
agencyUserClient
.
create
(
userModel
);
}
}
}
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/StartPlatformTokenService.java
0 → 100644
View file @
e12280b4
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
service
.
impl
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
com.yeejoin.amos.boot.module.tzs.biz.utils.DesUtil
;
import
com.yeejoin.amos.boot.module.tzs.biz.utils.RedisUtil
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.IdPasswordAuthModel
;
@Service
public
class
StartPlatformTokenService
{
@Value
(
"${admin.product}"
)
String
product
;
@Value
(
"${admin.appkey}"
)
String
appkey
;
@Value
(
"${admin.user}"
)
String
user
;
@Value
(
"${admin.password}"
)
String
password
;
@Value
(
"${amos.secret.key}"
)
String
secretKey
;
@Autowired
RedisUtil
redisUtil
;
public
void
getToken
()
{
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appkey
);
IdPasswordAuthModel
authModel
=
new
IdPasswordAuthModel
();
authModel
.
setLoginId
(
user
);
authModel
.
setPassword
(
DesUtil
.
encode
(
password
,
secretKey
));
System
.
out
.
println
(
"user:"
+
user
);
System
.
out
.
println
(
"secretKey:"
+
secretKey
);
FeignClientResult
<
Map
<
String
,
String
>>
authResult
=
Privilege
.
authClient
.
idpassword
(
authModel
);
String
token
=
authResult
.
getResult
().
get
(
"token"
);
System
.
out
.
println
(
"token:"
+
token
);
RequestContext
.
setToken
(
token
);
redisUtil
.
set
(
"platform_token"
,
token
);
}
}
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/Tz
sJg
EnterpriseInfoServiceImpl.java
→
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/Tz
Base
EnterpriseInfoServiceImpl.java
View file @
e12280b4
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
service
.
impl
;
import
org.springframework.stereotype.Service
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.TzBaseEnterpriseInfoDto
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.TzBaseEnterpriseInfo
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.TzBaseEnterpriseInfoMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.service.ITzBaseEnterpriseInfoService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.TzsJgEnterpriseInfo
;
import
org.springframework.stereotype.Service
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.TzsJgEnterpriseInfoMapper
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
com.yeejoin.amos.boot.module.tzs.api.service.ITzsJgEnterpriseInfoService
;
/**
/**
* 企业数据信息 服务实现类
* 企业数据信息 服务实现类
*
*
* @author duanwei
* @author duanwei
* @date 2022-0
7-26
* @date 2022-0
8-10
*/
*/
@Service
@Service
public
class
Tz
sJgEnterpriseInfoServiceImpl
extends
ServiceImpl
<
TzsJgEnterpriseInfoMapper
,
TzsJgEnterpriseInfo
>
implements
ITzsJg
EnterpriseInfoService
{
public
class
Tz
BaseEnterpriseInfoServiceImpl
extends
BaseService
<
TzBaseEnterpriseInfoDto
,
TzBaseEnterpriseInfo
,
TzBaseEnterpriseInfoMapper
>
implements
ITzBase
EnterpriseInfoService
{
}
}
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/utils/DesUtil.java
0 → 100644
View file @
e12280b4
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
utils
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.apache.commons.lang.StringUtils
;
/**
*
* <pre>
* DES加密解密工具
* 加密:DesUtils.encode("admin","1,2,3");
* 解密:DesUtils.decode("012C2C9BA925FAF8045B2FD9B02A2664","1,2,3");
* </pre>
*
* @author amos
* @version $Id: DesUtil.java, v 0.1 2018年10月13日 下午3:56:27 amos Exp $
*/
public
class
DesUtil
{
private
static
DesCore
desCore
=
new
DesCore
();
/**
* DES加密(secretKey代表3个key,用逗号分隔)
*/
public
static
String
encode
(
String
data
,
String
secretKey
)
{
if
(
StringUtils
.
isBlank
(
data
)){
return
""
;
}
String
[]
ks
=
StringUtils
.
split
(
secretKey
,
","
);
if
(
ks
.
length
>=
3
){
return
desCore
.
strEnc
(
data
,
ks
[
0
],
ks
[
1
],
ks
[
2
]);
}
return
desCore
.
strEnc
(
data
,
secretKey
,
""
,
""
);
}
/**
* DES解密(secretKey代表3个key,用逗号分隔)
*/
public
static
String
decode
(
String
data
,
String
secretKey
)
{
if
(
StringUtils
.
isBlank
(
data
)){
return
""
;
}
String
[]
ks
=
StringUtils
.
split
(
secretKey
,
","
);
if
(
ks
.
length
>=
3
){
return
desCore
.
strDec
(
data
,
ks
[
0
],
ks
[
1
],
ks
[
2
]);
}
return
desCore
.
strDec
(
data
,
secretKey
,
""
,
""
);
}
/**
*
* <pre>
* DES加密/解密
* @Copyright Copyright (c) 2006
* </pre>
*
* @author amos
* @version $Id: DesUtil.java, v 0.1 2018年10月13日 下午3:56:59 amos Exp $
*/
@SuppressWarnings
({
"rawtypes"
,
"unused"
,
"unchecked"
})
static
class
DesCore
{
/*
* encrypt the string to string made up of hex return the encrypted string
*/
public
String
strEnc
(
String
data
,
String
firstKey
,
String
secondKey
,
String
thirdKey
)
{
int
leng
=
data
.
length
();
String
encData
=
""
;
List
firstKeyBt
=
null
,
secondKeyBt
=
null
,
thirdKeyBt
=
null
;
int
firstLength
=
0
,
secondLength
=
0
,
thirdLength
=
0
;
if
(
firstKey
!=
null
&&
firstKey
!=
""
)
{
firstKeyBt
=
getKeyBytes
(
firstKey
);
firstLength
=
firstKeyBt
.
size
();
}
if
(
secondKey
!=
null
&&
secondKey
!=
""
)
{
secondKeyBt
=
getKeyBytes
(
secondKey
);
secondLength
=
secondKeyBt
.
size
();
}
if
(
thirdKey
!=
null
&&
thirdKey
!=
""
)
{
thirdKeyBt
=
getKeyBytes
(
thirdKey
);
thirdLength
=
thirdKeyBt
.
size
();
}
if
(
leng
>
0
)
{
if
(
leng
<
4
)
{
int
[]
bt
=
strToBt
(
data
);
int
[]
encByte
=
null
;
if
(
firstKey
!=
null
&&
firstKey
!=
""
&&
secondKey
!=
null
&&
secondKey
!=
""
&&
thirdKey
!=
null
&&
thirdKey
!=
""
)
{
int
[]
tempBt
;
int
x
,
y
,
z
;
tempBt
=
bt
;
for
(
x
=
0
;
x
<
firstLength
;
x
++)
{
tempBt
=
enc
(
tempBt
,
(
int
[])
firstKeyBt
.
get
(
x
));
}
for
(
y
=
0
;
y
<
secondLength
;
y
++)
{
tempBt
=
enc
(
tempBt
,
(
int
[])
secondKeyBt
.
get
(
y
));
}
for
(
z
=
0
;
z
<
thirdLength
;
z
++)
{
tempBt
=
enc
(
tempBt
,
(
int
[])
thirdKeyBt
.
get
(
z
));
}
encByte
=
tempBt
;
}
else
{
if
(
firstKey
!=
null
&&
firstKey
!=
""
&&
secondKey
!=
null
&&
secondKey
!=
""
)
{
int
[]
tempBt
;
int
x
,
y
;
tempBt
=
bt
;
for
(
x
=
0
;
x
<
firstLength
;
x
++)
{
tempBt
=
enc
(
tempBt
,
(
int
[])
firstKeyBt
.
get
(
x
));
}
for
(
y
=
0
;
y
<
secondLength
;
y
++)
{
tempBt
=
enc
(
tempBt
,
(
int
[])
secondKeyBt
.
get
(
y
));
}
encByte
=
tempBt
;
}
else
{
if
(
firstKey
!=
null
&&
firstKey
!=
""
)
{
int
[]
tempBt
;
int
x
=
0
;
tempBt
=
bt
;
for
(
x
=
0
;
x
<
firstLength
;
x
++)
{
tempBt
=
enc
(
tempBt
,
(
int
[])
firstKeyBt
.
get
(
x
));
}
encByte
=
tempBt
;
}
}
}
encData
=
bt64ToHex
(
encByte
);
}
else
{
int
iterator
=
(
leng
/
4
);
int
remainder
=
leng
%
4
;
int
i
=
0
;
for
(
i
=
0
;
i
<
iterator
;
i
++)
{
String
tempData
=
data
.
substring
(
i
*
4
+
0
,
i
*
4
+
4
);
int
[]
tempByte
=
strToBt
(
tempData
);
int
[]
encByte
=
null
;
if
(
firstKey
!=
null
&&
firstKey
!=
""
&&
secondKey
!=
null
&&
secondKey
!=
""
&&
thirdKey
!=
null
&&
thirdKey
!=
""
)
{
int
[]
tempBt
;
int
x
,
y
,
z
;
tempBt
=
tempByte
;
for
(
x
=
0
;
x
<
firstLength
;
x
++)
{
tempBt
=
enc
(
tempBt
,
(
int
[])
firstKeyBt
.
get
(
x
));
}
for
(
y
=
0
;
y
<
secondLength
;
y
++)
{
tempBt
=
enc
(
tempBt
,
(
int
[])
secondKeyBt
.
get
(
y
));
}
for
(
z
=
0
;
z
<
thirdLength
;
z
++)
{
tempBt
=
enc
(
tempBt
,
(
int
[])
thirdKeyBt
.
get
(
z
));
}
encByte
=
tempBt
;
}
else
{
if
(
firstKey
!=
null
&&
firstKey
!=
""
&&
secondKey
!=
null
&&
secondKey
!=
""
)
{
int
[]
tempBt
;
int
x
,
y
;
tempBt
=
tempByte
;
for
(
x
=
0
;
x
<
firstLength
;
x
++)
{
tempBt
=
enc
(
tempBt
,
(
int
[])
firstKeyBt
.
get
(
x
));
}
for
(
y
=
0
;
y
<
secondLength
;
y
++)
{
tempBt
=
enc
(
tempBt
,
(
int
[])
secondKeyBt
.
get
(
y
));
}
encByte
=
tempBt
;
}
else
{
if
(
firstKey
!=
null
&&
firstKey
!=
""
)
{
int
[]
tempBt
;
int
x
;
tempBt
=
tempByte
;
for
(
x
=
0
;
x
<
firstLength
;
x
++)
{
tempBt
=
enc
(
tempBt
,
(
int
[])
firstKeyBt
.
get
(
x
));
}
encByte
=
tempBt
;
}
}
}
encData
+=
bt64ToHex
(
encByte
);
}
if
(
remainder
>
0
)
{
String
remainderData
=
data
.
substring
(
iterator
*
4
+
0
,
leng
);
int
[]
tempByte
=
strToBt
(
remainderData
);
int
[]
encByte
=
null
;
if
(
firstKey
!=
null
&&
firstKey
!=
""
&&
secondKey
!=
null
&&
secondKey
!=
""
&&
thirdKey
!=
null
&&
thirdKey
!=
""
)
{
int
[]
tempBt
;
int
x
,
y
,
z
;
tempBt
=
tempByte
;
for
(
x
=
0
;
x
<
firstLength
;
x
++)
{
tempBt
=
enc
(
tempBt
,
(
int
[])
firstKeyBt
.
get
(
x
));
}
for
(
y
=
0
;
y
<
secondLength
;
y
++)
{
tempBt
=
enc
(
tempBt
,
(
int
[])
secondKeyBt
.
get
(
y
));
}
for
(
z
=
0
;
z
<
thirdLength
;
z
++)
{
tempBt
=
enc
(
tempBt
,
(
int
[])
thirdKeyBt
.
get
(
z
));
}
encByte
=
tempBt
;
}
else
{
if
(
firstKey
!=
null
&&
firstKey
!=
""
&&
secondKey
!=
null
&&
secondKey
!=
""
)
{
int
[]
tempBt
;
int
x
,
y
;
tempBt
=
tempByte
;
for
(
x
=
0
;
x
<
firstLength
;
x
++)
{
tempBt
=
enc
(
tempBt
,
(
int
[])
firstKeyBt
.
get
(
x
));
}
for
(
y
=
0
;
y
<
secondLength
;
y
++)
{
tempBt
=
enc
(
tempBt
,
(
int
[])
secondKeyBt
.
get
(
y
));
}
encByte
=
tempBt
;
}
else
{
if
(
firstKey
!=
null
&&
firstKey
!=
""
)
{
int
[]
tempBt
;
int
x
;
tempBt
=
tempByte
;
for
(
x
=
0
;
x
<
firstLength
;
x
++)
{
tempBt
=
enc
(
tempBt
,
(
int
[])
firstKeyBt
.
get
(
x
));
}
encByte
=
tempBt
;
}
}
}
encData
+=
bt64ToHex
(
encByte
);
}
}
}
return
encData
;
}
/*
* decrypt the encrypted string to the original string
*
* return the original string
*/
public
String
strDec
(
String
data
,
String
firstKey
,
String
secondKey
,
String
thirdKey
)
{
int
leng
=
data
.
length
();
String
decStr
=
""
;
List
firstKeyBt
=
null
,
secondKeyBt
=
null
,
thirdKeyBt
=
null
;
int
firstLength
=
0
,
secondLength
=
0
,
thirdLength
=
0
;
if
(
firstKey
!=
null
&&
firstKey
!=
""
)
{
firstKeyBt
=
getKeyBytes
(
firstKey
);
firstLength
=
firstKeyBt
.
size
();
}
if
(
secondKey
!=
null
&&
secondKey
!=
""
)
{
secondKeyBt
=
getKeyBytes
(
secondKey
);
secondLength
=
secondKeyBt
.
size
();
}
if
(
thirdKey
!=
null
&&
thirdKey
!=
""
)
{
thirdKeyBt
=
getKeyBytes
(
thirdKey
);
thirdLength
=
thirdKeyBt
.
size
();
}
int
iterator
=
leng
/
16
;
int
i
=
0
;
for
(
i
=
0
;
i
<
iterator
;
i
++)
{
String
tempData
=
data
.
substring
(
i
*
16
+
0
,
i
*
16
+
16
);
String
strByte
=
hexToBt64
(
tempData
);
int
[]
intByte
=
new
int
[
64
];
int
j
=
0
;
for
(
j
=
0
;
j
<
64
;
j
++)
{
intByte
[
j
]
=
Integer
.
parseInt
(
strByte
.
substring
(
j
,
j
+
1
));
}
int
[]
decByte
=
null
;
if
(
firstKey
!=
null
&&
firstKey
!=
""
&&
secondKey
!=
null
&&
secondKey
!=
""
&&
thirdKey
!=
null
&&
thirdKey
!=
""
)
{
int
[]
tempBt
;
int
x
,
y
,
z
;
tempBt
=
intByte
;
for
(
x
=
thirdLength
-
1
;
x
>=
0
;
x
--)
{
tempBt
=
dec
(
tempBt
,
(
int
[])
thirdKeyBt
.
get
(
x
));
}
for
(
y
=
secondLength
-
1
;
y
>=
0
;
y
--)
{
tempBt
=
dec
(
tempBt
,
(
int
[])
secondKeyBt
.
get
(
y
));
}
for
(
z
=
firstLength
-
1
;
z
>=
0
;
z
--)
{
tempBt
=
dec
(
tempBt
,
(
int
[])
firstKeyBt
.
get
(
z
));
}
decByte
=
tempBt
;
}
else
{
if
(
firstKey
!=
null
&&
firstKey
!=
""
&&
secondKey
!=
null
&&
secondKey
!=
""
)
{
int
[]
tempBt
;
int
x
,
y
,
z
;
tempBt
=
intByte
;
for
(
x
=
secondLength
-
1
;
x
>=
0
;
x
--)
{
tempBt
=
dec
(
tempBt
,
(
int
[])
secondKeyBt
.
get
(
x
));
}
for
(
y
=
firstLength
-
1
;
y
>=
0
;
y
--)
{
tempBt
=
dec
(
tempBt
,
(
int
[])
firstKeyBt
.
get
(
y
));
}
decByte
=
tempBt
;
}
else
{
if
(
firstKey
!=
null
&&
firstKey
!=
""
)
{
int
[]
tempBt
;
int
x
,
y
,
z
;
tempBt
=
intByte
;
for
(
x
=
firstLength
-
1
;
x
>=
0
;
x
--)
{
tempBt
=
dec
(
tempBt
,
(
int
[])
firstKeyBt
.
get
(
x
));
}
decByte
=
tempBt
;
}
}
}
decStr
+=
byteToString
(
decByte
);
}
return
decStr
;
}
/*
* chang the string into the bit array
*
* return bit array(it's length % 64 = 0)
*/
public
List
getKeyBytes
(
String
key
)
{
List
keyBytes
=
new
ArrayList
();
int
leng
=
key
.
length
();
int
iterator
=
(
leng
/
4
);
int
remainder
=
leng
%
4
;
int
i
=
0
;
for
(
i
=
0
;
i
<
iterator
;
i
++)
{
keyBytes
.
add
(
i
,
strToBt
(
key
.
substring
(
i
*
4
+
0
,
i
*
4
+
4
)));
}
if
(
remainder
>
0
)
{
// keyBytes[i] = strToBt(key.substring(i*4+0,leng));
keyBytes
.
add
(
i
,
strToBt
(
key
.
substring
(
i
*
4
+
0
,
leng
)));
}
return
keyBytes
;
}
/*
* chang the string(it's length <= 4) into the bit array
*
* return bit array(it's length = 64)
*/
public
int
[]
strToBt
(
String
str
)
{
int
leng
=
str
.
length
();
int
[]
bt
=
new
int
[
64
];
if
(
leng
<
4
)
{
int
i
=
0
,
j
=
0
,
p
=
0
,
q
=
0
;
for
(
i
=
0
;
i
<
leng
;
i
++)
{
int
k
=
str
.
charAt
(
i
);
for
(
j
=
0
;
j
<
16
;
j
++)
{
int
pow
=
1
,
m
=
0
;
for
(
m
=
15
;
m
>
j
;
m
--)
{
pow
*=
2
;
}
// bt.set(16*i+j,""+(k/pow)%2));
bt
[
16
*
i
+
j
]
=
(
k
/
pow
)
%
2
;
}
}
for
(
p
=
leng
;
p
<
4
;
p
++)
{
int
k
=
0
;
for
(
q
=
0
;
q
<
16
;
q
++)
{
int
pow
=
1
,
m
=
0
;
for
(
m
=
15
;
m
>
q
;
m
--)
{
pow
*=
2
;
}
// bt[16*p+q]=parseInt(k/pow)%2;
// bt.add(16*p+q,""+((k/pow)%2));
bt
[
16
*
p
+
q
]
=
(
k
/
pow
)
%
2
;
}
}
}
else
{
for
(
int
i
=
0
;
i
<
4
;
i
++)
{
int
k
=
str
.
charAt
(
i
);
for
(
int
j
=
0
;
j
<
16
;
j
++)
{
int
pow
=
1
;
for
(
int
m
=
15
;
m
>
j
;
m
--)
{
pow
*=
2
;
}
// bt[16*i+j]=parseInt(k/pow)%2;
// bt.add(16*i+j,""+((k/pow)%2));
bt
[
16
*
i
+
j
]
=
(
k
/
pow
)
%
2
;
}
}
}
return
bt
;
}
/*
* chang the bit(it's length = 4) into the hex
*
* return hex
*/
public
String
bt4ToHex
(
String
binary
)
{
String
hex
=
""
;
if
(
binary
.
equalsIgnoreCase
(
"0000"
))
{
hex
=
"0"
;
}
else
if
(
binary
.
equalsIgnoreCase
(
"0001"
))
{
hex
=
"1"
;
}
else
if
(
binary
.
equalsIgnoreCase
(
"0010"
))
{
hex
=
"2"
;
}
else
if
(
binary
.
equalsIgnoreCase
(
"0011"
))
{
hex
=
"3"
;
}
else
if
(
binary
.
equalsIgnoreCase
(
"0100"
))
{
hex
=
"4"
;
}
else
if
(
binary
.
equalsIgnoreCase
(
"0101"
))
{
hex
=
"5"
;
}
else
if
(
binary
.
equalsIgnoreCase
(
"0110"
))
{
hex
=
"6"
;
}
else
if
(
binary
.
equalsIgnoreCase
(
"0111"
))
{
hex
=
"7"
;
}
else
if
(
binary
.
equalsIgnoreCase
(
"1000"
))
{
hex
=
"8"
;
}
else
if
(
binary
.
equalsIgnoreCase
(
"1001"
))
{
hex
=
"9"
;
}
else
if
(
binary
.
equalsIgnoreCase
(
"1010"
))
{
hex
=
"A"
;
}
else
if
(
binary
.
equalsIgnoreCase
(
"1011"
))
{
hex
=
"B"
;
}
else
if
(
binary
.
equalsIgnoreCase
(
"1100"
))
{
hex
=
"C"
;
}
else
if
(
binary
.
equalsIgnoreCase
(
"1101"
))
{
hex
=
"D"
;
}
else
if
(
binary
.
equalsIgnoreCase
(
"1110"
))
{
hex
=
"E"
;
}
else
if
(
binary
.
equalsIgnoreCase
(
"1111"
))
{
hex
=
"F"
;
}
return
hex
;
}
/*
* chang the hex into the bit(it's length = 4)
*
* return the bit(it's length = 4)
*/
public
String
hexToBt4
(
String
hex
)
{
String
binary
=
""
;
if
(
hex
.
equalsIgnoreCase
(
"0"
))
{
binary
=
"0000"
;
}
else
if
(
hex
.
equalsIgnoreCase
(
"1"
))
{
binary
=
"0001"
;
}
if
(
hex
.
equalsIgnoreCase
(
"2"
))
{
binary
=
"0010"
;
}
if
(
hex
.
equalsIgnoreCase
(
"3"
))
{
binary
=
"0011"
;
}
if
(
hex
.
equalsIgnoreCase
(
"4"
))
{
binary
=
"0100"
;
}
if
(
hex
.
equalsIgnoreCase
(
"5"
))
{
binary
=
"0101"
;
}
if
(
hex
.
equalsIgnoreCase
(
"6"
))
{
binary
=
"0110"
;
}
if
(
hex
.
equalsIgnoreCase
(
"7"
))
{
binary
=
"0111"
;
}
if
(
hex
.
equalsIgnoreCase
(
"8"
))
{
binary
=
"1000"
;
}
if
(
hex
.
equalsIgnoreCase
(
"9"
))
{
binary
=
"1001"
;
}
if
(
hex
.
equalsIgnoreCase
(
"A"
))
{
binary
=
"1010"
;
}
if
(
hex
.
equalsIgnoreCase
(
"B"
))
{
binary
=
"1011"
;
}
if
(
hex
.
equalsIgnoreCase
(
"C"
))
{
binary
=
"1100"
;
}
if
(
hex
.
equalsIgnoreCase
(
"D"
))
{
binary
=
"1101"
;
}
if
(
hex
.
equalsIgnoreCase
(
"E"
))
{
binary
=
"1110"
;
}
if
(
hex
.
equalsIgnoreCase
(
"F"
))
{
binary
=
"1111"
;
}
return
binary
;
}
/*
* chang the bit(it's length = 64) into the string
*
* return string
*/
public
String
byteToString
(
int
[]
byteData
)
{
String
str
=
""
;
for
(
int
i
=
0
;
i
<
4
;
i
++)
{
int
count
=
0
;
for
(
int
j
=
0
;
j
<
16
;
j
++)
{
int
pow
=
1
;
for
(
int
m
=
15
;
m
>
j
;
m
--)
{
pow
*=
2
;
}
count
+=
byteData
[
16
*
i
+
j
]
*
pow
;
}
if
(
count
!=
0
)
{
str
+=
""
+
(
char
)
(
count
);
}
}
return
str
;
}
public
String
bt64ToHex
(
int
[]
byteData
)
{
String
hex
=
""
;
for
(
int
i
=
0
;
i
<
16
;
i
++)
{
String
bt
=
""
;
for
(
int
j
=
0
;
j
<
4
;
j
++)
{
bt
+=
byteData
[
i
*
4
+
j
];
}
hex
+=
bt4ToHex
(
bt
);
}
return
hex
;
}
public
String
hexToBt64
(
String
hex
)
{
String
binary
=
""
;
for
(
int
i
=
0
;
i
<
16
;
i
++)
{
binary
+=
hexToBt4
(
hex
.
substring
(
i
,
i
+
1
));
}
return
binary
;
}
/*
* the 64 bit des core arithmetic
*/
public
int
[]
enc
(
int
[]
dataByte
,
int
[]
keyByte
)
{
int
[][]
keys
=
generateKeys
(
keyByte
);
int
[]
ipByte
=
initPermute
(
dataByte
);
int
[]
ipLeft
=
new
int
[
32
];
int
[]
ipRight
=
new
int
[
32
];
int
[]
tempLeft
=
new
int
[
32
];
int
i
=
0
,
j
=
0
,
k
=
0
,
m
=
0
,
n
=
0
;
for
(
k
=
0
;
k
<
32
;
k
++)
{
ipLeft
[
k
]
=
ipByte
[
k
];
ipRight
[
k
]
=
ipByte
[
32
+
k
];
}
for
(
i
=
0
;
i
<
16
;
i
++)
{
for
(
j
=
0
;
j
<
32
;
j
++)
{
tempLeft
[
j
]
=
ipLeft
[
j
];
ipLeft
[
j
]
=
ipRight
[
j
];
}
int
[]
key
=
new
int
[
48
];
for
(
m
=
0
;
m
<
48
;
m
++)
{
key
[
m
]
=
keys
[
i
][
m
];
}
int
[]
tempRight
=
xor
(
pPermute
(
sBoxPermute
(
xor
(
expandPermute
(
ipRight
),
key
))),
tempLeft
);
for
(
n
=
0
;
n
<
32
;
n
++)
{
ipRight
[
n
]
=
tempRight
[
n
];
}
}
int
[]
finalData
=
new
int
[
64
];
for
(
i
=
0
;
i
<
32
;
i
++)
{
finalData
[
i
]
=
ipRight
[
i
];
finalData
[
32
+
i
]
=
ipLeft
[
i
];
}
return
finallyPermute
(
finalData
);
}
public
int
[]
dec
(
int
[]
dataByte
,
int
[]
keyByte
)
{
int
[][]
keys
=
generateKeys
(
keyByte
);
int
[]
ipByte
=
initPermute
(
dataByte
);
int
[]
ipLeft
=
new
int
[
32
];
int
[]
ipRight
=
new
int
[
32
];
int
[]
tempLeft
=
new
int
[
32
];
int
i
=
0
,
j
=
0
,
k
=
0
,
m
=
0
,
n
=
0
;
for
(
k
=
0
;
k
<
32
;
k
++)
{
ipLeft
[
k
]
=
ipByte
[
k
];
ipRight
[
k
]
=
ipByte
[
32
+
k
];
}
for
(
i
=
15
;
i
>=
0
;
i
--)
{
for
(
j
=
0
;
j
<
32
;
j
++)
{
tempLeft
[
j
]
=
ipLeft
[
j
];
ipLeft
[
j
]
=
ipRight
[
j
];
}
int
[]
key
=
new
int
[
48
];
for
(
m
=
0
;
m
<
48
;
m
++)
{
key
[
m
]
=
keys
[
i
][
m
];
}
int
[]
tempRight
=
xor
(
pPermute
(
sBoxPermute
(
xor
(
expandPermute
(
ipRight
),
key
))),
tempLeft
);
for
(
n
=
0
;
n
<
32
;
n
++)
{
ipRight
[
n
]
=
tempRight
[
n
];
}
}
int
[]
finalData
=
new
int
[
64
];
for
(
i
=
0
;
i
<
32
;
i
++)
{
finalData
[
i
]
=
ipRight
[
i
];
finalData
[
32
+
i
]
=
ipLeft
[
i
];
}
return
finallyPermute
(
finalData
);
}
public
int
[]
initPermute
(
int
[]
originalData
)
{
int
[]
ipByte
=
new
int
[
64
];
int
i
=
0
,
m
=
1
,
n
=
0
,
j
,
k
;
for
(
i
=
0
,
m
=
1
,
n
=
0
;
i
<
4
;
i
++,
m
+=
2
,
n
+=
2
)
{
for
(
j
=
7
,
k
=
0
;
j
>=
0
;
j
--,
k
++)
{
ipByte
[
i
*
8
+
k
]
=
originalData
[
j
*
8
+
m
];
ipByte
[
i
*
8
+
k
+
32
]
=
originalData
[
j
*
8
+
n
];
}
}
return
ipByte
;
}
public
int
[]
expandPermute
(
int
[]
rightData
)
{
int
[]
epByte
=
new
int
[
48
];
int
i
,
j
;
for
(
i
=
0
;
i
<
8
;
i
++)
{
if
(
i
==
0
)
{
epByte
[
i
*
6
+
0
]
=
rightData
[
31
];
}
else
{
epByte
[
i
*
6
+
0
]
=
rightData
[
i
*
4
-
1
];
}
epByte
[
i
*
6
+
1
]
=
rightData
[
i
*
4
+
0
];
epByte
[
i
*
6
+
2
]
=
rightData
[
i
*
4
+
1
];
epByte
[
i
*
6
+
3
]
=
rightData
[
i
*
4
+
2
];
epByte
[
i
*
6
+
4
]
=
rightData
[
i
*
4
+
3
];
if
(
i
==
7
)
{
epByte
[
i
*
6
+
5
]
=
rightData
[
0
];
}
else
{
epByte
[
i
*
6
+
5
]
=
rightData
[
i
*
4
+
4
];
}
}
return
epByte
;
}
public
int
[]
xor
(
int
[]
byteOne
,
int
[]
byteTwo
)
{
// var xorByte = new Array(byteOne.length);
// for(int i = 0;i < byteOne.length; i ++){
// xorByte[i] = byteOne[i] ^ byteTwo[i];
// }
// return xorByte;
int
[]
xorByte
=
new
int
[
byteOne
.
length
];
for
(
int
i
=
0
;
i
<
byteOne
.
length
;
i
++)
{
xorByte
[
i
]
=
byteOne
[
i
]
^
byteTwo
[
i
];
}
return
xorByte
;
}
public
int
[]
sBoxPermute
(
int
[]
expandByte
)
{
// var sBoxByte = new Array(32);
int
[]
sBoxByte
=
new
int
[
32
];
String
binary
=
""
;
int
[][]
s1
=
{
{
14
,
4
,
13
,
1
,
2
,
15
,
11
,
8
,
3
,
10
,
6
,
12
,
5
,
9
,
0
,
7
},
{
0
,
15
,
7
,
4
,
14
,
2
,
13
,
1
,
10
,
6
,
12
,
11
,
9
,
5
,
3
,
8
},
{
4
,
1
,
14
,
8
,
13
,
6
,
2
,
11
,
15
,
12
,
9
,
7
,
3
,
10
,
5
,
0
},
{
15
,
12
,
8
,
2
,
4
,
9
,
1
,
7
,
5
,
11
,
3
,
14
,
10
,
0
,
6
,
13
}
};
/* Table - s2 */
int
[][]
s2
=
{
{
15
,
1
,
8
,
14
,
6
,
11
,
3
,
4
,
9
,
7
,
2
,
13
,
12
,
0
,
5
,
10
},
{
3
,
13
,
4
,
7
,
15
,
2
,
8
,
14
,
12
,
0
,
1
,
10
,
6
,
9
,
11
,
5
},
{
0
,
14
,
7
,
11
,
10
,
4
,
13
,
1
,
5
,
8
,
12
,
6
,
9
,
3
,
2
,
15
},
{
13
,
8
,
10
,
1
,
3
,
15
,
4
,
2
,
11
,
6
,
7
,
12
,
0
,
5
,
14
,
9
}
};
/* Table - s3 */
int
[][]
s3
=
{
{
10
,
0
,
9
,
14
,
6
,
3
,
15
,
5
,
1
,
13
,
12
,
7
,
11
,
4
,
2
,
8
},
{
13
,
7
,
0
,
9
,
3
,
4
,
6
,
10
,
2
,
8
,
5
,
14
,
12
,
11
,
15
,
1
},
{
13
,
6
,
4
,
9
,
8
,
15
,
3
,
0
,
11
,
1
,
2
,
12
,
5
,
10
,
14
,
7
},
{
1
,
10
,
13
,
0
,
6
,
9
,
8
,
7
,
4
,
15
,
14
,
3
,
11
,
5
,
2
,
12
}
};
/* Table - s4 */
int
[][]
s4
=
{
{
7
,
13
,
14
,
3
,
0
,
6
,
9
,
10
,
1
,
2
,
8
,
5
,
11
,
12
,
4
,
15
},
{
13
,
8
,
11
,
5
,
6
,
15
,
0
,
3
,
4
,
7
,
2
,
12
,
1
,
10
,
14
,
9
},
{
10
,
6
,
9
,
0
,
12
,
11
,
7
,
13
,
15
,
1
,
3
,
14
,
5
,
2
,
8
,
4
},
{
3
,
15
,
0
,
6
,
10
,
1
,
13
,
8
,
9
,
4
,
5
,
11
,
12
,
7
,
2
,
14
}
};
/* Table - s5 */
int
[][]
s5
=
{
{
2
,
12
,
4
,
1
,
7
,
10
,
11
,
6
,
8
,
5
,
3
,
15
,
13
,
0
,
14
,
9
},
{
14
,
11
,
2
,
12
,
4
,
7
,
13
,
1
,
5
,
0
,
15
,
10
,
3
,
9
,
8
,
6
},
{
4
,
2
,
1
,
11
,
10
,
13
,
7
,
8
,
15
,
9
,
12
,
5
,
6
,
3
,
0
,
14
},
{
11
,
8
,
12
,
7
,
1
,
14
,
2
,
13
,
6
,
15
,
0
,
9
,
10
,
4
,
5
,
3
}
};
/* Table - s6 */
int
[][]
s6
=
{
{
12
,
1
,
10
,
15
,
9
,
2
,
6
,
8
,
0
,
13
,
3
,
4
,
14
,
7
,
5
,
11
},
{
10
,
15
,
4
,
2
,
7
,
12
,
9
,
5
,
6
,
1
,
13
,
14
,
0
,
11
,
3
,
8
},
{
9
,
14
,
15
,
5
,
2
,
8
,
12
,
3
,
7
,
0
,
4
,
10
,
1
,
13
,
11
,
6
},
{
4
,
3
,
2
,
12
,
9
,
5
,
15
,
10
,
11
,
14
,
1
,
7
,
6
,
0
,
8
,
13
}
};
/* Table - s7 */
int
[][]
s7
=
{
{
4
,
11
,
2
,
14
,
15
,
0
,
8
,
13
,
3
,
12
,
9
,
7
,
5
,
10
,
6
,
1
},
{
13
,
0
,
11
,
7
,
4
,
9
,
1
,
10
,
14
,
3
,
5
,
12
,
2
,
15
,
8
,
6
},
{
1
,
4
,
11
,
13
,
12
,
3
,
7
,
14
,
10
,
15
,
6
,
8
,
0
,
5
,
9
,
2
},
{
6
,
11
,
13
,
8
,
1
,
4
,
10
,
7
,
9
,
5
,
0
,
15
,
14
,
2
,
3
,
12
}
};
/* Table - s8 */
int
[][]
s8
=
{
{
13
,
2
,
8
,
4
,
6
,
15
,
11
,
1
,
10
,
9
,
3
,
14
,
5
,
0
,
12
,
7
},
{
1
,
15
,
13
,
8
,
10
,
3
,
7
,
4
,
12
,
5
,
6
,
11
,
0
,
14
,
9
,
2
},
{
7
,
11
,
4
,
1
,
9
,
12
,
14
,
2
,
0
,
6
,
10
,
13
,
15
,
3
,
5
,
8
},
{
2
,
1
,
14
,
7
,
4
,
10
,
8
,
13
,
15
,
12
,
9
,
0
,
3
,
5
,
6
,
11
}
};
for
(
int
m
=
0
;
m
<
8
;
m
++)
{
int
i
=
0
,
j
=
0
;
i
=
expandByte
[
m
*
6
+
0
]
*
2
+
expandByte
[
m
*
6
+
5
];
j
=
expandByte
[
m
*
6
+
1
]
*
2
*
2
*
2
+
expandByte
[
m
*
6
+
2
]
*
2
*
2
+
expandByte
[
m
*
6
+
3
]
*
2
+
expandByte
[
m
*
6
+
4
];
switch
(
m
)
{
case
0
:
binary
=
getBoxBinary
(
s1
[
i
][
j
]);
break
;
case
1
:
binary
=
getBoxBinary
(
s2
[
i
][
j
]);
break
;
case
2
:
binary
=
getBoxBinary
(
s3
[
i
][
j
]);
break
;
case
3
:
binary
=
getBoxBinary
(
s4
[
i
][
j
]);
break
;
case
4
:
binary
=
getBoxBinary
(
s5
[
i
][
j
]);
break
;
case
5
:
binary
=
getBoxBinary
(
s6
[
i
][
j
]);
break
;
case
6
:
binary
=
getBoxBinary
(
s7
[
i
][
j
]);
break
;
case
7
:
binary
=
getBoxBinary
(
s8
[
i
][
j
]);
break
;
}
sBoxByte
[
m
*
4
+
0
]
=
Integer
.
parseInt
(
binary
.
substring
(
0
,
1
));
sBoxByte
[
m
*
4
+
1
]
=
Integer
.
parseInt
(
binary
.
substring
(
1
,
2
));
sBoxByte
[
m
*
4
+
2
]
=
Integer
.
parseInt
(
binary
.
substring
(
2
,
3
));
sBoxByte
[
m
*
4
+
3
]
=
Integer
.
parseInt
(
binary
.
substring
(
3
,
4
));
}
return
sBoxByte
;
}
public
int
[]
pPermute
(
int
[]
sBoxByte
)
{
int
[]
pBoxPermute
=
new
int
[
32
];
pBoxPermute
[
0
]
=
sBoxByte
[
15
];
pBoxPermute
[
1
]
=
sBoxByte
[
6
];
pBoxPermute
[
2
]
=
sBoxByte
[
19
];
pBoxPermute
[
3
]
=
sBoxByte
[
20
];
pBoxPermute
[
4
]
=
sBoxByte
[
28
];
pBoxPermute
[
5
]
=
sBoxByte
[
11
];
pBoxPermute
[
6
]
=
sBoxByte
[
27
];
pBoxPermute
[
7
]
=
sBoxByte
[
16
];
pBoxPermute
[
8
]
=
sBoxByte
[
0
];
pBoxPermute
[
9
]
=
sBoxByte
[
14
];
pBoxPermute
[
10
]
=
sBoxByte
[
22
];
pBoxPermute
[
11
]
=
sBoxByte
[
25
];
pBoxPermute
[
12
]
=
sBoxByte
[
4
];
pBoxPermute
[
13
]
=
sBoxByte
[
17
];
pBoxPermute
[
14
]
=
sBoxByte
[
30
];
pBoxPermute
[
15
]
=
sBoxByte
[
9
];
pBoxPermute
[
16
]
=
sBoxByte
[
1
];
pBoxPermute
[
17
]
=
sBoxByte
[
7
];
pBoxPermute
[
18
]
=
sBoxByte
[
23
];
pBoxPermute
[
19
]
=
sBoxByte
[
13
];
pBoxPermute
[
20
]
=
sBoxByte
[
31
];
pBoxPermute
[
21
]
=
sBoxByte
[
26
];
pBoxPermute
[
22
]
=
sBoxByte
[
2
];
pBoxPermute
[
23
]
=
sBoxByte
[
8
];
pBoxPermute
[
24
]
=
sBoxByte
[
18
];
pBoxPermute
[
25
]
=
sBoxByte
[
12
];
pBoxPermute
[
26
]
=
sBoxByte
[
29
];
pBoxPermute
[
27
]
=
sBoxByte
[
5
];
pBoxPermute
[
28
]
=
sBoxByte
[
21
];
pBoxPermute
[
29
]
=
sBoxByte
[
10
];
pBoxPermute
[
30
]
=
sBoxByte
[
3
];
pBoxPermute
[
31
]
=
sBoxByte
[
24
];
return
pBoxPermute
;
}
public
int
[]
finallyPermute
(
int
[]
endByte
)
{
int
[]
fpByte
=
new
int
[
64
];
fpByte
[
0
]
=
endByte
[
39
];
fpByte
[
1
]
=
endByte
[
7
];
fpByte
[
2
]
=
endByte
[
47
];
fpByte
[
3
]
=
endByte
[
15
];
fpByte
[
4
]
=
endByte
[
55
];
fpByte
[
5
]
=
endByte
[
23
];
fpByte
[
6
]
=
endByte
[
63
];
fpByte
[
7
]
=
endByte
[
31
];
fpByte
[
8
]
=
endByte
[
38
];
fpByte
[
9
]
=
endByte
[
6
];
fpByte
[
10
]
=
endByte
[
46
];
fpByte
[
11
]
=
endByte
[
14
];
fpByte
[
12
]
=
endByte
[
54
];
fpByte
[
13
]
=
endByte
[
22
];
fpByte
[
14
]
=
endByte
[
62
];
fpByte
[
15
]
=
endByte
[
30
];
fpByte
[
16
]
=
endByte
[
37
];
fpByte
[
17
]
=
endByte
[
5
];
fpByte
[
18
]
=
endByte
[
45
];
fpByte
[
19
]
=
endByte
[
13
];
fpByte
[
20
]
=
endByte
[
53
];
fpByte
[
21
]
=
endByte
[
21
];
fpByte
[
22
]
=
endByte
[
61
];
fpByte
[
23
]
=
endByte
[
29
];
fpByte
[
24
]
=
endByte
[
36
];
fpByte
[
25
]
=
endByte
[
4
];
fpByte
[
26
]
=
endByte
[
44
];
fpByte
[
27
]
=
endByte
[
12
];
fpByte
[
28
]
=
endByte
[
52
];
fpByte
[
29
]
=
endByte
[
20
];
fpByte
[
30
]
=
endByte
[
60
];
fpByte
[
31
]
=
endByte
[
28
];
fpByte
[
32
]
=
endByte
[
35
];
fpByte
[
33
]
=
endByte
[
3
];
fpByte
[
34
]
=
endByte
[
43
];
fpByte
[
35
]
=
endByte
[
11
];
fpByte
[
36
]
=
endByte
[
51
];
fpByte
[
37
]
=
endByte
[
19
];
fpByte
[
38
]
=
endByte
[
59
];
fpByte
[
39
]
=
endByte
[
27
];
fpByte
[
40
]
=
endByte
[
34
];
fpByte
[
41
]
=
endByte
[
2
];
fpByte
[
42
]
=
endByte
[
42
];
fpByte
[
43
]
=
endByte
[
10
];
fpByte
[
44
]
=
endByte
[
50
];
fpByte
[
45
]
=
endByte
[
18
];
fpByte
[
46
]
=
endByte
[
58
];
fpByte
[
47
]
=
endByte
[
26
];
fpByte
[
48
]
=
endByte
[
33
];
fpByte
[
49
]
=
endByte
[
1
];
fpByte
[
50
]
=
endByte
[
41
];
fpByte
[
51
]
=
endByte
[
9
];
fpByte
[
52
]
=
endByte
[
49
];
fpByte
[
53
]
=
endByte
[
17
];
fpByte
[
54
]
=
endByte
[
57
];
fpByte
[
55
]
=
endByte
[
25
];
fpByte
[
56
]
=
endByte
[
32
];
fpByte
[
57
]
=
endByte
[
0
];
fpByte
[
58
]
=
endByte
[
40
];
fpByte
[
59
]
=
endByte
[
8
];
fpByte
[
60
]
=
endByte
[
48
];
fpByte
[
61
]
=
endByte
[
16
];
fpByte
[
62
]
=
endByte
[
56
];
fpByte
[
63
]
=
endByte
[
24
];
return
fpByte
;
}
public
String
getBoxBinary
(
int
i
)
{
String
binary
=
""
;
switch
(
i
)
{
case
0
:
binary
=
"0000"
;
break
;
case
1
:
binary
=
"0001"
;
break
;
case
2
:
binary
=
"0010"
;
break
;
case
3
:
binary
=
"0011"
;
break
;
case
4
:
binary
=
"0100"
;
break
;
case
5
:
binary
=
"0101"
;
break
;
case
6
:
binary
=
"0110"
;
break
;
case
7
:
binary
=
"0111"
;
break
;
case
8
:
binary
=
"1000"
;
break
;
case
9
:
binary
=
"1001"
;
break
;
case
10
:
binary
=
"1010"
;
break
;
case
11
:
binary
=
"1011"
;
break
;
case
12
:
binary
=
"1100"
;
break
;
case
13
:
binary
=
"1101"
;
break
;
case
14
:
binary
=
"1110"
;
break
;
case
15
:
binary
=
"1111"
;
break
;
}
return
binary
;
}
/*
* generate 16 keys for xor
*/
public
int
[][]
generateKeys
(
int
[]
keyByte
)
{
int
[]
key
=
new
int
[
56
];
int
[][]
keys
=
new
int
[
16
][
48
];
// keys[ 0] = new Array();
// keys[ 1] = new Array();
// keys[ 2] = new Array();
// keys[ 3] = new Array();
// keys[ 4] = new Array();
// keys[ 5] = new Array();
// keys[ 6] = new Array();
// keys[ 7] = new Array();
// keys[ 8] = new Array();
// keys[ 9] = new Array();
// keys[10] = new Array();
// keys[11] = new Array();
// keys[12] = new Array();
// keys[13] = new Array();
// keys[14] = new Array();
// keys[15] = new Array();
int
[]
loop
=
new
int
[]
{
1
,
1
,
2
,
2
,
2
,
2
,
2
,
2
,
1
,
2
,
2
,
2
,
2
,
2
,
2
,
1
};
for
(
int
i
=
0
;
i
<
7
;
i
++)
{
for
(
int
j
=
0
,
k
=
7
;
j
<
8
;
j
++,
k
--)
{
key
[
i
*
8
+
j
]
=
keyByte
[
8
*
k
+
i
];
}
}
int
i
=
0
;
for
(
i
=
0
;
i
<
16
;
i
++)
{
int
tempLeft
=
0
;
int
tempRight
=
0
;
for
(
int
j
=
0
;
j
<
loop
[
i
];
j
++)
{
tempLeft
=
key
[
0
];
tempRight
=
key
[
28
];
for
(
int
k
=
0
;
k
<
27
;
k
++)
{
key
[
k
]
=
key
[
k
+
1
];
key
[
28
+
k
]
=
key
[
29
+
k
];
}
key
[
27
]
=
tempLeft
;
key
[
55
]
=
tempRight
;
}
// var tempKey = new Array(48);
int
[]
tempKey
=
new
int
[
48
];
tempKey
[
0
]
=
key
[
13
];
tempKey
[
1
]
=
key
[
16
];
tempKey
[
2
]
=
key
[
10
];
tempKey
[
3
]
=
key
[
23
];
tempKey
[
4
]
=
key
[
0
];
tempKey
[
5
]
=
key
[
4
];
tempKey
[
6
]
=
key
[
2
];
tempKey
[
7
]
=
key
[
27
];
tempKey
[
8
]
=
key
[
14
];
tempKey
[
9
]
=
key
[
5
];
tempKey
[
10
]
=
key
[
20
];
tempKey
[
11
]
=
key
[
9
];
tempKey
[
12
]
=
key
[
22
];
tempKey
[
13
]
=
key
[
18
];
tempKey
[
14
]
=
key
[
11
];
tempKey
[
15
]
=
key
[
3
];
tempKey
[
16
]
=
key
[
25
];
tempKey
[
17
]
=
key
[
7
];
tempKey
[
18
]
=
key
[
15
];
tempKey
[
19
]
=
key
[
6
];
tempKey
[
20
]
=
key
[
26
];
tempKey
[
21
]
=
key
[
19
];
tempKey
[
22
]
=
key
[
12
];
tempKey
[
23
]
=
key
[
1
];
tempKey
[
24
]
=
key
[
40
];
tempKey
[
25
]
=
key
[
51
];
tempKey
[
26
]
=
key
[
30
];
tempKey
[
27
]
=
key
[
36
];
tempKey
[
28
]
=
key
[
46
];
tempKey
[
29
]
=
key
[
54
];
tempKey
[
30
]
=
key
[
29
];
tempKey
[
31
]
=
key
[
39
];
tempKey
[
32
]
=
key
[
50
];
tempKey
[
33
]
=
key
[
44
];
tempKey
[
34
]
=
key
[
32
];
tempKey
[
35
]
=
key
[
47
];
tempKey
[
36
]
=
key
[
43
];
tempKey
[
37
]
=
key
[
48
];
tempKey
[
38
]
=
key
[
38
];
tempKey
[
39
]
=
key
[
55
];
tempKey
[
40
]
=
key
[
33
];
tempKey
[
41
]
=
key
[
52
];
tempKey
[
42
]
=
key
[
45
];
tempKey
[
43
]
=
key
[
41
];
tempKey
[
44
]
=
key
[
49
];
tempKey
[
45
]
=
key
[
35
];
tempKey
[
46
]
=
key
[
28
];
tempKey
[
47
]
=
key
[
31
];
int
m
;
switch
(
i
)
{
case
0
:
for
(
m
=
0
;
m
<
48
;
m
++)
{
keys
[
0
][
m
]
=
tempKey
[
m
];
}
break
;
case
1
:
for
(
m
=
0
;
m
<
48
;
m
++)
{
keys
[
1
][
m
]
=
tempKey
[
m
];
}
break
;
case
2
:
for
(
m
=
0
;
m
<
48
;
m
++)
{
keys
[
2
][
m
]
=
tempKey
[
m
];
}
break
;
case
3
:
for
(
m
=
0
;
m
<
48
;
m
++)
{
keys
[
3
][
m
]
=
tempKey
[
m
];
}
break
;
case
4
:
for
(
m
=
0
;
m
<
48
;
m
++)
{
keys
[
4
][
m
]
=
tempKey
[
m
];
}
break
;
case
5
:
for
(
m
=
0
;
m
<
48
;
m
++)
{
keys
[
5
][
m
]
=
tempKey
[
m
];
}
break
;
case
6
:
for
(
m
=
0
;
m
<
48
;
m
++)
{
keys
[
6
][
m
]
=
tempKey
[
m
];
}
break
;
case
7
:
for
(
m
=
0
;
m
<
48
;
m
++)
{
keys
[
7
][
m
]
=
tempKey
[
m
];
}
break
;
case
8
:
for
(
m
=
0
;
m
<
48
;
m
++)
{
keys
[
8
][
m
]
=
tempKey
[
m
];
}
break
;
case
9
:
for
(
m
=
0
;
m
<
48
;
m
++)
{
keys
[
9
][
m
]
=
tempKey
[
m
];
}
break
;
case
10
:
for
(
m
=
0
;
m
<
48
;
m
++)
{
keys
[
10
][
m
]
=
tempKey
[
m
];
}
break
;
case
11
:
for
(
m
=
0
;
m
<
48
;
m
++)
{
keys
[
11
][
m
]
=
tempKey
[
m
];
}
break
;
case
12
:
for
(
m
=
0
;
m
<
48
;
m
++)
{
keys
[
12
][
m
]
=
tempKey
[
m
];
}
break
;
case
13
:
for
(
m
=
0
;
m
<
48
;
m
++)
{
keys
[
13
][
m
]
=
tempKey
[
m
];
}
break
;
case
14
:
for
(
m
=
0
;
m
<
48
;
m
++)
{
keys
[
14
][
m
]
=
tempKey
[
m
];
}
break
;
case
15
:
for
(
m
=
0
;
m
<
48
;
m
++)
{
keys
[
15
][
m
]
=
tempKey
[
m
];
}
break
;
}
}
return
keys
;
}
}
}
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/utils/RedisUtil.java
0 → 100644
View file @
e12280b4
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
utils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.CollectionUtils
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.concurrent.TimeUnit
;
/**
* @program: redis工具类
* @description:
* @author: duanwei
* @create: 2019-04-12 14:16
**/
@Component
public
class
RedisUtil
{
@Autowired
private
RedisTemplate
<
String
,
Object
>
redisTemplate
;
/**
* 指定缓存失效时间
*
* @param key 键
* @param time 时间(秒)
* @return
*/
public
boolean
expire
(
String
key
,
long
time
)
{
try
{
if
(
time
>
0
)
{
redisTemplate
.
expire
(
key
,
time
,
TimeUnit
.
SECONDS
);
}
return
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
}
}
/**
* 根据key 获取过期时间
*
* @param key 键 不能为null
* @return 时间(秒) 返回0代表为永久有效
*/
public
long
getExpire
(
String
key
)
{
return
redisTemplate
.
getExpire
(
key
,
TimeUnit
.
SECONDS
);
}
/**
* 判断key是否存在
*
* @param key 键
* @return true 存在 false不存在
*/
public
boolean
hasKey
(
String
key
)
{
try
{
return
redisTemplate
.
hasKey
(
key
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
}
}
/**
* 删除缓存
*
* @param key 可以传一个值 或多个
*/
@SuppressWarnings
(
"unchecked"
)
public
void
del
(
String
...
key
)
{
if
(
key
!=
null
&&
key
.
length
>
0
)
{
if
(
key
.
length
==
1
)
{
redisTemplate
.
delete
(
key
[
0
]);
}
else
{
redisTemplate
.
delete
(
CollectionUtils
.
arrayToList
(
key
));
}
}
}
//============================String=============================
/**
* 普通缓存获取
*
* @param key 键
* @return 值
*/
public
Object
get
(
String
key
)
{
return
key
==
null
?
null
:
redisTemplate
.
opsForValue
().
get
(
key
);
}
/**
* 普通缓存放入
*
* @param key 键
* @param value 值
* @return true成功 false失败
*/
public
boolean
set
(
String
key
,
Object
value
)
{
try
{
redisTemplate
.
opsForValue
().
set
(
key
,
value
);
return
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
}
}
/**
* 普通缓存放入并设置时间
*
* @param key 键
* @param value 值
* @param time 时间(秒) time要大于0 如果time小于等于0 将设置无限期
* @return true成功 false 失败
*/
public
boolean
set
(
String
key
,
Object
value
,
long
time
)
{
try
{
if
(
time
>
0
)
{
redisTemplate
.
opsForValue
().
set
(
key
,
value
,
time
,
TimeUnit
.
SECONDS
);
}
else
{
set
(
key
,
value
);
}
return
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
}
}
/**
* 递增
*
* @param key 键
* @param delta 要增加几(大于0)
* @return
*/
public
long
incr
(
String
key
,
long
delta
)
{
if
(
delta
<
0
)
{
throw
new
RuntimeException
(
"递增因子必须大于0"
);
}
return
redisTemplate
.
opsForValue
().
increment
(
key
,
delta
);
}
/**
* 递减
*
* @param key 键
* @param delta 要减少几(小于0)
* @return
*/
public
long
decr
(
String
key
,
long
delta
)
{
if
(
delta
<
0
)
{
throw
new
RuntimeException
(
"递减因子必须大于0"
);
}
return
redisTemplate
.
opsForValue
().
increment
(
key
,
-
delta
);
}
//================================Map=================================
/**
* HashGet
*
* @param key 键 不能为null
* @param item 项 不能为null
* @return 值
*/
public
Object
hget
(
String
key
,
String
item
)
{
return
redisTemplate
.
opsForHash
().
get
(
key
,
item
);
}
/**
* 获取hashKey对应的所有键值
*
* @param key 键
* @return 对应的多个键值
*/
public
Map
<
Object
,
Object
>
hmget
(
String
key
)
{
return
redisTemplate
.
opsForHash
().
entries
(
key
);
}
/**
* HashSet
*
* @param key 键
* @param map 对应多个键值
* @return true 成功 false 失败
*/
public
boolean
hmset
(
String
key
,
Map
<
String
,
Object
>
map
)
{
try
{
redisTemplate
.
opsForHash
().
putAll
(
key
,
map
);
return
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
}
}
/**
* HashSet 并设置时间
*
* @param key 键
* @param map 对应多个键值
* @param time 时间(秒)
* @return true成功 false失败
*/
public
boolean
hmset
(
String
key
,
Map
<
String
,
Object
>
map
,
long
time
)
{
try
{
redisTemplate
.
opsForHash
().
putAll
(
key
,
map
);
if
(
time
>
0
)
{
expire
(
key
,
time
);
}
return
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
}
}
/**
* 向一张hash表中放入数据,如果不存在将创建
*
* @param key 键
* @param item 项
* @param value 值
* @return true 成功 false失败
*/
public
boolean
hset
(
String
key
,
String
item
,
Object
value
)
{
try
{
redisTemplate
.
opsForHash
().
put
(
key
,
item
,
value
);
return
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
}
}
/**
* 向一张hash表中放入数据,如果不存在将创建
*
* @param key 键
* @param item 项
* @param value 值
* @param time 时间(秒) 注意:如果已存在的hash表有时间,这里将会替换原有的时间
* @return true 成功 false失败
*/
public
boolean
hset
(
String
key
,
String
item
,
Object
value
,
long
time
)
{
try
{
redisTemplate
.
opsForHash
().
put
(
key
,
item
,
value
);
if
(
time
>
0
)
{
expire
(
key
,
time
);
}
return
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
}
}
/**
* 删除hash表中的值
*
* @param key 键 不能为null
* @param item 项 可以使多个 不能为null
*/
public
void
hdel
(
String
key
,
Object
...
item
)
{
redisTemplate
.
opsForHash
().
delete
(
key
,
item
);
}
/**
* 判断hash表中是否有该项的值
*
* @param key 键 不能为null
* @param item 项 不能为null
* @return true 存在 false不存在
*/
public
boolean
hHasKey
(
String
key
,
String
item
)
{
return
redisTemplate
.
opsForHash
().
hasKey
(
key
,
item
);
}
/**
* hash递增 如果不存在,就会创建一个 并把新增后的值返回
*
* @param key 键
* @param item 项
* @param by 要增加几(大于0)
* @return
*/
public
double
hincr
(
String
key
,
String
item
,
double
by
)
{
return
redisTemplate
.
opsForHash
().
increment
(
key
,
item
,
by
);
}
/**
* hash递减
*
* @param key 键
* @param item 项
* @param by 要减少记(小于0)
* @return
*/
public
double
hdecr
(
String
key
,
String
item
,
double
by
)
{
return
redisTemplate
.
opsForHash
().
increment
(
key
,
item
,
-
by
);
}
//============================set=============================
/**
* 根据key获取Set中的所有值
*
* @param key 键
* @return
*/
public
Set
<
Object
>
sGet
(
String
key
)
{
try
{
return
redisTemplate
.
opsForSet
().
members
(
key
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
null
;
}
}
/**
* 根据value从一个set中查询,是否存在
*
* @param key 键
* @param value 值
* @return true 存在 false不存在
*/
public
boolean
sHasKey
(
String
key
,
Object
value
)
{
try
{
return
redisTemplate
.
opsForSet
().
isMember
(
key
,
value
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
}
}
/**
* 将数据放入set缓存
*
* @param key 键
* @param values 值 可以是多个
* @return 成功个数
*/
public
long
sSet
(
String
key
,
Object
...
values
)
{
try
{
return
redisTemplate
.
opsForSet
().
add
(
key
,
values
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
0
;
}
}
/**
* 将set数据放入缓存
*
* @param key 键
* @param time 时间(秒)
* @param values 值 可以是多个
* @return 成功个数
*/
public
long
sSetAndTime
(
String
key
,
long
time
,
Object
...
values
)
{
try
{
Long
count
=
redisTemplate
.
opsForSet
().
add
(
key
,
values
);
if
(
time
>
0
)
{
expire
(
key
,
time
);
}
return
count
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
0
;
}
}
/**
* 获取set缓存的长度
*
* @param key 键
* @return
*/
public
long
sGetSetSize
(
String
key
)
{
try
{
return
redisTemplate
.
opsForSet
().
size
(
key
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
0
;
}
}
/**
* 移除值为value的
*
* @param key 键
* @param values 值 可以是多个
* @return 移除的个数
*/
public
long
setRemove
(
String
key
,
Object
...
values
)
{
try
{
Long
count
=
redisTemplate
.
opsForSet
().
remove
(
key
,
values
);
return
count
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
0
;
}
}
//===============================list=================================
/**
* 获取list缓存的内容
*
* @param key 键
* @param start 开始
* @param end 结束 0 到 -1代表所有值
* @return
*/
public
List
<
Object
>
lGet
(
String
key
,
long
start
,
long
end
)
{
try
{
return
redisTemplate
.
opsForList
().
range
(
key
,
start
,
end
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
null
;
}
}
/**
* 获取list缓存的长度
*
* @param key 键
* @return
*/
public
long
lGetListSize
(
String
key
)
{
try
{
return
redisTemplate
.
opsForList
().
size
(
key
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
0
;
}
}
/**
* 通过索引 获取list中的值
*
* @param key 键
* @param index 索引 index>=0时, 0 表头,1 第二个元素,依次类推;index<0时,-1,表尾,-2倒数第二个元素,依次类推
* @return
*/
public
Object
lGetIndex
(
String
key
,
long
index
)
{
try
{
return
redisTemplate
.
opsForList
().
index
(
key
,
index
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
null
;
}
}
/**
* 将list放入缓存
*
* @param key 键
* @param value 值
* @return
*/
public
boolean
lSet
(
String
key
,
Object
value
)
{
try
{
redisTemplate
.
opsForList
().
rightPush
(
key
,
value
);
return
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
}
}
/**
* 将list放入缓存
*
* @param key 键
* @param value 值
* @param time 时间(秒)
* @return
*/
public
boolean
lSet
(
String
key
,
Object
value
,
long
time
)
{
try
{
redisTemplate
.
opsForList
().
rightPush
(
key
,
value
);
if
(
time
>
0
)
{
expire
(
key
,
time
);
}
return
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
}
}
/**
* 将list放入缓存
*
* @param key 键
* @param value 值
* @return
*/
public
boolean
lSet
(
String
key
,
List
<
Object
>
value
)
{
try
{
redisTemplate
.
opsForList
().
rightPushAll
(
key
,
value
);
return
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
}
}
/**
* 将list放入缓存
*
* @param key 键
* @param value 值
* @param time 时间(秒)
* @return
*/
public
boolean
lSet
(
String
key
,
List
<
Object
>
value
,
long
time
)
{
try
{
redisTemplate
.
opsForList
().
rightPushAll
(
key
,
value
);
if
(
time
>
0
)
{
expire
(
key
,
time
);
}
return
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
}
}
/**
* 根据索引修改list中的某条数据
*
* @param key 键
* @param index 索引
* @param value 值
* @return
*/
public
boolean
lUpdateIndex
(
String
key
,
long
index
,
Object
value
)
{
try
{
redisTemplate
.
opsForList
().
set
(
key
,
index
,
value
);
return
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
}
}
/**
* 移除N个值为value
*
* @param key 键
* @param count 移除多少个
* @param value 值
* @return 移除的个数
*/
public
long
lRemove
(
String
key
,
long
count
,
Object
value
)
{
try
{
Long
remove
=
redisTemplate
.
opsForList
().
remove
(
key
,
count
,
value
);
return
remove
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
0
;
}
}
}
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/controller/CarCylController.java
0 → 100644
View file @
e12280b4
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
flc
.
biz
.
controller
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.PageParam
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.TzCarcylRegDto
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.TzCarcylTraceDto
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.service.ITzCarcylService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
@RestController
@Api
(
tags
=
"车用气瓶Api"
)
@RequestMapping
(
value
=
"/carcyl"
)
public
class
CarCylController
{
@Autowired
private
ITzCarcylService
iTzCarcylService
;
/**
* 列表分页查询
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/userInfo/list"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"get"
,
value
=
"列表分页查询"
,
notes
=
"列表分页查询"
)
public
ResponseModel
<
IPage
<
TzCarcylRegDto
>>
getUserInfo
(
PageParam
pageParam
,
TzCarcylRegDto
tzCarcylRegDto
,
String
key
){
return
ResponseHelper
.
buildResponse
(
iTzCarcylService
.
page
(
pageParam
,
tzCarcylRegDto
,
key
));
}
/**
* 追溯详情查询
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/traceInfo/{sequenceNbr}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"get"
,
value
=
"列表分页查询"
,
notes
=
"列表分页查询"
)
public
ResponseModel
<
TzCarcylTraceDto
>
getTraceInfo
(
@PathVariable
(
value
=
"sequenceNbr"
)
String
sequenceNbr
){
return
ResponseHelper
.
buildResponse
(
iTzCarcylService
.
getTrace
(
sequenceNbr
));
}
}
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/service/impl/TzCarcylServiceImpl.java
0 → 100644
View file @
e12280b4
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
flc
.
biz
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.PageParam
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.TzCarcylFillInfoDto
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.TzCarcylInspectDto
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.TzCarcylRegDto
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.TzCarcylTraceDto
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.entity.TzCarcylReg
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.mapper.TzCarcylMapper
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.service.ITzCarcylService
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
java.util.List
;
/**
* 车用气瓶使用登记信息(列表) 服务实现类
*
* @author duanwei
* @date 2022-08-08
*/
@Service
public
class
TzCarcylServiceImpl
extends
BaseService
<
TzCarcylRegDto
,
TzCarcylReg
,
TzCarcylMapper
>
implements
ITzCarcylService
{
@Autowired
private
TzCarcylMapper
tzCarcylMapper
;
@Override
public
IPage
<
TzCarcylRegDto
>
page
(
PageParam
pageParam
,
TzCarcylRegDto
idxBizCarcylUserCompany
,
String
key
)
{
Page
<
TzCarcylRegDto
>
page
=
new
Page
<>(
pageParam
.
getCurrent
(),
pageParam
.
getSize
());
if
(
ValidationUtil
.
isEmpty
(
key
)){
System
.
out
.
println
(
"key没值"
);
Long
sequenceNbr
=
Privilege
.
agencyUserClient
.
getme
().
getResult
().
getOrgRoleSeqs
().
keySet
().
iterator
().
next
();
String
companyCode
=
Privilege
.
companyClient
.
seleteOne
(
sequenceNbr
).
getResult
().
getCompanyCode
();
return
tzCarcylMapper
.
pageByCompanyCode
(
page
,
idxBizCarcylUserCompany
,
companyCode
);
}
else
{
System
.
out
.
println
(
"key有值:"
+
key
);
String
superviseOrgCode
=
Privilege
.
companyClient
.
seleteOne
(
Long
.
valueOf
(
key
)).
getResult
().
getOrgCode
();
return
tzCarcylMapper
.
pageByOrgCode
(
page
,
idxBizCarcylUserCompany
,
superviseOrgCode
);
}
}
@Override
public
TzCarcylTraceDto
getTrace
(
String
sequenceNbr
)
{
TzCarcylRegDto
tzCarcylRegDto
=
tzCarcylMapper
.
getUserInfoger
(
sequenceNbr
);
String
useCode
=
tzCarcylMapper
.
getUseNum
(
sequenceNbr
);
List
<
TzCarcylFillInfoDto
>
tzCarcylFillInfoDtoList
=
tzCarcylMapper
.
getFillingInfo
(
useCode
);
List
<
TzCarcylInspectDto
>
tzCarcylInspectDtoList
=
tzCarcylMapper
.
getCheckingInfo
(
useCode
);
TzCarcylTraceDto
tzCarcylTraceDto
=
new
TzCarcylTraceDto
(
tzCarcylRegDto
,
tzCarcylInspectDtoList
,
tzCarcylFillInfoDtoList
);
return
tzCarcylTraceDto
;
}
}
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