| | |
| | | apply plugin: 'com.android.application' |
| | | apply plugin: 'org.greenrobot.greendao' |
| | | greendao { |
| | | schemaVersion 8//数据库版本号 |
| | | schemaVersion 9//数据库版本号 |
| | | daoPackage 'com.lotaai.canguiayw.sqllitedb'// 设置DaoMaster、DaoSession、Dao 包名 |
| | | targetGenDir 'src/main/java'//设置DaoMaster、DaoSession、Dao目录,请注意,这里路径用/不要用. |
| | | generateTests false //设置为true以自动生成单元测试。 |
| | |
| | | import android.graphics.Paint; |
| | | import android.graphics.Rect; |
| | | import android.os.Bundle; |
| | | import android.os.Message; |
| | | import android.text.Editable; |
| | | import android.text.InputType; |
| | | import android.view.LayoutInflater; |
| | |
| | | |
| | | import androidx.fragment.app.Fragment; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.bin.david.form.core.SmartTable; |
| | | import com.bin.david.form.core.TableConfig; |
| | | import com.bin.david.form.data.CellInfo; |
| | |
| | | import com.bin.david.form.data.format.draw.IDrawFormat; |
| | | import com.bin.david.form.data.style.FontStyle; |
| | | import com.bin.david.form.data.table.TableData; |
| | | import com.blankj.utilcode.util.CacheDiskUtils; |
| | | import com.blankj.utilcode.util.DeviceUtils; |
| | | import com.blankj.utilcode.util.LogUtils; |
| | | import com.blankj.utilcode.util.ScreenUtils; |
| | | import com.blankj.utilcode.util.TimeUtils; |
| | | import com.lotaai.canguiayw.common.HttpLoggerInterceptor; |
| | | import com.lotaai.canguiayw.common.HttpUrlDefine; |
| | | import com.lotaai.canguiayw.common.SettingConfig; |
| | | import com.lotaai.canguiayw.device.CanguiStatus; |
| | | import com.lotaai.canguiayw.device.service.CrontrolGridModel; |
| | | import com.lotaai.canguiayw.sqllitedb.GridModel; |
| | |
| | | |
| | | import org.w3c.dom.Text; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | import okhttp3.Call; |
| | | import okhttp3.Callback; |
| | | import okhttp3.FormBody; |
| | | import okhttp3.OkHttpClient; |
| | | import okhttp3.Request; |
| | | import okhttp3.RequestBody; |
| | | import okhttp3.Response; |
| | | |
| | | public class CunCanFragment extends Fragment { |
| | | |
| | |
| | | } |
| | | initOrderDetailTableView(od.getOrderNo()); |
| | | }else { |
| | | DynamicToast.makeError(context, "取餐序号输入错误,请重试。", 3).show(); |
| | | DynamicToast.makeError(context, "取餐序号不存在,请重试。", 3).show(); |
| | | initOrderDetailTableView(""); |
| | | } |
| | | //2、分配格子 |
| | | |
| | | |
| | | } else { |
| | | Button button = (Button) v; |
| | | editable.insert(index, button.getText()); |
| | |
| | | if (details!=null && details.size()>0){ |
| | | //查找空余的格子进行分配 |
| | | GridModel model = SqlliteDbManage.getInstance().selectFreeGrid(); |
| | | gekouTxt.setText(CrontrolGridModel.getGridNoStr(model.getGuiHao(),model.getGridNo())); |
| | | String gStr = CrontrolGridModel.getGridNoStr(model.getGuiHao(),model.getGridNo()); |
| | | gekouTxt.setText(gStr); |
| | | orderNotxt.setText(orderNo); |
| | | model.setState(1); |
| | | SqlliteDbManage.getInstance().addGrid(model); |
| | | //需要把order数据更新了 |
| | |
| | | od.setGridNo(CrontrolGridModel.getGridNoStr(model.getGuiHao(),model.getGridNo())); |
| | | od.setPutInDate(TimeUtils.getNowString()); |
| | | od.setState(1); |
| | | od.setGridNo(gStr); |
| | | SqlliteDbManage.getInstance().insertOrderInfo(od); |
| | | orderNotxt.setText(orderNo); |
| | | //需要将存餐信息同步到服务端 |
| | | cuncan(gStr,od.getOrderId()); |
| | | |
| | | }else { |
| | | DynamicToast.makeError(context, "未查询到订单", 3).show(); |
| | | } |
| | |
| | | orderDetailTable.setTableData(tableData); |
| | | |
| | | } |
| | | |
| | | |
| | | public void cuncan(String gridNo,String orderId) { |
| | | HttpLoggerInterceptor loggingInterceptor = new HttpLoggerInterceptor(true); |
| | | OkHttpClient client = new OkHttpClient.Builder() |
| | | .connectTimeout(20, TimeUnit.SECONDS)//响应时间,读取时间 |
| | | .readTimeout(20, TimeUnit.SECONDS) |
| | | .callTimeout(20, TimeUnit.SECONDS) |
| | | .addInterceptor(loggingInterceptor)//添加日志拦截器 |
| | | .build(); |
| | | |
| | | RequestBody body = new FormBody.Builder() |
| | | .add("equipmentUid", DeviceUtils.getUniqueDeviceId()) |
| | | .add("gridNo", gridNo) |
| | | .add("orderId", orderId).build(); |
| | | final Request request = new Request.Builder() |
| | | .url(HttpUrlDefine.equipmentCunCan) |
| | | .addHeader("language", "zh-CN") |
| | | .post(body) |
| | | .build(); |
| | | client.newCall(request).enqueue(new Callback() { |
| | | @Override |
| | | public void onFailure(Call call, IOException e) { |
| | | DynamicToast.makeError(context, "存餐同步失败!", 3).show(); |
| | | } |
| | | |
| | | @Override |
| | | public void onResponse(Call call, Response response) throws IOException { |
| | | String result = response.body().string(); |
| | | LogUtils.i("获取到的数据:"+result); |
| | | JSONObject obj = JSONObject.parseObject(result); |
| | | if ("0".equals(obj.getString("code"))) { |
| | | |
| | | } else { |
| | | String string = obj.getString("msg"); |
| | | DynamicToast.makeError(context, "存餐同步失败:" + string, 3).show(); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | } |
| | |
| | | import android.content.Intent; |
| | | import android.os.Build; |
| | | import android.os.Bundle; |
| | | import android.os.Handler; |
| | | import android.os.Message; |
| | | import android.text.Editable; |
| | | import android.text.InputType; |
| | | import android.view.View; |
| | |
| | | import android.widget.Toast; |
| | | import androidx.appcompat.app.AppCompatActivity; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.blankj.utilcode.util.CacheDiskUtils; |
| | | import com.blankj.utilcode.util.DeviceUtils; |
| | | import com.blankj.utilcode.util.LogUtils; |
| | | import com.lotaai.canguiayw.common.HttpLoggerInterceptor; |
| | | import com.lotaai.canguiayw.common.HttpUrlDefine; |
| | | import com.lotaai.canguiayw.common.SettingConfig; |
| | | import com.lotaai.canguiayw.device.CanGuiCommand; |
| | | import com.lotaai.canguiayw.device.DeviceMessage; |
| | | import com.lotaai.canguiayw.device.DeviceType; |
| | | import com.lotaai.canguiayw.device.MessageType; |
| | | import com.lotaai.canguiayw.mqtt.DeviceAction; |
| | | import com.lotaai.canguiayw.sqllitedb.Order; |
| | | import com.lotaai.canguiayw.sqllitedb.SqlliteDbManage; |
| | | import com.pranavpandey.android.dynamic.toasts.DynamicToast; |
| | | |
| | | import org.greenrobot.eventbus.EventBus; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.logging.Logger; |
| | | |
| | | import okhttp3.Call; |
| | | import okhttp3.Callback; |
| | | import okhttp3.FormBody; |
| | | import okhttp3.OkHttpClient; |
| | | import okhttp3.Request; |
| | | import okhttp3.RequestBody; |
| | | import okhttp3.Response; |
| | | |
| | | public class TakeActivity extends AppCompatActivity { |
| | | private Context context; |
| | |
| | | context = TakeActivity.this; |
| | | editText = (EditText)findViewById(R.id.edt_borrow_case_number); |
| | | editText.setInputType(InputType.TYPE_NULL); // 屏蔽软键盘 |
| | | DynamicToast.Config.getInstance().setTextSize(30).apply(); |
| | | // 软键盘设置统一按钮监听方法,数字键直接将text内容填充到edittext中,删除和确认才设置事件 |
| | | View.OnClickListener clickListener = new View.OnClickListener() { |
| | | @Override |
| | |
| | | return; |
| | | } |
| | | //调用判断是否可以取餐 |
| | | takeCheckCode(""); |
| | | takeCheckCode(gridNo); |
| | | } |
| | | } else { |
| | | Button button = (Button) v; |
| | |
| | | finish(); |
| | | } |
| | | |
| | | public void takeCheckCode(String code){ |
| | | Order order = SqlliteDbManage.getInstance().selectOrtderByTakeCode(code); |
| | | if (order == null || order.getGridNo() == ""){ |
| | | //代表取餐码错误 |
| | | public void takeCheckCode(String code) { |
| | | HttpLoggerInterceptor loggingInterceptor = new HttpLoggerInterceptor(true); |
| | | OkHttpClient client = new OkHttpClient.Builder() |
| | | .connectTimeout(20, TimeUnit.SECONDS)//响应时间,读取时间 |
| | | .readTimeout(20, TimeUnit.SECONDS) |
| | | .callTimeout(20, TimeUnit.SECONDS) |
| | | .addInterceptor(loggingInterceptor)//添加日志拦截器 |
| | | .build(); |
| | | |
| | | }else { |
| | | //开门取餐,并弹出取餐号 |
| | | LogUtils.i(CacheDiskUtils.getInstance().getString(SettingConfig.getInstance().Cache_Device_Code),code); |
| | | RequestBody body = new FormBody.Builder() |
| | | .add("equipmentCode", CacheDiskUtils.getInstance().getString(SettingConfig.getInstance().Cache_Device_Code)) |
| | | .add("takeCode", code).build(); |
| | | final Request request = new Request.Builder() |
| | | .url(HttpUrlDefine.equipmentTakeOut) |
| | | .addHeader("language", "zh-CN") |
| | | .post(body) |
| | | .build(); |
| | | client.newCall(request).enqueue(new Callback() { |
| | | @Override |
| | | public void onFailure(Call call, IOException e) { |
| | | DynamicToast.makeError(context, "取餐失败!", 3).show(); |
| | | } |
| | | |
| | | } |
| | | @Override |
| | | public void onResponse(Call call, Response response) throws IOException { |
| | | String result = response.body().string(); |
| | | LogUtils.i("获取到的数据:"+result); |
| | | JSONObject obj = JSONObject.parseObject(result); |
| | | if ("0".equals(obj.getString("code"))) { |
| | | String g = obj.getString("data"); |
| | | //发送mqtt 进行开门 |
| | | JSONObject json = new JSONObject(); |
| | | json.put("action", DeviceAction.CONTROLDEVICE.name()); |
| | | json.put(DeviceAction.doorIsOpen.name(), "1"); |
| | | json.put(DeviceAction.xiaoDuIsOpen.name(), "0"); |
| | | json.put(DeviceAction.jiareIsOpen.name(), "0"); |
| | | json.put(DeviceAction.dengGuangIsOpen.name(), "0"); |
| | | json.put("gridNo", g); |
| | | DeviceMessage deviceMessage = new DeviceMessage(); |
| | | deviceMessage.setMessageType(MessageType.MQTT.ordinal()); |
| | | deviceMessage.setMsgString(json.toJSONString()); |
| | | EventBus.getDefault().post(deviceMessage); |
| | | } else { |
| | | String string = obj.getString("msg"); |
| | | Message msg = new Message(); |
| | | msg.what = 0; |
| | | msg.obj = "取餐失败:" + string; |
| | | showHandler.sendMessage(msg); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | private Handler showHandler = new Handler() { |
| | | @Override |
| | | public void handleMessage(Message msg) { |
| | | if (msg.what == 0) { |
| | | DynamicToast.makeError(context, msg.obj.toString(), 3).show(); |
| | | } else if (msg.what == 1) { |
| | | DynamicToast.makeSuccess(context, msg.obj.toString(), 3).show(); |
| | | } else { |
| | | DynamicToast.makeWarning(context, msg.obj.toString(), 3).show(); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | } |
| | |
| | | private static String rootHost = "http://test.lotaai.com/"; |
| | | public static String equipmentBind = rootHost + "/lotaai-api/api/eq/equipmentBind"; |
| | | public static String equipmentLogin = rootHost + "/lotaai-api/api/eq/equipmentLogin"; |
| | | public static String equipmentCunCan = rootHost + "/lotaai-api/api/eq/putInFood"; |
| | | public static String equipmentTakeOut = rootHost + "/lotaai-api/api/eq/takeFood"; |
| | | } |
| | |
| | | |
| | | @Subscribe(threadMode = ThreadMode.ASYNC) |
| | | public void recvCommand(DeviceMessage mssage){ |
| | | LogUtils.i("开门命令接收"); |
| | | try { |
| | | if (mssage.getMessageType() == MessageType.SENDMESSAGE.ordinal()){ |
| | | if (mssage.getDeviceType() == DeviceType.CANGUI.ordinal()) { |
| | |
| | | @Override |
| | | public int onStartCommand(Intent intent, int flags, int startId) { |
| | | init(); |
| | | EventBus.getDefault().register(MyMQTTService.this); |
| | | return super.onStartCommand(intent, flags, startId); |
| | | } |
| | | |
| | | @Subscribe(threadMode = ThreadMode.ASYNC) |
| | | public static void publish(DeviceMessage message) { |
| | | public void publish(DeviceMessage message) { |
| | | //需要在这个地方区分是哪种指令 |
| | | //才能确定发送到哪个topic |
| | | LogUtils.i("接收到通知",message.getMsgString()); |
| | | if (message.getMessageType() == MessageType.MQTT.ordinal()){ |
| | | String topic = pubTopic; |
| | | String topic = subTopic_Control + CacheDiskUtils.getInstance().getString(SettingConfig.getInstance().Cache_Device_Code); |
| | | Integer qos = 2; |
| | | Boolean retained = false; |
| | | String msg = message.getMsgString(); |
| | |
| | | // 服务器地址(协议+地址+端口号) |
| | | String uri = "tcp://" + SettingConfig.getInstance().MQTT_IP+":"+SettingConfig.getInstance().MQTT_PORT;; |
| | | LogUtils.i(uri); |
| | | client = new MqttAndroidClient(this, uri, "tests233233232"); |
| | | client = new MqttAndroidClient(this, uri, CacheDiskUtils.getInstance().getString(SettingConfig.getInstance().Cache_Device_Code)); |
| | | // 设置MQTT监听并且接受消息 |
| | | client.setCallback(mqttCallback); |
| | | conOpt = new MqttConnectOptions(); |
| | |
| | | String seqnum = json.getString("seqnum"); |
| | | String orderType = json.getString("orderType"); |
| | | String bookingType = json.getString("bookingType"); |
| | | String orderId = json.getString("orderId"); |
| | | if (json.getString("startTime")!=null) { |
| | | String startTime = JsonUtils.getString(messageStr, "startTime", ""); |
| | | } |
| | | String createdTime = json.getString("createdTime"); |
| | | String tableNum = JsonUtils.getString(messageStr,"tableNum",""); |
| | | order.setOrderNo(orderno); |
| | | order.setOrderId(orderId); |
| | | order.setState(0); |
| | | order.setXuHao(seqnum); |
| | | order.setTakeCode(""); |
| | |
| | | if (dengGuangIsOpen!=null) { |
| | | crontrolGridModel.setXiaodu(Integer.parseInt(dengGuangIsOpen)); |
| | | } |
| | | |
| | | LogUtils.i("控制",crontrolGridModel.getGuiNo(),crontrolGridModel.getGridNo(),crontrolGridModel.getOpenOrNoActon()); |
| | | byte[] command = CanGuiCommand.getInstance().controlGridCommand(crontrolGridModel.getGuiNo() , |
| | | crontrolGridModel.getGridNo() , crontrolGridModel.getOpenOrNoActon(), |
| | | crontrolGridModel.getWendu(), crontrolGridModel.getXiaodu(), crontrolGridModel.getDengGuang(), |
| | |
| | | dvmessage.setMessageType(MessageType.SENDMESSAGE.ordinal()); |
| | | dvmessage.setDeviceType(DeviceType.CANGUI.ordinal()); |
| | | dvmessage.setMessageByte(command); |
| | | EventBus.getDefault().post(message); |
| | | EventBus.getDefault().post(dvmessage); |
| | | } |
| | | } |
| | | } |
| | |
| | | public IBinder onBind(Intent intent) { |
| | | return null; |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. |
| | | /** |
| | | * Master of DAO (schema version 8): knows all DAOs. |
| | | * Master of DAO (schema version 9): knows all DAOs. |
| | | */ |
| | | public class DaoMaster extends AbstractDaoMaster { |
| | | public static final int SCHEMA_VERSION = 8; |
| | | public static final int SCHEMA_VERSION = 9; |
| | | |
| | | /** Creates underlying database table using DAOs. */ |
| | | public static void createAllTables(Database db, boolean ifNotExists) { |
| | |
| | | @Id(autoincrement = true) |
| | | private Long id; |
| | | @Unique |
| | | private String orderId; |
| | | @Unique |
| | | private String orderNo; |
| | | @NotNull |
| | | private String gridNo; |
| | |
| | | private String putInDate; |
| | | private String takeCode; |
| | | private String createTime; |
| | | @Generated(hash = 1824136278) |
| | | public Order(Long id, String orderNo, @NotNull String gridNo, |
| | | @Generated(hash = 295152111) |
| | | public Order(Long id, String orderId, String orderNo, @NotNull String gridNo, |
| | | @NotNull String xuHao, int state, String putInDate, String takeCode, |
| | | String createTime) { |
| | | this.id = id; |
| | | this.orderId = orderId; |
| | | this.orderNo = orderNo; |
| | | this.gridNo = gridNo; |
| | | this.xuHao = xuHao; |
| | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | public String getOrderId() { |
| | | return this.orderId; |
| | | } |
| | | public void setOrderId(String orderId) { |
| | | this.orderId = orderId; |
| | | } |
| | | public String getOrderNo() { |
| | | return this.orderNo; |
| | | } |
| | |
| | | */ |
| | | public static class Properties { |
| | | public final static Property Id = new Property(0, Long.class, "id", true, "_id"); |
| | | public final static Property OrderNo = new Property(1, String.class, "orderNo", false, "ORDER_NO"); |
| | | public final static Property GridNo = new Property(2, String.class, "gridNo", false, "GRID_NO"); |
| | | public final static Property XuHao = new Property(3, String.class, "xuHao", false, "XU_HAO"); |
| | | public final static Property State = new Property(4, int.class, "state", false, "STATE"); |
| | | public final static Property PutInDate = new Property(5, String.class, "putInDate", false, "PUT_IN_DATE"); |
| | | public final static Property TakeCode = new Property(6, String.class, "takeCode", false, "TAKE_CODE"); |
| | | public final static Property CreateTime = new Property(7, String.class, "createTime", false, "CREATE_TIME"); |
| | | public final static Property OrderId = new Property(1, String.class, "orderId", false, "ORDER_ID"); |
| | | public final static Property OrderNo = new Property(2, String.class, "orderNo", false, "ORDER_NO"); |
| | | public final static Property GridNo = new Property(3, String.class, "gridNo", false, "GRID_NO"); |
| | | public final static Property XuHao = new Property(4, String.class, "xuHao", false, "XU_HAO"); |
| | | public final static Property State = new Property(5, int.class, "state", false, "STATE"); |
| | | public final static Property PutInDate = new Property(6, String.class, "putInDate", false, "PUT_IN_DATE"); |
| | | public final static Property TakeCode = new Property(7, String.class, "takeCode", false, "TAKE_CODE"); |
| | | public final static Property CreateTime = new Property(8, String.class, "createTime", false, "CREATE_TIME"); |
| | | } |
| | | |
| | | |
| | |
| | | String constraint = ifNotExists? "IF NOT EXISTS ": ""; |
| | | db.execSQL("CREATE TABLE " + constraint + "\"ORDER\" (" + // |
| | | "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id |
| | | "\"ORDER_NO\" TEXT UNIQUE ," + // 1: orderNo |
| | | "\"GRID_NO\" TEXT NOT NULL ," + // 2: gridNo |
| | | "\"XU_HAO\" TEXT NOT NULL ," + // 3: xuHao |
| | | "\"STATE\" INTEGER NOT NULL ," + // 4: state |
| | | "\"PUT_IN_DATE\" TEXT," + // 5: putInDate |
| | | "\"TAKE_CODE\" TEXT," + // 6: takeCode |
| | | "\"CREATE_TIME\" TEXT);"); // 7: createTime |
| | | "\"ORDER_ID\" TEXT UNIQUE ," + // 1: orderId |
| | | "\"ORDER_NO\" TEXT UNIQUE ," + // 2: orderNo |
| | | "\"GRID_NO\" TEXT NOT NULL ," + // 3: gridNo |
| | | "\"XU_HAO\" TEXT NOT NULL ," + // 4: xuHao |
| | | "\"STATE\" INTEGER NOT NULL ," + // 5: state |
| | | "\"PUT_IN_DATE\" TEXT," + // 6: putInDate |
| | | "\"TAKE_CODE\" TEXT," + // 7: takeCode |
| | | "\"CREATE_TIME\" TEXT);"); // 8: createTime |
| | | } |
| | | |
| | | /** Drops the underlying database table. */ |
| | |
| | | stmt.bindLong(1, id); |
| | | } |
| | | |
| | | String orderId = entity.getOrderId(); |
| | | if (orderId != null) { |
| | | stmt.bindString(2, orderId); |
| | | } |
| | | |
| | | String orderNo = entity.getOrderNo(); |
| | | if (orderNo != null) { |
| | | stmt.bindString(2, orderNo); |
| | | stmt.bindString(3, orderNo); |
| | | } |
| | | stmt.bindString(3, entity.getGridNo()); |
| | | stmt.bindString(4, entity.getXuHao()); |
| | | stmt.bindLong(5, entity.getState()); |
| | | stmt.bindString(4, entity.getGridNo()); |
| | | stmt.bindString(5, entity.getXuHao()); |
| | | stmt.bindLong(6, entity.getState()); |
| | | |
| | | String putInDate = entity.getPutInDate(); |
| | | if (putInDate != null) { |
| | | stmt.bindString(6, putInDate); |
| | | stmt.bindString(7, putInDate); |
| | | } |
| | | |
| | | String takeCode = entity.getTakeCode(); |
| | | if (takeCode != null) { |
| | | stmt.bindString(7, takeCode); |
| | | stmt.bindString(8, takeCode); |
| | | } |
| | | |
| | | String createTime = entity.getCreateTime(); |
| | | if (createTime != null) { |
| | | stmt.bindString(8, createTime); |
| | | stmt.bindString(9, createTime); |
| | | } |
| | | } |
| | | |
| | |
| | | stmt.bindLong(1, id); |
| | | } |
| | | |
| | | String orderId = entity.getOrderId(); |
| | | if (orderId != null) { |
| | | stmt.bindString(2, orderId); |
| | | } |
| | | |
| | | String orderNo = entity.getOrderNo(); |
| | | if (orderNo != null) { |
| | | stmt.bindString(2, orderNo); |
| | | stmt.bindString(3, orderNo); |
| | | } |
| | | stmt.bindString(3, entity.getGridNo()); |
| | | stmt.bindString(4, entity.getXuHao()); |
| | | stmt.bindLong(5, entity.getState()); |
| | | stmt.bindString(4, entity.getGridNo()); |
| | | stmt.bindString(5, entity.getXuHao()); |
| | | stmt.bindLong(6, entity.getState()); |
| | | |
| | | String putInDate = entity.getPutInDate(); |
| | | if (putInDate != null) { |
| | | stmt.bindString(6, putInDate); |
| | | stmt.bindString(7, putInDate); |
| | | } |
| | | |
| | | String takeCode = entity.getTakeCode(); |
| | | if (takeCode != null) { |
| | | stmt.bindString(7, takeCode); |
| | | stmt.bindString(8, takeCode); |
| | | } |
| | | |
| | | String createTime = entity.getCreateTime(); |
| | | if (createTime != null) { |
| | | stmt.bindString(8, createTime); |
| | | stmt.bindString(9, createTime); |
| | | } |
| | | } |
| | | |
| | |
| | | public Order readEntity(Cursor cursor, int offset) { |
| | | Order entity = new Order( // |
| | | cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id |
| | | cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // orderNo |
| | | cursor.getString(offset + 2), // gridNo |
| | | cursor.getString(offset + 3), // xuHao |
| | | cursor.getInt(offset + 4), // state |
| | | cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // putInDate |
| | | cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // takeCode |
| | | cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // createTime |
| | | cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // orderId |
| | | cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // orderNo |
| | | cursor.getString(offset + 3), // gridNo |
| | | cursor.getString(offset + 4), // xuHao |
| | | cursor.getInt(offset + 5), // state |
| | | cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // putInDate |
| | | cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // takeCode |
| | | cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8) // createTime |
| | | ); |
| | | return entity; |
| | | } |
| | |
| | | @Override |
| | | public void readEntity(Cursor cursor, Order entity, int offset) { |
| | | entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); |
| | | entity.setOrderNo(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); |
| | | entity.setGridNo(cursor.getString(offset + 2)); |
| | | entity.setXuHao(cursor.getString(offset + 3)); |
| | | entity.setState(cursor.getInt(offset + 4)); |
| | | entity.setPutInDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); |
| | | entity.setTakeCode(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); |
| | | entity.setCreateTime(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); |
| | | entity.setOrderId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); |
| | | entity.setOrderNo(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); |
| | | entity.setGridNo(cursor.getString(offset + 3)); |
| | | entity.setXuHao(cursor.getString(offset + 4)); |
| | | entity.setState(cursor.getInt(offset + 5)); |
| | | entity.setPutInDate(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); |
| | | entity.setTakeCode(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); |
| | | entity.setCreateTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); |
| | | } |
| | | |
| | | @Override |