部门资质

master
王家东 3 weeks ago
parent ea38962963
commit 845e93eeed
  1. 21
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depadminlx/controller/DepadminlxController.java
  2. 5
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depadminlx/entity/Depadminlx.java
  3. 3
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depadminlx/mapper/DepadminlxMapper.java
  4. 1
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depadminlx/service/IDepadminlxService.java
  5. 7
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depadminlx/service/impl/DepadminlxServiceImpl.java
  6. 25
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depfile/controller/DepfileController.java
  7. 5
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depfile/entity/Depfile.java
  8. 24
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depsbncz/controller/DepsbnczController.java
  9. 5
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depsbncz/entity/Depsbncz.java

@ -10,9 +10,12 @@ import java.io.UnsupportedEncodingException;
import java.net.URLDecoder; import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.query.QueryRuleEnum; import org.jeecg.common.system.query.QueryRuleEnum;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.oConvertUtils; import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.demo.depadminlx.entity.Depadminlx; import org.jeecg.modules.demo.depadminlx.entity.Depadminlx;
import org.jeecg.modules.demo.depadminlx.service.IDepadminlxService; import org.jeecg.modules.demo.depadminlx.service.IDepadminlxService;
@ -52,7 +55,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
public class DepadminlxController extends JeecgController<Depadminlx, IDepadminlxService> { public class DepadminlxController extends JeecgController<Depadminlx, IDepadminlxService> {
@Autowired @Autowired
private IDepadminlxService depadminlxService; private IDepadminlxService depadminlxService;
/** /**
* 分页列表查询 * 分页列表查询
* *
@ -69,12 +72,14 @@ public class DepadminlxController extends JeecgController<Depadminlx, IDepadminl
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) { HttpServletRequest req) {
LoginUser user= (LoginUser) SecurityUtils.getSubject().getPrincipal();
QueryWrapper<Depadminlx> queryWrapper = QueryGenerator.initQueryWrapper(depadminlx, req.getParameterMap()); QueryWrapper<Depadminlx> queryWrapper = QueryGenerator.initQueryWrapper(depadminlx, req.getParameterMap());
queryWrapper.eq("userid",user.getId());
Page<Depadminlx> page = new Page<Depadminlx>(pageNo, pageSize); Page<Depadminlx> page = new Page<Depadminlx>(pageNo, pageSize);
IPage<Depadminlx> pageList = depadminlxService.page(page, queryWrapper); IPage<Depadminlx> pageList = depadminlxService.page(page, queryWrapper);
return Result.OK(pageList); return Result.OK(pageList);
} }
/** /**
* 添加 * 添加
* *
@ -86,10 +91,14 @@ public class DepadminlxController extends JeecgController<Depadminlx, IDepadminl
@RequiresPermissions("depadminlx:depadminlx:add") @RequiresPermissions("depadminlx:depadminlx:add")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<String> add(@RequestBody Depadminlx depadminlx) { public Result<String> 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); depadminlxService.save(depadminlx);
return Result.OK("添加成功!"); return Result.OK("添加成功!");
} }
/** /**
* 编辑 * 编辑
* *
@ -104,7 +113,7 @@ public class DepadminlxController extends JeecgController<Depadminlx, IDepadminl
depadminlxService.updateById(depadminlx); depadminlxService.updateById(depadminlx);
return Result.OK("编辑成功!"); return Result.OK("编辑成功!");
} }
/** /**
* 通过id删除 * 通过id删除
* *
@ -119,7 +128,7 @@ public class DepadminlxController extends JeecgController<Depadminlx, IDepadminl
depadminlxService.removeById(id); depadminlxService.removeById(id);
return Result.OK("删除成功!"); return Result.OK("删除成功!");
} }
/** /**
* 批量删除 * 批量删除
* *
@ -134,7 +143,7 @@ public class DepadminlxController extends JeecgController<Depadminlx, IDepadminl
this.depadminlxService.removeByIds(Arrays.asList(ids.split(","))); this.depadminlxService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!"); return Result.OK("批量删除成功!");
} }
/** /**
* 通过id查询 * 通过id查询
* *

@ -98,4 +98,9 @@ public class Depadminlx implements Serializable {
@Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") @Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
@ApiModelProperty(value = "部门") @ApiModelProperty(value = "部门")
private String depid; private String depid;
/**用户id*/
@Excel(name = "用户id", width = 15)
@ApiModelProperty(value = "用户id")
private java.lang.String userid;
} }

@ -3,6 +3,7 @@ package org.jeecg.modules.demo.depadminlx.mapper;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.demo.depadminlx.entity.Depadminlx; import org.jeecg.modules.demo.depadminlx.entity.Depadminlx;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@ -14,4 +15,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface DepadminlxMapper extends BaseMapper<Depadminlx> { public interface DepadminlxMapper extends BaseMapper<Depadminlx> {
@Select("select dep_id from sys_user_depart where user_id=#{id}")
String getdepid(String id);
} }

@ -11,4 +11,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/ */
public interface IDepadminlxService extends IService<Depadminlx> { public interface IDepadminlxService extends IService<Depadminlx> {
String getdepid(String id);
} }

@ -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.entity.Depadminlx;
import org.jeecg.modules.demo.depadminlx.mapper.DepadminlxMapper; import org.jeecg.modules.demo.depadminlx.mapper.DepadminlxMapper;
import org.jeecg.modules.demo.depadminlx.service.IDepadminlxService; import org.jeecg.modules.demo.depadminlx.service.IDepadminlxService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -16,4 +17,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@Service @Service
public class DepadminlxServiceImpl extends ServiceImpl<DepadminlxMapper, Depadminlx> implements IDepadminlxService { public class DepadminlxServiceImpl extends ServiceImpl<DepadminlxMapper, Depadminlx> implements IDepadminlxService {
@Autowired
private DepadminlxMapper depadminlxMapper;
@Override
public String getdepid(String id) {
return depadminlxMapper.getdepid(id);
}
} }

@ -10,10 +10,14 @@ import java.io.UnsupportedEncodingException;
import java.net.URLDecoder; import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.query.QueryRuleEnum; import org.jeecg.common.system.query.QueryRuleEnum;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.oConvertUtils; 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.entity.Depfile;
import org.jeecg.modules.demo.depfile.service.IDepfileService; import org.jeecg.modules.demo.depfile.service.IDepfileService;
@ -52,7 +56,10 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
public class DepfileController extends JeecgController<Depfile, IDepfileService> { public class DepfileController extends JeecgController<Depfile, IDepfileService> {
@Autowired @Autowired
private IDepfileService depfileService; private IDepfileService depfileService;
@Autowired
private IDepadminlxService depadminlxService;
/** /**
* 分页列表查询 * 分页列表查询
* *
@ -69,12 +76,14 @@ public class DepfileController extends JeecgController<Depfile, IDepfileService>
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) { HttpServletRequest req) {
LoginUser user= (LoginUser) SecurityUtils.getSubject().getPrincipal();
QueryWrapper<Depfile> queryWrapper = QueryGenerator.initQueryWrapper(depfile, req.getParameterMap()); QueryWrapper<Depfile> queryWrapper = QueryGenerator.initQueryWrapper(depfile, req.getParameterMap());
queryWrapper.eq("userid",user.getId());
Page<Depfile> page = new Page<Depfile>(pageNo, pageSize); Page<Depfile> page = new Page<Depfile>(pageNo, pageSize);
IPage<Depfile> pageList = depfileService.page(page, queryWrapper); IPage<Depfile> pageList = depfileService.page(page, queryWrapper);
return Result.OK(pageList); return Result.OK(pageList);
} }
/** /**
* 添加 * 添加
* *
@ -86,10 +95,14 @@ public class DepfileController extends JeecgController<Depfile, IDepfileService>
@RequiresPermissions("depfile:depfile:add") @RequiresPermissions("depfile:depfile:add")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<String> add(@RequestBody Depfile depfile) { public Result<String> 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); depfileService.save(depfile);
return Result.OK("添加成功!"); return Result.OK("添加成功!");
} }
/** /**
* 编辑 * 编辑
* *
@ -104,7 +117,7 @@ public class DepfileController extends JeecgController<Depfile, IDepfileService>
depfileService.updateById(depfile); depfileService.updateById(depfile);
return Result.OK("编辑成功!"); return Result.OK("编辑成功!");
} }
/** /**
* 通过id删除 * 通过id删除
* *
@ -119,7 +132,7 @@ public class DepfileController extends JeecgController<Depfile, IDepfileService>
depfileService.removeById(id); depfileService.removeById(id);
return Result.OK("删除成功!"); return Result.OK("删除成功!");
} }
/** /**
* 批量删除 * 批量删除
* *
@ -134,7 +147,7 @@ public class DepfileController extends JeecgController<Depfile, IDepfileService>
this.depfileService.removeByIds(Arrays.asList(ids.split(","))); this.depfileService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!"); return Result.OK("批量删除成功!");
} }
/** /**
* 通过id查询 * 通过id查询
* *

@ -80,4 +80,9 @@ public class Depfile implements Serializable {
@Excel(name = "文件", width = 15) @Excel(name = "文件", width = 15)
@ApiModelProperty(value = "文件") @ApiModelProperty(value = "文件")
private String upfile; private String upfile;
/**用户id*/
@Excel(name = "用户id", width = 15)
@ApiModelProperty(value = "用户id")
private java.lang.String userid;
} }

@ -10,10 +10,14 @@ import java.io.UnsupportedEncodingException;
import java.net.URLDecoder; import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.query.QueryRuleEnum; import org.jeecg.common.system.query.QueryRuleEnum;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.oConvertUtils; 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.entity.Depsbncz;
import org.jeecg.modules.demo.depsbncz.service.IDepsbnczService; import org.jeecg.modules.demo.depsbncz.service.IDepsbnczService;
@ -52,7 +56,9 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
public class DepsbnczController extends JeecgController<Depsbncz, IDepsbnczService> { public class DepsbnczController extends JeecgController<Depsbncz, IDepsbnczService> {
@Autowired @Autowired
private IDepsbnczService depsbnczService; private IDepsbnczService depsbnczService;
@Autowired
private IDepadminlxService depadminlxService;
/** /**
* 分页列表查询 * 分页列表查询
* *
@ -69,12 +75,14 @@ public class DepsbnczController extends JeecgController<Depsbncz, IDepsbnczServi
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) { HttpServletRequest req) {
LoginUser user= (LoginUser) SecurityUtils.getSubject().getPrincipal();
QueryWrapper<Depsbncz> queryWrapper = QueryGenerator.initQueryWrapper(depsbncz, req.getParameterMap()); QueryWrapper<Depsbncz> queryWrapper = QueryGenerator.initQueryWrapper(depsbncz, req.getParameterMap());
queryWrapper.eq("userid",user.getId());
Page<Depsbncz> page = new Page<Depsbncz>(pageNo, pageSize); Page<Depsbncz> page = new Page<Depsbncz>(pageNo, pageSize);
IPage<Depsbncz> pageList = depsbnczService.page(page, queryWrapper); IPage<Depsbncz> pageList = depsbnczService.page(page, queryWrapper);
return Result.OK(pageList); return Result.OK(pageList);
} }
/** /**
* 添加 * 添加
* *
@ -86,10 +94,14 @@ public class DepsbnczController extends JeecgController<Depsbncz, IDepsbnczServi
@RequiresPermissions("depsbncz:depsbncz:add") @RequiresPermissions("depsbncz:depsbncz:add")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<String> add(@RequestBody Depsbncz depsbncz) { public Result<String> 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); depsbnczService.save(depsbncz);
return Result.OK("添加成功!"); return Result.OK("添加成功!");
} }
/** /**
* 编辑 * 编辑
* *
@ -104,7 +116,7 @@ public class DepsbnczController extends JeecgController<Depsbncz, IDepsbnczServi
depsbnczService.updateById(depsbncz); depsbnczService.updateById(depsbncz);
return Result.OK("编辑成功!"); return Result.OK("编辑成功!");
} }
/** /**
* 通过id删除 * 通过id删除
* *
@ -119,7 +131,7 @@ public class DepsbnczController extends JeecgController<Depsbncz, IDepsbnczServi
depsbnczService.removeById(id); depsbnczService.removeById(id);
return Result.OK("删除成功!"); return Result.OK("删除成功!");
} }
/** /**
* 批量删除 * 批量删除
* *
@ -134,7 +146,7 @@ public class DepsbnczController extends JeecgController<Depsbncz, IDepsbnczServi
this.depsbnczService.removeByIds(Arrays.asList(ids.split(","))); this.depsbnczService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!"); return Result.OK("批量删除成功!");
} }
/** /**
* 通过id查询 * 通过id查询
* *

@ -102,4 +102,9 @@ public class Depsbncz implements Serializable {
@Excel(name = "纳税总额", width = 15) @Excel(name = "纳税总额", width = 15)
@ApiModelProperty(value = "纳税总额") @ApiModelProperty(value = "纳税总额")
private String nsze; private String nsze;
/**用户id*/
@Excel(name = "用户id", width = 15)
@ApiModelProperty(value = "用户id")
private java.lang.String userid;
} }

Loading…
Cancel
Save