/webccr/src/com/emis/caesarui/webccr/webccr.java
https://bitbucket.org/sanliou/synccr · Java · 800 lines · 559 code · 125 blank · 116 comment · 19 complexity · 0fdeb69bd10710737787f2207a87e982 MD5 · raw file
- package com.emis.caesarui.webccr;
- import com.emis.caesar.emisComponents;
- import com.emis.caesar.emisUI;
- import com.emis.caesar.emisUILoader;
- import com.emis.caesar.senao.unit.TCcr;
- import com.emis.caesar.senao.util.CcrUtil;
- import com.emis.caesar.senao.util.UU2Util;
- import com.emis.caesarui.webccr.button.TDynBtnFactory;
- import com.emis.caesarui.webccr.core.PromotionInfoList;
- import com.emis.caesarui.webccr.core.PromotionMgr;
- import com.emis.caesarui.webccr.listener.TCcrKeyPressHandler;
- import com.emis.caesarui.webccr.printer.emisPrinter;
- import com.emis.caesarui.webccr.printer.emisPrinterFactory;
- import com.emis.caesarui.webccr.ui.table.TSalePayTable;
- import com.emis.caesarui.webccr.ui.table.TSalesTable;
- import com.emis.db.emisProp;
- import com.emis.servlet.jQueryServlet;
- import com.emis.user.emisAuthFactory;
- import com.emis.util.emisUtil;
- import com.vaadin.annotations.Theme;
- import com.vaadin.annotations.VaadinServletConfiguration;
- import com.vaadin.event.FieldEvents;
- import com.vaadin.event.LayoutEvents;
- import com.vaadin.server.VaadinRequest;
- import com.vaadin.server.VaadinService;
- import com.vaadin.server.WrappedSession;
- import com.vaadin.shared.communication.PushMode;
- import com.vaadin.ui.*;
- import com.vaadin.ui.Window.CloseEvent;
- import com.vaadin.ui.Window.CloseListener;
- import de.steinwedel.messagebox.ButtonOption;
- import de.steinwedel.messagebox.MessageBox;
- import elemental.json.JsonArray;
- import javax.servlet.annotation.WebServlet;
- import java.util.HashMap;
- @SuppressWarnings("serial")
- @Theme("caesar")
- public class webccr extends emisUI {
- @WebServlet(value = {"/webccr/*"}, asyncSupported = true)
- @VaadinServletConfiguration(productionMode = true, ui = webccr.class)
- //public static class Servlet extends VaadinServlet {
- public static class Servlet extends jQueryServlet {
- }
- // here we define some architecture flag
- public static final boolean bDevelopMode = true;
- public static final boolean bUseJavaScriptButton = true;
- // if it is cloud db mode , you have to use localThreadFilter
- public static final boolean bCouldDBMode = true;
- /*
- * 交易結束後,因為要多按一個 key, 或 5 秒後自動 reset 的機制,這邊需要一個 control flag
- */
- boolean m_bNewTransactionState = false;
- private Label FlSysDate_;//交易日期
- private Label FlSysTime_;//時間
- private Label FlStoreNo_;//門市
- private Label FlIdNo_;//機號
- private Label FlInvNo_;//發票號碼
- private Label FlSlNo_;//交易序號
- private Label FlSaler;//售貨員
- private Label FlUID;// 統一編號
- private Label FlOwner;// 買受人
- private Label FlCsNo;// 經銷商
- private Label FlCarryDonate;// 電子發票歸戶
- private Label FlInvCount;//發票剩餘張數
- private Label FlCcrState;//CCR交易狀態
- private Label FlLMSState;//LMS連線狀態
- private Label FlTotalAmt;//銷售金額
- private Label FlTotalOrderAmt;//客訂金額
- private Label FlTotalPayAmt;//應付金額
- private Label FlChangeAmt;//未付款(+)/找零(-)
- private TextField textField; //畫面輸入框
- private Label showMsg; //訊息框
- private GridLayout gridBtnTop_;
- private GridLayout gridBtnButton_;
- private HashMap<Integer, GridLayout> hashMapTop_;
- private HashMap<Integer, GridLayout> hashMapButton_;
- private HashMap<String, HashMap<String, String>> hashMapAllButtonInfo_ = null;
- private Table FTSaleTable;
- private Table FTSalePayTable;
- VerticalLayout SLDateLayout;
- Label SLDateTitleLabel;
- boolean m_keyClearState = false;
- confirmDlg m_delAllDlg = null;
- confirmDlg m_MessageDlg = null;
- confirmDlg m_ExitDlg = null;
- timeInfoThread bthread;
- // backgroundTask bTask;
- // some properties
- String m_InvKey;
- String m_3EINV_AP;
- String m_3EINV_ACCOUNT;
- String m_3EINV_PASSWD;
- String m_PRINTER;
- String m_PRINTTYPE;
- String m_PRINTPORT;
- String m_PRINTPORTCFG;
- emisPrinter m_Printer;
- private TCcr FoCCR_;
- public emisComponents componentWebCcr_ = null;
-
- //會員
- Label FlMEM_NAME = null;//會員姓名
- Label FlMEM_POINT = null; //會員點數
- Label FlMEM_S_CARE = null; //S-Care
- Label FlMEM_DOUBLE_AUTH = null; //神腦會員
- Label FlMEM_JOINSTORE = null; //綁定門市
- Label FlMEM_EMAIL = null; //email
- Label FlMEM_ADDRESS = null; //居住區域
- Label FlMEM_SEX = null; //性別
- Label FlMEM_BIRTHDAY = null; //生日
- Label FlMEN_NUMBER = null; //會員手機號碼
- private TextArea ANNOUNCEMENT; // 公告訊息
- @Override
- protected void init(VaadinRequest request) {
- if (!super.init(request, true)) {
- return;
- }
- try {
- FoCCR_ = (TCcr) emisAuthFactory.getCcr(emisUtil.getServletContext(), VaadinService.getCurrentRequest().getWrappedSession());
- } catch (Exception e) {
- }
- this.getPushConfiguration().setPushMode(PushMode.DISABLED);
- // System.out.println("TEST="+this.getPushConfiguration().getPushMode().isEnabled());
- getPage().setTitle(FoCCR_.getWEB_TITLE() + FoCCR_.getPage());
- FoCCR_.setPage(FoCCR_.getPage() + 1);
- emisComponents pointDisc = null;
- emisComponents buidCust = null;
- emisComponents birthDiscDlg = null;
- emisComponents clearCustDlg = null;
- emisComponents delAllDlg = null;
- emisComponents messageDlg = null;
- emisComponents exitDlg = null;
- try {
- componentWebCcr_ = emisUILoader.load(this, m_config, "webccr");
- // pointDisc= emisUILoader.load( this , m_config , "point_discount");
- // buidCust = emisUILoader.load( this , m_config , "build_cust");
- // birthDiscDlg = emisUILoader.load( this , m_config , "confirmdlg");
- // clearCustDlg = emisUILoader.load( this , m_config , "confirmdlg");
- delAllDlg = emisUILoader.load(this, m_config, "confirmdlg");
- messageDlg = emisUILoader.load(this, m_config, "confirmdlg");
- exitDlg = emisUILoader.load(this, m_config, "confirmdlg");
- m_delAllDlg = new confirmDlg("", "是否取消交易Y/N ?", delAllDlg, "600px", "420px");
- m_MessageDlg = new confirmDlg("", "", messageDlg, "600px", "420px");
- m_ExitDlg = new confirmDlg("", "确定离开WebCCR系统?", exitDlg, "600px", "420px");
- } catch (Exception e) {
- senaolog.error(webccr.class, e);
- e.getStackTrace();
- return;
- }
- textField = (TextField) componentWebCcr_.getComponent("inputText");
- showMsg = (Label) componentWebCcr_.getComponent("showMsg");
- textField.addFocusListener(new FieldEvents.FocusListener() {
- @Override
- public void focus(FieldEvents.FocusEvent event) {
- CcrUtil.setMessage("textField on focus");
- }
- });
- textField.addBlurListener(new FieldEvents.BlurListener() {
- @Override
- public void blur(FieldEvents.BlurEvent event) {
- //只有MESSAGE BOX設定FOCUS時才會設定為唯獨,因為有BUG會莫名其妙的FOCUS
- //被拖走,初步懷疑是MESSGEBOX關窗的時候又把FOCUS拉走了,因此在此特別
- //判斷若是唯獨狀態,則將FOCUS再拉回來一次
- CcrUtil.setMessage(" textField blur event, isReadOnly:"+textField.isReadOnly());
- if (textField.isReadOnly()) {
- textField.setReadOnly(false);
- textField.focus();
- }
- }
- });
- //設定按下鍵馬上觸發TEXTCHANGE 按鍵前的值可透過textField.getValue()取得,
- //按鍵後的值可透過event.getText()取得
- textField.setTextChangeEventMode(AbstractTextField.TextChangeEventMode.EAGER);
- textField.addTextChangeListener(new FieldEvents.TextChangeListener() {
- @Override
- public void textChange(FieldEvents.TextChangeEvent event) {
- String _sLastWord = "";
- int _iPos = textField.getCursorPosition();
- // System.out.println("current DisplayReset="+FoCCR_.isMainDisplayReset()); //滑鼠游標從0開始算起,當打了一個字就變成1
- //判斷主畫面輸入框是否需要清除
- // System.out.println("current position=" + _iPos); //滑鼠游標從0開始算起,當打了一個字就變成1
- if (_iPos > 0 && FoCCR_.isMainDisplayReset()) {
- //檢查目前游標位置要小於等於目前長度
- // System.out.println("current value=" +textField.getValue());
- // System.out.println("event text=" +event.getText());
- // System.out.println("current value length =" + textField.getValue().length());
- // System.out.println("event value length =" + event.getText().length());
- // System.out.println("lastword=" + _sLastWord);
- FoCCR_.setMainDisplayReset(false);//此行不可以放於textField.setValue之後,否則又會觸發一次validator
- //計算大小
- // int _iCnt = event.getText().length() - textField.getValue().length();
- // //如果只差一個字,代表從鍵盤輸入的(目前只能這樣判斷因為不能擷取所有的鍵盤輸入)
- // //若剪貼簿跟原字串正好相差一個字,就會有BUG會被清掉...
- // if ( _iCnt == 1) {
- // if (_iPos <= event.getText().length())
- // _sLastWord = event.getText().substring(_iPos - 1, _iPos); // 依據目前游標位置取得輸入的值
- // } else if (_iCnt >1 ){ //如果相差字數大於1代表剪貼簿來的
- // //取得相差的字數代表剪貼簿貼上的字數,再從游標位置減掉該自數到目前的游標位置
- // if (_iPos <= event.getText().length())
- // _sLastWord = event.getText().substring(_iPos - _iCnt, _iPos);
- // } //如果相差字數=0或小於0代表剪貼簿的字數完全貼上則不做任何處理
- // textField.setValue(_sLastWord );
- }
- }
- });
- TCcrKeyPressHandler _keyPressHandler = new TCcrKeyPressHandler();
- _keyPressHandler.bindComponent(textField, "TextField");
- this.addActionHandler(_keyPressHandler);
- try {
- TDynBtnFactory _oBtnFactory = new TDynBtnFactory(FoCCR_.getStore().getFLDxS_NO(), _keyPressHandler);
- this.hashMapTop_ = _oBtnFactory.getHashMapTop_();
- this.hashMapButton_ = _oBtnFactory.getHashMapButton_();
- this.hashMapAllButtonInfo_ = _oBtnFactory.getHashMapAllButton_();
- gridBtnTop_ = (GridLayout) componentWebCcr_.getComponent("gridBtnTop");
- gridBtnButton_ = (GridLayout) componentWebCcr_.getComponent("gridBtnButton");
- changeButton(0);
- changeTopButton(0);
- } catch (Exception e) {
- MessageBox.createError()
- .withCaption("錯誤")
- .withMessage("設定有誤,請聯繫資訊人員")
- .withWidth("400px")
- .withCloseButton(() -> {
- // 繼續往下執行
- FoCCR_.UInotify.closeWebCcr();
- }, ButtonOption.focus())
- .open();
- return;
- }
- // table
- FTSaleTable = (TSalesTable) componentWebCcr_.getComponent("saleTable");
- FTSalePayTable = (TSalePayTable) componentWebCcr_.getComponent("salePayTable");
- VerticalLayout _oInfoGrid = (VerticalLayout) componentWebCcr_.getComponent("WEBCCR_LAYOUT");
- _oInfoGrid.addLayoutClickListener(new LayoutEvents.LayoutClickListener() {
- @Override
- public void layoutClick(LayoutEvents.LayoutClickEvent event) {
- CcrUtil.setMessage("LayoutEvents click");
- textField.focus();
- }
- });
- /**上方畫面資料顯示區**/
- //交易日期
- FlSysDate_ = (Label) componentWebCcr_.getComponent("SYSDATE");
- FlSysDate_.setValue(FoCCR_.getSaleDate() + "/" + emisUtil.todayTime(":"));
- //系統時間
- // FlSysTime_ = (Label) componentWebCcr_.getComponent("SYSTIME");
- // FlSysTime_.setValue(emisUtil.todayTime(":"));
- //門市
- FlStoreNo_ = (Label) componentWebCcr_.getComponent("STORENAME");
- // FlStoreNo_.setValue(FoCCR_.getFoStore().getStoreNo()+" "+FoCCR_.getFoStore().getStoreName());
- FlStoreNo_.setValue(FoCCR_.getStore().getFLDxS_NO());
- //機號
- FlIdNo_ = (Label) componentWebCcr_.getComponent("ID_NO");
- FlIdNo_.setValue(FoCCR_.getCcrID());
- //發票號碼
- FlInvNo_ = (Label) componentWebCcr_.getComponent("INVNO");
- FlInvNo_.setValue(FoCCR_.getCurrentInvoiceNo());
- //交易序號
- FlSlNo_ = (Label) componentWebCcr_.getComponent("SL_NO");
- FlSlNo_.setValue("");
- //售貨員
- FlSaler = (Label) componentWebCcr_.getComponent("USER");
- FlSaler.setValue("");
- //統一編號
- FlUID = (Label) componentWebCcr_.getComponent("UID");
- FlUID.setValue("");
- //買受人
- // FlOwner = (Label) componentWebCcr_.getComponent("OWNER");
- // FlOwner.setValue("");
- //經銷商
- FlCsNo = (Label) componentWebCcr_.getComponent("CS_NO");
- FlCsNo.setValue("");
- // 電子發票歸戶
- FlCarryDonate = (Label) componentWebCcr_.getComponent("CARRY_DONATE");
- FlCarryDonate.setValue("");
- //發票剩餘張數
- FlInvCount = (Label) componentWebCcr_.getComponent("INVCOUNT");
- FlInvCount.setValue("");
- //交易狀態
- FlCcrState = (Label) componentWebCcr_.getComponent("CCRSTATE");
- FlCcrState.setValue("");
- //銷售金額
- FlTotalAmt = (Label) componentWebCcr_.getComponent("TOTALAMT");
- FlTotalAmt.setValue("");
- //客訂金額
- FlTotalOrderAmt = (Label) componentWebCcr_.getComponent("TOTALORDERAMT");
- FlTotalOrderAmt.setValue("");
- //應付金額
- FlTotalPayAmt = (Label) componentWebCcr_.getComponent("TOTALPAYAMT");
- FlTotalPayAmt.setValue("");
- //未付款(+)/找零(-)
- FlChangeAmt = (Label) componentWebCcr_.getComponent("CHANGEAMT");
- FlChangeAmt.setValue("");
- //LMS連線狀態
- FlLMSState = (Label) componentWebCcr_.getComponent("LMSSTATE");
-
- //會員
- FlMEM_NAME= (Label) componentWebCcr_.getComponent("MEM_NAME");//會員姓名
- FlMEM_POINT= (Label) componentWebCcr_.getComponent("MEM_POINT"); //會員點數
- // FlMEM_S_CARE= (Label) componentWebCcr_.getComponent("MEM_S_CARE"); //S-Care
- FlMEM_DOUBLE_AUTH= (Label) componentWebCcr_.getComponent("MEM_DOUBLE_AUTH"); //神腦會員
- FlMEM_JOINSTORE= (Label) componentWebCcr_.getComponent("MEM_JOINSTORE"); //綁定門市
- FlMEM_EMAIL= (Label) componentWebCcr_.getComponent("MEM_EMAIL"); //email
- FlMEM_ADDRESS= (Label) componentWebCcr_.getComponent("MEM_ADDRESS"); //居住區域
- FlMEM_SEX= (Label) componentWebCcr_.getComponent("MEM_SEX"); //性別
- FlMEM_BIRTHDAY= (Label) componentWebCcr_.getComponent("MEM_BIRTHDAY"); //生日
- FlMEN_NUMBER= (Label) componentWebCcr_.getComponent("MEN_NUMBER"); //會員手機號碼
- //公告訊息
- ANNOUNCEMENT = (TextArea) componentWebCcr_.getComponent("ANNOUNCEMENT");
- ANNOUNCEMENT.setEnabled(false);
- m_delAllDlg.addOnConfirmListener(new CCREventListener() {
- public void onEvent(Object src) {
- reset();
- }
- });
- m_delAllDlg.addCloseListener(new CloseListener() {
- public void windowClose(CloseEvent e) {
- onSubWindowClose();
- }
- });
- m_MessageDlg.addCloseListener(new CloseListener() {
- public void windowClose(CloseEvent e) {
- onSubWindowClose();
- }
- });
- m_ExitDlg.addOnConfirmListener(new CCREventListener() {
- public void onEvent(Object src) {
- try {
- emisAuthFactory.logout(m_application, m_session);
- close();
- emisUtil.setLocation("/esn/login");
- } catch (Exception e) {
- senaolog.error(webccr.class, e);
- }
- }
- });
- m_ExitDlg.addCloseListener(new CloseListener() {
- public void windowClose(CloseEvent e) {
- onSubWindowClose();
- }
- });
- //JavaScript.getCurrent().execute("window.onbeforeunload = function (e) { var e = e || window.event; aboutToClose(); return '确定离开WebCCR系统?'; };");
- // JavaScript.getCurrent().execute(
- // "window.onbeforeunload = " +
- // "function (e) { return '確定離開WebCCR系统?'; };"
- // );
- bthread = new timeInfoThread(this);
- bthread.start();
- // bTask = new backgroundTask(this);
- // bTask.start();
- this.addDetachListener(new DetachListener() {
- // clean the thread ?
- public void detach(DetachEvent event) {
- CcrUtil.setMessage("Detach called");
- if (bthread != null) {
- bthread.stopIt();
- }
- // if (bTask != null) {
- // bTask.stopIt();
- // }
- }
- });
- //頁面關閉,關閉時間的Thread
- JavaScript.getCurrent().addFunction("onClose", new JavaScriptFunction() {
- public void call(JsonArray arguments) {
- //System.out.println("Detach called");
- // senaolog.info(webccr.class, "window onClose called");
- CcrUtil.setMessage("window onClose called");
- // if( bTask != null ) { bTask.stopIt(); }
- if( bthread != null) { bthread.stopIt(); }
- }
- });
- //
- JavaScript.getCurrent().addFunction("CloseSession", new JavaScriptFunction() {
- public void call(JsonArray arguments) {
- try {
- WrappedSession session = VaadinService.getCurrentRequest().getWrappedSession();
- emisAuthFactory.logout(emisUtil.getServletContext(), session);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- });
- JavaScript.getCurrent().execute("window.onbeforeunload = function (e) { e.returnValue = '確定離開WebCCR系统?'; return '確定離開WebCCR系统?'; };");
- // JavaScript.getCurrent().execute("window.onunload = function (e) { onClose(); };");
- //載入CCR周邊資訊
- // emisUtil.getCcrDevice();
- //
- // 寫入ini
- String path = "C:/emis/bin/";
- JavaScript.getCurrent().execute(
- " var util = new emisUtility(); " +
- " var a = '" + FoCCR_.getCcrID() + "'; " +
- " var d = '" + path +"CCR.ini';" +
- " util.writeStringToUTF8File(d, a);");
- //登錄下傳POSAP download/機台 至Local端 20190305 ADD BY DAFF-DWN
- CcrUtil.Login_Download(FoCCR_.getCcrID());
- senaolog.init(FoCCR_.getStore().getFLDxS_NO(), FoCCR_.getCcrID());
- // ANNOUNCEMENT.addStyleName("SenaoMarquee");
- // CcrUtil.realMsgRun("ANNOUNCEMENT");
- //找出門市可用促銷單
- FoCCR_.getPromoHashMap().clear();
- FoCCR_.getDbData.getPromoMMStore();
- FoCCR_.getDbData.getPromoFIStore();
- FoCCR_.getDbData.getPromoSMStore();
- textField.focus();
- setContent(componentWebCcr_.getRootComponent());
- // senaolog.info(login.class, "登入機號="+ FoCCR_.getCcrID());
- CcrUtil.setMessage("登入機號="+ FoCCR_.getCcrID());
- // 分頁付置問題
- if (FoCCR_.getPage() > 1) {
- MessageBox.createError()
- .withCaption("錯誤")
- .withMessage("Webccr頁面超過1頁或重新載入,請確認分頁數。")
- .withWidth("400px")
- .withCloseButton(() -> {
- // 繼續往下執行
- FoCCR_.UInotify.closeWebCcr();
- }, ButtonOption.focus())
- .open();
- }
- // 登入悠遊卡 連接熱感機才能登入
- if (FoCCR_.isEINV()) {
- UU2Util uu2 = new UU2Util();
- uu2.signOnUUcard();
- // 悠遊卡儲值料號取得語法(每個門市有機會不同)
- String P_NO = FoCCR_.getDbData.getUU_PNO(FoCCR_.getStore().getFLDxS_NO());
- if (!emisUtil.isEmpty(P_NO)) {
- FoCCR_.setUU_PNO(P_NO);
- }
- }
- // 福利金料號取得語法
- String BENEFIT_PNO = FoCCR_.getDbData.getBENEFIT_PNO(FoCCR_.getStore().getFLDxS_NO());
- if (!emisUtil.isEmpty(BENEFIT_PNO)) {
- FoCCR_.setBENEFIT_PNO(BENEFIT_PNO);
- }
- //add by Ares 20181009 HAMIPOINT
- // HAMIPOINT折抵料號取得語法
- String HAMIPOINT_PNO = FoCCR_.getDbData.getHAMIPOINT_PNO(FoCCR_.getStore().getFLDxS_NO());
- if (!emisUtil.isEmpty(HAMIPOINT_PNO)) {
- FoCCR_.setHAMIPOINT_PNO(HAMIPOINT_PNO);
- }
- }
- public void changeButton(int page) {
- gridBtnButton_.removeComponent(0, 0);
- gridBtnButton_.addComponent((GridLayout) hashMapButton_.get(page), 0, 0);
- }
- public void changeTopButton(int page) {
- gridBtnTop_.removeComponent(0, 0);
- gridBtnTop_.addComponent((GridLayout) hashMapTop_.get(page), 0, 0);
- }
- protected void getCCRParameters() {
- try {
- HashMap m = emisProp.getProps(m_User, "INVKEY,3EINV_AP,3EINV_ACCOUNT,3EINV_PASSWD");
- m_InvKey = (String) m.get("INVKEY");
- m_3EINV_AP = (String) m.get("3EINV_AP");
- m_3EINV_ACCOUNT = (String) m.get("3EINV_ACCOUNT");
- m_3EINV_PASSWD = (String) m.get("3EINV_PASSWD");
- } catch (Exception e) {
- senaolog.error(webccr.class, e);
- }
- try {
- HashMap m = emisProp.getCCRProps(m_User, "PRINTER,PRINTTYPE,PRINTPORT,PRINTPORTCFG");
- m_PRINTER = (String) m.get(m_User.getID_NO() + ".PRINTER");
- m_PRINTTYPE = (String) m.get(m_User.getID_NO() + ".PRINTTYPE");
- m_PRINTPORT = (String) m.get(m_User.getID_NO() + ".PRINTPORT");
- m_PRINTPORTCFG = (String) m.get(m_User.getID_NO() + ".PRINTPORTCFG");
- } catch (Exception e) {
- senaolog.error(webccr.class, e);
- }
- System.out.println("Printer:" + m_PRINTER + "," + m_PRINTTYPE + "," + m_PRINTPORT + "," + m_PRINTPORTCFG);
- m_Printer = emisPrinterFactory.getPrinter(m_PRINTER);
- m_Printer.setConfig(m_PRINTTYPE, m_PRINTPORT, m_PRINTPORTCFG);
- }
- public void reset() {
- //SaleTransaction ccr = (SaleTransaction) src;
- System.out.println("webccr.reset");
- m_keyClearState = false;
- SLDateLayout.removeStyleName("alert_labelLayoutStyle");
- SLDateTitleLabel.removeStyleName("alert_labelstyle");
- SLDateLayout.addStyleName("labelLayoutStyle");
- SLDateTitleLabel.addStyleName("labelstyle");
- SLDateTitleLabel.setValue("交易日期");
- }
- private void onSubWindowClose() {
- // textField.focus();
- }
- // CLS , 清除
- public void clear() {
- setInput("");
- // messageLabel.setValue("");
- FlTotalAmt.setValue("");
- FlTotalOrderAmt.setValue("");
- FlTotalPayAmt.setValue("");
- FlChangeAmt.setValue("");
- m_keyClearState = false;
- }
- private void printhashMapAllButtonInfo() {
- HashMap<String, String> mapBtn = null;
- for (Object key1 : hashMapAllButtonInfo_.keySet()) {
- mapBtn = hashMapAllButtonInfo_.get(key1);
- System.out.println("--- " + key1 + " ---");
- for (Object key2 : mapBtn.keySet()) {
- System.out.println(key2 + " : " + mapBtn.get(key2));
- }
- }
- }
- CCREventListener m_OnTransactionEnd = null;
- public void addTransactionEndListener(CCREventListener listener) {
- m_OnTransactionEnd = listener;
- }
- // This is called by background thread
- public void updateTimeInfo() {
- if (FlSysDate_ != null) {
- FlSysDate_.setValue(FoCCR_.getSaleDate() + "/" + emisUtil.todayTime(":"));
- // this.push();
- }
- }
- public synchronized boolean IsNewTransactionState() {
- if (m_bNewTransactionState) {
- m_bNewTransactionState = false;
- return true;
- }
- return false;
- }
- /*
- * 需求, 交易結束後 , 5 秒自動清除
- */
- public synchronized void clearbyBackground() {
- if (IsNewTransactionState()) {
- //System.out.println("clearbyBackground");
- //m_CurrentSt.reset();
- reset();
- this.push();
- }
- }
- public emisComponents getComponentWebCcr() {
- return componentWebCcr_;
- }
- public String getInput() {
- return this.textField.getValue();
- }
- public void setInput(String input) {
- this.textField.setValue(input);
- }
- public TCcr getFoCCR() {
- return FoCCR_;
- }
- public Table getFTSaleTable() {
- return FTSaleTable;
- }
- public TextField getInputLabel() {
- return textField;
- }
- public Label getFlSaler() {
- return FlSaler;
- }
- public Label getFlUID() {
- return FlUID;
- }
- public Label getFlOwner() {
- return FlOwner;
- }
- public Label getFlCcrState() {
- return FlCcrState;
- }
- public Label getFlLMSState() {
- return FlLMSState;
- }
- public Table getFTSalePayTable() {
- return FTSalePayTable;
- }
- public Label getFlSysDate() {
- return FlSysDate_;
- }
- public Label getFlStoreNo() {
- return FlStoreNo_;
- }
- public Label getFlIdNo() {
- return FlIdNo_;
- }
- public Label getFlSlNo() {
- return FlSlNo_;
- }
- public Label getFlInvNo() {
- return FlInvNo_;
- }
- public Label getFlInvCount() {
- return FlInvCount;
- }
- public Label getFlTotalAmt() {
- return FlTotalAmt;
- }
- public Label getFlTotalOrderAmt() {
- return FlTotalOrderAmt;
- }
- public Label getFlTotalPayAmt() {
- return FlTotalPayAmt;
- }
- public Label getFlChangeAmt() {
- return FlChangeAmt;
- }
- public GridLayout getGridBtnTop() {
- return gridBtnTop_;
- }
- public GridLayout getGridBtnButton() {
- return gridBtnButton_;
- }
- public HashMap getHashMapTop() {
- return hashMapTop_;
- }
- public HashMap getHashMapButton() {
- return hashMapButton_;
- }
- public HashMap<String, HashMap<String, String>> getHashMapAllButtonInfo_() {
- return hashMapAllButtonInfo_;
- }
- // 取得某一個按鈕的資訊
- public HashMap<String, String> getHashMapButtonInfo(String sFP_FUNC_CODE) {
- return hashMapAllButtonInfo_.get(sFP_FUNC_CODE);
- }
- // 公司別先給空白
- public PromotionInfoList getPmList() {
- try {
- return PromotionMgr.getInstance(emisUtil.getServletContext()).
- getPromoteList(FoCCR_);
- } catch (Exception e) {
- senaolog.error(this.getClass(), e);
- return null;
- }
- }
- public webccrlog getlog() {
- return senaolog;
- }
- public Label getFlMEM_NAME() {
- return FlMEM_NAME;
- }
- public Label getFlMEM_POINT() {
- return FlMEM_POINT;
- }
- public Label getFlMEM_S_CARE() {
- return FlMEM_S_CARE;
- }
- public Label getFlMEM_DOUBLE_AUTH() {
- return FlMEM_DOUBLE_AUTH;
- }
- public Label getFlMEM_JOINSTORE() {
- return FlMEM_JOINSTORE;
- }
- public Label getFlMEM_EMAIL() {
- return FlMEM_EMAIL;
- }
- public Label getFlMEM_ADDRESS() {
- return FlMEM_ADDRESS;
- }
- public Label getFlMEM_SEX() {
- return FlMEM_SEX;
- }
- public Label getFlMEM_BIRTHDAY() {
- return FlMEM_BIRTHDAY;
- }
- public Label getShowMsg() {
- return showMsg;
- }
- public void setShowMsg(String showMsg) {
- this.showMsg.setValue(showMsg);
- }
- public Label getFlCsNo() {
- return FlCsNo;
- }
- public Label getFlCarryDonate() {
- return FlCarryDonate;
- }
- public Label getFlMEN_NUMBER() {
- return FlMEN_NUMBER;
- }
- }