From 959b9dbe19b1b2247d2e8889957637178a8c35d7 Mon Sep 17 00:00:00 2001 From: shaoyong Date: Fri, 31 May 2024 19:43:05 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E6=97=A5=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/MesReportWorkController.java | 24 +- .../com/op/mes/domain/dto/QuantityDto.java | 51 +++ .../op/mes/mapper/MesReportWorkMapper.java | 10 + .../op/mes/service/IMesReportWorkService.java | 4 + .../impl/MesReportWorkServiceImpl.java | 93 +++++ .../mapper/mes/MesReportWorkMapper.xml | 53 +++ .../op/quality/domain/QcMarketFeedback.java | 360 ++++++++++++++++++ 7 files changed, 592 insertions(+), 3 deletions(-) create mode 100644 op-modules/op-mes/src/main/java/com/op/mes/domain/dto/QuantityDto.java create mode 100644 op-modules/op-quality/src/main/java/com/op/quality/domain/QcMarketFeedback.java diff --git a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkController.java b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkController.java index ff0da3722..5dceb0883 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkController.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkController.java @@ -22,9 +22,9 @@ import com.op.common.core.utils.uuid.IdUtils; import com.op.common.datasource.creator.DynamicDatasourceCreator; import com.op.mes.domain.*; import com.op.mes.domain.dto.LineChartDto; -import com.op.mes.domain.dto.LineChartSeriesDto; import com.op.mes.domain.dto.SysFactoryDto; import com.op.mes.domain.vo.DynamicColumnVo; +import com.op.mes.domain.vo.MesDailyReportVo; import com.op.system.api.domain.DataSourcePropertyDTO; import com.op.system.api.domain.SysUser; import com.op.system.api.domain.device.EquEquipmentDTO; @@ -228,15 +228,21 @@ public class MesReportWorkController extends BaseController { @RequiresPermissions("mes:dailyReport:list") @GetMapping("/getDailyReport") public TableDataInfo getDailyReport(MesDailyReport mesDailyReport) { - if(!StringUtils.isNotBlank(mesDailyReport.getWorkCenter())){ return null; } - startPage(); List list = mesReportWorkService.getDailyReport(mesDailyReport); return getDataTable(list); } + @RequiresPermissions("mes:dailyReport:list") + @GetMapping("/getDailyReportNew") + public TableDataInfo getDailyReportNew(MesDailyReportVo mesDailyReportVo) { + startPage(); + List list = mesReportWorkService.getDailyReportNew(mesDailyReportVo); + return getDataTable(list); + } + @RequiresPermissions("mes:dailyReport:list") @PostMapping("/getDailyReportExport") public void getDailyReportExport(HttpServletResponse response,MesDailyReport mesDailyReport) { @@ -246,6 +252,18 @@ public class MesReportWorkController extends BaseController { ExcelUtilDailyReport util = new ExcelUtilDailyReport(MesDailyReport.class); util.exportExcel(response, list, ymd+"生产日报表",titleName); } + @RequiresPermissions("mes:dailyReportNew:export") + @PostMapping("/getDailyReportNewExport") + public void getDailyReportNewExport(HttpServletResponse response,MesDailyReportVo mesDailyReportVo) { + List list = mesReportWorkService.getDailyReportNew(mesDailyReportVo); + String start = mesDailyReportVo.getProductDateStart(); + String end = mesDailyReportVo.getProductDateEnd(); + ExcelUtil util = new ExcelUtil<>(MesDailyReportVo.class); + util.exportExcel(response, list, start+"至"+end+"生产日报表"); + + } + + @GetMapping("/getWorkcenterList") public List getWorkcenterList(MesDailyReport mesDailyReport) { diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/dto/QuantityDto.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/dto/QuantityDto.java new file mode 100644 index 000000000..ad1001ab2 --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/dto/QuantityDto.java @@ -0,0 +1,51 @@ +package com.op.mes.domain.dto; + +import java.math.BigDecimal; + +public class QuantityDto { + private Long quantityFeedbackSum; + private BigDecimal workTime; + private Long useMan; + private String workorderCode; + private String machineCode; + + public Long getQuantityFeedbackSum() { + return quantityFeedbackSum; + } + + public void setQuantityFeedbackSum(Long quantityFeedbackSum) { + this.quantityFeedbackSum = quantityFeedbackSum; + } + + public BigDecimal getWorkTime() { + return workTime; + } + + public void setWorkTime(BigDecimal workTime) { + this.workTime = workTime; + } + + public Long getUseMan() { + return useMan; + } + + public void setUseMan(Long useMan) { + this.useMan = useMan; + } + + public String getWorkorderCode() { + return workorderCode; + } + + public void setWorkorderCode(String workorderCode) { + this.workorderCode = workorderCode; + } + + public String getMachineCode() { + return machineCode; + } + + public void setMachineCode(String machineCode) { + this.machineCode = machineCode; + } +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkMapper.java b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkMapper.java index 20f16bdb4..794c561ee 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkMapper.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkMapper.java @@ -6,7 +6,9 @@ import java.util.Map; import com.op.mes.domain.*; import com.op.mes.domain.dto.LineChartSeriesDto; +import com.op.mes.domain.dto.QuantityDto; import com.op.mes.domain.dto.SysFactoryDto; +import com.op.mes.domain.vo.MesDailyReportVo; import com.op.system.api.domain.SysUser; import com.op.system.api.domain.device.EquEquipmentDTO; import com.op.system.api.domain.mes.ProOrderWorkorderDTO; @@ -82,6 +84,8 @@ public interface MesReportWorkMapper { String getTitleName(MesDailyReport mesDailyReport); + String getTitleNewName(MesDailyReportVo mesDailyReportVo); + List getWorkcenterList(MesDailyReport mesDailyReport); public void updateOrderWorkStatus(MesReportWork work); @@ -170,4 +174,10 @@ public interface MesReportWorkMapper { void updatePreReportAttr1(MesReportWork workOrder); MesReportWork getReportWorkHzAttr1(MesReportWork mesReportWork); + + List getDailyReportUp(MesDailyReportVo mesDailyReportVo); + + QuantityDto getRealQuantity(QuantityDto quantityDto); + + List getSumQuantity(QuantityDto quantityDto); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorkService.java b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorkService.java index f2992d4a9..70b4984e5 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorkService.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorkService.java @@ -11,6 +11,7 @@ import com.op.mes.domain.dto.LineChartDto; import com.op.mes.domain.dto.LineChartSeriesDto; import com.op.mes.domain.dto.SysFactoryDto; import com.op.mes.domain.vo.DynamicColumnVo; +import com.op.mes.domain.vo.MesDailyReportVo; import com.op.system.api.domain.SysUser; import com.op.system.api.domain.device.EquEquipmentDTO; import com.op.system.api.domain.dto.MesPrepareDetailDTO; @@ -78,6 +79,7 @@ public interface IMesReportWorkService { public List getDailyReport(MesDailyReport mesDailyReport); String getTitleName(MesDailyReport mesDailyReport); + String getTitleNewName(MesDailyReportVo mesDailyReportVo); List getWorkcenterList(MesDailyReport mesDailyReport); @@ -131,4 +133,6 @@ public interface IMesReportWorkService { int deleteReportNow(String reportCode); R preReportRow(MesReportWork mesReportWork); + + List getDailyReportNew(MesDailyReportVo mesDailyReportVo); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java index 5493cc9f9..7ba5e1475 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java @@ -20,8 +20,10 @@ import com.op.common.security.utils.SecurityUtils; import com.op.mes.domain.*; import com.op.mes.domain.dto.LineChartDto; import com.op.mes.domain.dto.LineChartSeriesDto; +import com.op.mes.domain.dto.QuantityDto; import com.op.mes.domain.dto.SysFactoryDto; import com.op.mes.domain.vo.DynamicColumnVo; +import com.op.mes.domain.vo.MesDailyReportVo; import com.op.mes.service.IWCSInterfaceService; import com.op.system.api.RemoteSapService; import com.op.system.api.domain.SysUser; @@ -37,6 +39,10 @@ import org.springframework.stereotype.Service; import com.op.mes.mapper.MesReportWorkMapper; import com.op.mes.service.IMesReportWorkService; import org.springframework.util.CollectionUtils; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; /** * 报工报表Service业务层处理 @@ -399,12 +405,99 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService { return dtos; } + @Override + @DS("#header.poolName") + public List getDailyReportNew(MesDailyReportVo mesDailyReportVo){ + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + String key = "#header.poolName"; + String factoryCode = request.getHeader(key.substring(8)).replace("ds_", ""); + + List dtos = mesReportWorkMapper.getDailyReportUp(mesDailyReportVo); + + for (MesDailyReportVo dto : dtos) { + dto.setFactoryCode(factoryCode); + + QuantityDto quantityDto = new QuantityDto(); + String workorderCode = dto.getWorkorderCode(); + String machineCode = dto.getEquipmentCode(); + + quantityDto.setWorkorderCode(workorderCode); + quantityDto.setMachineCode(machineCode); + QuantityDto realQuantity = mesReportWorkMapper.getRealQuantity(quantityDto); + List sumQuantityList = mesReportWorkMapper.getSumQuantity(quantityDto); + QuantityDto sumQuantity = sumQuantityList.get(0); + + // 产量 + Long sumQua = 0L; + // 实际产量 + Long realQua = 0L; + // 实际工时 + BigDecimal workTime = BigDecimal.ZERO; + // 实际用人 + Long useMan = 0L; + if (realQuantity != null && sumQuantity != null) { + sumQua = sumQuantity.getQuantityFeedbackSum(); + realQua = realQuantity.getQuantityFeedbackSum(); + workTime = sumQuantity.getWorkTime(); + useMan = sumQuantity.getUseMan(); + dto.setQuantityAct(String.valueOf(sumQua)); + dto.setQuantityFeedback(String.valueOf(realQua)); + dto.setWorkTime(workTime); + dto.setManStandard(useMan.toString()); + + // 计算规格 + dto.setSpec(sumQua / realQua); + // 订单完成率 实际产量/计划产量 + BigDecimal completeRate = new BigDecimal(realQua) + .multiply(new BigDecimal("100.00")) + .divide(new BigDecimal(dto.getQuantitySplit()),2,BigDecimal.ROUND_HALF_UP); + dto.setCompleteRate(completeRate.toString()+"%"); + // 标准工时 产量/产线标准效率 + BigDecimal workTimeStandard = new BigDecimal(sumQua) + .divide(dto.getEfficiency(),1,BigDecimal.ROUND_HALF_UP); + dto.setWorkTimeStandard(workTimeStandard.toString()); + // 产线效率 标准工时/实际工时 + BigDecimal productivity = workTimeStandard + .multiply(new BigDecimal("100.00")) + .divide(workTime,2,BigDecimal.ROUND_HALF_UP); + dto.setProductivity(productivity.toString()+"%"); + // 总工时 实际用人*实际工时 + BigDecimal totalWorkTime = new BigDecimal(useMan) + .multiply(workTime); + dto.setTotalWorkTime(totalWorkTime.toString()); + // 标准人均效率 实际产量/标准用人/标准工时 + BigDecimal manAvgStandard = new BigDecimal(realQua) + .divide(new BigDecimal(dto.getUseMan()),2,BigDecimal.ROUND_HALF_UP) + .divide(workTimeStandard,2,BigDecimal.ROUND_HALF_UP); + dto.setManAvgStandard(manAvgStandard.toString()); + // 实际人均效率 实际产量/总工时 + BigDecimal manAvgActual = new BigDecimal(realQua) + .divide(totalWorkTime,2,BigDecimal.ROUND_HALF_UP); + dto.setManAvgActual(manAvgActual.toString()); + // 人均效率达成率 标准人均效率/实际人均效率 + BigDecimal manAvgDo = manAvgStandard + .multiply(new BigDecimal("100.00")) + .divide(manAvgActual,2,BigDecimal.ROUND_HALF_UP); + dto.setManAvgDo(manAvgDo.toString()+"%"); + } + + } + + return dtos; + } + @Override @DS("#header.poolName") public String getTitleName(MesDailyReport mesDailyReport) { return mesReportWorkMapper.getTitleName(mesDailyReport); } + @Override + @DS("#header.poolName") + public String getTitleNewName(MesDailyReportVo mesDailyReportVo) { + return mesReportWorkMapper.getTitleNewName(mesDailyReportVo); + } + @Override @DS("#header.poolName") public List getWorkcenterList(MesDailyReport mesDailyReport) { diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml index 5a2fb1aa7..7ebd9c154 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml @@ -281,6 +281,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + + + - select - womsn.storage_id, - womsn.storage_type, - womsn.material_code, - womsn.material_desc, - womsn.amount, - womsn.storage_amount, - womsn.sap_factory_code, - womsn.wl_name, - womsn.del_flag, - womsn.spare_use_life, - womsn.spare_name, - womsn.spare_mode, - womsn.spare_manufacturer, - womsn.spare_supplier, - womsn.spare_replacement_cycle, - womsn.spare_measurement_unit, - womsn.spare_conversion_unit, - womsn.spare_conversion_ratio, - womsn.spare_inventory_floor, - womsn.spare_inventory_upper, - womsn.spare_type, - womsn.create_by, - womsn.gmt_create, - womsn.last_modified_by, - womsn.gmt_modified, - womsn.active_flag, - womsn.factory_code, - womsna.id, - womsna.primary_code, - womsna.own_equipment_name, - womsna.unit_quantity, - womsna.safe_stock, - womsna.unit_price, - womsna.procurement_method, - womsna.procurement_cycle, - womsna.opening_balance, - womsna.output_records, - womsna.input_records, - womsna.end_inventory, - womsna.end_money, - womsna.substitute_parts, - womsna.own_equipment_code - from wms_ods_mate_storage_news womsn - left join wms_ods_mate_storage_news_attached womsna on womsn.material_code = womsna.primary_code + - and womsn.storage_id = #{storageId} - and womsn.wh_code = #{whCode} - and womsn.region_code = #{regionCode} - and womsn.wa_code = #{waCode} - and womsn.storage_type = #{storageType} - and womsn.wl_code = #{wlCode} - and womsn.material_code like concat('%', #{materialCode}, '%') - and womsn.material_desc like concat('%', #{materialDesc}, '%') - and womsn.amount = #{amount} - and womsn.storage_amount = #{storageAmount} - and womsn.occupy_amount = #{occupyAmount} - and womsn.lpn = #{lpn} - and womsn.product_batch = #{productBatch} - and womsn.receive_date = #{receiveDate} - and womsn.product_date = #{productDate} - and womsn.user_defined1 = #{userDefined1} - and womsn.user_defined2 = #{userDefined2} - and womsn.user_defined3 = #{userDefined3} - and womsn.user_defined4 = #{userDefined4} - and womsn.user_defined5 = #{userDefined5} - and womsn.user_defined6 = #{userDefined6} - and womsn.user_defined7 = #{userDefined7} - and womsn.user_defined8 = #{userDefined8} - and womsn.user_defined9 = #{userDefined9} - and womsn.user_defined10 = #{userDefined10} - and womsn.gmt_create = #{gmtCreate} - and womsn.last_modified_by = #{lastModifiedBy} - and womsn.gmt_modified = #{gmtModified} - and womsn.active_flag = #{activeFlag} - and womsn.factory_code = #{factoryCode} - and womsn.sap_factory_code = #{sapFactoryCode} - and womsn.wl_name like concat('%', #{wlName}, '%') - and womsn.spare_use_life = #{spareUseLife} - and womsn.spare_name like concat('%', #{spareName}, '%') - and womsn.spare_mode like concat('%', #{spareMode}, '%') - and womsn.spare_manufacturer = #{spareManufacturer} - and womsn.spare_supplier like concat('%', #{spareSupplier}, '%') - and womsn.spare_replacement_cycle = #{spareReplacementCycle} - and womsn.spare_measurement_unit = #{spareMeasurementUnit} - and womsn.spare_conversion_unit = #{spareConversionUnit} - and womsn.spare_conversion_ratio = #{spareConversionRatio} - and womsn.spare_inventory_floor = #{spareInventoryFloor} - and womsn.spare_inventory_upper = #{spareInventoryUpper} - and womsn.spare_type = #{spareType} - and womsna.own_equipment_name like concat('%', #{ownEquipmentName}, '%') - and womsn.del_flag = '0' + and storage_id = #{storageId} + and wh_code = #{whCode} + and region_code = #{regionCode} + and wa_code = #{waCode} + and storage_type = #{storageType} + and wl_code = #{wlCode} + and material_code like concat('%', #{materialCode}, '%') + and material_desc like concat('%', #{materialDesc}, '%') + and amount = #{amount} + and storage_amount = #{storageAmount} + and occupy_amount = #{occupyAmount} + and lpn = #{lpn} + and product_batch = #{productBatch} + and receive_date = #{receiveDate} + and product_date = #{productDate} + and user_defined1 = #{userDefined1} + and user_defined2 = #{userDefined2} + and user_defined3 = #{userDefined3} + and user_defined4 = #{userDefined4} + and user_defined5 = #{userDefined5} + and user_defined6 = #{userDefined6} + and user_defined7 = #{userDefined7} + and user_defined8 = #{userDefined8} + and user_defined9 = #{userDefined9} + and user_defined10 = #{userDefined10} + and gmt_create = #{gmtCreate} + and last_modified_by = #{lastModifiedBy} + and gmt_modified = #{gmtModified} + and active_flag = #{activeFlag} + and factory_code = #{factoryCode} + and sap_factory_code = #{sapFactoryCode} + and wl_name like concat('%', #{wlName}, '%') + and spare_use_life = #{spareUseLife} + and spare_name like concat('%', #{spareName}, '%') + and spare_mode like concat('%', #{spareMode}, '%') + and spare_manufacturer = #{spareManufacturer} + and spare_supplier like concat('%', #{spareSupplier}, '%') + and spare_replacement_cycle = #{spareReplacementCycle} + and spare_measurement_unit = #{spareMeasurementUnit} + and spare_conversion_unit = #{spareConversionUnit} + and spare_conversion_ratio = #{spareConversionRatio} + and spare_inventory_floor = #{spareInventoryFloor} + and spare_inventory_upper = #{spareInventoryUpper} + and spare_type = #{spareType} + and own_equipment_name like concat('%', #{ownEquipmentName}, '%') + and del_flag = '0' @@ -186,15 +148,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where storage_id = #{storageId} and del_flag = '0' - and storage_tpye = 'SP' - insert into wms_ods_mate_storage_news + insert into equ_spareparts_ledger storage_id, wh_code, @@ -204,7 +165,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" wl_code, material_code, material_desc, - amount, + amount, storage_amount, occupy_amount, lpn, @@ -242,6 +203,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" spare_inventory_floor, spare_inventory_upper, spare_type, + own_equipment_name, + unit_quantity, + safe_stock, + unit_price, + procurement_method, + procurement_cycle, + opening_balance, + output_records, + input_records, + end_inventory, + end_money, + substitute_parts, + own_equipment_code, #{storageId}, @@ -252,7 +226,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{wlCode}, #{materialCode}, #{materialDesc}, - #{amount}, + #{amount}, #{storageAmount}, #{occupyAmount}, #{lpn}, @@ -290,11 +264,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{spareInventoryFloor}, #{spareInventoryUpper}, #{spareType}, + #{ownEquipmentName}, + #{unitQuantity}, + #{safeStock}, + #{unitPrice}, + #{procurementMethod}, + #{procurementCycle}, + #{openingBalance}, + #{outputRecords}, + #{inputRecords}, + #{endInventory}, + #{endMoney}, + #{substituteParts}, + #{ownEquipmentCode}, - update wms_ods_mate_storage_news + update equ_spareparts_ledger wh_code = #{whCode}, region_code = #{regionCode}, @@ -303,7 +290,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" wl_code = #{wlCode}, material_code = #{materialCode}, material_desc = #{materialDesc}, - amount = #{amount}, + amount = #{amount}, storage_amount = #{storageAmount}, occupy_amount = #{occupyAmount}, lpn = #{lpn}, @@ -341,28 +328,51 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" spare_inventory_floor = #{spareInventoryFloor}, spare_inventory_upper = #{spareInventoryUpper}, spare_type = #{spareType}, + own_equipment_name = #{ownEquipmentName}, + unit_quantity = #{unitQuantity}, + safe_stock = #{safeStock}, + unit_price = #{unitPrice}, + procurement_method = #{procurementMethod}, + procurement_cycle = #{procurementCycle}, + opening_balance = #{openingBalance}, + output_records = #{outputRecords}, + input_records = #{inputRecords}, + end_inventory = #{endInventory}, + end_money = #{endMoney}, + substitute_parts = #{substituteParts}, + own_equipment_code = #{ownEquipmentCode}, where storage_id = #{storageId} + + update equ_spareparts_ledger + set amount = #{amount} + where storage_id = #{storageId} + + - update wms_ods_mate_storage_news + update equ_spareparts_ledger set amount = ( amount - #{spareQuantity} ) where material_code = #{spareCode} - update wms_ods_mate_storage_news + update equ_spareparts_ledger set amount = ( amount + #{spareQuantity} ) where material_code = #{spareCode} - - delete from wms_ods_mate_storage_news where storage_id = #{storageId} - + + update equ_spareparts_ledger + set del_flag = '1' + where storage_id = #{storageId} + - - delete from wms_ods_mate_storage_news where storage_id in + + update equ_spareparts_ledger + set del_flag = '1' + where storage_id in #{storageId} - + \ No newline at end of file From 4e132481759f428db2f13a637995dcbeec1f6183 Mon Sep 17 00:00:00 2001 From: shaoyong Date: Mon, 3 Jun 2024 09:56:43 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E6=97=A5=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/op/mes/service/impl/MesReportWorkServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java index 7ba5e1475..d7081afac 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java @@ -425,7 +425,7 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService { quantityDto.setMachineCode(machineCode); QuantityDto realQuantity = mesReportWorkMapper.getRealQuantity(quantityDto); List sumQuantityList = mesReportWorkMapper.getSumQuantity(quantityDto); - QuantityDto sumQuantity = sumQuantityList.get(0); + QuantityDto sumQuantity = sumQuantityList.stream().max(Comparator.comparingLong(QuantityDto::getUseMan)).orElse(null); // 产量 Long sumQua = 0L; From a7d820625608c5527c858aef806b4fcdac86e3dd Mon Sep 17 00:00:00 2001 From: shaoyong Date: Mon, 3 Jun 2024 14:24:36 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E6=97=A5=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8-=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/op/mes/service/impl/MesReportWorkServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java index d7081afac..de0972aa5 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java @@ -416,6 +416,7 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService { for (MesDailyReportVo dto : dtos) { dto.setFactoryCode(factoryCode); + dto.setProdType("蚊香"); QuantityDto quantityDto = new QuantityDto(); String workorderCode = dto.getWorkorderCode();