日明细表客户快捷选择组件选择父节点问题

dev
wuwenxiong 2021-09-16 15:23:43 +08:00
parent 2f8c9df763
commit d5dcd9c38b
4 changed files with 54 additions and 15 deletions

View File

@ -743,5 +743,28 @@ public abstract class BaseTransport<M extends BaseTransport<M>> extends BaseMode
return getInt("state");
}
/**
* name: flag
* type: SMALLINT(2)
* isNullable: NO
* isPrimaryKey: NO
* defaultValue: 0
*
* @param flag 01
*/
@JSONField(name = "flag")
public void setFlag(Integer flag) {
set("flag", flag);
}
/**
* @return flag 01
*/
@JSONField(name = "flag")
public Integer getFlag() {
return getInt("flag");
}
}

View File

@ -45,7 +45,8 @@ public class OrderStatService {
String truck_license,
Integer isprepaid,
Integer product_id,
String sn
String sn,
Integer customer_type_id
) {
String temp_sql = " select\n" +
" t.sn\n" +
@ -66,9 +67,10 @@ public class OrderStatService {
" , t.create_time \n" +
" , t.product_id \n" +
" , t.product_name \n" +
" , p.in_time, p.out_time, p.first_weight, p.second_weight \n" +
" , p.in_time, p.out_time, p.first_weight, p.second_weight, c.customer_type_id \n" +
" from order_temp t\n" +
" left join transport p on p.order_sn = t.sn \n" +
" left join customer c on c.id = t.customer_id \n" +
" where t.state = ? \n" +
" and t.create_time like ? \n";
@ -94,6 +96,16 @@ public class OrderStatService {
if (customer_id != null && customer_id > 0) {
temp_sql += " and t.customer_id = ? \n";
paraTempList.add(customer_id);
} else {
if (customer_type_id != null && customer_type_id > 0 && customer_type_id != 99) {
temp_sql += " and c.customer_type_id = ? \n";
paraTempList.add(customer_type_id);
} else if(customer_type_id != null && customer_type_id == 99) {
temp_sql += " and t.customer_id is null \n";
} else if (StrKit.notBlank(customer_name) && customer_type_id == null) {
temp_sql += " and t.customer_name like ? \n";
paraTempList.add("%" + customer_name.trim() + "%");
}
}
if (product_id != null && product_id > 0) {
@ -101,11 +113,6 @@ public class OrderStatService {
paraTempList.add(product_id);
}
if (StrKit.notBlank(customer_name)) {
temp_sql += " and t.customer_name like ? \n";
paraTempList.add("%" + customer_name.trim() + "%");
}
if (StrKit.notBlank(truck_license)) {
temp_sql += " and t.truck_license like ? \n";
paraTempList.add("%" + truck_license.trim() + "%");
@ -136,7 +143,7 @@ public class OrderStatService {
" , a.isprepaid\n" +
" , a.product_id \n" +
" , a.product_name \n" +
" , a.in_time, a.out_time, a.first_weight, a.second_weight \n" +
" , a.in_time, a.out_time, a.first_weight, a.second_weight, a.customer_type_id \n" +
" from( \n";
if (null == type) {
@ -163,7 +170,8 @@ public class OrderStatService {
String truck_license,
Integer isprepaid,
Integer product_id,
String sn
String sn,
Integer customer_type_id
) {
List<Record> list = daydetail(tm,
supermarket_id,
@ -174,7 +182,9 @@ public class OrderStatService {
truck_license,
isprepaid,
product_id,
sn);
sn,
customer_type_id
);
list.sort(new Comparator<Record>() {
public int compare(Record o1, Record o2) {
@ -1741,7 +1751,7 @@ public class OrderStatService {
" left join prepay_customer p on p.customer_id = a.id", paramsArray.toArray());
}else {
list = Db.find("select c.id, ifnull(c.name, '零散') name, a.*, p.surplus total_surplus from (\n" +
" select ifnull(t.customer_id, -1) id,, count(t.sn) cnt, sum(t.total_price) total_price, sum(weight) total_weight from order_temp t\n" +
" select ifnull(t.customer_id, -1) id, count(t.sn) cnt, sum(t.total_price) total_price, sum(weight) total_weight from order_temp t\n" +
" where t.state = 5\n" +
" and t.create_time >= ? \n" +
" and t.create_time <= ? \n" +

View File

@ -27,6 +27,7 @@ public class OrderStatController extends BaseController {
Integer type = getInt("type");
Integer isprepaid = getInt("isprepaid");
Integer product_id = getInt("product_id");
Integer customer_type_id = getInt("customer_type_id");
int export = getInt("export", 0); // 是否导出为exce 0 不导出1 导出
@ -41,7 +42,8 @@ public class OrderStatController extends BaseController {
truck_license,
isprepaid,
product_id,
sn
sn,
customer_type_id
)));
} else {
Workbook wb = OrderStatService.me.daydetailExport(
@ -54,7 +56,8 @@ public class OrderStatController extends BaseController {
truck_license,
isprepaid,
product_id,
sn
sn,
customer_type_id
);
render(new ExcelRender(tm + "_日销售明细_" + System.currentTimeMillis() + ".xlsx", wb));
}

View File

@ -44,6 +44,7 @@ public class OrderStatController extends BaseController {
Integer type = getInt("type");
Integer isprepaid = getInt("isprepaid");
Integer product_id = getInt("product_id");
Integer customer_type_id = getInt("customer_type_id");
int export = getInt("export", 0); // 是否导出为exce 0 不导出1 导出
@ -58,7 +59,8 @@ public class OrderStatController extends BaseController {
truck_license,
isprepaid,
product_id,
sn
sn,
customer_type_id
)));
} else {
Workbook wb = OrderStatService.me.daydetailExport(
@ -71,7 +73,8 @@ public class OrderStatController extends BaseController {
truck_license,
isprepaid,
product_id,
sn
sn,
customer_type_id
);
render(new ExcelRender(tm + "_日销售明细_" + System.currentTimeMillis() + ".xlsx", wb));
}