Browse Source

Merge branch 'dev_wx_msg' into dev_temp

dev_shibei_match
wxz 5 years ago
parent
commit
97d4e313ef
  1. 5
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/WxMsgAuthInfoResultDTO.java
  2. 13
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpMessageController.java
  3. 9
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/WxmpMessageService.java
  4. 20
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java
  5. 1
      epmet-module/epmet-message/epmet-message-server/src/main/resources/db/migration/V0.3.12.3__sub_status_add_column.sql
  6. 32
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/WxmpTemplateListFormDTO.java
  7. 30
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/WxmpTemplateListResultDTO.java

5
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/WxMsgAuthInfoResultDTO.java

@ -38,4 +38,9 @@ public class WxMsgAuthInfoResultDTO {
* wx订阅状态 订阅状态(订阅:subscribe 取消订阅:unsubscribe)
*/
private String wxSubscribeStatus;
/**
* 微信openId
*/
private String wxOpenId;
}

13
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpMessageController.java

@ -24,8 +24,10 @@ import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.GetTemplateListFormDTO;
import com.epmet.dto.form.WxMsgAuthInfoFormDTO;
import com.epmet.dto.form.WxSubscribeMessageFormDTO;
import com.epmet.dto.form.WxmpTemplateListFormDTO;
import com.epmet.dto.result.GetTemplateListResultDTO;
import com.epmet.dto.result.WxMsgAuthInfoResultDTO;
import com.epmet.dto.result.WxmpTemplateListResultDTO;
import com.epmet.service.WxmpMessageService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -142,4 +144,15 @@ public class WxmpMessageController {
return new Result();
}
/**
* @return
* @Description (外挂)消息-获取订阅消息模板列表
* @author sun
*/
@PostMapping("wxmptemplatelist")
public Result<List<WxmpTemplateListResultDTO>> wxmpTemplateList(@RequestBody WxmpTemplateListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, WxmpTemplateListFormDTO.AddUserInternalGroup.class);
return new Result<List<WxmpTemplateListResultDTO>>().ok(wxmpMessageService.wxmpTemplateList(formDTO));
}
}

9
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/WxmpMessageService.java

@ -19,8 +19,10 @@ package com.epmet.service;
import com.epmet.dto.form.GetTemplateListFormDTO;
import com.epmet.dto.form.WxSubscribeMessageFormDTO;
import com.epmet.dto.form.WxmpTemplateListFormDTO;
import com.epmet.dto.result.GetTemplateListResultDTO;
import com.epmet.dto.result.WxMsgAuthInfoResultDTO;
import com.epmet.dto.result.WxmpTemplateListResultDTO;
import java.util.List;
@ -54,4 +56,11 @@ public interface WxmpMessageService {
* @author sun
*/
List<GetTemplateListResultDTO> templateList(GetTemplateListFormDTO formDTO);
/**
* @return
* @Description 消息-获取订阅消息模板列表
* @author sun
*/
List<WxmpTemplateListResultDTO> wxmpTemplateList(WxmpTemplateListFormDTO formDTO);
}

20
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java

@ -617,4 +617,24 @@ public class WxmpMessageServiceImpl implements WxmpMessageService {
}
return staffBasicInfo.getOpenId();
}
/**
* @return
* @Description 消息-获取订阅消息模板列表
* @author sun
*/
@Override
public List<WxmpTemplateListResultDTO> wxmpTemplateList(WxmpTemplateListFormDTO formDTO) {
List<WxmpTemplateListResultDTO> resultList = new ArrayList<>();
CustomerTemplateListFormDTO dto = ConvertUtils.sourceToTarget(formDTO, CustomerTemplateListFormDTO.class);
List<CustomerTemplateListResultDTO> list = customerTemplateList(dto);
list.forEach(l->{
if(formDTO.getClientType().equals(l.getClientType())){
WxmpTemplateListResultDTO result = ConvertUtils.sourceToTarget(l, WxmpTemplateListResultDTO.class);
resultList.add(result);
}
});
return resultList;
}
}

1
epmet-module/epmet-message/epmet-message-server/src/main/resources/db/migration/V0.3.12.3__sub_status_add_column.sql

@ -0,0 +1 @@
alter table wxmp_template_msg_subscribe_status add column WX_OPEN_ID varchar(64) not null ;

32
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/WxmpTemplateListFormDTO.java

@ -0,0 +1,32 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 消息-获取订阅消息模板列表-接口入参
* @Author sun
*/
@Data
public class WxmpTemplateListFormDTO implements Serializable {
/**
* 客户Id
*/
@NotBlank(message="客户Id不能为空", groups = {AddUserInternalGroup.class})
private String customerId;
/**
* 微信公共模板库模板Id
*/
@NotBlank(message="公共模板Id不能为空", groups = {AddUserInternalGroup.class})
private String publicId;
/**
* 所属端(居民端:resi 工作端:work)
*/
@NotBlank(message="所属端不能为空", groups = {AddUserInternalGroup.class})
private String clientType;
public interface AddUserInternalGroup {}
}

30
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/WxmpTemplateListResultDTO.java

@ -0,0 +1,30 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 消息-获取订阅消息模板列表-接口返参
* @Author sun
*/
@Data
public class WxmpTemplateListResultDTO implements Serializable {
private static final long serialVersionUID = 6856602932571839314L;
/**
* 模板Id
*/
private String templateId;
/**
* 模板类型站内信提醒
*/
private String templateType;
/**
* 所属端居民端resi 工作端work
*/
private String clientType;
}
Loading…
Cancel
Save