gongchunyi
20 小时以前 55487a75a65c14b73f72871e5470744e0564866a
src/main/java/com/ruoyi/purchase/service/impl/PurchaseLedgerServiceImpl.java
@@ -29,7 +29,9 @@
import com.ruoyi.other.mapper.TempFileMapper;
import com.ruoyi.procurementrecord.mapper.ProcurementRecordMapper;
import com.ruoyi.procurementrecord.pojo.ProcurementRecordStorage;
import com.ruoyi.project.system.domain.SysDept;
import com.ruoyi.project.system.domain.SysUser;
import com.ruoyi.project.system.mapper.SysDeptMapper;
import com.ruoyi.project.system.mapper.SysUserMapper;
import com.ruoyi.purchase.dto.PurchaseLedgerDto;
import com.ruoyi.purchase.dto.PurchaseLedgerImportDto;
@@ -87,6 +89,7 @@
    private final SysUserMapper userMapper;
    private final TempFileMapper tempFileMapper;
    private final CommonFileMapper commonFileMapper;
    private final SysDeptMapper sysDeptMapper;
    private final SupplierManageMapper supplierManageMapper;
    private final ProductMapper productMapper;
    private final ProductModelMapper productModelMapper;
@@ -668,4 +671,23 @@
        }
        return sb.toString();
    }
    @Override
    public Map<String, Object> getPrintData(Long id) {
        PurchaseLedger purchaseLedger = getById(id);
        if (purchaseLedger == null) {
            return null;
        }
        List<SalesLedgerProduct> products = salesLedgerProductMapper.selectList(
            new LambdaQueryWrapper<SalesLedgerProduct>()
                .eq(SalesLedgerProduct::getSalesLedgerId, id)
                .eq(SalesLedgerProduct::getType, 2)
        );
        SysDept dept = sysDeptMapper.selectDeptById(100L);
        Map<String, Object> result = new HashMap<>();
        result.put("companyName", dept != null ? dept.getDeptName() : "");
        result.put("ledger", purchaseLedger);
        result.put("products", products);
        return result;
    }
}