Browse Source
采购订单前端列表页面新增导出供应商合同按钮和js方法,加上对主子表数据的判断 采购订单后端新增导出供应商合同接口,完成对供应商模板的数据填充 采购订单子表新增 通过供应商code查询采购订单子表集合后端接口;新增通过供应商code和采购订单code查询采购订单子表集合后端接口 [feat]公司信息 新增 查询所有公司信息后端接口 [feat]供应商 新增 根据供应商编码查询供应商信息后端接口 [feat]项目依赖 更新项目后端框架springboot升级版本由旧版本升级成2.5.15版本.解决与新导出模块框架不兼容问题 导入poi-ooxml依赖5.5.3 导入poi依赖5.5.3 导入poi-ooxml-schemas依赖4.1.2 导入poi-scratchpad依赖5.2.3 导入log4j-api依赖 2.17.1 导入poi-tl依赖1.12.0 排除原有过旧easyexcel中的poi-ooxml、poi-ooxml-schemas和poi依赖,解决依赖冲突问题 更新项目中shiro依赖 [feat]通用模块 新增 通用金钱工具类,完成数字金额转换成中文大写金额 新增 通用下载工具类,处理统一附件文件存储路径 [feat]附件 新增合同模板 [fix]配置文件 修改新版配置文件 [fix]核心配置模块 修改旧版定时任务配置类dev
liuxiaoxu
3 months ago
20 changed files with 526 additions and 140 deletions
Binary file not shown.
@ -0,0 +1,61 @@ |
|||||
|
package com.ruoyi.common.utils; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
public class MoneyUtils { |
||||
|
private static final String[] CHINESE_DIGITS = {"零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"}; |
||||
|
private static final String[] UNITS = {"", "拾", "佰", "仟", "万", "亿"}; |
||||
|
|
||||
|
public static String toChineseCapitalized(BigDecimal amount) { |
||||
|
if (amount == null || amount.compareTo(BigDecimal.ZERO) == 0) { |
||||
|
return "零元整"; |
||||
|
} |
||||
|
|
||||
|
StringBuilder result = new StringBuilder(); |
||||
|
boolean isNegative = amount.signum() == -1; |
||||
|
amount = amount.abs(); |
||||
|
|
||||
|
// 将金额转换为整数部分和小数部分
|
||||
|
long integerPart = amount.longValue(); |
||||
|
BigDecimal decimalPart = amount.remainder(BigDecimal.ONE).setScale(2, BigDecimal.ROUND_HALF_UP); |
||||
|
|
||||
|
// 处理整数部分
|
||||
|
int unitIndex = 0; |
||||
|
while (integerPart > 0) { |
||||
|
int digit = (int) (integerPart % 10); |
||||
|
if (digit != 0 || result.length() > 0) { // 避免多个"零"
|
||||
|
result.insert(0, UNITS[unitIndex]); |
||||
|
} |
||||
|
result.insert(0, CHINESE_DIGITS[digit]); |
||||
|
integerPart /= 10; |
||||
|
unitIndex++; |
||||
|
if (unitIndex == 4) { |
||||
|
unitIndex = 0; |
||||
|
result.insert(0, "万"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 添加单位“元”
|
||||
|
result.append("元"); |
||||
|
|
||||
|
// 处理小数部分
|
||||
|
if (decimalPart.compareTo(BigDecimal.ZERO) > 0) { |
||||
|
result.append("零").append(CHINESE_DIGITS[decimalPart.intValue()]); |
||||
|
result.append("角"); |
||||
|
BigDecimal cents = decimalPart.remainder(BigDecimal.ONE).multiply(BigDecimal.TEN); |
||||
|
if (cents.compareTo(BigDecimal.ZERO) > 0) { |
||||
|
result.append("零").append(CHINESE_DIGITS[cents.intValue()]); |
||||
|
result.append("分"); |
||||
|
} |
||||
|
} else { |
||||
|
result.append("整"); |
||||
|
} |
||||
|
|
||||
|
if (isNegative) { |
||||
|
result.insert(0, "负"); |
||||
|
} |
||||
|
|
||||
|
return result.toString(); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.ruoyi.common.utils.file; |
||||
|
|
||||
|
import org.springframework.core.io.ClassPathResource; |
||||
|
|
||||
|
import java.io.File; |
||||
|
import java.io.IOException; |
||||
|
|
||||
|
/** |
||||
|
* 文件下载类 |
||||
|
* */ |
||||
|
public class FileDownloadUtils { |
||||
|
|
||||
|
|
||||
|
// 获取文件绝对路径
|
||||
|
public String getFileAbsolutePath(String fileName) throws IOException { |
||||
|
ClassPathResource resource = new ClassPathResource("attachments/" + fileName); |
||||
|
File file = resource.getFile(); |
||||
|
return file.getAbsolutePath(); |
||||
|
} |
||||
|
} |
@ -1,57 +1,57 @@ |
|||||
package com.ruoyi.quartz.config; |
//package com.ruoyi.quartz.config;
|
||||
|
//
|
||||
import org.springframework.context.annotation.Bean; |
//import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration; |
//import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.quartz.SchedulerFactoryBean; |
//import org.springframework.scheduling.quartz.SchedulerFactoryBean;
|
||||
import javax.sql.DataSource; |
//import javax.sql.DataSource;
|
||||
import java.util.Properties; |
//import java.util.Properties;
|
||||
|
//
|
||||
/** |
///**
|
||||
* 定时任务配置 |
// * 定时任务配置
|
||||
* |
// *
|
||||
* @author ruoyi |
// * @author ruoyi
|
||||
*/ |
// */
|
||||
@Configuration |
//@Configuration
|
||||
public class ScheduleConfig |
//public class ScheduleConfig
|
||||
{ |
//{
|
||||
@Bean |
// @Bean
|
||||
public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource) |
// public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource)
|
||||
{ |
// {
|
||||
SchedulerFactoryBean factory = new SchedulerFactoryBean(); |
// SchedulerFactoryBean factory = new SchedulerFactoryBean();
|
||||
factory.setDataSource(dataSource); |
// factory.setDataSource(dataSource);
|
||||
|
//
|
||||
// quartz参数
|
// // quartz参数
|
||||
Properties prop = new Properties(); |
// Properties prop = new Properties();
|
||||
prop.put("org.quartz.scheduler.instanceName", "RuoyiScheduler"); |
// prop.put("org.quartz.scheduler.instanceName", "RuoyiScheduler");
|
||||
prop.put("org.quartz.scheduler.instanceId", "AUTO"); |
// prop.put("org.quartz.scheduler.instanceId", "AUTO");
|
||||
// 线程池配置
|
// // 线程池配置
|
||||
prop.put("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool"); |
// prop.put("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool");
|
||||
prop.put("org.quartz.threadPool.threadCount", "20"); |
// prop.put("org.quartz.threadPool.threadCount", "20");
|
||||
prop.put("org.quartz.threadPool.threadPriority", "5"); |
// prop.put("org.quartz.threadPool.threadPriority", "5");
|
||||
// JobStore配置
|
// // JobStore配置
|
||||
prop.put("org.quartz.jobStore.class", "org.quartz.impl.jdbcjobstore.JobStoreTX"); |
// prop.put("org.quartz.jobStore.class", "org.quartz.impl.jdbcjobstore.JobStoreTX");
|
||||
// 集群配置
|
// // 集群配置
|
||||
prop.put("org.quartz.jobStore.isClustered", "true"); |
// prop.put("org.quartz.jobStore.isClustered", "true");
|
||||
prop.put("org.quartz.jobStore.clusterCheckinInterval", "15000"); |
// prop.put("org.quartz.jobStore.clusterCheckinInterval", "15000");
|
||||
prop.put("org.quartz.jobStore.maxMisfiresToHandleAtATime", "1"); |
// prop.put("org.quartz.jobStore.maxMisfiresToHandleAtATime", "1");
|
||||
prop.put("org.quartz.jobStore.txIsolationLevelSerializable", "true"); |
// prop.put("org.quartz.jobStore.txIsolationLevelSerializable", "true");
|
||||
|
//
|
||||
// sqlserver 启用
|
// // sqlserver 启用
|
||||
// prop.put("org.quartz.jobStore.selectWithLockSQL", "SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?");
|
// // prop.put("org.quartz.jobStore.selectWithLockSQL", "SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?");
|
||||
prop.put("org.quartz.jobStore.misfireThreshold", "12000"); |
// prop.put("org.quartz.jobStore.misfireThreshold", "12000");
|
||||
prop.put("org.quartz.jobStore.tablePrefix", "QRTZ_"); |
// prop.put("org.quartz.jobStore.tablePrefix", "QRTZ_");
|
||||
factory.setQuartzProperties(prop); |
// factory.setQuartzProperties(prop);
|
||||
|
//
|
||||
factory.setSchedulerName("RuoyiScheduler"); |
// factory.setSchedulerName("RuoyiScheduler");
|
||||
// 延时启动
|
// // 延时启动
|
||||
factory.setStartupDelay(1); |
// factory.setStartupDelay(1);
|
||||
factory.setApplicationContextSchedulerContextKey("applicationContextKey"); |
// factory.setApplicationContextSchedulerContextKey("applicationContextKey");
|
||||
// 可选,QuartzScheduler
|
// // 可选,QuartzScheduler
|
||||
// 启动时更新己存在的Job,这样就不用每次修改targetObject后删除qrtz_job_details表对应记录了
|
// // 启动时更新己存在的Job,这样就不用每次修改targetObject后删除qrtz_job_details表对应记录了
|
||||
factory.setOverwriteExistingJobs(true); |
// factory.setOverwriteExistingJobs(true);
|
||||
// 设置自动启动,默认为true
|
// // 设置自动启动,默认为true
|
||||
factory.setAutoStartup(true); |
// factory.setAutoStartup(true);
|
||||
|
//
|
||||
return factory; |
// return factory;
|
||||
} |
// }
|
||||
} |
//}
|
||||
|
Loading…
Reference in new issue