| @@ -12,6 +12,7 @@ import com.iformall.domain.po.WxFinanceReceive; | |||||
| import com.iformall.domain.po.base.BaseEntity; | import com.iformall.domain.po.base.BaseEntity; | ||||
| import com.iformall.domain.po.base.WxBillBaseEntity; | import com.iformall.domain.po.base.WxBillBaseEntity; | ||||
| import com.iformall.domain.vo.FinanceBillSetoffSum; | import com.iformall.domain.vo.FinanceBillSetoffSum; | ||||
| import com.iformall.domain.vo.WxFinanceReceiveVo; | |||||
| import com.iformall.enums.EnumBillAllType; | import com.iformall.enums.EnumBillAllType; | ||||
| import com.iformall.enums.EnumFinanceReceiveStatus; | import com.iformall.enums.EnumFinanceReceiveStatus; | ||||
| import com.iformall.enums.EnumFinanceReceiveType; | import com.iformall.enums.EnumFinanceReceiveType; | ||||
| @@ -258,7 +259,7 @@ public class WxFinanceController extends BaseController { | |||||
| public ResultData receiveList(@ModelAttribute WxFinanceReceive record, Integer pageNum, Integer pageSize) { | public ResultData receiveList(@ModelAttribute WxFinanceReceive record, Integer pageNum, Integer pageSize) { | ||||
| record.updateTenantInfo(getTenantInfo()); | record.updateTenantInfo(getTenantInfo()); | ||||
| record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | ||||
| PageInfo<WxFinanceReceive> page = wxFinanceService.receiveListAsPage(record, pageNum, pageSize); | |||||
| PageInfo<WxFinanceReceiveVo> page = wxFinanceService.receiveListAsPage(record, pageNum, pageSize); | |||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -139,8 +139,5 @@ public class WxFinanceReceive extends TenantEntity { | |||||
| private Long floor; | private Long floor; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private String shopIds; | private String shopIds; | ||||
| @TableField(exist = false) | |||||
| private List<WxFinanceReceiveBill> childBills; | |||||
| } | } | ||||
| @@ -0,0 +1,177 @@ | |||||
| package com.iformall.domain.vo; | |||||
| import cn.afterturn.easypoi.excel.annotation.Excel; | |||||
| import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils; | |||||
| import com.baomidou.mybatisplus.annotation.TableField; | |||||
| import com.iformall.domain.po.WxBillPayWay; | |||||
| import com.iformall.domain.po.WxFinanceReceive; | |||||
| import com.iformall.domain.po.WxFinanceReceiveBill; | |||||
| import com.iformall.domain.po.base.WxBillBaseEntity; | |||||
| import com.iformall.enums.EnumBillAllType; | |||||
| import com.iformall.enums.EnumFinanceReceiveStatus; | |||||
| import com.iformall.enums.EnumFinanceReceiveType; | |||||
| import lombok.Data; | |||||
| import java.io.Serializable; | |||||
| import java.math.BigDecimal; | |||||
| import java.util.Date; | |||||
| import java.util.List; | |||||
| @Data | |||||
| public class WxFinanceReceiveVo implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | |||||
| @io.swagger.annotations.ApiModelProperty(value="id",name="id") | |||||
| private Long id; | |||||
| @io.swagger.annotations.ApiModelProperty(value="createTime",name="createTime") | |||||
| private Date createTime; | |||||
| @io.swagger.annotations.ApiModelProperty(value="updateTime",name="updateTime") | |||||
| private Date updateTime; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "实收金额", name = "receiveMoney") | |||||
| private String receiveMoney; | |||||
| //跟useMoney的区别是,这个字段是记录此次收款冲抵了多少费用。useMoney是使用了自身多少的实收金额,预充用的到 | |||||
| @io.swagger.annotations.ApiModelProperty(value = "冲抵金额", name = "setOffMoney") | |||||
| private String setOffMoney; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "已使用金额,冲抵里面使用", name = "useMoney") | |||||
| private String useMoney; | |||||
| @TableField(exist = false) | |||||
| private String totalMoney; | |||||
| public String getTotalMoney() { | |||||
| if (StringUtils.isBlank(setOffMoney)) { | |||||
| setOffMoney = "0"; | |||||
| } | |||||
| if (StringUtils.isBlank(receiveMoney)) { | |||||
| receiveMoney = "0"; | |||||
| } | |||||
| return new BigDecimal(receiveMoney).add(new BigDecimal(setOffMoney)).toPlainString(); | |||||
| } | |||||
| @io.swagger.annotations.ApiModelProperty(value = "状态EnumFinanceReceiveStatus", name = "status") | |||||
| private Integer status; | |||||
| @TableField(exist = false) | |||||
| private String statusName; | |||||
| public String getStatusName() { | |||||
| if (null != status) { | |||||
| return EnumFinanceReceiveStatus.getEnum(status).getMessage(); | |||||
| } | |||||
| return null; | |||||
| } | |||||
| @io.swagger.annotations.ApiModelProperty(value = "类型EnumFinanceReceiveType", name = "type") | |||||
| private Integer type; | |||||
| @TableField(exist = false) | |||||
| private String typeName; | |||||
| public String getTypeName() { | |||||
| if (null != type) { | |||||
| return EnumFinanceReceiveType.getEnum(type).getMessage(); | |||||
| } | |||||
| return null; | |||||
| } | |||||
| @io.swagger.annotations.ApiModelProperty(value="createBy",name="createBy") | |||||
| private Long createBy; | |||||
| @io.swagger.annotations.ApiModelProperty(value="createByName",name="createByName") | |||||
| private String createByName; | |||||
| @io.swagger.annotations.ApiModelProperty(value="updateBy",name="updateBy") | |||||
| private Long updateBy; | |||||
| @io.swagger.annotations.ApiModelProperty(value="updateByName",name="updateByName") | |||||
| private String updateByName; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "moneyDetail", name = "moneyDetail") | |||||
| private String moneyDetail; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "merchantId", name = "merchantId") | |||||
| private Long merchantId; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "remark", name = "remark") | |||||
| private String remark; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "是否已打印", name = "isPrint") | |||||
| private Integer isPrint; | |||||
| @TableField(exist = false) | |||||
| private String shopNumber; | |||||
| @TableField(exist = false) | |||||
| private String merchantName; | |||||
| @io.swagger.annotations.ApiModelProperty(value="receiveBillId",name="rid") | |||||
| private Long rid; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "收款编号", name = "receiveId") | |||||
| private Long receiveId; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "账单编号", name = "billId") | |||||
| private Long billId; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "账单类型EnumBillAllType", name = "billType") | |||||
| private Integer billType; | |||||
| @TableField(exist = false) | |||||
| private String billTypeName; | |||||
| public String getBillTypeName() { | |||||
| return EnumBillAllType.getEnum(billType).getMessage(); | |||||
| } | |||||
| @io.swagger.annotations.ApiModelProperty(value="科目编号",name="feesId") | |||||
| private Long feesId; | |||||
| @TableField(exist = false) | |||||
| private String feesName; | |||||
| @io.swagger.annotations.ApiModelProperty(value="支付方式",name="payWay") | |||||
| private Long payWay; | |||||
| @TableField(exist = false) | |||||
| private String payWayName; | |||||
| @io.swagger.annotations.ApiModelProperty(value="账单实收金额",name="billReceive") | |||||
| private String billReceive; | |||||
| @io.swagger.annotations.ApiModelProperty(value="账单开始周期",name="starttime") | |||||
| private Date starttime; | |||||
| @io.swagger.annotations.ApiModelProperty(value="账单结束周期",name="endtime") | |||||
| private Date endtime; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "是否已删除", name = "isDel") | |||||
| private Integer isDel; | |||||
| public void initByReceive(WxFinanceReceive receive,WxFinanceReceiveBill receiveBill) { | |||||
| this.id = receive.getId(); | |||||
| this.createTime = receive.getCreateTime(); | |||||
| this.updateTime = receive.getUpdateTime(); | |||||
| this.receiveMoney = receive.getReceiveMoney(); | |||||
| this.setOffMoney = receive.getSetOffMoney(); | |||||
| this.useMoney = receive.getUseMoney(); | |||||
| this.status = receive.getStatus(); | |||||
| this.type = receive.getType(); | |||||
| this.createBy = receive.getCreateBy(); | |||||
| this.createByName = receive.getCreateByName(); | |||||
| this.updateBy = receive.getUpdateBy(); | |||||
| this.updateByName = receive.getUpdateByName(); | |||||
| this.moneyDetail = receive.getMoneyDetail(); | |||||
| this.merchantId = receive.getMerchantId(); | |||||
| this.remark = receive.getRemark(); | |||||
| this.isPrint = receive.getIsPrint(); | |||||
| if (null != receiveBill) { | |||||
| this.rid = receiveBill.getId(); | |||||
| this.receiveId = receiveBill.getReceiveId(); | |||||
| this.billId = receiveBill.getBillId(); | |||||
| this.billType = receiveBill.getBillType(); | |||||
| this.feesId = receiveBill.getFeesId(); | |||||
| this.payWay = receiveBill.getPayWay(); | |||||
| this.billReceive = receiveBill.getReceive(); | |||||
| this.starttime = receiveBill.getStarttime(); | |||||
| this.endtime = receiveBill.getEndtime(); | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -12,6 +12,7 @@ import com.iformall.domain.po.WxFinanceReceiveSetoff; | |||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.po.base.WxBillBaseEntity; | import com.iformall.domain.po.base.WxBillBaseEntity; | ||||
| import com.iformall.domain.vo.FinanceBillSetoffSum; | import com.iformall.domain.vo.FinanceBillSetoffSum; | ||||
| import com.iformall.domain.vo.WxFinanceReceiveVo; | |||||
| /** | /** | ||||
| */ | */ | ||||
| public interface WxFinanceService { | public interface WxFinanceService { | ||||
| @@ -25,7 +26,7 @@ public interface WxFinanceService { | |||||
| void payWayInit(TenantEntity tenantInfo); | void payWayInit(TenantEntity tenantInfo); | ||||
| //收款 | //收款 | ||||
| PageInfo<WxFinanceReceive> receiveListAsPage(WxFinanceReceive record, Integer pageIndex, Integer pageSize); | |||||
| PageInfo<WxFinanceReceiveVo> receiveListAsPage(WxFinanceReceive record, Integer pageIndex, Integer pageSize); | |||||
| List<WxBillBaseEntity> createReceive(WxFinanceReceive record,MallUserInfo user); | List<WxBillBaseEntity> createReceive(WxFinanceReceive record,MallUserInfo user); | ||||
| 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); | ||||
| @@ -27,6 +27,7 @@ import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.domain.po.base.WxBillBaseEntity; | import com.iformall.domain.po.base.WxBillBaseEntity; | ||||
| import com.iformall.domain.vo.FinanceBillSetoffSum; | import com.iformall.domain.vo.FinanceBillSetoffSum; | ||||
| import com.iformall.domain.vo.FinanceSetOffDetailVo; | import com.iformall.domain.vo.FinanceSetOffDetailVo; | ||||
| import com.iformall.domain.vo.WxFinanceReceiveVo; | |||||
| import com.iformall.enums.EnumBillAllType; | import com.iformall.enums.EnumBillAllType; | ||||
| import com.iformall.enums.EnumBillStatus; | import com.iformall.enums.EnumBillStatus; | ||||
| import com.iformall.enums.EnumFinanceReceiveStatus; | import com.iformall.enums.EnumFinanceReceiveStatus; | ||||
| @@ -398,10 +399,15 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public PageInfo<WxFinanceReceive> receiveListAsPage(WxFinanceReceive record, Integer pageIndex, Integer pageSize) { | |||||
| public PageInfo<WxFinanceReceiveVo> receiveListAsPage(WxFinanceReceive record, Integer pageIndex, Integer pageSize) { | |||||
| initQueryParam(record); | initQueryParam(record); | ||||
| PageInfo<WxFinanceReceive> page = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxFinanceReceiveMapper.findList(record)); | PageInfo<WxFinanceReceive> page = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxFinanceReceiveMapper.findList(record)); | ||||
| if (null != page && null != page.getList()) { | |||||
| PageInfo<WxFinanceReceiveVo> pageVo = new PageInfo<WxFinanceReceiveVo>(); | |||||
| pageVo.setPageNum(page.getPageNum()); | |||||
| pageVo.setPageSize(page.getPageSize()); | |||||
| pageVo.setPages(page.getPages()); | |||||
| pageVo.setTotal(page.getTotal()); | |||||
| if (null != page && null != page.getList()) { | |||||
| WxMerchant mq = new WxMerchant(); | WxMerchant mq = new WxMerchant(); | ||||
| mq.updateTenantInfo(record); | mq.updateTenantInfo(record); | ||||
| Map<Long, WxMerchant> merchantMap = wxMerchantService.findMerchantMap(mq); | Map<Long, WxMerchant> merchantMap = wxMerchantService.findMerchantMap(mq); | ||||
| @@ -415,7 +421,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||||
| WxEnergyFees fq = new WxEnergyFees(); | WxEnergyFees fq = new WxEnergyFees(); | ||||
| fq.updateTenantInfo(record); | fq.updateTenantInfo(record); | ||||
| Map<Long, WxEnergyFees> fmap = wxEnergyService.getFeesMap(fq); | Map<Long, WxEnergyFees> fmap = wxEnergyService.getFeesMap(fq); | ||||
| List<WxFinanceReceiveVo> volist = new ArrayList<WxFinanceReceiveVo>(); | |||||
| for (int i = 0 ; i < page.getList().size() ; i++) { | for (int i = 0 ; i < page.getList().size() ; i++) { | ||||
| WxFinanceReceive fr = page.getList().get(i); | WxFinanceReceive fr = page.getList().get(i); | ||||
| if (null != merchantMap && null != fr.getMerchantId()) { | if (null != merchantMap && null != fr.getMerchantId()) { | ||||
| @@ -424,6 +430,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||||
| fr.setMerchantName(merchant.getName()); | fr.setMerchantName(merchant.getName()); | ||||
| } | } | ||||
| } | } | ||||
| //查询关联的账单记录 | //查询关联的账单记录 | ||||
| WxFinanceReceiveBill rb = new WxFinanceReceiveBill(); | WxFinanceReceiveBill rb = new WxFinanceReceiveBill(); | ||||
| rb.updateTenantInfo(record); | rb.updateTenantInfo(record); | ||||
| @@ -432,37 +439,42 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||||
| if (null != bills && bills.size() > 0 ) { | if (null != bills && bills.size() > 0 ) { | ||||
| for (int j = 0 ; j < bills.size(); j ++) { | for (int j = 0 ; j < bills.size(); j ++) { | ||||
| WxFinanceReceiveBill frb = bills.get(j); | WxFinanceReceiveBill frb = bills.get(j); | ||||
| WxFinanceReceiveVo vo = new WxFinanceReceiveVo(); | |||||
| vo.initByReceive(fr, frb); | |||||
| if (null != paywayMap && null != frb.getPayWay()) { | if (null != paywayMap && null != frb.getPayWay()) { | ||||
| WxBillPayWay p = paywayMap.get(frb.getPayWay()); | |||||
| WxBillPayWay p = paywayMap.get(vo.getPayWay()); | |||||
| if (null != p) { | if (null != p) { | ||||
| frb.setPayWayName(p.getName()); | |||||
| vo.setPayWayName(p.getName()); | |||||
| } | } | ||||
| } | } | ||||
| if (null != shopNumberMap && null != frb.getMerchantId()) { | if (null != shopNumberMap && null != frb.getMerchantId()) { | ||||
| String shopNumber = shopNumberMap.get(frb.getMerchantId()); | |||||
| frb.setShopNumber(shopNumber); | |||||
| String shopNumber = shopNumberMap.get(vo.getMerchantId()); | |||||
| vo.setShopNumber(shopNumber); | |||||
| if (null != merchantMap) { | if (null != merchantMap) { | ||||
| WxMerchant merchant = merchantMap.get(frb.getMerchantId()); | |||||
| WxMerchant merchant = merchantMap.get(vo.getMerchantId()); | |||||
| if (null != merchant) { | if (null != merchant) { | ||||
| frb.setMerchantName(merchant.getName()); | |||||
| vo.setMerchantName(merchant.getName()); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| if (null != fmap && null != frb.getFeesId()) { | |||||
| WxEnergyFees ef = fmap.get(frb.getFeesId()); | |||||
| if (null != fmap && null != vo.getFeesId()) { | |||||
| WxEnergyFees ef = fmap.get(vo.getFeesId()); | |||||
| if (null != ef) { | if (null != ef) { | ||||
| frb.setFeesName(ef.getName()); | |||||
| vo.setFeesName(ef.getName()); | |||||
| } | } | ||||
| } | } | ||||
| volist.add(vo); | |||||
| } | } | ||||
| }else { | |||||
| WxFinanceReceiveVo vo = new WxFinanceReceiveVo(); | |||||
| vo.initByReceive(fr, null); | |||||
| volist.add(vo); | |||||
| } | } | ||||
| fr.setChildBills(bills); | |||||
| } | } | ||||
| pageVo.setList(volist); | |||||
| } | } | ||||
| return page; | |||||
| return pageVo; | |||||
| } | } | ||||
| private void sortBills(List<WxBillBaseEntity> billList) { | private void sortBills(List<WxBillBaseEntity> billList) { | ||||