| @@ -6,6 +6,7 @@ import com.iformall.common.Result; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.WxBillDeposit; | import com.iformall.domain.po.WxBillDeposit; | ||||
| import com.iformall.domain.po.WxUserDataRule; | |||||
| import com.iformall.service.WxBillDepositService; | import com.iformall.service.WxBillDepositService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| @@ -36,6 +37,11 @@ public class WxBillDepositController extends BaseController { | |||||
| wxBillDeposit = new WxBillDeposit(); | wxBillDeposit = new WxBillDeposit(); | ||||
| } | } | ||||
| wxBillDeposit.updateTenantInfo(getTenantInfo()); | wxBillDeposit.updateTenantInfo(getTenantInfo()); | ||||
| WxUserDataRule dataRule = this.getCurrentDataFloors(); | |||||
| if (null != dataRule) { | |||||
| wxBillDeposit.setFloorForRule(dataRule.getFloorIds()); | |||||
| wxBillDeposit.setBusinessForRule(dataRule.getBussinessIds()); | |||||
| } | |||||
| final PageInfo<WxBillDeposit> page = wxBillDepositService.listAsPage(wxBillDeposit, pageNum, pageSize); | final PageInfo<WxBillDeposit> page = wxBillDepositService.listAsPage(wxBillDeposit, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -6,6 +6,7 @@ import com.iformall.common.Result; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.WxBillPropertyDeposit; | import com.iformall.domain.po.WxBillPropertyDeposit; | ||||
| import com.iformall.domain.po.WxUserDataRule; | |||||
| import com.iformall.service.WxBillPropertyDepositService; | import com.iformall.service.WxBillPropertyDepositService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| @@ -36,6 +37,11 @@ public class WxBillPropertyDepositController extends BaseController { | |||||
| wxBillPropertyDeposit = new WxBillPropertyDeposit(); | wxBillPropertyDeposit = new WxBillPropertyDeposit(); | ||||
| } | } | ||||
| wxBillPropertyDeposit.updateTenantInfo(getTenantInfo()); | wxBillPropertyDeposit.updateTenantInfo(getTenantInfo()); | ||||
| WxUserDataRule dataRule = this.getCurrentDataFloors(); | |||||
| if (null != dataRule) { | |||||
| wxBillPropertyDeposit.setFloorForRule(dataRule.getFloorIds()); | |||||
| wxBillPropertyDeposit.setBusinessForRule(dataRule.getBussinessIds()); | |||||
| } | |||||
| PageInfo<WxBillPropertyDeposit> result = wxBillPropertyDepositService.listAsPage(wxBillPropertyDeposit, pageNum, pageSize); | PageInfo<WxBillPropertyDeposit> result = wxBillPropertyDepositService.listAsPage(wxBillPropertyDeposit, pageNum, pageSize); | ||||
| return new ResultData(result); | return new ResultData(result); | ||||
| } | } | ||||
| @@ -97,4 +97,6 @@ public class WxBillDeposit extends TenantEntity { | |||||
| private String serviceChargePayUpdate; | private String serviceChargePayUpdate; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private List<Long> rentContractIdList; | private List<Long> rentContractIdList; | ||||
| @TableField(exist = false) | |||||
| private List<Long> merchantIds; | |||||
| } | } | ||||
| @@ -96,4 +96,6 @@ public class WxBillPropertyDeposit extends TenantEntity { | |||||
| private String serviceChargePayUpdate; | private String serviceChargePayUpdate; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private List<Long> propertyContractIdList; | private List<Long> propertyContractIdList; | ||||
| @TableField(exist = false) | |||||
| private List<Long> merchantIds; | |||||
| } | } | ||||
| @@ -50,6 +50,6 @@ public interface WxBillDepositService { | |||||
| ResultData adjustDeposit(WxBillDeposit wxBillDeposit); | ResultData adjustDeposit(WxBillDeposit wxBillDeposit); | ||||
| void computeTotalMoney(WxPayAccountBill wxPayAccountBill, WxBillDeposit deposit); | |||||
| void computeTotalMoney(Integer decimalSize,WxPayAccountBill wxPayAccountBill, WxBillDeposit deposit); | |||||
| } | } | ||||
| @@ -60,7 +60,7 @@ public interface WxBillRentManageService { | |||||
| ResultData updatePaid(Long id); | ResultData updatePaid(Long id); | ||||
| void computeTotalMoney(WxPayAccountBill wxPayAccountBill, WxBillRentManage deposit); | |||||
| void computeTotalMoney(Integer decimalSize,WxPayAccountBill wxPayAccountBill, WxBillRentManage deposit); | |||||
| ResultData updateLatePayStatus(WxBillRentManage wxBillRent); | ResultData updateLatePayStatus(WxBillRentManage wxBillRent); | ||||
| @@ -10,7 +10,10 @@ import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.MallUserInfo; | import com.iformall.domain.po.MallUserInfo; | ||||
| import com.iformall.domain.po.WxBillAction; | import com.iformall.domain.po.WxBillAction; | ||||
| import com.iformall.domain.po.WxBillDeposit; | import com.iformall.domain.po.WxBillDeposit; | ||||
| import com.iformall.domain.po.WxBillOtherDeposit; | |||||
| import com.iformall.domain.po.WxMerchant; | |||||
| import com.iformall.domain.po.WxPayAccountBill; | import com.iformall.domain.po.WxPayAccountBill; | ||||
| import com.iformall.domain.po.WxShop; | |||||
| import com.iformall.enums.EnumBillAction; | import com.iformall.enums.EnumBillAction; | ||||
| import com.iformall.enums.EnumBillPayWay; | import com.iformall.enums.EnumBillPayWay; | ||||
| import com.iformall.enums.EnumBillRentStatus; | import com.iformall.enums.EnumBillRentStatus; | ||||
| @@ -19,11 +22,17 @@ import com.iformall.exception.MallinkException; | |||||
| import com.iformall.mapper.WxBillDepositMapper; | import com.iformall.mapper.WxBillDepositMapper; | ||||
| import com.iformall.service.WxBillActionService; | import com.iformall.service.WxBillActionService; | ||||
| import com.iformall.service.WxBillDepositService; | import com.iformall.service.WxBillDepositService; | ||||
| import com.iformall.service.WxMerchantService; | |||||
| import com.iformall.service.WxPayAccountBillService; | import com.iformall.service.WxPayAccountBillService; | ||||
| import com.iformall.service.WxShopService; | |||||
| import com.iformall.utils.Constant; | |||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| import org.apache.commons.collections.CollectionUtils; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.context.annotation.Lazy; | |||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import org.springframework.transaction.annotation.Transactional; | import org.springframework.transaction.annotation.Transactional; | ||||
| @@ -48,29 +57,99 @@ public class WxBillDepositServiceImpl implements WxBillDepositService { | |||||
| @Autowired | @Autowired | ||||
| WxPayAccountBillService wxPayAccountBillService; | WxPayAccountBillService wxPayAccountBillService; | ||||
| @Lazy | |||||
| @Autowired | |||||
| WxMerchantService wxMerchantService; | |||||
| @Lazy | |||||
| @Autowired | |||||
| WxShopService wxShopService; | |||||
| @Override | @Override | ||||
| public PageInfo<WxBillDeposit> listAsPage(WxBillDeposit record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxBillDeposit> listAsPage(WxBillDeposit record, Integer pageIndex, Integer pageSize) { | ||||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(record); | WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(record); | ||||
| PageHelper.startPage(pageIndex, pageSize); | |||||
| List<WxBillDeposit> billDepositList = wxBillDepositMapper.queryBillDepositList(record); | |||||
| billDepositList.stream().forEach(e->{ | |||||
| //手续费 = 合同应收+手续费+滞纳金 | |||||
| computeTotalMoney(wxPayAccountBill, e); | |||||
| }); | |||||
| PageInfo<WxBillDeposit> pageInfo = new PageInfo<>(billDepositList); | |||||
| return pageInfo; | |||||
| return getBillDepositPropertyList(wxPayAccountBill, record, pageIndex, pageSize); | |||||
| } | |||||
| private PageInfo<WxBillDeposit> getBillDepositPropertyList(WxPayAccountBill wxPayAccountBill,WxBillDeposit record, Integer pageIndex, Integer pageSize) { | |||||
| if (null != record.getFloorForRule()) { | |||||
| List<Long> merchantIds = wxMerchantService.getFloorBuildMerchantIds(record, record.getFloorForRule(), null, null, 0, 0); | |||||
| if (null != merchantIds) { | |||||
| record.setMerchantIds(merchantIds); | |||||
| }else { | |||||
| record.setId(-1L); | |||||
| } | |||||
| } | |||||
| if (StringUtils.isNotBlank(record.getMerchantName())) { | |||||
| WxMerchant mq = new WxMerchant(); | |||||
| mq.updateTenantInfo(record); | |||||
| mq.setName(StringUtils.trimToNull(record.getMerchantName())); | |||||
| List<Long> mids = wxMerchantService.findIdList(mq); | |||||
| if (null != mids && mids.size() > 0 ) { | |||||
| if (null != record.getMerchantIds()) { | |||||
| List<Long> _mids = (List<Long>) CollectionUtils.intersection(mids, record.getMerchantIds()); | |||||
| if (null == _mids || _mids.size() <= 0) { | |||||
| record.setId(-1L); | |||||
| }else { | |||||
| record.setMerchantIds(_mids); | |||||
| } | |||||
| }else { | |||||
| record.setMerchantIds(mids); | |||||
| } | |||||
| }else { | |||||
| record.setId(-1L); | |||||
| } | |||||
| } | |||||
| PageInfo<WxBillDeposit> page = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxBillDepositMapper.queryBillDepositList(record)); | |||||
| if (null == page) { | |||||
| return null; | |||||
| } | |||||
| WxMerchant wq = new WxMerchant(); | |||||
| wq.updateTenantInfo(record); | |||||
| Map<Long,WxMerchant> merchantMap = wxMerchantService.findMerchantMap(wq); | |||||
| WxShop sq = new WxShop(); | |||||
| sq.updateTenantInfo(record); | |||||
| Map<Long,WxShop> shopMap = wxShopService.findShopMap(sq); | |||||
| if (null != page.getList()) { | |||||
| for (int i = 0 ; i < page.getList().size() ; i ++) { | |||||
| WxBillDeposit e = page.getList().get(i); | |||||
| //手续费 = 合同应收+手续费+滞纳金 | |||||
| computeTotalMoney(Constant.default_long_decimal_size,wxPayAccountBill, e); | |||||
| if (null != e.getMerchantId()) { | |||||
| WxMerchant m = merchantMap.get(e.getMerchantId()); | |||||
| if (null != m ) { | |||||
| e.setMerchantName(m.getName()); | |||||
| } | |||||
| } | |||||
| if (null != e.getShopId()) { | |||||
| WxShop shop = shopMap.get(e.getShopId()); | |||||
| if (null != shop) { | |||||
| e.setShopNumber(shop.getShopNumber()); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| return page; | |||||
| } | } | ||||
| @Override | @Override | ||||
| public void computeTotalMoney(WxPayAccountBill wxPayAccountBill, WxBillDeposit deposit) { | |||||
| public void computeTotalMoney(Integer decimalSize,WxPayAccountBill wxPayAccountBill, WxBillDeposit deposit) { | |||||
| if (deposit.getReceivePay() != null) { | if (deposit.getReceivePay() != null) { | ||||
| String receivePayB = deposit.getReceivePay(); | String receivePayB = deposit.getReceivePay(); | ||||
| BigDecimal servicePay; | BigDecimal servicePay; | ||||
| if (deposit.getServiceChargePay() != null) { | if (deposit.getServiceChargePay() != null) { | ||||
| servicePay = new BigDecimal(deposit.getServiceChargePay()); | servicePay = new BigDecimal(deposit.getServiceChargePay()); | ||||
| } else { | } else { | ||||
| servicePay = new BigDecimal(receivePayB).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 10, BigDecimal.ROUND_HALF_UP); | |||||
| servicePay = new BigDecimal(receivePayB).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), decimalSize, BigDecimal.ROUND_HALF_UP); | |||||
| } | } | ||||
| BigDecimal realReceivePay = servicePay.add(new BigDecimal(receivePayB)); | BigDecimal realReceivePay = servicePay.add(new BigDecimal(receivePayB)); | ||||
| deposit.setRealReceivePay(realReceivePay.toPlainString()); | deposit.setRealReceivePay(realReceivePay.toPlainString()); | ||||
| @@ -1,5 +1,6 @@ | |||||
| package com.iformall.service.impl; | package com.iformall.service.impl; | ||||
| import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils; | |||||
| import com.github.pagehelper.PageHelper; | import com.github.pagehelper.PageHelper; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| @@ -8,8 +9,11 @@ import com.iformall.common.Result; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.MallUserInfo; | import com.iformall.domain.po.MallUserInfo; | ||||
| import com.iformall.domain.po.WxBillAction; | import com.iformall.domain.po.WxBillAction; | ||||
| import com.iformall.domain.po.WxBillDeposit; | |||||
| import com.iformall.domain.po.WxBillPropertyDeposit; | import com.iformall.domain.po.WxBillPropertyDeposit; | ||||
| import com.iformall.domain.po.WxMerchant; | |||||
| import com.iformall.domain.po.WxPayAccountBill; | import com.iformall.domain.po.WxPayAccountBill; | ||||
| import com.iformall.domain.po.WxShop; | |||||
| import com.iformall.enums.EnumBillAction; | import com.iformall.enums.EnumBillAction; | ||||
| import com.iformall.enums.EnumBillPayWay; | import com.iformall.enums.EnumBillPayWay; | ||||
| import com.iformall.enums.EnumBillRentStatus; | import com.iformall.enums.EnumBillRentStatus; | ||||
| @@ -18,11 +22,17 @@ import com.iformall.exception.MallinkException; | |||||
| import com.iformall.mapper.WxBillPropertyDepositMapper; | import com.iformall.mapper.WxBillPropertyDepositMapper; | ||||
| import com.iformall.service.WxBillActionService; | import com.iformall.service.WxBillActionService; | ||||
| import com.iformall.service.WxBillPropertyDepositService; | import com.iformall.service.WxBillPropertyDepositService; | ||||
| import com.iformall.service.WxMerchantService; | |||||
| import com.iformall.service.WxPayAccountBillService; | import com.iformall.service.WxPayAccountBillService; | ||||
| import com.iformall.service.WxShopService; | |||||
| import com.iformall.utils.Constant; | |||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| import org.apache.commons.collections.CollectionUtils; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.context.annotation.Lazy; | |||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import org.springframework.transaction.annotation.Transactional; | import org.springframework.transaction.annotation.Transactional; | ||||
| @@ -45,18 +55,88 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe | |||||
| WxBillActionService wxBillActionService; | WxBillActionService wxBillActionService; | ||||
| @Autowired | @Autowired | ||||
| WxPayAccountBillService wxPayAccountBillService; | WxPayAccountBillService wxPayAccountBillService; | ||||
| @Lazy | |||||
| @Autowired | |||||
| WxMerchantService wxMerchantService; | |||||
| @Lazy | |||||
| @Autowired | |||||
| WxShopService wxShopService; | |||||
| @Override | @Override | ||||
| public PageInfo<WxBillPropertyDeposit> listAsPage(WxBillPropertyDeposit record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxBillPropertyDeposit> listAsPage(WxBillPropertyDeposit record, Integer pageIndex, Integer pageSize) { | ||||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(record); | WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(record); | ||||
| PageHelper.startPage(pageIndex, pageSize); | |||||
| List<WxBillPropertyDeposit> billDepositList = wxBillPropertyDepositMapper.queryBillDepositList(record); | |||||
| /*billDepositList.stream().forEach(e->{ | |||||
| //手续费 = 合同应收+手续费+滞纳金 | |||||
| computeTotalMoney(wxPayAccountBill, e); | |||||
| });*/ | |||||
| PageInfo<WxBillPropertyDeposit> pageInfo = new PageInfo<>(billDepositList); | |||||
| return pageInfo; | |||||
| return getBillDepositPropertyList(wxPayAccountBill, record, pageIndex, pageSize); | |||||
| } | |||||
| private PageInfo<WxBillPropertyDeposit> getBillDepositPropertyList(WxPayAccountBill wxPayAccountBill,WxBillPropertyDeposit record, Integer pageIndex, Integer pageSize) { | |||||
| if (null != record.getFloorForRule()) { | |||||
| List<Long> merchantIds = wxMerchantService.getFloorBuildMerchantIds(record, record.getFloorForRule(), null, null, 0, 0); | |||||
| if (null != merchantIds) { | |||||
| record.setMerchantIds(merchantIds); | |||||
| }else { | |||||
| record.setId(-1L); | |||||
| } | |||||
| } | |||||
| if (StringUtils.isNotBlank(record.getMerchantName())) { | |||||
| WxMerchant mq = new WxMerchant(); | |||||
| mq.updateTenantInfo(record); | |||||
| mq.setName(StringUtils.trimToNull(record.getMerchantName())); | |||||
| List<Long> mids = wxMerchantService.findIdList(mq); | |||||
| if (null != mids && mids.size() > 0 ) { | |||||
| if (null != record.getMerchantIds()) { | |||||
| List<Long> _mids = (List<Long>) CollectionUtils.intersection(mids, record.getMerchantIds()); | |||||
| if (null == _mids || _mids.size() <= 0) { | |||||
| record.setId(-1L); | |||||
| }else { | |||||
| record.setMerchantIds(_mids); | |||||
| } | |||||
| }else { | |||||
| record.setMerchantIds(mids); | |||||
| } | |||||
| }else { | |||||
| record.setId(-1L); | |||||
| } | |||||
| } | |||||
| PageInfo<WxBillPropertyDeposit> page = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxBillPropertyDepositMapper.queryBillDepositList(record)); | |||||
| if (null == page) { | |||||
| return null; | |||||
| } | |||||
| WxMerchant wq = new WxMerchant(); | |||||
| wq.updateTenantInfo(record); | |||||
| Map<Long,WxMerchant> merchantMap = wxMerchantService.findMerchantMap(wq); | |||||
| WxShop sq = new WxShop(); | |||||
| sq.updateTenantInfo(record); | |||||
| Map<Long,WxShop> shopMap = wxShopService.findShopMap(sq); | |||||
| if (null != page.getList()) { | |||||
| for (int i = 0 ; i < page.getList().size() ; i ++) { | |||||
| WxBillPropertyDeposit e = page.getList().get(i); | |||||
| //手续费 = 合同应收+手续费+滞纳金 | |||||
| //computeTotalMoney(Constant.default_long_decimal_size,wxPayAccountBill, e); | |||||
| if (null != e.getMerchantId()) { | |||||
| WxMerchant m = merchantMap.get(e.getMerchantId()); | |||||
| if (null != m ) { | |||||
| e.setMerchantName(m.getName()); | |||||
| } | |||||
| } | |||||
| if (null != e.getShopId()) { | |||||
| WxShop shop = shopMap.get(e.getShopId()); | |||||
| if (null != shop) { | |||||
| e.setShopNumber(shop.getShopNumber()); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| return page; | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -26,6 +26,7 @@ import com.iformall.service.WxBillActionService; | |||||
| import com.iformall.service.WxBillRentManageService; | import com.iformall.service.WxBillRentManageService; | ||||
| import com.iformall.service.WxMerchantService; | import com.iformall.service.WxMerchantService; | ||||
| import com.iformall.service.WxPayAccountBillService; | import com.iformall.service.WxPayAccountBillService; | ||||
| import com.iformall.utils.Constant; | |||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| import org.apache.commons.collections.CollectionUtils; | import org.apache.commons.collections.CollectionUtils; | ||||
| @@ -130,10 +131,10 @@ public class WxBillRentManageServiceImpl implements WxBillRentManageService { | |||||
| if (null != billRentList.getList()) { | if (null != billRentList.getList()) { | ||||
| for (int i = 0 ; i < billRentList.getList().size() ; i ++) { | for (int i = 0 ; i < billRentList.getList().size() ; i ++) { | ||||
| WxBillRentManage e = billRentList.getList().get(i); | WxBillRentManage e = billRentList.getList().get(i); | ||||
| //手续费 = 合同应收+手续费+滞纳金 | |||||
| computeTotalMoney(wxPayAccountBill, e); | |||||
| Integer decimalSize = Constant.default_long_decimal_size; | |||||
| WxRentContract rent = rentContractMap.get(e.getRentContractId()); | WxRentContract rent = rentContractMap.get(e.getRentContractId()); | ||||
| if (null != rent) { | if (null != rent) { | ||||
| decimalSize = rent.getDecimalSize(); | |||||
| e.setMerchantName(rent.getMerchantName()); | e.setMerchantName(rent.getMerchantName()); | ||||
| //e.setRentType(rent.getType()); | //e.setRentType(rent.getType()); | ||||
| //if (null != rent.getPayRatio()) { | //if (null != rent.getPayRatio()) { | ||||
| @@ -146,6 +147,9 @@ public class WxBillRentManageServiceImpl implements WxBillRentManageService { | |||||
| // } | // } | ||||
| //e.setLatePayDay(rent.getLatePayDay()); | //e.setLatePayDay(rent.getLatePayDay()); | ||||
| } | } | ||||
| //手续费 = 合同应收+手续费+滞纳金 | |||||
| computeTotalMoney(decimalSize,wxPayAccountBill, e); | |||||
| } | } | ||||
| } | } | ||||
| return billRentList; | return billRentList; | ||||
| @@ -262,7 +266,7 @@ public class WxBillRentManageServiceImpl implements WxBillRentManageService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public void computeTotalMoney(WxPayAccountBill wxPayAccountBill, WxBillRentManage rent) { | |||||
| public void computeTotalMoney(Integer decimalSize, WxPayAccountBill wxPayAccountBill, WxBillRentManage rent) { | |||||
| if (rent.getReceivePay() != null) { | if (rent.getReceivePay() != null) { | ||||
| if (rent.getLatePayPrice() == null) { | if (rent.getLatePayPrice() == null) { | ||||
| rent.setLatePayPrice("0"); | rent.setLatePayPrice("0"); | ||||
| @@ -271,7 +275,7 @@ public class WxBillRentManageServiceImpl implements WxBillRentManageService { | |||||
| if (rent.getServiceChargePay() != null) { | if (rent.getServiceChargePay() != null) { | ||||
| servicePay = new BigDecimal(rent.getServiceChargePay()); | servicePay = new BigDecimal(rent.getServiceChargePay()); | ||||
| } else { | } else { | ||||
| servicePay = new BigDecimal(rent.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 10, BigDecimal.ROUND_HALF_UP); | |||||
| servicePay = new BigDecimal(rent.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), decimalSize, BigDecimal.ROUND_HALF_UP); | |||||
| } | } | ||||
| BigDecimal realReceivePay = servicePay.add(new BigDecimal(rent.getLatePayPrice()).add(new BigDecimal(rent.getReceivePay()))); | BigDecimal realReceivePay = servicePay.add(new BigDecimal(rent.getLatePayPrice()).add(new BigDecimal(rent.getReceivePay()))); | ||||
| rent.setRealReceivePay(realReceivePay.toPlainString()); | rent.setRealReceivePay(realReceivePay.toPlainString()); | ||||
| @@ -14,6 +14,7 @@ import com.iformall.enums.*; | |||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.*; | import com.iformall.mapper.*; | ||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import com.iformall.utils.Constant; | |||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.joda.time.DateTime; | import org.joda.time.DateTime; | ||||
| @@ -73,7 +74,7 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| return getBillRentPropertyList(pageIndex,pageSize,record,wxPayAccountBill); | return getBillRentPropertyList(pageIndex,pageSize,record,wxPayAccountBill); | ||||
| } | } | ||||
| public void computeTotalMoney(WxPayAccountBill wxPayAccountBill, WxBillRent rent) { | |||||
| public void computeTotalMoney(Integer decimalSize,WxPayAccountBill wxPayAccountBill, WxBillRent rent) { | |||||
| if (rent.getReceivePay() != null) { | if (rent.getReceivePay() != null) { | ||||
| if (rent.getLatePayPrice() == null) { | if (rent.getLatePayPrice() == null) { | ||||
| rent.setLatePayPrice("0"); | rent.setLatePayPrice("0"); | ||||
| @@ -82,15 +83,15 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| if (rent.getServiceChargePay() != null) { | if (rent.getServiceChargePay() != null) { | ||||
| servicePay = new BigDecimal(rent.getServiceChargePay()); | servicePay = new BigDecimal(rent.getServiceChargePay()); | ||||
| } else { | } else { | ||||
| servicePay = new BigDecimal(rent.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP); | |||||
| servicePay = new BigDecimal(rent.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), decimalSize, BigDecimal.ROUND_HALF_UP); | |||||
| } | } | ||||
| Long realReceivePay = servicePay.longValue() + rent.getLatePayPrice() + rent.getReceivePay(); | |||||
| rent.setRealReceivePay(realReceivePay); | |||||
| rent.setServiceChargePay(servicePay.intValue()); | |||||
| BigDecimal realReceivePay = servicePay.add(new BigDecimal(rent.getLatePayPrice())).add(new BigDecimal(rent.getReceivePay())); | |||||
| rent.setRealReceivePay(realReceivePay.toPlainString()); | |||||
| rent.setServiceChargePay(servicePay.toPlainString()); | |||||
| if (!rent.getStatus().equals(EnumBillRentStatus.NOT_PAID.getCode())) { | if (!rent.getStatus().equals(EnumBillRentStatus.NOT_PAID.getCode())) { | ||||
| rent.setOwe(0L); | |||||
| rent.setOwe("0"); | |||||
| } else { | } else { | ||||
| rent.setOwe(realReceivePay - rent.getPay()); | |||||
| rent.setOwe(realReceivePay.subtract(new BigDecimal(rent.getPay())).toPlainString()); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -145,15 +146,15 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| WxBillRent rent = rp.getList().get(0); | WxBillRent rent = rp.getList().get(0); | ||||
| //手续费 = 合同应收+手续费+滞纳金 | //手续费 = 合同应收+手续费+滞纳金 | ||||
| //computeTotalMoney(wxPayAccountBill, rent); | //computeTotalMoney(wxPayAccountBill, rent); | ||||
| rent.setOwe(rent.getRealReceivePay() - rent.getPay()); | |||||
| rent.setOwe(new BigDecimal(rent.getRealReceivePay()).subtract(new BigDecimal(rent.getPay())).toPlainString()); | |||||
| return rent; | return rent; | ||||
| } | } | ||||
| @Override | @Override | ||||
| public ResultData saveOrUpdate(WxBillRent record, MallUserInfo user) { | public ResultData saveOrUpdate(WxBillRent record, MallUserInfo user) { | ||||
| int receivepay = record.getRealReceivePay() == null ? 0 : record.getRealReceivePay().intValue(); | |||||
| int pay = record.getPay()==null?0:record.getPay().intValue(); | |||||
| if(pay>receivepay){ | |||||
| String receivepay = StringUtils.isBlank(record.getRealReceivePay()) ? "0" : record.getRealReceivePay(); | |||||
| String pay = StringUtils.isBlank(record.getPay()) ? "0" : record.getPay(); | |||||
| if(new BigDecimal(pay).compareTo(new BigDecimal(receivepay)) > 0 ){ | |||||
| return new ResultData(ErrorCode.BILL_PAY_ERROR.getCode(), "实收金额不能大于实际应收总金额"); | return new ResultData(ErrorCode.BILL_PAY_ERROR.getCode(), "实收金额不能大于实际应收总金额"); | ||||
| } | } | ||||
| Date date = new Date(); | Date date = new Date(); | ||||
| @@ -163,7 +164,7 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| record.setId(idWorker.nextId()); | record.setId(idWorker.nextId()); | ||||
| record.setCreatetime(date); | record.setCreatetime(date); | ||||
| record.setUpdatetime(date); | record.setUpdatetime(date); | ||||
| record.setOwe(record.getReceivePay()-record.getPay()); | |||||
| record.setOwe(new BigDecimal(receivepay).subtract(new BigDecimal(pay)).toPlainString()); | |||||
| record.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | record.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | ||||
| try { | try { | ||||
| wxBillRentMapper.insert(record); | wxBillRentMapper.insert(record); | ||||
| @@ -182,19 +183,19 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| String price = ""; | String price = ""; | ||||
| String message =""; | String message =""; | ||||
| if(record.getServiceChargePayUpdate() != null){ | if(record.getServiceChargePayUpdate() != null){ | ||||
| Double l = Double.valueOf(record.getServiceChargePayUpdate())*100; | |||||
| wxBillRent.setServiceChargePay(l.intValue()); | |||||
| long latePayPrice = wxBillRent.getLatePayPrice() == null ? 0 : wxBillRent.getLatePayPrice(); | |||||
| wxBillRent.setOwe(wxBillRent.getReceivePay() + latePayPrice + wxBillRent.getServiceChargePay() - wxBillRent.getPay()); | |||||
| wxBillRent.setServiceChargePay(record.getServiceChargePayUpdate()); | |||||
| String latePayPrice = StringUtils.isBlank(wxBillRent.getLatePayPrice()) ? "0" : wxBillRent.getLatePayPrice(); | |||||
| wxBillRent.setOwe(new BigDecimal(wxBillRent.getReceivePay()).add(new BigDecimal(latePayPrice)) | |||||
| .add(new BigDecimal(wxBillRent.getServiceChargePay())).subtract(new BigDecimal(wxBillRent.getPay())).toPlainString()); | |||||
| }else{ | }else{ | ||||
| Long addpay = wxBillRent.getPay(); | |||||
| String addpay = wxBillRent.getPay(); | |||||
| wxBillRent.setRevenue(record.getRevenue()); | wxBillRent.setRevenue(record.getRevenue()); | ||||
| wxBillRent.setLatePayRatio(record.getLatePayRatio()); | wxBillRent.setLatePayRatio(record.getLatePayRatio()); | ||||
| wxBillRent.setLatePayTime(record.getLatePayTime()); | wxBillRent.setLatePayTime(record.getLatePayTime()); | ||||
| wxBillRent.setLatePayStatus(record.getLatePayStatus()); | wxBillRent.setLatePayStatus(record.getLatePayStatus()); | ||||
| wxBillRent.setPay(record.getPay()); | wxBillRent.setPay(record.getPay()); | ||||
| wxBillRent.setReceivePay(record.getReceivePay()); | wxBillRent.setReceivePay(record.getReceivePay()); | ||||
| wxBillRent.setOwe(record.getRealReceivePay() - record.getPay()); | |||||
| wxBillRent.setOwe(new BigDecimal(record.getRealReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | |||||
| if (record.getPay().equals(record.getRealReceivePay())) { | if (record.getPay().equals(record.getRealReceivePay())) { | ||||
| wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode()); | wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode()); | ||||
| Date payDate = record.getPayDate(); | Date payDate = record.getPayDate(); | ||||
| @@ -208,7 +209,7 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| wxBillRent.setPayDate(record.getPayDate()); | wxBillRent.setPayDate(record.getPayDate()); | ||||
| wxBillRent.setUpdatetime(date); | wxBillRent.setUpdatetime(date); | ||||
| wxBillRent.setPayWay(record.getPayWay()); | wxBillRent.setPayWay(record.getPayWay()); | ||||
| price = new BigDecimal(record.getPay() - addpay).divide(new BigDecimal(100)).toPlainString(); | |||||
| price = new BigDecimal(record.getPay()).subtract(new BigDecimal(addpay)).toPlainString(); | |||||
| } | } | ||||
| try { | try { | ||||
| @@ -345,24 +346,24 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| if(EnumBusRatioTime.YEAR.getCode().equals(wxRentContract.getBusDiscountTime())){ | if(EnumBusRatioTime.YEAR.getCode().equals(wxRentContract.getBusDiscountTime())){ | ||||
| if(startInt == endInt && months == 12){ | if(startInt == endInt && months == 12){ | ||||
| //刚好1年 | //刚好1年 | ||||
| ratioVo = WxRentContractServiceImpl.getPayRatio(EnumGetRatioFrom.BILL.getCode(),wxBillRent.getRevenue(),wxRentContract.getBusDiscountRatio(),EnumMissTimeType.OTHER.getCode(),dayCount,0); | |||||
| ratioVo = WxRentContractServiceImpl.getPayRatio(wxRentContract.getDecimalSize(),EnumGetRatioFrom.BILL.getCode(),wxBillRent.getRevenue(),wxRentContract.getBusDiscountRatio(),EnumMissTimeType.OTHER.getCode(),dayCount,0); | |||||
| }else{ | }else{ | ||||
| ratioVo = WxRentContractServiceImpl.getPayRatio(EnumGetRatioFrom.BILL.getCode(),wxBillRent.getRevenue(),wxRentContract.getBusDiscountRatio(),EnumMissTimeType.YEAR.getCode(),dayCount,0); | |||||
| ratioVo = WxRentContractServiceImpl.getPayRatio(wxRentContract.getDecimalSize(),EnumGetRatioFrom.BILL.getCode(),wxBillRent.getRevenue(),wxRentContract.getBusDiscountRatio(),EnumMissTimeType.YEAR.getCode(),dayCount,0); | |||||
| } | } | ||||
| }else if(EnumBusRatioTime.MONTH.getCode().equals(wxRentContract.getBusDiscountTime())){ | }else if(EnumBusRatioTime.MONTH.getCode().equals(wxRentContract.getBusDiscountTime())){ | ||||
| if(startInt == endInt && months == 1){ | if(startInt == endInt && months == 1){ | ||||
| //刚好1个月 | //刚好1个月 | ||||
| ratioVo = WxRentContractServiceImpl.getPayRatio(EnumGetRatioFrom.BILL.getCode(),wxBillRent.getRevenue(),wxRentContract.getBusDiscountRatio(),EnumMissTimeType.OTHER.getCode(),dayCount,0); | |||||
| ratioVo = WxRentContractServiceImpl.getPayRatio(wxRentContract.getDecimalSize(),EnumGetRatioFrom.BILL.getCode(),wxBillRent.getRevenue(),wxRentContract.getBusDiscountRatio(),EnumMissTimeType.OTHER.getCode(),dayCount,0); | |||||
| }else{ | }else{ | ||||
| ratioVo = WxRentContractServiceImpl.getPayRatio(EnumGetRatioFrom.BILL.getCode(),wxBillRent.getRevenue(),wxRentContract.getBusDiscountRatio(),EnumMissTimeType.MONTH.getCode(),dayCount,0); | |||||
| ratioVo = WxRentContractServiceImpl.getPayRatio(wxRentContract.getDecimalSize(),EnumGetRatioFrom.BILL.getCode(),wxBillRent.getRevenue(),wxRentContract.getBusDiscountRatio(),EnumMissTimeType.MONTH.getCode(),dayCount,0); | |||||
| } | } | ||||
| }else if(EnumBusRatioTime.PERIOD.getCode().equals(wxRentContract.getBusDiscountTime())){ | }else if(EnumBusRatioTime.PERIOD.getCode().equals(wxRentContract.getBusDiscountTime())){ | ||||
| ratioVo = WxRentContractServiceImpl.getPayRatio(EnumGetRatioFrom.BILL.getCode(),wxBillRent.getRevenue(),wxRentContract.getBusDiscountRatio(),EnumMissTimeType.PERIOD.getCode(),dayCount,wxRentContract.getReceivePeriod()); | |||||
| ratioVo = WxRentContractServiceImpl.getPayRatio(wxRentContract.getDecimalSize(),EnumGetRatioFrom.BILL.getCode(),wxBillRent.getRevenue(),wxRentContract.getBusDiscountRatio(),EnumMissTimeType.PERIOD.getCode(),dayCount,wxRentContract.getReceivePeriod()); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| long newReceivePay; | |||||
| String newReceivePay; | |||||
| if(ratioVo != null){ | if(ratioVo != null){ | ||||
| newReceivePay = ratioVo.getPrice(); | newReceivePay = ratioVo.getPrice(); | ||||
| //wxBillRent.setPayRatio(ratioVo.getRatio().longValue()); | //wxBillRent.setPayRatio(ratioVo.getRatio().longValue()); | ||||
| @@ -371,22 +372,21 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| wxBillRent.setBusDiscountRatio(ratioVo.getUseRatio()); | wxBillRent.setBusDiscountRatio(ratioVo.getUseRatio()); | ||||
| } | } | ||||
| }else{ | }else{ | ||||
| BigDecimal hundred = new BigDecimal(100); | |||||
| BigDecimal revenue = new BigDecimal(record.getRevenue() == null ? 0 : record.getRevenue()).divide(hundred); | |||||
| BigDecimal revenue = new BigDecimal(StringUtils.isBlank(record.getRevenue()) ? "0" : record.getRevenue()); | |||||
| BigDecimal payRatio = new BigDecimal(ratio).divide(new BigDecimal(10000)); | BigDecimal payRatio = new BigDecimal(ratio).divide(new BigDecimal(10000)); | ||||
| BigDecimal price = revenue.multiply(payRatio).setScale(2, RoundingMode.HALF_EVEN); | |||||
| newReceivePay = price.multiply(hundred).longValue(); | |||||
| BigDecimal price = revenue.multiply(payRatio).setScale(wxRentContract.getDecimalSize(), RoundingMode.HALF_EVEN); | |||||
| newReceivePay = price.toPlainString(); | |||||
| } | } | ||||
| wxBillRent.setJoinRentPrice(newReceivePay); | wxBillRent.setJoinRentPrice(newReceivePay); | ||||
| if(newReceivePay > wxBillRent.getReceivePay()){ | |||||
| if(new BigDecimal(newReceivePay).compareTo(new BigDecimal(wxBillRent.getReceivePay())) > 0){ | |||||
| wxBillRent.setReceivePay(newReceivePay); | wxBillRent.setReceivePay(newReceivePay); | ||||
| } | } | ||||
| Long oldPrice = wxBillRent.getReceivePay(); | |||||
| Long newPrice = newReceivePay; | |||||
| String oldPrice = wxBillRent.getReceivePay(); | |||||
| String newPrice = newReceivePay; | |||||
| wxBillRent.setUpdatetime(new Date()); | wxBillRent.setUpdatetime(new Date()); | ||||
| long latePayPrice = wxBillRent.getLatePayPrice() == null ? 0 : wxBillRent.getLatePayPrice(); | |||||
| wxBillRent.setOwe(newPrice + wxBillRent.getServiceChargePay() + latePayPrice - wxBillRent.getPay()); | |||||
| String latePayPrice = StringUtils.isBlank(wxBillRent.getLatePayPrice()) ? "0" : wxBillRent.getLatePayPrice(); | |||||
| wxBillRent.setOwe(new BigDecimal(newPrice).add(new BigDecimal(wxBillRent.getServiceChargePay())).add(new BigDecimal(latePayPrice)).subtract(new BigDecimal(wxBillRent.getPay())).toPlainString()); | |||||
| wxBillRentMapper.updateById(wxBillRent); | wxBillRentMapper.updateById(wxBillRent); | ||||
| if (!oldPrice.equals(newPrice)) { | if (!oldPrice.equals(newPrice)) { | ||||
| @@ -517,10 +517,10 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| if (null != billRentList.getList()) { | if (null != billRentList.getList()) { | ||||
| for (int i = 0 ; i < billRentList.getList().size() ; i ++) { | for (int i = 0 ; i < billRentList.getList().size() ; i ++) { | ||||
| WxBillRent e = billRentList.getList().get(i); | WxBillRent e = billRentList.getList().get(i); | ||||
| //手续费 = 合同应收+手续费+滞纳金 | |||||
| computeTotalMoney(wxPayAccountBill, e); | |||||
| Integer decimalSize = Constant.default_long_decimal_size; | |||||
| WxRentContract rent = rentContractMap.get(e.getRentContractId()); | WxRentContract rent = rentContractMap.get(e.getRentContractId()); | ||||
| if (null != rent) { | if (null != rent) { | ||||
| decimalSize = rent.getDecimalSize(); | |||||
| e.setMerchantName(rent.getMerchantName()); | e.setMerchantName(rent.getMerchantName()); | ||||
| e.setRentType(rent.getType()); | e.setRentType(rent.getType()); | ||||
| if (null != rent.getPayRatio()) { | if (null != rent.getPayRatio()) { | ||||
| @@ -534,6 +534,9 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| e.setLatePayDay(rent.getLatePayDay()); | e.setLatePayDay(rent.getLatePayDay()); | ||||
| } | } | ||||
| //手续费 = 合同应收+手续费+滞纳金 | |||||
| computeTotalMoney(decimalSize,wxPayAccountBill, e); | |||||
| WxBillDeposit bd = billDepositMap.get(e.getRentContractId()); | WxBillDeposit bd = billDepositMap.get(e.getRentContractId()); | ||||
| if (null != bd) { | if (null != bd) { | ||||
| e.setDeposit(bd.getReceivePay()); | e.setDeposit(bd.getReceivePay()); | ||||
| @@ -550,8 +553,8 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| public ResultData updateLatePayMoney(WxBillRent record, MallUserInfo user) { | public ResultData updateLatePayMoney(WxBillRent record, MallUserInfo user) { | ||||
| WxBillRent rent = wxBillRentMapper.selectById(record.getId()); | WxBillRent rent = wxBillRentMapper.selectById(record.getId()); | ||||
| if(record.getLatePayMoneyUpdate() != null) { | if(record.getLatePayMoneyUpdate() != null) { | ||||
| rent.setLatePayPrice(Long.parseLong(record.getLatePayMoneyUpdate()) * 100); | |||||
| rent.setOwe(rent.getReceivePay() + rent.getLatePayPrice() + rent.getServiceChargePay() - rent.getPay()); | |||||
| rent.setLatePayPrice(record.getLatePayMoneyUpdate()); | |||||
| rent.setOwe(new BigDecimal(rent.getReceivePay()).add(new BigDecimal(rent.getLatePayPrice())).add(new BigDecimal(rent.getServiceChargePay())).subtract(new BigDecimal(rent.getPay())).toPlainString()); | |||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| WxBillAction billAction = new WxBillAction(); | WxBillAction billAction = new WxBillAction(); | ||||
| billAction.setId(idWorker.nextId()); | billAction.setId(idWorker.nextId()); | ||||
| @@ -148,7 +148,7 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| return billSettle; | return billSettle; | ||||
| } | } | ||||
| public void addBillAction(Long billId,Long money){ | |||||
| public void addBillAction(Long billId,String money){ | |||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| WxBillAction billAction = new WxBillAction(); | WxBillAction billAction = new WxBillAction(); | ||||
| billAction.setId(idWorker.nextId()); | billAction.setId(idWorker.nextId()); | ||||
| @@ -185,9 +185,9 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| wxBillRent.setPayDate(new Date()); | wxBillRent.setPayDate(new Date()); | ||||
| WxBillRent dbBill = wxBillRentMapper.selectById(wxBillRent.getId()); | WxBillRent dbBill = wxBillRentMapper.selectById(wxBillRent.getId()); | ||||
| if(dbBill!=null) { | if(dbBill!=null) { | ||||
| if(dbBill.getPay() == null) dbBill.setPay(0l); | |||||
| if(dbBill.getOwe() == null) dbBill.setOwe(0l); | |||||
| wxBillRent.setPay(dbBill.getPay()+ dbBill.getOwe()); | |||||
| if(StringUtils.isBlank(dbBill.getPay())) dbBill.setPay("0"); | |||||
| if(StringUtils.isBlank(dbBill.getOwe())) dbBill.setOwe("0"); | |||||
| wxBillRent.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getOwe())).toPlainString()); | |||||
| wxBillRent.setPayDate(new Date()); | wxBillRent.setPayDate(new Date()); | ||||
| addBillAction(bill.getBillId(), dbBill.getOwe()); | addBillAction(bill.getBillId(), dbBill.getOwe()); | ||||
| } | } | ||||
| @@ -211,9 +211,9 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| wxBillRent.setPayDate(new Date()); | wxBillRent.setPayDate(new Date()); | ||||
| WxBillDeposit dbBill = wxBillDepositMapper.selectById(wxBillRent.getId()); | WxBillDeposit dbBill = wxBillDepositMapper.selectById(wxBillRent.getId()); | ||||
| if(dbBill!=null) { | if(dbBill!=null) { | ||||
| if(dbBill.getPay() == null) dbBill.setPay(0l); | |||||
| if(dbBill.getReceivePay() == null) dbBill.setReceivePay(0l); | |||||
| wxBillRent.setPay(dbBill.getPay()+dbBill.getReceivePay() ); //押金是ReceivePay | |||||
| if(StringUtils.isBlank(dbBill.getPay())) dbBill.setPay("0"); | |||||
| if(StringUtils.isBlank(dbBill.getReceivePay())) dbBill.setReceivePay("0"); | |||||
| wxBillRent.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getReceivePay())).toPlainString()); //押金是ReceivePay | |||||
| wxBillRent.setPayDate(new Date()); | wxBillRent.setPayDate(new Date()); | ||||
| if(EnumSettleBillType.R.getCode().equals(bill.getType())){ | if(EnumSettleBillType.R.getCode().equals(bill.getType())){ | ||||
| wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode()); | wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode()); | ||||
| @@ -251,7 +251,7 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| }else{ | }else{ | ||||
| wxBillOtherDeposit.setStatus(EnumBillRentStatus.RETURN.getCode()); | wxBillOtherDeposit.setStatus(EnumBillRentStatus.RETURN.getCode()); | ||||
| } | } | ||||
| addBillAction(bill.getBillId(), dbBill.getOwe()); | |||||
| addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe())); | |||||
| } | } | ||||
| } | } | ||||
| wxBillOtherDepositMapper.updateById(wxBillOtherDeposit); | wxBillOtherDepositMapper.updateById(wxBillOtherDeposit); | ||||
| @@ -282,7 +282,7 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| }else{ | }else{ | ||||
| propertyDeposit.setStatus(EnumBillRentStatus.RETURN.getCode()); | propertyDeposit.setStatus(EnumBillRentStatus.RETURN.getCode()); | ||||
| } | } | ||||
| addBillAction(bill.getBillId(), dbBill.getOwe()); | |||||
| addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe())); | |||||
| } | } | ||||
| } | } | ||||
| wxBillPropertyDepositMapper.updateById(propertyDeposit); | wxBillPropertyDepositMapper.updateById(propertyDeposit); | ||||
| @@ -309,7 +309,7 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| if(dbBill.getOwe() == null) dbBill.setOwe(0l); | if(dbBill.getOwe() == null) dbBill.setOwe(0l); | ||||
| wxBillRent.setPay(dbBill.getPay()+dbBill.getOwe()); | wxBillRent.setPay(dbBill.getPay()+dbBill.getOwe()); | ||||
| wxBillRent.setPayDate(new Date()); | wxBillRent.setPayDate(new Date()); | ||||
| addBillAction(bill.getBillId(), dbBill.getOwe()); | |||||
| addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe())); | |||||
| } | } | ||||
| } | } | ||||
| wxBillPropertyMapper.updateById(wxBillRent); | wxBillPropertyMapper.updateById(wxBillRent); | ||||
| @@ -340,7 +340,7 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| }else{ | }else{ | ||||
| propertyDeposit.setStatus(EnumBillRentStatus.RETURN.getCode()); | propertyDeposit.setStatus(EnumBillRentStatus.RETURN.getCode()); | ||||
| } | } | ||||
| addBillAction(bill.getBillId(), dbBill.getOwe()); | |||||
| addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe())); | |||||
| } | } | ||||
| } | } | ||||
| wxBillPropertyDepositMapper.updateById(propertyDeposit); | wxBillPropertyDepositMapper.updateById(propertyDeposit); | ||||
| @@ -366,7 +366,7 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| if(dbBill.getOwe() == null) dbBill.setOwe(0l); | if(dbBill.getOwe() == null) dbBill.setOwe(0l); | ||||
| wxBillRent.setPay(dbBill.getPay()+dbBill.getOwe()); | wxBillRent.setPay(dbBill.getPay()+dbBill.getOwe()); | ||||
| wxBillRent.setPayDate(new Date()); | wxBillRent.setPayDate(new Date()); | ||||
| addBillAction(bill.getBillId(), dbBill.getOwe()); | |||||
| addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe())); | |||||
| } | } | ||||
| } | } | ||||
| wxBillOtherMapper.updateById(wxBillRent); | wxBillOtherMapper.updateById(wxBillRent); | ||||
| @@ -397,7 +397,7 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| }else{ | }else{ | ||||
| wxBillRent.setStatus(EnumBillRentStatus.RETURN.getCode()); | wxBillRent.setStatus(EnumBillRentStatus.RETURN.getCode()); | ||||
| } | } | ||||
| addBillAction(bill.getBillId(), dbBill.getOwe()); | |||||
| addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe())); | |||||
| } | } | ||||
| } | } | ||||
| wxBillOtherDepositMapper.updateById(wxBillRent); | wxBillOtherDepositMapper.updateById(wxBillRent); | ||||
| @@ -436,7 +436,7 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| }else{ | }else{ | ||||
| wxBillRent.setStatus(EnumBillRentStatus.RETURN.getCode()); | wxBillRent.setStatus(EnumBillRentStatus.RETURN.getCode()); | ||||
| } | } | ||||
| addBillAction(bill.getBillId(), dbBill.getOwe()); | |||||
| addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe())); | |||||
| } | } | ||||
| } | } | ||||
| wxBillOtherDepositMapper.updateById(wxBillRent); | wxBillOtherDepositMapper.updateById(wxBillRent); | ||||
| @@ -462,7 +462,7 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| if(dbBill.getOwe() == null) dbBill.setOwe(0l); | if(dbBill.getOwe() == null) dbBill.setOwe(0l); | ||||
| wxBillDaily.setPay(dbBill.getPay()+dbBill.getOwe()); | wxBillDaily.setPay(dbBill.getPay()+dbBill.getOwe()); | ||||
| wxBillDaily.setPayDate(new Date()); | wxBillDaily.setPayDate(new Date()); | ||||
| addBillAction(bill.getBillId(), dbBill.getOwe()); | |||||
| addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe())); | |||||
| } | } | ||||
| } | } | ||||
| wxBillDailyMapper.updateById(wxBillDaily); | wxBillDailyMapper.updateById(wxBillDaily); | ||||
| @@ -488,7 +488,7 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| if(dbBill.getOwe() == null) dbBill.setOwe(0l); | if(dbBill.getOwe() == null) dbBill.setOwe(0l); | ||||
| wxBillRent.setPay(dbBill.getPay()+dbBill.getOwe()); | wxBillRent.setPay(dbBill.getPay()+dbBill.getOwe()); | ||||
| wxBillRent.setPayDate(new Date()); | wxBillRent.setPayDate(new Date()); | ||||
| addBillAction(bill.getBillId(), dbBill.getOwe()); | |||||
| addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe())); | |||||
| } | } | ||||
| } | } | ||||
| wxBillOtherMapper.updateById(wxBillRent); | wxBillOtherMapper.updateById(wxBillRent); | ||||
| @@ -517,7 +517,7 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| }else{ | }else{ | ||||
| propertyDeposit.setStatus(EnumBillRentStatus.RETURN.getCode()); | propertyDeposit.setStatus(EnumBillRentStatus.RETURN.getCode()); | ||||
| } | } | ||||
| addBillAction(bill.getBillId(), dbBill.getOwe()); | |||||
| addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe())); | |||||
| } | } | ||||
| } | } | ||||
| wxBillPropertyDepositMapper.updateById(propertyDeposit); | wxBillPropertyDepositMapper.updateById(propertyDeposit); | ||||
| @@ -135,12 +135,12 @@ public class WxBusinessServiceImpl implements WxBusinessService { | |||||
| logger.warn("rent rentInfo is null-1: " + dbRent.getId()); | logger.warn("rent rentInfo is null-1: " + dbRent.getId()); | ||||
| continue; | continue; | ||||
| } | } | ||||
| Long price = dbRent.getPrice(); | |||||
| String price = dbRent.getPrice(); | |||||
| Integer priceUnit = dbRent.getPriceUnit(); | Integer priceUnit = dbRent.getPriceUnit(); | ||||
| Integer type = dbRent.getType(); | Integer type = dbRent.getType(); | ||||
| Integer period = dbRent.getReceivePeriod(); | Integer period = dbRent.getReceivePeriod(); | ||||
| Integer busDiscountTime = dbRent.getBusDiscountTime(); | Integer busDiscountTime = dbRent.getBusDiscountTime(); | ||||
| BigDecimal priceDecimal = getPriceDecimal(day, price, priceUnit, type, period, busDiscountTime); | |||||
| BigDecimal priceDecimal = getPriceDecimal(dbRent.getDecimalSize(),day, price, priceUnit, type, period, busDiscountTime); | |||||
| businessSumMoney = businessSumMoney.add(priceDecimal); | businessSumMoney = businessSumMoney.add(priceDecimal); | ||||
| } | } | ||||
| @@ -164,7 +164,7 @@ public class WxBusinessServiceImpl implements WxBusinessService { | |||||
| logger.info("业态分析>>>>>>>>>>>>>>>>>>物业合同ID:" + dbRent.getId()); | logger.info("业态分析>>>>>>>>>>>>>>>>>>物业合同ID:" + dbRent.getId()); | ||||
| Long price = dbRent.getPrice(); | Long price = dbRent.getPrice(); | ||||
| Integer priceUnit = dbRent.getPriceUnit(); | Integer priceUnit = dbRent.getPriceUnit(); | ||||
| BigDecimal priceDecimal = getPriceDecimal(day, price, priceUnit, EnumRentContractType.RENT_BY_AREA.getCode(), null, null); | |||||
| BigDecimal priceDecimal = getPriceDecimal(dbRent.getDecimalSize(),day, String.valueOf(price), priceUnit, EnumRentContractType.RENT_BY_AREA.getCode(), null, null); | |||||
| businessSumMoney = businessSumMoney.add(priceDecimal); | businessSumMoney = businessSumMoney.add(priceDecimal); | ||||
| } | } | ||||
| logger.info("业态分析>>>>>>>>>>>>>>>>>>商铺面积:" + e.get("area").toString()); | logger.info("业态分析>>>>>>>>>>>>>>>>>>商铺面积:" + e.get("area").toString()); | ||||
| @@ -188,23 +188,23 @@ public class WxBusinessServiceImpl implements WxBusinessService { | |||||
| * 2联营 1年(price/365*day) 2月(price/31*day) 3周期 (price/period/31*day) | * 2联营 1年(price/365*day) 2月(price/31*day) 3周期 (price/period/31*day) | ||||
| * 3取其高 与按面积 相同 | * 3取其高 与按面积 相同 | ||||
| */ | */ | ||||
| public BigDecimal getPriceDecimal(int day, Long price, Integer priceUnit, Integer type, Integer period, Integer busDiscountTime) { | |||||
| public BigDecimal getPriceDecimal(Integer decimalSize,int day, String price, Integer priceUnit, Integer type, Integer period, Integer busDiscountTime) { | |||||
| if (EnumRentContractType.RENT_BY_JOINT.getCode().equals(type)) { | if (EnumRentContractType.RENT_BY_JOINT.getCode().equals(type)) { | ||||
| if (EnumBusRatioTime.YEAR.getCode().equals(busDiscountTime)) { | if (EnumBusRatioTime.YEAR.getCode().equals(busDiscountTime)) { | ||||
| return new BigDecimal(price).divide(new BigDecimal(365), 0, RoundingMode.HALF_UP).multiply(new BigDecimal(day)); | |||||
| return new BigDecimal(price).divide(new BigDecimal(365), decimalSize, RoundingMode.HALF_UP).multiply(new BigDecimal(day)); | |||||
| } | } | ||||
| if (EnumBusRatioTime.MONTH.getCode().equals(busDiscountTime)) { | if (EnumBusRatioTime.MONTH.getCode().equals(busDiscountTime)) { | ||||
| return new BigDecimal(price).divide(new BigDecimal(31), 0, RoundingMode.HALF_UP).multiply(new BigDecimal(day)); | |||||
| return new BigDecimal(price).divide(new BigDecimal(31), decimalSize, RoundingMode.HALF_UP).multiply(new BigDecimal(day)); | |||||
| } | } | ||||
| return new BigDecimal(price).divide(new BigDecimal(31).multiply(new BigDecimal(period)), 0, RoundingMode.HALF_UP).multiply(new BigDecimal(day)); | |||||
| return new BigDecimal(price).divide(new BigDecimal(31).multiply(new BigDecimal(period)), decimalSize, RoundingMode.HALF_UP).multiply(new BigDecimal(day)); | |||||
| } else { | } else { | ||||
| if (EnumPriceUnit.D.getCode().equals(priceUnit)) { | if (EnumPriceUnit.D.getCode().equals(priceUnit)) { | ||||
| return new BigDecimal(price).multiply(new BigDecimal(day)); | return new BigDecimal(price).multiply(new BigDecimal(day)); | ||||
| } | } | ||||
| if (EnumPriceUnit.M.getCode().equals(priceUnit)) { | if (EnumPriceUnit.M.getCode().equals(priceUnit)) { | ||||
| return new BigDecimal(price).divide(new BigDecimal(31), 0, RoundingMode.HALF_UP).multiply(new BigDecimal(day)); | |||||
| return new BigDecimal(price).divide(new BigDecimal(31), decimalSize, RoundingMode.HALF_UP).multiply(new BigDecimal(day)); | |||||
| } | } | ||||
| return new BigDecimal(price).divide(new BigDecimal(365), 0, RoundingMode.HALF_UP).multiply(new BigDecimal(day)); | |||||
| return new BigDecimal(price).divide(new BigDecimal(365), decimalSize, RoundingMode.HALF_UP).multiply(new BigDecimal(day)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -752,19 +752,19 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| long needpay; | long needpay; | ||||
| //按日 | //按日 | ||||
| if (wxRentContract.getPriceUnit().equals(EnumPriceUnit.D.getCode())){ | if (wxRentContract.getPriceUnit().equals(EnumPriceUnit.D.getCode())){ | ||||
| Double priceD = new Double(price); | |||||
| double needpayD = WxRentContractHelper.getNeedPay(0,priceD,startDate,endDate); | |||||
| BigDecimal priceD = new BigDecimal(price); | |||||
| String needpayD = WxRentContractHelper.getNeedPay(wxRentContract.getDecimalSize(),new BigDecimal(0),priceD,startDate,endDate); | |||||
| needpay = new Double(needpayD).longValue(); | needpay = new Double(needpayD).longValue(); | ||||
| }else{ | }else{ | ||||
| //年 需要除12 | //年 需要除12 | ||||
| Double priceD = new Double(price); | |||||
| BigDecimal priceD = new BigDecimal(price); | |||||
| if(EnumPriceUnit.Y.getCode().equals(wxRentContract.getPriceUnit())){ | if(EnumPriceUnit.Y.getCode().equals(wxRentContract.getPriceUnit())){ | ||||
| priceD = new Double(price)/12; | |||||
| priceD = new BigDecimal(price).divide(new BigDecimal(12),wxRentContract.getDecimalSize(),BigDecimal.ROUND_HALF_UP); | |||||
| } | } | ||||
| //生成金额直接计算 | //生成金额直接计算 | ||||
| if(!saveDb){ | if(!saveDb){ | ||||
| needpay = new Double(WxRentContractHelper.getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod,false)).longValue(); | |||||
| needpay = new Double(WxRentContractHelper.getMonthNeedPay(wxRentContract.getDecimalSize(),priceD, startDate, endDate,dayType,receivePeriod,false)).longValue(); | |||||
| return needpay; | return needpay; | ||||
| } | } | ||||
| @@ -777,18 +777,18 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| if(sdMR.format(startDate).equals(sdMR.format(wxRentContract.getStartDate())) && sdMR.format(endDate).equals(sdMR.format(wxRentContract.getEndDate())) ){ | if(sdMR.format(startDate).equals(sdMR.format(wxRentContract.getStartDate())) && sdMR.format(endDate).equals(sdMR.format(wxRentContract.getEndDate())) ){ | ||||
| int months = WxRentContractHelper.getMonths(sdM.format(startDate)+"-01",sdM.format(endDate)+"-01"); | int months = WxRentContractHelper.getMonths(sdM.format(startDate)+"-01",sdM.format(endDate)+"-01"); | ||||
| months++; | months++; | ||||
| needpay = new Double(months * priceD).longValue(); | |||||
| needpay = new BigDecimal(months).multiply(priceD).longValue(); | |||||
| }else { | }else { | ||||
| needpay = new Double(WxRentContractHelper.getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod,false)).longValue(); | |||||
| needpay = new Double(WxRentContractHelper.getMonthNeedPay(wxRentContract.getDecimalSize(),priceD, startDate, endDate,dayType,receivePeriod,false)).longValue(); | |||||
| } | } | ||||
| }else if(i == 0){//第一期 | }else if(i == 0){//第一期 | ||||
| if(wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())){ | if(wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())){ | ||||
| if(isFirstDay(startDate)){ | if(isFirstDay(startDate)){ | ||||
| int months = WxRentContractHelper.getMonths(sdM.format(startDate)+"-01",sdM.format(endDate)+"-01"); | int months = WxRentContractHelper.getMonths(sdM.format(startDate)+"-01",sdM.format(endDate)+"-01"); | ||||
| months++; | months++; | ||||
| needpay = new Double(months * priceD).longValue(); | |||||
| needpay = new BigDecimal(months).multiply(priceD).longValue(); | |||||
| }else{ | }else{ | ||||
| needpay = new Double(WxRentContractHelper.getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod,false)).longValue(); | |||||
| needpay = new Double(WxRentContractHelper.getMonthNeedPay(wxRentContract.getDecimalSize(),priceD, startDate, endDate,dayType,receivePeriod,false)).longValue(); | |||||
| } | } | ||||
| }else{ | }else{ | ||||
| if(isFirstDay(startDate)){ | if(isFirstDay(startDate)){ | ||||
| @@ -796,9 +796,9 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| if(isFirstDay(startDate)){ | if(isFirstDay(startDate)){ | ||||
| months++; | months++; | ||||
| } | } | ||||
| needpay = new Double(months * priceD).longValue(); | |||||
| needpay = new BigDecimal(months).multiply(priceD).longValue(); | |||||
| }else{ | }else{ | ||||
| needpay = new Double(WxRentContractHelper.getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod,false)).longValue(); | |||||
| needpay = new Double(WxRentContractHelper.getMonthNeedPay(wxRentContract.getDecimalSize(),priceD, startDate, endDate,dayType,receivePeriod,false)).longValue(); | |||||
| } | } | ||||
| } | } | ||||
| }else{//中间 | }else{//中间 | ||||
| @@ -806,7 +806,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| if(isFirstDay(startDate)){ | if(isFirstDay(startDate)){ | ||||
| months++; | months++; | ||||
| } | } | ||||
| needpay = new Double(months * priceD).longValue(); | |||||
| needpay = new BigDecimal(months).multiply(priceD).longValue(); | |||||
| } | } | ||||
| } | } | ||||
| return needpay; | return needpay; | ||||
| @@ -134,5 +134,7 @@ public class Constant { | |||||
| public static final Integer dy_business = 2; | public static final Integer dy_business = 2; | ||||
| public static final String cache_aliyun_msg ="aliyunMsg:"; | public static final String cache_aliyun_msg ="aliyunMsg:"; | ||||
| public static final Integer default_long_decimal_size = 10; | |||||
| } | } | ||||
| @@ -94,16 +94,13 @@ | |||||
| <select id="queryBillDepositList" parameterType="com.iformall.domain.po.WxBillDeposit" resultMap="BaseResultMap"> | <select id="queryBillDepositList" parameterType="com.iformall.domain.po.WxBillDeposit" resultMap="BaseResultMap"> | ||||
| select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day`, | select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day`, | ||||
| br.`owe`,br.`status`,br.`need_pay`,m.`name` merchant_name,s.shop_number,br.`updatetime`,br.`merchant_id`, | |||||
| br.`apply_status`,br.`apply_pay_img`,br.`apply_update_time`, | |||||
| br.`owe`,br.`status`,br.`need_pay`,br.`updatetime`,br.`merchant_id`,br.`apply_status`,br.`apply_pay_img`,br.`apply_update_time`, | |||||
| br.`rent_shop_type`,br.`return_price`, br.pay_way,br.shop_info ,br.freeze,br.service_charge_pay | br.`rent_shop_type`,br.`return_price`, br.pay_way,br.shop_info ,br.freeze,br.service_charge_pay | ||||
| from wx_bill_rent_deposit br left join wx_merchant m on br.merchant_id=m.id | |||||
| left join wx_shop s on br.shop_id=s.id | |||||
| from wx_bill_rent_deposit br | |||||
| <where> | <where> | ||||
| 1 = 1 | 1 = 1 | ||||
| <if test=" null != id ">and br.`id` = #{id}</if> | <if test=" null != id ">and br.`id` = #{id}</if> | ||||
| <if test=" null != merchantId ">and br.`merchant_id` = #{merchantId}</if> | <if test=" null != merchantId ">and br.`merchant_id` = #{merchantId}</if> | ||||
| <if test=" null != merchantName and ''!=merchantName ">and m.`name` like concat('%',#{merchantName},'%')</if> | |||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||
| and br.`tenant_id` = #{tenantId} | and br.`tenant_id` = #{tenantId} | ||||
| </if> | </if> | ||||
| @@ -116,6 +113,12 @@ | |||||
| <if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if> | <if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if> | ||||
| <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 != merchantIds "> | |||||
| and br.`merchant_id` in | |||||
| <foreach collection="merchantIds" index="index" item="midItem" open="(" separator="," close=")"> | |||||
| #{midItem} | |||||
| </foreach> | |||||
| </if> | |||||
| </where> | </where> | ||||
| order by br.id desc | order by br.id desc | ||||
| </select> | </select> | ||||
| @@ -92,15 +92,11 @@ | |||||
| <include refid="dynamicWhereConditions" /> | <include refid="dynamicWhereConditions" /> | ||||
| </select> | </select> | ||||
| <select id="queryBillDepositList" parameterType="com.iformall.domain.po.WxBillPropertyDeposit" | |||||
| resultMap="BaseResultMap"> | |||||
| select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`, | |||||
| br.`pay_date`,br.`createtime`,br.`expired_day`,br.`owe`,br.`status`, | |||||
| br.`need_pay`,m.`name` merchant_name,s.shop_number,br.`updatetime`, | |||||
| br.`merchant_id`,br.`rent_shop_type`,br.`return_price`,br.`shop_info`,br.pay_way, | |||||
| <select id="queryBillDepositList" parameterType="com.iformall.domain.po.WxBillPropertyDeposit" resultMap="BaseResultMap"> | |||||
| select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day`,br.`owe`,br.`status`, | |||||
| br.`need_pay`,br.`updatetime`,br.`merchant_id`,br.`rent_shop_type`,br.`return_price`,br.`shop_info`,br.pay_way, | |||||
| br.freeze,br.service_charge_pay,br.`apply_status`,br.`apply_pay_img`,br.`apply_update_time` | br.freeze,br.service_charge_pay,br.`apply_status`,br.`apply_pay_img`,br.`apply_update_time` | ||||
| from wx_bill_property_deposit br left join wx_merchant m on br.merchant_id=m.id | |||||
| left join wx_shop s on br.shop_id=s.id | |||||
| from wx_bill_property_deposit br | |||||
| <where> | <where> | ||||
| <if test=" null != id ">and br.`id` = #{id}</if> | <if test=" null != id ">and br.`id` = #{id}</if> | ||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||
| @@ -110,14 +106,18 @@ | |||||
| and br.`parent_tenant_id` = #{parentTenantId} | and br.`parent_tenant_id` = #{parentTenantId} | ||||
| </if> | </if> | ||||
| <if test=" null != merchantId ">and br.`merchant_id` = #{merchantId}</if> | <if test=" null != merchantId ">and br.`merchant_id` = #{merchantId}</if> | ||||
| <if test=" null != merchantName and ''!=merchantName ">and m.`name` like concat('%',#{merchantName},'%')</if> | |||||
| <if test=" null != status ">and br.`status` = #{status}</if> | <if test=" null != status ">and br.`status` = #{status}</if> | ||||
| <if test=" null != applyStatus ">and br.`apply_status` = #{applyStatus}</if> | <if test=" null != applyStatus ">and br.`apply_status` = #{applyStatus}</if> | ||||
| <if test=" null != isDel ">and br.`is_del` = #{isDel}</if> | <if test=" null != isDel ">and br.`is_del` = #{isDel}</if> | ||||
| <if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if> | <if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if> | ||||
| <if test=" null != propertyContractId ">and br.`property_contract_id` = #{propertyContractId}</if> | <if test=" null != propertyContractId ">and br.`property_contract_id` = #{propertyContractId}</if> | ||||
| <if test=" null != payWay ">and br.`pay_way` = #{payWay}</if> | <if test=" null != payWay ">and br.`pay_way` = #{payWay}</if> | ||||
| <if test=" null != merchantIds "> | |||||
| and br.`merchant_id` in | |||||
| <foreach collection="merchantIds" index="index" item="midItem" open="(" separator="," close=")"> | |||||
| #{midItem} | |||||
| </foreach> | |||||
| </if> | |||||
| </where> | </where> | ||||
| order by id desc | order by id desc | ||||
| </select> | </select> | ||||