Browse Source

更新

master
牧羊人 4 years ago
parent
commit
0e1d27cecb
1 changed files with 21 additions and 8 deletions
  1. +21
    -8
      src/main/java/com/taauav/common/util/FunctionUtils.java

+ 21
- 8
src/main/java/com/taauav/common/util/FunctionUtils.java View File

* @return * @return
*/ */
public static Map<String, Object> dealArea(Map<String, Object> map) { public static Map<String, Object> dealArea(Map<String, Object> map) {
Integer adminId = ShiroUtils.getAdminId();
SysAdmin admin = adminMapper.selectById(adminId);
String[] areaIds; String[] areaIds;
if (!StringUtils.isEmpty(map.get("driverArea"))) { if (!StringUtils.isEmpty(map.get("driverArea"))) {
areaIds = map.get("driverArea").toString().split(","); areaIds = map.get("driverArea").toString().split(",");
if (null != areaIds && areaIds.length > 0) {
map.put("driverArea", areaIds);
} else {
map.remove("driverArea");
}
} else { } else {
areaIds = com.taauav.common.util.StringUtils.isEmpty(admin.getCityIds()) ? null : admin.getCityIds().split(",");
}
if (null != areaIds && areaIds.length > 0) {
map.put("driverArea", areaIds);
} else {
map.remove("driverArea");
Integer adminId = ShiroUtils.getAdminId();
if (!adminId.equals(1)) {
SysAdmin admin = adminMapper.selectById(adminId);
areaIds = com.taauav.common.util.StringUtils.isEmpty(admin.getCityIds()) ? null : admin.getCityIds().split(",");
if (null != areaIds && areaIds.length > 0) {
map.put("driverArea", areaIds);
} else {
map.remove("driverArea");
}
} else {
map.remove("driverArea");
}
} }
return map; return map;
} }
/** /**
* object 转 List * object 转 List
*
* @param object * @param object
* @param clazz * @param clazz
* @param <T> * @param <T>
/** /**
* Map排序 * Map排序
*
* @param map * @param map
* @param flag true:正序(从小到大) false:反序(从大到小) * @param flag true:正序(从小到大) false:反序(从大到小)
* @return * @return
/** /**
* 字符串转日期 * 字符串转日期
*
* @return * @return
*/ */
public static Date strToDate(String str, String formatStr) { public static Date strToDate(String str, String formatStr) {
/** /**
* 日期转指定格式字符串 * 日期转指定格式字符串
*
* @param date * @param date
* @param formatStr * @param formatStr
* @return * @return

Loading…
Cancel
Save