Browse Source

添加客户配置开关

dev_shibei_match
zxc 5 years ago
parent
commit
db9439ab98
  1. 2
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SysSmsConstant.java
  2. 22
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SysSmsServiceImpl.java
  3. 5
      epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerParameterDTO.java
  4. 5
      epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CrmParameterResultDTO.java
  5. 7
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerParameterEntity.java
  6. 3
      epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerParameterDao.xml

2
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SysSmsConstant.java

@ -14,4 +14,6 @@ public interface SysSmsConstant {
String NOT_ENOUGH_BALANCE = "客户:%s ,当前余额为:%s"; String NOT_ENOUGH_BALANCE = "客户:%s ,当前余额为:%s";
String NOT_ON_SWITCH = "客户:%s ,【%s】开关未开启";
} }

22
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SysSmsServiceImpl.java

@ -228,16 +228,20 @@ public class SysSmsServiceImpl extends BaseServiceImpl<SysSmsDao, SysSmsEntity>
groupByCustomer.forEach((customerId,v) -> { groupByCustomer.forEach((customerId,v) -> {
parameterResult.forEach(p -> { parameterResult.forEach(p -> {
if (customerId.equals(p.getCustomerId())){ if (customerId.equals(p.getCustomerId())){
if (p.getBalanceStatus() == false){ if (p.getSwitchStatus() == false){
logger.error(String.format(SysSmsConstant.NOT_ENOUGH_BALANCE,customerId,p.getParameterValue())); logger.error(String.format(SysSmsConstant.NOT_ON_SWITCH,customerId,p.getParameterKey()));
}else { }else {
v.forEach(dto->{ if (p.getBalanceStatus() == false){
SysSmsDTO sysSmsDTO = new SysSmsDTO(); logger.error(String.format(SysSmsConstant.NOT_ENOUGH_BALANCE,customerId,p.getParameterValue()));
sysSmsDTO.setMobile(dto.getMobile()); }else {
sysSmsDTO.setAliyunTemplateCode(dto.getAliyunTemplateCode()); v.forEach(dto->{
//推送短信 SysSmsDTO sysSmsDTO = new SysSmsDTO();
this.sendMsg(sysSmsDTO); sysSmsDTO.setMobile(dto.getMobile());
}); sysSmsDTO.setAliyunTemplateCode(dto.getAliyunTemplateCode());
//推送短信
this.sendMsg(sysSmsDTO);
});
}
} }
} }
}); });

5
epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerParameterDTO.java

@ -39,6 +39,11 @@ public class CustomerParameterDTO implements Serializable {
*/ */
private String parameterValue; private String parameterValue;
/**
* 参数开关开启on关闭off
*/
private String parameterSwitch;
/** /**
* 说明 * 说明
*/ */

5
epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CrmParameterResultDTO.java

@ -41,4 +41,9 @@ public class CrmParameterResultDTO implements Serializable {
* 新的参数VALUE值 * 新的参数VALUE值
*/ */
private String subtractParameterValue; private String subtractParameterValue;
/**
* 参数开关状态 true开启false关闭
*/
private Boolean switchStatus;
} }

7
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerParameterEntity.java

@ -11,7 +11,7 @@ import lombok.EqualsAndHashCode;
*/ */
@Data @Data
@EqualsAndHashCode(callSuper=false) @EqualsAndHashCode(callSuper=false)
@TableName("customer_project_parameter") @TableName("customer_parameter")
public class CustomerParameterEntity extends BaseEpmetEntity { public class CustomerParameterEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -36,6 +36,11 @@ public class CustomerParameterEntity extends BaseEpmetEntity {
*/ */
private String parameterValue; private String parameterValue;
/**
* 参数开关开启on关闭off
*/
private String parameterSwitch;
/** /**
* 说明 * 说明
*/ */

3
epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerParameterDao.xml

@ -20,7 +20,8 @@
SELECT SELECT
CUSTOMER_ID, CUSTOMER_ID,
PARAMETER_KEY, PARAMETER_KEY,
PARAMETER_VALUE PARAMETER_VALUE,
(CASE WHEN PARAMETER_SWITCH = 'on' THEN TRUE ELSE FALSE END) AS switchStatus
FROM customer_parameter FROM customer_parameter
WHERE DEL_FLAG = 0 WHERE DEL_FLAG = 0
AND AND

Loading…
Cancel
Save