| @@ -192,7 +192,6 @@ public class WxBillRent extends BaseEntity { | |||||
| private String latePayMoneyBefore; | private String latePayMoneyBefore; | ||||
| @Transient | @Transient | ||||
| private String latePayMoneyUpdate; | private String latePayMoneyUpdate; | ||||
| @Transient | |||||
| private String busDiscountRatio; | private String busDiscountRatio; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "冻结状态,0正常1冻结", name = "freeze") | @io.swagger.annotations.ApiModelProperty(value = "冻结状态,0正常1冻结", name = "freeze") | ||||
| @@ -93,4 +93,8 @@ public class WxBillSettle extends BaseEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="流向 0流入 1流出",name="direction") | @io.swagger.annotations.ApiModelProperty(value="流向 0流入 1流出",name="direction") | ||||
| private Integer direction; | private Integer direction; | ||||
| @Transient | |||||
| private Integer limitStart; | |||||
| @Transient | |||||
| private Integer limitEnd; | |||||
| } | } | ||||
| @@ -11,6 +11,7 @@ public interface WxBillSettleMapper extends CommonMapper<WxBillSettle, Long> { | |||||
| List<WxBillSettle> findList(WxBillSettle wxBillSettle); | List<WxBillSettle> findList(WxBillSettle wxBillSettle); | ||||
| void update(WxBillSettle record); | void update(WxBillSettle record); | ||||
| @@ -12,6 +12,7 @@ import com.iformall.service.ExcelService; | |||||
| import com.iformall.service.WxBillSettleService; | import com.iformall.service.WxBillSettleService; | ||||
| import com.iformall.service.WxFlowService; | import com.iformall.service.WxFlowService; | ||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| import org.apache.commons.collections.CollectionUtils; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import org.springframework.transaction.annotation.Transactional; | import org.springframework.transaction.annotation.Transactional; | ||||
| @@ -20,6 +21,7 @@ import javax.servlet.http.HttpServletResponse; | |||||
| import java.math.BigDecimal; | import java.math.BigDecimal; | ||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.Map; | |||||
| /** | /** | ||||
| * @author luozukai | * @author luozukai | ||||
| @@ -58,7 +60,36 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| @Override | @Override | ||||
| public PageInfo<WxBillSettle> listAsPage(WxBillSettle record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxBillSettle> listAsPage(WxBillSettle record, Integer pageIndex, Integer pageSize) { | ||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxBillSettleMapper.findList(record)); | |||||
| record.setLimitStart(0); | |||||
| record.setLimitEnd(Integer.MAX_VALUE); | |||||
| List totalList = wxBillSettleMapper.findList(record); | |||||
| if(CollectionUtils.isEmpty(totalList)){ | |||||
| PageHelper.startPage(pageIndex, pageSize); | |||||
| PageInfo<WxBillSettle> pageInfo = new PageInfo(new ArrayList()); | |||||
| pageInfo.setPages(0); | |||||
| pageInfo.setTotal(0); | |||||
| PageHelper.clearPage(); | |||||
| return pageInfo; | |||||
| } | |||||
| int total = totalList.size(); | |||||
| int pages; | |||||
| if(total % pageSize == 0){ | |||||
| pages = total / pageSize; | |||||
| }else{ | |||||
| pages = total / pageSize +1; | |||||
| } | |||||
| record.setLimitStart((pageIndex -1) * pageSize); | |||||
| record.setLimitEnd(pageSize); | |||||
| List<WxBillSettle> list = wxBillSettleMapper.findList(record); | |||||
| PageHelper.startPage(pageIndex, pageSize); | |||||
| PageInfo<WxBillSettle> pageInfo = new PageInfo(list); | |||||
| pageInfo.setPages(pages); | |||||
| pageInfo.setTotal(total); | |||||
| PageHelper.clearPage(); | |||||
| return pageInfo; | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -105,7 +105,7 @@ | |||||
| r.pay_ratio,br.`revenue`,r.`late_pay_ratio`,br.`late_pay_time`,br.`period`,br.`rent_contract_id`, | r.pay_ratio,br.`revenue`,r.`late_pay_ratio`,br.`late_pay_time`,br.`period`,br.`rent_contract_id`, | ||||
| d.receive_pay deposit,d.`status` | d.receive_pay deposit,d.`status` | ||||
| deposit_status,br.late_pay_price,br.shop_info,br.pay_way,br.late_pay_status,br.`comments`,br.starttime,br.endtime, | deposit_status,br.late_pay_price,br.shop_info,br.pay_way,br.late_pay_status,br.`comments`,br.starttime,br.endtime, | ||||
| r.late_pay_day,r.late_pay_ratio,br.bus_discount_ratio,br.freeze | |||||
| r.late_pay_day,r.late_pay_ratio,br.bus_discount_ratio,br.freeze,br.join_rent_price | |||||
| from wx_bill_rent br | from wx_bill_rent br | ||||
| left join wx_shop s on br.shop_id=s.id | left join wx_shop s on br.shop_id=s.id | ||||
| left join wx_rent_contract r on br.rent_contract_id=r.id | left join wx_rent_contract r on br.rent_contract_id=r.id | ||||
| @@ -36,13 +36,15 @@ | |||||
| <if test=" null != settleNumber and settleNumber !='' ">and tt.`settle_number` = #{settleNumber}</if> | <if test=" null != settleNumber and settleNumber !='' ">and tt.`settle_number` = #{settleNumber}</if> | ||||
| <if test=" null != status and status !=''">and tt.`status` = #{status}</if> | <if test=" null != status and status !=''">and tt.`status` = #{status}</if> | ||||
| <if test=" null != applyStatus and applyStatus !=''">and tt.`apply_status` = #{applyStatus}</if> | <if test=" null != applyStatus and applyStatus !=''">and tt.`apply_status` = #{applyStatus}</if> | ||||
| <if test=" null != direction and direction !=''"> | |||||
| <if test="0 == direction"> | |||||
| balance >0 | |||||
| </if> | |||||
| <if test="1 == direction"> | |||||
| balance <0 | |||||
| </if> | |||||
| <if test="0 == direction"> | |||||
| and (tt.receiveMoney-tt.payMoney- | |||||
| (select IFNULL(sum(settle_money),0) from wx_bill_settle_record where settle_id = tt.id) | |||||
| ) >0 | |||||
| </if> | |||||
| <if test="1 == direction"> | |||||
| and (tt.receiveMoney-tt.payMoney- | |||||
| (select IFNULL(sum(settle_money),0) from wx_bill_settle_record where settle_id = tt.id) | |||||
| ) <0 | |||||
| </if> | </if> | ||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | <if test=" null != sortColumns">order by ${sortColumns}</if> | ||||
| @@ -133,6 +135,9 @@ | |||||
| ) tt | ) tt | ||||
| <include refid="dynamicWhereConditions"/> | <include refid="dynamicWhereConditions"/> | ||||
| <if test="null != limitStart and null != limitEnd"> | |||||
| limit #{limitStart},#{limitEnd} | |||||
| </if> | |||||
| </select> | </select> | ||||