部门资质

master
王家东 3 weeks ago
parent ea38962963
commit 845e93eeed
  1. 9
      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. 13
      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. 12
      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 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;
@ -69,7 +72,9 @@ public class DepadminlxController extends JeecgController<Depadminlx, IDepadminl
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
LoginUser user= (LoginUser) SecurityUtils.getSubject().getPrincipal();
QueryWrapper<Depadminlx> queryWrapper = QueryGenerator.initQueryWrapper(depadminlx, req.getParameterMap());
queryWrapper.eq("userid",user.getId());
Page<Depadminlx> page = new Page<Depadminlx>(pageNo, pageSize);
IPage<Depadminlx> pageList = depadminlxService.page(page, queryWrapper);
return Result.OK(pageList);
@ -86,6 +91,10 @@ public class DepadminlxController extends JeecgController<Depadminlx, IDepadminl
@RequiresPermissions("depadminlx:depadminlx:add")
@PostMapping(value = "/add")
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);
return Result.OK("添加成功!");
}

@ -98,4 +98,9 @@ public class Depadminlx implements Serializable {
@Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
@ApiModelProperty(value = "部门")
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 org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.demo.depadminlx.entity.Depadminlx;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@ -14,4 +15,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
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> {
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.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<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 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;
@ -53,6 +57,9 @@ public class DepfileController extends JeecgController<Depfile, IDepfileService>
@Autowired
private IDepfileService depfileService;
@Autowired
private IDepadminlxService depadminlxService;
/**
* 分页列表查询
*
@ -69,7 +76,9 @@ public class DepfileController extends JeecgController<Depfile, IDepfileService>
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
LoginUser user= (LoginUser) SecurityUtils.getSubject().getPrincipal();
QueryWrapper<Depfile> queryWrapper = QueryGenerator.initQueryWrapper(depfile, req.getParameterMap());
queryWrapper.eq("userid",user.getId());
Page<Depfile> page = new Page<Depfile>(pageNo, pageSize);
IPage<Depfile> pageList = depfileService.page(page, queryWrapper);
return Result.OK(pageList);
@ -86,6 +95,10 @@ public class DepfileController extends JeecgController<Depfile, IDepfileService>
@RequiresPermissions("depfile:depfile:add")
@PostMapping(value = "/add")
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);
return Result.OK("添加成功!");
}

@ -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;
}

@ -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,6 +56,8 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
public class DepsbnczController extends JeecgController<Depsbncz, IDepsbnczService> {
@Autowired
private IDepsbnczService depsbnczService;
@Autowired
private IDepadminlxService depadminlxService;
/**
* 分页列表查询
@ -69,7 +75,9 @@ public class DepsbnczController extends JeecgController<Depsbncz, IDepsbnczServi
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
LoginUser user= (LoginUser) SecurityUtils.getSubject().getPrincipal();
QueryWrapper<Depsbncz> queryWrapper = QueryGenerator.initQueryWrapper(depsbncz, req.getParameterMap());
queryWrapper.eq("userid",user.getId());
Page<Depsbncz> page = new Page<Depsbncz>(pageNo, pageSize);
IPage<Depsbncz> pageList = depsbnczService.page(page, queryWrapper);
return Result.OK(pageList);
@ -86,6 +94,10 @@ public class DepsbnczController extends JeecgController<Depsbncz, IDepsbnczServi
@RequiresPermissions("depsbncz:depsbncz:add")
@PostMapping(value = "/add")
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);
return Result.OK("添加成功!");
}

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

Loading…
Cancel
Save