| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | @ApiOperation(value = "下载任务记录数据", tags = {"任务记录"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "列表数据id,多个逗号分隔", name = "ids", dataType = "String"), |
| | | @ApiImplicitParam(value = "状态(1=待执行,2=进行中,3=成功,4=失败)", name = "status", dataType = "int"), |
| | | @ApiImplicitParam(value = "状态(1=待执行,2=进行中,3=成功,4=失败)", name = "statuss", dataType = "String"), |
| | | @ApiImplicitParam(value = "规则编号", name = "code", dataType = "String"), |
| | | @ApiImplicitParam(value = "系统审核状态(1=未执行,2=正常,3=异常)", name = "sysStatus", dataType = "int"), |
| | | }) |
| | | public void downloadTaskRecord(String ids, String code, Integer status,Integer sysStatus, HttpServletResponse response){ |
| | | public void downloadTaskRecord(String ids, String code, String statuss,Integer sysStatus, HttpServletResponse response){ |
| | | List<String> id = null; |
| | | if(ToolUtil.isNotEmpty(ids)){ |
| | | String[] split = ids.split(","); |
| | | id = Arrays.asList(split); |
| | | } |
| | | taskDetailService.downloadTaskRecord(id, code, status,sysStatus, response); |
| | | List<Integer> statusList=null; |
| | | if(ToolUtil.isNotEmpty(statuss)){ |
| | | String[] split = ids.split(","); |
| | | statusList = Arrays.stream(split) |
| | | .map(Integer::parseInt) |
| | | .collect(Collectors.toList()); |
| | | |
| | | } |
| | | taskDetailService.downloadTaskRecord(id, code, statusList,sysStatus, response); |
| | | } |
| | | |
| | | |
| | |
| | | * @param status |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> getDownloadTaskRecord(@Param("ids") List<String> ids, @Param("code") String code, @Param("status") Integer status,@Param("sysStatus") Integer sysStatus); |
| | | List<Map<String, Object>> getDownloadTaskRecord(@Param("ids") List<String> ids, @Param("code") String code, @Param("status") List<Integer> status,@Param("sysStatus") Integer sysStatus); |
| | | } |
| | |
| | | <if test="null != code and '' != code"> |
| | | and b.code like CONCAT('%', #{code}, '%') |
| | | </if> |
| | | <if test="null != status"> |
| | | and b.status = #{status} |
| | | <if test="null != status and status.size() > 0"> |
| | | and b.status in |
| | | <foreach collection="status" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="null != sysStatus"> |
| | | and d.sys_status = #{sysStatus} |
| | |
| | | * @param status |
| | | * @param response |
| | | */ |
| | | void downloadTaskRecord(List<String> ids, String code, Integer status,Integer sysStatus, HttpServletResponse response); |
| | | void downloadTaskRecord(List<String> ids, String code,List<Integer> status,Integer sysStatus, HttpServletResponse response); |
| | | |
| | | } |
| | |
| | | * @param response |
| | | */ |
| | | @Override |
| | | public void downloadTaskRecord(List<String> ids, String code, Integer status,Integer sysStatus, HttpServletResponse response) { |
| | | public void downloadTaskRecord(List<String> ids, String code, List<Integer> status,Integer sysStatus, HttpServletResponse response) { |
| | | List<Map<String, Object>> mapList = this.baseMapper.getDownloadTaskRecord(ids, code, status,sysStatus); |
| | | try { |
| | | HSSFWorkbook hssfWorkbook = new HSSFWorkbook(); |