diff --git a/ssjygl-xsx-common/src/main/java/com/cowr/common/Const.java b/ssjygl-xsx-common/src/main/java/com/cowr/common/Const.java index 302e6c1..3e976b4 100644 --- a/ssjygl-xsx-common/src/main/java/com/cowr/common/Const.java +++ b/ssjygl-xsx-common/src/main/java/com/cowr/common/Const.java @@ -17,11 +17,11 @@ public class Const { public static final String REDIS_CACHENAME = "mian"; // redis 默认 cache 对象别名 public static final String REDIS_JSON = "json"; // redis 按 json 存储对象 - public static final String TEMP_CODE_PEIE = "SMS_203717953"; // 配额分配通知 + public static final String TEMP_CODE_PEIE = "SMS_203673037"; // 配额分配通知 public static Map SMS_TEMP_MAP; static { SMS_TEMP_MAP = new HashMap<>(); - SMS_TEMP_MAP.put("SMS_203717953", "已经在${supermarket_name}分配了${weight}吨配额,请在${date}安排车辆前去运输。"); + SMS_TEMP_MAP.put("SMS_203673037", "已经在${supermarket_name}分配了${weight}吨配额,请在${date}安排车辆前去运输。"); } } diff --git a/ssjygl-xsx-common/src/main/java/com/cowr/model/base/BaseInvoiceLog.java b/ssjygl-xsx-common/src/main/java/com/cowr/model/base/BaseInvoiceLog.java index 2d4ba9e..98ff33e 100644 --- a/ssjygl-xsx-common/src/main/java/com/cowr/model/base/BaseInvoiceLog.java +++ b/ssjygl-xsx-common/src/main/java/com/cowr/model/base/BaseInvoiceLog.java @@ -5,7 +5,7 @@ import com.jfinal.plugin.activerecord.IBean; import com.alibaba.fastjson.annotation.JSONField; /** - * Generated by COWR Mon Sep 21 13:04:24 CST 2020 + * Generated by COWR Tue Sep 29 16:17:52 CST 2020 * TableName: invoice_log * Remarks: 发票管理 - 发票使用记录 * PrimaryKey: id @@ -45,7 +45,7 @@ public abstract class BaseInvoiceLog> extends BaseMo /** * name: invoice_receive_id * type: INT(10) - * isNullable: NO + * isNullable: YES * isPrimaryKey: NO * defaultValue: * @param invoiceReceiveId 领用记录id @@ -158,7 +158,7 @@ public abstract class BaseInvoiceLog> extends BaseMo * isNullable: YES * isPrimaryKey: NO * defaultValue: - * @param settlementTime 结算时间 + * @param settlementTime 开票时间 */ @JSONField(name="settlement_time") public void setSettlementTime(java.util.Date settlementTime) { @@ -167,7 +167,7 @@ public abstract class BaseInvoiceLog> extends BaseMo /** - * @return settlement_time 结算时间 + * @return settlement_time 开票时间 */ @JSONField(name="settlement_time") public java.util.Date getSettlementTime() { @@ -180,7 +180,7 @@ public abstract class BaseInvoiceLog> extends BaseMo * isNullable: YES * isPrimaryKey: NO * defaultValue: - * @param settlementUserId 结算用户id + * @param settlementUserId 开票用户id */ @JSONField(name="settlement_user_id") public void setSettlementUserId(Integer settlementUserId) { @@ -189,7 +189,7 @@ public abstract class BaseInvoiceLog> extends BaseMo /** - * @return settlement_user_id 结算用户id + * @return settlement_user_id 开票用户id */ @JSONField(name="settlement_user_id") public Integer getSettlementUserId() { @@ -202,7 +202,7 @@ public abstract class BaseInvoiceLog> extends BaseMo * isNullable: YES * isPrimaryKey: NO * defaultValue: - * @param settlementUserName 结算用户姓名 + * @param settlementUserName 开票用户姓名 */ @JSONField(name="settlement_user_name") public void setSettlementUserName(String settlementUserName) { @@ -211,7 +211,7 @@ public abstract class BaseInvoiceLog> extends BaseMo /** - * @return settlement_user_name 结算用户姓名 + * @return settlement_user_name 开票用户姓名 */ @JSONField(name="settlement_user_name") public String getSettlementUserName() { diff --git a/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/actioncmdlog/ActionCmdLogService.java b/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/actioncmdlog/ActionCmdLogService.java index 8e5ffeb..069c255 100644 --- a/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/actioncmdlog/ActionCmdLogService.java +++ b/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/actioncmdlog/ActionCmdLogService.java @@ -93,7 +93,8 @@ public class ActionCmdLogService { JSONObject obj = JSONObject.parseObject(content); String which = obj.getString("which"); - record.set("content", "抬" + Enums.WhichEnum.getLabel(which) + (obj.getInteger("num") == 1 ? "前" : "后") + "闸" + (obj.getBoolean("rod") ? "成功" : "失败")); + record.set("content", "抬" + Enums.WhichEnum.getLabel(which) + (obj.getInteger("num") == 1 ? "前" : "后") + "闸"); + record.set("status", obj.getBoolean("rod") ? "成功" : "失败"); } catch (Exception e) { log.error(e.getMessage(), e); } diff --git a/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/order/ordertemp/OrderTempService.java b/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/order/ordertemp/OrderTempService.java index b9ce2c1..e47a9f2 100644 --- a/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/order/ordertemp/OrderTempService.java +++ b/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/order/ordertemp/OrderTempService.java @@ -70,7 +70,9 @@ public class OrderTempService extends BaseService { Integer isprepaid, Integer state, String invoice_code, - Integer product_id + Integer invoice_type, + Integer product_id, + Boolean invoice_code_is_null ) { String selectsql = "select t.* " + ", p.order_sn \n" + @@ -129,9 +131,13 @@ public class OrderTempService extends BaseService { paraList.add(product_id); } - if (StrKit.notBlank(invoice_code)) { - fromsql += " and t.invoice_code like ? \n"; - paraList.add("%" + invoice_code + "%"); + if(invoice_code_is_null != null && invoice_code_is_null){ + fromsql += " and t.invoice_code is null \n"; + }else{ + if (StrKit.notBlank(invoice_code)) { + fromsql += " and t.invoice_code like ? \n"; + paraList.add("%" + invoice_code + "%"); + } } if (state != null) { @@ -139,6 +145,11 @@ public class OrderTempService extends BaseService { paraList.add(state); } + if (invoice_type != null) { + fromsql += " and t.invoice_type = ? \n"; + paraList.add(invoice_type); + } + String totalRowSql = "select count(*) " + fromsql; String findSql = selectsql + fromsql; diff --git a/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/devicectrl/device/AbsScale.java b/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/devicectrl/device/AbsScale.java index 87e8072..479138b 100644 --- a/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/devicectrl/device/AbsScale.java +++ b/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/devicectrl/device/AbsScale.java @@ -26,6 +26,13 @@ public abstract class AbsScale extends Device { socket.connect(new InetSocketAddress(getIp(), getPort()), 5000); return true; + }catch (Exception e){ + if(e.getMessage().contains("connect timed out")){ + log.error("Scale %s %s 连接超时", getId(), getIp()); + }else{ + log.error(e.getMessage(), e); + } + return false; } finally { lock.unlock(); } diff --git a/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/devicectrl/device/LEDThread.java b/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/devicectrl/device/LEDThread.java index 8384113..4fc85ab 100644 --- a/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/devicectrl/device/LEDThread.java +++ b/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/devicectrl/device/LEDThread.java @@ -19,10 +19,10 @@ public class LEDThread extends Device implements Runnable { private static final String LEDWeightFormat = "%s\\n %s \\n重: %s吨"; private static final String LEDInfoFormat = "%s\\n %s \\n%s"; - private String license = ""; - private String text = "系统启动"; - private String format = LEDInfoFormat; - private Thread thread; + private String license = ""; + private String text = "系统启动"; + private String format = LEDInfoFormat; + private Thread thread; private boolean running = true; public void setRunning(boolean running) { @@ -33,12 +33,16 @@ public class LEDThread extends Device implements Runnable { this.license = license; this.text = text; this.format = LEDInfoFormat; + + screen(); // 更新属性后,马上刷新显示内容 } public void setWeightInfo(String license, String text) { this.license = license; this.text = text; this.format = LEDWeightFormat; + + screen(); // 更新属性后,马上刷新显示内容 } private static final ThreadLocal sdf = new ThreadLocal() { @@ -61,7 +65,7 @@ public class LEDThread extends Device implements Runnable { this.thread.setDaemon(true); } - public void start(){ + public void start() { this.thread.start(); } @@ -69,14 +73,14 @@ public class LEDThread extends Device implements Runnable { public void run() { DateFormat df = new SimpleDateFormat("mm.ss"); - while (this.running){ + while (this.running) { try { // // 发送测试消息 setWeightInfo("鄂A7D1P1", df.format(new Date())); screen(); Thread.sleep(5000); - }catch (Exception e){ + } catch (Exception e) { log.error(e.getMessage(), e); } @@ -87,70 +91,82 @@ public class LEDThread extends Device implements Runnable { } public void screen() { - lock.lock(); - try { - if (this.license == null) { - return; - } + synchronized (lock) { + lock.lock(); + try { + if (this.license == null) { + return; + } - // 重连一次 - if (!isConnected()) { - connect(); - } + // 重连一次 + if (!isConnected()) { + connect(); - String date = sdf.get().format(new Date()); - String dataStr = String.format(this.format, date, this.license, this.text); - byte[] data = dataStr.getBytes(Charset.forName("gb2312")); - int dataLen = data.length; - byte[] msg = new byte[frameHead.length + packetHead.length + b.length + dataLen]; - System.arraycopy(frameHead, 0, msg, 0, frameHead.length); + // 重连一次后还是连不上,就等下次连上再发送内容 + if (!isConnected()) { + log.error("LED %s %s 连接失败", getId(), getIp()); + return; + } + } + + String date = sdf.get().format(new Date()); + String dataStr = String.format(this.format, date, this.license, this.text); + byte[] data = dataStr.getBytes(Charset.forName("gb2312")); + int dataLen = data.length; + byte[] msg = new byte[frameHead.length + packetHead.length + b.length + dataLen]; + System.arraycopy(frameHead, 0, msg, 0, frameHead.length); // System.out.println(HexDump.toHex(msg)); - packetHead[packetHead.length - 2] = (byte) (b.length + dataLen); - System.arraycopy(packetHead, 0, msg, frameHead.length, packetHead.length); + packetHead[packetHead.length - 2] = (byte) (b.length + dataLen); + System.arraycopy(packetHead, 0, msg, frameHead.length, packetHead.length); // System.out.println(HexDump.toHex(msg)); - int areaLen = b.length - 9 + dataLen; - b[7] = (byte) areaLen; - b[32] = (byte) dataLen; - System.arraycopy(b, 0, msg, packetHead.length + frameHead.length, b.length); + int areaLen = b.length - 9 + dataLen; + b[7] = (byte) areaLen; + b[32] = (byte) dataLen; + System.arraycopy(b, 0, msg, packetHead.length + frameHead.length, b.length); // System.out.println(HexDump.toHex(msg)); - System.arraycopy(data, 0, msg, packetHead.length + frameHead.length + b.length, dataLen); + System.arraycopy(data, 0, msg, packetHead.length + frameHead.length + b.length, dataLen); // System.out.println(HexDump.toHex(msg)); - byte[] toCrc = new byte[msg.length - 8]; - System.arraycopy(msg, 8, toCrc, 0, toCrc.length); - int crc = CalcCRC(toCrc, toCrc.length); + byte[] toCrc = new byte[msg.length - 8]; + System.arraycopy(msg, 8, toCrc, 0, toCrc.length); + int crc = CalcCRC(toCrc, toCrc.length); - byte[] msgCrc = new byte[msg.length + 3]; - System.arraycopy(msg, 0, msgCrc, 0, msg.length); - msgCrc[msgCrc.length - 2] = (byte) (crc >> 8); - msgCrc[msgCrc.length - 3] = (byte) crc; - msgCrc[msgCrc.length - 1] = frameTail; + byte[] msgCrc = new byte[msg.length + 3]; + System.arraycopy(msg, 0, msgCrc, 0, msg.length); + msgCrc[msgCrc.length - 2] = (byte) (crc >> 8); + msgCrc[msgCrc.length - 3] = (byte) crc; + msgCrc[msgCrc.length - 1] = frameTail; // System.out.println(getId() + " LED 发送数据:" + HexDump.toHex(msgCrc)); - socket.getOutputStream().write(msgCrc); - socket.getOutputStream().flush(); + socket.getOutputStream().write(msgCrc); + socket.getOutputStream().flush(); - InputStream in = socket.getInputStream(); - byte[] buf = new byte[in.available()]; - in.read(buf); - // LED 返回 - BufferedInputStream bis = new BufferedInputStream(socket.getInputStream()); - byte[] y = new byte[128]; - int read = bis.read(y); - while (!(read > 0)) { - read = bis.read(y); - } - byte[] z = new byte[read]; - System.arraycopy(y, 0, z, 0, read); + InputStream in = socket.getInputStream(); + byte[] buf = new byte[in.available()]; + in.read(buf); + // LED 返回 + BufferedInputStream bis = new BufferedInputStream(socket.getInputStream()); + byte[] y = new byte[128]; + int read = bis.read(y); + while (!(read > 0)) { + read = bis.read(y); + } + byte[] z = new byte[read]; + System.arraycopy(y, 0, z, 0, read); // System.out.println(getId() + " LED 返回数据:" + HexDump.toHex(z)); // socket.close(); - } catch (Exception e) { - log.error(e.getMessage(), e); + } catch (Exception e) { + if (e.getMessage().contains("Socket is not connected")) { + log.error("LED %s %s 连接已断开", getId(), getIp()); + } else { + log.error(e.getMessage(), e); + } - reconn(); - } finally { - lock.unlock(); + reconn(); + } finally { + lock.unlock(); + } } } @@ -231,6 +247,12 @@ public class LEDThread extends Device implements Runnable { socket = new Socket(); socket.setSoTimeout(1000); socket.connect(new InetSocketAddress(getIp(), getPort()), 5000); + } catch (Exception e) { + if (e.getMessage().contains("connect timed out")) { + log.error("LED %s %s 连接超时", getId(), getIp()); + } else { + log.error(e.getMessage(), e); + } } finally { lock.unlock(); } @@ -260,7 +282,7 @@ public class LEDThread extends Device implements Runnable { socket = null; } - public boolean reconn(){ + public boolean reconn() { try { log.debug("销毁LED连接"); if (socket != null) { @@ -277,7 +299,11 @@ public class LEDThread extends Device implements Runnable { socket.setSoTimeout(1000); socket.connect(new InetSocketAddress(getIp(), getPort()), 5000); } catch (Exception e) { - log.error(e.getMessage(), e); + if (e.getMessage().contains("connect timed out")) { + log.error("LED %s %s 连接超时", getId(), getIp()); + } else { + log.error(e.getMessage(), e); + } } finally { lock.unlock(); } diff --git a/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/devicectrl/device/PLC.java b/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/devicectrl/device/PLC.java index 97905f1..20ad445 100644 --- a/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/devicectrl/device/PLC.java +++ b/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/devicectrl/device/PLC.java @@ -85,6 +85,12 @@ public class PLC extends Device { log.debug("plc连接成功"); return true; + }catch (Exception e){ + if(e.getMessage().contains("connect timed out")){ + log.error("PLC %s %s 连接超时", getId(), getIp()); + }else{ + log.error(e.getMessage(), e); + } } finally { lock.unlock(); } @@ -117,16 +123,11 @@ public class PLC extends Device { log.debug("销毁PLC连接开始"); try { - log.debug("销毁PLC 1 " + (socket != null)); - log.debug("销毁PLC 2 " + (socket != null && socket.isConnected())); - log.debug("销毁PLC 3 " + (socket != null && !socket.isClosed())); - if (socket != null && socket.isConnected() && !socket.isClosed()) { socket.close(); socket = null; } } catch (IOException e) { - System.out.println("销毁PLC IOException"); log.error(e.getMessage(), e); } @@ -143,6 +144,11 @@ public class PLC extends Device { void plcWrite(String address, byte data, byte[] framePreset) throws IOException { lock.lock(); try { + if (!isConnected()) { + log.debug("PLC %s %s 未连接", getId(), getIp()); + return; + } + if (addressTable.containsKey(address)) { byte addr = addressTable.get(address); byte[] frame = new byte[framePreset.length]; @@ -166,6 +172,11 @@ public class PLC extends Device { int plcRead() throws IOException { lock.lock(); try { + if (!isConnected()) { + log.debug("PLC %s %s 未连接", getId(), getIp()); + return -1; + } + InputStream in = socket.getInputStream(); if (in.available() >= 6) { byte[] buf = new byte[6]; @@ -188,6 +199,11 @@ public class PLC extends Device { int plcClear() throws IOException { lock.lock(); try { + if (!isConnected()) { + log.debug("PLC %s %s 未连接", getId(), getIp()); + return -1; + } + InputStream inputStream = socket.getInputStream(); int available = inputStream.available(); byte[] buf = new byte[available]; diff --git a/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/main/Config.java b/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/main/Config.java index 436a5f1..a25cb1a 100644 --- a/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/main/Config.java +++ b/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/main/Config.java @@ -79,15 +79,16 @@ import java.io.File; import java.sql.Connection; public class Config extends JFinalConfig { - private static Log log = Log.getLog(Config.class); - public static String ENV = "dev"; - public static Prop configprop = PropKit.use(ENV + "/config.properties", "UTF-8"); - public static Prop dbprop = PropKit.use(ENV + "/db.properties", "UTF-8"); - private WallFilter wallFilter; - public static NettyClient nettyClient = null; - public static DeviceThread deviceThread = new DeviceThread(); - public static SocketIOService socketio = null; - private static boolean client_run = true; + private static Log log = Log.getLog(Config.class); + public static String ENV = "dev"; + public static Prop configprop = PropKit.use(ENV + "/config.properties", "UTF-8"); + public static Prop dbprop = PropKit.use(ENV + "/db.properties", "UTF-8"); + private WallFilter wallFilter; + public static NettyClient nettyClient = null; + public static DeviceThread deviceThread = new DeviceThread(); + public static SocketIOService socketio = null; + private static boolean client_run = true; + public static final String CLINET_VERSION = "20200929"; public static String getRootPath() { return PathKit.getWebRootPath() diff --git a/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/netty/NettyClient.java b/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/netty/NettyClient.java index f074ffe..54e5232 100644 --- a/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/netty/NettyClient.java +++ b/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/netty/NettyClient.java @@ -186,7 +186,10 @@ public class NettyClient { channel = ctx.channel(); JSONObject json = new JSONObject(); - json.fluentPut("target", Enums.MsgTarget.LOGIN.name()).fluentPut("supermarket_id", supermarket_id); + json.fluentPut("target", Enums.MsgTarget.LOGIN.name()) + .fluentPut("supermarket_id", supermarket_id) + .fluentPut("clinet_version", Config.CLINET_VERSION) + ; sendMsg(ctx, json.toJSONString()); } diff --git a/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/order/ordertemp/OrderTempController.java b/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/order/ordertemp/OrderTempController.java index c040157..0036d39 100644 --- a/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/order/ordertemp/OrderTempController.java +++ b/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/order/ordertemp/OrderTempController.java @@ -27,19 +27,21 @@ public class OrderTempController extends BaseController { * 分页查找 order_temp 订单 */ public void find() { - PageParam pp = getBean(PageParam.class, "", true); - String stm = get("stm"); - String etm = get("etm"); - String truck_license = getUpperCaseVal("truck_license"); - String customer_name = get("customer_name"); - String sn = get("sn"); - Integer state = getInt("state"); - Integer product_id = getInt("product_id"); - Integer supermarket_id = getInt("supermarket_id"); - Integer isprepaid = getInt("isprepaid"); - String invoice_code = get("invoice_code"); - Integer customer_id = getInt("customer_id"); - renderJson(Result.object(OrderTempService.me.find(pp, sn, truck_license, supermarket_id, customer_id, customer_name, stm, etm, isprepaid, state, invoice_code, product_id))); + PageParam pp = getBean(PageParam.class, "", true); + String stm = get("stm"); + String etm = get("etm"); + String truck_license = getUpperCaseVal("truck_license"); + String customer_name = get("customer_name"); + String sn = get("sn"); + Integer state = getInt("state"); + Integer product_id = getInt("product_id"); + Integer supermarket_id = getInt("supermarket_id"); + Integer isprepaid = getInt("isprepaid"); + String invoice_code = get("invoice_code"); + Integer invoice_type = getInt("invoice_type"); + Integer customer_id = getInt("customer_id"); + Boolean invoice_code_is_null = getBoolean("invoice_code_is_null"); + renderJson(Result.object(OrderTempService.me.find(pp, sn, truck_license, supermarket_id, customer_id, customer_name, stm, etm, isprepaid, state, invoice_code, invoice_type, product_id, invoice_code_is_null))); } @Before(OrderTempPayValidator.class) diff --git a/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/order/ordertemp/OrderTempSyncService.java b/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/order/ordertemp/OrderTempSyncService.java index a932892..456cd36 100644 --- a/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/order/ordertemp/OrderTempSyncService.java +++ b/ssjygl-xsx-local/src/main/java/com/cowr/local/ssjygl/order/ordertemp/OrderTempSyncService.java @@ -6,6 +6,7 @@ import com.cowr.common.enums.OrderTypeEnum; import com.cowr.common.utils.DateTimeUtil; import com.cowr.common.view.Result; import com.cowr.local.ssjygl.actioncmdlog.ActionCmdLogSyncService; +import com.cowr.local.ssjygl.main.CliCacheData; import com.cowr.local.ssjygl.main.Config; import com.cowr.local.ssjygl.order.LocalOrderService; import com.cowr.local.ssjygl.order.orderseq.OrderSeqService; @@ -225,6 +226,13 @@ public class OrderTempSyncService { Sysuser sysuser, int req_receipt ) { + OrderTemp order = new OrderTemp(); + + order.setUuid(uuid); + + if (order.checkDuplicate("uuid")) { + return Result.failed("【%s】已经存在", uuid); + } Transport transport = Transport.dao.findById(transport_id); if (transport == null) { @@ -235,52 +243,7 @@ public class OrderTempSyncService { return Result.failed("进出场记录已完结或者已作废,不能使用"); } - InvoiceReceive receive = InvoiceReceiveService.me.checkReceive(transport.getSupermarketId(), invoice_number, invoice_code); - if (receive == null) { - return Result.failed("没有有效的发票领用记录,或者发票已经被使用"); - } - - Ordercluster ordercluster = Ordercluster.dao.findById(ordercluster_id); - if (ordercluster == null) { - return Result.failedstr("集团订单【%s】信息不存在", ordercluster_id); - } - - if (!DateTimeUtil.isToday(ordercluster.getCutoffTime())) { - return Result.failedstr("集团订单只能在%s使用", DateTimeUtil.sdfymd.get().format(ordercluster.getCutoffTime())); - } - - if (ordercluster.getState() == OrderStateEnum.INVALID.getStateid()) { - return Result.failedstr("集团订单【%s】已完结,请重新下单", ordercluster_id); - } - - BigDecimal up = SupermarketProductService.me.getUnitPrice(transport.getSupermarketId(), ordercluster.getProductId()); - - if (up == null) { - return Result.failedstr("未查到有效的单价信息"); - } - - OrderclusterTruck ot = OrderclusterTruck.dao.findFirst("select * from ordercluster_truck t \n" + - " where t.truck_license = ? \n" + - " and t.ordercluster_id = ? ", - transport.getTruckLicense(), - ordercluster_id - ); - - if (ot == null) { - return Result.failedstr("【%s】不是今日分配车辆", transport.getTruckLicense()); - } - - BigDecimal min = new BigDecimal(0.001); - Date now = new Date(); - SyncTask synctask = new SyncTask(); - OrderTemp order = new OrderTemp(); - - order.setUuid(uuid); - - if (order.checkDuplicate("uuid")) { - return Result.failed("【%s】已经存在", uuid); - } - + BigDecimal min = new BigDecimal(0.0); // 验证重量 if (transport.getFirstWeight() == null || transport.getSecondWeight() == null @@ -296,12 +259,51 @@ public class OrderTempSyncService { } BigDecimal net_weight = transport.getSecondWeight().subtract(transport.getFirstWeight()); // 销售的用第二次减第一次 + + OrderclusterTruck ot = OrderclusterTruck.dao.findFirst("select * from ordercluster_truck t \n" + + " where t.truck_license = ? \n" + + " and t.ordercluster_id = ? ", + transport.getTruckLicense(), + ordercluster_id + ); + + if (ot == null) { + return Result.failedstr("【%s】不是今日分配车辆", transport.getTruckLicense()); + } + + Ordercluster ordercluster = Ordercluster.dao.findById(ordercluster_id); + if (ordercluster == null) { + return Result.failedstr("集团订单【%s】信息不存在", ordercluster_id); + } + + if (!DateTimeUtil.isToday(ordercluster.getCutoffTime())) { + return Result.failedstr("集团订单只能在%s使用", DateTimeUtil.sdfymd.get().format(ordercluster.getCutoffTime())); + } + + if (ordercluster.getState() == OrderStateEnum.INVALID.getStateid()) { + return Result.failedstr("集团订单【%s】已完结,请重新下单", ordercluster_id); + } + BigDecimal overweight = OrderclusterService.me.getOverWeight(ordercluster_id); // 集团订单已完成量 // 不能超过集团订单剩余量 if (net_weight.compareTo(ordercluster.getTotalWeight().subtract(overweight)) > 0) { return Result.failedstr("净重 %.2f 吨,超过了剩余的 %.2f 余量", net_weight, ordercluster.getTotalWeight().subtract(overweight)); } + InvoiceReceive receive = InvoiceReceiveService.me.checkReceive(transport.getSupermarketId(), invoice_number, invoice_code); + if (receive == null) { + return Result.failed("没有有效的发票领用记录,或者发票已经被使用"); + } + + BigDecimal up = SupermarketProductService.me.getUnitPrice(transport.getSupermarketId(), ordercluster.getProductId()); + + if (up == null) { + return Result.failedstr("未查到有效的单价信息"); + } + + Date now = new Date(); + SyncTask synctask = new SyncTask(); + // if (req_receipt == 1) { // 需要同时开具发票 order.setInvoiceCode(invoice_code); order.setInvoiceNumber(invoice_number); @@ -335,6 +337,7 @@ public class OrderTempSyncService { order.setCustomerTexpayerName(customer.getTexpayerName()); order.setCustomerTexpayerNum(customer.getTexpayerNum()); } else { + // 可能是零散购砂客户,没有对应的客户信息记录,但是有客户名称之类的信息 order.setCustomerId(ordercluster.getCustomerId()); order.setCustomerAddress(ordercluster.getCustomerAddress()); order.setCustomerBankAccount(ordercluster.getCustomerBankAccount()); @@ -345,7 +348,6 @@ public class OrderTempSyncService { order.setCustomerTexpayerNum(ordercluster.getCustomerTexpayerNum()); } - // 物流公司信息 order.setTransCoId(ordercluster.getTransCoId()); order.setTransCoAddress(ordercluster.getTransCoAddress()); @@ -496,34 +498,6 @@ public class OrderTempSyncService { return Result.failed("进出场记录已完结或者已作废,不能使用"); } - InvoiceReceive receive = InvoiceReceiveService.me.checkReceive(transport.getSupermarketId(), invoice_number, invoice_code); - if (receive == null) { - return Result.failed("没有有效的发票领用记录,或者发票已经被使用"); - } - - OrderclusterTruck ot = OrderclusterTruck.dao.findFirst("select * from ordercluster_truck t \n" + - " where t.truck_license = ? \n" + - " and t.ordercluster_id = ? ", - transport.getTruckLicense(), - ordercluster_id - ); - - if (ot == null) { - return Result.failedstr("【%s】不是今日预付费车辆", transport.getTruckLicense()); - } - - Customer customer; - Product product; - Ordercluster ordercluster = Ordercluster.dao.findById(ordercluster_id); - - if (ordercluster == null) { - return Result.failedstr("集团订单【%s】信息不存在", ordercluster_id); - } - - if (ordercluster.getState() == OrderStateEnum.INVALID.getStateid()) { - return Result.failedstr("集团订单【%s】已完结,请重新下单", ordercluster_id); - } - // 验证重量 if (transport.getFirstWeight() == null || transport.getSecondWeight() == null @@ -540,12 +514,87 @@ public class OrderTempSyncService { BigDecimal net_weight = transport.getSecondWeight().subtract(transport.getFirstWeight()); // 销售的用第二次减第一次 + OrderclusterTruck ot = OrderclusterTruck.dao.findFirst("select * from ordercluster_truck t \n" + + " where t.truck_license = ? \n" + + " and t.ordercluster_id = ? ", + transport.getTruckLicense(), + ordercluster_id + ); + + if (ot == null) { + return Result.failedstr("【%s】不是今日预付费车辆", transport.getTruckLicense()); + } + + Ordercluster ordercluster = Ordercluster.dao.findById(ordercluster_id); + + if (ordercluster == null) { + return Result.failedstr("集团订单【%s】信息不存在", ordercluster_id); + } + + if (ordercluster.getState() == OrderStateEnum.INVALID.getStateid()) { + return Result.failedstr("集团订单【%s】已完结,请重新下单", ordercluster_id); + } + if (!DateTimeUtil.isToday(ordercluster.getCutoffTime())) { return Result.failedstr("集团订单只能在%s使用", DateTimeUtil.sdfymd.get().format(ordercluster.getCutoffTime())); } - customer = Customer.dao.findById(ordercluster.getCustomerId()); - product = Product.dao.findById(ordercluster.getProductId()); + if (ordercluster.getSupermarketId() != CliCacheData.SUP.getId()) { + return Result.failedstr("配额指定砂站(%s)和当前砂站不匹配(%s)", ordercluster.getSupermarketId(), CliCacheData.SUP.getId()); + } + + BigDecimal overweight = OrderclusterService.me.getOverWeight(ordercluster_id); // 集团订单已完成量 + // 不能超过集团订单剩余量 + if (net_weight.compareTo(ordercluster.getTotalWeight().subtract(overweight)) > 0) { + return Result.failedstr("净重 %.2f 吨,超过了剩余的 %.2f 余量", net_weight, ordercluster.getTotalWeight().subtract(overweight)); + } + + Customer customer = Customer.dao.findById(ordercluster.getCustomerId()); + + if (customer == null) { + return Result.failedstr("未找到有效的客户信息"); + } + + if (customer.getType() != 1) { + return Result.failed("不是预付费客户"); + } + + PrepayCustomer prepayCustomer = PrepayCustomerService.me.getPrepayCustomer(customer.getId()); + + if (prepayCustomer == null) { + return Result.failed("没有找到客户预付费信息"); + } + + if (prepayCustomer.getSurplus() == null || prepayCustomer.getSurplus().compareTo(min) == 0) { + return Result.failed("客户余额不足"); + } + + InvoiceReceive receive = null; + + // 2020-09-29 需要开具专票的,先开具结算单,不打发票 + if (CliCacheData.SUP.getInvoiceType() == 2 && customer.getInvoiceType() == 2) { + order.setInvoiceType(2); + // 需要专票的,在结算开了专票之后,再修改 invoice_site 字段 + } else { + receive = InvoiceReceiveService.me.checkReceive(transport.getSupermarketId(), invoice_number, invoice_code); + if (receive == null) { + return Result.failed("没有有效的发票领用记录,或者发票已经被使用"); + } + + // 不满足开专票的条件的,就必须开具冠名发票 +// if (req_receipt == 1) { // 需要同时开具发票 + order.setInvoiceCode(invoice_code); + order.setInvoiceNumber(invoice_number); + order.setInvoiceType(1); + order.setInvoiceSite(1); // 在砂站开具冠名发票 +// } + } + + Product product = Product.dao.findById(ordercluster.getProductId()); + + if (product == null) { + return Result.failedstr("未找到有效的品类信息"); + } // 物流公司信息 order.setTransCoId(ordercluster.getTransCoId()); @@ -566,42 +615,15 @@ public class OrderTempSyncService { transport.setTransCoTexpayerName(ordercluster.getTransCoTexpayerName()); transport.setTransCoTexpayerNum(ordercluster.getTransCoTexpayerNum()); - if (product == null) { - return Result.failedstr("未找到有效的品类信息"); - } - - if (customer == null) { - return Result.failedstr("未找到有效的客户信息"); - } - - if (customer.getType() != 1) { - return Result.failed("不是预付费客户"); - } - BigDecimal up = SupermarketProductService.me.getUnitPrice(transport.getSupermarketId(), product.getId()); if (up == null) { return Result.failedstr("未查到有效的单价信息"); } - PrepayCustomer prepayCustomer = PrepayCustomerService.me.getPrepayCustomer(customer.getId()); - - if (prepayCustomer == null) { - return Result.failed("没有找到客户预付费信息"); - } - - if (prepayCustomer.getSurplus() == null || prepayCustomer.getSurplus().compareTo(min) == 0) { - return Result.failed("客户余额不足"); - } - Date now = new Date(); SyncTask synctask = new SyncTask(); -// if (req_receipt == 1) { // 需要同时开具发票 - order.setInvoiceCode(invoice_code); - order.setInvoiceNumber(invoice_number); -// } - order.setTransportId(transport.getId()); order.setSupermarketId(transport.getSupermarketId()); order.setTruckLicense(transport.getTruckLicense()); @@ -646,6 +668,7 @@ public class OrderTempSyncService { return Result.failedstr("总价 %.2f,客户余额(%.2f)不足以支付"); } + InvoiceReceive finalReceive = receive; boolean ret = Db.tx(new IAtom() { @Override public boolean run() { @@ -704,38 +727,40 @@ public class OrderTempSyncService { return false; } + if (finalReceive != null) { // if (req_receipt == 1) { // 需要同时开具发票 - // 这里的 finalReceive 在前面肯定验证过了 - receive.setSurplus(receive.getSurplus() - 1); - receive.setCurrentCode(invoice_code); + // 这里的 finalReceive 在前面肯定验证过了 + finalReceive.setSurplus(finalReceive.getSurplus() - 1); + finalReceive.setCurrentCode(invoice_code); - ret = receive.update(); + ret = finalReceive.update(); - if (!ret) { - log.error("发票领用信息更新失败", invoice_code); - return false; + if (!ret) { + log.error("发票领用信息更新失败", invoice_code); + return false; + } + + InvoiceLog invoiceLog = new InvoiceLog(); + invoiceLog.setId(StrKit.getRandomUUID()); + invoiceLog.setInvoiceReceiveId(finalReceive.getId()); + invoiceLog.setCode(invoice_code); + invoiceLog.setInvoiceNumber(invoice_number); + invoiceLog.setState(OrderStateEnum.RECEIVED.getStateid()); + invoiceLog.setSettlementTime(now); + invoiceLog.setSettlementUserId(order.getSettlementUserId()); + invoiceLog.setSettlementUserName(order.getSettlementUserName()); + invoiceLog.setOrderSn(order.getSn()); + invoiceLog.setType(OrderTypeEnum.TEMP.getTypeid()); + + ret = invoiceLog.save(); + + if (!ret) { + return false; + } + + synctask.addSaveData(invoiceLog); + synctask.addUpdateData(finalReceive); } - - InvoiceLog invoiceLog = new InvoiceLog(); - invoiceLog.setId(StrKit.getRandomUUID()); - invoiceLog.setInvoiceReceiveId(receive.getId()); - invoiceLog.setCode(invoice_code); - invoiceLog.setInvoiceNumber(invoice_number); - invoiceLog.setState(OrderStateEnum.RECEIVED.getStateid()); - invoiceLog.setSettlementTime(now); - invoiceLog.setSettlementUserId(order.getSettlementUserId()); - invoiceLog.setSettlementUserName(order.getSettlementUserName()); - invoiceLog.setOrderSn(order.getSn()); - invoiceLog.setType(OrderTypeEnum.TEMP.getTypeid()); - - ret = invoiceLog.save(); - - if (!ret) { - return false; - } - - synctask.addSaveData(invoiceLog); - synctask.addUpdateData(receive); // } // 在这里更新sn字段之后存入 diff --git a/ssjygl-xsx-local/src/main/resources/tpl_bill_full.xlsx b/ssjygl-xsx-local/src/main/resources/tpl_bill_full.xlsx index e21ba1d..6113ca5 100644 Binary files a/ssjygl-xsx-local/src/main/resources/tpl_bill_full.xlsx and b/ssjygl-xsx-local/src/main/resources/tpl_bill_full.xlsx differ diff --git a/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/customer/register/CustomerRegisterVerifyValidator.java b/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/customer/register/CustomerRegisterVerifyValidator.java index 1732a5c..25f08d4 100644 --- a/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/customer/register/CustomerRegisterVerifyValidator.java +++ b/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/customer/register/CustomerRegisterVerifyValidator.java @@ -24,7 +24,7 @@ public class CustomerRegisterVerifyValidator extends CrudParamValidator { validateRequired("id", "id", "id 必填"); validateLong("id", 1, 9223372036854775807L, "id", "id 范围 1~9223372036854775807L"); validateInIntegerArray("state", chkstate, "state", "state 可选值 5、9"); - validateString("verify_memo", 0, 255, "memo", "verify_memo 长度 0~255"); + validateString("verify_memo", 0, 255, "verify_memo", "verify_memo 长度 0~255"); } protected void handleError(Controller c) { diff --git a/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/invoice/log/BatchSaveValidator.java b/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/invoice/log/BatchSaveValidator.java new file mode 100644 index 0000000..8ba6f24 --- /dev/null +++ b/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/invoice/log/BatchSaveValidator.java @@ -0,0 +1,18 @@ +package com.cowr.service.ssjygl.invoice.log; + +import com.cowr.common.validator.CrudParamValidator; +import com.cowr.common.view.Result; +import com.jfinal.core.Controller; + +public class BatchSaveValidator extends CrudParamValidator { + @Override + protected void validate(Controller c) { + validateRequired("invoice_number", "invoice_number", "invoice_number 必填"); + validateRequired("invoice_code", "invoice_code", "invoice_code 必填"); + validateRequired("order_sns", "order_sns", "order_sns 必填"); + } + + protected void handleError(Controller c) { + c.renderJson(Result.failed(getErrmsg())); + } +} diff --git a/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/invoice/log/InvoiceLogController.java b/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/invoice/log/InvoiceLogController.java index 4e0f4ee..e86e48e 100644 --- a/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/invoice/log/InvoiceLogController.java +++ b/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/invoice/log/InvoiceLogController.java @@ -118,4 +118,23 @@ public class InvoiceLogController extends Controller { renderJson(InvoiceLogSyncService.me.cancelByCode(invoice_number, code, invalid_memo, tokenuser)); } + + @Before(BatchSaveValidator.class) + public void batchSave() { + Sysuser tokenuser = SysuserSyncService.me.getSysuserByToken(get("token")); + + if (tokenuser == null) { + renderJson(Result.noauth()); + return; + } else if (!SysuserSyncService.me.isTreasurer(tokenuser.getRole())) { // 财务才能录入专票 + renderJson(Result.permissionDenied()); + return; + } + + String invoice_number = get("invoice_number"); + String invoice_code = get("invoice_code"); + String order_sns = get("order_sns"); + + renderJson(InvoiceLogSyncService.me.batchSave(invoice_number, invoice_code, order_sns, tokenuser)); + } } diff --git a/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/invoice/log/InvoiceLogSyncService.java b/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/invoice/log/InvoiceLogSyncService.java index 9f81b5a..0d3fd7c 100644 --- a/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/invoice/log/InvoiceLogSyncService.java +++ b/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/invoice/log/InvoiceLogSyncService.java @@ -3,6 +3,7 @@ package com.cowr.service.ssjygl.invoice.log; import com.cowr.common.base.BaseModel; import com.cowr.common.enums.Enums; import com.cowr.common.enums.OrderStateEnum; +import com.cowr.common.enums.OrderTypeEnum; import com.cowr.common.view.Result; import com.cowr.model.*; import com.cowr.service.ssjygl.base.BaseSyncService; @@ -16,12 +17,105 @@ import com.jfinal.plugin.activerecord.Db; import com.jfinal.plugin.activerecord.IAtom; import java.sql.SQLException; +import java.util.ArrayList; import java.util.Date; +import java.util.List; public class InvoiceLogSyncService extends BaseSyncService { private static Log log = Log.getLog(InvoiceLogSyncService.class); public static InvoiceLogSyncService me = new InvoiceLogSyncService(); + /** + * 添加专票 + * @param invoice_number + * @param invoice_code + * @param order_sns + * @param sysuser + * @return + */ + public Result batchSave(String invoice_number, String invoice_code, String order_sns, Sysuser sysuser){ + String[] snarr = order_sns.split(","); + List question = new ArrayList<>(); + List ordersnlist = new ArrayList<>(); + + if(StrKit.isBlank(order_sns) || snarr.length == 0){ + return Result.failed("订单号不能为空"); + } + + for(String sn : snarr){ + question.add("?"); + ordersnlist.add(sn); + } + + List list = OrderTemp.dao.find("select * from order_temp t \n" + + " where t.invoice_code is null \n" + + " and t.sn in(" + StrKit.join(question, ", ") + ")", ordersnlist.toArray()); + + if(list.size() != snarr.length){ + return Result.failed("部分订单号未找到,或者已开票"); + } + + List logs = new ArrayList<>(); + SyncTask synctask = new SyncTask(); + + for(OrderTemp o : list){ + InvoiceLog invoiceLog = new InvoiceLog(); + invoiceLog.setId(StrKit.getRandomUUID()); + invoiceLog.setSettlementUserId(sysuser.getId()); + invoiceLog.setSettlementUserName(sysuser.getName()); + invoiceLog.setSettlementTime(new Date()); + invoiceLog.setState(OrderStateEnum.RECEIVED.getStateid()); + invoiceLog.setCode(invoice_code); + invoiceLog.setInvoiceNumber(invoice_number); + invoiceLog.setInvoiceType(2); + invoiceLog.setOrderSn(o.getSn()); + invoiceLog.setType(OrderTypeEnum.TEMP.getTypeid()); + + logs.add(invoiceLog); + + synctask.addSaveData(invoiceLog); + + o.setInvoiceSite(2); + o.setInvoiceType(2); + o.setInvoiceNumber(invoice_number); + o.setInvoiceCode(invoice_code); + + synctask.addUpdateData(o); + } + + boolean ret = Db.tx(new IAtom() { + @Override + public boolean run() { + try{ + int[] saveret = Db.batchSave(logs, logs.size()); + + for (int i : saveret) { + // 必须是每条 sql 修改一条记录 + if (i != 1) { + return false; + } + } + + int[] editret = Db.batchUpdate(list, list.size()); + + for (int i : editret) { + // 必须是每条 sql 修改一条记录 + if (i != 1) { + return false; + } + } + + return SyncTaskService.me.save(synctask); + }catch (Exception e){ + log.error(e.getMessage(), e); + return false; + } + } + }); + + return ret ? Result.success() : Result.failed("保存失败"); + } + /** * 作废发票,未关联订单的(损毁等,不是正常开票使用的发票) * @return @@ -90,7 +184,7 @@ public class InvoiceLogSyncService extends BaseSyncService { synctask.addUpdateData(receive); - return SyncTaskService.me.save(synctask) + return SyncTaskService.me.save(synctask, supermarket_id) && ModifyLogService.me.save(finalInvoiceLog, null, Enums.DataOpType.SAVE.getId(), sysuser); } catch (Exception e) { log.error(e.getMessage(), e); @@ -153,6 +247,8 @@ public class InvoiceLogSyncService extends BaseSyncService { try{ order.set("invoice_code", null); order.set("invoice_number", null); + order.set("invoice_type", null); + order.set("invoice_site", null); boolean ret = order.update(); if(!ret){ @@ -170,7 +266,7 @@ public class InvoiceLogSyncService extends BaseSyncService { synctask.addUpdateData(invoiceLog); - return SyncTaskService.me.save(synctask) && ModifyLogService.me.save(invoiceLog, old, Enums.DataOpType.UPDATE.getId(), sysuser); + return SyncTaskService.me.save(synctask, order.getInt("supermarket_id")) && ModifyLogService.me.save(invoiceLog, old, Enums.DataOpType.UPDATE.getId(), sysuser); }catch (Exception e){ log.error(e.getMessage(), e); } diff --git a/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/netty/NettyServer.java b/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/netty/NettyServer.java index 6c03d8d..8d02477 100644 --- a/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/netty/NettyServer.java +++ b/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/netty/NettyServer.java @@ -64,7 +64,7 @@ public class NettyServer { public void start() { log.debug("启动 socket 服务"); - bossGroup = new NioEventLoopGroup(); + bossGroup = new NioEventLoopGroup(); workerGroup = new NioEventLoopGroup(); try { serverBootstrap = new ServerBootstrap(); @@ -149,8 +149,8 @@ public class NettyServer { sendMsg(ctx, deny().toJSONString()); } - JSONObject json = JSONObject.parseObject(msg); - String target = json.getString("target"); + JSONObject json = JSONObject.parseObject(msg); + String target = json.getString("target"); if (Enums.MsgTarget.LOGIN.name().equals(target)) { int supermarket_id = json.getIntValue("supermarket_id"); @@ -183,7 +183,7 @@ public class NettyServer { .toJSONString() ); - log.debug("supermarket_id " + supermarket_id + " 注册成功"); + log.debug("supermarket_id %s 注册成功, client version %s", supermarket_id, json.get("clinet_version")); } else if (Enums.MsgTarget.HEARTBEAT.name().equals(target)) { printlog("收到心跳 supermarket " + map.get(ctx.channel()) + ", 已连接客户端总数: " + map.size()); } else if (Enums.MsgTarget.SYNCTASK.name().equals(target)) { @@ -251,7 +251,7 @@ public class NettyServer { } return obj.containsKey("target"); - }catch (Exception e){ + } catch (Exception e) { return false; } } diff --git a/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/order/ordertemp/OrderTempController.java b/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/order/ordertemp/OrderTempController.java index 9003d65..4ec06e5 100644 --- a/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/order/ordertemp/OrderTempController.java +++ b/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/order/ordertemp/OrderTempController.java @@ -28,18 +28,20 @@ public class OrderTempController extends BaseController { * 分页查找 order_sale 订单 */ public void find() { - PageParam pp = getBean(PageParam.class, "", true); - String stm = get("stm"); - String etm = get("etm"); - String truck_license = getUpperCaseVal("truck_license"); - String customer_name = get("customer_name"); - String sn = get("sn"); - Integer state = getInt("state"); - String invoice_code = get("invoice_code"); - Integer product_id = getInt("product_id"); - Integer supermarket_id = getInt("supermarket_id"); - Integer isprepaid = getInt("isprepaid"); - Integer customer_id = getInt("customer_id"); + PageParam pp = getBean(PageParam.class, "", true); + String stm = get("stm"); + String etm = get("etm"); + String truck_license = getUpperCaseVal("truck_license"); + String customer_name = get("customer_name"); + String sn = get("sn"); + Integer state = getInt("state"); + String invoice_code = get("invoice_code"); + Integer product_id = getInt("product_id"); + Integer invoice_type = getInt("invoice_type"); + Integer supermarket_id = getInt("supermarket_id"); + Integer isprepaid = getInt("isprepaid"); + Integer customer_id = getInt("customer_id"); + Boolean invoice_code_is_null = getBoolean("invoice_code_is_null"); Sysuser tokenuser = SysuserSyncService.me.getSysuserByToken(get("token")); @@ -51,6 +53,6 @@ public class OrderTempController extends BaseController { customer_id = tokenuser.getEntityId(); } - renderJson(Result.object(OrderTempService.me.find(pp, sn, truck_license, supermarket_id, customer_id, customer_name, stm, etm, isprepaid, state, invoice_code, product_id))); + renderJson(Result.object(OrderTempService.me.find(pp, sn, truck_license, supermarket_id, customer_id, customer_name, stm, etm, isprepaid, state, invoice_code, invoice_type, product_id, invoice_code_is_null))); } }