huangjiayang
2025-04-28 37a369618f5ec8a2cd4540c6609e8b226e73e4cd
【UPDATE-BUGFIX】气柜管路产能负载数据类型变更
已修改2个文件
32 ■■■■ 文件已修改
aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsGasPipingRouteStatServiceImpl.java 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aps-modules/aps-core/src/main/resources/mapper/core/ApsGasPipingPlanMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
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{
aps-modules/aps-core/src/main/resources/mapper/core/ApsGasPipingPlanMapper.xml
@@ -287,7 +287,7 @@
    <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
        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>