| @@ -1,5 +1,6 @@ | |||||
| package com.iformall.controller.rent; | package com.iformall.controller.rent; | ||||
| import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.annotation.SystemControllerLog; | import com.iformall.annotation.SystemControllerLog; | ||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| @@ -51,6 +52,20 @@ public class WxBillRentController extends BaseController { | |||||
| final PageInfo<WxBillRent> page = wxBillRentService.listAsPage(wxBillRent, pageNum, pageSize); | final PageInfo<WxBillRent> page = wxBillRentService.listAsPage(wxBillRent, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @GetMapping("monthBillSum") | |||||
| public ResultData monthBillSum(@ModelAttribute WxBillRent wxBillRent) { | |||||
| if (StringUtils.isBlank(wxBillRent.getMonth())) { | |||||
| new ResultData(Result.ERROR, "请选择月份"); | |||||
| } | |||||
| wxBillRent.updateTenantInfo(getTenantInfo()); | |||||
| WxUserDataRule dataRule = this.getCurrentDataFloors(); | |||||
| if (null != dataRule) { | |||||
| wxBillRent.setFloorForRule(dataRule.getFloorIds()); | |||||
| wxBillRent.setBusinessForRule(dataRule.getBussinessIds()); | |||||
| } | |||||
| return new ResultData(wxBillRentService.getBillMonthSum(wxBillRent)); | |||||
| } | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| @SystemControllerLog(description = "租赁押金账单-新增") | @SystemControllerLog(description = "租赁押金账单-新增") | ||||
| @@ -34,15 +34,18 @@ public class WxBillRent extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="租金合同ID",name="rentContractId") | @io.swagger.annotations.ApiModelProperty(value="租金合同ID",name="rentContractId") | ||||
| private Long rentContractId; | private Long rentContractId; | ||||
| @io.swagger.annotations.ApiModelProperty(value="应收金额",name="receivePay") | |||||
| @io.swagger.annotations.ApiModelProperty(value="应收金额(最初应收)",name="needPay") | |||||
| private String needPay; | |||||
| @io.swagger.annotations.ApiModelProperty(value="实际应收金额(做了减免之后和need可能不一样)",name="receivePay") | |||||
| private String receivePay; | private String receivePay; | ||||
| // public String getReceivePayStr() { | // public String getReceivePayStr() { | ||||
| // return new BigDecimal(receivePay == null ? 0 : receivePay).divide(new BigDecimal(100)).toPlainString(); | // return new BigDecimal(receivePay == null ? 0 : receivePay).divide(new BigDecimal(100)).toPlainString(); | ||||
| // } | // } | ||||
| @TableField(exist = false) | |||||
| private String receivePayStr; | |||||
| // @TableField(exist = false) | |||||
| // private String receivePayStr; | |||||
| // public String getPayStr() { | // public String getPayStr() { | ||||
| // return new BigDecimal(pay == null ? 0 : pay).divide(new BigDecimal(100)).toPlainString(); | // return new BigDecimal(pay == null ? 0 : pay).divide(new BigDecimal(100)).toPlainString(); | ||||
| @@ -56,13 +59,25 @@ public class WxBillRent extends TenantEntity { | |||||
| private String pay; | private String pay; | ||||
| @Excel(name = "缴款截止日期", format = "yyyy-MM-dd", width = 20, orderNum = "13") | @Excel(name = "缴款截止日期", format = "yyyy-MM-dd", width = 20, orderNum = "13") | ||||
| @io.swagger.annotations.ApiModelProperty(value="收款日期",name="receiveDate") | |||||
| @io.swagger.annotations.ApiModelProperty(value="收款截止日期,过了有手续费",name="receiveDate") | |||||
| private Date receiveDate; | private Date receiveDate; | ||||
| @Excel(name = "周期开始时间", format = "yyyy-MM-dd", width = 20, orderNum = "4") | |||||
| @io.swagger.annotations.ApiModelProperty(value="开始时间",name="starttime") | |||||
| private Date starttime; | |||||
| @Excel(name = "周期结束时间", format = "yyyy-MM-dd", width = 20, orderNum = "5") | |||||
| @io.swagger.annotations.ApiModelProperty(value="结束时间",name="endtime") | |||||
| private Date endtime; | |||||
| @TableField(exist = false) | |||||
| private Date endtimeBegin; | |||||
| @TableField(exist = false) | |||||
| private Date endtimeEnd; | |||||
| @Excel(name = "收款日期", format = "yyyy-MM-dd", width = 20, orderNum = "12") | @Excel(name = "收款日期", format = "yyyy-MM-dd", width = 20, orderNum = "12") | ||||
| @io.swagger.annotations.ApiModelProperty(value="到账日期",name="payDate") | @io.swagger.annotations.ApiModelProperty(value="到账日期",name="payDate") | ||||
| private Date payDate; | private Date payDate; | ||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createtime") | @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createtime") | ||||
| private Date createtime; | private Date createtime; | ||||
| @@ -130,9 +145,6 @@ public class WxBillRent extends TenantEntity { | |||||
| return infoStr; | return infoStr; | ||||
| } | } | ||||
| @io.swagger.annotations.ApiModelProperty(value="应收金额",name="needPay") | |||||
| private String needPay; | |||||
| @io.swagger.annotations.ApiModelProperty(value="商业管理费应收金额",name="bussinessManageFeeNeedPay") | @io.swagger.annotations.ApiModelProperty(value="商业管理费应收金额",name="bussinessManageFeeNeedPay") | ||||
| private String bussinessManageFeeNeedPay; | private String bussinessManageFeeNeedPay; | ||||
| @@ -151,18 +163,6 @@ public class WxBillRent extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updatetime") | @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updatetime") | ||||
| private Date updatetime; | private Date updatetime; | ||||
| @Excel(name = "周期开始时间", format = "yyyy-MM-dd", width = 20, orderNum = "4") | |||||
| @io.swagger.annotations.ApiModelProperty(value="开始时间",name="starttime") | |||||
| private Date starttime; | |||||
| @Excel(name = "周期结束时间", format = "yyyy-MM-dd", width = 20, orderNum = "5") | |||||
| @io.swagger.annotations.ApiModelProperty(value="结束时间",name="endtime") | |||||
| private Date endtime; | |||||
| @TableField(exist = false) | |||||
| private Date endtimeBegin; | |||||
| @TableField(exist = false) | |||||
| private Date endtimeEnd; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "租赁商铺类型", name = "rentShopType") | @io.swagger.annotations.ApiModelProperty(value = "租赁商铺类型", name = "rentShopType") | ||||
| private Integer rentShopType; | private Integer rentShopType; | ||||
| @@ -283,5 +283,8 @@ public class WxBillRent extends TenantEntity { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private List<Long> merchantIdList; | private List<Long> merchantIdList; | ||||
| @TableField(exist = false) | |||||
| private String month; | |||||
| } | } | ||||
| @@ -0,0 +1,17 @@ | |||||
| package com.iformall.domain.vo; | |||||
| import lombok.Data; | |||||
| import java.io.Serializable; | |||||
| @Data | |||||
| public class WxBillSum implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | |||||
| //应收总金额 | |||||
| private String needPay; | |||||
| //已收总金额 | |||||
| private String paid; | |||||
| //欠款 | |||||
| private String owe; | |||||
| } | |||||
| @@ -4,6 +4,8 @@ import com.iformall.common.CommonMapper; | |||||
| import com.iformall.domain.po.WxBillRent; | import com.iformall.domain.po.WxBillRent; | ||||
| import com.iformall.domain.po.WxPayAccountBill; | import com.iformall.domain.po.WxPayAccountBill; | ||||
| import com.iformall.domain.po.WxRentContract; | import com.iformall.domain.po.WxRentContract; | ||||
| import com.iformall.domain.vo.WxBillSum; | |||||
| import org.apache.ibatis.annotations.Param; | import org.apache.ibatis.annotations.Param; | ||||
| import java.util.List; | import java.util.List; | ||||
| @@ -58,5 +60,7 @@ public interface WxBillRentMapper extends CommonMapper<WxBillRent, Long> { | |||||
| void updateServiceCharge(WxPayAccountBill record); | void updateServiceCharge(WxPayAccountBill record); | ||||
| void updateOwe(); | void updateOwe(); | ||||
| WxBillSum getBillMonthSum(WxBillRent wxBillRent); | |||||
| } | } | ||||
| @@ -19,6 +19,7 @@ import java.util.Map; | |||||
| /** | /** | ||||
| * @author gongbiao | * @author gongbiao | ||||
| */ | */ | ||||
| @Deprecated | |||||
| public interface WxBillAllService { | public interface WxBillAllService { | ||||
| List<WxBillAllVo> allDepositList(WxBillAll wxBillAll); | List<WxBillAllVo> allDepositList(WxBillAll wxBillAll); | ||||
| @@ -5,6 +5,7 @@ import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.MallUserInfo; | import com.iformall.domain.po.MallUserInfo; | ||||
| import com.iformall.domain.po.WxBillRent; | import com.iformall.domain.po.WxBillRent; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.vo.WxBillSum; | |||||
| import javax.servlet.http.HttpServletRequest; | import javax.servlet.http.HttpServletRequest; | ||||
| import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
| @@ -69,4 +70,8 @@ public interface WxBillRentService { | |||||
| ResultData updateLatePayStatus(WxBillRent wxBillRent); | ResultData updateLatePayStatus(WxBillRent wxBillRent); | ||||
| void exportBill(HttpServletRequest request, HttpServletResponse response, WxBillRent wxBillRent); | void exportBill(HttpServletRequest request, HttpServletResponse response, WxBillRent wxBillRent); | ||||
| WxBillSum getBillMonthSum(WxBillRent wxBillRent); | |||||
| } | } | ||||
| @@ -45,6 +45,7 @@ import java.util.stream.Collectors; | |||||
| /** | /** | ||||
| * @author gongbiao | * @author gongbiao | ||||
| */ | */ | ||||
| @Deprecated | |||||
| @Service | @Service | ||||
| public class WxBillAllServiceImpl implements WxBillAllService { | public class WxBillAllServiceImpl implements WxBillAllService { | ||||
| private Logger logger = LoggerFactory.getLogger(this.getClass()); | private Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @@ -10,6 +10,7 @@ import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.vo.RatioVo; | import com.iformall.domain.vo.RatioVo; | ||||
| import com.iformall.domain.vo.WxBillSum; | |||||
| import com.iformall.enums.*; | import com.iformall.enums.*; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.*; | import com.iformall.mapper.*; | ||||
| @@ -463,7 +464,7 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| excelService.exportExcel(datalist, null, billName, WxBillRent.class, billName + ".xlsx", response, false); | excelService.exportExcel(datalist, null, billName, WxBillRent.class, billName + ".xlsx", response, false); | ||||
| } | } | ||||
| private PageInfo<WxBillRent> getBillRentPropertyList(Integer pageIndex, Integer pageSize,WxBillRent wxBillRent,WxPayAccountBill wxPayAccountBill) { | |||||
| private void updateQueryParam(WxBillRent wxBillRent) { | |||||
| if(null != wxBillRent.getDepositStatus()) { | if(null != wxBillRent.getDepositStatus()) { | ||||
| WxBillDeposit bdq1 = new WxBillDeposit(); | WxBillDeposit bdq1 = new WxBillDeposit(); | ||||
| bdq1.updateTenantInfo(wxBillRent); | bdq1.updateTenantInfo(wxBillRent); | ||||
| @@ -504,7 +505,10 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| wxBillRent.setId(-1L); | wxBillRent.setId(-1L); | ||||
| } | } | ||||
| } | } | ||||
| } | |||||
| private PageInfo<WxBillRent> getBillRentPropertyList(Integer pageIndex, Integer pageSize,WxBillRent wxBillRent,WxPayAccountBill wxPayAccountBill) { | |||||
| updateQueryParam(wxBillRent); | |||||
| PageInfo<WxBillRent> billRentList = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxBillRentMapper.queryBillRentList(wxBillRent)); | PageInfo<WxBillRent> billRentList = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxBillRentMapper.queryBillRentList(wxBillRent)); | ||||
| if (null == billRentList) { | if (null == billRentList) { | ||||
| return null; | return null; | ||||
| @@ -592,4 +596,10 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| wxBillRentMapper.updateById(rent); | wxBillRentMapper.updateById(rent); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @Override | |||||
| public WxBillSum getBillMonthSum(WxBillRent wxBillRent) { | |||||
| updateQueryParam(wxBillRent); | |||||
| return wxBillRentMapper.getBillMonthSum(wxBillRent); | |||||
| } | |||||
| } | } | ||||
| @@ -132,7 +132,10 @@ | |||||
| <if test=" null != rentContractId ">and br.`rent_contract_id` = #{rentContractId}</if> | <if test=" null != rentContractId ">and br.`rent_contract_id` = #{rentContractId}</if> | ||||
| <if test=" null != payWay ">and br.`pay_way` = #{payWay}</if> | <if test=" null != payWay ">and br.`pay_way` = #{payWay}</if> | ||||
| <if test=" null != latePayStatus ">and br.`late_pay_status` = #{latePayStatus}</if> | <if test=" null != latePayStatus ">and br.`late_pay_status` = #{latePayStatus}</if> | ||||
| <if test=" null != starttime and null!=endtime ">and br.`receive_date` between #{starttime} and #{endtime} | |||||
| <if test=" null != starttime">and br.`starttime` <= #{starttime}</if> | |||||
| <if test=" null != endtime">and br.`endtime` >= #{endtime}</if> | |||||
| <if test=" null != month and '' != month"> | |||||
| and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month} | |||||
| </if> | </if> | ||||
| <if test=" null != rentContractIdList "> | <if test=" null != rentContractIdList "> | ||||
| and br.`rent_contract_id` in | and br.`rent_contract_id` in | ||||
| @@ -166,6 +169,19 @@ | |||||
| select distinct rent_contract_id from wx_bill_rent br | select distinct rent_contract_id from wx_bill_rent br | ||||
| <include refid="queryBillRentListCondition"/> | <include refid="queryBillRentListCondition"/> | ||||
| </select> | </select> | ||||
| <resultMap id="SumBaseResultMap" type="com.iformall.domain.vo.WxBillSum"> | |||||
| <result column="receive_pay" jdbcType="VARCHAR" property="needPay"/> | |||||
| <result column="paid" jdbcType="VARCHAR" property="paid" /> | |||||
| <result column="owe" jdbcType="VARCHAR" property="owe"/> | |||||
| </resultMap> | |||||
| <select id="getBillMonthSum" parameterType="com.iformall.domain.po.WxBillRent" resultMap="SumBaseResultMap"> | |||||
| select sum(br.receive_pay) receive_pay , sum(br.pay) paid, sum(br.owe) owe from wx_bill_rent br | |||||
| <include refid="queryBillRentListCondition"/> | |||||
| </select> | |||||
| <select id="queryPayInfo" resultType="hashmap" parameterType="hashmap"> | <select id="queryPayInfo" resultType="hashmap" parameterType="hashmap"> | ||||
| select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_rent | select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_rent | ||||