2022-03-08 15:40:26 +08:00
|
|
|
package com.engine.salary.transmethod;
|
|
|
|
|
|
2022-03-23 18:41:38 +08:00
|
|
|
import com.engine.salary.enums.SalaryDataSourceEnum;
|
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-24 16:59:52 +08:00
|
|
|
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
|
2022-03-23 18:41:38 +08:00
|
|
|
import com.engine.salary.enums.sicategory.RententionRuleEnum;
|
2022-03-15 09:55:58 +08:00
|
|
|
|
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
|
|
|
/**
|
|
|
|
|
* 字段来源类型
|
2022-03-23 18:41:38 +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));
|
|
|
|
|
}
|
2022-03-23 18:41:38 +08:00
|
|
|
|
2022-03-15 09:55:58 +08:00
|
|
|
/**
|
|
|
|
|
* 字段类型
|
2022-03-23 18:41:38 +08:00
|
|
|
*
|
2022-03-15 09:55:58 +08:00
|
|
|
* @param sourceType
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String fieldType(String sourceType) {
|
|
|
|
|
return AttendQuoteFieldTypeEnum.getDefaultLabelByValue(Integer.valueOf(sourceType));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 考勤来源类型
|
2022-03-23 18:41:38 +08:00
|
|
|
*
|
2022-03-15 09:55:58 +08:00
|
|
|
* @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-23 18:41:38 +08:00
|
|
|
/**
|
|
|
|
|
* 薪资项目进位规则
|
|
|
|
|
*
|
|
|
|
|
* @param roundingMode
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String roundingMode(String roundingMode) {
|
|
|
|
|
return RententionRuleEnum.getDefaultLabelByValue(Integer.valueOf(roundingMode));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 取值方式
|
|
|
|
|
* @param datasource
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String datasource(String datasource) {
|
|
|
|
|
return SalaryDataSourceEnum.getDefaultLabelByValue(Integer.valueOf(datasource));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 字段类型
|
|
|
|
|
* @param valueType
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
2022-03-24 16:59:52 +08:00
|
|
|
public static String dataType(String valueType) {
|
|
|
|
|
return SalaryDataTypeEnum.getDefaultLabelByValue(Integer.valueOf(valueType));
|
2022-03-23 18:41:38 +08:00
|
|
|
}
|
2022-03-15 09:55:58 +08:00
|
|
|
|
2022-03-08 15:40:26 +08:00
|
|
|
}
|