Browse Source

fix

release_toaliyun_real
winter 2 years ago
parent
commit
b7bdd6c36f
5 changed files with 110 additions and 27 deletions
  1. +12
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillOtherDepositController.java
  2. +3
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxBillOtherDeposit.java
  3. +2
    -1
      mallinkService/src/main/java/com/iformall/service/WxBillOtherDepositService.java
  4. +84
    -21
      mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherDepositServiceImpl.java
  5. +9
    -4
      mallinkService/src/main/resources/mapper/WxBillOtherDepositMapper.xml

+ 12
- 1
mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillOtherDepositController.java View File

@@ -7,6 +7,7 @@ import com.iformall.common.ResultData;
import com.iformall.controller.base.BaseController; import com.iformall.controller.base.BaseController;
import com.iformall.domain.po.MallUserInfo; import com.iformall.domain.po.MallUserInfo;
import com.iformall.domain.po.WxBillOtherDeposit; import com.iformall.domain.po.WxBillOtherDeposit;
import com.iformall.domain.po.WxUserDataRule;
import com.iformall.service.WxBillOtherDepositService; import com.iformall.service.WxBillOtherDepositService;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
@@ -39,6 +40,11 @@ public class WxBillOtherDepositController extends BaseController {
if (null == wxBillOtherDeposit) { if (null == wxBillOtherDeposit) {
wxBillOtherDeposit = new WxBillOtherDeposit(); wxBillOtherDeposit = new WxBillOtherDeposit();
} }
WxUserDataRule dataRule = this.getCurrentDataFloors();
if (null != dataRule) {
wxBillOtherDeposit.setFloorForRule(dataRule.getFloorForRule());
wxBillOtherDeposit.setBusinessForRule(dataRule.getBusinessForRule());
}
wxBillOtherDeposit.updateTenantInfo(getTenantInfo()); wxBillOtherDeposit.updateTenantInfo(getTenantInfo());
final PageInfo<WxBillOtherDeposit> page = wxBillOtherDepositService.listAsPage(wxBillOtherDeposit, pageNum, pageSize); final PageInfo<WxBillOtherDeposit> page = wxBillOtherDepositService.listAsPage(wxBillOtherDeposit, pageNum, pageSize);
return new ResultData(page); return new ResultData(page);
@@ -78,7 +84,7 @@ public class WxBillOtherDepositController extends BaseController {
@SystemControllerLog(description = "其它押金账单-查询") @SystemControllerLog(description = "其它押金账单-查询")
public ResultData findById(Long id) { public ResultData findById(Long id) {
logger.debug("[" + getIpAddr() + "] WxBillOtherDepositController::findById"); logger.debug("[" + getIpAddr() + "] WxBillOtherDepositController::findById");
return new ResultData(Result.SUCCESS, "查询成功", wxBillOtherDepositService.getById(id));
return new ResultData(Result.SUCCESS, "查询成功", wxBillOtherDepositService.getById(this.getTenantInfo(),id));
} }


@GetMapping("/updatePaid") @GetMapping("/updatePaid")
@@ -108,6 +114,11 @@ public class WxBillOtherDepositController extends BaseController {
@SystemControllerLog(description = "其它押金账单-导出") @SystemControllerLog(description = "其它押金账单-导出")
public void exportBill(@ModelAttribute WxBillOtherDeposit wxBillDeposit, HttpServletRequest request, HttpServletResponse response) { public void exportBill(@ModelAttribute WxBillOtherDeposit wxBillDeposit, HttpServletRequest request, HttpServletResponse response) {
wxBillDeposit.updateTenantInfo(getTenantInfo()); wxBillDeposit.updateTenantInfo(getTenantInfo());
WxUserDataRule dataRule = this.getCurrentDataFloors();
if (null != dataRule) {
wxBillDeposit.setFloorForRule(dataRule.getFloorForRule());
wxBillDeposit.setBusinessForRule(dataRule.getBusinessForRule());
}
wxBillOtherDepositService.exportBill(request, response, wxBillDeposit); wxBillOtherDepositService.exportBill(request, response, wxBillDeposit);
} }




+ 3
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxBillOtherDeposit.java View File

@@ -163,4 +163,7 @@ public class WxBillOtherDeposit extends TenantEntity {
public String getRealReceivePayStr() { public String getRealReceivePayStr() {
return new BigDecimal(realReceivePay == null ? 0 : realReceivePay).divide(new BigDecimal(100)).toPlainString(); return new BigDecimal(realReceivePay == null ? 0 : realReceivePay).divide(new BigDecimal(100)).toPlainString();
} }
@TableField(exist = false)
private List<Long> merchantIds;
} }

+ 2
- 1
mallinkService/src/main/java/com/iformall/service/WxBillOtherDepositService.java View File

@@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo;
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.WxBillOtherDeposit; import com.iformall.domain.po.WxBillOtherDeposit;
import com.iformall.domain.po.base.TenantEntity;


import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@@ -31,7 +32,7 @@ public interface WxBillOtherDepositService {
* @param id * @param id
* @return * @return
*/ */
WxBillOtherDeposit getById(Long id);
WxBillOtherDeposit getById(TenantEntity tenantEntity,Long id);


/** /**
* 保存或更新实体 * 保存或更新实体


+ 84
- 21
mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherDepositServiceImpl.java View File

@@ -9,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.WxBillDaily;
import com.iformall.domain.po.WxBillOtherDeposit; 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.base.TenantEntity;
import com.iformall.enums.*; import com.iformall.enums.*;
import com.iformall.exception.MallinkException; import com.iformall.exception.MallinkException;
import com.iformall.mapper.WxBillOtherDepositMapper; import com.iformall.mapper.WxBillOtherDepositMapper;
@@ -19,17 +22,23 @@ import com.iformall.mapper.WxShopMapper;
import com.iformall.service.ExcelService; import com.iformall.service.ExcelService;
import com.iformall.service.WxBillActionService; import com.iformall.service.WxBillActionService;
import com.iformall.service.WxBillOtherDepositService; import com.iformall.service.WxBillOtherDepositService;
import com.iformall.service.WxMerchantService;
import com.iformall.service.WxPayAccountBillService; import com.iformall.service.WxPayAccountBillService;
import com.iformall.utils.DateUtils; import com.iformall.utils.DateUtils;

import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
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;


import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@@ -59,23 +68,75 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService


@Autowired @Autowired
WxPayAccountBillService wxPayAccountBillService; WxPayAccountBillService wxPayAccountBillService;
@Lazy
@Autowired
WxMerchantService wxMerchantService;


@Override @Override
public PageInfo<WxBillOtherDeposit> listAsPage(WxBillOtherDeposit record, Integer pageIndex, Integer pageSize) { public PageInfo<WxBillOtherDeposit> listAsPage(WxBillOtherDeposit record, Integer pageIndex, Integer pageSize) {
WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(record); WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(record);
//分页对象设置页数和条数
PageHelper.startPage(pageIndex, pageSize);
//查询
List<WxBillOtherDeposit> billList = wxBillOtherDepositMapper.queryBillList(record);
billList.stream().forEach(e->{
//手续费 = 合同应收+手续费+滞纳金
computeTotalMoney(wxPayAccountBill, e);
});
//结果放入分页对象
PageInfo<WxBillOtherDeposit> pageInfo = new PageInfo<>(billList);
return pageInfo;
return getBillRentPropertyList(pageIndex, pageSize, record, wxPayAccountBill);


} }
private PageInfo<WxBillOtherDeposit> getBillRentPropertyList(Integer pageIndex, Integer pageSize,WxBillOtherDeposit record,WxPayAccountBill wxPayAccountBill) {
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<WxBillOtherDeposit> page = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxBillOtherDepositMapper.queryBillList(record));
if (null == page) {
return null;
}
WxMerchant wq = new WxMerchant();
wq.updateTenantInfo(record);
Map<Long,WxMerchant> merchantMap = wxMerchantService.findMerchantMap(wq);
if (null != page.getList()) {
for (int i = 0 ; i < page.getList().size() ; i ++) {
WxBillOtherDeposit e = page.getList().get(i);
//手续费 = 合同应收+手续费+滞纳金
computeTotalMoney(wxPayAccountBill, e);
if (null != e.getMerchantId()) {
WxMerchant m = merchantMap.get(e.getMerchantId());
if (null != m ) {
e.setMerchantName(m.getName());
}
}
}
}
return page;
}


public void computeTotalMoney(WxPayAccountBill wxPayAccountBill, WxBillOtherDeposit e) { public void computeTotalMoney(WxPayAccountBill wxPayAccountBill, WxBillOtherDeposit e) {
if (e.getReceivePay() != null) { if (e.getReceivePay() != null) {
@@ -136,12 +197,12 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService
} }


@Override @Override
public WxBillOtherDeposit getById(Long id) {
public WxBillOtherDeposit getById(TenantEntity tenantEntity,Long id) {
WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(tenantEntity);
WxBillOtherDeposit record = new WxBillOtherDeposit(); WxBillOtherDeposit record = new WxBillOtherDeposit();
record.setId(id); record.setId(id);
WxBillOtherDeposit wxBillOther = wxBillOtherDepositMapper.queryBillList(record).get(0);
WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(wxBillOther);
computeTotalMoney(wxPayAccountBill, wxBillOther);
record.updateTenantInfo(tenantEntity);
WxBillOtherDeposit wxBillOther = getBillRentPropertyList(1, 10000, record, wxPayAccountBill).getList().get(0);
wxBillOther.setOwe(wxBillOther.getRealReceivePay() - wxBillOther.getPay()); wxBillOther.setOwe(wxBillOther.getRealReceivePay() - wxBillOther.getPay());
wxBillOther.setMerchant(wxMerchantMapper.selectById(wxBillOther.getMerchantId())); wxBillOther.setMerchant(wxMerchantMapper.selectById(wxBillOther.getMerchantId()));
// if (wxBillOther.getShopId() != null) { // if (wxBillOther.getShopId() != null) {
@@ -345,12 +406,14 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService
@Override @Override
public void exportBill(HttpServletRequest request, HttpServletResponse response, WxBillOtherDeposit wxBillDeposit) { public void exportBill(HttpServletRequest request, HttpServletResponse response, WxBillOtherDeposit wxBillDeposit) {
WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(wxBillDeposit); WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(wxBillDeposit);
List<WxBillOtherDeposit> datalist = wxBillOtherDepositMapper.queryBillList(wxBillDeposit);
datalist.stream().forEach(e->{
//手续费 = 合同应收+手续费+滞纳金
computeTotalMoney(wxPayAccountBill, e);
});
excelService.exportExcel(datalist, null, "其他押金账单", WxBillOtherDeposit.class, "其他押金账单.xlsx", response, false);
PageInfo<WxBillOtherDeposit> datalist = getBillRentPropertyList(1, 10000, wxBillDeposit, wxPayAccountBill);
List<WxBillOtherDeposit> list = null;
if (null != datalist && null != datalist.getList()) {
list = datalist.getList();
}else {
list = new ArrayList<WxBillOtherDeposit>();
}
excelService.exportExcel(list, null, "其他押金账单", WxBillOtherDeposit.class, "其他押金账单.xlsx", response, false);
} }






+ 9
- 4
mallinkService/src/main/resources/mapper/WxBillOtherDepositMapper.xml View File

@@ -89,15 +89,13 @@
<select id="queryBillList" parameterType="com.iformall.domain.po.WxBillOtherDeposit" resultMap="BaseResultMap"> <select id="queryBillList" parameterType="com.iformall.domain.po.WxBillOtherDeposit" 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`,m.`name` merchant_name,br.shop_name,br.`updatetime`,br.`return_price`,br.`merchant_id`,
br.`apply_status`,br.`apply_pay_img`,br.`apply_update_time`,
br.`owe`,br.`status`,br.shop_name,br.`updatetime`,br.`return_price`,br.`merchant_id`,br.`apply_status`,br.`apply_pay_img`,br.`apply_update_time`,
br.shop_id,br.name,br.comments,br.`rent_shop_type`,br.pay_way,br.`starttime`,br.`endtime`,br.freeze,br.service_charge_pay br.shop_id,br.name,br.comments,br.`rent_shop_type`,br.pay_way,br.`starttime`,br.`endtime`,br.freeze,br.service_charge_pay
from wx_bill_other_deposit br left join wx_merchant m on br.merchant_id=m.id
from wx_bill_other_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 != freeze ">and br.`freeze` = #{freeze}</if> <if test=" null != freeze ">and br.`freeze` = #{freeze}</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>
@@ -106,6 +104,13 @@
<if test=" null != payWay ">and br.`pay_way` = #{payWay}</if> <if test=" null != payWay ">and br.`pay_way` = #{payWay}</if>
<if test=" null != comments and ''!=comments">and br.`comments` like concat('%',#{comments},'%')</if> <if test=" null != comments and ''!=comments">and br.`comments` like concat('%',#{comments},'%')</if>
<if test=" null != starttime and null!=endtime ">and br.`receive_date` between #{starttime} and #{endtime}</if> <if test=" null != starttime and null!=endtime ">and br.`receive_date` between #{starttime} and #{endtime}</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>
<if test=" null != sortColumns"> order by ${sortColumns} </if> <if test=" null != sortColumns"> order by ${sortColumns} </if>
<if test=" null == sortColumns"> order by id desc </if> <if test=" null == sortColumns"> order by id desc </if>


Loading…
Cancel
Save