Compare commits

...

4 Commits

Author SHA1 Message Date
Harryxzy db99e8239b 万德隆 动态薪资标准 2025-07-01 22:02:23 +08:00
Harryxzy f72d76540a Merge branch 'release/3.0.2.2504.01' into custom/万德隆 2025-06-30 14:26:28 +08:00
Harryxzy 3a1417b6a1 万德隆 动态薪资标准 2025-06-30 14:25:55 +08:00
Harryxzy 5cc0dda5f6 修复业务线版本个税申报bug 2025-06-27 13:45:57 +08:00
3 changed files with 59 additions and 17 deletions

View File

@ -1360,16 +1360,23 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
.distinct()
.map(Long::valueOf)
.collect(Collectors.toList());
Map<Long, String> positionMap = SalaryEntityUtil.convert2Map(getSalaryEmployeeService(user).listPositionInfo(gwIdList), PositionInfo::getId, PositionInfo::getName);
Map<Integer, String> positionMap = SalaryEntityUtil.convert2Map(getSalaryEmployeeService(user).listPositionInfo(gwIdList), positionInfo -> positionInfo.getId().intValue(), PositionInfo::getName);
// 查询所有岗位职级信息
rs.execute("select id,zj from uf_gwzjb");
Map<String, String> gwzjMap = new HashMap<>();
while (rs.next()) {
int id = rs.getInt("id");
String zj = rs.getString("zj");
gwzjMap.put(String.valueOf(id), zj);
}
List<Map<String, Object>> valueList = new ArrayList<>();
for (WdlGzjgDTO dto : wdlGzjgDTOList) {
Map<String, Object> singleValueMap = new HashMap<>();
singleValueMap.put("lb" ,lbValueMap.getOrDefault(dto.getLb(), ""));
singleValueMap.put("bgdd" ,locationValueMap.getOrDefault(dto.getBgdd(), ""));
singleValueMap.put("gwmc" ,positionMap.getOrDefault(dto.getGwmc(), ""));
// TODO 岗位职级标准要转换一下
singleValueMap.put("gwzj" ,dto.getGwzj());
singleValueMap.put("gwzj" ,gwzjMap.getOrDefault(dto.getGwzj(), ""));
singleValueMap.put("gzsp" ,dto.getGzsp());
List<WdlGzjgDtPO> detailList = dto.getDetailList();
Map<String, Integer> detailJeMap = SalaryEntityUtil.convert2Map(detailList, WdlGzjgDtPO::getXzxm, WdlGzjgDtPO::getJe);
@ -1546,6 +1553,14 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
String value = rs.getString("locationname");
locationValueMap.put(value, id);
}
// 查询岗位职级信息
rs.execute("select id,zj from uf_gwzjb");
Map <String, Integer> gwzjValueMap = new HashMap<>();
while (rs.next()) {
Integer id = rs.getInt("id");
String value = rs.getString("zj");
gwzjValueMap.put(value, id);
}
// 查询岗位名称信息
Map<String, Long> positionMap = SalaryEntityUtil.convert2Map(getSalaryEmployeeService(user).listAllPositionInfo(), PositionInfo::getName, PositionInfo::getId);
@ -1637,9 +1652,16 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
}
}
} else if (StringUtils.equals("岗位职级", dataKey) ) {
// todo
if (StringUtils.isNotBlank(dataValue)) {
Integer gwzjValue = gwzjValueMap.get(dataValue);
if (gwzjValue == null) {
isError = true;
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", row + "岗位职级信息不存在");
excelComments.add(errorMessageMap);
} else {
mainData.setGwzj(String.valueOf(gwzjValue));
}
}
} else if (salaryItemNameMap.containsKey(dataKey) && salaryItemNameMap.get(dataKey) != null) {
WdlGzjgDtPO detail = WdlGzjgDtPO.builder()
@ -1682,12 +1704,21 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
* 标准工资结构表 数据复制到历史标准工资结构表
*/
private void copyWdlReport2HistoryData() {
String dateStr = SalaryDateUtil.getFormatLocalDate(new Date()).replace("-", "").replace(" ", "");
RecordSet rs = new RecordSet();
rs.execute("select distinct(lsbb) from uf_bzgzjgbls");
int lsh = 1;
while (rs.next()) {
String lsbb = rs.getString("lsbb");
if (StringUtils.isNotBlank(lsbb) && lsbb.contains(dateStr)) {
lsh++;
}
}
rs.execute("select id,lb,bgdd,gwmc,gwzj,gzsp,mxbmr,gwzj1 from uf_bzgzjgb");
List<WdlGzjgDTO> mainList = new ArrayList<>();
String dateStr = SalaryDateUtil.getFormatLocalDateTime(new Date()).replace("-", "").replace(":", "").replace(" ", "");
String lsbb = StringUtils.substring(dateStr, 0, 12);
String lsbb = dateStr + String.format("%04d", lsh);;
while (rs.next()) {
WdlGzjgDTO wdlGzjgDTO = new WdlGzjgDTO();
wdlGzjgDTO.setId(rs.getInt("id"));
@ -1725,7 +1756,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
List<List<WdlGzjgDTO>> partition = Lists.partition(mainList, 500);
partition.forEach(part -> {
StringBuilder sb = new StringBuilder();
sb.append("insert into uf_bzgzjgbls_temp(formmodeid,modedatacreater,modedatacreatertype,modedatacreatedate,modedatacreatetime,id,lb,bgdd,gwmc,gwzj,gzsp,mxbmr,gwzj1,lsbb) values ");
sb.append("insert into uf_bzgzjgbls(formmodeid,modedatacreater,modedatacreatertype,modedatacreatedate,modedatacreatetime,id,lb,bgdd,gwmc,gwzj,gzsp,lsbb) values ");
for (WdlGzjgDTO data : part) {
sb.append("(")
.append(modeId).append(",1,0,").append(currDate).append(",").append(currTime).append(",")
@ -1735,8 +1766,8 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
.append(data.getGwmc()).append(",'")
.append(data.getGwzj()).append("',")
.append(data.getGzsp()).append(",'")
.append(data.getMxbmr()).append("','")
.append(data.getGwzj1()).append("','")
// .append(data.getMxbmr()).append("','")
// .append(data.getGwzj1()).append("','")
.append(data.getLsbb()).append("'),");
}
boolean execute = rs.execute(sb.substring(0, sb.length() - 1).toString());
@ -1752,7 +1783,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
List<List<WdlGzjgDtPO>> partition = Lists.partition(detailList, 500);
partition.forEach(part -> {
StringBuilder sb = new StringBuilder();
sb.append("insert into uf_bzgzjgbls_temp_dt1(id,mainid,xzxm,je) values ");
sb.append("insert into uf_bzgzjgbls_dt1(id,mainid,xzxm,je) values ");
for (WdlGzjgDtPO data : part) {
sb.append("(")
.append(data.getId()).append(",")

View File

@ -440,7 +440,8 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi
List<Long> effectiveSalaryItemDels = Lists.newArrayList();
List<SalaryArchiveItemPO> salaryArchiveItemNews = Lists.newArrayList();
salaryArchiveItems.forEach(e -> {
for (int j = 0; j < salaryArchiveItems.size(); j++) {
SalaryArchiveItemDetailSaveParam e = salaryArchiveItems.get(j);
// 已生效
List<SalaryArchiveItemPO> effectiveList = effectiveSalaryItems.stream().filter(i -> i.getSalaryItemId().equals(e.getSalaryItemId())).collect(Collectors.toList());
// 当前已生效
@ -461,7 +462,8 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi
// 1.2 如果等于当前已生效 fixme 日期比较可能有bug
} else if (saveEffectiveTime.equals(effectiveTime)) {
if (effectiveBeforeSalaryItem != null && effectiveBeforeSalaryItem.getItemValue().equals(e.getAdjustValue())) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100432, "调整前后不可相同"));
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100432, "调整前后不可相同"));
continue;
}
if (ineffectiveSalaryItem != null && ineffectiveSalaryItem.getItemValue().equals(e.getAdjustValue())) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100434, "与未生效的调整后不可相同"));
@ -469,14 +471,16 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi
// 1.3 如果>已经生效且<=今天
} else if (saveEffectiveTime.after(effectiveTime) && !saveEffectiveTime.after(today)) {
if (effectiveSalaryItem.getItemValue().equals(e.getAdjustValue())) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100432, "调整前后不可相同"));
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100432, "调整前后不可相同"));
continue;
}
if (ineffectiveSalaryItem != null && ineffectiveSalaryItem.getItemValue().equals(e.getAdjustValue())) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100434, "与未生效的调整后不可相同"));
}
// 1.4 如果>今天
} else if (saveEffectiveTime.after(today) && effectiveSalaryItem.getItemValue().equals(e.getAdjustValue())) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100432, "调整前后不可相同"));
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100432, "调整前后不可相同"));
continue;
}
} else if (ineffectiveSalaryItem != null && ineffectiveSalaryItem.getItemValue().equals(e.getAdjustValue())) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100434, "与未生效的调整后不可相同"));
@ -489,7 +493,7 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi
effectiveSalaryItemDels.add(ineffectiveSalaryItem.getId());
}
salaryArchiveItemNews.add(buildInsert(salaryArchive, e.getSalaryItemId(), e.getAdjustValue(), saveParam, nowTime, e.getDescription()));
});
}
// 落库处理
if (CollectionUtils.isNotEmpty(effectiveSalaryItemDels)) {

View File

@ -210,7 +210,14 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration
.replace("{1}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth())));
}
// 查询薪资所属月的薪资核算记录
salaryAcctRecordPOS = listBySalaryMonth(SalaryAcctRecordPO.builder().salaryMonths(salaryMonthDateRange).taxAgentId(taxAgentId).build());
salaryAcctRecordPOS = listBySalaryMonth(SalaryAcctRecordPO.builder().salaryMonths(salaryMonthDateRange).build());
List<SalarySobPO> salarySobPOS = getSalarySobService(user).listByTaxAgentId(saveParam.getTaxAgentId());
if (CollectionUtils.isEmpty(salarySobPOS)) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98874, "{0}该义务人下无账套数据").replace("{0}", saveParam.getSalaryMonth().toString()));
}
List<Long> salarySobIds = salarySobPOS.stream().map(SalarySobPO::getId).collect(Collectors.toList());
salaryAcctRecordPOS.stream().filter(record -> salarySobIds.contains(record.getSalarySobId())).collect(Collectors.toList());
// 无薪资核算记录不允许生成个税申报表
if (CollectionUtils.isEmpty(salaryAcctRecordPOS)) {