Ver código fonte

客商协议表

xlq 3 semanas atrás
pai
commit
44f9b94eb2
21 arquivos alterados com 1299 adições e 0 exclusões
  1. 100 0
      src/main/java/com/qmrb/system/controller/ContractController.java
  2. 101 0
      src/main/java/com/qmrb/system/controller/ContractPlaceNumberRelController.java
  3. 29 0
      src/main/java/com/qmrb/system/converter/ContractConverter.java
  4. 29 0
      src/main/java/com/qmrb/system/converter/ContractPlaceNumberRelConverter.java
  5. 18 0
      src/main/java/com/qmrb/system/mapper/ContractMapper.java
  6. 18 0
      src/main/java/com/qmrb/system/mapper/ContractPlaceNumberRelMapper.java
  7. 134 0
      src/main/java/com/qmrb/system/pojo/entity/Contract.java
  8. 73 0
      src/main/java/com/qmrb/system/pojo/entity/ContractPlaceNumberRel.java
  9. 7 0
      src/main/java/com/qmrb/system/pojo/entity/SysUser.java
  10. 105 0
      src/main/java/com/qmrb/system/pojo/form/ContractForm.java
  11. 57 0
      src/main/java/com/qmrb/system/pojo/form/ContractPlaceNumberRelForm.java
  12. 63 0
      src/main/java/com/qmrb/system/pojo/query/ContractPlaceNumberRelQuery.java
  13. 111 0
      src/main/java/com/qmrb/system/pojo/query/ContractQuery.java
  14. 58 0
      src/main/java/com/qmrb/system/pojo/vo/ContractPlaceNumberRelVO.java
  15. 106 0
      src/main/java/com/qmrb/system/pojo/vo/ContractVO.java
  16. 40 0
      src/main/java/com/qmrb/system/service/IContractPlaceNumberRelService.java
  17. 40 0
      src/main/java/com/qmrb/system/service/IContractService.java
  18. 104 0
      src/main/java/com/qmrb/system/service/impl/ContractPlaceNumberRelServiceImpl.java
  19. 96 0
      src/main/java/com/qmrb/system/service/impl/ContractServiceImpl.java
  20. 5 0
      src/main/resources/mapper/ContractMapper.xml
  21. 5 0
      src/main/resources/mapper/ContractPlaceNumberRelMapper.xml

+ 100 - 0
src/main/java/com/qmrb/system/controller/ContractController.java

@@ -0,0 +1,100 @@
+package com.qmrb.system.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import org.springdoc.core.annotations.ParameterObject;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.security.SecurityRequirement;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.qmrb.system.common.result.PageResult;
+import com.qmrb.system.common.result.Result;
+import com.qmrb.system.common.result.ResultCode;
+import com.qmrb.system.framework.resubmit.Resubmit;
+import com.qmrb.system.service.IContractService;
+import com.qmrb.system.pojo.form.ContractForm;
+import com.qmrb.system.pojo.vo.ContractVO;
+import com.qmrb.system.pojo.query.ContractQuery;
+
+import cn.hutool.core.util.StrUtil;
+import org.springframework.web.bind.annotation.RestController;
+import jakarta.validation.Valid;
+import lombok.RequiredArgsConstructor;
+
+/**
+ * <p>
+ * 客商协议表 前端控制器
+ * </p>
+ *
+ * @author xue
+ * @since 2025-03-11
+ */
+@Tag(name = "客商协议表接口")
+@RestController
+@RequestMapping("/api/v1/contract")
+@RequiredArgsConstructor
+public class ContractController{
+
+    private final IContractService contractService;
+
+	@Operation(summary = "客商协议表分页列表", security = {@SecurityRequirement(name = "Authorization")})
+    @GetMapping("/page")
+    public PageResult<ContractVO> getPage(@ParameterObject ContractQuery queryParams) {
+        Page<ContractVO> result = contractService.getPage(queryParams);
+        return PageResult.success(result);
+    }
+    
+    
+    @Operation(summary = "新增客商协议表", security = {@SecurityRequirement(name = "Authorization")})
+    @PostMapping
+    @PreAuthorize("@ss.hasPerm('contract:add')")
+    @Resubmit
+    public Result<ContractForm> saveForm(@RequestBody @Valid ContractForm form) {
+        ContractForm result = contractService.saveForm(form);
+        return Result.success(result);
+    }
+
+    @Operation(summary = "客商协议表表单数据", security = {@SecurityRequirement(name = "Authorization")})
+    @GetMapping("/{id}/form")
+    public Result<ContractForm> getForm(@Parameter(description = "客商协议表ID") @PathVariable Long id) {
+    	ContractForm formData = contractService.getFormData(id);
+        return Result.success(formData);
+    }
+
+    @Operation(summary = "修改客商协议表", security = {@SecurityRequirement(name = "Authorization")})
+    @PutMapping(value = "/{id}")
+    @PreAuthorize("@ss.hasPerm('contract:edit')")
+    public Result<?> updateForm(@Parameter(description = "客商协议表ID") @PathVariable Long id, @RequestBody @Validated ContractForm form) {
+        boolean result = contractService.updateForm(id,form);
+        return Result.judge(result);
+    }
+
+    @Operation(summary = "删除客商协议表", security = {@SecurityRequirement(name = "Authorization")})
+    @DeleteMapping("/{ids}")
+    @PreAuthorize("@ss.hasPerm('contract:delete')")
+    public Result<?> deleteUsers( @Parameter(description = "客商协议表ID,多个以英文逗号(,)分割") @PathVariable String ids) {
+    	if(StrUtil.isBlank(ids)) {
+    		 return Result.failed(ResultCode.PARAM_ERROR, "删除的客商协议表数据为空");
+    	}
+        // 逻辑删除
+        List<Long> idList = Arrays.asList(ids.split(",")).stream()
+                .map(idStr -> Long.parseLong(idStr)).collect(Collectors.toList());
+        boolean result = contractService.removeByIds(idList);
+        return Result.judge(result);
+    }
+    
+
+
+}

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

