From 37a369618f5ec8a2cd4540c6609e8b226e73e4cd Mon Sep 17 00:00:00 2001
From: huangjiayang <5265313@qq.com>
Date: 星期一, 28 四月 2025 14:51:22 +0800
Subject: [PATCH] 【UPDATE-BUGFIX】气柜管路产能负载数据类型变更
---
aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsGasPipingRouteStatServiceImpl.java | 30 +++++++++++++++---------------
aps-modules/aps-core/src/main/resources/mapper/core/ApsGasPipingPlanMapper.xml | 4 ++--
2 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsGasPipingRouteStatServiceImpl.java b/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsGasPipingRouteStatServiceImpl.java
index 0994490..bfc7309 100644
--- a/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsGasPipingRouteStatServiceImpl.java
+++ b/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsGasPipingRouteStatServiceImpl.java
@@ -274,13 +274,13 @@
apsResourceDateStat.setPlanDay(LocalDate.parse(planStartDate, formatter));
apsResourceDateStat.setResourceName(apsGasPipingRouteStatTemp.getProcessName());
//鏌ヨ姘旀煖绠¤矾浜ц兘瑙勫垝琛�
- apsResourceDateStat.setDesignTimes(apsGasPipingPlanMap.get(apsGasPipingRouteStatTemp.getProcessName())!=null?apsGasPipingPlanMap.get(apsGasPipingRouteStatTemp.getProcessName()).getDayProduceAllNum().intValue():0);
+ apsResourceDateStat.setDesignTimes(apsGasPipingPlanMap.get(apsGasPipingRouteStatTemp.getProcessName())!=null?apsGasPipingPlanMap.get(apsGasPipingRouteStatTemp.getProcessName()).getDayProduceAllNum():new BigDecimal(0));
//鏌ヨ鏂欏彿宸ュ簭浜ц兘琛�
- apsResourceDateStat.setRequireTimes(apsGasPipingRouteStatTemp.getProcessTotalTime().intValue());
- if(apsResourceDateStat.getDesignTimes()!=0){
- apsResourceDateStat.setCapacityLoad(BigDecimal.valueOf(apsResourceDateStat.getRequireTimes())
- .divide(BigDecimal.valueOf(apsResourceDateStat.getDesignTimes()), 2, RoundingMode.HALF_UP)
- .multiply(BigDecimal.valueOf(100)));
+ apsResourceDateStat.setRequireTimes(apsGasPipingRouteStatTemp.getProcessTotalTime());
+ if(apsResourceDateStat.getDesignTimes().compareTo(BigDecimal.ZERO)>0){
+ apsResourceDateStat.setCapacityLoad(apsResourceDateStat.getRequireTimes()
+ .divide(apsResourceDateStat.getDesignTimes(), 2, RoundingMode.HALF_UP)
+ .multiply(new BigDecimal(100)));
}else{
apsResourceDateStat.setCapacityLoad(BigDecimal.valueOf(0));
}
@@ -298,14 +298,14 @@
startPlanTimeSet.add(apsResourceDateStat.getPlanDay().toString());
if(dayMap.containsKey(apsResourceDateStat.getPlanDay().toString())){
ApsResourceDateStat apsResourceDateStatTemp = dayMap.get(apsResourceDateStat.getPlanDay().toString());
- apsResourceDateStatTemp.setDesignTimes(apsGasPipingPlanMap.get(processName)!=null?apsGasPipingPlanMap.get(processName).getMonthProduceAllNum().intValue():0);
- apsResourceDateStatTemp.setRequireTimes(apsResourceDateStatTemp.getRequireTimes()+apsResourceDateStat.getRequireTimes());
- if(apsResourceDateStatTemp.getDesignTimes()!=0){
- apsResourceDateStat.setCapacityLoad(BigDecimal.valueOf(apsResourceDateStat.getRequireTimes())
- .divide(BigDecimal.valueOf(apsResourceDateStat.getDesignTimes()), 2, RoundingMode.HALF_UP)
- .multiply(BigDecimal.valueOf(100)));
+ apsResourceDateStatTemp.setDesignTimes(apsGasPipingPlanMap.get(processName)!=null?apsGasPipingPlanMap.get(processName).getMonthProduceAllNum():new BigDecimal(0));
+ apsResourceDateStatTemp.setRequireTimes(apsResourceDateStatTemp.getRequireTimes().add(apsResourceDateStat.getRequireTimes()));
+ if(apsResourceDateStatTemp.getDesignTimes().compareTo(BigDecimal.ZERO) > 0){
+ apsResourceDateStat.setCapacityLoad(apsResourceDateStat.getRequireTimes()
+ .divide(apsResourceDateStat.getDesignTimes(), 2, RoundingMode.HALF_UP)
+ .multiply(new BigDecimal(100)));
}else{
- apsResourceDateStatTemp.setCapacityLoad(BigDecimal.valueOf(0));
+ apsResourceDateStatTemp.setCapacityLoad(new BigDecimal(0));
}
apsResourceDateStatTemp.setResourceGroupName(processName);
apsResourceDateStatTemp.setPlanDay(apsResourceDateStat.getPlanDay());
@@ -394,8 +394,8 @@
dataRow.createCell(0).setCellValue(resourceName);
for (int j = 0; j < resourceDateStats.size(); j++) {
ApsResourceDateStat apsResourceDateStat = resourceDateStats.get(j);
- dataRow.createCell(j*3+1).setCellValue(apsResourceDateStat.getDesignTimes());
- dataRow.createCell(j*3+2).setCellValue(apsResourceDateStat.getRequireTimes());
+ dataRow.createCell(j*3+1).setCellValue(apsResourceDateStat.getDesignTimes().doubleValue());
+ dataRow.createCell(j*3+2).setCellValue(apsResourceDateStat.getRequireTimes().doubleValue());
if(apsResourceDateStat.getCapacityLoad()!=null){
dataRow.createCell(j*3+3).setCellValue(apsResourceDateStat.getCapacityLoad().doubleValue()+"%");
}else{
diff --git a/aps-modules/aps-core/src/main/resources/mapper/core/ApsGasPipingPlanMapper.xml b/aps-modules/aps-core/src/main/resources/mapper/core/ApsGasPipingPlanMapper.xml
index e887477..e79be4d 100644
--- a/aps-modules/aps-core/src/main/resources/mapper/core/ApsGasPipingPlanMapper.xml
+++ b/aps-modules/aps-core/src/main/resources/mapper/core/ApsGasPipingPlanMapper.xml
@@ -286,8 +286,8 @@
<select id="selectApsGasPipingPlanWithProcess" parameterType="ApsGasPipingPlan" resultMap="ApsGasPipingPlanResultWithProcess">
select c.* from (select a.document_number,a.item_number,a.process_number,a.production_quantity,a.plan_type,b.process_name,b.process_number as process_number_sub,b.standard_time,b.process_plan_start_day from aps_gas_piping_plan a
- left join aps_process_route b on a.document_number = b.work_order_no
- where a.document_status in ('0','1','2','4') and b.process_plan_start_day is not null ORDER BY a.document_number,b.process_number) c GROUP BY c.document_number,c.item_number,c.process_number,c.production_quantity,c.process_name,c.process_number_sub,c.standard_time,c.process_plan_start_day,c.plan_type
+ left join aps_process_route b on a.document_number = b.work_order_no
+ where a.document_status in ('0','1','2','4') and b.process_plan_start_day is not null and b.process_name in(select process_name from aps_standard_process where major='姘旀煖' or major='绠¤矾') ORDER BY a.document_number,b.process_number) c GROUP BY c.document_number,c.item_number,c.process_number,c.production_quantity,c.process_name,c.process_number_sub,c.standard_time,c.process_plan_start_day,c.plan_type
</select>
</mapper>
\ No newline at end of file
--
Gitblit v1.9.3