dev
parent
2ae1c7c228
commit
1fcde5cf7e
|
|
@ -1,5 +1,7 @@
|
||||||
package com.cowr.local.ssjygl.devicectrl.device;
|
package com.cowr.local.ssjygl.devicectrl.device;
|
||||||
|
|
||||||
|
import com.jfinal.log.Log;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
@ -13,6 +15,8 @@ import java.util.stream.Collectors;
|
||||||
* 柯力称重显示器
|
* 柯力称重显示器
|
||||||
*/
|
*/
|
||||||
public class DingsongScale extends AbsScale {
|
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_LENGTH = 24;
|
||||||
private static final int DATA_FROM = 4;
|
private static final int DATA_FROM = 4;
|
||||||
private static final int DATA_TO = 10;
|
private static final int DATA_TO = 10;
|
||||||
|
|
@ -89,7 +93,7 @@ public class DingsongScale extends AbsScale {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
log.error(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// System.out.println("读一次耗时:" + (System.currentTimeMillis() - st) + ", " + Double.parseDouble(flip(weight)));
|
// System.out.println("读一次耗时:" + (System.currentTimeMillis() - st) + ", " + Double.parseDouble(flip(weight)));
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
package com.cowr.local.ssjygl.devicectrl.device;
|
package com.cowr.local.ssjygl.devicectrl.device;
|
||||||
|
|
||||||
|
import com.jfinal.log.Log;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
@ -13,9 +15,11 @@ import java.util.stream.Collectors;
|
||||||
* 柯力称重显示器
|
* 柯力称重显示器
|
||||||
*/
|
*/
|
||||||
public class KeLiScale extends AbsScale {
|
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_LENGTH = 12;
|
||||||
private static final int DATA_FROM = 2;
|
private static final int DATA_FROM = 2;
|
||||||
private static final int DATA_TO = 8;
|
private static final int DATA_TO = 8;
|
||||||
|
|
||||||
public KeLiScale(String id, String ip, int port) {
|
public KeLiScale(String id, String ip, int port) {
|
||||||
super(id, ip, port);
|
super(id, ip, port);
|
||||||
|
|
@ -83,6 +87,15 @@ public class KeLiScale extends AbsScale {
|
||||||
continue;
|
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)));
|
// System.out.println("读一次耗时:" + (System.currentTimeMillis() - st) + ", " + Double.parseDouble(flip(weight)));
|
||||||
list.add(weight);
|
list.add(weight);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,15 @@ public class XiShuiScale extends AbsScale {
|
||||||
continue;
|
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)));
|
// System.out.println("读一次耗时:" + (System.currentTimeMillis() - st) + ", " + Double.parseDouble(flip(weight)));
|
||||||
list.add(weight);
|
list.add(weight);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
package com.cowr.local.ssjygl.devicectrl.device;
|
package com.cowr.local.ssjygl.devicectrl.device;
|
||||||
|
|
||||||
|
import com.jfinal.log.Log;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
@ -13,6 +15,8 @@ import java.util.stream.Collectors;
|
||||||
* 耀华称重显示器
|
* 耀华称重显示器
|
||||||
*/
|
*/
|
||||||
public class YaoHuaScale extends AbsScale {
|
public class YaoHuaScale extends AbsScale {
|
||||||
|
private static Log log = Log.getLog(YaoHuaScale.class);
|
||||||
|
|
||||||
public YaoHuaScale(String id, String ip, int port) {
|
public YaoHuaScale(String id, String ip, int port) {
|
||||||
super(id, ip, port);
|
super(id, ip, port);
|
||||||
}
|
}
|
||||||
|
|
@ -78,6 +82,14 @@ public class YaoHuaScale extends AbsScale {
|
||||||
errCount++;
|
errCount++;
|
||||||
continue;
|
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)));
|
// System.out.println("读一次耗时:" + (System.currentTimeMillis() - st) + ", " + Double.parseDouble(flip(weight)));
|
||||||
list.add(weight);
|
list.add(weight);
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ public class Config extends JFinalConfig {
|
||||||
public static DeviceThread deviceThread = new DeviceThread();
|
public static DeviceThread deviceThread = new DeviceThread();
|
||||||
public static SocketIOService socketio = null;
|
public static SocketIOService socketio = null;
|
||||||
private static boolean client_run = true;
|
private static boolean client_run = true;
|
||||||
public static final String CLINET_VERSION = "20210111";
|
public static final String CLINET_VERSION = "20210128";
|
||||||
|
|
||||||
public static String getRootPath() {
|
public static String getRootPath() {
|
||||||
return PathKit.getWebRootPath()
|
return PathKit.getWebRootPath()
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ import com.cowr.common.view.PageParam;
|
||||||
import com.cowr.common.view.Result;
|
import com.cowr.common.view.Result;
|
||||||
import com.cowr.model.*;
|
import com.cowr.model.*;
|
||||||
import com.cowr.service.ssjygl.base.BaseSyncService;
|
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.Config;
|
||||||
import com.cowr.service.ssjygl.main.SvrCacheData;
|
import com.cowr.service.ssjygl.main.SvrCacheData;
|
||||||
import com.cowr.service.ssjygl.synctask.SyncTaskService;
|
import com.cowr.service.ssjygl.synctask.SyncTaskService;
|
||||||
|
|
@ -417,7 +416,8 @@ public class SysuserSyncService extends BaseSyncService {
|
||||||
synctask.addSaveData(customer);
|
synctask.addSaveData(customer);
|
||||||
|
|
||||||
return model.save() && SyncTaskService.me.save(synctask)
|
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) {
|
} catch (Exception e) {
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -487,6 +487,8 @@ public class SysuserSyncService extends BaseSyncService {
|
||||||
chkobj.setPassword(getPwdMD5(model.getPhone(), Const.DEFAULT_PASSWORD));
|
chkobj.setPassword(getPwdMD5(model.getPhone(), Const.DEFAULT_PASSWORD));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Customer customerold = customer.clone();
|
||||||
|
|
||||||
customer.setName(texpayer_name);
|
customer.setName(texpayer_name);
|
||||||
customer.setTexpayerName(texpayer_name);
|
customer.setTexpayerName(texpayer_name);
|
||||||
customer.setInvoiceType(invoice_type);
|
customer.setInvoiceType(invoice_type);
|
||||||
|
|
@ -538,7 +540,8 @@ public class SysuserSyncService extends BaseSyncService {
|
||||||
}
|
}
|
||||||
|
|
||||||
return SyncTaskService.me.save(synctask)
|
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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -797,8 +800,8 @@ public class SysuserSyncService extends BaseSyncService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Page<Record> find(PageParam pp, String name, String phone, Integer del, Integer type, Integer entity_id, String customer_name) {
|
public Page<Record> find(PageParam pp, String name, String phone, Integer del, Integer type, Integer entity_id, String customer_name) {
|
||||||
List<Object> paraList = new ArrayList<>();
|
List<Object> paraList = new ArrayList<>();
|
||||||
StringBuilder sqlbuf = new StringBuilder();
|
StringBuilder sqlbuf = new StringBuilder();
|
||||||
|
|
||||||
sqlbuf.append(" from (\n");
|
sqlbuf.append(" from (\n");
|
||||||
sqlbuf.append("select \n");
|
sqlbuf.append("select \n");
|
||||||
|
|
@ -828,7 +831,7 @@ public class SysuserSyncService extends BaseSyncService {
|
||||||
sqlbuf.append(") a\n");
|
sqlbuf.append(") a\n");
|
||||||
sqlbuf.append("where 1 = 1");
|
sqlbuf.append("where 1 = 1");
|
||||||
|
|
||||||
if(StrKit.notBlank(customer_name)){
|
if (StrKit.notBlank(customer_name)) {
|
||||||
sqlbuf.append(" and a.customer_name like ? \n");
|
sqlbuf.append(" and a.customer_name like ? \n");
|
||||||
paraList.add("%" + customer_name.trim() + "%");
|
paraList.add("%" + customer_name.trim() + "%");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue