Merge branch 'master' of http://47.115.223.229:8888/yangjun/hldy_java_monomer
# Conflicts: # nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/orgapplyinfo/service/impl/OrgApplyInfoServiceImpl.java
This commit is contained in:
commit
baacdb6d4d
|
|
@ -0,0 +1,12 @@
|
|||
package com.nu.modules.EmployessInfo.api;
|
||||
|
||||
import com.nu.entity.EmployeesApplyEntity;
|
||||
import com.nu.modules.EmployessInfo.entity.EmployeesOrgApiEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface EmployeesOrgLocalApi {
|
||||
|
||||
void apply(EmployeesApplyEntity dto);
|
||||
List<EmployeesOrgApiEntity> queryAll(String orgCodes);
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
package com.nu.modules.EmployessInfo.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description: 员工-机构关系中间表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-09-05
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
public class EmployeesOrgApiEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
private String id;
|
||||
/**微信id*/
|
||||
private String openId;
|
||||
/**员工nu_biz_employees_info.id*/
|
||||
private String employeesId;
|
||||
/**机构编码*/
|
||||
private String orgCode;
|
||||
/**创建人*/
|
||||
private String createBy;
|
||||
/**创建日期*/
|
||||
private Date createTime;
|
||||
/**更新人*/
|
||||
private String updateBy;
|
||||
/**更新日期*/
|
||||
private Date updateTime;
|
||||
/**是否在线 0在线 1不在线*/
|
||||
private String izOnline;
|
||||
/**冻结状态 0未冻结 1冻结*/
|
||||
private String izFreeze;
|
||||
/**申请状态 1申请中 2通过 3驳回*/
|
||||
private String status;
|
||||
/**审核备注*/
|
||||
private String auditContent;
|
||||
}
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
package com.nu.modules.orgapplyinfo.api;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.nu.modules.orgapplyinfo.entity.OrgAllInfoApiEntity;
|
||||
import com.nu.modules.orgapplyinfo.entity.OrgApplyInfoApiEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -11,4 +13,6 @@ public interface IOrgApplyInfoApi {
|
|||
int updateById(OrgApplyInfoApiEntity orgApplyInfoApiEntity);
|
||||
|
||||
List<OrgApplyInfoApiEntity> queryAuditInfo(String openId, String id, String status);
|
||||
|
||||
IPage<OrgAllInfoApiEntity> queryOrgAllInfo(Integer pageNo, Integer pageSize, String orgCode, String title);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
package com.nu.modules.orgapplyinfo.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
@Data
|
||||
public class EmployeesApiEntity {
|
||||
/**申请状态 1申请中 2通过 3驳回*/
|
||||
private java.lang.String status;
|
||||
/**审核备注*/
|
||||
private java.lang.String auditContent;
|
||||
/**是否在线 0在线 1不在线*/
|
||||
private java.lang.String izOnline;
|
||||
/**冻结状态 0未冻结 1冻结*/
|
||||
private java.lang.String izFreeze;
|
||||
}
|
||||
|
|
@ -0,0 +1,176 @@
|
|||
package com.nu.modules.orgapplyinfo.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description: 机构全部信息
|
||||
* @Author: zmy
|
||||
* @Date: 2025-07-09
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
public class OrgAllInfoApiEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**机构id*/
|
||||
private String orgId;
|
||||
|
||||
/**
|
||||
* 机构/部门名称
|
||||
*/
|
||||
private String departName;
|
||||
/**
|
||||
* 机构编码
|
||||
*/
|
||||
private String orgCode;
|
||||
/**
|
||||
* 协议+域名
|
||||
*/
|
||||
private String url;
|
||||
/**
|
||||
* 协议+域名
|
||||
*/
|
||||
private String contextPath;
|
||||
/**
|
||||
* 是否标准指令库 0是1否
|
||||
*/
|
||||
private String izDirectiveMain;
|
||||
/**
|
||||
* 是否标准标签库 0是1否
|
||||
*/
|
||||
private String izElderTagMain;
|
||||
/**
|
||||
* 媒体资源访问地址
|
||||
*/
|
||||
private String mediaUrl;
|
||||
/**
|
||||
* 省份
|
||||
*/
|
||||
private String province;
|
||||
/**
|
||||
* 城市
|
||||
*/
|
||||
private String city;
|
||||
/**
|
||||
* 区县
|
||||
*/
|
||||
private String district;
|
||||
/**
|
||||
* 业务平台类型
|
||||
*/
|
||||
private String platType;
|
||||
/**
|
||||
* 运营开始时间
|
||||
*/
|
||||
private Date operationStartTime;
|
||||
/**
|
||||
* 运营到期时间
|
||||
*/
|
||||
private Date operationEndTime;
|
||||
/**
|
||||
* 合同开始时间
|
||||
*/
|
||||
private Date contractStartTime;
|
||||
/**
|
||||
* 合同到期时间
|
||||
*/
|
||||
private Date contractEndTime;
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
private String mobile;
|
||||
/**
|
||||
* 传真
|
||||
*/
|
||||
private String fax;
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
private String address;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String memo;
|
||||
/**
|
||||
* 应缴金额
|
||||
*/
|
||||
private BigDecimal payableAmount;
|
||||
/**
|
||||
* 机构图片
|
||||
*/
|
||||
private String picUrl;
|
||||
|
||||
/**微信id*/
|
||||
private String openId;
|
||||
/**微信名称*/
|
||||
private String wechatName;
|
||||
/**联系电话*/
|
||||
private String tel;
|
||||
/**咨询人姓名*/
|
||||
private String name;
|
||||
/**性别*/
|
||||
private String sex;
|
||||
/**民族*/
|
||||
private String national;
|
||||
/**出生日期*/
|
||||
private Date birthDate;
|
||||
/**住址(身份证上)*/
|
||||
private String idCardAddress;
|
||||
/**身份证号*/
|
||||
private String idCard;
|
||||
/**签发机关*/
|
||||
private String issuingAuthority;
|
||||
/**有效开始日期*/
|
||||
private Date startTime;
|
||||
/**有效结束日期*/
|
||||
private Date endTime;
|
||||
/**身份证正面*/
|
||||
private String cardZmPath;
|
||||
/**身份证反面*/
|
||||
private String cardFmPath;
|
||||
/**营业执照照片*/
|
||||
private String comBusinessLicense;
|
||||
/**企业名称*/
|
||||
private String comName;
|
||||
/**企业注册地址*/
|
||||
private String comRegisterAddress;
|
||||
/**企业信用代码*/
|
||||
private String comCreditCode;
|
||||
/**企业法人*/
|
||||
private String comLegalPerson;
|
||||
/**机构地址*/
|
||||
private String orgAddress;
|
||||
/**机构位置坐标:经度*/
|
||||
private String orgCoordinateLo;
|
||||
/**机构位置坐标:维度*/
|
||||
private String orgCoordinateLa;
|
||||
/**机构负责人*/
|
||||
private String orgLeader;
|
||||
/**机构负责人电话*/
|
||||
private String orgLeaderPhone;
|
||||
/**机构楼宇牌号*/
|
||||
private String orgBuildingNumber;
|
||||
/**机构房屋性质*/
|
||||
private String orgPropertyType;
|
||||
/**机构建筑面积*/
|
||||
private Double orgBuildingArea;
|
||||
/**机构省份 sys_category.id*/
|
||||
private String orgProvince;
|
||||
/**机构城市 sys_category.id*/
|
||||
private String orgCity;
|
||||
/**机构区域 sys_category.id*/
|
||||
private String orgDistrict;
|
||||
/**合同附件*/
|
||||
private String contract;
|
||||
/**合同备注*/
|
||||
private String contractNote;
|
||||
/** 加盟时间*/
|
||||
private Date franchiseTime;
|
||||
|
||||
/** 员工信息*/
|
||||
private EmployeesApiEntity employeesApiEntity;
|
||||
}
|
||||
|
|
@ -82,4 +82,10 @@ public class EmployeesOrg implements Serializable {
|
|||
@Excel(name = "审核备注", width = 15)
|
||||
@ApiModelProperty(value = "审核备注")
|
||||
private java.lang.String auditContent;
|
||||
/**入职时间*/
|
||||
@Excel(name = "入职时间", width = 15, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "入职时间")
|
||||
private java.util.Date entryTime;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
package com.nu.modules.employees.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.nu.entity.EmployeesApplyEntity;
|
||||
import com.nu.modules.EmployessInfo.api.EmployeesOrgLocalApi;
|
||||
import com.nu.modules.EmployessInfo.entity.EmployeesOrgApiEntity;
|
||||
import com.nu.modules.employees.entity.EmployeesOrg;
|
||||
import com.nu.modules.employees.mapper.EmployeesOrgMapper;
|
||||
import com.nu.modules.employees.service.IEmployeesOrgService;
|
||||
|
|
@ -7,6 +12,8 @@ import org.springframework.stereotype.Service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 员工-机构关系中间表
|
||||
* @Author: jeecg-boot
|
||||
|
|
@ -14,6 +21,26 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class EmployeesOrgServiceImpl extends ServiceImpl<EmployeesOrgMapper, EmployeesOrg> implements IEmployeesOrgService {
|
||||
public class EmployeesOrgServiceImpl extends ServiceImpl<EmployeesOrgMapper, EmployeesOrg> implements IEmployeesOrgService, EmployeesOrgLocalApi {
|
||||
|
||||
@Override
|
||||
public void apply(EmployeesApplyEntity dto) {
|
||||
EmployeesOrg employeesOrg = new EmployeesOrg();
|
||||
employeesOrg.setOpenId(dto.getOpenId());
|
||||
employeesOrg.setEmployeesId(dto.getEmployeeId());
|
||||
employeesOrg.setOrgCode(dto.getOrgCode());
|
||||
employeesOrg.setStatus("1");
|
||||
employeesOrg.setIzOnline("1");
|
||||
employeesOrg.setIzFreeze("0");
|
||||
baseMapper.insert(employeesOrg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EmployeesOrgApiEntity> queryAll(String orgCodes) {
|
||||
QueryWrapper<EmployeesOrg> qw = new QueryWrapper<>();
|
||||
qw.in("org_code",orgCodes.split(","));
|
||||
List<EmployeesOrg> list = baseMapper.selectList(qw);
|
||||
List<EmployeesOrgApiEntity> result = BeanUtil.copyToList(list, EmployeesOrgApiEntity.class);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,10 +6,12 @@ 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;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.dto.OrgApplyInfoMQDto;
|
||||
import com.nu.modules.orgapplyinfo.api.IOrgApplyInfoApi;
|
||||
import com.nu.modules.orgapplyinfo.entity.OrgAllInfo;
|
||||
import com.nu.modules.orgapplyinfo.entity.OrgAllInfoApiEntity;
|
||||
import com.nu.modules.orgapplyinfo.entity.OrgApplyInfo;
|
||||
import com.nu.modules.orgapplyinfo.entity.OrgApplyInfoApiEntity;
|
||||
import com.nu.modules.orgapplyinfo.mapper.OrgApplyInfoMapper;
|
||||
|
|
@ -236,7 +238,7 @@ public class OrgApplyInfoServiceImpl extends ServiceImpl<OrgApplyInfoMapper, Org
|
|||
orgApplyInfo.setBuildStatus("3");
|
||||
|
||||
//推送机构信息变更申请消息(小程序)
|
||||
sendOrgAuthInfo(orgApplyInfo.getOpenId(),orgApplyInfo.getId(),"1",orgApplyInfo.getComName());
|
||||
sendOrgAuthInfo(orgApplyInfo.getOpenId(), orgApplyInfo.getId(), "1", orgApplyInfo.getComName());
|
||||
|
||||
}
|
||||
//审批完成后的平台搭建流程(合同上传并提交状态)
|
||||
|
|
@ -246,17 +248,17 @@ public class OrgApplyInfoServiceImpl extends ServiceImpl<OrgApplyInfoMapper, Org
|
|||
orgApplyInfo.setBuildStatus("4");
|
||||
}
|
||||
//审核驳回
|
||||
if(StringUtils.equals("3", orgApplyInfo.getStatus())){
|
||||
if (StringUtils.equals("3", orgApplyInfo.getStatus())) {
|
||||
//推送机构信息变更申请消息(小程序)
|
||||
sendOrgAuthInfo(orgApplyInfo.getOpenId(),orgApplyInfo.getId(),"2",orgApplyInfo.getComName());
|
||||
sendOrgAuthInfo(orgApplyInfo.getOpenId(), orgApplyInfo.getId(), "2", orgApplyInfo.getComName());
|
||||
}
|
||||
|
||||
//机构加盟审批流程
|
||||
baseMapper.updateById(orgApplyInfo);
|
||||
|
||||
if(StringUtils.equals("2", orgApplyInfo.getStatus()) && StringUtils.isNotBlank(orgApplyInfo.getContent())){
|
||||
if (StringUtils.equals("2", orgApplyInfo.getStatus()) && StringUtils.isNotBlank(orgApplyInfo.getContent())) {
|
||||
UpdateWrapper<OrgApplyInfo> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.set("content",null);
|
||||
updateWrapper.set("content", null);
|
||||
updateWrapper.eq("id", orgApplyInfo.getId());
|
||||
update(updateWrapper);
|
||||
}
|
||||
|
|
@ -265,50 +267,50 @@ public class OrgApplyInfoServiceImpl extends ServiceImpl<OrgApplyInfoMapper, Org
|
|||
}
|
||||
|
||||
//小程序订阅推送模板信息
|
||||
public Result sendOrgAuthInfo(String openId, String id, String type, String comName){
|
||||
public Result sendOrgAuthInfo(String openId, String id, String type, String comName) {
|
||||
try {
|
||||
|
||||
// 1. 获取access token
|
||||
String accessToken = WechatMiniProgramUtils.getAccessToken();
|
||||
// 1. 获取access token
|
||||
String accessToken = WechatMiniProgramUtils.getAccessToken();
|
||||
|
||||
// 2. 准备模板消息数据
|
||||
String templateId = "CJ6NDNV4mTTyOdYhbksyA_YjDORVemJRmzEVAUZMBis";
|
||||
String page = "pages/index/index"; // 点击消息跳转的页面
|
||||
// 2. 准备模板消息数据
|
||||
String templateId = "CJ6NDNV4mTTyOdYhbksyA_YjDORVemJRmzEVAUZMBis";
|
||||
String page = "pages/index/index"; // 点击消息跳转的页面
|
||||
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
String content = comName + "审核结果";
|
||||
String auditStatus = "";
|
||||
if(StringUtils.equals("1", type)){
|
||||
auditStatus = "审核通过";
|
||||
}else if(StringUtils.equals("2", type)){
|
||||
auditStatus = "审核驳回";
|
||||
}
|
||||
data.put("thing5", content); // 对应模板中的字段
|
||||
data.put("phrase6", auditStatus);
|
||||
data.put("date2", DateUtils.now());
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
String content = comName + "审核结果";
|
||||
String auditStatus = "";
|
||||
if (StringUtils.equals("1", type)) {
|
||||
auditStatus = "审核通过";
|
||||
} else if (StringUtils.equals("2", type)) {
|
||||
auditStatus = "审核驳回";
|
||||
}
|
||||
data.put("thing5", content); // 对应模板中的字段
|
||||
data.put("phrase6", auditStatus);
|
||||
data.put("date2", DateUtils.now());
|
||||
|
||||
// 3. 发送模板消息
|
||||
String resInfo = TemplateMessageSender.sendTemplateMessage( accessToken, openId, templateId, page, data);
|
||||
if(com.alibaba.cloud.commons.lang.StringUtils.equals(resInfo,"error")){
|
||||
baseCommonService.addLog("机构加盟审核,发送通知失败-发送消息异常56 " +resInfo, CommonConstant.LOG_TYPE_2, 1);
|
||||
return Result.error("发送消息异常");
|
||||
}
|
||||
JSONObject jsonObject = new JSONObject(resInfo);
|
||||
boolean success = jsonObject.getInt("errcode") == 0;
|
||||
if (success) {
|
||||
// 3. 发送模板消息
|
||||
String resInfo = TemplateMessageSender.sendTemplateMessage(accessToken, openId, templateId, page, data);
|
||||
if (com.alibaba.cloud.commons.lang.StringUtils.equals(resInfo, "error")) {
|
||||
baseCommonService.addLog("机构加盟审核,发送通知失败-发送消息异常56 " + resInfo, CommonConstant.LOG_TYPE_2, 1);
|
||||
return Result.error("发送消息异常");
|
||||
}
|
||||
JSONObject jsonObject = new JSONObject(resInfo);
|
||||
boolean success = jsonObject.getInt("errcode") == 0;
|
||||
if (success) {
|
||||
// OrgApplyInfo orgApplyInfo = new OrgApplyInfo();
|
||||
// orgApplyInfo.setId(id);
|
||||
// orgApplyInfo.setBuildStatus("6");
|
||||
// baseMapper.updateById(orgApplyInfo);
|
||||
|
||||
System.out.println("模板消息发送成功");
|
||||
baseCommonService.addLog("机构加盟审核,发送通知成功 " , CommonConstant.LOG_TYPE_2, 1);
|
||||
return Result.ok("发送消息成功");
|
||||
} else {
|
||||
baseCommonService.addLog("机构加盟审核,发送通知失败-发送消息异常68 " +resInfo , CommonConstant.LOG_TYPE_2, 1);
|
||||
System.out.println("模板消息发送失败");
|
||||
return Result.error("发送消息异常");
|
||||
}
|
||||
System.out.println("模板消息发送成功");
|
||||
baseCommonService.addLog("机构加盟审核,发送通知成功 ", CommonConstant.LOG_TYPE_2, 1);
|
||||
return Result.ok("发送消息成功");
|
||||
} else {
|
||||
baseCommonService.addLog("机构加盟审核,发送通知失败-发送消息异常68 " + resInfo, CommonConstant.LOG_TYPE_2, 1);
|
||||
System.out.println("模板消息发送失败");
|
||||
return Result.error("发送消息异常");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error("发送消息异常");
|
||||
|
|
@ -341,7 +343,22 @@ public class OrgApplyInfoServiceImpl extends ServiceImpl<OrgApplyInfoMapper, Org
|
|||
}
|
||||
|
||||
@Override
|
||||
public IPage<OrgAllInfo> getOrgByOpenId(IPage<OrgAllInfo> page, String openId) {
|
||||
return baseMapper.getOrgByOpenId(page, openId);
|
||||
public IPage<OrgAllInfoApiEntity> queryOrgAllInfo(Integer pageNo, Integer pageSize, String orgCode, String title) {
|
||||
IPage<OrgAllInfo> page = new Page<>(pageNo, pageSize);
|
||||
IPage<OrgAllInfo> orgAllInfoIPage = baseMapper.queryOrgInfo(page, orgCode, title);
|
||||
IPage<OrgAllInfoApiEntity> resultPage = new Page<>();
|
||||
resultPage.setCurrent(orgAllInfoIPage.getCurrent());
|
||||
resultPage.setSize(orgAllInfoIPage.getSize());
|
||||
resultPage.setTotal(orgAllInfoIPage.getTotal());
|
||||
resultPage.setPages(orgAllInfoIPage.getPages());
|
||||
|
||||
List<OrgAllInfo> records = orgAllInfoIPage.getRecords();
|
||||
if(records == null || records.size() <= 0){
|
||||
List<OrgAllInfoApiEntity> l_ = List.of();
|
||||
resultPage.setRecords(l_);
|
||||
return resultPage;
|
||||
}
|
||||
resultPage.setRecords(BeanUtil.copyToList(records, OrgAllInfoApiEntity.class));
|
||||
return resultPage;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,9 @@ public class EmployeesMQListener {
|
|||
EmployeesOrg employeesOrg = new EmployeesOrg();
|
||||
employeesOrg.setStatus(dto.getAuditStatus());
|
||||
employeesOrg.setAuditContent(dto.getAuditContent());
|
||||
if("2".equals(dto.getAuditStatus())){
|
||||
employeesOrg.setEntryTime(dto.getEntryTime());//审批通过的话将入职时间设置进去
|
||||
}
|
||||
UpdateWrapper<EmployeesOrg> uw = new UpdateWrapper<>();
|
||||
uw.eq("employees_id",dto.getEmployeeId());
|
||||
uw.eq("org_code",dto.getOrgCode());
|
||||
|
|
|
|||
|
|
@ -1,15 +1,25 @@
|
|||
package com.nu.modules.wechat.employess.api;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.nu.dto.EmployeesApplyMQDto;
|
||||
import com.nu.entity.EmployeesApplyEntity;
|
||||
import com.nu.modules.EmployessInfo.api.EmployeesOrgLocalApi;
|
||||
import com.nu.modules.EmployessInfo.entity.EmployeesOrgApiEntity;
|
||||
import com.nu.modules.orgapplyinfo.api.IOrgApplyInfoApi;
|
||||
import com.nu.modules.orgapplyinfo.entity.EmployeesApiEntity;
|
||||
import com.nu.modules.orgapplyinfo.entity.OrgAllInfoApiEntity;
|
||||
import com.nu.utils.RabbitMQUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/employessapply")
|
||||
|
|
@ -17,19 +27,68 @@ public class EmployessApplyApi {
|
|||
|
||||
@Autowired
|
||||
private RabbitMQUtil rabbitMQUtil;
|
||||
@Autowired
|
||||
private IOrgApplyInfoApi orgApplyInfoApi;
|
||||
@Autowired
|
||||
private EmployeesOrgLocalApi employeesOrgLocalApi;
|
||||
|
||||
/**
|
||||
* 员工申请加入机构
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "员工申请-加入机构申请")
|
||||
@PostMapping("/apply")
|
||||
public Result<Object> saveApiEmployess(@RequestBody EmployeesApplyMQDto dto) {
|
||||
if(StringUtils.isBlank(dto.getOrgCode())){
|
||||
public Result<Object> saveApiEmployess(@RequestBody EmployeesApplyEntity dto) {
|
||||
if (StringUtils.isBlank(dto.getOrgCode())) {
|
||||
return Result.error("申请失败");
|
||||
}
|
||||
rabbitMQUtil.sendToExchange("hldy.employees", dto.getOrgCode() + ".employees.apply", dto);
|
||||
|
||||
employeesOrgLocalApi.apply(dto);
|
||||
|
||||
EmployeesApplyMQDto mqdto = new EmployeesApplyMQDto();
|
||||
BeanUtils.copyProperties(dto,mqdto);
|
||||
rabbitMQUtil.sendToExchange("hldy.employees", dto.getOrgCode() + ".employees.apply", mqdto);
|
||||
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取各机构详细信息
|
||||
*
|
||||
* @param orgCode 机构编码
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/getOrgInfo")
|
||||
public Result<IPage<OrgAllInfoApiEntity>> getModifyInfo(
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "8") Integer pageSize,
|
||||
@RequestParam(value = "orgCode", defaultValue = "", required = false) String orgCode,
|
||||
@RequestParam(value = "title", defaultValue = "", required = false) String title) {
|
||||
IPage<OrgAllInfoApiEntity> result = orgApplyInfoApi.queryOrgAllInfo(pageNo, pageSize, orgCode, title);
|
||||
List<OrgAllInfoApiEntity> sourceRecords = result.getRecords();
|
||||
if (sourceRecords == null || sourceRecords.size() <= 0) {
|
||||
return Result.OK(result);
|
||||
}
|
||||
Map<String, Integer> indexMap = Maps.newHashMap();
|
||||
String orgCodes = "";
|
||||
for (int i = 0; i < sourceRecords.size(); i++) {
|
||||
indexMap.put(sourceRecords.get(i).getOrgCode(), i);
|
||||
orgCodes += sourceRecords.get(i).getOrgCode();
|
||||
}
|
||||
List<EmployeesOrgApiEntity> employeesOrgList = employeesOrgLocalApi.queryAll(orgCodes);
|
||||
if (employeesOrgList != null && employeesOrgList.size() > 0) {
|
||||
employeesOrgList.stream().forEach( eo -> {
|
||||
EmployeesApiEntity en = new EmployeesApiEntity();
|
||||
en.setStatus(eo.getStatus());
|
||||
en.setAuditContent(eo.getAuditContent());
|
||||
en.setIzOnline(eo.getIzOnline());
|
||||
en.setIzFreeze(eo.getIzFreeze());
|
||||
sourceRecords.get(indexMap.get(eo.getOrgCode())).setEmployeesApiEntity(en);
|
||||
});
|
||||
result.setRecords(sourceRecords);
|
||||
}
|
||||
return Result.OK(result);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ public class EmployeesApplyMQDto implements Serializable {
|
|||
|
||||
/**id*/
|
||||
private String id;
|
||||
/**open_id*/
|
||||
private String openId;
|
||||
/**员工id*/
|
||||
private String employeeId;
|
||||
/**姓名*/
|
||||
|
|
@ -81,7 +83,7 @@ public class EmployeesApplyMQDto implements Serializable {
|
|||
private String updateBy;
|
||||
/**更新日期*/
|
||||
private Date updateTime;
|
||||
/**申请状态 0历史 1申请中 2通过 3驳回*/
|
||||
/**申请状态 1申请中 2通过 3驳回*/
|
||||
private String status;
|
||||
/**审核备注*/
|
||||
private String auditContent;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ public class EmployeesStatusMQDto implements Serializable {
|
|||
|
||||
/**员工id*/
|
||||
private String employeeId;
|
||||
/**申请状态 0历史 1申请中 2通过 3驳回*/
|
||||
/**申请状态 1申请中 2通过 3驳回*/
|
||||
private String auditStatus;
|
||||
/**审核备注*/
|
||||
private String auditContent;
|
||||
|
|
@ -27,4 +27,6 @@ public class EmployeesStatusMQDto implements Serializable {
|
|||
private java.lang.String izFreeze;
|
||||
/**机构编码*/
|
||||
private String orgCode;
|
||||
/**入职时间*/
|
||||
private Date entryTime;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,92 @@
|
|||
package com.nu.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description: 员工申请
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-09-05
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
public class EmployeesApplyEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
private String id;
|
||||
/**open_id*/
|
||||
private String openId;
|
||||
/**员工id*/
|
||||
private String employeeId;
|
||||
/**姓名*/
|
||||
private String name;
|
||||
/**性别*/
|
||||
private String sex;
|
||||
/**民族*/
|
||||
private String national;
|
||||
/**身份证号*/
|
||||
private String idCard;
|
||||
/**联系电话*/
|
||||
private String tel;
|
||||
/**出生日期*/
|
||||
private Date dateOfBirth;
|
||||
/**婚否*/
|
||||
private String marriedOrNot;
|
||||
/**身高*/
|
||||
private Double height;
|
||||
/**体重*/
|
||||
private Double weight;
|
||||
/**家庭住址*/
|
||||
private String address;
|
||||
/**是否吸烟*/
|
||||
private String isSmoking;
|
||||
/**健康状况*/
|
||||
private String healthStatus;
|
||||
/**户籍所在地*/
|
||||
private String houseAddress;
|
||||
/**政治面貌*/
|
||||
private String politicalAppearance;
|
||||
/**紧急联系人*/
|
||||
private String emergencyContact;
|
||||
/**紧急联系人电话*/
|
||||
private String emergencyTel;
|
||||
/**紧急联系人与本人关系*/
|
||||
private String emergencyRelationship;
|
||||
/**户口性质*/
|
||||
private String hukouNature;
|
||||
/**身份证正面*/
|
||||
private String idCardPositive;
|
||||
/**身份证反面*/
|
||||
private String idCardNegative;
|
||||
/**健康证正面*/
|
||||
private String healthCertificatePositive;
|
||||
/**健康证反面*/
|
||||
private String healthCertificateNegative;
|
||||
/**银行卡正面*/
|
||||
private String bankPositive;
|
||||
/**银行卡反面*/
|
||||
private String bankNegative;
|
||||
/**资质证*/
|
||||
private String qualification;
|
||||
/**无犯罪证明*/
|
||||
private String noCrimeCertificate;
|
||||
/**区域*/
|
||||
private String regional;
|
||||
/**是否删除 0未删除 1删除*/
|
||||
private String delFlag;
|
||||
/**申请日期*/
|
||||
private Date createTime;
|
||||
/**更新人*/
|
||||
private String updateBy;
|
||||
/**更新日期*/
|
||||
private Date updateTime;
|
||||
/**申请状态 1申请中 2通过 3驳回*/
|
||||
private String status;
|
||||
/**审核备注*/
|
||||
private String auditContent;
|
||||
/**机构编码*/
|
||||
private String orgCode;
|
||||
}
|
||||
Loading…
Reference in New Issue