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,100 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:background="@color/tv_white"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_weight="1">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="0dp"
android:padding="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/installment_schedule"
android:textStyle="bold"
android:textSize="24sp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="8dp"
android:orientation="horizontal">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label_agreement_number"
android:textColor="#666"
android:textSize="15sp"/>
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/dummy_number"
android:id="@+id/agreementNumber"
android:textColor="#666"
android:textSize="15sp"/>
</LinearLayout>
<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="2"
android:id="@+id/tableHeaders">
<TableRow android:layout_width="match_parent" android:layout_height="wrap_content"
android:paddingTop="8dp"
android:background="@drawable/spinner_background"
android:paddingBottom="8dp">
<TextView android:text="@string/label_no"
android:textSize="12sp"
android:paddingRight="6dp"
android:paddingLeft="6dp"
android:gravity="center"
android:textColor="@color/tv_white"
android:textStyle="bold"/>
<TextView android:text="@string/label_due_date"
android:textSize="12sp"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:textColor="@color/tv_white"
android:textStyle="bold"/>
<TextView android:text="@string/label_amount_installment"
android:textSize="12sp"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:textColor="@color/tv_white"
android:textStyle="bold"/>
<TextView android:text="@string/label_amount_paid"
android:minWidth="100dp"
android:textSize="12sp"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:textColor="@color/tv_white"
android:textStyle="bold"/>
</TableRow>
</TableLayout>
</HorizontalScrollView>
</LinearLayout>
</ScrollView>
<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="bottom">
<ImageButton android:id="@+id/imageBtnDownload"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/ic_download"
android:background="@android:color/transparent"/>
</LinearLayout>
</LinearLayout>

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<com.adins.mss.foundation.questiongenerator.form.QuestionView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/questionTextLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="0. label"
android:id="@+id/questionTextLabel" />
<EditText
android:id="@+id/questionTextAnswer"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</com.adins.mss.foundation.questiongenerator.form.QuestionView>

View file

