Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
I
ims-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
ims-ci-test
Commits
d4b0c802
提交
d4b0c802
authored
7月 18, 2023
作者:
张小凤
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
LicenseBack(update)
上级
ecacc871
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
30 行增加
和
95 行删除
+30
-95
LicenceBackgroundDao.java
...com/mmc/csf/release/dao/licence/LicenceBackgroundDao.java
+0
-9
LicenseTrainingProgramsDO.java
...csf/release/entity/licence/LicenseTrainingProgramsDO.java
+3
-0
LicenceBackgroundServiceImpl.java
...se/service/licence/impl/LicenceBackgroundServiceImpl.java
+11
-6
LicenceBackgroundDao.xml
...rc/main/resources/mapper/licence/LicenceBackgroundDao.xml
+16
-80
没有找到文件。
release-service/src/main/java/com/mmc/csf/release/dao/licence/LicenceBackgroundDao.java
浏览文件 @
d4b0c802
...
@@ -19,19 +19,12 @@ public interface LicenceBackgroundDao {
...
@@ -19,19 +19,12 @@ public interface LicenceBackgroundDao {
void
insertOrganizations
(
LicenseOrganizationsDO
organizationsDO
);
void
insertOrganizations
(
LicenseOrganizationsDO
organizationsDO
);
void
insertLicenseOrgTraining
(
List
<
Integer
>
orgTrainingIds
,
Integer
orgId
);
int
countId
(
LicenseOrganizationsDO
organizationsDO
);
int
countId
(
LicenseOrganizationsDO
organizationsDO
);
void
removeOrgAndTraining
(
Integer
id
);
void
removeOrgAndTraining
(
Integer
id
);
void
updateOrganizations
(
LicenseOrganizationsDO
organizationsDO
);
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
insertProject
(
LicenseTrainingProgramsDO
programsDO
);
...
@@ -39,8 +32,6 @@ public interface LicenceBackgroundDao {
...
@@ -39,8 +32,6 @@ public interface LicenceBackgroundDao {
void
removeProject
(
Integer
id
);
void
removeProject
(
Integer
id
);
List
<
LicenseProgramsDO
>
LicenseTrainingProgramsDTO
(
Integer
id
);
int
countListOrgPage
(
LicenseOrganizationsQO
organizationsQO
);
int
countListOrgPage
(
LicenseOrganizationsQO
organizationsQO
);
List
<
LicenseOrganizationsDO
>
listOrgPage
(
LicenseOrganizationsQO
organizationsQO
);
List
<
LicenseOrganizationsDO
>
listOrgPage
(
LicenseOrganizationsQO
organizationsQO
);
...
...
release-service/src/main/java/com/mmc/csf/release/entity/licence/LicenseTrainingProgramsDO.java
浏览文件 @
d4b0c802
...
@@ -51,6 +51,9 @@ public class LicenseTrainingProgramsDO {
...
@@ -51,6 +51,9 @@ public class LicenseTrainingProgramsDO {
@NotBlank
(
message
=
"培训主图不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
@NotBlank
(
message
=
"培训主图不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
mainImage
;
private
String
mainImage
;
@ApiModelProperty
(
value
=
"机构id"
,
example
=
"1"
,
required
=
true
)
private
Integer
orgId
;
/**
/**
* VO类转换
* VO类转换
...
...
release-service/src/main/java/com/mmc/csf/release/service/licence/impl/LicenceBackgroundServiceImpl.java
浏览文件 @
d4b0c802
...
@@ -49,22 +49,25 @@ public class LicenceBackgroundServiceImpl implements LicenceBackgroundService {
...
@@ -49,22 +49,25 @@ public class LicenceBackgroundServiceImpl implements LicenceBackgroundService {
LicenseTrainingProgramsDO
programsDO
=
null
;
LicenseTrainingProgramsDO
programsDO
=
null
;
if
(
organizations
.
getTrainingProgramsVOS
()
!=
null
&&
organizations
.
getTrainingProgramsVOS
().
size
()
!=
0
)
{
if
(
organizations
.
getTrainingProgramsVOS
()
!=
null
&&
organizations
.
getTrainingProgramsVOS
().
size
()
!=
0
)
{
HashMap
<
LicenseTrainingProgramsVO
,
Integer
>
hashMap
=
new
HashMap
<>();
HashMap
<
LicenseTrainingProgramsVO
,
Integer
>
hashMap
=
new
HashMap
<>();
licenceBackgroundDao
.
insertOrganizations
(
organizationsDO
);
for
(
LicenseTrainingProgramsVO
trainingProgramsVO
:
organizations
.
getTrainingProgramsVOS
())
{
for
(
LicenseTrainingProgramsVO
trainingProgramsVO
:
organizations
.
getTrainingProgramsVOS
())
{
Integer
pro
=
hashMap
.
get
(
trainingProgramsVO
);
Integer
pro
=
hashMap
.
get
(
trainingProgramsVO
);
if
(
pro
==
null
)
{
if
(
pro
==
null
)
{
hashMap
.
put
(
trainingProgramsVO
,
1
);
hashMap
.
put
(
trainingProgramsVO
,
1
);
programsDO
=
new
LicenseTrainingProgramsDO
(
trainingProgramsVO
);
programsDO
=
new
LicenseTrainingProgramsDO
(
trainingProgramsVO
);
Integer
id
=
organizationsDO
.
getId
();
programsDO
.
setOrgId
(
id
);
licenceBackgroundDao
.
insertProject
(
programsDO
);
licenceBackgroundDao
.
insertProject
(
programsDO
);
list
.
add
(
programsDO
.
getId
());
list
.
add
(
programsDO
.
getId
());
organizationsDO
.
setOrgTrainingIds
(
list
);
organizationsDO
.
setOrgTrainingIds
(
list
);
}
else
{
}
else
{
licenceBackgroundDao
.
removeProject
(
programsDO
.
getId
());
licenceBackgroundDao
.
removeProject
(
programsDO
.
getId
());
licenceBackgroundDao
.
removeOrg
(
organizationsDO
.
getId
());
hashMap
.
put
(
trainingProgramsVO
,
pro
++);
hashMap
.
put
(
trainingProgramsVO
,
pro
++);
return
ResultBody
.
error
(
ResultEnum
.
THREE_FIELDS_CAN_BE_REPEATED
);
return
ResultBody
.
error
(
ResultEnum
.
THREE_FIELDS_CAN_BE_REPEATED
);
}
}
}
}
licenceBackgroundDao
.
insertOrganizations
(
organizationsDO
);
// licenceBackgroundDao.insertLicenseOrgTraining(organizationsDO.getOrgTrainingIds(), organizationsDO.getId());
licenceBackgroundDao
.
insertLicenseOrgTraining
(
organizationsDO
.
getOrgTrainingIds
(),
organizationsDO
.
getId
());
}
}
return
ResultBody
.
success
();
return
ResultBody
.
success
();
}
}
...
@@ -91,15 +94,17 @@ public class LicenceBackgroundServiceImpl implements LicenceBackgroundService {
...
@@ -91,15 +94,17 @@ public class LicenceBackgroundServiceImpl implements LicenceBackgroundService {
hashMap
.
put
(
trainingProgramsVO
,
pro
++);
hashMap
.
put
(
trainingProgramsVO
,
pro
++);
return
ResultBody
.
error
(
ResultEnum
.
THREE_FIELDS_CAN_BE_REPEATED
);
return
ResultBody
.
error
(
ResultEnum
.
THREE_FIELDS_CAN_BE_REPEATED
);
}
}
licenceBackgroundDao
.
removeOrganizations
(
organizations
.
getId
());
//
licenceBackgroundDao.removeOrganizations(organizations.getId());
programsDO
=
new
LicenseTrainingProgramsDO
(
trainingProgramsVO
);
programsDO
=
new
LicenseTrainingProgramsDO
(
trainingProgramsVO
);
Integer
id
=
organizations
.
getId
();
programsDO
.
setOrgId
(
id
);
licenceBackgroundDao
.
insertProject
(
programsDO
);
licenceBackgroundDao
.
insertProject
(
programsDO
);
list
.
add
(
programsDO
.
getId
());
list
.
add
(
programsDO
.
getId
());
organizationsDO
.
setOrgTrainingIds
(
list
);
organizationsDO
.
setOrgTrainingIds
(
list
);
}
}
licenceBackgroundDao
.
updateOrganizations
(
organizationsDO
);
licenceBackgroundDao
.
updateOrganizations
(
organizationsDO
);
licenceBackgroundDao
.
insertLicenseOrgTraining
(
organizationsDO
.
getOrgTrainingIds
(),
organizationsDO
.
getId
());
//
licenceBackgroundDao.insertLicenseOrgTraining(organizationsDO.getOrgTrainingIds(), organizationsDO.getId());
}
}
return
ResultBody
.
success
();
return
ResultBody
.
success
();
}
}
...
@@ -116,7 +121,7 @@ public class LicenceBackgroundServiceImpl implements LicenceBackgroundService {
...
@@ -116,7 +121,7 @@ public class LicenceBackgroundServiceImpl implements LicenceBackgroundService {
@Override
@Override
public
ResultBody
removeOrganizations
(
Integer
id
)
{
public
ResultBody
removeOrganizations
(
Integer
id
)
{
licenceBackgroundDao
.
removeOrg
(
id
);
licenceBackgroundDao
.
removeOrg
(
id
);
licenceBackgroundDao
.
removeOrg
anizations
(
id
);
licenceBackgroundDao
.
removeOrg
AndTraining
(
id
);
return
ResultBody
.
success
();
return
ResultBody
.
success
();
}
}
...
@@ -148,7 +153,7 @@ public class LicenceBackgroundServiceImpl implements LicenceBackgroundService {
...
@@ -148,7 +153,7 @@ public class LicenceBackgroundServiceImpl implements LicenceBackgroundService {
}
}
return
true
;
return
true
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
List
<
LicenseOrganizationsDTO
>
subList
=
collect
.
stream
().
skip
((
pageNo
-
1
)
*
organizationsQO
.
getPageSize
()).
limit
(
organizationsQO
.
getPageSize
()).
List
<
LicenseOrganizationsDTO
>
subList
=
collect
.
stream
().
skip
((
pageNo
-
1
)
*
organizationsQO
.
getPageSize
()).
limit
(
organizationsQO
.
getPageSize
()).
collect
(
Collectors
.
toList
());
collect
(
Collectors
.
toList
());
...
...
release-service/src/main/resources/mapper/licence/LicenceBackgroundDao.xml
浏览文件 @
d4b0c802
...
@@ -26,13 +26,7 @@
...
@@ -26,13 +26,7 @@
#{description}, #{detail}, NOW(), NOW(), #{longitude}, #{latitude})
#{description}, #{detail}, NOW(), NOW(), #{longitude}, #{latitude})
</insert>
</insert>
<insert
id=
"insertLicenseOrgTraining"
>
insert into license_org_training(training_programs_id,organizations_id) values
<foreach
item=
"list"
index=
"index"
collection=
"orgTrainingIds"
separator=
","
>
(#{list},#{orgId})
</foreach>
</insert>
<select
id=
"countId"
resultType=
"java.lang.Integer"
>
<select
id=
"countId"
resultType=
"java.lang.Integer"
>
select count(*)
select count(*)
...
@@ -47,15 +41,9 @@
...
@@ -47,15 +41,9 @@
</select>
</select>
<delete
id=
"removeOrgAndTraining"
parameterType=
"java.lang.Integer"
>
<delete
id=
"removeOrgAndTraining"
parameterType=
"java.lang.Integer"
>
DELETE
delete
license_org_training,
from license_training_programs
license_training_programs
where org_id = #{id}
FROM
license_org_training
LEFT JOIN license_training_programs ON license_org_training.training_programs_id = license_training_programs.id
WHERE
license_org_training.organizations_id =
#{id}
</delete>
</delete>
<update
id=
"updateOrganizations"
parameterType=
"com.mmc.csf.release.entity.licence.LicenseOrganizationsDO"
>
<update
id=
"updateOrganizations"
parameterType=
"com.mmc.csf.release.entity.licence.LicenseOrganizationsDO"
>
...
@@ -105,53 +93,18 @@
...
@@ -105,53 +93,18 @@
where id = #{id}
where id = #{id}
</update>
</update>
<delete
id=
"removeOrganizations"
parameterType=
"java.lang.Integer"
>
DELETE
license_org_training,
license_training_programs
FROM
license_org_training
LEFT JOIN license_training_programs ON license_org_training.training_programs_id = license_training_programs.id
WHERE
license_org_training.organizations_id =
#{id}
</delete>
<delete
id=
"removeOrgTraining"
parameterType=
"java.lang.Integer"
>
delete
from license_org_training
where organizations_id = #{id}
</delete>
<select
id=
"countPro"
resultType=
"java.lang.Integer"
>
SELECT
count(*)
FROM
license_training_programs ltp
LEFT JOIN license_org_training lot ON ltp.id = lot.training_programs_id
LEFT JOIN license_organizations lo ON lo.id = lot.organizations_id
WHERE
1 =1
<if
test=
" modelsId != null and modelsId != '' "
>
and ltp.models_id = #{modelsId}
</if>
<if
test=
" gradeId != null and gradeId != '' "
>
and ltp.grade_id = #{gradeId}
</if>
<if
test=
" typeId != null and typeId != '' "
>
and ltp.type_id = #{typeId}
</if>
<if
test=
" id != null and id != '' "
>
and lot.organizations_id = #{id}
</if>
</select>
<insert
id=
"insertProject"
useGeneratedKeys=
"true"
keyProperty=
"id"
<insert
id=
"insertProject"
useGeneratedKeys=
"true"
keyProperty=
"id"
parameterType=
"com.mmc.csf.release.entity.licence.LicenseOrganizationsDO"
>
parameterType=
"com.mmc.csf.release.entity.licence.LicenseOrganizationsDO"
>
insert into license_training_programs(grade_id, models_id, type_id, price, place, main_image, create_time,
insert into license_training_programs(grade_id, models_id, type_id, price, place, main_image, create_time,
update_time)
update_time
,org_id
)
values (#{gradeId}, #{modelsId}, #{typeId}, #{price}, #{place}, #{mainImage}, NOW(), NOW())
values (#{gradeId}, #{modelsId}, #{typeId}, #{price}, #{place}, #{mainImage}, NOW(), NOW()
,#{orgId}
)
</insert>
</insert>
<update
id=
"updateProject"
parameterType=
"com.mmc.csf.release.entity.licence.LicenseTrainingProgramsDO"
>
<update
id=
"updateProject"
parameterType=
"com.mmc.csf.release.entity.licence.LicenseTrainingProgramsDO"
>
...
@@ -200,25 +153,6 @@
...
@@ -200,25 +153,6 @@
</foreach>
</foreach>
</select>
</select>
<select
id=
"LicenseTrainingProgramsDTO"
resultType=
"com.mmc.csf.release.entity.licence.LicenseProgramsDO"
>
SELECT ltp.id,
ltp.grade_id AS gradeId,
lg.`name` AS gradeName,
ltp.models_id AS modelsId,
lm.`name` AS modelsName,
ltp.type_id AS typeId,
lt.`name` AS typeName,
ltp.price,
ltp.place,
ltp.main_image AS mainImage
FROM license_training_programs ltp
INNER JOIN licence_type lt ON ltp.type_id = lt.id
INNER JOIN licence_grade lg ON ltp.grade_id = lg.id
INNER JOIN licence_models lm ON ltp.models_id = lm.id
INNER JOIN license_org_training lot ON lot.training_programs_id = ltp.id
WHERE lot.organizations_id = #{id}
</select>
<select
id=
"countListOrgPage"
resultType=
"int"
>
<select
id=
"countListOrgPage"
resultType=
"int"
>
select count(*)
select count(*)
...
@@ -279,7 +213,8 @@
...
@@ -279,7 +213,8 @@
</select>
</select>
<select
id=
"trainingProgram"
resultType=
"com.mmc.csf.release.entity.licence.LicenseProgramsDO"
>
<select
id=
"trainingProgram"
resultType=
"com.mmc.csf.release.entity.licence.LicenseProgramsDO"
>
SELECT DISTINCT ltp.id,
SELECT DISTINCT
ltp.id,
ltp.grade_id AS gradeId,
ltp.grade_id AS gradeId,
lg.`name` AS gradeName,
lg.`name` AS gradeName,
ltp.models_id AS modelsId,
ltp.models_id AS modelsId,
...
@@ -289,13 +224,14 @@
...
@@ -289,13 +224,14 @@
ltp.price,
ltp.price,
ltp.place,
ltp.place,
ltp.main_image AS mainImage,
ltp.main_image AS mainImage,
lot.organizations_id AS orgId
ltp.org_id AS orgId
FROM license_training_programs ltp
FROM
license_training_programs ltp
LEFT JOIN licence_grade lg ON ltp.grade_id = lg.id
LEFT JOIN licence_grade lg ON ltp.grade_id = lg.id
LEFT JOIN licence_models lm ON ltp.models_id = lm.id
LEFT JOIN licence_models lm ON ltp.models_id = lm.id
LEFT JOIN licence_type lt ON ltp.type_id = lt.id
LEFT JOIN licence_type lt ON ltp.type_id = lt.id
LEFT JOIN license_org_training lot ON ltp.id = lot.training_programs_id
WHERE
where 1
=1
1
=1
<if
test=
" modelsId != null and modelsId != '' "
>
<if
test=
" modelsId != null and modelsId != '' "
>
and ltp.models_id =#{modelsId}
and ltp.models_id =#{modelsId}
</if>
</if>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论