Commit e15546b6 by unknown

修复1002503部分bug

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