修改bug
This commit is contained in:
parent
6b39d4f15a
commit
f15d254175
|
|
@ -0,0 +1,183 @@
|
||||||
|
package com.nu.modules.resourcesManagement.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||||
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
import com.nu.modules.resourcesManagement.entity.NuResourcesManagement;
|
||||||
|
import com.nu.modules.resourcesManagement.service.INuResourcesManagementService;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 资源管理
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2026-02-09
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Api(tags="资源管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/resourcesManagement/nuResourcesManagement")
|
||||||
|
@Slf4j
|
||||||
|
public class NuResourcesManagementController extends JeecgController<NuResourcesManagement, INuResourcesManagementService> {
|
||||||
|
@Autowired
|
||||||
|
private INuResourcesManagementService nuResourcesManagementService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param nuResourcesManagement
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "资源管理-分页列表查询")
|
||||||
|
@ApiOperation(value="资源管理-分页列表查询", notes="资源管理-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
@DS("devops")
|
||||||
|
public Result<IPage<NuResourcesManagement>> queryPageList(NuResourcesManagement nuResourcesManagement,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
QueryWrapper<NuResourcesManagement> queryWrapper = QueryGenerator.initQueryWrapper(nuResourcesManagement, req.getParameterMap());
|
||||||
|
Page<NuResourcesManagement> page = new Page<NuResourcesManagement>(pageNo, pageSize);
|
||||||
|
IPage<NuResourcesManagement> pageList = nuResourcesManagementService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param nuResourcesManagement
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "资源管理-添加")
|
||||||
|
@ApiOperation(value="资源管理-添加", notes="资源管理-添加")
|
||||||
|
@RequiresPermissions("resourcesManagement:nu_resources_management:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody NuResourcesManagement nuResourcesManagement) {
|
||||||
|
nuResourcesManagementService.save(nuResourcesManagement);
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param nuResourcesManagement
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "资源管理-编辑")
|
||||||
|
@ApiOperation(value="资源管理-编辑", notes="资源管理-编辑")
|
||||||
|
@RequiresPermissions("resourcesManagement:nu_resources_management:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody NuResourcesManagement nuResourcesManagement) {
|
||||||
|
nuResourcesManagementService.updateById(nuResourcesManagement);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "资源管理-通过id删除")
|
||||||
|
@ApiOperation(value="资源管理-通过id删除", notes="资源管理-通过id删除")
|
||||||
|
@RequiresPermissions("resourcesManagement:nu_resources_management:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
nuResourcesManagementService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "资源管理-批量删除")
|
||||||
|
@ApiOperation(value="资源管理-批量删除", notes="资源管理-批量删除")
|
||||||
|
@RequiresPermissions("resourcesManagement:nu_resources_management:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
this.nuResourcesManagementService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "资源管理-通过id查询")
|
||||||
|
@ApiOperation(value="资源管理-通过id查询", notes="资源管理-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<NuResourcesManagement> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
NuResourcesManagement nuResourcesManagement = nuResourcesManagementService.getById(id);
|
||||||
|
if(nuResourcesManagement==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(nuResourcesManagement);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param nuResourcesManagement
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("resourcesManagement:nu_resources_management:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, NuResourcesManagement nuResourcesManagement) {
|
||||||
|
return super.exportXls(request, nuResourcesManagement, NuResourcesManagement.class, "资源管理");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("resourcesManagement:nu_resources_management:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, NuResourcesManagement.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,82 @@
|
||||||
|
package com.nu.modules.resourcesManagement.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import org.jeecg.common.constant.ProvinceCityArea;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 资源管理
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2026-02-09
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value="nu_resources_management对象", description="资源管理")
|
||||||
|
public class NuResourcesManagement implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**id*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**createBy*/
|
||||||
|
@ApiModelProperty(value = "createBy")
|
||||||
|
private java.lang.String createBy;
|
||||||
|
/**createTime*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "createTime")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
/**updateBy*/
|
||||||
|
@ApiModelProperty(value = "updateBy")
|
||||||
|
private java.lang.String updateBy;
|
||||||
|
/**updateTime*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "updateTime")
|
||||||
|
private java.util.Date updateTime;
|
||||||
|
/**类型 1长者图片*/
|
||||||
|
@Excel(name = "类型 1长者图片", width = 15, dicCode = "resources_type")
|
||||||
|
@Dict(dicCode = "resources_type")
|
||||||
|
@ApiModelProperty(value = "类型 1长者图片")
|
||||||
|
private java.lang.String resourcesType;
|
||||||
|
/**附件图片 1图片 2mp3 3mp4 4附件*/
|
||||||
|
@Excel(name = "附件图片 1图片 2mp3 3mp4 4附件", width = 15, dicCode = "file_type")
|
||||||
|
@Dict(dicCode = "file_type")
|
||||||
|
@ApiModelProperty(value = "附件图片 1图片 2mp3 3mp4 4附件")
|
||||||
|
private java.lang.String fileType;
|
||||||
|
/**名称*/
|
||||||
|
@Excel(name = "名称", width = 15)
|
||||||
|
@ApiModelProperty(value = "名称")
|
||||||
|
private java.lang.String name;
|
||||||
|
/**附件*/
|
||||||
|
@Excel(name = "附件", width = 15)
|
||||||
|
@ApiModelProperty(value = "附件")
|
||||||
|
private java.lang.String filePath;
|
||||||
|
/**选中图片*/
|
||||||
|
@Excel(name = "选中图片", width = 15)
|
||||||
|
@ApiModelProperty(value = "选中图片")
|
||||||
|
private java.lang.String checkPicPath;
|
||||||
|
/**备注*/
|
||||||
|
@Excel(name = "备注", width = 15)
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private java.lang.String content;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.nu.modules.resourcesManagement.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import com.nu.modules.resourcesManagement.entity.NuResourcesManagement;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 资源管理
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2026-02-09
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface NuResourcesManagementMapper extends BaseMapper<NuResourcesManagement> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.nu.modules.resourcesManagement.mapper.NuResourcesManagementMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.nu.modules.resourcesManagement.service;
|
||||||
|
|
||||||
|
import com.nu.modules.resourcesManagement.entity.NuResourcesManagement;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 资源管理
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2026-02-09
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface INuResourcesManagementService extends IService<NuResourcesManagement> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.nu.modules.resourcesManagement.service.impl;
|
||||||
|
|
||||||
|
import com.nu.modules.resourcesManagement.entity.NuResourcesManagement;
|
||||||
|
import com.nu.modules.resourcesManagement.mapper.NuResourcesManagementMapper;
|
||||||
|
import com.nu.modules.resourcesManagement.service.INuResourcesManagementService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 资源管理
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2026-02-09
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class NuResourcesManagementServiceImpl extends ServiceImpl<NuResourcesManagementMapper, NuResourcesManagement> implements INuResourcesManagementService {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -225,7 +225,7 @@ mybatis-plus:
|
||||||
table-underline: true
|
table-underline: true
|
||||||
configuration:
|
configuration:
|
||||||
# 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
|
# 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
|
||||||
#log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||||
# 返回类型为Map,显示null对应的字段
|
# 返回类型为Map,显示null对应的字段
|
||||||
call-setters-on-nulls: true
|
call-setters-on-nulls: true
|
||||||
#jeecg专用配置
|
#jeecg专用配置
|
||||||
|
|
|
||||||
|
|
@ -222,7 +222,7 @@ mybatis-plus:
|
||||||
table-underline: true
|
table-underline: true
|
||||||
configuration:
|
configuration:
|
||||||
# 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
|
# 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
|
||||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||||
# 返回类型为Map,显示null对应的字段
|
# 返回类型为Map,显示null对应的字段
|
||||||
call-setters-on-nulls: true
|
call-setters-on-nulls: true
|
||||||
#jeecg专用配置
|
#jeecg专用配置
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue