Commit 05eee6de by 朱亚洁

feat:[1006332]H5新增落地页企微老师优化

parent d243f15d
......@@ -307,4 +307,8 @@ public interface BookGroupService {
@ApiOperation("公众号二维码配置的企微码信息")
@GetMapping("getWxworkQrcodesBySceneId4Official")
ResponseEntity<ResponseDto<List<WxworkQrcodeDTO>>> getWxworkQrcodesBySceneId4Official(@RequestParam("sceneId") Long sceneId);
@ApiOperation("二维码企微落地页是否配了内容")
@PostMapping("mapWxworkStateBySceneIds")
ResponseEntity<ResponseDto<Map<Long, Boolean>>> mapWxworkStateBySceneIds(@RequestBody List<Long> sceneIds);
}
......@@ -548,4 +548,11 @@ public interface ResourcePageBiz {
* @return
*/
ResourcePageShareDto getShareConfig(Long qrCodeId);
/**
* @Description 是否配了企微落地页
* @Author zhuyajie
* @Date 14:05 2021/12/23
**/
Map<Long, Boolean> mapWxworkStateBySceneIds(List<Long> sceneIds);
}
......@@ -3444,4 +3444,20 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
return shareDto;
}
@Override
public Map<Long, Boolean> mapWxworkStateBySceneIds(List<Long> sceneIds) {
if (ListUtils.isEmpty(sceneIds)) {
return new HashMap<>();
}
List<Long> list = resourcePageWxworkDao.getWxworkBySceneIds(sceneIds);
if (ListUtils.isEmpty(list)) {
return new HashMap<>();
}
Map<Long,Boolean> map = new HashMap<>();
for (Long sceneId : list) {
map.put(sceneId, true);
}
return map;
}
}
......@@ -16,5 +16,7 @@ public interface ResourcePageWxworkDao extends BaseDao<ResourcePageWxwork> {
ResourcePageWxwork getByPageId(Long resourcePageId);
List<Long> getWxworkBySceneIds(List<Long> sceneIds);
}
......@@ -6,6 +6,10 @@ import com.pcloud.common.core.dao.BaseDaoImpl;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @ClassName com.pcloud.book.group.dao.impl.ResourcePageWxworkDaoImpl
* @Author zhuyajie
......@@ -18,4 +22,11 @@ public class ResourcePageWxworkDaoImpl extends BaseDaoImpl<ResourcePageWxwork> i
public ResourcePageWxwork getByPageId(Long resourcePageId) {
return getSessionTemplate().selectOne(getStatement("getByPageId"), resourcePageId);
}
@Override
public List<Long> getWxworkBySceneIds(List<Long> sceneIds) {
Map<String,Object> map = new HashMap<>();
map.put("list", sceneIds);
return getSessionTemplate().selectList(getStatement("getWxworkBySceneIds"), map);
}
}
......@@ -522,4 +522,10 @@ public class BookGroupServiceImpl implements BookGroupService {
public ResponseEntity<ResponseDto<List<WxworkQrcodeDTO>>> getWxworkQrcodesBySceneId4Official(@RequestParam("sceneId") Long sceneId) {
return ResponseHandleUtil.toResponse(bookQrcodeWxworkBiz.getWxworkQrcodesBySceneId4Official(sceneId));
}
@Override
@PostMapping("mapWxworkStateBySceneIds")
public ResponseEntity<ResponseDto<Map<Long, Boolean>>> mapWxworkStateBySceneIds(@RequestBody List<Long> sceneIds) {
return ResponseHandleUtil.toResponse(resourcePageBiz.mapWxworkStateBySceneIds(sceneIds));
}
}
......@@ -81,5 +81,18 @@
limit 1
</select>
<select id="getWxworkBySceneIds" parameterType="map" resultType="long">
SELECT
p.scene_id
FROM
resource_page_wxwork w
LEFT JOIN resource_page p ON w.resource_page_id = p.id
WHERE
p.scene_id IN
<foreach collection="list" separator="," open="(" close=")" index="index" item="item">
#{item}
</foreach>
</select>
</mapper>
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