add project adins

This commit is contained in:
Alfrid Sanjaya Leo Putra 2024-07-25 14:44:22 +07:00
commit f8f85d679d
5299 changed files with 625430 additions and 0 deletions

View file

@ -0,0 +1,218 @@
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.Product;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "MS_PRODUCT".
*/
public class ProductDao extends AbstractDao<Product, String> {
public static final String TABLENAME = "MS_PRODUCT";
/**
* Properties of entity Product.<br/>
* Can be used for QueryBuilder and for referencing column names.
*/
public static class Properties {
public final static Property Uuid_product = new Property(0, String.class, "uuid_product", true, "UUID_PRODUCT");
public final static Property Product_code = new Property(1, String.class, "product_code", false, "PRODUCT_CODE");
public final static Property Product_name = new Property(2, String.class, "product_name", false, "PRODUCT_NAME");
public final static Property Product_desc = new Property(3, String.class, "product_desc", false, "PRODUCT_DESC");
public final static Property Product_value = new Property(4, Integer.class, "product_value", false, "PRODUCT_VALUE");
public final static Property Product_inctv_prctg = new Property(5, Integer.class, "product_inctv_prctg", false, "PRODUCT_INCTV_PRCTG");
public final static Property Lob_image = new Property(6, byte[].class, "lob_image", false, "LOB_IMAGE");
public final static Property Usr_crt = new Property(7, String.class, "usr_crt", false, "USR_CRT");
public final static Property Dtm_crt = new Property(8, java.util.Date.class, "dtm_crt", false, "DTM_CRT");
public final static Property Is_active = new Property(9, String.class, "is_active", false, "IS_ACTIVE");
public final static Property Brand = new Property(10, String.class, "brand", false, "BRAND");
public final static Property Type = new Property(11, String.class, "type", false, "TYPE");
public final static Property Model = new Property(12, String.class, "model", false, "MODEL");
public final static Property Product_file = new Property(13, String.class, "product_file", false, "PRODUCT_FILE");
};
public ProductDao(DaoConfig config) {
super(config);
}
public ProductDao(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_PRODUCT\" (" + //
"\"UUID_PRODUCT\" TEXT PRIMARY KEY NOT NULL ," + // 0: uuid_product
"\"PRODUCT_CODE\" TEXT," + // 1: product_code
"\"PRODUCT_NAME\" TEXT," + // 2: product_name
"\"PRODUCT_DESC\" TEXT," + // 3: product_desc
"\"PRODUCT_VALUE\" INTEGER," + // 4: product_value
"\"PRODUCT_INCTV_PRCTG\" INTEGER," + // 5: product_inctv_prctg
"\"LOB_IMAGE\" BLOB," + // 6: lob_image
"\"USR_CRT\" TEXT," + // 7: usr_crt
"\"DTM_CRT\" INTEGER," + // 8: dtm_crt
"\"IS_ACTIVE\" TEXT," + // 9: is_active
"\"BRAND\" TEXT," + // 10: brand
"\"TYPE\" TEXT," + // 11: type
"\"MODEL\" TEXT," + // 12: model
"\"PRODUCT_FILE\" TEXT);"); // 13: product_file
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MS_PRODUCT\"";
db.execSQL(sql);
}
/** @inheritdoc */
@Override
protected void bindValues(DatabaseStatement stmt, Product entity) {
stmt.clearBindings();
stmt.bindString(1, entity.getUuid_product());
String product_code = entity.getProduct_code();
if (product_code != null) {
stmt.bindString(2, product_code);
}
String product_name = entity.getProduct_name();
if (product_name != null) {
stmt.bindString(3, product_name);
}
String product_desc = entity.getProduct_desc();
if (product_desc != null) {
stmt.bindString(4, product_desc);
}
Integer product_value = entity.getProduct_value();
if (product_value != null) {
stmt.bindLong(5, product_value);
}
Integer product_inctv_prctg = entity.getProduct_inctv_prctg();
if (product_inctv_prctg != null) {
stmt.bindLong(6, product_inctv_prctg);
}
byte[] lob_image = entity.getLob_image();
if (lob_image != null) {
stmt.bindBlob(7, lob_image);
}
String usr_crt = entity.getUsr_crt();
if (usr_crt != null) {
stmt.bindString(8, usr_crt);
}
java.util.Date dtm_crt = entity.getDtm_crt();
if (dtm_crt != null) {
stmt.bindLong(9, dtm_crt.getTime());
}
String is_active = entity.getIs_active();
if (is_active != null) {
stmt.bindString(10, is_active);
}
String brand = entity.getBrand();
if (brand != null) {
stmt.bindString(11, brand);
}
String type = entity.getType();
if (type != null) {
stmt.bindString(12, type);
}
String model = entity.getModel();
if (model != null) {
stmt.bindString(13, model);
}
String product_file = entity.getProduct_file();
if (product_file != null) {
stmt.bindString(14, product_file);
}
}
/** @inheritdoc */
@Override
public String readKey(Cursor cursor, int offset) {
return cursor.getString(offset + 0);
}
/** @inheritdoc */
@Override
public Product readEntity(Cursor cursor, int offset) {
Product entity = new Product( //
cursor.getString(offset + 0), // uuid_product
cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // product_code
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // product_name
cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // product_desc
cursor.isNull(offset + 4) ? null : cursor.getInt(offset + 4), // product_value
cursor.isNull(offset + 5) ? null : cursor.getInt(offset + 5), // product_inctv_prctg
cursor.isNull(offset + 6) ? null : cursor.getBlob(offset + 6), // lob_image
cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // usr_crt
cursor.isNull(offset + 8) ? null : new java.util.Date(cursor.getLong(offset + 8)), // dtm_crt
cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // is_active
cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // brand
cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // type
cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // model
cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13) // product_file
);
return entity;
}
/** @inheritdoc */
@Override
public void readEntity(Cursor cursor, Product entity, int offset) {
entity.setUuid_product(cursor.getString(offset + 0));
entity.setProduct_code(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
entity.setProduct_name(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
entity.setProduct_desc(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
entity.setProduct_value(cursor.isNull(offset + 4) ? null : cursor.getInt(offset + 4));
entity.setProduct_inctv_prctg(cursor.isNull(offset + 5) ? null : cursor.getInt(offset + 5));
entity.setLob_image(cursor.isNull(offset + 6) ? null : cursor.getBlob(offset + 6));
entity.setUsr_crt(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
entity.setDtm_crt(cursor.isNull(offset + 8) ? null : new java.util.Date(cursor.getLong(offset + 8)));
entity.setIs_active(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9));
entity.setBrand(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10));
entity.setType(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11));
entity.setModel(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12));
entity.setProduct_file(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13));
}
/** @inheritdoc */
@Override
protected String updateKeyAfterInsert(Product entity, long rowId) {
return entity.getUuid_product();
}
/** @inheritdoc */
@Override
public String getKey(Product entity) {
if(entity != null) {
return entity.getUuid_product();
} else {
return null;
}
}
/** @inheritdoc */
@Override
protected boolean isEntityUpdateable() {
return true;
}
}

