diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/controller/TeamInfoController.java b/src/main/java/com/zhgd/xmgl/modules/worker/controller/TeamInfoController.java index a6f372298..cce2c4e09 100644 --- a/src/main/java/com/zhgd/xmgl/modules/worker/controller/TeamInfoController.java +++ b/src/main/java/com/zhgd/xmgl/modules/worker/controller/TeamInfoController.java @@ -116,10 +116,13 @@ public class TeamInfoController { @ApiOperation(value = "列表查询劳务人员班组信息", notes = "列表查询劳务人员班组信息", httpMethod = "POST") @ApiImplicitParams({ - @ApiImplicitParam(name = "enterpriseId", value = "企业ID", paramType = "body", required = true, dataType = "String"), - @ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"), - @ApiImplicitParam(name = "userEnterpriseId", value = "用户能查看的企业", paramType = "body", required = false, dataType = "String"), - }) + @ApiImplicitParam(name = "enterpriseId", value = "企业ID", paramType = "body", required = true, dataType = "String"), + @ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"), + @ApiImplicitParam(name = "userEnterpriseId", value = "用户能查看的企业", paramType = "body", required = false, dataType = "String"), + @ApiImplicitParam(name = "isSpecial", value = "1是特殊工种,0不是", paramType = "body", required = false, dataType = "String"), + @ApiImplicitParam(name = "workerTypeId", value = "工种id", paramType = "body", required = false, dataType = "String"), + @ApiImplicitParam(name = "containEnterpriseId", value = "包含下级的单位id", paramType = "body", required = false, dataType = "String"), + }) @PostMapping(value = "/getTeamInfoList") public Result> getTeamInfoList(@RequestBody Map map) { return Result.success(teamInfoService.getTeamInfoList(map)); diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/controller/WorkerDailyAttendanceStatisticsV2Controller.java b/src/main/java/com/zhgd/xmgl/modules/worker/controller/WorkerDailyAttendanceStatisticsV2Controller.java index 246166ea1..f5c54988d 100644 --- a/src/main/java/com/zhgd/xmgl/modules/worker/controller/WorkerDailyAttendanceStatisticsV2Controller.java +++ b/src/main/java/com/zhgd/xmgl/modules/worker/controller/WorkerDailyAttendanceStatisticsV2Controller.java @@ -181,6 +181,17 @@ public class WorkerDailyAttendanceStatisticsV2Controller { }) @GetMapping(value = "/countDailyAttendanceByDateRange") public Result> countDailyAttendanceByDateRange(@ApiIgnore @RequestParam HashMap param) { + IPage p = doCountDailyAttendanceByDateRange(param); + return Result.success(p); + } + + /** + * 统计考勤列表(一段时间) + * + * @param param + * @return + */ + private IPage doCountDailyAttendanceByDateRange(HashMap param) { Date startTime = null; Date endTime = null; if (StrUtil.isNotBlank(MapUtils.getString(param, "startTime"))) { @@ -246,7 +257,7 @@ public class WorkerDailyAttendanceStatisticsV2Controller { p.setRecords(vos); p.setCurrent(workerInfoList.getCurrent()); p.setSize(workerInfoList.getSize()); - return Result.success(p); + return p; } @ApiOperation(value = "查询异常工时统计列表", notes = "查询异常工时统计列表", httpMethod = "GET") @@ -731,4 +742,173 @@ public class WorkerDailyAttendanceStatisticsV2Controller { return Result.success(workerDailyAttendanceStatisticsV2Service.countWorkerDailyAttendanceByDate(param)); } + @ApiOperation(value = "按分包单位统计人员出勤", notes = "按分包单位统计人员出勤", httpMethod = "POST") + @ApiImplicitParams({ + @ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"), + @ApiImplicitParam(name = "startDate", value = "开始日期(yyyy-MM-dd)", paramType = "body", required = true, dataType = "String"), + @ApiImplicitParam(name = "endDate", value = "结束日期(yyyy-MM-dd)", paramType = "body", required = true, dataType = "String"), + @ApiImplicitParam(name = "parentEnterpriseId", value = "父级单位id(统计所有下级的)", paramType = "body", required = false, dataType = "String"), + @ApiImplicitParam(name = "personType", value = "人员类型 1、劳务人员 2、管理人员,3临时人员", paramType = "body", required = false, dataType = "String"), + @ApiImplicitParam(name = "isSecondLevel", value = "1是第二级", paramType = "body", required = false, dataType = "String"), + }) + @PostMapping(value = "/countNumByEnterprise") + public Result> countNumByEnterprise(@RequestBody HashMap param) { + return Result.success(workerDailyAttendanceStatisticsV2Service.countNumByEnterprise(param)); + } + + @ApiOperation(value = "按工种统计工人出勤", notes = "按工种统计工人出勤", httpMethod = "POST") + @ApiImplicitParams({ + @ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"), + @ApiImplicitParam(name = "startDate", value = "开始日期(yyyy-MM-dd)", paramType = "body", required = true, dataType = "String"), + @ApiImplicitParam(name = "endDate", value = "结束日期(yyyy-MM-dd)", paramType = "body", required = true, dataType = "String"), + @ApiImplicitParam(name = "isSpecial", value = "1是特殊工种,0不是", paramType = "body", required = false, dataType = "String"), + }) + @PostMapping(value = "/countNumByWorkerType") + public Result> countNumByWorkerType(@RequestBody HashMap param) { + return Result.success(workerDailyAttendanceStatisticsV2Service.countNumByWorkerType(param)); + } + + @ApiOperation(value = "导出考勤月报excel记录", notes = "导出考勤月报excel记录", httpMethod = "POST") + @ApiImplicitParams({ + @ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"), + @ApiImplicitParam(name = "startDate", value = "开始日期(yyyy-MM-dd)", paramType = "body", required = true, dataType = "String"), + @ApiImplicitParam(name = "endDate", value = "结束日期(yyyy-MM-dd)", paramType = "body", required = true, dataType = "String"), + @ApiImplicitParam(name = "groupByType", value = "1.按项目;2.按参建单位;3.按班组/部门;4.按人员", paramType = "body", required = true, dataType = "String"), + @ApiImplicitParam(name = "downloadType", value = "1上下午打卡2进出场打卡", paramType = "body", required = false, dataType = "String"), + @ApiImplicitParam(name = "effectiveHour", value = "有效工时", paramType = "body", required = false, dataType = "String"), + }) + @PostMapping(value = "/exportWorkerDailyAttendancesStaticsByMonthXls") + public void exportWorkerDailyAttendancesStaticsByMonthXls(HttpServletResponse response, @RequestBody HashMap param) { +// String templateUrl = null; +// try { +// String projectSn = MapUtils.getString(param, "projectSn"); +// String startDate = MapUtils.getString(param, "startDate"); +// String endDate = MapUtils.getString(param, "endDate"); +// Integer downloadType = MapUtils.getInteger(param, "downloadType"); +// Integer groupByType = MapUtils.getInteger(param, "groupByType"); +// List dateTimes = DateUtil.rangeToList(DateUtil.parseDate(startDate), DateUtil.parseDate(endDate), DateField.DAY_OF_YEAR); +// Map> root = new HashMap<>(); +// if (Objects.equals(groupByType, 3)) { +// //按班组/部门 +// if (Objects.equals(downloadType, 1)) { +// //考勤月报-按班组-每日出入(打卡记录明细).xlsx +// param.put("startTime", startDate); +// param.put("endTime", endDate); +// param.put("pageSize", -1); +// List voList = this.doCountDailyAttendanceByDateRange(param).getRecords(); +// Map> deptNameMap = voList.stream().collect(Collectors.groupingBy(StatisticsListVo::getDeptName)); +// Map sheetMap = new HashMap<>(); +// List> listMap = new ArrayList<>(); +// for (Map.Entry> entry : deptNameMap.entrySet()) { +// int j = 0; +// for (StatisticsListVo vo : entry.getValue()) { +// Map map = new HashMap<>(); +// map.put("firstInTimeYes", StrUtil.isNotBlank(vo.getFirstInTime()) ? "√" : "×"); +// map.put("firstInTime", vo.getFirstInTime()); +// map.put("endOutTimeYes", StrUtil.isNotBlank(vo.getEndOutTime()) ? "√" : "×"); +// map.put("endOutTime", vo.getEndOutTime()); +// map.put("firstTimeAmYes", StrUtil.isNotBlank(vo.getFirstTimeAm()) ? "√" : "×"); +// map.put("firstTimeAm", vo.getFirstTimeAm()); +// map.put("endTimePmYes", StrUtil.isNotBlank(vo.getEndTimePm()) ? "√" : "×"); +// map.put("endTimePm", vo.getEndTimePm()); +// map.put("personType", vo.getPersonType()); +// map.put("enterpriseName", vo.getEnterpriseName()); +// map.put("workerName", vo.getWorkerName()); +// map.put("deptName", vo.getDeptName()); +// map.put("projectSn", vo.getProjectSn()); +// map.put("personSn", vo.getPersonSn()); +// map.put("attendanceDate", vo.getAttendanceDate()); +// map.put("hourVal", vo.getHourVal()); +// map.put("dayVal", vo.getDayVal()); +// map.put("isAttendance", vo.getIsAttendance()); +// map.put("overtimeHourVal", vo.getOvertimeHourVal()); +// map.put("overtimeDayVal", vo.getOvertimeDayVal()); +// map.put("inserviceType", vo.getInserviceType()); +// AtomicInteger i = new AtomicInteger(1); +// map.put("attendanceList", Objects.nonNull(vo.getAttendanceList()) ? vo.getAttendanceList().stream().map(a -> { +// return i.getAndIncrement() + ".(" + (Objects.equals(a.getPassType(), 1) ? "进场" : "出场") + a.getCreateTime() + ")"; +// }).collect(Collectors.joining("\n")) : ""); +// map.put("workerTypeName", vo.getWorkerTypeName()); +// map.put("phoneNumber", vo.getPhoneNumber()); +// map.put("idCard", vo.getIdCard()); +// map.put("sex", Objects.equals(vo.getSex(), 1) ? "男" : "女"); +// map.put("enterDate", vo.getEnterDate()); +// listMap.add(map); +// } +// } +// sheetMap.put("date", DateUtil.formatDate(dateTime)); +// sheetMap.put("listMap", listMap); +// root.put(j++, sheetMap); +// } +// } +// +// param.put("pageNo", 1); +// param.put("pageSize", -1); +// int j = 0; +// String tempSheetName; +// if (Objects.equals(downloadType, 1)) { +// tempSheetName = "考勤日报-出勤导出模版(上午下午).xlsx"; +// } else { +// tempSheetName = "考勤日报-出勤导出模版(进场出场).xlsx"; +// } +// for (DateTime dateTime : dateTimes) { +// param.put("attendanceDate", DateUtil.formatDate(dateTime)); +// List records = doGetWorkerDailyAttendancePageByDateVoIPage(param).getRecords(); +// Map sheetMap = new HashMap<>(); +// List> listMap = new ArrayList<>(); +// for (WorkerDailyAttendancesByDateVo vo : records) { +// Map map = new HashMap<>(); +// map.put("firstInTimeYes", StrUtil.isNotBlank(vo.getFirstInTime()) ? "√" : "×"); +// map.put("firstInTime", vo.getFirstInTime()); +// map.put("endOutTimeYes", StrUtil.isNotBlank(vo.getEndOutTime()) ? "√" : "×"); +// map.put("endOutTime", vo.getEndOutTime()); +// map.put("firstTimeAmYes", StrUtil.isNotBlank(vo.getFirstTimeAm()) ? "√" : "×"); +// map.put("firstTimeAm", vo.getFirstTimeAm()); +// map.put("endTimePmYes", StrUtil.isNotBlank(vo.getEndTimePm()) ? "√" : "×"); +// map.put("endTimePm", vo.getEndTimePm()); +// map.put("personType", vo.getPersonType()); +// map.put("enterpriseName", vo.getEnterpriseName()); +// map.put("workerName", vo.getWorkerName()); +// map.put("deptName", vo.getDeptName()); +// map.put("projectSn", vo.getProjectSn()); +// map.put("personSn", vo.getPersonSn()); +// map.put("attendanceDate", vo.getAttendanceDate()); +// map.put("hourVal", vo.getHourVal()); +// map.put("dayVal", vo.getDayVal()); +// map.put("isAttendance", vo.getIsAttendance()); +// map.put("overtimeHourVal", vo.getOvertimeHourVal()); +// map.put("overtimeDayVal", vo.getOvertimeDayVal()); +// map.put("inserviceType", vo.getInserviceType()); +// AtomicInteger i = new AtomicInteger(1); +// map.put("attendanceList", Objects.nonNull(vo.getAttendanceList()) ? vo.getAttendanceList().stream().map(a -> { +// return i.getAndIncrement() + ".(" + (Objects.equals(a.getPassType(), 1) ? "进场" : "出场") + a.getCreateTime() + ")"; +// }).collect(Collectors.joining("\n")) : ""); +// map.put("workerTypeName", vo.getWorkerTypeName()); +// map.put("phoneNumber", vo.getPhoneNumber()); +// map.put("idCard", vo.getIdCard()); +// map.put("sex", Objects.equals(vo.getSex(), 1) ? "男" : "女"); +// map.put("enterDate", vo.getEnterDate()); +// listMap.add(map); +// } +// sheetMap.put("date", DateUtil.formatDate(dateTime)); +// sheetMap.put("listMap", listMap); +// root.put(j++, sheetMap); +// } +// templateUrl = Fileutils.getExportTemplateFile("excel/" + tempSheetName).getAbsolutePath(); +// String outputTemplateFilePath = PathUtil.getBasePath() + "/temp/" + IdUtil.randomUUID() + ".xlsx"; +// EasyPoiUtil.cloneSheetMultipleTimes(templateUrl, outputTemplateFilePath, "1", dateTimes.size() - 1); +// TemplateExportParams params = new TemplateExportParams(outputTemplateFilePath, true); +// params.setSheetName(dateTimes.stream().map(DateUtil::formatDate).collect(Collectors.toList()).toArray(new String[]{})); +// Workbook workbook = ExcelExportUtil.exportExcel(root, params); +// //设置下拉 +// ExcelUtils.downLoadExcel(tempSheetName, response, workbook); +// } catch (IOException e) { +// log.error("", e); +// throw new OpenAlertException("系统错误"); +// } finally { +// if (templateUrl != null) { +// FileUtil.deleteFile(templateUrl); +// } +// } + } } diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/controller/WorkerExitConfigController.java b/src/main/java/com/zhgd/xmgl/modules/worker/controller/WorkerExitConfigController.java new file mode 100644 index 000000000..66b3d4fd1 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/worker/controller/WorkerExitConfigController.java @@ -0,0 +1,141 @@ +package com.zhgd.xmgl.modules.worker.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.zhgd.annotation.OperLog; +import com.zhgd.jeecg.common.api.vo.Result; +import com.zhgd.xmgl.modules.worker.entity.WorkerExitConfig; +import com.zhgd.xmgl.modules.worker.entity.dto.WorkerExitConfigDto; +import com.zhgd.xmgl.modules.worker.entity.vo.WorkerExitConfigVo; +import com.zhgd.xmgl.modules.worker.service.IWorkerExitConfigService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections.MapUtils; +import org.simpleframework.xml.core.Validate; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import java.util.HashMap; +import java.util.List; + + +/** + * @Title: Controller + * @Description: 人员退场配置 + * @author: pds + * @date: 2025-08-20 + * @version: V1.0 + */ +@RestController +@RequestMapping("/xmgl/workerExitConfig") +@Slf4j +@Api(tags = "人员退场配置相关Api") +public class WorkerExitConfigController { + @Lazy + @Autowired + private IWorkerExitConfigService workerExitConfigService; + + /** + * 分页列表查询 + * + * @return + */ + @OperLog(operModul = "人员退场配置管理", operType = "分页查询", operDesc = "分页列表查询人员退场配置信息") + @ApiOperation(value = "分页列表查询人员退场配置信息", notes = "分页列表查询人员退场配置信息", httpMethod = "GET") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"), + @ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"), + }) + @GetMapping(value = "/page") + public Result> queryPageList(@ApiIgnore @RequestParam HashMap param) { + return Result.success(workerExitConfigService.queryPageList(param)); + } + + /** + * 列表查询 + * + * @return + */ + @OperLog(operModul = "人员退场配置管理", operType = "列表查询", operDesc = "列表查询人员退场配置信息") + @ApiOperation(value = "列表查询人员退场配置信息", notes = "列表查询人员退场配置信息", httpMethod = "GET") + @GetMapping(value = "/list") + public Result> queryList(@ApiIgnore @RequestParam HashMap param) { + return Result.success(workerExitConfigService.queryList(param)); + } + + /** + * 添加 + * + * @param workerExitConfigDto + * @return + */ + @OperLog(operModul = "人员退场配置管理", operType = "添加", operDesc = "添加人员退场配置信息") + @ApiOperation(value = "添加人员退场配置信息", notes = "添加人员退场配置信息", httpMethod = "POST") + @PostMapping(value = "/add") + public Result add(@RequestBody @Validate WorkerExitConfigDto workerExitConfigDto) { + workerExitConfigService.add(workerExitConfigDto); + return Result.ok(); + } + + /** + * 编辑 + * + * @param workerExitConfigDto + * @return + */ + @OperLog(operModul = "人员退场配置管理", operType = "编辑", operDesc = "编辑人员退场配置信息") + @ApiOperation(value = "编辑人员退场配置信息", notes = "编辑人员退场配置信息", httpMethod = "POST") + @PostMapping(value = "/edit") + public Result edit(@RequestBody WorkerExitConfigDto workerExitConfigDto) { + workerExitConfigService.edit(workerExitConfigDto); + return Result.ok(); + } + + /** + * 通过id删除 + * + * @return + */ + @OperLog(operModul = "人员退场配置管理", operType = "删除", operDesc = "删除人员退场配置信息") + @ApiOperation(value = "删除人员退场配置信息", notes = "删除人员退场配置信息", httpMethod = "POST") + @ApiImplicitParam(name = "id", value = "人员退场配置ID", paramType = "body", required = true, dataType = "String", example = "{\"id\":\"1\"}") + @PostMapping(value = "/delete") + public Result delete(@ApiIgnore @RequestBody HashMap map) { + workerExitConfigService.delete(MapUtils.getString(map, "id")); + return Result.ok(); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + @OperLog(operModul = "人员退场配置管理", operType = "通过id查询", operDesc = "通过id查询人员退场配置信息") + @ApiOperation(value = "通过id查询人员退场配置信息", notes = "通过id查询人员退场配置信息", httpMethod = "GET") + @ApiImplicitParam(name = "id", value = "人员退场配置ID", paramType = "query", required = true, dataType = "Integer") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name = "id", required = true) String id) { + return Result.success(workerExitConfigService.queryById(id)); + } + + @OperLog(operModul = "人员退场配置管理", operType = "", operDesc = "保存人员退场配置信息") + @ApiOperation(value = "保存人员退场配置信息", notes = "保存人员退场配置信息", httpMethod = "POST") + @PostMapping(value = "/save") + public Result saveConfig(@RequestBody @Validate WorkerExitConfigDto workerExitConfigDto) { + WorkerExitConfig db = workerExitConfigService.getOne(new LambdaQueryWrapper() + .eq(WorkerExitConfig::getProjectSn, workerExitConfigDto.getProjectSn())); + if (db == null) { + workerExitConfigService.add(workerExitConfigDto); + } else { + workerExitConfigDto.setId(db.getId()); + workerExitConfigService.updateById(workerExitConfigDto); + } + return Result.ok(); + } +} diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/controller/WorkerInfoController.java b/src/main/java/com/zhgd/xmgl/modules/worker/controller/WorkerInfoController.java index 9ceca139b..bd0506ef5 100644 --- a/src/main/java/com/zhgd/xmgl/modules/worker/controller/WorkerInfoController.java +++ b/src/main/java/com/zhgd/xmgl/modules/worker/controller/WorkerInfoController.java @@ -198,6 +198,7 @@ public class WorkerInfoController { @ApiImplicitParam(name = "workerTypeId", value = "工种id", paramType = "body", required = false, dataType = "String"), @ApiImplicitParam(name = "exitDate_begin", value = "进场日期开始yyyy-MM-dd", paramType = "body", required = false, dataType = "String"), @ApiImplicitParam(name = "exitDate_end", value = "进场日期结束yyyy-MM-dd", paramType = "body", required = false, dataType = "String"), + @ApiImplicitParam(name = "containEnterpriseId", value = "包含下级的单位的人员的单位id", paramType = "body", required = false, dataType = "String"), }) @PostMapping(value = "/selectWorkerInfoList") public Result> selectWorkerInfoList(@RequestBody Map map) { @@ -210,6 +211,7 @@ public class WorkerInfoController { @ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"), @ApiImplicitParam(name = "projectSnList", value = "项目SN列表", paramType = "body", required = false, dataType = "String"), @ApiImplicitParam(name = "userEnterpriseId", value = "用户能查看的企业", paramType = "body", required = false, dataType = "String"), + @ApiImplicitParam(name = "containEnterpriseId", value = "包含下级的单位的人员的单位id", paramType = "body", required = false, dataType = "String"), }) @PostMapping("/selectPersonTypeAndEduStatistics") public Result selectPersonTypeAndEduStatistics(@RequestBody Map map) { diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/controller/WorkerTypeController.java b/src/main/java/com/zhgd/xmgl/modules/worker/controller/WorkerTypeController.java index 7d9e2c2d2..9a403da51 100644 --- a/src/main/java/com/zhgd/xmgl/modules/worker/controller/WorkerTypeController.java +++ b/src/main/java/com/zhgd/xmgl/modules/worker/controller/WorkerTypeController.java @@ -19,9 +19,10 @@ import org.springframework.web.bind.annotation.RestController; import java.util.List; import java.util.Map; +import java.util.Objects; - /** +/** * @Title: Controller * @Description: 工种 * @author: pds @@ -43,13 +44,18 @@ public class WorkerTypeController { @ApiOperation(value = "列表查询工种信息", notes = "列表查询工种信息", httpMethod = "POST") @ApiImplicitParams({ @ApiImplicitParam(name = "projectSn", value = "一级公司sn", paramType = "body", required = true, dataType = "String"), + @ApiImplicitParam(name = "isSpecial", value = "1是特殊工种,0不是", paramType = "body", required = false, dataType = "String"), }) @PostMapping(value = "/list") public Result> queryPageList(@RequestBody Map map) { Result> result = new Result>(); QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().eq(WorkerType::getProjectSn, MapUtils.getString(map,"projectSn")); - List pageList = workerTypeService.list(queryWrapper); + queryWrapper.lambda().eq(WorkerType::getProjectSn, MapUtils.getString(map, "projectSn")); + Integer isSpecial = MapUtils.getInteger(map, "isSpecial"); + if (Objects.nonNull(isSpecial)) { + queryWrapper.lambda().eq(WorkerType::getIsSpecial, isSpecial); + } + List pageList = workerTypeService.list(queryWrapper); result.setSuccess(true); result.setResult(pageList); return result; diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/entity/WorkerExitConfig.java b/src/main/java/com/zhgd/xmgl/modules/worker/entity/WorkerExitConfig.java new file mode 100644 index 000000000..c8f7b55f6 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/worker/entity/WorkerExitConfig.java @@ -0,0 +1,88 @@ +package com.zhgd.xmgl.modules.worker.entity; + +import java.io.Serializable; +import java.util.Date; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * @Description: 人员退场配置 + * @author: pds + * @date: 2025-08-20 + * @version: V1.0 + */ +@Data +@TableName("worker_exit_config") +@ApiModel(value = "WorkerExitConfig实体类", description = "WorkerExitConfig") +public class WorkerExitConfig implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 主键id + */ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键id") + private java.lang.Long id; + /** + * 是否开启退成配置 + */ + @ApiModelProperty(value = "是否开启退成配置") + private java.lang.Integer enable; + /** + * 企业ids(多个,分割) + */ + @ApiModelProperty(value = "企业ids(多个,分割)") + private java.lang.String enterpriseIds; + /** + * 班组ids(多个,分割) + */ + @ApiModelProperty(value = "班组ids(多个,分割)") + private java.lang.String teamIds; + /** + * 部门ids(多个,分割) + */ + @ApiModelProperty(value = "部门ids(多个,分割)") + private java.lang.String departmentIds; + /** + * 人员ids(多个,分割) + */ + @ApiModelProperty(value = "人员ids(多个,分割)") + private java.lang.String workerIds; + /** + * 人员未打卡超过n天系统自动将人员退场 + */ + @ApiModelProperty(value = "人员未打卡超过n天系统自动将人员退场") + private java.lang.Integer exitIfAbsenceDay; + /** + * 是否将此处退场人员拉入黑名库1是0否 + */ + @ApiModelProperty(value = "是否将此处退场人员拉入黑名库1是0否") + private java.lang.Integer enableBlack; + /** + * 创建时间 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建时间") + private java.util.Date createTime; + /** + * 更新时间 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新时间") + private java.util.Date updateTime; + /** + * 所属项目SN + */ + @ApiModelProperty(value = "所属项目SN") + private java.lang.String projectSn; +} diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/entity/WorkerType.java b/src/main/java/com/zhgd/xmgl/modules/worker/entity/WorkerType.java index ef5c1ed78..8700ed513 100644 --- a/src/main/java/com/zhgd/xmgl/modules/worker/entity/WorkerType.java +++ b/src/main/java/com/zhgd/xmgl/modules/worker/entity/WorkerType.java @@ -1,16 +1,14 @@ package com.zhgd.xmgl.modules.worker.entity; -import java.io.Serializable; - import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import lombok.Data; -import org.jeecgframework.poi.excel.annotation.Excel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.jeecgframework.poi.excel.annotation.Excel; + +import java.io.Serializable; /** * @Description: 工种 * @author: pds @@ -22,17 +20,27 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(value="WorkerType实体类",description="WorkerType") public class WorkerType implements Serializable { private static final long serialVersionUID = 1L; - + /**工种信息表*/ @TableId(type = IdType.ASSIGN_ID) - @ApiModelProperty(value="工种信息表") - private java.lang.Long id ; - /**工种名称*/ - @Excel(name = "工种名称", width = 15) - @ApiModelProperty(value="工种名称") - private java.lang.String typeName ; - /**项目SN*/ - @Excel(name = "项目SN", width = 15) - @ApiModelProperty(value="项目SN") - private java.lang.String projectSn ; + @ApiModelProperty(value = "工种信息表") + private java.lang.Long id; + /** + * 工种名称 + */ + @Excel(name = "工种名称", width = 15) + @ApiModelProperty(value = "工种名称") + private java.lang.String typeName; + /** + * 项目SN + */ + @Excel(name = "项目SN", width = 15) + @ApiModelProperty(value = "项目SN") + private java.lang.String projectSn; + /** + * 1是特殊工种,0不是 + */ + @Excel(name = "1是特殊工种,0不是", width = 15) + @ApiModelProperty(value = "1是特殊工种,0不是") + private java.lang.Integer isSpecial; } diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/entity/dto/WorkerExitConfigDto.java b/src/main/java/com/zhgd/xmgl/modules/worker/entity/dto/WorkerExitConfigDto.java new file mode 100644 index 000000000..876981081 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/worker/entity/dto/WorkerExitConfigDto.java @@ -0,0 +1,11 @@ +package com.zhgd.xmgl.modules.worker.entity.dto; + +import com.zhgd.xmgl.modules.worker.entity.WorkerExitConfig; +import io.swagger.annotations.ApiModel; +import lombok.Data; + +@Data +@ApiModel(value = "WorkerExitConfigDto实体类", description = "WorkerExitConfigDto实体类") +public class WorkerExitConfigDto extends WorkerExitConfig { + +} diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/entity/vo/CountByEnterpriseVo.java b/src/main/java/com/zhgd/xmgl/modules/worker/entity/vo/CountByEnterpriseVo.java new file mode 100644 index 000000000..2ecf12d9a --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/worker/entity/vo/CountByEnterpriseVo.java @@ -0,0 +1,24 @@ +package com.zhgd.xmgl.modules.worker.entity.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class CountByEnterpriseVo { + /** + * 单位名称 + */ + @ApiModelProperty("单位名称") + private String enterpriseName; + /** + * 所属企业表外键ID + */ + @ApiModelProperty(value = "所属企业表外键ID") + private Long enterpriseId; + /** + * 人员出勤数量 + */ + @ApiModelProperty("人员出勤数量") + private Integer workerCount; + private String ancestors; +} diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/entity/vo/CountNumByWorkerTypeVo.java b/src/main/java/com/zhgd/xmgl/modules/worker/entity/vo/CountNumByWorkerTypeVo.java new file mode 100644 index 000000000..4c3b61572 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/worker/entity/vo/CountNumByWorkerTypeVo.java @@ -0,0 +1,30 @@ +package com.zhgd.xmgl.modules.worker.entity.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class CountNumByWorkerTypeVo { + /** + * 在职人数 + */ + @ApiModelProperty("在职人数") + private Integer inServe; + /** + * 出勤人数 + */ + @ApiModelProperty("出勤人数") + private Integer attendance; + /** + * 出勤率 + */ + @ApiModelProperty("出勤率") + private BigDecimal attendanceRate; + /** + * 工种名称 + */ + @ApiModelProperty("工种名称") + private String typeName; +} diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/entity/vo/WorkerExitConfigVo.java b/src/main/java/com/zhgd/xmgl/modules/worker/entity/vo/WorkerExitConfigVo.java new file mode 100644 index 000000000..aa1c9f77d --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/worker/entity/vo/WorkerExitConfigVo.java @@ -0,0 +1,11 @@ +package com.zhgd.xmgl.modules.worker.entity.vo; + +import com.zhgd.xmgl.modules.worker.entity.WorkerExitConfig; +import io.swagger.annotations.ApiModel; +import lombok.Data; + +@Data +@ApiModel(value = "WorkerExitConfigVo实体类", description = "WorkerExitConfigVo实体类") +public class WorkerExitConfigVo extends WorkerExitConfig { + +} diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/mapper/WorkerDailyAttendanceStatisticsV2Mapper.java b/src/main/java/com/zhgd/xmgl/modules/worker/mapper/WorkerDailyAttendanceStatisticsV2Mapper.java index 70bee5431..5e63ef9a7 100644 --- a/src/main/java/com/zhgd/xmgl/modules/worker/mapper/WorkerDailyAttendanceStatisticsV2Mapper.java +++ b/src/main/java/com/zhgd/xmgl/modules/worker/mapper/WorkerDailyAttendanceStatisticsV2Mapper.java @@ -7,9 +7,7 @@ import com.baomidou.mybatisplus.core.toolkit.Constants; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.zhgd.xmgl.modules.worker.entity.WorkerDailyAttendanceStatisticsV2; import com.zhgd.xmgl.modules.worker.entity.bo.CountWorkerDailyAttendanceStatisticsV2ByDateBo; -import com.zhgd.xmgl.modules.worker.entity.vo.CountWorkerDailyAttendanceByDateVo; -import com.zhgd.xmgl.modules.worker.entity.vo.CountWorkerDailyAttendanceStatisticsV2Vo; -import com.zhgd.xmgl.modules.worker.entity.vo.WorkerDailyAttendanceStatisticsV2Vo; +import com.zhgd.xmgl.modules.worker.entity.vo.*; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -72,4 +70,13 @@ public interface WorkerDailyAttendanceStatisticsV2Mapper extends BaseMapper countWorkerDailyAttendanceByDate(HashMap param); + /** + * 统计每个企业的出勤人员数量 + * + * @param param + * @return + */ + List countNumByEnterprise(HashMap param); + + List countNumByWorkerType(HashMap param); } diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/mapper/WorkerExitConfigMapper.java b/src/main/java/com/zhgd/xmgl/modules/worker/mapper/WorkerExitConfigMapper.java new file mode 100644 index 000000000..c654768e9 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/worker/mapper/WorkerExitConfigMapper.java @@ -0,0 +1,53 @@ +package com.zhgd.xmgl.modules.worker.mapper; + +import java.util.List; +import java.util.HashMap; + +import com.zhgd.xmgl.modules.worker.entity.WorkerExitConfig; +import com.zhgd.xmgl.modules.worker.entity.vo.WorkerExitConfigVo; +import com.zhgd.xmgl.modules.worker.entity.dto.WorkerExitConfigDto; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 人员退场配置 + * @author: pds + * @date: 2025-08-20 + * @version: V1.0 + */ +@Mapper +public interface WorkerExitConfigMapper extends BaseMapper { + + /** + * 分页列表查询人员退场配置信息 + * + * @param page + * @param queryWrapper + * @param param + * @return + */ + IPage queryList(Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper, @Param("param") HashMap param); + + /** + * 列表查询人员退场配置信息 + * + * @param queryWrapper + * @param param + * @return + */ + List queryList(@Param(Constants.WRAPPER) QueryWrapper queryWrapper, @Param("param") HashMap param); + + + /** + * 通过id查询人员退场配置信息 + * + * @param id + * @return + */ + WorkerExitConfigVo queryById(String id); +} diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/TeamInfoMapper.xml b/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/TeamInfoMapper.xml index 6b075f905..cc0699646 100644 --- a/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/TeamInfoMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/TeamInfoMapper.xml @@ -5,15 +5,36 @@ + + + + diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/WorkerExitConfigMapper.xml b/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/WorkerExitConfigMapper.xml new file mode 100644 index 000000000..98d67da48 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/WorkerExitConfigMapper.xml @@ -0,0 +1,18 @@ + + + + + + diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/WorkerInfoMapper.xml b/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/WorkerInfoMapper.xml index 4e9fbccc0..b2529f82f 100644 --- a/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/WorkerInfoMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/WorkerInfoMapper.xml @@ -511,6 +511,11 @@ AND (w1.enterprise_id = #{supplierEnterpriseId} OR w1.enterprise_id IN ( SELECT t.enterprise_id FROM project_enterprise t WHERE find_in_set(#{projectEnterpriseId}, ancestors) )) + + and (w1.enterprise_id = #{containEnterpriseId} OR w1.enterprise_id IN ( SELECT t.enterprise_id FROM + project_enterprise t WHERE find_in_set((select id from project_enterprise where enterprise_id = + #{containEnterpriseId} and project_sn = #{projectSn}), ancestors))) + @@ -1157,6 +1167,11 @@ and FIND_IN_SET(w1.enterprise_id, #{userEnterpriseId}) + + and (w1.enterprise_id = #{containEnterpriseId} OR w1.enterprise_id IN ( SELECT t.enterprise_id FROM + project_enterprise t WHERE find_in_set((select id from project_enterprise where enterprise_id = + #{containEnterpriseId} and project_sn = #{projectSn}), ancestors))) + ) tp diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/WorkerSafeEducationMapper.xml b/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/WorkerSafeEducationMapper.xml index 1b269879c..a22f01d1e 100644 --- a/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/WorkerSafeEducationMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/WorkerSafeEducationMapper.xml @@ -181,6 +181,11 @@ and FIND_IN_SET(w3.enterprise_id, #{userEnterpriseId}) + + and (w3.enterprise_id = #{containEnterpriseId} OR w3.enterprise_id IN ( SELECT t.enterprise_id FROM + project_enterprise t WHERE find_in_set((select id from project_enterprise where enterprise_id = + #{containEnterpriseId} and project_sn = #{projectSn}), ancestors))) + diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/service/IWorkerDailyAttendanceStatisticsV2Service.java b/src/main/java/com/zhgd/xmgl/modules/worker/service/IWorkerDailyAttendanceStatisticsV2Service.java index 68fe502b8..6cb12645a 100644 --- a/src/main/java/com/zhgd/xmgl/modules/worker/service/IWorkerDailyAttendanceStatisticsV2Service.java +++ b/src/main/java/com/zhgd/xmgl/modules/worker/service/IWorkerDailyAttendanceStatisticsV2Service.java @@ -98,4 +98,7 @@ public interface IWorkerDailyAttendanceStatisticsV2Service extends IService countWorkerDailyAttendanceByDate(HashMap param); + List countNumByEnterprise(HashMap param); + + List countNumByWorkerType(HashMap param); } diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/service/IWorkerExitConfigService.java b/src/main/java/com/zhgd/xmgl/modules/worker/service/IWorkerExitConfigService.java new file mode 100644 index 000000000..dec606282 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/worker/service/IWorkerExitConfigService.java @@ -0,0 +1,67 @@ +package com.zhgd.xmgl.modules.worker.service; + +import com.zhgd.xmgl.modules.worker.entity.WorkerExitConfig; +import com.zhgd.xmgl.modules.worker.entity.vo.WorkerExitConfigVo; +import com.zhgd.xmgl.modules.worker.entity.dto.WorkerExitConfigDto; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.util.HashMap; +import java.util.List; + +/** + * @Description: 人员退场配置 + * @author: pds + * @date: 2025-08-20 + * @version: V1.0 + */ +public interface IWorkerExitConfigService extends IService { + /** + * 分页列表查询人员退场配置信息 + * + * @param param 参数map + * @return + */ + IPage queryPageList(HashMap param); + + /** + * 列表查询人员退场配置信息 + * + * @param param 参数map + * @return + */ + List queryList(HashMap param); + + /** + * 添加人员退场配置信息 + * + * @param workerExitConfigDto 人员退场配置 + * @return + */ + void add(WorkerExitConfigDto workerExitConfigDto); + + /** + * 编辑人员退场配置信息 + * + * @param workerExitConfigDto 人员退场配置 + * @return + */ + void edit(WorkerExitConfigDto workerExitConfigDto); + + /** + * 根据id删除人员退场配置信息 + * + * @param id 人员退场配置的id + * @return + */ + void delete(String id); + + /** + * 根据id查询人员退场配置信息 + * + * @param id 人员退场配置的id + * @return + */ + WorkerExitConfigVo queryById(String id); + +} diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/service/impl/WorkerDailyAttendanceStatisticsV2ServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/worker/service/impl/WorkerDailyAttendanceStatisticsV2ServiceImpl.java index adf9ff640..4d7f22df1 100644 --- a/src/main/java/com/zhgd/xmgl/modules/worker/service/impl/WorkerDailyAttendanceStatisticsV2ServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/worker/service/impl/WorkerDailyAttendanceStatisticsV2ServiceImpl.java @@ -14,17 +14,14 @@ import com.zhgd.jeecg.common.execption.OpenAlertException; import com.zhgd.jeecg.common.system.query.QueryGenerator; import com.zhgd.xmgl.base.entity.vo.echarts.ChartDataVo; import com.zhgd.xmgl.base.entity.vo.echarts.SeriesItem; -import com.zhgd.xmgl.modules.worker.entity.WorkerAttendance; -import com.zhgd.xmgl.modules.worker.entity.WorkerAttendanceRuleV2; -import com.zhgd.xmgl.modules.worker.entity.WorkerDailyAttendanceStatisticsV2; -import com.zhgd.xmgl.modules.worker.entity.WorkerInfo; +import com.zhgd.xmgl.modules.project.entity.ProjectEnterprise; +import com.zhgd.xmgl.modules.project.service.IProjectEnterpriseService; +import com.zhgd.xmgl.modules.worker.entity.*; import com.zhgd.xmgl.modules.worker.entity.bo.CalAttendanceBo; import com.zhgd.xmgl.modules.worker.entity.bo.CountWorkerDailyAttendanceStatisticsV2ByDateBo; import com.zhgd.xmgl.modules.worker.entity.bo.Hour2dayJsonBo; import com.zhgd.xmgl.modules.worker.entity.dto.WorkerDailyAttendanceStatisticsV2Dto; -import com.zhgd.xmgl.modules.worker.entity.vo.CountWorkerDailyAttendanceByDateVo; -import com.zhgd.xmgl.modules.worker.entity.vo.CountWorkerDailyAttendanceStatisticsV2Vo; -import com.zhgd.xmgl.modules.worker.entity.vo.WorkerDailyAttendanceStatisticsV2Vo; +import com.zhgd.xmgl.modules.worker.entity.vo.*; import com.zhgd.xmgl.modules.worker.mapper.WorkerDailyAttendanceStatisticsV2Mapper; import com.zhgd.xmgl.modules.worker.service.IWorkerAttendanceRuleV2Service; import com.zhgd.xmgl.modules.worker.service.IWorkerAttendanceService; @@ -64,6 +61,12 @@ public class WorkerDailyAttendanceStatisticsV2ServiceImpl extends ServiceImpl countNumByEnterprise(HashMap param) { + String projectSn = MapUtils.getString(param, "projectSn"); + Long parentEnterpriseId = MapUtils.getLong(param, "parentEnterpriseId"); + Integer isSecondLevel = MapUtils.getInteger(param, "isSecondLevel"); + LambdaQueryWrapper peWrap = new LambdaQueryWrapper() + .eq(ProjectEnterprise::getProjectSn, projectSn); + List eids = projectEnterpriseService.list(peWrap).stream().filter(projectEnterprise -> { + if (Objects.nonNull(parentEnterpriseId)) { + return Objects.equals(parentEnterpriseId, projectEnterprise.getEnterpriseId()); + } + if (Objects.equals(isSecondLevel, 1)) { + return StrUtil.split(projectEnterprise.getAncestors(), ",").size() == 2; + } + return true; + }).map(ProjectEnterprise::getEnterpriseId).collect(Collectors.toList()); + eids.add(0L); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper(); + queryWrapper.in(EnterpriseInfo::getId, eids); + List enterpriseInfos = enterpriseInfoService.list(queryWrapper); + List vos = baseMapper.countNumByEnterprise(param); + return enterpriseInfos.stream().map(ei -> { + int workerCount = vos.stream().filter(v -> Objects.nonNull(v.getAncestors()) && v.getAncestors().contains(ei.getId() + "")).mapToInt(CountByEnterpriseVo::getWorkerCount).sum(); + CountByEnterpriseVo vo = new CountByEnterpriseVo(); + vo.setEnterpriseName(ei.getEnterpriseName()); + vo.setWorkerCount(workerCount); + return vo; + }).collect(Collectors.toList()); + } + + @Override + public List countNumByWorkerType(HashMap param) { + return baseMapper.countNumByWorkerType(param); + } + } diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/service/impl/WorkerExitConfigServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/worker/service/impl/WorkerExitConfigServiceImpl.java new file mode 100644 index 000000000..b79f47daf --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/worker/service/impl/WorkerExitConfigServiceImpl.java @@ -0,0 +1,93 @@ +package com.zhgd.xmgl.modules.worker.service.impl; + +import com.zhgd.jeecg.common.execption.OpenAlertException; +import com.zhgd.xmgl.modules.worker.entity.WorkerExitConfig; +import com.zhgd.xmgl.modules.worker.entity.vo.WorkerExitConfigVo; +import com.zhgd.xmgl.modules.worker.entity.dto.WorkerExitConfigDto; +import com.zhgd.xmgl.modules.worker.mapper.WorkerExitConfigMapper; +import com.zhgd.xmgl.modules.worker.service.IWorkerExitConfigService; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.zhgd.jeecg.common.system.query.QueryGenerator; +import com.zhgd.xmgl.util.PageUtil; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +import java.util.HashMap; +import java.util.List; + +import com.zhgd.xmgl.util.RefUtil; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * @Description: 人员退场配置 + * @author: pds + * @date: 2025-08-20 + * @version: V1.0 + */ +@Service +public class WorkerExitConfigServiceImpl extends ServiceImpl implements IWorkerExitConfigService { + @Autowired + private WorkerExitConfigMapper workerExitConfigMapper; + + @Override + public IPage queryPageList(HashMap param) { + QueryWrapper queryWrapper = this.getQueryWrapper(param); + Page page = PageUtil.getPage(param); + IPage pageList = baseMapper.queryList(page, queryWrapper, param); + pageList.setRecords(this.dealList(pageList.getRecords())); + return pageList; + } + + @Override + public List queryList(HashMap param) { + QueryWrapper queryWrapper = getQueryWrapper(param); + return dealList(baseMapper.queryList(queryWrapper, param)); + } + + private QueryWrapper getQueryWrapper(HashMap param) { + QueryWrapper queryWrapper = QueryGenerator.initPageQueryWrapper(WorkerExitConfigVo.class, param, true); + queryWrapper.orderByDesc(RefUtil.fieldNameUlc(WorkerExitConfigVo::getId)); + return queryWrapper; + } + + private List dealList(List list) { + return list; + } + + @Override + public void add(WorkerExitConfigDto workerExitConfigDto) { + workerExitConfigDto.setId(null); + baseMapper.insert(workerExitConfigDto); + } + + @Override + public void edit(WorkerExitConfigDto workerExitConfigDto) { + WorkerExitConfig oldWorkerExitConfig = baseMapper.selectById(workerExitConfigDto.getId()); + if (oldWorkerExitConfig == null) { + throw new OpenAlertException("未找到对应实体"); + } + baseMapper.updateById(workerExitConfigDto); + } + + @Override + public void delete(String id) { + WorkerExitConfig workerExitConfig = baseMapper.selectById(id); + if (workerExitConfig == null) { + throw new OpenAlertException("未找到对应实体"); + } + baseMapper.deleteById(id); + } + + @Override + public WorkerExitConfigVo queryById(String id) { + WorkerExitConfigVo entity = baseMapper.queryById(id); + if (entity == null) { + throw new OpenAlertException("未找到对应实体"); + } + return entity; + } + +} diff --git a/src/main/resources/excel/workerDailyAttendanceStatisticsV2/单个人员考勤出入明细报表.xlsx b/src/main/resources/excel/workerDailyAttendanceStatisticsV2/单个人员考勤出入明细报表.xlsx new file mode 100644 index 000000000..73d137584 Binary files /dev/null and b/src/main/resources/excel/workerDailyAttendanceStatisticsV2/单个人员考勤出入明细报表.xlsx differ diff --git a/src/main/resources/excel/workerDailyAttendanceStatisticsV2/考勤月报-按班组-每日出入(打卡记录明细).xlsx b/src/main/resources/excel/workerDailyAttendanceStatisticsV2/考勤月报-按班组-每日出入(打卡记录明细).xlsx new file mode 100644 index 000000000..68f03c877 Binary files /dev/null and b/src/main/resources/excel/workerDailyAttendanceStatisticsV2/考勤月报-按班组-每日出入(打卡记录明细).xlsx differ diff --git a/src/main/resources/excel/考勤日报-出勤导出模版(上午下午).xlsx b/src/main/resources/excel/考勤日报-出勤导出模版(上午下午).xlsx index 0b3365556..a1c392ea3 100644 Binary files a/src/main/resources/excel/考勤日报-出勤导出模版(上午下午).xlsx and b/src/main/resources/excel/考勤日报-出勤导出模版(上午下午).xlsx differ