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,38 @@
|
|||
package com.adins.mss.base.dynamicform;
|
||||
|
||||
import com.adins.mss.foundation.http.MssRequestType;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class JsonRequestPdfDocument extends MssRequestType {
|
||||
|
||||
@SerializedName("loginId")
|
||||
private String loginId;
|
||||
@SerializedName("agreementNo")
|
||||
private String agreementNo;
|
||||
@SerializedName("docType")
|
||||
private String docType;
|
||||
|
||||
public String getLoginId() {
|
||||
return loginId;
|
||||
}
|
||||
|
||||
public void setLoginId(String loginId) {
|
||||
this.loginId = loginId;
|
||||
}
|
||||
|
||||
public String getAgreementNo() {
|
||||
return agreementNo;
|
||||
}
|
||||
|
||||
public void setAgreementNo(String agreementNo) {
|
||||
this.agreementNo = agreementNo;
|
||||
}
|
||||
|
||||
public String getDocType() {
|
||||
return docType;
|
||||
}
|
||||
|
||||
public void setDocType(String docType) {
|
||||
this.docType = docType;
|
||||
}
|
||||
}
|
|
@ -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="#e74c3c"
|
||||
android:endColor="#e74c3c"
|
||||
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: 2.8 KiB |
|
@ -0,0 +1,21 @@
|
|||
package com.adins.mss.odr.accounts.api;
|
||||
|
||||
import com.adins.mss.foundation.http.MssRequestType;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* Created by olivia.dg on 12/19/2017.
|
||||
*/
|
||||
|
||||
public class LoadProductContactRequest extends MssRequestType {
|
||||
@SerializedName("uuid_account")
|
||||
private String uuid_account;
|
||||
|
||||
public String getUuid_account() {
|
||||
return uuid_account;
|
||||
}
|
||||
|
||||
public void setUuid_account(String uuid_account) {
|
||||
this.uuid_account = uuid_account;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,94 @@
|
|||
package com.adins.mss.foundation.db.dataaccess;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.adins.mss.dao.Broadcast;
|
||||
import com.adins.mss.dao.BroadcastDao;
|
||||
import com.adins.mss.dao.DaoSession;
|
||||
import com.adins.mss.foundation.db.DaoOpenHelper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import de.greenrobot.dao.query.QueryBuilder;
|
||||
|
||||
public class BroadcastDataAccess {
|
||||
/**
|
||||
* 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 user dao and you can access the DB
|
||||
*
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
protected static BroadcastDao getBroadcastDao(Context context){
|
||||
return getDaoSession(context).getBroadcastDao();
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear session, close db and set daoOpenHelper to null
|
||||
*
|
||||
*/
|
||||
public static void closeAll(){
|
||||
/*if(daoOpenHelper!=null){
|
||||
daoOpenHelper.closeAll();
|
||||
daoOpenHelper = null;
|
||||
}*/
|
||||
DaoOpenHelper.closeAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* add user as entity
|
||||
*
|
||||
* @param context
|
||||
* @param broadcast
|
||||
*
|
||||
*
|
||||
*/
|
||||
public static void addOrUpdate(Context context, Broadcast broadcast){
|
||||
getBroadcastDao(context).insertOrReplaceInTx(broadcast);
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
public static Broadcast getById(Context context, String uuidBroadcast){
|
||||
QueryBuilder<Broadcast> qb = getBroadcastDao(context).queryBuilder();
|
||||
qb.where(BroadcastDao.Properties.Uuid_broadcast.eq(uuidBroadcast));
|
||||
qb.build().forCurrentThread();
|
||||
if(qb.list() != null){
|
||||
if(qb.list().size()==1) return qb.list().get(0);
|
||||
else return null;
|
||||
}
|
||||
else return null;
|
||||
}
|
||||
|
||||
public static List<Broadcast> getAllNotShown(Context context){
|
||||
QueryBuilder<Broadcast> qb = getBroadcastDao(context).queryBuilder();
|
||||
qb.where(BroadcastDao.Properties.Is_shown.eq(false));
|
||||
qb.build().forCurrentThread();
|
||||
if(!qb.list().equals(null)){
|
||||
if(qb.list().size()>0) return qb.list();
|
||||
else return null;
|
||||
}
|
||||
else return null;
|
||||
}
|
||||
|
||||
public static void deleteByUuid(Context context, String uuidBroadcast){
|
||||
QueryBuilder<Broadcast> qb = getBroadcastDao(context).queryBuilder();
|
||||
qb.where(BroadcastDao.Properties.Uuid_broadcast.eq(uuidBroadcast));
|
||||
qb.build().forCurrentThread();
|
||||
getBroadcastDao(context).deleteInTx(qb.list());
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,84 @@
|
|||
package com.adins.mss.foundation.services;
|
||||
|
||||
import com.adins.mss.base.crashlytics.FireCrash;
|
||||
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.services.ScheduledItem.ScheduledItemHandler;
|
||||
|
||||
/**
|
||||
* @author glen.iglesias
|
||||
* <p> Subclass of ScheduledItem which is specific to connect to server by interval
|
||||
*/
|
||||
public abstract class ScheduledConnectionItem extends ScheduledItem implements ScheduledItemHandler {
|
||||
|
||||
protected String url;
|
||||
protected boolean enc;
|
||||
protected boolean dec;
|
||||
|
||||
public ScheduledConnectionItem(String id, int interval, String url, boolean enc, boolean dec) {
|
||||
super(id, interval);
|
||||
setHandler(this);
|
||||
this.url = url;
|
||||
this.enc = enc;
|
||||
this.dec = dec;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onEventTrigger(ScheduledItem schItem) {
|
||||
|
||||
String jsonString = getData();
|
||||
Logger.d("scheduledConnection", "schItem : " + schItem.scheduleId + "json : " + jsonString);
|
||||
|
||||
HttpCryptedConnection httpConn = new HttpCryptedConnection(enc, dec);
|
||||
HttpConnectionResult result = null;
|
||||
try {
|
||||
result = httpConn.requestToServer(url, jsonString);
|
||||
Logger.d("scheduledConnection", "schItem : " + schItem.scheduleId + "url : " + url);
|
||||
} catch (Exception e) {
|
||||
FireCrash.log(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
//TODO watch for exception if there is no result (internet failure from device)
|
||||
boolean skipInterval;
|
||||
if (result != null && result.getStatusCode() == 200) {
|
||||
skipInterval = onSuccess(result);
|
||||
} else {
|
||||
skipInterval = onFail(result);
|
||||
}
|
||||
return skipInterval;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return provide the string to send to server
|
||||
*/
|
||||
protected abstract String getData();
|
||||
|
||||
/**
|
||||
* Provide actions if connection success
|
||||
*
|
||||
* @param result
|
||||
* @return true if ScheduledConnectionItem should trigger without waiting for interval,
|
||||
* false if ScheduledConnectionItem should wait for next interval
|
||||
*/
|
||||
protected abstract boolean onSuccess(HttpConnectionResult result);
|
||||
|
||||
/**
|
||||
* Provide actions if connection failed
|
||||
*
|
||||
* @param result
|
||||
* @return true if ScheduledConnectionItem should trigger without waiting for interval,
|
||||
* false if ScheduledConnectionItem should wait for next interval
|
||||
*/
|
||||
protected abstract boolean onFail(HttpConnectionResult result);
|
||||
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 62 KiB |
Binary file not shown.
After Width: | Height: | Size: 524 B |
|
@ -0,0 +1,175 @@
|
|||
package com.adins.mss.foundation.db.dataaccess;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.adins.mss.dao.CollectionActivity;
|
||||
import com.adins.mss.dao.CollectionActivityDao;
|
||||
import com.adins.mss.dao.DaoSession;
|
||||
import com.adins.mss.foundation.db.DaoOpenHelper;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import de.greenrobot.dao.query.QueryBuilder;
|
||||
|
||||
public class CollectionActivityDataAccess {
|
||||
|
||||
private CollectionActivityDataAccess() {
|
||||
}
|
||||
|
||||
/**
|
||||
* use to generate dao session that you can access modelDao
|
||||
*
|
||||
* @param context --> context from activity
|
||||
* @return
|
||||
*/
|
||||
protected static DaoSession getDaoSession(Context context) {
|
||||
return DaoOpenHelper.getDaoSession(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* get collectionActivity dao and you can access the DB
|
||||
*
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
protected static CollectionActivityDao getCollectionActivityDao(Context context) {
|
||||
return getDaoSession(context).getCollectionActivityDao();
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear session, close db and set daoOpenHelper to null
|
||||
*/
|
||||
public static void closeAll() {
|
||||
DaoOpenHelper.closeAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* add collectionActivity as entity
|
||||
*
|
||||
* @param context
|
||||
* @param collectionActivity
|
||||
*/
|
||||
public static void add(Context context, CollectionActivity collectionActivity) {
|
||||
getCollectionActivityDao(context).insertInTx(collectionActivity);
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* add collectionActivity as list entity
|
||||
*
|
||||
* @param context
|
||||
* @param collectionActivityList
|
||||
*/
|
||||
public static void add(Context context, List<CollectionActivity> collectionActivityList) {
|
||||
getCollectionActivityDao(context).insertInTx(collectionActivityList);
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* delete all content in table.
|
||||
*
|
||||
* @param context
|
||||
*/
|
||||
public static void clean(Context context) {
|
||||
getCollectionActivityDao(context).deleteAll();
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param collectionActivity
|
||||
*/
|
||||
public static void delete(Context context, CollectionActivity collectionActivity) {
|
||||
getCollectionActivityDao(context).delete(collectionActivity);
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* delete all record by uuidTaskH
|
||||
*
|
||||
* @param context
|
||||
* @param uuidTaskH
|
||||
*/
|
||||
public static void delete(Context context, String uuidTaskH) {
|
||||
QueryBuilder<CollectionActivity> qb = getCollectionActivityDao(context).queryBuilder();
|
||||
qb.where(CollectionActivityDao.Properties.Uuid_task_h.eq(uuidTaskH));
|
||||
qb.build();
|
||||
if (!qb.list().isEmpty()) {
|
||||
getCollectionActivityDao(context).deleteInTx(qb.list());
|
||||
}
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
public static void deleteByAgreementNo(Context context, String agreement_no) {
|
||||
QueryBuilder<CollectionActivity> qb = getCollectionActivityDao(context).queryBuilder();
|
||||
qb.where(CollectionActivityDao.Properties.Agreement_no.eq(agreement_no));
|
||||
qb.build();
|
||||
if (!qb.list().isEmpty()) {
|
||||
getCollectionActivityDao(context).deleteInTx(qb.list());
|
||||
}
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param collectionActivity
|
||||
*/
|
||||
public static void update(Context context, CollectionActivity collectionActivity) {
|
||||
getCollectionActivityDao(context).update(collectionActivity);
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* get all data by agreementNo
|
||||
*
|
||||
* @param context
|
||||
* @param agreementNo
|
||||
* @return
|
||||
*/
|
||||
public static List<CollectionActivity> getAll(Context context, String agreementNo) {
|
||||
QueryBuilder<CollectionActivity> qb = getCollectionActivityDao(context).queryBuilder();
|
||||
qb.where(CollectionActivityDao.Properties.Agreement_no.eq(agreementNo));
|
||||
qb.build();
|
||||
if (!qb.list().isEmpty())
|
||||
return qb.list();
|
||||
else return Collections.emptyList();
|
||||
}
|
||||
|
||||
public static List<CollectionActivity> getAllbyTask(Context context, String uuidTaskH) {
|
||||
QueryBuilder<CollectionActivity> qb = getCollectionActivityDao(context).queryBuilder();
|
||||
qb.where(CollectionActivityDao.Properties.Uuid_task_h.eq(uuidTaskH));
|
||||
qb.build();
|
||||
if (!qb.list().isEmpty())
|
||||
return qb.list();
|
||||
else return Collections.emptyList();
|
||||
}
|
||||
|
||||
public static void addOrReplace(Context context, CollectionActivity collectionActivity) {
|
||||
getCollectionActivityDao(context).insertOrReplaceInTx(collectionActivity);
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
public static void addOrReplace(Context context, List<CollectionActivity> collectionActivities) {
|
||||
getCollectionActivityDao(context).insertOrReplaceInTx(collectionActivities);
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
private static CollectionActivity getOne(Context context, String agreementNo) {
|
||||
QueryBuilder<CollectionActivity> qb = getCollectionActivityDao(context).queryBuilder();
|
||||
qb.where(CollectionActivityDao.Properties.Agreement_no.eq(agreementNo));
|
||||
qb.build();
|
||||
if (qb.list().isEmpty())
|
||||
return null;
|
||||
return qb.list().get(0);
|
||||
}
|
||||
|
||||
private static CollectionActivity getOneCollAct(Context context, String uuid_CollAct) {
|
||||
QueryBuilder<CollectionActivity> qb = getCollectionActivityDao(context).queryBuilder();
|
||||
qb.where(CollectionActivityDao.Properties.Uuid_collection_activity.eq(uuid_CollAct));
|
||||
qb.build();
|
||||
if (qb.list().isEmpty())
|
||||
return null;
|
||||
return qb.list().get(0);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue