From 7a70162c1ba45c5a3a078ad54ab0365d4652ac9a Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 4 Aug 2020 15:05:20 +0800 Subject: [PATCH] =?UTF-8?q?crm=E6=B7=BB=E5=8A=A0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=89=80=E6=9C=89=E5=AE=A2=E6=88=B7fegin=E6=8E=A5=E5=8F=A3=20p?= =?UTF-8?q?oint=E6=B7=BB=E5=8A=A0=E5=88=9D=E5=A7=8B=E5=8C=96=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E8=A7=84=E5=88=99=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/InitPointRuleResultDTO.java | 45 +++++++++ .../com/epmet/dto/form/PointRuleFormDTO.java | 11 ++- .../epmet-point/epmet-point-server/pom.xml | 6 ++ .../epmet/controller/BackDoorController.java | 27 +++++- .../main/java/com/epmet/dao/PointRuleDao.java | 4 +- .../com/epmet/dao/PointRuleDefaultDao.java | 33 +++++++ .../epmet/entity/PointRuleDefaultEntity.java | 97 +++++++++++++++++++ .../com/epmet/entity/PointRuleEntity.java | 4 +- .../com/epmet/service/PointRuleService.java | 3 + .../service/impl/PointRuleServiceImpl.java | 40 +++++++- .../resources/db/migration/epmet_point.sql | 4 +- .../main/resources/mapper/PointRuleDao.xml | 3 + .../resources/mapper/PointRuleDefaultDao.xml | 27 ++++++ .../epmet/feign/OperCrmOpenFeignClient.java | 9 ++ .../OperCrmOpenFeignClientFallback.java | 5 + .../epmet/controller/CustomerController.java | 9 ++ .../main/java/com/epmet/dao/CustomerDao.java | 7 ++ .../com/epmet/service/CustomerService.java | 5 + .../service/impl/CustomerServiceImpl.java | 6 ++ .../src/main/resources/mapper/CustomerDao.xml | 8 ++ 20 files changed, 341 insertions(+), 12 deletions(-) create mode 100644 epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/InitPointRuleResultDTO.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRuleDefaultDao.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRuleDefaultEntity.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRuleDefaultDao.xml diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/InitPointRuleResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/InitPointRuleResultDTO.java new file mode 100644 index 0000000000..4f486cba66 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/InitPointRuleResultDTO.java @@ -0,0 +1,45 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 初始化客户规则 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +public class InitPointRuleResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 客户总数 + */ + private Integer customerTotal; + + /** + * 已经初始化总数 + */ + private Integer initedTotal; +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointRuleFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointRuleFormDTO.java index 5d3c6dabfa..00c02df232 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointRuleFormDTO.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointRuleFormDTO.java @@ -53,7 +53,7 @@ public class PointRuleFormDTO implements Serializable { @NotBlank(message = "是否开启不能为空", groups = {UpdateGroup.class}) private String enabledFlag; /** - * 是否启用 + * 积分上限不能为空 */ @NotNull(message = "积分上限不能为空", groups = {UpdateGroup.class}) private Integer upLimit; @@ -62,6 +62,15 @@ public class PointRuleFormDTO implements Serializable { * 积分上限描述 */ private String upLimitDesc; + /** + * 积分上限前缀 + */ + private String upLimitPrefix; + + /** + * 上限积分计算周期 + */ + private String rulePeriod; //=======系统添加时的属性====== /** diff --git a/epmet-module/epmet-point/epmet-point-server/pom.xml b/epmet-module/epmet-point/epmet-point-server/pom.xml index 208af44b10..a558d87053 100644 --- a/epmet-module/epmet-point/epmet-point-server/pom.xml +++ b/epmet-module/epmet-point/epmet-point-server/pom.xml @@ -81,6 +81,12 @@ 2.0.0 compile + + com.epmet + oper-crm-client + 2.0.0 + compile + diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/BackDoorController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/BackDoorController.java index 5c9dc10f67..cbbbbeebf5 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/BackDoorController.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/BackDoorController.java @@ -5,6 +5,7 @@ import com.epmet.common.enu.PointUnitEnum; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.dto.InitPointRuleResultDTO; import com.epmet.dto.form.PointRuleFormDTO; import com.epmet.service.PointRuleService; import org.springframework.beans.factory.annotation.Autowired; @@ -13,6 +14,8 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + /** * @author jianjun liu * @date 2020-06-04 20:39 @@ -24,18 +27,32 @@ public class BackDoorController { private PointRuleService pointRuleService; /** - * desc:添加规则 + * desc:批量添加规则 * - * @param formDTO + * @param list * @return */ @PostMapping(value = "addpointrule") - public Result add(@RequestBody PointRuleFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO, AddGroup.class); - pointRuleService.add(null, formDTO); + public Result add(@RequestBody List list) { + for (PointRuleFormDTO formDTO:list){ + ValidatorUtils.validateEntity(list, AddGroup.class); + pointRuleService.add(null, formDTO); + } return new Result().ok(true); } + /** + * desc:批量添加规则 + * + * @param list + * @return + */ + @PostMapping(value = "initpointrule") + public Result initPointRule() { + InitPointRuleResultDTO resultDTO = pointRuleService.initPointRule(); + return new Result().ok(resultDTO); + } + public static void main(String[] args) { PointRuleFormDTO formDTO = new PointRuleFormDTO(); formDTO.setPoint(0); diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRuleDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRuleDao.java index 9361d09442..9d5dbecdd3 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRuleDao.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRuleDao.java @@ -22,7 +22,6 @@ import com.epmet.dto.form.PointRuleListFormDTO; import com.epmet.entity.PointRuleEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; -import org.springframework.web.bind.annotation.PostMapping; import java.util.List; @@ -54,4 +53,7 @@ public interface PointRuleDao extends BaseDao { int updateByCustomerId(PointRuleEntity entity); PointRuleEntity selectByEventCodeAndCustomerId(@Param("customerId") String customerId, @Param("eventCode") String eventCode); + + List selectCustomerIds(); + } \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRuleDefaultDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRuleDefaultDao.java new file mode 100644 index 0000000000..4f83bca16c --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRuleDefaultDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.PointRuleDefaultEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 积分规则表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Mapper +public interface PointRuleDefaultDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRuleDefaultEntity.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRuleDefaultEntity.java new file mode 100644 index 0000000000..bbb6055148 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRuleDefaultEntity.java @@ -0,0 +1,97 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 积分规则表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("point_rule_default") +public class PointRuleDefaultEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 规则名称 与事件名称保持一致即可 + */ + private String ruleName; + + /** + * 规则说明 事件说明 + */ + private String ruleDesc; + + /** + * 事件CODE 来自事件表 + */ + private String eventCode; + + /** + * 功能分组Id + */ + private String functionId; + + /** + * 操作类型 加积分:add;减积分:subtract + */ + private String operateType; + + /** + * 积分上限 + */ + private Integer upLimit; + + /** + * 积分上限描述 + */ + private String upLimitDesc; + + /** + * 积分示例中 积分上限前缀 + */ + private String upLimitPrefix; + + /** + * 上限积分计算周期;不限:unlimit;首次:first;天:day;月:周:week;month;年:year + */ + private String rulePeriod; + + /** + * 获得积分值 + */ + private Integer point; + + /** + * 获得积分单位 次:time;分钟:minute;小时:hour + */ + private String pointUnit; + + /** + * 是否启用 0-否,1-是 + */ + private String enabledFlag; +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRuleEntity.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRuleEntity.java index ce47c3ca40..6468d86afb 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRuleEntity.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRuleEntity.java @@ -116,6 +116,8 @@ public class PointRuleEntity extends BaseEpmetEntity { Objects.equals(operateType, entity.operateType) && Objects.equals(upLimit, entity.upLimit) && Objects.equals(upLimitDesc, entity.upLimitDesc) && + Objects.equals(upLimitPrefix, entity.upLimitPrefix) && + Objects.equals(rulePeriod, entity.rulePeriod) && Objects.equals(point, entity.point) && Objects.equals(pointUnit, entity.pointUnit) && Objects.equals(enabledFlag, entity.enabledFlag); @@ -123,6 +125,6 @@ public class PointRuleEntity extends BaseEpmetEntity { @Override public int hashCode() { - return Objects.hash(super.hashCode(), customerId, ruleName, ruleDesc, eventCode, functionId, operateType, upLimit, upLimitDesc, point, pointUnit, enabledFlag); + return Objects.hash(super.hashCode(), customerId, ruleName, ruleDesc, eventCode, functionId, operateType, upLimit, upLimitDesc, upLimitPrefix, rulePeriod, point, pointUnit, enabledFlag); } } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointRuleService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointRuleService.java index f0e58de53e..28ec8991c2 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointRuleService.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointRuleService.java @@ -19,6 +19,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.InitPointRuleResultDTO; import com.epmet.dto.form.PointDetailFormDTO; import com.epmet.dto.form.PointRuleFormDTO; import com.epmet.dto.form.PointRuleListFormDTO; @@ -66,4 +67,6 @@ public interface PointRuleService extends BaseService { * @date 2020.07.31 14:54 **/ PointRuleEntity getByEventCodeAndCustomerId(String customerId,String eventCode); + + InitPointRuleResultDTO initPointRule(); } \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java index 9e5d5dea95..5eb5aaefbd 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java @@ -30,8 +30,11 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.PointRuleDao; +import com.epmet.dao.PointRuleDefaultDao; import com.epmet.dao.RuleOperateLogDao; +import com.epmet.dto.CustomerDTO; import com.epmet.dto.CustomerStaffDTO; +import com.epmet.dto.InitPointRuleResultDTO; import com.epmet.dto.form.CustomerFunctionListFormDTO; import com.epmet.dto.form.PointDetailFormDTO; import com.epmet.dto.form.PointRuleFormDTO; @@ -40,9 +43,11 @@ import com.epmet.dto.result.CustomerFunctionResultDTO; import com.epmet.dto.result.DefaultFunctionListResultDTO; import com.epmet.dto.result.PointDetailResultDTO; import com.epmet.dto.result.PointRuleResultDTO; +import com.epmet.entity.PointRuleDefaultEntity; import com.epmet.entity.PointRuleEntity; import com.epmet.entity.RuleOperateLogEntity; import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.OperCrmOpenFeignClient; import com.epmet.feign.OperCustomizeOpenFeignClient; import com.epmet.service.PointRuleService; import lombok.extern.slf4j.Slf4j; @@ -71,6 +76,10 @@ public class PointRuleServiceImpl extends BaseServiceImpl getFunctionList(String customerId) { @@ -171,16 +180,43 @@ public class PointRuleServiceImpl extends BaseServiceImpl> customerListResult = operCrmOpenFeignClient.getAllCustomerList(); + if (!customerListResult.success() || CollectionUtils.isEmpty(customerListResult.getData())) { + log.error("获取所有客户列表失败"); + } + List customerDTOList = customerListResult.getData(); + List ruleDefaultEntities = pointRuleDefaultDao.selectList(null); + List haveInitCustomerIds = baseDao.selectCustomerIds(); + List insertList = new ArrayList<>(); + ruleDefaultEntities.forEach(defaultRule -> { + for (CustomerDTO customerDTO : customerDTOList) { + if (haveInitCustomerIds.contains(customerDTO.getId())) { + continue; + } + PointRuleEntity entity = ConvertUtils.sourceToTarget(defaultRule, PointRuleEntity.class); + entity.setCustomerId(customerDTO.getId()); + insertList.add(entity); + } + }); + this.insertBatch(insertList, 100); + InitPointRuleResultDTO result = new InitPointRuleResultDTO(); + result.setCustomerTotal(customerDTOList.size()); + result.setInitedTotal(insertList.size()); + return result; } private void insertOperateRecord(TokenDto tokenDTO, PointRuleEntity entityNew, PointRuleEntity entityDB, String opType) { diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/epmet_point.sql b/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/epmet_point.sql index 88088724de..c5ff16cf02 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/epmet_point.sql +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/epmet_point.sql @@ -40,5 +40,5 @@ CREATE TABLE rule_operate_log( PRIMARY KEY (ID) ) COMMENT = '积分规则操作记录表'; -INSERT INTO `epmet_point`.`point_rule`(`ID`, `CUSTOMER_ID`, `RULE_NAME`, `RULE_DESC`, `EVENT_CODE`, `FUNCTION_ID`, `OPERATE_TYPE`, `UP_LIMIT`, `UP_LIMIT_DESC`, `UP_LIMIT_PREFIX`, `POINT`, `POINT_UNIT`, `ENABLED_FLAG`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1', '3ef7e4bb195eb9e622d68b52509aa940', '注册志愿者', '首次注册志愿者获得积分 ', 'register_volunteer', '43addd0735230c01eedbb38d721076b0', 'plus', 0, '无', '', 7, 'time', '1', '0', 0, 'APP_USER', '2020-07-23 14:48:56', 'APP_USER', '2020-07-23 14:48:56'); -INSERT INTO `epmet_point`.`point_rule`(`ID`, `CUSTOMER_ID`, `RULE_NAME`, `RULE_DESC`, `EVENT_CODE`, `FUNCTION_ID`, `OPERATE_TYPE`, `UP_LIMIT`, `UP_LIMIT_DESC`, `UP_LIMIT_PREFIX`, `POINT`, `POINT_UNIT`, `ENABLED_FLAG`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('2', '3ef7e4bb195eb9e622d68b52509aa940', '添加实况', '添加活动实况获得积分', 'active_insert_live', '43addd0735230c01eedbb38d721076b0', 'plus', 30, '每日该项所得积分总和上限,为0时表示没有积分上限', '每日获得积分上限', 20, 'time', '1', '0', 0, 'APP_USER', '2020-07-23 14:48:56', 'APP_USER', '2020-07-23 14:48:56'); +INSERT INTO `epmet_point`.`point_rule`(`ID`, `CUSTOMER_ID`, `RULE_NAME`, `RULE_DESC`, `EVENT_CODE`, `FUNCTION_ID`, `OPERATE_TYPE`, `UP_LIMIT`, `UP_LIMIT_DESC`, `UP_LIMIT_PREFIX`, `RULE_PERIOD`, `POINT`, `POINT_UNIT`, `ENABLED_FLAG`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1', '3ef7e4bb195eb9e622d68b52509aa940', '注册志愿者', '首次注册志愿者获得积分 ', 'register_volunteer', '43addd0735230c01eedbb38d721076b0', 'plus', 0, '无', '', 'first', 7, 'time', '1', '0', 0, 'APP_USER', '2020-07-23 14:48:56', 'APP_USER', '2020-07-23 14:48:56'); +INSERT INTO `epmet_point`.`point_rule`(`ID`, `CUSTOMER_ID`, `RULE_NAME`, `RULE_DESC`, `EVENT_CODE`, `FUNCTION_ID`, `OPERATE_TYPE`, `UP_LIMIT`, `UP_LIMIT_DESC`, `UP_LIMIT_PREFIX`, `RULE_PERIOD`, `POINT`, `POINT_UNIT`, `ENABLED_FLAG`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('2', '3ef7e4bb195eb9e622d68b52509aa940', '添加实况', '添加活动实况获得积分', 'active_insert_live', '43addd0735230c01eedbb38d721076b0', 'plus', 30, '每日该项所得积分总和上限,为0时表示没有积分上限', '每日获得积分上限', 'day', 20, 'time', '1', '0', 0, 'APP_USER', '2020-07-23 14:48:56', 'APP_USER', '2020-07-23 14:48:56'); diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRuleDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRuleDao.xml index 5171f21a59..7328567aab 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRuleDao.xml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRuleDao.xml @@ -47,4 +47,7 @@ AND CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND EVENT_CODE = #{eventCode,jdbcType=VARCHAR} + \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRuleDefaultDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRuleDefaultDao.xml new file mode 100644 index 0000000000..4e317c9a95 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRuleDefaultDao.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java index 6048121b9d..7b426012b4 100644 --- a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java @@ -53,4 +53,13 @@ public interface OperCrmOpenFeignClient { */ @PostMapping("/oper/crm/customer/addmanager") Result addManager(@RequestBody CustomerManagerFormDTO form); + + /** + * 获取客户李彪 + * @author zhaoqifeng + * @date 2020/8/3 15:24 + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("/oper/crm/customer/getalllist") + Result> getAllCustomerList(); } diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java index 504d2be412..b4f3947ed7 100644 --- a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java @@ -45,4 +45,9 @@ public class OperCrmOpenFeignClientFallback implements OperCrmOpenFeignClient { public Result addManager(CustomerManagerFormDTO form) { return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "CustomerManagerFormDTO", form); } + + @Override + public Result> getAllCustomerList() { + return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getAllCustomerList", null); + } } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java index 508f0ba09b..79c49245b6 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java @@ -247,4 +247,13 @@ public class CustomerController { return new Result(); } + /** + * desc:获取所有未删除的客户 + * @return + */ + @PostMapping("getalllist") + public Result> getAllList() { + return new Result>().ok(customerService.getAllList()); + } + } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java index 9ca4638bdd..dea5f2f40b 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java @@ -67,4 +67,11 @@ public interface CustomerDao extends BaseDao { * @Description 查询有效客户数据(不区分是否在有效期内)【按名称模糊查询】 **/ List selectCustomerList(@Param("customerName") String customerName); + + /** + * desc:获取未删除的所有用户 + * @return + */ + List getAllList(); + } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java index bf486a4ef2..b815474688 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java @@ -169,4 +169,9 @@ public interface CustomerService extends BaseService { **/ void init(CustomerInitFormDTO formDTO); + /** + * desc:获取所有客户列表 + * @return + */ + List getAllList(); } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java index 560586a971..eeb8e6abd5 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java @@ -520,4 +520,10 @@ public class CustomerServiceImpl extends BaseServiceImpl getAllList() { + List list = baseDao.getAllList(); + return ConvertUtils.sourceToTarget(list,CustomerDTO.class); + } + } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml b/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml index 997216b76c..1065535489 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml @@ -70,4 +70,12 @@ AND customer_name LIKE concat('%', trim(#{customerName}), '%') +