适配港澳台通行证

This commit is contained in:
钱涛 2024-11-19 16:44:08 +08:00
parent b3c2047a3d
commit 199fe67374
5 changed files with 53 additions and 5 deletions

View File

@ -105,7 +105,18 @@ public class EmployeeDeclareRefresh {
String idNum = hrmEmployeeComInfo.getIdNo() != null ? hrmEmployeeComInfo.getIdNo().toUpperCase() : ""; String idNum = hrmEmployeeComInfo.getIdNo() != null ? hrmEmployeeComInfo.getIdNo().toUpperCase() : "";
CardTypeEnum cardType = CardTypeEnum.RESIDENT_IDENTITY_CARDS; CardTypeEnum cardType = CardTypeEnum.RESIDENT_IDENTITY_CARDS;
if (!SalaryCardUtil.checkIdNum(idNum)) { if (!SalaryCardUtil.checkIdNum(idNum)) {
//默认外国护照
cardType = CardTypeEnum.FOREIGN_PASSPORT; cardType = CardTypeEnum.FOREIGN_PASSPORT;
//港澳通行证
if (SalaryCardUtil.checkHMPassportIdNum(idNum)) {
cardType = CardTypeEnum.HM_PASSPORT;
}
//台湾通行证
if (SalaryCardUtil.checkTPassportIdNum(idNum)) {
cardType = CardTypeEnum.T_PASSPORT;
}
} }
EmployeeDeclarePO employeeDeclare = initEmployeeDeclare(dto.getTaxAgentId(), dto.getTaxCycle(), employeeId); EmployeeDeclarePO employeeDeclare = initEmployeeDeclare(dto.getTaxAgentId(), dto.getTaxCycle(), employeeId);
employeeDeclare.setEmployeeId(hrmEmployeeComInfo.getEmployeeId()); employeeDeclare.setEmployeeId(hrmEmployeeComInfo.getEmployeeId());

View File

@ -233,7 +233,7 @@ public class SalaryCalcTaxRequest {
// 姓名 // 姓名
requestParam.put("xm", employeeDeclare.getEmployeeName()); requestParam.put("xm", employeeDeclare.getEmployeeName());
// 证件类型 // 证件类型
requestParam.put("zzlx", CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel()); requestParam.put("zzlx", CardTypeEnum.getByValue(employeeDeclare.getCardType()).getDefaultLabel());
// 证件号码 // 证件号码
requestParam.put("zzhm", employeeDeclare.getCardNum()); requestParam.put("zzhm", employeeDeclare.getCardNum());
// 所得项目 // 所得项目

View File

@ -17,7 +17,8 @@ public enum CardTypeEnum implements BaseEnum<Integer> {
RESIDENT_IDENTITY_CARDS(0, "居民身份证", 105564), RESIDENT_IDENTITY_CARDS(0, "居民身份证", 105564),
FOREIGN_PASSPORT(1, "外国护照", 105564), FOREIGN_PASSPORT(1, "外国护照", 105564),
HM_PASSPORT(2, "港澳居民来往内地通行证", 105564); HM_PASSPORT(2, "港澳居民来往内地通行证", 105564),
T_PASSPORT(3, "台湾居民来往大陆通行证", 105564);
CardTypeEnum(int value, String defaultLabel, int labelId) { CardTypeEnum(int value, String defaultLabel, int labelId) {
this.value = value; this.value = value;

View File

@ -133,7 +133,6 @@ public class SalaryCardUtil {
return validate18Idcard(idcard); return validate18Idcard(idcard);
} }
return false; return false;
} }
/** /**
@ -471,4 +470,42 @@ public class SalaryCardUtil {
} }
return a; return a;
} }
/**
* 验证港澳通行证
*
* @param idcard
* 身份证
* @return 合法返回true否则返回false
*/
public static boolean checkHMPassportIdNum(String idcard) {
if (idcard == null || "".equals(idcard)) {
return false;
}
if (idcard.length() == 9) {
return true;
}
return false;
}
/**
* 验证台湾通行证
* @param idcard
* @return
*/
public static boolean checkTPassportIdNum(String idcard) {
if (idcard == null || "".equals(idcard)) {
return false;
}
if (idcard.length() == 8) {
return true;
}
return false;
}
} }

View File

@ -98,9 +98,8 @@ public class EmployeeDeclareWrapper extends Service {
taxAgents = taxAgents.stream().filter(e -> StringUtils.contains(e.getName(), queryParam.getTaxAgentName())).collect(Collectors.toList()); taxAgents = taxAgents.stream().filter(e -> StringUtils.contains(e.getName(), queryParam.getTaxAgentName())).collect(Collectors.toList());
} }
// 分页 // 分页
List<TaxAgentPO> taxAgentPOS = SalaryPageUtil.subList(queryParam.getCurrent(), queryParam.getPageSize(), taxAgents);
List<TaxAgentDeclareListDTO> dtoList = Lists.newArrayList(); List<TaxAgentDeclareListDTO> dtoList = Lists.newArrayList();
for (TaxAgentPO taxAgent : taxAgentPOS) { for (TaxAgentPO taxAgent : taxAgents) {
TaxAgentDeclareListDTO dto = new TaxAgentDeclareListDTO().setId(taxAgent.getId()).setTaxAgentName(taxAgent.getName()); TaxAgentDeclareListDTO dto = new TaxAgentDeclareListDTO().setId(taxAgent.getId()).setTaxAgentName(taxAgent.getName());
dtoList.add(dto); dtoList.add(dto);
} }