lisai17@sina.com 2021-02-01 12:40:18 +08:00
parent 2ae1c7c228
commit 1fcde5cf7e
6 changed files with 51 additions and 10 deletions

View File

@ -1,5 +1,7 @@
package com.cowr.local.ssjygl.devicectrl.device;
import com.jfinal.log.Log;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
@ -13,6 +15,8 @@ import java.util.stream.Collectors;
*
*/
public class DingsongScale extends AbsScale {
private static Log log = Log.getLog(DingsongScale.class);
private static final int DATA_LENGTH = 24;
private static final int DATA_FROM = 4;
private static final int DATA_TO = 10;
@ -89,7 +93,7 @@ public class DingsongScale extends AbsScale {
continue;
}
} catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage(), e);
}
// System.out.println("读一次耗时:" + (System.currentTimeMillis() - st) + ", " + Double.parseDouble(flip(weight)));

View File

@ -1,5 +1,7 @@
package com.cowr.local.ssjygl.devicectrl.device;
import com.jfinal.log.Log;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
@ -13,6 +15,8 @@ import java.util.stream.Collectors;
*
*/
public class KeLiScale extends AbsScale {
private static Log log = Log.getLog(KeLiScale.class);
private static final int DATA_LENGTH = 12;
private static final int DATA_FROM = 2;
private static final int DATA_TO = 8;
@ -83,6 +87,15 @@ public class KeLiScale extends AbsScale {
continue;
}
try {
if (Long.parseLong(weight) > 100000) {
errCount++;
continue;
}
} catch (Exception e) {
log.error(e.getMessage(), e);
}
// System.out.println("读一次耗时:" + (System.currentTimeMillis() - st) + ", " + Double.parseDouble(flip(weight)));
list.add(weight);
}

View File

@ -80,6 +80,15 @@ public class XiShuiScale extends AbsScale {
continue;
}
try {
if (Long.parseLong(weight) > 100000) {
errCount++;
continue;
}
} catch (Exception e) {
log.error(e.getMessage(), e);
}
// System.out.println("读一次耗时:" + (System.currentTimeMillis() - st) + ", " + Double.parseDouble(flip(weight)));
list.add(weight);
}

View File

@ -1,5 +1,7 @@
package com.cowr.local.ssjygl.devicectrl.device;
import com.jfinal.log.Log;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
@ -13,6 +15,8 @@ import java.util.stream.Collectors;
* 耀
*/
public class YaoHuaScale extends AbsScale {
private static Log log = Log.getLog(YaoHuaScale.class);
public YaoHuaScale(String id, String ip, int port) {
super(id, ip, port);
}
@ -78,6 +82,14 @@ public class YaoHuaScale extends AbsScale {
errCount++;
continue;
}
try {
if (Long.parseLong(weight) > 100000) {
errCount++;
continue;
}
} catch (Exception e) {
log.error(e.getMessage(), e);
}
// System.out.println("读一次耗时:" + (System.currentTimeMillis() - st) + ", " + Double.parseDouble(flip(weight)));
list.add(weight);

View File

@ -95,7 +95,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 = "20210111";
public static final String CLINET_VERSION = "20210128";
public static String getRootPath() {
return PathKit.getWebRootPath()

View File

@ -9,7 +9,6 @@ import com.cowr.common.view.PageParam;
import com.cowr.common.view.Result;
import com.cowr.model.*;
import com.cowr.service.ssjygl.base.BaseSyncService;
import com.cowr.service.ssjygl.customer.register.CustomerRegisterService;
import com.cowr.service.ssjygl.main.Config;
import com.cowr.service.ssjygl.main.SvrCacheData;
import com.cowr.service.ssjygl.synctask.SyncTaskService;
@ -417,7 +416,8 @@ public class SysuserSyncService extends BaseSyncService {
synctask.addSaveData(customer);
return model.save() && SyncTaskService.me.save(synctask)
&& ModifyLogService.me.save(model, null, Enums.DataOpType.SAVE.getId(), tokenuser);
&& ModifyLogService.me.save(model, null, Enums.DataOpType.SAVE.getId(), tokenuser)
&& ModifyLogService.me.save(customer, null, Enums.DataOpType.SAVE.getId(), tokenuser);
} catch (Exception e) {
log.error(e.getMessage(), e);
return false;
@ -487,6 +487,8 @@ public class SysuserSyncService extends BaseSyncService {
chkobj.setPassword(getPwdMD5(model.getPhone(), Const.DEFAULT_PASSWORD));
}
Customer customerold = customer.clone();
customer.setName(texpayer_name);
customer.setTexpayerName(texpayer_name);
customer.setInvoiceType(invoice_type);
@ -538,7 +540,8 @@ public class SysuserSyncService extends BaseSyncService {
}
return SyncTaskService.me.save(synctask)
&& ModifyLogService.me.save(chkobj, old, Enums.DataOpType.UPDATE.getId(), tokenuser);
&& ModifyLogService.me.save(chkobj, old, Enums.DataOpType.UPDATE.getId(), tokenuser)
&& ModifyLogService.me.save(customer, customerold, Enums.DataOpType.UPDATE.getId(), tokenuser);
}
});