Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
2c165567
Commit
2c165567
authored
Oct 09, 2021
by
kongfm
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
d1dd2f32
cb0838a0
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
1146 additions
and
463 deletions
+1146
-463
DutyFireFightingDto.java
.../amos/boot/module/common/api/dto/DutyFireFightingDto.java
+49
-0
DutyFireFightingExcleDto.java
.../boot/module/common/api/dto/DutyFireFightingExcleDto.java
+75
-0
OrgUsrDto.java
...om/yeejoin/amos/boot/module/common/api/dto/OrgUsrDto.java
+3
-0
WaterResourceDto.java
...oin/amos/boot/module/common/api/dto/WaterResourceDto.java
+1
-1
ExcelUtil.java
.../yeejoin/amos/boot/module/common/api/excel/ExcelUtil.java
+297
-270
TemplateDynamicCellWriteHandlerDate.java
...common/api/excel/TemplateDynamicCellWriteHandlerDate.java
+107
-0
IDutyCommonService.java
...os/boot/module/common/api/service/IDutyCommonService.java
+30
-0
IDutyFireFightingService.java
...t/module/common/api/service/IDutyFireFightingService.java
+20
-0
IOrgUsrService.java
...n/amos/boot/module/common/api/service/IOrgUsrService.java
+6
-0
WaterResourceMapper.xml
...mon-api/src/main/resources/mapper/WaterResourceMapper.xml
+1
-1
ExcelEnums.java
...om/yeejoin/amos/boot/module/jcs/api/enums/ExcelEnums.java
+2
-2
ElevatorMapper.java
...ejoin/amos/boot/module/tzs/api/mapper/ElevatorMapper.java
+1
-5
ElevatorMapper.xml
...dule-tzs-api/src/main/resources/mapper/ElevatorMapper.xml
+16
-17
DutyCarController.java
.../boot/module/common/biz/controller/DutyCarController.java
+1
-1
DutyFireFightingController.java
...ule/common/biz/controller/DutyFireFightingController.java
+160
-0
DutyPersonController.java
...ot/module/common/biz/controller/DutyPersonController.java
+22
-13
FireExpertsController.java
...t/module/common/biz/controller/FireExpertsController.java
+4
-1
FirefightersPostController.java
...ule/common/biz/controller/FirefightersPostController.java
+12
-0
OrgUsrController.java
...s/boot/module/common/biz/controller/OrgUsrController.java
+12
-9
DutyCarServiceImpl.java
...ot/module/common/biz/service/impl/DutyCarServiceImpl.java
+29
-111
DutyCommonServiceImpl.java
...module/common/biz/service/impl/DutyCommonServiceImpl.java
+105
-1
DutyFireFightingServiceImpl.java
.../common/biz/service/impl/DutyFireFightingServiceImpl.java
+44
-0
FireStationServiceImpl.java
...odule/common/biz/service/impl/FireStationServiceImpl.java
+22
-0
OrgUsrServiceImpl.java
...oot/module/common/biz/service/impl/OrgUsrServiceImpl.java
+0
-0
ExcelServiceImpl.java
...os/boot/module/jcs/biz/service/impl/ExcelServiceImpl.java
+118
-22
AlertCalledServiceImpl.java
...t/module/tzs/biz/service/impl/AlertCalledServiceImpl.java
+7
-5
ElevatorServiceImpl.java
...boot/module/tzs/biz/service/impl/ElevatorServiceImpl.java
+2
-4
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/DutyFireFightingDto.java
0 → 100644
View file @
2c165567
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
dto
;
import
java.io.Serializable
;
import
java.util.List
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
value
=
"DutyFireFightingDto"
,
description
=
"微型消防站值班"
)
public
class
DutyFireFightingDto
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"用户id"
)
private
String
userId
;
@ApiModelProperty
(
value
=
"用户名称"
)
private
String
userName
;
@ApiModelProperty
(
value
=
"单位ID"
)
private
String
teamId
;
@ApiModelProperty
(
value
=
"单位名称"
)
private
String
teamName
;
@ApiModelProperty
(
value
=
"岗位id"
)
private
String
postType
;
@ApiModelProperty
(
value
=
"岗位名称"
)
private
String
postTypeName
;
@ApiModelProperty
(
value
=
"值班信息"
)
private
List
<
DutyPersonShiftDto
>
dutyShift
;
@ApiModelProperty
(
value
=
"值班开始时间"
)
private
String
startTime
;
@ApiModelProperty
(
value
=
"值班结束时间"
)
private
String
endTime
;
@ApiModelProperty
(
value
=
"微型消防站"
)
private
String
fireFighting
;
@ApiModelProperty
(
value
=
"微型消防站Id"
)
private
String
fireFightingId
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/DutyFireFightingExcleDto.java
0 → 100644
View file @
2c165567
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
dto
;
import
java.io.Serializable
;
import
java.util.List
;
import
com.alibaba.excel.annotation.ExcelIgnore
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
value
=
"DutyFireFightingExcleDto"
,
description
=
"微型消防站值班"
)
public
class
DutyFireFightingExcleDto
implements
Serializable
{
@ExcelIgnore
private
static
final
long
serialVersionUID
=
1L
;
@ExcelProperty
(
value
=
"序号"
,
index
=
0
)
@ApiModelProperty
(
value
=
"序号"
)
private
Integer
number
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"单位ID"
)
private
String
teamId
;
@ExcelProperty
(
value
=
"单位名称"
,
index
=
1
)
@ApiModelProperty
(
value
=
"单位名称"
)
private
String
teamName
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"用户id"
)
private
String
userId
;
@ExcelProperty
(
value
=
"用户名称"
,
index
=
2
)
@ApiModelProperty
(
value
=
"用户名称"
)
private
String
userName
;
// @ExcelIgnore
// @ApiModelProperty(value = "部门id")
// private String deptId;
// @ExcelIgnore
// @ApiModelProperty(value = "部门名称")
// private String deptName;
@ExcelIgnore
@ApiModelProperty
(
value
=
"岗位id"
)
private
String
postType
;
@ExcelProperty
(
value
=
"岗位"
,
index
=
3
)
@ApiModelProperty
(
value
=
"岗位名称"
)
private
String
postTypeName
;
@ExcelProperty
(
value
=
"微型消防站"
,
index
=
4
)
@ApiModelProperty
(
value
=
"微型消防站"
)
private
String
fireFighting
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"微型消防站Id"
)
private
String
fireFightingId
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"值班信息"
)
private
List
<
DutyPersonShiftDto
>
dutyShift
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"值班开始时间"
)
private
String
startTime
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"值班结束时间"
)
private
String
endTime
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/OrgUsrDto.java
View file @
2c165567
...
@@ -75,4 +75,7 @@ public class OrgUsrDto extends BaseDto {
...
@@ -75,4 +75,7 @@ public class OrgUsrDto extends BaseDto {
@ApiModelProperty
(
value
=
"动态表单值"
)
@ApiModelProperty
(
value
=
"动态表单值"
)
private
List
<
DynamicFormInstance
>
dynamicFormValue
;
private
List
<
DynamicFormInstance
>
dynamicFormValue
;
@ApiModelProperty
(
value
=
"动态表单值-DTO类型"
)
private
List
<
DynamicFormInstanceDto
>
dynamicFormValueDto
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/WaterResourceDto.java
View file @
2c165567
...
@@ -263,7 +263,7 @@ public class WaterResourceDto extends BaseDto {
...
@@ -263,7 +263,7 @@ public class WaterResourceDto extends BaseDto {
@ExplicitConstraint
(
indexNum
=
32
,
source
=
{
"有"
,
"无"
})
//固定下拉内容
@ExplicitConstraint
(
indexNum
=
32
,
source
=
{
"有"
,
"无"
})
//固定下拉内容
@ExcelProperty
(
value
=
"有无枯水期"
,
index
=
32
)
@ExcelProperty
(
value
=
"有无枯水期"
,
index
=
32
)
@ApiModelProperty
(
value
=
"有无枯水期"
)
@ApiModelProperty
(
value
=
"有无枯水期"
)
private
Boolean
hasDrySeasonType
;
private
String
hasDrySeasonType
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/excel/ExcelUtil.java
View file @
2c165567
...
@@ -6,270 +6,298 @@ import java.io.OutputStream;
...
@@ -6,270 +6,298 @@ import java.io.OutputStream;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Field
;
import
java.net.URLEncoder
;
import
java.net.URLEncoder
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.charset.StandardCharsets
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
org.apache.poi.ss.usermodel.BorderStyle
;
import
com.alibaba.excel.write.builder.ExcelWriterSheetBuilder
;
import
org.apache.poi.ss.usermodel.HorizontalAlignment
;
import
org.apache.poi.ss.usermodel.*
;
import
org.apache.poi.ss.usermodel.IndexedColors
;
import
org.apache.poi.ss.usermodel.VerticalAlignment
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
com.alibaba.excel.EasyExcel
;
import
com.alibaba.excel.EasyExcel
;
import
com.alibaba.excel.ExcelReader
;
import
com.alibaba.excel.ExcelReader
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.alibaba.excel.read.metadata.ReadSheet
;
import
com.alibaba.excel.read.metadata.ReadSheet
;
import
com.alibaba.excel.support.ExcelTypeEnum
;
import
com.alibaba.excel.support.ExcelTypeEnum
;
import
com.alibaba.excel.write.builder.ExcelWriterSheetBuilder
;
import
com.alibaba.excel.write.metadata.style.WriteCellStyle
;
import
com.alibaba.excel.write.metadata.style.WriteCellStyle
;
import
com.alibaba.excel.write.metadata.style.WriteFont
;
import
com.alibaba.excel.write.metadata.style.WriteFont
;
import
com.alibaba.excel.write.style.HorizontalCellStyleStrategy
;
import
com.alibaba.excel.write.style.HorizontalCellStyleStrategy
;
public
class
ExcelUtil
{
public
class
ExcelUtil
{
private
static
final
Integer
DUTY_CAR_START_INDEX
=
5
;
private
static
final
Integer
DUTY_CAR_START_INDEX
=
5
;
/**
/**
* 生成excel模板
* 生成excel模板
*
*
* @param response
* @param response
* @param fileName 下载的文件名,
* @param fileName 下载的文件名,
* @param sheetName sheet名
* @param sheetName sheet名
* @param data 导出的数据
* @param data 导出的数据
* @param model 导出的头
* @param model 导出的头
* @param flag true模板填充下拉 false 不填充
* @param flag true模板填充下拉 false 不填充
*/
*/
public
static
void
createTemplate
(
HttpServletResponse
response
,
String
fileName
,
public
static
void
createTemplate
(
HttpServletResponse
response
,
String
fileName
,
String
sheetName
,
String
sheetName
,
List
<?
extends
Object
>
data
,
List
<?
extends
Object
>
data
,
Class
<?>
model
,
DataSources
dataDictionaryMapper
,
boolean
flag
)
{
Class
<?>
model
,
DataSources
dataDictionaryMapper
,
boolean
flag
)
{
HorizontalCellStyleStrategy
horizontalCellStyleStrategy
=
setMyCellStyle
();
HorizontalCellStyleStrategy
horizontalCellStyleStrategy
=
setMyCellStyle
();
try
{
try
{
//下拉列表集合
// 下拉列表集合
Map
<
Integer
,
String
[]>
explicitListConstraintMap
=
new
HashMap
<>();
Map
<
Integer
,
String
[]>
explicitListConstraintMap
=
new
HashMap
<>();
if
(
flag
)
{
if
(
flag
)
{
//循环获取对应列得下拉列表信息
// 循环获取对应列得下拉列表信息
Field
[]
declaredFields
=
model
.
getDeclaredFields
();
Field
[]
declaredFields
=
model
.
getDeclaredFields
();
for
(
int
i
=
0
;
i
<
declaredFields
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
declaredFields
.
length
;
i
++)
{
Field
field
=
declaredFields
[
i
];
Field
field
=
declaredFields
[
i
];
//解析注解信息
// 解析注解信息
ExplicitConstraint
explicitConstraint
=
field
.
getAnnotation
(
ExplicitConstraint
.
class
);
ExplicitConstraint
explicitConstraint
=
field
.
getAnnotation
(
ExplicitConstraint
.
class
);
resolveExplicitConstraint
(
explicitListConstraintMap
,
explicitConstraint
,
dataDictionaryMapper
);
resolveExplicitConstraint
(
explicitListConstraintMap
,
explicitConstraint
,
dataDictionaryMapper
);
}
}
}
}
EasyExcel
.
write
(
getOutputStream
(
fileName
,
response
,
ExcelTypeEnum
.
XLSX
),
model
)
EasyExcel
.
write
(
getOutputStream
(
fileName
,
response
,
ExcelTypeEnum
.
XLSX
),
model
)
.
excelType
(
ExcelTypeEnum
.
XLSX
).
sheet
(
sheetName
)
.
excelType
(
ExcelTypeEnum
.
XLSX
).
sheet
(
sheetName
)
.
registerWriteHandler
(
new
TemplateCellWriteHandlerDate
(
explicitListConstraintMap
))
.
registerWriteHandler
(
new
TemplateCellWriteHandlerDate
(
explicitListConstraintMap
))
.
registerWriteHandler
(
new
TemplateCellWriteHandler
())
.
registerWriteHandler
(
new
TemplateCellWriteHandler
())
.
registerWriteHandler
(
horizontalCellStyleStrategy
)
.
registerWriteHandler
(
horizontalCellStyleStrategy
).
doWrite
(
data
);
.
doWrite
(
data
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
throw
new
RuntimeException
(
"系统异常!"
);
throw
new
RuntimeException
(
"系统异常!"
);
}
}
}
}
/**
/**
* 生成excel模板
* 生成excel模板
*
*
* @param response
* @param response
* @param fileName 下载的文件名,
* @param fileName 下载的文件名,
* @param sheetName sheet名
* @param sheetName sheet名
* @param data 导出的数据
* @param data 导出的数据
* @param model 导出的头
* @param model 导出的头
* @param flag true模板填充下拉 false 不填充
* @param flag true模板填充下拉 false 不填充
*/
*/
public
static
void
createDutyTemplate
(
HttpServletResponse
response
,
String
fileName
,
String
sheetName
,
List
<?
public
static
void
createDutyTemplate
(
HttpServletResponse
response
,
String
fileName
,
String
sheetName
,
extends
Object
>
data
,
Class
<?>
model
,
List
<
String
>
dayByMonth
,
String
[]
dutyNameList
,
List
<?
extends
Object
>
data
,
Class
<?>
model
,
List
<
String
>
dayByMonth
,
String
[]
dutyNameList
,
DataSources
dataDictionaryMapper
,
DataSources
dataDictionaryMapper
,
boolean
flag
,
boolean
typeFlag
)
{
boolean
flag
)
{
HorizontalCellStyleStrategy
horizontalCellStyleStrategy
=
setMyCellStyle
();
HorizontalCellStyleStrategy
horizontalCellStyleStrategy
=
setMyCellStyle
();
try
{
try
{
// 组装表头
// 组装表头
List
<
List
<
String
>>
dutyCarTitleList
=
new
ArrayList
<>();
List
<
List
<
String
>>
dutyCarTitleList
=
new
ArrayList
<>();
Field
[]
declaredFields
=
model
.
getDeclaredFields
();
Field
[]
declaredFields
=
model
.
getDeclaredFields
();
for
(
int
i
=
0
;
i
<
declaredFields
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
declaredFields
.
length
;
i
++)
{
Field
field
=
declaredFields
[
i
];
Field
field
=
declaredFields
[
i
];
ExcelProperty
excelProperty
=
field
.
getAnnotation
(
ExcelProperty
.
class
);
ExcelProperty
excelProperty
=
field
.
getAnnotation
(
ExcelProperty
.
class
);
if
(
excelProperty
!=
null
)
{
if
(
excelProperty
!=
null
)
{
ArrayList
<
String
>
head
=
new
ArrayList
<>();
ArrayList
<
String
>
head
=
new
ArrayList
<>();
head
.
add
(
excelProperty
.
value
()[
0
]);
head
.
add
(
excelProperty
.
value
()[
0
]);
dutyCarTitleList
.
add
(
head
);
dutyCarTitleList
.
add
(
head
);
}
}
}
}
int
size
=
dutyCarTitleList
.
size
();
int
size
=
dutyCarTitleList
.
size
();
if
(
dayByMonth
!=
null
)
{
if
(
dayByMonth
!=
null
)
{
for
(
int
i
=
0
;
i
<
dayByMonth
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
dayByMonth
.
size
();
i
++)
{
ArrayList
<
String
>
dutyDay
=
new
ArrayList
<>();
ArrayList
<
String
>
dutyDay
=
new
ArrayList
<>();
dutyDay
.
add
(
dayByMonth
.
get
(
i
));
dutyDay
.
add
(
dayByMonth
.
get
(
i
));
dutyCarTitleList
.
add
(
dutyDay
);
dutyCarTitleList
.
add
(
dutyDay
);
}
}
}
}
//
下拉列表集合
//
下拉列表集合
Map
<
Integer
,
String
[]>
explicitListConstraintMap
=
new
HashMap
<>();
Map
<
Integer
,
String
[]>
explicitListConstraintMap
=
new
HashMap
<>();
if
(
flag
)
{
if
(
flag
)
{
// 组装下拉列表
// 组装下拉列表
for
(
int
i
=
0
;
i
<
declaredFields
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
declaredFields
.
length
;
i
++)
{
Field
field
=
declaredFields
[
i
];
Field
field
=
declaredFields
[
i
];
//
解析注解信息
//
解析注解信息
ExplicitConstraint
explicitConstraint
=
field
.
getAnnotation
(
ExplicitConstraint
.
class
);
ExplicitConstraint
explicitConstraint
=
field
.
getAnnotation
(
ExplicitConstraint
.
class
);
resolveExplicitConstraint
(
explicitListConstraintMap
,
explicitConstraint
,
dataDictionaryMapper
);
resolveExplicitConstraint
(
explicitListConstraintMap
,
explicitConstraint
,
dataDictionaryMapper
);
}
}
if
(
dayByMonth
!=
null
)
{
if
(
dayByMonth
!=
null
)
{
for
(
int
i
=
0
;
i
<
dayByMonth
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
dayByMonth
.
size
();
i
++)
{
explicitListConstraintMap
.
put
(
size
+
i
,
dutyNameList
);
explicitListConstraintMap
.
put
(
size
+
i
,
dutyNameList
);
}
}
}
}
}
}
// String s = new String(fileName.getBytes(), "UTF-8");
// String s = new String(fileName.getBytes(), "UTF-8");
// response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(s, "UTF-8"));
// response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(s, "UTF-8"));
ExcelWriterSheetBuilder
excelWriterSheetBuilder
=
EasyExcel
.
write
(
getOutputStream
(
fileName
,
response
,
ExcelWriterSheetBuilder
excelWriterSheetBuilder
=
null
;
ExcelTypeEnum
.
XLSX
)).
head
(
dutyCarTitleList
).
excelType
(
ExcelTypeEnum
.
XLSX
)
;
.
sheet
(
sheetName
).
registerWriteHandler
(
new
TemplateCellWriteHandlerDate
(
explicitListConstraintMap
))
if
(
typeFlag
)
{
.
registerWriteHandler
(
new
TemplateCellWriteHandler
())
List
<
Map
<
Integer
,
String
[]>>
fireStationExplicitListConstraintMap
=
new
ArrayList
<
Map
<
Integer
,
String
[]>>();
.
registerWriteHandler
(
horizontalCellStyleStrategy
);
List
<
List
<
Object
>>
resultList
=
new
ArrayList
<
List
<
Object
>>();
excelWriterSheetBuilder
.
doWrite
(
data
);
data
.
stream
().
forEach
(
i
->
{
}
catch
(
Exception
e
)
{
Map
<
Integer
,
String
[]>
map
=
new
HashMap
<>();
e
.
printStackTrace
();
List
<
Object
>
detail
=
(
List
<
Object
>)
i
;
throw
new
RuntimeException
(
"系统异常!"
);
// 微型消防站中的对应单位微型消防站下拉列表数据的集合
List
<
String
>
fireStationDetailList
=
(
List
<
String
>)
detail
.
get
(
detail
.
size
()-
1
);
String
[]
strings
=
new
String
[
fireStationDetailList
.
size
()];
map
.
put
(
4
,
fireStationDetailList
.
toArray
(
strings
));
map
.
putAll
(
explicitListConstraintMap
);
fireStationExplicitListConstraintMap
.
add
(
map
);
detail
.
remove
(
detail
.
size
()-
1
);
resultList
.
add
(
detail
);
});
excelWriterSheetBuilder
=
EasyExcel
.
write
(
getOutputStream
(
fileName
,
response
,
ExcelTypeEnum
.
XLSX
))
.
head
(
dutyCarTitleList
)
.
excelType
(
ExcelTypeEnum
.
XLSX
).
sheet
(
sheetName
)
.
registerWriteHandler
(
new
TemplateDynamicCellWriteHandlerDate
(
fireStationExplicitListConstraintMap
))
.
registerWriteHandler
(
new
TemplateCellWriteHandler
())
.
registerWriteHandler
(
horizontalCellStyleStrategy
);
excelWriterSheetBuilder
.
doWrite
(
resultList
);
}
else
{
excelWriterSheetBuilder
=
EasyExcel
.
write
(
getOutputStream
(
fileName
,
response
,
ExcelTypeEnum
.
XLSX
))
.
head
(
dutyCarTitleList
)
.
excelType
(
ExcelTypeEnum
.
XLSX
).
sheet
(
sheetName
)
.
registerWriteHandler
(
new
TemplateCellWriteHandlerDate
(
explicitListConstraintMap
))
.
registerWriteHandler
(
new
TemplateCellWriteHandler
())
.
registerWriteHandler
(
horizontalCellStyleStrategy
);
excelWriterSheetBuilder
.
doWrite
(
data
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"系统异常!"
);
}
}
}
}
/**
/**
* 读取 Excel(第一个 sheet)
指定行开始读取
* 读取 Excel(第一个 sheet)
指定行开始读取
*
*
* @param excel 文件
* @param excel 文件
* @param rowType 模板实体类
* @param rowType 模板实体类
* @param header 指定不读取的表头行数,
* @param header 指定不读取的表头行数,
* @param <T>
* @param <T>
* @return 集合数据
* @return 集合数据
* @throws Exception
* @throws Exception
*/
*/
public
static
<
T
>
List
<
T
>
readFirstSheetExcel
(
MultipartFile
excel
,
Class
<
T
>
rowType
,
int
header
)
throws
Exception
{
public
static
<
T
>
List
<
T
>
readFirstSheetExcel
(
MultipartFile
excel
,
Class
<
T
>
rowType
,
int
header
)
throws
Exception
{
ExcelReader
reader
=
getReader
(
excel
,
header
);
ExcelReader
reader
=
getReader
(
excel
,
header
);
if
(
reader
==
null
)
{
if
(
reader
==
null
)
{
return
new
ArrayList
<>();
return
new
ArrayList
<>();
}
}
return
readExcel
(
reader
,
rowType
,
0
);
return
readExcel
(
reader
,
rowType
,
0
);
}
}
/**
* 读取 Excel(多个 sheet)
*
* @param reader 读取的excel
* @param rowModel excel模板实体类
* @param sheetCount sheet
* @param <T>
* @return
*/
public
static
<
T
>
List
<
T
>
readExcel
(
ExcelReader
reader
,
Class
<
T
>
rowModel
,
int
sheetCount
)
{
if
(
reader
==
null
)
{
return
new
ArrayList
<>();
}
ExcelListener
<
T
>
excelListener
=
new
ExcelListener
<>();
ReadSheet
readSheet
=
EasyExcel
.
readSheet
(
sheetCount
).
head
(
rowModel
).
registerReadListener
(
excelListener
)
.
build
();
reader
.
read
(
readSheet
);
return
excelListener
.
getList
();
}
/**
/**
* 读取 Excel(多个 sheet)
* @param excel 需要解析的 Excel 文件
*
* @param header 指定不读取表头行数,
* @param reader 读取的excel
* @return
* @param rowModel excel模板实体类
* @throws Exception
* @param sheetCount sheet
*/
* @param <T>
public
static
ExcelReader
getReader
(
MultipartFile
excel
,
int
header
)
throws
Exception
{
* @return
String
fileName
=
excel
.
getOriginalFilename
();
*/
if
(
fileName
==
null
)
{
public
static
<
T
>
List
<
T
>
readExcel
(
ExcelReader
reader
,
Class
<
T
>
rowModel
,
int
sheetCount
)
{
throw
new
Exception
(
"文件不存在!"
);
if
(
reader
==
null
)
{
}
return
new
ArrayList
<>();
if
(!
fileName
.
toLowerCase
().
endsWith
(
ExcelTypeEnum
.
XLS
.
getValue
())
}
&&
!
fileName
.
toLowerCase
().
endsWith
(
ExcelTypeEnum
.
XLSX
.
getValue
()))
{
ExcelListener
<
T
>
excelListener
=
new
ExcelListener
<>();
throw
new
Exception
(
"文件类型异常!"
);
ReadSheet
readSheet
=
EasyExcel
.
readSheet
(
sheetCount
)
}
.
head
(
rowModel
)
InputStream
inputStream
;
.
registerReadListener
(
excelListener
)
try
{
.
build
();
inputStream
=
excel
.
getInputStream
();
reader
.
read
(
readSheet
);
return
EasyExcel
.
read
(
inputStream
).
headRowNumber
(
header
).
build
();
return
excelListener
.
getList
();
}
catch
(
IOException
e
)
{
}
// do something
}
return
null
;
}
/**
* 解析注解内容 获取下列表信息
*
* @param explicitConstraint
* @return
*/
public
static
Map
<
Integer
,
String
[]>
resolveExplicitConstraint
(
Map
<
Integer
,
String
[]>
explicitListConstraintMap
,
ExplicitConstraint
explicitConstraint
,
DataSources
dataDictionaryMapper
)
{
if
(
explicitConstraint
==
null
)
{
return
null
;
}
// 固定下拉信息
String
[]
source
=
explicitConstraint
.
source
();
if
(
source
.
length
>
0
)
{
explicitListConstraintMap
.
put
(
explicitConstraint
.
indexNum
(),
source
);
}
// 动态下拉信息
Class
<?
extends
ExplicitInterface
>[]
classes
=
explicitConstraint
.
sourceClass
();
if
(
classes
.
length
>
0
)
{
ExplicitInterface
explicitInterface
=
null
;
try
{
explicitInterface
=
classes
[
0
].
newInstance
();
String
[]
source1
=
explicitInterface
.
source
(
explicitConstraint
.
type
(),
explicitConstraint
.
method
(),
dataDictionaryMapper
);
if
(
source1
.
length
>
0
)
{
explicitListConstraintMap
.
put
(
explicitConstraint
.
indexNum
(),
source1
);
}
}
catch
(
InstantiationException
e
)
{
e
.
printStackTrace
();
}
catch
(
IllegalAccessException
e
)
{
e
.
printStackTrace
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
return
null
;
}
/**
/**
* @param excel 需要解析的 Excel 文件
* 导出文件时为Writer生成OutputStream
* @param header 指定不读取表头行数,
*/
* @return
private
static
OutputStream
getOutputStream
(
String
fileName
,
HttpServletResponse
response
,
* @throws Exception
ExcelTypeEnum
excelTypeEnum
)
throws
Exception
{
*/
// 创建本地文件
public
static
ExcelReader
getReader
(
MultipartFile
excel
,
int
header
)
throws
Exception
{
String
filePath
=
fileName
+
excelTypeEnum
.
getValue
();
String
fileName
=
excel
.
getOriginalFilename
();
try
{
if
(
fileName
==
null
)
{
fileName
=
new
String
(
filePath
.
getBytes
(),
"UTF-8"
);
throw
new
Exception
(
"文件不存在!"
);
response
.
setCharacterEncoding
(
StandardCharsets
.
UTF_8
.
name
());
}
response
.
setContentType
(
"application/vnd.ms-excel"
);
if
(!
fileName
.
toLowerCase
().
endsWith
(
ExcelTypeEnum
.
XLS
.
getValue
())
&&
!
fileName
.
toLowerCase
().
endsWith
(
ExcelTypeEnum
.
XLSX
.
getValue
()))
{
response
.
addHeader
(
"Content-Disposition"
,
"filename="
+
fileName
);
throw
new
Exception
(
"文件类型异常!"
);
response
.
setHeader
(
"Content-Disposition"
,
}
"attachment; filename="
+
URLEncoder
.
encode
(
fileName
,
StandardCharsets
.
UTF_8
.
name
()));
InputStream
inputStream
;
return
response
.
getOutputStream
();
try
{
}
catch
(
IOException
e
)
{
inputStream
=
excel
.
getInputStream
();
throw
new
Exception
(
"系统异常"
);
return
EasyExcel
.
read
(
inputStream
).
}
headRowNumber
(
header
).
}
build
();
}
catch
(
IOException
e
)
{
//do something
}
return
null
;
}
/**
/**
* 创建我的cell 策略
* 解析注解内容 获取下列表信息
*
*
* @return
* @param explicitConstraint
*/
* @return
public
static
HorizontalCellStyleStrategy
setMyCellStyle
()
{
*/
public
static
Map
<
Integer
,
String
[]>
resolveExplicitConstraint
(
Map
<
Integer
,
String
[]>
explicitListConstraintMap
,
ExplicitConstraint
explicitConstraint
,
DataSources
dataDictionaryMapper
)
{
if
(
explicitConstraint
==
null
)
{
return
null
;
}
//固定下拉信息
String
[]
source
=
explicitConstraint
.
source
();
if
(
source
.
length
>
0
)
{
explicitListConstraintMap
.
put
(
explicitConstraint
.
indexNum
(),
source
);
}
//动态下拉信息
Class
<?
extends
ExplicitInterface
>[]
classes
=
explicitConstraint
.
sourceClass
();
if
(
classes
.
length
>
0
)
{
ExplicitInterface
explicitInterface
=
null
;
try
{
explicitInterface
=
classes
[
0
].
newInstance
();
String
[]
source1
=
explicitInterface
.
source
(
explicitConstraint
.
type
(),
explicitConstraint
.
method
(),
dataDictionaryMapper
);
if
(
source1
.
length
>
0
)
{
explicitListConstraintMap
.
put
(
explicitConstraint
.
indexNum
(),
source1
);
}
}
catch
(
InstantiationException
e
)
{
e
.
printStackTrace
();
}
catch
(
IllegalAccessException
e
)
{
e
.
printStackTrace
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
return
null
;
}
/**
* 导出文件时为Writer生成OutputStream
*/
private
static
OutputStream
getOutputStream
(
String
fileName
,
HttpServletResponse
response
,
ExcelTypeEnum
excelTypeEnum
)
throws
Exception
{
//创建本地文件
String
filePath
=
fileName
+
excelTypeEnum
.
getValue
();
try
{
fileName
=
new
String
(
filePath
.
getBytes
(),
"UTF-8"
);
response
.
setCharacterEncoding
(
StandardCharsets
.
UTF_8
.
name
());
response
.
setContentType
(
"application/vnd.ms-excel"
);
response
.
addHeader
(
"Content-Disposition"
,
"filename="
+
fileName
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment; filename="
+
URLEncoder
.
encode
(
fileName
,
StandardCharsets
.
UTF_8
.
name
()));
return
response
.
getOutputStream
();
}
catch
(
IOException
e
)
{
throw
new
Exception
(
"系统异常"
);
}
}
/**
* 创建我的cell 策略
*
* @return
*/
public
static
HorizontalCellStyleStrategy
setMyCellStyle
()
{
// // 头的策略
// // 头的策略
// WriteCellStyle headWriteCellStyle = new WriteCellStyle();
// WriteCellStyle headWriteCellStyle = new WriteCellStyle();
...
@@ -293,41 +321,40 @@ public class ExcelUtil {
...
@@ -293,41 +321,40 @@ public class ExcelUtil {
// // 这里 需要指定写用哪个class去写,然后写到第一个sheet,名字为模板 然后文件流会自动关闭
// // 这里 需要指定写用哪个class去写,然后写到第一个sheet,名字为模板 然后文件流会自动关闭
// return horizontalCellStyleStrategy;
// return horizontalCellStyleStrategy;
// 表头样式策略
WriteCellStyle
headWriteCellStyle
=
new
WriteCellStyle
();
// 设置表头居中对齐
headWriteCellStyle
.
setHorizontalAlignment
(
HorizontalAlignment
.
CENTER
);
// 表头前景色
headWriteCellStyle
.
setFillForegroundColor
(
IndexedColors
.
GREY_25_PERCENT
.
getIndex
());
WriteFont
headWriteFont
=
new
WriteFont
();
headWriteFont
.
setBold
(
true
);
headWriteFont
.
setFontName
(
"宋体"
);
headWriteFont
.
setFontHeightInPoints
((
short
)
10
);
headWriteCellStyle
.
setWriteFont
(
headWriteFont
);
// 表头样式策略
// 2 内容样式策略
WriteCellStyle
headWriteCellStyle
=
new
WriteCellStyle
();
WriteCellStyle
contentWriteCellStyle
=
new
WriteCellStyle
();
//设置表头居中对齐
WriteFont
contentWriteFont
=
new
WriteFont
();
headWriteCellStyle
.
setHorizontalAlignment
(
HorizontalAlignment
.
CENTER
);
// 内容字体大小
//表头前景色
contentWriteFont
.
setFontName
(
"宋体"
);
headWriteCellStyle
.
setFillForegroundColor
(
IndexedColors
.
GREY_25_PERCENT
.
getIndex
());
contentWriteFont
.
setFontHeightInPoints
((
short
)
10
);
WriteFont
headWriteFont
=
new
WriteFont
();
contentWriteCellStyle
.
setWriteFont
(
contentWriteFont
);
headWriteFont
.
setBold
(
true
);
// 设置自动换行
headWriteFont
.
setFontName
(
"宋体"
);
contentWriteCellStyle
.
setWrapped
(
true
);
headWriteFont
.
setFontHeightInPoints
((
short
)
10
);
// 设置垂直居中
headWriteCellStyle
.
setWriteFont
(
headWriteFont
);
contentWriteCellStyle
.
setVerticalAlignment
(
VerticalAlignment
.
CENTER
);
// 头默认了 FillPatternType所以可以不指定。
//2 内容样式策略
// contentWriteCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND);
WriteCellStyle
contentWriteCellStyle
=
new
WriteCellStyle
();
// 设置水平居中
WriteFont
contentWriteFont
=
new
WriteFont
();
contentWriteCellStyle
.
setHorizontalAlignment
(
HorizontalAlignment
.
CENTER
);
//内容字体大小
contentWriteFont
.
setFontName
(
"宋体"
);
contentWriteFont
.
setFontHeightInPoints
((
short
)
10
);
contentWriteCellStyle
.
setWriteFont
(
contentWriteFont
);
//设置自动换行
contentWriteCellStyle
.
setWrapped
(
true
);
//设置垂直居中
contentWriteCellStyle
.
setVerticalAlignment
(
VerticalAlignment
.
CENTER
);
// 头默认了 FillPatternType所以可以不指定。
// contentWriteCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND);
//设置水平居中
contentWriteCellStyle
.
setHorizontalAlignment
(
HorizontalAlignment
.
CENTER
);
//
设置边框样式
//
设置边框样式
contentWriteCellStyle
.
setBorderLeft
(
BorderStyle
.
THIN
);
contentWriteCellStyle
.
setBorderLeft
(
BorderStyle
.
THIN
);
contentWriteCellStyle
.
setBorderTop
(
BorderStyle
.
THIN
);
contentWriteCellStyle
.
setBorderTop
(
BorderStyle
.
THIN
);
contentWriteCellStyle
.
setBorderRight
(
BorderStyle
.
THIN
);
contentWriteCellStyle
.
setBorderRight
(
BorderStyle
.
THIN
);
contentWriteCellStyle
.
setBorderBottom
(
BorderStyle
.
THIN
);
contentWriteCellStyle
.
setBorderBottom
(
BorderStyle
.
THIN
);
return
new
HorizontalCellStyleStrategy
(
headWriteCellStyle
,
contentWriteCellStyle
);
return
new
HorizontalCellStyleStrategy
(
headWriteCellStyle
,
contentWriteCellStyle
);
}
}
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/excel/TemplateDynamicCellWriteHandlerDate.java
0 → 100644
View file @
2c165567
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
excel
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.poi.ss.usermodel.DataValidation
;
import
org.apache.poi.ss.usermodel.DataValidationConstraint
;
import
org.apache.poi.ss.usermodel.DataValidationHelper
;
import
org.apache.poi.ss.usermodel.Name
;
import
org.apache.poi.ss.usermodel.Sheet
;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.apache.poi.ss.util.CellRangeAddressList
;
import
org.apache.poi.xssf.usermodel.XSSFDataValidation
;
import
com.alibaba.excel.write.handler.SheetWriteHandler
;
import
com.alibaba.excel.write.metadata.holder.WriteSheetHolder
;
import
com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder
;
public
class
TemplateDynamicCellWriteHandlerDate
implements
SheetWriteHandler
{
/**
* 构造器注入
*/
private
List
<
Map
<
Integer
,
String
[]>>
explicitListConstraintMap
=
new
ArrayList
<
Map
<
Integer
,
String
[]>>();
public
TemplateDynamicCellWriteHandlerDate
(
List
<
Map
<
Integer
,
String
[]>>
explicitListConstraintMap
)
{
this
.
explicitListConstraintMap
=
explicitListConstraintMap
;
}
/**
* 避免生成的导入模板下拉值获取不到
*/
private
static
final
Integer
LIMIT_NUMBER
=
0
;
/**
* 返回excel列标A-Z-AA-ZZ
*
* @param num 列数
* @return java.lang.String
*/
private
String
getExcelLine
(
int
num
)
{
String
line
=
""
;
int
first
=
num
/
26
;
int
second
=
num
%
26
;
if
(
first
>
0
)
{
line
=
(
char
)
(
'A'
+
first
-
1
)
+
""
;
}
line
+=
(
char
)
(
'A'
+
second
)
+
""
;
return
line
;
}
@Override
public
void
beforeSheetCreate
(
WriteWorkbookHolder
writeWorkbookHolder
,
WriteSheetHolder
writeSheetHolder
)
{
// TODO Auto-generated method stub
}
@Override
public
void
afterSheetCreate
(
WriteWorkbookHolder
writeWorkbookHolder
,
WriteSheetHolder
writeSheetHolder
)
{
if
(
explicitListConstraintMap
!=
null
)
{
// 这里可以对cell进行任何操作
Sheet
sheet
=
writeSheetHolder
.
getSheet
();
DataValidationHelper
helper
=
sheet
.
getDataValidationHelper
();
for
(
int
index
=
0
;
index
<
explicitListConstraintMap
.
size
()
;
index
++
)
{
int
startIndex
=
index
+
1
;
explicitListConstraintMap
.
get
(
index
).
forEach
((
k
,
v
)->{
// 设置下拉单元格的首行 末行 首列 末列
CellRangeAddressList
rangeList
=
new
CellRangeAddressList
(
startIndex
,
startIndex
,
k
,
k
);
// 如果下拉值总数大于100,则使用一个新sheet存储,避免生成的导入模板下拉值获取不到
if
(
v
.
length
>
LIMIT_NUMBER
)
{
//定义sheet的名称
//1.创建一个隐藏的sheet 名称为 hidden + k
String
sheetName
=
"hidden"
+
startIndex
+
k
;
Workbook
workbook
=
writeWorkbookHolder
.
getWorkbook
();
Sheet
hiddenSheet
=
workbook
.
createSheet
(
sheetName
);
for
(
int
i
=
0
,
length
=
v
.
length
;
i
<
length
;
i
++)
{
// 开始的行数i,列数k
hiddenSheet
.
createRow
(
i
).
createCell
(
k
).
setCellValue
(
v
[
i
]);
}
Name
category1Name
=
workbook
.
createName
();
category1Name
.
setNameName
(
sheetName
);
String
excelLine
=
getExcelLine
(
k
);
// =hidden!$H:$1:$H$50 sheet为hidden的 H1列开始H50行数据获取下拉数组
String
refers
=
"="
+
sheetName
+
"!$"
+
excelLine
+
"$1:$"
+
excelLine
+
"$"
+
(
v
.
length
+
1
);
// 将刚才设置的sheet引用到你的下拉列表中
DataValidationConstraint
constraint
=
helper
.
createFormulaListConstraint
(
refers
);
DataValidation
dataValidation
=
helper
.
createValidation
(
constraint
,
rangeList
);
if
(
dataValidation
instanceof
XSSFDataValidation
){
dataValidation
.
setSuppressDropDownArrow
(
true
);
dataValidation
.
setShowErrorBox
(
true
);
}
else
{
dataValidation
.
setSuppressDropDownArrow
(
false
);
}
writeSheetHolder
.
getSheet
().
addValidationData
(
dataValidation
);
// 设置存储下拉列值得sheet为隐藏
int
hiddenIndex
=
workbook
.
getSheetIndex
(
sheetName
);
if
(!
workbook
.
isSheetHidden
(
hiddenIndex
))
{
workbook
.
setSheetHidden
(
hiddenIndex
,
true
);
}
}
});
}
}
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/service/IDutyCommonService.java
View file @
2c165567
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
service
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
service
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto
;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.util.List
;
import
java.util.List
;
...
@@ -86,4 +87,33 @@ public interface IDutyCommonService {
...
@@ -86,4 +87,33 @@ public interface IDutyCommonService {
* @return
* @return
*/
*/
List
<
Long
>
getDutyShiftIdList
();
List
<
Long
>
getDutyShiftIdList
();
/**
* 添加动态表单数据保存的方法,返回保存数据的instanceid
* @param userId
* @param map
* @param groupCode
* @return
*/
public
Long
excuteDynamicFormInstance
(
String
userId
,
Map
<
String
,
Object
>
map
,
String
groupCode
);
/**
* 修改动态表单数据
* @param groupCode
* @param instanceId
* @param map
*/
public
void
updateDynamicFormInstance
(
String
groupCode
,
Long
instanceId
,
Map
<
String
,
Object
>
map
)
;
/**
* 保存值班人的信息---
* @param instanceId
* @param dutyShift
* @param startTime
*/
public
void
saveDutyPersonShiftDetail
(
Long
instanceId
,
List
<
DutyPersonShiftDto
>
dutyShift
,
String
startTime
)
;
/**
* 添加值班人的信息 可以保存空信息
* @param instanceId
* @param dutyShiftList
*/
public
void
insertPersonShift
(
Long
instanceId
,
List
<
DutyPersonShiftDto
>
dutyShiftList
);
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/service/IDutyFireFightingService.java
0 → 100644
View file @
2c165567
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
service
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingDto
;
public
interface
IDutyFireFightingService
extends
IDutyCommonService
{
/**
* 值班信息保存
* @param DutyFireFightingDto 对象
* @return List<DutyCarDto>
*/
DutyFireFightingDto
save
(
DutyFireFightingDto
dto
);
/**
* 更新
* @param instanceId 实例id
* @param DutyFireFightingDto 业务对象
* @return List<DutyCarDto>
*/
DutyFireFightingDto
update
(
Long
instanceId
,
DutyFireFightingDto
dto
);
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/service/IOrgUsrService.java
View file @
2c165567
...
@@ -216,4 +216,10 @@ public interface IOrgUsrService {
...
@@ -216,4 +216,10 @@ public interface IOrgUsrService {
* @return
* @return
*/
*/
List
<
OrgUsrExcelDto
>
exportPersonToExcelByParentId
(
Long
parentId
);
List
<
OrgUsrExcelDto
>
exportPersonToExcelByParentId
(
Long
parentId
);
/**
* 查询目标公司下所有人员的简要信息,数据包含:所在公司id和name ,人员id和name,岗位id和name
* @param ids
* @return
*/
public
List
<
Map
<
String
,
Object
>>
getPersonDetailByCompanyIds
(
List
<
String
>
ids
);
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/WaterResourceMapper.xml
View file @
2c165567
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
rn.quality_situation_info,
rn.quality_situation_info,
rn.season_change_info,
rn.season_change_info,
rn.has_dry_season,
rn.has_dry_season,
(case r.has_dry_season when 0 then '有' when 1 then '无' end) hasDrySeasonType,
(case r
n
.has_dry_season when 0 then '有' when 1 then '无' end) hasDrySeasonType,
rn.dry_period_span,
rn.dry_period_span,
rp.intake_height,
rp.intake_height,
rp.elevation_difference,
rp.elevation_difference,
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/enums/ExcelEnums.java
View file @
2c165567
...
@@ -25,8 +25,8 @@ public enum ExcelEnums {
...
@@ -25,8 +25,8 @@ public enum ExcelEnums {
// BUG 2455 相关代码 bykongfm
// BUG 2455 相关代码 bykongfm
TGRY
(
"特岗人员"
,
"特岗人员"
,
"com.yeejoin.amos.boot.module.common.api.dto.SpecialPositionStaffDto"
,
"TGRY"
),
//("TGRY","特岗人员")
TGRY
(
"特岗人员"
,
"特岗人员"
,
"com.yeejoin.amos.boot.module.common.api.dto.SpecialPositionStaffDto"
,
"TGRY"
),
//("TGRY","特岗人员")
JYZB
(
"救援装备"
,
"救援装备"
,
"com.yeejoin.amos.boot.module.common.api.dto.RescueEquipmentDto"
,
"JYZB"
),
//("JYZB","救援装备")
JYZB
(
"救援装备"
,
"救援装备"
,
"com.yeejoin.amos.boot.module.common.api.dto.RescueEquipmentDto"
,
"JYZB"
),
//("JYZB","救援装备")
XFZB
(
"消防装备"
,
"消防装备"
,
"com.yeejoin.amos.boot.module.common.api.dto.EquipmentDetailDownloadTemplateDto"
,
"XFZB"
)
;
//("XFZB","消防装备")
XFZB
(
"消防装备"
,
"消防装备"
,
"com.yeejoin.amos.boot.module.common.api.dto.EquipmentDetailDownloadTemplateDto"
,
"XFZB"
)
,
//("XFZB","消防装备")
WXXFZB
(
"微型消防站值班"
,
"微型消防站值班"
,
"com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingExcleDto"
,
"WXXFZB"
);
//("WXXFZB","微型消防站值班")
private
String
fileName
;
private
String
fileName
;
private
String
sheetName
;
private
String
sheetName
;
private
String
classUrl
;
private
String
classUrl
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/mapper/ElevatorMapper.java
View file @
2c165567
...
@@ -22,11 +22,7 @@ public interface ElevatorMapper extends BaseMapper<Elevator> {
...
@@ -22,11 +22,7 @@ public interface ElevatorMapper extends BaseMapper<Elevator> {
Long
sequenceNbr
,
Long
sequenceNbr
,
int
current
,
int
size
);
int
current
,
int
size
);
List
<
ElevatorWlInfoDto
>
queryElevatorListDetails
(
String
address
,
List
<
ElevatorWlInfoDto
>
queryElevatorListDetails
(
String
registerCode
,
Integer
rescueCode
,
String
type
,
Integer
dealStatus
,
Long
sequenceNbr
Long
sequenceNbr
);
);
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/resources/mapper/ElevatorMapper.xml
View file @
2c165567
...
@@ -5,13 +5,13 @@
...
@@ -5,13 +5,13 @@
select
select
te.sequence_nbr sequenceNbr,
te.sequence_nbr sequenceNbr,
concat(te.province,te.city,te.district) area,
concat(te.province,te.city,te.district) area,
te.category,
te.
device_category
category,
te.register_code registerCode,
te.register_code registerCode,
te.rescue_code rescueCode,
te.rescue_code rescueCode,
te.address ,
te.address ,
te
a
.start_date happenTime,
te.start_date happenTime,
te
a
.type ,
te.type ,
case te
a
.deal_status
case te.deal_status
when '0' then '处置完成'
when '0' then '处置完成'
when '1' then '故障发生'
when '1' then '故障发生'
when '2' then '发出通知'
when '2' then '发出通知'
...
@@ -21,8 +21,7 @@
...
@@ -21,8 +21,7 @@
ELSE '' END dealStatus,
ELSE '' END dealStatus,
'电梯' categoryName,
'电梯' categoryName,
'立信远大科技有限公司' IotServiceProvider
'立信远大科技有限公司' IotServiceProvider
from tcb_elevator te inner join tz_elevator_alarm tea on
from tz_elevator_alarm te
te.register_code = tea.register_code
where 1=1
where 1=1
<if
test=
"address != null and address != ''"
>
<if
test=
"address != null and address != ''"
>
and te.address like CONCAT(CONCAT('%',#{address}),'%')
and te.address like CONCAT(CONCAT('%',#{address}),'%')
...
@@ -34,14 +33,15 @@
...
@@ -34,14 +33,15 @@
and te.rescue_code like CONCAT(CONCAT('%',#{rescueCode}),'%')
and te.rescue_code like CONCAT(CONCAT('%',#{rescueCode}),'%')
</if>
</if>
<if
test=
"type != null and type != ''"
>
<if
test=
"type != null and type != ''"
>
and te
c
.type = #{type}
and te.type = #{type}
</if>
</if>
<if
test=
"dealStatus != null and dealStatus != ''"
>
sequenceNbr
<if
test=
"dealStatus != null and dealStatus != ''"
>
and te
c
.deal_status = #{dealStatus}
and te.deal_status = #{dealStatus}
</if>
</if>
<if
test=
"sequenceNbr != null and sequenceNbr != ''"
>
<if
test=
"sequenceNbr != null and sequenceNbr != ''"
>
and te.sequence_nbr = #{sequenceNbr}
and te.sequence_nbr = #{sequenceNbr}
</if>
</if>
group by register_code
order by start_date DESC limit #{current},#{size}
order by start_date DESC limit #{current},#{size}
</select>
</select>
...
@@ -49,13 +49,13 @@
...
@@ -49,13 +49,13 @@
select
select
te.sequence_nbr sequenceNbr,
te.sequence_nbr sequenceNbr,
concat(te.province,te.city,te.district) area,
concat(te.province,te.city,te.district) area,
te.category,
te.
device_category
category,
te.register_code registerCode,
te.register_code registerCode,
te.rescue_code rescueCode,
te.rescue_code rescueCode,
te.address ,
te.address ,
te
a
.start_date happenTime,
te.start_date happenTime,
te
a
.type ,
te.type ,
case te
a
.deal_status
case te.deal_status
when '0' then '处置完成'
when '0' then '处置完成'
when '1' then '故障发生'
when '1' then '故障发生'
when '2' then '发出通知'
when '2' then '发出通知'
...
@@ -65,8 +65,7 @@
...
@@ -65,8 +65,7 @@
ELSE '' END dealStatus,
ELSE '' END dealStatus,
'电梯' categoryName,
'电梯' categoryName,
'立信远大科技有限公司' IotServiceProvider
'立信远大科技有限公司' IotServiceProvider
from tcb_elevator te inner join tz_elevator_alarm tea on
from tz_elevator_alarm te
te.register_code = tea.register_code
where 1=1
where 1=1
<if
test=
"sequenceNbr != null and sequenceNbr != ''"
>
<if
test=
"sequenceNbr != null and sequenceNbr != ''"
>
and te.sequence_nbr = #{sequenceNbr}
and te.sequence_nbr = #{sequenceNbr}
...
@@ -77,9 +76,9 @@
...
@@ -77,9 +76,9 @@
select count(1) from (
select count(1) from (
select
select
te.sequence_nbr
te.sequence_nbr
from tcb_elevator te inner join tz_elevator_alarm tea on
from tz_elevator_alarm te
te.register_code = tea.register_code
where 1=1
where 1=1
group by register_code order by start_date desc
) te
) te
</select>
</select>
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/DutyCarController.java
View file @
2c165567
...
@@ -33,7 +33,7 @@ import java.util.Map;
...
@@ -33,7 +33,7 @@ import java.util.Map;
@Api
(
tags
=
"值班车辆接口Api"
)
@Api
(
tags
=
"值班车辆接口Api"
)
@RequestMapping
(
value
=
"/common/duty-car"
)
@RequestMapping
(
value
=
"/common/duty-car"
)
public
class
DutyCarController
extends
BaseController
{
public
class
DutyCarController
extends
BaseController
{
@Autowired
@Autowired
IDutyCarService
iDutyCarService
;
IDutyCarService
iDutyCarService
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/DutyFireFightingController.java
0 → 100644
View file @
2c165567
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
controller
;
import
java.text.ParseException
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingDto
;
import
com.yeejoin.amos.boot.module.common.api.service.IDutyFireFightingService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
@RestController
@Api
(
tags
=
"微型消防站值班接口Api"
)
@RequestMapping
(
value
=
"/common/duty-FireFighting"
)
public
class
DutyFireFightingController
extends
BaseController
{
@Autowired
IDutyFireFightingService
iDutyFireFightingService
;
/**
* 值班列表视图--分页
*
* @return ResponseModel
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page-list"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"值班列表视图-分页"
,
notes
=
"值班列表视图-分页"
)
public
ResponseModel
<
IPage
<
Map
<
String
,
Object
>>>
pageList
(
@ApiParam
(
value
=
"开始日期"
,
required
=
true
)
@RequestParam
String
beginDate
,
@ApiParam
(
value
=
"结束日期"
,
required
=
true
)
@RequestParam
String
endDate
,
@ApiParam
(
value
=
"当前页"
,
required
=
true
)
@RequestParam
(
value
=
"current"
)
int
current
,
@ApiParam
(
value
=
"页面大小"
,
required
=
true
)
@RequestParam
(
value
=
"size"
)
int
size
)
throws
ParseException
{
return
ResponseHelper
.
buildResponse
(
iDutyFireFightingService
.
pageList
(
current
,
size
,
beginDate
,
endDate
));
}
/**
* 值班列表视图--不分页
*
* @return ResponseModel
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/list"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"值班列表视图-不分页"
,
notes
=
"值班列表视图-不分页"
)
public
ResponseModel
list
(
@ApiParam
(
value
=
"开始日期"
,
required
=
true
)
@RequestParam
String
beginDate
,
@ApiParam
(
value
=
"结束日期"
,
required
=
true
)
@RequestParam
String
endDate
)
throws
ParseException
{
return
ResponseHelper
.
buildResponse
(
iDutyFireFightingService
.
list
(
null
,
beginDate
,
endDate
));
}
/**
* 值班月视图
*
* @return ResponseModel
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
"/statistics-day"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"值班月视图"
,
notes
=
"值班月视图"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
dutyDetail
(
@ApiParam
(
value
=
"开始日期"
,
required
=
true
)
@RequestParam
String
beginDate
,
@ApiParam
(
value
=
"结束日期"
,
required
=
true
)
@RequestParam
String
endDate
)
throws
ParseException
{
return
ResponseHelper
.
buildResponse
(
iDutyFireFightingService
.
statisticsDay
(
beginDate
,
endDate
));
}
/**
* 调班
*
* @return ResponseModel
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
"/duty-adjust"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"调班保存"
,
notes
=
"调班保存"
)
public
ResponseModel
dutyAdjustSave
(
@RequestBody
DutyFireFightingDto
dto
)
{
return
ResponseHelper
.
buildResponse
(
iDutyFireFightingService
.
save
(
dto
));
}
/**
* 调班
*
* @param instanceId 实例id
* @param dutyCarDto 业务对象
* @return DutyCarDto
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
"/duty-adjust"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"调班更新"
,
notes
=
"调班更新"
)
public
ResponseModel
dutyAdjustUpdate
(
@RequestParam
Long
instanceId
,
@RequestBody
DutyFireFightingDto
dto
)
{
return
ResponseHelper
.
buildResponse
(
iDutyFireFightingService
.
update
(
instanceId
,
dto
));
}
/**
* 微型消防站导出
*
* @return ResponseModel
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
"/exportExcel"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"微型消防站导出"
,
notes
=
"微型消防站导出"
)
public
ResponseModel
exportExcel
(
HttpServletResponse
response
,
@ApiParam
(
value
=
"开始日期"
,
required
=
true
)
@RequestParam
String
beginDate
,
@ApiParam
(
value
=
"结束日期"
,
required
=
true
)
@RequestParam
String
endDate
)
throws
ParseException
{
return
ResponseHelper
.
buildResponse
(
iDutyFireFightingService
.
downloadList
(
beginDate
,
endDate
));
}
/**
* 值班数据删除
*
* @param instanceId 实例id
* @param startTime 开始时间
* @param endTime 结束时间
* @return ResponseModel
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
"/{instanceId}/{startTime}/{endTime}"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"值班数据删除"
,
notes
=
"值班数据删除"
)
public
ResponseModel
deleteDutyData
(
@PathVariable
Long
instanceId
,
@PathVariable
String
startTime
,
@PathVariable
String
endTime
)
{
if
(
ValidationUtil
.
isEmpty
(
instanceId
)
||
ValidationUtil
.
isEmpty
(
startTime
)
||
ValidationUtil
.
isEmpty
(
endTime
)){
throw
new
BadRequest
(
"参数校验失败."
);
}
return
ResponseHelper
.
buildResponse
(
iDutyFireFightingService
.
deleteDutyData
(
instanceId
,
startTime
,
endTime
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
"查询指定日期值班人信息列表"
)
@GetMapping
(
"/person/{dutyDay}/list"
)
public
ResponseModel
listDutyPerson
(
@ApiParam
(
value
=
"值班日期"
,
required
=
true
)
@PathVariable
String
dutyDay
,
@ApiParam
(
value
=
"班次id"
)
@RequestParam
(
required
=
false
)
Long
shiftId
,
@ApiParam
(
value
=
"岗位"
)
@RequestParam
(
required
=
false
)
String
postType
){
return
ResponseHelper
.
buildResponse
(
iDutyFireFightingService
.
dayDutyPersonList
(
dutyDay
,
shiftId
,
postType
));
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/DutyPersonController.java
View file @
2c165567
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
controller
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
controller
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
java.text.ParseException
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
java.util.List
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto
;
import
java.util.Map
;
import
com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService
;
import
javax.servlet.http.HttpServletResponse
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
...
@@ -17,11 +23,14 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
...
@@ -17,11 +23,14 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.servlet.http.HttpServletRequest
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
javax.servlet.http.HttpServletResponse
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
java.text.ParseException
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto
;
import
java.util.List
;
import
com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService
;
import
java.util.Map
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
/**
/**
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/FireExpertsController.java
View file @
2c165567
...
@@ -55,7 +55,7 @@ public class FireExpertsController extends BaseController {
...
@@ -55,7 +55,7 @@ public class FireExpertsController extends BaseController {
@Autowired
@Autowired
DataDictionaryServiceImpl
dataDictionaryService
;
DataDictionaryServiceImpl
dataDictionaryService
;
/**
/**
...
@@ -67,6 +67,9 @@ public class FireExpertsController extends BaseController {
...
@@ -67,6 +67,9 @@ public class FireExpertsController extends BaseController {
@PostMapping
(
value
=
"/save"
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
public
ResponseModel
<
FireExpertsDto
>
save
(
@RequestBody
FireExpertsDto
model
)
{
public
ResponseModel
<
FireExpertsDto
>
save
(
@RequestBody
FireExpertsDto
model
)
{
String
expertCode
=
model
.
getExpertCode
();
DataDictionary
zjly
=
dataDictionaryService
.
getByCode
(
expertCode
,
"ZJLY"
);
model
.
setExpert
(
zjly
.
getName
());
model
=
fireExpertsServiceImpl
.
createWithModel
(
model
);
model
=
fireExpertsServiceImpl
.
createWithModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/FirefightersPostController.java
View file @
2c165567
...
@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.common.biz.controller;
...
@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.common.biz.controller;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
com.yeejoin.amos.boot.biz.common.entity.DataDictionary
;
import
com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
...
@@ -57,6 +59,9 @@ public class FirefightersPostController extends BaseController {
...
@@ -57,6 +59,9 @@ public class FirefightersPostController extends BaseController {
@Autowired
@Autowired
FirefightersWorkexperienceServiceImpl
ifirefightersWorkexperienceService
;
FirefightersWorkexperienceServiceImpl
ifirefightersWorkexperienceService
;
@Autowired
@Autowired
DataDictionaryServiceImpl
dataDictionaryService
;
@Autowired
RedisUtils
redisUtils
;
RedisUtils
redisUtils
;
@Value
(
"${redis.cache.failure.time}"
)
@Value
(
"${redis.cache.failure.time}"
)
private
long
time
;
private
long
time
;
...
@@ -81,6 +86,13 @@ public class FirefightersPostController extends BaseController {
...
@@ -81,6 +86,13 @@ public class FirefightersPostController extends BaseController {
queryWrapper
.
eq
(
"firefighters_id"
,
firefightersDataDto
.
getFirefightersPost
().
getFirefightersId
());
queryWrapper
.
eq
(
"firefighters_id"
,
firefightersDataDto
.
getFirefightersPost
().
getFirefightersId
());
FirefightersPost
firefightersPost
=
iFirefightersPostService
.
getOne
(
queryWrapper
);
FirefightersPost
firefightersPost
=
iFirefightersPostService
.
getOne
(
queryWrapper
);
/*bug3071 消防人员,专家领域选择子分类时概要信息中专家领域未显示 2021-10-09 chenzhao */
if
(
firefightersDataDto
.
getFirefightersPost
().
getAreasExpertiseCode
()
!=
null
){
String
areasExpertiseCode
=
firefightersDataDto
.
getFirefightersPost
().
getAreasExpertiseCode
();
DataDictionary
zjly
=
dataDictionaryService
.
getByCode
(
areasExpertiseCode
,
"ZJLY"
);
firefightersDataDto
.
getFirefightersPost
().
setAreasExpertise
(
zjly
.
getName
());
}
/*bug3071 消防人员,专家领域选择子分类时概要信息中专家领域未显示 2021-10-09 chenzhao */
if
(
firefightersPost
==
null
)
{
if
(
firefightersPost
==
null
)
{
iFirefightersPostService
.
save
(
firefightersDataDto
.
getFirefightersPost
());
iFirefightersPostService
.
save
(
firefightersDataDto
.
getFirefightersPost
());
}
else
{
}
else
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/OrgUsrController.java
View file @
2c165567
...
@@ -12,8 +12,10 @@ import com.yeejoin.amos.boot.biz.common.constants.CommonConstant;
...
@@ -12,8 +12,10 @@ import com.yeejoin.amos.boot.biz.common.constants.CommonConstant;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
import
com.yeejoin.amos.boot.module.common.api.dto.*
;
import
com.yeejoin.amos.boot.module.common.api.dto.*
;
import
com.yeejoin.amos.boot.module.common.api.entity.FireTeam
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient
;
import
com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient
;
import
com.yeejoin.amos.boot.module.common.api.mapper.FireTeamMapper
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.ESOrgUsrService
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.ESOrgUsrService
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
...
@@ -51,6 +53,10 @@ public class OrgUsrController extends BaseController {
...
@@ -51,6 +53,10 @@ public class OrgUsrController extends BaseController {
OrgUsrServiceImpl
iOrgUsrService
;
OrgUsrServiceImpl
iOrgUsrService
;
@Autowired
@Autowired
ESOrgUsrService
eSOrgUsrService
;
ESOrgUsrService
eSOrgUsrService
;
@Autowired
FireTeamMapper
fireTeamMapper
;
@Autowired
@Autowired
EmqKeeper
emqKeeper
;
EmqKeeper
emqKeeper
;
@Value
(
"${jcs.company.topic.delete}"
)
@Value
(
"${jcs.company.topic.delete}"
)
...
@@ -85,19 +91,16 @@ public class OrgUsrController extends BaseController {
...
@@ -85,19 +91,16 @@ public class OrgUsrController extends BaseController {
public
ResponseModel
<
String
>
deleteById
(
HttpServletRequest
request
,
@PathVariable
Long
id
)
{
public
ResponseModel
<
String
>
deleteById
(
HttpServletRequest
request
,
@PathVariable
Long
id
)
{
// 删除时,只作逻辑删除
// 删除时,只作逻辑删除
// BUG 2741 首先判断是否为公司 如果公司底下有人员不可直接删除 bykongfm
// BUG 2741 首先判断是否为公司 如果公司底下有人员不可直接删除 bykongfm
OrgUsr
tempOrg
=
iOrgUsrService
.
getById
(
id
.
toString
());
if
(
tempOrg
.
getBizOrgType
().
equals
(
"COMPANY"
))
{
List
<
OrgUsr
>
tempList
=
iOrgUsrService
.
list
(
new
LambdaQueryWrapper
<
OrgUsr
>().
eq
(
OrgUsr:
:
getParentId
,
id
).
eq
(
OrgUsr:
:
getIsDelete
,
false
));
if
(
tempList
.
size
()
>
0
)
{
return
ResponseHelper
.
buildResponse
(
"-1"
);
}
}
//bug 2882 判断是否为部门 如果部门底下有人员不可直接删除 chenzhao 2021-09-27 start
//bug 2882 判断是否为部门 如果部门底下有人员不可直接删除 chenzhao 2021-09-27 start
if
(
tempOrg
.
getBizOrgType
().
equals
(
"DEPARTMENT"
))
{
OrgUsr
tempOrg
=
iOrgUsrService
.
getById
(
id
.
toString
());
if
(
tempOrg
.
getBizOrgType
().
equals
(
"COMPANY"
)
||
tempOrg
.
getBizOrgType
().
equals
(
"DEPARTMENT"
))
{
List
<
OrgUsr
>
tempList
=
iOrgUsrService
.
list
(
new
LambdaQueryWrapper
<
OrgUsr
>().
eq
(
OrgUsr:
:
getParentId
,
id
).
eq
(
OrgUsr:
:
getIsDelete
,
false
));
List
<
OrgUsr
>
tempList
=
iOrgUsrService
.
list
(
new
LambdaQueryWrapper
<
OrgUsr
>().
eq
(
OrgUsr:
:
getParentId
,
id
).
eq
(
OrgUsr:
:
getIsDelete
,
false
));
if
(
tempList
.
size
()
>
0
)
{
/*bug3031 删除机场单位后,队伍所属单位字段数据未清空 2021-10-09 start*/
List
<
FireTeam
>
fireTeams
=
fireTeamMapper
.
listFireTeamById
(
id
);
if
(
tempList
.
size
()
>
0
||
fireTeams
.
size
()
>
0
)
{
return
ResponseHelper
.
buildResponse
(
"-1"
);
return
ResponseHelper
.
buildResponse
(
"-1"
);
}
}
/*bug3031 删除机场单位后,队伍所属单位字段数据未清空 2021-10-09 end*/
}
}
//bug 2882 判断是否为部门 如果部门底下有人员不可直接删除 chenzhao 2021-09-27 end
//bug 2882 判断是否为部门 如果部门底下有人员不可直接删除 chenzhao 2021-09-27 end
// iOrgUsrService.update(new UpdateWrapper<OrgUsr>().eq("sequence_nbr", id).set("is_delete", CommonConstant.IS_DELETE_01));
// iOrgUsrService.update(new UpdateWrapper<OrgUsr>().eq("sequence_nbr", id).set("is_delete", CommonConstant.IS_DELETE_01));
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/DutyCarServiceImpl.java
View file @
2c165567
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.DutyPersonShift
;
import
com.yeejoin.amos.boot.module.common.api.entity.DutyPersonShift
;
import
com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn
;
import
com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn
;
import
com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance
;
import
com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance
;
...
@@ -12,23 +29,6 @@ import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
...
@@ -12,23 +29,6 @@ import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import
com.yeejoin.amos.boot.module.common.api.mapper.FirefightersMapper
;
import
com.yeejoin.amos.boot.module.common.api.mapper.FirefightersMapper
;
import
com.yeejoin.amos.boot.module.common.api.service.IDutyCarService
;
import
com.yeejoin.amos.boot.module.common.api.service.IDutyCarService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
/**
/**
* @author DELL
* @author DELL
*/
*/
...
@@ -58,14 +58,6 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
...
@@ -58,14 +58,6 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
public
DutyCarDto
save
(
DutyCarDto
dutyCarDto
)
{
public
DutyCarDto
save
(
DutyCarDto
dutyCarDto
)
{
// BUG 2807 更新人员车辆排版值班的保存逻辑 如果没有填写数据则保存空数据 。 同步修改 查询 导出相关逻辑 by kongfm 2021-09-14
// BUG 2807 更新人员车辆排版值班的保存逻辑 如果没有填写数据则保存空数据 。 同步修改 查询 导出相关逻辑 by kongfm 2021-09-14
//1.保存行数据
//1.保存行数据
String
groupCode
=
this
.
getGroupCode
();
String
userId
=
dutyCarDto
.
getUserId
();
List
<
DynamicFormInstance
>
instances
=
dynamicFormInstanceService
.
list
(
new
LambdaQueryWrapper
<
DynamicFormInstance
>().
eq
(
DynamicFormInstance:
:
getFieldCode
,
"userId"
)
.
eq
(
DynamicFormInstance:
:
getFieldValue
,
userId
)
.
eq
(
DynamicFormInstance:
:
getGroupCode
,
this
.
getGroupCode
()));
Long
instanceId
=
null
;
if
(
StringUtils
.
isNotEmpty
(
dutyCarDto
.
getDutyAreaId
()))
{
if
(
StringUtils
.
isNotEmpty
(
dutyCarDto
.
getDutyAreaId
()))
{
// 根据建筑id 查找建筑
// 根据建筑id 查找建筑
ResponseModel
<
Map
<
String
,
Object
>>
response
=
null
;
ResponseModel
<
Map
<
String
,
Object
>>
response
=
null
;
...
@@ -78,102 +70,28 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
...
@@ -78,102 +70,28 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
dutyCarDto
.
setDutyArea
(
result
.
get
(
"name"
).
toString
());
dutyCarDto
.
setDutyArea
(
result
.
get
(
"name"
).
toString
());
}
}
Map
<
String
,
Object
>
map
=
Bean
.
BeantoMap
(
dutyCarDto
);
Map
<
String
,
Object
>
map
=
Bean
.
BeantoMap
(
dutyCarDto
);
if
(!
instances
.
isEmpty
())
{
// 0.定位instanceId,准备进行更新操作
// 修改操作动态表单的方法,修改人陈浩 -------------start 2021-09-28
instanceId
=
instances
.
get
(
0
).
getInstanceId
();
// 已经有了走更新方法
Long
instanceId
=
excuteDynamicFormInstance
(
dutyCarDto
.
getUserId
(),
map
,
this
.
getGroupCode
());
//1.查询已有数据
saveDutyPersonShiftDetail
(
instanceId
,
dutyCarDto
.
getDutyShift
()
,
dutyCarDto
.
getStartTime
())
;
List
<
DynamicFormInstance
>
hasInstances
=
dynamicFormInstanceService
.
list
(
new
LambdaQueryWrapper
<
DynamicFormInstance
>().
eq
(
DynamicFormInstance:
:
getInstanceId
,
instanceId
));
insertPersonShift
(
instanceId
,
dutyCarDto
.
getDutyShift
());
//2.list 转 map
// 修改操作动态表单的方法,修改人陈浩 -------------end 2021-09-28
Map
<
Object
,
DynamicFormInstance
>
instanceMap
=
Bean
.
listToMap
(
hasInstances
,
"fieldCode"
,
DynamicFormInstance
.
class
);
//3.查询列数据,已列为主
List
<
DynamicFormColumn
>
columns
=
dynamicFormColumnService
.
list
(
new
LambdaQueryWrapper
<
DynamicFormColumn
>().
eq
(
DynamicFormColumn:
:
getGroupCode
,
groupCode
));
//4.已列为主 填充动态表单数据
List
<
DynamicFormInstance
>
entrys
=
new
ArrayList
<>();
for
(
DynamicFormColumn
column
:
columns
)
{
DynamicFormInstance
formInstance
=
instanceMap
.
get
(
column
.
getFieldCode
());
if
(!
ObjectUtils
.
isEmpty
(
formInstance
))
{
//有的更新
formInstance
.
setFieldValue
(
map
.
get
(
column
.
getFieldCode
())
!=
null
?
map
.
get
(
column
.
getFieldCode
()).
toString
()
:
""
);
}
else
{
//没有的新增
formInstance
=
new
DynamicFormInstance
();
buildFormInstanceData
(
instanceId
,
map
,
column
,
formInstance
);
}
entrys
.
add
(
formInstance
);
}
if
(!
entrys
.
isEmpty
()){
dynamicFormInstanceService
.
saveOrUpdateBatch
(
entrys
);
}
}
else
{
instanceId
=
dynamicFormInstanceService
.
commonSave
(
groupCode
,
map
);
}
if
(
dutyCarDto
.
getDutyShift
()
!=
null
&&
dutyCarDto
.
getDutyShift
().
size
()
==
0
)
{
Calendar
startDate
=
Calendar
.
getInstance
();
startDate
.
setTime
(
DateUtils
.
longStr2Date
(
dutyCarDto
.
getStartTime
()));
int
dates
=
startDate
.
getActualMaximum
(
Calendar
.
DAY_OF_MONTH
);
startDate
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
List
<
DutyPersonShift
>
dutyShift
=
new
ArrayList
<>(
dates
);
for
(
int
i
=
0
;
i
<
dates
;
i
++)
{
DutyPersonShift
temp
=
new
DutyPersonShift
();
temp
.
setAppKey
(
RequestContext
.
getAppKey
());
temp
.
setDutyDate
(
startDate
.
getTime
());
temp
.
setIsDelete
(
false
);
temp
.
setInstanceId
(
instanceId
);
dutyShift
.
add
(
temp
);
startDate
.
add
(
Calendar
.
DAY_OF_YEAR
,
1
);
}
dutyPersonShiftService
.
saveOrUpdateBatch
(
dutyShift
);
}
//2.保存值班信息
insertPersonShift
(
instanceId
,
dutyCarDto
);
//3.返回保存后的数据
//3.返回保存后的数据
return
dutyCarDto
;
return
dutyCarDto
;
}
}
@Override
@Override
public
DutyCarDto
update
(
Long
instanceId
,
DutyCarDto
dutyCarDto
)
{
public
DutyCarDto
update
(
Long
instanceId
,
DutyCarDto
dutyCarDto
)
{
String
groupCode
=
this
.
getGroupCode
();
//1.查询已有数据
//修改操作动态表单修改的逻辑方法,陈浩 start ----2021-09-28
List
<
DynamicFormInstance
>
instances
=
dynamicFormInstanceService
.
list
(
new
LambdaQueryWrapper
<
DynamicFormInstance
>().
eq
(
DynamicFormInstance:
:
getInstanceId
,
instanceId
));
updateDynamicFormInstance
(
this
.
getGroupCode
(),
instanceId
,
Bean
.
BeantoMap
(
dutyCarDto
));
//2.list 转 map
//修改操作动态表单修改的逻辑方法,陈浩 end ----2021-09-28
Map
<
Object
,
DynamicFormInstance
>
instanceMap
=
Bean
.
listToMap
(
instances
,
"fieldCode"
,
DynamicFormInstance
.
class
);
//3.查询列数据,已列为主
List
<
DynamicFormColumn
>
columns
=
dynamicFormColumnService
.
list
(
new
LambdaQueryWrapper
<
DynamicFormColumn
>().
eq
(
DynamicFormColumn:
:
getGroupCode
,
groupCode
));
//页面数据转Map
Map
<
String
,
Object
>
map
=
Bean
.
BeantoMap
(
dutyCarDto
);
//4.已列为主 填充动态表单数据
List
<
DynamicFormInstance
>
entrys
=
new
ArrayList
<>();
updateFormValue
(
entrys
,
map
,
instanceId
,
columns
,
instanceMap
);
if
(!
entrys
.
isEmpty
())
{
dynamicFormInstanceService
.
saveOrUpdateBatch
(
entrys
);
}
//5.更新值班信息人日期数据
//5.更新值班信息人日期数据
insertPersonShift
(
instanceId
,
dutyCarDto
);
insertPersonShift
(
instanceId
,
dutyCarDto
.
getDutyShift
()
);
return
dutyCarDto
;
return
dutyCarDto
;
}
}
private
void
insertPersonShift
(
Long
instanceId
,
DutyCarDto
dutyCarDto
)
{
Set
<
DutyPersonShift
>
personShiftList
=
dutyCarDto
.
getDutyShift
().
stream
().
map
(
dto
->
{
// BUG 2807 修改时发现BUG 车辆保存有问题 by kongfm 2021-09-14
// 根据instanceId 和 日期查找 如果有则更新
DutyPersonShift
dutyPersonShift
=
dutyPersonShiftService
.
getOne
(
new
LambdaQueryWrapper
<
DutyPersonShift
>().
eq
(
DutyPersonShift:
:
getInstanceId
,
instanceId
).
eq
(
DutyPersonShift:
:
getDutyDate
,
dto
.
getDutyDate
()));
if
(
dutyPersonShift
==
null
)
{
dutyPersonShift
=
new
DutyPersonShift
();
}
dto
.
setInstanceId
(
instanceId
);
Bean
.
copyExistPropertis
(
dto
,
dutyPersonShift
);
dutyPersonShift
.
setAppKey
(
RequestContext
.
getAppKey
());
return
dutyPersonShift
;
}).
collect
(
Collectors
.
toSet
());
if
(!
personShiftList
.
isEmpty
())
{
dutyPersonShiftService
.
saveOrUpdateBatch
(
personShiftList
);
}
}
private
void
buildFormInstanceData
(
Long
instanceId
,
Map
<
String
,
Object
>
map
,
DynamicFormColumn
column
,
DynamicFormInstance
formInstance
)
{
private
void
buildFormInstanceData
(
Long
instanceId
,
Map
<
String
,
Object
>
map
,
DynamicFormColumn
column
,
DynamicFormInstance
formInstance
)
{
fillFormInstanceData
(
instanceId
,
map
,
column
,
formInstance
,
sequence
.
nextId
());
fillFormInstanceData
(
instanceId
,
map
,
column
,
formInstance
,
sequence
.
nextId
());
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/DutyCommonServiceImpl.java
View file @
2c165567
...
@@ -35,6 +35,7 @@ import com.baomidou.mybatisplus.core.toolkit.Sequence;
...
@@ -35,6 +35,7 @@ import com.baomidou.mybatisplus.core.toolkit.Sequence;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyShiftDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyShiftDto
;
...
@@ -294,8 +295,10 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
...
@@ -294,8 +295,10 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
String
fileName
;
String
fileName
;
if
(
"dutyCar"
.
equals
(
groupCode
))
{
if
(
"dutyCar"
.
equals
(
groupCode
))
{
list
=
jsonArray
.
toJavaList
(
DutyCarDto
.
class
);
list
=
jsonArray
.
toJavaList
(
DutyCarDto
.
class
);
}
else
{
}
else
if
(
"dutyPerson"
.
equals
(
groupCode
))
{
list
=
jsonArray
.
toJavaList
(
DutyPersonDto
.
class
);
list
=
jsonArray
.
toJavaList
(
DutyPersonDto
.
class
);
}
else
if
(
"dutyFireFighting"
.
equals
(
groupCode
)){
list
=
jsonArray
.
toJavaList
(
DutyFireFightingDto
.
class
);
}
}
return
list
;
return
list
;
}
}
...
@@ -487,4 +490,105 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
...
@@ -487,4 +490,105 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
public
List
<
Long
>
getDutyShiftIdList
()
{
public
List
<
Long
>
getDutyShiftIdList
()
{
return
getOnDuty
(
new
DateTime
());
return
getOnDuty
(
new
DateTime
());
}
}
/***
* 将操作动态表单的方法单独提出来
* @author 陈浩
* @serialData 2021-09-28
* @param userId
* @param map
* @param groupCode
* @return
*/
public
Long
excuteDynamicFormInstance
(
String
userId
,
Map
<
String
,
Object
>
map
,
String
groupCode
)
{
List
<
DynamicFormInstance
>
instances
=
dynamicFormInstanceService
.
list
(
new
LambdaQueryWrapper
<
DynamicFormInstance
>().
eq
(
DynamicFormInstance:
:
getFieldCode
,
"userId"
)
.
eq
(
DynamicFormInstance:
:
getFieldValue
,
userId
)
.
eq
(
DynamicFormInstance:
:
getGroupCode
,
this
.
getGroupCode
()));
Long
instanceId
=
null
;
if
(!
instances
.
isEmpty
())
{
// 0.定位instanceId,准备进行更新操作
instanceId
=
instances
.
get
(
0
).
getInstanceId
();
// 已经有了走更新方法
//1.查询已有数据
List
<
DynamicFormInstance
>
hasInstances
=
dynamicFormInstanceService
.
list
(
new
LambdaQueryWrapper
<
DynamicFormInstance
>().
eq
(
DynamicFormInstance:
:
getInstanceId
,
instanceId
));
//2.list 转 map
Map
<
Object
,
DynamicFormInstance
>
instanceMap
=
Bean
.
listToMap
(
hasInstances
,
"fieldCode"
,
DynamicFormInstance
.
class
);
//3.查询列数据,已列为主
List
<
DynamicFormColumn
>
columns
=
dynamicFormColumnService
.
list
(
new
LambdaQueryWrapper
<
DynamicFormColumn
>().
eq
(
DynamicFormColumn:
:
getGroupCode
,
groupCode
));
//4.已列为主 填充动态表单数据
List
<
DynamicFormInstance
>
entrys
=
new
ArrayList
<>();
for
(
DynamicFormColumn
column
:
columns
)
{
DynamicFormInstance
formInstance
=
instanceMap
.
get
(
column
.
getFieldCode
());
if
(!
ObjectUtils
.
isEmpty
(
formInstance
))
{
//有的更新
formInstance
.
setFieldValue
(
map
.
get
(
column
.
getFieldCode
())
!=
null
?
map
.
get
(
column
.
getFieldCode
()).
toString
()
:
""
);
}
else
{
//没有的新增
formInstance
=
new
DynamicFormInstance
();
buildFormInstanceData
(
instanceId
,
map
,
column
,
formInstance
);
}
entrys
.
add
(
formInstance
);
}
if
(!
entrys
.
isEmpty
()){
dynamicFormInstanceService
.
saveOrUpdateBatch
(
entrys
);
}
}
else
{
instanceId
=
dynamicFormInstanceService
.
commonSave
(
groupCode
,
map
);
}
return
instanceId
;
}
public
void
updateDynamicFormInstance
(
String
groupCode
,
Long
instanceId
,
Map
<
String
,
Object
>
map
)
{
//1.查询已有数据
List
<
DynamicFormInstance
>
instances
=
dynamicFormInstanceService
.
list
(
new
LambdaQueryWrapper
<
DynamicFormInstance
>().
eq
(
DynamicFormInstance:
:
getInstanceId
,
instanceId
));
//2.list 转 map
Map
<
Object
,
DynamicFormInstance
>
instanceMap
=
Bean
.
listToMap
(
instances
,
"fieldCode"
,
DynamicFormInstance
.
class
);
//3.查询列数据,已列为主
List
<
DynamicFormColumn
>
columns
=
dynamicFormColumnService
.
list
(
new
LambdaQueryWrapper
<
DynamicFormColumn
>().
eq
(
DynamicFormColumn:
:
getGroupCode
,
groupCode
));
//页面数据转Map
//4.已列为主 填充动态表单数据
List
<
DynamicFormInstance
>
entrys
=
new
ArrayList
<>();
updateFormValue
(
entrys
,
map
,
instanceId
,
columns
,
instanceMap
);
if
(!
entrys
.
isEmpty
())
{
dynamicFormInstanceService
.
saveOrUpdateBatch
(
entrys
);
}
}
public
void
saveDutyPersonShiftDetail
(
Long
instanceId
,
List
<
DutyPersonShiftDto
>
dutyShift
,
String
startTime
)
{
if
(
dutyShift
!=
null
&&
dutyShift
.
size
()
==
0
)
{
Calendar
startDate
=
Calendar
.
getInstance
();
startDate
.
setTime
(
DateUtils
.
longStr2Date
(
startTime
));
int
dates
=
startDate
.
getActualMaximum
(
Calendar
.
DAY_OF_MONTH
);
startDate
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
List
<
DutyPersonShift
>
dutyShiftList
=
new
ArrayList
<>(
dates
);
for
(
int
i
=
0
;
i
<
dates
;
i
++)
{
DutyPersonShift
temp
=
new
DutyPersonShift
();
temp
.
setAppKey
(
RequestContext
.
getAppKey
());
temp
.
setDutyDate
(
startDate
.
getTime
());
temp
.
setIsDelete
(
false
);
temp
.
setInstanceId
(
instanceId
);
dutyShiftList
.
add
(
temp
);
startDate
.
add
(
Calendar
.
DAY_OF_YEAR
,
1
);
}
dutyPersonShiftService
.
saveOrUpdateBatch
(
dutyShiftList
);
}
}
public
void
insertPersonShift
(
Long
instanceId
,
List
<
DutyPersonShiftDto
>
dutyShiftList
)
{
Set
<
DutyPersonShift
>
personShiftList
=
dutyShiftList
.
stream
().
map
(
dto
->
{
// BUG 2807 修改时发现BUG 车辆保存有问题 by kongfm 2021-09-14
// 根据instanceId 和 日期查找 如果有则更新
DutyPersonShift
dutyPersonShift
=
dutyPersonShiftService
.
getOne
(
new
LambdaQueryWrapper
<
DutyPersonShift
>().
eq
(
DutyPersonShift:
:
getInstanceId
,
instanceId
).
eq
(
DutyPersonShift:
:
getDutyDate
,
dto
.
getDutyDate
()));
if
(
dutyPersonShift
==
null
)
{
dutyPersonShift
=
new
DutyPersonShift
();
}
dto
.
setInstanceId
(
instanceId
);
Bean
.
copyExistPropertis
(
dto
,
dutyPersonShift
);
dutyPersonShift
.
setAppKey
(
RequestContext
.
getAppKey
());
return
dutyPersonShift
;
}).
collect
(
Collectors
.
toSet
());
if
(!
personShiftList
.
isEmpty
())
{
dutyPersonShiftService
.
saveOrUpdateBatch
(
personShiftList
);
}
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/DutyFireFightingServiceImpl.java
0 → 100644
View file @
2c165567
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FireStationDto
;
import
com.yeejoin.amos.boot.module.common.api.service.IDutyFireFightingService
;
@Service
public
class
DutyFireFightingServiceImpl
extends
DutyCommonServiceImpl
implements
IDutyFireFightingService
{
@Autowired
FireStationServiceImpl
fireStationServiceImpl
;
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
DutyFireFightingDto
save
(
DutyFireFightingDto
dto
)
{
// 根据微型消防站ID,获取微型消防站名称
FireStationDto
fireStationDtoResult
=
fireStationServiceImpl
.
queryBySeq
(
Long
.
parseLong
(
dto
.
getFireFightingId
()));
dto
.
setFireFighting
(
fireStationDtoResult
.
getName
());
Map
<
String
,
Object
>
map
=
Bean
.
BeantoMap
(
dto
);
Long
instanceId
=
excuteDynamicFormInstance
(
dto
.
getUserId
(),
map
,
this
.
getGroupCode
());
saveDutyPersonShiftDetail
(
instanceId
,
dto
.
getDutyShift
(),
dto
.
getStartTime
());
insertPersonShift
(
instanceId
,
dto
.
getDutyShift
());
return
dto
;
}
@Override
public
DutyFireFightingDto
update
(
Long
instanceId
,
DutyFireFightingDto
dto
)
{
updateDynamicFormInstance
(
this
.
getGroupCode
(),
instanceId
,
Bean
.
BeantoMap
(
dto
));
insertPersonShift
(
instanceId
,
dto
.
getDutyShift
());
return
dto
;
}
public
String
getGroupCode
()
{
return
"dutyFireFighting"
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/FireStationServiceImpl.java
View file @
2c165567
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.common.api.dto.FireStationDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FireStationDto
;
...
@@ -116,4 +117,25 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
...
@@ -116,4 +117,25 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
this
.
updateById
(
entity
);
this
.
updateById
(
entity
);
return
Bean
.
toModel
(
entity
,
model
);
return
Bean
.
toModel
(
entity
,
model
);
}
}
/**
* 列表查询 示例
*/
public
List
<
FireStation
>
queryForFireStationList
(
List
<
String
>
companyIdList
)
{
LambdaQueryWrapper
<
FireStation
>
wrapper
=
new
LambdaQueryWrapper
<
FireStation
>();
wrapper
.
eq
(
FireStation:
:
getIsDelete
,
false
);
wrapper
.
in
(
FireStation:
:
getBizCompanyId
,
companyIdList
);
return
this
.
baseMapper
.
selectList
(
wrapper
);
}
/**
* 查询当前公司下的所有微型消防站信息
* @param companyId
* @return
*/
public
List
<
Map
<
String
,
Object
>>
queryForFireStationListByCompanyId
(
Long
companyId
)
{
LambdaQueryWrapper
<
FireStation
>
wrapper
=
new
LambdaQueryWrapper
<
FireStation
>();
wrapper
.
eq
(
FireStation:
:
getIsDelete
,
false
);
wrapper
.
eq
(
FireStation:
:
getBizCompanyId
,
companyId
);
wrapper
.
select
(
FireStation:
:
getSequenceNbr
,
FireStation:
:
getName
);
return
this
.
baseMapper
.
selectMaps
(
wrapper
);
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/OrgUsrServiceImpl.java
View file @
2c165567
This source diff could not be displayed because it is too large. You can
view the blob
instead.
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/ExcelServiceImpl.java
View file @
2c165567
...
@@ -26,19 +26,25 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -26,19 +26,25 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
com.alibaba.excel.support.ExcelTypeEnum
;
import
com.alibaba.excel.support.ExcelTypeEnum
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Sequence
;
import
com.baomidou.mybatisplus.core.toolkit.Sequence
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.QRCodeUtil
;
import
com.yeejoin.amos.boot.biz.common.utils.QRCodeUtil
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.common.api.dto.CompanyPerson
;
import
com.yeejoin.amos.boot.module.common.api.dto.CompanyPerson
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyShiftDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyShiftDto
;
...
@@ -76,6 +82,7 @@ import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany;
...
@@ -76,6 +82,7 @@ import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany;
import
com.yeejoin.amos.boot.module.common.api.entity.RescueEquipment
;
import
com.yeejoin.amos.boot.module.common.api.entity.RescueEquipment
;
import
com.yeejoin.amos.boot.module.common.api.entity.SpecialPositionStaff
;
import
com.yeejoin.amos.boot.module.common.api.entity.SpecialPositionStaff
;
import
com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil
;
import
com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil
;
import
com.yeejoin.amos.boot.module.common.api.service.IDutyFireFightingService
;
import
com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService
;
import
com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService
;
import
com.yeejoin.amos.boot.module.common.api.service.IKeySiteService
;
import
com.yeejoin.amos.boot.module.common.api.service.IKeySiteService
;
import
com.yeejoin.amos.boot.module.common.api.service.IMaintenanceCompanyService
;
import
com.yeejoin.amos.boot.module.common.api.service.IMaintenanceCompanyService
;
...
@@ -304,6 +311,9 @@ public class ExcelServiceImpl {
...
@@ -304,6 +311,9 @@ public class ExcelServiceImpl {
case
"JYZB"
:
case
"JYZB"
:
excelImportLinkageUnitJYZBDto
(
multipartFile
);
excelImportLinkageUnitJYZBDto
(
multipartFile
);
break
;
break
;
case
"WXXFZB"
:
excelImportDutyPerson
(
multipartFile
,
"WXXFZB"
);
break
;
}
}
return
;
return
;
}
}
...
@@ -922,6 +932,9 @@ if (excelDtoList != null && excelDtoList.size() > 0) {
...
@@ -922,6 +932,9 @@ if (excelDtoList != null && excelDtoList.size() > 0) {
}
else
if
(
ExcelEnums
.
RYZB
.
getType
().
equals
(
dutyType
))
{
}
else
if
(
ExcelEnums
.
RYZB
.
getType
().
equals
(
dutyType
))
{
initDutyPersonData
(
sheet
,
dataList
,
dayByMonth
);
initDutyPersonData
(
sheet
,
dataList
,
dayByMonth
);
dutyPersonService
.
saveImportData
(
dataList
);
dutyPersonService
.
saveImportData
(
dataList
);
}
else
if
(
ExcelEnums
.
WXXFZB
.
getType
().
equals
(
dutyType
))
{
initDutyFireFightingData
(
sheet
,
dataList
,
dayByMonth
);
dutyPersonService
.
saveImportData
(
dataList
);
}
}
}
}
}
}
...
@@ -1034,7 +1047,56 @@ if (excelDtoList != null && excelDtoList.size() > 0) {
...
@@ -1034,7 +1047,56 @@ if (excelDtoList != null && excelDtoList.size() > 0) {
}
}
}
}
}
}
private
void
initDutyFireFightingData
(
XSSFSheet
sheet
,
List
<
Map
<
String
,
Object
>>
dataList
,
List
<
Date
>
dayByMonth
)
{
// 遍历行,i = 1,从第二行开始,第一行是表头跳过。
for
(
int
i
=
1
;
i
<
sheet
.
getPhysicalNumberOfRows
();
i
++)
{
DutyFireFightingDto
dutyFireFightingDto
=
new
DutyFireFightingDto
();
// row是一行数据,row.getCell(i),代表拿到这一行,第i列数据
Row
row
=
sheet
.
getRow
(
i
);
if
(
row
==
null
)
{
continue
;
}
Cell
cell
=
row
.
getCell
(
1
);
if
(
cell
==
null
){
continue
;
}
String
[]
split
=
cell
.
toString
().
split
(
"@"
);
dutyFireFightingDto
.
setTeamId
(
split
[
1
]);
dutyFireFightingDto
.
setTeamName
(
split
[
0
]);
cell
=
row
.
getCell
(
2
);
if
(
cell
!=
null
)
{
String
[]
splitStr
=
cell
.
toString
().
split
(
"@"
);
dutyFireFightingDto
.
setUserName
(
MAINTENANCE_PERSON
);
dutyFireFightingDto
.
setUserId
(
MAINTENANCE_PERSON
);
}
cell
=
row
.
getCell
(
3
);
if
(
cell
!=
null
)
{
String
[]
splitStr
=
cell
.
toString
().
split
(
"@"
);
dutyFireFightingDto
.
setPostTypeName
(
splitStr
[
0
]);
dutyFireFightingDto
.
setPostType
(
splitStr
[
1
]);
}
cell
=
row
.
getCell
(
4
);
if
(
cell
!=
null
)
{
String
[]
splitStr
=
cell
.
toString
().
split
(
"@"
);
dutyFireFightingDto
.
setFireFighting
(
splitStr
[
0
]);
dutyFireFightingDto
.
setFireFightingId
(
splitStr
[
1
]);
}
List
<
DutyPersonShiftDto
>
dutyShift
=
new
ArrayList
<>();
for
(
int
j
=
0
;
j
<
dayByMonth
.
size
();
j
++)
{
cell
=
row
.
getCell
(
5
+
j
);
String
dutyType
=
cell
==
null
?
""
:
cell
.
toString
();
if
(!
StringUtils
.
isEmpty
(
dutyType
))
{
DutyPersonShiftDto
dutyPersonShiftDto
=
new
DutyPersonShiftDto
();
dutyPersonShiftDto
.
setDutyDate
(
dayByMonth
.
get
(
j
));
dutyPersonShiftDto
.
setShiftId
(
Long
.
valueOf
(
dutyType
.
split
(
"@"
)[
1
]));
dutyShift
.
add
(
dutyPersonShiftDto
);
}
}
dutyFireFightingDto
.
setDutyShift
(
dutyShift
);
Map
<
String
,
Object
>
dutyPersonDtoMap
=
Bean
.
BeantoMap
(
dutyFireFightingDto
);
dataList
.
add
(
dutyPersonDtoMap
);
}
}
private
void
excelImportMaintenancePerson
(
MultipartFile
multipartFile
)
throws
Exception
{
private
void
excelImportMaintenancePerson
(
MultipartFile
multipartFile
)
throws
Exception
{
List
<
MaintenancePersonExcleDto
>
excelDtoList
=
ExcelUtil
.
readFirstSheetExcel
(
multipartFile
,
List
<
MaintenancePersonExcleDto
>
excelDtoList
=
ExcelUtil
.
readFirstSheetExcel
(
multipartFile
,
MaintenancePersonExcleDto
.
class
,
1
);
MaintenancePersonExcleDto
.
class
,
1
);
...
@@ -1080,18 +1142,22 @@ if (excelDtoList != null && excelDtoList.size() > 0) {
...
@@ -1080,18 +1142,22 @@ if (excelDtoList != null && excelDtoList.size() > 0) {
data
=
initDutyCarTemplate
(
ids
);
data
=
initDutyCarTemplate
(
ids
);
}
else
if
(
ExcelEnums
.
RYZB
.
getType
().
equals
(
excelDto
.
getType
()))
{
}
else
if
(
ExcelEnums
.
RYZB
.
getType
().
equals
(
excelDto
.
getType
()))
{
data
=
initDutyPersonTemplate
(
ids
);
data
=
initDutyPersonTemplate
(
ids
);
}
else
if
(
ExcelEnums
.
WXXFZB
.
getType
().
equals
(
excelDto
.
getType
())){
data
=
initDutyDutyFireFightingTemplate
(
ids
);
}
}
//代码报错暂时注释掉
// else if(ExcelEnums.WXXFZB.getType().equals(excelDto.getType())){
// data = initDutyDutyFireFightingTemplate(ids);
// }
// 获取日期
// 获取日期
List
<
Map
<
String
,
Object
>>
rangeDate
=
dutyPersonShiftService
.
getBaseMapper
().
genRangeDate
(
beginDate
,
endDate
);
List
<
Map
<
String
,
Object
>>
rangeDate
=
dutyPersonShiftService
.
getBaseMapper
().
genRangeDate
(
beginDate
,
endDate
);
List
<
String
>
dayByMonth
=
new
ArrayList
<>();
List
<
String
>
dayByMonth
=
new
ArrayList
<>();
rangeDate
.
forEach
(
item
->
dayByMonth
.
add
((
String
)
item
.
get
(
"date"
)));
rangeDate
.
forEach
(
item
->
dayByMonth
.
add
((
String
)
item
.
get
(
"date"
)));
exportDutyTemplate
(
response
,
excelDto
.
getClassUrl
(),
dayByMonth
,
excelDto
,
data
,
true
);
if
(
ExcelEnums
.
WXXFZB
.
getType
().
equals
(
excelDto
.
getType
()))
{
exportDutyTemplate
(
response
,
excelDto
.
getClassUrl
(),
dayByMonth
,
excelDto
,
data
,
true
,
true
);
}
else
{
exportDutyTemplate
(
response
,
excelDto
.
getClassUrl
(),
dayByMonth
,
excelDto
,
data
,
true
,
false
);
}
}
}
private
List
<
List
<
Object
>>
initDutyDutyFireFightingTemplate
(
String
ids
)
{
private
List
<
List
<
Object
>>
initDutyDutyFireFightingTemplate
(
String
ids
)
{
List
<
List
<
Object
>>
data
=
new
ArrayList
<>();
List
<
List
<
Object
>>
data
=
new
ArrayList
<>();
// 根据id列表获取单位下的微型消防站集合
// 根据id列表获取单位下的微型消防站集合
...
@@ -1099,16 +1165,18 @@ if (excelDtoList != null && excelDtoList.size() > 0) {
...
@@ -1099,16 +1165,18 @@ if (excelDtoList != null && excelDtoList.size() > 0) {
if
(!
ValidationUtil
.
isEmpty
(
ids
))
{
if
(!
ValidationUtil
.
isEmpty
(
ids
))
{
companyIdList
=
Lists
.
newArrayList
(
ids
.
split
(
","
));
companyIdList
=
Lists
.
newArrayList
(
ids
.
split
(
","
));
}
}
List
<
FirefightersDto
>
firefightersDtoList
=
fireTeamService
.
getFighterByTeamId
(
companyIdList
);
List
<
Map
<
String
,
Object
>>
personDetailList
=
orgUsrServer
.
getPersonDetailByCompanyIds
(
companyIdList
);
if
(!
firefightersDto
List
.
isEmpty
())
{
if
(!
personDetail
List
.
isEmpty
())
{
AtomicInteger
row
=
new
AtomicInteger
(
1
);
AtomicInteger
row
=
new
AtomicInteger
(
1
);
firefightersDtoList
.
forEach
(
o
->
{
personDetailList
.
forEach
(
o
->
{
DutyFireFightingDto
dto
=
(
DutyFireFightingDto
)
Bean
.
mapToBean
(
o
,
DutyFireFightingDto
.
class
);
ArrayList
<
Object
>
list
=
new
ArrayList
<>();
ArrayList
<
Object
>
list
=
new
ArrayList
<>();
list
.
add
(
row
.
getAndIncrement
());
list
.
add
(
row
.
getAndIncrement
());
list
.
add
(
o
.
getFireTeamName
()
+
"@"
+
o
.
getFireTeamId
());
list
.
add
(
dto
.
getTeamName
()
+
"@"
+
dto
.
getTeamId
());
list
.
add
(
o
.
getName
()
+
"@"
+
o
.
getSequenceNbr
());
list
.
add
(
dto
.
getUserName
()+
"@"
+
dto
.
getUserId
());
list
.
add
(
o
.
getJobTitle
()
+
"@"
+
o
.
getJobTitleCode
());
list
.
add
(
dto
.
getPostTypeName
()+
"@"
+
dto
.
getPostType
());
list
.
add
(
o
.
get
(
"fireStation"
));
data
.
add
(
list
);
data
.
add
(
list
);
});
});
}
}
...
@@ -1126,9 +1194,35 @@ if (excelDtoList != null && excelDtoList.size() > 0) {
...
@@ -1126,9 +1194,35 @@ if (excelDtoList != null && excelDtoList.size() > 0) {
data
=
initDutyCarInfo
(
beginDate
,
endDate
,
dayByMonth
);
data
=
initDutyCarInfo
(
beginDate
,
endDate
,
dayByMonth
);
}
else
if
(
ExcelEnums
.
RYZB
.
getType
().
equals
(
excelDto
.
getType
()))
{
}
else
if
(
ExcelEnums
.
RYZB
.
getType
().
equals
(
excelDto
.
getType
()))
{
data
=
initDutyPersonInfo
(
beginDate
,
endDate
,
dayByMonth
);
data
=
initDutyPersonInfo
(
beginDate
,
endDate
,
dayByMonth
);
}
else
if
(
ExcelEnums
.
WXXFZB
.
getType
().
equals
(
excelDto
.
getType
())){
data
=
initDutyDutyFireFightingTemplate
(
beginDate
,
endDate
,
dayByMonth
);
}
}
exportDutyTemplate
(
response
,
excelDto
.
getClassUrl
(),
dayByMonth
,
excelDto
,
data
,
false
);
exportDutyTemplate
(
response
,
excelDto
.
getClassUrl
(),
dayByMonth
,
excelDto
,
data
,
false
,
false
);
}
@Autowired
IDutyFireFightingService
dutyFireFightingService
;
private
List
<
List
<
Object
>>
initDutyDutyFireFightingTemplate
(
String
beginDate
,
String
endDate
,
List
<
String
>
dayByMonth
)
throws
ParseException
{
List
<
DutyFireFightingDto
>
list
=
dutyFireFightingService
.
downloadList
(
beginDate
,
endDate
);
List
<
List
<
Object
>>
data
=
new
ArrayList
<>();
// 组装导出数据
if
(!
list
.
isEmpty
())
{
AtomicInteger
row
=
new
AtomicInteger
(
1
);
list
.
forEach
(
o
->
{
ArrayList
<
Object
>
detailList
=
new
ArrayList
<>();
detailList
.
add
(
row
.
getAndIncrement
());
detailList
.
add
(
o
.
getTeamName
());
detailList
.
add
(
o
.
getUserName
());
detailList
.
add
(
o
.
getPostTypeName
());
detailList
.
add
(
o
.
getFireFighting
());
List
<
DutyPersonShiftDto
>
dutyShift
=
o
.
getDutyShift
();
initDutyShift
(
dayByMonth
,
dutyShift
,
detailList
);
data
.
add
(
detailList
);
});
}
return
data
;
}
}
private
List
<
List
<
Object
>>
initDutyCarTemplate
(
String
teamIds
)
{
private
List
<
List
<
Object
>>
initDutyCarTemplate
(
String
teamIds
)
{
...
@@ -1191,13 +1285,14 @@ if (excelDtoList != null && excelDtoList.size() > 0) {
...
@@ -1191,13 +1285,14 @@ if (excelDtoList != null && excelDtoList.size() > 0) {
private
void
exportDutyTemplate
(
HttpServletResponse
response
,
String
classUrl
,
List
<
String
>
dayByMonth
,
private
void
exportDutyTemplate
(
HttpServletResponse
response
,
String
classUrl
,
List
<
String
>
dayByMonth
,
ExcelDto
excelDto
,
List
<?
extends
Object
>
data
,
Boolean
flag
)
{
ExcelDto
excelDto
,
List
<?
extends
Object
>
data
,
Boolean
flag
,
Boolean
typeFlag
)
{
try
{
try
{
// 获取排班类型
// 获取排班类型
String
[]
dutyNameList
=
getDutyNameList
();
String
[]
dutyNameList
=
getDutyNameList
();
Class
<?>
clz
=
Class
.
forName
(
classUrl
);
Class
<?>
clz
=
Class
.
forName
(
classUrl
);
ExcelUtil
.
createDutyTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
data
,
clz
,
ExcelUtil
.
createDutyTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
data
,
clz
,
dayByMonth
,
dutyNameList
,
dataSourcesImpl
,
flag
);
dayByMonth
,
dutyNameList
,
dataSourcesImpl
,
flag
,
typeFlag
);
}
catch
(
ClassNotFoundException
e
)
{
}
catch
(
ClassNotFoundException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
@@ -1346,16 +1441,17 @@ if (excelDtoList != null && excelDtoList.size() > 0) {
...
@@ -1346,16 +1441,17 @@ if (excelDtoList != null && excelDtoList.size() > 0) {
break
;
break
;
}
}
}
}
@Autowired
private
RedisUtils
redisUtils
;
public
BaseEntity
getCurrentInfo
()
{
public
BaseEntity
getCurrentInfo
()
{
BaseEntity
userModel
=
new
BaseEntity
();
BaseEntity
userModel
=
new
BaseEntity
();
/*
String keyString= RequestContext.getExeUserId();
String
keyString
=
RequestContext
.
getExeUserId
();
String
token
=
RequestContext
.
getToken
();
String
token
=
RequestContext
.
getToken
();
ReginParams
params
=
JSONObject
.
parseObject
(
redisUtils
ReginParams
params
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
keyString
,
token
)).
toString
(),
.
get
(
RedisKey
.
buildReginKey
(
keyString
,
token
)).
toString
(),
ReginParams.class);
*/
ReginParams
.
class
);
userModel
.
setRecUserId
(
"3141675"
);
userModel
.
setRecUserId
(
params
.
getUserModel
().
getUserId
()
);
userModel
.
setRecUserName
(
"admin_jcs"
);
userModel
.
setRecUserName
(
params
.
getUserModel
().
getUserName
()
);
userModel
.
setRecDate
(
new
Date
());
userModel
.
setRecDate
(
new
Date
());
return
userModel
;
return
userModel
;
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/AlertCalledServiceImpl.java
View file @
2c165567
...
@@ -40,6 +40,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -40,6 +40,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.annotation.Condition
;
import
org.typroject.tyboot.core.rdbms.annotation.Condition
;
import
org.typroject.tyboot.core.rdbms.annotation.Operator
;
import
org.typroject.tyboot.core.rdbms.annotation.Operator
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
...
@@ -289,15 +290,16 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
...
@@ -289,15 +290,16 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
LambdaQueryWrapper
<
DispatchPaper
>
queryWrapper
=
new
LambdaQueryWrapper
();
LambdaQueryWrapper
<
DispatchPaper
>
queryWrapper
=
new
LambdaQueryWrapper
();
queryWrapper
.
eq
(
DispatchPaper:
:
getAlertId
,
Long
.
valueOf
(
alertId
));
queryWrapper
.
eq
(
DispatchPaper:
:
getAlertId
,
Long
.
valueOf
(
alertId
));
DispatchPaper
dispatchPaper
=
dispatchPaperService
.
getOne
(
queryWrapper
);
DispatchPaper
dispatchPaper
=
dispatchPaperService
.
getOne
(
queryWrapper
);
List
<
DispatchTask
>
dispatchTask
=
null
;
LambdaQueryWrapper
<
DispatchTask
>
queryWrapper1
=
new
LambdaQueryWrapper
();
if
(!
ValidationUtil
.
isEmpty
(
dispatchPaper
))
{
queryWrapper1
.
eq
(
DispatchTask:
:
getPaperId
,
Long
.
valueOf
(
dispatchPaper
.
getSequenceNbr
()));
LambdaQueryWrapper
<
DispatchTask
>
queryWrapper1
=
new
LambdaQueryWrapper
();
List
<
DispatchTask
>
dispatchTask
=
dispatchTaskService
.
list
(
queryWrapper1
);
queryWrapper1
.
eq
(
DispatchTask:
:
getPaperId
,
Long
.
valueOf
(
dispatchPaper
.
getSequenceNbr
()));
dispatchTask
=
dispatchTaskService
.
list
(
queryWrapper1
);
}
String
[]
str
=
new
String
[]{
"使用单位"
,
"一级响应"
,
"二级响应"
,
"三级响应"
,
"市级监督"
};
String
[]
str
=
new
String
[]{
"使用单位"
,
"一级响应"
,
"二级响应"
,
"三级响应"
,
"市级监督"
};
if
(
null
!=
dispatchPaper
)
{
if
(
null
!=
dispatchPaper
)
{
for
(
String
s:
str
)
{
for
(
String
s:
str
)
{
AlertHandlerInfoDto
alertHandlerInfoDto
=
new
AlertHandlerInfoDto
();
AlertHandlerInfoDto
alertHandlerInfoDto
=
new
AlertHandlerInfoDto
();
if
(
null
!=
dispatchTask
&&
dispatchTask
.
size
()
>
0
)
{
if
(
null
!=
dispatchTask
&&
dispatchTask
.
size
()
>
0
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/ElevatorServiceImpl.java
View file @
2c165567
...
@@ -122,10 +122,8 @@ public class ElevatorServiceImpl extends BaseService<ElevatorDto, Elevator, Elev
...
@@ -122,10 +122,8 @@ public class ElevatorServiceImpl extends BaseService<ElevatorDto, Elevator, Elev
}
}
public
List
<
ElevatorWlInfoDto
>
queryElevatorListDetails
(
ElevatorWlInfoDto
esElevatorDto
)
{
public
List
<
ElevatorWlInfoDto
>
queryElevatorListDetails
(
ElevatorWlInfoDto
esElevatorDto
)
{
return
elevatorMapper
.
queryElevatorListDetails
(
esElevatorDto
.
getAddress
(),
return
elevatorMapper
.
queryElevatorListDetails
(
esElevatorDto
.
getRegisterCode
(),
esElevatorDto
.
getRescueCode
(),
esElevatorDto
.
getSequenceNbr
());
esElevatorDto
.
getType
(),
esElevatorDto
.
getDealStatus
()
!=
null
?
Integer
.
parseInt
(
esElevatorDto
.
getDealStatus
())
:
null
,
esElevatorDto
.
getSequenceNbr
());
}
}
public
int
queryElevatorListCount
()
{
public
int
queryElevatorListCount
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment