39 changed files with 2795 additions and 1 deletions
@ -0,0 +1,81 @@ |
|||||
|
package com.epmet.plugin.power.dto.rent; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 黑名单表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-22 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class RentBlacklistDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 主键 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* epmet用户主键 |
||||
|
*/ |
||||
|
@NotBlank(message = "用户ID不能为空") |
||||
|
private String userId; |
||||
|
|
||||
|
/** |
||||
|
* 姓名 |
||||
|
*/ |
||||
|
@NotBlank(message = "姓名不能为空") |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 身份证 |
||||
|
*/ |
||||
|
@NotBlank(message = "身份证不能为空") |
||||
|
private String idCard; |
||||
|
|
||||
|
/** |
||||
|
* 手机号 |
||||
|
*/ |
||||
|
@NotBlank(message = "手机号不能为空") |
||||
|
private String mobile; |
||||
|
|
||||
|
/** |
||||
|
* 性别 0女 1男 |
||||
|
*/ |
||||
|
@NotBlank(message = "性别不能为空") |
||||
|
private String gender; |
||||
|
|
||||
|
/** |
||||
|
* 类型 0 租客 1 房东 |
||||
|
*/ |
||||
|
@NotBlank(message = "人员类型不能为空") |
||||
|
private String type; |
||||
|
|
||||
|
/** |
||||
|
* 加入时间 |
||||
|
*/ |
||||
|
private String joinDate; |
||||
|
|
||||
|
/** |
||||
|
* 加入原因 |
||||
|
*/ |
||||
|
private String joinReason; |
||||
|
|
||||
|
/** |
||||
|
* 移除时间 |
||||
|
*/ |
||||
|
private String removeDate; |
||||
|
|
||||
|
/** |
||||
|
* 移除原因 |
||||
|
*/ |
||||
|
private String removeReason; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,69 @@ |
|||||
|
package com.epmet.plugin.power.dto.rent; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 附件表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-22 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class RentContractFileDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* ID |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 引用ID |
||||
|
*/ |
||||
|
private String referenceId; |
||||
|
|
||||
|
/** |
||||
|
* 文件地址 |
||||
|
*/ |
||||
|
private String fileUrl; |
||||
|
|
||||
|
/** |
||||
|
* 文件类型 0:图片,1 文件(合同) |
||||
|
*/ |
||||
|
private String fileType; |
||||
|
|
||||
|
/** |
||||
|
* 删除标识 0:未删除,1:删除 |
||||
|
*/ |
||||
|
private Integer delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,188 @@ |
|||||
|
package com.epmet.plugin.power.dto.rent; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import javax.validation.constraints.NotEmpty; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 合同表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-22 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class RentContractInfoDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 主键 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 社区ID |
||||
|
*/ |
||||
|
private String communityId; |
||||
|
|
||||
|
/** |
||||
|
* 社区 |
||||
|
*/ |
||||
|
private String communityName; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
@NotBlank(message = "网格信息不能为空") |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 网格 |
||||
|
*/ |
||||
|
private String gridName; |
||||
|
|
||||
|
/** |
||||
|
* 房屋小区ID |
||||
|
*/ |
||||
|
@NotBlank(message = "小区信息不能为空") |
||||
|
private String villageId; |
||||
|
|
||||
|
/** |
||||
|
* 房屋小区 |
||||
|
*/ |
||||
|
private String villageName; |
||||
|
|
||||
|
/** |
||||
|
* 楼号ID |
||||
|
*/ |
||||
|
@NotBlank(message = "楼栋信息不能为空") |
||||
|
private String buildId; |
||||
|
|
||||
|
/** |
||||
|
* 楼号 |
||||
|
*/ |
||||
|
private String buildName; |
||||
|
|
||||
|
/** |
||||
|
* 单元ID |
||||
|
*/ |
||||
|
@NotBlank(message = "单元信息不能为空") |
||||
|
private String unitId; |
||||
|
|
||||
|
/** |
||||
|
* 单元 |
||||
|
*/ |
||||
|
private String unitName; |
||||
|
|
||||
|
/** |
||||
|
* 房屋ID |
||||
|
*/ |
||||
|
@NotBlank(message = "房屋信息不能为空") |
||||
|
private String homeId; |
||||
|
|
||||
|
/** |
||||
|
* 房屋 |
||||
|
*/ |
||||
|
private String homeName; |
||||
|
|
||||
|
/** |
||||
|
* 房主姓名 |
||||
|
*/ |
||||
|
@NotBlank(message = "房主信息不能为空") |
||||
|
private String ownerName; |
||||
|
|
||||
|
/** |
||||
|
* 租户数 |
||||
|
*/ |
||||
|
private Integer tenantNum; |
||||
|
|
||||
|
/** |
||||
|
* 状态:0未审核,1审核通过,2审核不通过 |
||||
|
*/ |
||||
|
private String state; |
||||
|
|
||||
|
/** |
||||
|
* 出租人姓名 |
||||
|
*/ |
||||
|
@NotBlank(message = "出租人姓名不能为空") |
||||
|
private String lessorName; |
||||
|
|
||||
|
/** |
||||
|
* 出租人身份证 |
||||
|
*/ |
||||
|
@NotBlank(message = "出租人身份证不能为空") |
||||
|
private String lessorIdCard; |
||||
|
|
||||
|
/** |
||||
|
* 出租人手机 |
||||
|
*/ |
||||
|
@NotBlank(message = "出租人手机不能为空") |
||||
|
private String lessorMobile; |
||||
|
|
||||
|
/** |
||||
|
* 承租人姓名 |
||||
|
*/ |
||||
|
@NotBlank(message = "承租人姓名不能为空") |
||||
|
private String lesseeName; |
||||
|
|
||||
|
/** |
||||
|
* 承租人身份证 |
||||
|
*/ |
||||
|
@NotBlank(message = "承租人身份证不能为空") |
||||
|
private String lesseeIdCard; |
||||
|
|
||||
|
/** |
||||
|
* 承租人手机 |
||||
|
*/ |
||||
|
@NotBlank(message = "承租人手机不能为空") |
||||
|
private String lesseeMobile; |
||||
|
|
||||
|
/** |
||||
|
* 签署日期 |
||||
|
*/ |
||||
|
@NotBlank(message = "签订时间不能为空") |
||||
|
private String signDate; |
||||
|
|
||||
|
/** |
||||
|
* 审核日期 |
||||
|
*/ |
||||
|
private String reviewDate; |
||||
|
|
||||
|
/** |
||||
|
* 合同开始日期 |
||||
|
*/ |
||||
|
@NotBlank(message = "合同开始时间不能为空") |
||||
|
private String startDate; |
||||
|
|
||||
|
/** |
||||
|
* 合同结束日期 |
||||
|
*/ |
||||
|
@NotBlank(message = "合同结束时间不能为空") |
||||
|
private String endDate; |
||||
|
|
||||
|
/** |
||||
|
* 审核-原因 |
||||
|
*/ |
||||
|
private String reason; |
||||
|
|
||||
|
/** |
||||
|
* 租客列表 |
||||
|
*/ |
||||
|
@NotEmpty |
||||
|
private List<RentTenantInfoDTO> tenantList; |
||||
|
|
||||
|
/** |
||||
|
* 附件列表 |
||||
|
*/ |
||||
|
@NotEmpty |
||||
|
private List<RentContractFileDTO> fileList; |
||||
|
|
||||
|
/** |
||||
|
* 是否黑名单 |
||||
|
*/ |
||||
|
private String isBlack; |
||||
|
} |
||||
@ -0,0 +1,67 @@ |
|||||
|
package com.epmet.plugin.power.dto.rent; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import javax.validation.constraints.NotEmpty; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 租客表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-22 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class RentTenantInfoDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 主键 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 合同ID |
||||
|
*/ |
||||
|
private String contractId; |
||||
|
|
||||
|
/** |
||||
|
* 姓名 |
||||
|
*/ |
||||
|
@NotBlank(message = "姓名不能为空") |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 身份证 |
||||
|
*/ |
||||
|
@NotBlank(message = "身份证不能为空") |
||||
|
private String idCard; |
||||
|
|
||||
|
/** |
||||
|
* 手机号 |
||||
|
*/ |
||||
|
@NotBlank(message = "手机号不能为空") |
||||
|
private String mobile; |
||||
|
|
||||
|
/** |
||||
|
* 与房主关系 |
||||
|
*/ |
||||
|
private String yfzgx; |
||||
|
|
||||
|
/** |
||||
|
* 人员类型 0:房东 1:租客 |
||||
|
*/ |
||||
|
@NotBlank(message = "人员类型不能为空") |
||||
|
private String type; |
||||
|
|
||||
|
/** |
||||
|
* 头像列表 |
||||
|
*/ |
||||
|
@NotEmpty |
||||
|
private List<RentContractFileDTO> imgList; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,80 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.aop.NoRepeatSubmit; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.ExcelUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.AssertUtils; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.commons.tools.validator.group.AddGroup; |
||||
|
import com.epmet.commons.tools.validator.group.UpdateGroup; |
||||
|
import com.epmet.commons.tools.validator.group.DefaultGroup; |
||||
|
import com.epmet.plugin.power.dto.rent.RentBlacklistDTO; |
||||
|
import com.epmet.plugin.power.modules.rent.excel.RentBlacklistExcel; |
||||
|
import com.epmet.plugin.power.modules.rent.service.RentBlacklistService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 黑名单表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-22 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("rentBlacklist") |
||||
|
public class RentBlacklistController { |
||||
|
|
||||
|
@Autowired |
||||
|
private RentBlacklistService rentBlacklistService; |
||||
|
|
||||
|
@RequestMapping("page") |
||||
|
public Result<PageData<RentBlacklistDTO>> page(@RequestParam Map<String, Object> params) { |
||||
|
PageData<RentBlacklistDTO> page = rentBlacklistService.page(params); |
||||
|
return new Result<PageData<RentBlacklistDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) |
||||
|
public Result<RentBlacklistDTO> get(@PathVariable("id") String id) { |
||||
|
RentBlacklistDTO data = rentBlacklistService.get(id); |
||||
|
return new Result<RentBlacklistDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@NoRepeatSubmit |
||||
|
@PostMapping("save") |
||||
|
public Result save(@RequestBody RentBlacklistDTO dto) { |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
return rentBlacklistService.save(dto); |
||||
|
} |
||||
|
|
||||
|
@NoRepeatSubmit |
||||
|
@PostMapping("update") |
||||
|
public Result update(@RequestBody RentBlacklistDTO dto) { |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
rentBlacklistService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@DeleteMapping("delete") |
||||
|
public Result delete(@RequestBody String[] ids) { |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
rentBlacklistService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("export") |
||||
|
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
||||
|
List<RentBlacklistDTO> list = rentBlacklistService.list(params); |
||||
|
ExcelUtils.exportExcelToTarget(response, null, list, RentBlacklistExcel.class); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,81 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.aop.NoRepeatSubmit; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.ExcelUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.AssertUtils; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.commons.tools.validator.group.AddGroup; |
||||
|
import com.epmet.commons.tools.validator.group.UpdateGroup; |
||||
|
import com.epmet.commons.tools.validator.group.DefaultGroup; |
||||
|
import com.epmet.plugin.power.dto.rent.RentContractFileDTO; |
||||
|
import com.epmet.plugin.power.modules.rent.excel.RentContractFileExcel; |
||||
|
import com.epmet.plugin.power.modules.rent.service.RentContractFileService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 附件表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-22 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("rentContractFile") |
||||
|
public class RentContractFileController { |
||||
|
|
||||
|
@Autowired |
||||
|
private RentContractFileService rentContractFileService; |
||||
|
|
||||
|
@RequestMapping("page") |
||||
|
public Result<PageData<RentContractFileDTO>> page(@RequestParam Map<String, Object> params) { |
||||
|
PageData<RentContractFileDTO> page = rentContractFileService.page(params); |
||||
|
return new Result<PageData<RentContractFileDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) |
||||
|
public Result<RentContractFileDTO> get(@PathVariable("id") String id) { |
||||
|
RentContractFileDTO data = rentContractFileService.get(id); |
||||
|
return new Result<RentContractFileDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@NoRepeatSubmit |
||||
|
@PostMapping("save") |
||||
|
public Result save(@RequestBody RentContractFileDTO dto) { |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
rentContractFileService.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@NoRepeatSubmit |
||||
|
@PostMapping("update") |
||||
|
public Result update(@RequestBody RentContractFileDTO dto) { |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
rentContractFileService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PostMapping("delete") |
||||
|
public Result delete(@RequestBody String[] ids) { |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
rentContractFileService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("export") |
||||
|
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
||||
|
List<RentContractFileDTO> list = rentContractFileService.list(params); |
||||
|
ExcelUtils.exportExcelToTarget(response, null, list, RentContractFileExcel.class); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,89 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.aop.NoRepeatSubmit; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.ExcelUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.AssertUtils; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.commons.tools.validator.group.AddGroup; |
||||
|
import com.epmet.commons.tools.validator.group.DefaultGroup; |
||||
|
import com.epmet.commons.tools.validator.group.UpdateGroup; |
||||
|
import com.epmet.plugin.power.dto.rent.RentContractInfoDTO; |
||||
|
import com.epmet.plugin.power.modules.rent.excel.RentContractInfoExcel; |
||||
|
import com.epmet.plugin.power.modules.rent.service.RentContractInfoService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 合同表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-22 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("rentContractInfo") |
||||
|
public class RentContractInfoController { |
||||
|
|
||||
|
@Autowired |
||||
|
private RentContractInfoService rentContractInfoService; |
||||
|
|
||||
|
@RequestMapping("page") |
||||
|
public Result<PageData<RentContractInfoDTO>> page(@RequestParam Map<String, Object> params) { |
||||
|
PageData<RentContractInfoDTO> page = rentContractInfoService.page(params); |
||||
|
return new Result<PageData<RentContractInfoDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) |
||||
|
public Result<RentContractInfoDTO> get(@PathVariable("id") String id) { |
||||
|
RentContractInfoDTO data = rentContractInfoService.get(id); |
||||
|
return new Result<RentContractInfoDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@NoRepeatSubmit |
||||
|
@PostMapping("save") |
||||
|
public Result save(@RequestBody RentContractInfoDTO dto) { |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
return rentContractInfoService.save(dto); |
||||
|
} |
||||
|
|
||||
|
@NoRepeatSubmit |
||||
|
@PostMapping("review") |
||||
|
public Result review(@RequestBody RentContractInfoDTO dto) { |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
rentContractInfoService.review(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@NoRepeatSubmit |
||||
|
@PostMapping("update") |
||||
|
public Result update(@RequestBody RentContractInfoDTO dto) { |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
rentContractInfoService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@DeleteMapping("delete") |
||||
|
public Result delete(@RequestBody String[] ids) { |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
rentContractInfoService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("export") |
||||
|
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
||||
|
List<RentContractInfoDTO> list = rentContractInfoService.list(params); |
||||
|
ExcelUtils.exportExcelToTarget(response, null, list, RentContractInfoExcel.class); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,80 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.aop.NoRepeatSubmit; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.ExcelUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.AssertUtils; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.commons.tools.validator.group.AddGroup; |
||||
|
import com.epmet.commons.tools.validator.group.UpdateGroup; |
||||
|
import com.epmet.commons.tools.validator.group.DefaultGroup; |
||||
|
import com.epmet.plugin.power.dto.rent.RentTenantInfoDTO; |
||||
|
import com.epmet.plugin.power.modules.rent.excel.RentTenantInfoExcel; |
||||
|
import com.epmet.plugin.power.modules.rent.service.RentTenantInfoService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 租客表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-22 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("rentTenantInfo") |
||||
|
public class RentTenantInfoController { |
||||
|
|
||||
|
@Autowired |
||||
|
private RentTenantInfoService rentTenantInfoService; |
||||
|
|
||||
|
@RequestMapping("page") |
||||
|
public Result<PageData<RentTenantInfoDTO>> page(@RequestParam Map<String, Object> params) { |
||||
|
PageData<RentTenantInfoDTO> page = rentTenantInfoService.page(params); |
||||
|
return new Result<PageData<RentTenantInfoDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) |
||||
|
public Result<RentTenantInfoDTO> get(@PathVariable("id") String id) { |
||||
|
RentTenantInfoDTO data = rentTenantInfoService.get(id); |
||||
|
return new Result<RentTenantInfoDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@NoRepeatSubmit |
||||
|
@PostMapping("save") |
||||
|
public Result save(@RequestBody RentTenantInfoDTO dto) { |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
return rentTenantInfoService.save(dto); |
||||
|
} |
||||
|
|
||||
|
@NoRepeatSubmit |
||||
|
@PostMapping("update") |
||||
|
public Result update(@RequestBody RentTenantInfoDTO dto) { |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
rentTenantInfoService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PostMapping("delete") |
||||
|
public Result delete(@RequestBody String[] ids) { |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
rentTenantInfoService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("export") |
||||
|
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
||||
|
List<RentTenantInfoDTO> list = rentTenantInfoService.list(params); |
||||
|
ExcelUtils.exportExcelToTarget(response, null, list, RentTenantInfoExcel.class); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,16 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.plugin.power.modules.rent.entity.RentBlacklistEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
/** |
||||
|
* 黑名单表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-22 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface RentBlacklistDao extends BaseDao<RentBlacklistEntity> { |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,28 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.plugin.power.modules.rent.entity.RentContractFileEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 附件表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-22 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface RentContractFileDao extends BaseDao<RentContractFileEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 物理删除 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return void |
||||
|
* @author zhy |
||||
|
* @date 2022/4/24 14:08 |
||||
|
*/ |
||||
|
void deletePhysical(Map<String, Object> params); |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,29 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.plugin.power.dto.rent.RentContractInfoDTO; |
||||
|
import com.epmet.plugin.power.modules.rent.entity.RentContractInfoEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 合同表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-22 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface RentContractInfoDao extends BaseDao<RentContractInfoEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 获取合同列表 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<com.epmet.plugin.power.dto.rent.RentContractInfoDTO> |
||||
|
* @author zhy |
||||
|
* @date 2022/4/24 17:18 |
||||
|
*/ |
||||
|
List<RentContractInfoDTO> getContractInfoList(Map<String, Object> params); |
||||
|
} |
||||
@ -0,0 +1,28 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.plugin.power.modules.rent.entity.RentTenantInfoEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 租客表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-22 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface RentTenantInfoDao extends BaseDao<RentTenantInfoEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 物理删除 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return void |
||||
|
* @author zhy |
||||
|
* @date 2022/4/24 14:08 |
||||
|
*/ |
||||
|
void deletePhysical(Map<String, Object> params); |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,79 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 黑名单表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-22 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("pli_rent_blacklist") |
||||
|
public class RentBlacklistEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* epmet用户主键 |
||||
|
*/ |
||||
|
private String userId; |
||||
|
|
||||
|
/** |
||||
|
* 姓名 |
||||
|
*/ |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 身份证 |
||||
|
*/ |
||||
|
private String idCard; |
||||
|
|
||||
|
/** |
||||
|
* 手机号 |
||||
|
*/ |
||||
|
private String mobile; |
||||
|
|
||||
|
/** |
||||
|
* 性别 0女 1男 |
||||
|
*/ |
||||
|
private String gender; |
||||
|
|
||||
|
/** |
||||
|
* 类型 0 租客 1 房东 |
||||
|
*/ |
||||
|
private String type; |
||||
|
|
||||
|
/** |
||||
|
* 加入时间 |
||||
|
*/ |
||||
|
private String joinDate; |
||||
|
|
||||
|
/** |
||||
|
* 加入原因 |
||||
|
*/ |
||||
|
private String joinReason; |
||||
|
|
||||
|
/** |
||||
|
* 移除时间 |
||||
|
*/ |
||||
|
private String removeDate; |
||||
|
|
||||
|
/** |
||||
|
* 移除原因 |
||||
|
*/ |
||||
|
private String removeReason; |
||||
|
|
||||
|
/** |
||||
|
* 客户ID |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,44 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 附件表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-22 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("pli_rent_contract_file") |
||||
|
public class RentContractFileEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 引用ID |
||||
|
*/ |
||||
|
private String referenceId; |
||||
|
|
||||
|
/** |
||||
|
* 文件地址 |
||||
|
*/ |
||||
|
private String fileUrl; |
||||
|
|
||||
|
/** |
||||
|
* 文件类型 0:图片,1 文件(合同) |
||||
|
*/ |
||||
|
private String fileType; |
||||
|
|
||||
|
/** |
||||
|
* 客户ID |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,154 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 合同表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-22 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("pli_rent_contract_info") |
||||
|
public class RentContractInfoEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 社区ID |
||||
|
*/ |
||||
|
private String communityId; |
||||
|
|
||||
|
/** |
||||
|
* 社区 |
||||
|
*/ |
||||
|
private String communityName; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 网格 |
||||
|
*/ |
||||
|
private String gridName; |
||||
|
|
||||
|
/** |
||||
|
* 房屋小区ID |
||||
|
*/ |
||||
|
private String villageId; |
||||
|
|
||||
|
/** |
||||
|
* 房屋小区 |
||||
|
*/ |
||||
|
private String villageName; |
||||
|
|
||||
|
/** |
||||
|
* 楼号ID |
||||
|
*/ |
||||
|
private String buildId; |
||||
|
|
||||
|
/** |
||||
|
* 楼号 |
||||
|
*/ |
||||
|
private String buildName; |
||||
|
|
||||
|
/** |
||||
|
* 单元ID |
||||
|
*/ |
||||
|
private String unitId; |
||||
|
|
||||
|
/** |
||||
|
* 单元 |
||||
|
*/ |
||||
|
private String unitName; |
||||
|
|
||||
|
/** |
||||
|
* 房屋ID |
||||
|
*/ |
||||
|
private String homeId; |
||||
|
|
||||
|
/** |
||||
|
* 房屋 |
||||
|
*/ |
||||
|
private String homeName; |
||||
|
|
||||
|
/** |
||||
|
* 房主姓名 |
||||
|
*/ |
||||
|
private String ownerName; |
||||
|
|
||||
|
/** |
||||
|
* 状态:0未审核,1审核通过,2审核不通过 |
||||
|
*/ |
||||
|
private String state; |
||||
|
|
||||
|
/** |
||||
|
* 出租人姓名 |
||||
|
*/ |
||||
|
private String lessorName; |
||||
|
|
||||
|
/** |
||||
|
* 出租人身份证 |
||||
|
*/ |
||||
|
private String lessorIdCard; |
||||
|
|
||||
|
/** |
||||
|
* 出租人手机 |
||||
|
*/ |
||||
|
private String lessorMobile; |
||||
|
|
||||
|
/** |
||||
|
* 承租人姓名 |
||||
|
*/ |
||||
|
private String lesseeName; |
||||
|
|
||||
|
/** |
||||
|
* 承租人身份证 |
||||
|
*/ |
||||
|
private String lesseeIdCard; |
||||
|
|
||||
|
/** |
||||
|
* 承租人手机 |
||||
|
*/ |
||||
|
private String lesseeMobile; |
||||
|
|
||||
|
/** |
||||
|
* 签署日期 |
||||
|
*/ |
||||
|
private String signDate; |
||||
|
|
||||
|
/** |
||||
|
* 审核日期 |
||||
|
*/ |
||||
|
private String reviewDate; |
||||
|
|
||||
|
/** |
||||
|
* 合同开始日期 |
||||
|
*/ |
||||
|
private String startDate; |
||||
|
|
||||
|
/** |
||||
|
* 合同结束日期 |
||||
|
*/ |
||||
|
private String endDate; |
||||
|
|
||||
|
/** |
||||
|
* 审核-原因 |
||||
|
*/ |
||||
|
private String reason; |
||||
|
|
||||
|
/** |
||||
|
* 客户ID |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,68 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import com.epmet.plugin.power.dto.rent.RentContractFileDTO; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 租客表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-22 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("pli_rent_tenant_info") |
||||
|
public class RentTenantInfoEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 合同ID |
||||
|
*/ |
||||
|
private String contractId; |
||||
|
|
||||
|
/** |
||||
|
* 姓名 |
||||
|
*/ |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 身份证 |
||||
|
*/ |
||||
|
private String idCard; |
||||
|
|
||||
|
/** |
||||
|
* 手机号 |
||||
|
*/ |
||||
|
private String mobile; |
||||
|
|
||||
|
/** |
||||
|
* 与房主关系 |
||||
|
*/ |
||||
|
private String yfzgx; |
||||
|
|
||||
|
/** |
||||
|
* 人员类型 0:房东 1:租客 |
||||
|
*/ |
||||
|
private String type; |
||||
|
|
||||
|
/** |
||||
|
* 客户ID |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 头像列表 |
||||
|
*/ |
||||
|
@TableField(exist = false) |
||||
|
private List<RentContractFileDTO> imgList; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,69 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.excel; |
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.annotation.Excel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 黑名单表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-22 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class RentBlacklistExcel { |
||||
|
|
||||
|
@Excel(name = "主键") |
||||
|
private String id; |
||||
|
|
||||
|
@Excel(name = "epmet用户主键") |
||||
|
private String userId; |
||||
|
|
||||
|
@Excel(name = "姓名") |
||||
|
private String name; |
||||
|
|
||||
|
@Excel(name = "身份证") |
||||
|
private String idCard; |
||||
|
|
||||
|
@Excel(name = "手机号") |
||||
|
private String mobile; |
||||
|
|
||||
|
@Excel(name = "性别 0女 1男") |
||||
|
private String gender; |
||||
|
|
||||
|
@Excel(name = "类型 0 租客 1 房东") |
||||
|
private String type; |
||||
|
|
||||
|
@Excel(name = "加入时间") |
||||
|
private String joinDate; |
||||
|
|
||||
|
@Excel(name = "加入原因") |
||||
|
private String joinReason; |
||||
|
|
||||
|
@Excel(name = "移除时间") |
||||
|
private String removeDate; |
||||
|
|
||||
|
@Excel(name = "移除原因") |
||||
|
private String removeReason; |
||||
|
|
||||
|
@Excel(name = "删除标记 0:未删除,1:已删除") |
||||
|
private String delFlag; |
||||
|
|
||||
|
@Excel(name = "乐观锁") |
||||
|
private Integer revision; |
||||
|
|
||||
|
@Excel(name = "创建人") |
||||
|
private String createdBy; |
||||
|
|
||||
|
@Excel(name = "创建时间") |
||||
|
private Date createdTime; |
||||
|
|
||||
|
@Excel(name = "更新人") |
||||
|
private String updatedBy; |
||||
|
|
||||
|
@Excel(name = "更新时间") |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,48 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.excel; |
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.annotation.Excel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 附件表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-22 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class RentContractFileExcel { |
||||
|
|
||||
|
@Excel(name = "ID") |
||||
|
private String id; |
||||
|
|
||||
|
@Excel(name = "引用ID") |
||||
|
private String referenceId; |
||||
|
|
||||
|
@Excel(name = "文件地址") |
||||
|
private String fileUrl; |
||||
|
|
||||
|
@Excel(name = "文件类型") |
||||
|
private String fileType; |
||||
|
|
||||
|
@Excel(name = "删除标识 0:未删除,1:删除") |
||||
|
private Integer delFlag; |
||||
|
|
||||
|
@Excel(name = "乐观锁") |
||||
|
private Integer revision; |
||||
|
|
||||
|
@Excel(name = "创建人") |
||||
|
private String createdBy; |
||||
|
|
||||
|
@Excel(name = "创建时间") |
||||
|
private Date createdTime; |
||||
|
|
||||
|
@Excel(name = "更新人") |
||||
|
private String updatedBy; |
||||
|
|
||||
|
@Excel(name = "更新时间") |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,99 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.excel; |
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.annotation.Excel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 合同表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-22 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class RentContractInfoExcel { |
||||
|
|
||||
|
@Excel(name = "主键") |
||||
|
private String id; |
||||
|
|
||||
|
@Excel(name = "网格ID") |
||||
|
private String gridId; |
||||
|
|
||||
|
@Excel(name = "网格") |
||||
|
private String gridName; |
||||
|
|
||||
|
@Excel(name = "楼号ID") |
||||
|
private String buildId; |
||||
|
|
||||
|
@Excel(name = "楼号") |
||||
|
private String buildName; |
||||
|
|
||||
|
@Excel(name = "单元ID") |
||||
|
private String unitId; |
||||
|
|
||||
|
@Excel(name = "单元") |
||||
|
private String unitName; |
||||
|
|
||||
|
@Excel(name = "房屋ID") |
||||
|
private String homeId; |
||||
|
|
||||
|
@Excel(name = "房屋") |
||||
|
private String homeName; |
||||
|
|
||||
|
@Excel(name = "房主姓名") |
||||
|
private String ownerName; |
||||
|
|
||||
|
@Excel(name = "状态:0未审核,1审核通过,2审核不通过") |
||||
|
private String state; |
||||
|
|
||||
|
@Excel(name = "出租人姓名") |
||||
|
private String lessorName; |
||||
|
|
||||
|
@Excel(name = "出租人身份证") |
||||
|
private String lessorIdCard; |
||||
|
|
||||
|
@Excel(name = "出租人手机") |
||||
|
private String lessorMobile; |
||||
|
|
||||
|
@Excel(name = "承租人姓名") |
||||
|
private String lesseeName; |
||||
|
|
||||
|
@Excel(name = "承租人身份证") |
||||
|
private String lesseeIdCard; |
||||
|
|
||||
|
@Excel(name = "承租人手机") |
||||
|
private String lesseeMobile; |
||||
|
|
||||
|
@Excel(name = "签署日期") |
||||
|
private String signDate; |
||||
|
|
||||
|
@Excel(name = "合同开始日期") |
||||
|
private String startDate; |
||||
|
|
||||
|
@Excel(name = "合同结束日期") |
||||
|
private String endDate; |
||||
|
|
||||
|
@Excel(name = "审核-原因") |
||||
|
private String reason; |
||||
|
|
||||
|
@Excel(name = "删除标记 0:未删除,1:已删除") |
||||
|
private String delFlag; |
||||
|
|
||||
|
@Excel(name = "乐观锁") |
||||
|
private Integer revision; |
||||
|
|
||||
|
@Excel(name = "创建人") |
||||
|
private String createdBy; |
||||
|
|
||||
|
@Excel(name = "创建时间") |
||||
|
private Date createdTime; |
||||
|
|
||||
|
@Excel(name = "更新人") |
||||
|
private String updatedBy; |
||||
|
|
||||
|
@Excel(name = "更新时间") |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,57 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.excel; |
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.annotation.Excel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 租客表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-22 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class RentTenantInfoExcel { |
||||
|
|
||||
|
@Excel(name = "主键") |
||||
|
private String id; |
||||
|
|
||||
|
@Excel(name = "合同ID") |
||||
|
private String contractId; |
||||
|
|
||||
|
@Excel(name = "姓名") |
||||
|
private String name; |
||||
|
|
||||
|
@Excel(name = "身份证") |
||||
|
private String idCard; |
||||
|
|
||||
|
@Excel(name = "手机号") |
||||
|
private String mobile; |
||||
|
|
||||
|
@Excel(name = "与房主关系") |
||||
|
private String yfzgx; |
||||
|
|
||||
|
@Excel(name = "照片") |
||||
|
private String img; |
||||
|
|
||||
|
@Excel(name = "删除标记 0:未删除,1:已删除") |
||||
|
private String delFlag; |
||||
|
|
||||
|
@Excel(name = "乐观锁") |
||||
|
private Integer revision; |
||||
|
|
||||
|
@Excel(name = "创建人") |
||||
|
private String createdBy; |
||||
|
|
||||
|
@Excel(name = "创建时间") |
||||
|
private Date createdTime; |
||||
|
|
||||
|
@Excel(name = "更新人") |
||||
|
private String updatedBy; |
||||
|
|
||||
|
@Excel(name = "更新时间") |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,30 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.redis; |
||||
|
|
||||
|
import com.epmet.commons.tools.redis.RedisUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* 黑名单表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-22 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class RentBlacklistRedis { |
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
public void delete(Object[] ids) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void set(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String get(String id){ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,30 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.redis; |
||||
|
|
||||
|
import com.epmet.commons.tools.redis.RedisUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* 附件表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-22 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class RentContractFileRedis { |
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
public void delete(Object[] ids) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void set(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String get(String id){ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,30 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.redis; |
||||
|
|
||||
|
import com.epmet.commons.tools.redis.RedisUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* 合同表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-22 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class RentContractInfoRedis { |
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
public void delete(Object[] ids) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void set(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String get(String id){ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,30 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.redis; |
||||
|
|
||||
|
import com.epmet.commons.tools.redis.RedisUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* 租客表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-22 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class RentTenantInfoRedis { |
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
public void delete(Object[] ids) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void set(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String get(String id){ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,79 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.service; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.plugin.power.dto.rent.RentBlacklistDTO; |
||||
|
import com.epmet.plugin.power.modules.rent.entity.RentBlacklistEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 黑名单表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-22 |
||||
|
*/ |
||||
|
public interface RentBlacklistService extends BaseService<RentBlacklistEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<RentBlacklistDTO> |
||||
|
* @author generator |
||||
|
* @date 2022-04-22 |
||||
|
*/ |
||||
|
PageData<RentBlacklistDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<RentBlacklistDTO> |
||||
|
* @author generator |
||||
|
* @date 2022-04-22 |
||||
|
*/ |
||||
|
List<RentBlacklistDTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return RentBlacklistDTO |
||||
|
* @author generator |
||||
|
* @date 2022-04-22 |
||||
|
*/ |
||||
|
RentBlacklistDTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-04-22 |
||||
|
*/ |
||||
|
Result save(RentBlacklistDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 默认更新 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-04-22 |
||||
|
*/ |
||||
|
void update(RentBlacklistDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除 |
||||
|
* |
||||
|
* @param ids |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-04-22 |
||||
|
*/ |
||||
|
void delete(String[] ids); |
||||
|
} |
||||
@ -0,0 +1,88 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.service; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.plugin.power.dto.rent.RentContractFileDTO; |
||||
|
import com.epmet.plugin.power.modules.rent.entity.RentContractFileEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 附件表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-22 |
||||
|
*/ |
||||
|
public interface RentContractFileService extends BaseService<RentContractFileEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<RentContractFileDTO> |
||||
|
* @author generator |
||||
|
* @date 2022-04-22 |
||||
|
*/ |
||||
|
PageData<RentContractFileDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<RentContractFileDTO> |
||||
|
* @author generator |
||||
|
* @date 2022-04-22 |
||||
|
*/ |
||||
|
List<RentContractFileDTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return RentContractFileDTO |
||||
|
* @author generator |
||||
|
* @date 2022-04-22 |
||||
|
*/ |
||||
|
RentContractFileDTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-04-22 |
||||
|
*/ |
||||
|
void save(RentContractFileDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 默认更新 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-04-22 |
||||
|
*/ |
||||
|
void update(RentContractFileDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除 |
||||
|
* |
||||
|
* @param ids |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-04-22 |
||||
|
*/ |
||||
|
void delete(String[] ids); |
||||
|
|
||||
|
/** |
||||
|
* 物理删除 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return void |
||||
|
* @author zhy |
||||
|
* @date 2022/4/24 14:08 |
||||
|
*/ |
||||
|
void deletePhysical(Map<String, Object> params); |
||||
|
} |
||||
@ -0,0 +1,89 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.service; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.plugin.power.dto.rent.RentContractInfoDTO; |
||||
|
import com.epmet.plugin.power.modules.rent.entity.RentContractInfoEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 合同表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-22 |
||||
|
*/ |
||||
|
public interface RentContractInfoService extends BaseService<RentContractInfoEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<RentContractInfoDTO> |
||||
|
* @author generator |
||||
|
* @date 2022-04-22 |
||||
|
*/ |
||||
|
PageData<RentContractInfoDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<RentContractInfoDTO> |
||||
|
* @author generator |
||||
|
* @date 2022-04-22 |
||||
|
*/ |
||||
|
List<RentContractInfoDTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return RentContractInfoDTO |
||||
|
* @author generator |
||||
|
* @date 2022-04-22 |
||||
|
*/ |
||||
|
RentContractInfoDTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-04-22 |
||||
|
*/ |
||||
|
Result save(RentContractInfoDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 审核 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-04-22 |
||||
|
*/ |
||||
|
void review(RentContractInfoDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 默认更新 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-04-22 |
||||
|
*/ |
||||
|
void update(RentContractInfoDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除 |
||||
|
* |
||||
|
* @param ids |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-04-22 |
||||
|
*/ |
||||
|
void delete(String[] ids); |
||||
|
} |
||||
@ -0,0 +1,89 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.service; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.plugin.power.dto.rent.RentTenantInfoDTO; |
||||
|
import com.epmet.plugin.power.modules.rent.entity.RentTenantInfoEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 租客表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-22 |
||||
|
*/ |
||||
|
public interface RentTenantInfoService extends BaseService<RentTenantInfoEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<RentTenantInfoDTO> |
||||
|
* @author generator |
||||
|
* @date 2022-04-22 |
||||
|
*/ |
||||
|
PageData<RentTenantInfoDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<RentTenantInfoDTO> |
||||
|
* @author generator |
||||
|
* @date 2022-04-22 |
||||
|
*/ |
||||
|
List<RentTenantInfoDTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return RentTenantInfoDTO |
||||
|
* @author generator |
||||
|
* @date 2022-04-22 |
||||
|
*/ |
||||
|
RentTenantInfoDTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-04-22 |
||||
|
*/ |
||||
|
Result save(RentTenantInfoDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 默认更新 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-04-22 |
||||
|
*/ |
||||
|
void update(RentTenantInfoDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除 |
||||
|
* |
||||
|
* @param ids |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-04-22 |
||||
|
*/ |
||||
|
void delete(String[] ids); |
||||
|
|
||||
|
/** |
||||
|
* 物理删除 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return void |
||||
|
* @author zhy |
||||
|
* @date 2022/4/24 14:08 |
||||
|
*/ |
||||
|
void deletePhysical(Map<String, Object> params); |
||||
|
} |
||||
@ -0,0 +1,129 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.epmet.commons.tools.constant.FieldConstant; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.security.user.LoginUserUtil; |
||||
|
import com.epmet.commons.tools.utils.ConvertUtils; |
||||
|
import com.epmet.commons.tools.utils.DateUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.commons.tools.validator.group.DefaultGroup; |
||||
|
import com.epmet.commons.tools.validator.group.UpdateGroup; |
||||
|
import com.epmet.dto.form.RentTenantDataFormDTO; |
||||
|
import com.epmet.dto.result.RentTenantDataResultDTO; |
||||
|
import com.epmet.feign.EpmetUserOpenFeignClient; |
||||
|
import com.epmet.plugin.power.dto.rent.RentBlacklistDTO; |
||||
|
import com.epmet.plugin.power.modules.rent.dao.RentBlacklistDao; |
||||
|
import com.epmet.plugin.power.modules.rent.entity.RentBlacklistEntity; |
||||
|
import com.epmet.plugin.power.modules.rent.redis.RentBlacklistRedis; |
||||
|
import com.epmet.plugin.power.modules.rent.service.RentBlacklistService; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import java.util.*; |
||||
|
|
||||
|
/** |
||||
|
* 黑名单表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-22 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class RentBlacklistServiceImpl extends BaseServiceImpl<RentBlacklistDao, RentBlacklistEntity> implements RentBlacklistService { |
||||
|
|
||||
|
@Autowired |
||||
|
private RentBlacklistRedis rentBlacklistRedis; |
||||
|
|
||||
|
@Autowired |
||||
|
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
||||
|
|
||||
|
@Autowired |
||||
|
LoginUserUtil loginUserUtil; |
||||
|
|
||||
|
@Override |
||||
|
public PageData<RentBlacklistDTO> page(Map<String, Object> params) { |
||||
|
IPage<RentBlacklistEntity> page = baseDao.selectPage( |
||||
|
getPage(params, FieldConstant.CREATED_TIME, false), |
||||
|
getWrapper(params) |
||||
|
); |
||||
|
return getPageData(page, RentBlacklistDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<RentBlacklistDTO> list(Map<String, Object> params) { |
||||
|
List<RentBlacklistEntity> entityList = baseDao.selectList(getWrapper(params)); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, RentBlacklistDTO.class); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<RentBlacklistEntity> getWrapper(Map<String, Object> params) { |
||||
|
String id = (String) params.get(FieldConstant.ID_HUMP); |
||||
|
String name = (String) params.get("name"); |
||||
|
String idCard = (String) params.get("idCard"); |
||||
|
String mobile = (String) params.get("mobile"); |
||||
|
String startTime = (String) params.get("startTime"); |
||||
|
String endTime = (String) params.get("endTime"); |
||||
|
|
||||
|
QueryWrapper<RentBlacklistEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
||||
|
wrapper.eq(StringUtils.isNotBlank(name), "NAME", name); |
||||
|
wrapper.eq(StringUtils.isNotBlank(idCard), "ID_CARD", idCard); |
||||
|
wrapper.eq(StringUtils.isNotBlank(mobile), "MOBILE", mobile); |
||||
|
wrapper.ge(StringUtils.isNotBlank(startTime), "JOIN_DATE", startTime); |
||||
|
wrapper.le(StringUtils.isNotBlank(endTime), "JOIN_DATE", endTime); |
||||
|
|
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RentBlacklistDTO get(String id) { |
||||
|
RentBlacklistEntity entity = baseDao.selectById(id); |
||||
|
return ConvertUtils.sourceToTarget(entity, RentBlacklistDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public Result save(RentBlacklistDTO dto) { |
||||
|
RentTenantDataFormDTO formDTO = new RentTenantDataFormDTO(); |
||||
|
formDTO.setUserId(dto.getUserId()); |
||||
|
formDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId()); |
||||
|
ValidatorUtils.validateEntity(formDTO, UpdateGroup.class, DefaultGroup.class); |
||||
|
Result<RentTenantDataResultDTO> result = epmetUserOpenFeignClient.getRentResiUserInfo(formDTO); |
||||
|
|
||||
|
dto.setIdCard(result.getData().getIdCard()); |
||||
|
dto.setMobile(result.getData().getMobile()); |
||||
|
Map<String, Object> params = new HashMap<>(4); |
||||
|
params.put("idCard", dto.getIdCard()); |
||||
|
if (!list(params).isEmpty()) { |
||||
|
return new Result().error("该人员已经在黑名单"); |
||||
|
} |
||||
|
|
||||
|
dto.setJoinDate(DateUtils.format(new Date())); |
||||
|
RentBlacklistEntity entity = ConvertUtils.sourceToTarget(dto, RentBlacklistEntity.class); |
||||
|
entity.setCustomerId(loginUserUtil.getLoginUserCustomerId()); |
||||
|
insert(entity); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void update(RentBlacklistDTO dto) { |
||||
|
dto.setRemoveDate(DateUtils.format(new Date())); |
||||
|
RentBlacklistEntity entity = ConvertUtils.sourceToTarget(dto, RentBlacklistEntity.class); |
||||
|
updateById(entity); |
||||
|
baseDao.deleteBatchIds(Collections.singletonList(entity.getId())); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String[] ids) { |
||||
|
// 逻辑删除(@TableLogic 注解)
|
||||
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,99 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.epmet.commons.tools.constant.FieldConstant; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.ConvertUtils; |
||||
|
import com.epmet.plugin.power.dto.rent.RentContractFileDTO; |
||||
|
import com.epmet.plugin.power.modules.rent.dao.RentContractFileDao; |
||||
|
import com.epmet.plugin.power.modules.rent.entity.RentContractFileEntity; |
||||
|
import com.epmet.plugin.power.modules.rent.redis.RentContractFileRedis; |
||||
|
import com.epmet.plugin.power.modules.rent.service.RentContractFileService; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import java.util.Arrays; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 附件表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-22 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class RentContractFileServiceImpl extends BaseServiceImpl<RentContractFileDao, RentContractFileEntity> implements RentContractFileService { |
||||
|
|
||||
|
@Autowired |
||||
|
private RentContractFileRedis rentContractFileRedis; |
||||
|
|
||||
|
@Override |
||||
|
public PageData<RentContractFileDTO> page(Map<String, Object> params) { |
||||
|
IPage<RentContractFileEntity> page = baseDao.selectPage( |
||||
|
getPage(params, FieldConstant.CREATED_TIME, false), |
||||
|
getWrapper(params) |
||||
|
); |
||||
|
return getPageData(page, RentContractFileDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<RentContractFileDTO> list(Map<String, Object> params) { |
||||
|
List<RentContractFileEntity> entityList = baseDao.selectList(getWrapper(params)); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, RentContractFileDTO.class); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<RentContractFileEntity> getWrapper(Map<String, Object> params) { |
||||
|
String id = (String) params.get(FieldConstant.ID_HUMP); |
||||
|
String referenceId = (String) params.get("referenceId"); |
||||
|
String fileType = (String) params.get("fileType"); |
||||
|
|
||||
|
QueryWrapper<RentContractFileEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
||||
|
wrapper.eq(StringUtils.isNotBlank(referenceId), "REFERENCE_ID", referenceId); |
||||
|
wrapper.eq(StringUtils.isNotBlank(fileType), "FILE_TYPE", fileType); |
||||
|
|
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RentContractFileDTO get(String id) { |
||||
|
RentContractFileEntity entity = baseDao.selectById(id); |
||||
|
return ConvertUtils.sourceToTarget(entity, RentContractFileDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void save(RentContractFileDTO dto) { |
||||
|
RentContractFileEntity entity = ConvertUtils.sourceToTarget(dto, RentContractFileEntity.class); |
||||
|
insert(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void update(RentContractFileDTO dto) { |
||||
|
RentContractFileEntity entity = ConvertUtils.sourceToTarget(dto, RentContractFileEntity.class); |
||||
|
updateById(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String[] ids) { |
||||
|
// 逻辑删除(@TableLogic 注解)
|
||||
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void deletePhysical(Map<String, Object> params) { |
||||
|
if (!params.isEmpty()) { |
||||
|
baseDao.deletePhysical(params); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,282 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.epmet.commons.tools.constant.FieldConstant; |
||||
|
import com.epmet.commons.tools.constant.NumConstant; |
||||
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
||||
|
import com.epmet.commons.tools.exception.EpmetException; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.security.user.LoginUserUtil; |
||||
|
import com.epmet.commons.tools.utils.ConvertUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.dto.CustomerAgencyDTO; |
||||
|
import com.epmet.dto.IcResiUserAttachmentDTO; |
||||
|
import com.epmet.dto.IcResiUserDTO; |
||||
|
import com.epmet.dto.form.RentTenantFormDTO; |
||||
|
import com.epmet.feign.EpmetUserOpenFeignClient; |
||||
|
import com.epmet.feign.GovOrgOpenFeignClient; |
||||
|
import com.epmet.plugin.power.dto.rent.RentContractFileDTO; |
||||
|
import com.epmet.plugin.power.dto.rent.RentContractInfoDTO; |
||||
|
import com.epmet.plugin.power.dto.rent.RentTenantInfoDTO; |
||||
|
import com.epmet.plugin.power.modules.rent.dao.RentContractInfoDao; |
||||
|
import com.epmet.plugin.power.modules.rent.entity.RentContractFileEntity; |
||||
|
import com.epmet.plugin.power.modules.rent.entity.RentContractInfoEntity; |
||||
|
import com.epmet.plugin.power.modules.rent.entity.RentTenantInfoEntity; |
||||
|
import com.epmet.plugin.power.modules.rent.redis.RentContractInfoRedis; |
||||
|
import com.epmet.plugin.power.modules.rent.service.RentContractFileService; |
||||
|
import com.epmet.plugin.power.modules.rent.service.RentContractInfoService; |
||||
|
import com.epmet.plugin.power.modules.rent.service.RentTenantInfoService; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import java.util.*; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
/** |
||||
|
* 合同表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-22 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class RentContractInfoServiceImpl extends BaseServiceImpl<RentContractInfoDao, RentContractInfoEntity> implements RentContractInfoService { |
||||
|
|
||||
|
@Autowired |
||||
|
private RentContractInfoRedis rentContractInfoRedis; |
||||
|
|
||||
|
@Autowired |
||||
|
LoginUserUtil loginUserUtil; |
||||
|
|
||||
|
@Autowired |
||||
|
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
||||
|
|
||||
|
@Autowired |
||||
|
private GovOrgOpenFeignClient govOrgOpenFeignClient; |
||||
|
|
||||
|
@Autowired |
||||
|
private RentTenantInfoService rentTenantInfoService; |
||||
|
|
||||
|
@Autowired |
||||
|
private RentContractFileService rentContractFileService; |
||||
|
|
||||
|
@Override |
||||
|
public PageData<RentContractInfoDTO> page(Map<String, Object> params) { |
||||
|
IPage<RentContractInfoDTO> page = getPage(params); |
||||
|
List<RentContractInfoDTO> list = baseDao.getContractInfoList(params); |
||||
|
return new PageData<>(list, page.getTotal()); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<RentContractInfoDTO> list(Map<String, Object> params) { |
||||
|
List<RentContractInfoEntity> entityList = baseDao.selectList(getWrapper(params)); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, RentContractInfoDTO.class); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<RentContractInfoEntity> getWrapper(Map<String, Object> params) { |
||||
|
String id = (String) params.get(FieldConstant.ID_HUMP); |
||||
|
String gridId = (String) params.get("gridId"); |
||||
|
String villageId = (String) params.get("villageId"); |
||||
|
String buildId = (String) params.get("buildId"); |
||||
|
String unitId = (String) params.get("unitId"); |
||||
|
String homeId = (String) params.get("homeId"); |
||||
|
String state = (String) params.get("state"); |
||||
|
String lessorName = (String) params.get("lessorName"); |
||||
|
String lessorIdCard = (String) params.get("lessorIdCard"); |
||||
|
String lessorMobile = (String) params.get("lessorMobile"); |
||||
|
String lesseeName = (String) params.get("lesseeName"); |
||||
|
String lesseeIdCard = (String) params.get("lesseeIdCard"); |
||||
|
String lesseeMobile = (String) params.get("lesseeMobile"); |
||||
|
String startTime = (String) params.get("startTime"); |
||||
|
String endTime = (String) params.get("endTime"); |
||||
|
|
||||
|
String endDate = (String) params.get("endDate"); |
||||
|
|
||||
|
QueryWrapper<RentContractInfoEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
||||
|
wrapper.eq(StringUtils.isNotBlank(gridId), "GRID_ID", gridId); |
||||
|
wrapper.eq(StringUtils.isNotBlank(villageId), "VILLAGE_ID", villageId); |
||||
|
wrapper.eq(StringUtils.isNotBlank(buildId), "BUILD_ID", buildId); |
||||
|
wrapper.eq(StringUtils.isNotBlank(unitId), "UNIT_ID", unitId); |
||||
|
wrapper.eq(StringUtils.isNotBlank(homeId), "HOME_ID", homeId); |
||||
|
wrapper.eq(StringUtils.isNotBlank(state), "STATE", state); |
||||
|
wrapper.eq(StringUtils.isNotBlank(lessorName), "LESSOR_NAME", lessorName); |
||||
|
wrapper.eq(StringUtils.isNotBlank(lessorIdCard), "LESSOR_ID_CARD", lessorIdCard); |
||||
|
wrapper.eq(StringUtils.isNotBlank(lessorMobile), "LESSOR_MOBILE", lessorMobile); |
||||
|
wrapper.eq(StringUtils.isNotBlank(lesseeName), "LESSEE_NAME", lesseeName); |
||||
|
wrapper.eq(StringUtils.isNotBlank(lesseeIdCard), "LESSEE_ID_CARD", lesseeIdCard); |
||||
|
wrapper.eq(StringUtils.isNotBlank(lesseeMobile), "LESSEE_MOBILE", lesseeMobile); |
||||
|
|
||||
|
wrapper.eq(StringUtils.isNotBlank(endDate), "END_DATE", endDate); |
||||
|
|
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RentContractInfoDTO get(String id) { |
||||
|
RentContractInfoEntity entity = baseDao.selectById(id); |
||||
|
RentContractInfoDTO dto = ConvertUtils.sourceToTarget(entity, RentContractInfoDTO.class); |
||||
|
|
||||
|
Map<String, Object> params = new HashMap<>(4); |
||||
|
params.put("contractId", id); |
||||
|
|
||||
|
// 取出租客信息
|
||||
|
List<RentTenantInfoDTO> tenantList = rentTenantInfoService.list(params); |
||||
|
|
||||
|
tenantList.forEach(item -> { |
||||
|
// 租客信息补充照片信息
|
||||
|
params.put("referenceId", item.getId()); |
||||
|
params.put("fileType", NumConstant.ZERO_STR); |
||||
|
List<RentContractFileDTO> imgList = rentContractFileService.list(params); |
||||
|
item.setImgList(imgList); |
||||
|
}); |
||||
|
dto.setTenantList(tenantList); |
||||
|
dto.setTenantNum(tenantList.size()); |
||||
|
|
||||
|
params.put("referenceId", dto.getId()); |
||||
|
params.put("fileType", NumConstant.ONE_STR); |
||||
|
// 取出合同文件信息
|
||||
|
List<RentContractFileDTO> fileList = rentContractFileService.list(params); |
||||
|
dto.setFileList(fileList); |
||||
|
|
||||
|
return dto; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public Result save(RentContractInfoDTO dto) { |
||||
|
RentContractInfoEntity entity = ConvertUtils.sourceToTarget(dto, RentContractInfoEntity.class); |
||||
|
entity.setCustomerId(loginUserUtil.getLoginUserCustomerId()); |
||||
|
insert(entity); |
||||
|
return updateTenantAndFile(entity.getId(), dto); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void review(RentContractInfoDTO dto) { |
||||
|
RentContractInfoEntity entity = ConvertUtils.sourceToTarget(dto, RentContractInfoEntity.class); |
||||
|
updateById(entity); |
||||
|
// 如果审核通过,就去更新基础库头像信息以及居民信息
|
||||
|
if (NumConstant.ONE_STR.equals(entity.getState())) { |
||||
|
dto.getTenantList().forEach(tenant -> { |
||||
|
RentTenantFormDTO formDTO = new RentTenantFormDTO(); |
||||
|
List<IcResiUserAttachmentDTO> images = new ArrayList<>(); |
||||
|
formDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId()); |
||||
|
formDTO.setIdCard(tenant.getIdCard()); |
||||
|
formDTO.setImages(images); |
||||
|
formDTO.setType(NumConstant.ONE_STR); |
||||
|
|
||||
|
tenant.getImgList().forEach(img -> { |
||||
|
// 更新基础库的人员头像
|
||||
|
IcResiUserAttachmentDTO image = new IcResiUserAttachmentDTO(); |
||||
|
image.setAttachmentUrl(img.getFileUrl()); |
||||
|
image.setCustomerId(loginUserUtil.getLoginUserCustomerId()); |
||||
|
images.add(image); |
||||
|
}); |
||||
|
formDTO.setImages(images); |
||||
|
|
||||
|
// 初始化居民信息
|
||||
|
IcResiUserDTO user = new IcResiUserDTO(); |
||||
|
user.setCustomerId(loginUserUtil.getLoginUserCustomerId()); |
||||
|
user.setGridId(dto.getGridId()); |
||||
|
user.setVillageId(dto.getVillageId()); |
||||
|
user.setBuildId(dto.getBuildId()); |
||||
|
user.setUnitId(dto.getUnitId()); |
||||
|
user.setHomeId(dto.getHomeId()); |
||||
|
user.setName(tenant.getName()); |
||||
|
user.setIdCard(tenant.getIdCard()); |
||||
|
user.setMobile(tenant.getMobile()); |
||||
|
|
||||
|
user.setAgencyId(dto.getCommunityId()); |
||||
|
Result<CustomerAgencyDTO> agencyInfo = govOrgOpenFeignClient.getAgencyById(dto.getCommunityId()); |
||||
|
user.setPids(agencyInfo.getData().getPids()); |
||||
|
|
||||
|
formDTO.setUser(user); |
||||
|
|
||||
|
epmetUserOpenFeignClient.updateImage(formDTO); |
||||
|
|
||||
|
|
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void update(RentContractInfoDTO dto) { |
||||
|
RentContractInfoEntity entity = ConvertUtils.sourceToTarget(dto, RentContractInfoEntity.class); |
||||
|
updateById(entity); |
||||
|
updateTenantAndFile(entity.getId(), dto); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String[] ids) { |
||||
|
// 逻辑删除(@TableLogic 注解)
|
||||
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
||||
|
} |
||||
|
|
||||
|
private Result updateTenantAndFile(String contractId, RentContractInfoDTO dto) { |
||||
|
Map<String, Object> params = new HashMap<>(8); |
||||
|
params.put("contractId", contractId); |
||||
|
params.put("referenceId", contractId); |
||||
|
// 删除租客和合同文件
|
||||
|
rentTenantInfoService.deletePhysical(params); |
||||
|
rentContractFileService.deletePhysical(params); |
||||
|
|
||||
|
if (null == dto.getTenantList() || dto.getTenantList().isEmpty()) { |
||||
|
return new Result().error("租客不能为空"); |
||||
|
} else { |
||||
|
List<RentTenantInfoEntity> tenantList = ConvertUtils.sourceToTarget(dto.getTenantList(), RentTenantInfoEntity.class); |
||||
|
long idCardNum = tenantList.stream().map(RentTenantInfoEntity::getIdCard).collect(Collectors.toList()).stream().distinct().count(); |
||||
|
if (tenantList.size() != idCardNum) { |
||||
|
return new Result().error("租客身份证重复"); |
||||
|
} |
||||
|
|
||||
|
tenantList.forEach(tenant -> { |
||||
|
if (StringUtils.isNotBlank(tenant.getId())) { |
||||
|
// 如果是修改,先删除之前的头像
|
||||
|
params.put("referenceId", tenant.getId()); |
||||
|
params.put("fileType", NumConstant.ZERO_STR); |
||||
|
rentContractFileService.deletePhysical(params); |
||||
|
} |
||||
|
tenant.setContractId(contractId); |
||||
|
tenant.setType(NumConstant.ONE_STR); |
||||
|
tenant.setCustomerId(loginUserUtil.getLoginUserCustomerId()); |
||||
|
}); |
||||
|
rentTenantInfoService.insertBatch(tenantList); |
||||
|
// 处理租客头像
|
||||
|
dto.getTenantList().forEach(tenant -> { |
||||
|
if (null == tenant.getImgList() || tenant.getImgList().isEmpty()) { |
||||
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "租客照片不能为空"); |
||||
|
} else { |
||||
|
List<RentContractFileEntity> imgList = ConvertUtils.sourceToTarget(tenant.getImgList(), RentContractFileEntity.class); |
||||
|
imgList.forEach(img -> { |
||||
|
img.setReferenceId(tenant.getId()); |
||||
|
img.setFileType(NumConstant.ZERO_STR); |
||||
|
img.setCustomerId(loginUserUtil.getLoginUserCustomerId()); |
||||
|
}); |
||||
|
rentContractFileService.insertBatch(imgList); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
} |
||||
|
if (null == dto.getFileList() || dto.getFileList().isEmpty()) { |
||||
|
return new Result().error("合同附件不能为空"); |
||||
|
} else { |
||||
|
List<RentContractFileEntity> fileList = ConvertUtils.sourceToTarget(dto.getFileList(), RentContractFileEntity.class); |
||||
|
fileList.forEach(item -> { |
||||
|
item.setReferenceId(contractId); |
||||
|
item.setFileType(NumConstant.ONE_STR); |
||||
|
item.setCustomerId(loginUserUtil.getLoginUserCustomerId()); |
||||
|
}); |
||||
|
rentContractFileService.insertBatch(fileList); |
||||
|
} |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,153 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.epmet.commons.tools.constant.FieldConstant; |
||||
|
import com.epmet.commons.tools.constant.NumConstant; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.security.user.LoginUserUtil; |
||||
|
import com.epmet.commons.tools.utils.ConvertUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.dto.IcResiUserAttachmentDTO; |
||||
|
import com.epmet.dto.form.RentTenantFormDTO; |
||||
|
import com.epmet.feign.EpmetUserOpenFeignClient; |
||||
|
import com.epmet.plugin.power.dto.rent.RentTenantInfoDTO; |
||||
|
import com.epmet.plugin.power.modules.rent.dao.RentTenantInfoDao; |
||||
|
import com.epmet.plugin.power.modules.rent.entity.RentContractFileEntity; |
||||
|
import com.epmet.plugin.power.modules.rent.entity.RentTenantInfoEntity; |
||||
|
import com.epmet.plugin.power.modules.rent.redis.RentTenantInfoRedis; |
||||
|
import com.epmet.plugin.power.modules.rent.service.RentContractFileService; |
||||
|
import com.epmet.plugin.power.modules.rent.service.RentTenantInfoService; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import java.util.*; |
||||
|
|
||||
|
/** |
||||
|
* 租客表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-22 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class RentTenantInfoServiceImpl extends BaseServiceImpl<RentTenantInfoDao, RentTenantInfoEntity> implements RentTenantInfoService { |
||||
|
|
||||
|
@Autowired |
||||
|
private RentTenantInfoRedis rentTenantInfoRedis; |
||||
|
|
||||
|
@Autowired |
||||
|
LoginUserUtil loginUserUtil; |
||||
|
|
||||
|
@Autowired |
||||
|
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
||||
|
|
||||
|
@Autowired |
||||
|
private RentContractFileService rentContractFileService; |
||||
|
|
||||
|
@Override |
||||
|
public PageData<RentTenantInfoDTO> page(Map<String, Object> params) { |
||||
|
IPage<RentTenantInfoEntity> page = baseDao.selectPage( |
||||
|
getPage(params, FieldConstant.CREATED_TIME, false), |
||||
|
getWrapper(params) |
||||
|
); |
||||
|
return getPageData(page, RentTenantInfoDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<RentTenantInfoDTO> list(Map<String, Object> params) { |
||||
|
List<RentTenantInfoEntity> entityList = baseDao.selectList(getWrapper(params)); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, RentTenantInfoDTO.class); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<RentTenantInfoEntity> getWrapper(Map<String, Object> params) { |
||||
|
String id = (String) params.get(FieldConstant.ID_HUMP); |
||||
|
String contractId = (String) params.get("contractId"); |
||||
|
String idCard = (String) params.get("idCard"); |
||||
|
String type = (String) params.get("type"); |
||||
|
|
||||
|
QueryWrapper<RentTenantInfoEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
||||
|
wrapper.eq(StringUtils.isNotBlank(contractId), "CONTRACT_ID", contractId); |
||||
|
wrapper.eq(StringUtils.isNotBlank(idCard), "ID_CARD", idCard); |
||||
|
wrapper.eq(StringUtils.isNotBlank(type), "TYPE", type); |
||||
|
|
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RentTenantInfoDTO get(String id) { |
||||
|
RentTenantInfoEntity entity = baseDao.selectById(id); |
||||
|
return ConvertUtils.sourceToTarget(entity, RentTenantInfoDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public Result save(RentTenantInfoDTO dto) { |
||||
|
Map<String, Object> params = new HashMap<>(4); |
||||
|
params.put("idCard", dto.getIdCard()); |
||||
|
if (!list(params).isEmpty()) { |
||||
|
return new Result().error("用户已存在"); |
||||
|
} |
||||
|
|
||||
|
List<IcResiUserAttachmentDTO> images = new ArrayList<>(); |
||||
|
// 处理头像
|
||||
|
if (null == dto.getImgList() || dto.getImgList().isEmpty()) { |
||||
|
return new Result().error("照片不能为空"); |
||||
|
} else { |
||||
|
RentTenantInfoEntity entity = ConvertUtils.sourceToTarget(dto, RentTenantInfoEntity.class); |
||||
|
entity.setCustomerId(loginUserUtil.getLoginUserCustomerId()); |
||||
|
insert(entity); |
||||
|
|
||||
|
List<RentContractFileEntity> imgList = ConvertUtils.sourceToTarget(dto.getImgList(), RentContractFileEntity.class); |
||||
|
imgList.forEach(img -> { |
||||
|
img.setReferenceId(entity.getId()); |
||||
|
img.setFileType(NumConstant.ZERO_STR); |
||||
|
img.setCustomerId(loginUserUtil.getLoginUserCustomerId()); |
||||
|
|
||||
|
// 更新基础库的人员头像
|
||||
|
IcResiUserAttachmentDTO image = new IcResiUserAttachmentDTO(); |
||||
|
image.setAttachmentUrl(img.getFileUrl()); |
||||
|
image.setCustomerId(loginUserUtil.getLoginUserCustomerId()); |
||||
|
images.add(image); |
||||
|
}); |
||||
|
rentContractFileService.insertBatch(imgList); |
||||
|
|
||||
|
// 如果是房东信息立马去更新照片
|
||||
|
if (NumConstant.ZERO_STR.equals(dto.getType())) { |
||||
|
RentTenantFormDTO formDTO = new RentTenantFormDTO(); |
||||
|
formDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId()); |
||||
|
formDTO.setIdCard(dto.getIdCard()); |
||||
|
formDTO.setImages(images); |
||||
|
formDTO.setType(dto.getType()); |
||||
|
epmetUserOpenFeignClient.updateImage(formDTO); |
||||
|
} |
||||
|
} |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void update(RentTenantInfoDTO dto) { |
||||
|
RentTenantInfoEntity entity = ConvertUtils.sourceToTarget(dto, RentTenantInfoEntity.class); |
||||
|
updateById(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String[] ids) { |
||||
|
// 逻辑删除(@TableLogic 注解)
|
||||
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void deletePhysical(Map<String, Object> params) { |
||||
|
if (!params.isEmpty()) { |
||||
|
baseDao.deletePhysical(params); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,27 @@ |
|||||
|
<?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.epmet.plugin.power.modules.rent.dao.RentBlacklistDao"> |
||||
|
|
||||
|
<resultMap type="com.epmet.plugin.power.modules.rent.entity.RentBlacklistEntity" id="rentBlacklistMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="userId" column="USER_ID"/> |
||||
|
<result property="name" column="NAME"/> |
||||
|
<result property="idCard" column="ID_CARD"/> |
||||
|
<result property="mobile" column="MOBILE"/> |
||||
|
<result property="gender" column="GENDER"/> |
||||
|
<result property="type" column="TYPE"/> |
||||
|
<result property="joinDate" column="JOIN_DATE"/> |
||||
|
<result property="joinReason" column="JOIN_REASON"/> |
||||
|
<result property="removeDate" column="REMOVE_DATE"/> |
||||
|
<result property="removeReason" column="REMOVE_REASON"/> |
||||
|
<result property="delFlag" column="DEL_FLAG"/> |
||||
|
<result property="revision" column="REVISION"/> |
||||
|
<result property="createdBy" column="CREATED_BY"/> |
||||
|
<result property="createdTime" column="CREATED_TIME"/> |
||||
|
<result property="updatedBy" column="UPDATED_BY"/> |
||||
|
<result property="updatedTime" column="UPDATED_TIME"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
|
||||
|
</mapper> |
||||
@ -0,0 +1,32 @@ |
|||||
|
<?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.epmet.plugin.power.modules.rent.dao.RentContractFileDao"> |
||||
|
|
||||
|
<resultMap type="com.epmet.plugin.power.modules.rent.entity.RentContractFileEntity" id="rentContractFileMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="referenceId" column="REFERENCE_ID"/> |
||||
|
<result property="fileUrl" column="FILE_URL"/> |
||||
|
<result property="fileType" column="FILE_TYPE"/> |
||||
|
<result property="delFlag" column="DEL_FLAG"/> |
||||
|
<result property="revision" column="REVISION"/> |
||||
|
<result property="createdBy" column="CREATED_BY"/> |
||||
|
<result property="createdTime" column="CREATED_TIME"/> |
||||
|
<result property="updatedBy" column="UPDATED_BY"/> |
||||
|
<result property="updatedTime" column="UPDATED_TIME"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
<delete id="deletePhysical"> |
||||
|
DELETE |
||||
|
FROM |
||||
|
pli_rent_contract_file |
||||
|
<where> |
||||
|
<if test="referenceId != null and referenceId != ''"> |
||||
|
AND REFERENCE_ID = #{referenceId} |
||||
|
</if> |
||||
|
<if test="fileType != null and fileType != ''"> |
||||
|
AND FILE_TYPE = #{fileType} |
||||
|
</if> |
||||
|
</where> |
||||
|
</delete> |
||||
|
</mapper> |
||||
@ -0,0 +1,112 @@ |
|||||
|
<?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.epmet.plugin.power.modules.rent.dao.RentContractInfoDao"> |
||||
|
|
||||
|
<resultMap type="com.epmet.plugin.power.modules.rent.entity.RentContractInfoEntity" id="rentContractInfoMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="gridId" column="GRID_ID"/> |
||||
|
<result property="gridName" column="GRID_NAME"/> |
||||
|
<result property="buildId" column="BUILD_ID"/> |
||||
|
<result property="buildName" column="BUILD_NAME"/> |
||||
|
<result property="unitId" column="UNIT_ID"/> |
||||
|
<result property="unitName" column="UNIT_NAME"/> |
||||
|
<result property="homeId" column="HOME_ID"/> |
||||
|
<result property="homeName" column="HOME_NAME"/> |
||||
|
<result property="ownerName" column="OWNER_NAME"/> |
||||
|
<result property="state" column="STATE"/> |
||||
|
<result property="lessorName" column="LESSOR_NAME"/> |
||||
|
<result property="lessorIdCard" column="LESSOR_ID_CARD"/> |
||||
|
<result property="lessorMobile" column="LESSOR_MOBILE"/> |
||||
|
<result property="lesseeName" column="LESSEE_NAME"/> |
||||
|
<result property="lesseeIdCard" column="LESSEE_ID_CARD"/> |
||||
|
<result property="lesseeMobile" column="LESSEE_MOBILE"/> |
||||
|
<result property="signDate" column="SIGN_DATE"/> |
||||
|
<result property="startDate" column="START_DATE"/> |
||||
|
<result property="endDate" column="END_DATE"/> |
||||
|
<result property="reason" column="REASON"/> |
||||
|
<result property="delFlag" column="DEL_FLAG"/> |
||||
|
<result property="revision" column="REVISION"/> |
||||
|
<result property="createdBy" column="CREATED_BY"/> |
||||
|
<result property="createdTime" column="CREATED_TIME"/> |
||||
|
<result property="updatedBy" column="UPDATED_BY"/> |
||||
|
<result property="updatedTime" column="UPDATED_TIME"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
<select id="getContractInfoList" resultType="com.epmet.plugin.power.dto.rent.RentContractInfoDTO"> |
||||
|
SELECT |
||||
|
i.*, |
||||
|
IF |
||||
|
( b.id IS NULL, '否', '是' ) AS isBlack |
||||
|
FROM |
||||
|
pli_rent_contract_info i |
||||
|
LEFT JOIN pli_rent_blacklist b ON i.LESSEE_ID_CARD = b.ID_CARD |
||||
|
<where> |
||||
|
<if test="gridId != null and gridId != ''"> |
||||
|
AND i.GRID_ID = #{gridId} |
||||
|
</if> |
||||
|
<if test="villageId != null and villageId != ''"> |
||||
|
AND i.VILLAGE_ID = #{villageId} |
||||
|
</if> |
||||
|
<if test="buildId != null and buildId != ''"> |
||||
|
AND i.BUILD_ID = #{buildId} |
||||
|
</if> |
||||
|
<if test="unitId != null and unitId != ''"> |
||||
|
AND i.UNIT_ID = #{unitId} |
||||
|
</if> |
||||
|
<if test="homeId != null and homeId != ''"> |
||||
|
AND i.HOME_ID = #{homeId} |
||||
|
</if> |
||||
|
<if test="state != null and state != ''"> |
||||
|
AND i.STATE = #{state} |
||||
|
</if> |
||||
|
<if test="lessorName != null and lessorName != ''"> |
||||
|
AND i.LESSOR_NAME = #{lessorName} |
||||
|
</if> |
||||
|
<if test="lessorIdCard != null and lessorIdCard != ''"> |
||||
|
AND i.LESSOR_ID_CARD = #{lessorIdCard} |
||||
|
</if> |
||||
|
<if test="lessorMobile != null and lessorMobile != ''"> |
||||
|
AND i.LESSOR_MOBILE = #{lessorMobile} |
||||
|
</if> |
||||
|
<if test="lesseeName != null and lesseeName != ''"> |
||||
|
AND i.LESSEE_NAME = #{lesseeName} |
||||
|
</if> |
||||
|
<if test="lesseeIdCard != null and lesseeIdCard != ''"> |
||||
|
AND i.LESSEE_ID_CARD = #{lesseeIdCard} |
||||
|
</if> |
||||
|
<if test="lesseeMobile != null and lesseeMobile != ''"> |
||||
|
AND i.LESSEE_MOBILE = #{lesseeMobile} |
||||
|
</if> |
||||
|
<if test="reviewStartTime != null and reviewStartTime != ''"> |
||||
|
AND i.REVIEW_DATE >= #{reviewStartTime} |
||||
|
</if> |
||||
|
<if test="reviewEndTime != null and reviewEndTime != ''"> |
||||
|
AND i.REVIEW_DATE <= #{reviewEndTime} |
||||
|
</if> |
||||
|
<if test="startTime != null and startTime != ''"> |
||||
|
AND i.SIGN_DATE >= #{startTime} |
||||
|
</if> |
||||
|
<if test="endTime != null and endTime != ''"> |
||||
|
AND i.SIGN_DATE <= #{endTime} |
||||
|
</if> |
||||
|
<if test="endDate != null and endDate != ''"> |
||||
|
<if test="endDate == '0' or endDate == 0"> |
||||
|
AND DATE( i.END_DATE ) <= DATE_ADD( curdate(), INTERVAL 1 MONTH ) |
||||
|
AND DATE( i.END_DATE ) > CURDATE() |
||||
|
</if> |
||||
|
<if test="endDate == '1' or endDate == 1"> |
||||
|
AND DATE( i.END_DATE ) <= DATE_ADD( curdate(), INTERVAL 2 MONTH ) |
||||
|
AND DATE( i.END_DATE ) > CURDATE() |
||||
|
</if> |
||||
|
<if test="endDate == '2' or endDate == 2"> |
||||
|
AND DATE( i.END_DATE ) <= DATE_ADD( curdate(), INTERVAL 3 MONTH ) |
||||
|
AND DATE( i.END_DATE ) > CURDATE() |
||||
|
</if> |
||||
|
<if test="endDate == '3' or endDate == 3"> |
||||
|
AND DATE( i.END_DATE ) <= CURDATE() |
||||
|
</if> |
||||
|
</if> |
||||
|
</where> |
||||
|
</select> |
||||
|
</mapper> |
||||
@ -0,0 +1,35 @@ |
|||||
|
<?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.epmet.plugin.power.modules.rent.dao.RentTenantInfoDao"> |
||||
|
|
||||
|
<resultMap type="com.epmet.plugin.power.modules.rent.entity.RentTenantInfoEntity" id="rentTenantInfoMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="contractId" column="CONTRACT_ID"/> |
||||
|
<result property="name" column="NAME"/> |
||||
|
<result property="idCard" column="ID_CARD"/> |
||||
|
<result property="mobile" column="MOBILE"/> |
||||
|
<result property="yfzgx" column="YFZGX"/> |
||||
|
<result property="type" column="TYPE"/> |
||||
|
<result property="delFlag" column="DEL_FLAG"/> |
||||
|
<result property="revision" column="REVISION"/> |
||||
|
<result property="createdBy" column="CREATED_BY"/> |
||||
|
<result property="createdTime" column="CREATED_TIME"/> |
||||
|
<result property="updatedBy" column="UPDATED_BY"/> |
||||
|
<result property="updatedTime" column="UPDATED_TIME"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
<delete id="deletePhysical"> |
||||
|
DELETE |
||||
|
FROM |
||||
|
pli_rent_tenant_info |
||||
|
<where> |
||||
|
<if test="contractId != null and contractId != ''"> |
||||
|
AND CONTRACT_ID = #{contractId} |
||||
|
</if> |
||||
|
<if test="type != null and type != ''"> |
||||
|
AND TYPE = #{type} |
||||
|
</if> |
||||
|
</where> |
||||
|
</delete> |
||||
|
</mapper> |
||||
Loading…
Reference in new issue