1.首页二级页面和导出接口添加

This commit is contained in:
方亮 2025-08-22 10:33:19 +08:00
parent 5b1c7f6fb9
commit dfecdd0fe9
12 changed files with 555 additions and 3 deletions

View File

@ -32,7 +32,7 @@ public class HomePageController extends BaseController {
* @return
*/
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth(isUser = false), requiresPermissions = @RequiresPermissions("home:page:query"))
@PostMapping("/getDataOverview")
@GetMapping("/getDataOverview")
@SysLog(title = "数据概览", businessType = OperaType.QUERY, logType = 0, module = "首页->数据概览", details = "数据概览")
public AjaxResult getDataOverview(HomePagePo o) {
try {

View File

@ -1,8 +1,9 @@
package com.bonus.bmw.controller;
import com.bonus.bmw.domain.po.HomePagePo;
import com.bonus.bmw.domain.vo.HomePageSubProVo;
import com.bonus.bmw.domain.vo.*;
import com.bonus.bmw.service.HomePageSubService;
import com.bonus.common.core.utils.poi.ExcelUtil;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.core.web.page.TableDataInfo;
@ -11,12 +12,15 @@ import com.bonus.common.log.enums.OperaType;
import com.bonus.common.security.annotation.InnerAuth;
import com.bonus.common.security.annotation.RequiresPermissions;
import com.bonus.common.security.annotation.RequiresPermissionsOrInnerAuth;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* 首页 - 子页面
@ -153,7 +157,7 @@ public class HomePageSubController extends BaseController {
* @return
*/
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth(isUser = false), requiresPermissions = @RequiresPermissions("home:page:query"))
@GetMapping("/getWorkerNotFileMsg")
@GetMapping("/getWorkerMsgById")
@SysLog(title = "单人详情页面", businessType = OperaType.QUERY, logType = 0, module = "首页->二级页面", details = "单人详情页面")
public AjaxResult getWorkerMsgById(HomePagePo o) {
try {
@ -164,4 +168,163 @@ public class HomePageSubController extends BaseController {
return error("系统异常,请联系管理员");
}
/**
* 首页-子页面-单人红绿灯详情
* @param o
* @return
*/
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth(isUser = false), requiresPermissions = @RequiresPermissions("home:page:query"))
@GetMapping("/getWorkerLightMsg")
@SysLog(title = "单人详情页面", businessType = OperaType.QUERY, logType = 0, module = "首页->二级页面", details = "单人详情页面")
public AjaxResult getWorkerLightMsg(HomePagePo o) {
try {
return service.getWorkerLightMsg(o);
} catch (Exception e) {
logger.error(e.toString(), e);
}
return error("系统异常,请联系管理员");
}
//导出
/**
* 总工程导出
*/
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth(isUser = false), requiresPermissions = @RequiresPermissions("home:page:query"))
@PostMapping("/mainProExport")
@SysLog(title = "总工程导出", businessType = OperaType.EXPORT, logType = 0, module = "首页->二级页面", details = "总工程导出")
public void mainProExport(HttpServletResponse response, HomePagePo o) {
try {
List<HomePageSubProVo> list = service.getMainProMsg(o);
List<HomePageMainProExport> exportList = list.stream()
.map(worker -> {
HomePageMainProExport export = new HomePageMainProExport();
BeanUtils.copyProperties(export, worker);
return export;
})
.collect(Collectors.toList());
ExcelUtil<HomePageMainProExport> util = new ExcelUtil<>(HomePageMainProExport.class);
util.exportExcel(response, exportList, "总工程导出");
} catch (Exception e) {
logger.error(e.toString(), e);
}
}
/**
* 标段工程导出
*/
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth(isUser = false), requiresPermissions = @RequiresPermissions("home:page:query"))
@PostMapping("/proExport")
@SysLog(title = "标段工程导出", businessType = OperaType.EXPORT, logType = 0, module = "首页->二级页面", details = "标段工程导出")
public void proExport(HttpServletResponse response, HomePagePo o) {
try {
List<HomePageSubProVo> list = service.getProMsg(o);
List<HomePageProExport> exportList = list.stream()
.map(worker -> {
HomePageProExport export = new HomePageProExport();
BeanUtils.copyProperties(export, worker);
return export;
})
.collect(Collectors.toList());
ExcelUtil<HomePageProExport> util = new ExcelUtil<>(HomePageProExport.class);
util.exportExcel(response, exportList, "标段工程导出");
} catch (Exception e) {
logger.error(e.toString(), e);
}
}
/**
* 分包单位导出
*/
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth(isUser = false), requiresPermissions = @RequiresPermissions("home:page:query"))
@PostMapping("/subExport")
@SysLog(title = "分包单位导出", businessType = OperaType.EXPORT, logType = 0, module = "首页->二级页面", details = "分包单位导出")
public void subExport(HttpServletResponse response, HomePagePo o) {
try {
List<HomePageSubProVo> list = service.getSubMsg(o);
List<HomePageSubExport> exportList = list.stream()
.map(worker -> {
HomePageSubExport export = new HomePageSubExport();
BeanUtils.copyProperties(export, worker);
return export;
})
.collect(Collectors.toList());
ExcelUtil<HomePageSubExport> util = new ExcelUtil<>(HomePageSubExport.class);
util.exportExcel(response, exportList, "分包单位导出");
} catch (Exception e) {
logger.error(e.toString(), e);
}
}
/**
* 班组导出
*/
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth(isUser = false), requiresPermissions = @RequiresPermissions("home:page:query"))
@PostMapping("/teamExport")
@SysLog(title = "班组导出", businessType = OperaType.EXPORT, logType = 0, module = "首页->二级页面", details = "班组导出")
public void teamExport(HttpServletResponse response, HomePagePo o) {
try {
List<HomePageSubProVo> list = service.getTeamMsg(o);
List<HomePageTeamExport> exportList = list.stream()
.map(worker -> {
HomePageTeamExport export = new HomePageTeamExport();
BeanUtils.copyProperties(export, worker);
return export;
})
.collect(Collectors.toList());
ExcelUtil<HomePageTeamExport> util = new ExcelUtil<>(HomePageTeamExport.class);
util.exportExcel(response, exportList, "班组导出");
} catch (Exception e) {
logger.error(e.toString(), e);
}
}
/**
* 人员导出
*/
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth(isUser = false), requiresPermissions = @RequiresPermissions("home:page:query"))
@PostMapping("/workerExport")
@SysLog(title = "人员导出", businessType = OperaType.EXPORT, logType = 0, module = "首页->二级页面", details = "人员导出")
public void workerExport(HttpServletResponse response, HomePagePo o) {
try {
List<HomePageSubProVo> list = service.getWorkerMsg(o);
List<HomePageWorkerExport> exportList = list.stream()
.map(worker -> {
HomePageWorkerExport export = new HomePageWorkerExport();
BeanUtils.copyProperties(export, worker);
return export;
})
.collect(Collectors.toList());
ExcelUtil<HomePageWorkerExport> util = new ExcelUtil<>(HomePageWorkerExport.class);
util.exportExcel(response, exportList, "人员导出");
} catch (Exception e) {
logger.error(e.toString(), e);
}
}
/**
* 出场未结算导出
*/
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth(isUser = false), requiresPermissions = @RequiresPermissions("home:page:query"))
@PostMapping("/workerNoFileExport")
@SysLog(title = "出场未结算导出", businessType = OperaType.EXPORT, logType = 0, module = "首页->二级页面", details = "出场未结算导出")
public void workerNoFileExport(HttpServletResponse response, HomePagePo o) {
try {
List<HomePageSubProVo> list = service.getWorkerNotFileMsg(o);
List<HomePageWorkerNoFileExport> exportList = list.stream()
.map(worker -> {
HomePageWorkerNoFileExport export = new HomePageWorkerNoFileExport();
BeanUtils.copyProperties(export, worker);
return export;
})
.collect(Collectors.toList());
ExcelUtil<HomePageWorkerNoFileExport> util = new ExcelUtil<>(HomePageWorkerNoFileExport.class);
util.exportExcel(response, exportList, "出场未结算导出");
} catch (Exception e) {
logger.error(e.toString(), e);
}
}
}

View File

@ -0,0 +1,29 @@
package com.bonus.bmw.domain.vo;
import com.bonus.common.core.annotation.Excel;
import lombok.Data;
/**
*主工程导出
*/
@Data
public class HomePageMainProExport {
//用于excel导出的序号一列,不需要业务逻辑处理
@Excel(name = "序号", isSequence = true, type = Excel.Type.EXPORT,sort = 1)
int sequence;
/**
* 主工程名称
*/
@Excel(name = "总工程名称", type = Excel.Type.EXPORT,sort = 2)
private String mainProName;
/**
* 工程数量
*/
@Excel(name = "工程数量", type = Excel.Type.EXPORT,sort = 3)
private String proNum;
}

View File

@ -0,0 +1,81 @@
package com.bonus.bmw.domain.vo;
import com.bonus.common.core.annotation.Excel;
import lombok.Data;
/**
* 标段工程导出
*/
@Data
public class HomePageProExport {
//用于excel导出的序号一列,不需要业务逻辑处理
@Excel(name = "序号", isSequence = true, type = Excel.Type.EXPORT,sort = 1)
int sequence;
/**
* 主工程名称
*/
@Excel(name = "总工程名称", type = Excel.Type.EXPORT,sort = 2)
private String mainProName;
/**
* 分公司名称
*/
@Excel(name = "分公司名称", type = Excel.Type.EXPORT,sort = 3)
private String subCompanyName;
/**
* 工程名称
*/
@Excel(name = "工程名称", type = Excel.Type.EXPORT,sort = 4)
private String proName;
/**
* 分包数量
*/
@Excel(name = "分包数量", type = Excel.Type.EXPORT,sort = 5)
private String subNum;
/**
* 班组数量
*/
@Excel(name = "班组数量", type = Excel.Type.EXPORT,sort = 6)
private String teamNum;
/**
* 入场人员数量
*/
@Excel(name = "入场人员数量", type = Excel.Type.EXPORT,sort = 7)
private String einNum;
/**
* 考勤人员数量
*/
@Excel(name = "考勤人员数量", type = Excel.Type.EXPORT,sort = 8)
private String attNum;
/**
* yellow数量
*/
@Excel(name = "黄灯数量", type = Excel.Type.EXPORT,sort = 9)
private String yellowNum;
/**
* green数量
*/
@Excel(name = "绿灯数量", type = Excel.Type.EXPORT,sort = 10)
private String greenNum;
/**
* 电压等级
*/
@Excel(name = "电压等级", type = Excel.Type.EXPORT,sort = 11)
private String volLevel;
/**
* 工程类别
*/
@Excel(name = "工程类别", type = Excel.Type.EXPORT,sort = 12)
private String proType;
/**
* 工程状态
*/
@Excel(name = "工程状态", type = Excel.Type.EXPORT,sort = 13)
private String proStatus;
}

