add 企业管理员-重置密码和停用启用
This commit is contained in:
@@ -109,3 +109,5 @@ INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `co
|
||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_route`, `is_leaf`, `keep_alive`, `hidden`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1554373328009789441', '1554351144621146113', '编辑', NULL, NULL, NULL, NULL, 2, 'companyadmin:edit', '1', 1.00, 0, NULL, 1, 1, 0, 0, NULL, 'LKGLZ', '2022-08-02 15:47:35', NULL, NULL, 0, 0, '1', 0);
|
||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_route`, `is_leaf`, `keep_alive`, `hidden`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1554373257453207554', '1554351144621146113', '新增', NULL, NULL, NULL, NULL, 2, 'companyadmin:add', '1', 1.00, 0, NULL, 1, 1, 0, 0, NULL, 'LKGLZ', '2022-08-02 15:47:18', NULL, NULL, 0, 0, '1', 0);
|
||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_route`, `is_leaf`, `keep_alive`, `hidden`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1554351144621146113', '1430376218661572609', '企业管理员', '/businessManagement/CompanyAdmin', 'businessManagement/CompanyAdmin', NULL, NULL, 1, NULL, '1', 3.00, 0, NULL, 1, 0, 0, 0, NULL, 'LKGLZ', '2022-08-02 14:19:26', NULL, NULL, 0, 0, '1', 0);
|
||||
ALTER TABLE `pay_manager_management`
|
||||
ADD COLUMN `status` tinyint(1) NULL DEFAULT NULL COMMENT '状态(1-正常,2-冻结)' ;
|
||||
+3
@@ -300,6 +300,9 @@ public class CompanyManagerLoginController {
|
||||
* 用户信息
|
||||
*/
|
||||
private void userInfo(PayManagerManagement managerManagement, Result<JSONObject> result) {
|
||||
if (Objects.equals(managerManagement.getStatus(),2)) {
|
||||
throw new JeroBootException("用户已停用");
|
||||
}
|
||||
String syspassword = managerManagement.getPassword();
|
||||
String phone = managerManagement.getPhone();
|
||||
managerManagement.setPhone(PasswordUtil.decrypt(phone));
|
||||
|
||||
+52
-1
@@ -8,8 +8,10 @@ import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
@@ -25,9 +27,11 @@ import com.jero.company.service.IPayManagerManagementService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -57,6 +61,7 @@ public class PayManagerManagementController extends JeroController<PayManagerMan
|
||||
/**
|
||||
* 分页列表查询
|
||||
*/
|
||||
@RequiresPermissions(value = "companyadmin:page")
|
||||
@ApiOperation(value="企业管理员管理-分页列表查询", notes="企业管理员管理-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(PayManagerManagement payManagerManagement,
|
||||
@@ -85,6 +90,7 @@ public class PayManagerManagementController extends JeroController<PayManagerMan
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
@RequiresPermissions(value = "companyadmin:add")
|
||||
@AutoLog(value = "企业管理员管理-添加")
|
||||
@ApiOperation(value="企业管理员管理-添加", notes="企业管理员管理-添加")
|
||||
@PostMapping(value = "/add")
|
||||
@@ -142,7 +148,7 @@ public class PayManagerManagementController extends JeroController<PayManagerMan
|
||||
}catch (Exception e){
|
||||
log.error("手机号加密异常!",e);
|
||||
}
|
||||
|
||||
payManagerManagement.setStatus(1);
|
||||
payManagerManagement.setRoleCode(PayContactsManagementCommon.ROLE_CODE3);
|
||||
payManagerManagement.setDelFlag(PayContactsManagementCommon.DEL_FLAG0);
|
||||
payManagerManagementService.save(payManagerManagement);
|
||||
@@ -152,6 +158,7 @@ public class PayManagerManagementController extends JeroController<PayManagerMan
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
@RequiresPermissions(value = "companyadmin:edit")
|
||||
@AutoLog(value = "企业管理员管理-编辑")
|
||||
@ApiOperation(value="企业管理员管理-编辑", notes="企业管理员管理-编辑")
|
||||
@PostMapping(value = "/edit")
|
||||
@@ -226,6 +233,7 @@ public class PayManagerManagementController extends JeroController<PayManagerMan
|
||||
/**
|
||||
* 通过id删除
|
||||
*/
|
||||
@RequiresPermissions(value = "companyadmin:delete")
|
||||
@AutoLog(value = "企业管理员管理-通过id删除")
|
||||
@ApiOperation(value="企业管理员管理-通过id删除", notes="企业管理员管理-通过id删除")
|
||||
@GetMapping(value = "/delete")
|
||||
@@ -241,6 +249,7 @@ public class PayManagerManagementController extends JeroController<PayManagerMan
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
@RequiresPermissions(value = "companyadmin:batchDelete")
|
||||
@AutoLog(value = "企业管理员管理-批量删除")
|
||||
@ApiOperation(value="企业管理员管理-批量删除", notes="企业管理员管理-批量删除")
|
||||
@GetMapping(value = "/deleteBatch")
|
||||
@@ -276,6 +285,48 @@ public class PayManagerManagementController extends JeroController<PayManagerMan
|
||||
return Result.OK(payManagerManagement);
|
||||
}
|
||||
|
||||
/**
|
||||
* 冻结&解冻用户
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
//@RequiresRoles({"admin"})
|
||||
@RequiresPermissions("companyadmin:use")
|
||||
@PostMapping(value = "/frozenBatch")
|
||||
public Result<SysUser> frozenBatch(@RequestBody JSONObject jsonObject) {
|
||||
try {
|
||||
String ids = jsonObject.getString("ids");
|
||||
String status = jsonObject.getString("status");
|
||||
String[] arr = ids.split(",");
|
||||
for (String id : arr) {
|
||||
if(oConvertUtils.isNotEmpty(id)) {
|
||||
payManagerManagementService.update(new PayManagerManagement().setStatus(Integer.parseInt(status)),
|
||||
new UpdateWrapper<PayManagerManagement>().lambda().eq(PayManagerManagement::getId,id));
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
Result.error("操作失败"+e.getMessage());
|
||||
}
|
||||
return Result.OK();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置密码
|
||||
*/
|
||||
@RequiresPermissions("companyadmin:resetPassword")
|
||||
@PostMapping(value = "/resetPassword")
|
||||
public Result<?> resetPassword(@RequestBody PayManagerManagement payManagerManagement) {
|
||||
String id = payManagerManagement.getId();
|
||||
LambdaUpdateWrapper<PayManagerManagement> wrapper = new LambdaUpdateWrapper<>();
|
||||
wrapper.eq(PayManagerManagement::getId,id);
|
||||
wrapper.set(PayManagerManagement::getSalt,null);
|
||||
wrapper.set(PayManagerManagement::getPassword,null);
|
||||
payManagerManagementService.update(wrapper);
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*/
|
||||
|
||||
+7
@@ -171,6 +171,13 @@ public class PayManagerManagement implements Serializable {
|
||||
@ApiModelProperty(value = "会员企业id")
|
||||
private String memberId;
|
||||
|
||||
/**
|
||||
* 状态(1:正常 2:冻结 )
|
||||
*/
|
||||
@Excel(name = "状态", width = 15,dicCode = "user_status")
|
||||
@Dict(dicCode = "user_status")
|
||||
private Integer status;
|
||||
|
||||
/**企业角色1:普通企业、2:会员企业*/
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "企业角色1:普通企业、2:会员企业")
|
||||
|
||||
Reference in New Issue
Block a user