Commit d09686bb authored by fangxinjiang's avatar fangxinjiang

测试环境校验服务

parent 58dc8f00
......@@ -12,6 +12,7 @@ import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
/**
......@@ -182,4 +183,5 @@ public class DispatchEmpVo implements Serializable {
@ExcelAttribute(name = "业务细分", maxLength = 32, needExport = true)
@Schema(description = "业务细分(存lable)", name = "contractName")
private String contractSubName;
}
......@@ -669,7 +669,7 @@
a.ID_TOWN,a.EMP_REGIS_TYPE,a.FILE_PROVINCE,a.FILE_CITY,a.FILE_TOWN,a.HIGN_EDUCATION,a.FILE_STATUS,
b.CONTRACT_NAME,b.CONTRACT_TYPE,
b.CONTRACT_START,b.CONTRACT_END,b.CONTRACT_TERM,b.CONTRACT_SUB_NAME,
b.CONTRACT_START,b.CONTRACT_END,b.CONTRACT_TERM,b.CONTRACT_SUB_NAME
c.UNIT_NAME,
c.UNIT_NO,c.DEPT_ID,c.DEPT_NAME,c.DEPT_NO,c.POST
......
......@@ -298,4 +298,11 @@ public class Common {
}
return false;
}
public static String isNotNullToStr(Integer value) {
if (Common.isNotNull(value)){
return Integer.toString(value);
}
return null;
}
}
......@@ -253,7 +253,7 @@ public class TDispatchInfo extends BaseEntity {
@ExcelAttribute(name = "合同年限" )
@Schema(description = "合同年限" )
@ExcelProperty("合同年限" )
private Double contractTerm;
private String contractTerm;
/**
* 户口性质
*/
......@@ -262,21 +262,7 @@ public class TDispatchInfo extends BaseEntity {
@Schema(description = "户口性质" )
@ExcelProperty("户口性质" )
private String empRegisType;
/**
* 入职日期
*/
@ExcelAttribute(name = "入职日期", isDate = true)
@Schema(description = "入职日期" )
@ExcelProperty("入职日期" )
private Date enjoinDate;
/**
* 试用期(单位月)
*/
@Length(max = 32, message = "试用期(单位月) 不能超过32个字符" )
@ExcelAttribute(name = "试用期(单位月)", maxLength = 32)
@Schema(description = "试用期(单位月)" )
@ExcelProperty("试用期(单位月)" )
private String tryPeriod;
/**
* 档案所在地
*/
......@@ -331,15 +317,15 @@ public class TDispatchInfo extends BaseEntity {
@ExcelProperty("合同类型" )
private String contractType;
/**
* 社保办理状态 0 未办理 1 全部办理成功(原-已办理) 2 全部办理失败(原-办理失败) 3已派减
* 社保办理状态 0 未办理 1 全部办理成功(原-已办理) 2 全部办理失败(原-办理失败) 3已派减(已废弃)
*/
@Length(max = 1, message = "社保办理状态 0 未办理 1 全部办理成功(原-已办理) 2 全部办理失败(原-办理失败) 3已派减 不能超过1个字符" )
@ExcelAttribute(name = "社保办理状态 0 未办理 1 全部办理成功(原-已办理) 2 全部办理失败(原-办理失败) 3已派减", maxLength = 1)
@Schema(description = "社保办理状态 0 未办理 1 全部办理成功(原-已办理) 2 全部办理失败(原-办理失败) 3已派减" )
@ExcelProperty("社保办理状态 0 未办理 1 全部办理成功(原-已办理) 2 全部办理失败(原-办理失败) 3已派减" )
@Length(max = 1, message = "社保办理状态 不能超过1个字符" )
@ExcelAttribute(name = "社保办理状态", maxLength = 1)
@Schema(description = "社保办理状态 0 未办理 1 全部办理成功(原-已办理) 2 全部办理失败(原-办理失败) " )
@ExcelProperty("社保办理状态" )
private String socialHandleStatus;
/**
* 公积金办理状态
* 公积金办理状态:0 未办理 1办理成功 2 办理失败
*/
@Length(max = 1, message = "公积金办理状态 不能超过1个字符" )
@ExcelAttribute(name = "公积金办理状态", maxLength = 1)
......@@ -442,12 +428,12 @@ public class TDispatchInfo extends BaseEntity {
@ExcelProperty("审核时间" )
private Date auditTime;
/**
* 1标准工时 2 综合工时 3不定时工时制
* 工时制:1标准工时 2 综合工时 3不定时工时制
*/
@Length(max = 1, message = "1标准工时 2 综合工时 3不定时工时制 不能超过1个字符" )
@ExcelAttribute(name = "1标准工时 2 综合工时 3不定时工时制", maxLength = 1)
@Schema(description = "1标准工时 2 综合工时 3不定时工时制" )
@ExcelProperty("1标准工时 2 综合工时 3不定时工时制" )
@Length(max = 1, message = "工时制 不能超过1个字符" )
@ExcelAttribute(name = "工时制", maxLength = 1, readConverterExp = "1=标准工时,2=综合工时,3=不定时工时制")
@Schema(description = "工时制:1标准工时 2 综合工时 3不定时工时制" )
@ExcelProperty("工时制" )
private String workingHours;
/**
* 申请人所在部门
......
......@@ -234,7 +234,7 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
@ExcelAttribute(name = "合同期限", isInteger = true )
@Schema(description = "合同期限" )
@ExcelProperty("合同期限" )
private Integer contractTerm;
private String contractTerm;
/**
* 学历名称
......
......@@ -35,8 +35,10 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.social.entity.*;
import com.yifu.cloud.plus.v1.yifu.social.mapper.SysBaseSetInfoMapper;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TDispatchInfoMapper;
......@@ -189,6 +191,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
@Override
public R<List<ErrorMessage>> importDiy(InputStream inputStream) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(user)){
R.failed(CommonConstants.USER_FAIL);
}
List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<TDispatchImportVo> util1 = new ExcelUtil<>(TDispatchImportVo.class);
;
......@@ -234,7 +240,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
*/
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
importTDispatchInfo(cachedDataList, errorMessageList);
importTDispatchInfo(cachedDataList, errorMessageList,user);
log.info("存储数据库成功!");
}
}).sheet().doRead();
......@@ -246,7 +252,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
@GlobalTransactional
private void importTDispatchInfo(List<TDispatchImportVo> excelVOList, List<ErrorMessage> errorMessageList) {
private void importTDispatchInfo(List<TDispatchImportVo> excelVOList,
List<ErrorMessage> errorMessageList,
YifuUser user) {
// 个性化校验逻辑
ErrorMessage errorMsg;
List<String> idcards = new ArrayList<>();
......@@ -333,13 +341,49 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
dispatch.setEmpNational(excel.getEmpNational());
dispatch.setEmpType(excel.getEmpType());
dispatch.setEmpMobile(excel.getEmpMobile());
dispatch.setType(CommonConstants.ZERO_STRING);
dispatch.setCurrentOperator(user.getNickname());
dispatch.setTrustRemark(excel.getTrustRemark());
dispatch.setFundHandleStatus(CommonConstants.ZERO_STRING);
dispatch.setSocialHandleStatus(CommonConstants.ZERO_STRING);
if (Common.isNotNull(socialSet)){
dispatch.setSocialProvince(Common.isNotNullToStr(socialSet.getProvince()));
dispatch.setSocialCity(Common.isNotNullToStr(socialSet.getCity()));
dispatch.setSocialTown(Common.isNotNullToStr(socialSet.getTown()));
}
if (Common.isNotNull(fundSet)){
dispatch.setFundProvince(Common.isNotNullToStr(fundSet.getProvince()));
dispatch.setFundCity(Common.isNotNullToStr(fundSet.getCity()));
dispatch.setFundTown(Common.isNotNullToStr(fundSet.getTown()));
}
// 默认待审核
dispatch.setStatus(CommonConstants.ONE_STRING);
dispatch.setDeleteFlag(CommonConstants.ZERO_STRING);
// 封装结算主体客户信息 TODO
dispatch.setSettleDomainName("");
dispatch.setSettleDomain("");
dispatch.setBelongUnit("");
dispatch.setBelongUnitName("");
// 封装合同信息 默认取值派单的
dispatch.setContractStart(excel.getContractStart());
dispatch.setContractEnd(excel.getContractEnd());
dispatch.setContractTerm(excel.getContractTerm());
dispatch.setContractType(excel.getContractType());
dispatch.setWorkingHours(excel.getWorkingHours());
// 判断
// 封装客户信息
if (Common.isNotNull(empVo)){
dispatch.setEmpId(empVo.getId());
dispatch.setEmpNo(empVo.getEmpCode());
//TODO
dispatch.setSettleDomain(empVo.getDeptId());
dispatch.setSettleDomainName(empVo.getDeptName());
// 封装合同信息 如果有合同取值实际合同信息
dispatch.setContractStart(empVo.getContractStart());
dispatch.setContractEnd(empVo.getContractEnd());
dispatch.setContractTerm(empVo.getContractTerm());
dispatch.setContractType(empVo.getContractType());
dispatch.setFileProvince(empVo.getFileProvince());
dispatch.setFileCity(empVo.getFileCity());
dispatch.setFileTown(empVo.getFileTown());
}
dispatchMap.put(excel.getEmpIdcard(),dispatch);
// 变更社保公积金查询
......
......@@ -349,19 +349,23 @@
<!--获取对应户名称的公积金基数信息-->
<select id="getFundBaseSet" resultMap="sysBaseSetInfoMap">
select
<include refid="base_column_list"/>
FROM sys_base_set_info a
<where>
1=1
and a.APPLY_START_DATE <![CDATA[ <= ]]> now()
and a.APPLY_END_DATE >= now()
<if test="fundHolds != null and fundHolds.size > 0">
a.DEPART_NAME in
and a.DEPART_NAME in
<foreach collection="fundHolds" item="item" open="(" close=")" separator="," >
#{item}
</foreach>
</if>
and a.APPLY_START_DATE <![CDATA[ <= ]]> now()
and a.APPLY_END_DATE <![CDATA[ >= ]] now()
and a.DELETE_FLAG = '0' and a.status='0' and a.BASE_TYPE = '1'
and a.DELETE_FLAG = '0'
and a.status ='0'
and a.BASE_TYPE = '1'
</where>
</select>
</mapper>
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