Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cms
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
cms
Commits
8c11323a
提交
8c11323a
authored
7月 29, 2023
作者:
张小凤
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
CooperationController(add)
上级
1f681b3a
隐藏空白字符变更
内嵌
并排
正在显示
27 个修改的文件
包含
1394 行增加
和
12 行删除
+1394
-12
pom.xml
cms-common/cms-common-model/pom.xml
+7
-2
LicenseType.java
...a/com/mmc/iuav/user/model/dto/dronepilot/LicenseType.java
+81
-0
PilotAbilityDTO.java
...m/mmc/iuav/user/model/dto/dronepilot/PilotAbilityDTO.java
+32
-0
PilotCertificationDTO.java
...iuav/user/model/dto/dronepilot/PilotCertificationDTO.java
+97
-0
BaseEnum.java
.../java/com/mmc/iuav/user/model/vo/dronepilot/BaseEnum.java
+14
-0
EnumUtils.java
...java/com/mmc/iuav/user/model/vo/dronepilot/EnumUtils.java
+60
-0
EnumValue.java
...java/com/mmc/iuav/user/model/vo/dronepilot/EnumValue.java
+62
-0
PilotAbilityVO.java
...com/mmc/iuav/user/model/vo/dronepilot/PilotAbilityVO.java
+36
-0
PilotCertificationVO.java
...c/iuav/user/model/vo/dronepilot/PilotCertificationVO.java
+79
-0
ValueEnum.java
...java/com/mmc/iuav/user/model/vo/dronepilot/ValueEnum.java
+17
-0
ResultEnum.java
...-util/src/main/java/com/mmc/iuav/response/ResultEnum.java
+5
-1
CooperationController.java
...a/com/mmc/iuav/user/controller/CooperationController.java
+8
-0
PilotCertificationController.java
...r/controller/dronepilot/PilotCertificationController.java
+66
-0
CooperationDao.java
...r/src/main/java/com/mmc/iuav/user/dao/CooperationDao.java
+2
-0
PilotCertificationDao.java
...m/mmc/iuav/user/dao/dronepilot/PilotCertificationDao.java
+41
-0
CertificationMessage.java
...mmc/iuav/user/entity/dronepilot/CertificationMessage.java
+66
-0
PilotAbilityCertification.java
...uav/user/entity/dronepilot/PilotAbilityCertification.java
+35
-0
PilotAbilityDO.java
...a/com/mmc/iuav/user/entity/dronepilot/PilotAbilityDO.java
+47
-0
PilotCertificationDO.java
...mmc/iuav/user/entity/dronepilot/PilotCertificationDO.java
+146
-0
PilotCertificationLogDO.java
.../iuav/user/entity/dronepilot/PilotCertificationLogDO.java
+41
-0
CooperationService.java
...in/java/com/mmc/iuav/user/service/CooperationService.java
+2
-0
PilotCertificationService.java
...av/user/service/dronepilot/PilotCertificationService.java
+25
-0
PilotCertificationServiceImpl.java
...ervice/dronepilot/impl/PilotCertificationServiceImpl.java
+194
-0
CooperationServiceImpl.java
...om/mmc/iuav/user/service/impl/CooperationServiceImpl.java
+7
-0
CooperationDao.xml
...service-user/src/main/resources/mapper/CooperationDao.xml
+58
-9
PilotCertificationDao.xml
...ain/resources/mapper/dronepilot/PilotCertificationDao.xml
+165
-0
not-check.yml
...service/cms-service-user/src/main/resources/not-check.yml
+1
-0
没有找到文件。
cms-common/cms-common-model/pom.xml
浏览文件 @
8c11323a
...
@@ -40,7 +40,13 @@
...
@@ -40,7 +40,13 @@
<version>
1.0-SNAPSHOT
</version>
<version>
1.0-SNAPSHOT
</version>
<scope>
compile
</scope>
<scope>
compile
</scope>
</dependency>
</dependency>
<dependency>
<groupId>
com.google.protobuf
</groupId>
<artifactId>
protobuf-java
</artifactId>
<version>
3.11.4
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
</dependencies>
</project>
</project>
\ No newline at end of file
cms-common/cms-common-model/src/main/java/com/mmc/iuav/user/model/dto/dronepilot/LicenseType.java
0 → 100644
浏览文件 @
8c11323a
package
com
.
mmc
.
iuav
.
user
.
model
.
dto
.
dronepilot
;
import
com.mmc.iuav.user.model.vo.dronepilot.BaseEnum
;
import
lombok.Getter
;
/**
* @Author small
* @Date 2023/7/28 9:42
* @Version 1.0
*/
@Getter
public
enum
LicenseType
implements
BaseEnum
{
CAAC
(
"CAAC"
,
"CAAC"
),
UTC
(
"UTC"
,
"UTC"
),
OTHER
(
"OTHER"
,
"OTHER"
);
private
String
code
;
private
String
desc
;
private
LicenseType
(
String
code
,
String
desc
)
{
this
.
code
=
code
;
this
.
desc
=
desc
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
String
getdesc
()
{
return
desc
;
}
public
void
setdesc
(
String
desc
)
{
this
.
desc
=
desc
;
}
public
static
LicenseType
match
(
String
key
)
{
LicenseType
result
=
null
;
for
(
LicenseType
s
:
values
())
{
if
(
s
.
getCode
()
==
key
)
{
result
=
s
;
break
;
}
}
return
result
;
}
public
static
LicenseType
catchdesc
(
String
msg
)
{
LicenseType
result
=
null
;
for
(
LicenseType
s
:
values
())
{
if
(
s
.
getdesc
().
equals
(
msg
))
{
result
=
s
;
break
;
}
}
return
result
;
}
@Override
public
String
getEnumCode
()
{
return
code
;
}
@Override
public
String
getEnumDesc
()
{
return
desc
;
}
}
cms-common/cms-common-model/src/main/java/com/mmc/iuav/user/model/dto/dronepilot/PilotAbilityDTO.java
0 → 100644
浏览文件 @
8c11323a
package
com
.
mmc
.
iuav
.
user
.
model
.
dto
.
dronepilot
;
import
com.mmc.iuav.group.Create
;
import
com.mmc.iuav.group.Update
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.validation.constraints.NotBlank
;
/**
* @Author small
* @Date 2023/7/28 10:59
* @Version 1.0
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
@Builder
public
class
PilotAbilityDTO
{
@ApiModelProperty
(
value
=
"能力id不能为空"
,
example
=
"航拍摄影,农业植保"
,
required
=
true
)
@NotBlank
(
message
=
"能力id不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
Integer
abilityId
;
@ApiModelProperty
(
value
=
"能力不能为空"
,
example
=
"航拍摄影,农业植保"
,
required
=
true
)
@NotBlank
(
message
=
"能力名称不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
abilityName
;
}
cms-common/cms-common-model/src/main/java/com/mmc/iuav/user/model/dto/dronepilot/PilotCertificationDTO.java
0 → 100644
浏览文件 @
8c11323a
package
com
.
mmc
.
iuav
.
user
.
model
.
dto
.
dronepilot
;
import
com.alibaba.fastjson2.annotation.JSONField
;
import
com.mmc.iuav.group.Create
;
import
com.mmc.iuav.group.Update
;
import
com.mmc.iuav.user.model.vo.dronepilot.EnumValue
;
import
com.mmc.iuav.user.model.vo.dronepilot.PilotAbilityVO
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Size
;
import
java.util.Date
;
import
java.util.List
;
/**
* @Author small
* @Date 2023/7/28 10:02
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
PilotCertificationDTO
{
@ApiModelProperty
(
value
=
"飞手执照id"
,
example
=
"1"
)
@NotNull
(
message
=
"飞手执照id不能为空"
,
groups
=
Update
.
class
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"执照类型 CAAC,UTC,OTHER(其他) 目前只有三种"
,
example
=
"UTC"
,
required
=
false
)
@EnumValue
(
enumClass
=
LicenseType
.
class
,
message
=
"取值不合法,参考:LicenseType"
)
private
String
licenseType
;
@ApiModelProperty
(
value
=
"电子执照的编号"
,
example
=
"231321312313211"
,
required
=
true
)
@NotBlank
(
message
=
"电子执照的编号不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
licenseNumber
;
@ApiModelProperty
(
value
=
"上传执照"
,
example
=
"http://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/2cbbeffb-c1d1-4b26-a9a9-9e17c85e35a9.jpg"
,
required
=
true
)
@NotBlank
(
message
=
"上传执照的照片不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
licenseUrl
;
@ApiModelProperty
(
value
=
"地区编号不能为空"
,
example
=
"100001"
,
required
=
true
)
@NotBlank
(
message
=
"地区编号不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
Integer
areaNumber
;
@ApiModelProperty
(
value
=
"常驻城市不能为空"
,
example
=
"深圳市"
,
required
=
true
)
@NotBlank
(
message
=
"常驻城市不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
residentCity
;
@ApiModelProperty
(
value
=
"工作年限"
,
example
=
"3"
,
required
=
true
)
@NotBlank
(
message
=
"工作年限不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
Integer
yearsOfWorking
;
@NotNull
(
message
=
"能力不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
List
<
PilotAbilityVO
>
pilotAbility
;
@ApiModelProperty
(
value
=
"能力不能为空"
,
example
=
"http://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/2cbbeffb-c1d1-4b26-a9a9-9e17c85e35a9.jpg"
,
required
=
true
)
@NotBlank
(
message
=
"能力图片不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
abilityUrl
;
@ApiModelProperty
(
value
=
"个人简介"
,
example
=
"无人机专业,工作三年"
,
required
=
true
)
@NotBlank
(
message
=
"个人简介不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
@Size
(
max
=
300
,
message
=
"个人不能超过300"
)
private
String
individualResume
;
@ApiModelProperty
(
value
=
"备注"
,
example
=
"航拍摄影,农业植保"
,
required
=
false
)
private
String
remark
;
@ApiModelProperty
(
value
=
"审核是否通过 0审核中 1审核通过 2审核不通过"
,
example
=
"0审核中 1审核通过 2审核不通过"
,
required
=
false
)
private
Integer
auditStatus
;
@ApiModelProperty
(
value
=
"申请用户的id"
,
example
=
"1"
)
private
Integer
userAccountId
;
@JSONField
(
format
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
timeOfApplication
;
@JSONField
(
format
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createTime
;
@JSONField
(
format
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"申请用户的名称"
,
example
=
"1"
)
private
String
userName
;
@ApiModelProperty
(
value
=
"申请用户的性别"
,
example
=
"1"
)
private
Integer
sex
;
@ApiModelProperty
(
value
=
"申请用户的年龄"
,
example
=
"1"
)
private
Integer
age
;
}
cms-common/cms-common-model/src/main/java/com/mmc/iuav/user/model/vo/dronepilot/BaseEnum.java
0 → 100644
浏览文件 @
8c11323a
package
com
.
mmc
.
iuav
.
user
.
model
.
vo
.
dronepilot
;
/**
* @Author small
* @Date 2023/7/29 9:47
* @Version 1.0 枚举基类
*/
public
interface
BaseEnum
{
String
getEnumCode
();
String
getEnumDesc
();
}
cms-common/cms-common-model/src/main/java/com/mmc/iuav/user/model/vo/dronepilot/EnumUtils.java
0 → 100644
浏览文件 @
8c11323a
package
com
.
mmc
.
iuav
.
user
.
model
.
vo
.
dronepilot
;
import
com.alibaba.fastjson2.JSONArray
;
import
com.alibaba.fastjson2.JSONObject
;
import
java.lang.reflect.Method
;
import
java.util.Arrays
;
import
java.util.stream.Stream
;
/**
* @Author small
* @Date 2023/7/29 9:48
* @Version 1.0 枚举工具类
*/
public
final
class
EnumUtils
{
public
static
<
T
extends
BaseEnum
>
T
getByCode
(
Class
<
T
>
enumClazz
,
String
code
)
{
BaseEnum
[]
values
;
try
{
Method
method
=
enumClazz
.
getMethod
(
"values"
);
method
.
setAccessible
(
true
);
values
=
(
BaseEnum
[])
method
.
invoke
(
enumClazz
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
BaseEnum
result
=
Stream
.
of
(
values
)
.
filter
(
baseEnum
->
baseEnum
.
getEnumCode
().
equals
(
code
))
.
findFirst
()
.
orElse
(
null
);
return
result
==
null
?
null
:
(
T
)
result
;
}
public
static
boolean
isValidCode
(
Class
<?
extends
BaseEnum
>
enumClazz
,
String
code
)
{
return
getByCode
(
enumClazz
,
code
)
!=
null
;
}
public
static
JSONArray
toJsonArray
(
Class
<?
extends
BaseEnum
>
enumClazz
)
{
JSONArray
array
=
new
JSONArray
();
try
{
Method
method
=
enumClazz
.
getMethod
(
"values"
);
method
.
setAccessible
(
true
);
BaseEnum
[]
values
=
(
BaseEnum
[])
method
.
invoke
(
enumClazz
);
Arrays
.
stream
(
values
).
forEach
(
enumValue
->
{
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"code"
,
enumValue
.
getEnumCode
());
json
.
put
(
"desc"
,
enumValue
.
getEnumDesc
());
array
.
add
(
json
);
});
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
return
array
;
}
}
cms-common/cms-common-model/src/main/java/com/mmc/iuav/user/model/vo/dronepilot/EnumValue.java
0 → 100644
浏览文件 @
8c11323a
package
com
.
mmc
.
iuav
.
user
.
model
.
vo
.
dronepilot
;
/**
* @Author small
* @Date 2023/7/29 9:47
* @Version 1.0
*/
import
javax.validation.Constraint
;
import
javax.validation.ConstraintValidator
;
import
javax.validation.ConstraintValidatorContext
;
import
javax.validation.Payload
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.Target
;
@Target
({
ElementType
.
METHOD
,
ElementType
.
FIELD
,
ElementType
.
ANNOTATION_TYPE
})
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Constraint
(
validatedBy
=
EnumValue
.
Validator
.
class
)
public
@interface
EnumValue
{
String
message
()
default
"{custom.value.invalid}"
;
boolean
nullable
()
default
false
;
Class
<?>[]
groups
()
default
{};
Class
<?
extends
Payload
>[]
payload
()
default
{};
Class
<?
extends
BaseEnum
>
enumClass
();
class
Validator
implements
ConstraintValidator
<
EnumValue
,
Object
>
{
private
Class
<?
extends
BaseEnum
>
enumClass
;
boolean
nullable
=
false
;
@Override
public
void
initialize
(
EnumValue
enumValue
)
{
enumClass
=
enumValue
.
enumClass
();
nullable
=
enumValue
.
nullable
();
}
@Override
public
boolean
isValid
(
Object
value
,
ConstraintValidatorContext
constraintValidatorContext
)
{
if
(
value
==
null
&&
nullable
)
{
return
Boolean
.
TRUE
;
}
if
(
value
==
null
&&
!
nullable
)
{
return
Boolean
.
FALSE
;
}
if
(
enumClass
==
null
)
{
return
Boolean
.
TRUE
;
}
String
enumCode
=
(
String
)
value
;
return
EnumUtils
.
isValidCode
(
enumClass
,
enumCode
);
}
}
}
cms-common/cms-common-model/src/main/java/com/mmc/iuav/user/model/vo/dronepilot/PilotAbilityVO.java
0 → 100644
浏览文件 @
8c11323a
package
com
.
mmc
.
iuav
.
user
.
model
.
vo
.
dronepilot
;
import
com.mmc.iuav.group.Create
;
import
com.mmc.iuav.group.Update
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.validation.constraints.NotBlank
;
/**
* @Author small
* @Date 2023/7/28 11:23
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public
class
PilotAbilityVO
{
private
Integer
id
;
@ApiModelProperty
(
value
=
"能力id不能为空"
,
example
=
"5"
,
required
=
true
)
@NotBlank
(
message
=
"能力id不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
Integer
abilityId
;
@ApiModelProperty
(
value
=
"能力不能为空"
,
example
=
"道路检测"
,
required
=
true
)
@NotBlank
(
message
=
"能力名称不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
abilityName
;
@ApiModelProperty
(
value
=
"飞手认证id"
,
hidden
=
true
)
private
Integer
pilotCertificationId
;
}
cms-common/cms-common-model/src/main/java/com/mmc/iuav/user/model/vo/dronepilot/PilotCertificationVO.java
0 → 100644
浏览文件 @
8c11323a
package
com
.
mmc
.
iuav
.
user
.
model
.
vo
.
dronepilot
;
import
com.mmc.iuav.group.Create
;
import
com.mmc.iuav.group.Update
;
import
com.mmc.iuav.user.model.dto.dronepilot.LicenseType
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.validation.constraints.Max
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Size
;
import
java.util.List
;
/**
* @Author small
* @Date 2023/7/28 10:02
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
public
class
PilotCertificationVO
{
@ApiModelProperty
(
value
=
"飞手执照id"
,
example
=
"1"
)
@NotNull
(
message
=
"飞手执照id不能为空"
,
groups
=
Update
.
class
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"执照类型 CAAC,UTC,OTHER(其他) 目前只有三种"
,
example
=
"UTC"
,
required
=
true
)
@NotNull
(
message
=
"执照类型不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
@EnumValue
(
enumClass
=
LicenseType
.
class
,
message
=
"取值不合法,参考:LicenseType"
)
private
String
licenseType
;
@ApiModelProperty
(
value
=
"电子执照的编号"
,
example
=
"231321312313211"
,
required
=
true
)
@NotBlank
(
message
=
"电子执照的编号不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
licenseNumber
;
@ApiModelProperty
(
value
=
"上传执照"
,
example
=
"http://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/2cbbeffb-c1d1-4b26-a9a9-9e17c85e35a9.jpg"
,
required
=
true
)
@NotBlank
(
message
=
"上传执照的照片不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
licenseUrl
;
@ApiModelProperty
(
value
=
"地区编号不能为空"
,
example
=
"100001"
,
required
=
true
)
@NotNull
(
message
=
"地区编号不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
Integer
areaNumber
;
@ApiModelProperty
(
value
=
"常驻城市不能为空"
,
example
=
"深圳市"
,
required
=
true
)
@NotBlank
(
message
=
"常驻城市不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
residentCity
;
@ApiModelProperty
(
value
=
"工作年限"
,
example
=
"3"
,
required
=
true
)
@NotNull
(
message
=
"工作年限不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
@Max
(
value
=
80
,
message
=
"工作年限不能超过80年"
)
private
Integer
yearsOfWorking
;
@NotNull
(
message
=
"能力不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
List
<
PilotAbilityVO
>
pilotAbility
;
@ApiModelProperty
(
value
=
"能力不能为空"
,
example
=
"http://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/2cbbeffb-c1d1-4b26-a9a9-9e17c85e35a9.jpg"
,
required
=
true
)
@NotBlank
(
message
=
"能力图片不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
abilityUrl
;
@ApiModelProperty
(
value
=
"个人简介"
,
example
=
"无人机专业,工作三年"
,
required
=
true
)
@NotBlank
(
message
=
"个人简介不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
@Size
(
max
=
300
,
message
=
"个人不能超过300"
)
private
String
individualResume
;
@ApiModelProperty
(
value
=
"备注"
,
example
=
"航拍摄影,农业植保"
,
required
=
false
)
private
String
remark
;
@ApiModelProperty
(
value
=
"审核是否通过 0审核中 1审核通过 2审核不通过"
,
example
=
"0"
,
required
=
false
)
private
Integer
auditStatus
;
}
cms-common/cms-common-model/src/main/java/com/mmc/iuav/user/model/vo/dronepilot/ValueEnum.java
0 → 100644
浏览文件 @
8c11323a
package
com
.
mmc
.
iuav
.
user
.
model
.
vo
.
dronepilot
;
import
java.lang.annotation.Annotation
;
/**
* @Author small
* @Date 2023/7/29 9:43
* @Version 1.0
*/
public
interface
ValueEnum
<
T
>
extends
Annotation
{
/**
* 获取枚举值
*
* @return 枚举值
*/
T
getValue
();
}
cms-common/cms-common-util/src/main/java/com/mmc/iuav/response/ResultEnum.java
浏览文件 @
8c11323a
...
@@ -69,7 +69,11 @@ public enum ResultEnum implements BaseErrorInfoInterface {
...
@@ -69,7 +69,11 @@ public enum ResultEnum implements BaseErrorInfoInterface {
IDENTITY_HAS_BEEN_AUTHENTICATED
(
"34444"
,
"此身份证信息已经被认证,请重试"
),
IDENTITY_HAS_BEEN_AUTHENTICATED
(
"34444"
,
"此身份证信息已经被认证,请重试"
),
REAL_NAME_ACCOUNT_ID_ERROR
(
"36771"
,
"账户id错误"
),
REAL_NAME_ACCOUNT_ID_ERROR
(
"36771"
,
"账户id错误"
),
REAL_NAME_FUSING_ERROR
(
"36772"
,
"认证失败,请重新认证"
),
REAL_NAME_FUSING_ERROR
(
"36772"
,
"认证失败,请重新认证"
),
REAL_NAME_PASS_ERROR
(
"36773"
,
"已成功认证"
);
REAL_NAME_PASS_ERROR
(
"36773"
,
"已成功认证"
),
PLEASE_ERFORM_REAL_NAME_AUTHENTICATION_FIRST
(
"36774"
,
"请先进行实名认证"
),
I_HAVE_APPLIED_FOR_A_PILOT_LICENSE
(
"36775"
,
"已经申请飞手执照及能力认证,请等待审核"
),
CAN_NOT_CHANGE_THE_APPLICATION_OF_OTHERS
(
"36776"
,
"不能变更其他人申请的飞手执照及电子认证"
);
/**
/**
* 错误码
* 错误码
...
...
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/controller/CooperationController.java
浏览文件 @
8c11323a
...
@@ -58,6 +58,14 @@ public class CooperationController extends BaseController {
...
@@ -58,6 +58,14 @@ public class CooperationController extends BaseController {
return
cooperationService
.
appBrandList
();
return
cooperationService
.
appBrandList
();
}
}
@ApiOperation
(
value
=
"app-通过用户获取相关品牌信息"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
UserApplyTagVO
.
class
)})
@GetMapping
(
"appBrandMessage"
)
public
ResultBody
<
UserApplyTagVO
>
appBrandMessage
(
@ApiParam
(
value
=
"用户id"
,
required
=
true
)
@RequestParam
Integer
userAccountId
)
{
return
cooperationService
.
appBrandMessage
(
userAccountId
);
}
@ApiOperation
(
value
=
"后台-申请列表"
)
@ApiOperation
(
value
=
"后台-申请列表"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
UserApplyTagVO
.
class
)})
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
UserApplyTagVO
.
class
)})
@PostMapping
(
"listUserApplyTag"
)
@PostMapping
(
"listUserApplyTag"
)
...
...
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/controller/dronepilot/PilotCertificationController.java
0 → 100644
浏览文件 @
8c11323a
package
com
.
mmc
.
iuav
.
user
.
controller
.
dronepilot
;
import
com.mmc.iuav.group.Create
;
import
com.mmc.iuav.group.Page
;
import
com.mmc.iuav.group.Update
;
import
com.mmc.iuav.response.ResultBody
;
import
com.mmc.iuav.user.controller.BaseController
;
import
com.mmc.iuav.user.model.dto.RoleInfoDTO
;
import
com.mmc.iuav.user.model.dto.dronepilot.PilotAbilityDTO
;
import
com.mmc.iuav.user.model.dto.dronepilot.PilotCertificationDTO
;
import
com.mmc.iuav.user.model.qo.dronepilot.PilotCertificationQO
;
import
com.mmc.iuav.user.model.vo.dronepilot.PilotCertificationVO
;
import
com.mmc.iuav.user.service.dronepilot.PilotCertificationService
;
import
io.swagger.annotations.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
/**
* @Author small
* @Date 2023/7/28 9:32
* @Version 1.0
*/
@Api
(
tags
=
"飞手执照能力及认证"
)
@RequestMapping
(
"/pilot"
)
@RestController
public
class
PilotCertificationController
extends
BaseController
{
@Autowired
private
PilotCertificationService
certificationService
;
@ApiOperation
(
value
=
"能力类型"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
RoleInfoDTO
.
class
)})
@GetMapping
(
"/abilityList"
)
public
ResultBody
<
PilotAbilityDTO
>
abilityList
(
HttpServletRequest
request
)
{
return
certificationService
.
abilityList
();
}
@ApiOperation
(
value
=
"小程序——申请——飞手执照及能力认证"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@PostMapping
(
"/insertPilot"
)
public
ResultBody
insertPilot
(
HttpServletRequest
request
,
@RequestBody
@Validated
(
value
=
{
Create
.
class
})
PilotCertificationVO
certificationVO
)
{
return
certificationService
.
insertPilot
(
certificationVO
,
this
.
getUserLoginInfoFromRedis
(
request
));
}
@ApiOperation
(
value
=
"小程序——编辑——飞手执照及能力认证"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@PostMapping
(
"/updatePilot"
)
public
ResultBody
updatePilot
(
HttpServletRequest
request
,
@RequestBody
@Validated
(
value
=
{
Update
.
class
})
PilotCertificationVO
certificationVO
)
{
return
certificationService
.
updatePilot
(
certificationVO
,
this
.
getUserLoginInfoFromRedis
(
request
));
}
@ApiOperation
(
value
=
"小程序——详情————飞手执照及能力认证"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
PilotCertificationDTO
.
class
)})
@PostMapping
(
"/detailPilot"
)
public
ResultBody
<
PilotCertificationDTO
>
pilotList
(
HttpServletRequest
request
,
@Validated
(
value
=
{
Page
.
class
})
@ApiParam
(
value
=
"飞手查询"
,
required
=
true
)
@RequestBody
PilotCertificationQO
param
)
{
return
ResultBody
.
success
(
certificationService
.
pilotList
(
param
,
this
.
getUserLoginInfoFromRedis
(
request
)));
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/dao/CooperationDao.java
浏览文件 @
8c11323a
...
@@ -135,4 +135,6 @@ public interface CooperationDao {
...
@@ -135,4 +135,6 @@ public interface CooperationDao {
List
<
CompanyInfoDO
>
appBrandList
();
List
<
CompanyInfoDO
>
appBrandList
();
int
countUserApplyTagByUid
(
Integer
userAccountId
);
int
countUserApplyTagByUid
(
Integer
userAccountId
);
UserApplyTagDO
appBrandMessage
(
Integer
userAccountId
);
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/dao/dronepilot/PilotCertificationDao.java
0 → 100644
浏览文件 @
8c11323a
package
com
.
mmc
.
iuav
.
user
.
dao
.
dronepilot
;
import
com.mmc.iuav.user.entity.dronepilot.PilotAbilityDO
;
import
com.mmc.iuav.user.entity.dronepilot.PilotCertificationDO
;
import
com.mmc.iuav.user.entity.dronepilot.PilotCertificationLogDO
;
import
com.mmc.iuav.user.model.qo.dronepilot.PilotCertificationQO
;
import
com.mmc.iuav.user.model.vo.dronepilot.PilotAbilityVO
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
/**
* @Author small
* @Date 2023/7/28 9:36
* @Version 1.0
*/
@Mapper
public
interface
PilotCertificationDao
{
List
<
PilotAbilityDO
>
abilityList
();
Integer
selectRealNameAuth
(
Integer
userAccountId
);
void
insertPilot
(
PilotCertificationDO
pilotCertificationDO
);
void
insertAbility
(
List
<
PilotAbilityVO
>
list
);
void
insertPilotLog
(
PilotCertificationLogDO
pilotCertificationLog
);
Integer
selectPilotCertification
(
Integer
userAccountId
);
void
deleteAbility
(
Integer
id
);
void
updatePilot
(
PilotCertificationDO
pilotCertificationDO
);
Integer
selectPilotCount
(
Integer
id
,
Integer
userAccountId
);
List
<
PilotCertificationDO
>
pilotList
(
PilotCertificationQO
param
);
List
<
PilotAbilityVO
>
selectAbilityList
(
Integer
pilotCertificationId
);
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/entity/dronepilot/CertificationMessage.java
0 → 100644
浏览文件 @
8c11323a
package
com
.
mmc
.
iuav
.
user
.
entity
.
dronepilot
;
/**
* @Author small
* @Date 2023/7/28 10:43
* @Version 1.0
*/
public
enum
CertificationMessage
{
COMMITTED
(
0
,
"已提交电子执照认证。"
),
ALREADY_PASSED
(
1
,
"电子执照认证已通过。"
),
NOT_PASS
(
2
,
"电子执照认证不通过。"
);
private
int
code
;
private
String
message
;
private
CertificationMessage
(
int
code
,
String
message
)
{
this
.
code
=
code
;
this
.
message
=
message
;
}
public
int
getCode
()
{
return
code
;
}
public
void
setCode
(
int
code
)
{
this
.
code
=
code
;
}
public
String
getMessage
()
{
return
message
;
}
public
void
setMessage
(
String
message
)
{
this
.
message
=
message
;
}
public
static
CertificationMessage
match
(
int
key
)
{
CertificationMessage
result
=
null
;
for
(
CertificationMessage
s
:
values
())
{
if
(
s
.
getCode
()
==
key
)
{
result
=
s
;
break
;
}
}
return
result
;
}
public
static
CertificationMessage
catchMessage
(
String
msg
)
{
CertificationMessage
result
=
null
;
for
(
CertificationMessage
s
:
values
())
{
if
(
s
.
getMessage
().
equals
(
msg
))
{
result
=
s
;
break
;
}
}
return
result
;
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/entity/dronepilot/PilotAbilityCertification.java
0 → 100644
浏览文件 @
8c11323a
package
com
.
mmc
.
iuav
.
user
.
entity
.
dronepilot
;
import
com.mmc.iuav.group.Create
;
import
com.mmc.iuav.group.Update
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.validation.constraints.NotBlank
;
/**
* @Author small
* @Date 2023/7/28 10:37
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public
class
PilotAbilityCertification
{
@ApiModelProperty
(
value
=
"能力id不能为空"
,
example
=
"航拍摄影,农业植保"
,
required
=
true
)
@NotBlank
(
message
=
"能力id不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
Integer
abilityId
;
@ApiModelProperty
(
value
=
"能力不能为空"
,
example
=
"航拍摄影,农业植保"
,
required
=
true
)
@NotBlank
(
message
=
"能力名称不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
abilityName
;
@ApiModelProperty
(
value
=
"能力id不能为空"
,
example
=
"航拍摄影,农业植保"
,
required
=
true
)
@NotBlank
(
message
=
"能力id不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
Integer
pilotCertificationId
;
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/entity/dronepilot/PilotAbilityDO.java
0 → 100644
浏览文件 @
8c11323a
package
com
.
mmc
.
iuav
.
user
.
entity
.
dronepilot
;
import
com.mmc.iuav.group.Create
;
import
com.mmc.iuav.group.Update
;
import
com.mmc.iuav.user.model.dto.dronepilot.PilotAbilityDTO
;
import
com.mmc.iuav.user.model.vo.dronepilot.PilotAbilityVO
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.validation.constraints.NotBlank
;
/**
* @Author small
* @Date 2023/7/28 10:34
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public
class
PilotAbilityDO
{
@ApiModelProperty
(
value
=
"能力id不能为空"
,
example
=
"航拍摄影,农业植保"
,
required
=
true
)
@NotBlank
(
message
=
"能力id不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
Integer
abilityId
;
@ApiModelProperty
(
value
=
"能力不能为空"
,
example
=
"航拍摄影,农业植保"
,
required
=
true
)
@NotBlank
(
message
=
"能力名称不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
abilityName
;
public
PilotAbilityDTO
buildPilotAbilityDTO
()
{
return
PilotAbilityDTO
.
builder
()
.
abilityId
(
this
.
abilityId
)
.
abilityName
(
this
.
abilityName
)
.
build
();
}
public
PilotAbilityDO
(
PilotAbilityVO
pilotAbilityVO
)
{
this
.
abilityId
=
pilotAbilityVO
.
getAbilityId
();
this
.
abilityName
=
pilotAbilityVO
.
getAbilityName
();
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/entity/dronepilot/PilotCertificationDO.java
0 → 100644
浏览文件 @
8c11323a
package
com
.
mmc
.
iuav
.
user
.
entity
.
dronepilot
;
import
com.alibaba.fastjson2.annotation.JSONField
;
import
com.mmc.iuav.group.Create
;
import
com.mmc.iuav.group.Update
;
import
com.mmc.iuav.user.model.dto.dronepilot.PilotCertificationDTO
;
import
com.mmc.iuav.user.model.vo.dronepilot.PilotAbilityVO
;
import
com.mmc.iuav.user.model.vo.dronepilot.PilotCertificationVO
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.validation.constraints.Max
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Size
;
import
java.util.Date
;
import
java.util.List
;
/**
* @Author small
* @Date 2023/7/28 9:39
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public
class
PilotCertificationDO
{
@ApiModelProperty
(
value
=
"飞手执照id"
,
example
=
"1"
)
@NotNull
(
message
=
"飞手执照id不能为空"
,
groups
=
Update
.
class
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"执照类型 CAAC,UTC,OTHER(其他) 目前只有三种"
,
example
=
"UTC"
,
required
=
true
)
@NotNull
(
message
=
"执照类型不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
licenseType
;
@ApiModelProperty
(
value
=
"电子执照的编号"
,
example
=
"231321312313211"
,
required
=
true
)
@NotBlank
(
message
=
"电子执照的编号不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
licenseNumber
;
@ApiModelProperty
(
value
=
"上传执照"
,
example
=
"http://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/2cbbeffb-c1d1-4b26-a9a9-9e17c85e35a9.jpg"
,
required
=
true
)
@NotBlank
(
message
=
"上传执照的照片不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
licenseUrl
;
@ApiModelProperty
(
value
=
"地区编号不能为空"
,
example
=
"100001"
,
required
=
true
)
@NotNull
(
message
=
"地区编号不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
@Max
(
value
=
80
,
message
=
"工作年限不能超过80年"
)
private
Integer
areaNumber
;
@ApiModelProperty
(
value
=
"常驻城市不能为空"
,
example
=
"深圳市"
,
required
=
true
)
@NotBlank
(
message
=
"常驻城市不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
residentCity
;
@ApiModelProperty
(
value
=
"工作年限"
,
example
=
"3"
,
required
=
true
)
@NotNull
(
message
=
"工作年限不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
Integer
yearsOfWorking
;
@ApiModelProperty
(
value
=
"能力"
,
required
=
true
)
@NotNull
(
message
=
"能力不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
List
<
PilotAbilityVO
>
pilotAbility
;
@ApiModelProperty
(
value
=
"能力不能为空"
,
example
=
"http://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/2cbbeffb-c1d1-4b26-a9a9-9e17c85e35a9.jpg"
,
required
=
true
)
@NotBlank
(
message
=
"能力图片不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
abilityUrl
;
@ApiModelProperty
(
value
=
"个人简介"
,
example
=
"无人机专业,工作三年"
,
required
=
true
)
@NotBlank
(
message
=
"个人简介不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
@Size
(
max
=
300
,
message
=
"个人不能超过300"
)
private
String
individualResume
;
@ApiModelProperty
(
value
=
"备注"
,
example
=
"航拍摄影,农业植保"
,
required
=
false
)
private
String
remark
;
@ApiModelProperty
(
value
=
"审核是否通过 0审核中 1审核通过 2审核不通过"
,
example
=
"0审核中 1审核通过 2审核不通过"
,
required
=
false
)
private
Integer
auditStatus
;
@ApiModelProperty
(
value
=
"申请用户的id"
,
example
=
"1"
)
private
Integer
userAccountId
;
@JSONField
(
format
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
timeOfApplication
;
@JSONField
(
format
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createTime
;
@JSONField
(
format
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
updateTime
;
private
String
userName
;
private
Date
birthday
;
private
Integer
sex
;
private
Integer
age
;
public
PilotCertificationDO
(
PilotCertificationVO
pilotCertificationVO
,
Integer
userAccountId
)
{
this
.
id
=
pilotCertificationVO
.
getId
();
this
.
licenseType
=
pilotCertificationVO
.
getLicenseType
();
this
.
licenseNumber
=
pilotCertificationVO
.
getLicenseNumber
();
this
.
licenseUrl
=
pilotCertificationVO
.
getLicenseUrl
();
this
.
areaNumber
=
pilotCertificationVO
.
getAreaNumber
();
this
.
residentCity
=
pilotCertificationVO
.
getResidentCity
();
this
.
yearsOfWorking
=
pilotCertificationVO
.
getYearsOfWorking
();
this
.
pilotAbility
=
pilotCertificationVO
.
getPilotAbility
();
this
.
abilityUrl
=
pilotCertificationVO
.
getAbilityUrl
();
this
.
individualResume
=
pilotCertificationVO
.
getIndividualResume
();
this
.
remark
=
pilotCertificationVO
.
getRemark
();
this
.
auditStatus
=
pilotCertificationVO
.
getAuditStatus
();
this
.
userAccountId
=
userAccountId
;
}
public
PilotCertificationDTO
buildPilotCertificationDTO
()
{
return
PilotCertificationDTO
.
builder
()
.
id
(
this
.
id
)
.
licenseType
(
this
.
licenseType
)
.
licenseUrl
(
this
.
licenseUrl
)
.
licenseNumber
(
this
.
licenseNumber
)
.
areaNumber
(
this
.
areaNumber
)
.
residentCity
(
this
.
residentCity
)
.
yearsOfWorking
(
this
.
yearsOfWorking
)
.
pilotAbility
(
this
.
pilotAbility
)
.
abilityUrl
(
this
.
abilityUrl
)
.
individualResume
(
this
.
individualResume
)
.
remark
(
this
.
remark
)
.
auditStatus
(
this
.
auditStatus
)
.
userAccountId
(
this
.
userAccountId
)
.
timeOfApplication
(
this
.
timeOfApplication
)
.
createTime
(
this
.
createTime
)
.
updateTime
(
this
.
updateTime
)
.
userName
(
this
.
userName
)
.
age
(
this
.
age
)
.
sex
(
this
.
sex
)
.
build
();
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/entity/dronepilot/PilotCertificationLogDO.java
0 → 100644
浏览文件 @
8c11323a
package
com
.
mmc
.
iuav
.
user
.
entity
.
dronepilot
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.Date
;
/**
* @Author small
* @Date 2023/7/28 10:38
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public
class
PilotCertificationLogDO
{
@ApiModelProperty
(
value
=
"id"
,
example
=
"1"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"审批及认证时间"
,
example
=
"1"
)
private
Date
certificationDate
;
@ApiModelProperty
(
value
=
"申请人员的id"
,
example
=
"1"
)
private
Integer
userAccountId
;
@ApiModelProperty
(
value
=
"申请及审批信息"
,
example
=
"1"
)
private
String
certificationMessage
;
@ApiModelProperty
(
value
=
"操作人员id"
,
example
=
"1"
)
private
Integer
operatorUserId
;
public
PilotCertificationLogDO
(
PilotCertificationDO
pilotCertificationDO
,
CertificationMessage
certificationMessage
)
{
this
.
userAccountId
=
pilotCertificationDO
.
getUserAccountId
();
this
.
certificationMessage
=
certificationMessage
.
getMessage
();
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/CooperationService.java
浏览文件 @
8c11323a
...
@@ -60,4 +60,6 @@ public interface CooperationService {
...
@@ -60,4 +60,6 @@ public interface CooperationService {
PageResult
listServiceBitmapData
(
Integer
type
,
Integer
pageNo
,
Integer
pageSize
,
Double
lon
,
Double
lat
);
PageResult
listServiceBitmapData
(
Integer
type
,
Integer
pageNo
,
Integer
pageSize
,
Double
lon
,
Double
lat
);
ResultBody
appBrandList
();
ResultBody
appBrandList
();
ResultBody
<
UserApplyTagVO
>
appBrandMessage
(
Integer
userAccountId
);
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/dronepilot/PilotCertificationService.java
0 → 100644
浏览文件 @
8c11323a
package
com
.
mmc
.
iuav
.
user
.
service
.
dronepilot
;
import
com.mmc.iuav.page.PageResult
;
import
com.mmc.iuav.response.ResultBody
;
import
com.mmc.iuav.user.model.dto.LoginSuccessDTO
;
import
com.mmc.iuav.user.model.dto.dronepilot.PilotAbilityDTO
;
import
com.mmc.iuav.user.model.qo.dronepilot.PilotCertificationQO
;
import
com.mmc.iuav.user.model.vo.dronepilot.PilotCertificationVO
;
/**
* @Author small
* @Date 2023/7/28 9:35
* @Version 1.0
*/
public
interface
PilotCertificationService
{
ResultBody
insertPilot
(
PilotCertificationVO
certificationVO
,
LoginSuccessDTO
userLoginInfoFromRedis
);
ResultBody
<
PilotAbilityDTO
>
abilityList
();
ResultBody
updatePilot
(
PilotCertificationVO
certificationVO
,
LoginSuccessDTO
userLoginInfoFromRedis
);
PageResult
pilotList
(
PilotCertificationQO
param
,
LoginSuccessDTO
userLoginInfoFromRedis
);
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/dronepilot/impl/PilotCertificationServiceImpl.java
0 → 100644
浏览文件 @
8c11323a
package
com
.
mmc
.
iuav
.
user
.
service
.
dronepilot
.
impl
;
import
com.mmc.iuav.page.PageResult
;
import
com.mmc.iuav.response.ResultBody
;
import
com.mmc.iuav.response.ResultEnum
;
import
com.mmc.iuav.user.dao.dronepilot.PilotCertificationDao
;
import
com.mmc.iuav.user.entity.dronepilot.CertificationMessage
;
import
com.mmc.iuav.user.entity.dronepilot.PilotAbilityDO
;
import
com.mmc.iuav.user.entity.dronepilot.PilotCertificationDO
;
import
com.mmc.iuav.user.entity.dronepilot.PilotCertificationLogDO
;
import
com.mmc.iuav.user.model.dto.LoginSuccessDTO
;
import
com.mmc.iuav.user.model.dto.dronepilot.PilotAbilityDTO
;
import
com.mmc.iuav.user.model.dto.dronepilot.PilotCertificationDTO
;
import
com.mmc.iuav.user.model.qo.dronepilot.PilotCertificationQO
;
import
com.mmc.iuav.user.model.vo.dronepilot.PilotAbilityVO
;
import
com.mmc.iuav.user.model.vo.dronepilot.PilotCertificationVO
;
import
com.mmc.iuav.user.service.dronepilot.PilotCertificationService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* @Author small
* @Date 2023/7/28 9:35
* @Version 1.0
*/
@Service
public
class
PilotCertificationServiceImpl
implements
PilotCertificationService
{
@Autowired
private
PilotCertificationDao
certificationDao
;
@Override
public
ResultBody
insertPilot
(
PilotCertificationVO
certificationVO
,
LoginSuccessDTO
userLoginInfoFromRedis
)
{
Integer
count
=
certificationDao
.
selectRealNameAuth
(
userLoginInfoFromRedis
.
getUserAccountId
());
if
(
count
==
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
PLEASE_ERFORM_REAL_NAME_AUTHENTICATION_FIRST
);
}
Integer
integer
=
certificationDao
.
selectPilotCertification
(
userLoginInfoFromRedis
.
getUserAccountId
());
if
(
integer
!=
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
I_HAVE_APPLIED_FOR_A_PILOT_LICENSE
);
}
PilotCertificationDO
pilotCertificationDO
=
new
PilotCertificationDO
(
certificationVO
,
userLoginInfoFromRedis
.
getUserAccountId
());
certificationDao
.
insertPilot
(
pilotCertificationDO
);
List
<
PilotAbilityVO
>
pilotAbility
=
pilotCertificationDO
.
getPilotAbility
();
for
(
PilotAbilityVO
pilotAbilityVO
:
pilotAbility
)
{
pilotAbilityVO
.
setPilotCertificationId
(
pilotCertificationDO
.
getId
());
}
certificationDao
.
insertAbility
(
pilotAbility
);
PilotCertificationLogDO
pilotCertificationLog
=
new
PilotCertificationLogDO
(
pilotCertificationDO
,
CertificationMessage
.
match
(
0
));
certificationDao
.
insertPilotLog
(
pilotCertificationLog
);
return
ResultBody
.
success
();
}
@Override
public
ResultBody
<
PilotAbilityDTO
>
abilityList
()
{
List
<
PilotAbilityDO
>
abilityDOList
=
certificationDao
.
abilityList
();
List
<
PilotAbilityDTO
>
collect
=
abilityDOList
.
stream
().
map
(
PilotAbilityDO:
:
buildPilotAbilityDTO
).
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
collect
);
}
@Override
public
ResultBody
updatePilot
(
PilotCertificationVO
certificationVO
,
LoginSuccessDTO
userLoginInfoFromRedis
)
{
certificationDao
.
deleteAbility
(
certificationVO
.
getId
());
PilotCertificationDO
pilotCertificationDO
=
new
PilotCertificationDO
(
certificationVO
,
userLoginInfoFromRedis
.
getUserAccountId
());
Integer
count
=
certificationDao
.
selectPilotCount
(
pilotCertificationDO
.
getId
(),
userLoginInfoFromRedis
.
getUserAccountId
());
if
(
count
==
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
CAN_NOT_CHANGE_THE_APPLICATION_OF_OTHERS
);
}
certificationDao
.
updatePilot
(
pilotCertificationDO
);
List
<
PilotAbilityVO
>
pilotAbility
=
pilotCertificationDO
.
getPilotAbility
();
for
(
PilotAbilityVO
pilotAbilityVO
:
pilotAbility
)
{
pilotAbilityVO
.
setPilotCertificationId
(
pilotCertificationDO
.
getId
());
}
certificationDao
.
insertAbility
(
pilotAbility
);
PilotCertificationLogDO
pilotCertificationLog
=
new
PilotCertificationLogDO
(
pilotCertificationDO
,
CertificationMessage
.
match
(
0
));
certificationDao
.
insertPilotLog
(
pilotCertificationLog
);
return
ResultBody
.
success
();
}
@Override
public
PageResult
pilotList
(
PilotCertificationQO
param
,
LoginSuccessDTO
userLoginInfoFromRedis
)
{
Integer
pageNo
=
param
.
getPageNo
();
param
.
buildCurrentPage
();
List
<
PilotCertificationDO
>
pilotCertificationDOS
=
certificationDao
.
pilotList
(
param
);
extracted
(
pilotCertificationDOS
);
List
<
PilotCertificationDTO
>
collect
=
pilotCertificationDOS
.
stream
().
map
(
PilotCertificationDO:
:
buildPilotCertificationDTO
).
collect
(
Collectors
.
toList
());
if
(
param
.
getAbilityId
()
!=
null
)
{
for
(
PilotCertificationDTO
pilotCertificationDTO
:
collect
)
{
ArrayList
<
PilotAbilityVO
>
list
=
new
ArrayList
<>();
List
<
PilotAbilityVO
>
pilotAbility
=
pilotCertificationDTO
.
getPilotAbility
();
for
(
PilotAbilityVO
pilotAbilityVO
:
pilotAbility
)
{
if
(
pilotAbilityVO
.
getAbilityId
().
equals
(
param
.
getAbilityId
()))
{
list
.
add
(
pilotAbilityVO
);
}
}
if
(
list
.
size
()
==
0
)
{
pilotCertificationDTO
.
setPilotAbility
(
null
);
}
}
collect
=
collect
.
stream
().
filter
(
t
->
t
.
getPilotAbility
()
!=
null
).
collect
(
Collectors
.
toList
());
}
PageResult
pageResult
=
PageResult
.
buildPage
(
pageNo
,
param
.
getPageSize
(),
collect
.
size
(),
collect
);
return
pageResult
;
}
/**
* 工作年限的计算/年龄
*
* @param pilotCertificationDOS
*/
private
void
extracted
(
List
<
PilotCertificationDO
>
pilotCertificationDOS
)
{
int
ageByBirth
=
0
;
int
yearsOfWorking
=
0
;
for
(
PilotCertificationDO
pilotCertificationDO
:
pilotCertificationDOS
)
{
Date
birthday
=
pilotCertificationDO
.
getBirthday
();
ageByBirth
=
getAgeByBirth
(
birthday
);
pilotCertificationDO
.
setAge
(
ageByBirth
);
yearsOfWorking
=
getYearsOfWorking
(
pilotCertificationDO
.
getTimeOfApplication
());
Integer
Working
=
pilotCertificationDO
.
getYearsOfWorking
();
yearsOfWorking
=
yearsOfWorking
+
Working
;
pilotCertificationDO
.
setYearsOfWorking
(
yearsOfWorking
);
}
}
public
static
int
getYearsOfWorking
(
Date
yearsOfWorking
)
{
//获取当前时间
Calendar
cal
=
Calendar
.
getInstance
();
//获取出生日期的Calendar对象
Calendar
bir
=
Calendar
.
getInstance
();
bir
.
setTime
(
yearsOfWorking
);
//如果出生日期大于当前日期,则返回0
if
(
cal
.
before
(
yearsOfWorking
))
{
return
0
;
}
//取出当前年月日
int
nowYear
=
cal
.
get
(
Calendar
.
YEAR
);
int
nowMonth
=
cal
.
get
(
Calendar
.
MONTH
);
int
nowDay
=
cal
.
get
(
Calendar
.
DAY_OF_MONTH
);
//取出出生日期的年月日
int
birthYear
=
bir
.
get
(
Calendar
.
YEAR
);
int
birthMonth
=
bir
.
get
(
Calendar
.
MONTH
);
int
birthDay
=
bir
.
get
(
Calendar
.
DAY_OF_MONTH
);
//计算年份
int
age
=
nowYear
-
birthYear
;
//计算月份和日,看看是否大于当前月日,如果小于则减去一岁
if
(
nowMonth
<
birthMonth
||
(
nowMonth
==
birthMonth
&&
nowDay
<
birthDay
))
{
age
--;
}
return
age
;
}
public
static
int
getAgeByBirth
(
Date
birthday
)
{
//获取当前时间
Calendar
cal
=
Calendar
.
getInstance
();
//获取出生日期的Calendar对象
Calendar
bir
=
Calendar
.
getInstance
();
bir
.
setTime
(
birthday
);
//如果出生日期大于当前日期,则返回0
if
(
cal
.
before
(
birthday
))
{
return
0
;
}
//取出当前年月日
int
nowYear
=
cal
.
get
(
Calendar
.
YEAR
);
int
nowMonth
=
cal
.
get
(
Calendar
.
MONTH
);
int
nowDay
=
cal
.
get
(
Calendar
.
DAY_OF_MONTH
);
//取出出生日期的年月日
int
birthYear
=
bir
.
get
(
Calendar
.
YEAR
);
int
birthMonth
=
bir
.
get
(
Calendar
.
MONTH
);
int
birthDay
=
bir
.
get
(
Calendar
.
DAY_OF_MONTH
);
//计算年份
int
age
=
nowYear
-
birthYear
;
//计算月份和日,看看是否大于当前月日,如果小于则减去一岁
if
(
nowMonth
<
birthMonth
||
(
nowMonth
==
birthMonth
&&
nowDay
<
birthDay
))
{
age
--;
}
return
age
;
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/impl/CooperationServiceImpl.java
浏览文件 @
8c11323a
...
@@ -304,4 +304,11 @@ public class CooperationServiceImpl implements CooperationService {
...
@@ -304,4 +304,11 @@ public class CooperationServiceImpl implements CooperationService {
List
<
CompanyInfoVO
>
collect
=
companyInfoDOS
.
stream
().
map
(
CompanyInfoDO:
:
buildCompanyInfoVO
).
collect
(
Collectors
.
toList
());
List
<
CompanyInfoVO
>
collect
=
companyInfoDOS
.
stream
().
map
(
CompanyInfoDO:
:
buildCompanyInfoVO
).
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
collect
);
return
ResultBody
.
success
(
collect
);
}
}
@Override
public
ResultBody
<
UserApplyTagVO
>
appBrandMessage
(
Integer
userAccountId
)
{
UserApplyTagDO
userApplyTagDO
=
cooperationDao
.
appBrandMessage
(
userAccountId
);
UserApplyTagVO
userApplyTagVO
=
userApplyTagDO
.
buildUserApplyTagVO
();
return
ResultBody
.
success
(
userApplyTagVO
);
}
}
}
csm-service/cms-service-user/src/main/resources/mapper/CooperationDao.xml
浏览文件 @
8c11323a
...
@@ -354,21 +354,70 @@
...
@@ -354,21 +354,70 @@
</update>
</update>
<select
id=
"appBrandList"
resultType=
"com.mmc.iuav.user.entity.CompanyInfoDO"
>
<select
id=
"appBrandList"
resultType=
"com.mmc.iuav.user.entity.CompanyInfoDO"
>
SELECT cm.user_account_id,
SELECT ua.id,
cm.company_info_id,
ua.cooperation_tag_id,
cm.is_leader,
ua.user_account_id,
ua.apply_name,
ua.apply_phone,
ua.apply_status,
ua.remark,
ua.create_time,
ua.content,
ua.score,
ct.tag_name,
ci.company_name,
ci.brand_name,
ci.brand_name,
ci.brand_logo,
ci.brand_logo,
ci.credit_code,
ci.license_img,
ci.address,
ci.address,
ci.lon,
ci.lat,
ci.lat,
ci.company_name,
ci.lon
ci.id
FROM user_apply_tag ua
FROM company_member cm
INNER JOIN cooperation_tag ct ON ua.cooperation_tag_id = ct.id
LEFT JOIN company_info ci ON cm.company_info_id = ci.id
INNER JOIN company_member cm ON cm.user_account_id = ua.user_account_id
INNER JOIN company_info ci ON cm.company_info_id = ci.id
WHERE ua.apply_status = 1
AND ua.is_deleted = 0
AND ct.is_deleted = 0
AND ci.is_deleted = 0
</select>
</select>
<select
id=
"countUserApplyTagByUid"
resultType=
"java.lang.Integer"
>
<select
id=
"countUserApplyTagByUid"
resultType=
"java.lang.Integer"
>
select count(*) from user_apply_tag where user_account_id = #{userAccountId} and is_deleted = 0
select count(*)
from user_apply_tag
where user_account_id = #{userAccountId}
and is_deleted = 0
</select>
<select
id=
"appBrandMessage"
resultMap=
"UserApplyTagList"
>
SELECT ua.id,
ua.cooperation_tag_id,
ua.user_account_id,
ua.apply_name,
ua.apply_phone,
ua.apply_status,
ua.remark,
ua.create_time,
ua.content,
ua.score,
ct.tag_name,
ci.company_name,
ci.brand_name,
ci.brand_logo,
ci.credit_code,
ci.license_img,
ci.address,
ci.lat,
ci.lon
FROM user_apply_tag ua
INNER JOIN cooperation_tag ct ON ua.cooperation_tag_id = ct.id
INNER JOIN company_member cm ON cm.user_account_id = ua.user_account_id
INNER JOIN company_info ci ON cm.company_info_id = ci.id
WHERE ua.apply_status = 1
AND ua.user_account_id = #{userAccountId}
AND ua.is_deleted = 0
AND ct.is_deleted = 0
AND ci.is_deleted = 0
</select>
</select>
</mapper>
</mapper>
csm-service/cms-service-user/src/main/resources/mapper/dronepilot/PilotCertificationDao.xml
0 → 100644
浏览文件 @
8c11323a
<?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.mmc.iuav.user.dao.dronepilot.PilotCertificationDao"
>
<resultMap
id=
"pilotList"
type=
"com.mmc.iuav.user.entity.dronepilot.PilotCertificationDO"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"licenseType"
column=
"license_type"
/>
<result
property=
"licenseNumber"
column=
"license_number"
/>
<result
property=
"licenseUrl"
column=
"license_url"
/>
<result
property=
"areaNumber"
column=
"area_number"
/>
<result
property=
"yearsOfWorking"
column=
"years_of_working"
/>
<result
property=
"abilityUrl"
column=
"ability_url"
/>
<result
property=
"individualResume"
column=
"individual_resume"
/>
<result
property=
"auditStatus"
column=
"audit_status"
/>
<result
property=
"userAccountId"
column=
"user_account_id"
/>
<result
property=
"timeOfApplication"
column=
"time_of_application"
/>
<result
property=
"remark"
column=
"remark"
/>
<result
property=
"residentCity"
column=
"resident_city"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"userName"
column=
"user_name"
/>
<result
property=
"birthday"
column=
"birthday"
/>
<result
property=
"sex"
column=
"sex"
/>
<collection
property=
"pilotAbility"
ofType=
"com.mmc.iuav.user.model.vo.dronepilot.PilotAbilityVO"
select=
"selectAbilityList"
column=
"{pilotCertificationId=id}"
>
</collection>
</resultMap>
<select
id=
"selectAbilityList"
resultType=
"com.mmc.iuav.user.model.vo.dronepilot.PilotAbilityVO"
>
select id,
ability_name AS abilityName,
ability_id AS abilityId,
pilot_certification_id AS pilotCertificationId
from pilot_ability_certification
where pilot_certification_id = #{pilotCertificationId}
</select>
<select
id=
"abilityList"
resultType=
"com.mmc.iuav.user.entity.dronepilot.PilotAbilityDO"
>
select id AS abilityId, `name` AS abilityName
from pilot_ability
</select>
<select
id=
"selectRealNameAuth"
resultType=
"java.lang.Integer"
>
select count(*)
from real_name_auth
where user_account_id = #{userAccountId}
</select>
<insert
id=
"insertPilot"
useGeneratedKeys=
"true"
keyProperty=
"id"
parameterType=
"com.mmc.iuav.user.entity.dronepilot.PilotCertificationDO"
>
insert into pilot_certification(license_type, license_number, license_url, area_number, years_of_working,
ability_url, individual_resume, audit_status, user_account_id,
time_of_application, resident_city, create_time, update_time)
values (#{licenseType}, #{licenseNumber}, #{licenseUrl}, #{areaNumber}, #{yearsOfWorking},
#{abilityUrl}, #{individualResume}, #{auditStatus}, #{userAccountId},
NOW(), #{residentCity}, NOW(), NOW())
</insert>
<insert
id=
"insertAbility"
parameterType=
"java.util.List"
>
insert into
pilot_ability_certification(ability_name,ability_id,pilot_certification_id)
values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(#{item.abilityName},#{item.abilityId},#{item.pilotCertificationId})
</foreach>
</insert>
<insert
id=
"insertPilotLog"
parameterType=
"com.mmc.iuav.user.entity.dronepilot.PilotCertificationLogDO"
>
insert into pilot_certification_log(certification_date, user_account_id, certification_message, create_time,
update_time)
values (NOW(), #{userAccountId}, #{certificationMessage}, NOW(), NOW())
</insert>
<select
id=
"selectPilotCertification"
resultType=
"java.lang.Integer"
>
select count(*)
from pilot_certification
where user_account_id = #{userAccountId}
</select>
<delete
id=
"deleteAbility"
>
delete
from pilot_ability_certification
where pilot_certification_id = #{id}
</delete>
<update
id=
"updatePilot"
parameterType=
"com.mmc.iuav.user.entity.dronepilot.PilotCertificationDO"
>
UPDATE pilot_certification
<set>
<if
test=
" licenseType != null and licenseType != '' "
>
license_type = #{licenseType},
</if>
<if
test=
" licenseNumber != null and licenseNumber != '' "
>
license_number = #{licenseNumber},
</if>
<if
test=
" licenseUrl != null and licenseUrl != '' "
>
license_url = #{licenseUrl},
</if>
<if
test=
" areaNumber != null and areaNumber != '' "
>
area_number = #{areaNumber},
</if>
<if
test=
" yearsOfWorking != null "
>
years_of_working = #{yearsOfWorking},
</if>
<if
test=
" abilityUrl != null and abilityUrl != '' "
>
ability_url = #{abilityUrl},
</if>
<if
test=
" individualResume != null and individualResume != '' "
>
individual_resume = #{individualResume},
</if>
<if
test=
" remark != null and remark != '' "
>
remark = #{remark},
</if>
<if
test=
" residentCity != null and residentCity != '' "
>
resident_city = #{residentCity},
</if>
update_time=NOW(),
audit_status = 0
</set>
where id = #{id}
</update>
<select
id=
"selectPilotCount"
resultType=
"java.lang.Integer"
>
select count(*)
from pilot_certification
where id = #{id}
and user_account_id = #{userAccountId}
</select>
<select
id=
"pilotList"
resultMap=
"pilotList"
>
SELECT pc.id,
pc.license_type,
pc.license_number,
pc.license_url,
pc.area_number,
pc.years_of_working,
pc.ability_url,
pc.individual_resume,
pc.audit_status,
pc.user_account_id,
pc.time_of_application,
pc.remark,
pc.resident_city,
pc.create_time,
pc.update_time,
rna.user_name,
rna.birthday,
rna.sex
FROM pilot_certification pc
LEFT JOIN real_name_auth rna ON pc.user_account_id = rna.user_account_id
where 1=1
<if
test=
" areaNumber != null and areaNumber != '' "
>
and (pc.license_number =#{areaNumber})
</if>
<if
test=
" licenseType != null and licenseType != '' "
>
and (pc.license_type =#{licenseType})
</if>
order by update_time desc, create_time desc
limit #{pageNo},#{pageSize}
</select>
</mapper>
csm-service/cms-service-user/src/main/resources/not-check.yml
浏览文件 @
8c11323a
...
@@ -23,3 +23,4 @@ data-filter:
...
@@ -23,3 +23,4 @@ data-filter:
-
/userapp/company/getCompanyInfoById
-
/userapp/company/getCompanyInfoById
-
/userapp/cooperation/service/bitmap
-
/userapp/cooperation/service/bitmap
-
/userapp/cooperation/appBrandList
-
/userapp/cooperation/appBrandList
-
/userapp/cooperation/appBrandMessage
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论