文件后缀

master
erzhongxmu 2022-11-30 14:46:31 +08:00
parent 1155fc5883
commit ed7a98d10d
1 changed files with 5 additions and 83 deletions

View File

@ -7,14 +7,7 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.*;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@ -32,15 +25,7 @@ import org.jeecgframework.core.constant.Globals;
import org.jeecgframework.core.extend.hqlsearch.parse.ObjectParseUtil; import org.jeecgframework.core.extend.hqlsearch.parse.ObjectParseUtil;
import org.jeecgframework.core.extend.hqlsearch.parse.PageValueConvertRuleEnum; import org.jeecgframework.core.extend.hqlsearch.parse.PageValueConvertRuleEnum;
import org.jeecgframework.core.extend.hqlsearch.parse.vo.HqlRuleEnum; import org.jeecgframework.core.extend.hqlsearch.parse.vo.HqlRuleEnum;
import org.jeecgframework.core.util.JSONHelper; import org.jeecgframework.core.util.*;
import org.jeecgframework.core.util.ListUtils;
import org.jeecgframework.core.util.MutiLangSqlCriteriaUtil;
import org.jeecgframework.core.util.MutiLangUtil;
import org.jeecgframework.core.util.ResourceUtil;
import org.jeecgframework.core.util.SetListSort;
import org.jeecgframework.core.util.StringUtil;
import org.jeecgframework.core.util.YouBianCodeUtil;
import org.jeecgframework.core.util.oConvertUtils;
import org.jeecgframework.tag.core.easyui.TagUtil; import org.jeecgframework.tag.core.easyui.TagUtil;
import org.jeecgframework.tag.vo.datatable.SortDirection; import org.jeecgframework.tag.vo.datatable.SortDirection;
import org.jeecgframework.tag.vo.easyui.ComboTreeModel; import org.jeecgframework.tag.vo.easyui.ComboTreeModel;
@ -277,36 +262,6 @@ public class SystemController extends BaseController {
return new ModelAndView("system/type/typeListForTypegroup"); return new ModelAndView("system/type/typeListForTypegroup");
} }
// @RequestMapping(params = "typeGroupTree")
// @ResponseBody
// public List<ComboTree> typeGroupTree(HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
// CriteriaQuery cq = new CriteriaQuery(TSTypegroup.class);
// List<TSTypegroup> typeGroupList = systemService.getListByCriteriaQuery(cq, false);
// List<ComboTree> trees = new ArrayList<ComboTree>();
// for (TSTypegroup obj : typeGroupList) {
// ComboTree tree = new ComboTree();
// tree.setId(obj.getId());
// tree.setText(obj.getTypegroupname());
// List<TSType> types = obj.getTSTypes();
// if (types != null) {
// if (types.size() > 0) {
// //tree.setState("closed");
// List<ComboTree> children = new ArrayList<ComboTree>();
// for (TSType type : types) {
// ComboTree tree2 = new ComboTree();
// tree2.setId(type.getId());
// tree2.setText(type.getTypename());
// children.add(tree2);
// }
// tree.setChildren(children);
// }
// }
// //tree.setChecked(false);
// trees.add(tree);
// }
// return trees;
// }
@RequestMapping(params = "typeGridTree") @RequestMapping(params = "typeGridTree")
@ResponseBody @ResponseBody
@Deprecated // add-begin-end--Author:zhangguoming Date:20140928 for数据字典修改该方法启用数据字典不在已树结构展示了 @Deprecated // add-begin-end--Author:zhangguoming Date:20140928 for数据字典修改该方法启用数据字典不在已树结构展示了
@ -360,41 +315,6 @@ public class SystemController extends BaseController {
return treeGrids; return treeGrids;
} }
// private void assembleConditionForMutilLang(CriteriaQuery cq, String typegroupname, List<String> typegroupnameKeyList) {
// Map<String,String> typegroupnameMap = new HashMap<String, String>();
// for (String nameKey : typegroupnameKeyList) {
// String name = mutiLangService.getLang(nameKey);
// typegroupnameMap.put(nameKey, name);
// }
// List<String> tepegroupnameParamList = new ArrayList<String>();
// for (Map.Entry<String, String> entry : typegroupnameMap.entrySet()) {
// String key = entry.getKey();
// String value = entry.getValue();
// if (typegroupname.startsWith("*") && typegroupname.endsWith("*")) {
// if (value.contains(typegroupname)) {
// tepegroupnameParamList.add(key);
// }
// } else if(typegroupname.startsWith("*")) {
// if (value.endsWith(typegroupname.substring(1))) {
// tepegroupnameParamList.add(key);
// }
// } else if(typegroupname.endsWith("*")) {
// if (value.startsWith(typegroupname.substring(0, typegroupname.length() -1))) {
// tepegroupnameParamList.add(key);
// }
// } else {
// if (value.equals(typegroupname)) {
// tepegroupnameParamList.add(key);
// }
// }
// }
//
// if (tepegroupnameParamList.size() > 0) {
// cq.in("typegroupname", tepegroupnameParamList.toArray());
// cq.add();
// }
// }
/** /**
* IDG * IDG
* *
@ -1255,7 +1175,9 @@ public class SystemController extends BaseController {
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
MultipartFile mf=multipartRequest.getFile("file");// 获取上传文件对象 MultipartFile mf=multipartRequest.getFile("file");// 获取上传文件对象
fileName = mf.getOriginalFilename();// 获取文件名 fileName = mf.getOriginalFilename();// 获取文件名
String savePath = file.getPath() + File.separator + fileName; String fileExt = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
// TODO: 2022/11/30 判断文件后缀
String savePath = file.getPath() + File.separator + fileName;
File savefile = new File(savePath); File savefile = new File(savePath);
FileCopyUtils.copy(mf.getBytes(), savefile); FileCopyUtils.copy(mf.getBytes(), savefile);
msg="上传成功"; msg="上传成功";