Skip to content

Commit

Permalink
Merge pull request #13 from EcoNetsTech/2.x
Browse files Browse the repository at this point in the history
2.x
  • Loading branch information
ryximu233 authored Feb 27, 2024
2 parents 22121c8 + a7802ed commit 5def87f
Show file tree
Hide file tree
Showing 166 changed files with 3,070 additions and 1,215 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@

| 项目 | Star | 简介 |
|-----------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [econets-vue](https://github.com/EcoNetsTech/econets-vue) | [![GitHub stars](https://img.shields.io/github/stars/EcoNetsTech/econets-vue.svg?style=social&label=Stars)](https://github.com/EcoNetsTech/econets-vue) | 基于 Spring Boot 多模块架构 |
| [econets-vue-mini](https://github.com/EcoNetsTech/econets-vue-mini) | [![GitHub stars](https://img.shields.io/github/stars/EcoNetsTech/econets-vue-mini.svg?style=social&label=Stars)](https://github.com/EcoNetsTech/econets-vue-mini) | 基于 Spring Boot 多模块架构 mini版 |
| [econets-vue](https://github.com/EcoNetsTech/econets-vue) | [![Gitee star](https://gitee.com/EcoNetsTech/econets-vue/badge/star.svg?theme=white)](https://gitee.com/EcoNetsTech/econets-vue) [![GitHub stars](https://img.shields.io/github/stars/EcoNetsTech/econets-vue.svg?style=social&label=Stars)](https://github.com/EcoNetsTech/econets-vue) | 基于 Spring Boot 多模块架构 |
| [econets-vue-mini](https://github.com/EcoNetsTech/econets-vue-mini) | [![Gitee star](https://gitee.com/EcoNetsTech/econets-vue-mini/badge/star.svg?theme=white)](https://gitee.com/EcoNetsTech/econets-vue-mini) [![GitHub stars](https://img.shields.io/github/stars/EcoNetsTech/econets-vue-mini.svg?style=social&label=Stars)](https://github.com/EcoNetsTech/econets-vue-mini) | 基于 Spring Boot 多模块架构 mini版 |

### 前端项目

| 项目 | Star | 简介 |
|----------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------|
| [econets-ui-admin-vue3](https://github.com/EcoNetsTech/econets-ui-admin-vue3) | [![GitHub stars](https://img.shields.io/github/stars/EcoNetsTech/econets-ui-admin-vue3.svg?style=social&label=Stars)](https://github.com/EcoNetsTech/econets-ui-admin-vue3) | 基于 Vue3 + element-plus 实现的管理后台 |
| [econets-ui-admin-vue3](https://github.com/EcoNetsTech/econets-ui-admin-vue3) | [![Gitee star](https://gitee.com/EcoNetsTech/econets-ui-admin-vue3/badge/star.svg?theme=white)](https://gitee.com/EcoNetsTech/econets-ui-admin-vue3) [![GitHub stars](https://img.shields.io/github/stars/EcoNetsTech/econets-ui-admin-vue3.svg?style=social&label=Stars)](https://github.com/EcoNetsTech/econets-ui-admin-vue3) | 基于 Vue3 + element-plus 实现的管理后台 |
| [econets-mall-uniapp](https://github.com/EcoNetsTech/econets-mall-uniapp) | [![Gitee star](https://gitee.com/EcoNetsTech/econets-mall-uniapp/badge/star.svg?theme=white)](https://gitee.com/EcoNetsTech/econets-mall-uniapp) [![GitHub stars](https://img.shields.io/github/stars/EcoNetsTech/econets-mall-uniapp.svg?style=social&label=Stars)](https://github.com/EcoNetsTech/econets-mall-uniapp) | 基于 uni-app 实现的商城小程序 |


## 分支说明
Expand Down
2 changes: 1 addition & 1 deletion blossom-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<description>基础 bom 文件,管理整个项目的依赖版本</description>

<properties>
<revision>1.0.1</revision>
<revision>2.0.1</revision>
<flatten-maven-plugin.version>1.5.0</flatten-maven-plugin.version>
<!-- 统一依赖管理 -->
<spring.boot.version>2.7.17</spring.boot.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@
*/
public class MoneyUtils {

/**
* 金额的小数位数
*/
private static final int PRICE_SCALE = 2;

/**
* 百分比对应的 BigDecimal 对象
*/
public static final BigDecimal PERCENT_100 = BigDecimal.valueOf(100);

/**
* 计算百分比金额,四舍五入
*
Expand All @@ -34,6 +44,22 @@ public static Integer calculateRatePriceFloor(Integer price, Double rate) {
return calculateRatePrice(price, rate, 0, RoundingMode.FLOOR).intValue();
}

/**
* 计算百分比金额
*
* @param price 金额(单位分)
* @param count 数量
* @param percent 折扣(单位分),列如 60.2%,则传入 6020
* @return 商品总价
*/
public static Integer calculator(Integer price, Integer count, Integer percent) {
price = price * count;
if (percent == null) {
return price;
}
return MoneyUtils.calculateRatePriceFloor(price, (double) (percent / 100));
}

/**
* 计算百分比金额
*
Expand Down Expand Up @@ -69,4 +95,35 @@ public static String fenToYuanStr(int fen) {
return new Money(0, fen).toString();
}

/**
* 金额相乘,默认进行四舍五入
*
* 位数:{@link #PRICE_SCALE}
*
* @param price 金额
* @param count 数量
* @return 金额相乘结果
*/
public static BigDecimal priceMultiply(BigDecimal price, BigDecimal count) {
if (price == null || count == null) {
return null;
}
return price.multiply(count).setScale(PRICE_SCALE, RoundingMode.HALF_UP);
}

/**
* 金额相乘(百分比),默认进行四舍五入
*
* 位数:{@link #PRICE_SCALE}
*
* @param price 金额
* @param percent 百分比
* @return 金额相乘结果
*/
public static BigDecimal priceMultiplyPercent(BigDecimal price, BigDecimal percent) {
if (price == null || percent == null) {
return null;
}
return price.multiply(percent).divide(PERCENT_100, PRICE_SCALE, RoundingMode.HALF_UP);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package cn.econets.blossom.framework.dict.config;

import cn.econets.blossom.framework.dict.core.DictFrameworkUtils;
import cn.econets.blossom.framework.dict.core.util.DictFrameworkUtils;
import cn.econets.blossom.module.system.api.dict.DictDataApi;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package cn.econets.blossom.framework.dict.core;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cn.econets.blossom.framework.dict.core;
package cn.econets.blossom.framework.dict.core.util;

import cn.econets.blossom.framework.common.core.KeyValue;
import cn.econets.blossom.framework.common.util.cache.CacheUtils;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package cn.econets.blossom.framework.excel.core.convert;

import cn.econets.blossom.framework.dict.core.DictFrameworkUtils;
import cn.econets.blossom.framework.dict.core.util.DictFrameworkUtils;
import cn.econets.blossom.framework.excel.core.annotations.DictFormat;
import cn.hutool.core.convert.Convert;
import com.alibaba.excel.converters.Converter;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package cn.econets.blossom.module.bpm.api.listener;

import cn.econets.blossom.module.bpm.api.listener.dto.BpmResultListenerRespDTO;

// TODO 后续改成支持 RPC
/**
* 业务流程实例的结果发生变化的监听器 Api
*
*/
public interface BpmResultListenerApi {

/**
* 监听的流程定义 Key
*
* @return 返回监听的流程定义 Key
*/
String getProcessDefinitionKey();

/**
* 处理事件
*
* @param event 事件
*/
void onEvent(BpmResultListenerRespDTO event);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package cn.econets.blossom.module.bpm.api.listener.dto;

import lombok.Data;

// TODO后续改成支持 RPC
/**
* 业务流程实例的结果 Response DTO
*
*/
@Data
public class BpmResultListenerRespDTO {

/**
* 流程实例的编号
*/
private String id;
/**
* 流程实例的 key
*/
private String processDefinitionKey;
/**
* 流程实例的结果
*/
private Integer result;
/**
* 流程实例对应的业务标识
* 例如说,请假
*/
private String businessKey;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package cn.econets.blossom.module.bpm.framework.bpm.listener;

import cn.hutool.core.util.StrUtil;
import cn.econets.blossom.framework.common.util.object.BeanUtils;
import cn.econets.blossom.module.bpm.api.listener.BpmResultListenerApi;
import cn.econets.blossom.module.bpm.api.listener.dto.BpmResultListenerRespDTO;
import cn.econets.blossom.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

// TODO 后续改成支持 RPC
/**
* 业务流程结果监听器实现类
*
*/
@Component
public class BpmServiceResultListener implements ApplicationListener<BpmProcessInstanceResultEvent> {

@Resource
private List<BpmResultListenerApi> bpmResultListenerApis;

@Override
public final void onApplicationEvent(BpmProcessInstanceResultEvent event) {
bpmResultListenerApis.forEach(bpmResultListenerApi -> {
if (!StrUtil.equals(event.getProcessDefinitionKey(), bpmResultListenerApi.getProcessDefinitionKey())) {
return;
}
bpmResultListenerApi.onEvent(BeanUtils.toBean(event, BpmResultListenerRespDTO.class));
});
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ public interface ErrorCodeConstants {

// ========== 合同管理 1-020-000-000 ==========
ErrorCode CONTRACT_NOT_EXISTS = new ErrorCode(1_020_000_000, "合同不存在");
ErrorCode CONTRACT_UPDATE_FAIL_EDITING_PROHIBITED = new ErrorCode(1_020_000_001, "更新合同失败,原因:禁止编辑");
ErrorCode CONTRACT_SUBMIT_FAIL_NOT_DRAFT = new ErrorCode(1_020_000_002, "合同提交审核失败,原因:合同没处在未提交状态");

// ========== 线索管理 1-020-001-000 ==========
ErrorCode CLUE_NOT_EXISTS = new ErrorCode(1_020_001_000, "线索不存在");
Expand All @@ -21,13 +23,13 @@ public interface ErrorCodeConstants {
ErrorCode BUSINESS_NOT_EXISTS = new ErrorCode(1_020_002_000, "商机不存在");
ErrorCode BUSINESS_CONTRACT_EXISTS = new ErrorCode(1_020_002_001, "商机已关联合同,不能删除");

// TODO 商机状态、商机类型,都单独错误码段
// TODO @lilleo:商机状态、商机类型,都单独错误码段


// ========== 联系人管理 1-020-003-000 ==========
ErrorCode CONTACT_NOT_EXISTS = new ErrorCode(1_020_003_000, "联系人不存在");
ErrorCode CONTACT_BUSINESS_LINK_NOT_EXISTS = new ErrorCode( 1_020_003_001, "联系人商机关联不存在");
ErrorCode CONTACT_DELETE_FAIL_CONTRACT_LINK_EXISTS = new ErrorCode( 1_020_003_002, "联系人已关联合同,不能删除");
ErrorCode CONTACT_BUSINESS_LINK_NOT_EXISTS = new ErrorCode(1_020_003_001, "联系人商机关联不存在");
ErrorCode CONTACT_DELETE_FAIL_CONTRACT_LINK_EXISTS = new ErrorCode(1_020_003_002, "联系人已关联合同,不能删除");

// ========== 回款 1-020-004-000 ==========
ErrorCode RECEIVABLE_NOT_EXISTS = new ErrorCode(1_020_004_000, "回款不存在");
Expand All @@ -48,6 +50,9 @@ public interface ErrorCodeConstants {
ErrorCode CUSTOMER_LOCK_EXCEED_LIMIT = new ErrorCode(1_020_006_009, "锁定客户失败,超出锁定规则上限");
ErrorCode CUSTOMER_OWNER_EXCEED_LIMIT = new ErrorCode(1_020_006_010, "操作失败,超出客户数拥有上限");
ErrorCode CUSTOMER_DELETE_FAIL_HAVE_REFERENCE = new ErrorCode(1_020_006_011, "删除客户失败,有关联{}");
ErrorCode CUSTOMER_IMPORT_LIST_IS_EMPTY = new ErrorCode(1_020_006_012, "导入客户数据不能为空!");
ErrorCode CUSTOMER_CREATE_NAME_NOT_NULL = new ErrorCode(1_020_006_013, "客户名称不能为空!");
ErrorCode CUSTOMER_NAME_EXISTS = new ErrorCode(1_020_006_014, "已存在名为【{}】的客户!");

// ========== 权限管理 1_020_007_000 ==========
ErrorCode CRM_PERMISSION_NOT_EXISTS = new ErrorCode(1_020_007_000, "数据权限不存在");
Expand Down Expand Up @@ -80,10 +85,13 @@ public interface ErrorCodeConstants {
ErrorCode BUSINESS_STATUS_NOT_EXISTS = new ErrorCode(1_020_011_000, "商机状态不存在");

// ========== 客户公海规则设置 1_020_012_000 ==========
ErrorCode CUSTOMER_LIMIT_CONFIG_NOT_EXISTS = new ErrorCode(1_020_012_000, "客户限制配置不存在");
ErrorCode CUSTOMER_POOL_CONFIG_NOT_EXISTS_OR_DISABLED = new ErrorCode(1_020_012_000, "客户公海配置不存在或未启用");
ErrorCode CUSTOMER_LIMIT_CONFIG_NOT_EXISTS = new ErrorCode(1_020_012_001, "客户限制配置不存在");

// ========== 跟进记录 1_020_013_000 ==========
ErrorCode FOLLOW_UP_RECORD_NOT_EXISTS = new ErrorCode(1_020_013_000, "跟进记录不存在");
ErrorCode FOLLOW_UP_RECORD_DELETE_DENIED = new ErrorCode(1_020_013_001, "删除跟进记录失败,原因:没有权限");

// ========== 待办消息 1_020_014_000 ==========

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ public interface LogRecordConstants {
// ======================= CRM_LEADS 线索 =======================

String CRM_LEADS_TYPE = "CRM 线索";
String CRM_LEADS_CREATE_SUB_TYPE = "创建线索";
String CRM_LEADS_CREATE_SUCCESS = "创建了线索{{#clue.name}}";
String CRM_LEADS_UPDATE_SUB_TYPE = "更新线索";
String CRM_LEADS_UPDATE_SUCCESS = "更新了线索【{{#clueName}}】: {_DIFF{#updateReq}}";
String CRM_LEADS_DELETE_SUB_TYPE = "删除线索";
String CRM_LEADS_DELETE_SUCCESS = "删除了线索【{{#clueName}}】";
String CRM_LEADS_TRANSFER_SUB_TYPE = "转移线索";
String CRM_LEADS_TRANSFER_SUCCESS = "将线索【{{#clue.name}}】的负责人从【{getAdminUserById{#clue.ownerUserId}}】变更为了【{getAdminUserById{#reqVO.newOwnerUserId}}】";
String CRM_LEADS_TRANSLATE_SUB_TYPE = "线索转化为客户";
String CRM_LEADS_TRANSLATE_SUCCESS = "将线索【{{#clue.name}}】转化为客户";

// ======================= CRM_CUSTOMER 客户 =======================

Expand All @@ -28,6 +38,8 @@ public interface LogRecordConstants {
String CRM_CUSTOMER_POOL_SUCCESS = "将客户【{{#customerName}}】放入了公海";
String CRM_CUSTOMER_RECEIVE_SUB_TYPE = "{{#ownerUserName != null ? '分配客户' : '领取客户'}}";
String CRM_CUSTOMER_RECEIVE_SUCCESS = "{{#ownerUserName != null ? '将客户【' + #customer.name + '】分配给【' + #ownerUserName + '】' : '领取客户【' + #customer.name + '】'}}";
String CRM_CUSTOMER_IMPORT_SUB_TYPE = "{{#isUpdate ? '导入并更新客户' : '导入客户'}}";
String CRM_CUSTOMER_IMPORT_SUCCESS = "{{#isUpdate ? '导入并更新了客户【'+ #customer.name +'】' : '导入了客户【'+ #customer.name +'】'}}";

// ======================= CRM_CUSTOMER_LIMIT_CONFIG 客户限制配置 =======================

Expand Down Expand Up @@ -80,6 +92,8 @@ public interface LogRecordConstants {
String CRM_CONTRACT_DELETE_SUCCESS = "删除了合同【{{#contractName}}】";
String CRM_CONTRACT_TRANSFER_SUB_TYPE = "转移合同";
String CRM_CONTRACT_TRANSFER_SUCCESS = "将合同【{{#contract.name}}】的负责人从【{getAdminUserById{#contract.ownerUserId}}】变更为了【{getAdminUserById{#reqVO.newOwnerUserId}}】";
String CRM_CONTRACT_SUBMIT_SUB_TYPE = "提交合同审批";
String CRM_CONTRACT_SUBMIT_SUCCESS = "提交合同【{{#contractName}}】审批成功";

// ======================= CRM_PRODUCT 产品 =======================

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
import java.util.Arrays;

// TODO 1)title、description、create 可以删除,非标准的 javadoc 注释哈,然后可以在类上加下这个类的注释;2)CrmBizEndStatus 改成 CrmBusinessEndStatus,非必要不缩写哈,可阅读比较重要
/**
* @version 1.0
* @title CrmBizEndStatus
* @description
*/
@RequiredArgsConstructor
@Getter
public enum CrmBizEndStatus implements IntArrayValuable {
Expand All @@ -23,7 +18,7 @@ public enum CrmBizEndStatus implements IntArrayValuable {

public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CrmBizEndStatus::getStatus).toArray();

// TODO 这里的方法,建议放到 49 行之后;一般类里是,静态变量,普通变量;静态方法;普通方法
// TODO @lzxhqs:这里的方法,建议放到 49 行之后;一般类里是,静态变量,普通变量;静态方法;普通方法
public static boolean isWin(Integer status) {
return ObjectUtil.equal(WIN.getStatus(), status);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
/**
* CRM 的审批状态
*
*
*/
@RequiredArgsConstructor
@Getter
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
/**
* CRM 商品状态
*
* @since 2023-11-30 21:53
*/
@Getter
@AllArgsConstructor
Expand Down
Loading

0 comments on commit 5def87f

Please sign in to comment.