Merge branch 'master' of http://47.115.223.229:8888/yangjun/nursing_unit_java
This commit is contained in:
commit
422c59ab49
|
|
@ -1,6 +1,8 @@
|
|||
package com.nu.modules.employeesapply.controller;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
|
@ -30,10 +32,9 @@ import org.springframework.web.servlet.ModelAndView;
|
|||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.lang.reflect.Field;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Description: 员工申请
|
||||
|
|
@ -80,6 +81,15 @@ public class EmployeesApplyController extends JeecgController<EmployeesApply, IE
|
|||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "员工申请-分页列表查询", notes = "员工申请-分页列表查询")
|
||||
@GetMapping(value = "/listPage")
|
||||
public Result<IPage<EmployeesApply>> listPage(EmployeesApply employeesApply, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
|
||||
QueryWrapper<EmployeesApply> queryWrapper = QueryGenerator.initQueryWrapper(employeesApply, req.getParameterMap());
|
||||
Page<EmployeesApply> page = new Page<EmployeesApply>(pageNo, pageSize);
|
||||
IPage<EmployeesApply> pageList = employeesApplyService.listPage(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
|
|
@ -106,18 +116,14 @@ public class EmployeesApplyController extends JeecgController<EmployeesApply, IE
|
|||
@RequiresPermissions("employeesapply:nu_biz_employees_apply:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody EmployeesApply employeesApply) {
|
||||
if (StringUtils.isNotBlank(employeesApply.getStatusVal())) {
|
||||
if (StringUtils.isNotBlank(employeesApply.getStatus())) {
|
||||
//有值则说明是正在进行审批
|
||||
if ("auditPass".equals(employeesApply.getStatusVal())) {
|
||||
employeesApply.setStatus("2");
|
||||
if ("2".equals(employeesApply.getStatus())) {
|
||||
employeesApply.setAuditContent("审批通过");
|
||||
}
|
||||
if ("auditFaild".equals(employeesApply.getStatusVal())) {
|
||||
employeesApply.setStatus("3");
|
||||
}
|
||||
}
|
||||
employeesApplyService.updateById(employeesApply);
|
||||
if (StringUtils.isNotBlank(employeesApply.getStatusVal())) {
|
||||
if (StringUtils.isNotBlank(employeesApply.getStatus())) {
|
||||
|
||||
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
||||
//入职时间
|
||||
|
|
@ -125,7 +131,7 @@ public class EmployeesApplyController extends JeecgController<EmployeesApply, IE
|
|||
|
||||
//审批通过后将员工信息插入到员工表中
|
||||
BizEmployeesInfo employeesInfo = new BizEmployeesInfo();
|
||||
if ("auditPass".equals(employeesApply.getStatusVal())) {
|
||||
if ("2".equals(employeesApply.getStatus())) {
|
||||
QueryWrapper<BizEmployeesInfo> qw = new QueryWrapper<>();
|
||||
qw.eq("id", employeesApply.getEmployeeId());
|
||||
BizEmployeesInfo one = employeesInfoService.getOne(qw);
|
||||
|
|
@ -146,7 +152,7 @@ public class EmployeesApplyController extends JeecgController<EmployeesApply, IE
|
|||
mqdto.setAuditStatus(employeesApply.getStatus());//审批状态
|
||||
mqdto.setAuditContent(employeesApply.getAuditContent());//审批备注
|
||||
mqdto.setOpenId(employeesApply.getOpenId());//openId
|
||||
if ("auditPass".equals(employeesApply.getStatusVal())) {
|
||||
if ("2".equals(employeesApply.getStatus())) {
|
||||
mqdto.setEntryTime(entryTime);//入驻时间
|
||||
}
|
||||
rabbitMQUtil.sendToExchange("hldy.employees", "hldy.employeesorg.auditstatus.sync", mqdto);
|
||||
|
|
@ -312,4 +318,11 @@ public class EmployeesApplyController extends JeecgController<EmployeesApply, IE
|
|||
employeesApplyService.audit(employeesApply);
|
||||
return Result.OK("审核成功!");
|
||||
}
|
||||
|
||||
@ApiOperation(value = "员工变更历史比对信息", notes = "员工变更历史比对信息")
|
||||
@PostMapping(value = "/getModifyHistoryInfo")
|
||||
public Result<List<Map<String, Object>>> getModifyHistoryInfo(@RequestBody EmployeesApply employeesApply) {
|
||||
return Result.OK(employeesApplyService.getModifyHistoryInfo(employeesApply));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
package com.nu.modules.employeesapply.mapper;
|
||||
|
||||
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.Param;
|
||||
import com.nu.modules.employeesapply.entity.EmployeesApply;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
|
@ -12,5 +16,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
*/
|
||||
public interface EmployeesApplyMapper extends BaseMapper<EmployeesApply> {
|
||||
|
||||
IPage<EmployeesApply> listPage(Page<EmployeesApply> page, @Param(Constants.WRAPPER) QueryWrapper<EmployeesApply> queryWrapper);
|
||||
|
||||
int cleanErrorInvided(@Param("employeeId") String employeeId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,86 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nu.modules.employeesapply.mapper.EmployeesApplyMapper">
|
||||
|
||||
<select id="listPage" resultType="com.nu.modules.employeesapply.entity.EmployeesApply">
|
||||
SELECT sup.* FROM (
|
||||
SELECT
|
||||
IFNULL(b.id, a.id) AS id,
|
||||
a.id as employee_id,
|
||||
a.name,
|
||||
a.sex,
|
||||
a.date_of_birth,
|
||||
a.tel,
|
||||
a.national,
|
||||
a.id_card,
|
||||
a.married_or_not,
|
||||
a.height,
|
||||
a.weight,
|
||||
a.health_status,
|
||||
a.political_appearance,
|
||||
a.house_address,
|
||||
a.emergency_contact,
|
||||
a.emergency_tel,
|
||||
a.emergency_relationship,
|
||||
a.hukou_nature,
|
||||
a.current_address,
|
||||
a.id_card_positive,
|
||||
a.id_card_negative,
|
||||
a.health_certificate_positive,
|
||||
a.bank_positive,
|
||||
a.bank_negative,
|
||||
a.qualification,
|
||||
a.no_crime_certificate,
|
||||
a.create_time,
|
||||
b.status,
|
||||
b.modify_status,
|
||||
b.apply_type,
|
||||
b.audit_content,
|
||||
b.iz_history
|
||||
FROM nu_biz_employees_info a
|
||||
LEFT JOIN nu_biz_employees_apply b ON a.id = b.employee_id AND b.iz_history = 'N'
|
||||
WHERE a.del_flag = '0' AND a.iz_freeze = 'N'
|
||||
UNION ALL
|
||||
SELECT
|
||||
b.id AS id,
|
||||
b.employee_id,
|
||||
b.name,
|
||||
b.sex,
|
||||
b.date_of_birth,
|
||||
b.tel,
|
||||
b.national,
|
||||
b.id_card,
|
||||
b.married_or_not,
|
||||
b.height,
|
||||
b.weight,
|
||||
b.health_status,
|
||||
b.political_appearance,
|
||||
b.house_address,
|
||||
b.emergency_contact,
|
||||
b.emergency_tel,
|
||||
b.emergency_relationship,
|
||||
b.hukou_nature,
|
||||
b.current_address,
|
||||
b.id_card_positive,
|
||||
b.id_card_negative,
|
||||
b.health_certificate_positive,
|
||||
b.bank_positive,
|
||||
b.bank_negative,
|
||||
b.qualification,
|
||||
b.no_crime_certificate,
|
||||
b.create_time,
|
||||
b.status,
|
||||
b.modify_status,
|
||||
b.apply_type,
|
||||
b.audit_content,
|
||||
b.iz_history
|
||||
FROM nu_biz_employees_apply b
|
||||
WHERE b.employee_id NOT IN (SELECT id FROM nu_biz_employees_info)
|
||||
AND b.apply_type = '1'
|
||||
AND b.iz_history = 'N'
|
||||
) sup
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<delete id="cleanErrorInvided">
|
||||
delete from nu_biz_employees_apply where employee_id = #{employeeId} and iz_history = 'N' and apply_type = '1'
|
||||
</delete>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
package com.nu.modules.employeesapply.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
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.nu.modules.employeesapply.entity.EmployeesApply;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
|
|
@ -15,6 +18,8 @@ import java.util.Map;
|
|||
*/
|
||||
public interface IEmployeesApplyService extends IService<EmployeesApply> {
|
||||
|
||||
IPage<EmployeesApply> listPage(Page<EmployeesApply> page, QueryWrapper<EmployeesApply> queryWrapper);
|
||||
|
||||
void cleanErrorInvided(String employeeId);
|
||||
|
||||
List<Map<String, Object>> getModifyInfo(EmployeesApply employeesApply);
|
||||
|
|
@ -22,4 +27,6 @@ public interface IEmployeesApplyService extends IService<EmployeesApply> {
|
|||
void audit(EmployeesApply employeesApply);
|
||||
|
||||
void initialization(JSONObject j);
|
||||
|
||||
List<Map<String, Object>> getModifyHistoryInfo(EmployeesApply employeesApply);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import cn.hutool.core.util.IdUtil;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
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.nu.dto.EmployeesApplyMQDto;
|
||||
import com.nu.entity.SysUserEntity;
|
||||
import com.nu.modules.employeesInfo.entity.BizEmployeesInfo;
|
||||
|
|
@ -58,6 +60,11 @@ public class EmployeesApplyServiceImpl extends ServiceImpl<EmployeesApplyMapper,
|
|||
@Autowired
|
||||
private ISysUserAPI sysUserAPI;
|
||||
|
||||
@Override
|
||||
public IPage<EmployeesApply> listPage(Page<EmployeesApply> page, QueryWrapper<EmployeesApply> queryWrapper) {
|
||||
return baseMapper.listPage(page, queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cleanErrorInvided(String employeeId) {
|
||||
//删掉已保存的错误数据
|
||||
|
|
@ -201,12 +208,12 @@ public class EmployeesApplyServiceImpl extends ServiceImpl<EmployeesApplyMapper,
|
|||
eApply.setId(employeesApply.getId());
|
||||
eApply.setModifyStatus("3");
|
||||
eApply.setAuditContent(employeesApply.getAuditContent());
|
||||
eApply.setStatus("3");
|
||||
baseMapper.updateById(eApply);
|
||||
//修改员工信息表此人的信息修改审核状态为驳回
|
||||
BizEmployeesInfo eInfo = new BizEmployeesInfo();
|
||||
eInfo.setId(employeesApply.getEmployeeId());
|
||||
eInfo.setModifyStatus("3");
|
||||
eApply.setStatus("3");
|
||||
employeesInfoService.updateById(eInfo);
|
||||
}
|
||||
//通知管理平台修改相关数据
|
||||
|
|
@ -222,4 +229,87 @@ public class EmployeesApplyServiceImpl extends ServiceImpl<EmployeesApplyMapper,
|
|||
sysUserAPI.initialization(j);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getModifyHistoryInfo(EmployeesApply employeesApply) {
|
||||
// 1. 查询变更后数据
|
||||
EmployeesApply modifyData = baseMapper.selectById(employeesApply.getId());
|
||||
|
||||
// 2. 查询当前使用中数据
|
||||
QueryWrapper<EmployeesApply> usingQW = new QueryWrapper<>();
|
||||
usingQW.eq("employee_id", modifyData.getEmployeeId());
|
||||
usingQW.eq("status", "2");
|
||||
usingQW.lt("create_time", modifyData.getCreateTime());
|
||||
usingQW.last("limit 1");
|
||||
EmployeesApply usingData = baseMapper.selectOne(usingQW);
|
||||
if(usingData == null || usingData.getId() == null){
|
||||
usingData = modifyData;
|
||||
}
|
||||
|
||||
// 3. 准备结果列表
|
||||
List<Map<String, Object>> result = new ArrayList<>();
|
||||
|
||||
// 4. 获取 ConfigSuppliersInfo 所有字段(用于遍历)
|
||||
Field[] infoFields = EmployeesApply.class.getDeclaredFields();
|
||||
|
||||
// 5. 遍历每个字段,从两个对象中分别取值比较
|
||||
for (Field usingField : infoFields) {
|
||||
try {
|
||||
String fieldName = usingField.getName();
|
||||
|
||||
// 跳过序列化ID 和 @TableField(exist = false) 的字段
|
||||
if ("serialVersionUID".equals(fieldName)) {
|
||||
continue;
|
||||
}
|
||||
TableField tableField = usingField.getAnnotation(TableField.class);
|
||||
if (tableField != null && !tableField.exist()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 设置可访问
|
||||
usingField.setAccessible(true);
|
||||
|
||||
// 获取 ElderInfo 中对应的字段(必须同名)
|
||||
Field modifyField = null;
|
||||
try {
|
||||
modifyField = EmployeesApply.class.getDeclaredField(fieldName);
|
||||
modifyField.setAccessible(true);
|
||||
} catch (NoSuchFieldException e) {
|
||||
// 如果员工信息表中没有这个字段,跳过
|
||||
continue;
|
||||
}
|
||||
|
||||
// 获取两个对象中该字段的值
|
||||
Object modifyValue = modifyField.get(modifyData);
|
||||
Object usingValue = usingField.get(usingData);
|
||||
|
||||
// 处理日期类型
|
||||
if (usingField.getType() == Date.class) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
modifyValue = modifyValue != null ? sdf.format((Date) modifyValue) : null;
|
||||
usingValue = usingValue != null ? sdf.format((Date) usingValue) : null;
|
||||
}
|
||||
|
||||
// if(StringUtils.equals(fieldName,"suppliersNature")){
|
||||
// usingValue = usingValue != null ? dictUtils.translateDictValue("suppliers_nature", usingValue.toString()) : null;
|
||||
// modifyValue = modifyValue != null ? dictUtils.translateDictValue("suppliers_nature", modifyValue.toString()) : null;
|
||||
// }
|
||||
// 创建结果项
|
||||
Map<String, Object> fieldMap = new HashMap<>();
|
||||
fieldMap.put("id", IdUtil.simpleUUID());
|
||||
fieldMap.put("d1", fieldName); // 字段名
|
||||
fieldMap.put("d2", usingValue); // 原始值
|
||||
fieldMap.put("d3", modifyValue); // 修改值
|
||||
fieldMap.put("d4", Objects.equals(usingValue, modifyValue) ? "相同" : "不同"); // 比较结果
|
||||
|
||||
result.add(fieldMap);
|
||||
|
||||
} catch (IllegalAccessException e) {
|
||||
// 忽略访问失败或字段不存在的情况
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue