Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-zx-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Jobs
Commits
Open sidebar
项目统一框架
一体化_户用光伏项目代码
amos-boot-zx-biz
Commits
3122b373
Commit
3122b373
authored
Jul 12, 2021
by
fupeiyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
值班导入导出
parent
ddfa99c0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
99 deletions
+33
-99
DateUtils.java
...ava/com/yeejoin/amos/boot/biz/common/utils/DateUtils.java
+26
-0
DutyPersonExcelDto.java
...n/amos/boot/module/common/api/dto/DutyPersonExcelDto.java
+6
-4
ExcelUtil.java
.../yeejoin/amos/boot/module/common/api/excel/ExcelUtil.java
+0
-1
ExcelEnums.java
...om/yeejoin/amos/boot/module/jcs/api/enums/ExcelEnums.java
+1
-0
DateUtils.java
.../yeejoin/amos/boot/module/common/biz/utils/DateUtils.java
+0
-94
ExcelController.java
.../amos/boot/module/jcs/biz/controller/ExcelController.java
+0
-0
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/utils/DateUtils.java
View file @
3122b373
...
...
@@ -618,4 +618,30 @@ public class DateUtils {
String
name
=
sdf
.
format
(
calen
.
getTime
());
return
name
;
}
/**
* 获取某月的日期List
*
* @param dateStr
* @return
*/
public
static
List
<
Date
>
getDayByMonth
(
String
dateStr
)
{
List
<
Date
>
list
=
new
ArrayList
();
Date
date
=
null
;
try
{
date
=
shortSdf
.
parse
(
dateStr
);
calendar
.
setTime
(
date
);
int
month
=
calendar
.
get
(
Calendar
.
MONTH
)
+
1
;
//月份
int
year
=
calendar
.
get
(
Calendar
.
YEAR
);
//年份
int
day
=
calendar
.
getActualMaximum
(
Calendar
.
DATE
);
for
(
int
i
=
1
;
i
<=
day
;
i
++)
{
String
source
=
year
+
"-"
+
month
+
"-"
+
i
;
list
.
add
(
shortSdf
.
parse
(
source
));
}
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
return
list
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/DutyPersonExcelDto.java
View file @
3122b373
...
...
@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.common.api.dto;
import
com.alibaba.excel.annotation.ExcelIgnore
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint
;
import
com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -26,7 +28,7 @@ public class DutyPersonExcelDto implements Serializable {
@ApiModelProperty
(
value
=
"序号"
)
private
Integer
number
;
@ExcelProperty
(
value
=
"用户
id
"
,
index
=
1
)
@ExcelProperty
(
value
=
"用户
ID
"
,
index
=
1
)
@ApiModelProperty
(
value
=
"用户id"
)
private
String
userId
;
...
...
@@ -42,12 +44,12 @@ public class DutyPersonExcelDto implements Serializable {
@ApiModelProperty
(
value
=
"部门名称"
)
private
String
deptName
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"岗位id"
)
private
String
postType
;
@ExplicitConstraint
(
type
=
"DUTY_POST_TYPE"
,
indexNum
=
3
,
sourceClass
=
RoleNameExplicitConstraint
.
class
)
//动态下拉内容
@ExcelProperty
(
value
=
"岗位"
,
index
=
3
)
@ApiModelProperty
(
value
=
"岗位名称"
)
private
String
postTypeName
;
@ApiModelProperty
(
value
=
"值班信息"
)
private
List
<
DutyPersonShiftDto
>
dutyShift
;
}
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 @
3122b373
...
...
@@ -121,7 +121,6 @@ public class ExcelUtil {
}
}
ExcelWriterSheetBuilder
excelWriterSheetBuilder
=
EasyExcel
.
write
(
getOutputStream
(
fileName
,
response
,
ExcelTypeEnum
.
XLSX
)).
head
(
dutyCarTitleList
).
excelType
(
ExcelTypeEnum
.
XLSX
)
.
sheet
(
sheetName
).
registerWriteHandler
(
new
TemplateCellWriteHandlerDate
(
explicitListConstraintMap
))
...
...
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 @
3122b373
...
...
@@ -12,4 +12,5 @@ public class ExcelEnums {
public
static
final
String
WXXFZ
=
"WXXFZ"
;
//("WXXFZ","微型消防站")
public
static
final
String
XFRY
=
"XFRY"
;
//("XFRY","消防人员")
public
static
final
String
CLZQ
=
"CLZQ"
;
//("CLZQ","车辆执勤")
public
static
final
String
RYZB
=
"RYZB"
;
//("RYZB","人员值班")
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/utils/DateUtils.java
deleted
100644 → 0
View file @
ddfa99c0
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
utils
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
/**
* @title: DateUtils
* @Author fpy
* @Date: 2021/7/8 14:58
* @Version 1.0
*/
public
class
DateUtils
{
private
static
final
SimpleDateFormat
shortSdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
public
static
final
String
DATE_PATTERN
=
"yyyy-MM-dd"
;
private
static
final
Calendar
calendar
=
Calendar
.
getInstance
();
public
static
final
String
DATE_TIME_PATTERN
=
"yyyy-MM-dd HH:mm:ss"
;
/**
* 获取某月的日期List
*
* @param yearParam
* @param monthParam
* @return
*/
public
static
List
<
String
>
getDayByMonth
(
int
yearParam
,
int
monthParam
)
{
List
list
=
new
ArrayList
();
Calendar
aCalendar
=
Calendar
.
getInstance
(
Locale
.
CHINA
);
aCalendar
.
set
(
yearParam
,
monthParam
-
1
,
1
);
int
year
=
aCalendar
.
get
(
Calendar
.
YEAR
);
//年份
int
month
=
aCalendar
.
get
(
Calendar
.
MONTH
)
+
1
;
//月份
int
day
=
aCalendar
.
getActualMaximum
(
Calendar
.
DATE
);
for
(
int
i
=
1
;
i
<=
day
;
i
++)
{
list
.
add
(
year
+
"/"
+
month
+
"/"
+
i
);
}
return
list
;
}
/**
* 获取某月的日期List
*
* @param dateStr
* @return
*/
public
static
List
<
Date
>
getDayByMonth
(
String
dateStr
)
{
List
list
=
new
ArrayList
();
Date
date
=
null
;
try
{
date
=
shortSdf
.
parse
(
dateStr
);
calendar
.
setTime
(
date
);
int
month
=
calendar
.
get
(
Calendar
.
MONTH
)
+
1
;
//月份
int
year
=
calendar
.
get
(
Calendar
.
YEAR
);
//年份
int
day
=
calendar
.
getActualMaximum
(
Calendar
.
DATE
);
for
(
int
i
=
1
;
i
<=
day
;
i
++)
{
list
.
add
(
year
+
"/"
+
month
+
"/"
+
i
);
}
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
return
list
;
}
/**
* 日期返回Date类型
*
* @param dateStr
* @return
*/
public
static
int
strToDateShort
(
String
dateStr
)
{
try
{
Date
date
=
shortSdf
.
parse
(
dateStr
);
calendar
.
setTime
(
date
);
int
month
=
calendar
.
get
(
Calendar
.
MONTH
)
+
1
;
return
month
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
0
;
}
public
static
Date
getDate
(
String
dateStr
)
{
try
{
Date
date
=
shortSdf
.
parse
(
dateStr
);
return
date
;
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
return
null
;
}
}
\ No newline at end of file
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/ExcelController.java
View file @
3122b373
This diff is collapsed.
Click to expand it.
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