Commit a73c67b3 by 阮思源

加个biz

parent ea147087
...@@ -267,4 +267,9 @@ public interface BookGroupBiz { ...@@ -267,4 +267,9 @@ public interface BookGroupBiz {
* 获取所有的大类分类 * 获取所有的大类分类
*/ */
List<LargeTempletDTO> getAllLargTemplet(); List<LargeTempletDTO> getAllLargTemplet();
/**
* 根据微信id和机器人id获取分类集合
*/
List<Long> getClassifyIdsByWxIdAndAltId(String wxId,String altId);
} }
...@@ -1175,4 +1175,17 @@ public class BookGroupBizImpl implements BookGroupBiz { ...@@ -1175,4 +1175,17 @@ public class BookGroupBizImpl implements BookGroupBiz {
return list; return list;
} }
@ParamLog("根据微信id和机器人id获取分类集合")
@Override
public List<Long> getClassifyIdsByWxIdAndAltId(String wxId, String altId) {
if (StringUtil.isEmpty(wxId) || StringUtil.isEmpty(altId)) {
return new ArrayList<>();
}
List<Long> list = joinGroupCipherDao.getClassifyIdsByWxIdAndAltId(wxId, altId);
if (list == null) {
return new ArrayList<>();
}
return list;
}
} }
...@@ -3,10 +3,14 @@ package com.pcloud.book.group.dao; ...@@ -3,10 +3,14 @@ package com.pcloud.book.group.dao;
import com.pcloud.book.group.entity.JoinGroupCipher; import com.pcloud.book.group.entity.JoinGroupCipher;
import com.pcloud.common.core.dao.BaseDao; import com.pcloud.common.core.dao.BaseDao;
import java.util.List;
public interface JoinGroupCipherDao extends BaseDao<JoinGroupCipher> { public interface JoinGroupCipherDao extends BaseDao<JoinGroupCipher> {
JoinGroupCipher getByWechatUserId(Long wechatUserId,Long classifyId); JoinGroupCipher getByWechatUserId(Long wechatUserId,Long classifyId);
JoinGroupCipher getByCipher(String cipher); JoinGroupCipher getByCipher(String cipher);
void updateCipherStateToUsed(String cipher, String wxId); void updateCipherStateToUsed(String cipher, String wxId);
List<Long> getClassifyIdsByWxIdAndAltId(String wxId, String altId);
} }
...@@ -6,6 +6,7 @@ import com.pcloud.common.core.dao.BaseDaoImpl; ...@@ -6,6 +6,7 @@ import com.pcloud.common.core.dao.BaseDaoImpl;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
...@@ -35,4 +36,12 @@ public class JoinGroupCipherDaoImpl extends BaseDaoImpl<JoinGroupCipher> impleme ...@@ -35,4 +36,12 @@ public class JoinGroupCipherDaoImpl extends BaseDaoImpl<JoinGroupCipher> impleme
map.put("wxId",wxId); map.put("wxId",wxId);
this.getSqlSession().update(this.getStatement("updateCipherStateToUsed"), map); this.getSqlSession().update(this.getStatement("updateCipherStateToUsed"), map);
} }
@Override
public List<Long> getClassifyIdsByWxIdAndAltId(String wxId, String altId) {
Map<String,Object> map=new HashMap<>();
map.put("wxId",wxId);
map.put("altId",altId);
return this.getSqlSession().selectList(this.getStatement("getClassifyIdsByWxIdAndAltId"), map);
}
} }
...@@ -59,4 +59,12 @@ ...@@ -59,4 +59,12 @@
update_time=now() update_time=now()
where cipher=#{cipher} where cipher=#{cipher}
</update> </update>
<!--根据微信id和机器人id获取分类集合-->
<select id="getClassifyIdsByWxIdAndAltId" parameterType="map" resultType="long">
select classify_id from join_group_cipher where
has_used=1
and alt_id=#{altId}
and wx_id=#{wxId}
</select>
</mapper> </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