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
0d7dfbd6
提交
0d7dfbd6
authored
5月 22, 2023
作者:
chenshiying
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[新增] 廊坊生成大小类管理问题sql
上级
b406ce95
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
207 行增加
和
5 行删除
+207
-5
GeneratorCommandManualScript.java
...om/loit/common/langfang/GeneratorCommandManualScript.java
+85
-3
LimitUnitType.java
...main/java/com/loit/common/langfang/dto/LimitUnitType.java
+28
-0
bigTypeScript.ftl
...nv/src/main/resources/template/langfang/bigTypeScript.ftl
+1
-0
manageProblemScript.ftl
.../main/resources/template/langfang/manageProblemScript.ftl
+90
-0
smallTypeScript.ftl
.../src/main/resources/template/langfang/smallTypeScript.ftl
+3
-2
没有找到文件。
loit-build-component/loit-build-deploy-env/src/main/java/com/loit/common/langfang/GeneratorCommandManualScript.java
浏览文件 @
0d7dfbd6
package
com
.
loit
.
common
.
langfang
;
import
com.loit.common.langfang.dto.CommandManualDTO
;
import
com.loit.common.langfang.dto.LimitUnitType
;
import
com.loit.common.utils.DateUtils
;
import
com.loit.common.utils.ListUtil
;
import
com.loit.common.utils.StringUtils
;
import
com.loit.common.utils.excel.ImportExcel
;
...
...
@@ -8,6 +10,8 @@ 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.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.mock.web.MockMultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
...
...
@@ -20,6 +24,8 @@ import java.util.stream.Collectors;
@Slf4j
public
class
GeneratorCommandManualScript
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
GeneratorCommandManualScript
.
class
);
public
static
final
String
CASE_TYPE
=
"1"
;
protected
static
String
root_path
=
"F:\\9Git140\\loit-build-common\\loit-build-component\\loit-build-deploy-env\\src\\main\\resources\\langfang"
;
...
...
@@ -48,7 +54,7 @@ public class GeneratorCommandManualScript {
createSmallTypeScript
(
transformList
);
createManageProblemScript
(
transformList
);
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
}
...
...
@@ -112,8 +118,7 @@ public class GeneratorCommandManualScript {
commandManual
.
setCtype
(
atype
);
}
commandManual
.
setBigAndSmallCode
(
commandManual
.
getBigTypeCode
()
+
"|"
+
commandManual
.
getSmallTypeCode
());
commandManual
.
setBigAndSmallCode
(
commandManual
.
getBigTypeCode
()
+
"|"
+
commandManual
.
getSmallTypeCode
());
commandManual
.
setBigTypeCodeInt
(
Integer
.
valueOf
(
commandManual
.
getBigTypeCode
()));
...
...
@@ -142,6 +147,9 @@ public class GeneratorCommandManualScript {
return
;
}
bitTypeList
.
sort
(
Comparator
.
comparing
(
CommandManualDTO:
:
getBigTypeCodeInt
));
for
(
CommandManualDTO
commandManualDTO
:
bitTypeList
)
{
Map
model
=
new
HashMap
();
model
.
put
(
"bigTypeCode"
,
commandManualDTO
.
getBigTypeCode
());
...
...
@@ -188,4 +196,78 @@ public class GeneratorCommandManualScript {
}
}
/**
* 生成管理问题脚本
*
* @throws IOException
*/
private
static
void
createManageProblemScript
(
List
<
CommandManualDTO
>
commandManualList
)
{
if
(
commandManualList
==
null
||
commandManualList
.
isEmpty
())
{
return
;
}
for
(
CommandManualDTO
commandManualDTO
:
commandManualList
)
{
Map
model
=
new
HashMap
();
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
());
model
.
put
(
"datetime"
,
DateUtils
.
getDateTime
());
model
.
put
(
"caseType"
,
CASE_TYPE
);
LimitUnitType
alimitUnit
=
getLimitUnit
(
commandManualDTO
.
getAtype
());
LimitUnitType
blimitUnit
=
getLimitUnit
(
commandManualDTO
.
getBtype
());
LimitUnitType
climitUnit
=
getLimitUnit
(
commandManualDTO
.
getCtype
());
model
.
put
(
"alimit"
,
alimitUnit
.
getLimit
());
model
.
put
(
"aunit"
,
alimitUnit
.
getUnit
());
model
.
put
(
"blimit"
,
blimitUnit
.
getLimit
());
model
.
put
(
"bunit"
,
blimitUnit
.
getUnit
());
model
.
put
(
"climit"
,
climitUnit
.
getLimit
());
model
.
put
(
"cunit"
,
climitUnit
.
getUnit
());
String
configFilePath
=
root_path
+
"\\manageProblemScript.sql"
;
String
jobConfig
=
FreeMarkerUtils
.
process
(
"langfang"
+
"\\manageProblemScript.ftl"
,
model
);
FileUtils
.
append
(
configFilePath
,
jobConfig
);
}
}
private
static
LimitUnitType
getLimitUnit
(
String
limitStr
)
{
LimitUnitType
limitUnitType
=
new
LimitUnitType
();
if
(
StringUtils
.
isEmpty
(
limitStr
))
{
logger
.
error
(
"limitStr is null"
);
return
limitUnitType
;
}
limitStr
=
limitStr
.
trim
();
//0:工作日,1:工作时, 2:紧急工作时
if
(
limitStr
.
contains
(
"工作日"
))
{
limitUnitType
.
setUnit
(
"0"
);
limitUnitType
.
setLimit
(
limitStr
.
replaceAll
(
"工作日"
,
""
).
trim
());
}
else
if
(
limitStr
.
contains
(
"紧急工作时"
))
{
limitUnitType
.
setUnit
(
"2"
);
limitUnitType
.
setLimit
(
limitStr
.
replaceAll
(
"紧急工作时"
,
""
).
trim
());
}
else
if
(
limitStr
.
contains
(
"工作时"
))
{
limitUnitType
.
setUnit
(
"1"
);
limitUnitType
.
setLimit
(
limitStr
.
replaceAll
(
"工作时"
,
""
).
trim
());
}
if
(
limitUnitType
.
getLimit
().
length
()
>
1
)
{
logger
.
error
(
"limit length > 1"
+
limitUnitType
.
getLimit
());
}
return
limitUnitType
;
}
}
loit-build-component/loit-build-deploy-env/src/main/java/com/loit/common/langfang/dto/LimitUnitType.java
0 → 100644
浏览文件 @
0d7dfbd6
package
com
.
loit
.
common
.
langfang
.
dto
;
public
class
LimitUnitType
{
private
String
limit
;
//0:工作日,1:工作时, 2:紧急工作时
private
String
unit
;
public
String
getLimit
()
{
return
limit
;
}
public
void
setLimit
(
String
limit
)
{
this
.
limit
=
limit
;
}
public
String
getUnit
()
{
return
unit
;
}
public
void
setUnit
(
String
unit
)
{
this
.
unit
=
unit
;
}
}
loit-build-component/loit-build-deploy-env/src/main/resources/template/langfang/bigTypeScript.ftl
浏览文件 @
0d7dfbd6
...
...
@@ -49,3 +49,4 @@ NULL,
loit-build-component/loit-build-deploy-env/src/main/resources/template/langfang/manageProblemScript.ftl
0 → 100644
浏览文件 @
0d7dfbd6
INSERT INTO `digital_command_manual`(
`case_type`,
`door_type`,
`door_type_id`,
`big_type`,
`big_type_id`,
`small_type`,
`small_type_id`,
`small_type_all_code`,
`manage_problem`,
`handle_a_Limit_time`,
`handle_a_Limit_unit`,
`handle_b_Limit_time`,
`handle_b_Limit_unit`,
`handle_c_Limit_time`,
`handle_c_Limit_unit`,
`feedback_a_Limit_time`,
`feedback_a_Limit_unit`,
`feedback_b_Limit_time`,
`feedback_b_Limit_unit`,
`feedback_c_Limit_time`,
`feedback_c_Limit_unit`,
`first_handle_sm`,
`first_handle_hl`,
`first_handle_hc`,
`first_handle_jm`,
`first_handle_ta`,
`first_handle_xa`,
`first_handle_city`,
`file_name`,
`file_path`,
`finish_condition`,
`laws_regulations`,
`competent_department`,
`manage_subject`,
`enforce_subect`,
`synergy_unit`,
`coordinate_items`,
`remarks`,
`register_user`,
`create_time`,
`update_time`
)
VALUES (
'1',
NULL,
NULL,
'${bigTypeName}', -- 你的大类
'${bigTypeCode}', -- 大类的编码
'${smallTypeName}', -- 你的小类
'${smallTypeCode}', -- 小类的编码
NULL,
'施工过程中或者施工堆料未采取有效防尘措施造成扬尘现象', -- 管理问题
${alimit}, -- A 类处置时限
${aunit}, -- 0:工作日,1:工作时, 2:紧急工作时
${blimit}, -- B 类处置时限
${bunit}, -- 0:工作日,1:工作时, 2:紧急工作时
${climit}, -- C 类处置时限
${cunit}, -- 0:工作日,1:工作时, 2:紧急工作时
${alimit},
${aunit},
${blimit},
${bunit},
${climit},
${cunit},
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
'1、相关承办单位接到通知后,应在30分钟内派专人到现场勘验,迅速组织⼈员调查取
证。\n2、对明确的违法相对人,应实施宣传教有,责令整改并依法实施行政处罚。\n3、现场责令整
改要求在4工作时内处理完毕,并将处理结果反馈派遣单位。',
'法律法规',
NULL,
'质量安全部、综合执法局',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
'${datetime}'
);
loit-build-component/loit-build-deploy-env/src/main/resources/template/langfang/smallTypeScript.ftl
浏览文件 @
0d7dfbd6
...
...
@@ -23,8 +23,8 @@ INSERT INTO `base_base_casetype`(
`case_type`
)
VALUES (
'${smallTypeCode}', --
⼩
类编码,自己取一个
'${smallTypeName}', -- 修改你的
⼩
类
'${smallTypeCode}', --
小
类编码,自己取一个
'${smallTypeName}', -- 修改你的
小
类
'${bigTypeCode}', -- 大类的 id
'',
'',
...
...
@@ -46,3 +46,4 @@ NULL,
'3',
'${caseType}' -- 1:事件,2:部件
);
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论