艾志 个税申报管理员功能,且注释上一次所开发的分权功能(通过建模按照部门维度所设置的权限)

This commit is contained in:
Harryxzy 2024-05-29 18:56:19 +08:00
parent 399852fe8a
commit 69877f518f
2 changed files with 41 additions and 43 deletions

View File

@ -6,13 +6,11 @@ import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareListDTO;
import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareRateDTO;
import com.engine.salary.entity.employeedeclare.param.*;
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
import com.engine.salary.entity.taxdeclaration.dto.AzGssbDTO;
import com.engine.salary.util.page.PageInfo;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 人员报送人员
@ -202,7 +200,7 @@ public interface EmployeeDeclareService{
List<EmployeeDeclarePO> listByEmpIdsAndTaxCycle(List<Long> empIds, Date date);
List<AzGssbDTO> getAzGssbAuth(int uid);
Map<String, Object> empIdsByAzGssbAuth(int uid);
// List<AzGssbDTO> getAzGssbAuth(int uid);
//
// Map<String, Object> empIdsByAzGssbAuth(int uid);
}

View File

@ -835,43 +835,43 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla
return getEmployeeDeclareMapper().listSome(EmployeeDeclarePO.builder().employeeIds(empIds).taxCycle(date).build());
}
@Override
public List<AzGssbDTO> getAzGssbAuth(int uid) {
RecordSet rs = new RecordSet();
rs.execute("select qx,bm from uf_gssbqx where gsglry="+uid);
List<AzGssbDTO> azGssbAuthList = new ArrayList<>();
while (rs.next()) {
azGssbAuthList.add(AzGssbDTO.builder()
.gsglry(uid)
.bm(rs.getInt("bm"))
.qx(rs.getInt("qx")).build());
}
azGssbAuthList = azGssbAuthList.stream().filter(auth -> auth.getQx() == 0 || auth.getQx() == 1).collect(Collectors.toList());
return azGssbAuthList;
}
// @Override
// public List<AzGssbDTO> getAzGssbAuth(int uid) {
// RecordSet rs = new RecordSet();
// rs.execute("select qx,bm from uf_gssbqx where gsglry="+uid);
// List<AzGssbDTO> azGssbAuthList = new ArrayList<>();
// while (rs.next()) {
// azGssbAuthList.add(AzGssbDTO.builder()
// .gsglry(uid)
// .bm(rs.getInt("bm"))
// .qx(rs.getInt("qx")).build());
// }
// azGssbAuthList = azGssbAuthList.stream().filter(auth -> auth.getQx() == 0 || auth.getQx() == 1).collect(Collectors.toList());
// return azGssbAuthList;
// }
public Map<String, Object> empIdsByAzGssbAuth(int uid) {
//艾志二开登录人拥有查看编辑部门权限下的人员
List<AzGssbDTO> azGssbAuth = getAzGssbAuth(uid);
List<Long> empListByDep = new ArrayList<>();
if (azGssbAuth.size() > 0) {
List<Long> depWithChildList = new ArrayList<>();
for (AzGssbDTO dto : azGssbAuth) {
try {
String depStr = DepartmentComInfo.getAllChildDepartId(String.valueOf(dto.getBm()), String.valueOf(dto.getBm()));
depWithChildList.addAll(Arrays.stream(depStr.split(",")).map(Long::parseLong).collect(Collectors.toList()));
} catch (Exception e) {
e.printStackTrace();
}
}
//查询有权限部门包含的员工id
empListByDep = getSalaryEmployeeService(user).listEmpIdByDepId(depWithChildList);
}
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("canManageEmpIds", empListByDep);
// 客户会规定一个用户在建模表中要么全是查看权限要么全是编辑权限
Optional<AzGssbDTO> canOperate = azGssbAuth.stream().filter(dto -> dto.getQx() == 1).findFirst();
resultMap.put("canOperate", canOperate.isPresent());
return resultMap;
}
// public Map<String, Object> empIdsByAzGssbAuth(int uid) {
// //艾志二开登录人拥有查看编辑部门权限下的人员
// List<AzGssbDTO> azGssbAuth = getAzGssbAuth(uid);
// List<Long> empListByDep = new ArrayList<>();
// if (azGssbAuth.size() > 0) {
// List<Long> depWithChildList = new ArrayList<>();
// for (AzGssbDTO dto : azGssbAuth) {
// try {
// String depStr = DepartmentComInfo.getAllChildDepartId(String.valueOf(dto.getBm()), String.valueOf(dto.getBm()));
// depWithChildList.addAll(Arrays.stream(depStr.split(",")).map(Long::parseLong).collect(Collectors.toList()));
// } catch (Exception e) {
// e.printStackTrace();
// }
// }
// //查询有权限部门包含的员工id
// empListByDep = getSalaryEmployeeService(user).listEmpIdByDepId(depWithChildList);
// }
// Map<String, Object> resultMap = new HashMap<>();
// resultMap.put("canManageEmpIds", empListByDep);
// // 客户会规定一个用户在建模表中要么全是查看权限要么全是编辑权限
// Optional<AzGssbDTO> canOperate = azGssbAuth.stream().filter(dto -> dto.getQx() == 1).findFirst();
// resultMap.put("canOperate", canOperate.isPresent());
// return resultMap;
// }
}