回退 'Pull Request !8 : 处理iss 优化建议'

This commit is contained in:
Ants 2022-09-23 07:00:25 +00:00 committed by Gitee
parent 42c7936f40
commit 808cda3277
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 0 additions and 29 deletions

View File

@ -125,12 +125,6 @@ const { optionsData } = useDictOptions<{
} }
}) })
watch(optionsData, (arr) => {
if (arr.dept) {
formData.pid = arr.dept[0].id
}
})
const handleSubmit = async () => { const handleSubmit = async () => {
await formRef.value?.validate() await formRef.value?.validate()
mode.value == 'edit' ? await deptEdit(formData) : await deptAdd(formData) mode.value == 'edit' ? await deptEdit(formData) : await deptAdd(formData)

View File

@ -14,7 +14,6 @@ import com.mdd.common.utils.ArrayUtil;
import com.mdd.common.utils.TimeUtil; import com.mdd.common.utils.TimeUtil;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.*; import java.util.*;
@ -160,7 +159,6 @@ class SystemAuthDeptServiceImpl implements ISystemAuthDeptService {
* @author fzr * @author fzr
* @param systemAuthDeptParam 参数 * @param systemAuthDeptParam 参数
*/ */
@Transactional(rollbackFor = Exception.class)
@Override @Override
public void edit(SystemAuthDeptParam systemAuthDeptParam) { public void edit(SystemAuthDeptParam systemAuthDeptParam) {
SystemAuthDept model = systemAuthDeptMapper.selectOne( SystemAuthDept model = systemAuthDeptMapper.selectOne(
@ -184,8 +182,6 @@ class SystemAuthDeptServiceImpl implements ISystemAuthDeptService {
model.setIsStop(systemAuthDeptParam.getIsStop()); model.setIsStop(systemAuthDeptParam.getIsStop());
model.setUpdateTime(System.currentTimeMillis() / 1000); model.setUpdateTime(System.currentTimeMillis() / 1000);
systemAuthDeptMapper.updateById(model); systemAuthDeptMapper.updateById(model);
//级联更新自己状态
systemAuthDeptMapper.updateChilder(systemAuthDeptParam.getIsStop(),model.getId());
} }
/** /**

View File

@ -3,29 +3,10 @@ package com.mdd.common.mapper.system;
import com.mdd.common.core.basics.IBaseMapper; import com.mdd.common.core.basics.IBaseMapper;
import com.mdd.common.entity.system.SystemAuthDept; import com.mdd.common.entity.system.SystemAuthDept;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
/** /**
* 系统岗位Mapper * 系统岗位Mapper
*/ */
@Mapper @Mapper
public interface SystemAuthDeptMapper extends IBaseMapper<SystemAuthDept> { public interface SystemAuthDeptMapper extends IBaseMapper<SystemAuthDept> {
/**
* 级联更新部门状态
* @param stopStatus
* @param id
* @return
*/
@Update(value = "WITH recursive temp AS (SELECT id, pid\n"
+ " FROM la_system_auth_dept\n"
+ " WHERE id = #{id}\n" + " UNION ALL\n"
+ " SELECT u.id, u.pid\n"
+ " FROM la_system_auth_dept u,\n"
+ " temp t\n"
+ " WHERE u.pid = t.id and u.is_stop <> #{stopStatus})\n"
+ "update la_system_auth_dept set is_stop = #{stopStatus}\n"
+ "where id in (select id from temp)")
void updateChilder(@Param("stopStatus") int stopStatus, @Param("id") Integer id);
} }