Commit 0302d0f6 by 墨竹

Merge remote-tracking branch 'origin/developer' into developer

parents 32dc51fe 791850f4
package com.gic.haoban.manage.api.dto.welcome.qdto;
import com.gic.haoban.base.api.common.BasePageInfo;
/**
* @Author MUSI
* @Date 2022/7/4 9:19 AM
* @Description
* @Version
**/
public class QueryWelcomeQDTO extends BasePageInfo {
private String wxEnterpriseId;
/**
* 标题
*/
private String title;
/**
* 欢迎语类型
* @see com.gic.haoban.manage.api.enums.hm.HmWelcomeType
*/
private Integer type;
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
}
......@@ -67,6 +67,12 @@ public class SaveWelcomeQDTO implements Serializable {
*/
private List<WelcomeSuitStaffDTO> suitStaffDeleteList;
/**
* 欢迎语类型
* @see com.gic.haoban.manage.api.enums.hm.HmWelcomeType
*/
private Integer type;
public String getModifierId() {
return modifierId;
}
......@@ -195,6 +201,14 @@ public class SaveWelcomeQDTO implements Serializable {
this.suitStaffDeleteList = suitStaffDeleteList;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
@Override
public String toString() {
return "SaveWelcomeQDTO{" +
......
package com.gic.haoban.manage.api.enums.hm;
/**
* @Author MUSI
* @Date 2022/7/4 8:58 AM
* @Description
* @Version
**/
public enum HmWelcomeReferType {
LINK(1, "引流链接"),
HM(2, "活码");
HmWelcomeReferType(Integer code, String desc){
this.code = code;
this.desc = desc;
}
private Integer code;
/**
* 引用方
*/
private String desc;
public Integer getCode() {
return code;
}
public String getDesc() {
return desc;
}
}
......@@ -7,8 +7,8 @@ package com.gic.haoban.manage.api.enums.hm;
* @Version
**/
public enum HmWelcomeType {
LINK(1, "引流链接"),
HM(2, "活码");
NORMAL(1, "普通欢迎语"),
SPECIAL(2, "特殊欢迎语");
HmWelcomeType(Integer code, String desc){
this.code = code;
this.desc = desc;
......
package com.gic.haoban.manage.api.service.out;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.manage.api.dto.welcome.dto.FriendSettingDetailDTO;
import com.gic.haoban.manage.api.dto.welcome.dto.WelcomeDetailDTO;
import com.gic.haoban.manage.api.dto.welcome.dto.WelcomeListDTO;
import com.gic.haoban.manage.api.dto.welcome.qdto.QueryWelcomeQDTO;
import com.gic.haoban.manage.api.dto.welcome.qdto.SaveFriendSettingQDTO;
import com.gic.haoban.manage.api.dto.welcome.qdto.SaveWelcomeQDTO;
......@@ -108,4 +110,11 @@ public interface WelcomeApiService {
*/
ServiceResponse<Boolean> flushWelcomeMedia();
/**
* 条件查询欢迎语列表
* @param queryWelcomeQDTO
* @return
*/
ServiceResponse<Page<List<WelcomeListDTO>>> listWelcomeWithCondition(QueryWelcomeQDTO queryWelcomeQDTO);
}
......@@ -53,4 +53,14 @@ public interface TabHaobanWelcomeMapper {
* @date : 2022/2/10
*/
long countByWxEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId);
/**
* 查询欢迎语配置
* @param wxEnterpriseId
* @param title
* @param defaultWelcomeFlag
* @param type
* @return
*/
List<TabWelcome> queryWelcome(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("title") String title, @Param("defaultWelcomeFlag") Integer defaultWelcomeFlag, @Param("type") Integer type);
}
\ No newline at end of file
package com.gic.haoban.manage.service.pojo.bo.hm;
import com.gic.haoban.manage.api.enums.hm.HmWelcomeReferType;
import java.io.Serializable;
/**
......@@ -34,7 +36,7 @@ public class HmWelcomeRelationBO implements Serializable {
/**
* 引用方类型
* @see com.gic.haoban.manage.api.enums.hm.HmWelcomeType
* @see HmWelcomeReferType
*/
private Integer type;
}
package com.gic.haoban.manage.service.service;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.manage.api.dto.welcome.qdto.QueryWelcomeQDTO;
import com.gic.haoban.manage.service.pojo.bo.welcome.*;
import java.util.List;
......@@ -115,4 +117,27 @@ public interface WelcomeService {
*/
Boolean flushWelcomeMedia();
/**
* 条件查询
* @param queryWelcomeQDTO
* @return
*/
Page<List<WelcomeListBO>> queryWelcomeList(QueryWelcomeQDTO queryWelcomeQDTO);
/**
* desc: 根据员工所在部门匹配欢迎语
*
* @param staffId 员工id
* @param wxEnterpriseId 微信企业id
*
* @see com.gic.haoban.manage.api.enums.hm.HmWelcomeType
* @param type
* @return : {@link WelcomeDetailBO}
* @author : YongEn
* @date : 2022/2/9
*/
WelcomeDetailBO getMatchWelcomeWithType(String staffId, String wxEnterpriseId, Integer type);
}
package com.gic.haoban.manage.service.service.impl;
import com.gic.api.base.commons.Page;
import com.gic.commons.util.UniqueIdUtils;
import com.gic.haoban.common.utils.StringUtil;
import com.gic.haoban.manage.api.dto.welcome.qdto.QueryWelcomeQDTO;
import com.gic.haoban.manage.api.enums.FriendSettingTypeEnum;
import com.gic.haoban.manage.api.enums.WelcomeMediaTypeEnum;
import com.gic.haoban.manage.api.enums.WelcomeSuitTypeEnum;
import com.gic.haoban.manage.api.enums.hm.HmWelcomeType;
import com.gic.haoban.manage.service.dao.mapper.*;
import com.gic.haoban.manage.service.entity.*;
import com.gic.haoban.manage.service.pojo.bo.welcome.*;
......@@ -380,10 +383,14 @@ public class WelcomeServiceImpl implements WelcomeService {
if (StringUtils.isEmpty(staffId) || StringUtils.isEmpty(wxEnterpriseId)) {
return null;
}
return queryMatchWelcome(staffId, wxEnterpriseId, HmWelcomeType.NORMAL.getCode());
}
private WelcomeDetailBO queryMatchWelcome(String staffId, String wxEnterpriseId, Integer type) {
// 查询非默认欢迎语
List<TabWelcome> nonDefaultWelcomList = welcomeMapper.listByWxEnterpriseId(wxEnterpriseId, null, 0);
List<TabWelcome> nonDefaultWelcomList = welcomeMapper.queryWelcome(wxEnterpriseId, null, 0, type);
// 查询默认欢迎语
List<TabWelcome> defaultWelcomeList = welcomeMapper.listByWxEnterpriseId(wxEnterpriseId, null, 1);
List<TabWelcome> defaultWelcomeList = welcomeMapper.queryWelcome(wxEnterpriseId, null, 1, type);
if (CollectionUtils.isEmpty(nonDefaultWelcomList)) {
return checkAndGetDefaultWelcome(defaultWelcomeList);
}
......@@ -578,4 +585,29 @@ public class WelcomeServiceImpl implements WelcomeService {
return bo;
}).collect(Collectors.toList());
}
/**
* 条件查询
*
* @param queryWelcomeQDTO
* @return
*/
@Override
public Page<List<WelcomeListBO>> queryWelcomeList(QueryWelcomeQDTO queryWelcomeQDTO) {
return null;
}
/**
* desc: 根据员工所在部门匹配欢迎语
*
* @param staffId 员工id
* @param wxEnterpriseId 微信企业id
* @return : {@link WelcomeDetailBO}
* @author : YongEn
* @date : 2022/2/9
*/
@Override
public WelcomeDetailBO getMatchWelcomeWithType(String staffId, String wxEnterpriseId, Integer type) {
return queryMatchWelcome(staffId, wxEnterpriseId, type);
}
}
package com.gic.haoban.manage.service.service.out.impl;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil;
import com.gic.haoban.manage.api.dto.welcome.dto.*;
import com.gic.commons.util.PageHelperUtils;
import com.gic.haoban.manage.api.dto.welcome.dto.FriendSettingDetailDTO;
import com.gic.haoban.manage.api.dto.welcome.dto.WelcomeDetailDTO;
import com.gic.haoban.manage.api.dto.welcome.dto.WelcomeListDTO;
import com.gic.haoban.manage.api.dto.welcome.dto.WelcomeMediaDTO;
import com.gic.haoban.manage.api.dto.welcome.dto.WelcomeSuitDepartmentDTO;
import com.gic.haoban.manage.api.dto.welcome.qdto.QueryWelcomeQDTO;
import com.gic.haoban.manage.api.dto.welcome.qdto.SaveFriendSettingQDTO;
import com.gic.haoban.manage.api.dto.welcome.qdto.SaveWelcomeQDTO;
import com.gic.haoban.manage.api.enums.hm.HmWelcomeType;
import com.gic.haoban.manage.api.service.out.WelcomeApiService;
import com.gic.haoban.manage.service.pojo.bo.welcome.*;
import com.gic.haoban.manage.service.pojo.bo.welcome.FriendSettingDetailBO;
import com.gic.haoban.manage.service.pojo.bo.welcome.SaveFriendSettingBO;
import com.gic.haoban.manage.service.pojo.bo.welcome.SaveWelcomeBO;
import com.gic.haoban.manage.service.pojo.bo.welcome.SaveWelcomeMediaBO;
import com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeDetailBO;
import com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeListBO;
import com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeSuitDepartmentBO;
import com.gic.haoban.manage.service.service.WelcomeService;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -68,8 +82,13 @@ public class WelcomeApiServiceImpl implements WelcomeApiService {
public ServiceResponse<List<WelcomeListDTO>> listWelcome(String wxEnterpriseId, String title) {
List<WelcomeListBO> welcomeList = welcomeService.listWelcome(wxEnterpriseId, title);
// 数据转换
List<WelcomeListDTO> welcomeResponseList = welcomeList.stream().map(one -> {
WelcomeListDTO dto = new WelcomeListDTO() ;
List<WelcomeListDTO> welcomeResponseList = convertWelcomeList(welcomeList);
return ServiceResponse.success(welcomeResponseList);
}
private List<WelcomeListDTO> convertWelcomeList(List<WelcomeListBO> welcomeList) {
return welcomeList.stream().map(one -> {
WelcomeListDTO dto = new WelcomeListDTO();
dto.setCreatorId(one.getCreatorId());
dto.setCreatorName(one.getCreatorName());
dto.setModifierId(one.getModifierId());
......@@ -97,7 +116,6 @@ public class WelcomeApiServiceImpl implements WelcomeApiService {
// 员工暂时不做
return dto;
}).collect(Collectors.toList());
return ServiceResponse.success(welcomeResponseList);
}
@Override
......@@ -149,4 +167,9 @@ public class WelcomeApiServiceImpl implements WelcomeApiService {
public ServiceResponse<Boolean> flushWelcomeMedia() {
return ServiceResponse.success(welcomeService.flushWelcomeMedia());
}
@Override
public ServiceResponse<Page<List<WelcomeListDTO>>> listWelcomeWithCondition(QueryWelcomeQDTO queryWelcomeQDTO) {
return null;
}
}
......@@ -137,4 +137,23 @@
from tab_haoban_welcome where status_flag = 1
</select>
<select id="queryWelcome" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/>
from tab_haoban_welcome
<where>
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and status_flag = 1
<if test="title != null and title != ''">
and title = #{title,jdbcType=VARCHAR}
</if>
<if test="defaultWelcomeFlag != null and defaultWelcomeFlag != ''">
and default_welcome_flag = #{defaultWelcomeFlag,jdbcType=INTEGER}
</if>
<if test="type != null">
type = #{type}
</if>
</where>
order by update_time desc
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment