原材料运输各查询,统计接口修改

dev
wany 2025-07-18 10:14:44 +08:00
parent dbda413e86
commit b61d9bda2d
4 changed files with 5 additions and 27 deletions

View File

@ -30,7 +30,7 @@ public class OrderclusterTruckService extends BaseService {
", c.uuid, c.total_weight, c.avg_weight, c.create_time, c.start_time, c.cutoff_time, c.complete_time" + ", c.uuid, c.total_weight, c.avg_weight, c.create_time, c.start_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.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.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" + ", case when c.sale_type = 2 and c.customer_id = 5 then '巴河' else c.customer_name end as 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_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_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.customer_receiver_lttd, c.trans_co_id, c.trans_co_name, c.trans_co_texpayer_name" +

View File

@ -120,7 +120,7 @@ public class OrderTempService extends BaseService {
", p.in_time, p.out_time, p.in_which, p.out_which, p.in_mode, p.out_mode \n" + ", p.in_time, p.out_time, p.in_which, p.out_which, p.in_mode, p.out_mode \n" +
", p.first_weight, p.second_weight, p.first_weigh_mode, p.second_weight_mode \n" + ", p.first_weight, p.second_weight, p.first_weigh_mode, p.second_weight_mode \n" +
", p.first_pic, p.first_weight_which, p.second_weight_which, p.second_pic \n" + ", p.first_pic, p.first_weight_which, p.second_weight_which, p.second_pic \n" +
", p.arrive_time, p.type, p.memo transport_memo, s.name supermarket_name \n" + ", p.arrive_time, p.type, p.memo transport_memo, case when t.supermarket_id = 5 then '巴河' else s.name end as supermarket_name \n" +
", s1.name customer_name \n" + ", s1.name customer_name \n" +
", t.trans_price in_trans_price, t.weight in_weight,ot.ticket_code as old_ticket_code \n"; ", t.trans_price in_trans_price, t.weight in_weight,ot.ticket_code as old_ticket_code \n";
fromsql = "from order_transfer t \n" + fromsql = "from order_transfer t \n" +

View File

@ -641,36 +641,14 @@ public class OrderStatService {
List<Record> sale_list = Db.find("SELECT\n" + List<Record> sale_list = Db.find("SELECT\n" +
" s.id AS sandfarm_id,\n" + " s.id AS sandfarm_id,\n" +
" s.NAME AS sandfarm_name,\n" + " s.NAME AS sandfarm_name,\n" +
// " IFNULL( SUM( CASE WHEN t.supermarket_id = 1 THEN t.count END ), 0 ) AS xsl_1,\n" +
// " 0 AS xsl_1,\n"
dynamicSql + dynamicSql +
// " IFNULL( SUM( CASE WHEN t.supermarket_id = 1 THEN t.source_weight END ), 0 ) AS xse_1,\n" +
// " IFNULL( SUM( CASE WHEN t.supermarket_id = 1 THEN t.weight END ), 0 ) AS xss_1,\n" +
" IFNULL( SUM( t.weight ), 0 ) AS weight \n" + " IFNULL( SUM( t.weight ), 0 ) AS weight \n" +
"FROM\n" + "FROM\n" +
" supermarket s\n" + " supermarket s\n" +
" LEFT JOIN (\n" + " LEFT JOIN (\n" +
// " SELECT\n" +
// " t.supermarket_id sandfarm_id,\n" +
// " t.customer_id supermarket_id,\n" +
// " COUNT( t.sn ) AS count,\n" +
// " SUM( t.weight ) AS source_weight,\n" +
// " 0 weight \n" +
// " FROM\n" +
// " supermarket s\n" +
// " LEFT JOIN order_temp t ON t.supermarket_id = s.id \n" +
// " WHERE\n" +
// " s.del = 0 \n" +
// " AND t.state = 5 \n" +
// " AND s.type = 1 \n" +
// " AND t.create_time >= ? \n" +
// " AND t.create_time <= ? \n" +
// " GROUP BY\n" +
// " t.supermarket_id,\n" +
// " t.customer_id UNION\n" +
" SELECT\n" + " SELECT\n" +
" t.sandfarm_id,\n" + " t.sandfarm_id,\n" +
" t.supermarket_id,\n" + " case when t.supermarket_id in (4,5) then 4 else t.supermarket_id end as supermarket_id,\n" +
" COUNT( t.sn ) AS count,\n" + " COUNT( t.sn ) AS count,\n" +
" SUM( t.source_weight) AS source_weight,\n" + " SUM( t.source_weight) AS source_weight,\n" +
" SUM( t.weight ) AS weight \n" + " SUM( t.weight ) AS weight \n" +
@ -682,7 +660,7 @@ public class OrderStatService {
" AND t.create_time <= ? \n" + " AND t.create_time <= ? \n" +
" GROUP BY\n" + " GROUP BY\n" +
" t.sandfarm_id,\n" + " t.sandfarm_id,\n" +
" t.supermarket_id \n" + " case when t.supermarket_id in (4,5) then 4 else t.supermarket_id end \n" +
" ) t ON s.id = t.sandfarm_id \n" + " ) t ON s.id = t.sandfarm_id \n" +
"WHERE\n" + "WHERE\n" +
" s.type = 1 \n" + " s.type = 1 \n" +

View File

@ -191,7 +191,7 @@ public class DeviceThread extends Thread {
AbsScale scale = null; AbsScale scale = null;
// 根据砂站id兼容不同的表头 // 根据砂站id兼容不同的表头
if (supermarket_id == 1) { // 城隍用了耀华的表头 if (supermarket_id == 1 || supermarket_id == 5) { // 兰溪和巴河新塝用了耀华的表头
scale = new YaoHuaScale(which + "_scale", scaleconf.getString("ip"), scaleconf.getIntValue("port")); scale = new YaoHuaScale(which + "_scale", scaleconf.getString("ip"), scaleconf.getIntValue("port"));
} }