项目启动问题处理
This commit is contained in:
parent
445bdc63af
commit
cc950fb2b3
|
|
@ -13,6 +13,8 @@ import com.bonus.sgzb.common.core.constant.SecurityConstants;
|
||||||
import com.bonus.sgzb.common.core.constant.ServiceNameConstants;
|
import com.bonus.sgzb.common.core.constant.ServiceNameConstants;
|
||||||
import com.bonus.sgzb.common.core.domain.R;
|
import com.bonus.sgzb.common.core.domain.R;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户服务
|
* 用户服务
|
||||||
*
|
*
|
||||||
|
|
@ -40,4 +42,14 @@ public interface RemoteUserService
|
||||||
*/
|
*/
|
||||||
@PostMapping("/user/register")
|
@PostMapping("/user/register")
|
||||||
public R<Boolean> registerUserInfo(@RequestBody SysUser sysUser, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
public R<Boolean> registerUserInfo(@RequestBody SysUser sysUser, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户列表内部请求
|
||||||
|
*
|
||||||
|
* @param sysUser 用户信息
|
||||||
|
* @param source 请求来源
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@GetMapping("/user/getUserList")
|
||||||
|
public R<List<SysUser>> getUserList(@RequestBody SysUser sysUser, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@ import com.bonus.sgzb.system.api.RemoteUserService;
|
||||||
import com.bonus.sgzb.system.api.domain.SysUser;
|
import com.bonus.sgzb.system.api.domain.SysUser;
|
||||||
import com.bonus.sgzb.system.api.model.LoginUser;
|
import com.bonus.sgzb.system.api.model.LoginUser;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户服务降级处理
|
* 用户服务降级处理
|
||||||
*
|
*
|
||||||
|
|
@ -36,6 +38,12 @@ public class RemoteUserFallbackFactory implements FallbackFactory<RemoteUserServ
|
||||||
{
|
{
|
||||||
return R.fail("注册用户失败:" + throwable.getMessage());
|
return R.fail("注册用户失败:" + throwable.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<List<SysUser>> getUserList(SysUser sysUser, String source)
|
||||||
|
{
|
||||||
|
return R.fail("获取用户失败:" + throwable.getMessage());
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -87,12 +87,6 @@
|
||||||
<groupId>com.bonus.sgzb</groupId>
|
<groupId>com.bonus.sgzb</groupId>
|
||||||
<artifactId>sgzb-common-swagger</artifactId>
|
<artifactId>sgzb-common-swagger</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.bonus.sgzb</groupId>
|
|
||||||
<artifactId>sgzb-modules-system</artifactId>
|
|
||||||
<version>3.6.3</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
||||||
|
|
@ -5,15 +5,17 @@ package com.bonus.sgzb.base.controller;
|
||||||
import com.bonus.sgzb.base.domain.BmUnitPerson;
|
import com.bonus.sgzb.base.domain.BmUnitPerson;
|
||||||
import com.bonus.sgzb.base.service.BmUnitPersonService;
|
import com.bonus.sgzb.base.service.BmUnitPersonService;
|
||||||
import com.bonus.sgzb.base.service.DeptService;
|
import com.bonus.sgzb.base.service.DeptService;
|
||||||
|
import com.bonus.sgzb.common.core.constant.SecurityConstants;
|
||||||
|
import com.bonus.sgzb.common.core.domain.R;
|
||||||
import com.bonus.sgzb.common.core.utils.StringUtils;
|
import com.bonus.sgzb.common.core.utils.StringUtils;
|
||||||
import com.bonus.sgzb.common.core.web.controller.BaseController;
|
import com.bonus.sgzb.common.core.web.controller.BaseController;
|
||||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
|
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
|
||||||
import com.bonus.sgzb.common.log.annotation.Log;
|
import com.bonus.sgzb.common.log.annotation.Log;
|
||||||
import com.bonus.sgzb.common.log.enums.BusinessType;
|
import com.bonus.sgzb.common.log.enums.BusinessType;
|
||||||
|
import com.bonus.sgzb.system.api.RemoteUserService;
|
||||||
import com.bonus.sgzb.system.api.domain.SysDept;
|
import com.bonus.sgzb.system.api.domain.SysDept;
|
||||||
import com.bonus.sgzb.system.api.domain.SysUser;
|
import com.bonus.sgzb.system.api.domain.SysUser;
|
||||||
import com.bonus.sgzb.system.service.ISysUserService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
@ -35,8 +37,8 @@ public class BmUnitPersonController extends BaseController{
|
||||||
@Autowired
|
@Autowired
|
||||||
private DeptService deptService;
|
private DeptService deptService;
|
||||||
|
|
||||||
@Autowired(required = false)
|
@Autowired
|
||||||
private ISysUserService iSysUserService;
|
private RemoteUserService remoteUserService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -112,16 +114,15 @@ public class BmUnitPersonController extends BaseController{
|
||||||
* 根据部门获取人员信息
|
* 根据部门获取人员信息
|
||||||
*/
|
*/
|
||||||
@PostMapping("/getUserList")
|
@PostMapping("/getUserList")
|
||||||
public AjaxResult getUserList(@Validated @RequestBody SysDept sysDept)
|
public R<List<SysUser>> getUserList(@Validated @RequestBody SysDept sysDept)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (sysDept.getDeptId()==null) {
|
if (sysDept.getDeptId()==null) {
|
||||||
return error("部门id为空!");
|
return R.fail("部门id为空!");
|
||||||
}
|
}
|
||||||
SysUser sysUser = new SysUser();
|
SysUser sysUser = new SysUser();
|
||||||
sysUser.setDeptId(sysDept.getDeptId());
|
sysUser.setDeptId(sysDept.getDeptId());
|
||||||
List<SysUser> list = iSysUserService.selectUserList(sysUser);
|
return remoteUserService.getUserList(sysUser, SecurityConstants.INNER);
|
||||||
return success(list);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
from bm_project_info
|
from bm_project_info
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="getProjectInfoAll" resultType="com.bonus.sgzb.base.domain.BmProjectInfo">
|
<select id="getProjectInfoAll" parameterType="com.bonus.sgzb.base.domain.BmProjectInfo" resultMap="BmProjectInfoResult">
|
||||||
<!--<include refid="bmProjectInfo"/>-->
|
<!--<include refid="bmProjectInfo"/>-->
|
||||||
select pro_id, pro_name, status, type_id, link_man, telphone, dept_id, del_flag, create_by, create_time,
|
select pro_id, pro_name, status, type_id, link_man, telphone, dept_id, del_flag, create_by, create_time,
|
||||||
update_by, update_time, remark, company_id
|
update_by, update_time, remark, company_id
|
||||||
|
|
|
||||||
|
|
@ -28,14 +28,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
|
||||||
<select id="getUnitInfoAll" resultMap="BmUnitInfoResult">
|
<select id="getUnitInfoAll" resultMap="sysDeptResult">
|
||||||
<!-- <include refid="bmUnitInfo"/>-->
|
<!-- <include refid="bmUnitInfo"/>-->
|
||||||
select dept_id, parent_id, ancestors, dept_name, order_num, leader, phone, email, status, del_flag,
|
select dept_id, parent_id, ancestors, dept_name, order_num, leader, phone, email, status, del_flag,
|
||||||
create_by, create_time, update_by, update_time
|
create_by, create_time, update_by, update_time
|
||||||
from sys_dept
|
from sys_dept
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getDeptList" parameterType="com.bonus.sgzb.base.domain.BmUnitInfo" resultMap="BmUnitInfoResult">
|
<select id="getDeptList" parameterType="com.bonus.sgzb.base.domain.BmUnitInfo" resultMap="sysDeptResult">
|
||||||
select dept_id, parent_id, ancestors, dept_name, order_num, leader, phone, email, status, del_flag,
|
select dept_id, parent_id, ancestors, dept_name, order_num, leader, phone, email, status, del_flag,
|
||||||
create_by, create_time, update_by, update_time
|
create_by, create_time, update_by, update_time
|
||||||
from sys_dept
|
from sys_dept
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,10 @@
|
||||||
<groupId>com.bonus.sgzb</groupId>
|
<groupId>com.bonus.sgzb</groupId>
|
||||||
<artifactId>sgzb-common-core</artifactId>
|
<artifactId>sgzb-common-core</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ public class MaPropInfoServiceImpl implements IMaPropInfoService {
|
||||||
public boolean checkPropNameUnique(MaPropInfo maPropInfo) {
|
public boolean checkPropNameUnique(MaPropInfo maPropInfo) {
|
||||||
Long propId = StringUtils.isNull(maPropInfo.getPropId()) ? -1L : maPropInfo.getPropId();
|
Long propId = StringUtils.isNull(maPropInfo.getPropId()) ? -1L : maPropInfo.getPropId();
|
||||||
MaPropInfo info = maPropInfoMapper.checkPropNameUnique(maPropInfo.getPropName());
|
MaPropInfo info = maPropInfoMapper.checkPropNameUnique(maPropInfo.getPropName());
|
||||||
if (StringUtils.isNotNull(info) && info.getPropId().longValue() != propId.longValue())
|
if (StringUtils.isNotNull(info) && info.getPropId() != propId)
|
||||||
{
|
{
|
||||||
return UserConstants.NOT_UNIQUE;
|
return UserConstants.NOT_UNIQUE;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,17 @@ public class SysUserController extends BaseController
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户列表内部请求
|
||||||
|
*/
|
||||||
|
@InnerAuth
|
||||||
|
@GetMapping("/getUserList")
|
||||||
|
public R<List<SysUser>> getUserList(SysUser user)
|
||||||
|
{
|
||||||
|
List<SysUser> list = userService.selectUserList(user);
|
||||||
|
return R.ok(list);
|
||||||
|
}
|
||||||
|
|
||||||
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
||||||
@RequiresPermissions("system:user:export")
|
@RequiresPermissions("system:user:export")
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue