|
|
@ -54,10 +54,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
/** |
|
|
|
* 部门管理 |
|
|
@ -1075,4 +1072,45 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit |
|
|
|
|
|
|
|
return new Result<SysDeptDTO>().ok(dto); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Result<List<Long[]>> getAllDeptIdsArray(Long[] deptIds) { |
|
|
|
List<CompleteDeptDTO> allDeptIdsArray = baseDao.getAllDeptIdsArray(deptIds); |
|
|
|
|
|
|
|
List<Long[]> ids = new ArrayList<>(); |
|
|
|
for (CompleteDeptDTO dto : allDeptIdsArray) { |
|
|
|
Long[] allDeptId = new Long[NumConstant.FOUR]; |
|
|
|
int index = NumConstant.ZERO; |
|
|
|
if (dto.getDistrictId() != null && dto.getDistrictId() != NumConstant.ZERO_L) { |
|
|
|
allDeptId[index++] = dto.getDistrictId(); |
|
|
|
} |
|
|
|
if (dto.getStreetId() != null && dto.getStreetId() != NumConstant.ZERO_L) { |
|
|
|
allDeptId[index++] = dto.getStreetId(); |
|
|
|
} |
|
|
|
if (dto.getCommunityId() != null && dto.getCommunityId() != NumConstant.ZERO_L) { |
|
|
|
allDeptId[index++] = dto.getCommunityId(); |
|
|
|
} |
|
|
|
if (dto.getGridId() != null && dto.getGridId() != NumConstant.ZERO_L) { |
|
|
|
allDeptId[index++] = dto.getGridId(); |
|
|
|
} |
|
|
|
Long[] copyAllDeptId = Arrays.copyOf(allDeptId, index); |
|
|
|
ids.add(copyAllDeptId); |
|
|
|
} |
|
|
|
return new Result<List<Long[]> >().ok(ids); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
class A { |
|
|
|
public static void main(String[] args) { |
|
|
|
Long[] allDeptId = new Long[4]; |
|
|
|
allDeptId[0] = 1L; |
|
|
|
allDeptId[1] = 1L; |
|
|
|
allDeptId[2] = 1L; |
|
|
|
allDeptId[3] = 1L; |
|
|
|
Long[] longs = Arrays.copyOf(allDeptId,4); |
|
|
|
allDeptId[0] = 11L; |
|
|
|
for (Long aLong : longs) { |
|
|
|
System.out.println(aLong); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|