@@ -0,0 +1,101 @@
+package com.qmrb.system.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import com.qmrb.system.framework.security.util.SecurityUtils;
+import org.springdoc.core.annotations.ParameterObject;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.security.SecurityRequirement;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.qmrb.system.common.result.PageResult;
+import com.qmrb.system.common.result.Result;
+import com.qmrb.system.common.result.ResultCode;
+import com.qmrb.system.framework.resubmit.Resubmit;
+import com.qmrb.system.service.IContractPlaceNumberRelService;
+import com.qmrb.system.pojo.form.ContractPlaceNumberRelForm;
+import com.qmrb.system.pojo.vo.ContractPlaceNumberRelVO;
+import com.qmrb.system.pojo.query.ContractPlaceNumberRelQuery;
+
+import cn.hutool.core.util.StrUtil;
+import org.springframework.web.bind.annotation.RestController;
+import jakarta.validation.Valid;
+import lombok.RequiredArgsConstructor;
+
+/**
+ * <p>
+ * 协议(客商)车牌关系 前端控制器
+ * </p>
+ *
+ * @author xue
+ * @since 2025-03-11
+ */
+@Tag(name = "协议(客商)车牌关系接口")
+@RestController
+@RequestMapping("/api/v1/contract_place_number_rel")
+@RequiredArgsConstructor
+public class ContractPlaceNumberRelController{
+
+    private final IContractPlaceNumberRelService contractPlaceNumberRelService;
+
+	@Operation(summary = "协议(客商)车牌关系分页列表", security = {@SecurityRequirement(name = "Authorization")})
+    @GetMapping("/page")
+    public PageResult<ContractPlaceNumberRelVO> getPage(@ParameterObject ContractPlaceNumberRelQuery queryParams) {
+        // 校验当前登录用户id
+        if(SecurityUtils.getUserId() == null){
+            return PageResult.success(null);
+        }
+        Page<ContractPlaceNumberRelVO> result = contractPlaceNumberRelService.getPage(queryParams);
+        return PageResult.success(result);
+    }
+    
+    
+    @Operation(summary = "新增协议(客商)车牌关系", security = {@SecurityRequirement(name = "Authorization")})
+    @PostMapping
+    public Result<ContractPlaceNumberRelForm> saveForm(@RequestBody @Valid ContractPlaceNumberRelForm form) {
+        ContractPlaceNumberRelForm result = contractPlaceNumberRelService.saveForm(form);
+        return Result.success(result);
+    }
+
+    @Operation(summary = "协议(客商)车牌关系表单数据", security = {@SecurityRequirement(name = "Authorization")})
+    @GetMapping("/{id}/form")
+    public Result<ContractPlaceNumberRelForm> getForm(@Parameter(description = "协议(客商)车牌关系ID") @PathVariable Long id) {
+    	ContractPlaceNumberRelForm formData = contractPlaceNumberRelService.getFormData(id);
+        return Result.success(formData);
+    }
+
+    @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);
+    }
+
+    @Operation(summary = "删除协议(客商)车牌关系", security = {@SecurityRequirement(name = "Authorization")})
+    @DeleteMapping("/{ids}")
+    public Result<?> deleteUsers( @Parameter(description = "协议(客商)车牌关系ID,多个以英文逗号(,)分割") @PathVariable String ids) {
+    	if(StrUtil.isBlank(ids)) {
+    		 return Result.failed(ResultCode.PARAM_ERROR, "删除的协议(客商)车牌关系数据为空");
+    	}
+        // 逻辑删除
+        List<Long> idList = Arrays.asList(ids.split(",")).stream()
+                .map(idStr -> Long.parseLong(idStr)).collect(Collectors.toList());
+        boolean result = contractPlaceNumberRelService.removeByIds(idList);
+        return Result.judge(result);
+    }
+    
+
+
+}

