Commit c1654609 by 章春雨

Merge branch 'fixbug' into 'master'

修复1002503部分bug

See merge request rays/pcloud-book!528
parents 35133f3c e15546b6
......@@ -25,7 +25,7 @@ public interface CustomPlanBiz {
void deleteCustomPlanById(Integer planId);
PageBeanNew<CustomPlan> listCustomPlanByPage(Integer currentPage, Integer numPerPage, String content, Integer useState);
PageBeanNew<CustomPlan> listCustomPlanByPage(Integer currentPage, Integer numPerPage, String content, Integer useState, Integer hasPdf);
void editCustomPlanModule(EditCustomPlanModuleVO editCustomPlanModuleVO);
......
......@@ -135,12 +135,12 @@ public class CustomPlanBizImpl implements CustomPlanBiz {
}
@Override
public PageBeanNew<CustomPlan> listCustomPlanByPage(Integer currentPage, Integer numPerPage, String content, Integer useState) {
int count = customPlanMapper.getCustomPlanCount(content, useState);
public PageBeanNew<CustomPlan> listCustomPlanByPage(Integer currentPage, Integer numPerPage, String content, Integer useState, Integer hasPdf) {
int count = customPlanMapper.getCustomPlanCount(content, useState, hasPdf);
if(count <= 0) {
return new PageBeanNew<>(currentPage, numPerPage, new ArrayList<>());
}
List<CustomPlan> customPlanList = customPlanMapper.listCustomPlanByPage(currentPage * numPerPage, numPerPage, content, useState);
List<CustomPlan> customPlanList = customPlanMapper.listCustomPlanByPage(currentPage * numPerPage, numPerPage, content, useState, hasPdf);
return new PageBeanNew<>(currentPage, numPerPage, count, customPlanList);
}
......@@ -175,7 +175,7 @@ public class CustomPlanBizImpl implements CustomPlanBiz {
CustomPlan customPlan = new CustomPlan();
customPlan.setId(planId);
customPlan.setPdfUrl(pdfUrl);
customPlanMapper.update(customPlan);
customPlanMapper.updatePdfUrl(customPlan);
}
} catch (Exception e) {
LOGGER.error("转PDF失败", e);
......
......@@ -78,8 +78,9 @@ public class CustomPlanFacade {
@ApiOperation("分页获取定制方案")
@GetMapping("listCustomPlanByPage")
ResponseDto<?> listCustomPlanByPage(@RequestHeader String token, @RequestParam Integer currentPage, @RequestParam Integer numPerPage,
@RequestParam(value = "content", required = false) String content, @RequestParam(value = "useState", required = false) Integer useState) {
return new ResponseDto<>(customPlanBiz.listCustomPlanByPage(currentPage, numPerPage, content, useState));
@RequestParam(value = "content", required = false) String content, @RequestParam(value = "useState", required = false) Integer useState,
@RequestParam(value = "hasPdf", required = false) Integer hasPdf) {
return new ResponseDto<>(customPlanBiz.listCustomPlanByPage(currentPage, numPerPage, content, useState, hasPdf));
}
@ApiOperation("编辑方案模块")
......
......@@ -20,11 +20,14 @@ public interface CustomPlanMapper {
void deleteById(@Param("id") Integer id);
int getCustomPlanCount(@Param("content") String content, @Param("useState") Integer useState);
int getCustomPlanCount(@Param("content") String content, @Param("useState") Integer useState, @Param("hasPdf") Integer hasPdf);
List<CustomPlan> listCustomPlanByPage(@Param("pageNum") Integer pageNum, @Param("numPerPage") Integer numPerPage, @Param("content") String content, @Param("useState") Integer useState);
List<CustomPlan> listCustomPlanByPage(@Param("pageNum") Integer pageNum, @Param("numPerPage") Integer numPerPage, @Param("content") String content, @Param("useState") Integer useState,
@Param("hasPdf") Integer hasPdf);
int getPlanPaperCount(Map<String, Object> paramMap);
List<CustomPlanPaperVO> listPlanPaperByPage(Map<String, Object> paramMap);
void updatePdfUrl(CustomPlan customPlan);
}
\ No newline at end of file
......@@ -109,6 +109,9 @@
<if test="useState != null">
and use_state = #{useState}
</if>
<if test="hasPdf == 1">
and pdf_url is not null
</if>
</select>
<select id="listCustomPlanByPage" resultMap="BaseResultMap">
......@@ -126,6 +129,9 @@
<if test="useState != null">
and use_state = #{useState}
</if>
<if test="hasPdf == 1">
and pdf_url is not null
</if>
GROUP BY a.id
ORDER BY update_time DESC
LIMIT #{pageNum}, #{numPerPage}
......@@ -173,4 +179,9 @@
ORDER BY update_time DESC
LIMIT #{pageNum}, #{numPerPage}
</select>
<update id="updatePdfUrl" parameterType="CustomPlan">
update custom_plan set pdf_url =#{pdfUrl}
where id = #{id,jdbcType=INTEGER}
</update>
</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