|
@@ -1,6 +1,7 @@
|
|
package com.management.platform.service.impl;
|
|
package com.management.platform.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -4688,6 +4689,41 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public HttpRespMsg exportReport(String startDate, String endDate, Integer planId, Integer stateKey, Integer departmentId, HttpServletRequest request) {
|
|
public HttpRespMsg exportReport(String startDate, String endDate, Integer planId, Integer stateKey, Integer departmentId, HttpServletRequest request) {
|
|
- return null;
|
|
|
|
|
|
+ HttpRespMsg msg=new HttpRespMsg();
|
|
|
|
+ Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
|
|
|
|
+ List<Department> departmentList = departmentMapper.selectList(new LambdaQueryWrapper<Department>().eq(Department::getCompanyId, companyId));
|
|
|
|
+ List<Map<String,Object>> reportList=reportMapper.getReportList(startDate,endDate,planId,stateKey,departmentId,companyId);
|
|
|
|
+ List<List<String>> dataList=new ArrayList<>();
|
|
|
|
+ String[] title={"员工","工号","所属部门","排除工单号/任务变更通知号","钢印号","工作时长","产品名称","工序名称","进度","质检类型","质检人","工作日期","填报日期"};
|
|
|
|
+ List<String> titleList=Arrays.asList(title);
|
|
|
|
+ dataList.add(titleList);
|
|
|
|
+ for (Map<String, Object> map : reportList) {
|
|
|
|
+ List<String> item=new ArrayList<>();
|
|
|
|
+ item.add(String.valueOf(map.get("userName")));
|
|
|
|
+ item.add(String.valueOf(map.get("jobNumber")));
|
|
|
|
+ String departmentName = convertDepartmentIdToCascade(Integer.valueOf(String.valueOf(map.get("departmentId"))), departmentList);
|
|
|
|
+ item.add(departmentName);
|
|
|
|
+ Integer planType = Integer.valueOf(String.valueOf(map.get("planType")));
|
|
|
|
+ if(planType==0){
|
|
|
|
+ item.add(map.get("productSchedulingNum")==null?"":String.valueOf(map.get("productSchedulingNum")));
|
|
|
|
+ }else {
|
|
|
|
+ item.add(map.get("taskChangeNoticeNum")==null?"":String.valueOf(map.get("taskChangeNoticeNum")));
|
|
|
|
+ }
|
|
|
|
+ item.add(map.get("steelNumArray")==null?"":String.valueOf(map.get("steelNumArray")));
|
|
|
|
+ item.add(String.valueOf(map.get("workingTime")));
|
|
|
|
+ item.add(String.valueOf(map.get("productName")));
|
|
|
|
+ item.add(String.valueOf(map.get("procedureName")));
|
|
|
|
+ item.add(String.valueOf(map.get("progress"))+"%");
|
|
|
|
+ item.add(String.valueOf(map.get("checkType")));
|
|
|
|
+ item.add(map.get("checkerName")==null?"":String.valueOf(map.get("checkerName")));
|
|
|
|
+ item.add(String.valueOf(map.get("createDate")));
|
|
|
|
+ item.add(String.valueOf(map.get("reportTime")));
|
|
|
|
+ dataList.add(item);
|
|
|
|
+ }
|
|
|
|
+ Company company = companyMapper.selectById(companyId);
|
|
|
|
+ String fileName=("日报统计导出_")+company.getCompanyName()+System.currentTimeMillis();
|
|
|
|
+ String resp = ExcelUtil.exportGeneralExcelByTitleAndList(fileName, dataList, path);
|
|
|
|
+ msg.setData(resp);
|
|
|
|
+ return msg;
|
|
}
|
|
}
|
|
}
|
|
}
|