三江-app菜单
This commit is contained in:
parent
9c5a06003b
commit
29b9bd6678
@ -31,7 +31,7 @@ import java.util.*;
|
||||
@RestController
|
||||
@RequestMapping("/xmgl/sjSafeEnvironmentFile")
|
||||
@Slf4j
|
||||
@Api("三江安全环保资料中心")
|
||||
@Api(tags = "三江安全环保资料中心")
|
||||
public class SjSafeEnvironmentFileController {
|
||||
@Autowired
|
||||
private ISjSafeEnvironmentFileService sjSafeEnvironmentFileService;
|
||||
|
||||
@ -49,7 +49,7 @@ import com.alibaba.fastjson.JSON;
|
||||
@RestController
|
||||
@RequestMapping("/xmgl/sjSafeEnvironmentFileType")
|
||||
@Slf4j
|
||||
@Api(tags = "SjSafeEnvironmentFileTypeController相关Api")
|
||||
@Api(tags = "三江安全环保资料中心文件类型")
|
||||
public class SjSafeEnvironmentFileTypeController {
|
||||
@Autowired
|
||||
private ISjSafeEnvironmentFileTypeService sjSafeEnvironmentFileTypeService;
|
||||
@ -202,75 +202,5 @@ public class SjSafeEnvironmentFileTypeController {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
*/
|
||||
@ApiOperation(value = "导出excel三江安全环保资料中心文件类型信息", notes = "导出excel三江安全环保资料中心文件类型信息", httpMethod = "POST")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
|
||||
// Step.1 组装查询条件
|
||||
QueryWrapper<SjSafeEnvironmentFileType> queryWrapper = null;
|
||||
try {
|
||||
String paramsStr = request.getParameter("paramsStr");
|
||||
if (oConvertUtils.isNotEmpty(paramsStr)) {
|
||||
String deString = URLDecoder.decode(paramsStr, "UTF-8");
|
||||
SjSafeEnvironmentFileType sjSafeEnvironmentFileType = JSON.parseObject(deString, SjSafeEnvironmentFileType.class);
|
||||
queryWrapper = QueryGenerator.initQueryWrapper(sjSafeEnvironmentFileType, request.getParameterMap());
|
||||
}
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
//Step.2 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
List<SjSafeEnvironmentFileType> pageList = sjSafeEnvironmentFileTypeService.list(queryWrapper);
|
||||
//导出文件名称
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "三江安全环保资料中心文件类型列表");
|
||||
mv.addObject(NormalExcelConstants.CLASS, SjSafeEnvironmentFileType.class);
|
||||
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("三江安全环保资料中心文件类型列表数据", "导出人:Jeecg", "导出信息"));
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
||||
return mv;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "通过excel导入三江安全环保资料中心文件类型信息", notes = "通过excel导入三江安全环保资料中心文件类型信息", httpMethod = "POST")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
||||
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
|
||||
MultipartFile file = entity.getValue();// 获取上传文件对象
|
||||
ImportParams params = new ImportParams();
|
||||
params.setTitleRows(2);
|
||||
params.setHeadRows(1);
|
||||
params.setNeedSave(true);
|
||||
try {
|
||||
List<SjSafeEnvironmentFileType> listSjSafeEnvironmentFileTypes = ExcelImportUtil.importExcel(file.getInputStream(), SjSafeEnvironmentFileType.class, params);
|
||||
for (SjSafeEnvironmentFileType sjSafeEnvironmentFileTypeExcel : listSjSafeEnvironmentFileTypes) {
|
||||
sjSafeEnvironmentFileTypeService.save(sjSafeEnvironmentFileTypeExcel);
|
||||
}
|
||||
return Result.ok("文件导入成功!数据行数:" + listSjSafeEnvironmentFileTypes.size());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
return Result.error("文件导入失败!");
|
||||
} finally {
|
||||
try {
|
||||
file.getInputStream().close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return Result.ok("文件导入失败!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -9,7 +9,6 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
@ -77,6 +76,9 @@ public class SjSafeEnvironmentFile implements Serializable {
|
||||
@ApiModelProperty(value = "文件大小")
|
||||
private java.lang.String fileSize;
|
||||
|
||||
@ApiModelProperty(value = "三江安全环保资料中心文件类型id")
|
||||
private Long sjSafeEnvironmentFileTypeId;
|
||||
|
||||
@ApiModelProperty(value = "项目SN或企业sn")
|
||||
@TableField(exist = false)
|
||||
private java.lang.String sn;
|
||||
|
||||
@ -205,6 +205,7 @@ public class SjSafeEnvironmentFileServiceImpl extends ServiceImpl<SjSafeEnvironm
|
||||
QueryWrapper<SjSafeEnvironmentFile> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda()
|
||||
.in(SjSafeEnvironmentFile::getProjectSn, projectSnList)
|
||||
.eq(SjSafeEnvironmentFile::getSjSafeEnvironmentFileTypeId, MapUtils.getLong(map, "sjSafeEnvironmentFileTypeId"))
|
||||
.eq(SjSafeEnvironmentFile::getFilePath, MapUtils.getString(map, "filePath"));
|
||||
queryWrapper.orderByAsc("is_dir");
|
||||
List<SjSafeEnvironmentFile> list = list(queryWrapper);
|
||||
|
||||
@ -86,9 +86,9 @@ sj.unifiedAuthentication.login.url=http://116.169.63.183:30913
|
||||
#\u4E09\u6C5F\u7EDF\u4E00\u767B\u5F55\u6210\u529F\u8DF3\u8F6C\u540E\u63A5\u6536code\u7684\u5730\u5740
|
||||
#sj.unifiedAuthentication.login.code.url=http://wbtqry.natappfree.cc/xmgl/sj/unifiedAuthentication/getTokenByCode
|
||||
#\u4E09\u6C5F\u7EDF\u4E00\u767B\u5F55\u6210\u529F\u540E\u8DF3\u8F6Curl\uFF08pc\u7AEF\uFF09
|
||||
sj.unifiedAuthentication.success.redirect=http://192.168.34.226:8080/index.html#/login?UID=\
|
||||
sj.unifiedAuthentication.success.redirect=http://192.168.34.226:8080/index.html#/login?UID=
|
||||
#\u4E09\u6C5F\u7EDF\u4E00\u767B\u5F55\u6210\u529F\u540E\u8DF3\u8F6Curl\uFF08app\u7AEF\uFF09
|
||||
sj.unifiedAuthentication.success.redirect.app=http://192.168.34.226:8080/index.html#/login?UID=
|
||||
sj.unifiedAuthentication.success.redirect.app=http://192.168.34.226:8088/zjsjAPP/#/pages/projectManage/projectManage?UID=
|
||||
#\u4E09\u6C5F\u4E1A\u52A1\u4E2D\u53F0\u7F51\u5173\u5730\u5740
|
||||
sj.business.gateway.url=http://116.169.63.183:30867/
|
||||
#\u4E09\u6C5F\u4E1A\u52A1\u4E2D\u53F0\u7F51\u5173\u5730\u5740\u7684\u8C03\u7528\u51ED\u8BC1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user