From d5dcd9c38beeba6caf9548fa1bca2e1e5d28b798 Mon Sep 17 00:00:00 2001 From: wuwenxiong <646448316@qq.com> Date: Thu, 16 Sep 2021 15:23:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E6=98=8E=E7=BB=86=E8=A1=A8=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E5=BF=AB=E6=8D=B7=E9=80=89=E6=8B=A9=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E7=88=B6=E8=8A=82=E7=82=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/cowr/model/base/BaseTransport.java | 23 +++++++++++++ .../ssjygl/stat/sale/OrderStatService.java | 32 ++++++++++++------- .../ssjygl/stat/sale/OrderStatController.java | 7 ++-- .../ssjygl/stat/sale/OrderStatController.java | 7 ++-- 4 files changed, 54 insertions(+), 15 deletions(-) diff --git a/ssjygl-xsx-common/src/main/java/com/cowr/model/base/BaseTransport.java b/ssjygl-xsx-common/src/main/java/com/cowr/model/base/BaseTransport.java index bc8198e..37bba0a 100644 --- a/ssjygl-xsx-common/src/main/java/com/cowr/model/base/BaseTransport.java +++ b/ssjygl-xsx-common/src/main/java/com/cowr/model/base/BaseTransport.java @@ -743,5 +743,28 @@ public abstract class BaseTransport> extends BaseMode return getInt("state"); } + /** + * name: flag + * type: SMALLINT(2) + * isNullable: NO + * isPrimaryKey: NO + * defaultValue: 0 + * + * @param flag 0:正常,1:取消出厂 + */ + @JSONField(name = "flag") + public void setFlag(Integer flag) { + set("flag", flag); + } + + + /** + * @return flag 0:正常,1:取消出厂 + */ + @JSONField(name = "flag") + public Integer getFlag() { + return getInt("flag"); + } + } diff --git a/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/stat/sale/OrderStatService.java b/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/stat/sale/OrderStatService.java index 253e37e..9382542 100644 --- a/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/stat/sale/OrderStatService.java +++ b/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/stat/sale/OrderStatService.java @@ -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 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() { 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" + diff --git a/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/stat/sale/OrderStatController.java b/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/stat/sale/OrderStatController.java index 61a02fe..f6a3ae5 100644 --- a/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/stat/sale/OrderStatController.java +++ b/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/stat/sale/OrderStatController.java @@ -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)); } diff --git a/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/stat/sale/OrderStatController.java b/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/stat/sale/OrderStatController.java index 2749ca2..89e3fdf 100644 --- a/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/stat/sale/OrderStatController.java +++ b/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/stat/sale/OrderStatController.java @@ -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)); }