This commit is contained in:
zhangchenbiao
2024-04-16 17:08:51 +08:00
parent b00ee1ad8a
commit bc0cc2155c
12 changed files with 285 additions and 35 deletions

View File

@@ -22,7 +22,7 @@ import java.util.Objects;
* @date 2024-04-16 11:38
*/
@Data
public class UploadRentContractRequest {
public class AddRentContractRequest {
@ApiModelProperty("店铺id")
private Long shopId;
@@ -101,7 +101,7 @@ public class UploadRentContractRequest {
return true;
}
public static ShopRentInfoDO convertDO(UploadRentContractRequest param){
public static ShopRentInfoDO convertDO(AddRentContractRequest param){
if(Objects.isNull(param)){
return null;
}

View File

@@ -0,0 +1,135 @@
package com.cool.store.request;
import com.alibaba.fastjson.JSONObject;
import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils;
import com.cool.store.entity.ShopRentInfoDO;
import com.cool.store.enums.RentTypeEnum;
import com.cool.store.enums.ShopRentTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.collections4.CollectionUtils;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
import java.util.List;
import java.util.Objects;
/**
* @author zhangchenbiao
* @FileName: UploadRentContractRequest
* @Description:上传租赁合同
* @date 2024-04-16 11:38
*/
@Data
public class UpdateRentContractRequest {
@NotNull
@ApiModelProperty("租赁id")
private Long rentId;
@NotNull
@ApiModelProperty("店铺id")
private Long shopId;
@NotNull
@ApiModelProperty("铺位id")
private Long pointId;
@NotNull
@ApiModelProperty("租赁类型 1铺位直租 2自有铺位")
private Integer rentType;
@ApiModelProperty("签约日期")
private Date signTime;
@ApiModelProperty("合同开始日期")
private Date contractStartTime;
@ApiModelProperty("签约年限")
private Integer contractMonths;
@ApiModelProperty("店铺租金 1固定租金 2非固定租金")
private Integer shopRentType;
@ApiModelProperty("月租金")
private String monthRent;
@ApiModelProperty("第一年月租金")
private String firstYearMonthRent;
@ApiModelProperty("第二年月租金")
private String secondYearMonthRent;
@ApiModelProperty("第三年月租金")
private String thirdYearMonthRent;
@Size(max = 3, message = "最多上传三张租赁合同")
@ApiModelProperty("合同图片")
private List<String> contractPic;
@Size(max = 3, message = "最多上传三张房产证明")
@ApiModelProperty("房产证明")
private List<String> houseCertificatePic;
@ApiModelProperty(value = "当前线索id", hidden = true)
private Long curLineId;
public boolean check(){
if(Objects.isNull(rentId)){
return false;
}
if(Objects.isNull(shopId) || Objects.isNull(pointId)){
return false;
}
if(RentTypeEnum.OWN.getCode().equals(rentType)){
if(CollectionUtils.isEmpty(houseCertificatePic) || houseCertificatePic.size() > 3){
return false;
}
return true;
}
if(Objects.isNull(signTime) || Objects.isNull(contractStartTime)){
return false;
}
if(Objects.isNull(contractMonths) || Objects.isNull(shopRentType)){
return false;
}
if(ShopRentTypeEnum.FIXED.getCode().equals(shopRentType)){
if(StringUtils.isBlank(monthRent)){
return false;
}
}
if(ShopRentTypeEnum.NOT_FIXED.getCode().equals(shopRentType)){
if(StringUtils.isAnyBlank(firstYearMonthRent, secondYearMonthRent, thirdYearMonthRent)){
return false;
}
}
if(CollectionUtils.isEmpty(contractPic) || contractPic.size() > 3){
return false;
}
return true;
}
public static ShopRentInfoDO convertDO(UpdateRentContractRequest param){
if(Objects.isNull(param)){
return null;
}
ShopRentInfoDO shopRentInfoDO = new ShopRentInfoDO();
shopRentInfoDO.setId(param.getRentId());
shopRentInfoDO.setShopId(param.getShopId());
shopRentInfoDO.setPointId(param.getPointId());
shopRentInfoDO.setRentType(param.getRentType());
shopRentInfoDO.setSignTime(param.getSignTime());
shopRentInfoDO.setContractStartTime(param.getContractStartTime());
shopRentInfoDO.setContractMonths(param.getContractMonths());
shopRentInfoDO.setShopRentType(param.getShopRentType());
shopRentInfoDO.setMonthRent(param.getMonthRent());
shopRentInfoDO.setFirstYearMonthRent(param.getFirstYearMonthRent());
shopRentInfoDO.setSecondYearMonthRent(param.getSecondYearMonthRent());
shopRentInfoDO.setThirdYearMonthRent(param.getThirdYearMonthRent());
shopRentInfoDO.setContractPic(JSONObject.toJSONString(param.getContractPic()));
shopRentInfoDO.setHouseCertificatePic(JSONObject.toJSONString(param.getHouseCertificatePic()));
return shopRentInfoDO;
}
}

View File

@@ -0,0 +1,45 @@
package com.cool.store.vo;
import com.cool.store.entity.LineAuditInfoDO;
import com.cool.store.enums.AuditResultTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.Objects;
@Data
public class AuditInfoVO {
@ApiModelProperty("审核id")
private Long auditId;
@ApiModelProperty("结果类型 0通过,1拒绝,2结束跟进")
private Integer resultType;
@ApiModelProperty("原因")
private String reason;
@ApiModelProperty("明文件或凭证")
private String certifyFile;
@ApiModelProperty("审批时间")
private Date createTime;
public static AuditInfoVO convertVO(LineAuditInfoDO auditInfo) {
if(Objects.isNull(auditInfo)){
return null;
}
AuditInfoVO result = new AuditInfoVO();
result.setAuditId(auditInfo.getId());
result.setResultType(auditInfo.getResultType());
if(AuditResultTypeEnum.PASS.getCode().equals(result.getResultType())){
result.setReason(auditInfo.getPassReason());
}else if(AuditResultTypeEnum.REJECT.getCode().equals(result.getResultType())){
result.setReason(auditInfo.getRejectRealReason());
}
result.setCertifyFile(auditInfo.getCertifyFile());
result.setCreateTime(auditInfo.getCreateTime());
return result;
}
}

View File

@@ -3,13 +3,10 @@ package com.cool.store.vo.point;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.entity.ShopRentInfoDO;
import com.cool.store.enums.RentTypeEnum;
import com.cool.store.vo.AuditInfoVO;
import com.cool.store.vo.LineAuditInfoVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.Instant;
import java.time.LocalDate;
import java.time.ZoneId;
@@ -25,6 +22,9 @@ import java.util.List;
@Data
public class ShopRentInfoVO {
@ApiModelProperty("租赁id")
private Long rentId;
@ApiModelProperty("店铺id")
private Long shopId;
@@ -71,10 +71,11 @@ public class ShopRentInfoVO {
private Integer status;
@ApiModelProperty("审核信息")
private LineAuditInfoVO auditInfo;
private AuditInfoVO auditInfo;
public static ShopRentInfoVO build(ShopRentInfoDO shopRentInfo) {
ShopRentInfoVO result = new ShopRentInfoVO();
result.setRentId(shopRentInfo.getId());
result.setShopId(shopRentInfo.getShopId());
result.setPointId(shopRentInfo.getPointId());
result.setRentType(shopRentInfo.getRentType());