月计划与月计划异常导出添加头部条件

This commit is contained in:
fl 2025-02-12 09:56:53 +08:00
parent 803298ae60
commit de8a9f61aa
3 changed files with 21 additions and 18 deletions

View File

@ -77,7 +77,7 @@ public class AttDetailByMonthController extends BaseController {
// 如果需要转换回 List 类型
List<String> uniqueIds = new ArrayList<>(idsSet);
data.setOrgList(uniqueIds);
}else{
} else {
data.setUserId(userId);
}
}
@ -96,8 +96,8 @@ public class AttDetailByMonthController extends BaseController {
SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
List<String> roleId = sysUser.getRoleList();
//管理员与人资角色可以看到所有
if( roleId !=null && !roleId.isEmpty()){
if (Collections.frequency(roleId, "1")==0 && Collections.frequency(roleId, "16")==0) {
if (roleId != null && !roleId.isEmpty()) {
if (Collections.frequency(roleId, "1") == 0 && Collections.frequency(roleId, "16") == 0) {
List<MapVo> orgList = sysUser.getOrgList();
if (!orgList.isEmpty()) {
ArrayList<String> ids = new ArrayList<>();
@ -134,6 +134,7 @@ public class AttDetailByMonthController extends BaseController {
*/
@Resource(name = "attendanceDetailsService")
private AttendanceDetailsService attendanceDetailsService;
@RequiresPermissions("att:detail:export")
@GetMapping("/export")
public void export(HttpServletResponse response, AttDetailByMonthBean bean) {
@ -159,7 +160,7 @@ public class AttDetailByMonthController extends BaseController {
// 如果需要转换回 List 类型
List<String> uniqueIds = new ArrayList<>(idsSet);
bean.setOrgList(uniqueIds);
}else{
} else {
bean.setUserId(userId);
}
}
@ -207,25 +208,25 @@ public class AttDetailByMonthController extends BaseController {
AttDetailBean dayTable = new AttDetailBean();
dayTable.setStartDate(monthFirstAndLast.get(0));
dayTable.setEndDate(monthFirstAndLast.get(1));
if(bean.getOrgId() != null){
dayTable.setOrgId(String.valueOf(bean.getOrgId()));
}else{
//受限于当前登录人
if(bean.getOrgList() != null && !bean.getOrgList().isEmpty()){
dayTable.setOrgList(bean.getOrgList());
}
}
dayTable.setName(bean.getName());
if (bean.getOrgId() != null) {
dayTable.setOrgId(String.valueOf(bean.getOrgId()));
} else {
//受限于当前登录人
if (bean.getOrgList() != null && !bean.getOrgList().isEmpty()) {
dayTable.setOrgList(bean.getOrgList());
}
}
headers.entrySet()
.forEach(entry -> {
if("99".equals(entry.getKey())){
if ("99".equals(entry.getKey())) {
AttDataDetailsBean att = new AttDataDetailsBean();
att.setAttCurrentMonth(bean.getAttCurrentMonth());
if(bean.getOrgId() != null){
if (bean.getOrgId() != null) {
att.setOrgId(Long.valueOf(bean.getOrgId()));
}else{
} else {
//受限于当前登录人
if(bean.getOrgList() != null && !bean.getOrgList().isEmpty()){
if (bean.getOrgList() != null && !bean.getOrgList().isEmpty()) {
att.setOrgList(bean.getOrgList());
}
}
@ -248,7 +249,7 @@ public class AttDetailByMonthController extends BaseController {
departmentData2.add(map);
}
exporter.addDataRows(departmentSheet2, departmentData2, departmentHeaders2);
}else {
} else {
dayTable.setAttStatis(Integer.parseInt(entry.getKey()));
List<AttDetailBean> list = attDetailByMonthService.getDetailList(dayTable);
Sheet departmentSheet2 = exporter.createSheet(entry.getValue());

View File

@ -727,7 +727,6 @@ public class ExportFileController {
dayTable.setOrgList(bean.getOrgList());
}
}
dayTable.setName(bean.getUserName());
headers.entrySet()
.forEach(entry -> {
if ("99".equals(entry.getKey())) {

View File

@ -453,6 +453,9 @@
<if test="bean.userName != null and bean.userName != ''">
and locate(#{bean.userName},awa.user_name)
</if>
<if test="bean.orgId != null and bean.orgId != ''">
and so.id = #{bean.orgId}
</if>
<if test='bean.orgList != null and bean.orgList.size() > 0'>
and so.id in (
<foreach collection="bean.orgList" item="item" separator=",">