lisai17@sina.com 2020-10-13 14:16:22 +08:00
parent d484d87328
commit 22e8946496
39 changed files with 164 additions and 116 deletions

View File

@ -28,7 +28,7 @@ public class AuthLicenseService extends BaseService {
if(StrKit.notBlank(truck_license)){
fromsql += " and truck_license like ? \n";
paraList.add("%" + truck_license + "%");
paraList.add("%" + truck_license.trim() + "%");
}
if(StrKit.notBlank(stm)){

View File

@ -31,7 +31,7 @@ public class BlacklistService extends BaseService {
if(StrKit.notBlank(truck_license)){
fromsql += " and t.truck_license like ? \n";
paraList.add("%" + truck_license + "%");
paraList.add("%" + truck_license.trim() + "%");
}
String totalRowSql = "select count(*) " + fromsql;

View File

@ -90,7 +90,7 @@ public class CustomerService extends BaseService {
if (StrKit.notBlank(name)) {
fromsql += " and t.name like ? \n";
paraList.add("%" + name + "%");
paraList.add("%" + name.trim() + "%");
}
if (type != null) {

View File

@ -33,12 +33,12 @@ public class CustomerContactService extends BaseService {
if (StrKit.notBlank(name)) {
fromsql += " and t.name like ? \n";
paraList.add("%" + name + "%");
paraList.add("%" + name.trim() + "%");
}
if (StrKit.notBlank(phone)) {
fromsql += " and t.phone like ? \n";
paraList.add("%" + phone + "%");
paraList.add("%" + phone.trim() + "%");
}
if (del != null && (del == Const.LOGIC_DEL_VALID || del == Const.LOGIC_DEL_INVALID)) {

View File

@ -34,7 +34,7 @@ public class CustomerPactService extends BaseService {
if(StrKit.notBlank(customer_name)){
fromsql += " and c.name like ? \n";
paraList.add("%" + customer_name + "%");
paraList.add("%" + customer_name.trim() + "%");
}
String totalRowSql = "select count(*) " + fromsql;

View File

@ -44,12 +44,12 @@ public class CustomerReceiverService extends BaseService {
if (StrKit.notBlank(name)) {
fromsql += " and t.name like ? \n";
paraList.add("%" + name + "%");
paraList.add("%" + name.trim() + "%");
}
if (StrKit.notBlank(phone)) {
fromsql += " and t.phone like ? \n";
paraList.add("%" + phone + "%");
paraList.add("%" + phone.trim() + "%");
}
String totalRowSql = "select count(*) " + fromsql;
@ -94,12 +94,12 @@ public class CustomerReceiverService extends BaseService {
if (StrKit.notBlank(name)) {
fromsql += " and t.name like ? \n";
paraList.add("%" + name + "%");
paraList.add("%" + name.trim() + "%");
}
if (StrKit.notBlank(phone)) {
fromsql += " and t.phone like ? \n";
paraList.add("%" + phone + "%");
paraList.add("%" + phone.trim() + "%");
}
return Db.find(selectsql + fromsql, paraList.toArray());

View File

@ -32,7 +32,7 @@ public class DriverService extends BaseService {
if(StrKit.notBlank(phone)){
fromsql += " and t.phone like ? \n";
paraList.add("%" + phone + "%");
paraList.add("%" + phone.trim() + "%");
}
if(trans_co_id != null){

View File

@ -52,12 +52,12 @@ public class InvoiceLogService extends BaseService {
if (StrKit.notBlank(order_sn)) {
fromsql += " and t.order_sn like ? \n";
paraList.add("%" + order_sn + "%");
paraList.add("%" + order_sn.trim() + "%");
}
if (StrKit.notBlank(invoice_number)) {
fromsql += " and t.invoice_number like ? \n";
paraList.add("%" + invoice_number + "%");
paraList.add("%" + invoice_number.trim() + "%");
}
if (StrKit.notBlank(stm)) {
@ -72,7 +72,7 @@ public class InvoiceLogService extends BaseService {
if (StrKit.notBlank(code)) {
fromsql += " and t.code like ? \n";
paraList.add("%" + code + "%");
paraList.add("%" + code.trim() + "%");
}
if (invoice_type != null) {
@ -131,12 +131,12 @@ public class InvoiceLogService extends BaseService {
if (StrKit.notBlank(order_sn)) {
fromsql += " and t.order_sn like ? \n";
paraList.add("%" + order_sn + "%");
paraList.add("%" + order_sn.trim() + "%");
}
if (StrKit.notBlank(invoice_number)) {
fromsql += " and t.invoice_number like ? \n";
paraList.add("%" + invoice_number + "%");
paraList.add("%" + invoice_number.trim() + "%");
}
if (StrKit.notBlank(stm)) {
@ -151,7 +151,7 @@ public class InvoiceLogService extends BaseService {
if (StrKit.notBlank(code)) {
fromsql += " and t.code like ? \n";
paraList.add("%" + code + "%");
paraList.add("%" + code.trim() + "%");
}
if (invoice_type != null) {
@ -176,16 +176,18 @@ public class InvoiceLogService extends BaseService {
row.createCell(a++).setCellValue("开票名称");
row.createCell(a++).setCellValue("开票税号");
row.createCell(a++).setCellValue("订单号");
row.createCell(a++).setCellValue("开票时间");
row.createCell(a++).setCellValue("总价");
row.createCell(a++).setCellValue("开票时间");
row.createCell(a++).setCellValue("开票人");
row.createCell(a++).setCellValue("作废时间");
row.createCell(a++).setCellValue("作废人");
row.createCell(a++).setCellValue("车牌号");
row.createCell(a++).setCellValue("状态");
row.createCell(a++).setCellValue("砂站");
row.createCell(a++).setCellValue("车牌号");
row.createCell(a++).setCellValue("数量(吨)");
row.createCell(a++).setCellValue("皮重(吨)");
row.createCell(a++).setCellValue("毛重(吨)");
row.createCell(a++).setCellValue("备注");
// 表头 end
int end_col = 16;
@ -202,11 +204,15 @@ public class InvoiceLogService extends BaseService {
row.createCell(a++).setCellValue(order.getStr("customer_texpayer_name"));
row.createCell(a++).setCellValue(order.getStr("customer_texpayer_num"));
row.createCell(a++).setCellValue(order.getStr("order_sn"));
row.createCell(a++).setCellValue(DateTimeUtil.sdfhms.get().format(order.getDate("create_time")));
row.createCell(a++).setCellValue(DataUtil.getDefaultByRecord(order, "total_price"));
row.createCell(a++).setCellValue(DateTimeUtil.sdfhms.get().format(order.getDate("create_time")));
row.createCell(a++).setCellValue(order.getStr("settlement_user_name"));
if(order.get("invalid_time") != null){
row.createCell(a++).setCellValue(DateTimeUtil.sdfhms.get().format(order.getDate("invalid_time")));
}else{
row.createCell(a++).setCellValue("");
}
row.createCell(a++).setCellValue(order.getStr("invalid_user_name"));
row.createCell(a++).setCellValue(order.getStr("truck_license"));
switch (order.getInt("state")) {
case 5:
row.createCell(a++).setCellValue("已使用"); break;
@ -217,9 +223,11 @@ public class InvoiceLogService extends BaseService {
}
row.createCell(a++).setCellValue(order.getStr("supermarket_name"));
row.createCell(a++).setCellValue(order.getStr("truck_license"));
row.createCell(a++).setCellValue(DataUtil.getDefaultByRecord(order, "weight"));
row.createCell(a++).setCellValue(DataUtil.getDefaultByRecord(order, "first_weight"));
row.createCell(a++).setCellValue(DataUtil.getDefaultByRecord(order, "second_weight"));
row.createCell(a++).setCellValue(order.getStr("invalid_memo"));
}
// 通用单元格格式

View File

@ -126,12 +126,12 @@ public class InvoiceReceiveService extends BaseService {
if (StrKit.notBlank(reveiver_user_name)) {
fromsql += " and t.receive_user_name like ? \n";
paraList.add("%" + reveiver_user_name + "%");
paraList.add("%" + reveiver_user_name.trim() + "%");
}
if (StrKit.notBlank(invoice_number)) {
fromsql += " and t.invoice_number like ? \n";
paraList.add("%" + invoice_number + "%");
paraList.add("%" + invoice_number.trim() + "%");
}
if (StrKit.notBlank(stm)) {

View File

@ -79,7 +79,7 @@ public class OrderclusterService extends BaseService {
if (StrKit.notBlank(customer_name)) {
fromsql += " and t.customer_name like ? \n";
paraList.add("%" + customer_name + "%");
paraList.add("%" + customer_name.trim() + "%");
}
if (product_id != null) {
@ -155,7 +155,7 @@ public class OrderclusterService extends BaseService {
if (StrKit.notBlank(customer_name)) {
fromsql += " and t.customer_name like ? \n";
paraList.add("%" + customer_name + "%");
paraList.add("%" + customer_name.trim() + "%");
}
if (customer_id != null) {
@ -236,7 +236,7 @@ public class OrderclusterService extends BaseService {
if (StrKit.notBlank(customer_name)) {
fromsql += " and t.customer_name like ? \n";
paraList.add("%" + customer_name + "%");
paraList.add("%" + customer_name.trim() + "%");
}
if (customer_id != null) {
@ -501,24 +501,24 @@ public class OrderclusterService extends BaseService {
salesql += " and t.sn like ? \n";
tempsql += " and t.sn like ? \n";
salePara.add("%" + sn + "%");
tempPara.add("%" + sn + "%");
salePara.add("%" + sn.trim() + "%");
tempPara.add("%" + sn.trim() + "%");
}
if (StrKit.notBlank(truck_license)) {
salesql += " and t.truck_license like ? \n";
tempsql += " and t.truck_license like ? \n";
salePara.add("%" + truck_license + "%");
tempPara.add("%" + truck_license + "%");
salePara.add("%" + truck_license.trim() + "%");
tempPara.add("%" + truck_license.trim() + "%");
}
if (StrKit.notBlank(invoice_code)) {
salesql += " and t.invoice_code like ? \n";
tempsql += " and t.invoice_code like ? \n";
salePara.add("%" + invoice_code + "%");
tempPara.add("%" + invoice_code + "%");
salePara.add("%" + invoice_code.trim() + "%");
tempPara.add("%" + invoice_code.trim() + "%");
}
if (StrKit.notBlank(stm)) {

View File

@ -67,7 +67,7 @@ public class OrderPurchaseService extends BaseService {
if (StrKit.notBlank(sn)) {
fromsql += " and t.sn like ? \n";
paraList.add("%" + sn + "%");
paraList.add("%" + sn.trim() + "%");
}
if (supermarket_id != null) {
@ -77,7 +77,7 @@ public class OrderPurchaseService extends BaseService {
if (StrKit.notBlank(truck_license)) {
fromsql += " and t.truck_license like ? \n";
paraList.add("%" + truck_license + "%");
paraList.add("%" + truck_license.trim() + "%");
}
if (StrKit.notBlank(stm)) {

View File

@ -81,7 +81,7 @@ public class OrderSaleService extends BaseService {
if (StrKit.notBlank(sn)) {
fromsql += " and t.sn like ? \n";
paraList.add("%" + sn + "%");
paraList.add("%" + sn.trim() + "%");
}
if (supermarket_id != null) {
@ -96,12 +96,12 @@ public class OrderSaleService extends BaseService {
if (StrKit.notBlank(truck_license)) {
fromsql += " and t.truck_license like ? \n";
paraList.add("%" + truck_license + "%");
paraList.add("%" + truck_license.trim() + "%");
}
if (StrKit.notBlank(customer_name)) {
fromsql += " and t.customer_name like ? \n";
paraList.add("%" + customer_name + "%");
paraList.add("%" + customer_name.trim() + "%");
}
if (customer_id != null) {

View File

@ -93,7 +93,7 @@ public class OrderTempService extends BaseService {
if (StrKit.notBlank(sn)) {
fromsql += " and t.sn like ? \n";
paraList.add("%" + sn + "%");
paraList.add("%" + sn.trim() + "%");
}
if (supermarket_id != null) {
@ -103,12 +103,12 @@ public class OrderTempService extends BaseService {
if (StrKit.notBlank(truck_license)) {
fromsql += " and t.truck_license like ? \n";
paraList.add("%" + truck_license + "%");
paraList.add("%" + truck_license.trim() + "%");
}
if (StrKit.notBlank(customer_name)) {
fromsql += " and t.customer_name like ? \n";
paraList.add("%" + customer_name + "%");
paraList.add("%" + customer_name.trim() + "%");
}
if (customer_id != null) {
@ -141,7 +141,7 @@ public class OrderTempService extends BaseService {
} else {
if (StrKit.notBlank(invoice_code)) {
fromsql += " and t.invoice_code like ? \n";
paraList.add("%" + invoice_code + "%");
paraList.add("%" + invoice_code.trim() + "%");
}
}
@ -203,7 +203,7 @@ public class OrderTempService extends BaseService {
if (StrKit.notBlank(sn)) {
fromsql += " and t.sn like ? \n";
paraList.add("%" + sn + "%");
paraList.add("%" + sn.trim() + "%");
}
if (supermarket_id != null) {
@ -213,12 +213,12 @@ public class OrderTempService extends BaseService {
if (StrKit.notBlank(truck_license)) {
fromsql += " and t.truck_license like ? \n";
paraList.add("%" + truck_license + "%");
paraList.add("%" + truck_license.trim() + "%");
}
if (StrKit.notBlank(customer_name)) {
fromsql += " and t.customer_name like ? \n";
paraList.add("%" + customer_name + "%");
paraList.add("%" + customer_name.trim() + "%");
}
if (customer_id != null) {
@ -251,7 +251,7 @@ public class OrderTempService extends BaseService {
} else {
if (StrKit.notBlank(invoice_code)) {
fromsql += " and t.invoice_code like ? \n";
paraList.add("%" + invoice_code + "%");
paraList.add("%" + invoice_code.trim() + "%");
}
}

View File

@ -72,7 +72,7 @@ public class OrderTransferService extends BaseService {
if (StrKit.notBlank(sn)) {
fromsql += " and t.sn like ? \n";
paraList.add("%" + sn + "%");
paraList.add("%" + sn.trim() + "%");
}
if (supermarket_id != null) {
@ -82,7 +82,7 @@ public class OrderTransferService extends BaseService {
if (StrKit.notBlank(truck_license)) {
fromsql += " and t.truck_license like ? \n";
paraList.add("%" + truck_license + "%");
paraList.add("%" + truck_license.trim() + "%");
}
if (StrKit.notBlank(stm)) {

View File

@ -63,7 +63,7 @@ public class OrderTrashService extends BaseService {
if (StrKit.notBlank(sn)) {
fromsql += " and t.sn like ? \n";
paraList.add("%" + sn + "%");
paraList.add("%" + sn.trim() + "%");
}
if (supermarket_id != null) {
@ -73,7 +73,7 @@ public class OrderTrashService extends BaseService {
if (StrKit.notBlank(truck_license)) {
fromsql += " and t.truck_license like ? \n";
paraList.add("%" + truck_license + "%");
paraList.add("%" + truck_license.trim() + "%");
}
if (StrKit.notBlank(stm)) {

View File

@ -56,7 +56,7 @@ public class PrepayService {
if (StrKit.notBlank(name)) {
fromsql += " and c.name like ? \n";
paraList.add("%" + name + "%");
paraList.add("%" + name.trim() + "%");
}
if (customer_id != null) {
@ -208,10 +208,10 @@ public class PrepayService {
if (StrKit.notBlank(truck_license)) {
sale_sql += " and t.truck_license like ?";
saleList.add("%" + truck_license + "%");
saleList.add("%" + truck_license.trim() + "%");
temp_sql += " and t.truck_license like ?";
tempList.add("%" + truck_license + "%");
tempList.add("%" + truck_license.trim() + "%");
}
String sql = "select a.sn \n" +

View File

@ -51,7 +51,7 @@ public class PrepayDetailService extends BaseService {
if (StrKit.notBlank(name)) {
fromsql += " and c.name like ? \n";
paraList.add("%" + name + "%");
paraList.add("%" + name.trim() + "%");
}
if (customer_id != null) {

View File

@ -63,7 +63,7 @@ public class PrepayTruckService extends BaseService {
if (StrKit.notBlank(truck_license)) {
fromsql += " and t.truck_license like ? \n";
paraList.add("%" + truck_license + "%");
paraList.add("%" + truck_license.trim() + "%");
}
if (StrKit.notBlank(valid_date)) {
@ -118,7 +118,7 @@ public class PrepayTruckService extends BaseService {
if (StrKit.notBlank(truck_license)) {
fromsql += " and t.truck_license like ? \n";
paraList.add("%" + truck_license + "%");
paraList.add("%" + truck_license.trim() + "%");
}
if (StrKit.notBlank(valid_date)) {

View File

@ -33,7 +33,7 @@ public class RefundDetailService extends BaseService {
if (StrKit.notBlank(name)) {
fromsql += " and c.name like ? \n";
paraList.add("%" + name + "%");
paraList.add("%" + name.trim() + "%");
}
if (StrKit.notBlank(stm)) {

View File

@ -36,7 +36,7 @@ public class ProductService extends BaseService {
if (StrKit.notBlank(name)) {
fromsql += " and t.name like ? \n";
paraList.add("%" + name + "%");
paraList.add("%" + name.trim() + "%");
}
String totalRowSql = "select count(*) " + fromsql;

View File

@ -33,7 +33,7 @@ public class PurchaseService extends BaseService {
if (StrKit.notBlank(name)) {
fromsql += " and t.name like ?";
paraList.add("%" + name + "%");
paraList.add("%" + name.trim() + "%");
}
String totalRowSql = "select count(*) " + fromsql;

View File

@ -33,7 +33,7 @@ public class SandfarmService extends BaseService {
if (StrKit.notBlank(name)) {
fromsql += " and t.name like ? \n";
paraList.add("%" + name + "%");
paraList.add("%" + name.trim() + "%");
}
String totalRowSql = "select count(*) " + fromsql;

View File

@ -38,7 +38,7 @@ public class SmsLogService extends BaseService {
if (StrKit.notBlank(phone)) {
fromsql += " and t.phone like ? \n";
paraList.add("%" + phone + "%");
paraList.add("%" + phone.trim() + "%");
}
if (sendstatus != null) {

View File

@ -50,7 +50,7 @@ public class OrderPurchaseStatService {
if (StrKit.notBlank(sn)) {
sql += " and t.sn like ? \n";
paraList.add("%" + sn + "%");
paraList.add("%" + sn.trim() + "%");
}
if (supermarket_id != null) {
@ -75,7 +75,7 @@ public class OrderPurchaseStatService {
if (StrKit.notBlank(truck_license)) {
sql += " and t.truck_license like ? \n";
paraList.add("%" + truck_license + "%");
paraList.add("%" + truck_license.trim() + "%");
}
if (StrKit.notBlank(tm)) {

View File

@ -140,22 +140,22 @@ public class OrderStatService {
if (StrKit.notBlank(customer_name)) {
sale_sql += " and t.customer_name like ? \n";
temp_sql += " and t.customer_name like ? \n";
paraSaleList.add("%" + customer_name + "%");
paraTempList.add("%" + customer_name + "%");
paraSaleList.add("%" + customer_name.trim() + "%");
paraTempList.add("%" + customer_name.trim() + "%");
}
if (StrKit.notBlank(truck_license)) {
sale_sql += " and t.truck_license like ? \n";
temp_sql += " and t.truck_license like ? \n";
paraSaleList.add("%" + truck_license + "%");
paraTempList.add("%" + truck_license + "%");
paraSaleList.add("%" + truck_license.trim() + "%");
paraTempList.add("%" + truck_license.trim() + "%");
}
if (StrKit.notBlank(sn)) {
sale_sql += " and t.sn like ? \n";
temp_sql += " and t.sn like ? \n";
paraSaleList.add("%" + sn + "%");
paraTempList.add("%" + sn + "%");
paraSaleList.add("%" + sn.trim() + "%");
paraTempList.add("%" + sn.trim() + "%");
}
String sql = "select \n" +

View File

@ -48,7 +48,7 @@ public class OrderTransferStatService {
if (StrKit.notBlank(sn)) {
sql += " and t.sn like ? \n";
paraList.add("%" + sn + "%");
paraList.add("%" + sn.trim() + "%");
}
if (supermarket_id != null) {
@ -73,7 +73,7 @@ public class OrderTransferStatService {
if (StrKit.notBlank(truck_license)) {
sql += " and t.truck_license like ? \n";
paraList.add("%" + truck_license + "%");
paraList.add("%" + truck_license.trim() + "%");
}
if (StrKit.notBlank(tm)) {

View File

@ -62,7 +62,7 @@ public class SupermarketService extends BaseService {
if (StrKit.notBlank(name)) {
fromsql += " and t.name like ?";
paraList.add("%" + name + "%");
paraList.add("%" + name.trim() + "%");
}
String totalRowSql = "select count(*) " + fromsql;

View File

@ -73,7 +73,7 @@ public class SupermarketCustomerDistanceService extends BaseService {
if (StrKit.notBlank(customer_name)) {
fromsql += " and t.name like ? \n";
paraList.add("%" + customer_name + "%");
paraList.add("%" + customer_name.trim() + "%");
}
String totalRowSql = "select count(*) " + fromsql;

View File

@ -159,7 +159,7 @@ public class SupermarketReceiverDistanceService extends BaseService {
if (StrKit.notBlank(customer_name)) {
fromsql += " and a.customer_name like ? \n";
paraList.add("%" + customer_name + "%");
paraList.add("%" + customer_name.trim() + "%");
}
if (customer_receiver_id != null) {

View File

@ -73,7 +73,7 @@ public class TransportService extends BaseService {
if (StrKit.notBlank(truck_license)) {
fromsql += " and t.truck_license like ? \n";
paraList.add("%" + truck_license + "%");
paraList.add("%" + truck_license.trim() + "%");
}
if (StrKit.notBlank(stm)) {
@ -93,7 +93,7 @@ public class TransportService extends BaseService {
if (StrKit.notBlank(order_sn)) {
fromsql += " and t.order_sn like ? \n";
paraList.add("%" + order_sn + "%");
paraList.add("%" + order_sn.trim() + "%");
}
if (state != null) {

View File

@ -53,7 +53,7 @@ public class TransportCompanyService extends BaseService {
if(StrKit.notBlank(name)){
fromsql += " and t.name like ? \n";
paraList.add("%" + name + "%");
paraList.add("%" + name.trim() + "%");
}
String totalRowSql = "select count(*) " + fromsql;

View File

@ -35,7 +35,7 @@ public class TruckService extends BaseService {
if (StrKit.notBlank(license)) {
fromsql += " and t.license like ? \n";
paraList.add("%" + license + "%");
paraList.add("%" + license.trim() + "%");
}
if (trans_co_id != null) {
@ -50,17 +50,17 @@ public class TruckService extends BaseService {
if (StrKit.notBlank(gps)) {
fromsql += " and t.gps like ? \n";
paraList.add("%" + gps + "%");
paraList.add("%" + gps.trim() + "%");
}
if (StrKit.notBlank(sim)) {
fromsql += " and t.sim like ? \n";
paraList.add("%" + sim + "%");
paraList.add("%" + sim.trim() + "%");
}
if (StrKit.notBlank(number)) {
fromsql += " and t.number like ? \n";
paraList.add("%" + number + "%");
paraList.add("%" + number.trim() + "%");
}
String totalRowSql = "select count(*) " + fromsql;

View File

@ -144,6 +144,12 @@ public class PLC extends Device {
void plcWrite(String address, byte data, byte[] framePreset) throws IOException {
lock.lock();
try {
boolean f = this.socket != null && this.socket.isConnected() && !this.socket.isClosed();
if (!f) {
log.debug("PLC 未连接或者连接已断开, %s %s", this.getId(), this.getIp());
return;
}
if (addressTable.containsKey(address)) {
byte addr = addressTable.get(address);
byte[] frame = new byte[framePreset.length];
@ -167,6 +173,12 @@ public class PLC extends Device {
int plcRead() throws IOException {
lock.lock();
try {
boolean f = this.socket != null && this.socket.isConnected() && !this.socket.isClosed();
if (!f) {
log.debug("PLC 未连接或者连接已断开, %s %s", this.getId(), this.getIp());
return -1;
}
InputStream in = socket.getInputStream();
if (in.available() >= 6) {
byte[] buf = new byte[6];
@ -189,6 +201,12 @@ public class PLC extends Device {
int plcClear() throws IOException {
lock.lock();
try {
boolean f = this.socket != null && this.socket.isConnected() && !this.socket.isClosed();
if (!f) {
log.debug("PLC 未连接或者连接已断开, %s %s", this.getId(), this.getIp());
return -1;
}
InputStream inputStream = socket.getInputStream();
int available = inputStream.available();
byte[] buf = new byte[available];

View File

@ -259,6 +259,7 @@ public class NettyClient {
return obj.containsKey("target");
} catch (Exception e) {
log.error(e.getMessage(), e);
return false;
}
}

View File

@ -311,7 +311,7 @@ public class SysuserSyncService extends BaseService {
if (StrKit.notBlank(phone)) {
sqlbuf.append(" and a.phone like ? \n");
paraList.add("%" + phone + "%");
paraList.add("%" + phone.trim() + "%");
}
if (del != null && (del == Const.LOGIC_DEL_VALID || del == Const.LOGIC_DEL_INVALID)) {

View File

@ -260,10 +260,6 @@ public class TransportSyncService {
return result;
}
String fileuuid = StrKit.getRandomUUID();
String filekey = getOssKey(fileuuid, file);
File uploadfile = saveImg(fileuuid, file); // 压缩、重命名文件
Transport transport = new Transport();
transport.setId(StrKit.getRandomUUID());
transport.setSupermarketId(supermarket_id);
@ -271,23 +267,32 @@ public class TransportSyncService {
transport.setInTime(new Date());
transport.setInWhich(which);
transport.setState(OrderStateEnum.ENTERED.getStateid()); // 2入场
File uploadfile = null;
if (file != null) {
String fileuuid = StrKit.getRandomUUID();
String filekey = getOssKey(fileuuid, file);
uploadfile = saveImg(fileuuid, file); // 压缩、重命名文件
transport.setFirstPic(filekey);
}
// 浠水只有外销
transport.setType(OrderTypeEnum.TEMP.getTypeid());
File finalUploadfile = uploadfile;
boolean ret = Db.tx(new IAtom() {
@Override
public boolean run() {
try {
boolean ret = transport.save() && SyncTaskService.me.save(new SyncTask().addSaveData(transport));
if(ret){
OssfileLogService.me.save(transport.getId(), transport.getFirstPic(), uploadfile.getAbsolutePath());
if (ret && finalUploadfile != null) {
OssfileLogService.me.save(transport.getId(), transport.getFirstPic(), finalUploadfile.getAbsolutePath());
}
return ret;
} catch (Exception e) {
log.error(e.getMessage(), e);
return false;
}
}
@ -325,27 +330,31 @@ public class TransportSyncService {
Config.socketio.pubMessage(new Record().set("truck_license", result.getLicense()).set("msg", result.getLicense() + " 未找到入场记录!"));
return result;
}
File uploadfile = null;
if (file != null) {
String fileuuid = StrKit.getRandomUUID();
String filekey = getOssKey(fileuuid, file);
File uploadfile = saveImg(fileuuid, file); // 压缩、重命名文件
uploadfile = saveImg(fileuuid, file); // 压缩、重命名文件
transport.setSecondPic(filekey);
}
transport.setOutTime(new Date());
transport.setOutWhich(which);
transport.setSecondPic(filekey);
File finalUploadfile = uploadfile;
boolean ret = Db.tx(new IAtom() {
@Override
public boolean run() {
try {
boolean ret = transport.update() && SyncTaskService.me.save(new SyncTask().addUpdateData(transport));
if(ret){
OssfileLogService.me.save(transport.getId(), transport.getSecondPic(), uploadfile.getAbsolutePath());
if (ret && finalUploadfile != null) {
OssfileLogService.me.save(transport.getId(), transport.getSecondPic(), finalUploadfile.getAbsolutePath());
}
return ret;
} catch (Exception e) {
log.error(e.getMessage(), e);
return false;
}
}
@ -383,9 +392,16 @@ public class TransportSyncService {
Date now = new Date();
boolean ret = false;
File uploadfile = null;
String filekey = null;
if (file != null) {
String fileuuid = StrKit.getRandomUUID();
String filekey = getOssKey(fileuuid, file);
File uploadfile = saveImg(fileuuid, file); // 压缩、重命名文件
filekey = getOssKey(fileuuid, file);
uploadfile = saveImg(fileuuid, file); // 压缩、重命名文件
}
File finalUploadfile = uploadfile;
// 没有找到入场记录,就走入场流程
if (transport == null) {
@ -408,12 +424,13 @@ public class TransportSyncService {
try {
boolean ret = finalTransport.save() && SyncTaskService.me.save(new SyncTask().addSaveData(finalTransport));
if(ret){
OssfileLogService.me.save(finalTransport.getId(), finalTransport.getFirstPic(), uploadfile.getAbsolutePath());
if (ret && finalUploadfile != null) {
OssfileLogService.me.save(finalTransport.getId(), finalTransport.getFirstPic(), finalUploadfile.getAbsolutePath());
}
return ret;
} catch (Exception e) {
log.error(e.getMessage(), e);
return false;
}
}
@ -436,12 +453,13 @@ public class TransportSyncService {
try {
boolean ret = finalTransport1.update() && SyncTaskService.me.save(new SyncTask().addUpdateData(finalTransport1));
if(ret){
OssfileLogService.me.save(finalTransport1.getId(), finalTransport1.getSecondPic(), uploadfile.getAbsolutePath());
if (ret && finalUploadfile != null) {
OssfileLogService.me.save(finalTransport1.getId(), finalTransport1.getSecondPic(), finalUploadfile.getAbsolutePath());
}
return ret;
} catch (Exception e) {
log.error(e.getMessage(), e);
return false;
}
}
@ -502,6 +520,7 @@ public class TransportSyncService {
return ret;
} catch (Exception e) {
log.error(e.getMessage(), e);
return false;
}
}
@ -545,6 +564,7 @@ public class TransportSyncService {
return ret;
} catch (Exception e) {
log.error(e.getMessage(), e);
return false;
}
}

View File

@ -233,12 +233,12 @@ public class CustomerRegisterService extends BaseService {
if (StrKit.notBlank(sysuser_phone)) {
fromsql += " and t.sysuser_phone like ? \n";
paraList.add("%" + sysuser_phone + "%");
paraList.add("%" + sysuser_phone.trim() + "%");
}
if (StrKit.notBlank(customer_texpayer_name)) {
fromsql += " and t.customer_texpayer_name like ? \n";
paraList.add("%" + customer_texpayer_name + "%");
paraList.add("%" + customer_texpayer_name.trim() + "%");
}
if (StrKit.notBlank(receiver_name)) {
@ -248,7 +248,7 @@ public class CustomerRegisterService extends BaseService {
if (StrKit.notBlank(receiver_phone)) {
fromsql += " and t.receiver_phone like ? \n";
paraList.add("%" + receiver_phone + "%");
paraList.add("%" + receiver_phone.trim() + "%");
}
if (StrKit.notBlank(receiver_address)) {

View File

@ -265,6 +265,7 @@ public class NettyServer {
return obj.containsKey("target");
} catch (Exception e) {
log.error(e.getMessage(), e);
return false;
}
}

View File

@ -835,7 +835,7 @@ public class SysuserSyncService extends BaseSyncService {
if (StrKit.notBlank(phone)) {
sqlbuf.append(" and a.phone like ? \n");
paraList.add("%" + phone + "%");
paraList.add("%" + phone.trim() + "%");
}
if (del != null && (del == Const.LOGIC_DEL_VALID || del == Const.LOGIC_DEL_INVALID)) {
@ -883,7 +883,7 @@ public class SysuserSyncService extends BaseSyncService {
if (StrKit.notBlank(phone)) {
sqlbuf.append(" and a.phone like ? \n");
paraList.add("%" + phone + "%");
paraList.add("%" + phone.trim() + "%");
}
if (del != null && (del == Const.LOGIC_DEL_VALID || del == Const.LOGIC_DEL_INVALID)) {