打包工具自定义日期格式

dev
wangxuanran 2023-07-11 17:48:55 +08:00
parent 81f02278de
commit 13069894aa
3 changed files with 9 additions and 5 deletions

View File

@ -1,18 +1,14 @@
package weaver.xuanran.wang.cssc.cms.service.impl;
import aiyh.utils.Util;
import aiyh.utils.excention.CustomerException;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import sun.security.krb5.internal.PAData;
import weaver.conn.RecordSet;
import weaver.conn.RecordSetTrans;
import weaver.cssc.workflow.voucher.util.InterfaceLoggerDao;
import weaver.cssc.workflow.voucher.util.VoucherConstants;
import weaver.general.TimeUtil;
import weaver.soa.workflow.request.RequestInfo;
import weaver.xiao.commons.config.entity.RequestMappingConfig;

View File

@ -80,7 +80,7 @@ public class BuilderPackageEcology extends Application {
buttonBox.setPadding(new Insets(10));
buttonBox.setAlignment(Pos.CENTER_RIGHT);
Map<String, String> param = new HashMap<>(8);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(FileTreeBuilder.cusDateFormat);
Date date = new Date();
param.put("date", simpleDateFormat.format(date));
Button button = new Button("生成升级包");

View File

@ -2,6 +2,8 @@ package builderpackage;
import aiyh.utils.excention.CustomerException;
import aiyh.utils.tool.cn.hutool.core.util.StrUtil;
import org.apache.commons.lang3.StringUtils;
import weaver.common.util.string.StringUtil;
import java.io.*;
import java.nio.charset.StandardCharsets;
@ -19,6 +21,8 @@ public class FileTreeBuilder {
public static String zipDefaultName;
public static String defaultDir;
public static String cusDateFormat;
public static FileInfo buildFileTree() {
String directoryPath = "target";
@ -50,6 +54,10 @@ public class FileTreeBuilder {
classPath = classRootPath;
zipDefaultName = properties.getProperty("zipDefaultName");
defaultDir = properties.getProperty("defaultDir");
cusDateFormat = properties.getProperty("cusDateFormat");
if(StrUtil.isBlank(cusDateFormat)){
cusDateFormat = "yyyyMMdd";
}
List<String> blacklistPrefixes = Arrays.asList(
directoryPath + "generated-sources",
directoryPath + "generated-test-sources",