| @@ -11,6 +11,7 @@ import com.iformall.domain.po.WxFinancePrintTemplate; | |||||
| import com.iformall.domain.po.base.BaseEntity; | import com.iformall.domain.po.base.BaseEntity; | ||||
| import com.iformall.enums.EnumBillAllType; | import com.iformall.enums.EnumBillAllType; | ||||
| import com.iformall.enums.EnumFinancePrintDataType; | import com.iformall.enums.EnumFinancePrintDataType; | ||||
| import com.iformall.enums.EnumYesOrNo; | |||||
| import com.iformall.service.WxFinancePrintService; | import com.iformall.service.WxFinancePrintService; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| @@ -51,16 +52,14 @@ public class WxFinancePrintController extends BaseController { | |||||
| @GetMapping("types") | @GetMapping("types") | ||||
| public ResultData types() { | public ResultData types() { | ||||
| List<Map> list = new ArrayList<Map>(); | List<Map> list = new ArrayList<Map>(); | ||||
| Map m = new HashMap(); | |||||
| m.put("id", EnumFinancePrintDataType.FINANCE_RECEIVE.getCode()); | |||||
| m.put("name", EnumFinancePrintDataType.FINANCE_RECEIVE.getMessage()); | |||||
| list.add(m); | |||||
| // for (EnumFinancePrintDataType t : EnumFinancePrintDataType.values()) { | |||||
| // Map m = new HashMap(); | |||||
| // m.put("id", t.getCode()); | |||||
| // m.put("name", t.getMessage()); | |||||
| // list.add(m); | |||||
| // } | |||||
| for (EnumFinancePrintDataType t : EnumFinancePrintDataType.values()) { | |||||
| if (t != EnumFinancePrintDataType.BILL) { | |||||
| Map m = new HashMap(); | |||||
| m.put("id", t.getCode()); | |||||
| m.put("name", t.getMessage()); | |||||
| list.add(m); | |||||
| } | |||||
| } | |||||
| return new ResultData(list); | return new ResultData(list); | ||||
| } | } | ||||
| @@ -69,6 +68,7 @@ public class WxFinancePrintController extends BaseController { | |||||
| @TenantIgnore | @TenantIgnore | ||||
| public ResultData printDatas(@ModelAttribute WxFinancePrintData record) { | public ResultData printDatas(@ModelAttribute WxFinancePrintData record) { | ||||
| record.setSortColumns("sort asc"); | record.setSortColumns("sort asc"); | ||||
| record.setIsDel(EnumYesOrNo.NO.getCode()); | |||||
| return new ResultData(wxFinancePrintService.printDataList(record)); | return new ResultData(wxFinancePrintService.printDataList(record)); | ||||
| } | } | ||||
| @@ -28,8 +28,9 @@ public class WxBillSum implements Serializable { | |||||
| public String getNoTaxNeedPay() { | public String getNoTaxNeedPay() { | ||||
| if (StringUtils.isNotBlank(taxRate)) { | if (StringUtils.isNotBlank(taxRate)) { | ||||
| noTaxNeedPay = new BigDecimal(needPay).multiply(new BigDecimal(taxRate)).setScale(2,BigDecimal.ROUND_HALF_UP).toPlainString(); | noTaxNeedPay = new BigDecimal(needPay).multiply(new BigDecimal(taxRate)).setScale(2,BigDecimal.ROUND_HALF_UP).toPlainString(); | ||||
| return noTaxNeedPay; | |||||
| } | } | ||||
| return noTaxNeedPay; | |||||
| return needPay; | |||||
| } | } | ||||
| @@ -4,6 +4,8 @@ import cn.afterturn.easypoi.excel.annotation.Excel; | |||||
| import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils; | import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils; | ||||
| import com.baomidou.mybatisplus.annotation.TableField; | import com.baomidou.mybatisplus.annotation.TableField; | ||||
| import com.iformall.utils.PriceUtilV2; | |||||
| import lombok.Data; | import lombok.Data; | ||||
| import java.io.Serializable; | import java.io.Serializable; | ||||
| @@ -33,6 +35,15 @@ public class WxMerchantBillVo implements Serializable { | |||||
| public String getNeedPayNumber() { | public String getNeedPayNumber() { | ||||
| return StringUtils.isBlank(needPay) ? "0" : new BigDecimal(needPay).toPlainString(); | return StringUtils.isBlank(needPay) ? "0" : new BigDecimal(needPay).toPlainString(); | ||||
| } | } | ||||
| @TableField(exist = false) | |||||
| private String needPayChinese; | |||||
| public String getNeedPayChinese() { | |||||
| if (StringUtils.isBlank(needPay)) { | |||||
| needPay = "0"; | |||||
| needPayChinese = PriceUtilV2.number2CNMontrayUnit(new BigDecimal(needPay)); | |||||
| } | |||||
| return needPayChinese; | |||||
| } | |||||
| private String paid; | private String paid; | ||||
| @Excel(name = "已付账单金额(元)", width = 20, orderNum = "5") | @Excel(name = "已付账单金额(元)", width = 20, orderNum = "5") | ||||
| @@ -67,6 +78,8 @@ public class WxMerchantBillVo implements Serializable { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private List<WxBillSum> billSumList; | private List<WxBillSum> billSumList; | ||||
| @TableField(exist = false) | |||||
| private Date currentTime; | |||||
| } | } | ||||
| @@ -1,5 +1,6 @@ | |||||
| package com.iformall.print.data.impl; | package com.iformall.print.data.impl; | ||||
| import java.util.Date; | |||||
| import java.util.Map; | import java.util.Map; | ||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| @@ -28,12 +29,16 @@ public class PrintMerchantSettleDataHandler implements PrintDataParser{ | |||||
| return DateUtils.date2String(receive.getMinDate(),DateUtils.DATE_PATTERN); | return DateUtils.date2String(receive.getMinDate(),DateUtils.DATE_PATTERN); | ||||
| }else if (name.equals("returnPay")) { | }else if (name.equals("returnPay")) { | ||||
| return receive.getReturnPay(); | return receive.getReturnPay(); | ||||
| }else if (name.equals("currentTime")) { | |||||
| return DateUtils.date2String(receive.getCurrentTime(),DateUtils.DATE_PATTERN); | |||||
| }else if (name.equals("owe")) { | }else if (name.equals("owe")) { | ||||
| return receive.getOwe(); | return receive.getOwe(); | ||||
| }else if (name.equals("paid")) { | }else if (name.equals("paid")) { | ||||
| return receive.getPaid(); | return receive.getPaid(); | ||||
| }else if (name.equals("needPay")) { | }else if (name.equals("needPay")) { | ||||
| return receive.getNeedPay(); | return receive.getNeedPay(); | ||||
| }else if (name.equals("needPayChinese")) { | |||||
| return receive.getNeedPayChinese(); | |||||
| }else if (name.equals("shopNumber")) { | }else if (name.equals("shopNumber")) { | ||||
| return receive.getShopNumber(); | return receive.getShopNumber(); | ||||
| }else if (name.equals("merchantName")) { | }else if (name.equals("merchantName")) { | ||||
| @@ -336,6 +336,7 @@ public class WxFinancePrintServiceImpl implements WxFinancePrintService { | |||||
| bq.setNeedPay(receiveTotal.toPlainString()); | bq.setNeedPay(receiveTotal.toPlainString()); | ||||
| bq.setPaid(payTotal.toPlainString()); | bq.setPaid(payTotal.toPlainString()); | ||||
| bq.setOwe(oweTotal.toPlainString()); | bq.setOwe(oweTotal.toPlainString()); | ||||
| bq.setCurrentTime(new Date()); | |||||
| PrintVo vo = handleComponentData(bq.getMerchantId(),templateId,o,items, printMerchantSettleDataHandler,bq,printMerchantSettleItemDataHandler, sumlist,merchantMap,feesMap,shopNumber); | PrintVo vo = handleComponentData(bq.getMerchantId(),templateId,o,items, printMerchantSettleDataHandler,bq,printMerchantSettleItemDataHandler, sumlist,merchantMap,feesMap,shopNumber); | ||||
| if (null != vo) { | if (null != vo) { | ||||
| voList.add(vo); | voList.add(vo); | ||||