| @@ -37,33 +37,18 @@ public class WxBillRent implements Serializable { | |||
| public void setIds(List<Long> ids) { | |||
| this.ids = ids; | |||
| } | |||
| @Transient | |||
| protected String shopNumber; | |||
| /*商铺ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商铺ID",name="shopId") | |||
| private Long shopId; | |||
| /*使用面积**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="使用面积",name="userArea") | |||
| private BigDecimal userArea; | |||
| /*单价**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="单价",name="price") | |||
| private BigDecimal price; | |||
| /*应缴金额**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="应收金额",name="needPay") | |||
| private BigDecimal needPay; | |||
| /*应收金额**/ | |||
| /*租金合同ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="租金合同ID",name="rentContractId") | |||
| private Long rentContractId; | |||
| /*实际应收金额**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="实际应收金额",name="receivePay") | |||
| private BigDecimal receivePay; | |||
| private Integer receivePay; | |||
| /*实收金额**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="实缴金额",name="pay") | |||
| private BigDecimal pay; | |||
| /*缴费周期**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="缴费周期",name="receivePeriod") | |||
| private Integer receivePeriod; | |||
| @io.swagger.annotations.ApiModelProperty(value="实收金额",name="pay") | |||
| private Integer pay; | |||
| /*收款日期**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="收款日期",name="receiveDate") | |||
| private Date receiveDate; | |||
| @@ -76,76 +61,53 @@ public class WxBillRent implements Serializable { | |||
| /*逾期天数**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="逾期天数",name="expiredDay") | |||
| private Integer expiredDay; | |||
| /*付款方式:1微信2支付宝3银行4现金**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="付款方式:1微信2支付宝3银行4现金",name="payWay") | |||
| private Integer payWay; | |||
| /*单据编号**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="单据编号",name="receiptNum") | |||
| private String receiptNum; | |||
| /*租户ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||
| /*租户**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="租户",name="tenantId") | |||
| private String tenantId; | |||
| /*欠缴**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="欠缴金额",name="owe") | |||
| @io.swagger.annotations.ApiModelProperty(value="欠缴",name="owe") | |||
| private BigDecimal owe; | |||
| /*账单状态1未到期2待缴3逾期未缴4部分逾期5已结清**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="账单状态1未到期2待缴3欠缴4已结清",name="status") | |||
| private Integer status; | |||
| /*是否删除 是1否0 未到期不显示**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="是否删除 是1否0 未到期不显示",name="isDel") | |||
| private Integer isDel; | |||
| /*应收金额**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="应收金额",name="needPay") | |||
| private Integer needPay; | |||
| /*商户ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商户ID",name="merchantId") | |||
| private Long merchantId; | |||
| /*账号ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="账号ID",name="userId") | |||
| private Long userId; | |||
| /*商铺ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商铺ID",name="shopId") | |||
| private Long shopId; | |||
| /***/ | |||
| @io.swagger.annotations.ApiModelProperty(value="payStatus",name="payStatus") | |||
| private Integer payStatus; | |||
| public String getShopNumber() { | |||
| return shopNumber; | |||
| } | |||
| public void setShopNumber(String shopNumber) { | |||
| this.shopNumber = shopNumber; | |||
| } | |||
| /*更新时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updatetime") | |||
| private Date updatetime; | |||
| public Long getShopId() { | |||
| return shopId; | |||
| } | |||
| public void setShopId(Long _shopId) { | |||
| shopId = _shopId; | |||
| } | |||
| public BigDecimal getUserArea() { | |||
| return userArea; | |||
| } | |||
| public void setUserArea(BigDecimal _userArea) { | |||
| userArea = _userArea; | |||
| } | |||
| public BigDecimal getPrice() { | |||
| return price; | |||
| public Long getRentContractId() { | |||
| return rentContractId; | |||
| } | |||
| public void setPrice(BigDecimal _price) { | |||
| price = _price; | |||
| public void setRentContractId(Long _rentContractId) { | |||
| rentContractId = _rentContractId; | |||
| } | |||
| public BigDecimal getNeedPay() { | |||
| return needPay; | |||
| } | |||
| public void setNeedPay(BigDecimal _needPay) { | |||
| needPay = _needPay; | |||
| } | |||
| public BigDecimal getReceivePay() { | |||
| public Integer getReceivePay() { | |||
| return receivePay; | |||
| } | |||
| public void setReceivePay(BigDecimal _receivePay) { | |||
| public void setReceivePay(Integer _receivePay) { | |||
| receivePay = _receivePay; | |||
| } | |||
| public BigDecimal getPay() { | |||
| public Integer getPay() { | |||
| return pay; | |||
| } | |||
| public void setPay(BigDecimal _pay) { | |||
| public void setPay(Integer _pay) { | |||
| pay = _pay; | |||
| } | |||
| public Integer getReceivePeriod() { | |||
| return receivePeriod; | |||
| } | |||
| public void setReceivePeriod(Integer _receivePeriod) { | |||
| receivePeriod = _receivePeriod; | |||
| } | |||
| public Date getReceiveDate() { | |||
| return receiveDate; | |||
| } | |||
| @@ -170,60 +132,81 @@ public class WxBillRent implements Serializable { | |||
| public void setExpiredDay(Integer _expiredDay) { | |||
| expiredDay = _expiredDay; | |||
| } | |||
| public Integer getPayWay() { | |||
| return payWay; | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| public void setPayWay(Integer _payWay) { | |||
| payWay = _payWay; | |||
| public void setTenantId(String _tenantId) { | |||
| tenantId = _tenantId; | |||
| } | |||
| public String getReceiptNum() { | |||
| return receiptNum; | |||
| public BigDecimal getOwe() { | |||
| return owe; | |||
| } | |||
| public void setReceiptNum(String _receiptNum) { | |||
| receiptNum = _receiptNum; | |||
| public void setOwe(BigDecimal _owe) { | |||
| owe = _owe; | |||
| } | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| public Integer getStatus() { | |||
| return status; | |||
| } | |||
| public void setTenantId(String tenantId) { | |||
| this.tenantId = tenantId; | |||
| public void setStatus(Integer _status) { | |||
| status = _status; | |||
| } | |||
| public BigDecimal getOwe() { | |||
| return owe; | |||
| public Integer getIsDel() { | |||
| return isDel; | |||
| } | |||
| public void setOwe(BigDecimal owe) { | |||
| this.owe = owe; | |||
| public void setIsDel(Integer _isDel) { | |||
| isDel = _isDel; | |||
| } | |||
| public Integer getNeedPay() { | |||
| return needPay; | |||
| } | |||
| public void setNeedPay(Integer _needPay) { | |||
| needPay = _needPay; | |||
| } | |||
| public Long getMerchantId() { | |||
| return merchantId; | |||
| } | |||
| public void setMerchantId(Long _merchantId) { | |||
| merchantId = _merchantId; | |||
| } | |||
| public Long getUserId() { | |||
| return userId; | |||
| } | |||
| public void setUserId(Long _userId) { | |||
| userId = _userId; | |||
| } | |||
| public Long getShopId() { | |||
| return shopId; | |||
| } | |||
| public void setShopId(Long _shopId) { | |||
| shopId = _shopId; | |||
| } | |||
| public Integer getPayStatus() { | |||
| return payStatus; | |||
| public Date getUpdatetime() { | |||
| return updatetime; | |||
| } | |||
| public void setPayStatus(Integer payStatus) { | |||
| this.payStatus = payStatus; | |||
| public void setUpdatetime(Date updatetime) { | |||
| this.updatetime = updatetime; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| ,ShopId_ASC("`shop_id` ASC"),ShopId_DESC("`shop_id` DESC") | |||
| ,UserArea_ASC("`userArea` ASC"),UserArea_DESC("`userArea` DESC") | |||
| ,Price_ASC("`price` ASC"),Price_DESC("`price` DESC") | |||
| ,NeedPay_ASC("`needPay` ASC"),NeedPay_DESC("`needPay` DESC") | |||
| ,RentContractId_ASC("`rentContractId` ASC"),RentContractId_DESC("`rentContractId` DESC") | |||
| ,ReceivePay_ASC("`receivePay` ASC"),ReceivePay_DESC("`receivePay` DESC") | |||
| ,Pay_ASC("`pay` ASC"),Pay_DESC("`pay` DESC") | |||
| ,ReceivePeriod_ASC("`receive_period` ASC"),ReceivePeriod_DESC("`receive_period` DESC") | |||
| ,ReceiveDate_ASC("`receiveDate` ASC"),ReceiveDate_DESC("`receiveDate` DESC") | |||
| ,PayDate_ASC("`payDate` ASC"),PayDate_DESC("`payDate` DESC") | |||
| ,Createtime_ASC("`createtime` ASC"),Createtime_DESC("`createtime` DESC") | |||
| ,ExpiredDay_ASC("`expiredDay` ASC"),ExpiredDay_DESC("`expiredDay` DESC") | |||
| ,PayWay_ASC("`payWay` ASC"),PayWay_DESC("`payWay` DESC") | |||
| ,ReceiptNum_ASC("`receiptNum` ASC"),ReceiptNum_DESC("`receiptNum` DESC") | |||
| ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") | |||
| ,Owe_ASC("`owe` ASC"),Owe_DESC("`owe` DESC") | |||
| ,Status_ASC("`status` ASC"),Status_DESC("`status` DESC") | |||
| ,IsDel_ASC("`isDel` ASC"),IsDel_DESC("`isDel` DESC") | |||
| ,NeedPay_ASC("`needPay` ASC"),NeedPay_DESC("`needPay` DESC") | |||
| ,MerchantId_ASC("`merchantId` ASC"),MerchantId_DESC("`merchantId` DESC") | |||
| ,UserId_ASC("`userId` ASC"),UserId_DESC("`userId` DESC") | |||
| ,ShopId_ASC("`shopId` ASC"),ShopId_DESC("`shopId` DESC") | |||
| ; | |||
| private String value; | |||
| Field(String value){ | |||
| @@ -256,7 +239,7 @@ public class WxBillRent implements Serializable { | |||
| sb.append(","); | |||
| sb.append(fields[k].toString()); | |||
| } | |||
| this.sortColumns=sb.toString(); | |||
| } | |||
| public void setSortColumns(String sortColumns) | |||
| @@ -19,7 +19,7 @@ public class WxRentContract implements Serializable { | |||
| protected Long id; | |||
| @Transient | |||
| protected List<String> ids; | |||
| protected List<Long> ids; | |||
| @Transient | |||
| protected String sortColumns; | |||
| @@ -33,10 +33,10 @@ public class WxRentContract implements Serializable { | |||
| return sortColumns; | |||
| } | |||
| public List<String> getIds() { | |||
| public List<Long> getIds() { | |||
| return ids; | |||
| } | |||
| public void setIds(List<String> ids) { | |||
| public void setIds(List<Long> ids) { | |||
| this.ids = ids; | |||
| } | |||
| @@ -1,6 +1,5 @@ | |||
| package com.iformall.service.impl; | |||
| import java.util.*; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.IdWorker; | |||
| @@ -12,6 +11,10 @@ import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| @Service | |||
| public class WxBillRentServiceImpl implements WxBillRentService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @@ -41,11 +44,12 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||
| if (record.getId() == null) { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| record.setId(idWorker.nextId()); | |||
| record.setCreatetime(new Date()); | |||
| record.setPayStatus(record.getOwe().doubleValue()>0?0:1); | |||
| Date date = new Date(); | |||
| record.setCreatetime(date); | |||
| record.setUpdatetime(date); | |||
| wxBillRentMapper.insertSelective(record); | |||
| } else { | |||
| record.setPayStatus(record.getOwe().doubleValue()>0?0:1); | |||
| record.setUpdatetime(new Date()); | |||
| wxBillRentMapper.updateByPrimaryKeySelective(record); | |||
| } | |||
| } | |||
| @@ -3,46 +3,51 @@ | |||
| <mapper namespace="com.iformall.mapper.WxBillRentMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxBillRent"> | |||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||
| <result column="shop_id" jdbcType="BIGINT" property="shopId" /> | |||
| <result column="user_area" jdbcType="DECIMAL" property="userArea" /> | |||
| <result column="price" jdbcType="DECIMAL" property="price" /> | |||
| <result column="need_pay" jdbcType="DECIMAL" property="needPay" /> | |||
| <result column="receive_pay" jdbcType="DECIMAL" property="receivePay" /> | |||
| <result column="pay" jdbcType="DECIMAL" property="pay" /> | |||
| <result column="receive_period" jdbcType="INTEGER" property="receivePeriod" /> | |||
| <result column="rent_contract_id" jdbcType="BIGINT" property="rentContractId" /> | |||
| <result column="receive_pay" jdbcType="INTEGER" property="receivePay" /> | |||
| <result column="pay" jdbcType="INTEGER" property="pay" /> | |||
| <result column="receive_date" jdbcType="TIMESTAMP" property="receiveDate" /> | |||
| <result column="pay_date" jdbcType="TIMESTAMP" property="payDate" /> | |||
| <result column="createtime" jdbcType="TIMESTAMP" property="createtime" /> | |||
| <result column="expired_day" jdbcType="INTEGER" property="expiredDay" /> | |||
| <result column="pay_way" jdbcType="INTEGER" property="payWay" /> | |||
| <result column="receipt_num" jdbcType="VARCHAR" property="receiptNum" /> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | |||
| <result column="owe" jdbcType="DECIMAL" property="owe" /> | |||
| <result column="pay_status" jdbcType="INTEGER" property="payStatus" /> | |||
| <result column="status" jdbcType="INTEGER" property="status" /> | |||
| <result column="is_del" jdbcType="INTEGER" property="isDel" /> | |||
| <result column="need_pay" jdbcType="INTEGER" property="needPay" /> | |||
| <result column="merchant_id" jdbcType="BIGINT" property="merchantId" /> | |||
| <result column="user_id" jdbcType="BIGINT" property="userId" /> | |||
| <result column="shop_id" jdbcType="BIGINT" property="shopId" /> | |||
| <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`shop_id`,`user_area`,`price`,`need_pay`,`receive_pay`,`pay`,`receive_period`,`receive_date`,`pay_date`,`createtime`,`expired_day`,`pay_way`,`receipt_num`,`tenant_id`,`owe`,`pay_status` | |||
| `id`,`rent_contract_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,`expired_day`,`tenant_id`,`owe`,`status`,`is_del`,`need_pay`,`merchant_id`,`user_id`,`shop_id`,`updatetime` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> and `id` = #{id} </if> | |||
| <if test=" null != shopId "> and `shop_id` = #{shopId} </if> | |||
| <if test=" null != userArea "> and `user_area` = #{userArea} </if> | |||
| <if test=" null != price "> and `price` = #{price} </if> | |||
| <if test=" null != needPay "> and `need_pay` = #{needPay} </if> | |||
| <if test=" null != rentContractId "> and `rent_contract_id` = #{rentContractId} </if> | |||
| <if test=" null != receivePay "> and `receive_pay` = #{receivePay} </if> | |||
| <if test=" null != pay "> and `pay` = #{pay} </if> | |||
| <if test=" null != receivePeriod "> and `receive_period` = #{receivePeriod} </if> | |||
| <if test=" null != receiveDate "> and `receive_date` = #{receiveDate} </if> | |||
| <if test=" null != payDate "> and `pay_date` = #{payDate} </if> | |||
| <if test=" null != createtime "> and `createtime` = #{createtime} </if> | |||
| <if test=" null != expiredDay "> and `expired_day` = #{expiredDay} </if> | |||
| <if test=" null != payWay "> and `pay_way` = #{payWay} </if> | |||
| <if test=" null != receiptNum "> and `receipt_num` = #{receiptNum} </if> | |||
| <if test=" null != tenantId "> and `tenant_id` = #{tenantId} </if> | |||
| <if test=" null != tenantId "> and `tenant_id` = #{tenantId} </if> | |||
| <if test=" null != owe "> and `owe` = #{owe} </if> | |||
| <if test=" null != status "> and `status` = #{status} </if> | |||
| <if test=" null != isDel "> and `is_del` = #{isDel} </if> | |||
| <if test=" null != needPay "> and `need_pay` = #{needPay} </if> | |||
| <if test=" null != merchantId "> and `merchant_id` = #{merchantId} </if> | |||
| <if test=" null != userId "> and `user_id` = #{userId} </if> | |||
| <if test=" null != shopId "> and `shop_id` = #{shopId} </if> | |||
| <if test=" null != updatetime "> and `updatetime` = #{updatetime} </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| @@ -57,48 +62,9 @@ | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| <select id="findListMap" parameterType="com.iformall.domain.po.WxBillRent" resultType="hashmap"> | |||
| select br.id,br.shop_id shopId,br.user_area userArea,br.price,br.need_pay needPay,br.receive_pay receivePay, | |||
| br.pay,br.receive_period receivePeriod,br.receive_date receiveDate,br.pay_date payDate,br.createtime, | |||
| br.expired_day expiredDay,br.pay_way payWay,br.receipt_num receiptNum,m.`name` merchantName, | |||
| s.build_area buildArea,s.operation_area operationArea,s.shop_number shopNumber,br.owe,br.pay_status payStatus | |||
| from wx_bill_rent br left join wx_merchant_shop ms on br.shop_id=ms.shop_id and ms.is_del=0 | |||
| inner join wx_merchant m on ms.merchant_id=m.id | |||
| inner join wx_shop s on ms.shop_id=s.id | |||
| where 1 = 1 | |||
| <if test=" null != id "> and br.`id` = #{id} </if> | |||
| <if test=" null != shopId "> and br.`shop_id` = #{shopId} </if> | |||
| <if test=" null != userArea "> and br.`user_area` = #{userArea} </if> | |||
| <if test=" null != price "> and br.`price` = #{price} </if> | |||
| <if test=" null != needPay "> and br.`need_pay` = #{needPay} </if> | |||
| <if test=" null != receivePay "> and br.`receive_pay` = #{receivePay} </if> | |||
| <if test=" null != pay "> and br.`pay` = #{pay} </if> | |||
| <if test=" null != receivePeriod "> and br.`receive_period` = #{receivePeriod} </if> | |||
| <if test=" null != receiveDate "> and br.`receive_date` = #{receiveDate} </if> | |||
| <if test=" null != payDate "> and br.`pay_date` = #{payDate} </if> | |||
| <if test=" null != createtime "> and br.`createtime` = #{createtime} </if> | |||
| <if test=" null != expiredDay "> and br.`expired_day` = #{expiredDay} </if> | |||
| <if test=" null != payWay "> and br.`pay_way` = #{payWay} </if> | |||
| <if test=" null != receiptNum "> and br.`receipt_num` = #{receiptNum} </if> | |||
| <if test=" null != tenantId "> and br.`tenant_id` = #{tenantId} </if> | |||
| <if test=" null != shopNumber and ''!=shopNumber"> and s.`shop_number` = #{shopNumber} </if> | |||
| <if test=" null != payStatus "> and br.`pay_status` = #{payStatus} </if> | |||
| <if test=" null != ids "> | |||
| and br.id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by br.${sortColumns} </if> | |||
| </select> | |||
| <select id="queryPayInfo" resultType="hashmap" parameterType="hashmap"> | |||
| select sum(receive_pay) receivepay,sum(pay) pay,tenant_id from wx_bill_rent | |||
| where tenant_id=#{tenantId} and date_format(receive_date,'%Y-%m')=#{receiveDate} | |||
| group by tenant_id | |||
| </select> | |||
| </mapper> | |||