Browse Source

修复工序模型重复问题

master
liup 5 months ago
parent
commit
cb8201b7be
5 changed files with 206 additions and 6 deletions
  1. +2
    -0
      app/src/main/java/com/bonait/bnframework/business/ConfigData.java
  2. +6
    -2
      app/src/main/java/com/bonait/bnframework/common/db/QueryDB.java
  3. +64
    -0
      app/src/main/java/com/bonait/bnframework/common/db/mode/BPA_GOODSRECIPE.java
  4. +11
    -4
      app/src/main/java/com/bonait/bnframework/common/helper/TcpClient.java
  5. +123
    -0
      app/src/main/res/layout/fragment_home1.xml

+ 2
- 0
app/src/main/java/com/bonait/bnframework/business/ConfigData.java View File

@@ -8,11 +8,13 @@ import android.os.Message;

import androidx.annotation.NonNull;

import com.bonait.bnframework.MainApplication;
import com.bonait.bnframework.R;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.constant.DataBus;
import com.bonait.bnframework.common.constant.MessageName;
import com.bonait.bnframework.common.db.QueryDB;
import com.bonait.bnframework.common.db.file.DBHelper;
import com.bonait.bnframework.common.db.mode.BPA_CLOUDDATA;
import com.bonait.bnframework.common.db.mode.BPA_GOODS;
import com.bonait.bnframework.common.db.mode.BPA_GOODSRECIPE;


+ 6
- 2
app/src/main/java/com/bonait/bnframework/common/db/QueryDB.java View File

@@ -2172,7 +2172,12 @@ public class QueryDB {
* @return 是否成功
*/
public static boolean AddProcess(BPA_PROCESS data) {

ArrayList<BPA_PROCESS> list = GetProcessALL();
for(BPA_PROCESS model:list){
if(model.name.equals(data.name)){
return true;
}
}
return Add(BPA_PROCESS.class, data);
}

@@ -2262,7 +2267,6 @@ public class QueryDB {
* @return 是否成功
*/
public static boolean AddProcessModel(BPA_PROCESSModel data) {

return Add(BPA_PROCESSModel.class, data);
}



+ 64
- 0
app/src/main/java/com/bonait/bnframework/common/db/mode/BPA_GOODSRECIPE.java View File

@@ -22,4 +22,68 @@ public class BPA_GOODSRECIPE extends ModeBase {

//模型变量
public String processvalue;

public String getGoodsID() {
return goodsID;
}

public void setGoodsID(String goodsID) {
this.goodsID = goodsID;
}

public String getMaterialID() {
return materialID;
}

public void setMaterialID(String materialID) {
this.materialID = materialID;
}

public int getValue() {
return value;
}

public void setValue(int value) {
this.value = value;
}

public int getSort() {
return sort;
}

public void setSort(int sort) {
this.sort = sort;
}

public int getMaterialType() {
return materialType;
}

public void setMaterialType(int materialType) {
this.materialType = materialType;
}

public String getProcessms() {
return processms;
}

public void setProcessms(String processms) {
this.processms = processms;
}

public String getProcessname() {
return processname;
}

public void setProcessname(String processname) {
this.processname = processname;
}

public String getProcessvalue() {
return processvalue;
}

public void setProcessvalue(String processvalue) {
this.processvalue = processvalue;
}
}

+ 11
- 4
app/src/main/java/com/bonait/bnframework/common/helper/TcpClient.java View File

@@ -3,18 +3,22 @@ package com.bonait.bnframework.common.helper;

import android.util.Log;

import com.bonait.bnframework.MainApplication;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.constant.MessageName;
import com.bonait.bnframework.common.db.QueryDB;
import com.bonait.bnframework.common.db.file.DBHelper;
import com.bonait.bnframework.common.db.mode.BPA_CRAFT;
import com.bonait.bnframework.common.db.mode.BPA_GOODSRECIPE;
import com.bonait.bnframework.common.db.mode.BPA_SILOS;
import com.bonait.bnframework.common.db.mode.BPA_SILOSANDMATERIAL;
import com.bonait.bnframework.common.helper.I.IRunT;
import com.bonait.bnframework.common.helper.I.IThread;
import com.bonait.bnframework.common.message.MessageManager;
import com.google.gson.Gson;

import org.apache.commons.logging.LogFactory;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
@@ -29,6 +33,7 @@ import java.util.Enumeration;
import java.util.concurrent.ConcurrentLinkedQueue;

public class TcpClient {
private static final org.apache.commons.logging.Log log = LogFactory.getLog(TcpClient.class);
private volatile static TcpClient _Instance;
public synchronized static TcpClient getInstance(){
if(_Instance==null)_Instance=new TcpClient();
@@ -121,6 +126,7 @@ public class TcpClient {
public void Run() throws Exception {
while (msg.size()>0){
String res = msg.poll();

ReceiveData rd = new Gson().fromJson(res, ReceiveData.class);

if(rd.goods!=null){
@@ -138,10 +144,11 @@ public class TcpClient {
}

if(rd.goodsrecipes!=null){
ArrayList<BPA_GOODSRECIPE> removeData = QueryDB.GetGoodsSrecipeALL();
if(removeData!=null){
removeData.forEach(remove->{QueryDB.DeleteGoodsSrecipe(remove);});
}
// ArrayList<BPA_GOODSRECIPE> removeData = QueryDB.GetGoodsSrecipeALL();
// if(removeData!=null){
// removeData.forEach(remove->{QueryDB.DeleteGoodsSrecipe(remove);});
// }
DBHelper.getInstance(MainApplication.getContext()).DeleteCreateTables(BPA_GOODSRECIPE.class,null);
rd.goodsrecipes.forEach(item->{
QueryDB.AddGoodsSrecipe(item);
});


+ 123
- 0
app/src/main/res/layout/fragment_home1.xml View File

@@ -755,6 +755,129 @@
android:background="@color/activity_background" />
</RelativeLayout>

<!--边框分割细线-->
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp">

<LinearLayout
android:layout_width="1dp"
android:layout_height="30dp"
android:layout_centerInParent="true"
android:background="@color/activity_background" />
</RelativeLayout>




</LinearLayout>
</RelativeLayout>

<!-- 临时屏蔽要钱 -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:layout_marginRight="@dimen/dp_10">

<LinearLayout
android:id="@+id/yaoqian"
android:layout_width="wrap_content"
android:layout_height="match_parent">

<RelativeLayout
android:layout_width="26dp"
android:layout_height="match_parent">

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@mipmap/start" />
</RelativeLayout>

<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="摇芡" />
</RelativeLayout>
</LinearLayout>

<!--边框分割细线-->
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp">

<LinearLayout
android:layout_width="1dp"
android:layout_height="30dp"
android:layout_centerInParent="true"
android:background="@color/activity_background" />
</RelativeLayout>

<LinearLayout
android:id="@+id/tingyao"
android:layout_width="wrap_content"
android:layout_height="match_parent">

<RelativeLayout
android:layout_width="26dp"
android:layout_height="match_parent">

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@mipmap/stop" />
</RelativeLayout>

<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="停摇" />
</RelativeLayout>
</LinearLayout>

</LinearLayout>
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginTop="2dp"
android:background="@color/qmui_config_color_white"
android:padding="5dp">

<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentLeft="true">



<Button
android:id="@+id/ccw1"
android:layout_width="60dp"


Loading…
Cancel
Save