+ 29 - 0
src/main/java/com/qmrb/system/converter/ContractConverter.java

@@ -0,0 +1,29 @@
+package com.qmrb.system.converter;
+
+import org.mapstruct.InheritInverseConfiguration;
+import org.mapstruct.Mapper;
+import org.mapstruct.ReportingPolicy;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.qmrb.system.pojo.entity.Contract;
+import com.qmrb.system.pojo.form.ContractForm;
+import com.qmrb.system.pojo.vo.ContractVO;
+
+/**
+ * 客商协议表数据项对象转换器
+ *
+ * @author xue
+ * @since 2025-03-11
+ */
+@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE)
+public interface ContractConverter {
+
+    Page<ContractVO> entity2Page(Page<Contract> page);
+
+    ContractForm entity2Form(Contract entity);
+
+    @InheritInverseConfiguration(name="entity2Form")
+    Contract form2Entity(ContractForm form);
+    
+    
+}

+ 29 - 0
src/main/java/com/qmrb/system/converter/ContractPlaceNumberRelConverter.java

@@ -0,0 +1,29 @@
+package com.qmrb.system.converter;
+
+import org.mapstruct.InheritInverseConfiguration;
+import org.mapstruct.Mapper;
+import org.mapstruct.ReportingPolicy;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.qmrb.system.pojo.entity.ContractPlaceNumberRel;
+import com.qmrb.system.pojo.form.ContractPlaceNumberRelForm;
+import com.qmrb.system.pojo.vo.ContractPlaceNumberRelVO;
+
+/**
+ * 协议(客商)车牌关系数据项对象转换器
+ *
+ * @author xue
+ * @since 2025-03-11
+ */
+@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE)
+public interface ContractPlaceNumberRelConverter {
+
+    Page<ContractPlaceNumberRelVO> entity2Page(Page<ContractPlaceNumberRel> page);
+
+    ContractPlaceNumberRelForm entity2Form(ContractPlaceNumberRel entity);
+
+    @InheritInverseConfiguration(name="entity2Form")
+    ContractPlaceNumberRel form2Entity(ContractPlaceNumberRelForm form);
+    
+    
+}

+ 18 - 0
src/main/java/com/qmrb/system/mapper/ContractMapper.java

@@ -0,0 +1,18 @@
+package com.qmrb.system.mapper;
+
+import com.qmrb.system.pojo.entity.Contract;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ * 客商协议表 Mapper 接口
+ * </p>
+ *
+ * @author xue
+ * @since 2025-03-11
+ */
+@Mapper
+public interface ContractMapper extends BaseMapper<Contract> {
+
+}

+ 18 - 0
src/main/java/com/qmrb/system/mapper/ContractPlaceNumberRelMapper.java

@@ -0,0 +1,18 @@
+package com.qmrb.system.mapper;
+
+import com.qmrb.system.pojo.entity.ContractPlaceNumberRel;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ * 协议(客商)车牌关系 Mapper 接口
+ * </p>
+ *
+ * @author xue
+ * @since 2025-03-11
+ */
+@Mapper
+public interface ContractPlaceNumberRelMapper extends BaseMapper<ContractPlaceNumberRel> {
+
+}

+ 134 - 0
src/main/java/com/qmrb/system/pojo/entity/Contract.java

@@ -0,0 +1,134 @@
+package com.qmrb.system.pojo.entity;
+
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.qmrb.system.common.base.BaseEntity;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 客商协议表
+ * </p>
+ *
+ * @author xue
+ * @since 2025-03-11
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("contract")
+public class Contract extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 协议名称
+     */
+    @TableField("contract_name")
+    private String contractName;
+
+    /**
+     * 停车场ID
+     */
+    @TableField("car_park_id")
+    private Long carParkId;
+
+    /**
+     * 2 扫码协议 3:包租协议
+     */
+    @TableField("contract_type")
+    private String contractType;
+
+    /**
+     * 开始日期
+     */
+    @TableField("start_date")
+    private Date startDate;
+
+    /**
+     * 结束日期
+     */
+    @TableField("end_date")
+    private Date endDate;
+
+    /**
+     * 联系人姓名
+     */
+    @TableField("contact_name")
+    private String contactName;
+
+    /**
+     * 联系人电话
+     */
+    @TableField("contact_phone")
+    private String contactPhone;
+
+    /**
+     * 1 扫码抵用金额 2扫码抵用时长
+     */
+    @TableField("scan_type")
+    private String scanType;
+
+    /**
+     *  发券数量上限
+     */
+    @TableField("max_coupon_count")
+    private Integer maxCouponCount;
+
+    /**
+     * 抵用金额
+     */
+    @TableField("discount_amount")
+    private BigDecimal discountAmount;
+
+    /**
+     * 抵用分钟数
+     */
+    @TableField("discount_minute")
+    private Integer discountMinute;
+
+    /**
+     * 二维码屏登录账号
+     */
+    @TableField("username")
+    private String username;
+
+    /**
+     * 二维码屏登录密码
+     */
+    @TableField("password")
+    private String password;
+
+    /**
+     * 二维码屏登录地址
+     */
+    @TableField("qrcode_login_url")
+    private String qrcodeLoginUrl;
+
+    /**
+     * 使用车位上限
+     */
+    @TableField("max_parking_lot_num")
+    private Integer maxParkingLotNum;
+
+    /**
+     * 其中大型车位
+     */
+    @TableField("big_parking_lot_num")
+    private Integer bigParkingLotNum;
+
+    /**
+     * 其中小型车位
+     */
+    @TableField("small_parking_lot_num")
+    private Integer smallParkingLotNum;
+
+
+}

