liding
4 天以前 1946aa0712f623dd5e0221ef2481bc3d8d224e74
src/main/java/com/ruoyi/production/service/impl/ProductionProductMainServiceImpl.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -33,6 +34,7 @@
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -165,12 +167,13 @@
        //更新工单
        if (insert > 0) {
            UpdateWrapper<ProductWorkOrder> wrapper = new UpdateWrapper<>();
            wrapper.set("report_work", true)
                    .set("quantity", dto.getQuantity())
                    .set("product_main_id", productionProductMain.getId())
                    .eq("id", dto.getWorkOrderId());
            productWorkOrderMapper.update(null, wrapper);
            Map<String, Object> params = new HashMap<>();
            params.put("quantity", dto.getQuantity());
            params.put("productMainId", productionProductMain.getId());
            params.put("workOrderId", dto.getWorkOrderId());
            params.put("deductQuantity", dto.getQuantity());
            productWorkOrderMapper.updatePlanQuantity(params);
        }
        ProductProcess productProcess = productProcessMapper.selectById(productProcessRouteItem.getProcessId());
        ProductModel productModel = productProcessRouteItem.getProductModelId() != null ?
@@ -252,6 +255,8 @@
    public Boolean removeProductMain(ProductionProductMainDto dto) {
        Long id = dto.getId();
        // 更新工单
        productWorkOrderMapper.rollbackPlanQuantity(id);
        // 删除质检参数和质检记录
        qualityInspectMapper.selectList(
                new LambdaQueryWrapper<QualityInspect>()
@@ -270,9 +275,9 @@
        // 删除关联的核算数据
        salesLedgerProductionAccountingMapper.delete(
                        new LambdaQueryWrapper<SalesLedgerProductionAccounting>()
                                .eq(SalesLedgerProductionAccounting::getSalesLedgerWorkId, id)
                );
                new LambdaQueryWrapper<SalesLedgerProductionAccounting>()
                        .eq(SalesLedgerProductionAccounting::getSalesLedgerWorkId, id)
        );
        // 删除主表
        return productionProductMainMapper.deleteById(id) > 0;