Commit 16596bd1 authored by hongguangwu's avatar hongguangwu

MVP1.7.18-优化导入与更新

parent 2ff62c0c
......@@ -334,4 +334,33 @@ public class TEmployeeContractPre extends BaseEntity {
@Schema(description = "任务信息")
private String requestMsg;
// 电子签推送需要的新字段:——START
@TableField(exist = false)
@ExcelAttribute(name = "户籍所在地")
private String huArea;
// contactProvince,contactCity,contactTown,
// contactAddress
@TableField(exist = false)
@ExcelAttribute(name = "通讯地址")
private String contactArea;
@TableField(exist = false)
@ExcelAttribute(name = "邮箱")
private String empEmail;
// 紧急联系人表
@TableField(exist = false)
@ExcelAttribute(name = "紧急联系人")
private String contactEmpName;
@TableField(exist = false)
@ExcelAttribute(name = "紧急联系人电话")
private String contactTel;
// relationProvince,relationCity,relationTown
// address
@TableField(exist = false)
@ExcelAttribute(name = "紧急联系人地址")
private String contactAddress;
// 电子签推送需要的新字段——END
}
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import lombok.Data;
/**
* 法大大电子签信推送字段
*/
@Data
public class TEmployeeContractPrePushFascVo {
// idProvince,idCity,idTown
@ExcelAttribute(name = "户籍所在地")
private String huArea;
// contactProvince,contactCity,contactTown,
// contactAddress
@ExcelAttribute(name = "通讯地址")
private String contactArea;
@ExcelAttribute(name = "邮箱")
private String empEmail;
// 紧急联系人表
@ExcelAttribute(name = "紧急联系人")
private String contactEmpName;
@ExcelAttribute(name = "紧急联系人电话")
private String contactTel;
// relationProvince,relationCity,relationTown
// address
@ExcelAttribute(name = "紧急联系人地址")
private String contactAddress;
}
......@@ -21,6 +21,7 @@ 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.TEmpContactInfo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractPrePushFascVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -50,4 +51,10 @@ public interface TEmpContactInfoMapper extends BaseMapper<TEmpContactInfo> {
List<TEmpContactInfo> getContactByDeptId(@Param("deptId") String deptId);
List<TEmpContactInfo> getContactByIdCardList(@Param("idCardList") List<String> idCardList);
/* 获取紧急联系人信息,电子签推送法大大需要用紧急联系人相关字段 */
TEmployeeContractPrePushFascVo getTEmpContactInfoOneByCard(@Param("empIdCard") String empIdCard);
/* 获取档案信息,电子签推送法大大需要用紧急联系人相关字段 */
TEmployeeContractPrePushFascVo getTEmpInfoOneByCard(@Param("empIdCard") String empIdCard);
}
......@@ -21,12 +21,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fasc.open.api.exception.ApiException;
import com.fasc.open.api.v5_1.res.template.SignTemplateListInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.FddContractInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TAttaInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractPreMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.*;
import com.yifu.cloud.plus.v1.yifu.archives.service.*;
import com.yifu.cloud.plus.v1.yifu.archives.utils.FascUtil;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractPrePushFascVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TFascTemplateSearchVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
......@@ -62,6 +60,8 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
private final TFascTemplateDetailService tFascTemplateDetailService;
private final TEmployeeContractPreMapper tEmployeeContractPreMapper;
private final TEmployeeContractInfoMapper tEmployeeContractInfoMapper;
private final TEmployeeInfoMapper tEmployeeInfoMapper;
private final TEmpContactInfoMapper tEmpContactInfoMapper;
private final TAttaInfoMapper tAttaInfoMapper;
private final TFascCompanyService tFascCompanyService;
......@@ -287,11 +287,28 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
if (Common.isEmpty(contract.getContractId())) {
return R.failed("未生成合同,请联系管理员");
}
String empIdCard = contract.getEmpIdcard();
if (Common.isEmpty(empIdCard)) {
return R.failed("未找到身份证,请联系管理员");
}
TEmployeeContractInfo empContract = tEmployeeContractInfoMapper.selectById(contract.getContractId());
if (empContract == null) {
return R.failed(FASC_NO_EMP_CONTRACT);
}
TEmployeeContractPrePushFascVo empContactInfo = tEmpContactInfoMapper.getTEmpContactInfoOneByCard(empIdCard);
TEmployeeContractPrePushFascVo empInfo = tEmpContactInfoMapper.getTEmpInfoOneByCard(empIdCard);
if (empContactInfo != null) {
contract.setContactEmpName(empContactInfo.getContactEmpName());
contract.setContactTel(empContactInfo.getContactTel());
contract.setContactAddress(empContactInfo.getContactAddress());
}
if (empInfo != null) {
contract.setHuArea(empInfo.getHuArea());
contract.setContactArea(empInfo.getContactArea());
contract.setEmpEmail(empInfo.getEmpEmail());
}
if (Common.isEmpty(contract.getFadadaTemplateId())) {
return R.failed("未找到合同模板ID,请联系管理员");
......
......@@ -110,6 +110,43 @@
</where>
</select>
<!-- 获取紧急联系人信息,电子签推送法大大需要用紧急联系人相关字段 -->
<select id="getTEmpContactInfoOneByCard" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractPrePushFascVo">
SELECT
a.EMP_NAME contactEmpName,a.tel contactTel,concat(ifnull(sp.AREA_NAME,'')
,ifnull(sc.AREA_NAME,'')
,ifnull(st.AREA_NAME,'')
,ifnull(a.ADDRESS,'')
) contactAddress
from t_emp_contact_info a
left join sys_area sp on sp.id = a.RELATION_PROVINCE
left join sys_area sc on sc.id = a.RELATION_CITY
left join sys_area st on st.id = a.RELATION_TOWN
where a.EMP_IDCARD = #{empIdCard} ORDER BY a.CREATE_TIME desc limit 1
</select>
<!-- 获取档案信息,电子签推送法大大需要用紧急联系人相关字段 -->
<select id="getTEmpInfoOneByCard" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractPrePushFascVo">
select
concat(ifnull(sp.AREA_NAME,'')
,ifnull(sc.AREA_NAME,'')
,ifnull(st.AREA_NAME,'')
) huArea,
concat(ifnull(sp2.AREA_NAME,'')
,ifnull(sc2.AREA_NAME,'')
,ifnull(st2.AREA_NAME,'')
,ifnull(a.CONTACT_ADDRESS,'')
) contactArea,a.EMP_EMAIL empEmail
from t_employee_info a
left join sys_area sp on sp.id = a.ID_PROVINCE
left join sys_area sc on sc.id = a.ID_CITY
left join sys_area st on st.id = a.ID_TOWN
left join sys_area sp2 on sp2.id = a.CONTACT_PROVINCE
left join sys_area sc2 on sc2.id = a.CONTACT_CITY
left join sys_area st2 on st2.id = a.CONTACT_TOWN
where a.EMP_IDCARD = #{empIdCard} ORDER BY a.CREATE_TIME desc limit 1
</select>
<select id="getContactByDeptId" resultMap="tEmpContactInfoMap">
SELECT
<include refid="Base_Column_List"/>
......
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