@ -0,0 +1,695 @@
package com.adins.mss.base.timeline;
import android.content.Context;
import com.adins.mss.base.GlobalData;
import com.adins.mss.base.R;
import com.adins.mss.base.crashlytics.FireCrash;
import com.adins.mss.constant.Global;
import com.adins.mss.dao.LocationInfo;
import com.adins.mss.dao.Lookup;
import com.adins.mss.dao.Message;
import com.adins.mss.dao.TaskD;
import com.adins.mss.dao.TaskH;
import com.adins.mss.dao.Timeline;
import com.adins.mss.dao.TimelineType;
import com.adins.mss.dao.User;
import com.adins.mss.foundation.db.dataaccess.LookupDataAccess;
import com.adins.mss.foundation.db.dataaccess.TaskDDataAccess;
import com.adins.mss.foundation.db.dataaccess.TaskHDataAccess;
import com.adins.mss.foundation.db.dataaccess.TimelineDataAccess;
import com.adins.mss.foundation.db.dataaccess.TimelineTypeDataAccess;
import com.adins.mss.foundation.formatter.Formatter;
import com.adins.mss.foundation.formatter.Tool;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* @author gigin.ginanjar
*/
public class TimelineManager {
private Context context;
public TimelineManager(Context context) {
this.context = context;
}
/**
* Gets List of Timeline from Database
*
* @param context
* @return all Timeline
*/
public static List<Timeline> getAllTimeline(Context context) {
return TimelineDataAccess.getAll(context, GlobalData.getSharedGlobalData().getUser().getUuid_user());
}
public static List<Timeline> getAllTimelineWithLimitedDay(Context context, int range) {
int minRange = 0 - range;
try {
if (minRange != 0) {
List<Timeline> alltimeline = TimelineDataAccess.getAllDeletedTimeline(context, GlobalData.getSharedGlobalData().getUser().getUuid_user(), minRange);
for (Timeline timeline : alltimeline) {
TimelineDataAccess.delete(context, timeline);
}
}
} catch (Exception e) {
FireCrash.log(e);
}
if (minRange != 0) {
return TimelineDataAccess.getAllWithLimitedDay(context, GlobalData.getSharedGlobalData().getUser().getUuid_user(), minRange);
} else {
return getAllTimeline(context);
}
}
public static List<Timeline> getAllTimelineByTypeWithLimitedDay(Context context, int range, String timelineType) {
int minRange = 0 - range;
String uuidUser = GlobalData.getSharedGlobalData().getUser().getUuid_user();
List<Timeline> listTimelines;
List<Timeline> newTimelines = new ArrayList<>();
try {
if (minRange != 0) {
List<Timeline> alltimeline = TimelineDataAccess.getAllDeletedTimelineByType(context, GlobalData.getSharedGlobalData().getUser().getUuid_user(), minRange, timelineType);
for (Timeline timeline : alltimeline) {
TimelineDataAccess.delete(context, timeline);
}
}
} catch (Exception e) {
FireCrash.log(e);
}
if (minRange != 0) {
listTimelines = TimelineDataAccess.getAllWithLimitedDayByType(context, uuidUser, minRange, timelineType);
} else {
listTimelines = TimelineDataAccess.getAllTimelineByType(context, uuidUser, timelineType);
}
if (listTimelines != null) {
for (Timeline temp : listTimelines) {
List<Timeline> groupTimeline = TimelineDataAccess.getTimelineByTask(context, uuidUser, temp.getUuid_task_h());
Timeline timeline = groupTimeline.get(groupTimeline.size()-1);
TimelineType type = TimelineTypeDataAccess.getTimelineTypebyType(context, timelineType);
if (timeline.getUuid_timeline_type().equalsIgnoreCase(type.getUuid_timeline_type())) {
newTimelines.add(timeline);
}
}
}
return newTimelines;
}
public static List<Timeline> getAllTimelineTaskWithLimitedDay(Context context, int range, String timelineType, String priority) {
int minRange = 0 - range;
try {
if (minRange != 0) {
List<Timeline> alltimeline = TimelineDataAccess.getAllDeletedTimelineTask(context, GlobalData.getSharedGlobalData().getUser().getUuid_user(), minRange, timelineType, priority);
for (Timeline timeline : alltimeline) {
TimelineDataAccess.delete(context, timeline);
}
}
} catch (Exception e) {
FireCrash.log(e);
}
if (minRange != 0) {
return TimelineDataAccess.getAllWithLimitedDayTask(context, GlobalData.getSharedGlobalData().getUser().getUuid_user(), minRange, timelineType, priority);
} else {
return TimelineDataAccess.getAllTimelineTask(context, GlobalData.getSharedGlobalData().getUser().getUuid_user(), timelineType, priority);
}
}
public static Timeline getTimeline(Context context, String uuidUser, String uuidTimeline) {
return TimelineDataAccess.getOneTimeline(context, uuidUser, uuidTimeline);
}
public static List<Timeline> getAllTimeline(Context context, String uuidUser) {
return TimelineDataAccess.getAll(context, uuidUser);
}
public static Timeline getTimelineByDescription(Context context, String Description) {
List<Timeline> list = getAllTimeline(context, GlobalData.getSharedGlobalData().getUser().getUuid_user());
Timeline timeline = null;
for (Timeline tempTimeline : list) {
if (tempTimeline.getDescription().equals(Description)) {
timeline = tempTimeline;
}
}
return timeline;
}
/**
* Method for insert Timeline to Database by timeline
*
* @param context - Context
* @param timeline - Timeline
*/
public static void insertTimeline(Context context, Timeline timeline) {
TimelineDataAccess.add(context, timeline);
}
/**
* Method for insert Timeline to Database, use by Checkin and Checkout
*
* @param context - context
* @param description - String description
* @param latitude - String latitude
* @param longitude - String longitude
* @param usr_crt - String User Create
* @param dtm_crt - String date time create
* @param timeline_type - String timeline type
* @param bitmapArray - byte[] byte image
*/
public static void insertTimeline(Context context, String description, String latitude, String longitude, String usr_crt, Date dtm_crt, String name, String address, String agreement_no, String amount_due, String overdue, String installment_no, String timeline_type, byte[] bitmapArray) {
Context mContext;
mContext = context;
String uuid_timeline = Tool.getUUID();
Date dtm_crt_server = null;
String uuid_task_h = "";
String uuid_user = GlobalData.getSharedGlobalData().getUser().getUuid_user();
String uuid_message = "";
String attdAddress = "";
String priority = "";
String isVerification = "";
String collResult = "";
String accountName = "";
String productName = "";
String statusCode = "";
TimelineType timelineType = TimelineTypeDataAccess.getTimelineTypebyType(mContext, timeline_type);
Timeline temptimeline = new Timeline(uuid_timeline, description, latitude, longitude, dtm_crt_server, name, address, agreement_no, amount_due, overdue, installment_no, attdAddress, priority, isVerification, collResult, accountName, productName, statusCode, usr_crt, dtm_crt, uuid_task_h, uuid_user, null, uuid_message, bitmapArray);
temptimeline.setTimelineType(timelineType);
User nUser = null;
try {
nUser = GlobalData.getSharedGlobalData().getUser();
} catch (Exception e) {
FireCrash.log(e);
}
if (nUser != null)
temptimeline.setUser(nUser);
else
temptimeline.setUser(GlobalData.getSharedGlobalData().getUser());
TimelineDataAccess.add(mContext, temptimeline);
}
/**
* Method for insert Timeline to Database, use by Submitted task and Server Task
*
* @param context - Context
* @param description - String Description
* @param usr_crt - String user create
* @param dtm_crt - Date date time create
* @param timeline_type - String timeline type
* @param uuid_task_h - String uuid task H
*/
public static void insertTimeline(Context context, String uuid_task_h, String description, String usr_crt, Date dtm_crt, String name, String address, String agreement_no, String amount_due, String overdue, String installment_no, String timeline_type) {
Context mContext;
mContext = context;
String uuid_timeline = Tool.getUUID();
Date dtm_crt_server = null;
String latitude = "0.0";
String longitude = "0.0";
String attdAddress = "";
String uuid_message = "";
String priority = "";
String uuid_user = GlobalData.getSharedGlobalData().getUser().getUuid_user();
String isVerification = "";
String collResult = "";
String accountName = "";
String productName = "";
String statusCode = "";
TimelineType timelineType = TimelineTypeDataAccess.getTimelineTypebyType(mContext, timeline_type);
Timeline temptimeline = new Timeline(uuid_timeline, description, latitude, longitude, dtm_crt_server, name, address, agreement_no, amount_due, overdue, installment_no, attdAddress, priority, isVerification, collResult, accountName, productName, statusCode, usr_crt, dtm_crt, uuid_task_h, uuid_user, null, uuid_message, null);
temptimeline.setTimelineType(timelineType);
User nUser = null;
try {
nUser = GlobalData.getSharedGlobalData().getUser();
} catch (Exception e) {
FireCrash.log(e);
}
if (nUser != null)
temptimeline.setUser(nUser);
else
temptimeline.setUser(GlobalData.getSharedGlobalData().getUser());
TimelineDataAccess.add(mContext, temptimeline);
}
/**
* Method for insert Timeline to Database by Message
*
* @param context - Context
* @param message
*/
public static void insertTimeline(Context context, Message message) {
Context mContext;
mContext = context;
String uuid_timeline = Tool.getUUID();
Date dtm_crt_server = message.getDtm_crt_server();
String uuid_task_h = "";
String description = message.getMessage();
String latitude = "0.0";
String longitude = "0.0";
String name = "";
String address = "";
String agreement_no = "";
String amount_due = "";
String overdue = "";
String installment_no = "";
String attdAddress = "";
String priority = "";
String uuid_message = message.getUuid_message();
String usr_crt = message.getUsr_crt();
Date dtm_crt = message.getDtm_crt_server();
String timeline_type = Global.TIMELINE_TYPE_MESSAGE;
String uuid_user = message.getUuid_user();
String isVerification = "";
String collResult = "";
String accountName = "";
String productName = "";
String statusCode = "";
TimelineType timelineType = TimelineTypeDataAccess.getTimelineTypebyType(mContext, timeline_type);
Timeline temptimeline = new Timeline(uuid_timeline, description, latitude, longitude, dtm_crt_server, name, address, agreement_no, amount_due, overdue, installment_no, attdAddress, priority, isVerification, collResult, accountName, productName, statusCode, usr_crt, dtm_crt, uuid_task_h, uuid_user, null, uuid_message, null);
temptimeline.setTimelineType(timelineType);
User nUser = null;
try {
nUser = GlobalData.getSharedGlobalData().getUser();
} catch (Exception e) {
FireCrash.log(e);
}
if (nUser != null)
temptimeline.setUser(nUser);
else
temptimeline.setUser(GlobalData.getSharedGlobalData().getUser());
temptimeline.setMessage(message);
TimelineDataAccess.add(mContext, temptimeline);
}
/**
* Method for insert Timeline to Database by Message
*
* @param context - Context
*/
public static void insertTimelinePushNotification(Context context, String description) {
Context mContext;
mContext = context;
String uuid_timeline = Tool.getUUID();
Date dtm_crt_server = new Date();
String uuid_task_h = "";
String latitude = "0.0";
String longitude = "0.0";
String name = "";
String address = "";
String agreement_no = "";
String amount_due = "";
String overdue = "";
String installment_no = "";
String attdAddress = "";
String priority = "";
String uuid_message = Tool.getUUID();
String usr_crt = new Date().toString();
Date dtm_crt = new Date();
String timeline_type = Global.TIMELINE_TYPE_PUSH_NOTIFICATION;
String uuid_user = GlobalData.getSharedGlobalData().getUser().getUuid_user();
String isVerification = "";
String collResult = "";
String accountName = "";
String productName = "";
String statusCode = "";
TimelineType timelineType = TimelineTypeDataAccess.getTimelineTypebyType(mContext, timeline_type);
Timeline temptimeline = new Timeline(uuid_timeline, description, latitude, longitude, dtm_crt_server, name, address, agreement_no, amount_due, overdue, installment_no, attdAddress, priority, isVerification, collResult, accountName, productName, statusCode, usr_crt, dtm_crt, uuid_task_h, uuid_user, null, uuid_message, null);
temptimeline.setTimelineType(timelineType);
User nUser = null;
try {
nUser = GlobalData.getSharedGlobalData().getUser();
} catch (Exception e) {
FireCrash.log(e);
}
if (nUser != null)
temptimeline.setUser(nUser);
else
temptimeline.setUser(GlobalData.getSharedGlobalData().getUser());
TimelineDataAccess.add(mContext, temptimeline);
}
/**
* @param context
* @param taskH
*/
public static void insertTimeline(Context context, TaskH taskH) {
Context mContext;
mContext = context;
String uuid_timeline = Tool.getUUID();
Date dtm_crt_server = taskH.getAssignment_date();
String uuid_task_h = taskH.getUuid_task_h();
String description = "";
String name = taskH.getCustomer_name();
String address = taskH.getCustomer_address();
String agreement_no = "";
String amount_due = "";
String overdue = "";
String installment_no = "";
String isVerification = "";
String collResult = "";
String accountName = "";
String productName = "";
String statusCode = "";
if (TaskHDataAccess.STATUS_TASK_VERIFICATION.equals(taskH.getStatus()) ||
TaskHDataAccess.STATUS_TASK_VERIFICATION_DOWNLOAD.equals(taskH.getStatus()) ||
(taskH.getIs_prepocessed() != null && taskH.getIs_prepocessed().equals(Global.FORM_TYPE_VERIFICATION))) {
isVerification = Global.FORM_TYPE_VERIFICATION;
} else if (TaskHDataAccess.STATUS_TASK_APPROVAL.equals(taskH.getStatus()) ||
TaskHDataAccess.STATUS_TASK_APPROVAL_DOWNLOAD.equals(taskH.getStatus()) ||
(taskH.getIs_prepocessed() != null && taskH.getIs_prepocessed().equals(Global.FORM_TYPE_APPROVAL))) {
isVerification = Global.FORM_TYPE_APPROVAL;
}
String application = GlobalData.getSharedGlobalData().getAuditData().getApplication();
if (Global.APPLICATION_COLLECTION.equalsIgnoreCase(application)) {
// olivia : tambahan simpan collection result di timeline
TaskD taskdCollResult = TaskDDataAccess.getOneFromTaskDWithTag(context, taskH.getUuid_task_h(), Global.TAG_COLLECTION_RESULT);
if (taskdCollResult != null) {
Lookup lookup = LookupDataAccess.getOneByCode(context, taskdCollResult.getUuid_lookup(), taskdCollResult.getLov());
if (lookup != null) {
TaskD taskdTotalBayar = TaskDDataAccess.getOneFromTaskDWithTag(context, taskH.getUuid_task_h(), Global.TAG_TOTAL);
TaskD tasdPTP = TaskDDataAccess.getOneFromTaskDWithTag(context, taskH.getUuid_task_h(), Global.TAG_PTP);
if (taskdTotalBayar != null) {
collResult = lookup.getValue() + " - " + taskdTotalBayar.getText_answer();
} else if (tasdPTP != null) {
String ptpDate = "";
if (!tasdPTP.getText_answer().contains("/")) {
String format = Global.DATE_STR_FORMAT_GSON;
Date date = null;
try {
date = Formatter.parseDate(tasdPTP.getText_answer(), format);
} catch (ParseException e) {
e.printStackTrace();
}
ptpDate = Formatter.formatDate(date, Global.DATE_STR_FORMAT);
} else {
ptpDate = tasdPTP.getText_answer();
}
collResult = lookup.getValue() + " - " + ptpDate;
} else {
collResult = lookup.getValue();
}
}
}
agreement_no = taskH.getAppl_no();
if (taskH.getAmt_due() == null || "".equals(taskH.getAmt_due())) {
amount_due = "-";
} else {
amount_due = Tool.separateThousand(taskH.getAmt_due());
}
if (taskH.getOd() == null || "".equals(taskH.getOd())) {
overdue = "-";
} else {
overdue = taskH.getOd() + " " + context.getString(R.string.txtDay);
}
if (taskH.getInst_no() == null || "".equals(taskH.getInst_no())) {
installment_no = "-";
} else {
installment_no = taskH.getInst_no();
}
}
if (taskH.getMessage() != null)
description = taskH.getMessage();
String latitude = taskH.getLatitude();
String longitude = taskH.getLongitude();
String attdAddress = "";
String uuid_message = "";
String usr_crt = taskH.getUsr_crt();
String priority = taskH.getPriority();
Date dtm_crt = null;
String timeline_type = null;
if (TaskHDataAccess.STATUS_SEND_SENT.equals(taskH.getStatus())) {
dtm_crt = Tool.getSystemDateTime();
timeline_type = Global.TIMELINE_TYPE_SUBMITTED;
} else if (TaskHDataAccess.STATUS_SEND_INIT.equals(taskH.getStatus())) {
timeline_type = Global.TIMELINE_TYPE_TASK;
dtm_crt = taskH.getAssignment_date();
if (dtm_crt == null)
dtm_crt = Tool.getSystemDateTime();
} else if (TaskHDataAccess.STATUS_TASK_VERIFICATION.equals(taskH.getStatus()) ||
TaskHDataAccess.STATUS_TASK_VERIFICATION_DOWNLOAD.equals(taskH.getStatus())) {
timeline_type = Global.TIMELINE_TYPE_VERIFICATION;
dtm_crt = taskH.getAssignment_date();
if (dtm_crt == null) {
dtm_crt = taskH.getDtm_crt();
}
if (dtm_crt == null) {
dtm_crt = Tool.getSystemDateTime();
}
} else if (TaskHDataAccess.STATUS_TASK_APPROVAL.equals(taskH.getStatus()) ||
TaskHDataAccess.STATUS_TASK_APPROVAL_DOWNLOAD.equals(taskH.getStatus())) {
timeline_type = Global.TIMELINE_TYPE_APPROVAL;
dtm_crt = taskH.getAssignment_date();
if (dtm_crt == null) {
dtm_crt = taskH.getDtm_crt();
}
if (dtm_crt == null) {
dtm_crt = Tool.getSystemDateTime();
}
} else if (TaskHDataAccess.STATUS_SEND_DOWNLOAD.equals(taskH.getStatus())) {
timeline_type = Global.TIMELINE_TYPE_TASK;
dtm_crt = taskH.getAssignment_date();
}
else if (TaskHDataAccess.STATUS_SEND_PENDING.equals(taskH.getStatus())) {
dtm_crt = Tool.getSystemDateTime();
timeline_type = Global.TIMELINE_TYPE_PENDING;
} else if (TaskHDataAccess.STATUS_SEND_UPLOADING.equals(taskH.getStatus())) {
dtm_crt = Tool.getSystemDateTime();
timeline_type = Global.TIMELINE_TYPE_UPLOADING;
} else if (TaskHDataAccess.STATUS_SEND_SAVEDRAFT.equals(taskH.getStatus())) {
dtm_crt = Tool.getSystemDateTime();
timeline_type = Global.TIMELINE_TYPE_SAVEDRAFT;
} else if (TaskHDataAccess.STATUS_SEND_FAILEDDRAFT.equals(taskH.getStatus())) {
dtm_crt = Tool.getSystemDateTime();
taskH.setSubmit_date(null);
taskH.setStatus(TaskHDataAccess.STATUS_SEND_SAVEDRAFT);
TaskHDataAccess.addOrReplace(context, taskH);
timeline_type = Global.TIMELINE_TYPE_FAILEDDRAFT;
} else if (TaskHDataAccess.STATUS_TASK_CHANGED.equals(taskH.getStatus())) {
if (taskH.getSubmit_date() != null)
dtm_crt = taskH.getSubmit_date();
else {
dtm_crt = Tool.getSystemDateTime();
}
timeline_type = Global.TIMELINE_TYPE_CHANGED;
}
String uuid_user = taskH.getUuid_user();
TimelineType timelineType = TimelineTypeDataAccess.getTimelineTypebyType(mContext, timeline_type);
TimelineType timelineFailedType = TimelineTypeDataAccess.getTimelineTypebyType(mContext, Global.TIMELINE_TYPE_FAILEDDRAFT);
Timeline timeline = TimelineDataAccess.getOneTimelineByTaskH(context, GlobalData.getSharedGlobalData().getUser().getUuid_user(), uuid_task_h, timelineType.getUuid_timeline_type());
List<Timeline> listTimeline = TimelineDataAccess.getTimelineByTaskH(context, GlobalData.getSharedGlobalData().getUser().getUuid_user(), uuid_task_h, timelineType.getUuid_timeline_type());
List<Timeline> listTimelineDraftFailed = TimelineDataAccess.getTimelineByTaskH(context, GlobalData.getSharedGlobalData().getUser().getUuid_user(), uuid_task_h, timelineFailedType.getUuid_timeline_type());
if (timeline == null || ((!listTimelineDraftFailed.isEmpty()) && (listTimeline.size()< listTimelineDraftFailed.size()+1))) {
Timeline temptimeline = new Timeline(uuid_timeline, description, latitude, longitude, dtm_crt_server, name, address, agreement_no, amount_due, overdue, installment_no, attdAddress, priority, isVerification, collResult, accountName, productName, statusCode, usr_crt, dtm_crt, uuid_task_h, uuid_user, null, uuid_message, null);
temptimeline.setTimelineType(timelineType);
User nUser = null;
try {
nUser = GlobalData.getSharedGlobalData().getUser();
} catch (Exception e) {
FireCrash.log(e);
}
if (nUser != null)
temptimeline.setUser(nUser);
else
temptimeline.setUser(GlobalData.getSharedGlobalData().getUser());
temptimeline.setTaskH(taskH);
TimelineDataAccess.add(mContext, temptimeline);
} else {
timeline.setName(taskH.getCustomer_name());
timeline.setAddress(taskH.getCustomer_address());
timeline.setTimelineType(timelineType);
timeline.setDescription(description);
timeline.setDtm_crt(dtm_crt);
TimelineDataAccess.addOrReplace(mContext, timeline);
}
}
public static void insertTimeline(Context context, TaskH taskH, boolean isVerified, boolean isReject) {
Context mContext;
mContext = context;
String uuid_timeline = Tool.getUUID();
Date dtm_crt_server = taskH.getAssignment_date();
String uuid_task_h = taskH.getUuid_task_h();
String description = "";
String name = taskH.getCustomer_name();
String address = taskH.getCustomer_address();
String agreement_no = "";
String amount_due = "";
String overdue = "";
String installment_no = "";
String priority = taskH.getPriority();
String isVerification = "";
String collResult = "";
String accountName = "";
String productName = "";
String statusCode = "";
if (TaskHDataAccess.STATUS_TASK_VERIFICATION.equals(taskH.getStatus()) ||
TaskHDataAccess.STATUS_TASK_VERIFICATION_DOWNLOAD.equals(taskH.getStatus()) ||
(taskH.getIs_prepocessed() != null && taskH.getIs_prepocessed().equals(Global.FORM_TYPE_VERIFICATION))) {
isVerification = Global.FORM_TYPE_VERIFICATION;
} else if (TaskHDataAccess.STATUS_TASK_APPROVAL.equals(taskH.getStatus()) ||
TaskHDataAccess.STATUS_TASK_APPROVAL_DOWNLOAD.equals(taskH.getStatus()) ||
(taskH.getIs_prepocessed() != null && taskH.getIs_prepocessed().equals(Global.FORM_TYPE_APPROVAL))) {
isVerification = Global.FORM_TYPE_APPROVAL;
}
if (taskH.getMessage() != null)
description = taskH.getMessage();
String latitude = taskH.getLatitude();
String longitude = taskH.getLongitude();
String attdAddress = "";
String uuid_message = "";
String usr_crt = taskH.getUsr_crt();
Date dtm_crt = null;
String timeline_type = null;
if (isVerified) {
if (isReject) {
dtm_crt = taskH.getSubmit_date();
timeline_type = Global.TIMELINE_TYPE_REJECTED;
} else {
dtm_crt = taskH.getSubmit_date();
timeline_type = Global.TIMELINE_TYPE_VERIFIED;
}
} else {
if (isReject) {
dtm_crt = taskH.getSubmit_date();
timeline_type = Global.TIMELINE_TYPE_REJECTED;
} else {
dtm_crt = taskH.getSubmit_date();
timeline_type = Global.TIMELINE_TYPE_APPROVED;
}
}
String uuid_user = taskH.getUuid_user();
TimelineType timelineType = TimelineTypeDataAccess.getTimelineTypebyType(mContext, timeline_type);
Timeline timeline = TimelineDataAccess.getOneTimelineByTaskH(context, GlobalData.getSharedGlobalData().getUser().getUuid_user(), uuid_task_h, timelineType.getUuid_timeline_type());
if (timeline == null) {
Timeline temptimeline = new Timeline(uuid_timeline, description, latitude, longitude, dtm_crt_server, name, address, agreement_no, amount_due, overdue, installment_no, attdAddress, priority, isVerification, collResult, accountName, productName, statusCode, usr_crt, dtm_crt, uuid_task_h, uuid_user, null, uuid_message, null);
temptimeline.setTimelineType(timelineType);
User nUser = null;
try {
nUser = GlobalData.getSharedGlobalData().getUser();
} catch (Exception e) {
FireCrash.log(e);
}
if (nUser != null)
temptimeline.setUser(nUser);
else
temptimeline.setUser(GlobalData.getSharedGlobalData().getUser());
temptimeline.setTaskH(taskH);
TimelineDataAccess.add(mContext, temptimeline);
}
}
public static void insertTimeline(Context context, LocationInfo locationInfo, String description, String attdAddress, byte[] bitmapArray) {
Context mContext;
mContext = context;
String uuid_timeline = Tool.getUUID();
Date dtm_crt_server = null;
String uuid_task_h = "";
String latitude = locationInfo.getLatitude();
String longitude = locationInfo.getLongitude();
String uuid_message = "";
String name = "";
String address = "";
String agreement_no = "";
String amount_due = "";
String overdue = "";
String installment_no = "";
String priority = "";
String usr_crt = locationInfo.getUsr_crt();
Date dtm_crt = locationInfo.getDtm_crt();
String timeline_type = null;
String isVerification = "";
String collResult = "";
String accountName = "";
String productName = "";
String statusCode = "";
if (Global.LOCATION_TYPE_CHECKIN.equals(locationInfo.getLocation_type()))
timeline_type = Global.TIMELINE_TYPE_CHECKIN;
else if (Global.TIMELINE_TYPE_CHECKOUT.equals(locationInfo.getLocation_type()))
timeline_type = Global.TIMELINE_TYPE_CHECKOUT;
String uuid_user = locationInfo.getUuid_user();
TimelineType timelineType = TimelineTypeDataAccess.getTimelineTypebyType(mContext, timeline_type);
Timeline temptimeline = new Timeline(uuid_timeline, description, latitude, longitude, dtm_crt_server, name, address, agreement_no, amount_due, overdue, installment_no, attdAddress, priority, isVerification, collResult, accountName, productName, statusCode, usr_crt, dtm_crt, uuid_task_h, uuid_user, null, uuid_message, bitmapArray);
temptimeline.setTimelineType(timelineType);
User nUser = null;
try {
nUser = GlobalData.getSharedGlobalData().getUser();
} catch (Exception e) {
FireCrash.log(e);
}
if (nUser != null)
temptimeline.setUser(nUser);
else
temptimeline.setUser(GlobalData.getSharedGlobalData().getUser());
TimelineDataAccess.add(mContext, temptimeline);
}
/**
* Method for insert Timeline List to Database
*
* @param context - Context
* @param timeline - Timeline
*/
public static void insertTimeline(Context context, List<Timeline> timeline) {
TimelineDataAccess.add(context, timeline);
}
/**
* Gets List of Timeline from Database
*
* @param context
* @param timelineType
* @return all timeline by type
*/
public List<Timeline> getAllTimelineByType(Context context, String timelineType) {
TimelineType type = TimelineTypeDataAccess.getTimelineTypebyType(context, timelineType);
String uuid_timeline_type = type.getUuid_timeline_type();
return TimelineDataAccess.getAll(context, GlobalData.getSharedGlobalData().getUser().getUuid_user(), uuid_timeline_type);
}
}

