Commit ceec008e by Wyh

1、ConfigModule配置清單修改 2、餐廳擴展表的編輯BUG修復、提交修改優化 3、重印prjbug修復 4、導入jcifs PC共享文件jar包

Signed-off-by: Wyh <1239658231>
parent e209e25a
......@@ -101,6 +101,7 @@ dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation files('libs/javabase64-1.2.jar')
implementation files('libs/sun.misc.BASE64Decoder.jar')
api files('libs/jcifs-1.3.19.jar')
api files('libs/nexgon5lib.jar')
if (project.ext.runAsApp) {
annotationProcessor rootProject.ext.dependencies["dagger2-compiler"]
......
......@@ -17,7 +17,7 @@
android:launchMode="singleInstance"/>
<meta-data
android:name="com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
android:name="com.gingersoft.gsa.cloud.config.globalconfig.GlobalConfiguration"
android:value="ConfigModule" />
<meta-data
android:name="design_width_in_dp"
......
package com.gingersoft.gsa.cloud.base.utils;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
......@@ -77,4 +82,27 @@ public class CollectionUtils {
}
}
}
/**
* 深拷貝一個list集合,改變當前集合不影響之前的集合數據
* @param src
* @param <E>
* @return
*/
public static <E> List<E> deepCopy(List<E> src) {
try {
ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
ObjectOutputStream out = new ObjectOutputStream(byteOut);
out.writeObject(src);
ByteArrayInputStream byteIn = new ByteArrayInputStream(byteOut.toByteArray());
ObjectInputStream in = new ObjectInputStream(byteIn);
@SuppressWarnings("unchecked")
List<E> dest = (List<E>) in.readObject();
return dest;
} catch (Exception e) {
e.printStackTrace();
return new ArrayList<E>();
}
}
}
......@@ -3,9 +3,9 @@ package com.gingersoft.gsa.cloud.base.utils.okhttpUtils;
import com.gingersoft.gsa.cloud.app.GsaCloudApplication;
import com.gingersoft.gsa.cloud.base.utils.encryption.Aes;
import com.gingersoft.gsa.cloud.base.utils.time.TimeUtils;
import com.gingersoft.gsa.cloud.config.globalconfig.applyOptions.intercept.LoggingInterceptor;
import com.gingersoft.gsa.cloud.constans.AppConstans;
import com.gingersoft.gsa.cloud.constans.HttpsConstans;
import com.gingersoft.gsa.cloud.globalconfig.applyOptions.intercept.LoggingInterceptor;
import com.jess.arms.utils.DeviceUtils;
import java.io.File;
......
package com.gingersoft.gsa.cloud.globalconfig;
package com.gingersoft.gsa.cloud.config.globalconfig;
import android.app.Application;
import android.content.Context;
import androidx.fragment.app.FragmentManager;
import com.gingersoft.gsa.cloud.config.globalconfig.applyOptions.MyGlobalHttpHandler;
import com.gingersoft.gsa.cloud.config.globalconfig.applyOptions.MyGsonConfiguration;
import com.gingersoft.gsa.cloud.config.globalconfig.applyOptions.MyOkhttpConfiguration;
import com.gingersoft.gsa.cloud.config.globalconfig.applyOptions.MyResponseErrorListener;
import com.gingersoft.gsa.cloud.config.globalconfig.applyOptions.MyRetrofitConfiguration;
import com.gingersoft.gsa.cloud.config.globalconfig.applyOptions.MyRxCacheConfiguration;
import com.gingersoft.gsa.cloud.config.globalconfig.lifecyclesOptioins.MyActivityLifecycle;
import com.gingersoft.gsa.cloud.config.globalconfig.lifecyclesOptioins.MyAppLifecycles;
import com.gingersoft.gsa.cloud.constans.HttpsConstans;
import com.gingersoft.gsa.cloud.globalconfig.applyOptions.MyGlobalHttpHandler;
import com.gingersoft.gsa.cloud.globalconfig.applyOptions.MyGsonConfiguration;
import com.gingersoft.gsa.cloud.globalconfig.applyOptions.MyOkhttpConfiguration;
import com.gingersoft.gsa.cloud.globalconfig.applyOptions.MyResponseErrorListener;
import com.gingersoft.gsa.cloud.globalconfig.applyOptions.MyRetrofitConfiguration;
import com.gingersoft.gsa.cloud.globalconfig.applyOptions.MyRxCacheConfiguration;
import com.gingersoft.gsa.cloud.globalconfig.lifecyclesOptioins.MyActivityLifecycle;
import com.gingersoft.gsa.cloud.globalconfig.lifecyclesOptioins.MyAppLifecycles;
import com.jess.arms.base.delegate.AppLifecycles;
import com.jess.arms.di.module.GlobalConfigModule;
import com.jess.arms.integration.ConfigModule;
import com.jess.arms.integration.cache.Cache;
import com.jess.arms.integration.cache.CacheType;
import com.jess.arms.utils.DataHelper;
import java.io.File;
import java.util.List;
import androidx.annotation.NonNull;
import androidx.fragment.app.FragmentManager;
public class GlobalConfiguration implements ConfigModule {
@Override
......
package com.gingersoft.gsa.cloud.globalconfig.applyOptions;
package com.gingersoft.gsa.cloud.config.globalconfig.applyOptions;
import com.gingersoft.gsa.cloud.app.GsaCloudApplication;
import com.gingersoft.gsa.cloud.base.utils.encryption.Aes;
......
package com.gingersoft.gsa.cloud.globalconfig.applyOptions;
package com.gingersoft.gsa.cloud.config.globalconfig.applyOptions;
import android.content.Context;
......
package com.gingersoft.gsa.cloud.globalconfig.applyOptions;
package com.gingersoft.gsa.cloud.config.globalconfig.applyOptions;
import android.content.Context;
......
package com.gingersoft.gsa.cloud.globalconfig.applyOptions;
package com.gingersoft.gsa.cloud.config.globalconfig.applyOptions;
import android.app.Activity;
import android.content.Context;
......
package com.gingersoft.gsa.cloud.globalconfig.applyOptions;
package com.gingersoft.gsa.cloud.config.globalconfig.applyOptions;
import android.content.Context;
import com.gingersoft.gsa.cloud.base.BuildConfig;
import com.gingersoft.gsa.cloud.globalconfig.applyOptions.intercept.LoggingInterceptor;
import com.gingersoft.gsa.cloud.config.globalconfig.applyOptions.intercept.LoggingInterceptor;
import com.jess.arms.di.module.ClientModule;
import okhttp3.OkHttpClient;
import retrofit2.Retrofit;
......
package com.gingersoft.gsa.cloud.globalconfig.applyOptions;
package com.gingersoft.gsa.cloud.config.globalconfig.applyOptions;
import android.content.Context;
......
package com.gingersoft.gsa.cloud.globalconfig.applyOptions.intercept;
package com.gingersoft.gsa.cloud.config.globalconfig.applyOptions.intercept;
import java.io.IOException;
......
package com.gingersoft.gsa.cloud.globalconfig.lifecyclesOptioins;
package com.gingersoft.gsa.cloud.config.globalconfig.lifecyclesOptioins;
import android.annotation.SuppressLint;
import android.app.Activity;
......
package com.gingersoft.gsa.cloud.globalconfig.lifecyclesOptioins;
package com.gingersoft.gsa.cloud.config.globalconfig.lifecyclesOptioins;
import android.app.Application;
import android.content.Context;
......
......@@ -15,7 +15,7 @@
android:screenOrientation="portrait"/>
<!-- arms配置 -->
<meta-data
android:name="com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
android:name="com.gingersoft.gsa.cloud.config.globalconfig.GlobalConfiguration"
android:value="ConfigModule" />
</application>
......
......@@ -54,10 +54,6 @@ public class ExpandInfo implements Serializable {
private int dataType;
private String showName;
//是否被編輯了
@Transient
private boolean isUpdate = false;
public static final byte data_type_int = 1;
public static final byte data_type_string = 2;
public static final byte data_type_boolean = 3;
......
......@@ -38,7 +38,7 @@
android:screenOrientation="portrait" />
<meta-data
android:name="com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
android:name="com.gingersoft.gsa.cloud.config.globalconfig.GlobalConfiguration"
android:value="ConfigModule" />
<activity
android:name=".mvp.ui.activity.AddressListActivity"
......
......@@ -31,7 +31,7 @@
<service android:name="com.gingersoft.gsa.cloud.service.GetInfoUpdateService" />
<meta-data
android:name="com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
android:name="com.gingersoft.gsa.cloud.config.globalconfig.GlobalConfiguration"
android:value="ConfigModule" />
<activity android:name=".ui.activity.HistoryOrderActivity" />
......
......@@ -10,7 +10,7 @@
android:screenOrientation="portrait" />
<!-- arms配置 -->
<meta-data
android:name="com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
android:name="com.gingersoft.gsa.cloud.config.globalconfig.GlobalConfiguration"
android:value="ConfigModule" />
<meta-data
android:name="design_width_in_dp"
......
......@@ -22,7 +22,7 @@
<!-- arms配置 -->
<meta-data
android:name="com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
android:name="com.gingersoft.gsa.cloud.config.globalconfig.GlobalConfiguration"
android:value="ConfigModule" />
<meta-data
......
......@@ -52,7 +52,7 @@
android:screenOrientation="portrait" />
<meta-data
android:name="com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
android:name="com.gingersoft.gsa.cloud.config.globalconfig.GlobalConfiguration"
android:value="ConfigModule" />
<meta-data
android:name="design_width_in_dp"
......
......@@ -28,7 +28,7 @@ package="com.gingersoft.gsa.cloud.login">
<activity android:name=".mvp.ui.activity.mvp.ui.activity.RecoverPasswordActivity" />
<meta-data
android:name="com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
android:name="com.gingersoft.gsa.cloud.config.globalconfig.GlobalConfiguration"
android:value="ConfigModule" />
<meta-data
android:name="design_width_in_dp"
......
......@@ -39,7 +39,7 @@
android:screenOrientation="portrait" />
<!-- arms配置 -->
<meta-data
android:name="com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
android:name="com.gingersoft.gsa.cloud.config.globalconfig.GlobalConfiguration"
android:value="ConfigModule" />
<meta-data
android:name="design_width_in_dp"
......
......@@ -40,7 +40,7 @@
</activity>
<meta-data
android:name="com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
android:name="com.gingersoft.gsa.cloud.config.globalconfig.GlobalConfiguration"
android:value="ConfigModule" />
<meta-data
android:name="design_width_in_dp"
......
......@@ -4,6 +4,7 @@ import android.app.Application;
import com.gingersoft.gsa.cloud.app.GsaCloudApplication;
import com.gingersoft.gsa.cloud.base.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.base.utils.CollectionUtils;
import com.gingersoft.gsa.cloud.base.utils.JsonUtils;
import com.gingersoft.gsa.cloud.base.utils.RestaurantExpandInfoUtils;
import com.gingersoft.gsa.cloud.base.utils.gson.GsonUtils;
......@@ -17,6 +18,7 @@ import com.jess.arms.integration.AppManager;
import com.jess.arms.mvp.BasePresenter;
import com.jess.arms.utils.RxLifecycleUtils;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
......@@ -40,9 +42,12 @@ public class ExpandListPresenter extends BasePresenter<ExpandListContract.Model,
@Inject
AppManager mAppManager;
private List<ExpandInfo> originalDate;
@Inject
public ExpandListPresenter(ExpandListContract.Model model, ExpandListContract.View rootView) {
super(model, rootView);
originalDate = new ArrayList<>();
}
@Override
......@@ -68,7 +73,22 @@ public class ExpandListPresenter extends BasePresenter<ExpandListContract.Model,
if (result.isSuccess()) {
if (result.getData() != null) {
List<ExpandInfo> expandInfoList = JsonUtils.parseArray(result.getData(), ExpandInfo.class);
if (expandInfoList != null) {
originalDate = CollectionUtils.deepCopy(expandInfoList);
mRootView.loadExpandList(expandInfoList);
} else {
if (TextUtil.isNotEmptyOrNullOrUndefined(result.getErrMsg())) {
mRootView.showMessage(result.getErrMsg());
} else {
mRootView.showMessage("數據獲取失敗");
}
}
} else {
if (TextUtil.isNotEmptyOrNullOrUndefined(result.getErrMsg())) {
mRootView.showMessage(result.getErrMsg());
} else {
mRootView.showMessage("數據獲取失敗");
}
}
}
}
......@@ -77,7 +97,20 @@ public class ExpandListPresenter extends BasePresenter<ExpandListContract.Model,
public void updateExpandInfo(List<ExpandInfo> data) {
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), GsonUtils.GsonString(data));
List<ExpandInfo> changeData = new ArrayList<>();
if (originalDate != null) {
for (ExpandInfo expandInfo : data) {
if (!originalDate.contains(expandInfo)) {
//改變了
changeData.add(expandInfo);
}
}
}
if (changeData.size() <= 0) {
mRootView.killMyself();
return;
}
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), GsonUtils.GsonString(changeData));
mModel.updateExpandInfo(requestBody)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(""))
......
......@@ -10,7 +10,6 @@ import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.gingersoft.gsa.cloud.base.utils.time.TimeUtils;
import com.gingersoft.gsa.cloud.database.bean.ExpandInfo;
import com.gingersoft.gsa.cloud.main.R;
import com.gingersoft.gsa.cloud.main.R2;
......@@ -25,9 +24,6 @@ import com.jess.arms.utils.ArmsUtils;
import com.qmuiteam.qmui.alpha.QMUIAlphaButton;
import com.qmuiteam.qmui.widget.QMUITopBar;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import butterknife.BindView;
......@@ -132,28 +128,8 @@ public class ExpandListActivity extends BaseActivity<ExpandListPresenter> implem
int viewId = v.getId();
if (viewId == R.id.btn_expand_save) {
//保存
List<ExpandInfo> data = expandListAdapter.getData();
List<ExpandInfo> updateDate = new ArrayList<>();
for (ExpandInfo expandInfo : data) {
if(expandInfo.isUpdate()){
if(expandInfo.getValueDatetime() != null){
Calendar calendar = Calendar.getInstance();
try {
calendar.setTime(TimeUtils.ENGLISH_DATE_FORMAT.parse(expandInfo.getValueDatetime()));
} catch (ParseException e) {
e.printStackTrace();
}
expandInfo.setValueDatetime(TimeUtils.getStringByFormat(calendar.getTime(), TimeUtils.DEFAULT_DATE_FORMAT));
}
updateDate.add(expandInfo);
}
}
if (updateDate.size() > 0) {
//調用接口批量修改
mPresenter.updateExpandInfo(updateDate);
} else {
killMyself();
}
mPresenter.updateExpandInfo(expandListAdapter.getData());
}
}
}
......@@ -32,7 +32,6 @@ public class ExpandListAdapter extends BaseQuickAdapter<ExpandInfo, BaseViewHold
@Override
protected void convert(@NotNull BaseViewHolder baseViewHolder, ExpandInfo function) {
// baseViewHolder.setText(R.id.tv_expand_name, function.getShowName());
baseViewHolder.setText(R.id.tv_expand_name, function.getRemark());
EditText editText = baseViewHolder.getView(R.id.ed_expand_edit);
Switch btn = baseViewHolder.getView(R.id.switch_expand_boolean);
......@@ -62,14 +61,12 @@ public class ExpandListAdapter extends BaseQuickAdapter<ExpandInfo, BaseViewHold
btn.setChecked(function.getValueInt() == 0);
btn.setOnCheckedChangeListener((buttonView, isChecked) -> {
function.setValueInt(isChecked ? 0 : 1);
function.setUpdate(true);
});
} else if (function.getDataType() == 4) {
//日期
editText.setVisibility(View.GONE);
btn.setVisibility(View.GONE);
tvTime.setVisibility(View.VISIBLE);
Calendar calendar = Calendar.getInstance();
if (function.getValueDatetime() != null) {
try {
......@@ -83,10 +80,9 @@ public class ExpandListAdapter extends BaseQuickAdapter<ExpandInfo, BaseViewHold
//时间选择器
new TimePickerBuilder(getContext(), (date, view) -> {
tvTime.setText(TimeUtils.parseDateToString(date, TimeUtils.DATE_FORMAT_DATE));
function.setUpdate(true);
})
.setDate(calendar)
.setType(new boolean[]{true,true,true,false,false,false})
.setType(new boolean[]{true, true, true, false, false, false})
.setContentTextSize(24)
.setLabel("", "", "", "", "", "")
.build()
......@@ -99,10 +95,11 @@ public class ExpandListAdapter extends BaseQuickAdapter<ExpandInfo, BaseViewHold
tvTime.setVisibility(View.GONE);
editText.setVisibility(View.GONE);
}
if (editText.getVisibility() == View.VISIBLE) {
editText.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
......@@ -112,18 +109,18 @@ public class ExpandListAdapter extends BaseQuickAdapter<ExpandInfo, BaseViewHold
@Override
public void afterTextChanged(Editable s) {
if (function.getDataType() == 1) {
ExpandInfo expandInfo = getData().get(baseViewHolder.getAdapterPosition());
if (expandInfo.getDataType() == 1) {
if (TextUtil.isNotEmptyOrNullOrUndefined(s.toString())) {
function.setValueInt(Integer.parseInt(s.toString()));
function.setUpdate(true);
expandInfo.setValueInt(Integer.parseInt(s.toString()));
}
} else if (function.getDataType() == 2) {
} else if (expandInfo.getDataType() == 2) {
if (TextUtil.isNotEmptyOrNullOrUndefined(s.toString())) {
function.setValueChar(s.toString());
function.setUpdate(true);
expandInfo.setValueChar(s.toString());
}
}
}
});
}
}
}
......@@ -9,7 +9,7 @@
android:windowSoftInputMode="stateUnchanged|adjustPan"/>
<!-- arms配置 -->
<meta-data
android:name="com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
android:name="com.gingersoft.gsa.cloud.config.globalconfig.GlobalConfiguration"
android:value="ConfigModule" />
<meta-data
android:name="design_width_in_dp"
......
......@@ -16,7 +16,7 @@
android:windowSoftInputMode="stateUnchanged|adjustPan"/>
<!-- arms配置 -->
<meta-data
android:name="com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
android:name="com.gingersoft.gsa.cloud.config.globalconfig.GlobalConfiguration"
android:value="ConfigModule" />
<meta-data
android:name="design_width_in_dp"
......
......@@ -8,7 +8,7 @@
android:screenOrientation="portrait"/>
<!-- arms配置 -->
<meta-data
android:name="com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
android:name="com.gingersoft.gsa.cloud.config.globalconfig.GlobalConfiguration"
android:value="ConfigModule" />
</application>
......
......@@ -26,7 +26,7 @@
<!-- arms配置 -->
<meta-data
android:name="com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
android:name="com.gingersoft.gsa.cloud.config.globalconfig.GlobalConfiguration"
android:value="ConfigModule" />
<meta-data
android:name="design_width_in_dp"
......
......@@ -16,7 +16,7 @@
android:screenOrientation="portrait"/>
<service android:name=".mvp.print.service.PrjService"/>
<meta-data
android:name="com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
android:name="com.gingersoft.gsa.cloud.config.globalconfig.GlobalConfiguration"
android:value="ConfigModule" />
<activity
android:name=".mvp.ui.activity.PrintTestActivity"
......
......@@ -33,7 +33,7 @@
<activity android:name=".mvp.ui.activity.PrinterListActivity" />
<meta-data
android:name="com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
android:name="com.gingersoft.gsa.cloud.config.globalconfig.GlobalConfiguration"
android:value="ConfigModule" />
</application>
......
......@@ -183,9 +183,13 @@ public class PrintActivity extends BaseActivity<PrintPresenter> implements Print
return;
}
} else {
if (defaultPrint == null) {
printLocation = "";
} else {
printLocation = defaultPrint.getName();
}
}
}
prjBean.setPrintPosition(printLocation);
prjBean.setCurrentIndex(1);
}
......
......@@ -10,7 +10,6 @@ import com.epson.epos2.printer.Printer;
import com.epson.epos2.printer.PrinterStatusInfo;
import com.epson.epos2.printer.ReceiveListener;
import com.gingersoft.gsa.cloud.base.order.commodity.OrderDetail;
import com.gingersoft.gsa.cloud.base.utils.time.TimePickerUtils;
import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils;
import com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean;
import com.gingersoft.gsa.cloud.print.PrintExecutor;
......@@ -21,11 +20,19 @@ import com.joe.print.mvp.print.common.SendCallback;
import com.joe.print.mvp.print.common.SendResultCode;
import com.joe.print.mvp.print.usb.UsbPrinter;
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import jcifs.UniAddress;
import jcifs.smb.NtlmPasswordAuthentication;
import jcifs.smb.SmbFile;
import jcifs.smb.SmbFileInputStream;
import jcifs.smb.SmbFileOutputStream;
import jcifs.smb.SmbSession;
public class PrintTestActivity extends AppCompatActivity implements PrintSocketHolder.OnStateChangedListener, PrintExecutor.OnPrintResultListener, ReceiveListener {
private int lineLength = 42;//一行42個 17.5
......@@ -33,6 +40,51 @@ public class PrintTestActivity extends AppCompatActivity implements PrintSocketH
private static int foodNumSpace = 8;
private static int foodAmountSpace = 10;
private static void run() {
String ip = "192.168.1.144";
String rootPath = "smb://" + ip + "/KuGou/";
try {
UniAddress domain = UniAddress.getByName(ip);
NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(rootPath,
"", "");
SmbSession.logon(domain, auth);
SmbFile smbFile = new SmbFile(rootPath, auth);
smbFile.connect();
if (smbFile.isDirectory()) {
String newFilePath = rootPath + System.currentTimeMillis() + ".prj";
SmbFile createFile = new SmbFile(newFilePath, auth);
createFile.connect();
createFile.createNewFile();
if (createFile.exists()) {
SmbFileInputStream in = new SmbFileInputStream(createFile);
BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(new SmbFileOutputStream(createFile, true));
bufferedOutputStream.write("oiasfia按時間肯定很快就愛上檔卡戶時段接口和6556a6d5as65das5das奧術大師大所奧術大師大所".getBytes());
bufferedOutputStream.close();
}
smbFile.delete();
createFile.delete();
} else {
Log.e("eee", "请选择文件夾");
}
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_print_test);
// System.setProperty("jcifs.smb.client.dfs.disabled", "true");
// System.setProperty("jcifs.smb.client.soTimeout", "1000000");
// System.setProperty("jcifs.smb.client.responseTimeout", "30000");
// 获取跟目录然后获取下面各个盘符
new Thread(//smb://192.168.1.144/KuGou/
PrintTestActivity::run).start();
}
/**
* 獲取縮進,通過文字和最大長度
*
......@@ -167,54 +219,6 @@ public class PrintTestActivity extends AppCompatActivity implements PrintSocketH
return stringList;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_print_test);
// EditText ed_ip = findViewById(R.id.ed_ip);
// UsbPrinterFinder printerFinder = new UsbPrinterFinder(this, printerFinderCallback);
// printerFinder.startFinder();
//
// List<OrderDetail> foodList = new ArrayList<>();
// foodList.add(new OrderDetail("牛肉拉麵", 10, 1));
// foodList.add(new OrderDetail("紅燒牛肉拉麵", 200, 2));
//
// findViewById(R.id.btn_test).setOnClickListener(view -> {
// //打印測試
// String stringBuilder = "<html><body>" +
// getPLable("GingerSoft") +
// getPLable("Gs1") +
// getPLable("開檯時間:" + TimeUtils.getCurrentTimeInString(TimeUtils.DEFAULT_DATE_FORMAT)) +
// getPLable(getLineChar(lineLength, "_")) +
// getPLable(getFoodListStr(foodList)) +
// "</body></html>";
// OkHttp3Utils.get("http://localhost:8080/pos?transactionType=PRINT&isExternal=false&apiVersion=21&printData=" + stringBuilder).subscribe(new Observer<String>() {
// @Override
// public void onSubscribe(Disposable d) {
//
// }
//
// @Override
// public void onNext(String s) {
// }
//
// @Override
// public void onError(Throwable e) {
//
// }
//
// @Override
// public void onComplete() {
//
// }
// });
// });
TimePickerUtils.showTimePicker(this, null, (date, v1) -> {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
});
}
public String getLineChar(int size, String str) {
StringBuilder stringBuilder = new StringBuilder();
......
......@@ -36,7 +36,7 @@
android:screenOrientation="portrait" />
<meta-data
android:name="com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
android:name="com.gingersoft.gsa.cloud.config.globalconfig.GlobalConfiguration"
android:value="ConfigModule" />
<meta-data
android:name="design_width_in_dp"
......
......@@ -23,7 +23,7 @@
</activity>
<meta-data
android:name="com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
android:name="com.gingersoft.gsa.cloud.config.globalconfig.GlobalConfiguration"
android:value="ConfigModule" />
<meta-data
android:name="design_width_in_dp"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment