| | |
| | | return selectOne(CrmContractDO::getNo, no); |
| | | } |
| | | |
| | | default CrmContractDO selectByNameAndCustomerId(String name, Long customerId) { |
| | | return selectOne(new LambdaQueryWrapperX<CrmContractDO>() |
| | | .eq(CrmContractDO::getName, name) |
| | | .eq(CrmContractDO::getCustomerId, customerId)); |
| | | } |
| | | |
| | | /** |
| | | * 提交审批:置为审批中,并清空上一轮审核结果 |
| | | * |
| | |
| | | default int submitAndResetAuditInfo(Long id, Integer status) { |
| | | return update(null, new LambdaUpdateWrapper<CrmContractDO>() |
| | | .eq(CrmContractDO::getId, id) |
| | | .in(CrmContractDO::getAuditStatus, CrmAuditStatusEnum.DRAFT.getStatus(), |
| | | CrmAuditStatusEnum.REJECT.getStatus()) |
| | | .set(CrmContractDO::getAuditStatus, status) |
| | | .set(CrmContractDO::getReviewerId, null) |
| | | .set(CrmContractDO::getReviewerName, null) |
| | |
| | | String reviewerName, String reviewRemark) { |
| | | return update(null, new LambdaUpdateWrapper<CrmContractDO>() |
| | | .eq(CrmContractDO::getId, id) |
| | | .eq(CrmContractDO::getAuditStatus, CrmAuditStatusEnum.PROCESS.getStatus()) |
| | | .set(CrmContractDO::getAuditStatus, status) |
| | | .set(CrmContractDO::getReviewerId, reviewerId) |
| | | .set(CrmContractDO::getReviewerName, reviewerName) |
| | |
| | | .set(CrmContractDO::getReviewRemark, reviewRemark)); |
| | | } |
| | | |
| | | /** |
| | | * BPM 审批结束后回写合同状态 |
| | | * |
| | | * 仅当合同仍处于「审批中」时更新,避免与旧审批路径重复覆盖。 |
| | | */ |
| | | default int updateAuditStatusByBpm(Long id, Integer status, String reviewRemark) { |
| | | return update(null, new LambdaUpdateWrapper<CrmContractDO>() |
| | | .eq(CrmContractDO::getId, id) |
| | | .eq(CrmContractDO::getAuditStatus, CrmAuditStatusEnum.PROCESS.getStatus()) |
| | | .set(CrmContractDO::getAuditStatus, status) |
| | | .set(CrmContractDO::getReviewTime, LocalDateTime.now()) |
| | | .set(CrmContractDO::getReviewRemark, reviewRemark)); |
| | | } |
| | | |
| | | default PageResult<CrmContractDO> selectPageByCustomerId(CrmContractPageReqVO pageReqVO) { |
| | | return selectPage(pageReqVO, new LambdaQueryWrapperX<CrmContractDO>() |
| | | .eq(CrmContractDO::getCustomerId, pageReqVO.getCustomerId()) |