个税扣缴义务人、薪资账套 导入添加员工状态导入功能
This commit is contained in:
parent
091221d0d4
commit
69dd9cc61c
|
|
@ -35,7 +35,7 @@ public class SalarySobRangeSaveBO {
|
|||
* @param employeeId
|
||||
* @return
|
||||
*/
|
||||
public static Result handle(List<SalarySobRangePO> salarySobRanges, SalarySobRangeSaveParam saveParam, Long employeeId) {
|
||||
public static Result handle(List<SalarySobRangePO> salarySobRanges, SalarySobRangeSaveParam saveParam, Long employeeId, boolean isImport) {
|
||||
Date now = new Date();
|
||||
Result handleResult = Result.builder()
|
||||
.needInsertSalarySobRanges(Lists.newArrayList())
|
||||
|
|
@ -49,8 +49,11 @@ public class SalarySobRangeSaveBO {
|
|||
String key = saveParam.getIncludeType() + "-" + targetParam.getTargetType().getValue() + "-" + targetParam.getTargetId();
|
||||
if (salarySobRangeMap.containsKey(key)) {
|
||||
SalarySobRangePO salarySobRangePO = salarySobRangeMap.get(key);
|
||||
salarySobRangePO.setEmployeeStatuses(parseEnumListToStr(saveParam.getEmployeeStatus()));
|
||||
// salarySobRangePO.setEmployeeStatus(saveParam.getEmployeeStatus().getValue());
|
||||
if(isImport){
|
||||
salarySobRangePO.setEmployeeStatuses(parseEnumListToStr(targetParam.getEmployeeStatus()));
|
||||
}else {
|
||||
salarySobRangePO.setEmployeeStatuses(parseEnumListToStr(saveParam.getEmployeeStatus()));
|
||||
}
|
||||
salarySobRangePO.setUpdateTime(now);
|
||||
handleResult.getNeedUpdateSalarySobRanges().add(salarySobRangePO);
|
||||
continue;
|
||||
|
|
@ -59,7 +62,7 @@ public class SalarySobRangeSaveBO {
|
|||
.salarySobId(saveParam.getSalarySobId())
|
||||
.targetType(targetParam.getTargetType().getValue())
|
||||
.targetId(targetParam.getTargetId())
|
||||
.employeeStatuses(parseEnumListToStr(saveParam.getEmployeeStatus()))
|
||||
// .employeeStatuses(parseEnumListToStr(saveParam.getEmployeeStatus()))
|
||||
// .employeeStatus(saveParam.getEmployeeStatus().getValue())
|
||||
.includeType(saveParam.getIncludeType())
|
||||
.creator(employeeId)
|
||||
|
|
@ -68,6 +71,13 @@ public class SalarySobRangeSaveBO {
|
|||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.deleteType(0)
|
||||
.build();
|
||||
|
||||
if(isImport){
|
||||
salarySobRangePO.setEmployeeStatuses(parseEnumListToStr(targetParam.getEmployeeStatus()));
|
||||
}else{
|
||||
salarySobRangePO.setEmployeeStatuses(parseEnumListToStr(saveParam.getEmployeeStatus()));
|
||||
}
|
||||
|
||||
handleResult.getNeedInsertSalarySobRanges().add(salarySobRangePO);
|
||||
}
|
||||
return handleResult;
|
||||
|
|
|
|||
|
|
@ -54,4 +54,10 @@ public class SalarySobRangeImportListDTO {
|
|||
@ExcelProperty(index = 3)
|
||||
private String jobNum;
|
||||
|
||||
//人员状态
|
||||
@SalaryTableColumn(text = "员工状态", width = "10%", column = "employeeStatus")
|
||||
@TableTitle(title = "员工状态", dataIndex = "employeeStatus", key = "employeeStatus")
|
||||
@ExcelProperty(index = 4)
|
||||
private String employeeStatus;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,6 +48,10 @@ public class SalarySobRangeSaveParam {
|
|||
//@DataCheck(require = true, message = "对象不能为空")
|
||||
private Long targetId;
|
||||
|
||||
//员工状态 -- 导入使用
|
||||
// @DataCheck(require = true, message = "员工状态不允许为空")
|
||||
private SalaryEmployeeStatusEnum[] employeeStatus;
|
||||
|
||||
// 安全级别最小值
|
||||
// private Long minSecLevel;
|
||||
|
||||
|
|
|
|||
|
|
@ -340,13 +340,13 @@ public class TaxAgentBO {
|
|||
}
|
||||
}
|
||||
|
||||
public static Result handleTaxAgentRange(List<TaxAgentManageRangePO> taxAgentManageRanges, TaxAgentManageRangeSaveParam saveParam, Long taxAgentId, Long employeeId) {
|
||||
return handleManageRange(taxAgentManageRanges, saveParam, TaxAgentRangeTypeEnum.TAXAGENT, taxAgentId, 0L, employeeId);
|
||||
public static Result handleTaxAgentRange(List<TaxAgentManageRangePO> taxAgentManageRanges, TaxAgentManageRangeSaveParam saveParam, Long taxAgentId, Long employeeId, boolean isImport) {
|
||||
return handleManageRange(taxAgentManageRanges, saveParam, TaxAgentRangeTypeEnum.TAXAGENT, taxAgentId, 0L, employeeId, isImport);
|
||||
}
|
||||
|
||||
public static Result handleSubAdminRange(List<TaxAgentManageRangePO> taxAgentManageRanges, TaxAgentManageRangeSaveParam saveParam, Long taxAgentId, Long subAdminId,
|
||||
Long employeeId) {
|
||||
return handleManageRange(taxAgentManageRanges, saveParam, TaxAgentRangeTypeEnum.SUBADMIN, taxAgentId, subAdminId, employeeId);
|
||||
Long employeeId, boolean isImport) {
|
||||
return handleManageRange(taxAgentManageRanges, saveParam, TaxAgentRangeTypeEnum.SUBADMIN, taxAgentId, subAdminId, employeeId, isImport);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -360,7 +360,7 @@ public class TaxAgentBO {
|
|||
* @return
|
||||
*/
|
||||
private static Result handleManageRange(List<TaxAgentManageRangePO> taxAgentManageRanges, TaxAgentManageRangeSaveParam saveParam,
|
||||
TaxAgentRangeTypeEnum rangeTypeEnum, Long taxAgentId, Long subAdminId, Long employeeId) {
|
||||
TaxAgentRangeTypeEnum rangeTypeEnum, Long taxAgentId, Long subAdminId, Long employeeId, boolean isImport) {
|
||||
Date now = new Date();
|
||||
Result handleResult = Result.builder()
|
||||
.needInsertTaxAgentManageRanges(Lists.newArrayList())
|
||||
|
|
@ -375,7 +375,11 @@ public class TaxAgentBO {
|
|||
String key = saveParam.getIncludeType() + "-" + targetParam.getTargetType().getValue() + "-" + targetParam.getTargetId() + "-" + rangeTypeEnum.getValue();
|
||||
if (taxAgentManageRangeMap.containsKey(key)) {
|
||||
TaxAgentManageRangePO taxAgentManageRange = taxAgentManageRangeMap.get(key);
|
||||
taxAgentManageRange.setEmployeeStatus(JsonUtil.toJsonString(saveParam.getEmployeeStatus()));
|
||||
if(isImport){
|
||||
taxAgentManageRange.setEmployeeStatus(JsonUtil.toJsonString(targetParam.getEmployeeStatus()));
|
||||
}else {
|
||||
taxAgentManageRange.setEmployeeStatus(JsonUtil.toJsonString(saveParam.getEmployeeStatus()));
|
||||
}
|
||||
taxAgentManageRange.setUpdateTime(now);
|
||||
handleResult.getNeedUpdateTaxAgentManageRanges().add(taxAgentManageRange);
|
||||
continue;
|
||||
|
|
@ -387,7 +391,6 @@ public class TaxAgentBO {
|
|||
.rangeType(rangeTypeEnum.getValue())
|
||||
.targetType(targetParam.getTargetType().getValue())
|
||||
.targetId(targetParam.getTargetId())
|
||||
.employeeStatus(JsonUtil.toJsonString(saveParam.getEmployeeStatus()))
|
||||
.includeType(saveParam.getIncludeType())
|
||||
.creator(employeeId)
|
||||
.createTime(now)
|
||||
|
|
@ -395,6 +398,11 @@ public class TaxAgentBO {
|
|||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.deleteType(0)
|
||||
.build();
|
||||
if(isImport){
|
||||
taxAgentManageRange.setEmployeeStatus(JsonUtil.toJsonString(targetParam.getEmployeeStatus()));
|
||||
}else {
|
||||
taxAgentManageRange.setEmployeeStatus(JsonUtil.toJsonString(saveParam.getEmployeeStatus()));
|
||||
}
|
||||
handleResult.getNeedInsertTaxAgentManageRanges().add(taxAgentManageRange);
|
||||
}
|
||||
return handleResult;
|
||||
|
|
|
|||
|
|
@ -62,6 +62,12 @@ public class TaxAgentManageRangeEmployeeListDTO {
|
|||
@ExcelProperty(index = 3)
|
||||
private String jobNum;
|
||||
|
||||
//人员状态
|
||||
@SalaryTableColumn(text = "员工状态", width = "10%", column = "employeeStatus")
|
||||
@TableTitle(title = "员工状态", dataIndex = "employeeStatus", key = "employeeStatus")
|
||||
@ExcelProperty(index = 4)
|
||||
private String employeeStatus;
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -53,5 +53,10 @@ public class TaxAgentManageRangeSaveParam {
|
|||
*/
|
||||
@DataCheck(require = true,message = "对象不能为空")
|
||||
private Long targetId;
|
||||
|
||||
/**
|
||||
* 导入使用,员工状态
|
||||
*/
|
||||
private Collection<String> employeeStatus;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
|
|||
import com.engine.salary.enums.BaseEnum;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
|
@ -103,17 +104,64 @@ public enum SalaryEmployeeStatusEnum implements BaseEnum<Integer> {
|
|||
return values;
|
||||
}
|
||||
|
||||
// /***
|
||||
// * @description 获取所有人员状态value,返回string格式用”,“间隔
|
||||
// * @return List<String>
|
||||
// * @author Harryxzy
|
||||
// * @date 2023/1/9 14:35
|
||||
// */
|
||||
// public static String getAllSalaryEmployeeStatusValuesStr() {
|
||||
// StringBuilder sb = new StringBuilder();
|
||||
// for (SalaryEmployeeStatusEnum statusEnum : SalaryEmployeeStatusEnum.values()) {
|
||||
// sb.append(statusEnum.getValue());
|
||||
// }
|
||||
// return sb.toString();
|
||||
// }
|
||||
|
||||
/**
|
||||
* @description 根据string”、“间隔的格式,获取所有人员状态value集合
|
||||
* @return List<String>
|
||||
* @author Harryxzy
|
||||
* @date 2023/1/9 14:35
|
||||
*/
|
||||
public static List<String> parseByFormatStr(String statusStr, Boolean[] haveError) {
|
||||
List<String> result = new ArrayList<>();
|
||||
String[] status = statusStr.split("、");
|
||||
Arrays.stream(status).forEach(s -> {
|
||||
|
||||
String value = null;
|
||||
for (SalaryEmployeeStatusEnum statusEnum : SalaryEmployeeStatusEnum.values()) {
|
||||
if (Objects.equals(statusEnum.getDefaultLabel(), s)) {
|
||||
value = ObjectUtil.toString(statusEnum.getValue());
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(value != null ){
|
||||
result.add(value);
|
||||
}else{
|
||||
haveError[0] = true;
|
||||
return;
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description 根据string”、“间隔的格式,获取所有人员状态枚举数组
|
||||
* @return List<String>
|
||||
* @author Harryxzy
|
||||
* @date 2023/1/9 14:35
|
||||
*/
|
||||
public static SalaryEmployeeStatusEnum[] getEnumsParseByFormatStr(String statusStr, Boolean[] haveError) {
|
||||
List<SalaryEmployeeStatusEnum> result = new ArrayList<>();
|
||||
String[] status = statusStr.split("、");
|
||||
Arrays.stream(status).forEach(s -> {
|
||||
|
||||
SalaryEmployeeStatusEnum value = null;
|
||||
for (SalaryEmployeeStatusEnum statusEnum : SalaryEmployeeStatusEnum.values()) {
|
||||
if (Objects.equals(statusEnum.getDefaultLabel(), s)) {
|
||||
value =statusEnum;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(value != null ){
|
||||
result.add(value);
|
||||
}else{
|
||||
haveError[0] = true;
|
||||
return;
|
||||
}
|
||||
});
|
||||
SalaryEmployeeStatusEnum[] array = new SalaryEmployeeStatusEnum[result.size()];
|
||||
result.toArray(array);
|
||||
return array;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange
|
|||
// 查询已有的人员范围
|
||||
List<SalarySobRangePO> salarySobRangePOS = listBySalarySobIdAndIncludeType(saveParam.getSalarySobId(), saveParam.getIncludeType());
|
||||
// 处理一下本次的保存参数(如果原来添加过对应的人员(/部门/岗位),那么本次不需要新增,只需要更新)
|
||||
SalarySobRangeSaveBO.Result result = SalarySobRangeSaveBO.handle(salarySobRangePOS, saveParam, (long) user.getUID());
|
||||
SalarySobRangeSaveBO.Result result = SalarySobRangeSaveBO.handle(salarySobRangePOS, saveParam, (long) user.getUID(), false);
|
||||
// 保存
|
||||
if (CollectionUtils.isNotEmpty(result.getNeedInsertSalarySobRanges())) {
|
||||
salarySobRangeBiz.batchInsert(result.getNeedInsertSalarySobRanges());
|
||||
|
|
@ -243,12 +243,14 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange
|
|||
String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0";
|
||||
// 注释
|
||||
List<ExcelComment> excelComments = Lists.newArrayList();
|
||||
if(salarySysConfPO.getConfValue().equals("1")){
|
||||
if(confValue.equals("1")){
|
||||
// 人员校验规则为工号
|
||||
excelComments.add(new ExcelComment(3, 0, 4, 2, SalaryI18nUtil.getI18nLabel(100344, "必填")));
|
||||
}else {
|
||||
excelComments.add(new ExcelComment(0, 0, 1, 2, SalaryI18nUtil.getI18nLabel(100344, "必填")));
|
||||
}
|
||||
excelComments.add(new ExcelComment(4, 0, 6, 3, SalaryI18nUtil.getI18nLabel(100344, "若不填,默认全部员工状态。指定员工状态格式:试用、正式、临时、试用延期")));
|
||||
|
||||
|
||||
//获取excel
|
||||
return ExcelUtil.genWorkbookV2(rowList, "薪资账套人员范围", excelComments);
|
||||
|
|
@ -284,7 +286,7 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange
|
|||
InputStream fileInputStream = null;
|
||||
try {
|
||||
fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId));
|
||||
List<SalarySobRangeImportListDTO> salarySobRangeImportLists = ExcelParseHelper.parse2Map(fileInputStream, SalarySobRangeImportListDTO.class, 0, 1, 4, "SpecialAddDeductionTemplate.xlsx");
|
||||
List<SalarySobRangeImportListDTO> salarySobRangeImportLists = ExcelParseHelper.parse2Map(fileInputStream, SalarySobRangeImportListDTO.class, 0, 1, 5, "SpecialAddDeductionTemplate.xlsx");
|
||||
|
||||
int total = salarySobRangeImportLists.size();
|
||||
int index = 0;
|
||||
|
|
@ -317,6 +319,7 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange
|
|||
String deparmentName = dto.getDepartmentName();
|
||||
String mobile = dto.getMobile();
|
||||
String workcode = dto.getJobNum();
|
||||
String employeeStatusStr = dto.getEmployeeStatus();
|
||||
List<Long> employeeSameIds = new ArrayList<>();
|
||||
|
||||
//筛选导入人员信息可以在人力资源池中匹配到的人员信息
|
||||
|
|
@ -360,6 +363,25 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange
|
|||
errorSum += 1;
|
||||
}
|
||||
}
|
||||
|
||||
// 设置员工状态
|
||||
if(StringUtils.isEmpty(employeeStatusStr)){
|
||||
SalaryEmployeeStatusEnum[] values = SalaryEmployeeStatusEnum.values();
|
||||
po.setEmployeeStatus(SalaryEmployeeStatusEnum.values());
|
||||
}else{
|
||||
Boolean[] haveError = {false};
|
||||
// 人员状态字符串转换为对应的value
|
||||
SalaryEmployeeStatusEnum[] status = SalaryEmployeeStatusEnum.getEnumsParseByFormatStr(employeeStatusStr, haveError);
|
||||
if(haveError[0]){
|
||||
Map<String, String> errorMessageMap = new HashMap<>();
|
||||
errorMessageMap.put("message", rowIndex + "员工状态不存在,或格式有误。格式为:试用、正式、临时、试用延期");
|
||||
errorData.add(errorMessageMap);
|
||||
errorSum += 1;
|
||||
}else{
|
||||
po.setEmployeeStatus(status);
|
||||
}
|
||||
}
|
||||
|
||||
//fixme 分权判断
|
||||
if (errorSum == 0) {
|
||||
successCount += 1;
|
||||
|
|
@ -377,11 +399,11 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange
|
|||
List<SalarySobRangePO> salarySobRangePOS = listBySalarySobIdAndIncludeType(salarySobId, 1);
|
||||
SalarySobRangeSaveParam saveParam = new SalarySobRangeSaveParam();
|
||||
saveParam.setTargetParams(eligibleData);
|
||||
saveParam.setEmployeeStatus( SalaryEmployeeStatusEnum.values());
|
||||
// saveParam.setEmployeeStatus( SalaryEmployeeStatusEnum.values());
|
||||
saveParam.setIncludeType(1);
|
||||
saveParam.setSalarySobId(salarySobId);
|
||||
// 处理一下本次的保存参数(如果原来添加过对应的人员(/部门/岗位),那么本次不需要新增,只需要更新)
|
||||
SalarySobRangeSaveBO.Result result = SalarySobRangeSaveBO.handle(salarySobRangePOS, saveParam, (long) user.getUID());
|
||||
SalarySobRangeSaveBO.Result result = SalarySobRangeSaveBO.handle(salarySobRangePOS, saveParam, (long) user.getUID(), true);
|
||||
// 保存
|
||||
if (CollectionUtils.isNotEmpty(result.getNeedInsertSalarySobRanges())) {
|
||||
salarySobRangeBiz.batchInsert(result.getNeedInsertSalarySobRanges());
|
||||
|
|
@ -433,7 +455,7 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange
|
|||
InputStream fileInputStream = null;
|
||||
try {
|
||||
fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId));
|
||||
List<SalarySobRangeImportListDTO> salarySobRangeImportList = ExcelParseHelper.parse2Map(fileInputStream, SalarySobRangeImportListDTO.class, 0, 1, 4, "TaxAgentEmployee.xlsx");
|
||||
List<SalarySobRangeImportListDTO> salarySobRangeImportList = ExcelParseHelper.parse2Map(fileInputStream, SalarySobRangeImportListDTO.class, 0, 1, 5, "TaxAgentEmployee.xlsx");
|
||||
apidatas.put("preview", salarySobRangeImportList);
|
||||
} finally {
|
||||
IOUtils.closeQuietly(fileInputStream);
|
||||
|
|
@ -455,6 +477,7 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange
|
|||
headers.add(SalaryI18nUtil.getI18nLabel( 86185, "部门"));
|
||||
headers.add(SalaryI18nUtil.getI18nLabel(86186, "手机号"));
|
||||
headers.add(SalaryI18nUtil.getI18nLabel(86317, "工号"));
|
||||
headers.add(SalaryI18nUtil.getI18nLabel(86318, "员工状态"));
|
||||
List<List<Object>> rowList = new ArrayList<>();
|
||||
rowList.add(headers);
|
||||
return rowList;
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ public class TaxAgentExcelServiceImpl extends Service implements TaxAgentExcelSe
|
|||
// 注释
|
||||
List<ExcelComment> excelComments = Lists.newArrayList();
|
||||
excelComments.add(new ExcelComment(0, 0, 1, 2, SalaryI18nUtil.getI18nLabel(100344, "必填")));
|
||||
excelComments.add(new ExcelComment(4, 0, 6, 3, SalaryI18nUtil.getI18nLabel(100344, "若不填,默认全部员工状态。指定员工状态格式:试用、正式、临时、试用延期")));
|
||||
//获取excel
|
||||
return ExcelUtil.genWorkbookV2(rowList, "个税扣缴义务人人员范围", excelComments);
|
||||
}
|
||||
|
|
@ -61,7 +62,7 @@ public class TaxAgentExcelServiceImpl extends Service implements TaxAgentExcelSe
|
|||
InputStream fileInputStream = null;
|
||||
try {
|
||||
fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId));
|
||||
List<TaxAgentManageRangeEmployeeListDTO> taxAgentManageRangeEmployees = ExcelParseHelper.parse2Map(fileInputStream, TaxAgentManageRangeEmployeeListDTO.class, 0, 1, 4, "TaxAgentEmployee.xlsx");
|
||||
List<TaxAgentManageRangeEmployeeListDTO> taxAgentManageRangeEmployees = ExcelParseHelper.parse2Map(fileInputStream, TaxAgentManageRangeEmployeeListDTO.class, 0, 1, 5, "TaxAgentEmployee.xlsx");
|
||||
apidatas.put("preview", taxAgentManageRangeEmployees);
|
||||
} finally {
|
||||
IOUtils.closeQuietly(fileInputStream);
|
||||
|
|
@ -85,6 +86,7 @@ public class TaxAgentExcelServiceImpl extends Service implements TaxAgentExcelSe
|
|||
headers.add(SalaryI18nUtil.getI18nLabel( 86185, "部门"));
|
||||
headers.add(SalaryI18nUtil.getI18nLabel(86186, "手机号"));
|
||||
headers.add(SalaryI18nUtil.getI18nLabel(86317, "工号"));
|
||||
headers.add(SalaryI18nUtil.getI18nLabel(86318, "员工状态"));
|
||||
List<List<Object>> rowList = new ArrayList<>();
|
||||
rowList.add(headers);
|
||||
return rowList;
|
||||
|
|
|
|||
|
|
@ -303,7 +303,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
|
||||
List<TaxAgentManageRangePO> taxAgentManageRanges = taxAgentManageAllRanges.stream().filter(f -> f.getIncludeType().equals(saveParam.getIncludeType())).collect(Collectors.toList());
|
||||
// 处理一下本次的保存参数(如果原来添加过对应的人员(/部门/岗位),那么本次不需要新增,只需要更新)
|
||||
TaxAgentBO.Result result = TaxAgentBO.handleTaxAgentRange(taxAgentManageRanges, saveParam, taxAgent.getId(), (long) user.getUID());
|
||||
TaxAgentBO.Result result = TaxAgentBO.handleTaxAgentRange(taxAgentManageRanges, saveParam, taxAgent.getId(), (long) user.getUID(), false);
|
||||
|
||||
/* 检查当前个税扣缴义务人的所有人员范围与所有分管理员的管理范围===========================start */
|
||||
List<TaxAgentManageRangePO> allRanges = Lists.newArrayList(taxAgentManageAllRanges);
|
||||
|
|
@ -562,7 +562,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
InputStream fileInputStream = null;
|
||||
try {
|
||||
fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId));
|
||||
List<TaxAgentManageRangeEmployeeListDTO> rangeEmployees = ExcelParseHelper.parse2Map(fileInputStream, TaxAgentManageRangeEmployeeListDTO.class, 0, 1, 4, "TaxAgentEmployee.xlsx");
|
||||
List<TaxAgentManageRangeEmployeeListDTO> rangeEmployees = ExcelParseHelper.parse2Map(fileInputStream, TaxAgentManageRangeEmployeeListDTO.class, 0, 1, 5, "TaxAgentEmployee.xlsx");
|
||||
|
||||
int total = rangeEmployees.size();
|
||||
int index = 0;
|
||||
|
|
@ -584,7 +584,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
taxAgentRangeSaveParam.setTaxAgentId(taxAgentId);
|
||||
taxAgentRangeSaveParam.setIncludeType(1);
|
||||
taxAgentRangeSaveParam.setSync(true);
|
||||
taxAgentRangeSaveParam.setEmployeeStatus(allEmployeeStatuses);
|
||||
// taxAgentRangeSaveParam.setEmployeeStatus(allEmployeeStatuses);
|
||||
|
||||
for (int i = 0; i < rangeEmployees.size(); i++) {
|
||||
TaxAgentManageRangeEmployeeListDTO dto = rangeEmployees.get(i);
|
||||
|
|
@ -603,6 +603,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
String deparmentName = dto.getDepartmentName();
|
||||
String mobile = dto.getMobile();
|
||||
String workcode = dto.getJobNum();
|
||||
String employeeStatusStr = dto.getEmployeeStatus();
|
||||
List<Long> employeeSameIds = new ArrayList<>();
|
||||
|
||||
//筛选导入人员信息可以在人力资源池中匹配到的人员信息
|
||||
|
|
@ -653,6 +654,23 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
}
|
||||
}
|
||||
|
||||
// 设置员工状态
|
||||
if(StringUtils.isEmpty(employeeStatusStr)){
|
||||
po.setEmployeeStatus(allEmployeeStatuses);
|
||||
}else{
|
||||
Boolean[] haveError = {false};
|
||||
// 人员状态字符串转换为对应的value
|
||||
List<String> status = SalaryEmployeeStatusEnum.parseByFormatStr(employeeStatusStr, haveError);
|
||||
if(haveError[0]){
|
||||
Map<String, String> errorMessageMap = new HashMap<>();
|
||||
errorMessageMap.put("message", rowIndex + "员工状态不存在,或格式有误。格式为:试用、正式、临时、试用延期");
|
||||
errorData.add(errorMessageMap);
|
||||
errorSum += 1;
|
||||
}else{
|
||||
po.setEmployeeStatus(status);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (Objects.isNull(taxAgent)) {
|
||||
//个税扣缴义务人不存在
|
||||
|
|
@ -680,7 +698,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
List<TaxAgentManageRangePO> taxAgentManageAllRanges = listByTaxAgentId(taxAgentId);
|
||||
List<TaxAgentManageRangePO> taxAgentManageRanges = taxAgentManageAllRanges.stream().filter(f -> f.getIncludeType().equals(taxAgentRangeSaveParam.getIncludeType())).collect(Collectors.toList());
|
||||
// 处理一下本次的保存参数(如果原来添加过对应的人员(/部门/岗位),那么本次不需要新增,只需要更新)
|
||||
TaxAgentBO.Result result = TaxAgentBO.handleTaxAgentRange(taxAgentManageRanges, taxAgentRangeSaveParam, taxAgent.getId(), (long) user.getUID());
|
||||
TaxAgentBO.Result result = TaxAgentBO.handleTaxAgentRange(taxAgentManageRanges, taxAgentRangeSaveParam, taxAgent.getId(), (long) user.getUID(), true);
|
||||
|
||||
/* 检查当前个税扣缴义务人的所有人员范围与所有分管理员的管理范围===========================start */
|
||||
List<TaxAgentManageRangePO> allRanges = Lists.newArrayList(taxAgentManageAllRanges);
|
||||
|
|
@ -697,7 +715,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
result.getNeedInsertTaxAgentManageRanges().forEach(range -> getTaxAgentManageRangeMapper().insertIgnoreNull(range));
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(result.getNeedUpdateTaxAgentManageRanges())) {
|
||||
result.getNeedInsertTaxAgentManageRanges().forEach(range -> getTaxAgentManageRangeMapper().updateIgnoreNull(range));
|
||||
result.getNeedUpdateTaxAgentManageRanges().forEach(range -> getTaxAgentManageRangeMapper().updateIgnoreNull(range));
|
||||
}
|
||||
|
||||
/* 同步本地人员范围的关联人员=========================== */
|
||||
|
|
|
|||
Loading…
Reference in New Issue