integrated_traffic/src/main/java/com/zcloud/util/Jailer.java

78 lines
2.9 KiB
Java

package com.zcloud.util;
import com.zcloud.entity.PageData;
import com.zcloud.entity.system.Dictionaries;
import com.zcloud.util.excel.dto.PostExcelModel;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
public class Jailer {
public static Dictionaries mapDictionaries(PageData information) {
Dictionaries dictionaries = new Dictionaries();
dictionaries.setDICTIONARIES_ID(information.getString("INDUSTRYTYPE_ID"));
dictionaries.setNAME(information.getString("NAME"));
dictionaries.setPARENT_ID(information.getString("PARENT_ID"));
dictionaries.setSubDict(new ArrayList<>());
return dictionaries;
}
public static Map<String, Map<String, String>> getMonth() {
Map<String, Map<String, String>> map = new HashMap<>();
String year = LocalDate.now().getYear() + "";
for (int i = 1; i < 13; i++) {
HashMap<String, String> _map = new HashMap<>();
if (i < 10) {
String key = year + "-0" + i;
_map.put(key, i + "");
_map.put("key", key);
map.put(year + "-0" + i, _map);
} else {
String key = year + "-" + i;
_map.put(key, i + "");
_map.put("key", key);
map.put(year + "-" + i, _map);
}
}
return map;
}
public static Map<String, Map<String, String>> getDay() {
Map<String, Map<String, String>> map = new HashMap<>();
String year = LocalDate.now().getYear() + "";
String month = LocalDate.now().getMonthValue() + "";
for (int i = 1; i < 32; i++) {
HashMap<String, String> _map = new HashMap<>();
if (i < 10) {
String key = year + "-" + month + "-0" + i;
_map.put(key, i + "");
_map.put("key", key);
map.put(year + "-" + month + "-0" + i, _map);
} else {
String key = year + "-" + i;
_map.put(key, i + "");
_map.put("key", key);
map.put(year + "-" + month + "-" + i, _map);
}
}
return map;
}
public static PageData mapPostData(PostExcelModel postExcelModel) {
PageData entity = new PageData();
Warden.initDate(entity);
entity.put("ARCHIVES_POSTMAN_ID", Warden.get32UUID());
entity.put("NAME", postExcelModel.getNAME());
entity.put("POST", postExcelModel.getPOST());
entity.put("PHONE", postExcelModel.getPHONE());
entity.put("CARD_ID", postExcelModel.getCARD_ID());
entity.put("EFFECTIVE_DATE", postExcelModel.getEFFECTIVE_DATE());
entity.put("RETRAINING", postExcelModel.getRETRAINING());
entity.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
return entity;
}
}