2022-03-08 15:40:26 +08:00
|
|
|
package com.engine.salary.transmethod;
|
|
|
|
|
|
2022-03-15 09:55:58 +08:00
|
|
|
import com.engine.salary.enums.datacollection.AttendQuoteFieldSourceTypeEnum;
|
|
|
|
|
import com.engine.salary.enums.datacollection.AttendQuoteFieldTypeEnum;
|
|
|
|
|
import com.engine.salary.enums.datacollection.AttendQuoteSourceTypeEnum;
|
|
|
|
|
|
2022-03-08 15:40:26 +08:00
|
|
|
import java.text.ParseException;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
|
|
public class TransMethod {
|
|
|
|
|
|
|
|
|
|
public static String timeToDate(String time) {
|
|
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
SimpleDateFormat timeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
String format = "";
|
|
|
|
|
try {
|
|
|
|
|
Date parse = timeFormat.parse(time);
|
|
|
|
|
format = dateFormat.format(parse);
|
|
|
|
|
} catch (ParseException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
return format;
|
|
|
|
|
}
|
2022-03-08 16:35:05 +08:00
|
|
|
|
|
|
|
|
public static String timeToMoth(String time) {
|
|
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM");
|
|
|
|
|
SimpleDateFormat timeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
String format = "";
|
|
|
|
|
try {
|
|
|
|
|
Date parse = timeFormat.parse(time);
|
|
|
|
|
format = dateFormat.format(parse);
|
|
|
|
|
} catch (ParseException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
return format;
|
|
|
|
|
}
|
2022-03-12 14:20:39 +08:00
|
|
|
|
|
|
|
|
|
2022-03-15 09:55:58 +08:00
|
|
|
/**
|
|
|
|
|
* 字段来源类型
|
|
|
|
|
* @param sourceType
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String fieldSourceType(String sourceType) {
|
|
|
|
|
return AttendQuoteFieldSourceTypeEnum.getDefaultLabelByValue(Integer.valueOf(sourceType));
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 字段类型
|
|
|
|
|
* @param sourceType
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String fieldType(String sourceType) {
|
|
|
|
|
return AttendQuoteFieldTypeEnum.getDefaultLabelByValue(Integer.valueOf(sourceType));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 考勤来源类型
|
|
|
|
|
* @param sourceType
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String sourceType(String sourceType) {
|
|
|
|
|
return AttendQuoteSourceTypeEnum.getDefaultLabelByValue(Integer.valueOf(sourceType));
|
2022-03-12 14:20:39 +08:00
|
|
|
}
|
2022-03-15 09:55:58 +08:00
|
|
|
|
|
|
|
|
|
2022-03-08 15:40:26 +08:00
|
|
|
}
|