+ 73 - 0
src/main/java/com/qmrb/system/pojo/entity/ContractPlaceNumberRel.java

@@ -0,0 +1,73 @@
+package com.qmrb.system.pojo.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.qmrb.system.common.base.BaseEntity;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 协议(客商)车牌关系
+ * </p>
+ *
+ * @author xue
+ * @since 2025-03-11
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("contract_place_number_rel")
+public class ContractPlaceNumberRel extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 车型 1大型 2小型
+     */
+    @TableField("car_type")
+    private String carType;
+
+    /**
+     * 联系电话
+     */
+    @TableField("phone")
+    private String phone;
+
+    /**
+     * 车牌号
+     */
+    @TableField("plate_number")
+    private String plateNumber;
+
+    /**
+     * 开始时间
+     */
+    @TableField("start_time")
+    private Date startTime;
+
+    /**
+     * 到期日期
+     */
+    @TableField("end_time")
+    private Date endTime;
+
+    /**
+     * 0停用1启用 2到期
+     */
+    @TableField("status")
+    private String status;
+
+    /**
+     * 协议ID
+     */
+    @TableField("contract_id")
+    private Long contractId;
+
+
+}

+ 7 - 0
src/main/java/com/qmrb/system/pojo/entity/SysUser.java

@@ -90,6 +90,13 @@ public class SysUser implements Serializable {
      */
     @TableField("coupon_mode")
     private String couponMode;
+
+    /**
+     * 协议ID
+     */
+    @TableField("contract_id")
+    private Long contractId;
+
     
     @TableField(fill = FieldFill.INSERT)
     @JsonInclude(value = JsonInclude.Include.NON_NULL)

+ 105 - 0
src/main/java/com/qmrb/system/pojo/form/ContractForm.java

@@ -0,0 +1,105 @@
+package com.qmrb.system.pojo.form;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+/**
+ * <p>
+ * 客商协议表表单
+ * </p>
+ *
+ * @author xue
+ * @since 2025-03-11
+ */
+@Data
+public class ContractForm {
+
+    private Long id;
+    /**
+     * 协议名称
+     */
+	@Schema(description = "协议名称",type="String")
+    private String contractName;
+    /**
+     * 停车场ID
+     */
+	@Schema(description = "停车场ID",type="Long")
+    private Long carParkId;
+    /**
+     * 2 扫码协议 3:包租协议
+     */
+	@Schema(description = "2 扫码协议 3:包租协议",type="String")
+    private String contractType;
+    /**
+     * 开始日期
+     */
+	@Schema(description = "开始日期",type="Date")
+    private Date startDate;
+    /**
+     * 结束日期
+     */
+	@Schema(description = "结束日期",type="Date")
+    private Date endDate;
+    /**
+     * 联系人姓名
+     */
+	@Schema(description = "联系人姓名",type="String")
+    private String contactName;
+    /**
+     * 联系人电话
+     */
+	@Schema(description = "联系人电话",type="String")
+    private String contactPhone;
+    /**
+     * 1 扫码抵用金额 2扫码抵用时长
+     */
+	@Schema(description = "1 扫码抵用金额 2扫码抵用时长",type="String")
+    private String scanType;
+    /**
+     *  发券数量上限
+     */
+	@Schema(description = " 发券数量上限",type="Integer")
+    private Integer maxCouponCount;
+    /**
+     * 抵用金额
+     */
+	@Schema(description = "抵用金额",type="BigDecimal")
+    private BigDecimal discountAmount;
+    /**
+     * 抵用分钟数
+     */
+	@Schema(description = "抵用分钟数",type="Integer")
+    private Integer discountMinute;
+    /**
+     * 二维码屏登录账号
+     */
+	@Schema(description = "二维码屏登录账号",type="String")
+    private String username;
+    /**
+     * 二维码屏登录密码
+     */
+	@Schema(description = "二维码屏登录密码",type="String")
+    private String password;
+    /**
+     * 二维码屏登录地址
+     */
+	@Schema(description = "二维码屏登录地址",type="String")
+    private String qrcodeLoginUrl;
+    /**
+     * 使用车位上限
+     */
+	@Schema(description = "使用车位上限",type="Integer")
+    private Integer maxParkingLotNum;
+    /**
+     * 其中大型车位
+     */
+	@Schema(description = "其中大型车位",type="Integer")
+    private Integer bigParkingLotNum;
+    /**
+     * 其中小型车位
+     */
+	@Schema(description = "其中小型车位",type="Integer")
+    private Integer smallParkingLotNum;
+
+
+}

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

@@ -0,0 +1,57 @@
+package com.qmrb.system.pojo.form;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * <p>
+ * 协议(客商)车牌关系表单
+ * </p>
+ *
+ * @author xue
+ * @since 2025-03-11
+ */
+@Data
+public class ContractPlaceNumberRelForm {
+
+    private Long id;
+    /**
+     * 车型 1大型 2小型
+     */
+	@Schema(description = "车型 1大型 2小型",type="String")
+    private String carType;
+    /**
+     * 联系电话
+     */
+	@Schema(description = "联系电话",type="String")
+    private String phone;
+    /**
+     * 车牌号
+     */
+	@Schema(description = "车牌号",type="String")
+    private String plateNumber;
+    /**
+     * 开始时间
+     */
+	@Schema(description = "开始时间",type="Date")
+    private Date startTime;
+    /**
+     * 到期日期
+     */
+	@Schema(description = "到期日期",type="Date")
+    private Date endTime;
+    /**
+     * 0停用1启用 2到期
+     */
+	@Schema(description = "0停用1启用 2到期",type="String")
+    private String status;
+    /**
+     * 协议ID
+     */
+	@Schema(description = "协议ID",type="Long")
+    private Long contractId;
+
+
+}

+ 63 - 0
src/main/java/com/qmrb/system/pojo/query/ContractPlaceNumberRelQuery.java

@@ -0,0 +1,63 @@
+package com.qmrb.system.pojo.query;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import com.qmrb.system.common.base.BasePageQuery;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * <p>
+ * 协议(客商)车牌关系查询对象
+ * </p>
+ *
+ * @author xue
+ * @since 2025-03-11
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ContractPlaceNumberRelQuery extends BasePageQuery{
+
+ 	@Schema(description="关键字")
+    private String keywords;
+
+    private Long id;
+    /**
+     * 车型 1大型 2小型
+     */
+	@Schema(description = "车型 1大型 2小型",type="String")
+    private String carType;
+    /**
+     * 联系电话
+     */
+	@Schema(description = "联系电话",type="String")
+    private String phone;
+    /**
+     * 车牌号
+     */
+	@Schema(description = "车牌号",type="String")
+    private String plateNumber;
+    /**
+     * 开始时间
+     */
+	@Schema(description = "开始时间",type="Date")
+    private Date startTime;
+    /**
+     * 到期日期
+     */
+	@Schema(description = "到期日期",type="Date")
+    private Date endTime;
+    /**
+     * 0停用1启用 2到期
+     */
+	@Schema(description = "0停用1启用 2到期",type="String")
+    private String status;
+    /**
+     * 协议ID
+     */
+	@Schema(description = "协议ID",type="Long")
+    private Long contractId;
+
+
+}

+ 111 - 0
src/main/java/com/qmrb/system/pojo/query/ContractQuery.java

@@ -0,0 +1,111 @@
+package com.qmrb.system.pojo.query;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import com.qmrb.system.common.base.BasePageQuery;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 客商协议表查询对象
+ * </p>
+ *
+ * @author xue
+ * @since 2025-03-11
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ContractQuery extends BasePageQuery{
+
+ 	@Schema(description="关键字")
+    private String keywords;
+
+    private Long id;
+    /**
+     * 协议名称
+     */
+	@Schema(description = "协议名称",type="String")
+    private String contractName;
+    /**
+     * 停车场ID
+     */
+	@Schema(description = "停车场ID",type="Long")
+    private Long carParkId;
+    /**
+     * 2 扫码协议 3:包租协议
+     */
+	@Schema(description = "2 扫码协议 3:包租协议",type="String")
+    private String contractType;
+    /**
+     * 开始日期
+     */
+	@Schema(description = "开始日期",type="Date")
+    private Date startDate;
+    /**
+     * 结束日期
+     */
+	@Schema(description = "结束日期",type="Date")
+    private Date endDate;
+    /**
+     * 联系人姓名
+     */
+	@Schema(description = "联系人姓名",type="String")
+    private String contactName;
+    /**
+     * 联系人电话
+     */
+	@Schema(description = "联系人电话",type="String")
+    private String contactPhone;
+    /**
+     * 1 扫码抵用金额 2扫码抵用时长
+     */
+	@Schema(description = "1 扫码抵用金额 2扫码抵用时长",type="String")
+    private String scanType;
+    /**
+     *  发券数量上限
+     */
+	@Schema(description = " 发券数量上限",type="Integer")
+    private Integer maxCouponCount;
+    /**
+     * 抵用金额
+     */
+	@Schema(description = "抵用金额",type="BigDecimal")
+    private BigDecimal discountAmount;
+    /**
+     * 抵用分钟数
+     */
+	@Schema(description = "抵用分钟数",type="Integer")
+    private Integer discountMinute;
+    /**
+     * 二维码屏登录账号
+     */
+	@Schema(description = "二维码屏登录账号",type="String")
+    private String username;
+    /**
+     * 二维码屏登录密码
+     */
+	@Schema(description = "二维码屏登录密码",type="String")
+    private String password;
+    /**
+     * 二维码屏登录地址
+     */
+	@Schema(description = "二维码屏登录地址",type="String")
+    private String qrcodeLoginUrl;
+    /**
+     * 使用车位上限
+     */
+	@Schema(description = "使用车位上限",type="Integer")
+    private Integer maxParkingLotNum;
+    /**
+     * 其中大型车位
+     */
+	@Schema(description = "其中大型车位",type="Integer")
+    private Integer bigParkingLotNum;
+    /**
+     * 其中小型车位
+     */
+	@Schema(description = "其中小型车位",type="Integer")
+    private Integer smallParkingLotNum;
+
+
+}

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

@@ -0,0 +1,58 @@
+package com.qmrb.system.pojo.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * <p>
+ * 协议(客商)车牌关系视图对象
+ * </p>
+ *
+ * @author xue
+ * @since 2025-03-11
+ */
+@Data
+public class ContractPlaceNumberRelVO {
+
+    private Long id;
+    /**
+     * 车型 1大型 2小型
+     */
+	@Schema(description = "车型 1大型 2小型",type="String")
+    private String carType;
+    /**
+     * 联系电话
+     */
+	@Schema(description = "联系电话",type="String")
+    private String phone;
+    /**
+     * 车牌号
+     */
+	@Schema(description = "车牌号",type="String")
+    private String plateNumber;
+    /**
+     * 开始时间
+     */
+	@Schema(description = "开始时间",type="Date")
+    private Date startTime;
+    /**
+     * 到期日期
+     */
+	@Schema(description = "到期日期",type="Date")
+    private Date endTime;
+    /**
+     * 0停用1启用 2到期
+     */
+	@Schema(description = "0停用1启用 2到期",type="String")
+    private String status;
+    /**
+     * 协议ID
+     */
+	@Schema(description = "协议ID",type="Long")
+    private Long contractId;
+
+
+
+}

+ 106 - 0
src/main/java/com/qmrb/system/pojo/vo/ContractVO.java

@@ -0,0 +1,106 @@
+package com.qmrb.system.pojo.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+/**
+ * <p>
+ * 客商协议表视图对象
+ * </p>
+ *
+ * @author xue
+ * @since 2025-03-11
+ */
+@Data
+public class ContractVO {
+
+    private Long id;
+    /**
+     * 协议名称
+     */
+	@Schema(description = "协议名称",type="String")
+    private String contractName;
+    /**
+     * 停车场ID
+     */
+	@Schema(description = "停车场ID",type="Long")
+    private Long carParkId;
+    /**
+     * 2 扫码协议 3:包租协议
+     */
+	@Schema(description = "2 扫码协议 3:包租协议",type="String")
+    private String contractType;
+    /**
+     * 开始日期
+     */
+	@Schema(description = "开始日期",type="Date")
+    private Date startDate;
+    /**
+     * 结束日期
+     */
+	@Schema(description = "结束日期",type="Date")
+    private Date endDate;
+    /**
+     * 联系人姓名
+     */
+	@Schema(description = "联系人姓名",type="String")
+    private String contactName;
+    /**
+     * 联系人电话
+     */
+	@Schema(description = "联系人电话",type="String")
+    private String contactPhone;
+    /**
+     * 1 扫码抵用金额 2扫码抵用时长
+     */
+	@Schema(description = "1 扫码抵用金额 2扫码抵用时长",type="String")
+    private String scanType;
+    /**
+     *  发券数量上限
+     */
+	@Schema(description = " 发券数量上限",type="Integer")
+    private Integer maxCouponCount;
+    /**
+     * 抵用金额
+     */
+	@Schema(description = "抵用金额",type="BigDecimal")
+    private BigDecimal discountAmount;
+    /**
+     * 抵用分钟数
+     */
+	@Schema(description = "抵用分钟数",type="Integer")
+    private Integer discountMinute;
+    /**
+     * 二维码屏登录账号
+     */
+	@Schema(description = "二维码屏登录账号",type="String")
+    private String username;
+    /**
+     * 二维码屏登录密码
+     */
+	@Schema(description = "二维码屏登录密码",type="String")
+    private String password;
+    /**
+     * 二维码屏登录地址
+     */
+	@Schema(description = "二维码屏登录地址",type="String")
+    private String qrcodeLoginUrl;
+    /**
+     * 使用车位上限
+     */
+	@Schema(description = "使用车位上限",type="Integer")
+    private Integer maxParkingLotNum;
+    /**
+     * 其中大型车位
+     */
+	@Schema(description = "其中大型车位",type="Integer")
+    private Integer bigParkingLotNum;
+    /**
+     * 其中小型车位
+     */
+	@Schema(description = "其中小型车位",type="Integer")
+    private Integer smallParkingLotNum;
+
+
+
+}

+ 40 - 0
src/main/java/com/qmrb/system/service/IContractPlaceNumberRelService.java

@@ -0,0 +1,40 @@
+package com.qmrb.system.service;
+
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.qmrb.system.pojo.entity.ContractPlaceNumberRel;
+import com.qmrb.system.pojo.form.ContractPlaceNumberRelForm;
+import com.qmrb.system.pojo.vo.ContractPlaceNumberRelVO;
+import com.qmrb.system.pojo.query.ContractPlaceNumberRelQuery;
+import com.baomidou.mybatisplus.extension.service.IService;
+import jakarta.validation.Valid;
+
+/**
+ * <p>
+ * 协议(客商)车牌关系 服务类
+ * </p>
+ *
+ * @author xue
+ * @since 2025-03-11
+ */
+public interface IContractPlaceNumberRelService extends IService<ContractPlaceNumberRel> {
+	
+	/**分页查询
+	 * */
+	public Page<ContractPlaceNumberRelVO> getPage(ContractPlaceNumberRelQuery queryParams);
+	
+
+	/**
+	 * 保存表单
+	 * */
+	public ContractPlaceNumberRelForm saveForm(@Valid ContractPlaceNumberRelForm form);
+	
+	/**更新
+	 * */
+	public boolean updateForm(Long id, ContractPlaceNumberRelForm form);
+	
+	/**获取表单数据
+	 * */
+	public ContractPlaceNumberRelForm getFormData(Long id);
+	
+}

+ 40 - 0
src/main/java/com/qmrb/system/service/IContractService.java

@@ -0,0 +1,40 @@
+package com.qmrb.system.service;
+
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.qmrb.system.pojo.entity.Contract;
+import com.qmrb.system.pojo.form.ContractForm;
+import com.qmrb.system.pojo.vo.ContractVO;
+import com.qmrb.system.pojo.query.ContractQuery;
+import com.baomidou.mybatisplus.extension.service.IService;
+import jakarta.validation.Valid;
+
+/**
+ * <p>
+ * 客商协议表 服务类
+ * </p>
+ *
+ * @author xue
+ * @since 2025-03-11
+ */
+public interface IContractService extends IService<Contract> {
+	
+	/**分页查询
+	 * */
+	public Page<ContractVO> getPage(ContractQuery queryParams);
+	
+
+	/**
+	 * 保存表单
+	 * */
+	public ContractForm saveForm(@Valid ContractForm form);
+	
+	/**更新
+	 * */
+	public boolean updateForm(Long id, ContractForm form);
+	
+	/**获取表单数据
+	 * */
+	public ContractForm getFormData(Long id);
+	
+}

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

@@ -0,0 +1,104 @@
+package com.qmrb.system.service.impl;
+
+
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+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.ContractPlaceNumberRel;
+import com.qmrb.system.pojo.entity.SysUser;
+import com.qmrb.system.pojo.form.ContractPlaceNumberRelForm;
+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.SysUserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import cn.hutool.core.lang.Assert;
+import jakarta.validation.Valid;
+import lombok.RequiredArgsConstructor;
+
+/**
+ * <p>
+ * 协议(客商)车牌关系 服务实现类
+ * </p>
+ *
+ * @author xue
+ * @since 2025-03-11
+ */
+@Service
+@RequiredArgsConstructor
+public class ContractPlaceNumberRelServiceImpl extends ServiceImpl<ContractPlaceNumberRelMapper, ContractPlaceNumberRel> implements IContractPlaceNumberRelService {
+
+	private final ContractPlaceNumberRelConverter converter;
+
+	@Autowired
+	SysUserService userService;
+
+	/**分页查询
+	 * */
+	@Override
+	public Page<ContractPlaceNumberRelVO> getPage(ContractPlaceNumberRelQuery queryParams) {
+		// 查询参数
+        int pageNum = queryParams.getPageNum();
+        int pageSize = queryParams.getPageSize();
+        //Integer status = queryParams.getStatus();
+        //String keywords = queryParams.getKeywords();
+		SysUser sysUser = userService.getOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getId,SecurityUtils.getUserId()));
+        // 查询数据
+        Page<ContractPlaceNumberRel> dictItemPage = this.page(
+                new Page<>(pageNum, pageSize),
+                new LambdaQueryWrapper<ContractPlaceNumberRel>()
+                	.eq(sysUser != null, ContractPlaceNumberRel::getContractId,sysUser.getContractId())
+                	//.like(StrUtil.isNotBlank(keywords), ContractPlaceNumberRel::getCategoryName, keywords)
+        );
+
+        // 实体转换
+        Page<ContractPlaceNumberRelVO> pageResult = converter.entity2Page(dictItemPage);
+        return pageResult;
+	}
+	
+	
+
+	/**
+	 * 保存表单
+	 * */
+	@Override
+	public ContractPlaceNumberRelForm saveForm(@Valid ContractPlaceNumberRelForm form) {
+		// 实体对象转换 form->entity
+		ContractPlaceNumberRel entity = converter.form2Entity(form);
+        // 持久化
+        this.save(entity);
+        ContractPlaceNumberRelForm result = converter.entity2Form(entity);
+        return result;
+	}
+
+	/**更新
+	 * */
+	@Override
+	public boolean updateForm(Long id, ContractPlaceNumberRelForm form) {
+		ContractPlaceNumberRel entity = converter.form2Entity(form);
+		entity.setId(id);
+        boolean result = this.updateById(entity);
+        return result;
+	}
+
+	/**获取表单数据
+	 * */
+	@Override
+	public ContractPlaceNumberRelForm getFormData(Long id) {
+		// 获取entity
+		ContractPlaceNumberRel entity = this.getById(id);
+        Assert.isTrue(entity != null, "协议(客商)车牌关系不存在");
+
+        // 实体转换
+        ContractPlaceNumberRelForm form = converter.entity2Form(entity);
+        return form;
+	}
+	
+}

