增加 - 颜色、弹窗判断

master
wanghao 3 months ago
parent befc3d6c94
commit 46cb151321

@ -10,8 +10,8 @@ android {
applicationId "com.example.aucma_mes" applicationId "com.example.aucma_mes"
minSdk 24 minSdk 24
targetSdk 33 targetSdk 33
versionCode 13 versionCode 15
versionName "1.13" versionName "1.15"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }

@ -37,6 +37,7 @@ import com.lzy.okgo.request.base.Request;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional;
import okhttp3.RequestBody; import okhttp3.RequestBody;
@ -121,13 +122,18 @@ public class CheckActivity extends BaseActivity implements CheckAdapter.CheckIte
checkViewModel.setName(result.getMsg()); checkViewModel.setName(result.getMsg());
topDefects = gson.fromJson(gson.toJson(result.getData()), new TypeToken<List<DefectBeen>>() { topDefects = gson.fromJson(gson.toJson(result.getData()), new TypeToken<List<DefectBeen>>() {
}.getType()); }.getType());
if (topDefects == null || topDefects.isEmpty()) { if (topDefects == null || topDefects.isEmpty() ) {
Toast.makeText(CheckActivity.this, "本工位无需检查返修情况", Toast.LENGTH_SHORT).show(); Toast.makeText(CheckActivity.this, "本工位无需检查返修情况", Toast.LENGTH_SHORT).show();
return; return;
} }
checkViewModel.setButtonVisbleState(true); checkViewModel.setButtonVisbleState(true);
tipDialog.setList(topDefects); tipDialog.setList(topDefects);
tipDialog.show(); Optional<Boolean> checkState = topDefects.stream().findFirst().map(item -> !item.getQualityDefectName().equals("完成"));
if (checkState.get()){
tipDialog.show();
}
/*// 直接添加提交数据中submitList.addAll(defectBeens); /*// 直接添加提交数据中submitList.addAll(defectBeens);
checkAdapter.notifyDataSetChanged();*/ checkAdapter.notifyDataSetChanged();*/
@ -151,8 +157,9 @@ public class CheckActivity extends BaseActivity implements CheckAdapter.CheckIte
public void checkSubmint1(View view) { public void checkSubmint1(View view) {
sanInfo("B24031483025025351528"); sanInfo(binding.checkTeskCode.getText().toString());
} // 提交 }
// 提交
public void checkSubmint(View view) { public void checkSubmint(View view) {
if (checkViewModel.getName() == null || checkViewModel.getName().isEmpty()) return; if (checkViewModel.getName() == null || checkViewModel.getName().isEmpty()) return;
checkViewModel.setList(submitList); checkViewModel.setList(submitList);

@ -48,7 +48,7 @@ public class MainActivity extends BaseActivity {
String loginName = SharedPreferencesUtils.getstring("loginName", ""); String loginName = SharedPreferencesUtils.getstring("loginName", "");
user = new User(); user = new User();
user.setUsername(loginName); user.setUsername(loginName);
user.setPassword("123456"); user.setPassword(SharedPreferencesUtils.getstring("password", "123456"));
getSupportActionBar().hide(); // 隐藏原生标题栏 getSupportActionBar().hide(); // 隐藏原生标题栏
binding.setUser(user); binding.setUser(user);
OkGo.<Result>get(url + "/base/teamMembers/getTeamMemberList").tag(this) OkGo.<Result>get(url + "/base/teamMembers/getTeamMemberList").tag(this)
@ -181,6 +181,7 @@ public class MainActivity extends BaseActivity {
intent.putExtra("role", loginBack.getRoles()); intent.putExtra("role", loginBack.getRoles());
intent.putExtra("info", body); intent.putExtra("info", body);
SharedPreferencesUtils.putstring("loginName", user.username); SharedPreferencesUtils.putstring("loginName", user.username);
SharedPreferencesUtils.putstring("password", user.password);
SharedPreferencesUtils.putstring("teamCode", user.getTeamCode()); SharedPreferencesUtils.putstring("teamCode", user.getTeamCode());
SharedPreferencesUtils.putstring("teamName", user.getTeamName()); SharedPreferencesUtils.putstring("teamName", user.getTeamName());
SharedPreferencesUtils.putstring("token", token); SharedPreferencesUtils.putstring("token", token);

@ -56,13 +56,13 @@ public class RepaitSubmintInfoAdapter extends RecyclerView.Adapter<RepaitSubmint
databing.itemLinear.setBackgroundColor(context.getResources().getColor(R.color.yellow)); databing.itemLinear.setBackgroundColor(context.getResources().getColor(R.color.yellow));
}else if (processResult.equals("KA")){ }else if (processResult.equals("KA")){
databing.itemLinear.setBackgroundColor(context.getResources().getColor(R.color.red)); databing.itemLinear.setBackgroundColor(context.getResources().getColor(R.color.red1));
defectBeen.setProcessResult("样品机"); defectBeen.setProcessResult("样品机");
}else if (processResult.equals("未完成")){ }else if (processResult.equals("未完成")){
databing.itemLinear.setBackgroundColor(context.getResources().getColor(R.color.item1)); databing.itemLinear.setBackgroundColor(context.getResources().getColor(R.color.item1));
}else { }else {
defectBeen.setProcessResult("下返修"); defectBeen.setProcessResult("下返修");
databing.itemLinear.setBackgroundColor(context.getResources().getColor(R.color.item1)); databing.itemLinear.setBackgroundColor(context.getResources().getColor(R.color.red));
databing.itemButtom.setOnClickListener(t -> { databing.itemButtom.setOnClickListener(t -> {
checkItemClickCall.submintRepair(position); checkItemClickCall.submintRepair(position);
}); });

@ -26,8 +26,8 @@ import okhttp3.MediaType;
public abstract class BaseActivity extends AppCompatActivity { public abstract class BaseActivity extends AppCompatActivity {
private MyBroad receiver; private MyBroad receiver;
// public static String url="http://192.168.0.102:8080"; // public static String url="http://192.168.100.100:6061";
public static String url = "http://10.100.72.10:8080"; public static String url = "http://10.100.72.10:8080";//现场IP
public ProgressDialog dialog; public ProgressDialog dialog;
public Gson gson; public Gson gson;
public MediaType JSON = MediaType.parse("application/json; charset=utf-8"); public MediaType JSON = MediaType.parse("application/json; charset=utf-8");

@ -188,6 +188,11 @@
android:onClick="checkSubmint" android:onClick="checkSubmint"
android:text="提交" /> android:text="提交" />
<EditText
android:id="@+id/check_tesk_code"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"/>
<Button <Button
style="@style/button_true_style" style="@style/button_true_style"
@ -195,9 +200,10 @@
android:layout_height="40dp" android:layout_height="40dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:visibility="gone"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:onClick="checkSubmint1" android:onClick="checkSubmint1"
android:visibility="gone"
android:text="test" /> android:text="test" />

@ -32,10 +32,10 @@
<Button <Button
android:id="@+id/dialog_repair_submintbutton" android:id="@+id/dialog_repair_submintbutton"
android:layout_margin="10dp"
style="@style/button_true_style" style="@style/button_true_style"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="45dp" android:layout_height="45dp"
android:layout_margin="10dp"
android:text="完成" /> android:text="完成" />
</LinearLayout> </LinearLayout>
</layout> </layout>

@ -13,5 +13,6 @@
<color name="blue">#377CF9</color> <color name="blue">#377CF9</color>
<color name="item1">#DEE3E6</color> <color name="item1">#DEE3E6</color>
<color name="red">#6AFF5722</color> <color name="red">#6AFF5722</color>
<color name="red1">#FF6D00</color>
<color name="yellow">#FFEB3B</color> <color name="yellow">#FFEB3B</color>
</resources> </resources>
Loading…
Cancel
Save