Browse Source

Merge branch 'dev'

master
sunyuchao 5 years ago
parent
commit
f37e5d8ff2
  1. 4
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CustomerTemplateListFormDTO.java
  2. 4
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/GetTemplateListFormDTO.java
  3. 11
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PersonalTemplateDao.java
  4. 11
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PersonalTemplateService.java
  5. 17
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PersonalTemplateServiceImpl.java
  6. 5
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/SubscribeServiceImpl.java
  7. 13
      epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PersonalTemplateDao.xml

4
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CustomerTemplateListFormDTO.java

@ -22,6 +22,10 @@ public class CustomerTemplateListFormDTO implements Serializable {
*/
@NotBlank(message="公共模板Id不能为空", groups = {AddUserInternalGroup.class})
private String publicId;
/**
* 模板关键词Id
*/
private String keyIds;
public interface AddUserInternalGroup {}
}

4
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/GetTemplateListFormDTO.java

@ -26,6 +26,10 @@ public class GetTemplateListFormDTO implements Serializable {
* 模板类型(站内信提醒)
*/
private String templateType;
/**
* 模板关键词Id
*/
private String keyIds;
public interface AddUserInternalGroup {}
}

11
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PersonalTemplateDao.java

@ -94,4 +94,15 @@ public interface PersonalTemplateDao extends BaseDao<PersonalTemplateEntity> {
* @author sun
*/
List<CustomerTemplateListResultDTO> selectCustomerTemplateList(CustomerTemplateListFormDTO formDTO);
/**
* 根据tid和keyIds查询是否已存在该模板类型数据
* @author zhaoqifeng
* @date 2020/11/2 10:31
* @param appId
* @param tid
* @param keyIds
* @return java.util.List<com.epmet.dto.PersonalTemplateDTO>
*/
List<PersonalTemplateDTO> selectListByKey(@Param("appId") String appId, @Param("tid") String tid, @Param("keyIds") String keyIds);
}

11
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PersonalTemplateService.java

@ -141,4 +141,15 @@ public interface PersonalTemplateService extends BaseService<PersonalTemplateEnt
* @author sun
*/
List<CustomerTemplateListResultDTO> customerTemplateList(CustomerTemplateListFormDTO formDTO);
/**
* 根据tid和keyIds查询是否已存在该模板类型数据
* @author zhaoqifeng
* @date 2020/11/2 10:29
* @param appId
* @param tid
* @param keyIds
* @return java.util.List<com.epmet.dto.PersonalTemplateDTO>
*/
List<PersonalTemplateDTO> getListByKey(String appId, String tid, String keyIds);
}

17
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PersonalTemplateServiceImpl.java

@ -127,6 +127,7 @@ public class PersonalTemplateServiceImpl extends BaseServiceImpl<PersonalTemplat
*/
@Override
public List<GetTemplateListResultDTO> templateList(GetTemplateListFormDTO formDTO) {
formDTO.setKeyIds("5,4,2");
//根据客户Id、appId、模板类型查询小程序订阅消息模板列表
return baseDao.selectTemplateList(formDTO);
}
@ -138,7 +139,23 @@ public class PersonalTemplateServiceImpl extends BaseServiceImpl<PersonalTemplat
*/
@Override
public List<CustomerTemplateListResultDTO> customerTemplateList(CustomerTemplateListFormDTO formDTO) {
formDTO.setKeyIds("5,4,2");
return baseDao.selectCustomerTemplateList(formDTO);
}
/**
* 根据tid和keyIds查询是否已存在该模板类型数据
*
* @param appId
* @param tid
* @param keyIds
* @return java.util.List<com.epmet.dto.PersonalTemplateDTO>
* @author zhaoqifeng
* @date 2020/11/2 10:29
*/
@Override
public List<PersonalTemplateDTO> getListByKey(String appId, String tid, String keyIds) {
return baseDao.selectListByKey(appId, tid, keyIds);
}
}

5
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/SubscribeServiceImpl.java

@ -180,6 +180,11 @@ public class SubscribeServiceImpl implements SubscribeService {
String keywords = String.join(",", formDTO.getNameList());
List<String> keyIdList = formDTO.getKidList().stream().map(Object::toString).collect(Collectors.toList());
String keyIds = String.join(",", keyIdList);
//根据tid和keyIds查询是否已存在该模板类型数据
List<PersonalTemplateDTO> list = personalTemplateService.getListByKey(formDTO.getAppId(), formDTO.getTid(), keyIds);
if (null != list && list.size() > NumConstant.ZERO) {
throw new RenException(formDTO.getTitle() + "已存在所选关键词[" + keywords + "]的模板");
}
//将公共模板存入数据库
PersonalTemplateDTO personalTemplateDTO = new PersonalTemplateDTO();
personalTemplateDTO.setCustomerId(authInfo.getCustomerId());

13
epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PersonalTemplateDao.xml

@ -86,7 +86,8 @@
AND customer_id = #{customerId}
AND app_id = #{appId}
AND title = #{templateType}
ORDER BY CREATED_TIME DESC
AND key_ids = '5,4,2'<!-- 消息更新,详情内容,时间 -->
ORDER BY created_time ASC
</select>
<select id="selectCustomerTemplateList" resultType="com.epmet.dto.result.CustomerTemplateListResultDTO">
@ -102,6 +103,16 @@
AND cm.del_flag = '0'
AND pt.customer_id = #{customerId}
AND pt.tid = #{publicId}
AND key_ids = #{keyIds}<!-- 消息更新,详情内容,时间 -->
ORDER BY created_time ASC
</select>
<select id="selectListByKey" resultType="com.epmet.dto.PersonalTemplateDTO">
SELECT ID
FROM personal_template
WHERE DEL_FLAG = '0'
AND APP_ID=#{appId}
AND TID = #{tid}
AND KEY_IDS = #{keyIds}
</select>
</mapper>
Loading…
Cancel
Save