重庆测试bug修复

This commit is contained in:
liang.chao 2024-10-11 11:24:40 +08:00
parent 4c1199d67e
commit eeee648882
4 changed files with 21 additions and 8 deletions

View File

@ -65,8 +65,11 @@ public class MaTypeServiceImpl implements ITypeService {
level = maType1.getLevel(); level = maType1.getLevel();
} }
maType.setLevel(String.valueOf(Integer.parseInt(level) + 1)); maType.setLevel(String.valueOf(Integer.parseInt(level) + 1));
maType.setCompanyId(maType1.getCompanyId());
maType.setCreateTime(DateUtils.getNowDate()); maType.setCreateTime(DateUtils.getNowDate());
System.out.println(maType); if (parentId == 0){
maType.setCompanyId("101");
}
int i = maTypeMapper.insertType(maType); int i = maTypeMapper.insertType(maType);
Long typeId = maType.getTypeId(); Long typeId = maType.getTypeId();
// 图片路径保存 // 图片路径保存

View File

@ -92,5 +92,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mt.type_name like concat('%',#{keyWord},'%') or mt.type_name like concat('%',#{keyWord},'%') or
mm.ma_code like concat('%',#{keyWord},'%')) mm.ma_code like concat('%',#{keyWord},'%'))
</if> </if>
order by lod.create_time desc
</select> </select>
</mapper> </mapper>

View File

@ -6,6 +6,11 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import com.bonus.sgzb.common.security.annotation.EnableCustomConfig; import com.bonus.sgzb.common.security.annotation.EnableCustomConfig;
import com.bonus.sgzb.common.security.annotation.EnableRyFeignClients; import com.bonus.sgzb.common.security.annotation.EnableRyFeignClients;
import com.bonus.sgzb.common.swagger.annotation.EnableCustomSwagger2; import com.bonus.sgzb.common.swagger.annotation.EnableCustomSwagger2;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.util.unit.DataSize;
import javax.servlet.MultipartConfigElement;
/** /**
* 系统模块 * 系统模块
@ -17,11 +22,9 @@ import com.bonus.sgzb.common.swagger.annotation.EnableCustomSwagger2;
@EnableRyFeignClients @EnableRyFeignClients
@SpringBootApplication @SpringBootApplication
@EnableEncryptableProperties @EnableEncryptableProperties
public class SgzbSystemApplication public class SgzbSystemApplication {
{ public static void main(String[] args) {
public static void main(String[] args)
{
SpringApplication.run(SgzbSystemApplication.class, args); SpringApplication.run(SgzbSystemApplication.class, args);
System.out.println("(♥◠‿◠)ノ゙ 系统模块启动成功 ლ(´ڡ`ლ)゙ \n" ); System.out.println("(♥◠‿◠)ノ゙ 系统模块启动成功 ლ(´ڡ`ლ)゙ \n");
} }
} }

View File

@ -72,6 +72,12 @@ public class SysFileServiceImpl implements SysFileService {
if (!ALLOWED_EXTENSIONS.contains(fileExtension.toLowerCase())) { if (!ALLOWED_EXTENSIONS.contains(fileExtension.toLowerCase())) {
throw new Exception("不支持该文件格式"); throw new Exception("不支持该文件格式");
} }
// 检查文件大小
long fileSize = item.getSize();
long maxSize = 20 * 1024 * 1024; // 20MB
if (fileSize > maxSize) {
throw new Exception("文件太大,请重新上传");
}
try { try {
String url = saveFile(request, item, photoType); String url = saveFile(request, item, photoType);
//AjaxResult res = fileClient.uploadFile(item); //AjaxResult res = fileClient.uploadFile(item);