Ver código fonte

调试222

调味吧台(白底)
fyf 1 ano atrás
pai
commit
70ab40e6d3
5 arquivos alterados com 174 adições e 3 exclusões
  1. +135
    -0
      app/src/main/java/com/example/bpa/db/QueryDB.java
  2. +4
    -3
      app/src/main/java/com/example/bpa/db/file/DBHelper.java
  3. +15
    -0
      app/src/main/java/com/example/bpa/db/mode/BPA_CRAFT.java
  4. +18
    -0
      app/src/main/java/com/example/bpa/db/mode/BPA_CRAFTPROCESS.java
  5. +2
    -0
      app/src/main/java/com/example/bpa/db/mode/BPA_GOODS.java

+ 135
- 0
app/src/main/java/com/example/bpa/db/QueryDB.java Ver arquivo

@@ -5,6 +5,8 @@ import android.database.sqlite.SQLiteDatabase;
import com.example.bpa.config.ConfigName;
import com.example.bpa.db.file.DBHelper;
import com.example.bpa.db.mode.BPA_ALERTLOG;
import com.example.bpa.db.mode.BPA_CRAFT;
import com.example.bpa.db.mode.BPA_CRAFTPROCESS;
import com.example.bpa.db.mode.BPA_GOODS;
import com.example.bpa.db.mode.BPA_GOODSRECIPE;
import com.example.bpa.db.mode.BPA_LOG;
@@ -1669,6 +1671,125 @@ public class QueryDB {
}
//endregion

//region BPA_CRAFT 工艺基础信息表

/**
* 新增工艺基础信息表
* add fengyoufu 20230413
*
* @param data
* @return 是否成功
*/
public static boolean AddCraft(BPA_CRAFT data) {
return Add(BPA_CRAFT.class, data);
}

/**
* 修改工艺基础信息表
* add fengyoufu 20230413
*
* @param data
*/
public static void UpdateCraft(BPA_CRAFT data) {
Update(BPA_CRAFT.class, data);
}

/**
* 删除工艺基础信息表
* add fengyoufu 20230413
*
* @return 是否成功
*/
public static boolean DeleteCraft(String id) {
return Delete(BPA_CRAFT.class, id);
}

/**
* 获取工艺基础信息表
*
* @return
*/
public static ArrayList<BPA_CRAFT> GetCraftALL() {
String orderby = Desc_Time_Up;//先按排序 创建时间倒序
String where = "isDelete=?";
String[] args = new String[]{"0"};
ArrayList<BPA_CRAFT> data = new ArrayList<>();
ArrayList<Object> obj = Get(BPA_CRAFT.class, where, args, orderby);
for (Object k : obj) {
data.add((BPA_CRAFT) k);
}
return data;
}
//endregion

//region BPA_CRAFTPROCESS 工艺流程表

/**
* 新增工艺流程表
* add fengyoufu 20230413
*
* @param data
* @return 是否成功
*/
public static boolean AddCraftProcess(BPA_CRAFTPROCESS data) {
return Add(BPA_CRAFTPROCESS.class, data);
}

/**
* 修改工艺流程表
* add fengyoufu 20230413
*
* @param data
*/
public static void UpdateCraftProcess(BPA_CRAFTPROCESS data) {
Update(BPA_CRAFTPROCESS.class, data);
}

/**
* 删除工艺流程表
* add fengyoufu 20230413
*
* @return 是否成功
*/
public static boolean DeleteCraftProcess(String id) {
return Delete(BPA_CRAFTPROCESS.class, id);
}

/**
* 获取工艺流程表
*
* @return
*/
public static ArrayList<BPA_CRAFTPROCESS> GetCraftProcessALL() {
String orderby = Desc_Time_Up;//先按排序 创建时间倒序
String where = "isDelete=?";
String[] args = new String[]{"0"};
ArrayList<BPA_CRAFTPROCESS> data = new ArrayList<>();
ArrayList<Object> obj = Get(BPA_CRAFTPROCESS.class, where, args, orderby);
for (Object k : obj) {
data.add((BPA_CRAFTPROCESS) k);
}
return data;
}

/**
* 根据工艺id获取工艺流程表
*
* @return
*/
public static ArrayList<BPA_CRAFTPROCESS> GetCraftProcessId(String id) {
String orderby = Desc_Time_Up;//先按排序 创建时间倒序
String where = "isDelete=? and gyid=?";
String[] args = new String[]{"0",id};
ArrayList<BPA_CRAFTPROCESS> data = new ArrayList<>();
ArrayList<Object> obj = Get(BPA_CRAFTPROCESS.class, where, args, orderby);
for (Object k : obj) {
data.add((BPA_CRAFTPROCESS) k);
}
return data;
}
//endregion

