| | |
| | | package com.ruoyi.basic.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.basic.dto.ProductDto; |
| | | import com.ruoyi.basic.dto.ProductModelDto; |
| | | import com.ruoyi.basic.dto.ProductTreeDto; |
| | |
| | | } |
| | | return toAjax(productModelService.delProductModel(ids)); |
| | | } |
| | | |
| | | /** |
| | | * 根据id查询产品规格分页查询 |
| | | */ |
| | | @GetMapping("/modelListPage") |
| | | public IPage<ProductModel> selectModelListPage(Page page, ProductDto productDto) { |
| | | return productModelService.modelListPage(page, productDto); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.basic.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.basic.dto.ProductDto; |
| | | import com.ruoyi.basic.dto.ProductModelDto; |
| | |
| | | int delProductModel(Long[] ids); |
| | | |
| | | List<ProductModel> selectModelList(ProductDto productDto); |
| | | |
| | | /** |
| | | * 根据id查询产品规格分页查询 |
| | | * @param page |
| | | * @param productDto |
| | | * @return |
| | | */ |
| | | IPage<ProductModel> modelListPage(Page page , ProductDto productDto); |
| | | } |
| | |
| | | package com.ruoyi.basic.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.basic.dto.ProductDto; |
| | | import com.ruoyi.basic.dto.ProductModelDto; |
| | |
| | | queryWrapper.eq(ProductModel::getProductId, productDto.getId()); |
| | | return productModelMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | /** |
| | | * 根据id查询产品规格分页查询 |
| | | * @param page |
| | | * @param productDto |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<ProductModel> modelListPage(Page page, ProductDto productDto) { |
| | | LambdaQueryWrapper<ProductModel> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(ProductModel::getProductId, productDto.getId()); |
| | | return productModelMapper.selectPage(page, queryWrapper); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.sales.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | |
| | | List<ReceiptPaymentDto> list = receiptPaymentService.receiptPaymentHistoryList(receiptPaymentDto); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 查询回款记录 |
| | | */ |
| | | @GetMapping("/receiptPaymentHistoryListPage") |
| | | public IPage<ReceiptPaymentDto> receiptPaymentHistoryListPage(Page page, ReceiptPaymentDto receiptPaymentDto) { |
| | | return receiptPaymentService.receiptPaymentHistoryListPage(page,receiptPaymentDto); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.sales.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | |
| | | public AjaxResult getAmountHalfYear() { |
| | | return AjaxResult.success(salesLedgerService.getAmountHalfYear()); |
| | | } |
| | | |
| | | /** |
| | | * 查询销售台账列表 |
| | | */ |
| | | @GetMapping("/listPage") |
| | | public IPage<SalesLedger> listPage(Page page, SalesLedgerDto salesLedgerDto) { |
| | | IPage<SalesLedger> iPage = salesLedgerService.selectSalesLedgerListPage(page,salesLedgerDto); |
| | | // 计算已开票金额/未开票金额(已填写发票金额为准) |
| | | if(CollectionUtils.isEmpty(iPage.getRecords())){ |
| | | return iPage; |
| | | } |
| | | List<Long> salesLedgerIds = iPage.getRecords().stream().map(SalesLedger::getId).collect(Collectors.toList()); |
| | | List<InvoiceLedgerDto> invoiceLedgerDtoList = invoiceLedgerMapper.invoicedTotal(salesLedgerIds); |
| | | if(CollectionUtils.isEmpty(invoiceLedgerDtoList)){ |
| | | return iPage; |
| | | } |
| | | for (SalesLedger salesLedger : iPage.getRecords()) { |
| | | for (InvoiceLedgerDto invoiceLedgerDto : invoiceLedgerDtoList) { |
| | | if (salesLedger.getId().intValue() == invoiceLedgerDto.getSalesLedgerId()) { |
| | | BigDecimal noInvoiceAmountTotal = salesLedger.getContractAmount().subtract(invoiceLedgerDto.getInvoiceTotal()); |
| | | salesLedger.setNoInvoiceAmountTotal(noInvoiceAmountTotal); |
| | | } |
| | | } |
| | | } |
| | | return iPage; |
| | | } |
| | | } |
| | |
| | | */ |
| | | List<ReceiptPaymentDto> receiptPaymentHistoryList(@Param("params") ReceiptPaymentDto receiptPaymentDto); |
| | | |
| | | /** |
| | | * 查询回款记录分页 |
| | | */ |
| | | IPage<ReceiptPaymentDto> receiptPaymentHistoryListPage(Page page,@Param("params") ReceiptPaymentDto receiptPaymentDto); |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.support.SFunction; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.sales.dto.SalesLedgerDto; |
| | | import com.ruoyi.sales.pojo.SalesLedger; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | * @return |
| | | */ |
| | | List<SalesLedger> selectSalesLedgerList(@Param("salesLedgerDto") SalesLedgerDto salesLedgerDto); |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param page |
| | | * @param salesLedgerDto |
| | | * @return |
| | | */ |
| | | IPage<SalesLedger> selectSalesLedgerListPage(Page page, @Param("salesLedgerDto") SalesLedgerDto salesLedgerDto); |
| | | } |
| | |
| | | package com.ruoyi.sales.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.sales.dto.MonthlyAmountDto; |
| | | import com.ruoyi.sales.dto.SalesLedgerDto; |
| | |
| | | List getTopFiveList(); |
| | | |
| | | List<MonthlyAmountDto> getAmountHalfYear(); |
| | | |
| | | IPage<SalesLedger> selectSalesLedgerListPage(Page page, SalesLedgerDto salesLedgerDto); |
| | | } |
| | |
| | | import com.ruoyi.sales.dto.InvoiceLedgerDto; |
| | | import com.ruoyi.sales.dto.ReceiptPaymentDto; |
| | | import com.ruoyi.sales.pojo.ReceiptPayment; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | |
| | | * 查询回款记录 |
| | | */ |
| | | List<ReceiptPaymentDto> receiptPaymentHistoryList(ReceiptPaymentDto receiptPaymentDto); |
| | | |
| | | /** |
| | | * 查询回款记录分页 |
| | | */ |
| | | IPage<ReceiptPaymentDto> receiptPaymentHistoryListPage(Page page, ReceiptPaymentDto receiptPaymentDto); |
| | | } |
| | |
| | | public List<ReceiptPaymentDto> receiptPaymentHistoryList(ReceiptPaymentDto receiptPaymentDto) { |
| | | return receiptPaymentMapper.receiptPaymentHistoryList(receiptPaymentDto); |
| | | } |
| | | |
| | | /** |
| | | * 查询回款记录分页 |
| | | */ |
| | | @Override |
| | | public IPage<ReceiptPaymentDto> receiptPaymentHistoryListPage(Page page, ReceiptPaymentDto receiptPaymentDto) { |
| | | return receiptPaymentMapper.receiptPaymentHistoryListPage(page, receiptPaymentDto); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.basic.mapper.CustomerMapper; |
| | | import com.ruoyi.basic.pojo.Customer; |
| | |
| | | return monthlyAmounts; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<SalesLedger> selectSalesLedgerListPage(Page page, SalesLedgerDto salesLedgerDto) { |
| | | return salesLedgerMapper.selectSalesLedgerListPage(page, salesLedgerDto); |
| | | } |
| | | |
| | | // 内部类用于存储聚合结果 |
| | | private static class GroupedCustomer { |
| | | private final Long customerId; |
| | |
| | | ORDER BY T1.receipt_payment_date DESC |
| | | </select> |
| | | |
| | | <select id="receiptPaymentHistoryListPage" resultType="com.ruoyi.sales.dto.ReceiptPaymentDto"> |
| | | SELECT |
| | | T1.receipt_payment_date, |
| | | T5.customer_name, |
| | | T1.receipt_payment_amount, |
| | | T1.receipt_payment_type, |
| | | T1.registrant, |
| | | T1.create_time |
| | | FROM |
| | | receipt_payment T1 |
| | | LEFT JOIN |
| | | invoice_ledger T2 ON T1.invoice_ledger_id = T2.id |
| | | LEFT JOIN invoice_registration_product T3 ON T2.invoice_registration_product_id = T3.id |
| | | LEFT JOIN sales_ledger T4 ON T3.sales_ledger_id = T4.id |
| | | LEFT JOIN customer T5 ON T5.id = T4.customer_id |
| | | <where> |
| | | <if test="params.searchText != null and params.searchText != '' "> |
| | | T5.customer_name LIKE CONCAT('%',#{params.searchText},'%') |
| | | </if> |
| | | </where> |
| | | ORDER BY T1.receipt_payment_date DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectSalesLedgerListPage" resultType="com.ruoyi.sales.pojo.SalesLedger"> |
| | | SELECT |
| | | T1.id, |
| | | T1.sales_contract_no, |
| | | T1.customer_contract_no, |
| | | T1.project_name, |
| | | T1.entry_date, |
| | | T1.salesman, |
| | | T1.customer_id, |
| | | T1.customer_name, |
| | | T1.entry_person, |
| | | T1.remarks, |
| | | T1.attachment_materials, |
| | | T1.tenant_id, |
| | | T1.contract_amount, |
| | | T1.execution_date, |
| | | T2.nick_name AS entry_person_name |
| | | FROM |
| | | sales_ledger T1 |
| | | LEFT JOIN sys_user T2 ON T1.entry_person = T2.user_id |
| | | <where> |
| | | <if test="salesLedgerDto.customerName != null and salesLedgerDto.customerName != '' "> |
| | | T1.customer_name LIKE CONCAT('%',#{salesLedgerDto.customerName},'%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |