|
|
|
@ -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<Depsbncz, IDepsbnczService> { |
|
|
|
|
@Autowired |
|
|
|
|
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="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,10 +94,14 @@ 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("添加成功!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 编辑 |
|
|
|
|
* |
|
|
|
@ -104,7 +116,7 @@ public class DepsbnczController extends JeecgController<Depsbncz, IDepsbnczServi |
|
|
|
|
depsbnczService.updateById(depsbncz); |
|
|
|
|
return Result.OK("编辑成功!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 通过id删除 |
|
|
|
|
* |
|
|
|
@ -119,7 +131,7 @@ public class DepsbnczController extends JeecgController<Depsbncz, IDepsbnczServi |
|
|
|
|
depsbnczService.removeById(id); |
|
|
|
|
return Result.OK("删除成功!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 批量删除 |
|
|
|
|
* |
|
|
|
@ -134,7 +146,7 @@ public class DepsbnczController extends JeecgController<Depsbncz, IDepsbnczServi |
|
|
|
|
this.depsbnczService.removeByIds(Arrays.asList(ids.split(","))); |
|
|
|
|
return Result.OK("批量删除成功!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 通过id查询 |
|
|
|
|
* |
|
|
|
|