From 5d6a8db3c5901f16ec1d278d2bf6d5e96f29ab15 Mon Sep 17 00:00:00 2001 From: xhxu Date: Thu, 19 Aug 2021 17:06:51 +0800 Subject: [PATCH] hetong --- .../iformall/domain/po/WxRentContract.java | 8 +++--- .../impl/WxRentContractServiceImpl.java | 27 +++++++++++-------- .../resources/mapper/WxRentContractMapper.xml | 2 +- 3 files changed, 21 insertions(+), 16 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 cf85cbd4f..fbb256e28 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java @@ -222,9 +222,9 @@ public class WxRentContract extends TenantEntity { private Long merchantId; @io.swagger.annotations.ApiModelProperty(value = "月租金/分成(分)", name = "price") private Long price; - @io.swagger.annotations.ApiModelProperty(value = "计租开始时间", name = "rentalStartDate") + @io.swagger.annotations.ApiModelProperty(value = "起租开始时间", name = "rentalStartDate") private Date rentalStartDate; - @io.swagger.annotations.ApiModelProperty(value = "计租结束时间", name = "rentalEndDate") + @io.swagger.annotations.ApiModelProperty(value = "", name = "rentalEndDate") private Date rentalEndDate; @io.swagger.annotations.ApiModelProperty(value = "签定合同时间", name = "signDate") private Date signDate; @@ -296,10 +296,10 @@ public class WxRentContract extends TenantEntity { @io.swagger.annotations.ApiModelProperty(value = "营业额", name = "revenue") private Long revenue; - @io.swagger.annotations.ApiModelProperty(value = "起租开始时间", name = "startDate") + @io.swagger.annotations.ApiModelProperty(value = "计租开始时间", name = "startDate") private Date startDate; - @io.swagger.annotations.ApiModelProperty(value = "起租结束时间", name = "endDate") + @io.swagger.annotations.ApiModelProperty(value = "", name = "endDate") private Date endDate; @io.swagger.annotations.ApiModelProperty(value = "审核状态, 0未审核 1审核中 2审核通过 3驳回", name = "applyStatus") 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 bc1c52321..f385314cb 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -2143,8 +2143,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { } //计租 - if(wxRentContract.getRentalStartDate() != null && wxRentContract.getRentalEndDate() != null){ - String rentalStartDate = DateUtils.date2String(wxRentContract.getRentalStartDate(), "yyyy-MM-dd"); + if(wxRentContract.getStartDate() != null && wxRentContract.getRentalEndDate() != null){ + String rentalStartDate = DateUtils.date2String(wxRentContract.getStartDate(), "yyyy-MM-dd"); result.put("rentalStartDate", rentalStartDate); result.put("rentalStartDateYear", rentalStartDate.substring(0, 4)); result.put("rentalStartDateMonth", rentalStartDate.substring(5, 7)); @@ -2158,12 +2158,12 @@ public class WxRentContractServiceImpl implements WxRentContractService { //免租 if(wxRentContract.getStartDate() != null && wxRentContract.getRentalStartDate()!=null && !DateUtils.isSameDate(wxRentContract.getStartDate(),wxRentContract.getRentalStartDate())){ - String reductionStartDate = DateUtils.date2String(wxRentContract.getStartDate(), "yyyy-MM-dd"); + String reductionStartDate = DateUtils.date2String(wxRentContract.getRentalStartDate(), "yyyy-MM-dd"); result.put("reductionStartDateYear", reductionStartDate.substring(0, 4)); result.put("reductionStartDateMonth", reductionStartDate.substring(5, 7)); result.put("reductionStartDateDay", reductionStartDate.substring(8)); // String reductionEndDate = DateUtils.date2String(wxRentContract.getRentalStartDate(), "yyyy-MM-dd"); - String reductionEndDate = DateUtils.getTimeBefore(1,wxRentContract.getRentalStartDate()); + String reductionEndDate = DateUtils.getTimeBefore(1,wxRentContract.getStartDate()); result.put("reductionEndDateYear", reductionEndDate.substring(0, 4)); result.put("reductionEndDateMonth", reductionEndDate.substring(5, 7)); result.put("reductionEndDateDay", reductionEndDate.substring(8)); @@ -2179,9 +2179,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { String shopType4Str = ""; if(wxRentContract.getShopType() != null && wxRentContract.getShopType().intValue() == 1){ shopType4Str = "直营"; - }else if(wxRentContract.getShopType() != null && wxRentContract.getShopType().intValue() == 2){ + }else if(wxRentContract.getShopType() != null && wxRentContract.getShopType().intValue() == 6){ shopType4Str = "代理"; - }else if(wxRentContract.getShopType() != null && wxRentContract.getShopType().intValue() == 3){ + }else if(wxRentContract.getShopType() != null && wxRentContract.getShopType().intValue() == 2){ shopType4Str = "加盟"; }else{ shopType4Str = "其他("+wxRentContract.getShopTypeStr()+")"; @@ -2302,8 +2302,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { }else if(EnumRentContractType.RENT_BY_JOINT.getCode().equals(type)){ - Integer twoPayRatio1 = new BigDecimal(wxRentContract.getPayRatio()) - .divide(new BigDecimal(100)).intValue(); + Double twoPayRatio1 = new BigDecimal(wxRentContract.getPayRatio()) + .divide(new BigDecimal(100)) + .setScale(2, RoundingMode.HALF_EVEN).doubleValue();; result.put("twoPayRatio1",twoPayRatio1); result.put("twoPayDate",wxRentContract.getPayDate()); if(StringUtils.isNotBlank(incrementStartDate)){ @@ -2316,7 +2317,10 @@ public class WxRentContractServiceImpl implements WxRentContractService { result.put("twoRentalStartDateMonth2",incrementStartDate.substring(5,7)); result.put("twoRentalStartDateDay2",incrementStartDate.substring(8,10)); result.put("twoRentIncreasing2",increasingProportion); - result.put("twoPayRatio2",twoPayRatio1+Integer.parseInt(increasingProportion)); + Double twoPayRatio2 = new BigDecimal(wxRentContract.getPayRatio()) + .add(new BigDecimal(increasingProportion)) + .setScale(2, RoundingMode.HALF_EVEN).doubleValue(); + result.put("twoPayRatio2",twoPayRatio2); }else{ String rentalEndDate = DateUtils.date2String(wxRentContract.getRentalEndDate(), "yyyy-MM-dd"); @@ -2333,8 +2337,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { result.put("threeRentalPriceUpper1", PriceUtil.digitUppercase(priceRent)); result.put("threeRentPrice",wxRentContract.getRentPrice()); - Integer threePayRatio1 = new BigDecimal(wxRentContract.getPayRatio()) - .divide(new BigDecimal(100)).intValue(); + double threePayRatio1 = new BigDecimal(wxRentContract.getPayRatio()) + .divide(new BigDecimal(100)) + .setScale(2, RoundingMode.HALF_EVEN).doubleValue(); result.put("threePayRatio1",threePayRatio1); result.put("threePayDate",wxRentContract.getPayDate()); diff --git a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml index 27281eafa..e34a6f2a1 100644 --- a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml @@ -790,7 +790,7 @@ left join wx_rent_contract rc on rc.merchant_id = m.id and rc.is_del=0 where s.`id` = #{shopId} and rc.`status` in (2,3) - and rc.`start_date` <= now() and end_date >= now() + and rc.`rental_start_date` <= now() and rental_end_date >= now() order by rc.`updatetime` desc;