|
|
|
|
@ -2140,112 +2140,66 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
|
|
|
|
return excelInsuranceDetailPO;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// @Override
|
|
|
|
|
// public InsuranceSupplementListFoldDTO getPaymentById(Long id) {
|
|
|
|
|
// InsuranceSupplementListFoldDTO result = new InsuranceSupplementListFoldDTO();
|
|
|
|
|
// WeaTable<InsuranceSupplementListDTO> weaTable = new WeaTable<>();
|
|
|
|
|
// EditableTable<InsuranceSupplementListDTO> editableTable = new EditableTable<>(weaTable);
|
|
|
|
|
// editableTable.setColumns(InsuranceArchivesBO.buildCompensationEditTableColumns(employeeId, tenantKey));
|
|
|
|
|
// editableTable.setComProps(InsuranceArchivesBO.buildSupplementEditTableItemMap());
|
|
|
|
|
// editableTable.setShowCheck(false);
|
|
|
|
|
// editableTable.setEllipsis(true);
|
|
|
|
|
// result.setEditableTable(editableTable);
|
|
|
|
|
// InsuranceAccountDetailPO insuranceAccountDetailPO = new LambdaQueryChainWrapper<>(siAccountDetailMapper)
|
|
|
|
|
// .eq(InsuranceAccountDetailPO::getId, id)
|
|
|
|
|
// .one();
|
|
|
|
|
// SalaryAssert.notNull(insuranceAccountDetailPO, SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 139811, "人员不存在"));
|
|
|
|
|
// insuranceAccountDetailPO = (InsuranceAccountDetailPO) dataSecurityService.decrypt(insuranceAccountDetailPO, InsuranceAccountDetailPO.class, tenantKey);
|
|
|
|
|
// Map<String, List<InsuranceSupplementListDTO>> group = new HashMap<>();
|
|
|
|
|
// //组装社保数据
|
|
|
|
|
// Set<String> socialInsuranceIds = new HashSet<>();
|
|
|
|
|
// String socialPerJson = insuranceAccountDetailPO.getSocialPerJson();
|
|
|
|
|
// HashMap<String, String> socialPerMap = new HashMap<>();
|
|
|
|
|
// if (StringUtils.isNotBlank(socialPerJson)) {
|
|
|
|
|
// socialPerMap = JSON.parseObject(socialPerJson, new HashMap<String, String>().getClass());
|
|
|
|
|
// socialPerMap.forEach((k, v) -> socialInsuranceIds.add(k));
|
|
|
|
|
// }
|
|
|
|
|
// String socialComJson = insuranceAccountDetailPO.getSocialComJson();
|
|
|
|
|
// HashMap<String, String> socialComMap = new HashMap<>();
|
|
|
|
|
// if (StringUtils.isNotBlank(socialComJson)) {
|
|
|
|
|
// socialComMap = JSON.parseObject(socialComJson, new HashMap<String, String>().getClass());
|
|
|
|
|
// socialComMap.forEach((k, v) -> socialInsuranceIds.add(k));
|
|
|
|
|
// }
|
|
|
|
|
// List<InsuranceSupplementListDTO> socialSupplementList = new ArrayList<>();
|
|
|
|
|
// for (String insuranceId : socialInsuranceIds) {
|
|
|
|
|
// InsuranceSupplementListDTO dto = new InsuranceSupplementListDTO();
|
|
|
|
|
// dto.setItem(siCategoryService.getCategoryNameById(Long.valueOf(insuranceId), tenantKey));
|
|
|
|
|
// dto.setPaymentPer(socialPerMap.get(insuranceId));
|
|
|
|
|
// dto.setPaymentCom(socialComMap.get(insuranceId));
|
|
|
|
|
// dto.setId(insuranceId);
|
|
|
|
|
// socialSupplementList.add(dto);
|
|
|
|
|
// }
|
|
|
|
|
// group.put("social", socialSupplementList);
|
|
|
|
|
//
|
|
|
|
|
// //组装公积金数据
|
|
|
|
|
// Set<String> fundInsuranceIds = new HashSet<>();
|
|
|
|
|
// String fundPerJson = insuranceAccountDetailPO.getFundPerJson();
|
|
|
|
|
// HashMap<String, String> fundperMap = new HashMap<>();
|
|
|
|
|
// if (StringUtils.isNotBlank(fundPerJson)) {
|
|
|
|
|
// fundperMap = JSON.parseObject(fundPerJson, new HashMap<String, String>().getClass());
|
|
|
|
|
// fundperMap.forEach((k, v) -> fundInsuranceIds.add(k));
|
|
|
|
|
// }
|
|
|
|
|
// String fundComJson = insuranceAccountDetailPO.getFundComJson();
|
|
|
|
|
// HashMap<String, String> fundComMap = new HashMap<>();
|
|
|
|
|
// if (StringUtils.isNotBlank(fundComJson)) {
|
|
|
|
|
// fundComMap = JSON.parseObject(fundComJson, new HashMap<String, String>().getClass());
|
|
|
|
|
// fundComMap.forEach((k, v) -> fundInsuranceIds.add(k));
|
|
|
|
|
// }
|
|
|
|
|
// List<InsuranceSupplementListDTO> fundSupplementList = new ArrayList<>();
|
|
|
|
|
// for (String insuranceId : fundInsuranceIds) {
|
|
|
|
|
// InsuranceSupplementListDTO dto = new InsuranceSupplementListDTO();
|
|
|
|
|
// dto.setItem(siCategoryService.getCategoryNameById(Long.valueOf(insuranceId), tenantKey));
|
|
|
|
|
// dto.setPaymentPer(fundperMap.get(insuranceId));
|
|
|
|
|
// dto.setPaymentCom(fundComMap.get(insuranceId));
|
|
|
|
|
// dto.setId(insuranceId);
|
|
|
|
|
// fundSupplementList.add(dto);
|
|
|
|
|
// }
|
|
|
|
|
// group.put("fund", fundSupplementList);
|
|
|
|
|
//
|
|
|
|
|
// //组装其他福利数据
|
|
|
|
|
// Set<String> otherInsuranceIds = new HashSet<>();
|
|
|
|
|
// String otherPerJson = insuranceAccountDetailPO.getOtherPerJson();
|
|
|
|
|
// HashMap<String, String> otherPerMap = new HashMap<>();
|
|
|
|
|
// if (StringUtils.isNotBlank(otherPerJson)) {
|
|
|
|
|
// otherPerMap = JSON.parseObject(otherPerJson, new HashMap<String, String>().getClass());
|
|
|
|
|
// otherPerMap.forEach((k, v) -> otherInsuranceIds.add(k));
|
|
|
|
|
// }
|
|
|
|
|
// String otherComJson = insuranceAccountDetailPO.getOtherComJson();
|
|
|
|
|
// HashMap<String, String> otherComMap = new HashMap<>();
|
|
|
|
|
// if (StringUtils.isNotBlank(otherComJson)) {
|
|
|
|
|
// otherComMap = JSON.parseObject(otherComJson, new HashMap<String, String>().getClass());
|
|
|
|
|
// otherComMap.forEach((k, v) -> otherInsuranceIds.add(k));
|
|
|
|
|
// }
|
|
|
|
|
// List<InsuranceSupplementListDTO> otherSupplementList = new ArrayList<>();
|
|
|
|
|
// for (String insuranceId : otherInsuranceIds) {
|
|
|
|
|
// InsuranceSupplementListDTO dto = new InsuranceSupplementListDTO();
|
|
|
|
|
// dto.setItem(siCategoryService.getCategoryNameById(Long.valueOf(insuranceId), tenantKey));
|
|
|
|
|
// dto.setPaymentPer(otherPerMap.get(insuranceId));
|
|
|
|
|
// dto.setPaymentCom(otherComMap.get(insuranceId));
|
|
|
|
|
// dto.setId(insuranceId);
|
|
|
|
|
// otherSupplementList.add(dto);
|
|
|
|
|
// }
|
|
|
|
|
// group.put("other", otherSupplementList);
|
|
|
|
|
// Map<String, Map<String, String>> items = new HashMap<>();
|
|
|
|
|
// Map<String, String> socialItem = new HashMap<>();
|
|
|
|
|
// socialItem.put("index", "0");
|
|
|
|
|
// socialItem.put("groupName", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86568, "社保"));
|
|
|
|
|
// items.put("social", socialItem);
|
|
|
|
|
// Map<String, String> fundItem = new HashMap<>();
|
|
|
|
|
// fundItem.put("index", "1");
|
|
|
|
|
// fundItem.put("groupName", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86569, "公积金"));
|
|
|
|
|
// items.put("fund", fundItem);
|
|
|
|
|
// Map<String, String> otherItem = new HashMap<>();
|
|
|
|
|
// otherItem.put("index", "2");
|
|
|
|
|
// otherItem.put("groupName", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 93112, "企业年金及其他福利"));
|
|
|
|
|
// items.put("other", otherItem);
|
|
|
|
|
// result.setItems(items);
|
|
|
|
|
// result.setGroup(group);
|
|
|
|
|
// return result;
|
|
|
|
|
// }
|
|
|
|
|
/**
|
|
|
|
|
* 将通过id获取InsuranceAccountDetailPO中的社保、公积金、其他福利个人和公司缴纳数据
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> getPaymentById(Long id) {
|
|
|
|
|
|
|
|
|
|
InsuranceAccountDetailPO insuranceAccountDetailPO = getInsuranceAccountDetailMapper().getById(id);
|
|
|
|
|
if (insuranceAccountDetailPO == null) {
|
|
|
|
|
throw new SalaryRunTimeException("该条核算数据不存在!");
|
|
|
|
|
}
|
|
|
|
|
InsuranceAccountDetailPOEncrypt.decryptItem(insuranceAccountDetailPO);
|
|
|
|
|
String socialPerJson = insuranceAccountDetailPO.getSocialPerJson();
|
|
|
|
|
String socialComJson = insuranceAccountDetailPO.getSocialComJson();
|
|
|
|
|
String fundPerJson = insuranceAccountDetailPO.getFundPerJson();
|
|
|
|
|
String fundComJson = insuranceAccountDetailPO.getFundComJson();
|
|
|
|
|
String otherPerJson = insuranceAccountDetailPO.getOtherPerJson();
|
|
|
|
|
String otherComJson = insuranceAccountDetailPO.getOtherComJson();
|
|
|
|
|
|
|
|
|
|
Map<String, String> dataMap = new HashMap<>();
|
|
|
|
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
getPaymentGroup(socialPerJson, "个人", "社保", dataMap, addGroups);
|
|
|
|
|
getPaymentGroup(socialComJson, "公司", "社保", dataMap, addGroups);
|
|
|
|
|
getPaymentGroup(fundPerJson, "个人", "公积金", dataMap, addGroups);
|
|
|
|
|
getPaymentGroup(fundComJson, "公司", "公积金", dataMap, addGroups);
|
|
|
|
|
getPaymentGroup(otherPerJson, "个人", "其他福利", dataMap, addGroups);
|
|
|
|
|
getPaymentGroup(otherComJson, "公司", "其他福利", dataMap, addGroups);
|
|
|
|
|
|
|
|
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
|
|
|
resultMap.put("data", dataMap);
|
|
|
|
|
resultMap.put("items", addGroups);
|
|
|
|
|
|
|
|
|
|
return resultMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void getPaymentGroup(String baseJson, String groupType, String welfareType, Map<String, String> dataMap, List<SearchConditionGroup> addGroups) {
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(baseJson)) {
|
|
|
|
|
addGroups.add(new SearchConditionGroup(welfareType + groupType +"缴纳", true, null));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String groupPrefix = "个人".equals(groupType) ? "per" : "com";
|
|
|
|
|
|
|
|
|
|
Map<String, String> toDealMap = JSON.parseObject(baseJson, new HashMap<String, String>().getClass());
|
|
|
|
|
Map<String, String> baseJsonMap = new HashMap<>();
|
|
|
|
|
List<SearchConditionItem> inputItems = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
for (Map.Entry<String, String> entry : toDealMap.entrySet()) {
|
|
|
|
|
//获取福利项信息
|
|
|
|
|
ICategoryPO iCategoryPO = siCategoryBiz.getByID(Long.valueOf(entry.getKey()));
|
|
|
|
|
if (iCategoryPO != null) {
|
|
|
|
|
String name = groupPrefix + iCategoryPO.getId().toString();
|
|
|
|
|
String label = iCategoryPO.getInsuranceName();
|
|
|
|
|
inputItems.add(SalaryFormItemUtil.inputNumberItem(user, "precision:2", 2, 12, 2, label, name));
|
|
|
|
|
}
|
|
|
|
|
baseJsonMap.put(groupPrefix + entry.getKey(), entry.getValue());
|
|
|
|
|
}
|
|
|
|
|
dataMap.putAll(baseJsonMap);
|
|
|
|
|
addGroups.add(new SearchConditionGroup(welfareType + groupType +"缴纳", true, inputItems));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|