提交修改
This commit is contained in:
parent
67049f5df3
commit
e66d1cf50a
@ -13,10 +13,12 @@ import com.lz.modules.app.entity.DepartmentsEntity;
|
|||||||
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
|
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
|
||||||
import com.lz.modules.app.entity.StaffEntity;
|
import com.lz.modules.app.entity.StaffEntity;
|
||||||
import com.lz.modules.app.enums.ResultRecordStatusEnum;
|
import com.lz.modules.app.enums.ResultRecordStatusEnum;
|
||||||
|
import com.lz.modules.app.enums.RoleEnums;
|
||||||
import com.lz.modules.app.resp.Step;
|
import com.lz.modules.app.resp.Step;
|
||||||
import com.lz.modules.app.service.DepartmentsService;
|
import com.lz.modules.app.service.DepartmentsService;
|
||||||
import com.lz.modules.app.service.DepartmentsStaffRelateService;
|
import com.lz.modules.app.service.DepartmentsStaffRelateService;
|
||||||
import com.lz.modules.app.service.StaffService;
|
import com.lz.modules.app.service.StaffService;
|
||||||
|
import com.lz.modules.flow.dao.StaffRoleMapper;
|
||||||
import com.lz.modules.flow.entity.RecordAuth;
|
import com.lz.modules.flow.entity.RecordAuth;
|
||||||
import com.lz.modules.flow.entity.StaffRole;
|
import com.lz.modules.flow.entity.StaffRole;
|
||||||
import com.lz.modules.flow.model.FlowModel;
|
import com.lz.modules.flow.model.FlowModel;
|
||||||
@ -39,10 +41,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@ -274,6 +273,18 @@ public class TestController {
|
|||||||
return R.ok().put("data",map);
|
return R.ok().put("data",map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StaffRoleMapper staffRoleMapper;
|
||||||
|
|
||||||
|
// http://localhost:8080/lz_management/test/testmaster
|
||||||
|
@RequestMapping("/test/testmaster")
|
||||||
|
public R testmaster(Long userId) throws Exception{
|
||||||
|
List<StaffRole> masterPMs = staffRoleMapper.selectStaffRolesByDepartmentLevelList(Arrays.asList(new String[]{RoleEnums.MASTER_PM.getName()}));
|
||||||
|
|
||||||
|
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
String a = "{\"313\":[17,20,13]}";
|
String a = "{\"313\":[17,20,13]}";
|
||||||
|
|||||||
@ -68,4 +68,6 @@ public interface StaffRoleMapper extends BaseMapper<StaffRole> {
|
|||||||
|
|
||||||
|
|
||||||
List<StaffMenu> selectMenusByParentId(@Param("parentId") long parentId);
|
List<StaffMenu> selectMenusByParentId(@Param("parentId") long parentId);
|
||||||
|
|
||||||
|
List<StaffRole> selectStaffRolesByDepartmentLevelList(@Param("departmentLevels") List<String> departmentLevels);
|
||||||
}
|
}
|
||||||
@ -425,8 +425,8 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
|
|||||||
com.lz.modules.app.utils.BeanUtils.copyProperty(staffRole, roleModel);
|
com.lz.modules.app.utils.BeanUtils.copyProperty(staffRole, roleModel);
|
||||||
staffRole.setStaffName(staffEntity.getName());
|
staffRole.setStaffName(staffEntity.getName());
|
||||||
|
|
||||||
StaffRole masterPM = staffRoleMapper.selectStaffRolesByStaffIdDepartmentLevelList(roleModel.getStaffId(), Arrays.asList(new String[]{RoleEnums.MASTER_PM.getName()}));
|
List<StaffRole> masterPMs = staffRoleMapper.selectStaffRolesByDepartmentLevelList(Arrays.asList(new String[]{RoleEnums.MASTER_PM.getName()}));
|
||||||
if(masterPM !=null){
|
if(CollectionUtils.isNotEmpty(masterPMs)){
|
||||||
return R.error("主管理员只能设置一个,如果想添加,只能更改管理员。");
|
return R.error("主管理员只能设置一个,如果想添加,只能更改管理员。");
|
||||||
}
|
}
|
||||||
staffRoleMapper.insertStaffRole(staffRole);
|
staffRoleMapper.insertStaffRole(staffRole);
|
||||||
|
|||||||
@ -197,5 +197,13 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectStaffRolesByDepartmentLevelList" resultType="com.lz.modules.flow.entity.StaffRole">
|
||||||
|
select * from lz_staff_role where is_delete = 0 and department_level in
|
||||||
|
<foreach collection="departmentLevels" item="item" index="index" separator="," open="(" close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user