mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2025-01-19 03:30:06 +08:00
CRM: 完善回款
This commit is contained in:
parent
dd6981d901
commit
88cb683752
@ -221,4 +221,13 @@ public class CrmContractController {
|
|||||||
return success(contractService.getEndContractCount(getLoginUserId()));
|
return success(contractService.getEndContractCount(getLoginUserId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/list-all-simple-by-customer")
|
||||||
|
@Operation(summary = "获得合同精简列表", description = "只包含有读权限的客户的合同,主要用于前端的下拉选项")
|
||||||
|
@Parameter(name = "customerId", description = "客户编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('crm:contract:query')")
|
||||||
|
public CommonResult<List<CrmContractRespVO>> getListAllSimpleByCustomer(@RequestParam("customerId") Long customerId) {
|
||||||
|
PageResult<CrmContractDO> result = contractService.getContractPageByCustomerId(new CrmContractPageReqVO().setCustomerId(customerId));
|
||||||
|
return success(BeanUtils.toBean(result.getList(), CrmContractRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -153,7 +153,7 @@ public class CrmReceivableController {
|
|||||||
|
|
||||||
@PutMapping("/submit")
|
@PutMapping("/submit")
|
||||||
@Operation(summary = "提交回款审批")
|
@Operation(summary = "提交回款审批")
|
||||||
@PreAuthorize("@ss.hasPermission('crm:receivable:submit')")
|
@PreAuthorize("@ss.hasPermission('crm:receivable:update')")
|
||||||
public CommonResult<Boolean> submitContract(@RequestParam("id") Long id) {
|
public CommonResult<Boolean> submitContract(@RequestParam("id") Long id) {
|
||||||
receivableService.submitReceivable(id, getLoginUserId());
|
receivableService.submitReceivable(id, getLoginUserId());
|
||||||
return success(true);
|
return success(true);
|
||||||
|
@ -24,6 +24,7 @@ import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
|||||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameters;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
@ -159,4 +160,18 @@ public class CrmReceivablePlanController {
|
|||||||
return success(receivablePlanService.getRemindReceivablePlanCount(getLoginUserId()));
|
return success(receivablePlanService.getRemindReceivablePlanCount(getLoginUserId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/list-all-simple-by-customer")
|
||||||
|
@Operation(summary = "获得回款计划精简列表", description = "获得回款计划精简列表,主要用于前端的下拉选项")
|
||||||
|
@Parameters({
|
||||||
|
@Parameter(name = "customerId", description = "客户编号", required = true),
|
||||||
|
@Parameter(name = "contractId", description = "合同编号", required = true)
|
||||||
|
})
|
||||||
|
@PreAuthorize("@ss.hasPermission('crm:receivable-plan:query')")
|
||||||
|
public CommonResult<List<CrmReceivablePlanRespVO>> getListAllSimpleByCustomer(@RequestParam("customerId") Long customerId,
|
||||||
|
@RequestParam("contractId") Long contractId) {
|
||||||
|
PageResult<CrmReceivablePlanDO> result = receivablePlanService.getReceivablePlanPageByCustomerId(
|
||||||
|
new CrmReceivablePlanPageReqVO().setCustomerId(customerId).setContractId(contractId));
|
||||||
|
return success(BeanUtils.toBean(result.getList(), CrmReceivablePlanRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -30,8 +30,10 @@ public class CrmReceivablePlanPageReqVO extends PageParam {
|
|||||||
@Schema(description = "客户编号", example = "18026")
|
@Schema(description = "客户编号", example = "18026")
|
||||||
private Long customerId;
|
private Long customerId;
|
||||||
|
|
||||||
// TODO @芋艿:这个搜的应该是合同编号 no
|
@Schema(description = "合同编号", example = "H3473")
|
||||||
@Schema(description = "合同名称", example = "3473")
|
private String contractNo;
|
||||||
|
|
||||||
|
@Schema(description = "合同编号", example = "3473")
|
||||||
private Long contractId;
|
private Long contractId;
|
||||||
|
|
||||||
@Schema(description = "场景类型", example = "1")
|
@Schema(description = "场景类型", example = "1")
|
||||||
|
@ -37,6 +37,10 @@ public class CrmReceivablePlanSaveReqVO {
|
|||||||
@NotNull(message = "计划回款金额不能为空")
|
@NotNull(message = "计划回款金额不能为空")
|
||||||
private BigDecimal price;
|
private BigDecimal price;
|
||||||
|
|
||||||
|
@Schema(description = "提醒日期", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
@NotNull(message = "提醒日期不能为空")
|
||||||
|
private LocalDateTime remindTime;
|
||||||
|
|
||||||
@Schema(description = "提前几天提醒", example = "1")
|
@Schema(description = "提前几天提醒", example = "1")
|
||||||
private Integer remindDays;
|
private Integer remindDays;
|
||||||
|
|
||||||
|
@ -38,9 +38,6 @@ public class CrmReceivableRespVO {
|
|||||||
@Schema(description = "负责人编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
@Schema(description = "负责人编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||||
private Long ownerUserId;
|
private Long ownerUserId;
|
||||||
|
|
||||||
@Schema(description = "显示顺序")
|
|
||||||
private Integer sort;
|
|
||||||
|
|
||||||
@Schema(description = "备注", example = "备注")
|
@Schema(description = "备注", example = "备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
@ -46,9 +46,6 @@ public class CrmReceivableSaveReqVO {
|
|||||||
@NotNull(message = "负责人编号不能为空")
|
@NotNull(message = "负责人编号不能为空")
|
||||||
private Long ownerUserId;
|
private Long ownerUserId;
|
||||||
|
|
||||||
@Schema(description = "显示顺序")
|
|
||||||
private Integer sort;
|
|
||||||
|
|
||||||
@Schema(description = "备注", example = "备注")
|
@Schema(description = "备注", example = "备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
@ -67,10 +67,6 @@ public class CrmReceivableDO extends BaseDO {
|
|||||||
* 计划回款金额,单位:元
|
* 计划回款金额,单位:元
|
||||||
*/
|
*/
|
||||||
private BigDecimal price;
|
private BigDecimal price;
|
||||||
/**
|
|
||||||
* 显示顺序
|
|
||||||
*/
|
|
||||||
private Integer sort;
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
|
@ -3,9 +3,9 @@ package cn.iocoder.yudao.module.crm.dal.mysql.receivable;
|
|||||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.query.MPJLambdaWrapperX;
|
import cn.iocoder.yudao.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||||
import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.plan.CrmReceivablePlanPageReqVO;
|
import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.plan.CrmReceivablePlanPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.crm.dal.dataobject.contract.CrmContractDO;
|
||||||
import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivablePlanDO;
|
import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivablePlanDO;
|
||||||
import cn.iocoder.yudao.module.crm.enums.common.CrmBizTypeEnum;
|
import cn.iocoder.yudao.module.crm.enums.common.CrmBizTypeEnum;
|
||||||
import cn.iocoder.yudao.module.crm.enums.common.CrmSceneTypeEnum;
|
import cn.iocoder.yudao.module.crm.enums.common.CrmSceneTypeEnum;
|
||||||
@ -15,6 +15,7 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 回款计划 Mapper
|
* 回款计划 Mapper
|
||||||
@ -25,10 +26,15 @@ import java.util.List;
|
|||||||
public interface CrmReceivablePlanMapper extends BaseMapperX<CrmReceivablePlanDO> {
|
public interface CrmReceivablePlanMapper extends BaseMapperX<CrmReceivablePlanDO> {
|
||||||
|
|
||||||
default PageResult<CrmReceivablePlanDO> selectPageByCustomerId(CrmReceivablePlanPageReqVO reqVO) {
|
default PageResult<CrmReceivablePlanDO> selectPageByCustomerId(CrmReceivablePlanPageReqVO reqVO) {
|
||||||
return selectPage(reqVO, new LambdaQueryWrapperX<CrmReceivablePlanDO>()
|
MPJLambdaWrapperX<CrmReceivablePlanDO> query = new MPJLambdaWrapperX<>();
|
||||||
.eq(CrmReceivablePlanDO::getCustomerId, reqVO.getCustomerId()) // 必须传递
|
if (Objects.nonNull(reqVO.getContractNo())) { // 根据合同编号检索
|
||||||
|
query.innerJoin(CrmContractDO.class, on -> on.like(CrmContractDO::getNo, reqVO.getContractNo())
|
||||||
|
.eq(CrmContractDO::getId, CrmReceivablePlanDO::getContractId));
|
||||||
|
}
|
||||||
|
query.eq(CrmReceivablePlanDO::getCustomerId, reqVO.getCustomerId()) // 必须传递
|
||||||
.eqIfPresent(CrmReceivablePlanDO::getContractId, reqVO.getContractId())
|
.eqIfPresent(CrmReceivablePlanDO::getContractId, reqVO.getContractId())
|
||||||
.orderByDesc(CrmReceivablePlanDO::getId));
|
.orderByDesc(CrmReceivablePlanDO::getPeriod);
|
||||||
|
return selectJoinPage(reqVO, CrmReceivablePlanDO.class, query);
|
||||||
}
|
}
|
||||||
|
|
||||||
default PageResult<CrmReceivablePlanDO> selectPage(CrmReceivablePlanPageReqVO pageReqVO, Long userId) {
|
default PageResult<CrmReceivablePlanDO> selectPage(CrmReceivablePlanPageReqVO pageReqVO, Long userId) {
|
||||||
@ -40,7 +46,12 @@ public interface CrmReceivablePlanMapper extends BaseMapperX<CrmReceivablePlanDO
|
|||||||
query.selectAll(CrmReceivablePlanDO.class)
|
query.selectAll(CrmReceivablePlanDO.class)
|
||||||
.eqIfPresent(CrmReceivablePlanDO::getCustomerId, pageReqVO.getCustomerId())
|
.eqIfPresent(CrmReceivablePlanDO::getCustomerId, pageReqVO.getCustomerId())
|
||||||
.eqIfPresent(CrmReceivablePlanDO::getContractId, pageReqVO.getContractId())
|
.eqIfPresent(CrmReceivablePlanDO::getContractId, pageReqVO.getContractId())
|
||||||
.orderByDesc(CrmReceivablePlanDO::getId);
|
.orderByDesc(CrmReceivablePlanDO::getPeriod);
|
||||||
|
|
||||||
|
if (Objects.nonNull(pageReqVO.getContractNo())) { // 根据合同编号检索
|
||||||
|
query.innerJoin(CrmContractDO.class, on -> on.like(CrmContractDO::getNo, pageReqVO.getContractNo())
|
||||||
|
.eq(CrmContractDO::getId, CrmReceivablePlanDO::getContractId));
|
||||||
|
}
|
||||||
|
|
||||||
// Backlog: 回款提醒类型
|
// Backlog: 回款提醒类型
|
||||||
// TODO: @dhb52 需要配置 提前提醒天数
|
// TODO: @dhb52 需要配置 提前提醒天数
|
||||||
@ -55,7 +66,8 @@ public interface CrmReceivablePlanMapper extends BaseMapperX<CrmReceivablePlanDO
|
|||||||
.lt(CrmReceivablePlanDO::getReturnTime, endOfToday);
|
.lt(CrmReceivablePlanDO::getReturnTime, endOfToday);
|
||||||
} else if (CrmReceivablePlanPageReqVO.REMIND_TYPE_RECEIVED.equals(pageReqVO.getRemindType())) { // 已回款
|
} else if (CrmReceivablePlanPageReqVO.REMIND_TYPE_RECEIVED.equals(pageReqVO.getRemindType())) { // 已回款
|
||||||
query.isNotNull(CrmReceivablePlanDO::getReceivableId)
|
query.isNotNull(CrmReceivablePlanDO::getReceivableId)
|
||||||
.between(CrmReceivablePlanDO::getReturnTime, beginOfToday, endOfToday.plusDays(REMIND_DAYS));;
|
.between(CrmReceivablePlanDO::getReturnTime, beginOfToday, endOfToday.plusDays(REMIND_DAYS));
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
return selectJoinPage(pageReqVO, CrmReceivablePlanDO.class, query);
|
return selectJoinPage(pageReqVO, CrmReceivablePlanDO.class, query);
|
||||||
|
Loading…
Reference in New Issue
Block a user