| | |
| | | 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; |
| | |
| | | */ |
| | | |
| | | public class CommonUtils { |
| | | |
| | | public static List<Domainitem> getDomainItemByCalalogGuid(DaoSession daoSession, String guid) { |
| | | return daoSession.getDomainitemDao().queryBuilder() |
| | | .where(DomainitemDao.Properties.Dcguid.eq(guid)) |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取时间段文本 |
| | | */ |
| | | 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 日历对象 |
| | |
| | | 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; |
| | |
| | | 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; |
| | | } |
| | |
| | | public static byte intToByte(int x) { |
| | | return (byte) x; |
| | | } |
| | | |
| | | } |