Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
loit-build-common
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
loit-Infrastructure
loit-build-common
Commits
71159648
提交
71159648
authored
5月 22, 2023
作者:
chenshiying
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[新增] 廊坊生成大小类管理问题sql
上级
39b278fd
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
267 行增加
和
1 行删除
+267
-1
GeneratorCommandManualScript.java
...om/loit/common/langfang/GeneratorCommandManualScript.java
+145
-0
CommandManualDTO.java
...n/java/com/loit/common/langfang/dto/CommandManualDTO.java
+116
-0
README.md
...it-build-deploy-env/src/main/resources/langfang/README.md
+1
-0
bigTypeScript.ftl
...nv/src/main/resources/template/langfang/bigTypeScript.ftl
+4
-0
井盖大小类扩展20230516.xlsx
...-build-deploy-env/src/main/resources/井盖大小类扩展20230516.xlsx
+0
-0
userNames.txt
...t/loit-build-gitlab-user/src/main/resources/userNames.txt
+1
-1
没有找到文件。
loit-build-component/loit-build-deploy-env/src/main/java/com/loit/common/langfang/GeneratorCommandManualScript.java
0 → 100644
浏览文件 @
71159648
package
com
.
loit
.
common
.
langfang
;
import
com.loit.common.langfang.dto.CommandManualDTO
;
import
com.loit.common.script.dto.BackendFrontEnum
;
import
com.loit.common.script.dto.DeployInfoDataDTO
;
import
com.loit.common.utils.ListUtil
;
import
com.loit.common.utils.StringUtils
;
import
com.loit.common.utils.excel.ImportExcel
;
import
com.loit.common.utils.file.FileUtils
;
import
com.loit.common.utils.freemarker.FreeMarkerUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.http.entity.ContentType
;
import
org.springframework.mock.web.MockMultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
@Slf4j
public
class
GeneratorCommandManualScript
{
protected
static
String
root_path
=
"F:\\9Git140\\loit-build-common\\loit-build-component\\loit-build-deploy-env\\src\\main\\resources\\langfang"
;
public
static
void
main
(
String
[]
args
)
{
try
{
String
filePathStr
=
"F:\\9Git140\\loit-build-common\\loit-build-component\\loit-build-deploy-env\\src\\main\\resources\\井盖大小类扩展20230516.xlsx"
;
File
pdfFile
=
new
File
(
filePathStr
);
FileInputStream
fileInputStream
=
new
FileInputStream
(
pdfFile
);
MultipartFile
multipartFile
=
new
MockMultipartFile
(
pdfFile
.
getName
(),
pdfFile
.
getName
(),
ContentType
.
APPLICATION_OCTET_STREAM
.
toString
(),
fileInputStream
);
ImportExcel
ei
=
new
ImportExcel
(
multipartFile
,
2
,
0
);
List
<
CommandManualDTO
>
commandManualDTOList
=
ei
.
getDataList
(
CommandManualDTO
.
class
);
if
(
ListUtil
.
isEmpty
(
commandManualDTOList
))
{
return
;
}
List
<
CommandManualDTO
>
transformList
=
transform
(
commandManualDTOList
);
createBigTypeScript
(
transformList
);
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
}
}
/**
* 对excel中的数据做转换:
* 1、去除空数据
* 2、填充大类小类
* 3、填充A类B类C类处置时限一样的
* 4、
*/
private
static
List
<
CommandManualDTO
>
transform
(
List
<
CommandManualDTO
>
commandManualDTOList
)
{
String
bigTypeCode
=
null
;
String
bigTypeName
=
null
;
String
smallTypeCode
=
null
;
String
smallTypeName
=
null
;
List
<
CommandManualDTO
>
resultList
=
new
ArrayList
();
for
(
CommandManualDTO
commandManual
:
commandManualDTOList
)
{
if
(
StringUtils
.
isEmpty
(
commandManual
.
getManageProblem
()))
{
continue
;
}
if
(
StringUtils
.
isNotEmpty
(
commandManual
.
getBigTypeCode
()))
{
bigTypeCode
=
commandManual
.
getBigTypeCode
();
}
else
{
commandManual
.
setBigTypeCode
(
bigTypeCode
);
}
if
(
StringUtils
.
isNotEmpty
(
commandManual
.
getBigTypeName
()))
{
bigTypeName
=
commandManual
.
getBigTypeName
();
}
else
{
commandManual
.
setBigTypeName
(
bigTypeName
);
}
if
(
StringUtils
.
isNotEmpty
(
commandManual
.
getSmallTypeCode
()))
{
smallTypeCode
=
commandManual
.
getSmallTypeCode
();
}
else
{
commandManual
.
setSmallTypeCode
(
smallTypeCode
);
}
if
(
StringUtils
.
isNotEmpty
(
commandManual
.
getSmallTypeName
()))
{
smallTypeName
=
commandManual
.
getSmallTypeName
();
}
else
{
commandManual
.
setSmallTypeName
(
smallTypeName
);
}
resultList
.
add
(
commandManual
);
String
atype
=
commandManual
.
getAtype
();
if
(
StringUtils
.
isEmpty
(
commandManual
.
getBtype
()))
{
commandManual
.
setBtype
(
atype
);
}
if
(
StringUtils
.
isEmpty
(
commandManual
.
getCtype
()))
{
commandManual
.
setCtype
(
atype
);
}
}
return
resultList
;
}
/**
* 生成大类脚本
*
* @throws IOException
*/
private
static
void
createBigTypeScript
(
List
<
CommandManualDTO
>
commandManualList
)
{
Map
model
=
new
HashMap
();
model
.
put
(
"springProfilesActive"
,
"123"
);
String
configFilePath
=
root_path
+
"\\bigTypeScript.sql"
;
String
jobConfig
=
FreeMarkerUtils
.
process
(
"langfang"
+
"\\bigTypeScript.ftl"
,
model
);
FileUtils
.
appendNewLine
(
configFilePath
,
jobConfig
);
System
.
out
.
println
(
"test"
);
}
}
loit-build-component/loit-build-deploy-env/src/main/java/com/loit/common/langfang/dto/CommandManualDTO.java
0 → 100644
浏览文件 @
71159648
package
com
.
loit
.
common
.
langfang
.
dto
;
import
com.loit.common.utils.excel.annotation.ExcelField
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serializable
;
@ApiModel
(
value
=
"CommandManualDTO"
,
description
=
"管理手册DTO"
)
public
class
CommandManualDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
6587921299183759035L
;
@ApiModelProperty
(
value
=
"大类代码"
)
@ExcelField
(
title
=
"大类代码"
,
sort
=
1
)
private
String
bigTypeCode
;
@ApiModelProperty
(
value
=
"大类名称"
)
@ExcelField
(
title
=
"大类名称"
,
sort
=
2
)
private
String
bigTypeName
;
@ApiModelProperty
(
value
=
"小类代码"
)
@ExcelField
(
title
=
"小类代码"
,
sort
=
3
)
private
String
smallTypeCode
;
@ApiModelProperty
(
value
=
"小类代码名称"
)
@ExcelField
(
title
=
"小类代码名称"
,
sort
=
4
)
private
String
smallTypeName
;
@ApiModelProperty
(
value
=
"管理问题"
)
@ExcelField
(
title
=
"管理问题"
,
sort
=
5
)
private
String
manageProblem
;
@ApiModelProperty
(
value
=
"a类处置时限"
)
@ExcelField
(
title
=
"atype"
,
sort
=
6
)
private
String
atype
;
@ApiModelProperty
(
value
=
"b类处置时限"
)
@ExcelField
(
title
=
"btype"
,
sort
=
7
)
private
String
btype
;
@ApiModelProperty
(
value
=
"c类处置时限"
)
@ExcelField
(
title
=
"ctype"
,
sort
=
8
)
private
String
ctype
;
public
String
getBigTypeCode
()
{
return
bigTypeCode
;
}
public
void
setBigTypeCode
(
String
bigTypeCode
)
{
this
.
bigTypeCode
=
bigTypeCode
;
}
public
String
getBigTypeName
()
{
return
bigTypeName
;
}
public
void
setBigTypeName
(
String
bigTypeName
)
{
this
.
bigTypeName
=
bigTypeName
;
}
public
String
getSmallTypeCode
()
{
return
smallTypeCode
;
}
public
void
setSmallTypeCode
(
String
smallTypeCode
)
{
this
.
smallTypeCode
=
smallTypeCode
;
}
public
String
getSmallTypeName
()
{
return
smallTypeName
;
}
public
void
setSmallTypeName
(
String
smallTypeName
)
{
this
.
smallTypeName
=
smallTypeName
;
}
public
String
getManageProblem
()
{
return
manageProblem
;
}
public
void
setManageProblem
(
String
manageProblem
)
{
this
.
manageProblem
=
manageProblem
;
}
public
String
getAtype
()
{
return
atype
;
}
public
void
setAtype
(
String
atype
)
{
this
.
atype
=
atype
;
}
public
String
getBtype
()
{
return
btype
;
}
public
void
setBtype
(
String
btype
)
{
this
.
btype
=
btype
;
}
public
String
getCtype
()
{
return
ctype
;
}
public
void
setCtype
(
String
ctype
)
{
this
.
ctype
=
ctype
;
}
}
loit-build-component/loit-build-deploy-env/src/main/resources/langfang/README.md
0 → 100644
浏览文件 @
71159648
廊坊生成大小类脚本
loit-build-component/loit-build-deploy-env/src/main/resources/template/langfang/bigTypeScript.ftl
0 → 100644
浏览文件 @
71159648
spring.profiles.active=${springProfilesActive}
loit-build-component/loit-build-deploy-env/src/main/resources/井盖大小类扩展20230516.xlsx
0 → 100644
浏览文件 @
71159648
File added
loit-build-component/loit-build-gitlab-user/src/main/resources/userNames.txt
浏览文件 @
71159648
张志达
袁声培
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论