部门-调整
This commit is contained in:
parent
4050c2b176
commit
f0b44ad060
|
|
@ -106,6 +106,61 @@ public class DepartmentController extends ControllerBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启用
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("enable")
|
||||||
|
@MethodInfoMark(value = "启用",menuName = "部门管理")
|
||||||
|
@ApiMark(moduleName = "部门管理", apiName = "启用")
|
||||||
|
public ApiResult<Boolean> enable(@RequestBody List<Integer> ids ){
|
||||||
|
VUtils.trueThrowBusinessError(CollUtil.isEmpty(ids)).throwMessage("请选择要启用的数据");
|
||||||
|
List<TBaseDepartment> tBaseDepartments = departmentService.getBaseMapper().selectByIds(ids);
|
||||||
|
tBaseDepartments.forEach(u->{
|
||||||
|
u.setDeptStatus(1);
|
||||||
|
u.setDataModifyUserNo(AdminUserUtil.getUserNo());
|
||||||
|
u.setDataModifyUserName(AdminUserUtil.getUserName());
|
||||||
|
u.setDataModifyTime(LocalDateTime.now());
|
||||||
|
});
|
||||||
|
if(CollUtil.isNotEmpty(tBaseDepartments)){
|
||||||
|
departmentService.updateBatchById(tBaseDepartments);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ApiResult.success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 禁用
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("disable")
|
||||||
|
@MethodInfoMark(value = "禁用",menuName = "部门管理")
|
||||||
|
@ApiMark(moduleName = "部门管理", apiName = "禁用")
|
||||||
|
public ApiResult<Boolean> disable(@RequestBody List<Integer> ids ){
|
||||||
|
VUtils.trueThrowBusinessError(CollUtil.isEmpty(ids)).throwMessage("请选择要启用的数据");
|
||||||
|
List<TBaseDepartment> tBaseDepartments = departmentService.getBaseMapper().selectByIds(ids);
|
||||||
|
tBaseDepartments.forEach(u->{
|
||||||
|
u.setDeptStatus(0);
|
||||||
|
u.setDataModifyUserNo(AdminUserUtil.getUserNo());
|
||||||
|
u.setDataModifyUserName(AdminUserUtil.getUserName());
|
||||||
|
u.setDataModifyTime(LocalDateTime.now());
|
||||||
|
});
|
||||||
|
if(CollUtil.isNotEmpty(tBaseDepartments)){
|
||||||
|
departmentService.updateBatchById(tBaseDepartments);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ApiResult.success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,6 @@ public class DepartmentQuery extends PageBaseQuery {
|
||||||
//编码OR 名称
|
//编码OR 名称
|
||||||
private String deptCodeOrName;
|
private String deptCodeOrName;
|
||||||
|
|
||||||
//是否有效 0-否 1-是
|
// 状态 0-禁用 1-启用
|
||||||
private Integer dataValidStatus;
|
private Integer deptStatus;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,10 +46,15 @@ public class TBaseDepartment implements Serializable {
|
||||||
*/
|
*/
|
||||||
private Integer deptParentId;
|
private Integer deptParentId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态 0-禁用 1-启用
|
||||||
|
*/
|
||||||
|
private Integer deptStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 有效状态 0否1是
|
* 有效状态 0否1是
|
||||||
*/
|
*/
|
||||||
private Byte dataValidStatus;
|
private Integer dataValidStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建人编号
|
* 创建人编号
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@
|
||||||
<if test="query.deptCodeOrName!=null and query.deptCodeOrName!=''">
|
<if test="query.deptCodeOrName!=null and query.deptCodeOrName!=''">
|
||||||
and (dept_code=#{query.deptCodeOrName} or dept_name=#{query.deptCodeOrName})
|
and (dept_code=#{query.deptCodeOrName} or dept_name=#{query.deptCodeOrName})
|
||||||
</if>
|
</if>
|
||||||
<if test="query.dataValidStatus!=null">
|
<if test="query.deptStatus!=null">
|
||||||
and data_valid_status=#{query.dataValidStatus}
|
and dept_status=#{query.deptStatus}
|
||||||
</if>
|
</if>
|
||||||
</sql>
|
</sql>
|
||||||
<select id="selectListByPage" resultType="com.nflg.mobilebroken.repository.entity.TBaseDepartment">
|
<select id="selectListByPage" resultType="com.nflg.mobilebroken.repository.entity.TBaseDepartment">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue