Browse Source

Merge remote-tracking branch 'remotes/origin/dev_heart' into dev

dev_shibei_match
jianjun 5 years ago
parent
commit
138d6f74b7
  1. 45
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/InitPointRuleResultDTO.java
  2. 11
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointRuleFormDTO.java
  3. 6
      epmet-module/epmet-point/epmet-point-server/pom.xml
  4. 25
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/BackDoorController.java
  5. 4
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRuleDao.java
  6. 33
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRuleDefaultDao.java
  7. 97
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRuleDefaultEntity.java
  8. 4
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRuleEntity.java
  9. 3
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointRuleService.java
  10. 38
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java
  11. 4
      epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/epmet_point.sql
  12. 3
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRuleDao.xml
  13. 27
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRuleDefaultDao.xml
  14. 9
      epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java
  15. 5
      epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java
  16. 9
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java
  17. 7
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java
  18. 5
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java
  19. 6
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java
  20. 8
      epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml

45
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

11
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;
//=======系统添加时的属性======
/**

6
epmet-module/epmet-point/epmet-point-server/pom.xml

@ -81,6 +81,12 @@
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>oper-crm-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

25
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<Boolean> add(@RequestBody PointRuleFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, AddGroup.class);
public Result<Boolean> add(@RequestBody List<PointRuleFormDTO> list) {
for (PointRuleFormDTO formDTO:list){
ValidatorUtils.validateEntity(list, AddGroup.class);
pointRuleService.add(null, formDTO);
}
return new Result<Boolean>().ok(true);
}
/**
* desc:批量添加规则
*
* @param list
* @return
*/
@PostMapping(value = "initpointrule")
public Result<InitPointRuleResultDTO> initPointRule() {
InitPointRuleResultDTO resultDTO = pointRuleService.initPointRule();
return new Result<InitPointRuleResultDTO>().ok(resultDTO);
}
public static void main(String[] args) {
PointRuleFormDTO formDTO = new PointRuleFormDTO();
formDTO.setPoint(0);

4
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<PointRuleEntity> {
int updateByCustomerId(PointRuleEntity entity);
PointRuleEntity selectByEventCodeAndCustomerId(@Param("customerId") String customerId, @Param("eventCode") String eventCode);
List<String> selectCustomerIds();
}

33
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<PointRuleDefaultEntity> {
}

97
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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首次firstdayweekmonthyear
*/
private String rulePeriod;
/**
* 获得积分值
*/
private Integer point;
/**
* 获得积分单位 time分钟minute小时hour
*/
private String pointUnit;
/**
* 是否启用 0-1-
*/
private String enabledFlag;
}

4
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);
}
}

3
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<PointRuleEntity> {
* @date 2020.07.31 14:54
**/
PointRuleEntity getByEventCodeAndCustomerId(String customerId,String eventCode);
InitPointRuleResultDTO initPointRule();
}

38
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<PointRuleDao, PointRul
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private RuleOperateLogDao ruleOperateLogDao;
@Autowired
private OperCrmOpenFeignClient operCrmOpenFeignClient;
@Autowired
private PointRuleDefaultDao pointRuleDefaultDao;
@Override
public List<CustomerFunctionResultDTO> getFunctionList(String customerId) {
@ -171,10 +180,10 @@ public class PointRuleServiceImpl extends BaseServiceImpl<PointRuleDao, PointRul
}
/**
* @Description 根据evetCode和客户Id查找积分规则详情
* @param customerId
* @param eventCode
* @return
* @Description 根据evetCode和客户Id查找积分规则详情
* @author wangc
* @date 2020.07.31 14:54
**/
@ -183,6 +192,33 @@ public class PointRuleServiceImpl extends BaseServiceImpl<PointRuleDao, PointRul
return baseDao.selectByEventCodeAndCustomerId(customerId, eventCode);
}
@Override
public InitPointRuleResultDTO initPointRule() {
Result<List<CustomerDTO>> customerListResult = operCrmOpenFeignClient.getAllCustomerList();
if (!customerListResult.success() || CollectionUtils.isEmpty(customerListResult.getData())) {
log.error("获取所有客户列表失败");
}
List<CustomerDTO> customerDTOList = customerListResult.getData();
List<PointRuleDefaultEntity> ruleDefaultEntities = pointRuleDefaultDao.selectList(null);
List<String> haveInitCustomerIds = baseDao.selectCustomerIds();
List<PointRuleEntity> 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) {
RuleOperateLogEntity record = new RuleOperateLogEntity();
if (tokenDTO != null) {

4
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');

3
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}
</select>
<select id="selectCustomerIds" resultType="java.lang.String">
SELECT DISTINCT CUSTOMER_ID FROM point_rule WHERE DEL_FLAG = '0'
</select>
</mapper>

27
epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRuleDefaultDao.xml

@ -0,0 +1,27 @@
<?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="com.epmet.dao.PointRuleDefaultDao">
<resultMap type="com.epmet.entity.PointRuleDefaultEntity" id="pointRuleMap">
<result property="id" column="ID"/>
<result property="ruleName" column="RULE_NAME"/>
<result property="ruleDesc" column="RULE_DESC"/>
<result property="eventCode" column="EVENT_CODE"/>
<result property="operateType" column="OPERATE_TYPE"/>
<result property="upLimit" column="UP_LIMIT"/>
<result property="upLimitDesc" column="UP_LIMIT_DESC"/>
<result property="upLimitPrefix" column="UP_LIMIT_PREFIX"/>
<result property="rulePeriod" column="RULE_PERIOD"/>
<result property="point" column="POINT"/>
<result property="pointUnit" column="POINT_UNIT"/>
<result property="enabledFlag" column="ENABLED_FLAG"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

9
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<List<CustomerDTO>> getAllCustomerList();
}

5
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<List<CustomerDTO>> getAllCustomerList() {
return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getAllCustomerList", null);
}
}

9
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<List<CustomerDTO>> getAllList() {
return new Result<List<CustomerDTO>>().ok(customerService.getAllList());
}
}

7
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java

@ -67,4 +67,11 @@ public interface CustomerDao extends BaseDao<CustomerEntity> {
* @Description 查询有效客户数据(不区分是否在有效期内)按名称模糊查询
**/
List<CustomerResultDTO> selectCustomerList(@Param("customerName") String customerName);
/**
* desc获取未删除的所有用户
* @return
*/
List<CustomerEntity> getAllList();
}

5
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java

@ -169,4 +169,9 @@ public interface CustomerService extends BaseService<CustomerEntity> {
**/
void init(CustomerInitFormDTO formDTO);
/**
* desc获取所有客户列表
* @return
*/
List<CustomerDTO> getAllList();
}

6
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<CustomerDao, CustomerEn
}
@Override
public List<CustomerDTO> getAllList() {
List<CustomerEntity> list = baseDao.getAllList();
return ConvertUtils.sourceToTarget(list,CustomerDTO.class);
}
}

8
epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml

@ -70,4 +70,12 @@
AND customer_name LIKE concat('%', trim(#{customerName}), '%')
</if>
</select>
<select id="getAllList" resultMap="customerMap">
SELECT
id,customer_name,title,organizationNumber,organizationImg,validityTime,customerAdmin,
organizationLevel,logo
FROM customer
WHERE
del_flag = '0'
</select>
</mapper>

Loading…
Cancel
Save