+ 96 - 0
src/main/java/com/qmrb/system/service/impl/ContractServiceImpl.java

@@ -0,0 +1,96 @@
+package com.qmrb.system.service.impl;
+
+
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.qmrb.system.converter.ContractConverter;
+import com.qmrb.system.pojo.entity.Contract;
+import com.qmrb.system.pojo.form.ContractForm;
+import com.qmrb.system.pojo.vo.ContractVO;
+import com.qmrb.system.pojo.query.ContractQuery;
+import com.qmrb.system.mapper.ContractMapper;
+import com.qmrb.system.service.IContractService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import cn.hutool.core.lang.Assert;
+import jakarta.validation.Valid;
+import lombok.RequiredArgsConstructor;
+
+/**
+ * <p>
+ * 客商协议表 服务实现类
+ * </p>
+ *
+ * @author xue
+ * @since 2025-03-11
+ */
+@Service
+@RequiredArgsConstructor
+public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> implements IContractService {
+
+	private final ContractConverter converter;
+
+	/**分页查询
+	 * */
+	@Override
+	public Page<ContractVO> getPage(ContractQuery queryParams) {
+		// 查询参数
+        int pageNum = queryParams.getPageNum();
+        int pageSize = queryParams.getPageSize();
+        //Integer status = queryParams.getStatus();
+        //String keywords = queryParams.getKeywords();
+
+        // 查询数据
+        Page<Contract> dictItemPage = this.page(
+                new Page<>(pageNum, pageSize),
+                new LambdaQueryWrapper<Contract>()
+                	//.eq(status != null, Contract::getStatus,status)
+                	//.like(StrUtil.isNotBlank(keywords), Contract::getCategoryName, keywords)
+        );
+
+        // 实体转换
+        Page<ContractVO> pageResult = converter.entity2Page(dictItemPage);
+        return pageResult;
+	}
+	
+	
+
+	/**
+	 * 保存表单
+	 * */
+	@Override
+	public ContractForm saveForm(@Valid ContractForm form) {
+		// 实体对象转换 form->entity
+		Contract entity = converter.form2Entity(form);
+        // 持久化
+        this.save(entity);
+        ContractForm result = converter.entity2Form(entity);
+        return result;
+	}
+
+	/**更新
+	 * */
+	@Override
+	public boolean updateForm(Long id, ContractForm form) {
+		Contract entity = converter.form2Entity(form);
+		entity.setId(id);
+        boolean result = this.updateById(entity);
+        return result;
+	}
+
+	/**获取表单数据
+	 * */
+	@Override
+	public ContractForm getFormData(Long id) {
+		// 获取entity
+		Contract entity = this.getById(id);
+        Assert.isTrue(entity != null, "客商协议表不存在");
+
+        // 实体转换
+        ContractForm form = converter.entity2Form(entity);
+        return form;
+	}
+	
+}

+ 5 - 0
src/main/resources/mapper/ContractMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.qmrb.system.mapper.ContractMapper">
+
+</mapper>

+ 5 - 0
src/main/resources/mapper/ContractPlaceNumberRelMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.qmrb.system.mapper.ContractPlaceNumberRelMapper">
+
+</mapper>