commit
71ce831d59
@ -0,0 +1,61 @@
|
||||
package cn.iocoder.yudao.module.crm.enums;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 流程审批状态枚举类
|
||||
* 0 未审核 1 审核通过 2 审核拒绝 3 审核中 4 已撤回
|
||||
* @author 赤焰
|
||||
*/
|
||||
public enum AuditStatusEnum implements IntArrayValuable {
|
||||
/**
|
||||
* 未审批
|
||||
*/
|
||||
AUDIT_NEW(0, "未审批"),
|
||||
/**
|
||||
* 审核通过
|
||||
*/
|
||||
AUDIT_FINISH(1, "审核通过"),
|
||||
/**
|
||||
* 审核拒绝
|
||||
*/
|
||||
AUDIT_REJECT(2, "审核拒绝"),
|
||||
/**
|
||||
* 审核中
|
||||
*/
|
||||
AUDIT_DOING(3, "审核中"),
|
||||
/**
|
||||
* 已撤回
|
||||
*/
|
||||
AUDIT_RETURN(4, "已撤回");
|
||||
|
||||
private final Integer value;
|
||||
private final String desc;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(AuditStatusEnum::getValue).toArray();
|
||||
|
||||
/**
|
||||
*
|
||||
* @param value
|
||||
* @param desc
|
||||
*/
|
||||
AuditStatusEnum(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
package cn.iocoder.yudao.module.crm.enums;
|
||||
|
||||
/**
|
||||
* @author 赤焰
|
||||
*/
|
||||
|
||||
public enum ReturnTypeEnum {
|
||||
}
|
||||
@ -1,14 +1,12 @@
|
||||
package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - CRM 回款创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ReceivableCreateReqVO extends ReceivableBaseVO {
|
||||
public class CrmReceivableCreateReqVO extends CrmReceivableBaseVO {
|
||||
|
||||
}
|
||||
@ -1,14 +1,12 @@
|
||||
package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - CRM 回款计划创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ReceivablePlanCreateReqVO extends ReceivablePlanBaseVO {
|
||||
public class CrmReceivablePlanCreateReqVO extends CrmReceivablePlanBaseVO {
|
||||
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.crm.convert.receivable;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivableDO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*;
|
||||
|
||||
/**
|
||||
* 回款管理 Convert
|
||||
*
|
||||
* @author 赤焰
|
||||
*/
|
||||
@Mapper
|
||||
public interface CrmReceivableConvert {
|
||||
|
||||
CrmReceivableConvert INSTANCE = Mappers.getMapper(CrmReceivableConvert.class);
|
||||
|
||||
CrmReceivableDO convert(CrmReceivableCreateReqVO bean);
|
||||
|
||||
CrmReceivableDO convert(CrmReceivableUpdateReqVO bean);
|
||||
|
||||
CrmReceivableRespVO convert(CrmReceivableDO bean);
|
||||
|
||||
List<CrmReceivableRespVO> convertList(List<CrmReceivableDO> list);
|
||||
|
||||
PageResult<CrmReceivableRespVO> convertPage(PageResult<CrmReceivableDO> page);
|
||||
|
||||
List<CrmReceivableExcelVO> convertList02(List<CrmReceivableDO> list);
|
||||
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.crm.convert.receivable;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivablePlanDO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*;
|
||||
|
||||
/**
|
||||
* 回款计划 Convert
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface CrmReceivablePlanConvert {
|
||||
|
||||
CrmReceivablePlanConvert INSTANCE = Mappers.getMapper(CrmReceivablePlanConvert.class);
|
||||
|
||||
CrmReceivablePlanDO convert(CrmReceivablePlanCreateReqVO bean);
|
||||
|
||||
CrmReceivablePlanDO convert(CrmReceivablePlanUpdateReqVO bean);
|
||||
|
||||
CrmReceivablePlanRespVO convert(CrmReceivablePlanDO bean);
|
||||
|
||||
List<CrmReceivablePlanRespVO> convertList(List<CrmReceivablePlanDO> list);
|
||||
|
||||
PageResult<CrmReceivablePlanRespVO> convertPage(PageResult<CrmReceivablePlanDO> page);
|
||||
|
||||
List<CrmReceivablePlanExcelVO> convertList02(List<CrmReceivablePlanDO> list);
|
||||
|
||||
}
|
||||
@ -1,34 +0,0 @@
|
||||
package cn.iocoder.yudao.module.crm.convert.receivable;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*;
|
||||
import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivableDO;
|
||||
|
||||
/**
|
||||
* 回款管理 Convert
|
||||
*
|
||||
* @author 赤焰
|
||||
*/
|
||||
@Mapper
|
||||
public interface ReceivableConvert {
|
||||
|
||||
ReceivableConvert INSTANCE = Mappers.getMapper(ReceivableConvert.class);
|
||||
|
||||
ReceivableDO convert(ReceivableCreateReqVO bean);
|
||||
|
||||
ReceivableDO convert(ReceivableUpdateReqVO bean);
|
||||
|
||||
ReceivableRespVO convert(ReceivableDO bean);
|
||||
|
||||
List<ReceivableRespVO> convertList(List<ReceivableDO> list);
|
||||
|
||||
PageResult<ReceivableRespVO> convertPage(PageResult<ReceivableDO> page);
|
||||
|
||||
List<ReceivableExcelVO> convertList02(List<ReceivableDO> list);
|
||||
|
||||
}
|
||||
@ -1,34 +0,0 @@
|
||||
package cn.iocoder.yudao.module.crm.convert.receivable;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*;
|
||||
import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivablePlanDO;
|
||||
|
||||
/**
|
||||
* 回款计划 Convert
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ReceivablePlanConvert {
|
||||
|
||||
ReceivablePlanConvert INSTANCE = Mappers.getMapper(ReceivablePlanConvert.class);
|
||||
|
||||
ReceivablePlanDO convert(ReceivablePlanCreateReqVO bean);
|
||||
|
||||
ReceivablePlanDO convert(ReceivablePlanUpdateReqVO bean);
|
||||
|
||||
ReceivablePlanRespVO convert(ReceivablePlanDO bean);
|
||||
|
||||
List<ReceivablePlanRespVO> convertList(List<ReceivablePlanDO> list);
|
||||
|
||||
PageResult<ReceivablePlanRespVO> convertPage(PageResult<ReceivablePlanDO> page);
|
||||
|
||||
List<ReceivablePlanExcelVO> convertList02(List<ReceivablePlanDO> list);
|
||||
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
package cn.iocoder.yudao.module.crm.dal.mysql.receivable;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivableDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*;
|
||||
|
||||
/**
|
||||
* 回款管理 Mapper
|
||||
*
|
||||
* @author 赤焰
|
||||
*/
|
||||
@Mapper
|
||||
public interface CrmReceivableMapper extends BaseMapperX<CrmReceivableDO> {
|
||||
|
||||
default PageResult<CrmReceivableDO> selectPage(CrmReceivablePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<CrmReceivableDO>()
|
||||
.eqIfPresent(CrmReceivableDO::getNo, reqVO.getNo())
|
||||
.eqIfPresent(CrmReceivableDO::getPlanId, reqVO.getPlanId())
|
||||
.eqIfPresent(CrmReceivableDO::getCustomerId, reqVO.getCustomerId())
|
||||
.eqIfPresent(CrmReceivableDO::getContractId, reqVO.getContractId())
|
||||
.eqIfPresent(CrmReceivableDO::getCheckStatus, reqVO.getCheckStatus())
|
||||
.betweenIfPresent(CrmReceivableDO::getReturnTime, reqVO.getReturnTime())
|
||||
.eqIfPresent(CrmReceivableDO::getReturnType, reqVO.getReturnType())
|
||||
.eqIfPresent(CrmReceivableDO::getPrice, reqVO.getPrice())
|
||||
.eqIfPresent(CrmReceivableDO::getOwnerUserId, reqVO.getOwnerUserId())
|
||||
.eqIfPresent(CrmReceivableDO::getStatus, reqVO.getStatus())
|
||||
.betweenIfPresent(CrmReceivableDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(CrmReceivableDO::getId));
|
||||
}
|
||||
|
||||
default List<CrmReceivableDO> selectList(CrmReceivableExportReqVO reqVO) {
|
||||
return selectList(new LambdaQueryWrapperX<CrmReceivableDO>()
|
||||
.eqIfPresent(CrmReceivableDO::getNo, reqVO.getNo())
|
||||
.eqIfPresent(CrmReceivableDO::getPlanId, reqVO.getPlanId())
|
||||
.eqIfPresent(CrmReceivableDO::getCustomerId, reqVO.getCustomerId())
|
||||
.eqIfPresent(CrmReceivableDO::getContractId, reqVO.getContractId())
|
||||
.eqIfPresent(CrmReceivableDO::getCheckStatus, reqVO.getCheckStatus())
|
||||
.betweenIfPresent(CrmReceivableDO::getReturnTime, reqVO.getReturnTime())
|
||||
.eqIfPresent(CrmReceivableDO::getReturnType, reqVO.getReturnType())
|
||||
.eqIfPresent(CrmReceivableDO::getPrice, reqVO.getPrice())
|
||||
.eqIfPresent(CrmReceivableDO::getOwnerUserId, reqVO.getOwnerUserId())
|
||||
.eqIfPresent(CrmReceivableDO::getBatchId, reqVO.getBatchId())
|
||||
.eqIfPresent(CrmReceivableDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(CrmReceivableDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(CrmReceivableDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(CrmReceivableDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
package cn.iocoder.yudao.module.crm.dal.mysql.receivable;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivablePlanDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*;
|
||||
|
||||
/**
|
||||
* 回款计划 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface CrmReceivablePlanMapper extends BaseMapperX<CrmReceivablePlanDO> {
|
||||
|
||||
default PageResult<CrmReceivablePlanDO> selectPage(CrmReceivablePlanPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<CrmReceivablePlanDO>()
|
||||
.eqIfPresent(CrmReceivablePlanDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(CrmReceivablePlanDO::getCheckStatus, reqVO.getCheckStatus())
|
||||
.betweenIfPresent(CrmReceivablePlanDO::getReturnTime, reqVO.getReturnTime())
|
||||
.betweenIfPresent(CrmReceivablePlanDO::getRemindTime, reqVO.getRemindTime())
|
||||
.eqIfPresent(CrmReceivablePlanDO::getCustomerId, reqVO.getCustomerId())
|
||||
.eqIfPresent(CrmReceivablePlanDO::getContractId, reqVO.getContractId())
|
||||
.eqIfPresent(CrmReceivablePlanDO::getOwnerUserId, reqVO.getOwnerUserId())
|
||||
.betweenIfPresent(CrmReceivablePlanDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(CrmReceivablePlanDO::getId));
|
||||
}
|
||||
|
||||
default List<CrmReceivablePlanDO> selectList(CrmReceivablePlanExportReqVO reqVO) {
|
||||
return selectList(new LambdaQueryWrapperX<CrmReceivablePlanDO>()
|
||||
.eqIfPresent(CrmReceivablePlanDO::getPeriod, reqVO.getPeriod())
|
||||
.eqIfPresent(CrmReceivablePlanDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(CrmReceivablePlanDO::getCheckStatus, reqVO.getCheckStatus())
|
||||
.betweenIfPresent(CrmReceivablePlanDO::getReturnTime, reqVO.getReturnTime())
|
||||
.eqIfPresent(CrmReceivablePlanDO::getRemindDays, reqVO.getRemindDays())
|
||||
.betweenIfPresent(CrmReceivablePlanDO::getRemindTime, reqVO.getRemindTime())
|
||||
.eqIfPresent(CrmReceivablePlanDO::getCustomerId, reqVO.getCustomerId())
|
||||
.eqIfPresent(CrmReceivablePlanDO::getContractId, reqVO.getContractId())
|
||||
.eqIfPresent(CrmReceivablePlanDO::getOwnerUserId, reqVO.getOwnerUserId())
|
||||
.eqIfPresent(CrmReceivablePlanDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(CrmReceivablePlanDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(CrmReceivablePlanDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,64 +0,0 @@
|
||||
package cn.iocoder.yudao.module.crm.dal.mysql.receivable;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivableDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*;
|
||||
|
||||
/**
|
||||
* 回款管理 Mapper
|
||||
*
|
||||
* @author 赤焰
|
||||
*/
|
||||
@Mapper
|
||||
public interface ReceivableMapper extends BaseMapperX<ReceivableDO> {
|
||||
|
||||
default PageResult<ReceivableDO> selectPage(ReceivablePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ReceivableDO>()
|
||||
.eqIfPresent(ReceivableDO::getNo, reqVO.getNo())
|
||||
.eqIfPresent(ReceivableDO::getPlanId, reqVO.getPlanId())
|
||||
.eqIfPresent(ReceivableDO::getCustomerId, reqVO.getCustomerId())
|
||||
.eqIfPresent(ReceivableDO::getContractId, reqVO.getContractId())
|
||||
.eqIfPresent(ReceivableDO::getCheckStatus, reqVO.getCheckStatus())
|
||||
.eqIfPresent(ReceivableDO::getProcessInstanceId, reqVO.getProcessInstanceId())
|
||||
.betweenIfPresent(ReceivableDO::getReturnTime, reqVO.getReturnTime())
|
||||
.eqIfPresent(ReceivableDO::getReturnType, reqVO.getReturnType())
|
||||
.eqIfPresent(ReceivableDO::getPrice, reqVO.getPrice())
|
||||
.eqIfPresent(ReceivableDO::getOwnerUserId, reqVO.getOwnerUserId())
|
||||
.eqIfPresent(ReceivableDO::getBatchId, reqVO.getBatchId())
|
||||
.eqIfPresent(ReceivableDO::getSort, reqVO.getSort())
|
||||
.eqIfPresent(ReceivableDO::getDataScope, reqVO.getDataScope())
|
||||
.eqIfPresent(ReceivableDO::getDataScopeDeptIds, reqVO.getDataScopeDeptIds())
|
||||
.eqIfPresent(ReceivableDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(ReceivableDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(ReceivableDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(ReceivableDO::getId));
|
||||
}
|
||||
|
||||
default List<ReceivableDO> selectList(ReceivableExportReqVO reqVO) {
|
||||
return selectList(new LambdaQueryWrapperX<ReceivableDO>()
|
||||
.eqIfPresent(ReceivableDO::getNo, reqVO.getNo())
|
||||
.eqIfPresent(ReceivableDO::getPlanId, reqVO.getPlanId())
|
||||
.eqIfPresent(ReceivableDO::getCustomerId, reqVO.getCustomerId())
|
||||
.eqIfPresent(ReceivableDO::getContractId, reqVO.getContractId())
|
||||
.eqIfPresent(ReceivableDO::getCheckStatus, reqVO.getCheckStatus())
|
||||
.eqIfPresent(ReceivableDO::getProcessInstanceId, reqVO.getProcessInstanceId())
|
||||
.betweenIfPresent(ReceivableDO::getReturnTime, reqVO.getReturnTime())
|
||||
.eqIfPresent(ReceivableDO::getReturnType, reqVO.getReturnType())
|
||||
.eqIfPresent(ReceivableDO::getPrice, reqVO.getPrice())
|
||||
.eqIfPresent(ReceivableDO::getOwnerUserId, reqVO.getOwnerUserId())
|
||||
.eqIfPresent(ReceivableDO::getBatchId, reqVO.getBatchId())
|
||||
.eqIfPresent(ReceivableDO::getSort, reqVO.getSort())
|
||||
.eqIfPresent(ReceivableDO::getDataScope, reqVO.getDataScope())
|
||||
.eqIfPresent(ReceivableDO::getDataScopeDeptIds, reqVO.getDataScopeDeptIds())
|
||||
.eqIfPresent(ReceivableDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(ReceivableDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(ReceivableDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(ReceivableDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,52 +0,0 @@
|
||||
package cn.iocoder.yudao.module.crm.dal.mysql.receivable;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivablePlanDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*;
|
||||
|
||||
/**
|
||||
* 回款计划 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ReceivablePlanMapper extends BaseMapperX<ReceivablePlanDO> {
|
||||
|
||||
default PageResult<ReceivablePlanDO> selectPage(ReceivablePlanPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ReceivablePlanDO>()
|
||||
.eqIfPresent(ReceivablePlanDO::getIndexNo, reqVO.getIndexNo())
|
||||
.eqIfPresent(ReceivablePlanDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(ReceivablePlanDO::getCheckStatus, reqVO.getCheckStatus())
|
||||
.betweenIfPresent(ReceivablePlanDO::getReturnTime, reqVO.getReturnTime())
|
||||
.eqIfPresent(ReceivablePlanDO::getRemindDays, reqVO.getRemindDays())
|
||||
.betweenIfPresent(ReceivablePlanDO::getRemindTime, reqVO.getRemindTime())
|
||||
.eqIfPresent(ReceivablePlanDO::getCustomerId, reqVO.getCustomerId())
|
||||
.eqIfPresent(ReceivablePlanDO::getContractId, reqVO.getContractId())
|
||||
.eqIfPresent(ReceivablePlanDO::getOwnerUserId, reqVO.getOwnerUserId())
|
||||
.eqIfPresent(ReceivablePlanDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(ReceivablePlanDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(ReceivablePlanDO::getId));
|
||||
}
|
||||
|
||||
default List<ReceivablePlanDO> selectList(ReceivablePlanExportReqVO reqVO) {
|
||||
return selectList(new LambdaQueryWrapperX<ReceivablePlanDO>()
|
||||
.eqIfPresent(ReceivablePlanDO::getIndexNo, reqVO.getIndexNo())
|
||||
.eqIfPresent(ReceivablePlanDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(ReceivablePlanDO::getCheckStatus, reqVO.getCheckStatus())
|
||||
.betweenIfPresent(ReceivablePlanDO::getReturnTime, reqVO.getReturnTime())
|
||||
.eqIfPresent(ReceivablePlanDO::getRemindDays, reqVO.getRemindDays())
|
||||
.betweenIfPresent(ReceivablePlanDO::getRemindTime, reqVO.getRemindTime())
|
||||
.eqIfPresent(ReceivablePlanDO::getCustomerId, reqVO.getCustomerId())
|
||||
.eqIfPresent(ReceivablePlanDO::getContractId, reqVO.getContractId())
|
||||
.eqIfPresent(ReceivablePlanDO::getOwnerUserId, reqVO.getOwnerUserId())
|
||||
.eqIfPresent(ReceivablePlanDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(ReceivablePlanDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(ReceivablePlanDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,129 @@
|
||||
package cn.iocoder.yudao.module.crm.service.receivable;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivablePlanCreateReqVO;
|
||||
import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivablePlanExportReqVO;
|
||||
import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivablePlanPageReqVO;
|
||||
import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivablePlanUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.crm.convert.receivable.CrmReceivablePlanConvert;
|
||||
import cn.iocoder.yudao.module.crm.dal.dataobject.contract.ContractDO;
|
||||
import cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerDO;
|
||||
import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivablePlanDO;
|
||||
import cn.iocoder.yudao.module.crm.dal.mysql.receivable.CrmReceivablePlanMapper;
|
||||
import cn.iocoder.yudao.module.crm.enums.AuditStatusEnum;
|
||||
import cn.iocoder.yudao.module.crm.service.contract.ContractService;
|
||||
import cn.iocoder.yudao.module.crm.service.customer.CrmCustomerService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 回款计划 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class CrmReceivablePlanServiceImpl implements CrmReceivablePlanService {
|
||||
|
||||
@Resource
|
||||
private CrmReceivablePlanMapper crmReceivablePlanMapper;
|
||||
@Resource
|
||||
private ContractService contractService;
|
||||
@Resource
|
||||
private CrmCustomerService crmCustomerService;
|
||||
|
||||
@Override
|
||||
public Long createReceivablePlan(CrmReceivablePlanCreateReqVO createReqVO) {
|
||||
// 插入
|
||||
CrmReceivablePlanDO receivablePlan = CrmReceivablePlanConvert.INSTANCE.convert(createReqVO);
|
||||
if (ObjectUtil.isNull(receivablePlan.getStatus())){
|
||||
receivablePlan.setStatus(CommonStatusEnum.ENABLE.getStatus());
|
||||
}
|
||||
if (ObjectUtil.isNull(receivablePlan.getCheckStatus())){
|
||||
receivablePlan.setCheckStatus(AuditStatusEnum.AUDIT_NEW.getValue());
|
||||
}
|
||||
|
||||
checkReceivablePlan(receivablePlan);
|
||||
|
||||
crmReceivablePlanMapper.insert(receivablePlan);
|
||||
// 返回
|
||||
return receivablePlan.getId();
|
||||
}
|
||||
|
||||
private void checkReceivablePlan(CrmReceivablePlanDO receivablePlan) {
|
||||
|
||||
if(ObjectUtil.isNull(receivablePlan.getContractId())){
|
||||
throw exception(CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
ContractDO contract = contractService.getContract(receivablePlan.getContractId());
|
||||
if(ObjectUtil.isNull(contract)){
|
||||
throw exception(CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
CrmCustomerDO customer = crmCustomerService.getCustomer(receivablePlan.getCustomerId());
|
||||
if(ObjectUtil.isNull(customer)){
|
||||
throw exception(CUSTOMER_NOT_EXISTS);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateReceivablePlan(CrmReceivablePlanUpdateReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateReceivablePlanExists(updateReqVO.getId());
|
||||
|
||||
// 更新
|
||||
CrmReceivablePlanDO updateObj = CrmReceivablePlanConvert.INSTANCE.convert(updateReqVO);
|
||||
crmReceivablePlanMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteReceivablePlan(Long id) {
|
||||
// 校验存在
|
||||
validateReceivablePlanExists(id);
|
||||
// 删除
|
||||
crmReceivablePlanMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateReceivablePlanExists(Long id) {
|
||||
if (crmReceivablePlanMapper.selectById(id) == null) {
|
||||
throw exception(RECEIVABLE_PLAN_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CrmReceivablePlanDO getReceivablePlan(Long id) {
|
||||
return crmReceivablePlanMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CrmReceivablePlanDO> getReceivablePlanList(Collection<Long> ids) {
|
||||
if (CollUtil.isEmpty(ids)) {
|
||||
return ListUtil.empty();
|
||||
}
|
||||
return crmReceivablePlanMapper.selectBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<CrmReceivablePlanDO> getReceivablePlanPage(CrmReceivablePlanPageReqVO pageReqVO) {
|
||||
return crmReceivablePlanMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CrmReceivablePlanDO> getReceivablePlanList(CrmReceivablePlanExportReqVO exportReqVO) {
|
||||
return crmReceivablePlanMapper.selectList(exportReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,138 @@
|
||||
package cn.iocoder.yudao.module.crm.service.receivable;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivableCreateReqVO;
|
||||
import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivableExportReqVO;
|
||||
import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivablePageReqVO;
|
||||
import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivableUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.crm.convert.receivable.CrmReceivableConvert;
|
||||
import cn.iocoder.yudao.module.crm.dal.dataobject.contract.ContractDO;
|
||||
import cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerDO;
|
||||
import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivableDO;
|
||||
import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivablePlanDO;
|
||||
import cn.iocoder.yudao.module.crm.dal.mysql.receivable.CrmReceivableMapper;
|
||||
import cn.iocoder.yudao.module.crm.enums.AuditStatusEnum;
|
||||
import cn.iocoder.yudao.module.crm.service.contract.ContractService;
|
||||
import cn.iocoder.yudao.module.crm.service.customer.CrmCustomerService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 回款管理 Service 实现类
|
||||
*
|
||||
* @author 赤焰
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class CrmReceivableServiceImpl implements CrmReceivableService {
|
||||
|
||||
@Resource
|
||||
private CrmReceivableMapper crmReceivableMapper;
|
||||
@Resource
|
||||
private ContractService contractService;
|
||||
@Resource
|
||||
private CrmCustomerService crmCustomerService;
|
||||
@Resource
|
||||
private CrmReceivablePlanService crmReceivablePlanService;
|
||||
|
||||
@Override
|
||||
public Long createReceivable(CrmReceivableCreateReqVO createReqVO) {
|
||||
// 插入
|
||||
CrmReceivableDO receivable = CrmReceivableConvert.INSTANCE.convert(createReqVO);
|
||||
if (ObjectUtil.isNull(receivable.getStatus())){
|
||||
receivable.setStatus(CommonStatusEnum.ENABLE.getStatus());
|
||||
}
|
||||
if (ObjectUtil.isNull(receivable.getCheckStatus())){
|
||||
receivable.setCheckStatus(AuditStatusEnum.AUDIT_NEW.getValue());
|
||||
}
|
||||
|
||||
//校验
|
||||
checkReceivable(receivable);
|
||||
|
||||
crmReceivableMapper.insert(receivable);
|
||||
// 返回
|
||||
return receivable.getId();
|
||||
}
|
||||
|
||||
private void checkReceivable(CrmReceivableDO receivable) {
|
||||
|
||||
if(ObjectUtil.isNull(receivable.getContractId())){
|
||||
throw exception(CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
ContractDO contract = contractService.getContract(receivable.getContractId());
|
||||
if(ObjectUtil.isNull(contract)){
|
||||
throw exception(CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
CrmCustomerDO customer = crmCustomerService.getCustomer(receivable.getCustomerId());
|
||||
if(ObjectUtil.isNull(customer)){
|
||||
throw exception(CUSTOMER_NOT_EXISTS);
|
||||
}
|
||||
|
||||
CrmReceivablePlanDO receivablePlan = crmReceivablePlanService.getReceivablePlan(receivable.getPlanId());
|
||||
if(ObjectUtil.isNull(receivablePlan)){
|
||||
throw exception(RECEIVABLE_PLAN_NOT_EXISTS);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateReceivable(CrmReceivableUpdateReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateReceivableExists(updateReqVO.getId());
|
||||
|
||||
// 更新
|
||||
CrmReceivableDO updateObj = CrmReceivableConvert.INSTANCE.convert(updateReqVO);
|
||||
crmReceivableMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteReceivable(Long id) {
|
||||
// 校验存在
|
||||
validateReceivableExists(id);
|
||||
// 删除
|
||||
crmReceivableMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateReceivableExists(Long id) {
|
||||
if (crmReceivableMapper.selectById(id) == null) {
|
||||
throw exception(RECEIVABLE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CrmReceivableDO getReceivable(Long id) {
|
||||
return crmReceivableMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CrmReceivableDO> getReceivableList(Collection<Long> ids) {
|
||||
if (CollUtil.isEmpty(ids)) {
|
||||
return ListUtil.empty();
|
||||
}
|
||||
return crmReceivableMapper.selectBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<CrmReceivableDO> getReceivablePage(CrmReceivablePageReqVO pageReqVO) {
|
||||
return crmReceivableMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CrmReceivableDO> getReceivableList(CrmReceivableExportReqVO exportReqVO) {
|
||||
return crmReceivableMapper.selectList(exportReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
<?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="cn.iocoder.yudao.module.crm.dal.mysql.receivable.ReceivableMapper">
|
||||
<mapper namespace="cn.iocoder.yudao.module.crm.dal.mysql.receivable.CrmReceivableMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
@ -1,6 +1,6 @@
|
||||
<?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="cn.iocoder.yudao.module.crm.dal.mysql.receivable.ReceivablePlanMapper">
|
||||
<mapper namespace="cn.iocoder.yudao.module.crm.dal.mysql.receivable.CrmReceivablePlanMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
Loading…
Reference in New Issue