View File

@ -0,0 +1,59 @@
package com.bonus.bmw.domain.vo;
import com.bonus.common.core.annotation.Excel;
import lombok.Data;
/**
* 标段工程导出
*/
@Data
public class HomePageSubExport {
//用于excel导出的序号一列,不需要业务逻辑处理
@Excel(name = "序号", isSequence = true, type = Excel.Type.EXPORT,sort = 1)
int sequence;
/**
* 分包名称
*/
@Excel(name = "分包名称", type = Excel.Type.EXPORT,sort = 2)
private String subName;
/**
* 班组数量
*/
@Excel(name = "班组数量", type = Excel.Type.EXPORT,sort = 3)
private String teamNum;
/**
* 入场人员数量
*/
@Excel(name = "入场人员数量", type = Excel.Type.EXPORT,sort = 4)
private String einNum;
/**
* 考勤人员数量
*/
@Excel(name = "考勤人员数量", type = Excel.Type.EXPORT,sort = 5)
private String attNum;
/**
* yellow数量
*/
@Excel(name = "黄灯数量", type = Excel.Type.EXPORT,sort = 6)
private String yellowNum;
/**
* green数量
*/
@Excel(name = "绿灯数量", type = Excel.Type.EXPORT,sort = 7)
private String greenNum;
/**
* 工程名称
*/
@Excel(name = "工程名称", type = Excel.Type.EXPORT,sort = 8)
private String proName;
/**
* 分公司名称
*/
@Excel(name = "分公司名称", type = Excel.Type.EXPORT,sort = 9)
private String subCompanyName;
}

View File

@ -0,0 +1,60 @@
package com.bonus.bmw.domain.vo;
import com.bonus.common.core.annotation.Excel;
import lombok.Data;
/**
* 标段工程导出
*/
@Data
public class HomePageTeamExport {
//用于excel导出的序号一列,不需要业务逻辑处理
@Excel(name = "序号", isSequence = true, type = Excel.Type.EXPORT,sort = 1)
int sequence;
/**
* 班组名称
*/
@Excel(name = "班组名称", type = Excel.Type.EXPORT,sort = 2)
private String teamName;
/**
* 入场人员数量
*/
@Excel(name = "入场人员数量", type = Excel.Type.EXPORT,sort = 3)
private String einNum;
/**
* 考勤人员数量
*/
@Excel(name = "考勤人员数量", type = Excel.Type.EXPORT,sort = 4)
private String attNum;
/**
* yellow数量
*/
@Excel(name = "黄灯数量", type = Excel.Type.EXPORT,sort = 5)
private String yellowNum;
/**
* green数量
*/
@Excel(name = "绿灯数量", type = Excel.Type.EXPORT,sort = 6)
private String greenNum;
/**
* 分包名称
*/
@Excel(name = "分包名称", type = Excel.Type.EXPORT,sort = 7)
private String subName;
/**
* 工程名称
*/
@Excel(name = "工程名称", type = Excel.Type.EXPORT,sort = 8)
private String proName;
/**
* 分公司名称
*/
@Excel(name = "分公司名称", type = Excel.Type.EXPORT,sort = 9)
private String subCompanyName;
}

View File

@ -0,0 +1,68 @@
package com.bonus.bmw.domain.vo;
import com.bonus.common.core.annotation.Excel;
import lombok.Data;
/**
* 标段工程导出
*/
@Data
public class HomePageWorkerExport {
//用于excel导出的序号一列,不需要业务逻辑处理
@Excel(name = "序号", isSequence = true, type = Excel.Type.EXPORT,sort = 1)
int sequence;
/**
* 施工人员名称
*/
@Excel(name = "项目", isSequence = true, type = Excel.Type.EXPORT,sort = 2)
private String workerName;
/**
* 岗位名称
*/
@Excel(name = "工种", isSequence = true, type = Excel.Type.EXPORT,sort = 3)
private String postName;
/**
* 红绿灯状态
*/
@Excel(name = "红绿灯状态", isSequence = true, type = Excel.Type.EXPORT,sort = 4,readConverterExp = "1=黄灯,2 = 红灯")
private String lightStatus;
/**
* 是否考勤
*/
@Excel(name = "是否考勤", isSequence = true, type = Excel.Type.EXPORT,sort = 5,readConverterExp = "1 = 是,0 = 否")
private String isAtt;
/**
* 性别
*/
@Excel(name = "性别", isSequence = true, type = Excel.Type.EXPORT,sort = 6)
private String sex;
/**
* 年龄
*/
@Excel(name = "年龄", isSequence = true, type = Excel.Type.EXPORT,sort = 7)
private String age;
/**
* 手机号
*/
@Excel(name = "手机号", isSequence = true, type = Excel.Type.EXPORT,sort = 8)
private String phone;
/**
* 分包名称
*/
@Excel(name = "分包名称", type = Excel.Type.EXPORT,sort = 9)
private String subName;
/**
* 工程名称
*/
@Excel(name = "工程名称", type = Excel.Type.EXPORT,sort = 10)
private String proName;
/**
* 分公司名称
*/
@Excel(name = "分公司名称", type = Excel.Type.EXPORT,sort = 11)
private String subCompanyName;
}

