Commit 803b743a by 徐高华

群活码

parent 16e7f1f8
......@@ -14,5 +14,7 @@ public interface GroupChatApiService {
* @throws
*/
public ServiceResponse<Void> qwEventNotice(ChatEventDTO dto);
}
package com.gic.haoban.manage.api.service.chat;
import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.manage.api.dto.chat.GroupChatHmDTO;
import com.gic.haoban.manage.api.dto.qdto.chat.ChatHmSearchQDTO;
/**
*
* @ClassName: GroupChatHmApiService
* @Description: 群活码
* @author xugh
* @date 2022年12月1日 下午7:44:51
*
*/
public interface GroupChatHmApiService {
// 活码列表
public ServiceResponse<Page<GroupChatHmDTO>> listPage(ChatHmSearchQDTO qdto, BasePageInfo basePageInfo);
// 活码详情
public ServiceResponse<GroupChatHmDTO> detail(Long chatHmId);
// 保存/更新
public ServiceResponse<GroupChatHmDTO> save(GroupChatHmDTO dto);
}
package com.gic.haoban.manage.service.dao.mapper.chat;
import java.util.Date;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.gic.haoban.manage.service.entity.chat.TabGroupChatHm;
/**
......@@ -14,14 +17,18 @@ import com.gic.haoban.manage.service.entity.chat.TabGroupChatHm;
* @CopyRight
*/
public interface GroupChatHmMapper {
public int insert(TabGroupChatHm tabHaobanGroupChatHm) ;
public int deleteByPrimaryKey(Long chatHmId) ;
public int updateByPrimaryKey(TabGroupChatHm tabHaobanGroupChatHm) ;
public TabGroupChatHm selectById(Long chatHmId) ;
public int insert(TabGroupChatHm tabHaobanGroupChatHm);
public int deleteById(Long chatHmId);
public int updateByPrimaryKey(TabGroupChatHm tabHaobanGroupChatHm);
public TabGroupChatHm selectById(Long chatHmId);
public List<TabGroupChatHm> list(@Param("wxEnterpriseId") String wxEnterpriseId,
@Param("enterpriseId") String enterpriseId, @Param("startDate") Date startDate,
@Param("endDate") Date endDate, @Param("searchParams") String searchParams,
@Param("statusFlag") Integer statusFlag);
}
\ No newline at end of file
......@@ -19,7 +19,7 @@ public interface GroupChatUserMapper {
public int insert(TabGroupChatUser tabHaobanGroupChatUser);
public int delete(@Param("idList") List<Long> chatUserIdList);
public int dismiss(@Param("idList") List<Long> chatUserIdList);
public int update(TabGroupChatUser tabHaobanGroupChatUser);
......
package com.gic.haoban.manage.service.service.chat;
import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page;
import com.gic.haoban.manage.api.dto.chat.GroupChatHmDTO;
import com.gic.haoban.manage.api.dto.qdto.chat.ChatHmSearchQDTO;
import com.gic.haoban.manage.service.pojo.bo.chat.GroupChatHmBO;
public interface GroupChatHmService {
public void saveHm(GroupChatHmDTO dto);
GroupChatHmBO getById(Long hmId);
public Page<GroupChatHmBO> listPage(ChatHmSearchQDTO qdto, BasePageInfo basePageInfo);
}
\ No newline at end of file
......@@ -11,24 +11,31 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.PageHelperUtils;
import com.gic.commons.util.UniqueIdUtils;
import com.gic.haoban.manage.api.constants.Manage3Constants;
import com.gic.haoban.manage.api.dto.SecretSettingDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO;
import com.gic.haoban.manage.api.dto.chat.GroupChatHmDTO;
import com.gic.haoban.manage.api.dto.qdto.chat.ChatHmSearchQDTO;
import com.gic.haoban.manage.api.enums.SecretTypeEnum;
import com.gic.haoban.manage.service.dao.mapper.chat.GroupChatHmMapper;
import com.gic.haoban.manage.service.dao.mapper.chat.GroupChatMapper;
import com.gic.haoban.manage.service.entity.chat.TabGroupChat;
import com.gic.haoban.manage.service.entity.chat.TabGroupChatHm;
import com.gic.haoban.manage.service.entity.hm.TabHmLink;
import com.gic.haoban.manage.service.pojo.bo.chat.GroupChatHmBO;
import com.gic.haoban.manage.service.pojo.bo.hm.HmLinkBO;
import com.gic.haoban.manage.service.service.SecretSettingService;
import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.haoban.manage.service.service.chat.GroupChatHmService;
import com.gic.wechat.api.dto.qywx.chat.AddJoinWayDTO;
import com.gic.wechat.api.service.qywx.QywxChatApiService;
import com.github.pagehelper.PageHelper;
@Service("groupChatHmService")
public class GroupChatHmServiceImpl implements GroupChatHmService {
......@@ -47,12 +54,27 @@ public class GroupChatHmServiceImpl implements GroupChatHmService {
private GroupChatHmMapper groupChatHmMapper;
@Override
public Page<GroupChatHmBO> listPage(ChatHmSearchQDTO qdto, BasePageInfo basePageInfo) {
PageHelper.startPage(basePageInfo);
String wxEnterpriseId = qdto.getWxEnterpriseId();
String enterpriseId = qdto.getEnterpriseId();
Date startDate = qdto.getStartDate();
Date endDate = qdto.getEndDate();
Integer statusFlag = qdto.getStatus();
List<TabGroupChatHm> list = this.groupChatHmMapper.list(wxEnterpriseId, enterpriseId, startDate, endDate,
qdto.getSearchParams(), statusFlag);
Page<GroupChatHmBO> retPage = PageHelperUtils.changePageHelperToCurrentPage(list, GroupChatHmBO.class);
return retPage;
}
@Override
public GroupChatHmBO getById(Long hmId) {
TabGroupChatHm hm = this.groupChatHmMapper.selectById(hmId);
GroupChatHmBO bo = EntityUtil.changeEntityByJSON(GroupChatHmBO.class, hm);
return bo;
}
@Override
public void saveHm(GroupChatHmDTO dto) {
String wxEnterpriseId = dto.getWxEnterpriseId();
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId);
......
......@@ -314,10 +314,10 @@ public class GroupChatServiceImpl implements GroupChatService {
}
}
if (CollectionUtils.isNotEmpty(deleteIdList)) {
this.groupChatUserMapper.delete(deleteIdList);
this.groupChatUserMapper.dismiss(deleteIdList);
}
// 群统计
this.groupChatMapper.updateData();
// this.groupChatMapper.updateData();
}
// 初始化群信息-不包括群状态
......
......@@ -22,6 +22,7 @@
<constructor-arg index="0" value="haoban-manage-service"/>
</bean>
<dubbo:service interface="com.gic.haoban.manage.api.service.chat.GroupChatHmApiService" ref="groupChatHmApiService" timeout="10000"/>
<dubbo:service interface="com.gic.haoban.manage.api.service.chat.GroupChatApiService" ref="groupChatApiService" timeout="10000"/>
<dubbo:service interface="com.gic.haoban.manage.api.service.HaobanCommonMQApiService" ref="haobanCommonMQApiService" timeout="10000"/>
<dubbo:service interface="com.gic.haoban.manage.api.service.hm.WxUserAddLogApiService" ref="wxUserAddLogApiService" timeout="10000"/>
......
......@@ -102,9 +102,8 @@
</insert>
<!-- =====================删除==================== -->
<update id="deleteByPrimaryKey" parameterType="long">
UPDATE tab_haoban_group_chat_hm SET delete_flag = 1 WHERE chat_hm_id =
#{chatHmId}
<update id="deleteById" parameterType="long">
UPDATE tab_haoban_group_chat_hm SET delete_flag = 1 WHERE chat_hm_id = #{chatHmId}
</update>
......@@ -139,9 +138,19 @@
</update>
<!-- ============ 查询============= -->
<select id="selectById" parameterType="long"
resultMap="result-map-tabHaobanGroupChatHm">
SELECT <include refid="Base_Column_List" /> FROM tab_haoban_group_chat_hm WHERE chat_hm_id = #{chatHmId}
</select>
<select id="selectById" parameterType="long" resultMap="result-map-tabHaobanGroupChatHm">
SELECT
<include refid="Base_Column_List" />
FROM tab_haoban_group_chat_hm WHERE chat_hm_id = #{chatHmId} and delete_flag = 0
</select>
<select id="list" resultMap="result-map-tabHaobanGroupChatHm">
SELECT
<include refid="Base_Column_List" /> FROM tab_haoban_group_chat_hm WHERE
wx_enterprise_id =#{wxEnterpriseId} and enterprise_id=#{enterpriesId}
and delete_flag = 0
</select>
</mapper>
\ No newline at end of file
......@@ -102,8 +102,8 @@
</insert>
<!-- =====================删除==================== -->
<update id="delete">
UPDATE tab_haoban_group_chat_user SET delete_flag = 1 WHERE chat_user_id in
<update id="dismiss">
UPDATE tab_haoban_group_chat_user SET status_flag = 2 , update_time=now() , user_quit_time = now() , quit_scene = 0 WHERE chat_user_id in
<foreach collection="idList" close=")" open="(" index="index" item="id" separator=",">
#{id}
</foreach>
......
package com.gic.haoban.manage.web.controller.chat;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO;
import com.gic.haoban.common.utils.AuthWebRequestUtil;
import com.gic.haoban.manage.api.dto.chat.GroupChatHmDTO;
import com.gic.haoban.manage.api.dto.qdto.chat.ChatHmSearchQDTO;
import com.gic.haoban.manage.api.service.chat.GroupChatHmApiService;
/**
*
* @ClassName: GroupChatHmController
......@@ -12,7 +24,51 @@ import org.springframework.web.bind.annotation.RestController;
*
*/
@RestController
@RequestMapping("/chat")
@RequestMapping("/chat/hm")
public class GroupChatHmController {
@Autowired
private GroupChatHmApiService groupChatHmApiService;
@RequestMapping("add")
public RestResponse<Object> save(@RequestBody GroupChatHmDTO dto) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
dto.setCreatorId(loginUser.getClerkId());
dto.setCreatorName(loginUser.getClerkName());
dto.setModifierId(loginUser.getClerkId());
dto.setModifierName(loginUser.getClerkName());
dto.setWxEnterpriseId(loginUser.getWxEnterpriseId());
dto.setEnterpriseId(loginUser.getEnterpriseId());
this.groupChatHmApiService.save(dto);
return RestResponse.successResult();
}
@RequestMapping("update")
public RestResponse<Object> update(@RequestBody GroupChatHmDTO dto) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
dto.setModifierId(loginUser.getClerkId());
dto.setModifierName(loginUser.getClerkName());
this.groupChatHmApiService.save(dto);
return RestResponse.successResult();
}
@RequestMapping("page")
public RestResponse<Object> page(ChatHmSearchQDTO qdto, BasePageInfo basePageInfo) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
qdto.setWxEnterpriseId(loginUser.getWxEnterpriseId());
qdto.setEnterpriseId(loginUser.getEnterpriseId());
ServiceResponse<Page<GroupChatHmDTO>> page = this.groupChatHmApiService.listPage(qdto, basePageInfo);
return RestResponse.successResult(page.getResult());
}
@RequestMapping("detail")
public RestResponse<Object> detail(Long chatHmId) {
ServiceResponse<GroupChatHmDTO> linkResp = this.groupChatHmApiService.detail(chatHmId);
if (!linkResp.isSuccess()) {
return RestResponse.failure("1", "群活码不存在");
}
GroupChatHmDTO hm = linkResp.getResult();
return RestResponse.successResult(hm);
}
}
......@@ -14,7 +14,8 @@
<dubbo:application name="haoban-manage3-web"/>
<dubbo:protocol name="dubbo" port="30009"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.chat.GroupChatApiService" id="groupChatApiService" timeout="10000"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.chat.GroupChatHmApiService" id="groupChatHmApiService" timeout="10000"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.QwFriendApiService" id="qwFriendApiService" timeout="10000"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.hm.WxUserAddLogApiService" id="wxUserAddLogApiService" timeout="10000"/>
<dubbo:reference interface="com.gic.member.tag.api.service.MemberTagApiService" id="memberTagApiService" timeout="10000"/>
......
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