Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
lefull-lot-microservice
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
yangqi
lefull-lot-microservice
Commits
df7be165
提交
df7be165
authored
12月 21, 2022
作者:
yangqi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1
上级
5ecb3257
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
49 行增加
和
9 行删除
+49
-9
LisaController.java
...t-api-web/src/main/java/cn/lefull/api/LisaController.java
+3
-9
ArrayUtils.java
...mmon/src/main/java/cn/lefull/common/utils/ArrayUtils.java
+31
-0
EquipmentService.java
...rc/main/java/cn/lefull/service/lisa/EquipmentService.java
+4
-0
EquipmentServiceImpl.java
...ain/java/cn/lefull/service/lisa/EquipmentServiceImpl.java
+11
-0
没有找到文件。
lefull-lot-api-web/src/main/java/cn/lefull/api/LisaController.java
浏览文件 @
df7be165
...
@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDate
;
import
java.util.Calendar
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -83,15 +84,8 @@ public class LisaController {
...
@@ -83,15 +84,8 @@ public class LisaController {
@NoAuth
@NoAuth
@GetMapping
(
"/test"
)
@GetMapping
(
"/test"
)
public
ApiResponse
<
Object
>
test
(
String
date
)
throws
Exception
{
public
ApiResponse
<
Object
>
test
(
String
start
,
String
end
)
throws
Exception
{
Date
d
=
new
Date
();
equipmentService
.
getLogList
(
start
,
end
);
SimpleDateFormat
f
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
System
.
out
.
println
(
"日期"
+
f
.
format
(
d
.
getTime
()));
Calendar
calendar
=
Calendar
.
getInstance
();
Date
d1
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
parse
(
"2022-12-12"
);
calendar
.
setTime
(
d1
);
calendar
.
add
(
Calendar
.
DATE
,-
1
);
System
.
out
.
println
(
"日期"
+
f
.
format
(
d1
.
getTime
()));
return
new
ApiResponse
<>();
return
new
ApiResponse
<>();
}
}
}
}
lefull-lot-common/src/main/java/cn/lefull/common/utils/ArrayUtils.java
0 → 100644
浏览文件 @
df7be165
package
cn
.
lefull
.
common
.
utils
;
import
java.time.LocalDate
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @author 杨奇
*/
public
class
ArrayUtils
{
/**
* 根据开始时间和结束时间获取所有时间的list
* @param startDate
* @param endDate
* @return
*/
public
static
List
<
LocalDate
>
getTimeList
(
LocalDate
startDate
,
LocalDate
endDate
)
{
List
<
LocalDate
>
dateList
=
new
ArrayList
<>();
LocalDate
tempData
=
startDate
;
while
(
true
)
{
dateList
.
add
(
tempData
);
if
(
tempData
.
compareTo
(
endDate
)
==
0
)
{
return
dateList
;
}
tempData
=
tempData
.
plusDays
(
1
);
}
}
}
lefull-lot-service/src/main/java/cn/lefull/service/lisa/EquipmentService.java
浏览文件 @
df7be165
...
@@ -5,6 +5,8 @@ import cn.lefull.interaction.vo.face.EntityListVO;
...
@@ -5,6 +5,8 @@ import cn.lefull.interaction.vo.face.EntityListVO;
import
cn.lefull.interaction.vo.face.EquipmentListVO
;
import
cn.lefull.interaction.vo.face.EquipmentListVO
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDate
;
/**
/**
* @author 杨奇
* @author 杨奇
*/
*/
...
@@ -29,4 +31,6 @@ public interface EquipmentService {
...
@@ -29,4 +31,6 @@ public interface EquipmentService {
boolean
searchFace
(
int
apartmentId
,
String
url
)
throws
Exception
;
boolean
searchFace
(
int
apartmentId
,
String
url
)
throws
Exception
;
void
addDateLog
(
String
date
)
throws
Exception
;
void
addDateLog
(
String
date
)
throws
Exception
;
void
getLogList
(
String
start
,
String
end
)
throws
Exception
;
}
}
lefull-lot-service/src/main/java/cn/lefull/service/lisa/EquipmentServiceImpl.java
浏览文件 @
df7be165
package
cn
.
lefull
.
service
.
lisa
;
package
cn
.
lefull
.
service
.
lisa
;
import
cn.lefull.common.utils.ArrayUtils
;
import
cn.lefull.common.utils.PageBuilder
;
import
cn.lefull.common.utils.PageBuilder
;
import
cn.lefull.common.utils.Utils
;
import
cn.lefull.common.utils.Utils
;
import
cn.lefull.interaction.pageresp.Pagination
;
import
cn.lefull.interaction.pageresp.Pagination
;
...
@@ -19,6 +20,8 @@ import org.springframework.util.CollectionUtils;
...
@@ -19,6 +20,8 @@ import org.springframework.util.CollectionUtils;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDate
;
import
java.time.format.DateTimeFormatter
;
import
java.util.*
;
import
java.util.*
;
/**
/**
...
@@ -382,4 +385,12 @@ public class EquipmentServiceImpl implements EquipmentService {
...
@@ -382,4 +385,12 @@ public class EquipmentServiceImpl implements EquipmentService {
}
}
}
}
}
}
@Override
public
void
getLogList
(
String
start
,
String
end
)
throws
Exception
{
LocalDate
startDate
=
LocalDate
.
parse
(
start
,
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
LocalDate
endDate
=
LocalDate
.
parse
(
end
,
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
List
<
LocalDate
>
dateList
=
ArrayUtils
.
getTimeList
(
startDate
,
endDate
);
System
.
out
.
println
(
dateList
);
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论