Commit 0560ebc2 by xugaojun

包路径优化、提供api接口、代码优化、提供批量操作接口

parent e6706209
package com.gic.haoban.manage.api.dto.welcome;
package com.gic.haoban.manage.api.dto.welcome.dto;
import java.io.Serializable;
......@@ -8,7 +8,7 @@ import java.io.Serializable;
* @author: YongEn
* @date: 2022/2/9
**/
public class FriendSettingDTO implements Serializable {
public class FriendSettingDetailDTO implements Serializable {
private static final long serialVersionUID = -8947246337650792859L;
/**
* 加好友配置id
......
package com.gic.haoban.manage.api.dto.welcome;
package com.gic.haoban.manage.api.dto.welcome.dto;
import java.io.Serializable;
import java.util.List;
......@@ -32,21 +32,13 @@ public class WelcomeDetailDTO implements Serializable {
*/
private Integer openFlag;
/**
* 适用部门, 以逗号分割
* 适用部门列表
*/
private String suitDepartment;
private List<WelcomeSuitDepartmentDTO> suitDepartmentList;
/**
* 适用部门名称, 以逗号分割
* 适用员工列表
*/
private String suitDepartmentName;
/**
* 适用员工, 以逗号分割
*/
private String suitStaff;
/**
* 适用员工名称, 以逗号分割
*/
private String suitStaffName;
private List<WelcomeSuitStaffDTO> suitStaffList;
/**
* 欢迎语媒体列表
*/
......@@ -92,44 +84,28 @@ public class WelcomeDetailDTO implements Serializable {
this.openFlag = openFlag;
}
public String getSuitDepartment() {
return suitDepartment;
}
public void setSuitDepartment(String suitDepartment) {
this.suitDepartment = suitDepartment;
}
public List<WelcomeMediaDTO> getWelcomeMediaList() {
return welcomeMediaList;
}
public void setWelcomeMediaList(List<WelcomeMediaDTO> welcomeMediaList) {
this.welcomeMediaList = welcomeMediaList;
}
public String getSuitDepartmentName() {
return suitDepartmentName;
public List<WelcomeSuitDepartmentDTO> getSuitDepartmentList() {
return suitDepartmentList;
}
public void setSuitDepartmentName(String suitDepartmentName) {
this.suitDepartmentName = suitDepartmentName;
public void setSuitDepartmentList(List<WelcomeSuitDepartmentDTO> suitDepartmentList) {
this.suitDepartmentList = suitDepartmentList;
}
public String getSuitStaff() {
return suitStaff;
public List<WelcomeSuitStaffDTO> getSuitStaffList() {
return suitStaffList;
}
public void setSuitStaff(String suitStaff) {
this.suitStaff = suitStaff;
public void setSuitStaffList(List<WelcomeSuitStaffDTO> suitStaffList) {
this.suitStaffList = suitStaffList;
}
public String getSuitStaffName() {
return suitStaffName;
public List<WelcomeMediaDTO> getWelcomeMediaList() {
return welcomeMediaList;
}
public void setSuitStaffName(String suitStaffName) {
this.suitStaffName = suitStaffName;
public void setWelcomeMediaList(List<WelcomeMediaDTO> welcomeMediaList) {
this.welcomeMediaList = welcomeMediaList;
}
@Override
......@@ -140,7 +116,6 @@ public class WelcomeDetailDTO implements Serializable {
", title='" + title + '\'' +
", welcomeContent='" + welcomeContent + '\'' +
", openFlag=" + openFlag +
", suitDepartment='" + suitDepartment + '\'' +
", welcomeMediaList=" + welcomeMediaList +
'}';
}
......
package com.gic.haoban.manage.api.dto.welcome;
package com.gic.haoban.manage.api.dto.welcome.dto;
import java.io.Serializable;
import java.util.Date;
......@@ -37,14 +37,6 @@ public class WelcomeListDTO implements Serializable {
*/
private Date updateTime;
/**
* 适用部门id, 以逗号分割
*/
private String suitDepartment;
/**
* 适用部门名称, 以逗号分割
*/
private String suitDepartmentName;
/**
* 操作人id
*/
private String operatorId;
......@@ -53,6 +45,14 @@ public class WelcomeListDTO implements Serializable {
*/
private String operatorName;
/**
* 适用部门列表
*/
private List<WelcomeSuitDepartmentDTO> suitDepartmentList;
/**
* 适用员工列表
*/
private List<WelcomeSuitStaffDTO> suitStaffList;
/**
* 欢迎语媒体列表
*/
private List<WelcomeMediaDTO> welcomeMediaList;
......@@ -97,30 +97,6 @@ public class WelcomeListDTO implements Serializable {
this.openFlag = openFlag;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getSuitDepartment() {
return suitDepartment;
}
public void setSuitDepartment(String suitDepartment) {
this.suitDepartment = suitDepartment;
}
public String getSuitDepartmentName() {
return suitDepartmentName;
}
public void setSuitDepartmentName(String suitDepartmentName) {
this.suitDepartmentName = suitDepartmentName;
}
public String getOperatorId() {
return operatorId;
}
......@@ -145,6 +121,30 @@ public class WelcomeListDTO implements Serializable {
this.welcomeMediaList = welcomeMediaList;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public List<WelcomeSuitDepartmentDTO> getSuitDepartmentList() {
return suitDepartmentList;
}
public void setSuitDepartmentList(List<WelcomeSuitDepartmentDTO> suitDepartmentList) {
this.suitDepartmentList = suitDepartmentList;
}
public List<WelcomeSuitStaffDTO> getSuitStaffList() {
return suitStaffList;
}
public void setSuitStaffList(List<WelcomeSuitStaffDTO> suitStaffList) {
this.suitStaffList = suitStaffList;
}
@Override
public String toString() {
return "WelcomeListDTO{" +
......@@ -154,7 +154,6 @@ public class WelcomeListDTO implements Serializable {
", welcomeContent='" + welcomeContent + '\'' +
", openFlag=" + openFlag +
", updateTime=" + updateTime +
", suitDepartment='" + suitDepartment + '\'' +
", operatorId='" + operatorId + '\'' +
", operatorName='" + operatorName + '\'' +
", welcomeMediaList=" + welcomeMediaList +
......
package com.gic.haoban.manage.api.dto.welcome.dto;
import java.io.Serializable;
/**
* desc:欢迎语适用部门dto
*
* @author: YongEn
* @date: 2022/2/11
**/
public class WelcomeSuitDepartmentDTO implements Serializable {
private static final long serialVersionUID = 272279336557372654L;
/**
* 部门id
*/
private String departmentId;
/**
* 部门名称
*/
private String departmentName;
/**
* 选中类型(部门)1被选中 2关联选中
*/
private Integer selectType;
public String getDepartmentId() {
return departmentId;
}
public void setDepartmentId(String departmentId) {
this.departmentId = departmentId;
}
public String getDepartmentName() {
return departmentName;
}
public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;
}
public Integer getSelectType() {
return selectType;
}
public void setSelectType(Integer selectType) {
this.selectType = selectType;
}
@Override
public String toString() {
return "WelcomeSuitDepartmentDTO{" +
"departmentId='" + departmentId + '\'' +
", departmentName='" + departmentName + '\'' +
", selectType=" + selectType +
'}';
}
}
package com.gic.haoban.manage.api.dto.welcome.dto;
import java.io.Serializable;
/**
* desc:欢迎语适用员工dto
*
* @author: YongEn
* @date: 2022/2/11
**/
public class WelcomeSuitStaffDTO implements Serializable {
private static final long serialVersionUID = 2778978786281347228L;
/**
* 员工id
*/
private String staffId;
/**
* 员工名称
*/
private String staffName;
/**
* 员工所属部门id
*/
private String belongDepartmentId;
/**
* 员工所属部门名称
*/
private String belongDepartmentName;
public String getStaffId() {
return staffId;
}
public void setStaffId(String staffId) {
this.staffId = staffId;
}
public String getStaffName() {
return staffName;
}
public void setStaffName(String staffName) {
this.staffName = staffName;
}
public String getBelongDepartmentId() {
return belongDepartmentId;
}
public void setBelongDepartmentId(String belongDepartmentId) {
this.belongDepartmentId = belongDepartmentId;
}
public String getBelongDepartmentName() {
return belongDepartmentName;
}
public void setBelongDepartmentName(String belongDepartmentName) {
this.belongDepartmentName = belongDepartmentName;
}
@Override
public String toString() {
return "WelcomeSuitStaffDTO{" +
"staffId='" + staffId + '\'' +
", staffName='" + staffName + '\'' +
", belongDepartmentId='" + belongDepartmentId + '\'' +
", belongDepartmentName='" + belongDepartmentName + '\'' +
'}';
}
}
package com.gic.haoban.manage.api.dto.welcome.qdto;
import java.io.Serializable;
/**
* desc:保存加好友配置qdto
*
* @author: YongEn
* @date: 2022/2/11
**/
public class SaveFriendSettingQDTO implements Serializable {
private static final long serialVersionUID = 7952875026726340084L;
/**
* 加好友配置id
*/
private Long friendSettingId;
/**
* 微信企业id
*/
private String wxEnterpriseId;
/**
* 欢迎语配置类型 :
* 1 发送好办欢迎语文案+小程序卡片(附带导购参数)
* 2 发送好办欢迎语文案+公众号二维码(附带导购参数)
* 3 发送好办欢迎语文案
* 4 不发送好办欢迎语,用企微欢迎语
*/
private Integer friendSettingType;
/**
* 更新人id
*/
private String updateId;
/**
* 更新人名称
*/
private String updateName;
public Long getFriendSettingId() {
return friendSettingId;
}
public void setFriendSettingId(Long friendSettingId) {
this.friendSettingId = friendSettingId;
}
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
public Integer getFriendSettingType() {
return friendSettingType;
}
public void setFriendSettingType(Integer friendSettingType) {
this.friendSettingType = friendSettingType;
}
public String getUpdateId() {
return updateId;
}
public void setUpdateId(String updateId) {
this.updateId = updateId;
}
public String getUpdateName() {
return updateName;
}
public void setUpdateName(String updateName) {
this.updateName = updateName;
}
@Override
public String toString() {
return "SaveFriendSettingQDTO{" +
"friendSettingId=" + friendSettingId +
", wxEnterpriseId='" + wxEnterpriseId + '\'' +
", friendSettingType=" + friendSettingType +
", updateId='" + updateId + '\'' +
", updateName='" + updateName + '\'' +
'}';
}
}
package com.gic.haoban.manage.api.dto.welcome.qdto;
import java.io.Serializable;
/**
* desc:保存欢迎语媒体qdto
*
* @author: YongEn
* @date: 2022/2/11
**/
public class SaveWelcomeMediaQDTO implements Serializable {
private static final long serialVersionUID = 5292835528434173702L;
/**
* 媒体标题
*/
private String mediaTitle;
/**
* 媒体路径
*/
private String mediaUrl;
/**
* 媒体类型
* @see com.gic.haoban.manage.api.enums.WelcomeMediaTypeEnum
*/
private Integer mediaType;
public String getMediaTitle() {
return mediaTitle;
}
public void setMediaTitle(String mediaTitle) {
this.mediaTitle = mediaTitle;
}
public String getMediaUrl() {
return mediaUrl;
}
public void setMediaUrl(String mediaUrl) {
this.mediaUrl = mediaUrl;
}
public Integer getMediaType() {
return mediaType;
}
public void setMediaType(Integer mediaType) {
this.mediaType = mediaType;
}
@Override
public String toString() {
return "SaveWelcomeMediaQDTO{" +
"mediaTitle='" + mediaTitle + '\'' +
", mediaUrl='" + mediaUrl + '\'' +
", mediaType=" + mediaType +
'}';
}
}
package com.gic.haoban.manage.api.dto.welcome.qdto;
import com.gic.haoban.manage.api.dto.welcome.dto.WelcomeSuitDepartmentDTO;
import com.gic.haoban.manage.api.dto.welcome.dto.WelcomeSuitStaffDTO;
import java.io.Serializable;
import java.util.List;
/**
* desc:保存欢迎语qdto
*
* @author: YongEn
* @date: 2022/2/11
**/
public class SaveWelcomeQDTO implements Serializable {
private static final long serialVersionUID = 2585027808161889622L;
/**
* 欢迎语id
*/
private String welcomeId;
/**
* 微信企业id
*/
private String wxEnterpriseId;
/**
* 标题
*/
private String title;
/**
* 内容
*/
private String welcomeContent;
/**
* 操作人id
*/
private String operatorId;
/**
* 操作人名称
*/
private String operatorName;
/**
* 欢迎语媒体列表
*/
private List<SaveWelcomeMediaQDTO> mediaList;
/**
* 适用部门新增列表
*/
private List<WelcomeSuitDepartmentDTO> suitDepartmentAddList;
/**
* 适用部门删除列表
*/
private List<WelcomeSuitDepartmentDTO> suitDepartmentDeleteList;
/**
* 适用员工新增列表
*/
private List<WelcomeSuitStaffDTO> suitStaffAddList;
/**
* 适用员工删除列表
*/
private List<WelcomeSuitStaffDTO> suitStaffDeleteList;
public String getWelcomeId() {
return welcomeId;
}
public void setWelcomeId(String welcomeId) {
this.welcomeId = welcomeId;
}
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 String getWelcomeContent() {
return welcomeContent;
}
public void setWelcomeContent(String welcomeContent) {
this.welcomeContent = welcomeContent;
}
public String getOperatorId() {
return operatorId;
}
public void setOperatorId(String operatorId) {
this.operatorId = operatorId;
}
public String getOperatorName() {
return operatorName;
}
public void setOperatorName(String operatorName) {
this.operatorName = operatorName;
}
public List<SaveWelcomeMediaQDTO> getMediaList() {
return mediaList;
}
public void setMediaList(List<SaveWelcomeMediaQDTO> mediaList) {
this.mediaList = mediaList;
}
public List<WelcomeSuitDepartmentDTO> getSuitDepartmentAddList() {
return suitDepartmentAddList;
}
public void setSuitDepartmentAddList(List<WelcomeSuitDepartmentDTO> suitDepartmentAddList) {
this.suitDepartmentAddList = suitDepartmentAddList;
}
public List<WelcomeSuitDepartmentDTO> getSuitDepartmentDeleteList() {
return suitDepartmentDeleteList;
}
public void setSuitDepartmentDeleteList(List<WelcomeSuitDepartmentDTO> suitDepartmentDeleteList) {
this.suitDepartmentDeleteList = suitDepartmentDeleteList;
}
public List<WelcomeSuitStaffDTO> getSuitStaffAddList() {
return suitStaffAddList;
}
public void setSuitStaffAddList(List<WelcomeSuitStaffDTO> suitStaffAddList) {
this.suitStaffAddList = suitStaffAddList;
}
public List<WelcomeSuitStaffDTO> getSuitStaffDeleteList() {
return suitStaffDeleteList;
}
public void setSuitStaffDeleteList(List<WelcomeSuitStaffDTO> suitStaffDeleteList) {
this.suitStaffDeleteList = suitStaffDeleteList;
}
@Override
public String toString() {
return "SaveWelcomeQDTO{" +
"welcomeId='" + welcomeId + '\'' +
", wxEnterpriseId='" + wxEnterpriseId + '\'' +
", title='" + title + '\'' +
", welcomeContent='" + welcomeContent + '\'' +
", operatorId='" + operatorId + '\'' +
", operatorName='" + operatorName + '\'' +
", mediaList=" + mediaList +
", suitDepartmentAddList=" + suitDepartmentAddList +
", suitDepartmentDeleteList=" + suitDepartmentDeleteList +
", suitStaffAddList=" + suitStaffAddList +
", suitStaffDeleteList=" + suitStaffDeleteList +
'}';
}
}
package com.gic.haoban.manage.api.service.notify;
import com.gic.haoban.base.api.common.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.SaveFriendSettingQDTO;
import com.gic.haoban.manage.api.dto.welcome.qdto.SaveWelcomeQDTO;
import java.util.List;
/**
* desc:欢迎语对外服务接口
*
* @author: YongEn
* @date: 2022/2/11
**/
public interface WelcomeApiService {
/**
* desc: 保存欢迎语
*
* @param qdto qdto
* @return : {@link ServiceResponse< Boolean>}
* @author : YongEn
* @date : 2022/2/11
*/
ServiceResponse<Boolean> saveWelcome(SaveWelcomeQDTO qdto);
/**
* desc: 删除欢迎语
*
* @param welcomeId 欢迎语id
* @return : {@link ServiceResponse< Boolean>}
* @author : YongEn
* @date : 2022/2/11
*/
ServiceResponse<Boolean> removeWelcome(String welcomeId);
/**
* desc: 获取欢迎语列表
*
* @param wxEnterpriseId 微信企业id
* @param title 标题
* @return : {@link ServiceResponse< WelcomeListDTO>}
* @author : YongEn
* @date : 2022/2/11
*/
ServiceResponse<List<WelcomeListDTO>> listWelcome(String wxEnterpriseId, String title);
/**
* desc: 获取欢迎语详情
*
* @param welcomeId 欢迎语id
* @return : {@link ServiceResponse< WelcomeDetailDTO>}
* @author : YongEn
* @date : 2022/2/11
*/
ServiceResponse<WelcomeDetailDTO> getWelcome(String welcomeId);
/**
* desc: 保存加好友配置
*
* @param qdto qdto
* @return : {@link ServiceResponse< Boolean>}
* @author : YongEn
* @date : 2022/2/11
*/
ServiceResponse<Boolean> saveFriendSetting(SaveFriendSettingQDTO qdto);
/**
* desc: 获取加好友配置
*
* @param wxEnterpriseId 微信企业id
* @return : {@link ServiceResponse< FriendSettingDetailDTO>}
* @author : YongEn
* @date : 2022/2/11
*/
ServiceResponse<FriendSettingDetailDTO> getFriendSetting(String wxEnterpriseId);
}
......@@ -53,4 +53,9 @@ public interface StaffDepartmentRelatedMapper {
List<TabHaobanStaffDepartmentRelated> listByDepartmentIds(@Param("departmentIds")List<String> departmentIds);
int cleanStaffDepartment(@Param("wxEnterpriseId")String wxEnterpriseId,@Param("staffIds")List<String> staffIds);
List<TabHaobanStaffDepartmentRelated> listByWxEnterpriseIdAndStaffId(
@Param("wxEnterpriseId") String wxEnterpriseId,
@Param("staffId") String staffId
);
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ import com.gic.haoban.manage.service.entity.TabHaobanWelcomeSuitRang;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Set;
/**
* 欢迎语适用范围表(TabHaobanWelcomeSuitRang)表数据库访问层
......@@ -25,7 +26,7 @@ public interface TabHaobanWelcomeSuitRangMapper {
* 查询指定行数据
*
* @param offset 查询起始位置
* @param limit 查询条数
* @param limit 查询条数
* @return 对象列表
*/
List<TabHaobanWelcomeSuitRang> queryAllByLimit(@Param("offset") int offset, @Param("limit") int limit);
......@@ -62,4 +63,60 @@ public interface TabHaobanWelcomeSuitRangMapper {
* @return 影响行数
*/
int deleteById(Long welcomeSuitRangId);
/**
* desc: 根据微信企业id与部门id列表查询
*
* @param wxEnterpriseId 微信企业id
* @param departmentIdList 部门id列表
* @return : {@link List< TabHaobanWelcomeSuitRang>}
* @author : YongEn
* @date : 2022/2/11
*/
List<TabHaobanWelcomeSuitRang> listByWxEnterpriseIdAndDeptList(
@Param("wxEnterpriseId") String wxEnterpriseId,
@Param("departmentIdList") List<String> departmentIdList
);
/**
* desc: 批量新增
*
* @param welcomeSuitRangList 实体类列表
* @return : {@link int}
* @author : YongEn
* @date : 2022/2/11
*/
int batchInsert(@Param("welcomeSuitRangList") List<TabHaobanWelcomeSuitRang> welcomeSuitRangList);
/**
* desc: 根据适用部门批量删除(软删)
*
* @param suitDepartmentIdSet 列表
* @param wxEnterpriseId 微信企业id
* @param welcomeId 欢迎语id
* @return : {@link int}
* @author : YongEn
* @date : 2022/2/11
*/
int batchDeleteBySuitDepartmentIdSet(
@Param("welcomeId") String welcomeId,
@Param("wxEnterpriseId") String wxEnterpriseId,
@Param("suitDepartmentIdSet") Set<String> suitDepartmentIdSet
);
/**
* desc: 根据适用员工批量删除(软删除)
*
* @param suitStaffIdSet 列表
* @param wxEnterpriseId 微信企业id
* @param welcomeId 欢迎语id
* @return : {@link int}
* @author : YongEn
* @date : 2022/2/11
*/
int batchDeleteBySuitStaffIdSet(
@Param("welcomeId") String welcomeId,
@Param("wxEnterpriseId") String wxEnterpriseId,
@Param("suitStaffIdSet") Set<String> suitStaffIdSet
);
}
......@@ -44,7 +44,7 @@ public class WelcomeSuitRangServiceImpl implements WelcomeSuitRangService {
welcomeSuitRang.setSelectType(one.getSelectType());
return welcomeSuitRang;
}).collect(Collectors.toList());
// TODO: 2022/2/11 批量新增
welcomeSuitRangMapper.batchInsert(welcomeSuitRangList);
}
@Override
......@@ -66,7 +66,7 @@ public class WelcomeSuitRangServiceImpl implements WelcomeSuitRangService {
welcomeSuitRang.setSelectType(1);
return welcomeSuitRang;
}).collect(Collectors.toList());
// TODO: 2022/2/11 批量新增
welcomeSuitRangMapper.batchInsert(welcomeSuitRangList);
}
@Override
......@@ -76,8 +76,7 @@ public class WelcomeSuitRangServiceImpl implements WelcomeSuitRangService {
}
Set<String> welcomeSuitDepartmentIdSet = suitDepartmentList.stream()
.map(WelcomeSuitDepartmentBO::getDepartmentId).collect(Collectors.toSet());
// TODO: 2022/2/11 批量删除
welcomeSuitRangMapper.batchDeleteBySuitDepartmentIdSet(welcomeId, wxEnterpriseId, welcomeSuitDepartmentIdSet);
}
@Override
......@@ -87,7 +86,7 @@ public class WelcomeSuitRangServiceImpl implements WelcomeSuitRangService {
}
Set<String> welcomeSuitDepartmentIdSet = suitStaffList.stream()
.map(WelcomeSuitStaffBO::getStaffId).collect(Collectors.toSet());
// TODO: 2022/2/11 批量删除
welcomeSuitRangMapper.batchDeleteBySuitStaffIdSet(welcomeId, wxEnterpriseId, welcomeSuitDepartmentIdSet);
}
}
......@@ -337,4 +337,13 @@
#{item}
</foreach>
</update>
<select id="listByWxEnterpriseIdAndStaffId"
resultType="com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated">
select
<include refid="Base_Column_List" />
from tab_haoban_staff_department_related
where status_flag = 1
and wx_enterprise_id = #{wxEnterpriseId} and staff_id = #{staffId}
</select>
</mapper>
\ No newline at end of file
......@@ -105,6 +105,7 @@
title = #{title,jdbcType=VARCHAR},
</if>
and status_flag=1
order by create_time desc
</select>
<select id="countByWxEnterpriseId" resultType="java.lang.Long">
......
......@@ -62,7 +62,8 @@
<select id="queryAll" resultMap="TabHaobanWelcomeSuitRangMap">
select
welcome_suit_rang_id, wx_enterprise_id, welcome_id, suit_type, suit_department_id, suit_department_name,
suit_staff_id, suit_staff_name, staff_belong_department_id, staff_belong_department_name, select_type, create_time,
suit_staff_id, suit_staff_name, staff_belong_department_id, staff_belong_department_name, select_type,
create_time,
update_time, delete_flag
from haoban3.tab_haoban_welcome_suit_rang
<where>
......@@ -115,7 +116,8 @@
<insert id="insert" keyProperty="welcomeSuitRangId" useGeneratedKeys="true">
insert into haoban3.tab_haoban_welcome_suit_rang(wx_enterprise_id, welcome_id, suit_type, suit_department_id,
suit_department_name, suit_staff_id, suit_staff_name,
staff_belong_department_id, staff_belong_department_name, select_type,
staff_belong_department_id, staff_belong_department_name,
select_type,
create_time, update_time, delete_flag)
values (#{wxEnterpriseId}, #{welcomeId}, #{suitType}, #{suitDepartmentId}, #{suitDepartmentName},
#{suitStaffId}, #{suitStaffName}, #{staffBelongDepartmentId}, #{staffBelongDepartmentName}, #{selectType}
......@@ -176,4 +178,72 @@
where welcome_suit_rang_id = #{welcomeSuitRangId}
</delete>
<select id="listByWxEnterpriseIdAndDeptList"
resultType="com.gic.haoban.manage.service.entity.TabHaobanWelcomeSuitRang">
select welcome_suit_rang_id,
wx_enterprise_id,
welcome_id,
suit_type,
suit_department_id,
suit_department_name,
suit_staff_id,
suit_staff_name,
staff_belong_department_id,
staff_belong_department_name,
select_type,
create_time,
update_time,
delete_flag
from tab_haoban_welcome_suit_rang
where delete_flag = 0
and wx_enterprise_id = #{wxEnterpriseId}
and suit_department_id in
<foreach collection="departmentIdList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<insert id="batchInsert">
insert into tab_haoban_welcome_suit_rang
(
wx_enterprise_id,
welcome_id,
suit_type,
suit_department_id,
suit_department_name,
suit_staff_id,
suit_staff_name,
staff_belong_department_id,
staff_belong_department_name,
select_type,
create_time,
update_time,
delete_flag
)
values
<foreach collection="welcomeSuitRangList" item="model" separator=",">
(#{wxEnterpriseId}, #{welcomeId}, #{suitType}, #{suitDepartmentId}, #{suitDepartmentName},
#{suitStaffId}, #{suitStaffName}, #{staffBelongDepartmentId}, #{staffBelongDepartmentName}, #{selectType}
#{createTime}, #{updateTime}, #{deleteFlag})
</foreach>
</insert>
<update id="batchDeleteBySuitDepartmentIdSet">
update tab_haoban_welcome_suit_rang
set delete_flag = 1 where wx_enterprise_id = #{wxEnterpriseId} and welcome_id = #{welcomeId}
and suit_department_id in
<foreach collection="suitDepartmentIdSet" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</update>
<update id="batchDeleteBySuitStaffIdSet">
update tab_haoban_welcome_suit_rang
set delete_flag = 1 where wx_enterprise_id = #{wxEnterpriseId} and welcome_id = #{welcomeId}
and suit_staff_id in
<foreach collection="suitStaffIdSet" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</update>
</mapper>
package com.gic.haoban.manage.web.controller;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.haoban.manage.api.dto.welcome.FriendSettingDTO;
import com.gic.haoban.manage.api.dto.welcome.WelcomeDetailDTO;
import com.gic.haoban.manage.api.dto.welcome.WelcomeListDTO;
import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO;
import com.gic.haoban.common.utils.AuthWebRequestUtil;
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.SaveFriendSettingQDTO;
import com.gic.haoban.manage.api.dto.welcome.qdto.SaveWelcomeMediaQDTO;
import com.gic.haoban.manage.api.dto.welcome.qdto.SaveWelcomeQDTO;
import com.gic.haoban.manage.api.service.notify.WelcomeApiService;
import com.gic.haoban.manage.web.qo.welcome.ListWelcomeQO;
import com.gic.haoban.manage.web.qo.welcome.SaveFriendSettingQO;
import com.gic.haoban.manage.web.qo.welcome.SaveWelcomeQO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
......@@ -21,40 +30,107 @@ import java.util.List;
@RequestMapping("/welcome")
public class WelcomeController extends WebBaseController {
@Autowired
private WelcomeApiService welcomeApiService;
/**
* desc: 保存欢迎语
*
* @param qo qo
* @return : {@link RestResponse< Boolean>}
* @author : YongEn
* @date : 2022/2/11
*/
@RequestMapping(value = "/save", method = RequestMethod.POST)
public RestResponse<Boolean> saveWelcome(@RequestBody SaveWelcomeQO qo) {
// 保存欢迎语
return null;
WebLoginDTO login = AuthWebRequestUtil.getLoginUser();
SaveWelcomeQDTO qdto = new SaveWelcomeQDTO();
qdto.setWelcomeId(qo.getWelcomeId());
qdto.setWxEnterpriseId(qo.getWxEnterpriseId());
qdto.setTitle(qdto.getTitle());
qdto.setWelcomeContent(qo.getWelcomeContent());
qdto.setMediaList(EntityUtil.changeEntityListNew(SaveWelcomeMediaQDTO.class, qdto.getMediaList()));
qdto.setOperatorId(login.getStaffDTO().getStaffId());
qdto.setOperatorName(login.getStaffDTO().getStaffName());
qdto.setSuitDepartmentAddList(qo.getSuitDepartmentAddList());
qdto.setSuitDepartmentDeleteList(qo.getSuitDepartmentDeleteList());
// 员工暂时不传
ServiceResponse<Boolean> response = welcomeApiService.saveWelcome(qdto);
return RestResponse.successResult(response.getResult());
}
/**
* desc: 删除欢迎语
*
* @param welcomeId 欢迎语id
* @return : {@link RestResponse< Boolean>}
* @author : YongEn
* @date : 2022/2/11
*/
@RequestMapping(value = "/remove", method = RequestMethod.GET)
public RestResponse<Boolean> removeWelcome(@RequestParam("welcomeId") Long welcomeId) {
// 删除欢迎语
return null;
public RestResponse<Boolean> removeWelcome(@RequestParam("welcomeId") String welcomeId) {
ServiceResponse<Boolean> response = welcomeApiService.removeWelcome(welcomeId);
return RestResponse.successResult(response.getResult());
}
/**
* desc: 查询欢迎语列表
*
* @param qo qo
* @return : {@link RestResponse< List< WelcomeListDTO>>}
* @author : YongEn
* @date : 2022/2/11
*/
@RequestMapping(value = "/list", method = RequestMethod.POST)
public RestResponse<List<WelcomeListDTO>> listWelcome(@RequestBody ListWelcomeQO qo) {
// 查询欢迎语列表
return null;
ServiceResponse<List<WelcomeListDTO>> response = welcomeApiService.listWelcome(qo.getWxEnterpriseId(), qo.getTitle());
return RestResponse.successResult(response.getResult());
}
/**
* desc: 获取欢迎语
*
* @param welcomeId 欢迎语id
* @return : {@link RestResponse< WelcomeDetailDTO>}
* @author : YongEn
* @date : 2022/2/11
*/
@RequestMapping(value = "/get", method = RequestMethod.GET)
public RestResponse<WelcomeDetailDTO> getWelcome(@RequestParam("welcomeId") Long welcomeId) {
// 获取欢迎语
return null;
public RestResponse<WelcomeDetailDTO> getWelcome(@RequestParam("welcomeId") String welcomeId) {
ServiceResponse<WelcomeDetailDTO> response = welcomeApiService.getWelcome(welcomeId);
return RestResponse.successResult(response.getResult());
}
/**
* desc: 保存加好友配置
*
* @param qo qo
* @return : {@link RestResponse< Boolean>}
* @author : YongEn
* @date : 2022/2/11
*/
@RequestMapping(value = "/save/friend-setting", method = RequestMethod.POST)
public RestResponse<Boolean> saveFriendSetting(@RequestBody SaveFriendSettingQO qo) {
// 保存加好友配置
return null;
WebLoginDTO login = AuthWebRequestUtil.getLoginUser();
SaveFriendSettingQDTO qdto = EntityUtil.changeEntityNew(SaveFriendSettingQDTO.class, qo);
qdto.setUpdateId(login.getStaffDTO().getStaffId());
qdto.setUpdateName(login.getStaffDTO().getStaffName());
ServiceResponse<Boolean> response = welcomeApiService.saveFriendSetting(qdto);
return RestResponse.successResult(response.getResult());
}
/**
* desc: 获取加好友配置
*
* @param wxEnterpriseId 微信企业id
* @return : {@link RestResponse< FriendSettingDetailDTO>}
* @author : YongEn
* @date : 2022/2/11
*/
@RequestMapping(value = "/get/friend-setting", method = RequestMethod.GET)
public RestResponse<FriendSettingDTO> getFriendSetting(@RequestParam("wxEnterpriseId") String wxEnterpriseId) {
// 获取加好友配置
return null;
public RestResponse<FriendSettingDetailDTO> getFriendSetting(@RequestParam("wxEnterpriseId") String wxEnterpriseId) {
ServiceResponse<FriendSettingDetailDTO> response = welcomeApiService.getFriendSetting(wxEnterpriseId);
return RestResponse.successResult(response.getResult());
}
}
package com.gic.haoban.manage.web.qo.welcome;
import com.gic.haoban.manage.api.dto.welcome.dto.WelcomeSuitDepartmentDTO;
import com.gic.haoban.manage.api.dto.welcome.dto.WelcomeSuitStaffDTO;
import java.io.Serializable;
import java.util.List;
......@@ -10,7 +13,7 @@ import java.util.List;
* @date: 2022/2/9
**/
public class SaveWelcomeQO implements Serializable {
private static final long serialVersionUID = -595985005842610284L;
private static final long serialVersionUID = 5563693523008686521L;
/**
* 欢迎语id
*/
......@@ -28,17 +31,25 @@ public class SaveWelcomeQO implements Serializable {
*/
private String welcomeContent;
/**
* 适用部门, 以逗号分割
* 媒体列表
*/
private String suitDepartment;
private List<SaveWelcomeMediaQO> mediaList;
/**
* 适用员工, 以逗号分割
* 适用部门新增列表
*/
private String suitStaff;
private List<WelcomeSuitDepartmentDTO> suitDepartmentAddList;
/**
* 媒体列表
* 适用部门删除列表
*/
private List<SaveWelcomeMediaQO> mediaList;
private List<WelcomeSuitDepartmentDTO> suitDepartmentDeleteList;
/**
* 适用员工新增列表
*/
private List<WelcomeSuitStaffDTO> suitStaffAddList;
/**
* 适用员工删除列表
*/
private List<WelcomeSuitStaffDTO> suitStaffDeleteList;
public String getWelcomeId() {
return welcomeId;
......@@ -72,28 +83,44 @@ public class SaveWelcomeQO implements Serializable {
this.welcomeContent = welcomeContent;
}
public String getSuitDepartment() {
return suitDepartment;
public List<SaveWelcomeMediaQO> getMediaList() {
return mediaList;
}
public void setSuitDepartment(String suitDepartment) {
this.suitDepartment = suitDepartment;
public void setMediaList(List<SaveWelcomeMediaQO> mediaList) {
this.mediaList = mediaList;
}
public String getSuitStaff() {
return suitStaff;
public List<WelcomeSuitDepartmentDTO> getSuitDepartmentAddList() {
return suitDepartmentAddList;
}
public void setSuitStaff(String suitStaff) {
this.suitStaff = suitStaff;
public void setSuitDepartmentAddList(List<WelcomeSuitDepartmentDTO> suitDepartmentAddList) {
this.suitDepartmentAddList = suitDepartmentAddList;
}
public List<SaveWelcomeMediaQO> getMediaList() {
return mediaList;
public List<WelcomeSuitDepartmentDTO> getSuitDepartmentDeleteList() {
return suitDepartmentDeleteList;
}
public void setMediaList(List<SaveWelcomeMediaQO> mediaList) {
this.mediaList = mediaList;
public void setSuitDepartmentDeleteList(List<WelcomeSuitDepartmentDTO> suitDepartmentDeleteList) {
this.suitDepartmentDeleteList = suitDepartmentDeleteList;
}
public List<WelcomeSuitStaffDTO> getSuitStaffAddList() {
return suitStaffAddList;
}
public void setSuitStaffAddList(List<WelcomeSuitStaffDTO> suitStaffAddList) {
this.suitStaffAddList = suitStaffAddList;
}
public List<WelcomeSuitStaffDTO> getSuitStaffDeleteList() {
return suitStaffDeleteList;
}
public void setSuitStaffDeleteList(List<WelcomeSuitStaffDTO> suitStaffDeleteList) {
this.suitStaffDeleteList = suitStaffDeleteList;
}
@Override
......@@ -103,8 +130,11 @@ public class SaveWelcomeQO implements Serializable {
", wxEnterpriseId='" + wxEnterpriseId + '\'' +
", title='" + title + '\'' +
", welcomeContent='" + welcomeContent + '\'' +
", suitDepartment='" + suitDepartment + '\'' +
", mediaList=" + mediaList +
", suitDepartmentAddList=" + suitDepartmentAddList +
", suitDepartmentDeleteList=" + suitDepartmentDeleteList +
", suitStaffAddList=" + suitStaffAddList +
", suitStaffDeleteList=" + suitStaffDeleteList +
'}';
}
}
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