From 229f13529be6c8f99083bfb47b47ab7d27bfad20 Mon Sep 17 00:00:00 2001 From: luozukai Date: Tue, 3 Sep 2019 17:17:48 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[=E5=90=88=E5=90=8C][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E5=BC=80=E5=8F=91=E7=BB=93=E7=AE=97=E5=8D=95]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migration/V201909031716__L_CONTRACT.sql | 1 + .../service/impl/WxBillAllServiceImpl.java | 51 ++++++++++++++++--- 2 files changed, 44 insertions(+), 8 deletions(-) create mode 100644 mallinkAdmin/src/main/resources/db/migration/V201909031716__L_CONTRACT.sql diff --git a/mallinkAdmin/src/main/resources/db/migration/V201909031716__L_CONTRACT.sql b/mallinkAdmin/src/main/resources/db/migration/V201909031716__L_CONTRACT.sql new file mode 100644 index 000000000..e33453878 --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V201909031716__L_CONTRACT.sql @@ -0,0 +1 @@ +update wx_flow_config set type=21 where name = '结算单审核'; \ No newline at end of file diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java index 1bd1f9838..156f2c22c 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java @@ -120,6 +120,9 @@ public class WxBillAllServiceImpl implements WxBillAllService { @Autowired WxBillSettleRecordService wxBillSettleRecordService; + @Autowired + WxBillSettleService wxBillSettleService; + @Override public Map listAsPage(WxBillAll record, Integer pageIndex, Integer pageSize) { //更新各账单状态 @@ -788,18 +791,50 @@ public class WxBillAllServiceImpl implements WxBillAllService { @Override public void exportSettleBill(WxBillSettle wxBillSettle, HttpServletRequest request, HttpServletResponse response) { - //商场名称 - WxMall wxMall = wxMallMapper.getByTenantId(wxBillSettle.getTenantId()); + wxBillSettle = wxBillSettleService.getById(wxBillSettle.getId()); + if(wxBillSettle.getReceiveBillIds() == null) wxBillSettle.setReceiveBillIds(new ArrayList<>()); + if(wxBillSettle.getPayBillIds() == null) wxBillSettle.setPayBillIds(new ArrayList<>()); + //映射结果 Map result = new HashMap<>(); - result.put("mall", wxMall.getName()); - - //编号 - String number = "JF" + DateUtils.getSystemTime("yyyyMMddHHmmss"); - result.put("number", number); + WxMall wxMall = wxMallMapper.getByTenantId(wxBillSettle.getTenantId()); + result.put("mall", wxMall.getName()); + result.put("merchant",wxMerchantMapper.selectByPrimaryKey(wxBillSettle.getMerchantId()).getName()); + result.put("num", wxBillSettle.getSettleNumber()); + result.put("cdate", DateUtils.format(wxBillSettle.getCreatetime())); + + BigDecimal receiveM = (new BigDecimal(wxBillSettle.getReceiveMoney()).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP)); + BigDecimal payM = (new BigDecimal(wxBillSettle.getPayMoney()).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP)); + BigDecimal bM = (new BigDecimal(wxBillSettle.getBalance()).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP)); + result.put("receiveM", receiveM.toString()+"元"); + result.put("payM", payM.toString()+"元"); + result.put("bM", bM.toString()+"元"); + result.put("receiveMU", PriceUtil.digitUppercase(receiveM.doubleValue())); + result.put("payMU", PriceUtil.digitUppercase(payM.doubleValue())); + result.put("bMU", PriceUtil.digitUppercase(bM.doubleValue())); + + List> rowsParams = new ArrayList<>(); + int size = wxBillSettle.getReceiveBillIds().size() > wxBillSettle.getPayBillIds().size()?wxBillSettle.getReceiveBillIds().size():wxBillSettle.getPayBillIds().size(); + int count = 1; + for (int i = 0; i < size ; i++) { + WxBillSettleBill bill = wxBillSettle.getReceiveBillIds().get(i); + Map map = new HashedMap(); + if(bill != null){ + map.put("s1",count+""); + map.put("bn1",bill.getBillName()); + map.put("money1",bill.getReceivePay()); + } + WxBillSettleBill payBill = wxBillSettle.getPayBillIds().get(i); + if(payBill != null){ + map.put("bn2",payBill.getBillName()); + map.put("money2",payBill.getReceivePay()); + } + rowsParams.add(map); + count++; + } - String templatePath = "contract-word-template/bill_owe.docx"; + String templatePath = "contract-word-template/settle.docx"; String filepath = fmUploadDir; String filename = UUID.randomUUID() + ".docx"; String exportFileName = "催缴单.docx"; From ef4488f90d5786bd77cabc3b9c4ae82e5296f3ad Mon Sep 17 00:00:00 2001 From: luozukai Date: Tue, 3 Sep 2019 17:40:03 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[=E5=90=88=E5=90=8C][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E5=BC=80=E5=8F=91=E7=BB=93=E7=AE=97=E5=8D=95]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/iformall/service/impl/WxFlowServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java index d87f2b377..e1239ea36 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -286,7 +286,7 @@ public class WxFlowServiceImpl implements WxFlowService { WxBillSettle wxBillSettle = new WxBillSettle(); wxBillSettle.setId(businessId); wxBillSettle.setApplyStatus(applyStatus); - wxBillSettleMapper.update(wxBillSettle); + wxBillSettleMapper.updateByPrimaryKeySelective(wxBillSettle); //审批完成,账单解冻 if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) {