mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 15:55:18 +08:00
添加销售订单报表
This commit is contained in:
@@ -6,7 +6,7 @@ import lombok.Data;
|
||||
|
||||
import org.hibernate.annotations.Comment;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
|
||||
@Data
|
||||
@@ -46,8 +46,8 @@ month
|
||||
*/
|
||||
private List<FieldInfo> fieldInfos;
|
||||
|
||||
private LocalDate startTime;
|
||||
private LocalDate endTime;
|
||||
private LocalDateTime startTime;
|
||||
private LocalDateTime endTime;
|
||||
|
||||
/** 过滤条件 */
|
||||
private List<String> supplierIds;
|
||||
|
||||
@@ -320,15 +320,15 @@ public class SaleOrderService extends BaseService<SaleOrderEntity, SaleOrderRepo
|
||||
</#list>
|
||||
<#list fieldInfos as field>
|
||||
|
||||
<#if field.fieldName == 'price'>, ${field.function}(o.price) as ${underScore(field.fieldName)}_${field.function} </#if>
|
||||
<#if field.fieldName == 'otherFee'>, ${field.function}(o.other_fee) as ${underScore(field.fieldName)}_${field.function} </#if>
|
||||
<#if field.fieldName == 'amount'>, ${field.function}(o.amount) as ${underScore(field.fieldName)}_${field.function} </#if>
|
||||
<#if field.fieldName == 'total'>, ${field.function}(o.amount * o.price + o.other_fee) as ${underScore(field.fieldName)}_${field.function} </#if>
|
||||
<#if field.fieldName == 'price'>, round( ${field.function}(o.price)::::numeric, 2 )as ${underScore(field.fieldName)}_${field.function} </#if>
|
||||
<#if field.fieldName == 'otherFee'>, round( ${field.function}(o.other_fee)::::numeric, 2 )as ${underScore(field.fieldName)}_${field.function} </#if>
|
||||
<#if field.fieldName == 'amount'>, round( ${field.function}(o.amount)::::numeric, 2 )as ${underScore(field.fieldName)}_${field.function} </#if>
|
||||
<#if field.fieldName == 'total'>, round( ${field.function}(o.amount * o.price + o.other_fee)::::numeric, 2 )as ${underScore(field.fieldName)}_${field.function} </#if>
|
||||
|
||||
|
||||
<#if field.fieldName == 'receivedAmount'>, ${field.function}((select round(sum(sz)::::numeric, 2) from t_weight_device_data where purchase_order_id = o.id )) as ${underScore(field.fieldName)}_${field.function} </#if>
|
||||
<#if field.fieldName == 'leftAmount'>, ${field.function}( coalesce(o.amount, 0) - coalesce( (select round(sum(sz)::::numeric, 2) from t_weight_device_data where purchase_order_id = o.id ) , 0)) as ${underScore(field.fieldName)}_${field.function} </#if>
|
||||
<#if field.fieldName == 'totalCarCount'>, ${field.function}( (select count(1) from t_weight_device_data where purchase_order_id = o.id ) ) as ${underScore(field.fieldName)}_${field.function} </#if>
|
||||
<#if field.fieldName == 'receivedAmount'>, round( ${field.function}((select round(sum(sz)::::numeric, 2) from t_weight_device_data where sale_order_id = o.id ))::::numeric, 2 )as ${underScore(field.fieldName)}_${field.function} </#if>
|
||||
<#if field.fieldName == 'leftAmount'>, round( ${field.function}( coalesce(o.amount, 0) - coalesce( (select round(sum(sz)::::numeric, 2) from t_weight_device_data where sale_order_id = o.id ) , 0))::::numeric, 2 )as ${underScore(field.fieldName)}_${field.function} </#if>
|
||||
<#if field.fieldName == 'totalCarCount'>, round( ${field.function}( (select count(1) from t_weight_device_data where sale_order_id = o.id ) )::::numeric, 2 )as ${underScore(field.fieldName)}_${field.function} </#if>
|
||||
|
||||
|
||||
</#list>
|
||||
@@ -412,6 +412,9 @@ public class SaleOrderService extends BaseService<SaleOrderEntity, SaleOrderRepo
|
||||
""))))
|
||||
.toList();
|
||||
|
||||
|
||||
|
||||
|
||||
return new PageImpl<>(ans, PageRequest.of(0, request.getPageSize()), count);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,14 +2,23 @@ package scripts.dict
|
||||
|
||||
import cn.lihongjie.coal.base.dto.CommonQuery
|
||||
import cn.lihongjie.coal.supplier.controller.SupplierController
|
||||
import com.fasterxml.jackson.databind.JsonNode
|
||||
import org.springframework.context.ApplicationContext
|
||||
import org.springframework.data.domain.Sort
|
||||
|
||||
ApplicationContext ioc = ioc;
|
||||
ApplicationContext ioc = ioc
|
||||
|
||||
def controller = ioc.getBean(SupplierController.class)
|
||||
|
||||
|
||||
def query = new CommonQuery()
|
||||
def q = (params as JsonNode).get("q")?.asText('') ?: ''
|
||||
if (!q.isEmpty()) {
|
||||
|
||||
|
||||
return controller.list(new CommonQuery())
|
||||
query.setItems(List.of(new CommonQuery.QueryItem(false, "name", "like", q, null, null, null, null)))
|
||||
query.setPageNo(0)
|
||||
query.setPageSize(10)
|
||||
query.setOrders(List.of(new CommonQuery.Order(Sort.Direction.ASC, "name", null)))
|
||||
}
|
||||
return controller.list(query)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user