View file

@ -0,0 +1,284 @@
package com.adins.mss.dao;
import java.util.List;
import java.util.ArrayList;
import android.database.Cursor;
import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.Property;
import de.greenrobot.dao.internal.SqlUtils;
import de.greenrobot.dao.internal.DaoConfig;
import de.greenrobot.dao.database.Database;
import de.greenrobot.dao.database.DatabaseStatement;
import de.greenrobot.dao.query.Query;
import de.greenrobot.dao.query.QueryBuilder;
import com.adins.mss.dao.DepositReportD;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "TR_DEPOSITREPORT_D".
*/
public class DepositReportDDao extends AbstractDao<DepositReportD, String> {
public static final String TABLENAME = "TR_DEPOSITREPORT_D";
/**
* Properties of entity DepositReportD.<br/>
* Can be used for QueryBuilder and for referencing column names.
*/
public static class Properties {
public final static Property Uuid_deposit_report_d = new Property(0, String.class, "uuid_deposit_report_d", true, "UUID_DEPOSIT_REPORT_D");
public final static Property Uuid_task_h = new Property(1, String.class, "uuid_task_h", false, "UUID_TASK_H");
public final static Property Deposit_amt = new Property(2, String.class, "deposit_amt", false, "DEPOSIT_AMT");
public final static Property Usr_crt = new Property(3, String.class, "usr_crt", false, "USR_CRT");
public final static Property Dtm_crt = new Property(4, java.util.Date.class, "dtm_crt", false, "DTM_CRT");
public final static Property Uuid_deposit_report_h = new Property(5, String.class, "uuid_deposit_report_h", false, "UUID_DEPOSIT_REPORT_H");
public final static Property Is_sent = new Property(6, String.class, "is_sent", false, "IS_SENT");
public final static Property Agreement_no = new Property(7, String.class, "agreement_no", false, "AGREEMENT_NO");
};
private DaoSession daoSession;
private Query<DepositReportD> depositReportH_DepositReportDListQuery;
public DepositReportDDao(DaoConfig config) {
super(config);
}
public DepositReportDDao(DaoConfig config, DaoSession daoSession) {
super(config, daoSession);
this.daoSession = 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 + "\"TR_DEPOSITREPORT_D\" (" + //
"\"UUID_DEPOSIT_REPORT_D\" TEXT PRIMARY KEY NOT NULL ," + // 0: uuid_deposit_report_d
"\"UUID_TASK_H\" TEXT," + // 1: uuid_task_h
"\"DEPOSIT_AMT\" TEXT," + // 2: deposit_amt
"\"USR_CRT\" TEXT," + // 3: usr_crt
"\"DTM_CRT\" INTEGER," + // 4: dtm_crt
"\"UUID_DEPOSIT_REPORT_H\" TEXT," + // 5: uuid_deposit_report_h
"\"IS_SENT\" TEXT," + // 6: is_sent
"\"AGREEMENT_NO\" TEXT);"); // 7: agreement_no
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TR_DEPOSITREPORT_D\"";
db.execSQL(sql);
}
/** @inheritdoc */
@Override
protected void bindValues(DatabaseStatement stmt, DepositReportD entity) {
stmt.clearBindings();
stmt.bindString(1, entity.getUuid_deposit_report_d());
String uuid_task_h = entity.getUuid_task_h();
if (uuid_task_h != null) {
stmt.bindString(2, uuid_task_h);
}
String deposit_amt = entity.getDeposit_amt();
if (deposit_amt != null) {
stmt.bindString(3, deposit_amt);
}
String usr_crt = entity.getUsr_crt();
if (usr_crt != null) {
stmt.bindString(4, usr_crt);
}
java.util.Date dtm_crt = entity.getDtm_crt();
if (dtm_crt != null) {
stmt.bindLong(5, dtm_crt.getTime());
}
String uuid_deposit_report_h = entity.getUuid_deposit_report_h();
if (uuid_deposit_report_h != null) {
stmt.bindString(6, uuid_deposit_report_h);
}
String is_sent = entity.getIs_sent();
if (is_sent != null) {
stmt.bindString(7, is_sent);
}
String agreement_no = entity.getAgreement_no();
if (agreement_no != null) {
stmt.bindString(8, agreement_no);
}
}
@Override
protected void attachEntity(DepositReportD entity) {
super.attachEntity(entity);
entity.__setDaoSession(daoSession);
}
/** @inheritdoc */
@Override
public String readKey(Cursor cursor, int offset) {
return cursor.getString(offset + 0);
}
/** @inheritdoc */
@Override
public DepositReportD readEntity(Cursor cursor, int offset) {
DepositReportD entity = new DepositReportD( //
cursor.getString(offset + 0), // uuid_deposit_report_d
cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // uuid_task_h
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // deposit_amt
cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // usr_crt
cursor.isNull(offset + 4) ? null : new java.util.Date(cursor.getLong(offset + 4)), // dtm_crt
cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // uuid_deposit_report_h
cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // is_sent
cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // agreement_no
);
return entity;
}
/** @inheritdoc */
@Override
public void readEntity(Cursor cursor, DepositReportD entity, int offset) {
entity.setUuid_deposit_report_d(cursor.getString(offset + 0));
entity.setUuid_task_h(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
entity.setDeposit_amt(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
entity.setUsr_crt(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
entity.setDtm_crt(cursor.isNull(offset + 4) ? null : new java.util.Date(cursor.getLong(offset + 4)));
entity.setUuid_deposit_report_h(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
entity.setIs_sent(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
entity.setAgreement_no(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
}
/** @inheritdoc */
@Override
protected String updateKeyAfterInsert(DepositReportD entity, long rowId) {
return entity.getUuid_deposit_report_d();
}
/** @inheritdoc */
@Override
public String getKey(DepositReportD entity) {
if(entity != null) {
return entity.getUuid_deposit_report_d();
} else {
return null;
}
}
/** @inheritdoc */
@Override
protected boolean isEntityUpdateable() {
return true;
}
/** Internal query to resolve the "depositReportDList" to-many relationship of DepositReportH. */
public List<DepositReportD> _queryDepositReportH_DepositReportDList(String uuid_deposit_report_h) {
synchronized (this) {
if (depositReportH_DepositReportDListQuery == null) {
QueryBuilder<DepositReportD> queryBuilder = queryBuilder();
queryBuilder.where(Properties.Uuid_deposit_report_h.eq(null));
depositReportH_DepositReportDListQuery = queryBuilder.build();
}
}
Query<DepositReportD> query = depositReportH_DepositReportDListQuery.forCurrentThread();
query.setParameter(0, uuid_deposit_report_h);
return query.list();
}
private String selectDeep;
protected String getSelectDeep() {
if (selectDeep == null) {
StringBuilder builder = new StringBuilder("SELECT ");
SqlUtils.appendColumns(builder, "T", getAllColumns());
builder.append(',');
SqlUtils.appendColumns(builder, "T0", daoSession.getDepositReportHDao().getAllColumns());
builder.append(" FROM TR_DEPOSITREPORT_D T");
builder.append(" LEFT JOIN TR_DEPOSITREPORT_H T0 ON T.\"UUID_DEPOSIT_REPORT_H\"=T0.\"UUID_DEPOSIT_REPORT_H\"");
builder.append(' ');
selectDeep = builder.toString();
}
return selectDeep;
}
protected DepositReportD loadCurrentDeep(Cursor cursor, boolean lock) {
DepositReportD entity = loadCurrent(cursor, 0, lock);
int offset = getAllColumns().length;
DepositReportH depositReportH = loadCurrentOther(daoSession.getDepositReportHDao(), cursor, offset);
entity.setDepositReportH(depositReportH);
return entity;
}
public DepositReportD loadDeep(Long key) {
assertSinglePk();
if (key == null) {
return null;
}
StringBuilder builder = new StringBuilder(getSelectDeep());
builder.append("WHERE ");
SqlUtils.appendColumnsEqValue(builder, "T", getPkColumns());
String sql = builder.toString();
String[] keyArray = new String[] { key.toString() };
Cursor cursor = db.rawQuery(sql, keyArray);
try {
boolean available = cursor.moveToFirst();
if (!available) {
return null;
} else if (!cursor.isLast()) {
throw new IllegalStateException("Expected unique result, but count was " + cursor.getCount());
}
return loadCurrentDeep(cursor, true);
} finally {
cursor.close();
}
}
/** Reads all available rows from the given cursor and returns a list of new ImageTO objects. */
public List<DepositReportD> loadAllDeepFromCursor(Cursor cursor) {
int count = cursor.getCount();
List<DepositReportD> list = new ArrayList<DepositReportD>(count);
if (cursor.moveToFirst()) {
if (identityScope != null) {
identityScope.lock();
identityScope.reserveRoom(count);
}
try {
do {
list.add(loadCurrentDeep(cursor, false));
} while (cursor.moveToNext());
} finally {
if (identityScope != null) {
identityScope.unlock();
}
}
}
return list;
}
protected List<DepositReportD> loadDeepAllAndCloseCursor(Cursor cursor) {
try {
return loadAllDeepFromCursor(cursor);
} finally {
cursor.close();
}
}
/** A raw-style query where you can pass any WHERE clause and arguments. */
public List<DepositReportD> queryDeep(String where, String... selectionArg) {
Cursor cursor = db.rawQuery(getSelectDeep() + where, selectionArg);
return loadDeepAllAndCloseCursor(cursor);
}
}

View file

@ -0,0 +1,41 @@
package com.adins.mss.base.mainmenu;
/**
* Created by developer on 9/6/17.
*/
public class NewMenuItem {
private String name;
private int icon;
private String counter;
public NewMenuItem(String name, int icon, String counter) {
this.name = name;
this.icon = icon;
this.counter = counter;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getIcon() {
return icon;
}
public void setIcon(int icon) {
this.icon = icon;
}
public String getCounter() {
return counter;
}
public void setCounter(String counter) {
this.counter = counter;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View file

@ -0,0 +1,47 @@
package com.adins.mss.base.todolist.form.todaysplan.dummytaskplan;
public class DummyPlan{
private boolean showDeleteBtn;
private String customer;
private String address;
private String phone;
public DummyPlan(boolean showDeleteBtn, String customer, String address, String phone) {
this.showDeleteBtn = showDeleteBtn;
this.customer = customer;
this.address = address;
this.phone = phone;
}
public boolean isShowDeleteBtn() {
return showDeleteBtn;
}
public void setShowDeleteBtn(boolean showDeleteBtn) {
this.showDeleteBtn = showDeleteBtn;
}
public String getCustomer() {
return customer;
}
public void setCustomer(String customer) {
this.customer = customer;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
}

View file

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_grayscale">
<View
android:layout_width="match_parent"
android:layout_height="?android:actionBarSize"
android:background="@drawable/actionbar_background">
</View>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:text="@string/label_recapitulation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/PageTextTitle">
</TextView>
<ListView
android:layout_weight="1"
android:layout_height="fill_parent"
android:layout_width="match_parent"
android:id="@+id/recapitulationList">
</ListView>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/btnTransfer"
android:id="@+id/transferButton">
</Button>
</LinearLayout>
</LinearLayout>

View file

@ -0,0 +1,34 @@
package com.adins.mss.foundation.dialog.gitonway.lib.effects;
import android.view.View;
import com.adins.libs.nineoldandroids.animation.ObjectAnimator;
/*
* Copyright 2014 litao
* https://github.com/sd6352051/NiftyDialogEffects
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class RotateLeft extends BaseEffects {
@Override
protected void setupAnimation(View view) {
getAnimatorSet().playTogether(
ObjectAnimator.ofFloat(view, "rotationY", 90, 0).setDuration(mDuration),
ObjectAnimator.ofFloat(view, "translationX", -300, 0).setDuration(mDuration),
ObjectAnimator.ofFloat(view, "alpha", 0, 1).setDuration(mDuration * 3 / 2)
);
}
}