You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
155 lines
6.4 KiB
Java
155 lines
6.4 KiB
Java
|
|
|
|
import com.engine.attendance.enums.AccountingUnitEnum;
|
|
import com.engine.common.util.Utils;
|
|
import weaver.general.Util;
|
|
|
|
import java.time.LocalDate;
|
|
import java.time.temporal.ChronoUnit;
|
|
|
|
|
|
public class Test {
|
|
public static void main(String[] args) {
|
|
// Map<String,Object> params = Maps.newHashMap();
|
|
// List<Map<String,Object>> attendanceItems = new ArrayList<>();
|
|
// Map<String,Object> map = new HashMap<>();
|
|
// map.put("xmlx","1");
|
|
// map.put("zysd","1");
|
|
// map.put("zxhsl","60");
|
|
// map.put("zdhsl","180");
|
|
// map.put("signdate","2023-10-31");
|
|
// map.put("signtime","08:55:16");
|
|
// Map<String,Object> map2 = new HashMap<>();
|
|
// map2.put("xmlx","2");
|
|
// map2.put("zysd","2");
|
|
// map2.put("signdate","2023-11-31");
|
|
// map2.put("signtime","12:55:16");
|
|
// Map<String,Object> map3 = new HashMap<>();
|
|
// map3.put("xmlx","3");
|
|
// map3.put("zysd","1");
|
|
// map3.put("zxhsl","0");
|
|
// map3.put("signdate","2023-10-31");
|
|
// map3.put("signtime","13:55:16");
|
|
// attendanceItems.add(map);
|
|
// attendanceItems.add(map2);
|
|
// attendanceItems.add(map3);
|
|
//// params.put("attendanceItems",attendanceItems);
|
|
//// params.put("workfor","1");
|
|
//// params.put("time","50");
|
|
//
|
|
//// List<Map<String,Object>> dataList = attendanceItems.stream().filter(e->"1".equals(e.get("zysd"))).collect(Collectors.toList());
|
|
//// System.out.println(dataList);
|
|
// // Map<String,Object> resultMap = attendanceItems.stream().min(Comparator.comparing(e->DateUtil.getTime(e.get("signdate")+" "+e.get("signtime")).toInstant(ZoneOffset.of("+8")).toEpochMilli())).get();
|
|
//
|
|
// List<Map<String,Object>> resultList = attendanceItems.stream().sorted(Comparator.comparing(e->DateUtil.getTime(e.get("signdate")+" "+e.get("signtime")).toInstant(ZoneOffset.of("+8")).toEpochMilli())).collect(Collectors.toList());
|
|
|
|
// attendanceItems.remove(resultMap);
|
|
// System.out.println(resultList);
|
|
// new AbsenteeismCmd(params).execute(null);
|
|
|
|
// for (int i=0;i<5;i++){
|
|
// if (i == 3){
|
|
// break;
|
|
// }
|
|
// System.out.println(i);
|
|
// }
|
|
// System.out.println("aaaa");
|
|
|
|
//System.out.println(Util.getIntValue(""));
|
|
// List<Map<String,Object>> beforeleaveDate = Lists.newArrayList();
|
|
// for (int i=beforeleaveDate.size()-1;i>=0;i--){
|
|
// System.out.println(123123);
|
|
// }
|
|
// System.out.println("".split("-")[0]);
|
|
// for (int i=0;i<5;i++){
|
|
// int j=i+1;
|
|
// if (j > 5-1){
|
|
// j = 5-1;
|
|
// }
|
|
// System.out.println(j);
|
|
// }
|
|
// Map<String,Object> jsdkNearestClcokInTime = Maps.newHashMap();
|
|
// jsdkNearestClcokInTime.put("after","222");
|
|
// //jsdkNearestClcokInTime.put("before","222");
|
|
// jsdkNearestClcokInTime.put("equal","222");
|
|
// if (jsdkNearestClcokInTime.get("equal") != null){
|
|
// System.out.println(111);
|
|
// }else if (jsdkNearestClcokInTime.get("after") != null){
|
|
// System.out.println(222);
|
|
// }else if (jsdkNearestClcokInTime.get("before") != null){
|
|
// System.out.println(333);
|
|
// }
|
|
// List<Map> lists = Lists.newArrayList();
|
|
// List<Map> lists2 = Lists.newArrayList();
|
|
// List<Map> lists3 = Lists.newArrayList();
|
|
// lists.add(new HashMap());
|
|
// lists.add(new HashMap());
|
|
// lists.add(new HashMap());
|
|
// lists2.add(lists.get(1));
|
|
// lists3.add(lists.get(1));
|
|
// if (lists2.get(0) == lists3.get(0)){
|
|
// System.out.println(1111);
|
|
// }
|
|
// System.out.println("aa|aa|ss".split("\\|")[2]);
|
|
// AccountingUnitEnum accountingUnitEnum = AccountingUnitEnum.HOUR;
|
|
// AccountingUnitEnum accountingUnitEnum2 = AccountingUnitEnum.HOUR;
|
|
|
|
//long numDays = DateUtil.getBetWeenMinutes("2023-11-08 17:40","2023-11-08 16:30");
|
|
// BigDecimal duration = new BigDecimal(5);
|
|
// BigDecimal hsl = new BigDecimal(0.6);
|
|
// System.out.println(duration.divide(hsl,BigDecimal.ROUND_DOWN).multiply(hsl).add(hsl,new MathContext(BigDecimal.ROUND_HALF_DOWN)).doubleValue());
|
|
// System.out.println(DateUtil.AfterMinutes("2023-11-08 15:40:05",numDays/2));
|
|
System.out.println(Integer.valueOf(Util.null2String(null)));
|
|
|
|
// List<Map<String, Object>> clockInTimeList = Lists.newArrayList();
|
|
// clockInTimeList.add(new HashMap(){{
|
|
// put("signdate","2023-11-12");
|
|
// put("signtime","08:47:43");
|
|
// }});
|
|
// clockInTimeList.add(new HashMap(){{
|
|
// put("signdate","2023-11-12");
|
|
// put("signtime","09:47:43");
|
|
// }});
|
|
// clockInTimeList.add(new HashMap(){{
|
|
// put("signdate","2023-11-12");
|
|
// put("signtime","10:47:43");
|
|
// }});
|
|
//
|
|
// clockInTimeList.add(new HashMap(){{
|
|
// put("signdate","2023-11-13");
|
|
// put("signtime","11:05:43");
|
|
// }});
|
|
// System.out.println(Utils.getNearestClcokInTimeCmd("2023-11-12 08:46:43",clockInTimeList));
|
|
|
|
|
|
|
|
// System.out.println(DateUtil.getTime("2023-10-30 23:00").compareTo(DateUtil.getTime("2023-10-30 22:01")));
|
|
//System.out.println(DateUtil.beforeDay("2023-10-31",1));
|
|
// List<Map<String,Object>> personGroupOrganizationList = Lists.newArrayList();
|
|
// personGroupOrganizationList.add(new HashMap(){{put("dx","4-夜班人员");}});
|
|
// personGroupOrganizationList.add(new HashMap(){{put("dx","8-测试条件录入");}});
|
|
// Set<String> personGroupIds = personGroupOrganizationList.stream().map(e -> Util.null2String(e.get("dx")).split("-")[0]).collect(Collectors.toSet());
|
|
// System.out.println(String.join(",",personGroupIds));
|
|
// List<String> list = Lists.newArrayList();
|
|
// list.add("1");
|
|
// list.add("2");
|
|
// list.add("5");
|
|
// System.out.println(list);
|
|
// list.add(1,"10");
|
|
// Map<String,Object> map = new HashMap(){{
|
|
//put("11","22");
|
|
// put("33","44");
|
|
// put("44","66");
|
|
// }};
|
|
// System.out.println(map);
|
|
}
|
|
|
|
public static int getDaysBetween(String date1, String date2) {
|
|
LocalDate startDate = LocalDate.parse(date1);
|
|
LocalDate endDate = LocalDate.parse(date2);
|
|
|
|
long daysBetween = ChronoUnit.DAYS.between(startDate, endDate);
|
|
return Math.toIntExact(daysBetween);
|
|
}
|
|
}
|