Commit fbce1b7c by 徐高华

群事件

parent 08689b9f
......@@ -11,7 +11,7 @@ import com.gic.api.base.commons.ServiceResponse;
*
*/
public interface HaobanTimerApiService {
/**
*
* @Title: deleteTempWxHm
......@@ -21,8 +21,8 @@ public interface HaobanTimerApiService {
* @return
* @throws
*/
public ServiceResponse<Void> deleteTempWxHm(String params) ;
public ServiceResponse<Void> deleteTempWxHm(String params);
/**
*
* @Title: repairExternalUserId
......@@ -32,8 +32,8 @@ public interface HaobanTimerApiService {
* @return
* @throws
*/
public ServiceResponse<Void> repairExternalUserId(String wxEnterpriseId) ;
public ServiceResponse<Void> repairExternalUserId(String wxEnterpriseId);
/**
*
* @Title: repairStaffDepart
......@@ -43,8 +43,17 @@ public interface HaobanTimerApiService {
* @return
* @throws
*/
public ServiceResponse<Void> repairStaffDepart(String params) ;
public ServiceResponse<Void> repairStaffDepart(String params);
/**
*
* @Title: handChatNotice
* @Description: 处理好办事件通知
* @author xugh
* @param params
* @return
* @throws
*/
public ServiceResponse<Void> handChatNotice(String params);
}
......@@ -17,7 +17,7 @@ public interface ChatNoticeMapper {
public int insert(TabChatNotice entity);
public int updateStatus(TabChatNotice entity);
public int closeAll();
public List<TabChatNotice> listAll();
}
\ No newline at end of file
......@@ -9,8 +9,11 @@ public interface GroupChatService {
public void createChat(String corpid, String wxChatId);
// 更新同步群信息
public void updateChat(String corpid, String wxChatId ,String updateDetail , String msg);
public void updateChat(String corpid, String wxChatId, String updateDetail, String msg);
// 初始化企业群
public void initEnterpriseGroupChat(String wxEnterpriseId);
// 处理企微群事件
public void handChatNotice(String params);
}
\ No newline at end of file
......@@ -120,6 +120,27 @@ public class GroupChatServiceImpl implements GroupChatService {
}
@Override
public void handChatNotice(String params) {
List<TabChatNotice> list = this.chatNoticeMapper.listAll();
this.chatNoticeMapper.closeAll();
for (TabChatNotice item : list) {
int type = item.getType();
String wxEnterpriseId = item.getWxEnterpriseId();
Long groupChatId = item.getChatId();
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId);
if (type == 1) {
this.updateGroupChatDetail(qwDTO, groupChatId, false);
}
if (type == 2) {
}
if (type == 3) {
this.updateGroupChatDetail(qwDTO, groupChatId, true);
}
}
}
@Override
public void initEnterpriseGroupChat(String wxEnterpriseId) {
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId);
if (null == qwDTO) {
......@@ -206,7 +227,7 @@ public class GroupChatServiceImpl implements GroupChatService {
this.groupChatMapper.insert(chat);
}
if (syncDetailFlag) {
this.initGroupChatDetail(qwDTO, groupChatId, true);
this.updateGroupChatDetail(qwDTO, groupChatId, true);
}
}
......@@ -280,7 +301,7 @@ public class GroupChatServiceImpl implements GroupChatService {
}
// 初始化群信息-不包括群状态
private void initGroupChatDetail(WxEnterpriseQwDTO qwDTO, Long groupChatId, boolean syncMember) {
private void updateGroupChatDetail(WxEnterpriseQwDTO qwDTO, Long groupChatId, boolean syncMember) {
TabGroupChat chat = this.groupChatMapper.selectById(groupChatId);
this.initGroupChatDetail(qwDTO, chat, syncMember);
}
......
......@@ -7,34 +7,43 @@ import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.manage.api.service.HaobanTimerApiService;
import com.gic.haoban.manage.service.service.ExternalClerkRelatedService;
import com.gic.haoban.manage.service.service.StaffDepartmentRelatedService;
import com.gic.haoban.manage.service.service.chat.GroupChatService;
import com.gic.haoban.manage.service.service.hm.HmQrcodeTempService;
@Service("haobanTimerApiService")
public class HaobanTimerApiServiceImpl implements HaobanTimerApiService {
@Autowired
private HmQrcodeTempService hmQrcodeTempService;
@Autowired
private HmQrcodeTempService hmQrcodeTempService ;
private ExternalClerkRelatedService externalClerkRelatedService;
@Autowired
private ExternalClerkRelatedService externalClerkRelatedService ;
private StaffDepartmentRelatedService staffDepartmentRelatedService;
@Autowired
private StaffDepartmentRelatedService staffDepartmentRelatedService ;
private GroupChatService groupChatService;
@Override
public ServiceResponse<Void> deleteTempWxHm(String params) {
this.hmQrcodeTempService.deleteForTimer();
this.hmQrcodeTempService.deleteForTimer();
return ServiceResponse.success();
}
@Override
public ServiceResponse<Void> repairExternalUserId(String wxEnterpriseId) {
this.externalClerkRelatedService.repairExternalUserId(wxEnterpriseId) ;
this.externalClerkRelatedService.repairExternalUserId(wxEnterpriseId);
return ServiceResponse.success();
}
@Override
public ServiceResponse<Void> repairStaffDepart(String params) {
this.staffDepartmentRelatedService.repairAllStaffDepart(params);
return ServiceResponse.success();
}
@Override
public ServiceResponse<Void> handChatNotice(String params) {
this.groupChatService.handChatNotice(params);
return null;
}
}
......@@ -46,22 +46,15 @@
]]>
</insert>
<!-- ==================更新 ========== -->
<update id="updateStatus">
<![CDATA[
UPDATE tab_haoban_chat_notice SET
status_flag=#{statusFlag},
<update id="closeAll">
UPDATE tab_haoban_chat_notice SET
status_flag=1,
update_time=now()
where id = #{id}
]]>
where create_time > DATE_ADD(NOW(),INTERVAL -30 MINUTE)
</update>
<!-- ============ 查询============= -->
<select id="selectById" parameterType="long" resultMap="result-map-tabHaobanChatNotice">
SELECT <include refid="Base_Column_List" /> FROM tab_haoban_chat_notice WHERE id = #{id}
</select>
<select id="listAll" resultMap="result-map-tabHaobanChatNotice">
select <include refid="Base_Column_List" /> from tab_haoban_chat_notice
select wx_enterprise_id wxEnterpriseId , chat_id chatId , type from tab_haoban_chat_notice where create_time > DATE_ADD(NOW(),INTERVAL -30 MINUTE) and status_flag = 0
group by wx_enterprise_id , chat_id , type
</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