Commit fc0eef77 authored by mengbali153's avatar mengbali153

非标产值

parent de2b762a
...@@ -2,10 +2,12 @@ package cn.wise.sc.cement.business.controller; ...@@ -2,10 +2,12 @@ package cn.wise.sc.cement.business.controller;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.wise.sc.cement.business.entity.NonStandardValue;
import cn.wise.sc.cement.business.entity.NormProduction; import cn.wise.sc.cement.business.entity.NormProduction;
import cn.wise.sc.cement.business.entity.NormProductionStatistics; import cn.wise.sc.cement.business.entity.NormProductionStatistics;
import cn.wise.sc.cement.business.model.BaseResponse; import cn.wise.sc.cement.business.model.BaseResponse;
import cn.wise.sc.cement.business.model.PageQuery; import cn.wise.sc.cement.business.model.PageQuery;
import cn.wise.sc.cement.business.model.vo.NonStandardValueVo;
import cn.wise.sc.cement.business.model.vo.NormProductionVo; import cn.wise.sc.cement.business.model.vo.NormProductionVo;
import cn.wise.sc.cement.business.model.vo.ProductionVo; import cn.wise.sc.cement.business.model.vo.ProductionVo;
import cn.wise.sc.cement.business.service.INormProductionService; import cn.wise.sc.cement.business.service.INormProductionService;
...@@ -22,7 +24,10 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -22,7 +24,10 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set;
/** /**
* <p> * <p>
...@@ -131,7 +136,7 @@ public class NormProductionController { ...@@ -131,7 +136,7 @@ public class NormProductionController {
@GetMapping("/total/production") @GetMapping("/total/production")
@ApiOperation("总产值统计") @ApiOperation("总产值统计")
public BaseResponse<Page<ProductionVo>> production(PageQuery pageQuery, String name, String start, String end) { public BaseResponse<Page<ProductionVo>> production(PageQuery pageQuery, String name, String start, String end,Integer groupId) {
Long startTime = null; Long startTime = null;
Long endTime = null; Long endTime = null;
...@@ -140,7 +145,40 @@ public class NormProductionController { ...@@ -140,7 +145,40 @@ public class NormProductionController {
endTime = DateUtil.parseDate(end).getTime(); endTime = DateUtil.parseDate(end).getTime();
} }
List<ProductionVo> rts = iNormProductionService.production(name, startTime, endTime); List<ProductionVo> rts = iNormProductionService.production(name, startTime, endTime,groupId);
if (!rts.isEmpty()){
Set<Integer> ids = new HashSet<>();
for (ProductionVo productionVo:rts) {
Integer groupId1 = productionVo.getGroupId();
ids.add(groupId1);
}
List<ProductionVo> newRts = new ArrayList<>();
for (Integer groupId1:ids){
ProductionVo finalNormProduction=new ProductionVo();
for (ProductionVo productionVo:rts){
if (productionVo.getGroupId().intValue()==groupId1){
finalNormProduction.setUserId(productionVo.getUserId());
finalNormProduction.setUserName(productionVo.getUserName());
finalNormProduction.setAccount(productionVo.getAccount());
finalNormProduction.setPositionId(productionVo.getPositionId());
finalNormProduction.setPosition(productionVo.getPosition());
finalNormProduction.setTime(productionVo.getTime());
finalNormProduction.setGroupId(productionVo.getGroupId());
Double newFinalValue=productionVo.getProductionTotalValue()+finalNormProduction.getProductionTotalValue();
finalNormProduction.setProductionTotalValue(newFinalValue);
Double newNonProductionValue=productionVo.getNonProductionValue()+finalNormProduction.getNonProductionValue();
finalNormProduction.setNonProductionValue(newNonProductionValue);
Double newProductionValue=productionVo.getProductionValue()+finalNormProduction.getProductionValue();
finalNormProduction.setProductionValue(newProductionValue);
}
}
newRts.add(finalNormProduction);
}
rts=newRts;
}
return BaseResponse.okData(PageUtil.listConvertToPage(rts, pageQuery)); return BaseResponse.okData(PageUtil.listConvertToPage(rts, pageQuery));
} }
...@@ -173,7 +211,7 @@ public class NormProductionController { ...@@ -173,7 +211,7 @@ public class NormProductionController {
@PostMapping("/export/total/production") @PostMapping("/export/total/production")
@ApiOperation("导出总产值") @ApiOperation("导出总产值")
public void exportProduction(String name, String start, String end, HttpServletResponse response) { public void exportProduction(String name, String start, String end,Integer groupId, HttpServletResponse response) {
Long startTime = null; Long startTime = null;
Long endTime = null; Long endTime = null;
if (StrUtil.isNotBlank(start) && StrUtil.isNotBlank(end)) { if (StrUtil.isNotBlank(start) && StrUtil.isNotBlank(end)) {
...@@ -181,7 +219,7 @@ public class NormProductionController { ...@@ -181,7 +219,7 @@ public class NormProductionController {
endTime = DateUtil.parseDate(end).getTime(); endTime = DateUtil.parseDate(end).getTime();
} }
iNormProductionService.exportProduction(name, startTime, endTime, response); iNormProductionService.exportProduction(name, startTime, endTime,groupId, response);
} }
} }
......
...@@ -69,4 +69,7 @@ public class NonStandardValue implements Serializable { ...@@ -69,4 +69,7 @@ public class NonStandardValue implements Serializable {
@ApiModelProperty("部门id") @ApiModelProperty("部门id")
private Integer groups; private Integer groups;
@ApiModelProperty("部门名")
private String groupName;
} }
...@@ -28,8 +28,10 @@ public class NormProductionStatistics implements Serializable { ...@@ -28,8 +28,10 @@ public class NormProductionStatistics implements Serializable {
private Long count; private Long count;
private Integer coefficient; private Double coefficient;
private Integer groupId; private Integer groupId;
private String groupName;
} }
...@@ -23,17 +23,19 @@ ...@@ -23,17 +23,19 @@
</sql> </sql>
<select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.NonStandardValueVo"> <select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.NonStandardValueVo">
select na.*,su.name as name,su.username as account,su.group_id as groups select na.*,su.name as name,su.username as account,su.group_id as groups,sg.name as groupname
from nonstandard_apply na from nonstandard_apply na
LEFT JOIN sys_user su ON su.id = na.user_id LEFT JOIN sys_user su ON su.id = na.user_id
LEFT JOIN sys_group sg ON sg.id = su.group_id
<include refid="where"/> <include refid="where"/>
order by na.id asc order by na.id asc
</select> </select>
<select id="getList" resultType="cn.wise.sc.cement.business.model.vo.NonStandardValueVo"> <select id="getList" resultType="cn.wise.sc.cement.business.model.vo.NonStandardValueVo">
select na.*,su.name as name,su.username as account,na.start_time as startTime,su.group_id as groups select na.*,su.name as name,su.username as account,na.start_time as startTime,su.group_id as groups,sg.name as groupname
from nonstandard_apply na from nonstandard_apply na
LEFT JOIN sys_user su ON su.id = na.user_id LEFT JOIN sys_user su ON su.id = na.user_id
LEFT JOIN sys_group sg ON sg.id = su.group_id
<include refid="where"/> <include refid="where"/>
order by na.id asc order by na.id asc
</select> </select>
...@@ -50,9 +52,11 @@ ...@@ -50,9 +52,11 @@
na.work_type as 工作类别, na.work_type as 工作类别,
na.work_description as 工作描述, na.work_description as 工作描述,
na.start_time as 开始时间, na.start_time as 开始时间,
su.group_id as 部门id su.group_id as 部门id,
sg.name as groupname
FROM nonstandard_apply na FROM nonstandard_apply na
left join sys_user su on na.user_id = su.id left join sys_user su on na.user_id = su.id
LEFT JOIN sys_group sg ON sg.id = su.group_id
<include refid="where" /> <include refid="where" />
ORDER BY na.id ASC ORDER BY na.id ASC
</select> </select>
......
...@@ -49,6 +49,9 @@ public class NonStandardValueVo { ...@@ -49,6 +49,9 @@ public class NonStandardValueVo {
@ApiModelProperty("用户id") @ApiModelProperty("用户id")
private Integer userId; private Integer userId;
@ApiModelProperty("部门") @ApiModelProperty("部门id")
private Integer groups; private Integer groups;
@ApiModelProperty("部门名")
private String groupName;
} }
...@@ -31,7 +31,7 @@ public class ProductionVo implements Serializable { ...@@ -31,7 +31,7 @@ public class ProductionVo implements Serializable {
@ApiModelProperty("统计时间") @ApiModelProperty("统计时间")
private String time; private String time;
@ApiModelProperty("标准产值") @ApiModelProperty("标准产值")
private Integer productionValue = 0; private Double productionValue = 0D;
@ApiModelProperty("非标准产值") @ApiModelProperty("非标准产值")
private Double nonProductionValue = 0D; private Double nonProductionValue = 0D;
@ApiModelProperty("总产值") @ApiModelProperty("总产值")
......
...@@ -83,7 +83,7 @@ public interface INormProductionService extends IService<NormProduction> { ...@@ -83,7 +83,7 @@ public interface INormProductionService extends IService<NormProduction> {
* @param end 结束时间 * @param end 结束时间
* @return 详细信息 * @return 详细信息
*/ */
List<ProductionVo> production(String name,Long start,Long end); List<ProductionVo> production(String name,Long start,Long end,Integer groupId);
/** /**
* 导出标准统计 * 导出标准统计
...@@ -96,7 +96,7 @@ public interface INormProductionService extends IService<NormProduction> { ...@@ -96,7 +96,7 @@ public interface INormProductionService extends IService<NormProduction> {
void exportNormProductionStatistics(Long start, Long end,String name,Integer groupId, HttpServletResponse response); void exportNormProductionStatistics(Long start, Long end,String name,Integer groupId, HttpServletResponse response);
/** /**
* 导出标准统计详情 * 导出个人标准产值详情列表
* @param userId 用户id * @param userId 用户id
* @param startTime 开始时间 * @param startTime 开始时间
* @param endTime 结束时间 * @param endTime 结束时间
...@@ -111,5 +111,5 @@ public interface INormProductionService extends IService<NormProduction> { ...@@ -111,5 +111,5 @@ public interface INormProductionService extends IService<NormProduction> {
* @param endTime 结束时间 * @param endTime 结束时间
* @param response 响应体 * @param response 响应体
*/ */
void exportProduction(String name, Long startTime, Long endTime,HttpServletResponse response); void exportProduction(String name, Long startTime, Long endTime,Integer groupId,HttpServletResponse response);
} }
...@@ -84,6 +84,7 @@ public class NonStandardValueServiceImpl extends ServiceImpl<NonStandardValueMap ...@@ -84,6 +84,7 @@ public class NonStandardValueServiceImpl extends ServiceImpl<NonStandardValueMap
finalNonStandardValue.setName(nonStandardValue.getName()); finalNonStandardValue.setName(nonStandardValue.getName());
finalNonStandardValue.setAccount(nonStandardValue.getAccount()); finalNonStandardValue.setAccount(nonStandardValue.getAccount());
finalNonStandardValue.setGroups(nonStandardValue.getGroups()); finalNonStandardValue.setGroups(nonStandardValue.getGroups());
finalNonStandardValue.setGroupName(nonStandardValue.getGroupName());
Integer newId=finalNonStandardValue.getId()+1; Integer newId=finalNonStandardValue.getId()+1;
finalNonStandardValue.setId(newId); finalNonStandardValue.setId(newId);
...@@ -126,7 +127,7 @@ public class NonStandardValueServiceImpl extends ServiceImpl<NonStandardValueMap ...@@ -126,7 +127,7 @@ public class NonStandardValueServiceImpl extends ServiceImpl<NonStandardValueMap
if (!CollectionUtils.isEmpty(list)) { if (!CollectionUtils.isEmpty(list)) {
Map<String, Object> map = list.get(0); Map<String, Object> map = list.get(0);
String[] headers = new String[11]; String[] headers = new String[12];
headers[0] = "序号"; headers[0] = "序号";
headers[1] = "姓名"; headers[1] = "姓名";
headers[2] = "账户"; headers[2] = "账户";
...@@ -138,6 +139,7 @@ public class NonStandardValueServiceImpl extends ServiceImpl<NonStandardValueMap ...@@ -138,6 +139,7 @@ public class NonStandardValueServiceImpl extends ServiceImpl<NonStandardValueMap
headers[8] = "工作描述"; headers[8] = "工作描述";
headers[9] = "开始时间"; headers[9] = "开始时间";
headers[10] = "部门id"; headers[10] = "部门id";
headers[11] = "部门名";
List<Object[]> datas = new ArrayList<>(list.size()); List<Object[]> datas = new ArrayList<>(list.size());
......
...@@ -21,15 +21,7 @@ import cn.wise.sc.cement.business.model.BaseResponse; ...@@ -21,15 +21,7 @@ import cn.wise.sc.cement.business.model.BaseResponse;
import cn.wise.sc.cement.business.model.PageQuery; import cn.wise.sc.cement.business.model.PageQuery;
import cn.wise.sc.cement.business.model.vo.NormProductionVo; import cn.wise.sc.cement.business.model.vo.NormProductionVo;
import cn.wise.sc.cement.business.model.vo.ProductionVo; import cn.wise.sc.cement.business.model.vo.ProductionVo;
import cn.wise.sc.cement.business.service.IHandleService; import cn.wise.sc.cement.business.service.*;
import cn.wise.sc.cement.business.service.INonStandardValueService;
import cn.wise.sc.cement.business.service.INormProductionService;
import cn.wise.sc.cement.business.service.ISampleCheckTeamService;
import cn.wise.sc.cement.business.service.ISampleDistributionService;
import cn.wise.sc.cement.business.service.ISampleHandleService;
import cn.wise.sc.cement.business.service.ISysPostService;
import cn.wise.sc.cement.business.service.ISysUserService;
import cn.wise.sc.cement.business.service.ITeamGroupService;
import cn.wise.sc.cement.business.util.ExcelUtil; import cn.wise.sc.cement.business.util.ExcelUtil;
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;
...@@ -70,6 +62,8 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper, ...@@ -70,6 +62,8 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
final final
ISysUserService iSysUserService; ISysUserService iSysUserService;
final final
ISysGroupService iSysGroupService;
final
ISampleCheckTeamService iSampleCheckTeamService; ISampleCheckTeamService iSampleCheckTeamService;
final final
ITeamGroupService iTeamGroupService; ITeamGroupService iTeamGroupService;
...@@ -83,12 +77,14 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper, ...@@ -83,12 +77,14 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
public NormProductionServiceImpl(ISampleDistributionService iSampleDistributionService, public NormProductionServiceImpl(ISampleDistributionService iSampleDistributionService,
ISampleHandleService iSampleHandleService, ISampleHandleService iSampleHandleService,
ISysUserService iSysUserService, ISysUserService iSysUserService,
ISysGroupService iSysGroupService,
ISampleCheckTeamService iSampleCheckTeamService, ISampleCheckTeamService iSampleCheckTeamService,
ITeamGroupService iTeamGroupService, IHandleService iHandleService, ITeamGroupService iTeamGroupService, IHandleService iHandleService,
ISysPostService iSysPostService, INonStandardValueService iNonStandardValueService) { ISysPostService iSysPostService, INonStandardValueService iNonStandardValueService) {
this.iSampleDistributionService = iSampleDistributionService; this.iSampleDistributionService = iSampleDistributionService;
this.iSampleHandleService = iSampleHandleService; this.iSampleHandleService = iSampleHandleService;
this.iSysUserService = iSysUserService; this.iSysUserService = iSysUserService;
this.iSysGroupService = iSysGroupService;
this.iSampleCheckTeamService = iSampleCheckTeamService; this.iSampleCheckTeamService = iSampleCheckTeamService;
this.iTeamGroupService = iTeamGroupService; this.iTeamGroupService = iTeamGroupService;
this.iHandleService = iHandleService; this.iHandleService = iHandleService;
...@@ -274,7 +270,7 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper, ...@@ -274,7 +270,7 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
} }
NormProductionStatistics productionStatistics = new NormProductionStatistics(); NormProductionStatistics productionStatistics = new NormProductionStatistics();
productionStatistics.setAccount(sysUser.getUsername()); productionStatistics.setAccount(sysUser.getUsername());
productionStatistics.setCoefficient(coefficientMap.get(userId).intValue()); productionStatistics.setCoefficient(coefficientMap.get(userId).doubleValue());
productionStatistics.setTime("/"); productionStatistics.setTime("/");
productionStatistics.setCount(normProductionDetails.stream() productionStatistics.setCount(normProductionDetails.stream()
.filter(arg -> arg.getUserId().intValue() == sysUser.getId()) .filter(arg -> arg.getUserId().intValue() == sysUser.getId())
...@@ -378,12 +374,11 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper, ...@@ -378,12 +374,11 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
} }
@Override @Override
public List<ProductionVo> production(String name, Long start, Long end) { public List<ProductionVo> production(String name, Long start, Long end,Integer groupId) {
Date startDate = null; Date startDate = null;
Date endDate = new Date(); Date endDate = new Date();
Integer group=null;
if (start != null && start != 0) { if (start != null && start != 0) {
startDate = DateUtil.date(start); startDate = DateUtil.date(start);
} }
...@@ -392,9 +387,9 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper, ...@@ -392,9 +387,9 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
} }
//非标准产值 //非标准产值
List<NonStandardValue> nonStandardValues = iNonStandardValueService.nonValue(startDate, endDate ,group).getData(); List<NonStandardValue> nonStandardValues = iNonStandardValueService.nonValue(startDate, endDate ,groupId).getData();
//标准产值 //标准产值
List<NormProductionStatistics> productionStatistics = this.normProductionStatistics(start, end, name, group).getData(); List<NormProductionStatistics> productionStatistics = this.normProductionStatistics(start, end, name, groupId).getData();
//以userId找关系 //以userId找关系
Set<String> userIds = new HashSet<>(); Set<String> userIds = new HashSet<>();
nonStandardValues.forEach(arg -> userIds.add(arg.getUserId() + "")); nonStandardValues.forEach(arg -> userIds.add(arg.getUserId() + ""));
...@@ -410,6 +405,7 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper, ...@@ -410,6 +405,7 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
productionVo.setUserName(opt.getUserName()); productionVo.setUserName(opt.getUserName());
productionVo.setPosition(opt.getPosition()); productionVo.setPosition(opt.getPosition());
productionVo.setAccount(opt.getAccount()); productionVo.setAccount(opt.getAccount());
productionVo.setGroupId(opt.getGroupId());
} }
}); });
//找到标准产值里面的数据 //找到标准产值里面的数据
...@@ -451,6 +447,12 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper, ...@@ -451,6 +447,12 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
//过滤部门id
if (groupId != null) {
return rts.stream().filter(arg -> arg.getGroupId().equals(groupId))
.collect(Collectors.toList());
}
return rts; return rts;
} }
...@@ -497,7 +499,7 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper, ...@@ -497,7 +499,7 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
public void exportNormProductionDetail(Integer userId, Long startTime, Long endTime, HttpServletResponse response) { public void exportNormProductionDetail(Integer userId, Long startTime, Long endTime, HttpServletResponse response) {
List<NormProduction.NormProductionDetail> normProductionDetails = normProductionDetails(userId, startTime, endTime); List<NormProduction.NormProductionDetail> normProductionDetails = normProductionDetails(userId, startTime, endTime);
if (CollectionUtil.isNotEmpty(normProductionDetails)) { if (CollectionUtil.isNotEmpty(normProductionDetails)) {
String[] headers = new String[11]; String[] headers = new String[12];
headers[0] = "序号"; headers[0] = "序号";
headers[1] = "名字"; headers[1] = "名字";
headers[2] = "检测项目"; headers[2] = "检测项目";
...@@ -508,12 +510,13 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper, ...@@ -508,12 +510,13 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
headers[7] = "分样占比"; headers[7] = "分样占比";
headers[8] = "校核占比"; headers[8] = "校核占比";
headers[9] = "报结果占比"; headers[9] = "报结果占比";
headers[10] = "合计"; headers[10] = "部门id";
headers[11] = "合计";
List<Object[]> exportData = new ArrayList<>(normProductionDetails.size()); List<Object[]> exportData = new ArrayList<>(normProductionDetails.size());
int count = 0; int count = 0;
DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern("yyyy年MM月dd日 hh:mm:ss"); DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern("yyyy年MM月dd日 hh:mm:ss");
for (NormProduction.NormProductionDetail target : normProductionDetails) { for (NormProduction.NormProductionDetail target : normProductionDetails) {
Object[] objs = new Object[11]; Object[] objs = new Object[12];
objs[0] = count++; objs[0] = count++;
objs[1] = target.getUserName(); objs[1] = target.getUserName();
objs[2] = target.getGroupTeamName(); objs[2] = target.getGroupTeamName();
...@@ -524,7 +527,8 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper, ...@@ -524,7 +527,8 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
objs[7] = target.getSeparateRate(); objs[7] = target.getSeparateRate();
objs[8] = target.getAssessRate(); objs[8] = target.getAssessRate();
objs[9] = target.getReportedResultRate(); objs[9] = target.getReportedResultRate();
objs[10] = target.getWorkTimeCoefficient(); objs[10] = target.getGroupId();
objs[11] = target.getWorkTimeCoefficient();
exportData.add(objs); exportData.add(objs);
} }
ExcelUtil.excelExport("标准产值详情—" + normProductionDetails.get(0).getUserName(), headers, exportData, response); ExcelUtil.excelExport("标准产值详情—" + normProductionDetails.get(0).getUserName(), headers, exportData, response);
...@@ -532,10 +536,10 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper, ...@@ -532,10 +536,10 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
} }
@Override @Override
public void exportProduction(String name, Long startTime, Long endTime, HttpServletResponse response) { public void exportProduction(String name, Long startTime, Long endTime,Integer groupId, HttpServletResponse response) {
List<ProductionVo> data = production(name, startTime, endTime); List<ProductionVo> data = production(name, startTime, endTime,groupId);
if (CollectionUtil.isNotEmpty(data)) { if (CollectionUtil.isNotEmpty(data)) {
String[] headers = new String[8]; String[] headers = new String[9];
headers[0] = "序号"; headers[0] = "序号";
headers[1] = "姓名"; headers[1] = "姓名";
headers[2] = "账户"; headers[2] = "账户";
...@@ -544,10 +548,11 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper, ...@@ -544,10 +548,11 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
headers[5] = "标准产值"; headers[5] = "标准产值";
headers[6] = "非标准产值"; headers[6] = "非标准产值";
headers[7] = "产值统计"; headers[7] = "产值统计";
headers[8] = "部门id";
List<Object[]> exportData = new ArrayList<>(data.size()); List<Object[]> exportData = new ArrayList<>(data.size());
int count = 0; int count = 0;
for (ProductionVo target : data) { for (ProductionVo target : data) {
Object[] objs = new Object[8]; Object[] objs = new Object[9];
objs[0] = count++; objs[0] = count++;
objs[1] = target.getUserName(); objs[1] = target.getUserName();
objs[2] = target.getAccount(); objs[2] = target.getAccount();
...@@ -556,6 +561,7 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper, ...@@ -556,6 +561,7 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
objs[5] = target.getProductionValue(); objs[5] = target.getProductionValue();
objs[6] = target.getNonProductionValue(); objs[6] = target.getNonProductionValue();
objs[7] = target.getProductionTotalValue(); objs[7] = target.getProductionTotalValue();
objs[8] = target.getGroupId();
exportData.add(objs); exportData.add(objs);
} }
ExcelUtil.excelExport("产值统计", headers, exportData, response); ExcelUtil.excelExport("产值统计", headers, exportData, response);
......
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