From e2bb52ee212d917b98fc21e88f245f5ee419b9fa Mon Sep 17 00:00:00 2001 From: zhengfangyuan Date: Mon, 2 Jan 2023 16:49:27 +0800 Subject: [PATCH] fix bug --- .../iformall/domain/po/WxRentContract.java | 8 +-- .../service/helper/WxRentContractHelper.java | 6 +- .../impl/WxRentContractServiceImpl.java | 66 ------------------- 3 files changed, 7 insertions(+), 73 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java b/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java index b8d2df938..39ad1d098 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java @@ -402,8 +402,8 @@ public class WxRentContract extends TenantEntity { @TableField(exist = false) private Integer flowHas; - @io.swagger.annotations.ApiModelProperty(value = "商业管理费", name = "bussinessManagementFee") - private Long bussinessManagementFee; + @io.swagger.annotations.ApiModelProperty(value = "商业管理费单价", name = "bussinessManagementFee") + private String bussinessManagementFee; @io.swagger.annotations.ApiModelProperty(value = "商业管理费调整方式1按比例2按金额", name = "bussinessManagementFeeRatioWay") private Integer bussinessManagementFeeRatioWay; @@ -411,8 +411,8 @@ public class WxRentContract extends TenantEntity { @io.swagger.annotations.ApiModelProperty(value = "商业管理费调整方式1按比例2按金额", name = "bussinessManagementFeeRatio") private String bussinessManagementFeeRatio; - @io.swagger.annotations.ApiModelProperty(value = "营业管理费", name = "operatingManagementFee") - private Long operatingManagementFee; + @io.swagger.annotations.ApiModelProperty(value = "营业管理费单价", name = "operatingManagementFee") + private String operatingManagementFee; @io.swagger.annotations.ApiModelProperty(value = "营业管理费调整方式1按比例2按金额", name = "operatingManagementFeeRatioWay") private Integer operatingManagementFeeRatioWay; diff --git a/mallinkService/src/main/java/com/iformall/service/helper/WxRentContractHelper.java b/mallinkService/src/main/java/com/iformall/service/helper/WxRentContractHelper.java index 08b990afb..4517dc5e9 100644 --- a/mallinkService/src/main/java/com/iformall/service/helper/WxRentContractHelper.java +++ b/mallinkService/src/main/java/com/iformall/service/helper/WxRentContractHelper.java @@ -43,7 +43,7 @@ public class WxRentContractHelper { } //计算除租金外其他可调整费项(按面积计算) - private static long[] calcuteOtherCanAdjustFeeByArea(WxRentContract wxRentContract,Long fee,Integer ratioWay,String ratio,String feeField,String feeRatioField) { + private static long[] calcuteOtherCanAdjustFeeByArea(WxRentContract wxRentContract,String fee,Integer ratioWay,String ratio,String feeField,String feeRatioField) { if (wxRentContract.getType().equals(EnumRentContractType.RENT_BY_AREA.getCode()) || wxRentContract.getType().equals(EnumRentContractType.RENT_BY_AREA_AND_JOINT.getCode())) { if (wxRentContract.getRentInputWay().equals(EnumRentContractRentInputWay.PART.getCode())) { @@ -71,14 +71,14 @@ public class WxRentContractHelper { return null; } }else { - if (null == fee) { + if (StringUtils.isBlank(fee)) { return null; } String rentArea = wxRentContract.getRentArea(); if (rentArea == null || rentArea.equalsIgnoreCase("NaN")) { rentArea = "0"; } - Long ratioFirstYearPrice = new BigDecimal(fee).multiply(new BigDecimal(rentArea)).longValue(); + Long ratioFirstYearPrice = new BigDecimal(fee).multiply(new BigDecimal(100)).multiply(new BigDecimal(rentArea)).longValue(); return calcuteRatioByJoin(ratioWay, ratio, ratioFirstYearPrice); } } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java index 2e9061116..e9c152386 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -923,72 +923,6 @@ public class WxRentContractServiceImpl implements WxRentContractService { } } - private void buildBussinessManagementFee( Long userId,WxRentContract wxRentContract) { - if (wxRentContract != null && wxRentContract.getBussinessManagementFee() > 0) { - final IdWorker idWorker = IdWorker.get(); - WxBillDeposit wxBillDeposit = new WxBillDeposit(); - wxBillDeposit.setId(idWorker.nextId()); - wxBillDeposit.setRentContractId(wxRentContract.getId()); - wxBillDeposit.setPay(0L); - long needpay = wxRentContract.getDeposit(); - wxBillDeposit.setReceivePay(needpay); - wxBillDeposit.setNeedPay(needpay); - wxBillDeposit.setOwe(needpay); - //找到计租方式 - int dayType = wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_DAY.getCode()) ? Calendar.DAY_OF_MONTH : Calendar.MONTH; - - Date date = new Date(); - Calendar instance = Calendar.getInstance(); - instance.setTime(wxRentContract.getRentalStartDate()); - instance.add(Calendar.DAY_OF_MONTH, -1); - Date time = instance.getTime(); - wxBillDeposit.setReceiveDate(time); - - //账单开始时间 - instance.clear(); - instance.setTime(wxBillDeposit.getReceiveDate()); - instance.add(Calendar.DAY_OF_MONTH, 1); - wxBillDeposit.setStarttime(instance.getTime()); - //账单结束时间 - instance.clear(); - instance.setTime(wxBillDeposit.getReceiveDate()); - instance.add(dayType, wxRentContract.getLease()); - wxBillDeposit.setEndtime(instance.getTime()); - wxBillDeposit.setStatus(EnumBillRentStatus.WAIT_PAY.getCode()); - wxBillDeposit.setExpiredDay(0L); - wxBillDeposit.setReceiveDate(time); - wxBillDeposit.updateTenantInfo(wxRentContract); - wxBillDeposit.setIsDel(0); - wxBillDeposit.setMerchantId(wxRentContract.getMerchantId()); - wxBillDeposit.setUserId(userId); - if (wxRentContract.shopIdsByRentInfo().size()==1) { - wxBillDeposit.setShopId(wxRentContract.shopIdsByRentInfo().get(0)); - } - wxBillDeposit.setCreatetime(date); - wxBillDeposit.setUpdatetime(date); - wxBillDeposit.setIsDel(EnumDelStatus.NOT_DEL.getCode()); - wxBillDeposit.setRentShopType(wxRentContract.getRentShopType()); - if (wxRentContract.getRentShopType().equals(EnumRentShopType.SHOP.getCode())) { - String rentInfo = wxRentContract.getRentInfo(); - if (rentInfo != null) { - JSONArray rentInfoArray = JSONArray.parseArray(rentInfo); - Map shopInfo = new HashMap<>(); - for (int i = 0, size = rentInfoArray.size(); i < size; i++) { - JSONObject rentInfoObject = rentInfoArray.getJSONObject(i); - shopInfo.put(rentInfoObject.getString("shopNumber"), rentInfoObject.get("deposit")); - } - wxBillDeposit.setShopInfo(JSONObject.toJSONString(shopInfo)); - } - } - try { - wxBillDepositMapper.insert(wxBillDeposit); - } catch (Exception e) { - logger.error("添加押金账单失败,e:" + e.getMessage()); - throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); - } - } - } - @Override public Object getMerchants(WxRentContract wxRentContract) { List rentContractList = wxRentContractMapper.getMerchants(wxRentContract);