Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张雷
/
skboot-zhongye
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
22e8d044
由
张雷
编写于
2024-11-25 15:38:31 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
设备台账导入功能
1 个父辈
b242b3bf
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
51 行增加
和
28 行删除
sk-module-biz/src/main/java/com/skua/modules/emergency/controller/EmergencyEventsController.java
sk-module-equipment/src/main/java/com/skua/modules/equipment/controller/EquipmentController.java
sk-module-equipment/src/main/java/com/skua/modules/equipment/service/IEquipmentInfoService.java
sk-module-equipment/src/main/java/com/skua/modules/equipment/service/impl/EquipmentInfoServiceImpl.java
sk-module-system/src/main/java/com/skua/config/aspect/DictAspect.java
sk-module-system/src/main/java/com/skua/modules/system/controller/PipenetworkTubewellController.java
sk-module-system/src/main/java/com/skua/modules/system/service/ISysDictService.java
sk-module-system/src/main/java/com/skua/modules/system/service/impl/SysDictServiceImpl.java
sk-module-biz/src/main/java/com/skua/modules/emergency/controller/EmergencyEventsController.java
查看文件 @
22e8d04
...
...
@@ -312,7 +312,7 @@ public class EmergencyEventsController {
lastYearData
.
add
(
String
.
valueOf
(
lastYearMap
.
getOrDefault
(
type
,
"0"
)));
}
}
Map
<
String
,
String
>
eventType
=
sysDictService
.
getDictMap
(
"emergency_event_type"
).
get
(
"emergency_event_type"
);
Map
<
String
,
String
>
eventType
=
sysDictService
.
getDictMap
(
"emergency_event_type"
,
"export"
).
get
(
"emergency_event_type"
);
for
(
int
i
=
0
;
i
<
types
.
size
();
i
++)
{
types
.
set
(
i
,
eventType
.
getOrDefault
(
types
.
get
(
i
),
""
));
}
...
...
sk-module-equipment/src/main/java/com/skua/modules/equipment/controller/EquipmentController.java
查看文件 @
22e8d04
...
...
@@ -671,6 +671,23 @@ public class EquipmentController {
@AutoLog
(
value
=
"设备台账-excel导入"
)
@ApiOperation
(
value
=
"设备台账-excel导入"
,
notes
=
"设备台账-excel导入"
)
@RequestMapping
(
value
=
"/importExcel"
,
method
=
RequestMethod
.
POST
)
public
Result
<?>
importExcel
(
String
departId
,
HttpServletRequest
request
)
{
MultipartHttpServletRequest
multipartRequest
=
(
MultipartHttpServletRequest
)
request
;
Map
<
String
,
MultipartFile
>
fileMap
=
multipartRequest
.
getFileMap
();
try
{
for
(
Map
.
Entry
<
String
,
MultipartFile
>
entity
:
fileMap
.
entrySet
())
{
MultipartFile
file
=
entity
.
getValue
();
// 获取上传文件对象
equipmentInfoService
.
importExcel
(
file
,
departId
);
}
return
Result
.
ok
(
"设备台账导入完成"
);
}
catch
(
Exception
e
)
{
return
Result
.
error
(
"设备台账导入失败"
);
}
}
@AutoLog
(
value
=
"设备台账-excel导入"
)
@ApiOperation
(
value
=
"设备台账-excel导入"
,
notes
=
"设备台账-excel导入"
)
@RequestMapping
(
value
=
"/importData"
,
method
=
RequestMethod
.
POST
)
public
Result
<?>
importExcel
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
Exception
{
MultipartHttpServletRequest
multipartRequest
=
(
MultipartHttpServletRequest
)
request
;
Map
<
String
,
MultipartFile
>
fileMap
=
multipartRequest
.
getFileMap
();
...
...
sk-module-equipment/src/main/java/com/skua/modules/equipment/service/IEquipmentInfoService.java
查看文件 @
22e8d04
package
com
.
skua
.
modules
.
equipment
.
service
;
import
java.io.IOException
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -10,6 +11,7 @@ import com.skua.modules.equipment.dto.EquipmentDTO;
import
com.skua.modules.equipment.entity.EquipmentInfo
;
import
com.skua.modules.equipment.vo.EquipmentInfoForMonitorVO
;
import
com.skua.modules.equipment.vo.EquipmentVO
;
import
org.springframework.web.multipart.MultipartFile
;
/**
* 设备信息
...
...
@@ -22,7 +24,7 @@ public interface IEquipmentInfoService extends IService<EquipmentInfo> {
* @param result
* @param equipmentDTO
* @author Li Yuanyuan, 2022年6月27日 下午2:24:14
* @throws Exception
* @throws Exception
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
void
addData
(
Result
<
EquipmentVO
>
result
,
EquipmentDTO
equipmentDTO
)
throws
Exception
;
...
...
@@ -55,7 +57,7 @@ public interface IEquipmentInfoService extends IService<EquipmentInfo> {
* @param result
* @param equipmentDTO
* @author Li Yuanyuan, 2022年6月28日 上午10:00:31
* @throws Exception
* @throws Exception
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
void
editData
(
Result
<
EquipmentVO
>
result
,
EquipmentDTO
equipmentDTO
)
throws
Exception
;
...
...
@@ -64,7 +66,7 @@ public interface IEquipmentInfoService extends IService<EquipmentInfo> {
* 自定义查询
* </pre>
* @param pageList
* @param equipmentInfoVO
* @param equipmentInfo
ForMonitor
VO
* @return
* @author Li Yuanyuan, 2022年6月28日 下午3:30:33
* @Description: TODO(这里描述这个方法的需求变更情况)
...
...
@@ -78,4 +80,6 @@ public interface IEquipmentInfoService extends IService<EquipmentInfo> {
* @return
*/
List
<
Map
<
String
,
Object
>>
getEquipmentLifeTree
(
String
id
,
String
eventType
);
void
importExcel
(
MultipartFile
file
,
String
departId
)
throws
Exception
;
}
...
...
sk-module-equipment/src/main/java/com/skua/modules/equipment/service/impl/EquipmentInfoServiceImpl.java
查看文件 @
22e8d04
此文件的差异被折叠,
点击展开。
sk-module-system/src/main/java/com/skua/config/aspect/DictAspect.java
查看文件 @
22e8d04
...
...
@@ -105,7 +105,7 @@ public class DictAspect {
if
(!
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isBlank
(
table
)){
if
(!
businessMap
.
containsKey
(
table
)){
//获取table的集合
Map
<
String
,
Map
<
String
,
String
>>
map
=
dictService
.
getBusinessMap
(
code
,
table
,
text
);
Map
<
String
,
Map
<
String
,
String
>>
map
=
dictService
.
getBusinessMap
(
code
,
table
,
text
,
"export"
);
businessMap
.
putAll
(
map
);
}
...
...
@@ -120,7 +120,7 @@ public class DictAspect {
textValue
=
textValueStringBuilder
.
toString
().
replaceFirst
(
","
,
""
);
}
else
{
if
(!
dictMap
.
containsKey
(
code
)){
Map
<
String
,
Map
<
String
,
String
>>
map
=
dictService
.
getDictMap
(
code
);
Map
<
String
,
Map
<
String
,
String
>>
map
=
dictService
.
getDictMap
(
code
,
"export"
);
dictMap
.
putAll
(
map
);
}
String
[]
keys
=
key
.
split
(
","
);
...
...
sk-module-system/src/main/java/com/skua/modules/system/controller/PipenetworkTubewellController.java
查看文件 @
22e8d04
...
...
@@ -343,17 +343,13 @@ public class PipenetworkTubewellController {
/**
* 分页列表查询
*
* @param pipenetworkTubewell
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog
(
value
=
"排水管网-管井-获取所有管井数据"
)
@ApiOperation
(
value
=
"排水管网-管井-获取所有管井数据"
,
notes
=
"排水管网-管井--获取所有管井数据"
)
@GetMapping
(
value
=
"/queryAllList"
)
public
Result
<
List
<
PipenetworkTubewell
>>
queryAllList
(
HttpServletRequest
req
)
{
public
Result
<
List
<
PipenetworkTubewell
>>
queryAllList
(
HttpServletRequest
req
)
{
Result
<
List
<
PipenetworkTubewell
>>
result
=
new
Result
<
List
<
PipenetworkTubewell
>>();
QueryWrapper
<
PipenetworkTubewell
>
pipenetworkTubewell
=
new
QueryWrapper
<>();
pipenetworkTubewell
.
eq
(
"del_flag"
,
0
);
...
...
@@ -375,22 +371,19 @@ public class PipenetworkTubewellController {
}
private
Map
<
String
,
String
>
setDictText
(
String
table
)
{
Map
<
String
,
String
>
type
=
sysDictService
.
getDictMap
(
table
).
get
(
table
);
Map
<
String
,
String
>
type
=
sysDictService
.
getDictMap
(
table
,
"export"
).
get
(
table
);
return
type
;
}
/**
* 根据管径查询管线
*
* @param gjID[]
* @param req
* @param gjID
* @return
*/
@AutoLog
(
value
=
"排水管网-管线-分页列表查询"
)
@ApiOperation
(
value
=
"排水管网-管线-分页列表查询"
,
notes
=
"排水管网-管线-分页列表查询"
)
@GetMapping
(
value
=
"/queryPipelineBytubWells"
)
public
Result
<
List
<
PipenetworkPipeline
>>
queryPipelineBytubWells
(
String
[]
gjID
,
HttpServletRequest
req
)
{
public
Result
<
List
<
PipenetworkPipeline
>>
queryPipelineBytubWells
(
String
[]
gjID
)
{
Result
<
List
<
PipenetworkPipeline
>>
result
=
new
Result
<
List
<
PipenetworkPipeline
>>();
String
ids
=
""
;
for
(
String
id
:
gjID
)
{
...
...
sk-module-system/src/main/java/com/skua/modules/system/service/ISysDictService.java
查看文件 @
22e8d04
...
...
@@ -99,9 +99,9 @@ public interface ISysDictService extends IService<SysDict> {
<
T
>
List
<
JSONObject
>
translateListDictValue
(
List
<
T
>
list
);
Map
<
String
,
Map
<
String
,
String
>>
getDictMap
(
String
code
);
Map
<
String
,
Map
<
String
,
String
>>
getDictMap
(
String
code
,
String
type
);
Map
<
String
,
Map
<
String
,
String
>>
getBusinessMap
(
String
code
,
String
table
,
String
text
);
Map
<
String
,
Map
<
String
,
String
>>
getBusinessMap
(
String
code
,
String
table
,
String
text
,
String
type
);
String
queryDictIdByCode
(
String
code
);
...
...
sk-module-system/src/main/java/com/skua/modules/system/service/impl/SysDictServiceImpl.java
查看文件 @
22e8d04
...
...
@@ -23,6 +23,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.StringUtils
;
import
javax.annotation.Resource
;
import
java.lang.reflect.Field
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
...
...
@@ -35,9 +36,9 @@ import java.util.stream.Collectors;
@Slf4j
public
class
SysDictServiceImpl
extends
ServiceImpl
<
SysDictMapper
,
SysDict
>
implements
ISysDictService
{
@
Autowired
@
Resource
private
SysDictMapper
sysDictMapper
;
@
Autowired
@
Resource
private
SysDictItemMapper
sysDictItemMapper
;
@Override
...
...
@@ -221,7 +222,7 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
@Override
public
Map
<
String
,
String
>
getDictMapByCode
(
String
code
)
{
return
this
.
getDictMap
(
code
).
get
(
code
);
return
this
.
getDictMap
(
code
,
"export"
).
get
(
code
);
}
@Override
public
<
T
>
List
<
JSONObject
>
translateListDictValue
(
List
<
T
>
list
)
{
...
...
@@ -250,13 +251,13 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
if
(!
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isBlank
(
table
))
{
if
(!
businessMap
.
containsKey
(
table
))
{
//获取table的集合
Map
<
String
,
Map
<
String
,
String
>>
map
=
getBusinessMap
(
code
,
table
,
text
);
Map
<
String
,
Map
<
String
,
String
>>
map
=
getBusinessMap
(
code
,
table
,
text
,
"export"
);
businessMap
.
putAll
(
map
);
}
textValue
=
businessMap
.
get
(
table
).
get
(
key
);
}
else
{
if
(!
dictMap
.
containsKey
(
code
))
{
Map
<
String
,
Map
<
String
,
String
>>
map
=
getDictMap
(
code
);
Map
<
String
,
Map
<
String
,
String
>>
map
=
getDictMap
(
code
,
"export"
);
dictMap
.
putAll
(
map
);
}
if
(!
StringUtils
.
isEmpty
(
key
)&&
key
.
split
(
","
).
length
>
1
)
{
...
...
@@ -291,24 +292,32 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
}
@Override
public
Map
<
String
,
Map
<
String
,
String
>>
getDictMap
(
String
code
)
{
public
Map
<
String
,
Map
<
String
,
String
>>
getDictMap
(
String
code
,
String
type
)
{
Map
<
String
,
Map
<
String
,
String
>>
dictMap
=
new
HashMap
<>();
List
<
Map
<
String
,
String
>>
listMap
=
sysDictMapper
.
getDictMapByCode
(
code
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
listMap
.
forEach
(
map1
->
{
map
.
put
(
map1
.
get
(
"item_value"
),
map1
.
get
(
"item_text"
));
if
(
"export"
.
equals
(
type
))
{
map
.
put
(
map1
.
get
(
"item_value"
),
map1
.
get
(
"item_text"
));
}
else
{
map
.
put
(
map1
.
get
(
"item_text"
),
map1
.
get
(
"item_value"
));
}
});
dictMap
.
put
(
code
,
map
);
return
dictMap
;
}
@Override
public
Map
<
String
,
Map
<
String
,
String
>>
getBusinessMap
(
String
code
,
String
table
,
String
text
)
{
public
Map
<
String
,
Map
<
String
,
String
>>
getBusinessMap
(
String
code
,
String
table
,
String
text
,
String
type
)
{
Map
<
String
,
Map
<
String
,
String
>>
businessMap
=
new
HashMap
<>();
List
<
Map
<
String
,
String
>>
listMap
=
sysDictMapper
.
getBusinessMapByTable
(
code
,
table
,
text
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
listMap
.
forEach
(
map1
->
{
map
.
put
(
String
.
valueOf
(
map1
.
get
(
code
)),
map1
.
get
(
text
));
if
(
"export"
.
equals
(
type
))
{
map
.
put
(
String
.
valueOf
(
map1
.
get
(
code
)),
map1
.
get
(
text
));
}
else
{
map
.
put
(
map1
.
get
(
text
),
String
.
valueOf
(
map1
.
get
(
code
)));
}
});
businessMap
.
put
(
table
,
map
);
return
businessMap
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论