| | |
| | | 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)) |
| | |
| | | cal.setTime(getCurrentYearEndTime()); |
| | | cal.add(Calendar.YEAR, -1); |
| | | return cal.getTime(); |
| | | } |
| | | |
| | | /** |
| | | * 获取时间段文本 |
| | | */ |
| | | 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; |
| | | } |
| | | |
| | | /** |
| | |
| | | public static byte intToByte(int x) { |
| | | return (byte) x; |
| | | } |
| | | |
| | | } |