449 lines
26 KiB
Java
449 lines
26 KiB
Java
package com.engine.salary.entity.datacollection.bo;
|
||
|
||
import com.engine.salary.entity.datacollection.AddUpDeduction;
|
||
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRequestResultDTO;
|
||
import com.engine.salary.entity.datacollection.po.AddUpDeductionRequestFailPO;
|
||
import com.engine.salary.entity.datacollection.po.AddUpDeductionRequestPO;
|
||
import com.engine.salary.entity.datacollection.response.QuerySpecialAmountFeedbackResponse;
|
||
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
|
||
import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO;
|
||
import com.engine.salary.enums.SalaryOnOffEnum;
|
||
import com.engine.salary.enums.employeedeclare.CardTypeEnum;
|
||
import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum;
|
||
import com.engine.salary.enums.employeedeclare.EmploymentTypeEnum;
|
||
import com.engine.salary.enums.employeedeclare.GenderEnum;
|
||
import com.engine.salary.enums.sicategory.DeleteTypeEnum;
|
||
import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum;
|
||
import com.engine.salary.service.impl.AddUpDeductionServiceImpl;
|
||
import com.engine.salary.util.SalaryDateUtil;
|
||
import com.engine.salary.util.SalaryI18nUtil;
|
||
import dm.jdbc.util.IdGenerator;
|
||
import org.apache.commons.lang3.StringUtils;
|
||
import org.slf4j.Logger;
|
||
import org.slf4j.LoggerFactory;
|
||
|
||
import java.util.*;
|
||
|
||
/**
|
||
* @Description: 数据采集
|
||
* @Author: wangxiangzhong
|
||
* @Date: 2021/11/29 13:28
|
||
*/
|
||
public class DataCollectionBO {
|
||
private static final Logger logger = LoggerFactory.getLogger(DataCollectionBO.class);
|
||
|
||
// @Override
|
||
// public String toString() {
|
||
// return "DataCollectionBO{}";
|
||
// }
|
||
//
|
||
// /**
|
||
// * PO转DTO:累计专项附加扣除加密字段赋值
|
||
// *
|
||
// * @param po
|
||
// * @param dto
|
||
// */
|
||
// public static void poToDTO4AddUpDeduction(AddUpDeduction po, AddUpDeductionListDTO dto) {
|
||
// if (po == null || dto == null) {
|
||
// return;
|
||
// }
|
||
// dto.setAddUpChildEducation(SalaryEntityUtil.thousandthConvert(po.getAddUpChildEducation()));
|
||
// dto.setAddUpContinuingEducation(SalaryEntityUtil.thousandthConvert(po.getAddUpContinuingEducation()));
|
||
// dto.setAddUpHousingLoanInterest(SalaryEntityUtil.thousandthConvert(po.getAddUpHousingLoanInterest()));
|
||
// dto.setAddUpHousingRent(SalaryEntityUtil.thousandthConvert(po.getAddUpHousingRent()));
|
||
// dto.setAddUpSupportElderly(SalaryEntityUtil.thousandthConvert(po.getAddUpSupportElderly()));
|
||
// dto.setAddUpIllnessMedical(SalaryEntityUtil.thousandthConvert(po.getAddUpIllnessMedical()));
|
||
// dto.setAddUpInfantCare(SalaryEntityUtil.thousandthConvert(po.getAddUpInfantCare()));
|
||
// dto.setLastUpdateTime(po.getLastUpdateTime());
|
||
// dto.setDataSource(Optional.ofNullable(EnumAddUpDeductionDataSource.parseByValue(po.getDataSource()))
|
||
// .map(e -> SalaryI18nUtil.getI18nLabel(e.getLabelId(), e.getDefaultLabel()))
|
||
// .orElse(SalaryI18nUtil.getI18nLabel(EnumAddUpDeductionDataSource.MANUAL.getLabelId(), EnumAddUpDeductionDataSource.MANUAL.getDefaultLabel())));
|
||
// }
|
||
//
|
||
// /**
|
||
// * PO转DTO:往期累计情况加密字段赋值
|
||
// *
|
||
// * @param po
|
||
// * @param dto
|
||
// */
|
||
// public static void poToDTO4AddUpSituationPOVal(AddUpSituationPO po, AddUpSituationListDTO dto) {
|
||
// if (po == null || dto == null) {
|
||
// return;
|
||
// }
|
||
// dto.setAddUpIncome(SalaryEntityUtil.thousandthConvert(po.getAddUpIncome()));
|
||
// dto.setAddUpSubtraction(SalaryEntityUtil.thousandthConvert(po.getAddUpSubtraction()));
|
||
// dto.setAddUpSocialSecurityTotal(SalaryEntityUtil.thousandthConvert(po.getAddUpSocialSecurityTotal()));
|
||
// dto.setAddUpAccumulationFundTotal(SalaryEntityUtil.thousandthConvert(po.getAddUpAccumulationFundTotal()));
|
||
// dto.setAddUpEnterpriseAndOther(SalaryEntityUtil.thousandthConvert(po.getAddUpEnterpriseAndOther()));
|
||
// dto.setAddUpOtherDeduction(SalaryEntityUtil.thousandthConvert(po.getAddUpOtherDeduction()));
|
||
// dto.setAddUpTaxExemptIncome(SalaryEntityUtil.thousandthConvert(po.getAddUpTaxExemptIncome()));
|
||
// dto.setAddUpAllowedDonation(SalaryEntityUtil.thousandthConvert(po.getAddUpAllowedDonation()));
|
||
// dto.setAddUpTaxSavings(SalaryEntityUtil.thousandthConvert(po.getAddUpTaxSavings()));
|
||
// dto.setAddUpAdvanceTax(SalaryEntityUtil.thousandthConvert(po.getAddUpAdvanceTax()));
|
||
// dto.setAddUpTaxableIncome(SalaryEntityUtil.thousandthConvert(po.getAddUpTaxableIncome()));
|
||
// }
|
||
//
|
||
// public static void poToDTO4AddUpSituationRecordPOVal(AddUpSituationPO po, AddUpSituationRecordDTO dto) {
|
||
// if (po == null || dto == null) {
|
||
// return;
|
||
// }
|
||
// dto.setAddUpIncome(SalaryEntityUtil.thousandthConvert(po.getAddUpIncome()));
|
||
// dto.setAddUpSubtraction(SalaryEntityUtil.thousandthConvert(po.getAddUpSubtraction()));
|
||
// dto.setAddUpSocialSecurityTotal(SalaryEntityUtil.thousandthConvert(po.getAddUpSocialSecurityTotal()));
|
||
// dto.setAddUpAccumulationFundTotal(SalaryEntityUtil.thousandthConvert(po.getAddUpAccumulationFundTotal()));
|
||
// dto.setAddUpEnterpriseAndOther(SalaryEntityUtil.thousandthConvert(po.getAddUpEnterpriseAndOther()));
|
||
// dto.setAddUpOtherDeduction(SalaryEntityUtil.thousandthConvert(po.getAddUpOtherDeduction()));
|
||
// dto.setAddUpTaxExemptIncome(SalaryEntityUtil.thousandthConvert(po.getAddUpTaxExemptIncome()));
|
||
// dto.setAddUpAllowedDonation(SalaryEntityUtil.thousandthConvert(po.getAddUpAllowedDonation()));
|
||
// dto.setAddUpTaxSavings(SalaryEntityUtil.thousandthConvert(po.getAddUpTaxSavings()));
|
||
// dto.setAddUpAdvanceTax(SalaryEntityUtil.thousandthConvert(po.getAddUpAdvanceTax()));
|
||
// dto.setAddUpTaxableIncome(SalaryEntityUtil.thousandthConvert(po.getAddUpTaxableIncome()));
|
||
// }
|
||
//
|
||
// public static void convert2Po4UpdateSituation(AddUpSituationPO po, AddUpSituationUpdateParam param) {
|
||
// if (param == null || po == null) {
|
||
// return;
|
||
// }
|
||
// po.setAddUpIncome(param.getAddUpIncome());
|
||
// po.setAddUpSubtraction(param.getAddUpSubtraction());
|
||
// po.setAddUpSocialSecurityTotal(param.getAddUpSocialSecurityTotal());
|
||
// po.setAddUpAccumulationFundTotal(param.getAddUpAccumulationFundTotal());
|
||
// po.setAddUpEnterpriseAndOther(param.getAddUpEnterpriseAndOther());
|
||
// po.setAddUpOtherDeduction(param.getAddUpOtherDeduction());
|
||
// po.setAddUpTaxExemptIncome(param.getAddUpTaxExemptIncome());
|
||
// po.setAddUpAllowedDonation(param.getAddUpAllowedDonation());
|
||
// po.setAddUpTaxSavings(param.getAddUpTaxSavings());
|
||
// po.setAddUpAdvanceTax(param.getAddUpAdvanceTax());
|
||
// po.setAddUpTaxableIncome(param.getAddUpTaxableIncome());
|
||
// }
|
||
//
|
||
// /**
|
||
// * PO转DTO:其他免税扣除加密字段赋值
|
||
// *
|
||
// * @param po
|
||
// * @param dto
|
||
// */
|
||
// public static void poToDTO4OtherDeductionPOVal(OtherDeductionPO po, OtherDeductionListDTO dto) {
|
||
// if (po == null || dto == null) {
|
||
// return;
|
||
// }
|
||
// dto.setBusinessHealthyInsurance(SalaryEntityUtil.thousandthConvert(po.getBusinessHealthyInsurance()));
|
||
// dto.setTaxDelayEndowmentInsurance(SalaryEntityUtil.thousandthConvert(po.getTaxDelayEndowmentInsurance()));
|
||
// dto.setOtherDeduction(SalaryEntityUtil.thousandthConvert(po.getOtherDeduction()));
|
||
// dto.setDeductionAllowedDonation(SalaryEntityUtil.thousandthConvert(po.getDeductionAllowedDonation()));
|
||
// }
|
||
//
|
||
// /**
|
||
// * 添加日期范围
|
||
// *
|
||
// * @param weaSearchCondition
|
||
// * @param employeeId
|
||
// * @param tenantKey
|
||
// */
|
||
// public static void addDatePickerRangeOtherParams(WeaSearchCondition weaSearchCondition, String datePickerKey, Long employeeId, String tenantKey) {
|
||
// WeaSearchConditionItem datePickerItem = weaSearchCondition.getItems().get(datePickerKey);
|
||
// Map<String, Object> otherParams = Maps.newHashMap();
|
||
// otherParams.put("isRange", true);
|
||
// otherParams.put("type", "day");
|
||
// otherParams.put("startPlaceholder", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 90648, "开始日期"));
|
||
// otherParams.put("endPlaceholder", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 90649, "结束日期"));
|
||
// datePickerItem.setOtherParams(otherParams);
|
||
// weaSearchCondition.getItems().put(datePickerKey, datePickerItem);
|
||
// }
|
||
//
|
||
// /**
|
||
// * 忽略身份证号码搜索条件
|
||
// *
|
||
// * @param clazz
|
||
// */
|
||
// public static <T> void ingoreIdNoSearchCondition(Class<T> clazz) {
|
||
// try {
|
||
// Field idNoField = clazz.getDeclaredField("idNo");
|
||
// SalarySearchCondition targetAnnotation = idNoField.getAnnotation(SalarySearchCondition.class);
|
||
//// boolean oldValue = targetAnnotation.ignore();
|
||
//// System.out.println("修改之前的注解值:" + oldValue);
|
||
// //获取 targetAnnotation 这个代理实例所持有的 InvocationHandler
|
||
// InvocationHandler invocationHandler = Proxy.getInvocationHandler(targetAnnotation);
|
||
// // 获取 AnnotationInvocationHandler 的 memberValues 字段
|
||
// Field declaredField = invocationHandler.getClass().getDeclaredField("memberValues");
|
||
// // 因为这个字段事 private final 修饰,所以要打开权限
|
||
// declaredField.setAccessible(true);
|
||
// // 获取 memberValues
|
||
// Map memberValues = (Map) declaredField.get(invocationHandler);
|
||
// // 修改 ignore 属性值
|
||
// memberValues.put("ignore", true);
|
||
//// boolean newValue = targetAnnotation.ignore();
|
||
//// System.out.println("修改之后的注解值:" + newValue);
|
||
// } catch (Exception e) {
|
||
// logger.error("忽略idNo失败:{}", e.getMessage(), e);
|
||
// }
|
||
// }
|
||
//
|
||
// /**
|
||
// * 构建新建基础表单
|
||
// *
|
||
// * @param taxAgentList
|
||
// * @param employeeId
|
||
// * @param tenantKey
|
||
// * @return
|
||
// */
|
||
// public static WeaForm buildBaseInfoAddForm(Collection<TaxAgentPO> taxAgentList, Long employeeId, String tenantKey) {
|
||
// // 构建表单
|
||
// WeaForm baseInfoForm = new WeaForm();
|
||
// // 控件项目
|
||
// Map<String, WeaFormItem> items = baseInfoForm.getItems();
|
||
//
|
||
// WeaFormItem declareMonthItem = new WeaFormItem(WeaFormItemType.DATEPICKER);
|
||
// declareMonthItem.setRequired(true);
|
||
// Map<String, Object> otherParams = new HashMap<>();
|
||
// otherParams.put("type", "month");
|
||
// declareMonthItem.setOtherParams(otherParams);
|
||
// items.put("declareMonth", declareMonthItem);
|
||
//
|
||
// WeaFormItem taxAgentItem = new WeaFormItem(WeaFormItemType.SELECT);
|
||
// taxAgentItem.setRequired(true);
|
||
// taxAgentItem.setOptions(taxAgentList.stream()
|
||
// .map(t -> {
|
||
// WeaFormOption weaFormOption = new WeaFormOption();
|
||
// weaFormOption.setId("" + t.getId());
|
||
// weaFormOption.setContent(t.getName());
|
||
// return weaFormOption;
|
||
// }).collect(Collectors.toList()));
|
||
// items.put("taxAgent", taxAgentItem);
|
||
//
|
||
// WeaFormItem employeeItem = new WeaFormItem(WeaFormItemType.BROWSER);
|
||
// employeeItem.setRequired(true);
|
||
// employeeItem.setBrowserBean(new WeaBrowserBean("hrmsalary", "dataCollectionEmployeeBrowser"));
|
||
// items.put("employee", employeeItem);
|
||
//
|
||
// // 控件布局
|
||
// String groupId = "baseInfo";
|
||
// List<List<WeaFormLayout>> layout = baseInfoForm.getLayout();
|
||
// layout.add(Lists.newArrayList(new WeaFormLayout("1", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86176, "税款所属期"), groupId, new String[]{"declareMonth"})));
|
||
// layout.add(Lists.newArrayList(new WeaFormLayout("2", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86184, "个税扣缴义务人"), groupId, new String[]{"taxAgent"})));
|
||
// layout.add(Lists.newArrayList(new WeaFormLayout("3", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100133, "人员"), groupId, new String[]{"employee"})));
|
||
// layout.forEach(ll-> ll.forEach(wl-> wl.setLabelSpan(8)));
|
||
// baseInfoForm.setGroups(Collections.singletonList(new WeaFormGroup(groupId, SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86124, "基础信息"))));
|
||
// return baseInfoForm;
|
||
// }
|
||
//
|
||
// /**
|
||
// * 构建基础信息表单
|
||
// *
|
||
// * @param employee
|
||
// * @param taxAgent
|
||
// * @param enableHr
|
||
// * @param declareMonth
|
||
// * @param employeeId
|
||
// * @param tenantKey
|
||
// * @return
|
||
// */
|
||
// public static WeaForm buildBaseInfoForm(SimpleEmployee employee, String taxAgent, boolean enableHr, String idNo, LocalDate declareMonth, Long employeeId, String tenantKey) {
|
||
// // 构建表单
|
||
// WeaForm baseInfoForm = new WeaForm();
|
||
// // 控件项目
|
||
// Map<String, WeaFormItem> items = baseInfoForm.getItems();
|
||
//
|
||
// List<String> itemNames = Arrays.asList("username", "taxAgent", "declareMonth", "department", "position", "hiredate", "mobile", "jobNum", "employeeStatus");
|
||
// itemNames.forEach(itemName -> {
|
||
// WeaFormItem item = new WeaFormItem(WeaFormItemType.INPUT);
|
||
// item.setReadOnly(true);
|
||
// items.put(itemName, item);
|
||
// });
|
||
//
|
||
// if (enableHr) {
|
||
// WeaFormItem idNoItem = new WeaFormItem(WeaFormItemType.INPUT);
|
||
// idNoItem.setReadOnly(true);
|
||
// items.put("idNo", idNoItem);
|
||
// } else {
|
||
// WeaFormItem emptyItem = new WeaFormItem(WeaFormItemType.INPUT);
|
||
// emptyItem.setReadOnly(true);
|
||
// items.put("empty", emptyItem);
|
||
// }
|
||
//
|
||
// // 控件布局
|
||
// List<List<WeaFormLayout>> layout = baseInfoForm.getLayout();
|
||
// String groupId = "baseInfo";
|
||
// layout.add(Lists.newArrayList(new WeaFormLayout("1", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 85429, "姓名"), groupId, new String[]{"username"}), new WeaFormLayout("2", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86184, "个税扣缴义务人"), groupId, new String[]{"taxAgent"})));
|
||
// layout.add(Lists.newArrayList(new WeaFormLayout("3", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86176, "税款所属期"), groupId, new String[]{"declareMonth"}), new WeaFormLayout("4", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86185, "部门"), groupId, new String[]{"department"})));
|
||
// layout.add(Lists.newArrayList(new WeaFormLayout("5", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 90633, "岗位"), groupId, new String[]{"position"}), new WeaFormLayout("6", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86319, "入职日期"), groupId, new String[]{"hiredate"})));
|
||
// layout.add(Lists.newArrayList(new WeaFormLayout("7", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86186, "手机号"), groupId, new String[]{"mobile"}), new WeaFormLayout("8", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86317, "工号"), groupId, new String[]{"jobNum"})));
|
||
// layout.add(Lists.newArrayList(new WeaFormLayout("9", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 109332, "人事状态"), groupId, new String[]{"employeeStatus"}), enableHr ? new WeaFormLayout("10", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 106277, "身份证号码"), groupId, new String[]{"idNo"}) : new WeaFormLayout("10", " ", new String[]{"empty"})));
|
||
//
|
||
// layout.forEach(ll-> ll.forEach(wl-> wl.setLabelSpan(8)));
|
||
// // 控件数据
|
||
// Map<String, Object> data = baseInfoForm.getData();
|
||
// data.put("username", employee.getUsername());
|
||
// data.put("taxAgent", taxAgent);
|
||
// data.put("declareMonth", declareMonth == null ? "" : declareMonth + "");
|
||
// data.put("department", employee.getDepartment() == null ? "" : employee.getDepartment().getName());
|
||
// data.put("position", employee.getPosition() == null ? "" : employee.getPosition().getName());
|
||
// data.put("hiredate", SalaryDateUtil.getFormatLocalDate(employee.getHiredate()));
|
||
// data.put("mobile", employee.getMobile());
|
||
// data.put("jobNum", employee.getJobNum());
|
||
// data.put("idNo", idNo);
|
||
// data.put("employeeStatus", employee.getPersonnelStatus());
|
||
// baseInfoForm.setData(data);
|
||
// baseInfoForm.setGroups(Collections.singletonList(new WeaFormGroup(groupId, SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86124, "基础信息"))));
|
||
//
|
||
// return baseInfoForm;
|
||
// }
|
||
//
|
||
//
|
||
// public static AddUpSituationFormDTO po2AddUpSituationFormDTO(AddUpSituationPO situationPO) {
|
||
// return AddUpSituationFormDTO.builder()
|
||
// .addUpAdvanceTax(situationPO.getAddUpAdvanceTax())
|
||
// .addUpTaxableIncome(situationPO.getAddUpTaxableIncome())
|
||
// .addUpAllowedDonation(situationPO.getAddUpAllowedDonation())
|
||
// .addUpAccumulationFundTotal(situationPO.getAddUpAccumulationFundTotal())
|
||
// .addUpIncome(situationPO.getAddUpIncome())
|
||
// .addUpSubtraction(situationPO.getAddUpSubtraction())
|
||
// .addUpOtherDeduction(situationPO.getAddUpOtherDeduction())
|
||
// .addUpTaxSavings(situationPO.getAddUpTaxSavings())
|
||
// .addUpTaxExemptIncome(situationPO.getAddUpTaxExemptIncome())
|
||
// .addUpEnterpriseAndOther(situationPO.getAddUpEnterpriseAndOther())
|
||
// .addUpSocialSecurityTotal(situationPO.getAddUpSocialSecurityTotal())
|
||
// .id(situationPO.getId())
|
||
// .taxYearMonth(situationPO.getTaxYearMonth())
|
||
// .taxAgent(situationPO.getTaxAgentId())
|
||
// .employeeType(EmployeeTypeEnum.parseByValue(situationPO.getEmployeeType()).toString())
|
||
// .build();
|
||
// }
|
||
|
||
public static Map<String, Object> getApiBaseQueryParams(TaxAgentTaxReturnPO returnPO, String taxAgentName, String taxMonth) {
|
||
Map<String, Object> requestParam = new HashMap<>(32);
|
||
requestParam.put("bizNo", IdGenerator.generate());
|
||
requestParam.put("qymc", taxAgentName);
|
||
requestParam.put("nsrsbh", returnPO.getTaxCode());
|
||
requestParam.put("areaid", returnPO.getAreaCode());
|
||
requestParam.put("skssq", taxMonth);
|
||
requestParam.put("sfrysb", SalaryOnOffEnum.OFF.getValue());
|
||
requestParam.put("mmlx", returnPO.getPasswordType());
|
||
requestParam.put("jmsbmm", 1);
|
||
requestParam.put("jmsmmm", 1);
|
||
boolean realNamePwd = TaxAgentTaxReturnPasswordTypeEnum.REAL_NAME_PASSWORD.getValue().equals(returnPO.getPasswordType());
|
||
requestParam.computeIfAbsent("smzh", e -> realNamePwd ? returnPO.getRealAccount() : null);
|
||
requestParam.computeIfAbsent("smmm", e -> realNamePwd ? returnPO.getPwd() : null);
|
||
requestParam.computeIfAbsent("sbmm", e -> realNamePwd ? null : returnPO.getPwd());
|
||
requestParam.computeIfAbsent("djxhid", e -> StringUtils.isNotEmpty(returnPO.getTaxRegistrationNumber()) ? returnPO.getTaxRegistrationNumber() : null);
|
||
requestParam.computeIfAbsent("bmbh", e -> StringUtils.isNotEmpty(returnPO.getDepartmentCode()) ? returnPO.getDepartmentCode() : null);
|
||
requestParam.computeIfAbsent("bmmc", e -> StringUtils.isNotEmpty(returnPO.getDepartmentName()) ? returnPO.getDepartmentName() : null);
|
||
return requestParam;
|
||
}
|
||
|
||
public static List<Map<String, Object>> getEmployeeList(List<EmployeeDeclarePO> declarePOList) {
|
||
List<Map<String, Object>> employeeList = new ArrayList<>();
|
||
for (EmployeeDeclarePO employeeDeclarePO : declarePOList) {
|
||
Map<String, Object> employeeMap = new HashMap<>(32);
|
||
employeeMap.put("xm", employeeDeclarePO.getEmployeeName());
|
||
employeeMap.put("zzlx", CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel());
|
||
employeeMap.put("zzhm", employeeDeclarePO.getCardNum());
|
||
employeeMap.put("lxdh", employeeDeclarePO.getMobile());
|
||
employeeMap.put("nsrzt", EmploymentStatusEnum.NORMAL.getDefaultLabel());
|
||
employeeMap.put("sfgy", EmploymentTypeEnum.EMPLOYEE.getDefaultLabel());
|
||
employeeMap.put("rzsgrq", SalaryDateUtil.getFormatYYYYMM(employeeDeclarePO.getEmploymentDate()));
|
||
employeeMap.put("xb", GenderEnum.MALE.getValue().equals(employeeDeclarePO.getGender()) ? GenderEnum.MALE.getDefaultLabel() : GenderEnum.FEMALE.getDefaultLabel());
|
||
employeeMap.put("csny", SalaryDateUtil.getFormatYYYYMM(employeeDeclarePO.getBirthday()));
|
||
employeeMap.put("gj", "中国");
|
||
employeeMap.put("rydq", "境内");
|
||
boolean disability = SalaryOnOffEnum.ON.getValue().equals(employeeDeclarePO.getDisability());
|
||
boolean martyrDependents = SalaryOnOffEnum.ON.getValue().equals(employeeDeclarePO.getMartyrDependents());
|
||
employeeMap.computeIfAbsent("sfcj", e -> SalaryOnOffEnum.parseByValue(employeeDeclarePO.getDisability()).getDefaultLabel());
|
||
employeeMap.computeIfAbsent("cjzh", e -> disability ? employeeDeclarePO.getDisabilityCardNo() : null);
|
||
employeeMap.computeIfAbsent("sfls", e->SalaryOnOffEnum.parseByValue(employeeDeclarePO.getMartyrDependents()).getDefaultLabel());
|
||
employeeMap.computeIfAbsent("lszh", e-> martyrDependents ? employeeDeclarePO.getMartyrDependentsCardNo() : null);
|
||
employeeMap.computeIfAbsent("sfgl", e -> SalaryOnOffEnum.parseByValue(employeeDeclarePO.getLonelyOld()).getDefaultLabel());
|
||
employeeMap.computeIfAbsent("sfzdw", e -> SalaryOnOffEnum.parseByValue(employeeDeclarePO.getDeductExpenses()).getDefaultLabel());
|
||
employeeList.add(employeeMap);
|
||
}
|
||
return employeeList;
|
||
}
|
||
|
||
public static AddUpDeduction buildAddUpDeductionPO(QuerySpecialAmountFeedbackResponse.Feedback feedback) {
|
||
return AddUpDeduction.builder()
|
||
.id(IdGenerator.generate())
|
||
.addUpChildEducation(feedback.getLjznjyzc().toString())
|
||
.addUpContinuingEducation(feedback.getLjjxjyzc().toString())
|
||
.addUpHousingRent(feedback.getLjzfzjzc().toString())
|
||
.addUpInfantCare(feedback.getLjyyezhzc().toString())
|
||
.addUpHousingLoanInterest(feedback.getLjzfdklxzc().toString())
|
||
.addUpSupportElderly(feedback.getLjsylrzc().toString())
|
||
.addUpIllnessMedical("0")
|
||
// .dataSource(EnumAddUpDeductionDataSource.ONLINE.getValue())
|
||
// .lastUpdateTime(LocalDateTime.now())
|
||
.updateTime(new Date())
|
||
.build();
|
||
}
|
||
|
||
public static AddUpDeductionRequestFailPO buildAddUpDeductionRequestFailPO(AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper requestWrapper,
|
||
AddUpDeductionRequestPO requestPO,
|
||
Long employeeId) {
|
||
Date now = new Date();
|
||
return AddUpDeductionRequestFailPO.builder()
|
||
.id(IdGenerator.generate())
|
||
.requestId(requestPO.getRequestId())
|
||
.outerRequestId(requestPO.getOuterRequestId())
|
||
.taxYearMonth(requestPO.getTaxYearMonth())
|
||
.taxAgentId(requestPO.getTaxAgentId())
|
||
.employeeId(employeeId)
|
||
.createTime(now)
|
||
.updateTime(now)
|
||
.deleteType(DeleteTypeEnum.NOT_DELETED.getValue())
|
||
.creator(requestWrapper.getCurrentEmployeeId())
|
||
.tenantKey(requestPO.getTenantKey())
|
||
.build();
|
||
}
|
||
|
||
public static AddUpDeductionRequestResultDTO buildRequestResultDTO(Long requestId, AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper requestWrapper) {
|
||
return AddUpDeductionRequestResultDTO.builder()
|
||
.requestId(requestId.toString())
|
||
.msg(String.format(SalaryI18nUtil.getI18nLabel(184070, "共成功获取数据%s条,失败%s条"),
|
||
requestWrapper.getInsertList().size() + requestWrapper.getUpdateList().size(),
|
||
requestWrapper.getFailPOList().size()))
|
||
.result(requestWrapper.getFailPOList().size() > 0 ? "warning" : "success")
|
||
.finish(true)
|
||
.build();
|
||
}
|
||
|
||
// public static AddUpDeduction buildAddUpDeductionPO(AddUpDeductionSaveParam saveParam, Long currentEmployeeId, String currentTenantKey) {
|
||
// return AddUpDeduction.builder()
|
||
// .id(IdGenerator.generate())
|
||
// .createTime(LocalDateTime.now())
|
||
// .updateTime(LocalDateTime.now())
|
||
// .creator(currentEmployeeId)
|
||
// .deleteType(NumberUtils.INTEGER_ZERO)
|
||
// .tenantKey(currentTenantKey)
|
||
// .dataSource(EnumAddUpDeductionDataSource.MANUAL.getValue())
|
||
// .lastUpdateTime(LocalDateTime.now())
|
||
// .declareMonth(saveParam.getDeclareMonth().atDay(1))
|
||
// .taxAgentId(saveParam.getTaxAgentId())
|
||
// .employeeId(saveParam.getEmployeeId())
|
||
// .addUpChildEducation(saveParam.getAddUpChildEducation())
|
||
// .addUpInfantCare(saveParam.getAddUpInfantCare())
|
||
// .addUpHousingRent(saveParam.getAddUpHousingRent())
|
||
// .addUpIllnessMedical(saveParam.getAddUpIllnessMedical())
|
||
// .addUpSupportElderly(saveParam.getAddUpSupportElderly())
|
||
// .addUpHousingLoanInterest(saveParam.getAddUpHousingLoanInterest())
|
||
// .addUpContinuingEducation(saveParam.getAddUpContinuingEducation())
|
||
// .build();
|
||
// }
|
||
//
|
||
// public static OtherDeductionPO buildOtherDeductionPO(OtherDeductionSaveParam saveParam, Long currentEmployeeId, String currentTenantKey) {
|
||
// return OtherDeductionPO.builder()
|
||
// .id(IdGenerator.generate())
|
||
// .createTime(LocalDateTime.now())
|
||
// .updateTime(LocalDateTime.now())
|
||
// .creator(currentEmployeeId)
|
||
// .deleteType(NumberUtils.INTEGER_ZERO)
|
||
// .tenantKey(currentTenantKey)
|
||
// .declareMonth(saveParam.getDeclareMonth().atDay(1))
|
||
// .taxAgentId(saveParam.getTaxAgentId())
|
||
// .employeeId(saveParam.getEmployeeId())
|
||
// .businessHealthyInsurance(saveParam.getBusinessHealthyInsurance())
|
||
// .taxDelayEndowmentInsurance(saveParam.getTaxDelayEndowmentInsurance())
|
||
// .otherDeduction(saveParam.getOtherDeduction())
|
||
// .deductionAllowedDonation(saveParam.getDeductionAllowedDonation())
|
||
// .build();
|
||
// }
|
||
}
|