From 7a992309d5484aa6f5b8fc87c83061d09462c45f Mon Sep 17 00:00:00 2001 From: gongbiao Date: Wed, 12 Jun 2019 16:23:15 +0800 Subject: [PATCH] =?UTF-8?q?[=E7=A7=9F=E8=B5=81=E7=89=A9=E4=B8=9A=E5=90=88?= =?UTF-8?q?=E5=90=8C][=E4=BF=AE=E6=94=B9][=E6=B7=BB=E5=8A=A0=E5=AE=9E?= =?UTF-8?q?=E4=BD=93=E5=AD=97=E6=AE=B5=E5=8F=8A=E5=AD=97=E6=AE=B5sql]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WxRentPropertyContractController.java | 17 +++++------ .../V201906121607__ALTER_CONTRACT.sql | 4 +++ .../domain/po/WxPropertyContract.java | 3 ++ .../iformall/domain/po/WxRentContract.java | 4 +++ .../domain/vo/WxRentPropertyContractVo.java | 30 +++++++++++++++++-- .../service/WxRentContractService.java | 5 ++++ .../impl/WxRentContractServiceImpl.java | 6 ++++ 7 files changed, 57 insertions(+), 12 deletions(-) create mode 100644 mallinkAdmin/src/main/resources/db/migration/V201906121607__ALTER_CONTRACT.sql diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentPropertyContractController.java b/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentPropertyContractController.java index 7b919a902..24e40337f 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentPropertyContractController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentPropertyContractController.java @@ -1,9 +1,10 @@ package com.iformall.controller.contract; +import com.github.pagehelper.PageInfo; import com.iformall.annotation.SystemControllerLog; import com.iformall.common.ResultData; import com.iformall.controller.base.BaseController; -import com.iformall.domain.po.WxRentContract; +import com.iformall.domain.vo.WxRentPropertyContractVo; import com.iformall.service.WxRentContractService; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; @@ -15,8 +16,6 @@ import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import java.util.Map; - /** * @author gongbiao */ @@ -33,14 +32,14 @@ public class WxRentPropertyContractController extends BaseController { @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) @SystemControllerLog(description = "租赁物业合同-列表") - public ResultData list(@ModelAttribute WxRentContract wxRentContract, Integer pageNum, Integer pageSize) { + public ResultData list(@ModelAttribute WxRentPropertyContractVo wxRentPropertyContractVo, Integer pageNum, Integer pageSize) { logger.debug("[" + getIpAddr() + "] wxRentPropertyContract::list"); - if (null == wxRentContract) { - wxRentContract = new WxRentContract(); + if (null == wxRentPropertyContractVo) { + wxRentPropertyContractVo = new WxRentPropertyContractVo(); } - wxRentContract.setTenantId(getTenantId()); - Map result = wxRentContractService.listAsPage(wxRentContract, pageNum, pageSize); - return new ResultData(result); + wxRentPropertyContractVo.setTenantId(getTenantId()); + final PageInfo page = wxRentContractService.listContractVo(wxRentPropertyContractVo, pageNum, pageSize); + return new ResultData(page); } } diff --git a/mallinkAdmin/src/main/resources/db/migration/V201906121607__ALTER_CONTRACT.sql b/mallinkAdmin/src/main/resources/db/migration/V201906121607__ALTER_CONTRACT.sql new file mode 100644 index 000000000..ab5596e30 --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V201906121607__ALTER_CONTRACT.sql @@ -0,0 +1,4 @@ +#租赁合同 +alter table wx_rent_contract add column operation_type smallint(2) default 1 comment '1区分租赁物业2合并租赁物业'; +#物业合同 +alter table wx_property_contract add column operation_type smallint(2) default 1 comment '1区分租赁物业2合并租赁物业'; \ No newline at end of file diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxPropertyContract.java b/mallinkService/src/main/java/com/iformall/domain/po/WxPropertyContract.java index 858ef5d61..94b59ec05 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxPropertyContract.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxPropertyContract.java @@ -180,6 +180,9 @@ public class WxPropertyContract extends BaseEntity { @io.swagger.annotations.ApiModelProperty(value = "1按租赁日生产2按计租日生成账单", name = "rentStartType") private Integer rentStartType; + @io.swagger.annotations.ApiModelProperty(value = "操作类型1区分租赁物业2合并租赁物业", name = "operationType") + private Integer operationType; + public static enum Field { Id_ASC("`id` ASC"),Id_DESC("`id` DESC") 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 47c51032a..53e619c38 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java @@ -226,6 +226,10 @@ public class WxRentContract extends BaseEntity { @io.swagger.annotations.ApiModelProperty(value = "年租金调整方式1按比例2按金额", name = "adjust_ratio_way") private Integer adjustRatioWay; + @io.swagger.annotations.ApiModelProperty(value = "操作类型1区分租赁物业2合并租赁物业", name = "operationType") + private Integer operationType; + + // public Integer getAdjustPeriod() { // if(EnumPriceUnit.D.getCode().equals(this.getPriceUnit()) && EnumRentContractAdjustPeriod.ADJUST_PERIOD_MONTH.getCode().equals(adjustPeriod)){ // return EnumRentContractAdjustPeriod.ADJUST_PERIOD_DAY.getCode(); diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/WxRentPropertyContractVo.java b/mallinkService/src/main/java/com/iformall/domain/vo/WxRentPropertyContractVo.java index 70f1d400c..2fbd0ea91 100644 --- a/mallinkService/src/main/java/com/iformall/domain/vo/WxRentPropertyContractVo.java +++ b/mallinkService/src/main/java/com/iformall/domain/vo/WxRentPropertyContractVo.java @@ -7,7 +7,7 @@ import lombok.ToString; import javax.persistence.Id; import javax.persistence.Transient; -import java.util.List; +import java.util.Date; /** * @author gongbiao @@ -16,11 +16,10 @@ import java.util.List; @ToString(callSuper = true) @EqualsAndHashCode(callSuper = true) public class WxRentPropertyContractVo extends BaseEntity { + @Id protected Long id; - @Transient - protected List ids; @Transient protected String sortColumns; @@ -42,7 +41,32 @@ public class WxRentPropertyContractVo extends BaseEntity { @io.swagger.annotations.ApiModelProperty(value = "商户名称", name = "merchantName") private String merchantName; + @io.swagger.annotations.ApiModelProperty(value = "计租开始时间", name = "rentalStartDate") + private Date rentalStartDate; + + @io.swagger.annotations.ApiModelProperty(value = "计租结束时间", name = "rentalEndDate") + private Date rentalEndDate; + + @io.swagger.annotations.ApiModelProperty(value = "租金", name = "rentPrice") + private String rentPrice; + + @io.swagger.annotations.ApiModelProperty(value = "物业费", name = "propertyPrice") + private String propertyPrice; + + @io.swagger.annotations.ApiModelProperty(value = "计租类型", name = "type") + private Integer type; + + @io.swagger.annotations.ApiModelProperty(value = "合同状态", name = "status") + private Integer status; + + @io.swagger.annotations.ApiModelProperty(value = "审批状态", name = "applyStatus") + private Integer applyStatus; + + @io.swagger.annotations.ApiModelProperty(value = "租户ID", name = "tenantId") + private String tenantId; + @io.swagger.annotations.ApiModelProperty(value = "操作类型1区分租赁物业2合并租赁物业", name = "operationType") + private Integer operationType; } diff --git a/mallinkService/src/main/java/com/iformall/service/WxRentContractService.java b/mallinkService/src/main/java/com/iformall/service/WxRentContractService.java index aa1f67a5d..31403379f 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxRentContractService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxRentContractService.java @@ -1,9 +1,11 @@ package com.iformall.service; +import com.github.pagehelper.PageInfo; import com.iformall.common.ResultData; import com.iformall.domain.po.WxBillRent; import com.iformall.domain.po.WxMerchant; import com.iformall.domain.po.WxRentContract; +import com.iformall.domain.vo.WxRentPropertyContractVo; import io.swagger.models.auth.In; import javax.servlet.http.HttpServletRequest; @@ -85,4 +87,7 @@ public interface WxRentContractService { ResultData hasContractNumber(WxRentContract wxRentContract); Integer getShopType(WxRentContract wxRentContract); + + PageInfo listContractVo(WxRentPropertyContractVo wxRentPropertyContractVo, Integer pageNum, Integer pageSize); + } 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 27b74e22b..f9657bfbe 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -10,6 +10,7 @@ import com.iformall.common.Result; import com.iformall.common.ResultData; import com.iformall.domain.po.*; import com.iformall.domain.vo.BillTimeVo; +import com.iformall.domain.vo.WxRentPropertyContractVo; import com.iformall.enums.*; import com.iformall.exception.MallinkException; import com.iformall.mapper.*; @@ -1835,6 +1836,11 @@ public class WxRentContractServiceImpl implements WxRentContractService { return wxRentContractMapper.getShopType(wxRentContract); } + @Override + public PageInfo listContractVo(WxRentPropertyContractVo wxRentPropertyContractVo, Integer pageNum, Integer pageSize) { + return null; + } + public static double getMonthNeedPay(Double price,Date start,Date end){ SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdM = new SimpleDateFormat("yyyy-MM");