mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-07-01 05:14:17 +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,48 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="3dp"
|
||||
app:cardBackgroundColor="@color/fontColorWhite"
|
||||
app:cardCornerRadius="10dp"
|
||||
app:cardElevation="5dp"
|
||||
app:contentPadding="5dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/productPicture"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/ic_back" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/productNameText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawablePadding="5dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:paddingBottom="5dp"
|
||||
android:text="Name" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/productPriceText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawablePadding="5dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="Desc" />
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
|
@ -0,0 +1,18 @@
|
|||
package com.adins.mss.coll.loyalti.pointacquisitionmonthly.contracts;
|
||||
|
||||
import com.adins.mss.coll.models.loyaltymodels.LoyaltyPointsRequest;
|
||||
import com.adins.mss.coll.models.loyaltymodels.LoyaltyPointsResponse;
|
||||
import com.adins.mss.dao.GeneralParameter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ILoyaltyPointsDataSource {
|
||||
void requestPointsData(LoyaltyPointsRequest reqData, ReqPointsListener listener);
|
||||
List<GeneralParameter> getJobsGenParam(List<String> jobs);
|
||||
interface ReqPointsListener {
|
||||
void onSuccess(LoyaltyPointsResponse loyaltyPoints);
|
||||
void onFailed(String message);
|
||||
}
|
||||
|
||||
//add more here...
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape>
|
||||
<gradient
|
||||
android:startColor="#f06a4d"
|
||||
android:endColor="#ab2002"
|
||||
android:angle="270" />
|
||||
<corners
|
||||
android:radius="0dp" />
|
||||
<!-- <padding -->
|
||||
<!-- android:left="10dp" -->
|
||||
<!-- android:top="10dp" -->
|
||||
<!-- android:right="10dp" -->
|
||||
<!-- android:bottom="10dp" /> -->
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
Binary file not shown.
After Width: | Height: | Size: 3.4 KiB |
|
@ -0,0 +1,146 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/bgColor">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?android:attr/actionBarSize"
|
||||
android:background="@drawable/header"
|
||||
app:titleTextAppearance="?android:attr/textAppearanceSmall"
|
||||
android:titleTextColor="@color/fontColorWhite"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.ActionBar"
|
||||
app:layout_collapseMode="pin"
|
||||
android:fitsSystemWindows="true" />
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/detailContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
app:cardCornerRadius="10dp"
|
||||
app:contentPadding="10dp"
|
||||
app:cardElevation="@dimen/card_shadow"
|
||||
android:layout_margin="@dimen/card_margin"
|
||||
app:cardBackgroundColor="@color/fontColorWhite">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="5dp"
|
||||
android:orientation="horizontal">
|
||||
<TextView android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/label_transaction_code_2"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"/>
|
||||
<TextView android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=""
|
||||
android:id="@+id/transactionCode"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"/>
|
||||
</LinearLayout>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
<HorizontalScrollView
|
||||
android:id="@+id/horizontalScrollView1"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fillViewport="true">
|
||||
<TableLayout android:layout_width="match_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:stretchColumns="4"
|
||||
android:id="@+id/tableCollectionDetail">
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:text="@string/label_no"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:gravity="center_horizontal"/>
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/timelineLine" />
|
||||
<TextView
|
||||
android:text="@string/label_field"
|
||||
android:minWidth="120dp"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:gravity="center_horizontal"/>
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/timelineLine" />
|
||||
<TextView
|
||||
android:text="@string/label_value"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:gravity="center_horizontal"/>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/timelineLine"/>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/timelineLine"/>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/timelineLine"/>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/timelineLine"/>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/timelineLine"/>
|
||||
</TableRow>
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="5dp">
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="5dp" />
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/timelineLine" />
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="5dp" />
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/timelineLine" />
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="5dp" />
|
||||
</TableRow>
|
||||
</TableLayout>
|
||||
|
||||
</HorizontalScrollView>
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,36 @@
|
|||
package com.adins.mss.odr.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by winy.firdasari on 20/01/2015.
|
||||
*/
|
||||
public class Order {
|
||||
public String orderNo;
|
||||
public String customerName;
|
||||
public List<StatusOrder> statusOrder;
|
||||
|
||||
|
||||
public Order(){
|
||||
|
||||
}
|
||||
|
||||
public String getOrderNo() {
|
||||
return orderNo;
|
||||
}
|
||||
public void setOrderNo(String orderNo) {
|
||||
this.orderNo = orderNo;
|
||||
}
|
||||
public String getCustomerName() {
|
||||
return customerName;
|
||||
}
|
||||
public void setCustomerName(String customerName) {
|
||||
this.customerName = customerName;
|
||||
}
|
||||
public List<StatusOrder> getStatusOrder() {
|
||||
return statusOrder;
|
||||
}
|
||||
public void setStatusOrder(List<StatusOrder> statusOrder) {
|
||||
this.statusOrder = statusOrder;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,161 @@
|
|||
package com.adins.mss.coll.closingtask;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import androidx.annotation.Keep;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ListView;
|
||||
|
||||
import com.adins.mss.base.GlobalData;
|
||||
import com.adins.mss.coll.R;
|
||||
import com.adins.mss.coll.closingtask.models.ClosingTaskRequest;
|
||||
import com.adins.mss.coll.closingtask.models.ClosingTaskResponse;
|
||||
import com.adins.mss.coll.closingtask.senders.ClosingTaskListener;
|
||||
import com.adins.mss.coll.closingtask.senders.ClosingTaskSender;
|
||||
import com.adins.mss.coll.dummy.ClosingTaskDummyAdapter;
|
||||
import com.adins.mss.coll.dummy.UserHelpCOLDummy;
|
||||
import com.adins.mss.constant.Global;
|
||||
import com.adins.mss.foundation.db.dataaccess.TaskHDataAccess;
|
||||
import com.adins.mss.foundation.dialog.NiftyDialogBuilder;
|
||||
import com.androidquery.AQuery;
|
||||
|
||||
/**
|
||||
* Created by angga.permadi on 6/6/2016.
|
||||
*/
|
||||
public class ClosingTaskFragment extends Fragment implements ClosingTaskListener {
|
||||
private AQuery query;
|
||||
private static boolean showDummy = true;
|
||||
public static ClosingTaskFragment newInstance() {
|
||||
return new ClosingTaskFragment();
|
||||
}
|
||||
private ListView listView;
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.new_fragment_closing_task, container, false);
|
||||
query = new AQuery(getActivity(), view);
|
||||
|
||||
getActivity().findViewById(com.adins.mss.base.R.id.search).setVisibility(View.GONE);
|
||||
getActivity().findViewById(com.adins.mss.base.R.id.spinner).setVisibility(View.GONE);
|
||||
getActivity().setTitle(R.string.title_mn_closing_task);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(Context context) {
|
||||
setHasOptionsMenu(true);
|
||||
super.onAttach(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
|
||||
listView = (ListView) query.id(R.id.listClosingTask).getView();
|
||||
if(Global.ENABLE_USER_HELP &&
|
||||
showDummy &&
|
||||
Global.userHelpDummyGuide.get(ClosingTaskFragment.this.getClass().getSimpleName()) != null &&
|
||||
Global.userHelpDummyGuide.get(ClosingTaskFragment.this.getClass().getSimpleName()).size()>0){
|
||||
listView.setAdapter(ClosingTaskDummyAdapter.getInstance());
|
||||
showDummy=false;
|
||||
UserHelpCOLDummy userHelpCOLDummy = new UserHelpCOLDummy();
|
||||
userHelpCOLDummy.showDummyClosing(ClosingTaskFragment.this.getActivity(),ClosingTaskFragment.this.getClass().getSimpleName(),listView,ClosingTaskAdapter.getInstance());
|
||||
} else {
|
||||
listView.setAdapter(ClosingTaskAdapter.getInstance());
|
||||
}
|
||||
updateCount();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
getActivity().findViewById(com.adins.mss.base.R.id.search).setVisibility(View.GONE);
|
||||
getActivity().findViewById(com.adins.mss.base.R.id.spinner).setVisibility(View.GONE);
|
||||
getActivity().setTitle(R.string.title_mn_closing_task);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
||||
query = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
if(item.getItemId() == R.id.mnGuide){
|
||||
if(!Global.BACKPRESS_RESTRICTION) {
|
||||
listView.setAdapter(ClosingTaskDummyAdapter.getInstance());
|
||||
showDummy = false;
|
||||
UserHelpCOLDummy userHelpCOLDummy = new UserHelpCOLDummy();
|
||||
userHelpCOLDummy.showDummyClosing(ClosingTaskFragment.this.getActivity(), ClosingTaskFragment.this.getClass().getSimpleName(), listView, ClosingTaskAdapter.getInstance());
|
||||
}
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClosingTaskSuccess() {
|
||||
ClosingTaskAdapter.getInstance().clear();
|
||||
ClosingTaskAdapter.getInstance().notifyDataSetChanged();
|
||||
updateCount();
|
||||
}
|
||||
|
||||
private void updateCount() {
|
||||
query.id(R.id.btnClosingTask).clicked(this, "closingTask").text(
|
||||
getString(R.string.title_mn_closing_task) + " (" +
|
||||
ClosingTaskAdapter.getInstance().getCount() + ")");
|
||||
}
|
||||
|
||||
@Keep // subcribe
|
||||
public void closingTask() {
|
||||
if (GlobalData.getSharedGlobalData().getUser() != null) {
|
||||
String uuidUser = GlobalData.getSharedGlobalData().getUser().getUuid_user();
|
||||
boolean isDraft = TaskHDataAccess.getAllTaskByStatus(getActivity(), uuidUser, TaskHDataAccess.STATUS_SEND_SAVEDRAFT).size() != 0;
|
||||
boolean isPending = TaskHDataAccess.getAllTaskByStatus(getActivity(), uuidUser, TaskHDataAccess.STATUS_SEND_PENDING).size() != 0;
|
||||
|
||||
/*boolean isRvPending = TaskHDataAccess.getOneTaskByStatusRV(getActivity(), uuidUser, TaskHDataAccess.STATUS_RV_PENDING) != null;
|
||||
*/
|
||||
if (Global.isIsUploading() || isDraft || isPending) { /*|| isRvPending) {*/
|
||||
final NiftyDialogBuilder dialogBuilder = NiftyDialogBuilder.getInstance(getActivity());
|
||||
dialogBuilder.withTitle(getString(R.string.title_mn_closing_task))
|
||||
.withMessage(getString(R.string.msg_still_uploading_closing_task))
|
||||
.withButton1Text(getString(R.string.btnCancel))
|
||||
.setButton1Click(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View arg0) {
|
||||
dialogBuilder.dismiss();
|
||||
}
|
||||
})
|
||||
.isCancelable(false)
|
||||
.isCancelableOnTouchOutside(true)
|
||||
.show();
|
||||
} else {
|
||||
ClosingTaskRequest request = new ClosingTaskRequest();
|
||||
request.setFlag(ClosingTaskRequest.CLOSING_TASK);
|
||||
|
||||
ClosingTaskSender<ClosingTaskResponse> sender = new ClosingTaskSender<>(
|
||||
getActivity(), request, ClosingTaskResponse.class);
|
||||
sender.setListener(this);
|
||||
sender.execute();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/contentComment"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_toRightOf="@+id/txt_usrCrt"
|
||||
android:minLines="2"
|
||||
android:text="@string/comment"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_usrCrt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@+id/txt_timeCrt"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:gravity="center_vertical"
|
||||
android:background="@drawable/button_background"
|
||||
android:text="@string/comment_item_name"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_timeCrt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_below="@+id/contentComment"
|
||||
android:text="@string/comment_item_date"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="#aaaaaa"/>
|
||||
|
||||
<!-- <View -->
|
||||
<!-- android:layout_width="2dp" -->
|
||||
<!-- android:id="@+id/divider" -->
|
||||
<!-- android:layout_height="match_parent" -->
|
||||
<!-- android:layout_marginLeft="5dp" -->
|
||||
<!-- android:layout_alignBottom="@+id/contentComment" -->
|
||||
<!-- android:layout_toRightOf="@+id/txt_usrCrt" -->
|
||||
<!-- android:layout_alignParentTop="true" -->
|
||||
<!-- android:background="#aaaaaa" /> -->
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
|
@ -0,0 +1,155 @@
|
|||
package com.adins.mss.dao;
|
||||
|
||||
import android.database.Cursor;
|
||||
|
||||
import de.greenrobot.dao.AbstractDao;
|
||||
import de.greenrobot.dao.Property;
|
||||
import de.greenrobot.dao.internal.DaoConfig;
|
||||
import de.greenrobot.dao.database.Database;
|
||||
import de.greenrobot.dao.database.DatabaseStatement;
|
||||
|
||||
import com.adins.mss.dao.PaymentChannel;
|
||||
|
||||
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
|
||||
/**
|
||||
* DAO for table "MS_PAYMENTCHANNEL".
|
||||
*/
|
||||
public class PaymentChannelDao extends AbstractDao<PaymentChannel, String> {
|
||||
|
||||
public static final String TABLENAME = "MS_PAYMENTCHANNEL";
|
||||
|
||||
/**
|
||||
* Properties of entity PaymentChannel.<br/>
|
||||
* Can be used for QueryBuilder and for referencing column names.
|
||||
*/
|
||||
public static class Properties {
|
||||
public final static Property Uuid_paymentchannel = new Property(0, String.class, "uuid_paymentchannel", true, "UUID_PAYMENTCHANNEL");
|
||||
public final static Property Usr_crt = new Property(1, String.class, "usr_crt", false, "USR_CRT");
|
||||
public final static Property Dtm_crt = new Property(2, java.util.Date.class, "dtm_crt", false, "DTM_CRT");
|
||||
public final static Property Is_active = new Property(3, String.class, "is_active", false, "IS_ACTIVE");
|
||||
public final static Property Code = new Property(4, String.class, "code", false, "CODE");
|
||||
public final static Property Description = new Property(5, String.class, "description", false, "DESCRIPTION");
|
||||
public final static Property Payment_limit = new Property(6, Double.class, "payment_limit", false, "PAYMENT_LIMIT");
|
||||
};
|
||||
|
||||
|
||||
public PaymentChannelDao(DaoConfig config) {
|
||||
super(config);
|
||||
}
|
||||
|
||||
public PaymentChannelDao(DaoConfig config, DaoSession daoSession) {
|
||||
super(config, daoSession);
|
||||
}
|
||||
|
||||
/** Creates the underlying database table. */
|
||||
public static void createTable(Database db, boolean ifNotExists) {
|
||||
String constraint = ifNotExists? "IF NOT EXISTS ": "";
|
||||
db.execSQL("CREATE TABLE " + constraint + "\"MS_PAYMENTCHANNEL\" (" + //
|
||||
"\"UUID_PAYMENTCHANNEL\" TEXT PRIMARY KEY NOT NULL ," + // 0: uuid_paymentchannel
|
||||
"\"USR_CRT\" TEXT," + // 1: usr_crt
|
||||
"\"DTM_CRT\" INTEGER," + // 2: dtm_crt
|
||||
"\"IS_ACTIVE\" TEXT," + // 3: is_active
|
||||
"\"CODE\" TEXT," + // 4: code
|
||||
"\"DESCRIPTION\" TEXT," + // 5: description
|
||||
"\"PAYMENT_LIMIT\" REAL);"); // 6: payment_limit
|
||||
}
|
||||
|
||||
/** Drops the underlying database table. */
|
||||
public static void dropTable(Database db, boolean ifExists) {
|
||||
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MS_PAYMENTCHANNEL\"";
|
||||
db.execSQL(sql);
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
@Override
|
||||
protected void bindValues(DatabaseStatement stmt, PaymentChannel entity) {
|
||||
stmt.clearBindings();
|
||||
stmt.bindString(1, entity.getUuid_paymentchannel());
|
||||
|
||||
String usr_crt = entity.getUsr_crt();
|
||||
if (usr_crt != null) {
|
||||
stmt.bindString(2, usr_crt);
|
||||
}
|
||||
|
||||
java.util.Date dtm_crt = entity.getDtm_crt();
|
||||
if (dtm_crt != null) {
|
||||
stmt.bindLong(3, dtm_crt.getTime());
|
||||
}
|
||||
|
||||
String is_active = entity.getIs_active();
|
||||
if (is_active != null) {
|
||||
stmt.bindString(4, is_active);
|
||||
}
|
||||
|
||||
String code = entity.getCode();
|
||||
if (code != null) {
|
||||
stmt.bindString(5, code);
|
||||
}
|
||||
|
||||
String description = entity.getDescription();
|
||||
if (description != null) {
|
||||
stmt.bindString(6, description);
|
||||
}
|
||||
|
||||
Double payment_limit = entity.getPayment_limit();
|
||||
if (payment_limit != null) {
|
||||
stmt.bindDouble(7, payment_limit);
|
||||
}
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
@Override
|
||||
public String readKey(Cursor cursor, int offset) {
|
||||
return cursor.getString(offset + 0);
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
@Override
|
||||
public PaymentChannel readEntity(Cursor cursor, int offset) {
|
||||
PaymentChannel entity = new PaymentChannel( //
|
||||
cursor.getString(offset + 0), // uuid_paymentchannel
|
||||
cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // usr_crt
|
||||
cursor.isNull(offset + 2) ? null : new java.util.Date(cursor.getLong(offset + 2)), // dtm_crt
|
||||
cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // is_active
|
||||
cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // code
|
||||
cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // description
|
||||
cursor.isNull(offset + 6) ? null : cursor.getDouble(offset + 6) // payment_limit
|
||||
);
|
||||
return entity;
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
@Override
|
||||
public void readEntity(Cursor cursor, PaymentChannel entity, int offset) {
|
||||
entity.setUuid_paymentchannel(cursor.getString(offset + 0));
|
||||
entity.setUsr_crt(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
|
||||
entity.setDtm_crt(cursor.isNull(offset + 2) ? null : new java.util.Date(cursor.getLong(offset + 2)));
|
||||
entity.setIs_active(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
|
||||
entity.setCode(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
|
||||
entity.setDescription(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
|
||||
entity.setPayment_limit(cursor.isNull(offset + 6) ? null : cursor.getDouble(offset + 6));
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
@Override
|
||||
protected String updateKeyAfterInsert(PaymentChannel entity, long rowId) {
|
||||
return entity.getUuid_paymentchannel();
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
@Override
|
||||
public String getKey(PaymentChannel entity) {
|
||||
if(entity != null) {
|
||||
return entity.getUuid_paymentchannel();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
@Override
|
||||
protected boolean isEntityUpdateable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,31 @@
|
|||
package com.adins.mss.base.dynamicform;
|
||||
|
||||
import com.adins.mss.foundation.http.MssRequestType;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class JsonRequestLuOnlineView extends MssRequestType implements Serializable {
|
||||
|
||||
@SerializedName("AgrNo")
|
||||
private String agrNo;
|
||||
@SerializedName("RefId")
|
||||
private String refId;
|
||||
|
||||
public String getAgrNo() {
|
||||
return agrNo;
|
||||
}
|
||||
|
||||
public void setAgrNo(String agrNo) {
|
||||
this.agrNo = agrNo;
|
||||
}
|
||||
|
||||
public String getRefId() {
|
||||
return refId;
|
||||
}
|
||||
|
||||
public void setRefId(String refId) {
|
||||
this.refId = refId;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,182 @@
|
|||
package com.adins.mss.foundation.db.dataaccess;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.adins.mss.dao.DaoSession;
|
||||
import com.adins.mss.dao.DepositReportD;
|
||||
import com.adins.mss.dao.DepositReportDDao;
|
||||
import com.adins.mss.foundation.db.DaoOpenHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import de.greenrobot.dao.query.QueryBuilder;
|
||||
|
||||
public class DepositReportDDataAccess {
|
||||
|
||||
// private static DaoOpenHelper daoOpenHelper;
|
||||
|
||||
/**
|
||||
* use to generate dao session that you can access modelDao
|
||||
*
|
||||
* @param context --> context from activity
|
||||
* @return
|
||||
*/
|
||||
protected static DaoSession getDaoSession(Context context) {
|
||||
/*if(daoOpenHelper==null){
|
||||
// if(daoOpenHelper.getDaoSession()==null)
|
||||
daoOpenHelper = new DaoOpenHelper(context);
|
||||
}
|
||||
DaoSession daoSeesion = daoOpenHelper.getDaoSession();
|
||||
return daoSeesion;*/
|
||||
return DaoOpenHelper.getDaoSession(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* get depositReportD dao and you can access the DB
|
||||
*
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
protected static DepositReportDDao getDepositReportDDao(Context context) {
|
||||
return getDaoSession(context).getDepositReportDDao();
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear session, close db and set daoOpenHelper to null
|
||||
*/
|
||||
public static void closeAll() {
|
||||
/*if(daoOpenHelper!=null){
|
||||
daoOpenHelper.closeAll();
|
||||
daoOpenHelper = null;
|
||||
}*/
|
||||
DaoOpenHelper.closeAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* add depositReportD as entity
|
||||
*
|
||||
* @param context
|
||||
* @param depositReportD
|
||||
*/
|
||||
public static void add(Context context, DepositReportD depositReportD) {
|
||||
getDepositReportDDao(context).insertInTx(depositReportD);
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* add depositReportD as list entity
|
||||
*
|
||||
* @param context
|
||||
* @param depositReportDList
|
||||
*/
|
||||
public static void add(Context context, List<DepositReportD> depositReportDList) {
|
||||
getDepositReportDDao(context).insertInTx(depositReportDList);
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* delete all content in table.
|
||||
*
|
||||
* @param context
|
||||
*/
|
||||
public static void clean(Context context) {
|
||||
getDepositReportDDao(context).deleteAll();
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param depositReportD
|
||||
*/
|
||||
public static void delete(Context context, DepositReportD depositReportD) {
|
||||
getDepositReportDDao(context).deleteInTx(depositReportD);
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* delete all record by keyDepositReportH
|
||||
*
|
||||
* @param context
|
||||
* @param keyDepositReportH
|
||||
*/
|
||||
public static void delete(Context context, String keyDepositReportH) {
|
||||
QueryBuilder<DepositReportD> qb = getDepositReportDDao(context).queryBuilder();
|
||||
qb.where(DepositReportDDao.Properties.Uuid_deposit_report_h.eq(keyDepositReportH));
|
||||
qb.build();
|
||||
getDepositReportDDao(context).deleteInTx(qb.list());
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
public static void deleteDummy(Context context) {
|
||||
QueryBuilder<DepositReportD> qb = getDepositReportDDao(context).queryBuilder();
|
||||
qb.where(DepositReportDDao.Properties.Is_sent.eq("10"));
|
||||
qb.build();
|
||||
getDepositReportDDao(context).deleteInTx(qb.list());
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param depositReportD
|
||||
*/
|
||||
public static void update(Context context, DepositReportD depositReportD) {
|
||||
getDepositReportDDao(context).update(depositReportD);
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* select * from table where uuid_depositReportD = param
|
||||
*
|
||||
* @param context
|
||||
* @param keyDepositReportH
|
||||
* @return
|
||||
*/
|
||||
public static List<DepositReportD> getAll(Context context, String keyDepositReportH) {
|
||||
QueryBuilder<DepositReportD> qb = getDepositReportDDao(context).queryBuilder();
|
||||
qb.where(DepositReportDDao.Properties.Uuid_deposit_report_h.eq(keyDepositReportH));
|
||||
qb.build();
|
||||
return qb.list();
|
||||
}
|
||||
|
||||
/**
|
||||
* get all rows from deposit report D
|
||||
* select * from DepositReportD
|
||||
*
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
public static List<DepositReportD> getAll(Context context) {
|
||||
QueryBuilder<DepositReportD> qb = getDepositReportDDao(context).queryBuilder();
|
||||
qb.build();
|
||||
return qb.list();
|
||||
}
|
||||
|
||||
/**
|
||||
* select depositReportD per
|
||||
*
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
|
||||
/**
|
||||
* select * from table where uuid_user = param
|
||||
*
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
public static List<String> getAllUuid(Context context) {
|
||||
|
||||
List<String> result = new ArrayList<String>();
|
||||
|
||||
QueryBuilder<DepositReportD> qb = getDepositReportDDao(context).queryBuilder();
|
||||
qb.build();
|
||||
|
||||
for (int i = 0; i < qb.list().size(); i++) {
|
||||
result.add(qb.list().get(i).getUuid_task_h());
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 361 B |
|
@ -0,0 +1,36 @@
|
|||
package com.adins.mss.base.plugins;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
|
||||
import com.adins.mss.base.R;
|
||||
|
||||
/**
|
||||
* Created by Aditya Purwa on 1/5/2015.
|
||||
* Plugin for activity context.
|
||||
*/
|
||||
public abstract class ActivityPlugin extends Plugin {
|
||||
/**
|
||||
* Initialize a new instance of plugin.
|
||||
*
|
||||
* @param context Context for the plugin. Must be an activity.
|
||||
*/
|
||||
protected ActivityPlugin(Context context) {
|
||||
super(context);
|
||||
if (!(context instanceof Activity)) {
|
||||
throw new IllegalArgumentException(getContext().getString(R.string.plugin_required));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the context as an activity.
|
||||
*
|
||||
* @return Context as activity.
|
||||
*/
|
||||
public Activity getContextAsActivity() {
|
||||
if (!(this.getContext() instanceof Activity)) {
|
||||
throw new IllegalArgumentException(getContext().getString(R.string.plugin_required));
|
||||
}
|
||||
return (Activity) getContext();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue