| | |
| | | import com.ruoyi.common.enums.StockOutQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.enums.StockInUnQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.DictUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.procurementrecord.utils.StockUtils; |
| | |
| | | import com.ruoyi.production.dto.ProductionProductMainSummaryExportDto; |
| | | import com.ruoyi.production.dto.ProductionReportDailySummaryDto; |
| | | import com.ruoyi.production.dto.ProductionReportStateDto; |
| | | import com.ruoyi.production.enums.ProductProcessEnum; |
| | | import com.ruoyi.production.mapper.ProductionProductReportDailyMapper; |
| | | import com.ruoyi.production.pojo.ProductionProductReportDaily; |
| | | import com.ruoyi.production.mapper.*; |
| | |
| | | |
| | | @Override |
| | | public ProductionReportStateDto reportState(Long workOrderId, Long productProcessRouteItemId) { |
| | | ProductionProductMain running = getRunning(workOrderId, productProcessRouteItemId); |
| | | ProductionReportStateDto dto = new ProductionReportStateDto(); |
| | | ProductWorkOrder workOrder = productWorkOrderMapper.selectById(workOrderId); |
| | | if (workOrder != null) { |
| | | BigDecimal planQty = workOrder.getPlanQuantity() == null ? BigDecimal.ZERO : workOrder.getPlanQuantity(); |
| | | BigDecimal completeQty = workOrder.getCompleteQuantity() == null ? BigDecimal.ZERO : workOrder.getCompleteQuantity(); |
| | | // 生产报工数量已完成 |
| | | if (planQty.compareTo(BigDecimal.ZERO) > 0 && completeQty.compareTo(planQty) >= 0) { |
| | | dto.setState(3); |
| | | return dto; |
| | | } |
| | | } |
| | | |
| | | ProductionProductMain running = getRunning(workOrderId, productProcessRouteItemId); |
| | | if (running == null) { |
| | | dto.setState(1); |
| | | return dto; |
| | |
| | | if (process == null || process.getType() == null) { |
| | | return "其他"; |
| | | } |
| | | for (ProductProcessEnum value : ProductProcessEnum.values()) { |
| | | if (value.getCode().equals(process.getType())) { |
| | | return value.getInfo(); |
| | | } |
| | | } |
| | | return "其他"; |
| | | String dictLabel = DictUtils.getDictLabel("product_process_type", String.valueOf(process.getType())); |
| | | return (dictLabel == null || dictLabel.isEmpty()) ? "其他" : dictLabel; |
| | | } |
| | | |
| | | private void saveDailyDurations(ProductionProductMain main, LocalDateTime start, LocalDateTime end) { |