dev
parent
03b7478252
commit
36cb174ae3
|
|
@ -27,9 +27,20 @@ public class OrderclusterTruckService extends BaseService {
|
||||||
public static final OrderclusterTruckService me = new OrderclusterTruckService();
|
public static final OrderclusterTruckService me = new OrderclusterTruckService();
|
||||||
|
|
||||||
public Page<Record> find(PageParam pp, String stm, String etm, String customer_name, String truck_license) {
|
public Page<Record> find(PageParam pp, String stm, String etm, String customer_name, String truck_license) {
|
||||||
String selectsql = "select * ";
|
String selectsql = "select t.id, t.truck_license" +
|
||||||
|
", c.uuid, c.total_weight, c.avg_weight, c.create_time, c.cutoff_time, c.complete_time" +
|
||||||
|
", c.unit_price, c.state, c.supermarket_id, c.trans_distance, c.pay_type, c.create_user_id" +
|
||||||
|
", c.create_user_name, c.req_receipt, c.change_time, c.product_id, c.product_name, c.customer_id" +
|
||||||
|
", c.customer_name, c.customer_texpayer_name, c.customer_texpayer_num, c.customer_address" +
|
||||||
|
", c.customer_phone, c.customer_bank_name, c.customer_bank_account, c.customer_receiver_name" +
|
||||||
|
", c.customer_receiver_phone, c.customer_receiver_address, c.customer_receiver_lgtd" +
|
||||||
|
", c.customer_receiver_lttd, c.trans_co_id, c.trans_co_name, c.trans_co_texpayer_name" +
|
||||||
|
", c.trans_co_texpayer_num, c.trans_co_address, c.trans_co_phone, c.trans_co_bank_name" +
|
||||||
|
", c.trans_co_bank_account, c.time_interval, c.mini_truck" +
|
||||||
|
", s.name supermarket_name ";
|
||||||
String fromsql = "from ordercluster_truck t \n" +
|
String fromsql = "from ordercluster_truck t \n" +
|
||||||
" left join ordercluster c on c.id = t.ordercluster_id \n" +
|
" left join ordercluster c on c.id = t.ordercluster_id \n" +
|
||||||
|
" left join supermarket s on s.id = c.supermarket_id \n" +
|
||||||
" where 1=1 ";
|
" where 1=1 ";
|
||||||
List<Object> paraList = new ArrayList<>();
|
List<Object> paraList = new ArrayList<>();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,15 +18,16 @@ public class InvoiceUseService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 票据使用情况统计
|
* 票据使用情况统计
|
||||||
* @param tm 日期 yyyy-DD-dd
|
*
|
||||||
|
* @param tm 日期 yyyy-DD-dd
|
||||||
* @param supermarket_id 砂站id
|
* @param supermarket_id 砂站id
|
||||||
* @param invoice_type 发票类型 1 普票、2 专票
|
* @param invoice_type 发票类型 1 普票、2 专票
|
||||||
* @param invoice_number 发票代码
|
* @param invoice_number 发票代码
|
||||||
* @param invoice_code 发票号码
|
* @param invoice_code 发票号码
|
||||||
* @param invoice_state 发票状态 5 已使用 9 已取消
|
* @param invoice_state 发票状态 5 已使用 9 已取消
|
||||||
* @param order_sn 订单号
|
* @param order_sn 订单号
|
||||||
* @param truck_license 车牌号
|
* @param truck_license 车牌号
|
||||||
* @param order_state 订单状态 5 已出货 9 已取消
|
* @param order_state 订单状态 5 已出货 9 已取消
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Record statuse(
|
public Record statuse(
|
||||||
|
|
@ -72,8 +73,8 @@ public class InvoiceUseService {
|
||||||
paramord.add(tm + "%");
|
paramord.add(tm + "%");
|
||||||
|
|
||||||
if (supermarket_id != null) {
|
if (supermarket_id != null) {
|
||||||
logsql += " and r.supermarket_id <= ? \n"; // 这里用领用记录的 supermarket_id
|
logsql += " and r.supermarket_id = ? \n"; // 这里用领用记录的 supermarket_id
|
||||||
ordsql += " and t.supermarket_id <= ? \n";
|
ordsql += " and t.supermarket_id = ? \n";
|
||||||
|
|
||||||
paramlog.add(supermarket_id);
|
paramlog.add(supermarket_id);
|
||||||
paramord.add(supermarket_id);
|
paramord.add(supermarket_id);
|
||||||
|
|
@ -88,7 +89,7 @@ public class InvoiceUseService {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StrKit.notBlank(invoice_code)) {
|
if (StrKit.notBlank(invoice_code)) {
|
||||||
logsql += " and t.invoice_code like ? \n";
|
logsql += " and t.code like ? \n";
|
||||||
ordsql += " and t.invoice_code like ? \n";
|
ordsql += " and t.invoice_code like ? \n";
|
||||||
|
|
||||||
paramlog.add("%" + invoice_code.trim() + "%");
|
paramlog.add("%" + invoice_code.trim() + "%");
|
||||||
|
|
@ -117,8 +118,8 @@ public class InvoiceUseService {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (order_state != null) {
|
if (order_state != null) {
|
||||||
logsql += " and o.state <= ? \n";
|
logsql += " and o.state = ? \n";
|
||||||
ordsql += " and t.state <= ? \n";
|
ordsql += " and t.state = ? \n";
|
||||||
|
|
||||||
paramlog.add(order_state);
|
paramlog.add(order_state);
|
||||||
paramord.add(order_state);
|
paramord.add(order_state);
|
||||||
|
|
@ -131,6 +132,14 @@ public class InvoiceUseService {
|
||||||
} else {
|
} else {
|
||||||
paramlog.addAll(paramord);
|
paramlog.addAll(paramord);
|
||||||
|
|
||||||
|
if (invoice_type != null && invoice_type == 2) {
|
||||||
|
logsql += " and t.invoice_type = ? \n";
|
||||||
|
ordsql += " and t.invoice_type = ? \n";
|
||||||
|
|
||||||
|
paramlog.add(invoice_type);
|
||||||
|
paramord.add(invoice_type);
|
||||||
|
}
|
||||||
|
|
||||||
list = Db.find("select * from (" + logsql + "\n union \n " + ordsql + ") a order by a.create_time ", paramlog.toArray());
|
list = Db.find("select * from (" + logsql + "\n union \n " + ordsql + ") a order by a.create_time ", paramlog.toArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue