xlq 3 недель назад
Родитель
Сommit
fbe2064fa8

+ 1 - 0
src/main/java/com/qmrb/system/controller/ContractPlaceNumberRelController.java

@@ -79,6 +79,7 @@ public class ContractPlaceNumberRelController{
     @Operation(summary = "修改协议(客商)车牌关系", security = {@SecurityRequirement(name = "Authorization")})
     @PutMapping(value = "/{id}")
     public Result<?> updateForm(@Parameter(description = "协议(客商)车牌关系ID") @PathVariable Long id, @RequestBody @Validated ContractPlaceNumberRelForm form) {
+
         boolean result = contractPlaceNumberRelService.updateForm(id,form);
         return Result.judge(result);
     }

+ 4 - 0
src/main/java/com/qmrb/system/pojo/form/ContractPlaceNumberRelForm.java

@@ -1,5 +1,6 @@
 package com.qmrb.system.pojo.form;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
@@ -36,11 +37,14 @@ public class ContractPlaceNumberRelForm {
      * 开始时间
      */
 	@Schema(description = "开始时间",type="Date")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date startTime;
+    
     /**
      * 到期日期
      */
 	@Schema(description = "到期日期",type="Date")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date endTime;
     /**
      * 0停用1启用 2到期

+ 21 - 0
src/main/java/com/qmrb/system/pojo/vo/ContractPlaceNumberRelVO.java

@@ -1,9 +1,13 @@
 package com.qmrb.system.pojo.vo;
 
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonInclude;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
+import java.time.LocalDateTime;
 import java.util.Date;
 
 /**
@@ -56,6 +60,23 @@ public class ContractPlaceNumberRelVO {
 	@Schema(description = "协议ID",type="Long")
     private Long contractId;
 
+    /**
+     * 使用车位上限
+     */
+    @Schema(description = "使用车位上限",type="Integer")
+    private Integer maxParkingLotNum;
+
+
+
+    /**
+     * 更新日期
+     */
+    @Schema(description = "更新日期",type="Date")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date updateTime;
+
+
+
 
 
 }

+ 11 - 0
src/main/java/com/qmrb/system/service/impl/ContractPlaceNumberRelServiceImpl.java

@@ -7,14 +7,17 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.qmrb.system.common.result.PageResult;
 import com.qmrb.system.converter.ContractPlaceNumberRelConverter;
 import com.qmrb.system.framework.security.util.SecurityUtils;
+import com.qmrb.system.pojo.entity.Contract;
 import com.qmrb.system.pojo.entity.ContractPlaceNumberRel;
 import com.qmrb.system.pojo.entity.SysUser;
 import com.qmrb.system.pojo.form.ContractPlaceNumberRelForm;
+import com.qmrb.system.pojo.vo.BarnRecordVO;
 import com.qmrb.system.pojo.vo.ContractPlaceNumberRelVO;
 import com.qmrb.system.pojo.query.ContractPlaceNumberRelQuery;
 import com.qmrb.system.mapper.ContractPlaceNumberRelMapper;
 import com.qmrb.system.service.IContractPlaceNumberRelService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.qmrb.system.service.IContractService;
 import com.qmrb.system.service.SysUserService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -40,6 +43,9 @@ public class ContractPlaceNumberRelServiceImpl extends ServiceImpl<ContractPlace
 	@Autowired
 	SysUserService userService;
 
+	@Autowired
+	IContractService contractService;
+
 	/**分页查询
 	 * */
 	@Override
@@ -60,6 +66,11 @@ public class ContractPlaceNumberRelServiceImpl extends ServiceImpl<ContractPlace
 
         // 实体转换
         Page<ContractPlaceNumberRelVO> pageResult = converter.entity2Page(dictItemPage);
+		// 获取车位上限
+		Contract contract = contractService.getOne(new LambdaQueryWrapper<Contract>().eq(Contract::getId, sysUser.getContractId()));
+		for (ContractPlaceNumberRelVO record : pageResult.getRecords()) {
+			record.setMaxParkingLotNum(contract.getMaxParkingLotNum());
+		}
         return pageResult;
 	}