From 845e93eeedcf5d0a3ee3ae411348cde1d69369a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=B6=E4=B8=9C?= <1654135867@qq.com> Date: Fri, 1 Nov 2024 10:52:45 +0800 Subject: [PATCH 01/19] =?UTF-8?q?=E9=83=A8=E9=97=A8=E8=B5=84=E8=B4=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DepadminlxController.java | 21 +++++++++++----- .../demo/depadminlx/entity/Depadminlx.java | 5 ++++ .../depadminlx/mapper/DepadminlxMapper.java | 3 +++ .../service/IDepadminlxService.java | 1 + .../service/impl/DepadminlxServiceImpl.java | 7 ++++++ .../depfile/controller/DepfileController.java | 25 ++++++++++++++----- .../modules/demo/depfile/entity/Depfile.java | 5 ++++ .../controller/DepsbnczController.java | 24 +++++++++++++----- .../demo/depsbncz/entity/Depsbncz.java | 5 ++++ 9 files changed, 78 insertions(+), 18 deletions(-) diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depadminlx/controller/DepadminlxController.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depadminlx/controller/DepadminlxController.java index 2c08804..862f830 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depadminlx/controller/DepadminlxController.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depadminlx/controller/DepadminlxController.java @@ -10,9 +10,12 @@ import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + +import org.apache.shiro.SecurityUtils; 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.system.vo.LoginUser; import org.jeecg.common.util.oConvertUtils; import org.jeecg.modules.demo.depadminlx.entity.Depadminlx; import org.jeecg.modules.demo.depadminlx.service.IDepadminlxService; @@ -52,7 +55,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions; public class DepadminlxController extends JeecgController { @Autowired private IDepadminlxService depadminlxService; - + /** * 分页列表查询 * @@ -69,12 +72,14 @@ public class DepadminlxController extends JeecgController queryWrapper = QueryGenerator.initQueryWrapper(depadminlx, req.getParameterMap()); + queryWrapper.eq("userid",user.getId()); Page page = new Page(pageNo, pageSize); IPage pageList = depadminlxService.page(page, queryWrapper); return Result.OK(pageList); } - + /** * 添加 * @@ -86,10 +91,14 @@ public class DepadminlxController extends JeecgController add(@RequestBody Depadminlx depadminlx) { + LoginUser user= (LoginUser) SecurityUtils.getSubject().getPrincipal(); + depadminlx.setUserid(user.getId()); + String depiid = depadminlxService.getdepid(user.getId()); + depadminlx.setDepid(depiid); depadminlxService.save(depadminlx); return Result.OK("添加成功!"); } - + /** * 编辑 * @@ -104,7 +113,7 @@ public class DepadminlxController extends JeecgController { + @Select("select dep_id from sys_user_depart where user_id=#{id}") + String getdepid(String id); } diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depadminlx/service/IDepadminlxService.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depadminlx/service/IDepadminlxService.java index 6830a3c..d044b48 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depadminlx/service/IDepadminlxService.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depadminlx/service/IDepadminlxService.java @@ -11,4 +11,5 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface IDepadminlxService extends IService { + String getdepid(String id); } diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depadminlx/service/impl/DepadminlxServiceImpl.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depadminlx/service/impl/DepadminlxServiceImpl.java index 8c60899..c6b3bc7 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depadminlx/service/impl/DepadminlxServiceImpl.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depadminlx/service/impl/DepadminlxServiceImpl.java @@ -3,6 +3,7 @@ package org.jeecg.modules.demo.depadminlx.service.impl; import org.jeecg.modules.demo.depadminlx.entity.Depadminlx; import org.jeecg.modules.demo.depadminlx.mapper.DepadminlxMapper; import org.jeecg.modules.demo.depadminlx.service.IDepadminlxService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -16,4 +17,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @Service public class DepadminlxServiceImpl extends ServiceImpl implements IDepadminlxService { + @Autowired + private DepadminlxMapper depadminlxMapper; + @Override + public String getdepid(String id) { + return depadminlxMapper.getdepid(id); + } } diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depfile/controller/DepfileController.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depfile/controller/DepfileController.java index 92f9469..6fcf93b 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depfile/controller/DepfileController.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depfile/controller/DepfileController.java @@ -10,10 +10,14 @@ import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + +import org.apache.shiro.SecurityUtils; 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.system.vo.LoginUser; import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.demo.depadminlx.service.IDepadminlxService; import org.jeecg.modules.demo.depfile.entity.Depfile; import org.jeecg.modules.demo.depfile.service.IDepfileService; @@ -52,7 +56,10 @@ import org.apache.shiro.authz.annotation.RequiresPermissions; public class DepfileController extends JeecgController { @Autowired private IDepfileService depfileService; - + + @Autowired + private IDepadminlxService depadminlxService; + /** * 分页列表查询 * @@ -69,12 +76,14 @@ public class DepfileController extends JeecgController @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, HttpServletRequest req) { + LoginUser user= (LoginUser) SecurityUtils.getSubject().getPrincipal(); QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(depfile, req.getParameterMap()); + queryWrapper.eq("userid",user.getId()); Page page = new Page(pageNo, pageSize); IPage pageList = depfileService.page(page, queryWrapper); return Result.OK(pageList); } - + /** * 添加 * @@ -86,10 +95,14 @@ public class DepfileController extends JeecgController @RequiresPermissions("depfile:depfile:add") @PostMapping(value = "/add") public Result add(@RequestBody Depfile depfile) { + LoginUser user= (LoginUser) SecurityUtils.getSubject().getPrincipal(); + depfile.setUserid(user.getId()); + String depiid = depadminlxService.getdepid(user.getId()); + depfile.setDepid(depiid); depfileService.save(depfile); return Result.OK("添加成功!"); } - + /** * 编辑 * @@ -104,7 +117,7 @@ public class DepfileController extends JeecgController depfileService.updateById(depfile); return Result.OK("编辑成功!"); } - + /** * 通过id删除 * @@ -119,7 +132,7 @@ public class DepfileController extends JeecgController depfileService.removeById(id); return Result.OK("删除成功!"); } - + /** * 批量删除 * @@ -134,7 +147,7 @@ public class DepfileController extends JeecgController this.depfileService.removeByIds(Arrays.asList(ids.split(","))); return Result.OK("批量删除成功!"); } - + /** * 通过id查询 * diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depfile/entity/Depfile.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depfile/entity/Depfile.java index 0403607..542eada 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depfile/entity/Depfile.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depfile/entity/Depfile.java @@ -80,4 +80,9 @@ public class Depfile implements Serializable { @Excel(name = "文件", width = 15) @ApiModelProperty(value = "文件") private String upfile; + + /**用户id*/ + @Excel(name = "用户id", width = 15) + @ApiModelProperty(value = "用户id") + private java.lang.String userid; } diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depsbncz/controller/DepsbnczController.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depsbncz/controller/DepsbnczController.java index fa8b637..9fbd656 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depsbncz/controller/DepsbnczController.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depsbncz/controller/DepsbnczController.java @@ -10,10 +10,14 @@ import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + +import org.apache.shiro.SecurityUtils; 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.system.vo.LoginUser; import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.demo.depadminlx.service.IDepadminlxService; import org.jeecg.modules.demo.depsbncz.entity.Depsbncz; import org.jeecg.modules.demo.depsbncz.service.IDepsbnczService; @@ -52,7 +56,9 @@ import org.apache.shiro.authz.annotation.RequiresPermissions; public class DepsbnczController extends JeecgController { @Autowired private IDepsbnczService depsbnczService; - + @Autowired + private IDepadminlxService depadminlxService; + /** * 分页列表查询 * @@ -69,12 +75,14 @@ public class DepsbnczController extends JeecgController queryWrapper = QueryGenerator.initQueryWrapper(depsbncz, req.getParameterMap()); + queryWrapper.eq("userid",user.getId()); Page page = new Page(pageNo, pageSize); IPage pageList = depsbnczService.page(page, queryWrapper); return Result.OK(pageList); } - + /** * 添加 * @@ -86,10 +94,14 @@ public class DepsbnczController extends JeecgController add(@RequestBody Depsbncz depsbncz) { + LoginUser user= (LoginUser) SecurityUtils.getSubject().getPrincipal(); + depsbncz.setUserid(user.getId()); + String depiid = depadminlxService.getdepid(user.getId()); + depsbncz.setDepid(depiid); depsbnczService.save(depsbncz); return Result.OK("添加成功!"); } - + /** * 编辑 * @@ -104,7 +116,7 @@ public class DepsbnczController extends JeecgController Date: Fri, 1 Nov 2024 11:07:10 +0800 Subject: [PATCH 02/19] =?UTF-8?q?=E9=83=A8=E9=97=A8=E8=B5=84=E8=B4=A8bug?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DepadminlxController.java | 7 ----- .../depfile/controller/DepfileController.java | 7 ----- .../controller/DepsbnczController.java | 8 +----- .../src/views/depadminlx/DepadminlxList.vue | 24 ++++++++-------- .../depadminlx/components/DepadminlxForm.vue | 26 ++++++++--------- .../src/views/depfile/DepfileList.vue | 24 ++++++++-------- .../views/depfile/components/DepfileForm.vue | 16 +++++------ .../src/views/depsbncz/DepsbnczList.vue | 24 ++++++++-------- .../depsbncz/components/DepsbnczForm.vue | 28 +++++++++---------- 9 files changed, 72 insertions(+), 92 deletions(-) diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depadminlx/controller/DepadminlxController.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depadminlx/controller/DepadminlxController.java index 862f830..74a0703 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depadminlx/controller/DepadminlxController.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depadminlx/controller/DepadminlxController.java @@ -40,7 +40,6 @@ 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: 单位基本情况联系人 @@ -88,7 +87,6 @@ public class DepadminlxController extends JeecgController add(@RequestBody Depadminlx depadminlx) { LoginUser user= (LoginUser) SecurityUtils.getSubject().getPrincipal(); @@ -107,7 +105,6 @@ public class DepadminlxController extends JeecgController edit(@RequestBody Depadminlx depadminlx) { depadminlxService.updateById(depadminlx); @@ -122,7 +119,6 @@ public class DepadminlxController extends JeecgController delete(@RequestParam(name="id",required=true) String id) { depadminlxService.removeById(id); @@ -137,7 +133,6 @@ public class DepadminlxController extends JeecgController deleteBatch(@RequestParam(name="ids",required=true) String ids) { this.depadminlxService.removeByIds(Arrays.asList(ids.split(","))); @@ -167,7 +162,6 @@ public class DepadminlxController extends JeecgController importExcel(HttpServletRequest request, HttpServletResponse response) { return super.importExcel(request, response, Depadminlx.class); diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depfile/controller/DepfileController.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depfile/controller/DepfileController.java index 6fcf93b..a163ee9 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depfile/controller/DepfileController.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depfile/controller/DepfileController.java @@ -41,7 +41,6 @@ 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: 单位技术研究资质情况 @@ -92,7 +91,6 @@ public class DepfileController extends JeecgController */ @AutoLog(value = "单位技术研究资质情况-添加") @ApiOperation(value="单位技术研究资质情况-添加", notes="单位技术研究资质情况-添加") - @RequiresPermissions("depfile:depfile:add") @PostMapping(value = "/add") public Result add(@RequestBody Depfile depfile) { LoginUser user= (LoginUser) SecurityUtils.getSubject().getPrincipal(); @@ -111,7 +109,6 @@ public class DepfileController extends JeecgController */ @AutoLog(value = "单位技术研究资质情况-编辑") @ApiOperation(value="单位技术研究资质情况-编辑", notes="单位技术研究资质情况-编辑") - @RequiresPermissions("depfile:depfile:edit") @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) public Result edit(@RequestBody Depfile depfile) { depfileService.updateById(depfile); @@ -126,7 +123,6 @@ public class DepfileController extends JeecgController */ @AutoLog(value = "单位技术研究资质情况-通过id删除") @ApiOperation(value="单位技术研究资质情况-通过id删除", notes="单位技术研究资质情况-通过id删除") - @RequiresPermissions("depfile:depfile:delete") @DeleteMapping(value = "/delete") public Result delete(@RequestParam(name="id",required=true) String id) { depfileService.removeById(id); @@ -141,7 +137,6 @@ public class DepfileController extends JeecgController */ @AutoLog(value = "单位技术研究资质情况-批量删除") @ApiOperation(value="单位技术研究资质情况-批量删除", notes="单位技术研究资质情况-批量删除") - @RequiresPermissions("depfile:depfile:deleteBatch") @DeleteMapping(value = "/deleteBatch") public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { this.depfileService.removeByIds(Arrays.asList(ids.split(","))); @@ -171,7 +166,6 @@ public class DepfileController extends JeecgController * @param request * @param depfile */ - @RequiresPermissions("depfile:depfile:exportXls") @RequestMapping(value = "/exportXls") public ModelAndView exportXls(HttpServletRequest request, Depfile depfile) { return super.exportXls(request, depfile, Depfile.class, "单位技术研究资质情况"); @@ -184,7 +178,6 @@ public class DepfileController extends JeecgController * @param response * @return */ - @RequiresPermissions("depfile:depfile:importExcel") @RequestMapping(value = "/importExcel", method = RequestMethod.POST) public Result importExcel(HttpServletRequest request, HttpServletResponse response) { return super.importExcel(request, response, Depfile.class); diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depsbncz/controller/DepsbnczController.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depsbncz/controller/DepsbnczController.java index 9fbd656..fb903ae 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depsbncz/controller/DepsbnczController.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depsbncz/controller/DepsbnczController.java @@ -41,7 +41,7 @@ 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: 上年度(末)主要财务数据 @@ -91,7 +91,6 @@ public class DepsbnczController extends JeecgController add(@RequestBody Depsbncz depsbncz) { LoginUser user= (LoginUser) SecurityUtils.getSubject().getPrincipal(); @@ -110,7 +109,6 @@ public class DepsbnczController extends JeecgController edit(@RequestBody Depsbncz depsbncz) { depsbnczService.updateById(depsbncz); @@ -125,7 +123,6 @@ public class DepsbnczController extends JeecgController delete(@RequestParam(name="id",required=true) String id) { depsbnczService.removeById(id); @@ -140,7 +137,6 @@ public class DepsbnczController extends JeecgController deleteBatch(@RequestParam(name="ids",required=true) String ids) { this.depsbnczService.removeByIds(Arrays.asList(ids.split(","))); @@ -170,7 +166,6 @@ public class DepsbnczController extends JeecgController importExcel(HttpServletRequest request, HttpServletResponse response) { return super.importExcel(request, response, Depsbncz.class); diff --git a/jeecgboot-vue3/src/views/depadminlx/DepadminlxList.vue b/jeecgboot-vue3/src/views/depadminlx/DepadminlxList.vue index 0d70cd0..25118c7 100644 --- a/jeecgboot-vue3/src/views/depadminlx/DepadminlxList.vue +++ b/jeecgboot-vue3/src/views/depadminlx/DepadminlxList.vue @@ -29,7 +29,7 @@ @@ -80,16 +80,16 @@ const emit = defineEmits(['register', 'ok']); const formData = reactive>({ id: '', - bzs: '', - zzzgrs: '', - zjzcysyjrys: '', - dwlxrxm: '', - dwlxrzc: '', - dwlxrzw: '', - dwlxrdh: '', - dwlxrsj: '', - dwlxryx: '', - depid: '', + bzs: '', + zzzgrs: '', + zjzcysyjrys: '', + dwlxrxm: '', + dwlxrzc: '', + dwlxrzw: '', + dwlxrdh: '', + dwlxrsj: '', + dwlxryx: '', + depid: '', }); const { createMessage } = useMessage(); const labelCol = ref({ xs: { span: 24 }, sm: { span: 5 } }); @@ -114,7 +114,7 @@ return props.formDisabled; }); - + /** * 新增 */ diff --git a/jeecgboot-vue3/src/views/depfile/DepfileList.vue b/jeecgboot-vue3/src/views/depfile/DepfileList.vue index 836673c..46b5229 100644 --- a/jeecgboot-vue3/src/views/depfile/DepfileList.vue +++ b/jeecgboot-vue3/src/views/depfile/DepfileList.vue @@ -11,7 +11,7 @@