Commit eb6c0e2d authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/MVP1.6.6' into MVP1.6.6

parents a446d73b a0d61ea5
package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 档案完整度监控
*
* @author huyc
* @date 2024-06-17 16:08:58
*/
@Data
@TableName("t_complete_monitor")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "档案完整度监控")
public class TCompleteMonitor extends BaseEntity {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private String id;
@Schema(description = "客户名称")
private String unitName;
@Schema(description = "客户编码")
private String unitNo;
@Schema(description = "项目名称")
private String deptName;
@Schema(description = "项目编码")
private String deptNo;
@Schema(description = "业务类型一级分类")
private String businessPrimaryType;
@Schema(description = "业务类型二级分类")
private String businessSecondType;
@Schema(description = "业务类型三级分类")
private String businessThirdType;
@Schema(description = "在项人数")
private Integer inusePersonNum;
@Schema(description = "信息是否完整 0是 1 否")
private String isComplete;
@Schema(description = "信息不完整人数")
private Integer incompleteNum;
@Schema(description = "完整度占比")
private String completePer;
@Schema(description = "6月及后入职人数")
private Integer afterEmployment;
@Schema(description = "6月及后入职信息是否完整 0是 1 否")
private String afterIsComplete;
@Schema(description = "6月及后入职信息不完整人数")
private Integer afterIncompleteNum;
@Schema(description = "立项申请人")
private String alertUser;
}
...@@ -273,6 +273,13 @@ public class TEmployeeProject extends BaseEntity { ...@@ -273,6 +273,13 @@ public class TEmployeeProject extends BaseEntity {
@Schema(description ="是否删除 0否/1是") @Schema(description ="是否删除 0否/1是")
private String deleteFlag; private String deleteFlag;
/**
* 是否完整 0是 1 否
*/
@Schema(description ="是否完整0是 1 否")
private String isComplete;
/** /**
* 备注 * 备注
*/ */
......
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 档案完整度监控
*
* @author huyc
* @date 2024-06-17 16:08:58
*/
@Data
public class TCompleteMonitorFlagVo implements Serializable {
private String empSex;
private Date validityStart;
private Date validityEnd;
private Date empBirthday;
private Integer empAge;
private String empMarriStatus;
private String empNational;
private String politicalStatus;
private String empPhone;
private String empRegisType;
private Integer fileProvince;
private Integer fileCity;
private Integer isCollege;
private String hignEducation;
private String school;
private String major;
private Date admissionDate;
private Date gradutionDate;
private String contactAddress;
private String firstWorkFlag;
private String haveQualification;
private String deptName;
private String unitName;
private String businessPrimaryType;
private String businessSecondType;
private String businessThirdType;
private String workingHours;
private String tryPeriod;
private Date enjoinDate;
private String post;
private String empProjectId;
private String contactInfoId;
private String disabilityFlag;
private String badRecordFlag;
private String educationFlag;
private String familyFlag;
}
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* 档案完整度监控
*
* @author huyc
* @date 2024-06-17 16:08:58
*/
@Data
public class TCompleteMonitorInfoVo implements Serializable {
@Schema(description = "姓名")
private String empName;
@Schema(description = "身份证号")
private String empIdCard;
@Schema(description = "手机号码")
private String phone;
@Schema(description = "进项目时间")
private LocalDateTime inTime;
@Schema(description = "信息是否完整")
private String isComplete;
@Schema(description = "人员档案id")
private String empInfoId;
}
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TCompleteMonitor;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 档案完整度监控
*
* @author huyc
* @date 2024-06-17 16:08:58
*/
@Data
public class TCompleteMonitorSearchVo extends TCompleteMonitor {
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,多个逗号分割")
private String ids;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
/**
* @Author fxj
* 查询数据起
**/
@Schema(description = "查询limit 开始")
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
private int limitEnd;
}
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 档案完整度监控
*
* @author huyc
* @date 2024-06-17 16:08:58
*/
@Data
public class TCompleteMonitorVo extends RowIndex implements Serializable {
/**
* 客户名称
*/
@Length(max = 50, message = "客户名称 不能超过50 个字符")
@ExcelAttribute(name = "客户名称", maxLength = 50)
@Schema(description = "客户名称")
@ExcelProperty("客户名称")
private String unitName;
/**
* 客户编码
*/
@Length(max = 32, message = "客户编码 不能超过32 个字符")
@ExcelAttribute(name = "客户编码", maxLength = 32)
@Schema(description = "客户编码")
@ExcelProperty("客户编码")
private String unitNo;
/**
* 项目名称
*/
@Length(max = 50, message = "项目名称 不能超过50 个字符")
@ExcelAttribute(name = "项目名称", maxLength = 50)
@Schema(description = "项目名称")
@ExcelProperty("项目名称")
private String deptName;
/**
* 项目编码
*/
@NotBlank(message = "项目编码 不能为空")
@Length(max = 30, message = "项目编码 不能超过30 个字符")
@ExcelAttribute(name = "项目编码", isNotEmpty = true, errorInfo = "项目编码不能为空", maxLength = 30)
@Schema(description = "项目编码")
@ExcelProperty("项目编码")
private String deptNo;
/**
* 业务类型一级分类
*/
@Length(max = 64, message = "业务类型一级分类 不能超过64 个字符")
@ExcelAttribute(name = "业务类型", maxLength = 64)
@Schema(description = "业务类型")
@ExcelProperty("业务类型")
private String businessPrimaryType;
/**
* 在项人数
*/
@ExcelAttribute(name = "在项人数")
@Schema(description = "在项人数")
@ExcelProperty("在项人数")
private Integer inusePersonNum;
/**
* 信息是否完整
*/
@Length(max = 1, message = "信息是否完整 不能超过1 个字符")
@ExcelAttribute(name = "信息是否完整", maxLength = 1, readConverterExp = "0=否,1=是")
@Schema(description = "信息是否完整")
@ExcelProperty("信息是否完整")
private String isComplete;
/**
* 信息不完整人数
*/
@ExcelAttribute(name = "信息不完整人数")
@Schema(description = "信息不完整人数")
@ExcelProperty("信息不完整人数")
private Integer incompleteNum;
/**
* 完整度占比
*/
@Length(max = 8, message = "完整度占比 不能超过8 个字符")
@ExcelAttribute(name = "完整度占比", maxLength = 8)
@Schema(description = "完整度占比")
@ExcelProperty("完整度占比")
private String completePer;
/**
* 6月及后入职人数
*/
@ExcelAttribute(name = "6月及后入职人数")
@Schema(description = "6月及后入职人数")
@ExcelProperty("6月及后入职人数")
private Integer afterEmployment;
/**
* 6月及后入职信息是否完整
*/
@Length(max = 1, message = "6月及后入职信息是否完整 不能超过1 个字符")
@ExcelAttribute(name = "6月及后入职信息是否完整", maxLength = 1, readConverterExp = "0=否,1=是")
@Schema(description = "6月及后入职信息是否完整")
@ExcelProperty("6月及后入职信息是否完整")
private String afterIsComplete;
/**
* 6月及后入职信息不完整人数
*/
@ExcelAttribute(name = "6月及后入职信息不完整人数")
@Schema(description = "6月及后入职信息不完整人数")
@ExcelProperty("6月及后入职信息不完整人数")
private Integer afterIncompleteNum;
/**
* 立项申请人
*/
@Length(max = 32, message = "立项申请人 不能超过32 个字符")
@ExcelAttribute(name = "立项申请人", maxLength = 32)
@Schema(description = "立项申请人")
@ExcelProperty("立项申请人")
private String alertUser;
}
package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TCompleteMonitor;
import com.yifu.cloud.plus.v1.yifu.archives.service.TCompleteMonitorService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorInfoVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorSearchVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
/**
* 档案完整度监控
*
* @author huyc
* @date 2024-06-17 16:08:58
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tcompletemonitor" )
@Tag(name = "档案完整度监控管理")
public class TCompleteMonitorController {
private final TCompleteMonitorService tCompleteMonitorService;
/**
* 简单分页查询
* @param page 分页对象
* @param tCompleteMonitor 档案完整度监控
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TCompleteMonitor>> getTCompleteMonitorPage(Page<TCompleteMonitor> page, TCompleteMonitor tCompleteMonitor) {
return new R<>(tCompleteMonitorService.getTCompleteMonitorPage(page,tCompleteMonitor));
}
/**
* 查询人员明细
* @param page 分页对象
* @param deptNo 查询人员明细
* @return
*/
@Operation(description = "根据项目查询人员明细")
@GetMapping("/empPage")
public R<IPage<TCompleteMonitorInfoVo>> getMonitorEmpInfoListPage(Page<TCompleteMonitorInfoVo> page, String deptNo) {
return new R<>(tCompleteMonitorService.getMonitorEmpInfoListPage(page,deptNo));
}
/**
* 通过id查询档案完整度监控
* @param id id
* @return R
*/
@Operation(summary = "查看详情", description = "查看详情")
@GetMapping("/{id}" )
public R<TCompleteMonitor> getById(@PathVariable("id") String id) {
return R.ok(tCompleteMonitorService.getById(id));
}
/**
* 修改档案完整度监控
* @param tCompleteMonitor 档案完整度监控
* @return R
*/
@Operation(summary = "修改档案完整度监控", description = "修改档案完整度监控:hasPermission('archves_tcompletemonitor_edit')")
@SysLog("修改档案完整度监控" )
@PutMapping
@PreAuthorize("@pms.hasPermission('archves_tcompletemonitor_edit')" )
public R<Boolean> updateById(@RequestBody TCompleteMonitor tCompleteMonitor) {
return R.ok(tCompleteMonitorService.updateById(tCompleteMonitor));
}
/**
* 通过id删除档案完整度监控
* @param id id
* @return R
*/
@Operation(summary = "通过id删除档案完整度监控", description = "通过id删除档案完整度监控:hasPermission('archves_tcompletemonitor_del')")
@SysLog("通过id删除档案完整度监控" )
@DeleteMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('archves_tcompletemonitor_del')" )
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tCompleteMonitorService.removeById(id));
}
/**
* 档案完整度监控 批量导出
* @author huyc
* @date 2024-06-17 16:08:58
**/
@Operation(description = "导出档案完整度监控 hasPermission('archves_tcompletemonitor-export')")
@PostMapping("/export")
@PreAuthorize("@pms.hasPermission('archves_tcompletemonitor-export')")
public void export(HttpServletResponse response, @RequestBody TCompleteMonitorSearchVo searchVo) {
tCompleteMonitorService.listExport(response,searchVo);
}
/**
* 档案完整度监控 批量生成
* @author huyc
* @date 2024-06-17 16:08:58
**/
@Operation(description = "生成档案完整度监控")
@Inner
@PostMapping("/inner/createComlpeteMonitor")
public void createComlpeteMonitor() throws IllegalAccessException{
tCompleteMonitorService.createComlpeteMonitor();
}
/**
* 档案完整度监控 批量生成
* @author huyc
* @date 2024-06-17 16:08:58
**/
@Operation(description = "根据项目编码刷新项目完整度状态")
@PostMapping("/updateProjectStatusByDeptNo")
public R updateProjectStatusByDeptNo(@RequestParam String deptNo) throws IllegalAccessException {
tCompleteMonitorService.updateProjectStatusByDeptNo(deptNo);
return R.ok();
}
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TCompleteMonitor;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorFlagVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorInfoVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 档案完整度监控
*
* @author huyc
* @date 2024-06-17 16:08:58
*/
@Mapper
public interface TCompleteMonitorMapper extends BaseMapper<TCompleteMonitor> {
/**
* 档案完整度监控简单分页查询
* @param tCompleteMonitor 档案完整度监控
* @return
*/
IPage<TCompleteMonitor> getTCompleteMonitorPage(Page<TCompleteMonitor> page, @Param("tCompleteMonitor") TCompleteMonitor tCompleteMonitor);
/**
* 档案完整度监控简单分页查询
* @param tCompleteMonitor 档案完整度监控
* @return
*/
long getExportCount(@Param("tCompleteMonitor") TCompleteMonitorSearchVo tCompleteMonitor);
/**
* 档案完整度监控批量导出
* @param tCompleteMonitor 档案完整度监控
* @return
*/
List<TCompleteMonitorVo> getTCompleteMonitorExportList(@Param("tCompleteMonitor") TCompleteMonitorSearchVo tCompleteMonitor);
/**
* 查询人员明细
* @param deptNo 项目编码
* @return
*/
IPage<TCompleteMonitorInfoVo> getMonitorEmpInfoList(Page<TCompleteMonitorInfoVo> page,@Param("deptNo") String deptNo);
/**
* 获取所有监控数据
* @return
*/
List<TCompleteMonitor> getAllMonitorEmpList(@Param("deptNo") String deptNo);
/**
* 删除所有监控数据
* @return
*/
void deleteAllMonitorInfo();
/**
* 判断项目档案的完整状态
* @return
*/
List<TCompleteMonitorFlagVo> checkEmpProjectCompleteFlag(@Param("deptNo") String deptNo);
/**
* 根据项目编码删除监控数据
* @return
*/
void deleteMonitorInfoByDeptNo(@Param("deptNo") String deptNo);
}
...@@ -118,4 +118,11 @@ public interface TEmployeeProjectMapper extends BaseMapper<TEmployeeProject> { ...@@ -118,4 +118,11 @@ public interface TEmployeeProjectMapper extends BaseMapper<TEmployeeProject> {
void updateContractStatus(@Param("empId") String empId, @Param("deptId") String deptId, @Param("status")int status); void updateContractStatus(@Param("empId") String empId, @Param("deptId") String deptId, @Param("status")int status);
int updatePostByEmpDeptNo(@Param("deptNo")String deptNo, @Param("post")String post,@Param("empIdcard")String empIdcard); int updatePostByEmpDeptNo(@Param("deptNo")String deptNo, @Param("post")String post,@Param("empIdcard")String empIdcard);
/**
* 批量刷新项目档案的是否完整状态
* @return
*/
void batchUpdateEmpProjectCompleteStatus(@Param("idList") List<String> idList);
} }
package com.yifu.cloud.plus.v1.yifu.archives.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TCompleteMonitor;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorInfoVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorSearchVo;
import javax.servlet.http.HttpServletResponse;
/**
* 档案完整度监控
*
* @author huyc
* @date 2024-06-17 16:08:58
*/
public interface TCompleteMonitorService extends IService<TCompleteMonitor> {
/**
* 档案完整度监控简单分页查询
* @param tCompleteMonitor 档案完整度监控
* @return
*/
IPage<TCompleteMonitor> getTCompleteMonitorPage(Page<TCompleteMonitor> page, TCompleteMonitor tCompleteMonitor);
/**
* 档案完整度监控导出
* @param searchVo 档案完整度监控
* @return
*/
void listExport(HttpServletResponse response, TCompleteMonitorSearchVo searchVo);
/**
* 档案完整度监控生成
* @return
*/
void createComlpeteMonitor() throws IllegalAccessException;
/**
* 根据项目编码刷新项目完整度状态
* @return
*/
void updateProjectStatusByDeptNo(String deptNo) throws IllegalAccessException;
/**
* 档案完整度监控简单分页查询
* @param deptNo 项目编码
* @return
*/
IPage<TCompleteMonitorInfoVo> getMonitorEmpInfoListPage(Page<TCompleteMonitorInfoVo> page, String deptNo);
}
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TCompleteMonitor;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TCompleteMonitorMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TCompleteMonitorService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorFlagVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorInfoVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ExcelUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.lang.reflect.Field;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
/**
* 档案完整度监控
*
* @author huyc
* @date 2024-06-17 16:08:58
*/
@Log4j2
@Service
@RequiredArgsConstructor
public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMapper, TCompleteMonitor> implements TCompleteMonitorService {
private final TEmployeeProjectMapper projectMapper;
/**
* 档案完整度监控简单分页查询
* @param tCompleteMonitor 档案完整度监控
* @return
*/
@Override
public IPage<TCompleteMonitor> getTCompleteMonitorPage(Page<TCompleteMonitor> page, TCompleteMonitor tCompleteMonitor){
return baseMapper.getTCompleteMonitorPage(page,tCompleteMonitor);
}
/**
* 档案完整度监控批量导出
* @param searchVo 档案完整度监控
* @return
*/
@Override
public void listExport(HttpServletResponse response, TCompleteMonitorSearchVo searchVo){
String fileName = "档案完整度监控批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TCompleteMonitorVo> list = new ArrayList<>();
long count = baseMapper.getExportCount(searchVo);
ServletOutputStream out = null;
try {
out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName , CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
//EasyExcel.write(out, TEmpBadRecord.class).sheet("不良记录").doWrite(list);
ExcelWriter excelWriter = EasyExcel.write(out, TCompleteMonitorVo.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT){
for (int i = 0; i <= count; ) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getTCompleteMonitorExportList(searchVo);
if (Common.isNotNull(list)){
ExcelUtil<TCompleteMonitorVo> util = new ExcelUtil<>(TCompleteMonitorVo.class);
for (TCompleteMonitorVo vo:list){
util.convertEntity(vo,null,null,null);
}
}
if (Common.isNotNull(list)){
WriteSheet writeSheet = EasyExcel.writerSheet("档案完整度监控"+index).build();
excelWriter.write(list,writeSheet);
index++;
}
i = i + CommonConstants.EXCEL_EXPORT_LIMIT;
if (Common.isNotNull(list)){
list.clear();
}
}
}else {
WriteSheet writeSheet = EasyExcel.writerSheet("档案完整度监控"+index).build();
excelWriter.write(list,writeSheet);
}
if (Common.isNotNull(list)){
list.clear();
}
out.flush();
excelWriter.finish();
}catch (Exception e){
log.error("执行异常" ,e);
}finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
}
}
@Override
public void createComlpeteMonitor() throws IllegalAccessException {
//先删除所有的档案监控数据
baseMapper.deleteAllMonitorInfo();
//批量查询项目档案的是否完整状态
List<TCompleteMonitorFlagVo> flagList = baseMapper.checkEmpProjectCompleteFlag(null);
if (!flagList.isEmpty()) {
List<String> projectIdList = new ArrayList<>();
String projectId;
for(TCompleteMonitorFlagVo flagVo : flagList) {
boolean flag = checkObjFieldIsNull(flagVo);
if(!flag){
projectId = flagVo.getEmpProjectId();
projectIdList.add(projectId);
}
}
//批量更新
if (!projectIdList.isEmpty())
projectMapper.batchUpdateEmpProjectCompleteStatus(projectIdList);
}
//查询项目维度的信息
List<TCompleteMonitor> list = baseMapper.getAllMonitorEmpList(null);
//查询当天新增的项目档案数据来筛选需要刷新的数据
this.saveBatch(list);
}
/**
* 档案完整度监控简单分页查询
* @param deptNo 项目编码
* @return
*/
@Override
public IPage<TCompleteMonitorInfoVo> getMonitorEmpInfoListPage(Page<TCompleteMonitorInfoVo> page, String deptNo){
return baseMapper.getMonitorEmpInfoList(page,deptNo);
}
@Override
public void updateProjectStatusByDeptNo(String deptNo) throws IllegalAccessException{
//批量查询项目档案的是否完整状态
List<TCompleteMonitorFlagVo> flagList = baseMapper.checkEmpProjectCompleteFlag(deptNo);
if (!flagList.isEmpty()) {
List<String> projectIdList = new ArrayList<>();
String projectId;
for(TCompleteMonitorFlagVo flagVo : flagList) {
boolean flag = checkObjFieldIsNull(flagVo);
if(!flag){
projectId = flagVo.getEmpProjectId();
projectIdList.add(projectId);
}
}
//批量更新
if (!projectIdList.isEmpty())
projectMapper.batchUpdateEmpProjectCompleteStatus(projectIdList);
}
//删除项目监控表数据
baseMapper.deleteMonitorInfoByDeptNo(deptNo);
//查询项目维度的信息
List<TCompleteMonitor> list = baseMapper.getAllMonitorEmpList(deptNo);
//查询当天新增的项目档案数据来筛选需要刷新的数据
this.saveBatch(list);
}
/**
*
* @param obj 对象
// * @param checkField 要检查的属性集合
* @return true 指定属性有为空的 false 所有属性值都不为空
* @throws IllegalAccessException
*/
public boolean checkObjFieldIsNull(Object obj) throws IllegalAccessException {
//获取对象的类
Class<?> aClass = obj.getClass();
Field[] declaredFields = aClass.getDeclaredFields();
//筛选出包含在要检查的list 并且 属性为null的字段
for(Field field : declaredFields){
if (null == field.get(obj)) {
return true;
}
}
return false;
}
}
<?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.yifu.cloud.plus.v1.yifu.archives.mapper.TCompleteMonitorMapper">
<resultMap id="tCompleteMonitorMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TCompleteMonitor">
<id property="id" column="ID"/>
<result property="unitName" column="UNIT_NAME"/>
<result property="unitNo" column="UNIT_NO"/>
<result property="deptName" column="DEPT_NAME"/>
<result property="deptNo" column="DEPT_NO"/>
<result property="businessPrimaryType" column="BUSINESS_PRIMARY_TYPE"/>
<result property="businessSecondType" column="BUSINESS_SECOND_TYPE"/>
<result property="businessThirdType" column="BUSINESS_THIRD_TYPE"/>
<result property="inusePersonNum" column="INUSE_PERSON_NUM"/>
<result property="isComplete" column="IS_COMPLETE"/>
<result property="incompleteNum" column="INCOMPLETE_NUM"/>
<result property="completePer" column="COMPLETE_PER"/>
<result property="afterEmployment" column="AFTER_EMPLOYMENT"/>
<result property="afterIsComplete" column="AFTER_IS_COMPLETE"/>
<result property="afterIncompleteNum" column="AFTER_INCOMPLETE_NUM"/>
<result property="alertUser" column="ALERT_USER"/>
</resultMap>
<resultMap id="tCompleteMonitorExport" type="com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorVo">
<result property="unitName" column="UNIT_NAME"/>
<result property="unitNo" column="UNIT_NO"/>
<result property="deptName" column="DEPT_NAME"/>
<result property="deptNo" column="DEPT_NO"/>
<result property="businessPrimaryType" column="BUSINESS_PRIMARY_TYPE"/>
<result property="inusePersonNum" column="INUSE_PERSON_NUM"/>
<result property="isComplete" column="IS_COMPLETE"/>
<result property="incompleteNum" column="INCOMPLETE_NUM"/>
<result property="completePer" column="COMPLETE_PER"/>
<result property="afterEmployment" column="AFTER_EMPLOYMENT"/>
<result property="afterIsComplete" column="AFTER_IS_COMPLETE"/>
<result property="afterIncompleteNum" column="AFTER_INCOMPLETE_NUM"/>
<result property="alertUser" column="ALERT_USER"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.UNIT_NAME,
a.UNIT_NO,
a.DEPT_NAME,
a.DEPT_NO,
a.BUSINESS_PRIMARY_TYPE,
a.BUSINESS_SECOND_TYPE,
a.BUSINESS_THIRD_TYPE,
a.INUSE_PERSON_NUM,
a.IS_COMPLETE,
a.INCOMPLETE_NUM,
a.COMPLETE_PER,
a.AFTER_EMPLOYMENT,
a.AFTER_IS_COMPLETE,
a.AFTER_INCOMPLETE_NUM,
a.ALERT_USER
</sql>
<sql id="tCompleteMonitor_where">
<if test="tCompleteMonitor != null">
<if test="tCompleteMonitor.id != null and tCompleteMonitor.id.trim() != ''">
AND a.ID = #{tCompleteMonitor.id}
</if>
<if test="tCompleteMonitor.unitName != null and tCompleteMonitor.unitName.trim() != ''">
AND a.UNIT_NAME like concat('%',#{tCompleteMonitor.unitName},'%')
</if>
<if test="tCompleteMonitor.unitNo != null and tCompleteMonitor.unitNo.trim() != ''">
AND a.UNIT_NO = #{tCompleteMonitor.unitNo}
</if>
<if test="tCompleteMonitor.deptName != null and tCompleteMonitor.deptName.trim() != ''">
AND a.DEPT_NAME like concat('%',#{tCompleteMonitor.deptName},'%')
</if>
<if test="tCompleteMonitor.deptNo != null and tCompleteMonitor.deptNo.trim() != ''">
AND a.DEPT_NO = #{tCompleteMonitor.deptNo}
</if>
<if test="tCompleteMonitor.businessThirdType != null and tCompleteMonitor.businessThirdType.trim() != ''">
AND a.BUSINESS_THIRD_TYPE like concat('%',#{tCompleteMonitor.businessThirdType},'%')
</if>
<if test="tCompleteMonitor.isComplete != null and tCompleteMonitor.isComplete.trim() != ''">
AND a.IS_COMPLETE = #{tCompleteMonitor.isComplete}
</if>
<if test="tCompleteMonitor.afterIsComplete != null and tCompleteMonitor.afterIsComplete.trim() != ''">
AND a.AFTER_IS_COMPLETE = #{tCompleteMonitor.afterIsComplete}
</if>
</if>
</sql>
<!--tCompleteMonitor简单分页查询-->
<select id="getTCompleteMonitorPage" resultMap="tCompleteMonitorMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_complete_monitor a
<where>
1=1
<include refid="tCompleteMonitor_where"/>
</where>
</select>
<!--tCompleteMonitor简单分页查询-->
<select id="getExportCount" resultType="java.lang.Long">
SELECT
count(1)
FROM t_complete_monitor a
<where>
1=1
<include refid="tCompleteMonitor_where"/>
</where>
</select>
<!--tCompleteMonitor简单分页查询-->
<select id="getTCompleteMonitorExportList" resultMap="tCompleteMonitorExport">
SELECT
a.UNIT_NAME,
a.UNIT_NO,
a.DEPT_NAME,
a.DEPT_NO,
concat(BUSINESS_PRIMARY_TYPE,'-',BUSINESS_SECOND_TYPE,'-',BUSINESS_THIRD_TYPE) as BUSINESS_PRIMARY_TYPE,
a.INUSE_PERSON_NUM,
a.IS_COMPLETE,
a.INCOMPLETE_NUM,
a.COMPLETE_PER,
a.AFTER_EMPLOYMENT,
a.AFTER_IS_COMPLETE,
a.AFTER_INCOMPLETE_NUM,
a.ALERT_USER
FROM t_complete_monitor a
<where>
1=1
<include refid="tCompleteMonitor_where"/>
</where>
<if test="tCompleteMonitor.limitStart != null">
limit #{tCompleteMonitor.limitStart},#{tCompleteMonitor.limitEnd}
</if>
</select>
<!--获取详情人员列表-->
<select id="getMonitorEmpInfoList" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorInfoVo">
select
a.EMP_NAME empName,
a.EMP_IDCARD empIdCard,
b.EMP_PHONE phone,
a.CREATE_TIME inTime,
if(a.IS_COMPLETE = '0','是','否') isComplete,
a.EMP_ID empInfoId,
from
t_employee_project a
left join t_employee_info b on a.EMP_ID = b.id
where a.DELETE_FLAG = '0' and a.dept_no = #{deptNo}
</select>
<!--生成数据封装-->
<select id="getAllMonitorEmpList" resultMap="tCompleteMonitorMap">
select
a.UNIT_NAME,
a.UNIT_NO,
a.DEPT_NAME,
a.DEPT_NO,
a.BUSINESS_PRIMARY_TYPE,
,a.BUSINESS_SECOND_TYPE,
,a.BUSINESS_THIRD_TYPE,
count(a.EMP_IDCARD) as INUSE_PERSON_NUM,
if(sum(if(a.PROJECT_STATUS = 0 and a.IS_COMPLETE = '0',0,1)) > 0,1,0) as IS_COMPLETE,
sum(if(a.IS_COMPLETE = '0',0,1)) as INCOMPLETE_NUM,
concat(ROUND((count(a.EMP_IDCARD) - sum(if(a.IS_COMPLETE = '0',0,1)))/count(a.EMP_IDCARD)),'%') as COMPLETE_PER,
sum(if(a.PROJECT_STATUS = 0 and DATE_FORMAT(a.CREATE_TIME,'%Y-%m-%d') >= '2024-06-01',1,0)) as AFTER_EMPLOYMENT,
if(sum(if(a.PROJECT_STATUS = 0 and DATE_FORMAT(a.CREATE_TIME,'%Y-%m-%d') >= '2024-06-01' and a.IS_COMPLETE = '0',0,1)) > 0,1,0) AFTER_IS_COMPLETE,
sum(if(a.PROJECT_STATUS = 0 and DATE_FORMAT(a.CREATE_TIME,'%Y-%m-%d') >= '2024-06-01' and a.IS_COMPLETE = '0',0,1)) as AFTER_INCOMPLETE_NUM,
a.CREATE_NAME as ALERT_USER
from
t_employee_project a
where DELETE_FLAG = '0'
<if test="deptNo != null and deptNo.trim() != ''">
and a.DEPT_NO = #{deptNo}
</if>
group by a.DEPT_NO
</select>
<!--判断项目档案的完整状态-->
<select id="checkEmpProjectCompleteFlag" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TCompleteMonitorFlagVo">
select
e.EMP_SEX empSex,
e.VALIDITY_START validityStart,
e.VALIDITY_END validityEnd,
e.EMP_BIRTHDAY empBirthday,
e.EMP_AGE empAge,
e.EMP_MARRI_STATUS empMarriStatus,
e.EMP_NATIONAL empNational,
e.POLITICAL_STATUS politicalStatus,
e.EMP_PHONE empPhone,
e.EMP_REGIS_TYPE empRegisType,
e.FILE_PROVINCE fileProvince,
e.FILE_CITY fileCity,
e.IS_COLLEGE isCollege,
e.HIGN_EDUCATION hignEducation,
e.SCHOOL,
e.MAJOR,
e.ADMISSION_DATE admissionDate,
e.GRADUTION_DATE gradutionDate,
e.CONTACT_ADDRESS contactAddress,
e.FIRST_WORK_FLAG firstWorkFlag,
e.HAVE_QUALIFICATION haveQualification,
a.DEPT_NAME deptName,
a.UNIT_NAME unitName,
a.BUSINESS_PRIMARY_TYPE businessPrimaryType,
a.BUSINESS_SECOND_TYPE businessSecondType,
a.BUSINESS_THIRD_TYPE businessThirdType,
a.WORKING_HOURS workingHours,
a.TRY_PERIOD tryPeriod,
a.ENJOIN_DATE enjoinDate,
a.POST,
a.id as empProjectId,
d.id as contactInfoId,
if(ifnull(f.OCCUPATIONAL_DISEASE_FLAG,1) != 1 and ifnull(f.INFECTIOUS_DISEASE_FLAG,1) != 1 and ifnull(f.DISABILITY_FLAG,1) != 1 and ifnull(f.OTHER_FLAG,1) != 1,'1',null) as disabilityFlag,
if(ifnull(b.REMARK,1) != 1,'1',null) as badRecordFlag,
if(c.count >0,'1',null) as educationFlag,
if(g.count >0,'1',null) as familyFlag
from
t_employee_project a
left join (
select
ee.ID,
ee.EMP_SEX,
ee.VALIDITY_START,
ee.VALIDITY_END,
ee.EMP_BIRTHDAY,
ee.EMP_AGE,
ee.EMP_MARRI_STATUS,
ee.EMP_NATIONAL,
ee.POLITICAL_STATUS,
ee.EMP_PHONE,
ee.EMP_REGIS_TYPE,
ee.FILE_PROVINCE,
ee.FILE_CITY,
ee.IS_COLLEGE,
ee.HIGN_EDUCATION,
ee.SCHOOL,
ee.MAJOR,
ee.ADMISSION_DATE,
ee.GRADUTION_DATE,
ee.CONTACT_ADDRESS,
ee.FIRST_WORK_FLAG,
ee.HAVE_QUALIFICATION
from t_employee_info ee
left join t_atta_info tt on ee.id = tt.DOMAIN_ID and tt.RELATION_TYPE = '9'
left join t_atta_info yy on ee.id = yy.DOMAIN_ID and yy.RELATION_TYPE = '10'
where ee.DELETE_FLAG = '0' and ee.FILE_STATUS = 0 and tt.id is not null and yy.id is not null
group by ee.ID
) e on a.EMP_ID = e.ID
left join t_emp_bad_record b on a.EMP_IDCARD = b.EMP_IDCARD
left join (select EMP_ID,sum(if(ifnull(HIGH_IDENTIFICATION,-1) != -1 and ifnull(SCHOOL,-1) != -1 and ifnull(MAJOR,-1) != -1 and ifnull(TYPE,-1) != -1 and ifnull(ENTRY_DATE,-1) != -1 and ifnull(GRADUTION_DATE,-1) != -1,1,0)) as count from t_emp_education a left join t_atta_info b on a.id = b.domain_id where a.DELETE_FLAG = '0' and b.RELATION_TYPE = '0' group by a.EMP_ID) c on a.EMP_ID = c.EMP_ID
left join t_emp_contact_info d on a.EMP_IDCARD = d.EMP_IDCARD
left join t_emp_disability_info f on a.EMP_ID = f.EMP_ID and f.DELETE_FLAG = '1'
left join (select EMP_ID,sum(if(ifnull(RELATIONSHIP_SELF,-1) != -1 and ifnull(FAMILY_NAME,-1) != -1 and ifnull(CONTRACT_TEL,-1) != -1,1,0)) as count from t_emp_family where DELETE_FLAG = '1' group by EMP_ID) g on a.EMP_ID = g.EMP_ID
where a.DELETE_FLAG = '0' and a.PROJECT_STATUS = 0
<if test="deptNo != null and deptNo.trim() != ''">
and a.DEPT_NO = #{deptNo}
</if>
group by a.ID
</select>
<!--删除所有监控数据-->
<update id="deleteAllMonitorInfo">
TRUNCATE t_complete_monitor
</update>
<!--根据项目编码删除监控数据-->
<delete id="deleteMonitorInfoByDeptNo">
delete from t_complete_monitor WHERE DEPT_NO = #{deptNo}
</delete>
</mapper>
...@@ -1086,4 +1086,12 @@ ...@@ -1086,4 +1086,12 @@
set a.POST = #{post} set a.POST = #{post}
WHERE a.DEPT_NO=#{deptNo} and a.EMP_IDCARD=#{empIdcard} and a.DELETE_FLAG ='0' WHERE a.DEPT_NO=#{deptNo} and a.EMP_IDCARD=#{empIdcard} and a.DELETE_FLAG ='0'
</update> </update>
<!-- 批量刷新项目档案的是否完整状态 -->
<update id="batchUpdateEmpProjectCompleteStatus">
update t_employee_project a set a.IS_COMPLETE = '0' where a.id in
<foreach item="item" index="index" collection="idList" open="(" separator="," close=")">
#{item}
</foreach>
</update>
</mapper> </mapper>
...@@ -68,4 +68,12 @@ public class ArchiveTask { ...@@ -68,4 +68,12 @@ public class ArchiveTask {
SecurityConstants.FROM_IN); SecurityConstants.FROM_IN);
log.info("-------------每月26号更新人员花名册-定时任务开始------------"); log.info("-------------每月26号更新人员花名册-定时任务开始------------");
} }
public void everyDayCreateComlpeteMonitor() {
log.info("-------------每月刷新档案完整监控数据------------");
HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(), daprArchivesProperties.getAppId(),
"/tcompletemonitor/inner/createComlpeteMonitor", "", Object.class,
SecurityConstants.FROM_IN);
log.info("-------------每月刷新档案完整监控数据-定时任务开始------------");
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment