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
6c56f13b
提交
6c56f13b
authored
5月 22, 2023
作者:
chenshiying
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[新增] 廊坊生成大小类管理问题sql
上级
0d7dfbd6
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
162 行增加
和
80 行删除
+162
-80
GeneratorCommandManualScript.java
...om/loit/common/langfang/GeneratorCommandManualScript.java
+139
-75
CommandManualDTO.java
...n/java/com/loit/common/langfang/dto/CommandManualDTO.java
+15
-0
manageProblemScript.ftl
.../main/resources/template/langfang/manageProblemScript.ftl
+4
-4
manageProblem_smallTypeId_Script.ftl
...es/template/langfang/manageProblem_smallTypeId_Script.ftl
+3
-0
smallTypeScript.ftl
.../src/main/resources/template/langfang/smallTypeScript.ftl
+1
-1
井盖大小类扩展20230516.xlsx
...-build-deploy-env/src/main/resources/井盖大小类扩展20230516.xlsx
+0
-0
没有找到文件。
loit-build-component/loit-build-deploy-env/src/main/java/com/loit/common/langfang/GeneratorCommandManualScript.java
浏览文件 @
6c56f13b
...
...
@@ -24,9 +24,15 @@ import java.util.stream.Collectors;
@Slf4j
public
class
GeneratorCommandManualScript
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
GeneratorCommandManualScript
.
class
);
public
static
final
String
CASE_TYPE
=
"1"
;
//TODO 1:事件,2:部件
public
static
final
String
CASE_TYPE
=
"2"
;
//TODO 大类id 需要手动设置下,后面可以改成查询数据库
public
static
final
String
BIG_TYPE_ID
=
"344"
;
protected
static
String
root_path
=
"F:\\9Git140\\loit-build-common\\loit-build-component\\loit-build-deploy-env\\src\\main\\resources\\langfang"
;
...
...
@@ -55,82 +61,13 @@ public class GeneratorCommandManualScript {
createSmallTypeScript
(
transformList
);
createManageProblemScript
(
transformList
);
createManageProblemSmallTypeScript
(
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
);
}
String
atype
=
commandManual
.
getAtype
();
if
(
StringUtils
.
isEmpty
(
commandManual
.
getBtype
()))
{
commandManual
.
setBtype
(
atype
);
}
if
(
StringUtils
.
isEmpty
(
commandManual
.
getCtype
()))
{
commandManual
.
setCtype
(
atype
);
}
commandManual
.
setBigAndSmallCode
(
commandManual
.
getBigTypeCode
()
+
"|"
+
commandManual
.
getSmallTypeCode
());
commandManual
.
setBigTypeCodeInt
(
Integer
.
valueOf
(
commandManual
.
getBigTypeCode
()));
commandManual
.
setSmallTypeCodeInt
(
Integer
.
valueOf
(
commandManual
.
getSmallTypeCode
()));
resultList
.
add
(
commandManual
);
}
return
resultList
;
}
/**
* 生成大类脚本
...
...
@@ -151,13 +88,21 @@ public class GeneratorCommandManualScript {
for
(
CommandManualDTO
commandManualDTO
:
bitTypeList
)
{
String
sql1
=
"select * from base_base_casetype order by parent_id asc;\n"
;
String
sql2
=
"select * from base_base_casetype where obj_name = '"
+
commandManualDTO
.
getBigTypeName
()
+
"';\n"
;
Map
model
=
new
HashMap
();
model
.
put
(
"bigTypeCode"
,
commandManualDTO
.
getBigTypeCode
());
model
.
put
(
"bigTypeName"
,
commandManualDTO
.
getBigTypeName
());
model
.
put
(
"caseType"
,
CASE_TYPE
);
String
configFilePath
=
root_path
+
"\\bigTypeScript.sql"
;
String
configFilePath
=
root_path
+
"\\1、bigTypeScript.sql"
;
String
jobConfig
=
FreeMarkerUtils
.
process
(
"langfang"
+
"\\bigTypeScript.ftl"
,
model
);
FileUtils
.
append
(
configFilePath
,
sql1
);
FileUtils
.
append
(
configFilePath
,
sql2
);
FileUtils
.
append
(
configFilePath
,
jobConfig
);
}
}
...
...
@@ -181,8 +126,15 @@ public class GeneratorCommandManualScript {
smallTypeList
.
sort
(
Comparator
.
comparing
(
CommandManualDTO:
:
getBigTypeCodeInt
)
.
thenComparing
(
CommandManualDTO:
:
getSmallTypeCodeInt
));
String
configFilePath
=
root_path
+
"\\2、smallTypeScript.sql"
;
CommandManualDTO
commandManual
=
smallTypeList
.
get
(
0
);
String
sql
=
"select * from base_base_casetype where parent_id = '"
+
commandManual
.
getBigTypeCode
()
+
"';\n"
;
FileUtils
.
append
(
configFilePath
,
sql
);
for
(
CommandManualDTO
commandManualDTO
:
smallTypeList
)
{
Map
model
=
new
HashMap
();
model
.
put
(
"bigTypeId"
,
commandManualDTO
.
getBigTypeId
());
model
.
put
(
"bigTypeCode"
,
commandManualDTO
.
getBigTypeCode
());
model
.
put
(
"bigTypeName"
,
commandManualDTO
.
getBigTypeName
());
model
.
put
(
"smallTypeCode"
,
commandManualDTO
.
getSmallTypeCode
());
...
...
@@ -190,7 +142,7 @@ public class GeneratorCommandManualScript {
model
.
put
(
"caseType"
,
CASE_TYPE
);
String
configFilePath
=
root_path
+
"\\smallTypeScript.sql"
;
String
jobConfig
=
FreeMarkerUtils
.
process
(
"langfang"
+
"\\smallTypeScript.ftl"
,
model
);
FileUtils
.
append
(
configFilePath
,
jobConfig
);
}
...
...
@@ -213,6 +165,7 @@ public class GeneratorCommandManualScript {
for
(
CommandManualDTO
commandManualDTO
:
commandManualList
)
{
Map
model
=
new
HashMap
();
model
.
put
(
"bigTypeId"
,
commandManualDTO
.
getBigTypeId
());
model
.
put
(
"bigTypeCode"
,
commandManualDTO
.
getBigTypeCode
());
model
.
put
(
"bigTypeName"
,
commandManualDTO
.
getBigTypeName
());
model
.
put
(
"smallTypeCode"
,
commandManualDTO
.
getSmallTypeCode
());
...
...
@@ -234,13 +187,44 @@ public class GeneratorCommandManualScript {
model
.
put
(
"climit"
,
climitUnit
.
getLimit
());
model
.
put
(
"cunit"
,
climitUnit
.
getUnit
());
String
configFilePath
=
root_path
+
"\\manageProblemScript.sql"
;
String
configFilePath
=
root_path
+
"\\
3、
manageProblemScript.sql"
;
String
jobConfig
=
FreeMarkerUtils
.
process
(
"langfang"
+
"\\manageProblemScript.ftl"
,
model
);
FileUtils
.
append
(
configFilePath
,
jobConfig
);
}
}
/**
* 生成管理问题脚本-清洗小类id
*
* @throws IOException
*/
private
static
void
createManageProblemSmallTypeScript
(
List
<
CommandManualDTO
>
commandManualList
)
{
if
(
commandManualList
==
null
||
commandManualList
.
isEmpty
())
{
return
;
}
for
(
CommandManualDTO
commandManualDTO
:
commandManualList
)
{
Map
model
=
new
HashMap
();
model
.
put
(
"bigTypeId"
,
commandManualDTO
.
getBigTypeId
());
model
.
put
(
"bigTypeCode"
,
commandManualDTO
.
getBigTypeCode
());
model
.
put
(
"bigTypeName"
,
commandManualDTO
.
getBigTypeName
());
model
.
put
(
"smallTypeCode"
,
commandManualDTO
.
getSmallTypeCode
());
model
.
put
(
"smallTypeName"
,
commandManualDTO
.
getSmallTypeName
());
model
.
put
(
"manageProblem"
,
commandManualDTO
.
getManageProblem
());
String
configFilePath
=
root_path
+
"\\4、manageProblem_smallTypeId_Script.sql"
;
String
jobConfig
=
FreeMarkerUtils
.
process
(
"langfang"
+
"\\manageProblem_smallTypeId_Script.ftl"
,
model
);
FileUtils
.
append
(
configFilePath
,
jobConfig
);
}
}
private
static
LimitUnitType
getLimitUnit
(
String
limitStr
)
{
LimitUnitType
limitUnitType
=
new
LimitUnitType
();
...
...
@@ -270,4 +254,84 @@ public class GeneratorCommandManualScript {
return
limitUnitType
;
}
/**
* 对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
);
}
String
atype
=
commandManual
.
getAtype
();
if
(
StringUtils
.
isEmpty
(
commandManual
.
getBtype
()))
{
commandManual
.
setBtype
(
atype
);
}
if
(
StringUtils
.
isEmpty
(
commandManual
.
getCtype
()))
{
commandManual
.
setCtype
(
atype
);
}
commandManual
.
setBigAndSmallCode
(
commandManual
.
getBigTypeCode
()
+
"|"
+
commandManual
.
getSmallTypeCode
());
commandManual
.
setBigTypeCodeInt
(
Integer
.
valueOf
(
commandManual
.
getBigTypeCode
()));
commandManual
.
setSmallTypeCodeInt
(
Integer
.
valueOf
(
commandManual
.
getSmallTypeCode
()));
//TODO 查询从数据库查询
commandManual
.
setBigTypeId
(
BIG_TYPE_ID
);
resultList
.
add
(
commandManual
);
}
return
resultList
;
}
}
loit-build-component/loit-build-deploy-env/src/main/java/com/loit/common/langfang/dto/CommandManualDTO.java
浏览文件 @
6c56f13b
...
...
@@ -12,6 +12,13 @@ public class CommandManualDTO implements Serializable {
private
static
final
long
serialVersionUID
=
-
6587921299183759035L
;
/**
* 大类ID
*/
private
String
bigTypeId
;
@ApiModelProperty
(
value
=
"大类代码"
)
@ExcelField
(
title
=
"大类代码"
,
sort
=
1
)
private
String
bigTypeCode
;
...
...
@@ -66,6 +73,14 @@ public class CommandManualDTO implements Serializable {
private
String
bigAndSmallCode
;
public
String
getBigTypeId
()
{
return
bigTypeId
;
}
public
void
setBigTypeId
(
String
bigTypeId
)
{
this
.
bigTypeId
=
bigTypeId
;
}
public
String
getBigTypeCode
()
{
return
bigTypeCode
;
}
...
...
loit-build-component/loit-build-deploy-env/src/main/resources/template/langfang/manageProblemScript.ftl
浏览文件 @
6c56f13b
...
...
@@ -42,15 +42,15 @@ INSERT INTO `digital_command_manual`(
`update_time`
)
VALUES (
'
1
',
'
${caseType}
',
NULL,
NULL,
'${bigTypeName}', -- 你的大类
'${bigType
Code
}', -- 大类的编码
'${bigType
Id
}', -- 大类的编码
'${smallTypeName}', -- 你的小类
'${smallTypeCode}', -- 小类的编码
NULL, -- 小类的编码 先设置为null 后面用脚本刷小类id
NULL,
'
施工过程中或者施工堆料未采取有效防尘措施造成扬尘现象
', -- 管理问题
'
${manageProblem}
', -- 管理问题
${alimit}, -- A 类处置时限
${aunit}, -- 0:工作日,1:工作时, 2:紧急工作时
${blimit}, -- B 类处置时限
...
...
loit-build-component/loit-build-deploy-env/src/main/resources/template/langfang/manageProblem_smallTypeId_Script.ftl
0 → 100644
浏览文件 @
6c56f13b
update digital_command_manual
set small_type_id = (select casetype.id from base_base_casetype casetype where casetype.parent_id = '${bigTypeId}' and obj_name= '${smallTypeName}')
where big_type = '${bigTypeName}' and small_type = '${smallTypeName}' and manage_problem = '${manageProblem}';
loit-build-component/loit-build-deploy-env/src/main/resources/template/langfang/smallTypeScript.ftl
浏览文件 @
6c56f13b
...
...
@@ -25,7 +25,7 @@ INSERT INTO `base_base_casetype`(
VALUES (
'${smallTypeCode}', -- 小类编码,自己取一个
'${smallTypeName}', -- 修改你的小类
'${bigType
Code
}', -- 大类的 id
'${bigType
Id
}', -- 大类的 id
'',
'',
'',
...
...
loit-build-component/loit-build-deploy-env/src/main/resources/井盖大小类扩展20230516.xlsx
浏览文件 @
6c56f13b
No preview for this file type
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论