| | |
| | | package com.highdatas.mdm.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.security.CodeSigner; |
| | | import java.text.MessageFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | |
| | | }else { |
| | | wrapper.isNull("maintain_field_id"); |
| | | } |
| | | wrapper.orderBy("order_no"); |
| | | |
| | | List<SysField> fieldList = fieldService.selectList(wrapper); |
| | | |
| | | |
| | | |
| | | return fieldList; |
| | | } |
| | | |
| | |
| | | MaintainField maintainField = fieldService.getMaintainFieldByMaintain(maintainId); |
| | | String maintainFieldId = maintainField.getId(); |
| | | |
| | | List<MasterAuthor> masterAuthors = selectList(new EntityWrapper<MasterAuthor>().eq(Constant.TYPE, MasterAuthorType.user).eq(MasterAuthorController.character_id, userId).eq("maintain_field_id", maintainFieldId)); |
| | | List<MasterAuthor> masterAuthors = selectList(new EntityWrapper<MasterAuthor>() |
| | | .eq("table_name", maintain.getTableName()) |
| | | .eq(Constant.TYPE, MasterAuthorType.user).eq(MasterAuthorController.character_id, userId).eq("maintain_field_id", maintainFieldId)); |
| | | if (masterAuthors.size() == 0) { |
| | | //user 获取role |
| | | List<TUserRole> roles = userRoleService.selectList(new EntityWrapper<TUserRole>().eq("user_id", userId)); |
| | | List<String> roleIds = roles.stream().map(tUserRole -> tUserRole.getRoleId()).collect(Collectors.toList()); |
| | | masterAuthors = selectList(new EntityWrapper<MasterAuthor>().eq(Constant.TYPE, MasterAuthorType.role).in(MasterAuthorController.character_id, roleIds).eq("maintain_field_id", maintainFieldId)); |
| | | masterAuthors = selectList(new EntityWrapper<MasterAuthor>().eq("table_name", maintain.getTableName()).eq(Constant.TYPE, MasterAuthorType.role).in(MasterAuthorController.character_id, roleIds).eq("maintain_field_id", maintainFieldId)); |
| | | } |
| | | if (masterAuthors.isEmpty()){ |
| | | return Constant.WHERE_DEFAULTUN; |