Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张雷
/
skboot-zhongye
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
08ed838b
由
康伟
编写于
2025-01-03 17:03:45 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
kangwei: 设备中心半年、全年时间条件
1 个父辈
11e8dfa4
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
68 行增加
和
8 行删除
sk-base-common/src/main/java/com/skua/tool/util/DateUtils.java
sk-module-equipment/src/main/java/com/skua/modules/equipment/dto/ReportStatisticsDTO.java
sk-module-equipment/src/main/java/com/skua/modules/equipment/service/impl/ProductionEquipmentServiceImpl.java
sk-base-common/src/main/java/com/skua/tool/util/DateUtils.java
查看文件 @
08ed838
...
...
@@ -629,6 +629,27 @@ public class DateUtils {
return
sdf
.
format
(
preDate
);
}
/***
* 获取几个月之后日期
* @param month
* @return
*/
public
static
String
getDateByAfterMonth
(
int
month
)
{
// 设置日期格式
SimpleDateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
// 创建一个Calendar实例,并设置为当前日期和时间
Calendar
calendar
=
Calendar
.
getInstance
();
// 减去半年(6个月)
//calendar.add(Calendar.MONTH, -6);
calendar
.
add
(
Calendar
.
MONTH
,
month
);
// Date preDate = calendar.getTime();
// 获取半年前的日期
String
afterDate
=
dateFormat
.
format
(
calendar
.
getTime
());
return
afterDate
;
}
/**
* 获取日期时间集合
* @param start
...
...
sk-module-equipment/src/main/java/com/skua/modules/equipment/dto/ReportStatisticsDTO.java
查看文件 @
08ed838
...
...
@@ -62,14 +62,14 @@ public class ReportStatisticsDTO {
public
String
getLastYearStartTime
()
{
if
(
StringUtils
.
isEmpty
(
lastYearStartTime
)){
lastYearStartTime
=
DateUtils
.
getTbDate
(
lastYearS
tartTime
);
lastYearStartTime
=
DateUtils
.
getTbDate
(
s
tartTime
);
}
return
lastYearStartTime
;
}
public
String
getLastYearEndTime
()
{
if
(
StringUtils
.
isEmpty
(
lastYearEndTime
)){
lastYearEndTime
=
DateUtils
.
getTbDate
(
lastYearE
ndTime
);
lastYearEndTime
=
DateUtils
.
getTbDate
(
e
ndTime
);
}
return
lastYearEndTime
;
}
...
...
@@ -81,8 +81,8 @@ public class ReportStatisticsDTO {
}
else
{
time
=
DateUtils
.
getCurrentYear
()+
""
;
}
}
return
time
;
}
}
...
...
sk-module-equipment/src/main/java/com/skua/modules/equipment/service/impl/ProductionEquipmentServiceImpl.java
查看文件 @
08ed838
...
...
@@ -11,7 +11,9 @@ import com.skua.modules.equipment.dto.ReportStatisticsDTO;
import
com.skua.modules.equipment.mapper.ProductionEquipmentMapper
;
import
com.skua.modules.equipment.service.IProductionEquipmentService
;
import
com.skua.modules.equipment.vo.*
;
import
com.skua.tool.util.DateUtils
;
import
com.skua.tool.util.JSUtils
;
import
io.swagger.annotations.ApiModelProperty
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -218,7 +220,7 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi
//本月新增
productionEquipmentVO
.
setIncrease
(
increase
);
//设备完好率
BigDecimal
bigDecimal
=
new
BigDecimal
(
v
*
100
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
BigDecimal
bigDecimal
=
new
BigDecimal
(
ConvertUtils
.
getDou
(
v
,
0
d
)
*
100
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
productionEquipmentVO
.
setEquipmentIntactRate
(
bigDecimal
.
toString
()
+
"%"
);
//设备完好总台日
BigDecimal
bigDecimal5
=
new
BigDecimal
(
goodDay
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
...
...
@@ -387,6 +389,15 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi
List<Map<String,Object>> mapList = commonSqlService.queryForList(dict_sql);
List<String> categoryNameList = new ArrayList<>();
List<String> categoryIdList = new ArrayList<>();*/
String
startTime
;
String
endTime
=
DateUtils
.
getDateByAfterMonth
(
0
);
//当前日期
if
(
6
==
reportStatisticsDTO
.
getTimeUnit
())
{
startTime
=
DateUtils
.
getDateByAfterMonth
(-
6
);
}
else
{
startTime
=
DateUtils
.
getDateByAfterMonth
(-
12
);
}
reportStatisticsDTO
.
setStartTime
(
startTime
);
reportStatisticsDTO
.
setEndTime
(
endTime
);
return
productionEquipmentMapper
.
getEquipmentStatisticsDetailsNew
(
pageList
,
reportStatisticsDTO
);
}
@Override
...
...
@@ -491,7 +502,7 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi
List
<
ContrastVO
>
list
=
new
ArrayList
<>();
List
<
Map
>
rate
=
null
;
List
<
Map
>
onYearRate
=
new
ArrayList
<>();
if
(
reportStatisticsDTO
.
getTimeUnit
()
==
6
)
{
if
(
6
==
reportStatisticsDTO
.
getTimeUnit
()
)
{
rate
=
productionEquipmentMapper
.
getHalfIntactRate
();
onYearRate
=
productionEquipmentMapper
.
getHalfIntactYearOnYearRate
();
}
else
{
...
...
@@ -627,6 +638,15 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi
//设备完好率详情(新)
public
List
<
Map
>
getEquipmentIntactRateDetailsNew
(
ReportStatisticsDTO
reportStatisticsDTO
)
{
String
startTime
;
String
endTime
=
DateUtils
.
getDateByAfterMonth
(
0
);
//当前日期
if
(
6
==
reportStatisticsDTO
.
getTimeUnit
())
{
startTime
=
DateUtils
.
getDateByAfterMonth
(-
6
);
}
else
{
startTime
=
DateUtils
.
getDateByAfterMonth
(-
12
);
}
reportStatisticsDTO
.
setStartTime
(
startTime
);
reportStatisticsDTO
.
setEndTime
(
endTime
);
return
productionEquipmentMapper
.
getEquipmentIntactRateDetailsNew
(
reportStatisticsDTO
);
}
@Override
...
...
@@ -636,7 +656,7 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi
List
<
Map
>
MTBF
=
new
ArrayList
<>();
//平均修复时间
List
<
Map
>
MTTR
=
new
ArrayList
<>();
if
(
reportStatisticsDTO
.
getTimeUnit
()
==
6
)
{
if
(
6
==
reportStatisticsDTO
.
getTimeUnit
()
)
{
MTBF
=
productionEquipmentMapper
.
getHalfIntactMTBF
();
//平均故障时间
MTTR
=
productionEquipmentMapper
.
getHalfIntactMTTR
();
}
else
{
...
...
@@ -786,7 +806,7 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi
List
<
ContrastVO
>
contrastVOS
=
new
ArrayList
<>();
List
<
Map
>
completeRate
=
new
ArrayList
<>();
List
<
Map
>
completeYearOnYearRate
=
new
ArrayList
<>();
if
(
reportStatisticsDTO
.
getTimeUnit
()
==
6
)
{
if
(
6
==
reportStatisticsDTO
.
getTimeUnit
()
)
{
completeRate
=
productionEquipmentMapper
.
getHalfIntactCompleteRate
();
completeYearOnYearRate
=
productionEquipmentMapper
.
getHalfIntactCompleteYearOnYearRate
();
}
else
{
...
...
@@ -834,6 +854,15 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi
* @return
*/
public
List
<
Map
>
getMaintainCompleteRateDetailsNew
(
ReportStatisticsDTO
reportStatisticsDTO
)
{
String
startTime
;
String
endTime
=
DateUtils
.
getDateByAfterMonth
(
0
);
//当前日期
if
(
6
==
reportStatisticsDTO
.
getTimeUnit
()
)
{
startTime
=
DateUtils
.
getDateByAfterMonth
(-
6
);
}
else
{
startTime
=
DateUtils
.
getDateByAfterMonth
(-
12
);
}
reportStatisticsDTO
.
setStartTime
(
startTime
);
reportStatisticsDTO
.
setEndTime
(
endTime
);
return
productionEquipmentMapper
.
getMaintainCompleteRateDetails
(
reportStatisticsDTO
);
}
@Override
...
...
@@ -941,7 +970,7 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi
List
<
ContrastVO
>
list
=
new
ArrayList
<>();
List
<
Map
>
contrastCost
=
new
ArrayList
<>();
if
(
reportStatisticsDTO
.
getTimeUnit
()
==
6
)
{
//半年
if
(
6
==
reportStatisticsDTO
.
getTimeUnit
()
)
{
//半年
contrastCost
=
productionEquipmentMapper
.
getHalfIntactContrastCost
(
reportStatisticsDTO
.
getDepartIds
());
}
else
{
contrastCost
=
productionEquipmentMapper
.
getOneYearContrastCost
(
reportStatisticsDTO
.
getDepartIds
());
...
...
@@ -962,6 +991,16 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi
//维护维修费用详情
@Override
public
List
<
Map
>
getContrastCostDetails
(
ReportStatisticsDTO
reportStatisticsDTO
)
{
String
startTime
;
String
endTime
=
DateUtils
.
getDateByAfterMonth
(
0
);
//当前日期
if
(
6
==
reportStatisticsDTO
.
getTimeUnit
())
{
startTime
=
DateUtils
.
getDateByAfterMonth
(-
6
);
}
else
{
startTime
=
DateUtils
.
getDateByAfterMonth
(-
12
);
}
reportStatisticsDTO
.
setStartTime
(
startTime
);
reportStatisticsDTO
.
setEndTime
(
endTime
);
return
productionEquipmentMapper
.
getContrastCostDetails
(
reportStatisticsDTO
);
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论