View File

@ -0,0 +1,63 @@
package com.bonus.bmw.domain.vo;
import com.bonus.common.core.annotation.Excel;
import lombok.Data;
/**
* 标段工程导出
*/
@Data
public class HomePageWorkerNoFileExport {
//用于excel导出的序号一列,不需要业务逻辑处理
@Excel(name = "序号", isSequence = true, type = Excel.Type.EXPORT,sort = 1)
int sequence;
/**
* 施工人员名称
*/
@Excel(name = "姓名", isSequence = true, type = Excel.Type.EXPORT,sort = 2)
private String workerName;
/**
* 身份证号码
*/
@Excel(name = "身份证号码", isSequence = true, type = Excel.Type.EXPORT,sort = 3)
private String idNumber;
/**
* 手机号
*/
@Excel(name = "手机号", isSequence = true, type = Excel.Type.EXPORT,sort = 4)
private String phone;
/**
* 班组名称
*/
@Excel(name = "班组名称", type = Excel.Type.EXPORT,sort = 5)
private String teamName;
/**
* 工程名称
*/
@Excel(name = "工程名称", type = Excel.Type.EXPORT,sort = 6)
private String proName;
/**
* 出场时间
*/
@Excel(name = "出场时间", type = Excel.Type.EXPORT,sort = 7)
private String exitTime;
/**
* 出场天数
*/
@Excel(name = "出场天数 ", type = Excel.Type.EXPORT,sort = 8)
private String daysSinceExit;
/**
* 分公司名称
*/
@Excel(name = "分公司名称", type = Excel.Type.EXPORT,sort = 9)
private String subCompanyName;
}

View File

@ -59,4 +59,6 @@ public interface HomePageSubMapper {
* @return
*/
PmWorker getWorkerMsgById(HomePagePo o);
List<MapBeanVo> getWorkerLightMsg(HomePagePo o);
}

View File

@ -56,4 +56,11 @@ public interface HomePageSubService {
* @return
*/
AjaxResult getWorkerMsgById(HomePagePo o);
/**
* 单人红绿灯详情页面
* @param o
* @return
*/
AjaxResult getWorkerLightMsg(HomePagePo o);
}

View File

@ -62,4 +62,10 @@ public class HomePageSubServiceImpl implements HomePageSubService {
return AjaxResult.success("查询成功", worker);
}
@Override
public AjaxResult getWorkerLightMsg(HomePagePo o) {
List<MapBeanVo> list = mapper.getWorkerLightMsg(o);
return AjaxResult.success("查询成功", list);
}
}

View File

@ -345,4 +345,18 @@
WHERE
pw.id = #{id}
</select>
<select id="getWorkerLightMsg" resultType="com.bonus.bmw.domain.vo.MapBeanVo">
SELECT
'工资卡' as `key`,
count(1) as `value`
FROM
`bm_worker_wage_card` where is_active = 1 and worker_id = #{id}
UNION ALL
SELECT
'合同' as `key`,
count(1) as `value`
FROM
`bm_worker_contract` where is_active = 1 and worker_id = #{id}
</select>
</mapper>