1、社保公积金解锁加锁分开

2、报表加2个字段
3、推送成功反写状态不根据id反写 根据公司名称
This commit is contained in:
Harryxzy 2025-08-15 13:33:43 +08:00
parent 6de10786df
commit d5ed2ffac0
7 changed files with 72 additions and 7 deletions

View File

@ -102,6 +102,7 @@ public interface LyFundReportService {
XSSFWorkbook exportFundReport(LySalaryReportQueryParam param);
List<LyFundReportPO> getByIds(List<Long> ids);
List<LyFundReportPO> listSome(LyFundReportPO lyFundReportPO);
/**
* 社保公积金购买公司下拉框list

View File

@ -104,6 +104,7 @@ public interface LySalaryReportService {
List<String> getCanManageFrztByUid(User user);
List<LySalaryReportPO> getByIds(List<Long> ids);
List<LySalaryReportPO> listSome(LySalaryReportPO lySalaryReport);
void deleteAllSalaryReport(LySalaryReportQueryParam queryParam);

View File

@ -102,6 +102,7 @@ public interface LySocialReportService {
XSSFWorkbook exportSIReport(LySalaryReportQueryParam param);
List<LySocialReportPO> getByIds(List<Long> ids);
List<LySocialReportPO> ListSome(LySocialReportPO lySocialReportPO);
/**
* 社保公积金购买公司下拉框list

View File

@ -751,6 +751,11 @@ public class LyFundReportServiceImpl extends Service implements LyFundReportServ
}
}
@Override
public List<LyFundReportPO> listSome(LyFundReportPO lyFundReportPO) {
return getLyFundReportMapper().listSome(lyFundReportPO);
}
@Override
public Map<String, Object> fundReportGmgsList(LySalaryReportQueryParam param) {
if (StringUtils.isBlank(param.getSalaryMonth())) {

View File

@ -925,9 +925,11 @@ public class LyPZServiceImpl extends Service implements LyPZService {
*/
private void updateReportStatus(LyVoucherPushParam pushParam) {
int pushStatus = pushParam.getStatus() == null ? LyPushStatusEnum.WAIT.getValue() : pushParam.getStatus();
List<Long> dataSource = pushParam.getDataSource();
Date date = SalaryDateUtil.dateStrToLocalYearMonth(pushParam.getSalaryMonth());
// List<Long> dataSource = pushParam.getDataSource();
if (pushParam.getPzlx().equals(LyPZTypeEnum.XZJTPZ.getValue()) || pushParam.getPzlx().equals(LyPZTypeEnum.XZFFPZ.getValue())) {
List<LySalaryReportPO> salaryReportList = getLySalaryReportService(user).getByIds(dataSource);
// List<LySalaryReportPO> salaryReportList = getLySalaryReportService(user).getByIds(dataSource);
List<LySalaryReportPO> salaryReportList = getLySalaryReportService(user).listSome(LySalaryReportPO.builder().salaryMonth(date).ffgsqc(pushParam.getFfgsqc()).build());
salaryReportList.stream().forEach(po -> {
if (pushParam.getPzlx().equals(LyPZTypeEnum.XZJTPZ.getValue())) {
po.setXzjtpzFlag(pushStatus);
@ -937,7 +939,8 @@ public class LyPZServiceImpl extends Service implements LyPZService {
getLySalaryReportService(user).update(po);
});
} else if (pushParam.getPzlx().equals(LyPZTypeEnum.SBJTPZ.getValue()) || pushParam.getPzlx().equals(LyPZTypeEnum.SBFFPZ.getValue())) {
List<LySocialReportPO> socialReportList = getLySocialReportService(user).getByIds(dataSource);
// List<LySocialReportPO> socialReportList = getLySocialReportService(user).getByIds(dataSource);
List<LySocialReportPO> socialReportList = getLySocialReportService(user).ListSome(LySocialReportPO.builder().salaryMonth(date).gmgsqc(pushParam.getFfgsqc()).build());
socialReportList.stream().forEach(po -> {
if (pushParam.getPzlx().equals(LyPZTypeEnum.SBJTPZ.getValue())) {
po.setSbjtpzFlag(pushStatus);
@ -947,7 +950,8 @@ public class LyPZServiceImpl extends Service implements LyPZService {
getLySocialReportService(user).update(po);
});
} else if (pushParam.getPzlx().equals(LyPZTypeEnum.GJJJTPZ.getValue()) || pushParam.getPzlx().equals(LyPZTypeEnum.GJJFFPZ.getValue())) {
List<LyFundReportPO> fundReportList = getLyFundReportService(user).getByIds(dataSource);
// List<LyFundReportPO> fundReportList = getLyFundReportService(user).getByIds(dataSource);
List<LyFundReportPO> fundReportList = getLyFundReportService(user).listSome(LyFundReportPO.builder().salaryMonth(date).gmgsqc(pushParam.getFfgsqc()).build());
fundReportList.stream().forEach(po -> {
if (pushParam.getPzlx().equals(LyPZTypeEnum.GJJJTPZ.getValue())) {
po.setGjjjtpzFlag(pushStatus);
@ -1010,6 +1014,7 @@ public class LyPZServiceImpl extends Service implements LyPZService {
RecordSet rs = new RecordSet();
String sql = "";
List<Integer> needUpdateIds = new ArrayList<>();
List<Integer> needUpdateGjjIds = new ArrayList<>();
if (gsId != null && gsId != 0) {
if (pushParam.getPzlx().equals(LyPZTypeEnum.SBFFPZ.getValue()) || pushParam.getPzlx().equals(LyPZTypeEnum.SBJTPZ.getValue())) {
sql = "select id from uf_sbgjj where fyszq = '"+pushParam.getSalaryMonth()+"' and gmgsqc=" + gsId;
@ -1021,7 +1026,7 @@ public class LyPZServiceImpl extends Service implements LyPZService {
sql = "select id from uf_sbgjj where fyszq = '"+pushParam.getSalaryMonth()+"' and fycdgsqc=" + gsId;
rs.execute(sql);
while (rs.next()) {
needUpdateIds.add(rs.getInt("id"));
needUpdateGjjIds.add(rs.getInt("id"));
}
}
// 入库
@ -1043,6 +1048,25 @@ public class LyPZServiceImpl extends Service implements LyPZService {
ModeRightInfo.editModeDataShare(1, modeId, id);
}
}
if (CollectionUtils.isNotEmpty(needUpdateGjjIds)) {
List<List<Integer>> partition = Lists.partition(needUpdateGjjIds, 800);
partition.forEach( part -> {
String idStr = StringUtils.join(part, ",");
String updateSql = "update uf_sbgjj set gjjsjsd = 0 where id in (" + idStr + ")";
rs.execute(updateSql);
});
// 获取社保公积金模块id
BaseBean baseBean = new BaseBean();
Integer modeId = NumberUtils.isCreatable(baseBean.getPropValue("lySalaryNCVoucher", "sbgjj_mode_id"))
? Integer.valueOf(baseBean.getPropValue("lySalaryNCVoucher", "sbgjj_mode_id")) : 0;
// 权限重构
for (Integer id : needUpdateGjjIds) {
ModeRightInfo ModeRightInfo = new ModeRightInfo();
ModeRightInfo.setNewRight(true);
ModeRightInfo.editModeDataShare(1, modeId, id);
}
}
}
}
resultMap.put("status", (pushParam.getStatus() != null && pushParam.getStatus().equals(NumberUtils.INTEGER_ONE)) ? Boolean.TRUE : Boolean.FALSE);
@ -1454,6 +1478,7 @@ public class LyPZServiceImpl extends Service implements LyPZService {
RecordSet rs = new RecordSet();
String sql = "";
List<Integer> needUpdateIds = new ArrayList<>();
List<Integer> needUpdateGjjIds = new ArrayList<>();
String formatYearMonth = SalaryDateUtil.getFormatYearMonth(voucherPO.getSalaryMonth());
// 修改报表中数据推送状态
Integer pzlx = voucherPO.getPzlx();
@ -1506,10 +1531,10 @@ public class LyPZServiceImpl extends Service implements LyPZService {
});
if (gsId != null && gsId != 0) {
sql = "select id from uf_sbgjj where fyszq = '" + formatYearMonth + "' and fycdgsqc=" + gsId + " and sjsd = 0";
sql = "select id from uf_sbgjj where fyszq = '" + formatYearMonth + "' and fycdgsqc=" + gsId + " and gjjsjsd = 0";
rs.execute(sql);
while (rs.next()) {
needUpdateIds.add(rs.getInt("id"));
needUpdateGjjIds.add(rs.getInt("id"));
}
}
}
@ -1533,6 +1558,26 @@ public class LyPZServiceImpl extends Service implements LyPZService {
ModeRightInfo.editModeDataShare(1, modeId, id);
}
}
// 入库
if (CollectionUtils.isNotEmpty(needUpdateGjjIds)) {
List<List<Integer>> partition = Lists.partition(needUpdateGjjIds, 800);
partition.forEach( part -> {
String idStr = StringUtils.join(part, ",");
String updateSql = "update uf_sbgjj set gjjsjsd = 1 where id in (" + idStr + ")";
rs.execute(updateSql);
});
// 获取社保公积金模块id
BaseBean baseBean = new BaseBean();
Integer modeId = NumberUtils.isCreatable(baseBean.getPropValue("lySalaryNCVoucher", "sbgjj_mode_id"))
? Integer.valueOf(baseBean.getPropValue("lySalaryNCVoucher", "sbgjj_mode_id")) : 0;
// 权限重构
for (Integer id : needUpdateGjjIds) {
ModeRightInfo ModeRightInfo = new ModeRightInfo();
ModeRightInfo.setNewRight(true);
ModeRightInfo.editModeDataShare(1, modeId, id);
}
}
}
// }
}

View File

@ -1291,9 +1291,14 @@ public class LySalaryReportServiceImpl extends Service implements LySalaryReport
// 获取需要统计的薪资项目id
BaseBean baseBean = new BaseBean();
Long gsmcItemId = NumberUtils.isCreatable(baseBean.getPropValue("lySalaryReport", "bsb_gsmc_item_id")) ? Long.valueOf(baseBean.getPropValue("lySalaryReport", "fbb_gsmc_item_id")) : 0L;
Long pqItemId = NumberUtils.isCreatable(baseBean.getPropValue("lySalaryReport", "bsb_pq_item_id")) ? Long.valueOf(baseBean.getPropValue("lySalaryReport", "bsb_pq_item_id")) : 0L;
Long xmItemId = NumberUtils.isCreatable(baseBean.getPropValue("lySalaryReport", "bsb_xm_item_id")) ? Long.valueOf(baseBean.getPropValue("lySalaryReport", "bsb_xm_item_id")) : 0L;
String salaryItemIdStr = Utils.null2String(baseBean.getPropValue("lySalaryReport", "bsb_report_item_ids"));
List<Long> salaryItemIds = Arrays.stream(salaryItemIdStr.split(",")).filter(NumberUtils::isCreatable).map(Long::valueOf).collect(Collectors.toList());
salaryItemIds.add(gsmcItemId);
salaryItemIds.add(pqItemId);
salaryItemIds.add(xmItemId);
List<SalaryItemPO> salaryItemList = getSalaryItemService(user).listByIds(salaryItemIds);
Map<Long, SalaryItemPO> salaryItemMap = SalaryEntityUtil.convert2Map(salaryItemList, SalaryItemPO::getId);
@ -1396,6 +1401,8 @@ public class LySalaryReportServiceImpl extends Service implements LySalaryReport
// 构建表头
List<WeaTableColumn> columns = new ArrayList<>();
columns.add(new WeaTableColumn("150px", "公司名称", gsmcItemId.toString()));
columns.add(new WeaTableColumn("150px", "片区", pqItemId.toString()));
columns.add(new WeaTableColumn("150px", "项目", xmItemId.toString()));
columns.add(new WeaTableColumn("150px", "部门", "departmentName"));
columns.add(new WeaTableColumn("150px", "姓名", "userName"));
columns.add(new WeaTableColumn("150px", "身份证号", "idNo"));

View File

@ -1031,6 +1031,11 @@ public class LySocialReportServiceImpl extends Service implements LySocialReport
}
}
@Override
public List<LySocialReportPO> ListSome(LySocialReportPO lySocialReportPO) {
return getLySocialReportMapper().listSome(lySocialReportPO);
}
@Override
public Map<String, Object> sIReportGmgsList(LySalaryReportQueryParam param) {
if (StringUtils.isBlank(param.getSalaryMonth())) {