//region 私有

/**
@@ -1880,6 +2001,7 @@ public class QueryDB {
((BPA_GOODS) data).sort = cursor.getInt((int) cursor.getColumnIndex("sort"));
((BPA_GOODS) data).status = cursor.getInt((int) cursor.getColumnIndex("status"));
((BPA_GOODS) data).url = cursor.getString((int) cursor.getColumnIndex("url"));
((BPA_GOODS) data).gyid = cursor.getString((int) cursor.getColumnIndex("gyid"));
break;
case "BPA_GOODSRECIPE":
data = new BPA_GOODSRECIPE();
@@ -1960,6 +2082,19 @@ public class QueryDB {
//私有
((BPA_SUGAR)data).sugarName = cursor.getString((int) cursor.getColumnIndex("sugarName"));
((BPA_SUGAR)data).plcvar = cursor.getString((int) cursor.getColumnIndex("plcvar"));
case "BPA_CRAFT":
data = new BPA_CRAFT();
//私有
((BPA_CRAFT)data).status = cursor.getInt((int) cursor.getColumnIndex("status"));
((BPA_CRAFT)data).name = cursor.getString((int) cursor.getColumnIndex("name"));
case "BPA_CRAFTPROCESS":
data = new BPA_CRAFTPROCESS();
//私有
((BPA_CRAFTPROCESS)data).gyid = cursor.getString((int) cursor.getColumnIndex("gyid"));
((BPA_CRAFTPROCESS)data).pfid = cursor.getString((int) cursor.getColumnIndex("pfid"));
((BPA_CRAFTPROCESS)data).sort = cursor.getInt((int) cursor.getColumnIndex("sort"));
((BPA_CRAFTPROCESS)data).value = cursor.getInt((int) cursor.getColumnIndex("value"));

}
((ModeBase) data).id = cursor.getString((int) cursor.getColumnIndex("id"));
((ModeBase) data).createTime = cursor.getString((int) cursor.getColumnIndex("createTime"));


+ 4
- 3
app/src/main/java/com/example/bpa/db/file/DBHelper.java Ver arquivo

@@ -4,6 +4,8 @@ import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import com.example.bpa.config.ConfigName;
import com.example.bpa.db.mode.BPA_ALERTLOG;
import com.example.bpa.db.mode.BPA_CRAFT;
import com.example.bpa.db.mode.BPA_CRAFTPROCESS;
import com.example.bpa.db.mode.BPA_GOODS;
import com.example.bpa.db.mode.BPA_GOODSRECIPE;
import com.example.bpa.db.mode.BPA_LOG;
@@ -106,11 +108,10 @@ public class DBHelper extends SQLiteOpenHelper {
CreateTablesAll(BPA_MENUANDUSER.class,null);//菜单用户关联表
CreateTablesAll(BPA_SUGAR.class,null);//果糖表


CreateTablesAll(BPA_CRAFT.class,null);//工艺基础信息表
CreateTablesAll(BPA_CRAFTPROCESS.class,null);//工艺流程表

ForeignKeys();


}
/**
* 创建数据库表


+ 15
- 0
app/src/main/java/com/example/bpa/db/mode/BPA_CRAFT.java Ver arquivo

@@ -0,0 +1,15 @@
package com.example.bpa.db.mode;

/**
* BPA_CRAFT[工艺基础信息表]
* 创建人:fengyoufu add 20230412
*/
public class BPA_CRAFT {
/**
* 0:禁用
* 1:启用
*/
public int status;
//日志描述
public String name;
}

+ 18
- 0
app/src/main/java/com/example/bpa/db/mode/BPA_CRAFTPROCESS.java Ver arquivo

@@ -0,0 +1,18 @@
package com.example.bpa.db.mode;

/**
* BPA_CRAFTPROCESS[工艺流程表]
* 创建人:fengyoufu add 20230412
*/
public class BPA_CRAFTPROCESS {

/**
* 工艺id
*/
public String gyid;
//排序
public int sort;
//出料数值:20g
public int value;
public String pfid;
}

+ 2
- 0
app/src/main/java/com/example/bpa/db/mode/BPA_GOODS.java Ver arquivo

@@ -13,4 +13,6 @@ public class BPA_GOODS extends ModeBase {
public int sort;
//状态:0 禁用 1 启用
public int status;
//工艺id
public String gyid;
}

Carregando…
Cancelar
Salvar