View file

@ -0,0 +1,124 @@
package com.adins.mss.base.todolist.form.todaysplan;
import android.content.Context;
import android.graphics.Color;
import androidx.annotation.NonNull;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.TextView;
import com.adins.mss.base.R;
import com.adins.mss.base.todolist.form.OnTaskListClickListener;
import com.adins.mss.base.todolist.form.PriorityViewAdapter;
import com.adins.mss.dao.TaskH;
import org.acra.util.BoundedLinkedList;
import java.util.HashMap;
import java.util.List;
public class UnplanTaskAdapter extends PriorityViewAdapter {
private OnTaskCheckedListener checkedListener;
private HashMap<String,Integer> selectedTasks;
private String selectedTaskColor = "#DBA9A9A9";
public UnplanTaskAdapter(Context context, List<TaskH> items,HashMap<String,Integer> selectedTasks
,OnTaskCheckedListener checkedListener, OnTaskListClickListener listener, String param) {
super(context, items, listener, param);
mValues = items;
this.checkedListener = checkedListener;
this.selectedTasks = selectedTasks;
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.unplan_task_list_item, parent, false);
return new UnplanTaskViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, final int position) {
UnplanTaskViewHolder unplanTaskVH = (UnplanTaskViewHolder) holder;
if (mValues.size() == 0) {
unplanTaskVH.noData.setVisibility(View.VISIBLE);
unplanTaskVH.taskItem.setVisibility(View.GONE);
} else {
final TaskH taskH = mValues.get(position);
unplanTaskVH.noData.setVisibility(View.GONE);
unplanTaskVH.taskItem.setVisibility(View.VISIBLE);
unplanTaskVH.mItem = taskH;
unplanTaskVH.selectPlanTaskCB.setOnCheckedChangeListener(null);
unplanTaskVH.bind(taskH);
unplanTaskVH.mView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (null != mListener) {
// Notify the active callbacks interface (the activity, if the
// fragment is attached to one) that an item has been selected.
mListener.onItemClickListener(taskH, position);
}
}
});
unplanTaskVH.selectPlanTaskCB.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if(checkedListener!=null){
if(isChecked){
checkedListener.onTaskChecked(taskH,position);
}
else{
checkedListener.onTaskUnchecked(taskH,position);
}
}
}
});
}
}
public HashMap<String, Integer> getSelectedTasks() {
return selectedTasks;
}
public void notifySelectedSequenceChanged(HashMap<String,Integer> newSelectSequences){
selectedTasks = newSelectSequences;
notifyDataSetChanged();
}
public class UnplanTaskViewHolder extends PriorityViewAdapter.ViewHolder{
//checkbox
private CheckBox selectPlanTaskCB;
private TextView selectedSequence;
public UnplanTaskViewHolder(View view) {
super(view);
selectPlanTaskCB = view.findViewById(R.id.selectPlanTaskCB);
selectedSequence = view.findViewById(R.id.selectedSequence);
}
@Override
public void bind(TaskH taskH) {
super.bind(taskH);
//set checkbox state depend on data
if(selectedTasks.containsKey(taskH.getUuid_task_h())){
Integer seq = selectedTasks.get(taskH.getUuid_task_h());
if(seq != null){
selectedSequence.setVisibility(View.VISIBLE);
selectedSequence.setText(seq+"");
}
selectPlanTaskCB.setChecked(true);
taskHeader.setCardBackgroundColor(Color.parseColor(selectedTaskColor));
}
else {
selectedSequence.setVisibility(View.GONE);
selectPlanTaskCB.setChecked(false);
taskHeader.setCardBackgroundColor(Color.parseColor("#FFFFFF"));
}
}
}
}

View file

@ -0,0 +1,12 @@
package com.adins.mss.foundation.sync.api;
import java.util.List;
/**
* Created by adityapurwa on 16/03/15.
*/
public interface FakeSynchronizationCallback<T> {
void onSuccess(List<T> entities);
void onFailed(String errMessage);
}

View file

@ -0,0 +1,45 @@
package com.adins.mss.dummy.userhelp_dummy.Adapter;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.adins.mss.base.GlobalData;
import com.adins.mss.base.R;
import com.adins.mss.constant.Global;
public class NewTaskLogDummyAdapter extends RecyclerView.Adapter<NewTaskLogDummyAdapter.NewTaskLogDummyHolder> {
@NonNull
@Override
public NewTaskLogDummyHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
View v = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.new_log_item,viewGroup,false);
NewTaskLogDummyHolder viewHolder = new NewTaskLogDummyHolder(v);
return viewHolder;
}
@Override
public void onBindViewHolder(@NonNull NewTaskLogDummyHolder newTaskLogDummyHolder, int i) {
}
@Override
public int getItemCount() {
return 1;
}
public class NewTaskLogDummyHolder extends RecyclerView.ViewHolder {
ImageView imgPrint;
public NewTaskLogDummyHolder(@NonNull View itemView) {
super(itemView);
imgPrint = itemView.findViewById(R.id.imgPrint);
String application = GlobalData.getSharedGlobalData().getAuditData().getApplication();
if(Global.APPLICATION_COLLECTION.equalsIgnoreCase(application)){
imgPrint.setVisibility(View.VISIBLE);
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View file

@ -0,0 +1,25 @@
package com.adins.mss.base.loyalti.model;
import com.google.gson.annotations.SerializedName;
public class PointDetail {
@SerializedName("REWARD_PROGRAM")
public String rewardProgram;
@SerializedName("POINT")
public String point;
public transient int colorValue;
public PointDetail() {
}
public PointDetail(String rewardProgram, String point) {
this.rewardProgram = rewardProgram;
this.point = point;
}
public PointDetail(String rewardProgram, String point, int colorValue) {
this.rewardProgram = rewardProgram;
this.point = point;
this.colorValue = colorValue;
}
}