Commit 33ab5cea by whl

Merge remote-tracking branch 'origin/future-page-ywd' into dev

# Conflicts:
#	bsoft-api/src/main/java/com/bsoft/api/mapper/DicDimMapper.java
#	bsoft-api/src/main/java/com/bsoft/api/mapper/DicIndMapper.java
#	bsoft-api/src/main/java/com/bsoft/api/mapper/DicOrgMapper.java
#	bsoft-api/src/main/java/com/bsoft/api/mapper/SerBlockMapper.java
#	bsoft-api/src/main/java/com/bsoft/api/mapper/SerPageBlockRsMapper.java
#	bsoft-api/src/main/java/com/bsoft/api/mapper/SerPageDimRsMapper.java
#	bsoft-api/src/main/java/com/bsoft/api/mapper/SerPageMapper.java
#	bsoft-api/src/main/java/com/bsoft/api/mapper/SysMenuMapper.java
#	bsoft-api/src/main/java/com/bsoft/api/mapper/SysOrgMapper.java
#	bsoft-api/src/main/java/com/bsoft/api/mapper/SysProjectMapper.java
#	bsoft-api/src/main/java/com/bsoft/api/mapper/SysRoleMapper.java
#	bsoft-api/src/main/java/com/bsoft/api/mapper/SysRoleMenuRsMapper.java
#	bsoft-api/src/main/java/com/bsoft/api/mapper/SysUserMapper.java
#	bsoft-api/src/main/java/com/bsoft/api/mapper/SysUserMenuRsMapper.java
#	bsoft-api/src/main/java/com/bsoft/api/mapper/SysUserOrgRsMapper.java
#	bsoft-api/src/main/java/com/bsoft/api/mapper/SysUserRoleRsMapper.java
#	bsoft-api/src/main/java/com/bsoft/api/model/SysUser.java
parents 5043c4bc 90b112f1
......@@ -37,7 +37,7 @@ public class DicDimController {
}
@GetMapping("info")
public Object info(Integer id){
public Object info(Long id){
dicDimService.find(id);
return new RequestResult(RequestResultType.SUCCESS.getValue(),RequestResultType.SUCCESS.getDesc(),null);
}
......@@ -55,7 +55,7 @@ public class DicDimController {
}
@PostMapping("delete")
public Object delete(Integer id){
public Object delete(Long id){
dicDimService.delete(id);
return new RequestResult(RequestResultType.SUCCESS.getValue(),RequestResultType.SUCCESS.getDesc(),null);
}
......
package com.bsoft.api.controller;
import com.bsoft.api.common.base.RequestResult;
import com.bsoft.api.common.enums.RequestResultType;
import com.bsoft.api.model.DicDim;
import com.bsoft.api.model.DicInd;
import com.bsoft.api.model.respmodel.ListPage;
import com.bsoft.api.service.DicIndService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Api(tags = {"指标库"})
@RequestMapping("ind")
@RestController
public class DicIndController {
@Autowired
private DicIndService dicIndService;
@GetMapping("list")
public Object list(){
List<DicInd> list = dicIndService.findAll();
return new RequestResult(RequestResultType.SUCCESS.getValue(),RequestResultType.SUCCESS.getDesc(),list);
}
@GetMapping("listpage")
public Object listpage(Integer pageSize, Integer pageIndex){
List<DicInd> list = dicIndService.findAll();
ListPage<DicDim> listPage = new ListPage(list, pageSize, pageIndex, 0);
return new RequestResult(RequestResultType.SUCCESS.getValue(),RequestResultType.SUCCESS.getDesc(),list);
}
@GetMapping("info")
public Object info(Long id){
dicIndService.find(id);
return new RequestResult(RequestResultType.SUCCESS.getValue(),RequestResultType.SUCCESS.getDesc(),null);
}
@PostMapping("add")
public Object add(DicInd dicInd){
dicIndService.add(dicInd);
return new RequestResult(RequestResultType.SUCCESS.getValue(),RequestResultType.SUCCESS.getDesc(),null);
}
@PostMapping("update")
public Object update(DicInd dicInd){
dicIndService.update(dicInd);
return new RequestResult(RequestResultType.SUCCESS.getValue(),RequestResultType.SUCCESS.getDesc(),null);
}
@PostMapping("delete")
public Object delete(Long id){
dicIndService.delete(id);
return new RequestResult(RequestResultType.SUCCESS.getValue(),RequestResultType.SUCCESS.getDesc(),null);
}
}
......@@ -37,7 +37,7 @@ public class DicOrgController {
}
@GetMapping("info")
public Object info(Integer id){
public Object info(Long id){
dicOrgService.find(id);
return new RequestResult(RequestResultType.SUCCESS.getValue(),RequestResultType.SUCCESS.getDesc(),null);
}
......@@ -55,7 +55,7 @@ public class DicOrgController {
}
@PostMapping("delete")
public Object delete(Integer id){
public Object delete(Long id){
dicOrgService.delete(id);
return new RequestResult(RequestResultType.SUCCESS.getValue(),RequestResultType.SUCCESS.getDesc(),null);
}
......
......@@ -37,7 +37,7 @@ public class SysMenuController {
}
@GetMapping("info")
public Object info(Integer id){
public Object info(Long id){
sysMenuService.find(id);
return new RequestResult(RequestResultType.SUCCESS.getValue(),RequestResultType.SUCCESS.getDesc(),null);
}
......@@ -55,7 +55,7 @@ public class SysMenuController {
}
@PostMapping("delete")
public Object delete(Integer id){
public Object delete(Long id){
sysMenuService.delete(id);
return new RequestResult(RequestResultType.SUCCESS.getValue(),RequestResultType.SUCCESS.getDesc(),null);
}
......
......@@ -37,7 +37,7 @@ public class SysRoleController {
}
@GetMapping("info")
public Object info(Integer id){
public Object info(Long id){
sysRoleService.find(id);
return new RequestResult(RequestResultType.SUCCESS.getValue(),RequestResultType.SUCCESS.getDesc(),null);
}
......@@ -55,7 +55,7 @@ public class SysRoleController {
}
@PostMapping("delete")
public Object delete(Integer id){
public Object delete(Long id){
sysRoleService.delete(id);
return new RequestResult(RequestResultType.SUCCESS.getValue(),RequestResultType.SUCCESS.getDesc(),null);
}
......
......@@ -38,7 +38,7 @@ public class SysRoleMenuRsController {
}
@GetMapping("info")
public Object info(Integer id){
public Object info(Long id){
sysRoleMenuRsService.find(id);
return new RequestResult(RequestResultType.SUCCESS.getValue(),RequestResultType.SUCCESS.getDesc(),null);
}
......@@ -56,7 +56,7 @@ public class SysRoleMenuRsController {
}
@PostMapping("delete")
public Object delete(Integer id){
public Object delete(Long id){
sysRoleMenuRsService.delete(id);
return new RequestResult(RequestResultType.SUCCESS.getValue(),RequestResultType.SUCCESS.getDesc(),null);
}
......
......@@ -38,7 +38,7 @@ public class SysUserMenuRsController {
}
@GetMapping("info")
public Object info(Integer id){
public Object info(Long id){
sysUserMenuRsService.find(id);
return new RequestResult(RequestResultType.SUCCESS.getValue(),RequestResultType.SUCCESS.getDesc(),null);
}
......@@ -56,7 +56,7 @@ public class SysUserMenuRsController {
}
@PostMapping("delete")
public Object delete(Integer id){
public Object delete(Long id){
sysUserMenuRsService.delete(id);
return new RequestResult(RequestResultType.SUCCESS.getValue(),RequestResultType.SUCCESS.getDesc(),null);
}
......
......@@ -37,7 +37,7 @@ public class SysUserOrgController {
}
@GetMapping("info")
public Object info(Integer id){
public Object info(Long id){
sysUserOrgRsService.find(id);
return new RequestResult(RequestResultType.SUCCESS.getValue(),RequestResultType.SUCCESS.getDesc(),null);
}
......@@ -55,7 +55,7 @@ public class SysUserOrgController {
}
@PostMapping("delete")
public Object delete(Integer id){
public Object delete(Long id){
sysUserOrgRsService.delete(id);
return new RequestResult(RequestResultType.SUCCESS.getValue(),RequestResultType.SUCCESS.getDesc(),null);
}
......
......@@ -37,7 +37,7 @@ public class SysUserRoleRsController {
}
@GetMapping("info")
public Object info(Integer id){
public Object info(Long id){
sysUserRoleRsService.find(id);
return new RequestResult(RequestResultType.SUCCESS.getValue(),RequestResultType.SUCCESS.getDesc(),null);
}
......@@ -55,7 +55,7 @@ public class SysUserRoleRsController {
}
@PostMapping("delete")
public Object delete(Integer id){
public Object delete(Long id){
sysUserRoleRsService.delete(id);
return new RequestResult(RequestResultType.SUCCESS.getValue(),RequestResultType.SUCCESS.getDesc(),null);
}
......
......@@ -2,10 +2,15 @@ package com.bsoft.api.controller;
import com.bsoft.api.common.Result;
import com.bsoft.api.common.annotations.CurrentUser;
import com.bsoft.api.common.annotations.Token;
import com.bsoft.api.model.SysUser;
import com.bsoft.api.service.SysMenuService;
import com.bsoft.api.service.SysUserRoleRsService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
......@@ -14,9 +19,37 @@ import springfox.documentation.annotations.ApiIgnore;
@RequestMapping("/user")
@RestController
public class UserController {
@Autowired
private SysUserRoleRsService sysUserRoleRsService;
@Autowired
private SysMenuService sysMenuService;
@GetMapping()
public Object user(@CurrentUser@ApiIgnore SysUser user){
return Result.success(user);
}
/**
* 根据用户id查询用户角色
* @param userId 用户id
* @return
*/
@GetMapping("getRole")
@Token
public Object getRoleListByUser(@ApiIgnore Long userId)throws Exception{
return Result.success(sysUserRoleRsService.getRoleListByUser(userId));
}
/**
* 根据用户id查询用户角色
* @param userId 用户id
* @return
*/
@GetMapping("getMenu")
// @Token
public Object getMenuByUser(Long userId)throws Exception{
return Result.success(sysMenuService.getMenu(userId));
}
}
......@@ -3,103 +3,498 @@ package com.bsoft.api.model;
import java.util.Date;
public class SysUser {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column LL.SYS_USER.ID
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
private Long id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column LL.SYS_USER.CREATE_DATE
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
private Date createDate;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column LL.SYS_USER.CREATE_USERID
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
private Long createUserid;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column LL.SYS_USER.STATE
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
private Short state;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column LL.SYS_USER.USER_CODE
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
private String userCode;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column LL.SYS_USER.USER_NAME
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
private String userName;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column LL.SYS_USER.PASSWORD
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
private String password;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column LL.SYS_USER.IDCARD
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
private String idcard;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column LL.SYS_USER.SEX
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
private String sex;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column LL.SYS_USER.MOBILE
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
private String mobile;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column LL.SYS_USER.PAGE_COUNT
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
private Long pageCount;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column LL.SYS_USER.ERROR_COUNT
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
private Long errorCount;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column LL.SYS_USER.ERROR_TIME
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
private Date errorTime;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column LL.SYS_USER.LAST_TIME
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
private Date lastTime;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column LL.SYS_USER.LAST_IP
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
private String lastIp;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column LL.SYS_USER.ID
*
* @return the value of LL.SYS_USER.ID
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
public Long getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column LL.SYS_USER.ID
*
* @param id the value for LL.SYS_USER.ID
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
public void setId(Long id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column LL.SYS_USER.CREATE_DATE
*
* @return the value of LL.SYS_USER.CREATE_DATE
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
public Date getCreateDate() {
return createDate;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column LL.SYS_USER.CREATE_DATE
*
* @param createDate the value for LL.SYS_USER.CREATE_DATE
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column LL.SYS_USER.CREATE_USERID
*
* @return the value of LL.SYS_USER.CREATE_USERID
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
public Long getCreateUserid() {
return createUserid;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column LL.SYS_USER.CREATE_USERID
*
* @param createUserid the value for LL.SYS_USER.CREATE_USERID
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
public void setCreateUserid(Long createUserid) {
this.createUserid = createUserid;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column LL.SYS_USER.STATE
*
* @return the value of LL.SYS_USER.STATE
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
public Short getState() {
return state;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column LL.SYS_USER.STATE
*
* @param state the value for LL.SYS_USER.STATE
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
public void setState(Short state) {
this.state = state;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column LL.SYS_USER.USER_CODE
*
* @return the value of LL.SYS_USER.USER_CODE
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
public String getUserCode() {
return userCode;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column LL.SYS_USER.USER_CODE
*
* @param userCode the value for LL.SYS_USER.USER_CODE
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
public void setUserCode(String userCode) {
this.userCode = userCode;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column LL.SYS_USER.USER_NAME
*
* @return the value of LL.SYS_USER.USER_NAME
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
public String getUserName() {
return userName;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column LL.SYS_USER.USER_NAME
*
* @param userName the value for LL.SYS_USER.USER_NAME
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
public void setUserName(String userName) {
this.userName = userName;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column LL.SYS_USER.PASSWORD
*
* @return the value of LL.SYS_USER.PASSWORD
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
public String getPassword() {
return password;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column LL.SYS_USER.PASSWORD
*
* @param password the value for LL.SYS_USER.PASSWORD
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
public void setPassword(String password) {
this.password = password;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column LL.SYS_USER.IDCARD
*
* @return the value of LL.SYS_USER.IDCARD
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
public String getIdcard() {
return idcard;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column LL.SYS_USER.IDCARD
*
* @param idcard the value for LL.SYS_USER.IDCARD
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
public void setIdcard(String idcard) {
this.idcard = idcard;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column LL.SYS_USER.SEX
*
* @return the value of LL.SYS_USER.SEX
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
public String getSex() {
return sex;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column LL.SYS_USER.SEX
*
* @param sex the value for LL.SYS_USER.SEX
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
public void setSex(String sex) {
this.sex = sex;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column LL.SYS_USER.MOBILE
*
* @return the value of LL.SYS_USER.MOBILE
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
public String getMobile() {
return mobile;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column LL.SYS_USER.MOBILE
*
* @param mobile the value for LL.SYS_USER.MOBILE
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
public void setMobile(String mobile) {
this.mobile = mobile;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column LL.SYS_USER.PAGE_COUNT
*
* @return the value of LL.SYS_USER.PAGE_COUNT
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
public Long getPageCount() {
return pageCount;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column LL.SYS_USER.PAGE_COUNT
*
* @param pageCount the value for LL.SYS_USER.PAGE_COUNT
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
public void setPageCount(Long pageCount) {
this.pageCount = pageCount;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column LL.SYS_USER.ERROR_COUNT
*
* @return the value of LL.SYS_USER.ERROR_COUNT
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
public Long getErrorCount() {
return errorCount;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column LL.SYS_USER.ERROR_COUNT
*
* @param errorCount the value for LL.SYS_USER.ERROR_COUNT
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
public void setErrorCount(Long errorCount) {
this.errorCount = errorCount;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column LL.SYS_USER.ERROR_TIME
*
* @return the value of LL.SYS_USER.ERROR_TIME
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
public Date getErrorTime() {
return errorTime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column LL.SYS_USER.ERROR_TIME
*
* @param errorTime the value for LL.SYS_USER.ERROR_TIME
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
public void setErrorTime(Date errorTime) {
this.errorTime = errorTime;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column LL.SYS_USER.LAST_TIME
*
* @return the value of LL.SYS_USER.LAST_TIME
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
public Date getLastTime() {
return lastTime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column LL.SYS_USER.LAST_TIME
*
* @param lastTime the value for LL.SYS_USER.LAST_TIME
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
public void setLastTime(Date lastTime) {
this.lastTime = lastTime;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column LL.SYS_USER.LAST_IP
*
* @return the value of LL.SYS_USER.LAST_IP
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
public String getLastIp() {
return lastIp;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column LL.SYS_USER.LAST_IP
*
* @param lastIp the value for LL.SYS_USER.LAST_IP
*
* @mbggenerated Tue Oct 22 14:44:12 CST 2019
*/
public void setLastIp(String lastIp) {
this.lastIp = lastIp;
}
}
\ No newline at end of file
package com.bsoft.api.model.respmodel;
import com.bsoft.api.model.SysMenu;
import java.util.List;
public class SysMenuList extends SysMenu {
private List<SysMenuList> sysMenuList;
public void setSysMenuList(List<SysMenuList> sysMenuList) {
this.sysMenuList = sysMenuList;
}
public List<SysMenuList> getSysMenuList() {
return this.sysMenuList;
}
}
package com.bsoft.api.service;
import com.bsoft.api.model.DicInd;
public interface DicIndService extends ServiceBase<DicInd>{
}
......@@ -3,7 +3,6 @@ package com.bsoft.api.service.Impl;
import com.bsoft.api.mapper.DicDimMapper;
import com.bsoft.api.model.DicDim;
import com.bsoft.api.service.DicDimService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
......@@ -12,6 +11,7 @@ import java.util.List;
@Service
public class DicDimServiceImpl implements DicDimService {
@Resource
private DicDimMapper dicDimMapper;
......@@ -26,17 +26,17 @@ public class DicDimServiceImpl implements DicDimService {
}
@Override
public DicDim find(int id) {
return dicDimMapper.selectByPrimaryKey(BigDecimal.valueOf(id));
public DicDim find(Long id) {
return dicDimMapper.selectByPrimaryKey(id);
}
@Override
public int delete(int id) {
return dicDimMapper.deleteByPrimaryKey(BigDecimal.valueOf(id));
public int delete(Long id) {
return dicDimMapper.deleteByPrimaryKey(id);
}
@Override
public int logicDelete(int id) {
public int logicDelete(Long id) {
return 0;
}
......
package com.bsoft.api.service.Impl;
import com.bsoft.api.mapper.DicIndMapper;
import com.bsoft.api.model.DicInd;
import com.bsoft.api.service.DicIndService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class DicIndServiceImpl implements DicIndService {
@Resource
private DicIndMapper dicIndMapper;
@Override
public int add(DicInd dicInd) {
return dicIndMapper.insert(dicInd);
}
@Override
public List<DicInd> findAll() {
return dicIndMapper.selectAll();
}
@Override
public DicInd find(Long id) {
return dicIndMapper.selectByPrimaryKey(id);
}
@Override
public int delete(Long id) {
return dicIndMapper.deleteByPrimaryKey(id);
}
@Override
public int logicDelete(Long id) {
return 0;
}
@Override
public int update(DicInd dicInd) {
return dicIndMapper.updateByPrimaryKey(dicInd);
}
}
......@@ -9,7 +9,7 @@ import java.math.BigDecimal;
import java.util.List;
@Service
public class dicOrgServiceImpl implements DicOrgService {
public class DicOrgServiceImpl implements DicOrgService {
@Resource
private DicOrgMapper dicOrgMapper;
......@@ -24,17 +24,17 @@ public class dicOrgServiceImpl implements DicOrgService {
}
@Override
public DicOrg find(int id) {
return dicOrgMapper.selectByPrimaryKey(BigDecimal.valueOf(id));
public DicOrg find(Long id) {
return dicOrgMapper.selectByPrimaryKey(id);
}
@Override
public int delete(int id) {
return dicOrgMapper.deleteByPrimaryKey(BigDecimal.valueOf(id));
public int delete(Long id) {
return dicOrgMapper.deleteByPrimaryKey(id);
}
@Override
public int logicDelete(int id) {
public int logicDelete(Long id) {
return 0;
}
......
......@@ -2,19 +2,45 @@ package com.bsoft.api.service.Impl;
import com.bsoft.api.mapper.SysMenuMapper;
import com.bsoft.api.model.SysMenu;
import com.bsoft.api.model.respmodel.SysMenuList;
import com.bsoft.api.service.SysMenuService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.awt.*;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@Service
public class SysMenuServiceImpl implements SysMenuService {
@Resource
private SysMenuMapper sysMenuMapper;
@Override
public List<SysMenuList> getMenu(Long userId) throws Exception {
SysMenuList sysMenuList = new SysMenuList();
SysMenu sysMenu = new SysMenu();
List<SysMenuList> list = sysMenuMapper.selectMenuByUser(userId);
List<SysMenuList> resultList = getLevelData(list, Long.valueOf(0));
return resultList;
}
private List<SysMenuList> getLevelData(List<SysMenuList> list, Long parentcode) {
List<SysMenuList> resultList = new ArrayList<>();
for (SysMenuList data : list) {
if (data.getParentId() == parentcode){
List<SysMenuList> childList = getLevelData(list,data.getId());
data.setSysMenuList(childList);
resultList.add(data);
}
}
return resultList;
}
@Override
public int add(SysMenu sysMenu) {
return sysMenuMapper.insert(sysMenu);
}
......@@ -25,17 +51,17 @@ public class SysMenuServiceImpl implements SysMenuService {
}
@Override
public SysMenu find(int id) {
return sysMenuMapper.selectByPrimaryKey(BigDecimal.valueOf(id));
public SysMenu find(Long id) {
return sysMenuMapper.selectByPrimaryKey(id);
}
@Override
public int delete(int id) {
return sysMenuMapper.deleteByPrimaryKey(BigDecimal.valueOf(id));
public int delete(Long id) {
return sysMenuMapper.deleteByPrimaryKey(id);
}
@Override
public int logicDelete(int id) {
public int logicDelete(Long id) {
return 0;
}
......
......@@ -25,17 +25,17 @@ public class SysRoleMenuRsServiceImpl implements SysRoleMenuRsService {
}
@Override
public SysRoleMenuRs find(int id) {
return sysRoleMenuRsMapper.selectByPrimaryKey(BigDecimal.valueOf(id));
public SysRoleMenuRs find(Long id) {
return sysRoleMenuRsMapper.selectByPrimaryKey(id);
}
@Override
public int delete(int id) {
return sysRoleMenuRsMapper.deleteByPrimaryKey(BigDecimal.valueOf(id));
public int delete(Long id) {
return sysRoleMenuRsMapper.deleteByPrimaryKey(id);
}
@Override
public int logicDelete(int id) {
public int logicDelete(Long id) {
return 0;
}
......
package com.bsoft.api.service.Impl;
import com.bsoft.api.mapper.SysRoleMapper;
import com.bsoft.api.model.DicOrg;
import com.bsoft.api.model.SysRole;
import com.bsoft.api.service.SysRoleService;
import org.springframework.stereotype.Service;
......@@ -26,17 +25,17 @@ public class SysRoleServiceImpl implements SysRoleService {
}
@Override
public SysRole find(int id) {
return sysRoleMapper.selectByPrimaryKey(BigDecimal.valueOf(id));
public SysRole find(Long id) {
return sysRoleMapper.selectByPrimaryKey(id);
}
@Override
public int delete(int id) {
return sysRoleMapper.deleteByPrimaryKey(BigDecimal.valueOf(id));
public int delete(Long id) {
return sysRoleMapper.deleteByPrimaryKey(id);
}
@Override
public int logicDelete(int id) {
public int logicDelete(Long id) {
return 0;
}
......
......@@ -25,17 +25,17 @@ public class SysUserMenuRsServiceImpl implements SysUserMenuRsService {
}
@Override
public SysUserMenuRs find(int id) {
return sysUserMenuRsMapper.selectByPrimaryKey(BigDecimal.valueOf(id));
public SysUserMenuRs find(Long id) {
return sysUserMenuRsMapper.selectByPrimaryKey(id);
}
@Override
public int delete(int id) {
return sysUserMenuRsMapper.deleteByPrimaryKey(BigDecimal.valueOf(id));
public int delete(Long id) {
return sysUserMenuRsMapper.deleteByPrimaryKey(id);
}
@Override
public int logicDelete(int id) {
public int logicDelete(Long id) {
return 0;
}
......
......@@ -25,17 +25,17 @@ public class SysUserOrgRsServiceImpl implements SysUserOrgRsService {
}
@Override
public SysUserOrgRs find(int id) {
return sysUserOrgRsMapper.selectByPrimaryKey(BigDecimal.valueOf(id));
public SysUserOrgRs find(Long id) {
return sysUserOrgRsMapper.selectByPrimaryKey(id);
}
@Override
public int delete(int id) {
return sysUserOrgRsMapper.deleteByPrimaryKey(BigDecimal.valueOf(id));
public int delete(Long id) {
return sysUserOrgRsMapper.deleteByPrimaryKey(id);
}
@Override
public int logicDelete(int id) {
public int logicDelete(Long id) {
return 0;
}
......
package com.bsoft.api.service.Impl;
import com.bsoft.api.mapper.SysUserRoleRsMapper;
import com.bsoft.api.model.SysMenu;
import com.bsoft.api.model.SysRole;
import com.bsoft.api.model.SysUserRoleRs;
import com.bsoft.api.service.SysUserRoleRsService;
import org.springframework.stereotype.Service;
......@@ -12,9 +12,16 @@ import java.util.List;
@Service
public class SysUserRoleServiceImpl implements SysUserRoleRsService {
@Resource
private SysUserRoleRsMapper sysUserRoleRsMapper;
@Override
public List<SysRole> getRoleListByUser(Long userId) throws Exception {
return sysUserRoleRsMapper.selectRoleByUser(userId);
}
@Override
public int add(SysUserRoleRs sysUserRoleRs) {
return sysUserRoleRsMapper.insert(sysUserRoleRs);
......@@ -26,17 +33,17 @@ public class SysUserRoleServiceImpl implements SysUserRoleRsService {
}
@Override
public SysUserRoleRs find(int id) {
return sysUserRoleRsMapper.selectByPrimaryKey(BigDecimal.valueOf(id));
public SysUserRoleRs find(Long id) {
return sysUserRoleRsMapper.selectByPrimaryKey(id);
}
@Override
public int delete(int id) {
return sysUserRoleRsMapper.deleteByPrimaryKey(BigDecimal.valueOf(id));
public int delete(Long id) {
return sysUserRoleRsMapper.deleteByPrimaryKey(id);
}
@Override
public int logicDelete(int id) {
public int logicDelete(Long id) {
return 0;
}
......
......@@ -21,21 +21,21 @@ public interface ServiceBase<T> {
* @param id
* @return
*/
T find(int id);
T find(Long id);
/**
* 物理删除
* @param id
* @return
*/
int delete(int id);
int delete(Long id);
/**
* 逻辑删除
* @param id
* @return
*/
int logicDelete(int id);
int logicDelete(Long id);
/**
* 更新
......
package com.bsoft.api.service;
import com.bsoft.api.model.SysMenu;
import com.bsoft.api.model.respmodel.SysMenuList;
import java.util.List;
public interface SysMenuService extends ServiceBase<SysMenu> {
List<SysMenuList> getMenu(Long userId) throws Exception;
}
package com.bsoft.api.service;
import com.bsoft.api.model.SysRole;
import com.bsoft.api.model.SysUserRoleRs;
import java.util.List;
public interface SysUserRoleRsService extends ServiceBase<SysUserRoleRs> {
List<SysRole> getRoleListByUser(Long userId) throws Exception;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment