提交 87bd7560 authored 作者: zhoushaopan's avatar zhoushaopan

[使用报告]修改

上级 eeca0947
...@@ -3,6 +3,7 @@ package com.tykj.dev.device.usereport.controller; ...@@ -3,6 +3,7 @@ package com.tykj.dev.device.usereport.controller;
import com.tykj.dev.config.swagger.AutoDocument; import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.file.entity.WrodParameter; import com.tykj.dev.device.file.entity.WrodParameter;
import com.tykj.dev.device.file.service.UseReportFIleService; import com.tykj.dev.device.file.service.UseReportFIleService;
import com.tykj.dev.device.user.subject.entity.SecurityUser;
import com.tykj.dev.device.usereport.service.DeviceUseReportService; import com.tykj.dev.device.usereport.service.DeviceUseReportService;
import com.tykj.dev.device.usereport.subject.domin.DeviceUseReport; import com.tykj.dev.device.usereport.subject.domin.DeviceUseReport;
import com.tykj.dev.device.usereport.subject.vo.DeviceUseReportCreateVo; import com.tykj.dev.device.usereport.subject.vo.DeviceUseReportCreateVo;
...@@ -17,9 +18,11 @@ import org.springframework.beans.BeanUtils; ...@@ -17,9 +18,11 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
...@@ -53,7 +56,7 @@ public class DeviceUseReportController { ...@@ -53,7 +56,7 @@ public class DeviceUseReportController {
@ApiOperation(value = "生成装备使用报告", notes = "可以通过这个接口生成装备使用报告") @ApiOperation(value = "生成装备使用报告", notes = "可以通过这个接口生成装备使用报告")
@PostMapping("/create") @PostMapping("/create")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public ResponseEntity createDeviceUseReport(@RequestBody @Validated DeviceUseReportCreateVo deviceUseReportCreateVo) { public ResponseEntity createDeviceUseReport(@RequestBody @Validated DeviceUseReportCreateVo deviceUseReportCreateVo, @ApiIgnore @AuthenticationPrincipal SecurityUser securityUser) {
return ResultUtil.success(deviceUseReportService.createReport(deviceUseReportCreateVo)); return ResultUtil.success(deviceUseReportService.createReport(deviceUseReportCreateVo));
} }
...@@ -65,15 +68,21 @@ public class DeviceUseReportController { ...@@ -65,15 +68,21 @@ public class DeviceUseReportController {
BeanUtils.copyProperties(d, deviceUseReportDetailVo); BeanUtils.copyProperties(d, deviceUseReportDetailVo);
//分解数量详情组合字段 //分解数量详情组合字段
List<Integer> list = StringSplitUtil.userIdSplit(d.getReportDetail()); List<Integer> list = StringSplitUtil.userIdSplit(d.getReportDetail());
if (list.size() > 7) { if (list.size() > 13) {
deviceUseReportDetailVo.setDeviceNumber(list.get(0)); deviceUseReportDetailVo.setDeviceNumber(list.get(0));
deviceUseReportDetailVo.setInLibraryNum(list.get(1)); deviceUseReportDetailVo.setInLibraryNum(list.get(1));
deviceUseReportDetailVo.setRepairNum(list.get(2)); deviceUseReportDetailVo.setSendRepairNum(list.get(2));
deviceUseReportDetailVo.setAllotNum(list.get(3)); deviceUseReportDetailVo.setReceiveRepairNum(list.get(3));
deviceUseReportDetailVo.setSendBackNum(list.get(4)); deviceUseReportDetailVo.setDestoryNum(list.get(4));
deviceUseReportDetailVo.setDestoryNum(list.get(5)); deviceUseReportDetailVo.setSendAllotNum(list.get(5));
deviceUseReportDetailVo.setPackingNum(list.get(6)); deviceUseReportDetailVo.setReceiveAllotNum(list.get(6));
deviceUseReportDetailVo.setRetiredNum(list.get(7)); deviceUseReportDetailVo.setSensAllotBackNum(list.get(7));
deviceUseReportDetailVo.setReceiveAllotBackNum(list.get(8));
deviceUseReportDetailVo.setSendBackNum(list.get(9));
deviceUseReportDetailVo.setScrapStatisticsNum(list.get(10));
deviceUseReportDetailVo.setPackingNum(list.get(11));
deviceUseReportDetailVo.setRetiredNum(list.get(12));
deviceUseReportDetailVo.setDecommissioningStatisticsNum(list.get(13));
} }
return ResultUtil.success(deviceUseReportDetailVo); return ResultUtil.success(deviceUseReportDetailVo);
} }
...@@ -104,9 +113,9 @@ public class DeviceUseReportController { ...@@ -104,9 +113,9 @@ public class DeviceUseReportController {
wrodParameter.setDestructionNum(deviceUseReportDetailVo.getDestoryNum()); wrodParameter.setDestructionNum(deviceUseReportDetailVo.getDestoryNum());
wrodParameter.setFieldingNum(deviceUseReportDetailVo.getPackingNum()); wrodParameter.setFieldingNum(deviceUseReportDetailVo.getPackingNum());
wrodParameter.setStorageNum(deviceUseReportDetailVo.getInLibraryNum()); wrodParameter.setStorageNum(deviceUseReportDetailVo.getInLibraryNum());
wrodParameter.setMaintenanceNum(deviceUseReportDetailVo.getRepairNum()); // wrodParameter.setMaintenanceNum(deviceUseReportDetailVo.getRepairNum());
wrodParameter.setRepelNum(deviceUseReportDetailVo.getSendBackNum()); wrodParameter.setRepelNum(deviceUseReportDetailVo.getSendBackNum());
wrodParameter.setWithNum(deviceUseReportDetailVo.getAllotNum()); // wrodParameter.setWithNum(deviceUseReportDetailVo.getAllotNum());
wrodParameter.setTitleAnnual(localDateTime.getYear()); wrodParameter.setTitleAnnual(localDateTime.getYear());
useReportFIleService.findToFileService(wrodParameter, response, httpServletRequest); useReportFIleService.findToFileService(wrodParameter, response, httpServletRequest);
return ResponseEntity.ok("下载成功"); return ResponseEntity.ok("下载成功");
......
package com.tykj.dev.device.usereport.service; package com.tykj.dev.device.usereport.service;
import com.tykj.dev.device.user.subject.entity.SecurityUser;
import com.tykj.dev.device.usereport.subject.domin.DeviceUseReport; import com.tykj.dev.device.usereport.subject.domin.DeviceUseReport;
import com.tykj.dev.device.usereport.subject.vo.DeviceStatistics; import com.tykj.dev.device.usereport.subject.vo.DeviceStatistics;
import com.tykj.dev.device.usereport.subject.vo.DeviceUseReportCreateVo; import com.tykj.dev.device.usereport.subject.vo.DeviceUseReportCreateVo;
......
...@@ -20,27 +20,32 @@ public class DeviceUseReportDetailVo { ...@@ -20,27 +20,32 @@ public class DeviceUseReportDetailVo {
@ApiModelProperty(value = "装备类型总数", example = "100") @ApiModelProperty(value = "装备类型总数", example = "100")
private Integer deviceNumber; private Integer deviceNumber;
@ApiModelProperty(value = "入库数量", example = "10") @ApiModelProperty(value = "入库数量", example = "10")
private Integer inLibraryNum; private Integer inLibraryNum;
@ApiModelProperty(value = "维修数量", example = "10") @ApiModelProperty(value = "维修数量", example = "10")
private Integer repairNum; private Integer sendRepairNum;
@ApiModelProperty(value = "维修退回", example = "10")
private Integer receiveRepairNum;
@ApiModelProperty(value = "销毁数量", example = "10") @ApiModelProperty(value = "销毁数量", example = "10")
private Integer destoryNum; private Integer destoryNum;
@ApiModelProperty(value = "发起配发数量", example = "10")
private Integer sendAllotNum;
@ApiModelProperty(value = "接收配发数量", example = "10")
private Integer receiveAllotNum;
@ApiModelProperty(value = "发起退回数量", example = "10")
private Integer sensAllotBackNum;
@ApiModelProperty(value = "接收退回", example = "10")
private Integer receiveAllotBackNum;
@ApiModelProperty(value = "清退数量", example = "10") @ApiModelProperty(value = "清退数量", example = "10")
private Integer sendBackNum; private Integer sendBackNum;
@ApiModelProperty(value = "报废数量", example = "10")
@ApiModelProperty(value = "配发数量", example = "10") private Integer scrapStatisticsNum;
private Integer allotNum;
@ApiModelProperty(value = "列装数量", example = "10") @ApiModelProperty(value = "列装数量", example = "10")
private Integer packingNum; private Integer packingNum;
@ApiModelProperty(value = "退装数量", example = "10") @ApiModelProperty(value = "退装数量", example = "10")
private Integer retiredNum; private Integer retiredNum;
@ApiModelProperty(value = "退役", example = "10")
private Integer decommissioningStatisticsNum;
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
private Date createTime; private Date createTime;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论