From e27f54aa7e10836e2741dc590559e1039fbade78 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期五, 23 七月 2021 15:06:41 +0800
Subject: [PATCH] 1. 创建子任务时,执行用户默认为当前登录用户或执行组中的第一人 2. 修复部分企业类型问题图标错误 3. 新增场景账户自动生成功能
---
app/src/main/java/cn/flightfeather/thirdapp/util/CommonUtils.java | 47 +++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 45 insertions(+), 2 deletions(-)
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/util/CommonUtils.java b/app/src/main/java/cn/flightfeather/thirdapp/util/CommonUtils.java
index 2f318e7..07b37db 100644
--- a/app/src/main/java/cn/flightfeather/thirdapp/util/CommonUtils.java
+++ b/app/src/main/java/cn/flightfeather/thirdapp/util/CommonUtils.java
@@ -5,10 +5,12 @@
import com.ping.greendao.gen.DaoSession;
import com.ping.greendao.gen.DomainitemDao;
+import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
+import java.util.Locale;
import cn.flightfeather.thirdapp.R;
import cn.flightfeather.thirdapp.bean.entity.Domainitem;
@@ -18,6 +20,7 @@
*/
public class CommonUtils {
+
public static List<Domainitem> getDomainItemByCalalogGuid(DaoSession daoSession, String guid) {
return daoSession.getDomainitemDao().queryBuilder()
.where(DomainitemDao.Properties.Dcguid.eq(guid))
@@ -213,6 +216,26 @@
}
/**
+ * 鑾峰彇鏃堕棿娈垫枃鏈�
+ */
+ public static String getStartEndDate(Date startDate, Date endDate) {
+ SimpleDateFormat format1 = new SimpleDateFormat("yyyy.MM.dd", Locale.CHINESE);
+ String s = format1.format(startDate);
+ String e = format1.format(endDate);
+ String str = "";
+ try {
+ if (s.substring(0, 4).equals(e.substring(0, 4))) {
+ str = s + "-" + e.substring(5);
+ } else {
+ str = s + "-" + e;
+ }
+ } catch (Exception exception) {
+ exception.printStackTrace();
+ }
+ return str;
+ }
+
+ /**
* 宸ヤ綔鏃ユ煡璇�
*
* @param cal 鏃ュ巻瀵硅薄
@@ -385,7 +408,7 @@
default:
return R.drawable.selector_button_problem_others;
}
- } else if (sceneType.equals(Constant.SCENE_TYPE_WHARF)){
+ } else if (sceneType.equals(Constant.SCENE_TYPE_WHARF)) {
switch (type) {
case "1":
return R.drawable.selector_button_problem_road;
@@ -403,8 +426,27 @@
return R.drawable.selector_button_problem_sewage;
case "8":
return R.drawable.selector_button_problem_attitude;
- case "9":
+ default:
return R.drawable.selector_button_problem_others;
+ }
+ } else if (sceneType.equals(Constant.SCENE_TYPE14)) {
+ switch (type) {
+ case "1":
+ return R.drawable.selector_button_problem_road;
+ case "2":
+ return R.drawable.selector_button_problem_vehicle;
+ case "3":
+ return R.drawable.selector_button_problem_bulk_material;
+ case "4":
+ return R.drawable.selector_button_problem_protect;
+ case "5":
+ return R.drawable.selector_button_problem_dust_equipment;
+ case "6":
+ return R.drawable.selector_button_problem_dedusting;
+ case "7":
+ return R.drawable.selector_button_problem_sewage;
+ case "8":
+ return R.drawable.selector_button_problem_attitude;
default:
return R.drawable.selector_button_problem_others;
}
@@ -457,4 +499,5 @@
public static byte intToByte(int x) {
return (byte) x;
}
+
}
--
Gitblit v1.9.3