Просмотр исходного кода

Merge commit 'ee3cfdb7e782b23d31b6beb8d70fcdba30f82764' into release

release_toaliyun_real
luozukai 6 лет назад
Родитель
Сommit
68a8e68865
3 измененных файлов: 42 добавлений и 43 удалений
  1. +11
    -6
      mallinkService/src/main/java/com/iformall/service/impl/WxBillSettleServiceImpl.java
  2. +22
    -29
      mallinkService/src/main/java/com/iformall/service/impl/WxBusinessServiceImpl.java
  3. +9
    -8
      mallinkService/src/main/resources/mapper/WxBillSettleBillMapper.xml

+ 11
- 6
mallinkService/src/main/java/com/iformall/service/impl/WxBillSettleServiceImpl.java Просмотреть файл

@@ -187,7 +187,7 @@ public class WxBillSettleServiceImpl implements WxBillSettleService {
if(EnumBillRentStatus.PAID.getCode().equals(status)){ if(EnumBillRentStatus.PAID.getCode().equals(status)){
WxBillDeposit dbBill = wxBillDepositMapper.selectByPrimaryKey(wxBillRent.getId()); WxBillDeposit dbBill = wxBillDepositMapper.selectByPrimaryKey(wxBillRent.getId());
if(dbBill!=null) { if(dbBill!=null) {
wxBillRent.setPay(dbBill.getOwe());
wxBillRent.setPay(dbBill.getReceivePay()); //押金是ReceivePay
wxBillRent.setPayDate(new Date()); wxBillRent.setPayDate(new Date());
addBillAction(bill.getBillId(), dbBill.getOwe()); addBillAction(bill.getBillId(), dbBill.getOwe());
} }
@@ -204,7 +204,7 @@ public class WxBillSettleServiceImpl implements WxBillSettleService {
if(EnumBillRentStatus.PAID.getCode().equals(status)){ if(EnumBillRentStatus.PAID.getCode().equals(status)){
WxBillOtherDeposit dbBill = wxBillOtherDepositMapper.selectByPrimaryKey(wxBillRent.getId()); WxBillOtherDeposit dbBill = wxBillOtherDepositMapper.selectByPrimaryKey(wxBillRent.getId());
if(dbBill!=null) { if(dbBill!=null) {
wxBillOtherDeposit.setPay(dbBill.getOwe());
wxBillOtherDeposit.setPay(dbBill.getReceivePay());
wxBillOtherDeposit.setPayDate(new Date()); wxBillOtherDeposit.setPayDate(new Date());
addBillAction(bill.getBillId(), dbBill.getOwe()); addBillAction(bill.getBillId(), dbBill.getOwe());
} }
@@ -221,7 +221,7 @@ public class WxBillSettleServiceImpl implements WxBillSettleService {
if(EnumBillRentStatus.PAID.getCode().equals(status)){ if(EnumBillRentStatus.PAID.getCode().equals(status)){
WxBillPropertyDeposit dbBill = wxBillPropertyDepositMapper.selectByPrimaryKey(wxBillRent.getId()); WxBillPropertyDeposit dbBill = wxBillPropertyDepositMapper.selectByPrimaryKey(wxBillRent.getId());
if(dbBill!=null) { if(dbBill!=null) {
propertyDeposit.setPay(dbBill.getOwe());
propertyDeposit.setPay(dbBill.getReceivePay());
propertyDeposit.setPayDate(new Date()); propertyDeposit.setPayDate(new Date());
addBillAction(bill.getBillId(), dbBill.getOwe()); addBillAction(bill.getBillId(), dbBill.getOwe());
} }
@@ -256,7 +256,7 @@ public class WxBillSettleServiceImpl implements WxBillSettleService {
if(EnumBillRentStatus.PAID.getCode().equals(status)){ if(EnumBillRentStatus.PAID.getCode().equals(status)){
WxBillPropertyDeposit dbBill = wxBillPropertyDepositMapper.selectByPrimaryKey(wxBillRent.getId()); WxBillPropertyDeposit dbBill = wxBillPropertyDepositMapper.selectByPrimaryKey(wxBillRent.getId());
if(dbBill!=null) { if(dbBill!=null) {
propertyDeposit.setPay(dbBill.getOwe());
propertyDeposit.setPay(dbBill.getReceivePay());
propertyDeposit.setPayDate(new Date()); propertyDeposit.setPayDate(new Date());
addBillAction(bill.getBillId(), dbBill.getOwe()); addBillAction(bill.getBillId(), dbBill.getOwe());
} }
@@ -290,7 +290,7 @@ public class WxBillSettleServiceImpl implements WxBillSettleService {
if(EnumBillRentStatus.PAID.getCode().equals(status)){ if(EnumBillRentStatus.PAID.getCode().equals(status)){
WxBillOtherDeposit dbBill = wxBillOtherDepositMapper.selectByPrimaryKey(wxBillRent.getId()); WxBillOtherDeposit dbBill = wxBillOtherDepositMapper.selectByPrimaryKey(wxBillRent.getId());
if(dbBill!=null) { if(dbBill!=null) {
wxBillRent.setPay(dbBill.getOwe());
wxBillRent.setPay(dbBill.getReceivePay());
wxBillRent.setPayDate(new Date()); wxBillRent.setPayDate(new Date());
addBillAction(bill.getBillId(), dbBill.getOwe()); addBillAction(bill.getBillId(), dbBill.getOwe());
} }
@@ -315,7 +315,7 @@ public class WxBillSettleServiceImpl implements WxBillSettleService {
if(EnumBillRentStatus.PAID.getCode().equals(status)){ if(EnumBillRentStatus.PAID.getCode().equals(status)){
WxBillOtherDeposit dbBill = wxBillOtherDepositMapper.selectByPrimaryKey(wxBillRent.getId()); WxBillOtherDeposit dbBill = wxBillOtherDepositMapper.selectByPrimaryKey(wxBillRent.getId());
if(dbBill!=null) { if(dbBill!=null) {
wxBillRent.setPay(dbBill.getOwe());
wxBillRent.setPay(dbBill.getReceivePay());
wxBillRent.setPayDate(new Date()); wxBillRent.setPayDate(new Date());
addBillAction(bill.getBillId(), dbBill.getOwe()); addBillAction(bill.getBillId(), dbBill.getOwe());
} }
@@ -364,6 +364,10 @@ public class WxBillSettleServiceImpl implements WxBillSettleService {
public ResultData saveOrUpdate(WxBillSettle record, MallUserInfo userInfo) { public ResultData saveOrUpdate(WxBillSettle record, MallUserInfo userInfo) {
final IdWorker idWorker = IdWorker.get(); final IdWorker idWorker = IdWorker.get();


//检查账单是否存在其他结算单中



if (record.getFlowParams() == null || record.getFlowParams().size() == 0) { if (record.getFlowParams() == null || record.getFlowParams().size() == 0) {
record.setStatus(EnumSettleStatus.NOT_FINISH.getCode()); record.setStatus(EnumSettleStatus.NOT_FINISH.getCode());
//选择的账单改为已结清 //选择的账单改为已结清
@@ -434,3 +438,4 @@ public class WxBillSettleServiceImpl implements WxBillSettleService {


} }
} }


+ 22
- 29
mallinkService/src/main/java/com/iformall/service/impl/WxBusinessServiceImpl.java Просмотреть файл

@@ -3,17 +3,16 @@ package com.iformall.service.impl;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.iformall.common.ResultData; import com.iformall.common.ResultData;
import com.iformall.domain.po.*;
import com.iformall.domain.po.WxBusiness;
import com.iformall.domain.po.WxPropertyContract;
import com.iformall.domain.po.WxRentContract;
import com.iformall.enums.*; import com.iformall.enums.*;
import com.iformall.mapper.WxBusinessMapper; import com.iformall.mapper.WxBusinessMapper;
import com.iformall.mapper.WxPropertyContractMapper; import com.iformall.mapper.WxPropertyContractMapper;
import com.iformall.mapper.WxRentContractMapper; import com.iformall.mapper.WxRentContractMapper;
import com.iformall.service.WxBusinessService; import com.iformall.service.WxBusinessService;
import com.iformall.service.WxPropertyContractService;
import com.iformall.service.WxRentContractService;
import com.iformall.utils.DateUtils; import com.iformall.utils.DateUtils;
import org.apache.commons.collections.CollectionUtils; 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;
@@ -34,11 +33,7 @@ public class WxBusinessServiceImpl implements WxBusinessService {
@Autowired @Autowired
private WxRentContractMapper wxRentContractMapper; private WxRentContractMapper wxRentContractMapper;
@Autowired @Autowired
private WxRentContractService wxRentContractService;
@Autowired
private WxPropertyContractMapper wxPropertyContractMapper; private WxPropertyContractMapper wxPropertyContractMapper;
@Autowired
private WxPropertyContractService wxPropertyContractService;


@Override @Override
public PageInfo<WxBusiness> listAsPage(WxBusiness record, Integer pageIndex, Integer pageSize) { public PageInfo<WxBusiness> listAsPage(WxBusiness record, Integer pageIndex, Integer pageSize) {
@@ -69,23 +64,22 @@ public class WxBusinessServiceImpl implements WxBusinessService {
} }


@Override @Override
public List<Map<String,Object>> businessDataList(WxBusiness wxBusiness, Long userid) {
public List<Map<String, Object>> businessDataList(WxBusiness wxBusiness, Long userid) {
//1 得到天数+1 //1 得到天数+1
int day = DateUtils.daysBetween(wxBusiness.getStartdate(), wxBusiness.getEnddate()) + 1; int day = DateUtils.daysBetween(wxBusiness.getStartdate(), wxBusiness.getEnddate()) + 1;
List<Map<String,Object>> resultList = wxBusinessMapper.businessDataList(wxBusiness);
resultList.stream().forEach(e->{
List<Map<String, Object>> resultList = wxBusinessMapper.businessDataList(wxBusiness);
resultList.stream().forEach(e -> {
BigDecimal businessSumMoney = new BigDecimal(0); BigDecimal businessSumMoney = new BigDecimal(0);
WxRentContract query = new WxRentContract(); WxRentContract query = new WxRentContract();
query.setBusinessId((Integer) e.get("id")); query.setBusinessId((Integer) e.get("id"));
List<WxRentContract> rentContractList = wxRentContractMapper.select(query); List<WxRentContract> rentContractList = wxRentContractMapper.select(query);
for (WxRentContract dbRent:rentContractList ) {
if (StringUtils.isBlank(dbRent.getRentInfo()) ||
dbRent.getStatus().equals(EnumRentContractStatus.INTENTION.getCode()) ||
for (WxRentContract dbRent : rentContractList) {
if (dbRent.getStatus().equals(EnumRentContractStatus.INTENTION.getCode()) ||
dbRent.getStatus().equals(EnumRentContractStatus.WAIT_SIGN.getCode()) || dbRent.getStatus().equals(EnumRentContractStatus.WAIT_SIGN.getCode()) ||
dbRent.getStatus().equals(EnumRentContractStatus.CONTRACT_END.getCode()) || dbRent.getStatus().equals(EnumRentContractStatus.CONTRACT_END.getCode()) ||
dbRent.getStatus().equals(EnumRentContractStatus.CONTRACT_TERMINATE.getCode()) || dbRent.getStatus().equals(EnumRentContractStatus.CONTRACT_TERMINATE.getCode()) ||
dbRent.getStatus().equals(EnumRentContractStatus.INVALID.getCode())) { dbRent.getStatus().equals(EnumRentContractStatus.INVALID.getCode())) {
System.out.println("rent rentInfo is null:{}"+dbRent.getId());
System.out.println("rent rentInfo is null:{}" + dbRent.getId());
continue; continue;
} }
Long price = dbRent.getPrice(); Long price = dbRent.getPrice();
@@ -100,14 +94,13 @@ public class WxBusinessServiceImpl implements WxBusinessService {
WxPropertyContract pquery = new WxPropertyContract(); WxPropertyContract pquery = new WxPropertyContract();
pquery.setBusinessId((Integer) e.get("id")); pquery.setBusinessId((Integer) e.get("id"));
List<WxPropertyContract> propertyContractList = wxPropertyContractMapper.select(pquery); List<WxPropertyContract> propertyContractList = wxPropertyContractMapper.select(pquery);
for (WxPropertyContract dbRent:propertyContractList) {
if (StringUtils.isBlank(dbRent.getRentInfo()) ||
dbRent.getStatus().equals(EnumRentContractStatus.INTENTION.getCode()) ||
for (WxPropertyContract dbRent : propertyContractList) {
if (dbRent.getStatus().equals(EnumRentContractStatus.INTENTION.getCode()) ||
dbRent.getStatus().equals(EnumRentContractStatus.WAIT_SIGN.getCode()) || dbRent.getStatus().equals(EnumRentContractStatus.WAIT_SIGN.getCode()) ||
dbRent.getStatus().equals(EnumRentContractStatus.CONTRACT_END.getCode()) || dbRent.getStatus().equals(EnumRentContractStatus.CONTRACT_END.getCode()) ||
dbRent.getStatus().equals(EnumRentContractStatus.CONTRACT_TERMINATE.getCode()) || dbRent.getStatus().equals(EnumRentContractStatus.CONTRACT_TERMINATE.getCode()) ||
dbRent.getStatus().equals(EnumRentContractStatus.INVALID.getCode())) { dbRent.getStatus().equals(EnumRentContractStatus.INVALID.getCode())) {
System.out.println("property rentInfo is null:{}"+dbRent.getId());
System.out.println("property rentInfo is null:{}" + dbRent.getId());
continue; continue;
} }
logger.info("业态分析>>>>>>>>>>>>>>>>>>物业合同ID:" + dbRent.getId()); logger.info("业态分析>>>>>>>>>>>>>>>>>>物业合同ID:" + dbRent.getId());
@@ -119,8 +112,8 @@ public class WxBusinessServiceImpl implements WxBusinessService {
logger.info("业态分析>>>>>>>>>>>>>>>>>>商铺面积:" + e.get("area").toString()); logger.info("业态分析>>>>>>>>>>>>>>>>>>商铺面积:" + e.get("area").toString());
if (e.get("area") == null || "0".equals(e.get("area").toString()) || if (e.get("area") == null || "0".equals(e.get("area").toString()) ||
"0.0".equals(e.get("area").toString())) { "0.0".equals(e.get("area").toString())) {
e.put("rent",0);
}else {
e.put("rent", 0);
} else {
BigDecimal area = new BigDecimal(e.get("area").toString()); BigDecimal area = new BigDecimal(e.get("area").toString());
if (area.doubleValue() > 0) { if (area.doubleValue() > 0) {
BigDecimal areaRatio = businessSumMoney.divide(area, 2, BigDecimal.ROUND_HALF_UP).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP); BigDecimal areaRatio = businessSumMoney.divide(area, 2, BigDecimal.ROUND_HALF_UP).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP);
@@ -162,9 +155,9 @@ public class WxBusinessServiceImpl implements WxBusinessService {
wxBusiness.setLimitStart(0); wxBusiness.setLimitStart(0);
wxBusiness.setLimitEnd(Integer.MAX_VALUE); wxBusiness.setLimitEnd(Integer.MAX_VALUE);
List totalList = wxBusinessMapper.devoteList(wxBusiness); List totalList = wxBusinessMapper.devoteList(wxBusiness);
if(CollectionUtils.isEmpty(totalList)){
if (CollectionUtils.isEmpty(totalList)) {
PageHelper.startPage(pageNum, pageSize); PageHelper.startPage(pageNum, pageSize);
PageInfo<List<Map<String,Object>>> pageInfo = new PageInfo(new ArrayList());
PageInfo<List<Map<String, Object>>> pageInfo = new PageInfo(new ArrayList());
pageInfo.setPages(0); pageInfo.setPages(0);
pageInfo.setTotal(0); pageInfo.setTotal(0);
PageHelper.clearPage(); PageHelper.clearPage();
@@ -173,17 +166,17 @@ public class WxBusinessServiceImpl implements WxBusinessService {


int total = totalList.size(); int total = totalList.size();
int pages; int pages;
if(total % pageSize == 0){
if (total % pageSize == 0) {
pages = total / pageSize; pages = total / pageSize;
}else{
pages = total / pageSize +1;
} else {
pages = total / pageSize + 1;
} }
wxBusiness.setLimitStart((pageNum -1) * pageSize);
wxBusiness.setLimitStart((pageNum - 1) * pageSize);
wxBusiness.setLimitEnd(pageSize); wxBusiness.setLimitEnd(pageSize);
List<Map<String,Object>> list = wxBusinessMapper.devoteList(wxBusiness);
List<Map<String, Object>> list = wxBusinessMapper.devoteList(wxBusiness);


PageHelper.startPage(pageNum, pageSize); PageHelper.startPage(pageNum, pageSize);
PageInfo<List<Map<String,Object>>> pageInfo = new PageInfo(list);
PageInfo<List<Map<String, Object>>> pageInfo = new PageInfo(list);
pageInfo.setPages(pages); pageInfo.setPages(pages);
pageInfo.setTotal(total); pageInfo.setTotal(total);
PageHelper.clearPage(); PageHelper.clearPage();


+ 9
- 8
mallinkService/src/main/resources/mapper/WxBillSettleBillMapper.xml Просмотреть файл

@@ -20,8 +20,8 @@
</resultMap> </resultMap>


<sql id="allColumns"> <sql id="allColumns">
`id`,`tenant_id`,`settle_id`,`type`,`bill_id`,`bill_type`
,`createtime`,`updatetime`
`id`,`tenant_id`,`settle_id`,`type`,`bill_id`,`bill_type`
,`createtime`,`updatetime`
</sql> </sql>


<sql id="dynamicWhereConditions"> <sql id="dynamicWhereConditions">
@@ -56,10 +56,10 @@
bill_type,need_pay, bill_type,need_pay,
<choose> <choose>
<when test="1==type"> <when test="1==type">
owe receive_pay
receive_pay
</when> </when>
<otherwise> <otherwise>
receive_pay
owe receive_pay
</otherwise> </otherwise>
</choose> </choose>
,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type,starttime,endtime from ,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type,starttime,endtime from
@@ -73,10 +73,10 @@
bill_type,need_pay, bill_type,need_pay,
<choose> <choose>
<when test="1==type"> <when test="1==type">
owe receive_pay
receive_pay
</when> </when>
<otherwise> <otherwise>
receive_pay
owe receive_pay
</otherwise> </otherwise>
</choose> </choose>
,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type,starttime,endtime from ,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type,starttime,endtime from
@@ -101,10 +101,10 @@
need_pay, need_pay,
<choose> <choose>
<when test="1==type"> <when test="1==type">
owe receive_pay
receive_pay
</when> </when>
<otherwise> <otherwise>
receive_pay
owe receive_pay
</otherwise> </otherwise>
</choose> </choose>
,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type,starttime,endtime from wx_bill_other_deposit ,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type,starttime,endtime from wx_bill_other_deposit
@@ -126,3 +126,4 @@


</mapper> </mapper>




Загрузка…
Отмена
Сохранить