mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-06-30 21:04:16 +00:00
add project adins
This commit is contained in:
parent
ad06ac5505
commit
f8f85d679d
5299 changed files with 625430 additions and 0 deletions
|
@ -0,0 +1,28 @@
|
|||
package com.adins.mss.coll.commons;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.adins.mss.base.GlobalData;
|
||||
import com.adins.mss.constant.Global;
|
||||
import com.adins.mss.foundation.formatter.Formatter;
|
||||
import com.adins.mss.foundation.formatter.Tool;
|
||||
|
||||
/**
|
||||
* Created by Aditya Purwa on 3/5/2015.
|
||||
*/
|
||||
public class Generator {
|
||||
public static String generateBatchId(Context context) {
|
||||
|
||||
java.util.Date now = Tool.getSystemDateTime();
|
||||
String loginId= GlobalData.getSharedGlobalData().getUser().getLogin_id();
|
||||
int idxOfOpenBrace = loginId.indexOf('@');
|
||||
if(idxOfOpenBrace!=-1){
|
||||
loginId = loginId.substring(0,idxOfOpenBrace);
|
||||
}
|
||||
return
|
||||
loginId +
|
||||
Formatter.formatDate(now, Global.DATE_STR_FORMAT4)+
|
||||
PersistentCounter.getAndIncrement(context, "batchId");
|
||||
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,91 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/checkOrderLayout"
|
||||
>
|
||||
|
||||
<ScrollView android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content" android:layout_alignParentTop="true">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
>
|
||||
|
||||
<LinearLayout android:orientation="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="visible"
|
||||
android:gravity="center_horizontal"
|
||||
android:id="@+id/searchBy">
|
||||
|
||||
<TextView
|
||||
android:text="@string/lblSearchBy"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:textColor="#000000"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginTop="37dp"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:ems="10"/>
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/cbSearchBy"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:ems="10"
|
||||
android:entries="@array/cbSearchBy" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:id="@+id/byNoOrder"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:visibility="visible"
|
||||
android:gravity="center_horizontal" >
|
||||
|
||||
<TextView
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:ems="10"
|
||||
android:text="@string/lblNomorOrder"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textColor="#000000"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
<EditText android:hint="@string/requiredField"
|
||||
android:id="@+id/txtNomorOrder"
|
||||
android:editable="false"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:ems="10" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View android:layout_width="fill_parent"
|
||||
android:layout_height="20dp"
|
||||
android:background="@android:color/transparent"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnSearchOrder"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:ems="10"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/btnSearchOrder"
|
||||
android:textColor="#ffffff"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="37dp">
|
||||
</Button>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
</RelativeLayout>
|
|
@ -0,0 +1,89 @@
|
|||
package com.adins.mss.foundation.print.rv;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
|
||||
import com.adins.mss.base.GlobalData;
|
||||
import com.adins.mss.base.R;
|
||||
import com.adins.mss.base.util.EventBusHelper;
|
||||
import com.adins.mss.base.util.GsonHelper;
|
||||
import com.adins.mss.foundation.http.HttpConnectionResult;
|
||||
import com.adins.mss.logger.Logger;
|
||||
import com.google.gson.JsonParseException;
|
||||
|
||||
/**
|
||||
* Created by angga.permadi on 4/20/2016.
|
||||
*/
|
||||
public class RVNumberSender extends DataTask<Void, Void, RVNumberResponse> {
|
||||
private ProgressDialog progressDialog;
|
||||
private int reqCode;
|
||||
private boolean isShowLoading = false;
|
||||
private InputRVNumberActivity.OnSendRVListener listener;
|
||||
|
||||
public RVNumberSender(Activity context, RVNumberRequest entity, int reqCode) {
|
||||
this(context, entity, reqCode, null);
|
||||
}
|
||||
|
||||
public RVNumberSender(Activity context, RVNumberRequest entity, int reqCode, InputRVNumberActivity.OnSendRVListener listener) {
|
||||
super(context, entity);
|
||||
this.reqCode = reqCode;
|
||||
this.isShowLoading = true;
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPreExecute() {
|
||||
super.onPreExecute();
|
||||
if (isShowLoading)
|
||||
progressDialog = ProgressDialog.show(context.get(), "", context.get().getString(R.string.please_wait), true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RVNumberResponse onBackgroundResult(HttpConnectionResult serverResult) {
|
||||
RVNumberResponse resultBean = new RVNumberResponse();
|
||||
|
||||
if (errorMessage != null) {
|
||||
resultBean.setErrorMessage(errorMessage);
|
||||
} else {
|
||||
if (serverResult != null) {
|
||||
Logger.d(this, serverResult.getResult());
|
||||
if (serverResult.isOK()) {
|
||||
try {
|
||||
resultBean = GsonHelper.fromJson(serverResult.getResult(), RVNumberResponse.class);
|
||||
} catch (JsonParseException e) {
|
||||
resultBean.setErrorMessage(context.get().getString(R.string.input_rv_number_failed));
|
||||
resultBean.setErrorCode(ErrorCodes.ERROR_PARSING_JSON);
|
||||
}
|
||||
} else {
|
||||
resultBean.setErrorMessage(serverResult.getResult());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resultBean.setReqCode(reqCode);
|
||||
return resultBean;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(RVNumberResponse rvNumberResponse) {
|
||||
super.onPostExecute(rvNumberResponse);
|
||||
|
||||
if (progressDialog != null) {
|
||||
if (progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
progressDialog = null;
|
||||
}
|
||||
|
||||
if (listener == null)
|
||||
return;
|
||||
|
||||
listener.onSendReceiptVoucher(rvNumberResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getUrl() {
|
||||
return GlobalData.getSharedGlobalData().getURL_RV_NUMBER();
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 7.8 KiB |
|
@ -0,0 +1,71 @@
|
|||
package com.adins.mss.coll.closingtask.senders;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.AsyncTask;
|
||||
import android.util.Log;
|
||||
|
||||
import com.adins.mss.base.GlobalData;
|
||||
import com.adins.mss.base.crashlytics.FireCrash;
|
||||
import com.adins.mss.base.util.GsonHelper;
|
||||
import com.adins.mss.constant.Global;
|
||||
import com.adins.mss.foundation.camerainapp.helper.Logger;
|
||||
import com.adins.mss.foundation.http.HttpConnectionResult;
|
||||
import com.adins.mss.foundation.http.HttpCryptedConnection;
|
||||
import com.adins.mss.foundation.http.MssRequestType;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
/**
|
||||
* Created by angga.permadi on 3/3/2016.
|
||||
*/
|
||||
public abstract class DataTask<Params, Progress, Result> extends AsyncTask<Params, Progress, Result>
|
||||
{
|
||||
protected String errorMessage;
|
||||
private MssRequestType entity;
|
||||
private WeakReference<Context> context;
|
||||
|
||||
public DataTask(Context context, MssRequestType entity)
|
||||
{
|
||||
this.context = new WeakReference<Context>(context);
|
||||
this.entity = entity;
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
@Override
|
||||
protected final Result doInBackground(Params... params)
|
||||
{
|
||||
entity.setAudit(GlobalData.getSharedGlobalData().getAuditData());
|
||||
HttpCryptedConnection httpConn = new HttpCryptedConnection(context.get(),
|
||||
GlobalData.getSharedGlobalData().isEncrypt(), GlobalData.getSharedGlobalData().isDecrypt());
|
||||
HttpConnectionResult serverResult;
|
||||
String url = getUrl();
|
||||
String json = GsonHelper.toJson(entity);
|
||||
|
||||
try
|
||||
{
|
||||
serverResult = httpConn.requestToServer(url, json, Global.DEFAULTCONNECTIONTIMEOUT);
|
||||
} catch (Exception e) {
|
||||
FireCrash.log(e);
|
||||
e.printStackTrace();
|
||||
errorMessage = e.getMessage();
|
||||
return null;
|
||||
}
|
||||
|
||||
return onBackgroundResult(serverResult);
|
||||
}
|
||||
|
||||
protected void onDestroy()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected void log(String message)
|
||||
{
|
||||
Logger.d(getClass().getSimpleName(), message);
|
||||
}
|
||||
|
||||
protected abstract Result onBackgroundResult(HttpConnectionResult serverResult);
|
||||
|
||||
protected abstract String getUrl();
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.adins.mss.odr.model;
|
||||
|
||||
/**
|
||||
* Created by winy.firdasari on 20/01/2015.
|
||||
*/
|
||||
public class StatusOrder {
|
||||
public String Status;
|
||||
public String Tanggal;
|
||||
|
||||
public StatusOrder(){
|
||||
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return Status;
|
||||
}
|
||||
public String getTanggal() {
|
||||
return Tanggal;
|
||||
}
|
||||
public void setStatus(String Status) {
|
||||
this.Status = Status;
|
||||
}
|
||||
public void setTanggal(String Tanggal) {
|
||||
this.Tanggal = Tanggal;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue