| @@ -56,8 +56,9 @@ public class PrintCustomedTableDataHandler{ | |||||
| String trstyle = titleTr.attr("style"); | String trstyle = titleTr.attr("style"); | ||||
| for (int i = 0 ; i < listdata.size(); i ++) { | for (int i = 0 ; i < listdata.size(); i ++) { | ||||
| Object object = listdata.get(i); | Object object = listdata.get(i); | ||||
| JSONObject o = JSON.parseObject(JSON.toJSONString(object)); | |||||
| Element tr = titleTr.parent().appendElement("tr"); | |||||
| Element tr = new Element("tr"); | |||||
| titleTr.parent().insertChildren(i+1, tr); | |||||
| if (StringUtils.isNotBlank(trclass)) { | if (StringUtils.isNotBlank(trclass)) { | ||||
| tr.attr("class", trclass); | tr.attr("class", trclass); | ||||
| } | } | ||||
| @@ -80,6 +80,14 @@ public class PrintFinanceReceiveDataHandler implements PrintDataParser{ | |||||
| } | } | ||||
| } | } | ||||
| return ""; | return ""; | ||||
| }else if (name.equals("merchantId")) { | |||||
| if (null != merchantMap) { | |||||
| WxMerchant m = merchantMap.get(receive.getMerchantId()); | |||||
| if (null != m) { | |||||
| return m.getName(); | |||||
| } | |||||
| } | |||||
| return ""; | |||||
| }else if (name.equals("shopNumber")) { | }else if (name.equals("shopNumber")) { | ||||
| if (null != shopNumber) { | if (null != shopNumber) { | ||||
| return shopNumber.get(receive.getMerchantId()); | return shopNumber.get(receive.getMerchantId()); | ||||
| @@ -0,0 +1,82 @@ | |||||
| package com.iformall.print.data.impl; | |||||
| import java.util.Map; | |||||
| import org.springframework.stereotype.Service; | |||||
| import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils; | |||||
| import com.iformall.domain.po.WxAllBill; | |||||
| import com.iformall.domain.po.WxEnergyFees; | |||||
| import com.iformall.domain.po.WxFinanceReceiveBill; | |||||
| import com.iformall.domain.po.WxMerchant; | |||||
| import com.iformall.print.data.PrintDataParser; | |||||
| import com.iformall.utils.DateUtils; | |||||
| @Service | |||||
| public class PrintReceiveBillDataHandler implements PrintDataParser{ | |||||
| @Override | |||||
| public Object getObjectValue(String name, Object o,Object... params) { | |||||
| Map<Long, WxMerchant> merchantMap = (Map<Long, WxMerchant>) params[0]; | |||||
| Map<Long, WxEnergyFees> feesMap = (Map<Long, WxEnergyFees>) params[1]; | |||||
| Map<Long,String> shopNumber = (Map<Long, String>) params[2]; | |||||
| WxFinanceReceiveBill receive = (WxFinanceReceiveBill) o; | |||||
| if (name.equals("id")) { | |||||
| return receive.getId(); | |||||
| }else if (name.equals("createtime")) { | |||||
| if (null != receive.getCreateTime()) { | |||||
| return DateUtils.date2String(receive.getCreateTime()); | |||||
| } | |||||
| return ""; | |||||
| }else if (name.equals("receiveId")) { | |||||
| return receive.getReceiveId(); | |||||
| }else if (name.equals("billId")) { | |||||
| return receive.getBillId(); | |||||
| }else if (name.equals("feesId") || name.equals("feesName")) { | |||||
| if (StringUtils.isNotBlank(receive.getFeesName())) { | |||||
| return receive.getFeesName(); | |||||
| } | |||||
| if (null != feesMap && null != receive.getFeesId()) { | |||||
| WxEnergyFees f = feesMap.get(receive.getFeesId()); | |||||
| if (null != f) { | |||||
| return f.getName(); | |||||
| } | |||||
| } | |||||
| return ""; | |||||
| }else if (name.equals("receive")) { | |||||
| return receive.getReceive(); | |||||
| }else if (name.equals("pay")) { | |||||
| return receive.getPay(); | |||||
| }else if (name.equals("starttime")) { | |||||
| if (null != receive.getStarttime()) { | |||||
| return DateUtils.date2String(receive.getStarttime(),DateUtils.DATE_PATTERN); | |||||
| } | |||||
| return ""; | |||||
| }else if (name.equals("endtime")) { | |||||
| if (null != receive.getEndtime()) { | |||||
| return DateUtils.date2String(receive.getEndtime(),DateUtils.DATE_PATTERN); | |||||
| } | |||||
| return ""; | |||||
| }else if (name.equals("merchantName") || name.equals("merchantId")) { | |||||
| if (null != merchantMap && null != receive.getMerchantId()) { | |||||
| WxMerchant m = merchantMap.get(receive.getMerchantId()); | |||||
| if (null != m) { | |||||
| return m.getName(); | |||||
| } | |||||
| } | |||||
| return ""; | |||||
| }else if (name.equals("shopNumber")) { | |||||
| if (StringUtils.isNotBlank(receive.getShopNumber())) { | |||||
| return receive.getShopNumber(); | |||||
| } | |||||
| if (null != shopNumber && null != receive.getMerchantId()) { | |||||
| String m = shopNumber.get(receive.getMerchantId()); | |||||
| return m; | |||||
| } | |||||
| return ""; | |||||
| } | |||||
| return null; | |||||
| } | |||||
| } | |||||
| @@ -36,7 +36,7 @@ public interface WxFinanceService { | |||||
| WxFinanceReceive getReceiveById(TenantEntity tenantEntity,Long id); | WxFinanceReceive getReceiveById(TenantEntity tenantEntity,Long id); | ||||
| void invalidReceive(WxFinanceReceive record,MallUserInfo user,String remark); | void invalidReceive(WxFinanceReceive record,MallUserInfo user,String remark); | ||||
| void redSetoffReceive(WxFinanceReceive record,MallUserInfo user); | void redSetoffReceive(WxFinanceReceive record,MallUserInfo user); | ||||
| List<Long> getReceiveBillIds(WxFinanceReceiveBill record); | |||||
| List<WxFinanceReceiveBill> getReceiveBills(WxFinanceReceiveBill record); | |||||
| void updateReceivePrint(WxFinanceReceive record); | void updateReceivePrint(WxFinanceReceive record); | ||||
| //预收款 | //预收款 | ||||
| List<WxAllBill> calcuetSetOff(FinanceSetOffDTO dto,MallUserInfo user); | List<WxAllBill> calcuetSetOff(FinanceSetOffDTO dto,MallUserInfo user); | ||||
| @@ -34,6 +34,7 @@ import com.iformall.print.data.PrintDataParser; | |||||
| import com.iformall.print.data.impl.PrintBillDataHandler; | import com.iformall.print.data.impl.PrintBillDataHandler; | ||||
| import com.iformall.print.data.impl.PrintFinanceReceiveDataHandler; | import com.iformall.print.data.impl.PrintFinanceReceiveDataHandler; | ||||
| import com.iformall.print.data.impl.PrintMerchantSettleDataHandler; | import com.iformall.print.data.impl.PrintMerchantSettleDataHandler; | ||||
| import com.iformall.print.data.impl.PrintReceiveBillDataHandler; | |||||
| import com.iformall.service.WxAllBillService; | import com.iformall.service.WxAllBillService; | ||||
| import com.iformall.service.WxEnergyService; | import com.iformall.service.WxEnergyService; | ||||
| import com.iformall.service.WxFinancePrintService; | import com.iformall.service.WxFinancePrintService; | ||||
| @@ -78,6 +79,9 @@ public class WxFinancePrintServiceImpl implements WxFinancePrintService { | |||||
| @Autowired | @Autowired | ||||
| PrintBillDataHandler printBillDataHandler; | PrintBillDataHandler printBillDataHandler; | ||||
| @Autowired | |||||
| PrintReceiveBillDataHandler printReceiveBillDataHandler; | |||||
| @Autowired | @Autowired | ||||
| PrintMerchantSettleDataHandler printMerchantSettleDataHandler; | PrintMerchantSettleDataHandler printMerchantSettleDataHandler; | ||||
| @@ -269,25 +273,8 @@ public class WxFinancePrintServiceImpl implements WxFinancePrintService { | |||||
| WxFinanceReceiveBill rb = new WxFinanceReceiveBill(); | WxFinanceReceiveBill rb = new WxFinanceReceiveBill(); | ||||
| rb.updateTenantInfo(re); | rb.updateTenantInfo(re); | ||||
| rb.setReceiveId(re.getId()); | rb.setReceiveId(re.getId()); | ||||
| List<Long> billIdList = wxFinanceService.getReceiveBillIds(rb); | |||||
| List<WxAllBill> billList = null; | |||||
| if (null != billIdList && billIdList.size() > 0 ) { | |||||
| WxAllBill billq = new WxAllBill(); | |||||
| billq.updateTenantInfo(re); | |||||
| billq.setIds(billIdList); | |||||
| billList = wxAllBillService.list(billq); | |||||
| } | |||||
| if (null != billList) { | |||||
| WxAllBill billq = new WxAllBill(); | |||||
| billq.setShopNumber("合计"); | |||||
| billq.setEnergyFeesName(PriceUtilV2.number2CNMontrayUnit(new BigDecimal(re.getAllReceiveMoney()))); | |||||
| billq.setReceivePay(re.getReceiveMoney()); | |||||
| billq.setSetOff(re.getSetOffMoney()); | |||||
| billList.add(billq); | |||||
| } | |||||
| PrintVo vo = handleComponentData(re.getId(),templateId,o,items, printFinanceReceiveDataHandler,re,printBillDataHandler, billList,merchantMap,feesMap,shopNumber); | |||||
| List<WxFinanceReceiveBill> rbills = wxFinanceService.getReceiveBills(rb); | |||||
| PrintVo vo = handleComponentData(re.getId(),templateId,o,items, printFinanceReceiveDataHandler,re,printReceiveBillDataHandler, rbills,merchantMap,feesMap,shopNumber); | |||||
| if (null != vo) { | if (null != vo) { | ||||
| voList.add(vo); | voList.add(vo); | ||||
| } | } | ||||
| @@ -1048,8 +1048,8 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public List<Long> getReceiveBillIds(WxFinanceReceiveBill record) { | |||||
| return wxFinanceReceiveBillMapper.findBillIdList(record); | |||||
| public List<WxFinanceReceiveBill> getReceiveBills(WxFinanceReceiveBill record) { | |||||
| return wxFinanceReceiveBillMapper.findList(record); | |||||
| } | } | ||||
| @Override | @Override | ||||