Commit d2d0f92d by 朱亚洁

feat:[1004853]小程序打卡

parent 194aed2e
......@@ -11,9 +11,9 @@ import com.pcloud.book.applet.dto.AppletThirdResourcesDTO;
import com.pcloud.book.applet.dto.BaseTempletClassifyDTO;
import com.pcloud.book.applet.dto.PcloudGroupActivityDTO;
import com.pcloud.book.applet.dto.ServeCollectDTO;
import com.pcloud.book.book.dto.BookDto;
import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.utils.ResponseHandleUtil;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -149,4 +149,9 @@ public interface AppletService {
@ApiOperation("查询用户书刊订阅信息")
@GetMapping("getUserSubscribeInfo")
ResponseEntity<ResponseDto<AnswerSubscribeUserDTO>> getUserSubscribeInfo(@RequestParam("wechatUserId") Long wechatUserId);
@ApiOperation("小程序打卡-书架最近10本书")
@GetMapping("getLatest10Books4Clock")
ResponseEntity<ResponseDto<List<BookDto>>> getLatest10Books4Clock(@RequestParam("wechatUserId") Long wechatUserId,
@RequestParam("officialAccountsId") Long officialAccountsId);
}
......@@ -15,6 +15,7 @@ import org.springframework.amqp.core.Queue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
......@@ -30,6 +31,7 @@ import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import javax.servlet.MultipartConfigElement;
import javax.sql.DataSource;
import java.util.ArrayList;
import java.util.HashMap;
......@@ -71,6 +73,16 @@ public class BookApplication {
}
@Bean
public MultipartConfigElement multipartConfigElement() {
MultipartConfigFactory factory = new MultipartConfigFactory();
//允许上传的文件最大值
factory.setMaxFileSize("50MB"); //KB,MB
/// 设置总上传数据总大小
factory.setMaxRequestSize("50MB");
return factory.createMultipartConfig();
}
@Bean
public DataSource setDataSourceProperties(@Autowired DataSource dataSource) {
ArrayList<String> arr = new ArrayList<>();
arr.add("set names utf8mb4;");
......
......@@ -6,6 +6,7 @@ import com.pcloud.book.applet.dto.BaseTempletClassifyDTO;
import com.pcloud.book.applet.dto.UserLastBookReDTO;
import com.pcloud.book.applet.entity.AppletUserBookcase;
import com.pcloud.book.applet.entity.AppletUserClickRecord;
import com.pcloud.book.book.dto.BookDto;
import com.pcloud.common.page.PageBeanNew;
import org.springframework.web.multipart.MultipartHttpServletRequest;
......@@ -104,4 +105,12 @@ public interface AppletUserBookcaseBiz {
BaseTempletClassifyDTO getLastReadBookInfo(List<Long> wechatUserIds);
List<Long> getSameClassifyUserIds(List<Long> wechatUserIds);
/**
* 小程序打卡-书架最近10本书
* @author:zhuyajie
* @date:2021/6/22 14:03
* * @param null
*/
List<BookDto> getLatest10Books4Clock(Long wechatUserId, Long officialAccountsId);
}
......@@ -21,6 +21,7 @@ import com.pcloud.book.book.dao.BookDao;
import com.pcloud.book.book.dao.BookLabelDao;
import com.pcloud.book.book.dao.BookRaysClassifyDao;
import com.pcloud.book.book.dto.BookAdviserDto;
import com.pcloud.book.book.dto.BookDto;
import com.pcloud.book.book.entity.BookLabel;
import com.pcloud.book.book.entity.BookRaysClassify;
import com.pcloud.book.consumer.app.AssistTempletConsr;
......@@ -738,4 +739,9 @@ public class AppletUserBookcaseBizImpl implements AppletUserBookcaseBiz {
appletUserBookcaseDTO.setRightsSettingBanners(rightsSetting.getRightsSettingBanners());
}
@Override
public List<BookDto> getLatest10Books4Clock(Long wechatUserId, Long officialAccountsId) {
List<Long> wechatUserIdList = readerConsr.getRelateUserIdList(wechatUserId, officialAccountsId);
return appletUserBookcaseDao.getLatest10Books4Clock(wechatUserIdList);
}
}
......@@ -5,6 +5,7 @@ import com.pcloud.book.applet.dto.BaseTempletClassifyDTO;
import com.pcloud.book.applet.dto.UserLastBookReDTO;
import com.pcloud.book.applet.entity.AppletUserBookcase;
import com.pcloud.book.applet.entity.AppletUserClickRecord;
import com.pcloud.book.book.dto.BookDto;
import com.pcloud.book.rightsSetting.entity.BaseTempletClassify;
import com.pcloud.common.core.dao.BaseDao;
......@@ -118,4 +119,11 @@ public interface AppletUserBookcaseDao extends BaseDao<AppletUserBookcase> {
BaseTempletClassifyDTO getLastReadBookInfoByUsers(List<Long> wechatUserIds);
List<Long> getSameClassifyUserIds(BaseTempletClassifyDTO baseTempletClassifyDTO);
/**
* 小程序打卡-书架最近10本书
* @author:zhuyajie
* @date:2021/6/22 14:03
* * @param null
*/
List<BookDto> getLatest10Books4Clock(List<Long> wechatUserIdList);
}
......@@ -6,6 +6,7 @@ import com.pcloud.book.applet.dto.BaseTempletClassifyDTO;
import com.pcloud.book.applet.dto.UserLastBookReDTO;
import com.pcloud.book.applet.entity.AppletUserBookcase;
import com.pcloud.book.applet.entity.AppletUserClickRecord;
import com.pcloud.book.book.dto.BookDto;
import com.pcloud.book.rightsSetting.entity.BaseTempletClassify;
import com.pcloud.common.core.dao.BaseDaoImpl;
......@@ -168,4 +169,9 @@ public class AppletUserBookcaseDaoImpl extends BaseDaoImpl<AppletUserBookcase> i
public List<Long> getSameClassifyUserIds(BaseTempletClassifyDTO baseTempletClassifyDTO) {
return getSessionTemplate().selectList(getStatement("getSameClassifyUserIds"), baseTempletClassifyDTO);
}
@Override
public List<BookDto> getLatest10Books4Clock(List<Long> wechatUserIdList) {
return getSessionTemplate().selectList(getStatement("getLatest10Books4Clock"), wechatUserIdList);
}
}
......@@ -24,6 +24,7 @@ import com.pcloud.book.applet.dto.PcloudGroupActivityDTO;
import com.pcloud.book.applet.dto.ServeCollectDTO;
import com.pcloud.book.applet.entity.ServeCollect;
import com.pcloud.book.applet.service.AppletService;
import com.pcloud.book.book.dto.BookDto;
import com.pcloud.book.group.biz.ResourcePageBiz;
import com.pcloud.book.rightsSetting.biz.RightsSettingBiz;
import com.pcloud.book.skill.biz.PcloudGroupActivityBiz;
......@@ -270,4 +271,11 @@ public class AppletServiceImpl implements AppletService {
public ResponseEntity<ResponseDto<AnswerSubscribeUserDTO>> getUserSubscribeInfo(@RequestParam("wechatUserId") Long wechatUserId){
return ResponseHandleUtil.toResponse(answerSubscribeBiz.getUserSubscribeInfo(wechatUserId));
}
@Override
@GetMapping("getLatest10Books4Clock")
public ResponseEntity<ResponseDto<List<BookDto>>> getLatest10Books4Clock(@RequestParam("wechatUserId") Long wechatUserId,
@RequestParam("officialAccountsId") Long officialAccountsId) {
return ResponseHandleUtil.toResponse(appletUserBookcaseBiz.getLatest10Books4Clock(wechatUserId, officialAccountsId));
}
}
......@@ -617,6 +617,9 @@ public class BookBizImpl implements BookBiz {
bookDto.setSubLabelId(bookAdviserDto.getSubLabelId());
bookDto.setVerLabelId(bookAdviserDto.getVerLabelId());
bookDto.setVolLabelId(bookAdviserDto.getVolLabelId());
bookDto.setProLabelId(bookAdviserDto.getProLabelId());
bookDto.setDepLabelId(bookAdviserDto.getDepLabelId());
bookDto.setPurLabelId(bookAdviserDto.getPurLabelId());
}
if (Objects.nonNull(bookDto)){
bookDto.setIsLibraryBook(checkIsLibraryBook(adviserId, bookId) ? 1 : 0);
......
......@@ -423,4 +423,33 @@
limit 1000
</select>
<select id="getLatest10Books4Clock" resultType="com.pcloud.book.book.dto.BookDto" parameterType="list">
SELECT
c.book_id bookId,
c.channel_id channelId,
c.adviser_id adviserId,
b.BOOK_NAME bookName,
b.COVER_IMG coverImg
FROM
applet_user_bookcase c
LEFT JOIN BOOK_ADVISER a ON c.book_id = a.BOOK_ID
AND c.adviser_id = a.ADVISER_ID
AND c.channel_id = a.CHANNEL_ID
AND a.IS_DELETE = 0
INNER JOIN BOOK b ON c.BOOK_ID = b.BOOK_ID
AND b.IS_DELETE = 0
WHERE
c.wechat_user_id IN
<foreach collection="list" separator="," item="item" close=")" open="(" index="index">
#{item}
</foreach>
GROUP BY
c.book_id,
a.ADVISER_ID,
c.channel_id
ORDER BY
c.create_time DESC
LIMIT 10
</select>
</mapper>
\ No newline at end of file
......@@ -700,7 +700,8 @@
SELECT
BOOK_ADVISER_ID, BOOK_ID, TEMPLET_ID, CHANNEL_ID, ADVISER_ID, IS_DELETE,
TEMPLET_ID,SECOND_TEMPLET_ID,third_templet_id,
GRA_LABEL_ID,SUB_LABEL_ID,VER_LABEL_ID,AREA_LABEL_ID,vol_label_id
GRA_LABEL_ID,SUB_LABEL_ID,VER_LABEL_ID,AREA_LABEL_ID,vol_label_id,
dep_label_id, pro_label_id, pur_label_id
FROM book_adviser
WHERE BOOK_ID=#{bookId}
AND IS_MAIN_EDITOR=1 AND IS_DELETE=0
......
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