package cn.iocoder.yudao.module.erp.controller.admin.autocode.util;

import cn.iocoder.yudao.module.erp.dal.dataobject.autocode.AutocodePartDO;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

@Component
@Order(1)
public class PartTypeNowDateHandler implements PartTypeTemplate {

    @Override
    public String partHandle(AutocodePartDO sysAutoCodePart) {
        String formatDate = sysAutoCodePart.getDatetimeFormat();
        return DateTimeFormatter.ofPattern(formatDate).format(LocalDateTime.now());
    }
}
