Commit 4e91364f authored by tangwei's avatar tangwei

添加导出接口

parent 19720387
...@@ -38,6 +38,7 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType; ...@@ -38,6 +38,7 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.GET;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
...@@ -110,19 +111,40 @@ public class PlanTaskController extends AbstractBaseController { ...@@ -110,19 +111,40 @@ public class PlanTaskController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "导出巡检记录", notes = "导出巡检记录") @ApiOperation(value = "导出巡检记录", notes = "导出巡检记录")
@RequestMapping(value = "/exportSelectPlanTaskNew", method = RequestMethod.GET) @RequestMapping(value = "/exportSelectPlanTaskNew", method = RequestMethod.GET)
public void exportSelectPlanTaskNew( public void exportSelectPlanTaskNew(
@ApiParam(value = "查询条件", required = false) @RequestParam(required = false) Long[] ids, @ApiParam(value = "查询条件", required = false) @RequestParam(required = false) Long[] ids,
HttpServletResponse response) { HttpServletResponse response) {
List<PlanTaskVo> list = planTaskService.getPlanTaskListByIds(getToken(), getProduct(), getAppKey(), ids); List<PlanTaskVo> list = planTaskService.getPlanTaskListByIdsNew( ids);
String fileName = "巡检记录" + System.currentTimeMillis(); String fileName = "巡检记录" + System.currentTimeMillis();
FileHelper.exportExcel(list, "计划执行", "计划执行", PlanTaskVo.class, fileName + ".xls", response); FileHelper.exportExcel(list, "计划执行", "计划执行", PlanTaskVo.class, fileName + ".xls", response);
} }
/**
* 执行计划导出
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "执行计划导出", notes = "执行计划导出")
@GetMapping (value = "/reportPlanTaskNew", produces = "application/vnd.ms-excel;charset=UTF-8")
public void planTaskReportNew(
@ApiParam(value = "导出参数", required = false) @RequestParam(required = false)PlanTaskPageParam params,
HttpServletResponse response) {
try {
PlanTaskPageParam paramsk =new PlanTaskPageParam();
ReginParams reginParams = getSelectedOrgInfo();
paramsk.setBizOrgCode(reginParams.getPersonIdentity().getCompanyBizOrgCode());
List<PlanTaskVo> list = planTaskService.planTaskReportNew(paramsk);
String fileName = "计划执行" + new Date().getTime();
FileHelper.exportExcel(list, "计划执行", "计划执行", PlanTaskVo.class, fileName + ".xls", response);
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
......
...@@ -480,6 +480,12 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -480,6 +480,12 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
return content; return content;
} }
@Override
public List<PlanTaskVo> planTaskReportNew(PlanTaskPageParam params) {
List<PlanTaskVo> content = planTaskMapper.getPlanTaskInfoList(params);
return content;
}
/** /**
* 自动任务执行 * 自动任务执行
*/ */
......
...@@ -48,6 +48,10 @@ public interface IPlanTaskService { ...@@ -48,6 +48,10 @@ public interface IPlanTaskService {
* 执行计划导出 * 执行计划导出
*/ */
List<PlanTaskVo> planTaskReport(String toke,String product,String appKey,PlanTaskPageParam params); List<PlanTaskVo> planTaskReport(String toke,String product,String appKey,PlanTaskPageParam params);
List<PlanTaskVo> planTaskReportNew(PlanTaskPageParam params);
/** /**
* 自动任务执行 * 自动任务执行
* @param runDate * @param runDate
......
...@@ -144,6 +144,7 @@ ...@@ -144,6 +144,7 @@
<if test="orgCode!=null"> <if test="orgCode!=null">
and a.org_code like #{orgCode} and a.org_code like #{orgCode}
</if> </if>
<if test="bizOrgCode!=null"> and d.biz_org_code like concat(#{bizOrgCode},'%') </if>
</where> </where>
order by b.id order by b.id
......
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