薪酬系统-福利台账,退差数据单条查看v2

This commit is contained in:
sy 2022-11-18 16:07:20 +08:00
parent ad0b89b91a
commit 746ab58ed3
6 changed files with 122 additions and 107 deletions

View File

@ -107,5 +107,29 @@ public class InsuranceAccountDetailPOEncrypt {
return item;
}
public static InsuranceAccountDetailPO encryptItem(InsuranceAccountDetailPO item) {
if(item == null) {
return item;
}
item.setSocialPaymentBaseString(AESEncryptUtil.encrypt(item.getSocialPaymentBaseString()));
item.setFundPaymentBaseString(AESEncryptUtil.encrypt(item.getFundPaymentBaseString()));
item.setOtherPaymentBaseString(AESEncryptUtil.encrypt(item.getOtherPaymentBaseString()));
item.setSocialPerJson(AESEncryptUtil.encrypt(item.getSocialPerJson()));
item.setSocialPerSum(AESEncryptUtil.encrypt(item.getSocialPerSum()));
item.setFundPerJson(AESEncryptUtil.encrypt(item.getFundPerJson()));
item.setFundPerSum(AESEncryptUtil.encrypt(item.getFundPerSum()));
item.setOtherPerJson(AESEncryptUtil.encrypt(item.getOtherPerJson()));
item.setOtherPerSum(AESEncryptUtil.encrypt(item.getOtherPerSum()));
item.setPerSum(AESEncryptUtil.encrypt(item.getPerSum()));
item.setSocialComJson(AESEncryptUtil.encrypt(item.getSocialComJson()));
item.setSocialComSum(AESEncryptUtil.encrypt(item.getSocialComSum()));
item.setComSum(AESEncryptUtil.encrypt(item.getComSum()));
item.setSocialSum(AESEncryptUtil.encrypt(item.getSocialSum()));
item.setFundSum(AESEncryptUtil.encrypt(item.getFundSum()));
item.setOtherSum(AESEncryptUtil.encrypt(item.getOtherSum()));
item.setTotal(AESEncryptUtil.encrypt(item.getTotal()));
return item;
}
}

View File

@ -26,6 +26,11 @@ public interface InsuranceAccountDetailMapper {
*/
List<InsuranceAccountDetailPO> list(@Param("param") InsuranceAccountDetailParam queryParam);
/**
* 通过id查询
*/
InsuranceAccountDetailPO getById(@Param("id") Long id);
/**
* 根据账单月份获取所有员工
*

View File

@ -1144,4 +1144,14 @@
</foreach>
</update>
<select id="getById" resultMap="BaseResultMap">
SELECT
<include refid="baseColumns"/>
FROM
hrsa_bill_detail t
left join hrmresource e on e.ID = t.employee_id
WHERE t.delete_type = 0
and t.id = #{id}
</select>
</mapper>

View File

@ -245,5 +245,10 @@ public interface SIAccountService {
*/
Map<String, Object> importExcelInsuranceDetail(ExcelInsuranceImportParam excelInsuranceImportParam);
/**
* 将通过id获取InsuranceAccountDetailPO中的社保公积金其他福利个人和公司缴纳数据
*/
Map<String, Object> getPaymentById(Long id);
}

View File

@ -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));
}
}

View File

@ -654,5 +654,22 @@ public class SIAccountController {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<InsuranceAccountDetailParam, Map<String, Object>>(user).run(getService(user)::listRecessionPage, insuranceAccountDetailParam);
}
/**
* 通过id获取InsuranceAccountDetailPO中的社保公积金其他福利个人和公司缴纳数据
* @param request
* @param response
* @param id
* @return
*/
@GET
@Path("/getPaymentById")
@Produces(MediaType.APPLICATION_JSON)
public String getPaymentById(@Context HttpServletRequest request, @Context HttpServletResponse response,
@QueryParam("id") Long id) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<Long, Map<String, Object>>(user).run(getService(user)::getPaymentById, id);
}
// **********************************退差 end*********************************/
}