Browse Source

fix

release_toaliyun_real
winter 1 year ago
parent
commit
6cf05624ed
5 changed files with 46 additions and 28 deletions
  1. +2
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxAllBill.java
  2. +5
    -4
      mallinkService/src/main/java/com/iformall/service/impl/WxAgileContractServiceImpl.java
  3. +24
    -12
      mallinkService/src/main/java/com/iformall/service/impl/WxAllBillServiceImpl.java
  4. +4
    -4
      mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java
  5. +11
    -8
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java

+ 2
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxAllBill.java View File

@@ -431,4 +431,6 @@ public class WxAllBill extends TenantEntity {
private List<Long> shopIdList; private List<Long> shopIdList;
@TableField(exist = false) @TableField(exist = false)
private List<Long> cusNameShopIdList; private List<Long> cusNameShopIdList;
@TableField(exist = false)
private String queryShopIdStr;
} }

+ 5
- 4
mallinkService/src/main/java/com/iformall/service/impl/WxAgileContractServiceImpl.java View File

@@ -60,6 +60,7 @@ import com.iformall.service.WxMerchantService;
import com.iformall.service.WxShopService; import com.iformall.service.WxShopService;
import com.iformall.service.helper.WxRentContractAgileHelper; import com.iformall.service.helper.WxRentContractAgileHelper;
import com.iformall.service.helper.WxRentContractHelper; import com.iformall.service.helper.WxRentContractHelper;
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;
@@ -522,7 +523,7 @@ public class WxAgileContractServiceImpl implements WxAgileContractService {
for (int j = 0 ; j < shopIdList.size(); j++ ) { for (int j = 0 ; j < shopIdList.size(); j++ ) {
Long sid = shopIdList.get(j); Long sid = shopIdList.get(j);
BigDecimal shoprentArea = shopAreaRateMap.get(sid); BigDecimal shoprentArea = shopAreaRateMap.get(sid);
BigDecimal shoprate = shoprentArea.divide(new BigDecimal(wxRentContract.getRentArea()),wxRentContract.getDecimalSize(),BigDecimal.ROUND_HALF_UP);
BigDecimal shoprate = shoprentArea.divide(new BigDecimal(wxRentContract.getRentArea()),Constant.default_long_decimal_size,BigDecimal.ROUND_HALF_UP);
String cusName = null; String cusName = null;
if (null != shopUserMap) { if (null != shopUserMap) {
WxShopUsers su = shopUserMap.get(sid); WxShopUsers su = shopUserMap.get(sid);
@@ -540,7 +541,7 @@ public class WxAgileContractServiceImpl implements WxAgileContractService {
wxBillDeposit.setCanEdit(EnumYesOrNo.NO.getCode()); wxBillDeposit.setCanEdit(EnumYesOrNo.NO.getCode());
wxBillDeposit.setPriceDetail(fees.getName()); wxBillDeposit.setPriceDetail(fees.getName());
wxBillDeposit.setPay("0"); wxBillDeposit.setPay("0");
wxBillDeposit.setReceivePay(new BigDecimal(deposit.getPrice()).multiply(shoprate).toPlainString());
wxBillDeposit.setReceivePay(new BigDecimal(deposit.getPrice()).multiply(shoprate).setScale(wxRentContract.getDecimalSize(),BigDecimal.ROUND_HALF_UP).toPlainString());
wxBillDeposit.setNeedPay(wxBillDeposit.getReceivePay()); wxBillDeposit.setNeedPay(wxBillDeposit.getReceivePay());
wxBillDeposit.setStarttime(wxRentContract.getRentalStartDate()); wxBillDeposit.setStarttime(wxRentContract.getRentalStartDate());
wxBillDeposit.setEndtime(wxRentContract.getRentalEndDate()); wxBillDeposit.setEndtime(wxRentContract.getRentalEndDate());
@@ -650,7 +651,7 @@ public class WxAgileContractServiceImpl implements WxAgileContractService {
for (int i = 0 ; i < shopIdList.size(); i++) { for (int i = 0 ; i < shopIdList.size(); i++) {
Long sid= shopIdList.get(i); Long sid= shopIdList.get(i);
BigDecimal shoprentArea = shopAreaMap.get(sid); BigDecimal shoprentArea = shopAreaMap.get(sid);
BigDecimal shoprate = shoprentArea.divide(new BigDecimal(contract.getRentArea()),contract.getDecimalSize(),BigDecimal.ROUND_HALF_UP);
BigDecimal shoprate = shoprentArea.divide(new BigDecimal(contract.getRentArea()),Constant.default_long_decimal_size,BigDecimal.ROUND_HALF_UP);
String cusName = null; String cusName = null;
if (null != shopUserMap) { if (null != shopUserMap) {
WxShopUsers su = shopUserMap.get(sid); WxShopUsers su = shopUserMap.get(sid);
@@ -658,7 +659,7 @@ public class WxAgileContractServiceImpl implements WxAgileContractService {
cusName = su.getName(); cusName = su.getName();
} }
} }
String money = new BigDecimal(needpay).multiply(shoprate).toPlainString();
String money = new BigDecimal(needpay).multiply(shoprate).setScale(contract.getDecimalSize(),BigDecimal.ROUND_HALF_UP).toPlainString();
WxAllBill bill = buildUnDepositBill(unDeposit,idWorker,contract.getId(),fees,sid,cusName,start,end,receiveDate,money,shoprentArea.toPlainString(),user); WxAllBill bill = buildUnDepositBill(unDeposit,idWorker,contract.getId(),fees,sid,cusName,start,end,receiveDate,money,shoprentArea.toPlainString(),user);
billList.add(bill); billList.add(bill);
} }


+ 24
- 12
mallinkService/src/main/java/com/iformall/service/impl/WxAllBillServiceImpl.java View File

@@ -129,18 +129,30 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill
wxBillRent.setId(-1L); wxBillRent.setId(-1L);
} }
} }
//List<Long> _sids = (List<Long>) CollectionUtils.intersection(shopIds, wxBillRent.getShopIdList());
// if (StringUtils.isNotBlank(wxBillRent.getCusName())) {
// WxShopUsers suq = new WxShopUsers();
// suq.updateTenantInfo(wxBillRent);
// suq.setName(wxBillRent.getCusName());
// List<Long> shopIds = wxShopService.getUserShopIds(suq);
// if (null != shopIds && shopIds.size() > 0 ) {
// wxBillRent.setCusNameShopIdList(shopIds);;
// }else {
// wxBillRent.setId(-1L);
// }
// }
if (StringUtils.isNotBlank(wxBillRent.getQueryShopIdStr())) {
String[] qsids = wxBillRent.getQueryShopIdStr().split(",");
if (null != qsids && qsids.length > 0 ) {
List<Long> shopIdList = new ArrayList<Long>();
for (int i = 0 ; i < qsids.length ; i ++) {
String qsid = qsids[i];
if (StringUtils.isNotBlank(qsid)) {
shopIdList.add(Long.parseLong(qsid));
}
}
if (null != shopIdList && shopIdList.size() > 0 ) {
if (null != wxBillRent.getShopIdList()) {
List<Long> _sids = (List<Long>) CollectionUtils.intersection(shopIdList, wxBillRent.getShopIdList());
if (null != _sids && _sids.size() > 0 ) {
wxBillRent.setShopIdList(_sids);
}else {
wxBillRent.setId(-1L);
}
}else {
wxBillRent.setShopIdList(shopIdList);
}
}
}
}
} }
@Override @Override


+ 4
- 4
mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java View File

@@ -722,7 +722,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
for (int i = 0 ; i < shopIds.size(); i++) { for (int i = 0 ; i < shopIds.size(); i++) {
Long shopId = shopIds.get(i); Long shopId = shopIds.get(i);
BigDecimal shoprentArea = shopAreaRateMap.get(shopId); BigDecimal shoprentArea = shopAreaRateMap.get(shopId);
BigDecimal shoprate = shoprentArea.divide(new BigDecimal(wxPropertyContract.getRentArea()),wxPropertyContract.getDecimalSize(),BigDecimal.ROUND_HALF_UP);
BigDecimal shoprate = shoprentArea.divide(new BigDecimal(wxPropertyContract.getRentArea()),Constant.default_long_decimal_size,BigDecimal.ROUND_HALF_UP);
String cusName = null; String cusName = null;
if (null != shopUserMap) { if (null != shopUserMap) {
WxShopUsers su = shopUserMap.get(shopId); WxShopUsers su = shopUserMap.get(shopId);
@@ -737,7 +737,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
wxBillDeposit.setPropertyContractId(wxPropertyContract.getId()); wxBillDeposit.setPropertyContractId(wxPropertyContract.getId());
wxBillDeposit.setPay("0"); wxBillDeposit.setPay("0");
String needpay = wxPropertyContract.getDeposit(); String needpay = wxPropertyContract.getDeposit();
wxBillDeposit.setNeedPay(new BigDecimal(needpay).multiply(shoprate).toPlainString());
wxBillDeposit.setNeedPay(new BigDecimal(needpay).multiply(shoprate).setScale(wxPropertyContract.getDecimalSize(),BigDecimal.ROUND_HALF_UP).toPlainString());
wxBillDeposit.setReceivePay(wxBillDeposit.getNeedPay()); wxBillDeposit.setReceivePay(wxBillDeposit.getNeedPay());
wxBillDeposit.setIsPreview(EnumYesOrNo.NO.getCode()); wxBillDeposit.setIsPreview(EnumYesOrNo.NO.getCode());
wxBillDeposit.setCanEdit(EnumYesOrNo.NO.getCode()); wxBillDeposit.setCanEdit(EnumYesOrNo.NO.getCode());
@@ -1076,13 +1076,13 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
private void setNewsBills(WxPropertyContract wxPropertyContract,WxAllBill newBill,WxAllBill oldBill,Long shopId,Map<Long, BigDecimal> shopAreaRateMap,Map<Long,WxShopUsers> shopUserMap) { private void setNewsBills(WxPropertyContract wxPropertyContract,WxAllBill newBill,WxAllBill oldBill,Long shopId,Map<Long, BigDecimal> shopAreaRateMap,Map<Long,WxShopUsers> shopUserMap) {
BigDecimal shoprentArea = shopAreaRateMap.get(shopId); BigDecimal shoprentArea = shopAreaRateMap.get(shopId);
BigDecimal shoprate = shoprentArea.divide(new BigDecimal(wxPropertyContract.getRentArea()),wxPropertyContract.getDecimalSize(),BigDecimal.ROUND_HALF_UP);
BigDecimal shoprate = shoprentArea.divide(new BigDecimal(wxPropertyContract.getRentArea()),Constant.default_long_decimal_size,BigDecimal.ROUND_HALF_UP);
final IdWorker idWorker = IdWorker.get(); final IdWorker idWorker = IdWorker.get();
try { try {
BeanUtils.copyProperties(newBill, oldBill); BeanUtils.copyProperties(newBill, oldBill);
newBill.setId(idWorker.nextId()); newBill.setId(idWorker.nextId());
newBill.setShopId(shopId); newBill.setShopId(shopId);
newBill.setNeedPay(new BigDecimal(oldBill.getNeedPay()).multiply(shoprate).toPlainString());
newBill.setNeedPay(new BigDecimal(oldBill.getNeedPay()).multiply(shoprate).setScale(wxPropertyContract.getDecimalSize(),BigDecimal.ROUND_HALF_UP).toPlainString());
newBill.setReceivePay(newBill.getNeedPay()); newBill.setReceivePay(newBill.getNeedPay());
newBill.setRentArea(shoprentArea.toPlainString()); newBill.setRentArea(shoprentArea.toPlainString());
if (null != shopUserMap ) { if (null != shopUserMap ) {


+ 11
- 8
mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java View File

@@ -931,7 +931,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
for (int i = 0 ; i < shopIdList.size(); i++ ) { for (int i = 0 ; i < shopIdList.size(); i++ ) {
Long sid = shopIdList.get(i); Long sid = shopIdList.get(i);
BigDecimal shoprentArea = shopAreaRateMap.get(sid); BigDecimal shoprentArea = shopAreaRateMap.get(sid);
BigDecimal shoprate = shoprentArea.divide(new BigDecimal(wxRentContract.getRentArea()),wxRentContract.getDecimalSize(),BigDecimal.ROUND_HALF_UP);
BigDecimal shoprate = shoprentArea.divide(new BigDecimal(wxRentContract.getRentArea()),Constant.default_long_decimal_size,BigDecimal.ROUND_HALF_UP);
String cusName = null; String cusName = null;
if (null != shopUserMap) { if (null != shopUserMap) {
WxShopUsers su = shopUserMap.get(sid); WxShopUsers su = shopUserMap.get(sid);
@@ -957,7 +957,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
// count = wxRentContract.getRentArea(); // count = wxRentContract.getRentArea();
// } // }
// String needpay = depositFee.calcuteTotalMoney(wxRentContract.getDecimalSize(), null, null, count, true, null, null); // String needpay = depositFee.calcuteTotalMoney(wxRentContract.getDecimalSize(), null, null, count, true, null, null);
wxBillDeposit.setReceivePay(new BigDecimal(needpay).multiply(shoprate).toPlainString());
wxBillDeposit.setReceivePay(new BigDecimal(needpay).multiply(shoprate).setScale(wxRentContract.getDecimalSize(),BigDecimal.ROUND_HALF_UP).toPlainString());
wxBillDeposit.setNeedPay(wxBillDeposit.getReceivePay()); wxBillDeposit.setNeedPay(wxBillDeposit.getReceivePay());
//wxBillDeposit.setOwe(needpay); //wxBillDeposit.setOwe(needpay);
//找到计租方式 //找到计租方式
@@ -1477,20 +1477,20 @@ public class WxRentContractServiceImpl implements WxRentContractService {
WxAllBill rs = new WxAllBill(); WxAllBill rs = new WxAllBill();
Long sid = shopIdList.get(g); Long sid = shopIdList.get(g);
BigDecimal shoprentArea = shopAreaRateMap.get(sid); BigDecimal shoprentArea = shopAreaRateMap.get(sid);
BigDecimal shoprate = shoprentArea.divide(new BigDecimal(wxRentContract.getRentArea()),wxRentContract.getDecimalSize(),BigDecimal.ROUND_HALF_UP);
BigDecimal shoprate = shoprentArea.divide(new BigDecimal(wxRentContract.getRentArea()),Constant.default_long_decimal_size,BigDecimal.ROUND_HALF_UP);
try { try {
BeanUtils.copyProperties(rs, rb); BeanUtils.copyProperties(rs, rb);
rs.setId(idWorker.nextId()); rs.setId(idWorker.nextId());
rs.setShopId(sid); rs.setShopId(sid);
rs.setNeedPay(new BigDecimal(rb.getNeedPay()).multiply(shoprate).toPlainString());
rs.setNeedPay(new BigDecimal(rb.getNeedPay()).multiply(shoprate).setScale(wxRentContract.getDecimalSize(),BigDecimal.ROUND_HALF_UP).toPlainString());
rs.setReceivePay(rs.getNeedPay()); rs.setReceivePay(rs.getNeedPay());
rs.setShopId(sid); rs.setShopId(sid);
rs.setRentArea(shoprentArea.toPlainString()); rs.setRentArea(shoprentArea.toPlainString());
if (StringUtils.isNotBlank(rb.getBussinessManageFeeNeedPay())) { if (StringUtils.isNotBlank(rb.getBussinessManageFeeNeedPay())) {
rs.setBussinessManageFeeNeedPay(new BigDecimal(rb.getBussinessManageFeeNeedPay()).multiply(shoprate).toPlainString());
rs.setBussinessManageFeeNeedPay(new BigDecimal(rb.getBussinessManageFeeNeedPay()).multiply(shoprate).setScale(wxRentContract.getDecimalSize(),BigDecimal.ROUND_HALF_UP).toPlainString());
} }
if (StringUtils.isNotBlank(rb.getOperatingManageFeeNeedPay())) { if (StringUtils.isNotBlank(rb.getOperatingManageFeeNeedPay())) {
rs.setOperatingManageFeeNeedPay(new BigDecimal(rb.getOperatingManageFeeNeedPay()).multiply(shoprate).toPlainString());
rs.setOperatingManageFeeNeedPay(new BigDecimal(rb.getOperatingManageFeeNeedPay()).multiply(shoprate).setScale(wxRentContract.getDecimalSize(),BigDecimal.ROUND_HALF_UP).toPlainString());
} }
if (null != shopUserMap ) { if (null != shopUserMap ) {
WxShopUsers wsu = shopUserMap.get(sid); WxShopUsers wsu = shopUserMap.get(sid);
@@ -1517,12 +1517,12 @@ public class WxRentContractServiceImpl implements WxRentContractService {
WxAllBill rs = new WxAllBill(); WxAllBill rs = new WxAllBill();
Long sid = shopIdList.get(g); Long sid = shopIdList.get(g);
BigDecimal shoprentArea = shopAreaRateMap.get(sid); BigDecimal shoprentArea = shopAreaRateMap.get(sid);
BigDecimal shoprate = shoprentArea.divide(new BigDecimal(wxRentContract.getRentArea()),wxRentContract.getDecimalSize(),BigDecimal.ROUND_HALF_UP);
BigDecimal shoprate = shoprentArea.divide(new BigDecimal(wxRentContract.getRentArea()),Constant.default_long_decimal_size,BigDecimal.ROUND_HALF_UP);
try { try {
BeanUtils.copyProperties(rs, rb); BeanUtils.copyProperties(rs, rb);
rs.setId(idWorker.nextId()); rs.setId(idWorker.nextId());
rs.setShopId(sid); rs.setShopId(sid);
rs.setNeedPay(new BigDecimal(rb.getNeedPay()).multiply(shoprate).toPlainString());
rs.setNeedPay(new BigDecimal(rb.getNeedPay()).multiply(shoprate).setScale(wxRentContract.getDecimalSize(),BigDecimal.ROUND_HALF_UP).toPlainString());
rs.setReceivePay(rs.getNeedPay()); rs.setReceivePay(rs.getNeedPay());
rs.setShopId(sid); rs.setShopId(sid);
rs.setRentArea(shoprentArea.toPlainString()); rs.setRentArea(shoprentArea.toPlainString());
@@ -1743,6 +1743,9 @@ public class WxRentContractServiceImpl implements WxRentContractService {
} }
private Map<Long,WxContractCustomers> getContractCustomersMap(TenantEntity tenantEntity,List<Long> customerIds) { private Map<Long,WxContractCustomers> getContractCustomersMap(TenantEntity tenantEntity,List<Long> customerIds) {
if (null == customerIds || customerIds.size() <= 0 ) {
return null;
}
WxContractCustomers ccq = new WxContractCustomers(); WxContractCustomers ccq = new WxContractCustomers();
ccq.updateTenantInfo(tenantEntity); ccq.updateTenantInfo(tenantEntity);
ccq.setIds(customerIds); ccq.setIds(customerIds);


Loading…
Cancel
Save