Commit 308d502b by 徐高华

删除临时活码

parent 170b119b
......@@ -25,8 +25,6 @@ public interface HmQrcodeTempMapper {
public int deleteByPrimaryKey(Long id);
public int deleteByRelationId(String id);
TabHmQrcodeTemp selectByRelationId(String relationId);
/**
......
......@@ -44,26 +44,32 @@ public class HmQrcodeTempServiceImpl implements HmQrcodeTempService {
@Override
public void deleteQrcode(String relationId) {
this.hmQrcodeTempMapper.deleteByRelationId(relationId);
TabHmQrcodeTemp item = this.hmQrcodeTempMapper.selectByRelationId(relationId);
if (null != item && item.getStatusFlag() == 1) {
this.del(item);
}
}
@Override
public void deleteForTimer() {
List<TabHmQrcodeTemp> list = this.hmQrcodeTempMapper.listAll();
String suiteId = config.getWxSuiteid();
if (CollectionUtils.isEmpty(list)) {
for (TabHmQrcodeTemp item : list) {
try {
String corpid = item.getCorpid();
String configId = item.getWxConfigId();
QywxResponseDTO resp = this.qywxUserApiService.delContactWay(corpid, suiteId, configId);
log.info("删除临时活码={}{},返回={}", configId, corpid, JSON.toJSONString(resp));
this.hmQrcodeTempMapper.deleteByPrimaryKey(item.getId());
} catch (Exception e) {
log.info("删除临时活码异常={}", e);
}
this.del(item);
}
}
}
private void del(TabHmQrcodeTemp item) {
try {
String suiteId = config.getWxSuiteid();
String corpid = item.getCorpid();
String configId = item.getWxConfigId();
QywxResponseDTO resp = this.qywxUserApiService.delContactWay(corpid, suiteId, configId);
log.info("删除临时活码={}{},返回={}", configId, corpid, JSON.toJSONString(resp));
this.hmQrcodeTempMapper.deleteByPrimaryKey(item.getId());
} catch (Exception e) {
log.info("删除临时活码异常={}", e);
}
}
}
......@@ -49,11 +49,6 @@
UPDATE tab_haoban_hm_qrcode_temp SET status_flag = 0 , update_time=now() WHERE id = #{id} and status_flag=1
</update>
<update id="deleteByRelationId" parameterType="long">
UPDATE tab_haoban_hm_qrcode_temp SET status_flag = 0 , update_time=now() WHERE relation_id = #{relationId} and status_flag=1
</update>
<!-- ============ 查询============= -->
<select id="selectByRelationId" parameterType="String"
resultMap="result-map-tabHaobanHmQrcodeTemp">
......
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