| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | |
| | | */ |
| | | @GetMapping("/registrationProductPage") |
| | | public AjaxResult registrationProductPage(Page page, InvoiceRegistrationProductDto registrationProductDto) { |
| | | |
| | | return AjaxResult.success(invoiceLedgerService.registrationProductPage(page,registrationProductDto)); |
| | | } |
| | | |
| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | |
| | | |
| | | private Boolean status; |
| | | |
| | | private String projectName; |
| | | |
| | | |
| | | @TableField(exist = false) |
| | | private String createTimeStart; |
| | | @TableField(exist = false) |
| | | private String createTimeEnd; |
| | | |
| | | |
| | | } |
| | |
| | | private String salesContractNo; |
| | | private String customerContractNo; |
| | | private String projectName; |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date entryDate; |
| | | // @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private String entryDate; |
| | | private String salesman; |
| | | private Long customerId; |
| | | private String customerName; |
| | |
| | | // 2. 查询子表 |
| | | LambdaQueryWrapper<SalesLedgerProduct> productWrapper = new LambdaQueryWrapper<>(); |
| | | productWrapper.eq(SalesLedgerProduct::getSalesLedgerId, salesLedger.getId()); |
| | | productWrapper.eq(SalesLedgerProduct::getType, 1); |
| | | List<SalesLedgerProduct> products = salesLedgerProductMapper.selectList(productWrapper); |
| | | for (SalesLedgerProduct product : products) { |
| | | product.setOriginalNoInvoiceNum(product.getNoInvoiceNum()); |
| | |
| | | IFNULL(T3.invoice_total,0) AS invoice_total, |
| | | T3.invoice_person, |
| | | T3.invoice_date, |
| | | T4.invoiceFileName |
| | | T4.invoiceFileName, |
| | | T2.project_name |
| | | FROM invoice_registration_product T1 |
| | | LEFT JOIN sales_ledger T2 ON T1.sales_ledger_id = T2.id |
| | | LEFT JOIN invoice_ledger T3 ON T1.id = T3.invoice_registration_product_id |
| | |
| | | <if test="invoiceRegistrationProductDto.invoiceDateEnd != null and invoiceRegistrationProductDto.invoiceDateEnd != ''"> |
| | | AND T3.invoice_date <= date_format(#{invoiceRegistrationProductDto.invoiceDateEnd}, '%Y-%m-%d') |
| | | </if> |
| | | <if test="invoiceRegistrationProductDto.createTimeStart != null "> |
| | | AND T1.create_time >= date_format(#{invoiceRegistrationProductDto.createTimeStart}, '%Y-%m-%d %H:%i:%s') |
| | | </if> |
| | | <if test="invoiceRegistrationProductDto.createTimeEnd != null "> |
| | | AND T1.create_time <= date_format(#{invoiceRegistrationProductDto.createTimeStart}, '%Y-%m-%d %H:%i:%s')+interval 1 day |
| | | </if> |
| | | </where> |
| | | ORDER BY T1.create_time DESC |
| | | </select> |
| | |
| | | <if test="salesLedgerDto.projectName != null and salesLedgerDto.projectName != '' "> |
| | | T1.project_name LIKE CONCAT('%',#{salesLedgerDto.projectName},'%') |
| | | </if> |
| | | <if test="salesLedgerDto.entryDate != null and salesLedgerDto.entryDate != '' "> |
| | | T1.entry_date = DATE_FORMAT(#{salesLedgerDto.entryDate},'%Y-%m-%d') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |