From a4d5c21cdedee193ec2990294cd80ac67d42ec4d Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Fri, 6 Sep 2024 09:12:38 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=86=E6=82=A6=20temp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/entity/ly/param/LyFzhslxParam.java | 4 ++++ .../salary/service/impl/LyPZServiceImpl.java | 20 ++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/com/engine/salary/entity/ly/param/LyFzhslxParam.java b/src/com/engine/salary/entity/ly/param/LyFzhslxParam.java index 2e314526d..3c569e683 100644 --- a/src/com/engine/salary/entity/ly/param/LyFzhslxParam.java +++ b/src/com/engine/salary/entity/ly/param/LyFzhslxParam.java @@ -24,4 +24,8 @@ public class LyFzhslxParam extends BaseQueryParam { private String key; + /** + * 辅助核算类型 + */ + private Integer fzhslx; } diff --git a/src/com/engine/salary/service/impl/LyPZServiceImpl.java b/src/com/engine/salary/service/impl/LyPZServiceImpl.java index dbce55a26..4be081a65 100644 --- a/src/com/engine/salary/service/impl/LyPZServiceImpl.java +++ b/src/com/engine/salary/service/impl/LyPZServiceImpl.java @@ -256,6 +256,20 @@ public class LyPZServiceImpl extends Service implements LyPZService { Map resultMap = new HashMap<>(); resultMap.put("columns" , columns); resultMap.put("data", lyPzPreviewList); + + // 求合计值 + BigDecimal jfTotal = new BigDecimal("0"); + BigDecimal dfTotal = new BigDecimal("0"); + for (LyPzPreview pzPreview : lyPzPreviewList) { + if (NumberUtils.isCreatable(pzPreview.getJfValue())) { + jfTotal = jfTotal.add(new BigDecimal(pzPreview.getJfValue())); + } + if (NumberUtils.isCreatable(pzPreview.getDfValue())) { + dfTotal = dfTotal.add(new BigDecimal(pzPreview.getDfValue())); + } + } + LyPzPreview sumPz = LyPzPreview.builder().zy("合计").jfValue(jfTotal.toPlainString()).dfValue(dfTotal.toPlainString()).build(); + resultMap.put("totalData", sumPz); return resultMap; } @@ -313,7 +327,11 @@ public class LyPZServiceImpl extends Service implements LyPZService { RecordSet rs = new RecordSet(); BaseBean baseBean = new BaseBean(); String fzhslxFieldId = baseBean.getPropValue("lySalaryNCVoucher", "fzhslx_field_id"); - rs.execute("select bh,mc,fzhslx,b.selectname from uf_NCfuhs a left join workflow_selectitem b on a. fzhslx= b.SELECTVALUE where b.FIELDID=" + fzhslxFieldId); + if (queryParam.getFzhslx() == null ) { + rs.execute("select bh,mc,fzhslx,b.selectname from uf_NCfuhs a left join workflow_selectitem b on a. fzhslx= b.SELECTVALUE where b.FIELDID=" + fzhslxFieldId ); + } else { + rs.execute("select bh,mc,fzhslx,b.selectname from uf_NCfuhs a left join workflow_selectitem b on a. fzhslx= b.SELECTVALUE where b.FIELDID=" + fzhslxFieldId + "and a.fzhslx = "+ queryParam.getFzhslx()); + } List> resultList = new ArrayList<>(); while (rs.next()) { if (StringUtils.isNotBlank(queryParam.getKey())