增加品牌管理,品牌动态选择
This commit is contained in:
@ -284,30 +284,30 @@ public class CommonController
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
/** oss --------------- */
|
/** oss --------------- */
|
||||||
// // 检查文件是否为空
|
// 检查文件是否为空
|
||||||
// if (file.isEmpty()) {
|
if (file.isEmpty()) {
|
||||||
// return AjaxResult.error("上传文件不能为空");
|
return AjaxResult.error("上传文件不能为空");
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// // 检查文件类型(可选)
|
// 检查文件类型(可选)
|
||||||
// String contentType = file.getContentType();
|
String contentType = file.getContentType();
|
||||||
// if (contentType == null || !contentType.startsWith("image/")) {
|
if (contentType == null || !contentType.startsWith("image/")) {
|
||||||
// return AjaxResult.error("只允许上传图片文件");
|
return AjaxResult.error("只允许上传图片文件");
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// // 上传到 OSS
|
// 上传到 OSS
|
||||||
// String url = ossService.uploadImage(file);
|
String url = ossService.uploadImage(file);
|
||||||
// // 返回文件访问 URL
|
// 返回文件访问 URL
|
||||||
// String[] str = url.split("/");
|
String[] str = url.split("/");
|
||||||
// String fileName = str[str.length - 1];
|
String fileName = str[str.length - 1];
|
||||||
|
|
||||||
/** 原文件上传 --------------- */
|
/** 原文件上传 --------------- */
|
||||||
// 上传文件路径
|
// // 上传文件路径
|
||||||
String filePath = RuoYiConfig.getUploadPath();
|
// String filePath = RuoYiConfig.getUploadPath();
|
||||||
// 上传并返回新文件名称
|
// // 上传并返回新文件名称
|
||||||
String fileName = FileUploadUtils.upload(filePath, fileType, file);
|
// String fileName = FileUploadUtils.upload(filePath, fileType, file);
|
||||||
|
//
|
||||||
String url = serverConfig.getUrl() + fileName;
|
// String url = serverConfig.getUrl() + fileName;
|
||||||
/** -------------------------- */
|
/** -------------------------- */
|
||||||
String uuid = UUID.randomUUID().toString();
|
String uuid = UUID.randomUUID().toString();
|
||||||
CommonAttachment insert = new CommonAttachment();
|
CommonAttachment insert = new CommonAttachment();
|
||||||
|
|||||||
@ -58,6 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="extend2 != null and extend2 != ''"> and extend2 = #{extend2}</if>
|
<if test="extend2 != null and extend2 != ''"> and extend2 = #{extend2}</if>
|
||||||
<if test="extend3 != null and extend3 != ''"> and extend3 = #{extend3}</if>
|
<if test="extend3 != null and extend3 != ''"> and extend3 = #{extend3}</if>
|
||||||
</where>
|
</where>
|
||||||
|
order by update_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectZcCarBrandById" parameterType="Long" resultMap="ZcCarBrandZcCarModelResult">
|
<select id="selectZcCarBrandById" parameterType="Long" resultMap="ZcCarBrandZcCarModelResult">
|
||||||
|
|||||||
@ -53,6 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="brandName != null and brandName != ''"> and brand_name like concat('%', #{brandName}, '%')</if>
|
<if test="brandName != null and brandName != ''"> and brand_name like concat('%', #{brandName}, '%')</if>
|
||||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||||
</where>
|
</where>
|
||||||
|
order by update_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectZcCarModelById" parameterType="Long" resultMap="ZcCarModelResult">
|
<select id="selectZcCarModelById" parameterType="Long" resultMap="ZcCarModelResult">
|
||||||
|
|||||||
@ -234,19 +234,11 @@
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
title: '实际支付时间'
|
title: '实际支付时间'
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
|
||||||
field: 'remark',
|
|
||||||
align: 'center',
|
|
||||||
title: '备注'
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
field: 'createTime',
|
field: 'createTime',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
title: '创建时间'
|
title: '创建时间'
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
field: 'updateTime',
|
field: 'updateTime',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
|||||||
@ -50,14 +50,13 @@ public class OssService {
|
|||||||
// 上传文件
|
// 上传文件
|
||||||
ossClient.putObject(putObjectRequest);
|
ossClient.putObject(putObjectRequest);
|
||||||
|
|
||||||
// 设置预签名URL过期时间,单位为亮秒。本示例以设置过期时间为1小时为例
|
// // 设置预签名URL过期时间,单位为亮秒。本示例以设置过期时间为1小时为例
|
||||||
Date expiration = new Date(new Date().getTime()+ 3600 * 1000L);
|
// Date expiration = new Date(new Date().getTime()+ 3600 * 1000L);
|
||||||
//生成以GET方法访问的预签名URL、本示例没有额外请求头,其他人可以直按通过湖览器访问相关内容
|
// //生成以GET方法访问的预签名URL、本示例没有额外请求头,其他人可以直按通过湖览器访问相关内容
|
||||||
URL url = ossClient.generatePresignedUrl(ossConfig.getBucketName(), objectName, expiration);
|
// URL url = ossClient.generatePresignedUrl(ossConfig.getBucketName(), objectName, expiration);
|
||||||
System.out.println(url);
|
// return url.toString();
|
||||||
return url.toString();
|
|
||||||
// 返回文件访问 URL
|
// 返回文件访问 URL
|
||||||
//return "https://" + ossConfig.getDomain() + "/" + objectName;
|
return "https://" + ossConfig.getDomain() + "/" + objectName;
|
||||||
} catch (com.aliyun.oss.OSSException e) {
|
} catch (com.aliyun.oss.OSSException e) {
|
||||||
if ("AccessDenied".equals(e.getErrorCode())) {
|
if ("AccessDenied".equals(e.getErrorCode())) {
|
||||||
throw new IOException("OSS权限不足,请联系管理员配置权限。错误代码: " + e.getErrorCode(), e);
|
throw new IOException("OSS权限不足,请联系管理员配置权限。错误代码: " + e.getErrorCode(), e);
|
||||||
|
|||||||
Reference in New Issue
Block a user