fix
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package com.cool.store.dao;
|
package com.cool.store.dao;
|
||||||
|
|
||||||
|
import com.cool.store.constants.CommonConstants;
|
||||||
import com.cool.store.entity.ShopRentInfoDO;
|
import com.cool.store.entity.ShopRentInfoDO;
|
||||||
import com.cool.store.mapper.ShopRentInfoMapper;
|
import com.cool.store.mapper.ShopRentInfoMapper;
|
||||||
import com.cool.store.vo.point.ShopRentInfoVO;
|
import com.cool.store.vo.point.ShopRentInfoVO;
|
||||||
@@ -31,4 +32,11 @@ public class ShopRentInfoDAO {
|
|||||||
}
|
}
|
||||||
return shopRentInfoMapper.getRentContractByShopId(shopId);
|
return shopRentInfoMapper.getRentContractByShopId(shopId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer updateRentContract(ShopRentInfoDO shopRentInfo) {
|
||||||
|
if(Objects.isNull(shopRentInfo.getId())){
|
||||||
|
return CommonConstants.ZERO;
|
||||||
|
}
|
||||||
|
return shopRentInfoMapper.updateByPrimaryKeySelective(shopRentInfo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,28 +86,28 @@ public class ShopStageInfoDAO {
|
|||||||
return shopStageInfoMapper.getShopSubStageInfo(shopId, shopSubStageEnum.getShopSubStage());
|
return shopStageInfoMapper.getShopSubStageInfo(shopId, shopSubStageEnum.getShopSubStage());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新店铺阶段状态
|
|
||||||
* @param shopId
|
|
||||||
* @param shopStageInfo
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public Integer updateShopStageInfo(Long shopId, ShopSubStageStatusEnum shopStageInfo, Long auditId) {
|
|
||||||
if(Objects.isNull(shopId) || Objects.isNull(shopStageInfo)){
|
|
||||||
return CommonConstants.ZERO;
|
|
||||||
}
|
|
||||||
String remark = shopStageInfo.getShopSubStageName() + CommonConstants.PATH_BAR +shopStageInfo.getShopSubStageStatusName();
|
|
||||||
boolean isTerminated = shopStageInfo.isTerminated();
|
|
||||||
return shopStageInfoMapper.updateShopStageInfo(shopId, shopStageInfo.getShopSubStageEnum().getShopSubStage(), shopStageInfo.getShopSubStageStatus(), isTerminated, remark, auditId);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer updateShopStageInfo(Long shopId, ShopSubStageStatusEnum shopStageInfo) {
|
public Integer updateShopStageInfo(Long shopId, ShopSubStageStatusEnum shopStageInfo) {
|
||||||
if(Objects.isNull(shopId) || Objects.isNull(shopStageInfo)){
|
if(Objects.isNull(shopId) || Objects.isNull(shopStageInfo)){
|
||||||
return CommonConstants.ZERO;
|
return CommonConstants.ZERO;
|
||||||
}
|
}
|
||||||
String remark = shopStageInfo.getShopSubStageName() + CommonConstants.PATH_BAR +shopStageInfo.getShopSubStageStatusName();
|
String remark = shopStageInfo.getShopSubStageName() + CommonConstants.PATH_BAR +shopStageInfo.getShopSubStageStatusName();
|
||||||
boolean isTerminated = shopStageInfo.isTerminated();
|
boolean isTerminated = shopStageInfo.isTerminated();
|
||||||
return shopStageInfoMapper.updateShopStageInfo(shopId, shopStageInfo.getShopSubStageEnum().getShopSubStage(), shopStageInfo.getShopSubStageStatus(), isTerminated, remark, null);
|
return shopStageInfoMapper.updateShopStageInfo(shopId, shopStageInfo.getShopSubStageEnum().getShopSubStage(), shopStageInfo.getShopSubStageStatus(), isTerminated, remark);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新店铺阶段状态及审核信息
|
||||||
|
* @param shopId
|
||||||
|
* @param shopStageInfo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Integer updateShopStageAndAuditInfo(Long shopId, ShopSubStageStatusEnum shopStageInfo, Long auditId) {
|
||||||
|
if(Objects.isNull(shopId) || Objects.isNull(shopStageInfo)){
|
||||||
|
return CommonConstants.ZERO;
|
||||||
|
}
|
||||||
|
String remark = shopStageInfo.getShopSubStageName() + CommonConstants.PATH_BAR +shopStageInfo.getShopSubStageStatusName();
|
||||||
|
boolean isTerminated = shopStageInfo.isTerminated();
|
||||||
|
return shopStageInfoMapper.updateShopStageAndAuditInfo(shopId, shopStageInfo.getShopSubStageEnum().getShopSubStage(), shopStageInfo.getShopSubStageStatus(), isTerminated, remark, auditId);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,19 @@ public interface ShopStageInfoMapper extends Mapper<ShopStageInfoDO> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Integer updateShopStageInfo(@Param("shopId") Long shopId, @Param("shopSubStage") Integer shopSubStage, @Param("shopSubStageStatus") Integer shopSubStageStatus,
|
Integer updateShopStageInfo(@Param("shopId") Long shopId, @Param("shopSubStage") Integer shopSubStage, @Param("shopSubStageStatus") Integer shopSubStageStatus,
|
||||||
|
@Param("isTerminated")boolean isTerminated, @Param("remark") String remark);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新阶段及审核信息
|
||||||
|
* @param shopId
|
||||||
|
* @param shopSubStage
|
||||||
|
* @param shopSubStageStatus
|
||||||
|
* @param isTerminated
|
||||||
|
* @param remark
|
||||||
|
* @param auditId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Integer updateShopStageAndAuditInfo(@Param("shopId") Long shopId, @Param("shopSubStage") Integer shopSubStage, @Param("shopSubStageStatus") Integer shopSubStageStatus,
|
||||||
@Param("isTerminated")boolean isTerminated, @Param("remark") String remark, @Param("auditId")Long auditId);
|
@Param("isTerminated")boolean isTerminated, @Param("remark") String remark, @Param("auditId")Long auditId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -95,8 +95,8 @@
|
|||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
<if test="request.areaPath != null">
|
<if test="areaPath != null">
|
||||||
and b.want_shop_area_id in (select id from xfsg_open_area_info where area_path like concat(#{request.areaPath}, '%'))
|
and b.want_shop_area_id in (select id from xfsg_open_area_info where area_path like concat(#{areaPath}, '%'))
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|||||||
@@ -65,4 +65,17 @@
|
|||||||
shop_id = #{shopId} and shop_sub_stage = #{shopSubStage} and deleted = 0
|
shop_id = #{shopId} and shop_sub_stage = #{shopSubStage} and deleted = 0
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<update id="updateShopStageAndAuditInfo">
|
||||||
|
update
|
||||||
|
xfsg_shop_stage_info
|
||||||
|
set
|
||||||
|
shop_sub_stage_status = #{shopSubStageStatus},
|
||||||
|
is_terminated = #{isTerminated},
|
||||||
|
remark = #{remark},
|
||||||
|
actual_complete_time = if(is_terminated, now(), null),
|
||||||
|
audit_id = #{auditId}
|
||||||
|
where
|
||||||
|
shop_id = #{shopId} and shop_sub_stage = #{shopSubStage}
|
||||||
|
</update>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -22,7 +22,7 @@ import java.util.Objects;
|
|||||||
* @date 2024-04-16 11:38
|
* @date 2024-04-16 11:38
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class UploadRentContractRequest {
|
public class AddRentContractRequest {
|
||||||
|
|
||||||
@ApiModelProperty("店铺id")
|
@ApiModelProperty("店铺id")
|
||||||
private Long shopId;
|
private Long shopId;
|
||||||
@@ -101,7 +101,7 @@ public class UploadRentContractRequest {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ShopRentInfoDO convertDO(UploadRentContractRequest param){
|
public static ShopRentInfoDO convertDO(AddRentContractRequest param){
|
||||||
if(Objects.isNull(param)){
|
if(Objects.isNull(param)){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,13 +3,10 @@ package com.cool.store.vo.point;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.cool.store.entity.ShopRentInfoDO;
|
import com.cool.store.entity.ShopRentInfoDO;
|
||||||
import com.cool.store.enums.RentTypeEnum;
|
import com.cool.store.enums.RentTypeEnum;
|
||||||
|
import com.cool.store.vo.AuditInfoVO;
|
||||||
import com.cool.store.vo.LineAuditInfoVO;
|
import com.cool.store.vo.LineAuditInfoVO;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
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.Instant;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
@@ -25,6 +22,9 @@ import java.util.List;
|
|||||||
@Data
|
@Data
|
||||||
public class ShopRentInfoVO {
|
public class ShopRentInfoVO {
|
||||||
|
|
||||||
|
@ApiModelProperty("租赁id")
|
||||||
|
private Long rentId;
|
||||||
|
|
||||||
@ApiModelProperty("店铺id")
|
@ApiModelProperty("店铺id")
|
||||||
private Long shopId;
|
private Long shopId;
|
||||||
|
|
||||||
@@ -71,10 +71,11 @@ public class ShopRentInfoVO {
|
|||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
@ApiModelProperty("审核信息")
|
@ApiModelProperty("审核信息")
|
||||||
private LineAuditInfoVO auditInfo;
|
private AuditInfoVO auditInfo;
|
||||||
|
|
||||||
public static ShopRentInfoVO build(ShopRentInfoDO shopRentInfo) {
|
public static ShopRentInfoVO build(ShopRentInfoDO shopRentInfo) {
|
||||||
ShopRentInfoVO result = new ShopRentInfoVO();
|
ShopRentInfoVO result = new ShopRentInfoVO();
|
||||||
|
result.setRentId(shopRentInfo.getId());
|
||||||
result.setShopId(shopRentInfo.getShopId());
|
result.setShopId(shopRentInfo.getShopId());
|
||||||
result.setPointId(shopRentInfo.getPointId());
|
result.setPointId(shopRentInfo.getPointId());
|
||||||
result.setRentType(shopRentInfo.getRentType());
|
result.setRentType(shopRentInfo.getRentType());
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ public interface PointService {
|
|||||||
* @param request
|
* @param request
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Integer uploadRentContract(UploadRentContractRequest request);
|
Integer uploadRentContract(AddRentContractRequest request);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取租赁合同详情
|
* 获取租赁合同详情
|
||||||
@@ -242,4 +242,11 @@ public interface PointService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Integer auditRentContract(AuditRentContractRequest request);
|
Integer auditRentContract(AuditRentContractRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新租赁合同
|
||||||
|
* @param request
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Integer updateRentContract(UpdateRentContractRequest request);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import com.cool.store.service.PointService;
|
|||||||
import com.cool.store.service.UserAuthMappingService;
|
import com.cool.store.service.UserAuthMappingService;
|
||||||
import com.cool.store.utils.RedisUtilPool;
|
import com.cool.store.utils.RedisUtilPool;
|
||||||
import com.cool.store.utils.poi.StringUtils;
|
import com.cool.store.utils.poi.StringUtils;
|
||||||
|
import com.cool.store.vo.AuditInfoVO;
|
||||||
import com.cool.store.vo.LineAuditInfoVO;
|
import com.cool.store.vo.LineAuditInfoVO;
|
||||||
import com.cool.store.vo.LinePointBaseInfoVO;
|
import com.cool.store.vo.LinePointBaseInfoVO;
|
||||||
import com.cool.store.vo.point.*;
|
import com.cool.store.vo.point.*;
|
||||||
@@ -666,7 +667,7 @@ public class PointServiceImpl implements PointService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer uploadRentContract(UploadRentContractRequest request){
|
public Integer uploadRentContract(AddRentContractRequest request){
|
||||||
if(!request.check()){
|
if(!request.check()){
|
||||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||||
}
|
}
|
||||||
@@ -679,7 +680,7 @@ public class PointServiceImpl implements PointService {
|
|||||||
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
|
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
|
||||||
shopId = pointInfo.getShopId();
|
shopId = pointInfo.getShopId();
|
||||||
}
|
}
|
||||||
ShopRentInfoDO shopRentInfo = UploadRentContractRequest.convertDO(request);
|
ShopRentInfoDO shopRentInfo = AddRentContractRequest.convertDO(request);
|
||||||
shopRentInfo.setShopId(shopId);
|
shopRentInfo.setShopId(shopId);
|
||||||
shopRentInfo.setPointId(pointId);
|
shopRentInfo.setPointId(pointId);
|
||||||
shopRentInfoDAO.addShopRentInfo(shopRentInfo);
|
shopRentInfoDAO.addShopRentInfo(shopRentInfo);
|
||||||
@@ -692,9 +693,12 @@ public class PointServiceImpl implements PointService {
|
|||||||
ShopRentInfoVO result = ShopRentInfoVO.build(rentContract);
|
ShopRentInfoVO result = ShopRentInfoVO.build(rentContract);
|
||||||
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_2);
|
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_2);
|
||||||
result.setStatus(shopSubStageInfo.getShopSubStageStatus());
|
result.setStatus(shopSubStageInfo.getShopSubStageStatus());
|
||||||
if(Objects.nonNull(shopSubStageInfo.getAuditId())){
|
boolean isAudit = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_4.getShopSubStageStatus().equals(shopSubStageInfo.getShopSubStageStatus()) ||
|
||||||
|
ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_5.getShopSubStageStatus().equals(shopSubStageInfo.getShopSubStageStatus());
|
||||||
|
if(Objects.nonNull(shopSubStageInfo.getAuditId()) && isAudit){
|
||||||
|
//当前是审核过的状态才获取原因
|
||||||
LineAuditInfoDO auditInfo = lineAuditInfoDAO.getAuditInfo(shopSubStageInfo.getAuditId());
|
LineAuditInfoDO auditInfo = lineAuditInfoDAO.getAuditInfo(shopSubStageInfo.getAuditId());
|
||||||
result.setAuditInfo(LineAuditInfoVO.convertVO(auditInfo));
|
result.setAuditInfo(AuditInfoVO.convertVO(auditInfo));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -703,10 +707,28 @@ public class PointServiceImpl implements PointService {
|
|||||||
public Integer auditRentContract(AuditRentContractRequest request) {
|
public Integer auditRentContract(AuditRentContractRequest request) {
|
||||||
Long shopId = request.getShopId();
|
Long shopId = request.getShopId();
|
||||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
|
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
|
||||||
ShopRentInfoDO rentContract = shopRentInfoDAO.getRentContractByShopId(shopId);
|
if(Objects.isNull(shopInfo)){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
||||||
|
}
|
||||||
|
if(!ShopStageEnum.SHOP_STAGE_1.getShopStage().equals(shopInfo.getShopStage())){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.SHOP_STAGE_NOT_OPERATE);
|
||||||
|
}
|
||||||
Long auditId = lineAuditInfoDAO.addAuditInfo(AuditRentContractRequest.convert(request, shopInfo.getPartnerId(), shopInfo.getLineId()));
|
Long auditId = lineAuditInfoDAO.addAuditInfo(AuditRentContractRequest.convert(request, shopInfo.getPartnerId(), shopInfo.getLineId()));
|
||||||
ShopSubStageStatusEnum subStageStatus = AuditResultTypeEnum.PASS.getCode().equals(request.getResultType()) ? ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_5 : ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_4;
|
ShopSubStageStatusEnum subStageStatus = AuditResultTypeEnum.PASS.getCode().equals(request.getResultType()) ? ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_5 : ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_4;
|
||||||
return shopStageInfoDAO.updateShopStageInfo(shopId, subStageStatus, auditId);
|
return shopStageInfoDAO.updateShopStageAndAuditInfo(shopId, subStageStatus, auditId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer updateRentContract(UpdateRentContractRequest request){
|
||||||
|
if(!request.check()){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||||
|
}
|
||||||
|
ShopRentInfoDO shopRentInfo = UpdateRentContractRequest.convertDO(request);
|
||||||
|
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(request.getShopId(), ShopSubStageEnum.SHOP_STAGE_2);
|
||||||
|
if(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_4.getShopSubStageStatus().equals(shopSubStageInfo.getShopSubStageStatus())){
|
||||||
|
shopStageInfoDAO.updateShopStageAndAuditInfo(shopRentInfo.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_3, null);
|
||||||
|
}
|
||||||
|
return shopRentInfoDAO.updateRentContract(shopRentInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<AuditNodeDTO> dealAuditNode(AuditSettingVO auditSetting, Long regionId, String operateUserId, String developmentManager) {
|
public List<AuditNodeDTO> dealAuditNode(AuditSettingVO auditSetting, Long regionId, String operateUserId, String developmentManager) {
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.cool.store.controller.webc;
|
package com.cool.store.controller.webc;
|
||||||
|
|
||||||
import com.cool.store.context.CurrentUserHolder;
|
|
||||||
import com.cool.store.context.PartnerUserHolder;
|
import com.cool.store.context.PartnerUserHolder;
|
||||||
import com.cool.store.request.*;
|
import com.cool.store.request.*;
|
||||||
import com.cool.store.response.ResponseResult;
|
import com.cool.store.response.ResponseResult;
|
||||||
@@ -8,7 +7,6 @@ import com.cool.store.service.PointService;
|
|||||||
import com.cool.store.service.ShopService;
|
import com.cool.store.service.ShopService;
|
||||||
import com.cool.store.vo.point.MiniPointPageVO;
|
import com.cool.store.vo.point.MiniPointPageVO;
|
||||||
import com.cool.store.vo.point.PointDetailVO;
|
import com.cool.store.vo.point.PointDetailVO;
|
||||||
import com.cool.store.vo.point.PointPageVO;
|
|
||||||
import com.cool.store.vo.point.ShopRentInfoVO;
|
import com.cool.store.vo.point.ShopRentInfoVO;
|
||||||
import com.cool.store.vo.shop.MiniShopPageVO;
|
import com.cool.store.vo.shop.MiniShopPageVO;
|
||||||
import com.cool.store.vo.shop.ShopStageInfoVO;
|
import com.cool.store.vo.shop.ShopStageInfoVO;
|
||||||
@@ -97,7 +95,7 @@ public class MiniShopController {
|
|||||||
|
|
||||||
@ApiOperation("上传租赁合同")
|
@ApiOperation("上传租赁合同")
|
||||||
@PostMapping("/uploadRentContract")
|
@PostMapping("/uploadRentContract")
|
||||||
public ResponseResult<Integer> uploadRentContract(@RequestBody @Validated UploadRentContractRequest request) {
|
public ResponseResult<Integer> uploadRentContract(@RequestBody @Validated AddRentContractRequest request) {
|
||||||
Long lineId = PartnerUserHolder.getUser().getLineId();
|
Long lineId = PartnerUserHolder.getUser().getLineId();
|
||||||
request.setCurLineId(lineId);
|
request.setCurLineId(lineId);
|
||||||
return ResponseResult.success(pointService.uploadRentContract(request));
|
return ResponseResult.success(pointService.uploadRentContract(request));
|
||||||
@@ -109,5 +107,13 @@ public class MiniShopController {
|
|||||||
return ResponseResult.success(pointService.getRentContractDetail(shopId));
|
return ResponseResult.success(pointService.getRentContractDetail(shopId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("更新租赁合同")
|
||||||
|
@PostMapping("/updateRentContract")
|
||||||
|
public ResponseResult<Integer> updateRentContract(@RequestBody @Validated UpdateRentContractRequest request) {
|
||||||
|
Long lineId = PartnerUserHolder.getUser().getLineId();
|
||||||
|
request.setCurLineId(lineId);
|
||||||
|
return ResponseResult.success(pointService.updateRentContract(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user