Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
I
ims-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
ims-ci-test
Commits
ac05e3ce
提交
ac05e3ce
authored
7月 15, 2023
作者:
张小凤
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Licence(add)
上级
b4c53bea
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
17 个修改的文件
包含
962 行增加
和
12 行删除
+962
-12
LicenseOrganizationsDTO.java
...java/com/mmc/csf/licence/dto/LicenseOrganizationsDTO.java
+81
-0
LicenseTrainingProgramsDTO.java
...a/com/mmc/csf/licence/dto/LicenseTrainingProgramsDTO.java
+70
-0
LicenseOrganizationsQO.java
...n/java/com/mmc/csf/licence/qo/LicenseOrganizationsQO.java
+63
-0
LicenseOrganizationsVO.java
...n/java/com/mmc/csf/licence/vo/LicenseOrganizationsVO.java
+75
-0
LicenseTrainingProgramsVO.java
...ava/com/mmc/csf/licence/vo/LicenseTrainingProgramsVO.java
+69
-0
Create.java
...src/main/java/com/mmc/csf/release/model/group/Create.java
+8
-5
Update.java
...src/main/java/com/mmc/csf/release/model/group/Update.java
+8
-5
ResultEnum.java
...src/main/java/com/mmc/csf/common/util/web/ResultEnum.java
+3
-1
LicenceBackgroundController.java
...lease/controller/licence/LicenceBackgroundController.java
+82
-0
LicenceCommonController.java
...f/release/controller/licence/LicenceCommonController.java
+1
-1
LicenceBackgroundDao.java
...com/mmc/csf/release/dao/licence/LicenceBackgroundDao.java
+52
-0
LicenseOrganizationsDO.java
...mc/csf/release/entity/licence/LicenseOrganizationsDO.java
+122
-0
LicenseProgramsDO.java
...com/mmc/csf/release/entity/licence/LicenseProgramsDO.java
+92
-0
LicenseTrainingProgramsDO.java
...csf/release/entity/licence/LicenseTrainingProgramsDO.java
+68
-0
LicenceBackgroundService.java
...csf/release/service/licence/LicenceBackgroundService.java
+23
-0
LicenceBackgroundServiceImpl.java
...se/service/licence/impl/LicenceBackgroundServiceImpl.java
+145
-0
LicenceBackgroundDao.xml
...rc/main/resources/mapper/licence/LicenceBackgroundDao.xml
+0
-0
没有找到文件。
csf-common/csf-common-model/src/main/java/com/mmc/csf/licence/dto/LicenseOrganizationsDTO.java
0 → 100644
浏览文件 @
ac05e3ce
package
com
.
mmc
.
csf
.
licence
.
dto
;
import
com.mmc.csf.release.model.group.Create
;
import
com.mmc.csf.release.model.group.Update
;
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.List
;
/**
* @Author small
* @Date 2023/7/14 16:51
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
LicenseOrganizationsDTO
{
private
static
final
long
serialVersionUID
=
-
5814724843819090363L
;
@ApiModelProperty
(
value
=
"机构id"
,
example
=
"1"
)
@NotNull
(
message
=
"机构id"
,
groups
=
Update
.
class
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"机构主图不能为空"
,
example
=
"http://"
,
required
=
true
)
@NotBlank
(
message
=
"机构主图不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
mainImage
;
@ApiModelProperty
(
value
=
"机构副图不能为空"
,
example
=
"http://"
,
required
=
true
)
@NotBlank
(
message
=
"机构副图不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
auxiliaryPicture
;
@ApiModelProperty
(
value
=
"机构视频"
,
example
=
"http://"
)
private
String
video
;
@ApiModelProperty
(
value
=
"机构名称不能为空"
,
example
=
"科比特智能教育"
,
required
=
true
)
@NotBlank
(
message
=
"机构名称不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
@Size
(
max
=
25
,
message
=
"机构名称不能超过25个字符"
)
private
String
name
;
@ApiModelProperty
(
name
=
"机构地区"
,
example
=
"110000,110100"
)
@NotBlank
(
message
=
"机构地区不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
region
;
@ApiModelProperty
(
name
=
"机构地区名称"
,
example
=
"河北省,石家庄市"
,
required
=
true
)
@NotBlank
(
message
=
"机构地区名称"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
regionName
;
@ApiModelProperty
(
name
=
"机构详细地址"
,
example
=
"南山区"
)
@NotBlank
(
message
=
"机构详细地址不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
detailedAddress
;
@ApiModelProperty
(
name
=
"是否是考点机构 0否 1是"
,
example
=
"0"
,
required
=
true
)
@NotNull
(
message
=
"考点机构不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
Integer
testCenter
;
@ApiModelProperty
(
name
=
"机构规模id不能为空 "
,
example
=
"1"
)
//@NotNull(message = "机构规模id不能为空", groups = {Create.class, Update.class})
private
Integer
scaleId
;
@ApiModelProperty
(
name
=
"机构规模名称"
,
example
=
"1"
)
private
String
scaleName
;
@ApiModelProperty
(
name
=
"机构描述"
,
example
=
"机构描述0001"
)
//@NotNull(message = "机构描述", groups = {Create.class, Update.class})
private
String
description
;
@ApiModelProperty
(
name
=
"机构详情"
,
example
=
"机构详情0001"
)
//@NotNull(message = "机构描述", groups = {Create.class, Update.class})
private
String
detail
;
@ApiModelProperty
(
name
=
"培训项目"
,
required
=
false
)
private
List
<
LicenseTrainingProgramsDTO
>
programsDOList
;
}
csf-common/csf-common-model/src/main/java/com/mmc/csf/licence/dto/LicenseTrainingProgramsDTO.java
0 → 100644
浏览文件 @
ac05e3ce
package
com
.
mmc
.
csf
.
licence
.
dto
;
import
com.mmc.csf.release.model.group.Create
;
import
com.mmc.csf.release.model.group.Update
;
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
;
/**
* @Author small
* @Date 2023/7/14 13:30
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
LicenseTrainingProgramsDTO
{
private
static
final
long
serialVersionUID
=
-
5814724843819090363L
;
@ApiModelProperty
(
value
=
"培训id"
,
example
=
"1"
)
@NotNull
(
message
=
"培训id不能为空"
,
groups
=
Update
.
class
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"培训等级id"
,
example
=
"1"
,
required
=
true
)
@NotNull
(
message
=
"培训等级id不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
Integer
gradeId
;
@ApiModelProperty
(
value
=
"培训等级名称"
,
example
=
"1"
,
required
=
true
)
@NotNull
(
message
=
"培训等级名称不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
gradeName
;
@ApiModelProperty
(
value
=
"培训机型id"
,
example
=
"1"
,
required
=
true
)
@NotNull
(
message
=
"培训机型id不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
Integer
modelsId
;
@ApiModelProperty
(
value
=
"培训机型名称"
,
example
=
"1"
,
required
=
true
)
@NotNull
(
message
=
"培训机型名称不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
modelsName
;
@ApiModelProperty
(
value
=
"培训类型id"
,
example
=
"1"
,
required
=
true
)
@NotNull
(
message
=
"培训类型id不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
Integer
typeId
;
@ApiModelProperty
(
value
=
"培训类型名称"
,
example
=
"1"
,
required
=
true
)
@NotNull
(
message
=
"培训类型名称"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
typeName
;
@ApiModelProperty
(
value
=
"培训价格"
,
example
=
"1000"
,
required
=
true
)
@NotNull
(
message
=
"培训价格不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
@Size
(
min
=
0
,
max
=
100000
,
message
=
"价格不能超过100000"
)
private
Integer
price
;
@ApiModelProperty
(
value
=
"培训地点不能为空"
,
example
=
"广东省深圳市南山区XXX001"
,
required
=
true
)
@NotBlank
(
message
=
"培训地点不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
place
;
@ApiModelProperty
(
value
=
"培训主图不能为空"
,
example
=
"http://"
,
required
=
true
)
@NotBlank
(
message
=
"培训主图不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
mainImage
;
@ApiModelProperty
(
value
=
"机构id"
,
example
=
"http://"
,
required
=
true
)
@NotBlank
(
message
=
"机构id"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
Integer
orgId
;
}
csf-common/csf-common-model/src/main/java/com/mmc/csf/licence/qo/LicenseOrganizationsQO.java
0 → 100644
浏览文件 @
ac05e3ce
package
com
.
mmc
.
csf
.
licence
.
qo
;
import
com.mmc.csf.release.model.group.Freeze
;
import
com.mmc.csf.release.model.group.Page
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.validation.constraints.Min
;
import
javax.validation.constraints.NotNull
;
/**
* @Author small
* @Date 2023/7/14 16:58
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
LicenseOrganizationsQO
{
@ApiModelProperty
(
value
=
"机构名称不能为空"
,
example
=
"科比特智能教育"
,
required
=
false
)
private
String
name
;
@ApiModelProperty
(
value
=
"培训等级id"
,
example
=
"1"
,
required
=
false
)
private
Integer
gradeId
;
@ApiModelProperty
(
value
=
"培训机型id"
,
example
=
"1"
,
required
=
false
)
private
Integer
modelsId
;
@ApiModelProperty
(
value
=
"培训类型id"
,
example
=
"1"
,
required
=
false
)
private
Integer
typeId
;
@ApiModelProperty
(
value
=
"开始时间,如果只有一个日期,就开始时间与结束时间一致"
,
example
=
"2023-07-14"
,
required
=
false
)
private
String
statTime
;
@ApiModelProperty
(
value
=
"结束时间"
,
example
=
"2023-07-14"
,
required
=
false
)
private
String
endTime
;
@ApiModelProperty
(
value
=
"机构id"
,
example
=
"1"
,
required
=
false
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"地域region"
,
example
=
"110000"
,
required
=
false
)
private
String
region
;
@ApiModelProperty
(
value
=
"当前页"
,
required
=
true
,
example
=
"1"
)
@NotNull
(
message
=
"当前页不能为空"
,
groups
=
{
Page
.
class
,
Freeze
.
class
})
@Min
(
value
=
1
,
groups
=
Page
.
class
)
private
Integer
pageNo
;
@ApiModelProperty
(
value
=
"页大小"
,
required
=
true
,
example
=
"10"
)
@NotNull
(
message
=
"页大小不能为空"
,
groups
=
{
Page
.
class
,
Freeze
.
class
})
@Min
(
value
=
1
,
groups
=
Page
.
class
)
private
Integer
pageSize
;
public
void
buildCurrentPage
()
{
this
.
pageNo
=
(
pageNo
-
1
)
*
pageSize
;
}
}
csf-common/csf-common-model/src/main/java/com/mmc/csf/licence/vo/LicenseOrganizationsVO.java
0 → 100644
浏览文件 @
ac05e3ce
package
com
.
mmc
.
csf
.
licence
.
vo
;
import
com.mmc.csf.release.model.group.Create
;
import
com.mmc.csf.release.model.group.Update
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Size
;
import
java.util.List
;
/**
* @Author small
* @Date 2023/7/13 16:07
* @Version 1.0
*/
@Data
public
class
LicenseOrganizationsVO
{
private
static
final
long
serialVersionUID
=
-
5814724843819090363L
;
@ApiModelProperty
(
value
=
"机构id"
,
example
=
"1"
)
@NotNull
(
message
=
"机构id"
,
groups
=
Update
.
class
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"机构主图不能为空"
,
example
=
"http://"
,
required
=
true
)
@NotBlank
(
message
=
"机构主图不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
mainImage
;
@ApiModelProperty
(
value
=
"机构副图不能为空"
,
example
=
"http://"
,
required
=
true
)
@NotBlank
(
message
=
"机构副图不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
auxiliaryPicture
;
@ApiModelProperty
(
value
=
"机构视频"
,
example
=
"http://"
)
private
String
video
;
@ApiModelProperty
(
value
=
"机构名称不能为空"
,
example
=
"科比特智能教育"
,
required
=
true
)
@NotBlank
(
message
=
"机构名称不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
@Size
(
max
=
25
,
message
=
"机构名称不能超过25个字符"
)
private
String
name
;
@ApiModelProperty
(
name
=
"机构地区编号"
,
example
=
"110000,130100"
,
required
=
true
)
@NotBlank
(
message
=
"机构地区不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
region
;
@ApiModelProperty
(
name
=
"机构地区名称"
,
example
=
"河北省,石家庄市"
,
required
=
true
)
@NotBlank
(
message
=
"机构地区名称"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
regionName
;
@ApiModelProperty
(
name
=
"机构详细地址"
,
example
=
"南山区"
,
required
=
true
)
@NotBlank
(
message
=
"机构详细地址不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
detailedAddress
;
@ApiModelProperty
(
name
=
"是否是考点机构 0否 1是"
,
example
=
"0"
,
required
=
true
)
@NotNull
(
message
=
"考点机构不能为空 0否 1是"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
Integer
testCenter
;
@ApiModelProperty
(
name
=
"机构规模id不能为空"
,
example
=
"1"
)
//@NotNull(message = "机构规模id不能为空", groups = {Create.class, Update.class})
private
Integer
scaleId
;
@ApiModelProperty
(
name
=
"机构描述"
,
example
=
"机构描述0001"
)
//@NotNull(message = "机构描述", groups = {Create.class, Update.class})
private
String
description
;
@ApiModelProperty
(
name
=
"机构详情"
,
example
=
"机构详情0001"
,
required
=
true
)
@NotNull
(
message
=
"机构详情"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
detail
;
@ApiModelProperty
(
name
=
"培训项目"
,
required
=
true
)
@NotNull
(
message
=
"培训项目"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
List
<
LicenseTrainingProgramsVO
>
trainingProgramsVOS
;
}
csf-common/csf-common-model/src/main/java/com/mmc/csf/licence/vo/LicenseTrainingProgramsVO.java
0 → 100644
浏览文件 @
ac05e3ce
package
com
.
mmc
.
csf
.
licence
.
vo
;
import
com.mmc.csf.release.model.group.Create
;
import
com.mmc.csf.release.model.group.Update
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
org.hibernate.validator.constraints.Range
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.util.Objects
;
/**
* @Author small
* @Date 2023/7/14 11:12
* @Version 1.0
*/
@Data
public
class
LicenseTrainingProgramsVO
{
private
static
final
long
serialVersionUID
=
-
5814724843819090363L
;
@ApiModelProperty
(
value
=
"培训id"
,
example
=
"1"
)
@NotNull
(
message
=
"培训id不能为空"
,
groups
=
Update
.
class
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"培训等级id"
,
example
=
"1"
,
required
=
true
)
@NotNull
(
message
=
"培训等级id不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
Integer
gradeId
;
@ApiModelProperty
(
value
=
"培训机型id"
,
example
=
"1"
,
required
=
true
)
@NotNull
(
message
=
"培训机型id不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
Integer
modelsId
;
@ApiModelProperty
(
value
=
"培训类型id"
,
example
=
"1"
,
required
=
true
)
@NotNull
(
message
=
"培训类型id不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
Integer
typeId
;
@ApiModelProperty
(
value
=
"培训价格"
,
example
=
"1000"
,
required
=
true
)
@NotNull
(
message
=
"培训价格不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
@Range
(
min
=
0
,
max
=
100000
,
message
=
"价格不能超过100000"
)
private
Integer
price
;
@ApiModelProperty
(
value
=
"培训地点不能为空"
,
example
=
"广东省深圳市南山区XXX001"
,
required
=
true
)
@NotBlank
(
message
=
"培训地点不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
place
;
@ApiModelProperty
(
value
=
"培训主图不能为空"
,
example
=
"http://"
,
required
=
true
)
@NotBlank
(
message
=
"培训主图不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
mainImage
;
@ApiModelProperty
(
value
=
"机构id"
,
hidden
=
true
)
private
Integer
orgId
;
@Override
public
boolean
equals
(
Object
train
)
{
LicenseTrainingProgramsVO
programsVO
=
(
LicenseTrainingProgramsVO
)
train
;
if
(
this
.
gradeId
.
equals
(
programsVO
.
getGradeId
())
&&
this
.
modelsId
.
equals
(
programsVO
.
getModelsId
())
&&
this
.
typeId
.
equals
(
programsVO
.
getTypeId
()))
{
return
true
;
}
else
{
return
false
;
}
}
@Override
public
int
hashCode
()
{
return
Objects
.
hash
(
gradeId
,
modelsId
,
typeId
);
}
}
csf-common/csf-common-model/src/main/java/com/mmc/csf/release/model/group/Create.java
浏览文件 @
ac05e3ce
package
com
.
mmc
.
csf
.
release
.
model
.
group
;
import
javax.validation.groups.Default
;
/**
* @author 作者 geDuo
* @version 创建时间:2021年8月28日 下午5:37:44
* @explain 类说明
*/
public
@interface
Create
{
* @author 作者 geDuo
* @version 创建时间:2021年8月28日 下午5:37:44
* @explain 类说明
*/
public
interface
Create
extends
Default
{
}
csf-common/csf-common-model/src/main/java/com/mmc/csf/release/model/group/Update.java
浏览文件 @
ac05e3ce
package
com
.
mmc
.
csf
.
release
.
model
.
group
;
import
javax.validation.groups.Default
;
/**
* @author 作者 geDuo
* @version 创建时间:2021年8月28日 下午5:37:52
* @explain 类说明
*/
public
@interface
Update
{
* @author 作者 geDuo
* @version 创建时间:2021年8月28日 下午5:37:52
* @explain 类说明
*/
public
interface
Update
extends
Default
{
}
csf-common/csf-common-util/src/main/java/com/mmc/csf/common/util/web/ResultEnum.java
浏览文件 @
ac05e3ce
...
...
@@ -402,7 +402,9 @@ public enum ResultEnum implements BaseErrorInfoInterface {
INDUSTRY_NEWS_TITLE_EXISTS
(
"40200"
,
"文章标题存在"
),
// 论坛
DYNAMIC_SENSITIVE_INFO
(
"50100"
,
"发布内容涉及敏感信息!"
);
DYNAMIC_SENSITIVE_INFO
(
"50100"
,
"发布信息涉及敏感信息!"
),
THE_ORGANIZATION_NAME_ALREADY_EXISTS
(
"60001"
,
"机构名称已存在"
),
THREE_FIELDS_CAN_BE_REPEATED
(
"60002"
,
"机型、等级、价格存在重复"
);
/**
* 错误码
*
...
...
release-service/src/main/java/com/mmc/csf/release/controller/licence/LicenceBackgroundController.java
0 → 100644
浏览文件 @
ac05e3ce
package
com
.
mmc
.
csf
.
release
.
controller
.
licence
;
import
com.mmc.csf.common.util.web.ResultBody
;
import
com.mmc.csf.licence.dto.LicenseOrganizationsDTO
;
import
com.mmc.csf.licence.qo.LicenseOrganizationsQO
;
import
com.mmc.csf.licence.vo.LicenseOrganizationsVO
;
import
com.mmc.csf.release.controller.BaseController
;
import
com.mmc.csf.release.model.group.Create
;
import
com.mmc.csf.release.model.group.Page
;
import
com.mmc.csf.release.model.group.Update
;
import
com.mmc.csf.release.service.licence.LicenceBackgroundService
;
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/13 16:00
* @Version 1.0
*/
@Api
(
tags
=
{
"执照——后台管理"
})
@RestController
@RequestMapping
(
"/licence/background"
)
public
class
LicenceBackgroundController
extends
BaseController
{
@Autowired
private
LicenceBackgroundService
licenceBackgroundService
;
@ApiOperation
(
value
=
"机构-上传"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@PostMapping
(
"/insertOrg"
)
public
ResultBody
insertOrganizations
(
HttpServletRequest
request
,
@RequestBody
@Validated
(
value
=
{
Create
.
class
})
LicenseOrganizationsVO
organizations
)
{
return
licenceBackgroundService
.
insertOrganizations
(
organizations
,
this
.
getUserLoginInfoFromRedis
(
request
));
}
@ApiOperation
(
value
=
"机构-修改"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@PostMapping
(
"/updateOrg"
)
public
ResultBody
updateOrganizations
(
HttpServletRequest
request
,
@RequestBody
@Validated
(
value
=
{
Update
.
class
})
LicenseOrganizationsVO
organizations
)
{
return
licenceBackgroundService
.
updateOrganizations
(
organizations
,
this
.
getUserLoginInfoFromRedis
(
request
));
}
@ApiOperation
(
value
=
"机构-删除"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@GetMapping
(
"/removeOrg"
)
public
ResultBody
removeOrganizations
(
@ApiParam
(
value
=
"机构id"
,
required
=
true
)
@RequestParam
Integer
id
)
{
return
licenceBackgroundService
.
removeOrganizations
(
id
);
}
@ApiOperation
(
value
=
"机构列表-分页"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
LicenseOrganizationsDTO
.
class
)})
@PostMapping
(
"/listOrgPage"
)
public
ResultBody
<
LicenseOrganizationsDTO
>
listOrgPage
(
HttpServletRequest
request
,
@Validated
(
value
=
{
Page
.
class
})
@ApiParam
(
value
=
"角色查询QO"
,
required
=
true
)
@RequestBody
LicenseOrganizationsQO
organizationsQO
)
{
return
ResultBody
.
success
(
licenceBackgroundService
.
listOrgPage
(
organizationsQO
,
this
.
getUserLoginInfoFromRedis
(
request
)));
}
@ApiOperation
(
value
=
"app机构列表-分页"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
LicenseOrganizationsDTO
.
class
)})
@PostMapping
(
"/appListOrgPage"
)
public
ResultBody
<
LicenseOrganizationsDTO
>
appListOrgPage
(
HttpServletRequest
request
,
@Validated
(
value
=
{
Page
.
class
})
@ApiParam
(
value
=
"角色查询QO"
,
required
=
true
)
@RequestBody
LicenseOrganizationsQO
organizationsQO
)
{
return
ResultBody
.
success
(
licenceBackgroundService
.
listOrgPage
(
organizationsQO
,
this
.
getUserLoginInfoFromRedis
(
request
)));
}
@ApiOperation
(
value
=
"web机构列表-分页"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
LicenseOrganizationsDTO
.
class
)})
@PostMapping
(
"/webListOrgPage"
)
public
ResultBody
<
LicenseOrganizationsDTO
>
webListOrgPage
(
HttpServletRequest
request
,
@Validated
(
value
=
{
Page
.
class
})
@ApiParam
(
value
=
"角色查询QO"
,
required
=
true
)
@RequestBody
LicenseOrganizationsQO
organizationsQO
)
{
return
ResultBody
.
success
(
licenceBackgroundService
.
listOrgPage
(
organizationsQO
,
this
.
getUserLoginInfoFromRedis
(
request
)));
}
}
release-service/src/main/java/com/mmc/csf/release/controller/licence/LicenceCommonController.java
浏览文件 @
ac05e3ce
...
...
@@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
* @Date 2023/7/13 14:32
* @Version 1.0
*/
@Api
(
tags
=
{
"执照公共下拉列表"
})
@Api
(
tags
=
{
"执照
——
公共下拉列表"
})
@RestController
@RequestMapping
(
"/licence/pullDown"
)
public
class
LicenceCommonController
{
...
...
release-service/src/main/java/com/mmc/csf/release/dao/licence/LicenceBackgroundDao.java
0 → 100644
浏览文件 @
ac05e3ce
package
com
.
mmc
.
csf
.
release
.
dao
.
licence
;
import
com.mmc.csf.licence.qo.LicenseOrganizationsQO
;
import
com.mmc.csf.release.entity.licence.LicenseOrganizationsDO
;
import
com.mmc.csf.release.entity.licence.LicenseProgramsDO
;
import
com.mmc.csf.release.entity.licence.LicenseTrainingProgramsDO
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
/**
* @Author small
* @Date 2023/7/13 16:02
* @Version 1.0
*/
@Mapper
public
interface
LicenceBackgroundDao
{
int
countOrg
(
String
name
);
void
insertOrganizations
(
LicenseOrganizationsDO
organizationsDO
);
void
insertLicenseOrgTraining
(
List
<
Integer
>
orgTrainingIds
,
Integer
orgId
);
int
countId
(
LicenseOrganizationsDO
organizationsDO
);
void
removeOrgAndTraining
(
Integer
id
);
void
updateOrganizations
(
LicenseOrganizationsDO
organizationsDO
);
void
removeOrganizations
(
Integer
id
);
void
removeOrgTraining
(
Integer
id
);
int
countPro
(
Integer
modelsId
,
Integer
gradeId
,
Integer
typeId
,
Integer
id
);
void
insertProject
(
LicenseTrainingProgramsDO
programsDO
);
void
updateProject
(
LicenseTrainingProgramsDO
programsDO
);
void
removeProject
(
Integer
id
);
List
<
LicenseProgramsDO
>
LicenseTrainingProgramsDTO
(
Integer
id
);
int
countListOrgPage
(
LicenseOrganizationsQO
organizationsQO
);
List
<
LicenseOrganizationsDO
>
listOrgPage
(
LicenseOrganizationsQO
organizationsQO
);
List
<
LicenseProgramsDO
>
trainingProgram
(
LicenseOrganizationsQO
organizationsQO
);
int
removeOrg
(
Integer
id
);
}
release-service/src/main/java/com/mmc/csf/release/entity/licence/LicenseOrganizationsDO.java
0 → 100644
浏览文件 @
ac05e3ce
package
com
.
mmc
.
csf
.
release
.
entity
.
licence
;
import
com.mmc.csf.licence.dto.LicenseOrganizationsDTO
;
import
com.mmc.csf.licence.dto.LicenseTrainingProgramsDTO
;
import
com.mmc.csf.licence.vo.LicenseOrganizationsVO
;
import
com.mmc.csf.release.model.group.Create
;
import
com.mmc.csf.release.model.group.Update
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
/**
* @Author small
* @Date 2023/7/13 16:42
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
LicenseOrganizationsDO
{
@ApiModelProperty
(
value
=
"机构id"
,
example
=
"1"
)
@NotNull
(
message
=
"机构id"
,
groups
=
Update
.
class
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"机构主图不能为空"
,
example
=
"http://"
,
required
=
true
)
//@Size(max = 10, message = "机构主图")
@NotBlank
(
message
=
"机构主图不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
mainImage
;
@ApiModelProperty
(
value
=
"机构副图不能为空"
,
example
=
"http://"
,
required
=
true
)
@NotBlank
(
message
=
"机构副图不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
auxiliaryPicture
;
@ApiModelProperty
(
value
=
"机构视频"
,
example
=
"http://"
)
private
String
video
;
@ApiModelProperty
(
value
=
"机构名称不能为空"
,
example
=
"科比特智能教育"
,
required
=
true
)
@NotBlank
(
message
=
"机构名称不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
name
;
@ApiModelProperty
(
name
=
"机构地区"
,
example
=
"110000,110100"
)
@NotBlank
(
message
=
"机构地区不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
region
;
@ApiModelProperty
(
name
=
"机构地区名称"
,
example
=
"河北省,石家庄市"
,
required
=
true
)
@NotBlank
(
message
=
"机构地区名称"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
regionName
;
@ApiModelProperty
(
name
=
"机构详细地址"
,
example
=
"南山区"
)
@NotBlank
(
message
=
"机构详细地址不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
detailedAddress
;
@ApiModelProperty
(
name
=
"是否是考点机构"
,
example
=
"0"
,
required
=
true
)
@NotNull
(
message
=
"考点机构不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
Integer
testCenter
;
@ApiModelProperty
(
name
=
"机构规模id不能为空"
,
example
=
"1"
)
private
Integer
scaleId
;
@ApiModelProperty
(
name
=
"机构规模名称"
,
example
=
"1"
)
private
String
scaleName
;
@ApiModelProperty
(
name
=
"机构描述"
,
example
=
"机构描述0001"
)
private
String
description
;
@ApiModelProperty
(
name
=
"机构详情"
,
example
=
"机构详情0001"
)
private
String
detail
;
@ApiModelProperty
(
name
=
"机构培训项目id"
,
example
=
"1,2"
)
private
List
<
Integer
>
orgTrainingIds
;
@ApiModelProperty
(
name
=
"培训项目"
,
required
=
false
)
private
List
<
LicenseTrainingProgramsDTO
>
programsDOList
;
/**
* VO类转换
*/
public
LicenseOrganizationsDO
(
LicenseOrganizationsVO
organizationsVO
)
{
this
.
id
=
organizationsVO
.
getId
();
this
.
mainImage
=
organizationsVO
.
getMainImage
();
this
.
auxiliaryPicture
=
organizationsVO
.
getAuxiliaryPicture
();
this
.
video
=
organizationsVO
.
getVideo
();
this
.
name
=
organizationsVO
.
getName
();
this
.
region
=
organizationsVO
.
getRegion
();
this
.
testCenter
=
organizationsVO
.
getTestCenter
();
this
.
scaleId
=
organizationsVO
.
getScaleId
();
this
.
description
=
organizationsVO
.
getDescription
();
this
.
detail
=
organizationsVO
.
getDetail
();
this
.
detailedAddress
=
organizationsVO
.
getDetailedAddress
();
this
.
regionName
=
organizationsVO
.
getRegionName
();
}
/**
* DTO转换
*
* @return
*/
public
LicenseOrganizationsDTO
organizationsDTO
()
{
return
LicenseOrganizationsDTO
.
builder
()
.
id
(
this
.
id
)
.
mainImage
(
this
.
mainImage
)
.
auxiliaryPicture
(
this
.
auxiliaryPicture
)
.
video
(
this
.
video
)
.
name
(
this
.
name
)
.
region
(
this
.
region
)
.
detailedAddress
(
this
.
detailedAddress
)
.
scaleId
(
this
.
scaleId
)
.
testCenter
(
this
.
testCenter
)
.
scaleName
(
this
.
scaleName
)
.
description
(
this
.
description
)
.
detail
(
this
.
detail
)
.
programsDOList
(
this
.
programsDOList
)
.
regionName
(
this
.
regionName
)
.
build
();
}
}
release-service/src/main/java/com/mmc/csf/release/entity/licence/LicenseProgramsDO.java
0 → 100644
浏览文件 @
ac05e3ce
package
com
.
mmc
.
csf
.
release
.
entity
.
licence
;
import
com.mmc.csf.licence.dto.LicenseTrainingProgramsDTO
;
import
com.mmc.csf.release.model.group.Create
;
import
com.mmc.csf.release.model.group.Update
;
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
;
/**
* @Author small
* @Date 2023/7/14 13:37
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public
class
LicenseProgramsDO
{
private
static
final
long
serialVersionUID
=
-
5814724843819090363L
;
@ApiModelProperty
(
value
=
"培训id"
,
example
=
"1"
)
@NotNull
(
message
=
"培训id不能为空"
,
groups
=
Update
.
class
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"培训等级id"
,
example
=
"1"
,
required
=
true
)
@NotNull
(
message
=
"培训等级id不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
Integer
gradeId
;
@ApiModelProperty
(
value
=
"培训等级名称"
,
example
=
"1"
,
required
=
true
)
@NotNull
(
message
=
"培训等级名称不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
gradeName
;
@ApiModelProperty
(
value
=
"培训机型id"
,
example
=
"1"
,
required
=
true
)
@NotNull
(
message
=
"培训机型id不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
Integer
modelsId
;
@ApiModelProperty
(
value
=
"培训机型名称"
,
example
=
"1"
,
required
=
true
)
@NotNull
(
message
=
"培训机型名称不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
modelsName
;
@ApiModelProperty
(
value
=
"培训类型id"
,
example
=
"1"
,
required
=
true
)
@NotNull
(
message
=
"培训类型id不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
Integer
typeId
;
@ApiModelProperty
(
value
=
"培训类型名称"
,
example
=
"1"
,
required
=
true
)
@NotNull
(
message
=
"培训类型名称"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
typeName
;
@ApiModelProperty
(
value
=
"培训价格"
,
example
=
"1000"
,
required
=
true
)
@NotNull
(
message
=
"培训价格不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
@Size
(
min
=
0
,
max
=
100000
,
message
=
"价格不能超过100000"
)
private
Integer
price
;
@ApiModelProperty
(
value
=
"培训地点不能为空"
,
example
=
"广东省深圳市南山区XXX001"
,
required
=
true
)
@NotBlank
(
message
=
"培训地点不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
place
;
@ApiModelProperty
(
value
=
"培训主图不能为空"
,
example
=
"http://"
,
required
=
true
)
@NotBlank
(
message
=
"培训主图不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
mainImage
;
@ApiModelProperty
(
value
=
"机构id"
,
example
=
"http://"
,
required
=
true
)
@NotBlank
(
message
=
"机构id"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
Integer
orgId
;
/**
* DTO转换
*
* @return
*/
public
LicenseTrainingProgramsDTO
buildTrainingProgramsDTO
()
{
return
LicenseTrainingProgramsDTO
.
builder
().
id
(
this
.
id
)
.
gradeId
(
this
.
gradeId
)
.
gradeName
(
this
.
gradeName
)
.
modelsId
(
this
.
modelsId
)
.
modelsName
(
this
.
modelsName
)
.
typeId
(
this
.
typeId
)
.
typeName
(
this
.
typeName
)
.
price
(
this
.
price
)
.
place
(
this
.
place
)
.
mainImage
(
this
.
mainImage
)
.
orgId
(
this
.
orgId
)
.
build
();
}
}
release-service/src/main/java/com/mmc/csf/release/entity/licence/LicenseTrainingProgramsDO.java
0 → 100644
浏览文件 @
ac05e3ce
package
com
.
mmc
.
csf
.
release
.
entity
.
licence
;
import
com.mmc.csf.licence.vo.LicenseTrainingProgramsVO
;
import
com.mmc.csf.release.model.group.Create
;
import
com.mmc.csf.release.model.group.Update
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
/**
* @Author small
* @Date 2023/7/14 11:20
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
LicenseTrainingProgramsDO
{
@ApiModelProperty
(
value
=
"培训id"
,
example
=
"1"
)
@NotNull
(
message
=
"培训id不能为空"
,
groups
=
Update
.
class
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"培训等级id"
,
example
=
"1"
,
required
=
true
)
@NotNull
(
message
=
"培训等级id不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
Integer
gradeId
;
@ApiModelProperty
(
value
=
"培训机型id"
,
example
=
"1"
,
required
=
true
)
@NotNull
(
message
=
"培训机型id不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
Integer
modelsId
;
@ApiModelProperty
(
value
=
"培训类型id"
,
example
=
"1"
,
required
=
true
)
@NotNull
(
message
=
"培训类型id不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
Integer
typeId
;
@ApiModelProperty
(
value
=
"培训价格"
,
example
=
"1000"
,
required
=
true
)
@NotNull
(
message
=
"培训价格不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
Integer
price
;
@ApiModelProperty
(
value
=
"培训地点不能为空"
,
example
=
"1"
,
required
=
true
)
@NotBlank
(
message
=
"培训地点不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
place
;
@ApiModelProperty
(
value
=
"培训主图不能为空"
,
example
=
"1"
,
required
=
true
)
@NotBlank
(
message
=
"培训主图不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
mainImage
;
/**
* VO类转换
*/
public
LicenseTrainingProgramsDO
(
LicenseTrainingProgramsVO
programsVO
)
{
this
.
id
=
programsVO
.
getId
();
this
.
mainImage
=
programsVO
.
getMainImage
();
this
.
gradeId
=
programsVO
.
getGradeId
();
this
.
modelsId
=
programsVO
.
getModelsId
();
this
.
typeId
=
programsVO
.
getTypeId
();
this
.
price
=
programsVO
.
getPrice
();
this
.
place
=
programsVO
.
getPlace
();
}
}
release-service/src/main/java/com/mmc/csf/release/service/licence/LicenceBackgroundService.java
0 → 100644
浏览文件 @
ac05e3ce
package
com
.
mmc
.
csf
.
release
.
service
.
licence
;
import
com.mmc.csf.common.util.page.PageResult
;
import
com.mmc.csf.common.util.web.ResultBody
;
import
com.mmc.csf.licence.qo.LicenseOrganizationsQO
;
import
com.mmc.csf.licence.vo.LicenseOrganizationsVO
;
import
com.mmc.csf.release.auth.dto.LoginSuccessDTO
;
/**
* @Author small
* @Date 2023/7/13 16:01
* @Version 1.0
*/
public
interface
LicenceBackgroundService
{
ResultBody
insertOrganizations
(
LicenseOrganizationsVO
organizations
,
LoginSuccessDTO
userLoginInfoFromRedis
);
ResultBody
updateOrganizations
(
LicenseOrganizationsVO
organizations
,
LoginSuccessDTO
userLoginInfoFromRedis
);
ResultBody
removeOrganizations
(
Integer
id
);
PageResult
listOrgPage
(
LicenseOrganizationsQO
organizationsQO
,
LoginSuccessDTO
userLoginInfoFromRedis
);
}
release-service/src/main/java/com/mmc/csf/release/service/licence/impl/LicenceBackgroundServiceImpl.java
0 → 100644
浏览文件 @
ac05e3ce
package
com
.
mmc
.
csf
.
release
.
service
.
licence
.
impl
;
import
com.mmc.csf.common.util.page.PageResult
;
import
com.mmc.csf.common.util.web.ResultBody
;
import
com.mmc.csf.common.util.web.ResultEnum
;
import
com.mmc.csf.licence.dto.LicenseOrganizationsDTO
;
import
com.mmc.csf.licence.dto.LicenseTrainingProgramsDTO
;
import
com.mmc.csf.licence.qo.LicenseOrganizationsQO
;
import
com.mmc.csf.licence.vo.LicenseOrganizationsVO
;
import
com.mmc.csf.licence.vo.LicenseTrainingProgramsVO
;
import
com.mmc.csf.release.auth.dto.LoginSuccessDTO
;
import
com.mmc.csf.release.dao.licence.LicenceBackgroundDao
;
import
com.mmc.csf.release.entity.licence.LicenseOrganizationsDO
;
import
com.mmc.csf.release.entity.licence.LicenseProgramsDO
;
import
com.mmc.csf.release.entity.licence.LicenseTrainingProgramsDO
;
import
com.mmc.csf.release.service.licence.LicenceBackgroundService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* @Author small
* @Date 2023/7/13 16:01
* @Version 1.0
*/
@Service
@Slf4j
public
class
LicenceBackgroundServiceImpl
implements
LicenceBackgroundService
{
@Autowired
private
LicenceBackgroundDao
licenceBackgroundDao
;
@Override
public
ResultBody
insertOrganizations
(
LicenseOrganizationsVO
organizations
,
LoginSuccessDTO
userLoginInfoFromRedis
)
{
int
count
=
licenceBackgroundDao
.
countOrg
(
organizations
.
getName
());
if
(
count
>
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
THE_ORGANIZATION_NAME_ALREADY_EXISTS
);
}
LicenseOrganizationsDO
organizationsDO
=
new
LicenseOrganizationsDO
(
organizations
);
List
<
Integer
>
list
=
new
ArrayList
<>();
LicenseTrainingProgramsDO
programsDO
=
null
;
if
(
organizations
.
getTrainingProgramsVOS
()
!=
null
&&
organizations
.
getTrainingProgramsVOS
().
size
()
!=
0
)
{
HashMap
<
LicenseTrainingProgramsVO
,
Integer
>
hashMap
=
new
HashMap
<>();
for
(
LicenseTrainingProgramsVO
trainingProgramsVO
:
organizations
.
getTrainingProgramsVOS
())
{
Integer
pro
=
hashMap
.
get
(
trainingProgramsVO
);
if
(
pro
==
null
)
{
hashMap
.
put
(
trainingProgramsVO
,
1
);
programsDO
=
new
LicenseTrainingProgramsDO
(
trainingProgramsVO
);
licenceBackgroundDao
.
insertProject
(
programsDO
);
list
.
add
(
programsDO
.
getId
());
organizationsDO
.
setOrgTrainingIds
(
list
);
}
else
{
licenceBackgroundDao
.
removeProject
(
programsDO
.
getId
());
hashMap
.
put
(
trainingProgramsVO
,
pro
++);
return
ResultBody
.
error
(
ResultEnum
.
THREE_FIELDS_CAN_BE_REPEATED
);
}
}
licenceBackgroundDao
.
insertOrganizations
(
organizationsDO
);
licenceBackgroundDao
.
insertLicenseOrgTraining
(
organizationsDO
.
getOrgTrainingIds
(),
organizationsDO
.
getId
());
}
return
ResultBody
.
success
();
}
@Override
public
ResultBody
updateOrganizations
(
LicenseOrganizationsVO
organizations
,
LoginSuccessDTO
userLoginInfoFromRedis
)
{
LicenseOrganizationsDO
organizationsDO
=
new
LicenseOrganizationsDO
(
organizations
);
int
count
=
licenceBackgroundDao
.
countId
(
organizationsDO
);
if
(
count
>
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
THE_ORGANIZATION_NAME_ALREADY_EXISTS
);
}
licenceBackgroundDao
.
removeOrgAndTraining
(
organizations
.
getId
());
LicenseTrainingProgramsDO
programsDO
=
null
;
List
<
Integer
>
list
=
new
ArrayList
<>();
if
(
organizations
.
getTrainingProgramsVOS
()
!=
null
&&
organizations
.
getTrainingProgramsVOS
().
size
()
!=
0
)
{
HashMap
<
LicenseTrainingProgramsVO
,
Integer
>
hashMap
=
new
HashMap
<>();
for
(
LicenseTrainingProgramsVO
trainingProgramsVO
:
organizations
.
getTrainingProgramsVOS
())
{
Integer
pro
=
hashMap
.
get
(
trainingProgramsVO
);
if
(
pro
==
null
)
{
hashMap
.
put
(
trainingProgramsVO
,
1
);
}
else
{
hashMap
.
put
(
trainingProgramsVO
,
pro
++);
return
ResultBody
.
error
(
ResultEnum
.
THREE_FIELDS_CAN_BE_REPEATED
);
}
licenceBackgroundDao
.
removeOrganizations
(
organizations
.
getId
());
programsDO
=
new
LicenseTrainingProgramsDO
(
trainingProgramsVO
);
licenceBackgroundDao
.
insertProject
(
programsDO
);
list
.
add
(
programsDO
.
getId
());
organizationsDO
.
setOrgTrainingIds
(
list
);
}
licenceBackgroundDao
.
updateOrganizations
(
organizationsDO
);
licenceBackgroundDao
.
insertLicenseOrgTraining
(
organizationsDO
.
getOrgTrainingIds
(),
organizationsDO
.
getId
());
}
return
ResultBody
.
success
();
}
@Override
public
ResultBody
removeOrganizations
(
Integer
id
)
{
licenceBackgroundDao
.
removeOrg
(
id
);
licenceBackgroundDao
.
removeOrganizations
(
id
);
return
ResultBody
.
success
();
}
@Override
public
PageResult
listOrgPage
(
LicenseOrganizationsQO
organizationsQO
,
LoginSuccessDTO
userLoginInfoFromRedis
)
{
int
count
=
licenceBackgroundDao
.
countListOrgPage
(
organizationsQO
);
if
(
count
==
0
)
{
return
PageResult
.
buildPage
(
organizationsQO
.
getPageNo
(),
organizationsQO
.
getPageSize
(),
count
);
}
Integer
pageNo
=
organizationsQO
.
getPageNo
();
organizationsQO
.
buildCurrentPage
();
List
<
LicenseOrganizationsDO
>
licenseOrganizationsDOS
=
licenceBackgroundDao
.
listOrgPage
(
organizationsQO
);
List
<
LicenseOrganizationsDTO
>
orgList
=
licenseOrganizationsDOS
.
stream
().
map
(
t
->
t
.
organizationsDTO
()).
collect
(
Collectors
.
toList
());
//培训项目数据
List
<
LicenseProgramsDO
>
licenseProgramsDOS
=
licenceBackgroundDao
.
trainingProgram
(
organizationsQO
);
List
<
LicenseTrainingProgramsDTO
>
programsList
=
licenseProgramsDOS
.
stream
().
map
(
t
->
t
.
buildTrainingProgramsDTO
()).
collect
(
Collectors
.
toList
());
for
(
LicenseOrganizationsDTO
org
:
orgList
)
{
ArrayList
<
LicenseTrainingProgramsDTO
>
list
=
new
ArrayList
<>();
for
(
LicenseTrainingProgramsDTO
pro
:
programsList
)
{
if
(
org
.
getId
().
equals
(
pro
.
getOrgId
()))
{
list
.
add
(
pro
);
org
.
setProgramsDOList
(
list
);
}
}
}
List
<
LicenseOrganizationsDTO
>
collect
=
orgList
.
stream
().
filter
(
o
->
{
if
(
o
.
getProgramsDOList
()
==
null
)
{
return
false
;
}
return
true
;
}).
collect
(
Collectors
.
toList
());
if
(
collect
.
size
()
==
0
)
{
count
=
0
;
}
return
PageResult
.
buildPage
(
pageNo
,
organizationsQO
.
getPageSize
(),
count
,
collect
);
}
}
release-service/src/main/resources/mapper/licence/LicenceBackgroundDao.xml
0 → 100644
浏览文件 @
ac05e3ce
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论