lisai17@sina.com 2020-10-14 15:26:30 +08:00
parent 13c4ae5985
commit ca11e8e630
3 changed files with 25 additions and 9 deletions

View File

@ -151,13 +151,19 @@ group by date
String premonthtm = DateTimeUtil.sd.get().format(c.getTime()); // 前一月
String sql_ordercluster = "select \n" +
" sum(t.total_weight) total_weight, \n" +
" sum(case when t.cutoff_time like '" + nowmonttm + "%' then t.total_weight end ) month_total_weight, \n" +
" sum(case when t.cutoff_time like '" + nowdaytm + "%' then t.total_weight end ) day_total_weight, \n" +
" sum(case when t.cutoff_time like '" + premonthtm + "%' then t.total_weight end ) before_month_total_weight, \n" +
" sum(case when t.cutoff_time like '" + predaytm + "%' then t.total_weight end ) before_day_total_weight \n" +
" from ordercluster t\n" +
" where t.state < ?";
" ifnull(sum(t.weight), 0) total_weight, \n" +
" ifnull(sum(case when t.create_time like '" + nowmonttm + "%' then t.weight end ), 0) month_total_weight, \n" +
" ifnull(sum(case when t.create_time like '" + nowdaytm + "%' then t.weight end ), 0) day_total_weight, \n" +
" ifnull(sum(case when t.create_time like '" + premonthtm + "%' then t.weight end ), 0) before_month_total_weight, \n" +
" ifnull(sum(case when t.create_time like '" + predaytm + "%' then t.weight end) , 0) before_day_total_weight,\n" +
" \n" +
" ifnull(sum(t.total_price), 0) total_price, \n" +
" ifnull(sum(case when t.create_time like '" + nowmonttm + "%' then t.total_price end ), 0) month_total_price, \n" +
" ifnull(sum(case when t.create_time like '" + nowdaytm + "%' then t.total_price end ), 0) day_total_price, \n" +
" ifnull(sum(case when t.create_time like '" + premonthtm + "%' then t.total_price end ), 0) before_month_total_price, \n" +
" ifnull(sum(case when t.create_time like '" + predaytm + "%' then t.total_price end) , 0) before_day_total_price \n" +
" from order_temp t\n" +
" where t.state = 5";
String sql_ordercluster_truck = "select\n" +
" count(t.id) truck_cnt,\n" +

View File

@ -90,7 +90,7 @@ public class Config extends JFinalConfig {
public static DeviceThread deviceThread = new DeviceThread();
public static SocketIOService socketio = null;
private static boolean client_run = true;
public static final String CLINET_VERSION = "20201013";
public static final String CLINET_VERSION = "20201014";
public static String getRootPath() {
return PathKit.getWebRootPath()

View File

@ -34,6 +34,11 @@ import java.util.*;
/**
* MySQL
*
*
* select * from modify_log t
* where t.`table` = 'transport'
* and t.editdata -> '$.modify_content' = 'manualWeight'
*/
public class TransportSyncService {
public static TransportSyncService me = new TransportSyncService();
@ -701,12 +706,17 @@ public class TransportSyncService {
transport.setOutWhich(out_which);
SyncTask synctask = new SyncTask();
Record logrecord = new Record();
logrecord.set("id", transport.getId());
logrecord.set("modify_content", "manualWeight"); // 创建入场记录,用 Enums.DataOpType.UPDATE 记录
logrecord.set("first_weight", transport.getFirstWeight());
logrecord.set("second_weight", transport.getSecondWeight());
boolean ret = Db.tx(new IAtom() {
@Override
public boolean run() {
try {
boolean ret = transport.save();
boolean ret = transport.save() && editLog(logrecord.toJson(), sysuser);
if (!ret) {
return false;