统计添加客户类型筛选
parent
1446981fd6
commit
4e0227d14c
File diff suppressed because it is too large
Load Diff
|
|
@ -17,16 +17,16 @@ public class OrderStatController extends BaseController {
|
|||
*/
|
||||
@Before(DayValidator.class)
|
||||
public void daydetail() {
|
||||
String tm = get("tm");
|
||||
String truck_license = getUpperCaseVal("truck_license");
|
||||
String sn = get("sn");
|
||||
Integer supermarket_id = getInt("supermarket_id");
|
||||
Integer trans_co_id = getInt("trans_co_id");
|
||||
Integer customer_id = getInt("customer_id");
|
||||
Integer type = getInt("type");
|
||||
Integer isprepaid = getInt("isprepaid");
|
||||
Integer product_id = getInt("product_id");
|
||||
Integer customer_type_id = getInt("customer_type_id");
|
||||
String tm = get("tm");
|
||||
String truck_license = getUpperCaseVal("truck_license");
|
||||
String sn = get("sn");
|
||||
Integer supermarket_id = getInt("supermarket_id");
|
||||
Integer trans_co_id = getInt("trans_co_id");
|
||||
Integer customer_id = getInt("customer_id");
|
||||
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 导出
|
||||
|
||||
|
|
@ -69,8 +69,8 @@ public class OrderStatController extends BaseController {
|
|||
Integer customer_id = getInt("customer_id");
|
||||
String tm = get("tm");
|
||||
int export = getInt("export", 0);
|
||||
Integer product_id = getInt("product_id");
|
||||
Boolean stat_product = getBoolean("stat_product",false);
|
||||
Integer product_id = getInt("product_id");
|
||||
Boolean stat_product = getBoolean("stat_product", false);
|
||||
|
||||
if (export == 0) {
|
||||
renderJson(Result.object(OrderStatService.me.monthgrid(tm, supermarket_id, customer_id, stat_product, product_id)));
|
||||
|
|
@ -117,14 +117,16 @@ public class OrderStatController extends BaseController {
|
|||
*/
|
||||
@Before(DayValidator.class)
|
||||
public void daystatCustomer() {
|
||||
String tm = get("tm");
|
||||
Integer invoice_type = getInt("invoice_type");
|
||||
int export = getInt("export", 0);
|
||||
Boolean stat_product = getBoolean("stat_product",false);
|
||||
String tm = get("tm");
|
||||
Integer invoice_type = getInt("invoice_type");
|
||||
Integer customer_id = getInt("customer_id");
|
||||
Integer customer_type_id = getInt("customer_type_id");
|
||||
int export = getInt("export", 0);
|
||||
Boolean stat_product = getBoolean("stat_product", false);
|
||||
if (export == 0) {
|
||||
renderJson(Result.object(OrderStatService.me.salestatCustomer(tm, invoice_type, stat_product)));
|
||||
renderJson(Result.object(OrderStatService.me.salestatCustomer(tm, invoice_type, stat_product, customer_id, customer_type_id)));
|
||||
} else {
|
||||
Workbook wb = OrderStatService.me.daysalestatCustomerExport(tm, invoice_type, stat_product);
|
||||
Workbook wb = OrderStatService.me.daysalestatCustomerExport(tm, invoice_type, stat_product, customer_id, customer_type_id);
|
||||
render(new ExcelRender(tm + "_销售日统计_" + System.currentTimeMillis() + ".xlsx", wb));
|
||||
}
|
||||
}
|
||||
|
|
@ -134,14 +136,16 @@ public class OrderStatController extends BaseController {
|
|||
*/
|
||||
@Before(MonthValidator.class)
|
||||
public void monthstatCustomer() {
|
||||
String tm = get("tm");
|
||||
Integer invoice_type = getInt("invoice_type");
|
||||
int export = getInt("export", 0);
|
||||
Boolean stat_product = getBoolean("stat_product",false);
|
||||
String tm = get("tm");
|
||||
Integer invoice_type = getInt("invoice_type");
|
||||
Integer customer_id = getInt("customer_id");
|
||||
Integer customer_type_id = getInt("customer_type_id");
|
||||
int export = getInt("export", 0);
|
||||
Boolean stat_product = getBoolean("stat_product", false);
|
||||
if (export == 0) {
|
||||
renderJson(Result.object(OrderStatService.me.salestatCustomer(tm, invoice_type, stat_product)));
|
||||
renderJson(Result.object(OrderStatService.me.salestatCustomer(tm, invoice_type, stat_product, customer_id, customer_type_id)));
|
||||
} else {
|
||||
Workbook wb = OrderStatService.me.monthsalestatCustomerExport(tm, invoice_type, stat_product);
|
||||
Workbook wb = OrderStatService.me.monthsalestatCustomerExport(tm, invoice_type, stat_product, customer_id, customer_type_id);
|
||||
render(new ExcelRender(tm + "_销售月统计_" + System.currentTimeMillis() + ".xlsx", wb));
|
||||
}
|
||||
}
|
||||
|
|
@ -155,7 +159,7 @@ public class OrderStatController extends BaseController {
|
|||
String etm = get("etm"); // 前端将 YYYY-MM-DD 后面补 " 23:59:59"
|
||||
Integer supermarket_id = getInt("supermarket_id");
|
||||
int export = getInt("export", 0);
|
||||
Boolean stat_product = getBoolean("stat_product",false);
|
||||
Boolean stat_product = getBoolean("stat_product", false);
|
||||
Integer product_id = getInt("product_id");
|
||||
|
||||
if (export == 0) {
|
||||
|
|
@ -231,19 +235,20 @@ public class OrderStatController extends BaseController {
|
|||
*/
|
||||
@Before(DayValidator.class)
|
||||
public void statDayCustomer() {
|
||||
String tm = get("tm");
|
||||
int export = getInt("export", 0); // 是否导出为exce 0 不导出,1 导出
|
||||
Integer supermarket_id = getInt("supermarket_id");
|
||||
Integer customer_id = getInt("customer_id");
|
||||
String customer_ids = get("customer_ids");
|
||||
Integer product_id = getInt("product_id");
|
||||
boolean stat_product = getBoolean("stat_product", false);
|
||||
Integer isprepaid = getInt("isprepaid");
|
||||
String tm = get("tm");
|
||||
int export = getInt("export", 0); // 是否导出为exce 0 不导出,1 导出
|
||||
Integer supermarket_id = getInt("supermarket_id");
|
||||
Integer customer_id = getInt("customer_id");
|
||||
Integer customer_type_id = getInt("customer_type_id");
|
||||
String customer_ids = get("customer_ids");
|
||||
Integer product_id = getInt("product_id");
|
||||
boolean stat_product = getBoolean("stat_product", false);
|
||||
Integer isprepaid = getInt("isprepaid");
|
||||
|
||||
if (export == 0) {
|
||||
renderJson(Result.object(OrderStatService.me.statCustomer(tm, null, null, supermarket_id, customer_id, customer_ids, stat_product, product_id, isprepaid)));
|
||||
renderJson(Result.object(OrderStatService.me.statCustomer(tm, null, null, supermarket_id, customer_id, customer_ids, customer_type_id, stat_product, product_id, isprepaid)));
|
||||
} else {
|
||||
Workbook wb = OrderStatService.me.statCustomerExport("砂站日销售汇总表", tm, null, null, supermarket_id, customer_id, customer_ids, stat_product, product_id, isprepaid);
|
||||
Workbook wb = OrderStatService.me.statCustomerExport("砂站日销售汇总表", tm, null, null, supermarket_id, customer_id, customer_ids, customer_type_id, stat_product, product_id, isprepaid);
|
||||
render(new ExcelRender(tm + "_砂站日" + (isprepaid != null && isprepaid == 1 ? "预付费" : "") + "销售汇总表_" + System.currentTimeMillis() + ".xlsx", wb));
|
||||
}
|
||||
}
|
||||
|
|
@ -253,91 +258,97 @@ public class OrderStatController extends BaseController {
|
|||
*/
|
||||
@Before(MonthValidator.class)
|
||||
public void statMonthCustomer() {
|
||||
String tm = get("tm");
|
||||
int export = getInt("export", 0); // 是否导出为exce 0 不导出,1 导出
|
||||
Integer supermarket_id = getInt("supermarket_id");
|
||||
Integer customer_id = getInt("customer_id");
|
||||
String customer_ids = get("customer_ids");
|
||||
Integer product_id = getInt("product_id");
|
||||
boolean stat_product = getBoolean("stat_product", false);
|
||||
Integer isprepaid = getInt("isprepaid");
|
||||
String tm = get("tm");
|
||||
int export = getInt("export", 0); // 是否导出为exce 0 不导出,1 导出
|
||||
Integer supermarket_id = getInt("supermarket_id");
|
||||
Integer customer_id = getInt("customer_id");
|
||||
Integer customer_type_id = getInt("customer_type_id");
|
||||
String customer_ids = get("customer_ids");
|
||||
Integer product_id = getInt("product_id");
|
||||
boolean stat_product = getBoolean("stat_product", false);
|
||||
Integer isprepaid = getInt("isprepaid");
|
||||
|
||||
if (export == 0) {
|
||||
renderJson(Result.object(OrderStatService.me.statCustomer(tm, null, null, supermarket_id, customer_id, customer_ids, stat_product, product_id, isprepaid)));
|
||||
renderJson(Result.object(OrderStatService.me.statCustomer(tm, null, null, supermarket_id, customer_id, customer_ids, customer_type_id, stat_product, product_id, isprepaid)));
|
||||
} else {
|
||||
Workbook wb = OrderStatService.me.statCustomerExport("砂站月销售汇总表", tm, null, null, supermarket_id, customer_id, customer_ids, stat_product, product_id, isprepaid);
|
||||
Workbook wb = OrderStatService.me.statCustomerExport("砂站月销售汇总表", tm, null, null, supermarket_id, customer_id, customer_ids, customer_type_id, stat_product, product_id, isprepaid);
|
||||
render(new ExcelRender(tm + "_砂站月" + (isprepaid != null && isprepaid == 1 ? "预付费" : "") + "销售汇总表_" + System.currentTimeMillis() + ".xlsx", wb));
|
||||
}
|
||||
}
|
||||
|
||||
@Before(StartAndEndIntervalValidator.class)
|
||||
public void statRangeCustomer() {
|
||||
String stm = get("stm"); // 前端将 YYYY-MM-DD 后面补 " 00:00:00"
|
||||
String etm = get("etm"); // 前端将 YYYY-MM-DD 后面补 " 23:59:59"
|
||||
int export = getInt("export", 0); // 是否导出为exce 0 不导出,1 导出
|
||||
Integer supermarket_id = getInt("supermarket_id");
|
||||
Integer customer_id = getInt("customer_id");
|
||||
String customer_ids = get("customer_ids");
|
||||
Integer product_id = getInt("product_id");
|
||||
boolean stat_product = getBoolean("stat_product", false);
|
||||
Integer isprepaid = getInt("isprepaid");
|
||||
String stm = get("stm"); // 前端将 YYYY-MM-DD 后面补 " 00:00:00"
|
||||
String etm = get("etm"); // 前端将 YYYY-MM-DD 后面补 " 23:59:59"
|
||||
int export = getInt("export", 0); // 是否导出为exce 0 不导出,1 导出
|
||||
Integer supermarket_id = getInt("supermarket_id");
|
||||
Integer customer_id = getInt("customer_id");
|
||||
Integer customer_type_id = getInt("customer_type_id");
|
||||
String customer_ids = get("customer_ids");
|
||||
Integer product_id = getInt("product_id");
|
||||
boolean stat_product = getBoolean("stat_product", false);
|
||||
Integer isprepaid = getInt("isprepaid");
|
||||
|
||||
if (export == 0) {
|
||||
renderJson(Result.object(OrderStatService.me.statCustomer(null, stm, etm, supermarket_id, customer_id, customer_ids, stat_product, product_id, isprepaid)));
|
||||
renderJson(Result.object(OrderStatService.me.statCustomer(null, stm, etm, supermarket_id, customer_id, customer_ids, customer_type_id, stat_product, product_id, isprepaid)));
|
||||
} else {
|
||||
Workbook wb = OrderStatService.me.statCustomerExport("砂站时段销售汇总表", null, stm, etm, supermarket_id, customer_id, customer_ids, stat_product, product_id, isprepaid);
|
||||
Workbook wb = OrderStatService.me.statCustomerExport("砂站时段销售汇总表", null, stm, etm, supermarket_id, customer_id, customer_ids, customer_type_id, stat_product, product_id, isprepaid);
|
||||
render(new ExcelRender(stm + "_" + etm + "_砂站" + (isprepaid != null && isprepaid == 1 ? "预付费" : "") + "销售汇总表_" + System.currentTimeMillis() + ".xlsx", wb));
|
||||
}
|
||||
}
|
||||
|
||||
public void statYearCustomer() {
|
||||
String tm = get("tm");
|
||||
int export = getInt("export", 0); // 是否导出为exce 0 不导出,1 导出
|
||||
Boolean stat_product = getBoolean("stat_product",false);
|
||||
String tm = get("tm");
|
||||
Integer customer_id = getInt("customer_id");
|
||||
Integer customer_type_id = getInt("customer_type_id");
|
||||
int export = getInt("export", 0); // 是否导出为exce 0 不导出,1 导出
|
||||
Boolean stat_product = getBoolean("stat_product", false);
|
||||
if (export == 0) {
|
||||
renderJson(Result.object(OrderStatService.me.yearStatByCustomer(tm, stat_product)));
|
||||
renderJson(Result.object(OrderStatService.me.yearStatByCustomer(tm, stat_product, customer_id, customer_type_id)));
|
||||
} else {
|
||||
Workbook wb = OrderStatService.me.yearStatByCustomerExport(tm, stat_product);
|
||||
Workbook wb = OrderStatService.me.yearStatByCustomerExport(tm, stat_product, customer_id, customer_type_id);
|
||||
render(new ExcelRender("按客户统计总销售汇总表_" + System.currentTimeMillis() + ".xlsx", wb));
|
||||
}
|
||||
}
|
||||
|
||||
public void statYearBySup() {
|
||||
String tm = get("tm");
|
||||
int export = getInt("export", 0); // 是否导出为exce 0 不导出,1 导出
|
||||
Boolean stat_product = getBoolean("stat_product",false);
|
||||
String tm = get("tm");
|
||||
int export = getInt("export", 0); // 是否导出为exce 0 不导出,1 导出
|
||||
Boolean stat_product = getBoolean("stat_product", false);
|
||||
|
||||
if (export == 0) {
|
||||
renderJson(Result.object(OrderStatService.me.yearStatBySup(tm, stat_product)));
|
||||
renderJson(Result.object(OrderStatService.me.salestat(tm)));
|
||||
} else {
|
||||
Workbook wb = OrderStatService.me.yearStatBySupExport(tm, stat_product);
|
||||
Workbook wb = OrderStatService.me.yearsalestatExport(tm);
|
||||
render(new ExcelRender("按砂站总销售汇总表_" + System.currentTimeMillis() + ".xlsx", wb));
|
||||
}
|
||||
}
|
||||
|
||||
@Before(StartAndEndIntervalValidator.class)
|
||||
public void statRangeAllCustomer() {
|
||||
String stm = get("stm");
|
||||
String etm = get("etm");
|
||||
int export = getInt("export", 0); // 是否导出为exce 0 不导出,1 导出
|
||||
Boolean stat_product = getBoolean("stat_product",false);
|
||||
Integer product_id = getInt("product_id");
|
||||
String stm = get("stm");
|
||||
String etm = get("etm");
|
||||
int export = getInt("export", 0); // 是否导出为exce 0 不导出,1 导出
|
||||
Boolean stat_product = getBoolean("stat_product", false);
|
||||
Integer product_id = getInt("product_id");
|
||||
Integer customer_id = getInt("customer_id");
|
||||
Integer customer_type_id = getInt("customer_type_id");
|
||||
|
||||
if (export == 0) {
|
||||
renderJson(Result.object(OrderStatService.me.yearStatByCustomer(stm, etm, stat_product, product_id)));
|
||||
renderJson(Result.object(OrderStatService.me.yearStatByCustomer(stm, etm, stat_product, product_id, customer_id, customer_type_id)));
|
||||
} else {
|
||||
Workbook wb = OrderStatService.me.yearStatByCustomerExport(stm, etm, stat_product, product_id);
|
||||
Workbook wb = OrderStatService.me.yearStatByCustomerExport(stm, etm, stat_product, product_id, customer_id, customer_type_id);
|
||||
render(new ExcelRender("按客户统计总销售汇总表_" + System.currentTimeMillis() + ".xlsx", wb));
|
||||
}
|
||||
}
|
||||
|
||||
@Before(StartAndEndIntervalValidator.class)
|
||||
public void statRangeAllSup() {
|
||||
String stm = get("stm");
|
||||
String etm = get("etm");
|
||||
Boolean stat_product = getBoolean("stat_product",false);
|
||||
Integer product_id = getInt("product_id");
|
||||
int export = getInt("export", 0); // 是否导出为exce 0 不导出,1 导出
|
||||
String stm = get("stm");
|
||||
String etm = get("etm");
|
||||
Boolean stat_product = getBoolean("stat_product", false);
|
||||
Integer product_id = getInt("product_id");
|
||||
int export = getInt("export", 0); // 是否导出为exce 0 不导出,1 导出
|
||||
|
||||
if (export == 0) {
|
||||
renderJson(Result.object(OrderStatService.me.yearStatBySup(stm, etm, stat_product, product_id)));
|
||||
|
|
@ -351,10 +362,10 @@ public class OrderStatController extends BaseController {
|
|||
* 固定、零散配额指定年的销售统计汇总数据
|
||||
*/
|
||||
public void yearStatisticsByCustomerId() {
|
||||
String year = get("year");
|
||||
Integer customer_id = getInt("customer_id");
|
||||
String customer_name = get("customer_name");
|
||||
Integer type = getInt("type");
|
||||
String year = get("year");
|
||||
Integer customer_id = getInt("customer_id");
|
||||
String customer_name = get("customer_name");
|
||||
Integer type = getInt("type");
|
||||
renderJson(Result.object(OrderStatService.me.yearStatisticsByCustomerId(year, customer_id, customer_name, type)));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -193,9 +193,15 @@ public class StatSmsJob implements Job {
|
|||
|
||||
/**
|
||||
* 累计销售汇总,含前日汇总
|
||||
* 王乐 2021-08-17
|
||||
* 四家客户2020年12月30日、31日两天的销售数据是固定值(4677.26吨、420953.4元)
|
||||
* 2021年新增客户销售=2021年销售汇总 -四家客户充值金额(2000万)+四家客户2020年12月30日、31日两天的销售数据
|
||||
* 王乐 2021-09-22
|
||||
*
|
||||
* 274.62-27.34
|
||||
* 21830.32-2011.27
|
||||
*
|
||||
* 新增客户销售的计算公式
|
||||
*
|
||||
* 27.34和2011.27这两个数是固定值
|
||||
* 274.62和21830.32这两个数是系统里统计的总数
|
||||
*/
|
||||
public void statAggr() {
|
||||
Date now = new Date();
|
||||
|
|
@ -264,8 +270,18 @@ public class StatSmsJob implements Job {
|
|||
}
|
||||
|
||||
obj.put("aggr_cnt", orderobj.get("aggr_cnt"));
|
||||
obj.put("aggr_weight", String.format("%.2f万", orderobj.getBigDecimal("aggr_weight").divide(new BigDecimal("10000"), 2, BigDecimal.ROUND_HALF_UP)));
|
||||
obj.put("aggr_price", String.format("%.2f万", orderobj.getBigDecimal("aggr_price").divide(new BigDecimal("10000"), 2, BigDecimal.ROUND_HALF_UP)));
|
||||
obj.put("aggr_weight", String.format("%.2f万",
|
||||
orderobj.getBigDecimal("aggr_weight")
|
||||
.divide(new BigDecimal("10000"), 2, BigDecimal.ROUND_HALF_UP)
|
||||
.subtract(new BigDecimal("27.34"))
|
||||
)
|
||||
);
|
||||
obj.put("aggr_price", String.format("%.2f万",
|
||||
orderobj.getBigDecimal("aggr_price")
|
||||
.divide(new BigDecimal("10000"), 2, BigDecimal.ROUND_HALF_UP)
|
||||
.subtract(new BigDecimal("2011.27"))
|
||||
)
|
||||
);
|
||||
|
||||
obj.put("customer_weight", String.format("%.2f万", revenueobj.getBigDecimal("weight").divide(new BigDecimal("10000"), 2, BigDecimal.ROUND_HALF_UP)));
|
||||
obj.put("customer_price", String.format("%.2f万", revenueobj.getBigDecimal("total_price").divide(new BigDecimal("10000"), 2, BigDecimal.ROUND_HALF_UP)));
|
||||
|
|
|
|||
|
|
@ -40,10 +40,10 @@ public class OrderStatController extends BaseController {
|
|||
customer_id = tokenuser.getEntityId();
|
||||
}
|
||||
|
||||
Integer type = getInt("type");
|
||||
Integer isprepaid = getInt("isprepaid");
|
||||
Integer product_id = getInt("product_id");
|
||||
Integer customer_type_id = getInt("customer_type_id");
|
||||
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 导出
|
||||
|
||||
|
|
@ -84,8 +84,8 @@ public class OrderStatController extends BaseController {
|
|||
public void monthgrid() {
|
||||
Integer supermarket_id = getInt("supermarket_id");
|
||||
Integer customer_id = getInt("customer_id");
|
||||
Integer product_id = getInt("product_id");
|
||||
Boolean stat_product = getBoolean("stat_product",false);
|
||||
Integer product_id = getInt("product_id");
|
||||
Boolean stat_product = getBoolean("stat_product", false);
|
||||
|
||||
Sysuser tokenuser = SysuserSyncService.me.getSysuserByToken(get("token"));
|
||||
|
||||
|
|
@ -145,15 +145,17 @@ public class OrderStatController extends BaseController {
|
|||
*/
|
||||
@Before(DayValidator.class)
|
||||
public void daystatCustomer() {
|
||||
String tm = get("tm");
|
||||
Integer invoice_type = getInt("invoice_type");
|
||||
int export = getInt("export", 0);
|
||||
Boolean stat_product = getBoolean("stat_product",false);
|
||||
String tm = get("tm");
|
||||
Integer invoice_type = getInt("invoice_type");
|
||||
Integer customer_id = getInt("customer_id");
|
||||
Integer customer_type_id = getInt("customer_type_id");
|
||||
int export = getInt("export", 0);
|
||||
Boolean stat_product = getBoolean("stat_product", false);
|
||||
|
||||
if (export == 0) {
|
||||
renderJson(Result.object(OrderStatService.me.salestatCustomer(tm, invoice_type, stat_product)));
|
||||
renderJson(Result.object(OrderStatService.me.salestatCustomer(tm, invoice_type, stat_product, customer_id, customer_type_id)));
|
||||
} else {
|
||||
Workbook wb = OrderStatService.me.daysalestatCustomerExport(tm, invoice_type, stat_product);
|
||||
Workbook wb = OrderStatService.me.daysalestatCustomerExport(tm, invoice_type, stat_product, customer_id, customer_type_id);
|
||||
render(new ExcelRender(tm + "_销售日统计_" + System.currentTimeMillis() + ".xlsx", wb));
|
||||
}
|
||||
}
|
||||
|
|
@ -163,15 +165,17 @@ public class OrderStatController extends BaseController {
|
|||
*/
|
||||
@Before(MonthValidator.class)
|
||||
public void monthstatCustomer() {
|
||||
String tm = get("tm");
|
||||
Integer invoice_type = getInt("invoice_type");
|
||||
int export = getInt("export", 0);
|
||||
Boolean stat_product = getBoolean("stat_product",false);
|
||||
String tm = get("tm");
|
||||
Integer invoice_type = getInt("invoice_type");
|
||||
Integer customer_id = getInt("customer_id");
|
||||
Integer customer_type_id = getInt("customer_type_id");
|
||||
int export = getInt("export", 0);
|
||||
Boolean stat_product = getBoolean("stat_product", false);
|
||||
|
||||
if (export == 0) {
|
||||
renderJson(Result.object(OrderStatService.me.salestatCustomer(tm, invoice_type, stat_product)));
|
||||
renderJson(Result.object(OrderStatService.me.salestatCustomer(tm, invoice_type, stat_product, customer_id, customer_type_id)));
|
||||
} else {
|
||||
Workbook wb = OrderStatService.me.monthsalestatCustomerExport(tm, invoice_type, stat_product);
|
||||
Workbook wb = OrderStatService.me.monthsalestatCustomerExport(tm, invoice_type, stat_product, customer_id, customer_type_id);
|
||||
render(new ExcelRender(tm + "_销售月统计_" + System.currentTimeMillis() + ".xlsx", wb));
|
||||
}
|
||||
}
|
||||
|
|
@ -184,14 +188,14 @@ public class OrderStatController extends BaseController {
|
|||
String stm = get("stm"); // 前端将 YYYY-MM-DD 后面补 " 00:00:00"
|
||||
String etm = get("etm"); // 前端将 YYYY-MM-DD 后面补 " 23:59:59"
|
||||
Integer supermarket_id = getInt("supermarket_id");
|
||||
Boolean stat_product = getBoolean("stat_product",false);
|
||||
Integer product_id = getInt("product_id");
|
||||
Boolean stat_product = getBoolean("stat_product", false);
|
||||
Integer product_id = getInt("product_id");
|
||||
int export = getInt("export", 0);
|
||||
|
||||
if (export == 0) {
|
||||
renderJson(Result.object(OrderStatService.me.mdstat(stm, etm, supermarket_id, stat_product,product_id)));
|
||||
renderJson(Result.object(OrderStatService.me.mdstat(stm, etm, supermarket_id, stat_product, product_id)));
|
||||
} else {
|
||||
Workbook wb = OrderStatService.me.mdstatExport(stm, etm, supermarket_id, stat_product,product_id);
|
||||
Workbook wb = OrderStatService.me.mdstatExport(stm, etm, supermarket_id, stat_product, product_id);
|
||||
|
||||
render(new ExcelRender(stm.substring(0, 10) + "至" + etm.substring(0, 10) + "_销售月逐日统计_" + System.currentTimeMillis() + ".xlsx", wb));
|
||||
}
|
||||
|
|
@ -261,11 +265,12 @@ public class OrderStatController extends BaseController {
|
|||
*/
|
||||
@Before(DayValidator.class)
|
||||
public void statDayCustomer() {
|
||||
String tm = get("tm");
|
||||
int export = getInt("export", 0); // 是否导出为exce 0 不导出,1 导出
|
||||
Integer supermarket_id = getInt("supermarket_id");
|
||||
Integer customer_id = getInt("customer_id");
|
||||
String customer_ids = get("customer_ids");
|
||||
String tm = get("tm");
|
||||
int export = getInt("export", 0); // 是否导出为exce 0 不导出,1 导出
|
||||
Integer supermarket_id = getInt("supermarket_id");
|
||||
Integer customer_id = getInt("customer_id");
|
||||
Integer customer_type_id = getInt("customer_type_id");
|
||||
String customer_ids = get("customer_ids");
|
||||
|
||||
Sysuser tokenuser = SysuserSyncService.me.getSysuserByToken(get("token"));
|
||||
|
||||
|
|
@ -274,8 +279,9 @@ public class OrderStatController extends BaseController {
|
|||
renderJson(Result.noauth());
|
||||
return;
|
||||
} else if (tokenuser.getType() == UserTypeEnum.CUSTOMER.getTypeid()) {
|
||||
customer_id = tokenuser.getEntityId();
|
||||
customer_ids = null;
|
||||
customer_id = tokenuser.getEntityId();
|
||||
customer_ids = null;
|
||||
customer_type_id = null;
|
||||
}
|
||||
|
||||
Integer product_id = getInt("product_id");
|
||||
|
|
@ -283,9 +289,9 @@ public class OrderStatController extends BaseController {
|
|||
Integer isprepaid = getInt("isprepaid");
|
||||
|
||||
if (export == 0) {
|
||||
renderJson(Result.object(OrderStatService.me.statCustomer(tm, null, null, supermarket_id, customer_id, customer_ids, stat_product, product_id, isprepaid)));
|
||||
renderJson(Result.object(OrderStatService.me.statCustomer(tm, null, null, supermarket_id, customer_id, customer_ids, customer_type_id, stat_product, product_id, isprepaid)));
|
||||
} else {
|
||||
Workbook wb = OrderStatService.me.statCustomerExport("砂站日销售汇总表", tm, null, null, supermarket_id, customer_id, customer_ids, stat_product, product_id, isprepaid);
|
||||
Workbook wb = OrderStatService.me.statCustomerExport("砂站日销售汇总表", tm, null, null, supermarket_id, customer_id, customer_ids, customer_type_id, stat_product, product_id, isprepaid);
|
||||
render(new ExcelRender(tm + "_砂站日" + (isprepaid != null && isprepaid == 1 ? "预付费" : "") + "销售汇总表_" + System.currentTimeMillis() + ".xlsx", wb));
|
||||
}
|
||||
}
|
||||
|
|
@ -295,11 +301,12 @@ public class OrderStatController extends BaseController {
|
|||
*/
|
||||
@Before(MonthValidator.class)
|
||||
public void statMonthCustomer() {
|
||||
String tm = get("tm");
|
||||
int export = getInt("export", 0); // 是否导出为exce 0 不导出,1 导出
|
||||
Integer supermarket_id = getInt("supermarket_id");
|
||||
Integer customer_id = getInt("customer_id");
|
||||
String customer_ids = get("customer_ids");
|
||||
String tm = get("tm");
|
||||
int export = getInt("export", 0); // 是否导出为exce 0 不导出,1 导出
|
||||
Integer supermarket_id = getInt("supermarket_id");
|
||||
Integer customer_id = getInt("customer_id");
|
||||
Integer customer_type_id = getInt("customer_type_id");
|
||||
String customer_ids = get("customer_ids");
|
||||
|
||||
Sysuser tokenuser = SysuserSyncService.me.getSysuserByToken(get("token"));
|
||||
|
||||
|
|
@ -317,21 +324,22 @@ public class OrderStatController extends BaseController {
|
|||
Integer isprepaid = getInt("isprepaid");
|
||||
|
||||
if (export == 0) {
|
||||
renderJson(Result.object(OrderStatService.me.statCustomer(tm, null, null, supermarket_id, customer_id, customer_ids, stat_product, product_id, isprepaid)));
|
||||
renderJson(Result.object(OrderStatService.me.statCustomer(tm, null, null, supermarket_id, customer_id, customer_ids, customer_type_id, stat_product, product_id, isprepaid)));
|
||||
} else {
|
||||
Workbook wb = OrderStatService.me.statCustomerExport("砂站月销售汇总表", tm, null, null, supermarket_id, customer_id, customer_ids, stat_product, product_id, isprepaid);
|
||||
Workbook wb = OrderStatService.me.statCustomerExport("砂站月销售汇总表", tm, null, null, supermarket_id, customer_id, customer_ids, customer_type_id, stat_product, product_id, isprepaid);
|
||||
render(new ExcelRender(tm + "_砂站月" + (isprepaid != null && isprepaid == 1 ? "预付费" : "") + "销售汇总表_" + System.currentTimeMillis() + ".xlsx", wb));
|
||||
}
|
||||
}
|
||||
|
||||
@Before(StartAndEndIntervalValidator.class)
|
||||
public void statRangeCustomer() {
|
||||
String stm = get("stm"); // 前端将 YYYY-MM-DD 后面补 " 00:00:00"
|
||||
String etm = get("etm"); // 前端将 YYYY-MM-DD 后面补 " 23:59:59"
|
||||
int export = getInt("export", 0); // 是否导出为exce 0 不导出,1 导出
|
||||
Integer supermarket_id = getInt("supermarket_id");
|
||||
Integer customer_id = getInt("customer_id");
|
||||
String customer_ids = get("customer_ids");
|
||||
String stm = get("stm"); // 前端将 YYYY-MM-DD 后面补 " 00:00:00"
|
||||
String etm = get("etm"); // 前端将 YYYY-MM-DD 后面补 " 23:59:59"
|
||||
int export = getInt("export", 0); // 是否导出为exce 0 不导出,1 导出
|
||||
Integer supermarket_id = getInt("supermarket_id");
|
||||
Integer customer_id = getInt("customer_id");
|
||||
Integer customer_type_id = getInt("customer_type_id");
|
||||
String customer_ids = get("customer_ids");
|
||||
|
||||
Sysuser tokenuser = SysuserSyncService.me.getSysuserByToken(get("token"));
|
||||
|
||||
|
|
@ -349,64 +357,69 @@ public class OrderStatController extends BaseController {
|
|||
Integer isprepaid = getInt("isprepaid");
|
||||
|
||||
if (export == 0) {
|
||||
renderJson(Result.object(OrderStatService.me.statCustomer(null, stm, etm, supermarket_id, customer_id, customer_ids, stat_product, product_id, isprepaid)));
|
||||
renderJson(Result.object(OrderStatService.me.statCustomer(null, stm, etm, supermarket_id, customer_id, customer_ids, customer_type_id, stat_product, product_id, isprepaid)));
|
||||
} else {
|
||||
Workbook wb = OrderStatService.me.statCustomerExport("砂站时段销售汇总表", null, stm, etm, supermarket_id, customer_id, customer_ids, stat_product, product_id, isprepaid);
|
||||
Workbook wb = OrderStatService.me.statCustomerExport("砂站时段销售汇总表", null, stm, etm, supermarket_id, customer_id, customer_ids, customer_type_id, stat_product, product_id, isprepaid);
|
||||
render(new ExcelRender(stm + "_" + etm + "_砂站" + (isprepaid != null && isprepaid == 1 ? "预付费" : "") + "销售汇总表_" + System.currentTimeMillis() + ".xlsx", wb));
|
||||
}
|
||||
}
|
||||
|
||||
public void statYearCustomer() {
|
||||
String tm = get("tm");
|
||||
int export = getInt("export", 0); // 是否导出为exce 0 不导出,1 导出
|
||||
Boolean stat_product = getBoolean("stat_product",false);
|
||||
String tm = get("tm");
|
||||
Integer customer_id = getInt("customer_id");
|
||||
Integer customer_type_id = getInt("customer_type_id");
|
||||
int export = getInt("export", 0); // 是否导出为exce 0 不导出,1 导出
|
||||
Boolean stat_product = getBoolean("stat_product", false);
|
||||
|
||||
if (export == 0) {
|
||||
renderJson(Result.object(OrderStatService.me.yearStatByCustomer(tm, stat_product)));
|
||||
renderJson(Result.object(OrderStatService.me.yearStatByCustomer(tm, stat_product, customer_id, customer_type_id)));
|
||||
} else {
|
||||
Workbook wb = OrderStatService.me.yearStatByCustomerExport(tm, stat_product);
|
||||
Workbook wb = OrderStatService.me.yearStatByCustomerExport(tm, stat_product, customer_id, customer_type_id);
|
||||
render(new ExcelRender("按客户统计总销售汇总表_" + System.currentTimeMillis() + ".xlsx", wb));
|
||||
}
|
||||
}
|
||||
|
||||
public void statYearBySup() {
|
||||
String tm = get("tm");
|
||||
int export = getInt("export", 0); // 是否导出为exce 0 不导出,1 导出
|
||||
Boolean stat_product = getBoolean("stat_product",false);
|
||||
String tm = get("tm");
|
||||
int export = getInt("export", 0); // 是否导出为exce 0 不导出,1 导出
|
||||
Boolean stat_product = getBoolean("stat_product", false);
|
||||
if (export == 0) {
|
||||
renderJson(Result.object(OrderStatService.me.yearStatBySup(tm, stat_product)));
|
||||
renderJson(Result.object(OrderStatService.me.salestat(tm)));
|
||||
} else {
|
||||
Workbook wb = OrderStatService.me.yearStatBySupExport(tm, stat_product);
|
||||
Workbook wb = OrderStatService.me.yearsalestatExport(tm);
|
||||
render(new ExcelRender("按砂站总销售汇总表_" + System.currentTimeMillis() + ".xlsx", wb));
|
||||
}
|
||||
}
|
||||
|
||||
@Before(StartAndEndIntervalValidator.class)
|
||||
public void statRangeAllCustomer() {
|
||||
String stm = get("stm");
|
||||
String etm = get("etm");
|
||||
Boolean stat_product = getBoolean("stat_product",false);
|
||||
Integer product_id = getInt("product_id");
|
||||
int export = getInt("export", 0); // 是否导出为exce 0 不导出,1 导出
|
||||
String stm = get("stm");
|
||||
String etm = get("etm");
|
||||
Boolean stat_product = getBoolean("stat_product", false);
|
||||
Integer product_id = getInt("product_id");
|
||||
Integer customer_id = getInt("customer_id");
|
||||
Integer customer_type_id = getInt("customer_type_id");
|
||||
int export = getInt("export", 0); // 是否导出为exce 0 不导出,1 导出
|
||||
|
||||
if (export == 0) {
|
||||
renderJson(Result.object(OrderStatService.me.yearStatByCustomer(stm, etm, stat_product, product_id)));
|
||||
renderJson(Result.object(OrderStatService.me.yearStatByCustomer(stm, etm, stat_product, product_id, customer_id, customer_type_id)));
|
||||
} else {
|
||||
Workbook wb = OrderStatService.me.yearStatByCustomerExport(stm, etm, stat_product,product_id);
|
||||
Workbook wb = OrderStatService.me.yearStatByCustomerExport(stm, etm, stat_product, product_id, customer_id, customer_type_id);
|
||||
render(new ExcelRender("按客户统计总销售汇总表_" + System.currentTimeMillis() + ".xlsx", wb));
|
||||
}
|
||||
}
|
||||
|
||||
@Before(StartAndEndIntervalValidator.class)
|
||||
public void statRangeAllSup() {
|
||||
String stm = get("stm");
|
||||
String etm = get("etm");
|
||||
Boolean stat_product = getBoolean("stat_product",false);
|
||||
Integer product_id = getInt("product_id");
|
||||
int export = getInt("export", 0); // 是否导出为exce 0 不导出,1 导出
|
||||
String stm = get("stm");
|
||||
String etm = get("etm");
|
||||
Boolean stat_product = getBoolean("stat_product", false);
|
||||
Integer product_id = getInt("product_id");
|
||||
int export = getInt("export", 0); // 是否导出为exce 0 不导出,1 导出
|
||||
if (export == 0) {
|
||||
renderJson(Result.object(OrderStatService.me.yearStatBySup(stm, etm, stat_product,product_id)));
|
||||
renderJson(Result.object(OrderStatService.me.yearStatBySup(stm, etm, stat_product, product_id)));
|
||||
} else {
|
||||
Workbook wb = OrderStatService.me.yearStatBySupExport(stm, etm, stat_product,product_id);
|
||||
Workbook wb = OrderStatService.me.yearStatBySupExport(stm, etm, stat_product, product_id);
|
||||
render(new ExcelRender("按砂站总销售汇总表_" + System.currentTimeMillis() + ".xlsx", wb));
|
||||
}
|
||||
}
|
||||
|
|
@ -432,10 +445,10 @@ public class OrderStatController extends BaseController {
|
|||
* 固定、零散配额指定年的销售统计汇总数据
|
||||
*/
|
||||
public void yearStatisticsByCustomerId() {
|
||||
String year = get("year");
|
||||
Integer customer_id = getInt("customer_id");
|
||||
String customer_name = get("customer_name");
|
||||
Integer type = getInt("type");
|
||||
String year = get("year");
|
||||
Integer customer_id = getInt("customer_id");
|
||||
String customer_name = get("customer_name");
|
||||
Integer type = getInt("type");
|
||||
renderJson(Result.object(OrderStatService.me.yearStatisticsByCustomerId(year, customer_id, customer_name, type)));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue