| @@ -52,10 +52,10 @@ public class WxRentContractController extends BaseController { | |||||
| @ApiImplicitParam(name = "startDate", value = "开始时间", dataType = "string", paramType = "query", required = true), | @ApiImplicitParam(name = "startDate", value = "开始时间", dataType = "string", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "endtDate", value = "结束时间", dataType = "string", paramType = "query", required = true)}) | @ApiImplicitParam(name = "endtDate", value = "结束时间", dataType = "string", paramType = "query", required = true)}) | ||||
| @SystemControllerLog(description = "获取两个时间相差,返回n月零n天") | @SystemControllerLog(description = "获取两个时间相差,返回n月零n天") | ||||
| public ResultData getDateDiff(String startDate, String endtDate) throws Exception{ | |||||
| public ResultData getDateDiff(String startDate, String endDate) throws Exception{ | |||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::getTimeDiff"); | logger.debug("[" + getIpAddr() + "] WxRentContractController::getTimeDiff"); | ||||
| SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); | SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); | ||||
| int[] array = DateUtils.getDiff(sd.parse(startDate),sd.parse(endtDate)); | |||||
| int[] array = DateUtils.getDiff(sd.parse(startDate),sd.parse(endDate)); | |||||
| Map<String,Integer> map = new HashMap<>(); | Map<String,Integer> map = new HashMap<>(); | ||||
| map.put("month",array[0]); | map.put("month",array[0]); | ||||
| map.put("day",array[1]); | map.put("day",array[1]); | ||||
| @@ -331,6 +331,50 @@ public class WxRentContract extends BaseEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "上传文件名", name = "fileNames") | @io.swagger.annotations.ApiModelProperty(value = "上传文件名", name = "fileNames") | ||||
| private String fileNames; | private String fileNames; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "总租期(月)", name = "totalPeriodMonth") | |||||
| private Integer totalPeriodMonth; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "总租期(天)", name = "totalPeriodDay") | |||||
| private Integer totalPeriodDay; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "租赁单价", name = "rentPrice") | |||||
| private Integer rentPrice; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "租金单位1日2月3年", name = "priceUnit") | |||||
| private Integer priceUnit; | |||||
| public Integer getPriceUnit() { | |||||
| return priceUnit; | |||||
| } | |||||
| public void setPriceUnit(Integer priceUnit) { | |||||
| this.priceUnit = priceUnit; | |||||
| } | |||||
| public Integer getTotalPeriodMonth() { | |||||
| return totalPeriodMonth; | |||||
| } | |||||
| public void setTotalPeriodMonth(Integer totalPeriodMonth) { | |||||
| this.totalPeriodMonth = totalPeriodMonth; | |||||
| } | |||||
| public Integer getTotalPeriodDay() { | |||||
| return totalPeriodDay; | |||||
| } | |||||
| public void setTotalPeriodDay(Integer totalPeriodDay) { | |||||
| this.totalPeriodDay = totalPeriodDay; | |||||
| } | |||||
| public Integer getRentPrice() { | |||||
| return rentPrice; | |||||
| } | |||||
| public void setRentPrice(Integer rentPrice) { | |||||
| this.rentPrice = rentPrice; | |||||
| } | |||||
| public String getRentInfo() { | public String getRentInfo() { | ||||
| return rentInfo; | return rentInfo; | ||||
| } | } | ||||
| @@ -560,6 +560,15 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| } | } | ||||
| } | } | ||||
| public static void main(String[] args) throws Exception{ | |||||
| SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); | |||||
| String start = "2019-05-18"; | |||||
| String end = "2019-05-24"; | |||||
| int[] array = DateUtils.getDiff(sd.parse(start),sd.parse(end)); | |||||
| System.out.println(array[0] +"月"); | |||||
| System.out.println(array[1] +"天"); | |||||
| } | |||||
| @Override | @Override | ||||
| public Object getMerchants(WxRentContract wxRentContract) { | public Object getMerchants(WxRentContract wxRentContract) { | ||||
| List<WxRentContract> rentContractList = wxRentContractMapper.getMerchants(wxRentContract); | List<WxRentContract> rentContractList = wxRentContractMapper.getMerchants(wxRentContract); | ||||