人员退场设置和bug修复
This commit is contained in:
parent
31d2d1bdf2
commit
e6ae6c94e0
@ -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<Map<String,Object>> getTeamInfoList(@RequestBody Map<String,Object> map) {
|
||||
return Result.success(teamInfoService.getTeamInfoList(map));
|
||||
|
||||
@ -181,6 +181,17 @@ public class WorkerDailyAttendanceStatisticsV2Controller {
|
||||
})
|
||||
@GetMapping(value = "/countDailyAttendanceByDateRange")
|
||||
public Result<IPage<StatisticsListVo>> countDailyAttendanceByDateRange(@ApiIgnore @RequestParam HashMap<String, Object> param) {
|
||||
IPage<StatisticsListVo> p = doCountDailyAttendanceByDateRange(param);
|
||||
return Result.success(p);
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计考勤列表(一段时间)
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
private IPage<StatisticsListVo> doCountDailyAttendanceByDateRange(HashMap<String, Object> 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<List<CountByEnterpriseVo>> countNumByEnterprise(@RequestBody HashMap<String, Object> 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<List<CountNumByWorkerTypeVo>> countNumByWorkerType(@RequestBody HashMap<String, Object> 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<String, Object> 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<DateTime> dateTimes = DateUtil.rangeToList(DateUtil.parseDate(startDate), DateUtil.parseDate(endDate), DateField.DAY_OF_YEAR);
|
||||
// Map<Integer, Map<String, Object>> 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<StatisticsListVo> voList = this.doCountDailyAttendanceByDateRange(param).getRecords();
|
||||
// Map<String, List<StatisticsListVo>> deptNameMap = voList.stream().collect(Collectors.groupingBy(StatisticsListVo::getDeptName));
|
||||
// Map<String, Object> sheetMap = new HashMap<>();
|
||||
// List<Map<String, Object>> listMap = new ArrayList<>();
|
||||
// for (Map.Entry<String, List<StatisticsListVo>> entry : deptNameMap.entrySet()) {
|
||||
// int j = 0;
|
||||
// for (StatisticsListVo vo : entry.getValue()) {
|
||||
// Map<String, Object> 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<WorkerDailyAttendancesByDateVo> records = doGetWorkerDailyAttendancePageByDateVoIPage(param).getRecords();
|
||||
// Map<String, Object> sheetMap = new HashMap<>();
|
||||
// List<Map<String, Object>> listMap = new ArrayList<>();
|
||||
// for (WorkerDailyAttendancesByDateVo vo : records) {
|
||||
// Map<String, Object> 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);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@ -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<IPage<WorkerExitConfigVo>> queryPageList(@ApiIgnore @RequestParam HashMap<String, Object> param) {
|
||||
return Result.success(workerExitConfigService.queryPageList(param));
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "人员退场配置管理", operType = "列表查询", operDesc = "列表查询人员退场配置信息")
|
||||
@ApiOperation(value = "列表查询人员退场配置信息", notes = "列表查询人员退场配置信息", httpMethod = "GET")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<WorkerExitConfigVo>> queryList(@ApiIgnore @RequestParam HashMap<String, Object> param) {
|
||||
return Result.success(workerExitConfigService.queryList(param));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param workerExitConfigDto
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "人员退场配置管理", operType = "添加", operDesc = "添加人员退场配置信息")
|
||||
@ApiOperation(value = "添加人员退场配置信息", notes = "添加人员退场配置信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<WorkerExitConfigVo> 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<WorkerExitConfig> 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<WorkerExitConfig> delete(@ApiIgnore @RequestBody HashMap<String, Object> 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<WorkerExitConfigVo> 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<WorkerExitConfigVo> saveConfig(@RequestBody @Validate WorkerExitConfigDto workerExitConfigDto) {
|
||||
WorkerExitConfig db = workerExitConfigService.getOne(new LambdaQueryWrapper<WorkerExitConfig>()
|
||||
.eq(WorkerExitConfig::getProjectSn, workerExitConfigDto.getProjectSn()));
|
||||
if (db == null) {
|
||||
workerExitConfigService.add(workerExitConfigDto);
|
||||
} else {
|
||||
workerExitConfigDto.setId(db.getId());
|
||||
workerExitConfigService.updateById(workerExitConfigDto);
|
||||
}
|
||||
return Result.ok();
|
||||
}
|
||||
}
|
||||
@ -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<IPage<WorkerInfo>> selectWorkerInfoList(@RequestBody Map<String, Object> 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<PersonTypeAndEduStatisticsVo> selectPersonTypeAndEduStatistics(@RequestBody Map<String, Object> map) {
|
||||
|
||||
@ -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<List<WorkerType>> queryPageList(@RequestBody Map<String, Object> map) {
|
||||
Result<List<WorkerType>> result = new Result<List<WorkerType>>();
|
||||
QueryWrapper<WorkerType> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(WorkerType::getProjectSn, MapUtils.getString(map,"projectSn"));
|
||||
List<WorkerType> 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<WorkerType> pageList = workerTypeService.list(queryWrapper);
|
||||
result.setSuccess(true);
|
||||
result.setResult(pageList);
|
||||
return result;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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 {
|
||||
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
@ -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 {
|
||||
|
||||
}
|
||||
@ -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<Work
|
||||
*/
|
||||
List<CountWorkerDailyAttendanceByDateVo> countWorkerDailyAttendanceByDate(HashMap<String, Object> param);
|
||||
|
||||
/**
|
||||
* 统计每个企业的出勤人员数量
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<CountByEnterpriseVo> countNumByEnterprise(HashMap<String, Object> param);
|
||||
|
||||
List<CountNumByWorkerTypeVo> countNumByWorkerType(HashMap<String, Object> param);
|
||||
}
|
||||
|
||||
@ -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<WorkerExitConfig> {
|
||||
|
||||
/**
|
||||
* 分页列表查询人员退场配置信息
|
||||
*
|
||||
* @param page
|
||||
* @param queryWrapper
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
IPage<WorkerExitConfigVo> queryList(Page<WorkerExitConfigVo> page, @Param(Constants.WRAPPER) QueryWrapper<WorkerExitConfigVo> queryWrapper, @Param("param") HashMap<String, Object> param);
|
||||
|
||||
/**
|
||||
* 列表查询人员退场配置信息
|
||||
*
|
||||
* @param queryWrapper
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<WorkerExitConfigVo> queryList(@Param(Constants.WRAPPER) QueryWrapper<WorkerExitConfigVo> queryWrapper, @Param("param") HashMap<String, Object> param);
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询人员退场配置信息
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
WorkerExitConfigVo queryById(String id);
|
||||
}
|
||||
@ -5,15 +5,36 @@
|
||||
<select id="getTeamInfoList" resultType="com.zhgd.xmgl.modules.worker.entity.TeamInfo" parameterType="map">
|
||||
SELECT a.*,IFNULL(b.worker_num,0) worker_num
|
||||
from team_info a LEFT JOIN
|
||||
(SELECT team_id,COUNT(1) worker_num FROM worker_info
|
||||
WHERE project_sn=#{projectSn}
|
||||
<if test="enterpriseId!=null and enterpriseId!=''">
|
||||
and enterprise_id=#{enterpriseId}
|
||||
(SELECT wi.team_id,COUNT(1) worker_num
|
||||
FROM worker_info wi
|
||||
join team_info ti on ti.id=wi.team_id
|
||||
join worker_type wt on wt.id=ti.worker_type_id
|
||||
WHERE wi.project_sn=#{projectSn}
|
||||
<if test="enterpriseId != null and enterpriseId != ''">
|
||||
and wi.enterprise_id=#{enterpriseId}
|
||||
</if>
|
||||
and person_type=1
|
||||
group by team_id
|
||||
<if test="isSpecial != null and isSpecial != ''">
|
||||
and wt.is_special = #{isSpecial}
|
||||
</if>
|
||||
<if test="workerTypeId != null and workerTypeId != ''">
|
||||
and wt.id = #{workerTypeId}
|
||||
</if>
|
||||
and wi.person_type=1
|
||||
group by wi.team_id
|
||||
) b ON a.id=b.team_id
|
||||
join worker_type wt on wt.id=a.worker_type_id
|
||||
WHERE a.project_sn=#{projectSn}
|
||||
<if test="containEnterpriseId != null and containEnterpriseId != '' and projectSn != null and projectSn != ''">
|
||||
and (a.enterprise_id = #{containEnterpriseId} OR a.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)))
|
||||
</if>
|
||||
<if test="isSpecial != null and isSpecial != ''">
|
||||
and wt.is_special = #{isSpecial}
|
||||
</if>
|
||||
<if test="workerTypeId != null and workerTypeId != ''">
|
||||
and wt.id = #{workerTypeId}
|
||||
</if>
|
||||
<if test="enterpriseId != null and enterpriseId != ''">
|
||||
and a.enterprise_id=#{enterpriseId}
|
||||
</if>
|
||||
|
||||
@ -186,4 +186,57 @@
|
||||
</if>
|
||||
group by date
|
||||
</select>
|
||||
|
||||
<select id="countNumByEnterprise" resultType="com.zhgd.xmgl.modules.worker.entity.vo.CountByEnterpriseVo">
|
||||
select
|
||||
en.id as enterprise_id
|
||||
,pe.ancestors
|
||||
,en.enterprise_name
|
||||
,ifnull(sum(t.is_attendance),0) as worker_count
|
||||
from worker_daily_attendance_statistics_v2 t
|
||||
JOIN worker_info a on t.person_sn=a.person_sn
|
||||
JOIN team_info b ON a.team_id = b.id and a.person_type = 1
|
||||
JOIN department_info c ON a.department_id = c.id and a.person_type = 2
|
||||
JOIN worker_type wt ON b.worker_type_id = wt.id and a.person_type = 1
|
||||
JOIN enterprise_info en ON en.id = a.enterprise_id
|
||||
JOIN project_enterprise pe ON a.id = pe.enterprise_id and pe.project_sn=t.project_sn
|
||||
where t.project_sn=#{projectSn}
|
||||
<if test="personType != null and personType != ''">
|
||||
and a.person_type = #{personType}
|
||||
</if>
|
||||
<if test="startDate != null and startDate != ''">
|
||||
and t.attendance_date >= #{startDate}
|
||||
</if>
|
||||
<if test="endDate != null and endDate != ''">
|
||||
and t.attendance_date <![CDATA[<=]]> concat(#{endDate},' 23:59:59')
|
||||
</if>
|
||||
group by en.id
|
||||
</select>
|
||||
|
||||
<select id="countNumByWorkerType" resultType="com.zhgd.xmgl.modules.worker.entity.vo.CountNumByWorkerTypeVo">
|
||||
select
|
||||
t.*
|
||||
,ifnull(round(t.attendance/t.in_serve*100,2),0) as attendance_rate
|
||||
from (
|
||||
select
|
||||
count(*) as total_in_service_num
|
||||
,wt.type_name
|
||||
,ifnull(sum(t.is_attendance),0) as attendance
|
||||
,ifnull(sum(t.inService_type),0) as in_serve
|
||||
from worker_type wt
|
||||
LEFT JOIN team_info b ON b.worker_type_id = wt.id
|
||||
LEFT JOIN worker_info a ON a.team_id=b.id and a.person_type = 1
|
||||
LEFT JOIN worker_daily_attendance_statistics_v2 t on t.person_sn=a.person_sn
|
||||
<if test="startDate != null and startDate != ''">
|
||||
and t.attendance_date >= #{startDate}
|
||||
</if>
|
||||
<if test="endDate != null and endDate != ''">
|
||||
and t.attendance_date <![CDATA[<=]]> concat(#{endDate},' 23:59:59')
|
||||
</if>
|
||||
where wt.project_sn=#{projectSn}
|
||||
<if test="isSpecial != null and isSpecial != ''">
|
||||
and wt.is_special = #{isSpecial}
|
||||
</if>
|
||||
group by wt.id) t
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zhgd.xmgl.modules.worker.mapper.WorkerExitConfigMapper">
|
||||
<select id="queryList" resultType="com.zhgd.xmgl.modules.worker.entity.vo.WorkerExitConfigVo">
|
||||
select * from (
|
||||
select t.*
|
||||
from worker_exit_config t
|
||||
)t
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
<select id="queryById" resultType="com.zhgd.xmgl.modules.worker.entity.vo.WorkerExitConfigVo">
|
||||
select * from (
|
||||
select t.*
|
||||
from worker_exit_config t
|
||||
)t
|
||||
where t.id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
@ -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) ))
|
||||
</if>
|
||||
<if test="containEnterpriseId != null and containEnterpriseId != '' and projectSn != null and projectSn != ''">
|
||||
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)))
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectExitWorkerPersonTypeTotal" resultType="java.util.Map" parameterType="java.util.Map">
|
||||
@ -567,6 +572,11 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="containEnterpriseId != null and containEnterpriseId != '' and projectSn != null and projectSn != ''">
|
||||
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)))
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@ -1157,6 +1167,11 @@
|
||||
<if test="userEnterpriseId != null and userEnterpriseId != ''">
|
||||
and FIND_IN_SET(w1.enterprise_id, #{userEnterpriseId})
|
||||
</if>
|
||||
<if test="containEnterpriseId != null and containEnterpriseId != '' and projectSn != null and projectSn != ''">
|
||||
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)))
|
||||
</if>
|
||||
</where>
|
||||
) tp
|
||||
</select>
|
||||
|
||||
@ -181,6 +181,11 @@
|
||||
<if test="userEnterpriseId != null and userEnterpriseId != ''">
|
||||
and FIND_IN_SET(w3.enterprise_id, #{userEnterpriseId})
|
||||
</if>
|
||||
<if test="containEnterpriseId != null and containEnterpriseId != '' and projectSn != null and projectSn != ''">
|
||||
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)))
|
||||
</if>
|
||||
</select>
|
||||
<select id="exportExcelWorkerEducation" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
|
||||
</select>
|
||||
|
||||
@ -98,4 +98,7 @@ public interface IWorkerDailyAttendanceStatisticsV2Service extends IService<Work
|
||||
|
||||
List<CountWorkerDailyAttendanceByDateVo> countWorkerDailyAttendanceByDate(HashMap<String, Object> param);
|
||||
|
||||
List<CountByEnterpriseVo> countNumByEnterprise(HashMap<String, Object> param);
|
||||
|
||||
List<CountNumByWorkerTypeVo> countNumByWorkerType(HashMap<String, Object> param);
|
||||
}
|
||||
|
||||
@ -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<WorkerExitConfig> {
|
||||
/**
|
||||
* 分页列表查询人员退场配置信息
|
||||
*
|
||||
* @param param 参数map
|
||||
* @return
|
||||
*/
|
||||
IPage<WorkerExitConfigVo> queryPageList(HashMap<String, Object> param);
|
||||
|
||||
/**
|
||||
* 列表查询人员退场配置信息
|
||||
*
|
||||
* @param param 参数map
|
||||
* @return
|
||||
*/
|
||||
List<WorkerExitConfigVo> queryList(HashMap<String, Object> 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);
|
||||
|
||||
}
|
||||
@ -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<Wo
|
||||
@Autowired
|
||||
@Lazy
|
||||
private IWorkerAttendanceService workerAttendanceService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private EnterpriseInfoServiceImpl enterpriseInfoService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private IProjectEnterpriseService projectEnterpriseService;
|
||||
|
||||
/**
|
||||
* 清洗考勤记录,保留有效的进出对(同一天,连续的进或出,进的记录保留最早的,出的记录保留最晚的)
|
||||
@ -550,4 +553,39 @@ public class WorkerDailyAttendanceStatisticsV2ServiceImpl extends ServiceImpl<Wo
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CountByEnterpriseVo> countNumByEnterprise(HashMap<String, Object> param) {
|
||||
String projectSn = MapUtils.getString(param, "projectSn");
|
||||
Long parentEnterpriseId = MapUtils.getLong(param, "parentEnterpriseId");
|
||||
Integer isSecondLevel = MapUtils.getInteger(param, "isSecondLevel");
|
||||
LambdaQueryWrapper<ProjectEnterprise> peWrap = new LambdaQueryWrapper<ProjectEnterprise>()
|
||||
.eq(ProjectEnterprise::getProjectSn, projectSn);
|
||||
List<Long> 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<EnterpriseInfo> queryWrapper = new LambdaQueryWrapper<EnterpriseInfo>();
|
||||
queryWrapper.in(EnterpriseInfo::getId, eids);
|
||||
List<EnterpriseInfo> enterpriseInfos = enterpriseInfoService.list(queryWrapper);
|
||||
List<CountByEnterpriseVo> 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<CountNumByWorkerTypeVo> countNumByWorkerType(HashMap<String, Object> param) {
|
||||
return baseMapper.countNumByWorkerType(param);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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<WorkerExitConfigMapper, WorkerExitConfig> implements IWorkerExitConfigService {
|
||||
@Autowired
|
||||
private WorkerExitConfigMapper workerExitConfigMapper;
|
||||
|
||||
@Override
|
||||
public IPage<WorkerExitConfigVo> queryPageList(HashMap<String, Object> param) {
|
||||
QueryWrapper<WorkerExitConfigVo> queryWrapper = this.getQueryWrapper(param);
|
||||
Page<WorkerExitConfigVo> page = PageUtil.getPage(param);
|
||||
IPage<WorkerExitConfigVo> pageList = baseMapper.queryList(page, queryWrapper, param);
|
||||
pageList.setRecords(this.dealList(pageList.getRecords()));
|
||||
return pageList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WorkerExitConfigVo> queryList(HashMap<String, Object> param) {
|
||||
QueryWrapper<WorkerExitConfigVo> queryWrapper = getQueryWrapper(param);
|
||||
return dealList(baseMapper.queryList(queryWrapper, param));
|
||||
}
|
||||
|
||||
private QueryWrapper<WorkerExitConfigVo> getQueryWrapper(HashMap<String, Object> param) {
|
||||
QueryWrapper<WorkerExitConfigVo> queryWrapper = QueryGenerator.initPageQueryWrapper(WorkerExitConfigVo.class, param, true);
|
||||
queryWrapper.orderByDesc(RefUtil.fieldNameUlc(WorkerExitConfigVo::getId));
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
private List<WorkerExitConfigVo> dealList(List<WorkerExitConfigVo> 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;
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user