提交 57cafca5 authored 作者: 133's avatar 133

[报废 销毁 表格模块] 添加表格模块 以及修改bug

上级 56984fd5
...@@ -121,6 +121,7 @@ public class DeviceDecommissioningBusinessServiceImpl implements DeviceDecommiss ...@@ -121,6 +121,7 @@ public class DeviceDecommissioningBusinessServiceImpl implements DeviceDecommiss
deviceDecommissioningDetail.setDecommissioningStatus(taskBto.getBillStatus()); deviceDecommissioningDetail.setDecommissioningStatus(taskBto.getBillStatus());
deviceDecommissioningDetail.setNum(deviceDecommissioningDetail1.getNum()); deviceDecommissioningDetail.setNum(deviceDecommissioningDetail1.getNum());
} }
deviceDecommissioningDetail.setOutboundFile(FilesUtil.stringFileToList(decommissioningOrderOutData.getOutboundFileList()));
deviceDecommissioningDetail.setApplyNumber(decommissioningOrderOutData.getApplyNumber()); deviceDecommissioningDetail.setApplyNumber(decommissioningOrderOutData.getApplyNumber());
deviceDecommissioningDetail.setReplayNumber(decommissioningOrderOutData.getReplayNumber()); deviceDecommissioningDetail.setReplayNumber(decommissioningOrderOutData.getReplayNumber());
deviceDecommissioningDetail.setReplyFiles(FilesUtil.stringFileToList(decommissioningOrderOutData.getReplyFileList())); deviceDecommissioningDetail.setReplyFiles(FilesUtil.stringFileToList(decommissioningOrderOutData.getReplyFileList()));
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>equip</artifactId>
<groupId>com.tykj</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>dev-excel</artifactId>
<dependencies>
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-base</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-web</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-annotation</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>com.tykj.dev</groupId>
<artifactId>config</artifactId>
</dependency>
<dependency>
<groupId>com.tykj.dev</groupId>
<artifactId>misc</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package com.tykj.dev.device.excel;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @author zjm
* @version 1.0.0
* @ClassName userApp.java
* @Description TODO
* @createTime 2020年09月01日 14:32:00
*/
@SpringBootApplication(scanBasePackages = {
"com.tykj.dev.*",
}
)
public class ExcelApp {
public static void main(String[] args) {
SpringApplication.run(ExcelApp.class, args);
}
}
package com.tykj.dev.device.excel;
public interface ExcelService {
/**
* 导出培训名单接口(excel)
*/
void exportExcelTrainUser();
}
package com.tykj.dev.device.excel.controller;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.excel.entity.TrainExcel;
import com.tykj.dev.device.excel.entity.TrainUserExcel;
import com.tykj.dev.device.excel.utils.ExcelStyleUtil;
import com.tykj.dev.device.excel.utils.ExcelUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.ss.formula.functions.T;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
/**
* @author zjm
*/
@RestController
@RequestMapping(value = "/excel")
@AutoDocument
@Api(tags = "excel", value = "excel")
public class ExeclController {
/**
* 保存报废草稿
*/
@GetMapping(value ="/test")
@ApiOperation(value = "下载培训excel", notes = "下载培训excel")
public ResponseEntity saveDeviceDestroyBill(HttpServletRequest request, HttpServletResponse response){
TrainExcel tableInfoVo = new TrainExcel();
tableInfoVo.setName("xxx培训");
List<TrainUserExcel> tableInfoVos = new ArrayList<>();
for (int i=0;i<6;i++){
TrainUserExcel trainUserExcel=new TrainUserExcel();
trainUserExcel.setIdCard("123123123131");
trainUserExcel.setMobel("15171636570");
trainUserExcel.setName("占金明");
trainUserExcel.setSex("男");
trainUserExcel.setNumber(i);
tableInfoVos.add(trainUserExcel);
}
tableInfoVo.setTrainUserExcels(tableInfoVos);
List<TrainExcel> list=new ArrayList<>();
list.add(tableInfoVo);
ExportParams exportParams = new ExportParams(tableInfoVo.getName(), tableInfoVo.getName(), ExcelType.XSSF);
exportParams.setSecondTitle(tableInfoVo.getName());
exportParams.setStyle(ExcelStyleUtil.class);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, TrainExcel.class, list);
ExcelUtil.downloadExcel(request, response, workbook, tableInfoVo.getName());
return ResponseEntity.ok("ok");
}
}
package com.tykj.dev.device.excel.entity;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* @author zjm
* @version 1.0.0
* @ClassName TrainExcel.java
* @Description TODO
* @createTime 2021年04月29日 15:22:00
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class TrainExcel {
@Excel(name = "培训标题", orderNum = "1", width = 30, needMerge = true)
private String name;
@ExcelCollection(name = "参加培训用户信息", orderNum = "2")
private List<TrainUserExcel> trainUserExcels;
}
package com.tykj.dev.device.excel.entity;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author zjm
* @version 1.0.0
* @ClassName TrainExcel.java
* @Description TODO
* @createTime 2021年04月29日 15:22:00
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class TrainUserExcel {
@Excel(name = "序号", orderNum = "1", width = 30, needMerge = true)
private Integer number;
@Excel(name = "姓名", orderNum = "2", width = 30, needMerge = true)
private String name;
@Excel(name = "性别", orderNum = "3", width = 30, needMerge = true)
private String sex;
@Excel(name = "职务", orderNum = "4", width = 30, needMerge = true)
private String post;
@Excel(name = "手机号", orderNum = "5", width = 30, needMerge = true)
private String mobel;
@Excel(name = "身份证", orderNum = "6", width = 30, needMerge = true)
private String idCard;
}
package com.tykj.dev.device.excel.entity;
\ No newline at end of file
package com.tykj.dev.device.excel;
\ No newline at end of file
package com.tykj.dev.device.excel.utils;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.entity.params.ExcelForEachParams;
import cn.afterturn.easypoi.excel.export.styler.IExcelExportStyler;
import org.apache.poi.ss.usermodel.*;
public class ExcelStyleUtil implements IExcelExportStyler {
private static final short STRING_FORMAT = (short) BuiltinFormats.getBuiltinFormat("TEXT");
private static final short FONT_SIZE_TEN = 10;
private static final short FONT_SIZE_ELEVEN = 11;
private static final short FONT_SIZE_TWELVE = 12;
private static final short FONT_SIZE_THIRTEEN = 13;
/**
* 大标题样式
*/
private CellStyle headerStyle;
/**
* 每列标题样式
*/
private CellStyle titleStyle;
/**
* 数据行样式
*/
private CellStyle styles;
public ExcelStyleUtil(Workbook workbook) {
this.init(workbook);
}
/**
* 初始化样式
*
* @param workbook
*/
private void init(Workbook workbook) {
this.headerStyle = initHeaderStyle(workbook);
this.titleStyle = initTitleStyle(workbook);
this.styles = initStyles(workbook);
}
/**
* 大标题样式
*
* @param color
* @return
*/
@Override
public CellStyle getHeaderStyle(short color) {
return headerStyle;
}
/**
* 每列标题样式
*
* @param color
* @return
*/
@Override
public CellStyle getTitleStyle(short color) {
return titleStyle;
}
/**
* 数据行样式
*
* @param parity 可以用来表示奇偶行
* @param entity 数据内容
* @return 样式
*/
@Override
public CellStyle getStyles(boolean parity, ExcelExportEntity entity) {
return styles;
}
/**
* 获取样式方法
*
* @param dataRow 数据行
* @param obj 对象
* @param data 数据
*/
@Override
public CellStyle getStyles(Cell cell, int dataRow, ExcelExportEntity entity, Object obj, Object data) {
return getStyles(true, entity);
}
/**
* 模板使用的样式设置
*/
@Override
public CellStyle getTemplateStyles(boolean isSingle, ExcelForEachParams excelForEachParams) {
return null;
}
/**
* 初始化--大标题样式
*
* @param workbook
* @return
*/
private CellStyle initHeaderStyle(Workbook workbook) {
CellStyle style = getBaseCellStyle(workbook);
style.setFont(getFont(workbook, FONT_SIZE_THIRTEEN, true));
return style;
}
/**
* 初始化--每列标题样式
*
* @param workbook
* @return
*/
private CellStyle initTitleStyle(Workbook workbook) {
CellStyle style = getBaseCellStyle(workbook);
style.setFont(getFont(workbook, FONT_SIZE_TWELVE, false));
//背景色
style.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
return style;
}
/**
* 初始化--数据行样式
*
* @param workbook
* @return
*/
private CellStyle initStyles(Workbook workbook) {
CellStyle style = getBaseCellStyle(workbook);
style.setFont(getFont(workbook, FONT_SIZE_ELEVEN, false));
style.setDataFormat(STRING_FORMAT);
return style;
}
/**
* 基础样式
*
* @return
*/
private CellStyle getBaseCellStyle(Workbook workbook) {
CellStyle style = workbook.createCellStyle();
//下边框
style.setBorderBottom(BorderStyle.THIN);
//左边框
style.setBorderLeft(BorderStyle.THIN);
//上边框
style.setBorderTop(BorderStyle.THIN);
//右边框
style.setBorderRight(BorderStyle.THIN);
//水平居中
style.setAlignment(HorizontalAlignment.CENTER);
//上下居中
style.setVerticalAlignment(VerticalAlignment.CENTER);
//设置自动换行
style.setWrapText(true);
return style;
}
/**
* 字体样式
*
* @param size 字体大小
* @param isBold 是否加粗
* @return
*/
private Font getFont(Workbook workbook, short size, boolean isBold) {
Font font = workbook.createFont();
//字体样式
font.setFontName("宋体");
//是否加粗
font.setBold(isBold);
//字体大小
font.setFontHeightInPoints(size);
return font;
}
}
package com.tykj.dev.device.excel.utils;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.URLEncoder;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
/**
* fp-api.
*
* @author : Matrix [xhyrzldf@gmail.com]
* 18-11-15 .
*/
public class ExcelUtil {
public static void exportExcel(List<?> list, String title, String sheetName, Class<?> pojoClass, String fileName, boolean isCreateHeader, HttpServletResponse response) {
ExportParams exportParams = new ExportParams(title, sheetName);
exportParams.setCreateHeadRows(isCreateHeader);
defaultExport(list, pojoClass, fileName, response, exportParams);
}
public static void exportExcel(List<?> list, String title, String sheetName, Class<?> pojoClass, String fileName, HttpServletResponse response) {
defaultExport(list, pojoClass, fileName, response, new ExportParams(title, sheetName));
}
public static void exportExcel(List<Map<String, Object>> list, String fileName, HttpServletResponse response) {
defaultExport(list, fileName, response);
}
/**
* @param response HTTP response
* @param wb workbook
* @param excelName excelName名称
*/
public static void downloadExcel(HttpServletRequest request, HttpServletResponse response, Workbook wb, String excelName) {
// 判断数据
if (wb == null) {
throw new RuntimeException("workbook can not be null!");
}
// 重置响应对象
response.reset();
String fileName = excelName + ".xlsx";
try {
String userAgent = request.getHeader("USER-AGENT");//获取浏览器版本
if (StringUtils.contains(userAgent, "MSIE")) {//IE浏览器
fileName = URLEncoder.encode(fileName, "UTF8");
} else if (StringUtils.contains(userAgent, "Mozilla")) {//google,火狐浏览器
fileName = new String(fileName.getBytes("UTF-8"), "ISO8859-1");
} else {
fileName = URLEncoder.encode(fileName, "UTF8");//其他浏览器
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
response.setContentType("application/octet-stream;charset=UTF-8");
response.setHeader("Pragma", "no-cache");
response.setDateHeader("Expires", 0);
response.setHeader("Access-Control-Allow-Origin", request.getHeader("Origin"));
response.setHeader("Access-Control-Allow-Credentials", "true");
response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, PATCH, DELETE");
response.setHeader("Access-Control-Max-Age", "3600");
response.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
// 写出数据输出流到页面
try {
OutputStream output = response.getOutputStream();
BufferedOutputStream bufferedOutPut = new BufferedOutputStream(output);
wb.write(bufferedOutPut);
bufferedOutPut.flush();
bufferedOutPut.close();
output.close();
} catch (IOException e) {
e.printStackTrace();
}
}
private static void defaultExport(List<?> list, Class<?> pojoClass, String fileName, HttpServletResponse response, ExportParams exportParams) {
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, pojoClass, list);
downLoadExcel(fileName, response, workbook);
}
private static void downLoadExcel(String fileName, HttpServletResponse response, Workbook workbook) {
try {
response.setCharacterEncoding("UTF-8");
response.setHeader("content-Type", "application/vnd.ms-excel");
response.setHeader("Content-Disposition",
"attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
workbook.write(response.getOutputStream());
} catch (IOException e) {
throw new RuntimeException(e.getMessage());
}
}
private static void defaultExport(List<Map<String, Object>> list, String fileName, HttpServletResponse response) {
Workbook workbook = ExcelExportUtil.exportExcel(list, ExcelType.HSSF);
downLoadExcel(fileName, response, workbook);
}
public static <T> List<T> importExcel(String filePath, Integer titleRows, Integer headerRows, Class<T> pojoClass) {
if (StringUtils.isBlank(filePath)) {
return null;
}
ImportParams params = new ImportParams();
params.setTitleRows(titleRows);
params.setHeadRows(headerRows);
List<T> list;
try {
list = ExcelImportUtil.importExcel(new File(filePath), pojoClass, params);
} catch (NoSuchElementException e) {
throw new RuntimeException("模板不能为空");
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e.getMessage());
}
return list;
}
public static <T> List<T> importExcel(MultipartFile file, Integer titleRows, Integer headerRows, Class<T> pojoClass) {
if (file == null) {
return null;
}
ImportParams params = new ImportParams();
params.setTitleRows(titleRows);
params.setHeadRows(headerRows);
// 开启Excel校验
params.setNeedVerfiy(true);
List<T> list;
try {
list = ExcelImportUtil.importExcel(file.getInputStream(), pojoClass, params);
} catch (NoSuchElementException e) {
throw new RuntimeException("excel文件不能为空");
} catch (Exception e) {
throw new RuntimeException(e.getMessage());
}
return list;
}
}
...@@ -89,11 +89,11 @@ public class DeviceLibraryController { ...@@ -89,11 +89,11 @@ public class DeviceLibraryController {
} }
@ApiOperation(value = "根据装备id查询装备详情", notes = "根据装备id查询装备详情") @ApiOperation(value = "根据装备id查询装备详情", notes = "根据装备id查询装备详情")
@PostMapping("/selectByIds/{page}/{size}") @PostMapping("/selectByIds")
public ResponseEntity selectByIds(@RequestBody List<Integer> ids,@PathVariable("page") int page,@PathVariable("size") int size){ public ResponseEntity selectByIds(@RequestBody DeviceSelectIdsVo deviceSelectIdsVo){
List<DeviceLibrary> deviceLibraries = new ArrayList<>(); List<DeviceLibrary> deviceLibraries = new ArrayList<>();
ids.forEach(integer -> deviceLibraries.add(deviceLibraryService.getOne(integer).setConfigName())); deviceSelectIdsVo.getIds().forEach(integer -> deviceLibraries.add(deviceLibraryService.getOne(integer).setConfigName()));
return ResponseEntity.ok(PageUtil.getPerPage(page,size,deviceLibraries, PageRequest.of(page, size))); return ResponseEntity.ok(PageUtil.getPerPage(deviceSelectIdsVo.getPage(),deviceSelectIdsVo.getSize(),deviceLibraries, PageRequest.of(deviceSelectIdsVo.getPage(),deviceSelectIdsVo.getSize())));
} }
@ApiOperation(value = "根据装备id查询装备详情", notes = "根据装备id查询装备详情") @ApiOperation(value = "根据装备id查询装备详情", notes = "根据装备id查询装备详情")
......
package com.tykj.dev.device.library.subject.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* @author zjm
* @version 1.0.0
* @ClassName DeviceSelectIdsVo.java
* @Description TODO
* @createTime 2021年04月29日 20:12:00
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class DeviceSelectIdsVo {
private Integer page;
private Integer size;
private List<Integer> ids;
}
...@@ -71,7 +71,7 @@ public enum StatusEnum { ...@@ -71,7 +71,7 @@ public enum StatusEnum {
SEND_BACK_1207(1207, "清退装备等待审核确认"), SEND_BACK_1207(1207, "清退装备等待审核确认"),
SEND_BACK_1208(1208, "清退装备等待出库"), SEND_BACK_1208(1208, "清退装备等待出库"),
SEND_BACK_1209(1209, "清退装备等待入库"), SEND_BACK_1209(1209, "清退装备等待入库"),
SEND_BACK_1210(1210, "省退役送往省外等待回执单"), SEND_BACK_1210(1210, "等待上传退役签收单"),
SEND_BACK_1211(1211, "市发清退任务待省审核"), SEND_BACK_1211(1211, "市发清退任务待省审核"),
SEND_BACK_1212(1212, "清退统计任务待办结"), SEND_BACK_1212(1212, "清退统计任务待办结"),
SEND_BACK_1213(1213,"省直属清退任务待上传单据"), SEND_BACK_1213(1213,"省直属清退任务待上传单据"),
...@@ -269,7 +269,7 @@ public enum StatusEnum { ...@@ -269,7 +269,7 @@ public enum StatusEnum {
/** /**
* 报废状态 * 报废状态
*/ */
SCRAP_2222(2222, "待上传报废单"), SCRAP_2222(2222, "待上报废签收单"),
SCRAP_2223(2223, "报废草稿"), SCRAP_2223(2223, "报废草稿"),
SCRAP_2224(2224, "报废出库签章审核"), SCRAP_2224(2224, "报废出库签章审核"),
SCRAP_2225(2225, "报废出库等待盖电子签章"); SCRAP_2225(2225, "报废出库等待盖电子签章");
......
...@@ -114,6 +114,7 @@ public class ScrapBusinessServiceImpl implements ScrapBusinessService { ...@@ -114,6 +114,7 @@ public class ScrapBusinessServiceImpl implements ScrapBusinessService {
scrap.setNum(scrap1.getNum()); scrap.setNum(scrap1.getNum());
} }
scrap.setOutboundFile(FilesUtil.stringFileToList(scrapOrderOutData.getOutboundFileList()));
scrap.setApplyNumber(scrapOrderOutData.getApplyNumber()); scrap.setApplyNumber(scrapOrderOutData.getApplyNumber());
scrap.setReplayNumber(scrapOrderOutData.getReplayNumber()); scrap.setReplayNumber(scrapOrderOutData.getReplayNumber());
scrap.setReplyFiles(FilesUtil.stringFileToList(scrapOrderOutData.getReplyFileList())); scrap.setReplyFiles(FilesUtil.stringFileToList(scrapOrderOutData.getReplyFileList()));
......
...@@ -182,7 +182,7 @@ public class DeviceRepelDetail extends BaseEntity { ...@@ -182,7 +182,7 @@ public class DeviceRepelDetail extends BaseEntity {
@Column(name = "auditing_feedback",columnDefinition = "TEXT") @Column(name = "auditing_feedback",columnDefinition = "TEXT")
private String auditingFeedback; private String auditingFeedback;
@ApiModelProperty(value = "清退状态",name = "1.清退中,2.清退完成 ,3.无装备清退完成") @ApiModelProperty(value = "清退状态",name = "1.清退中, 2.清退完成 ,3.无装备清退完成")
private Integer repelStatus=1; private Integer repelStatus=1;
@ApiModelProperty(value = "清退单据类型",name = "1.出入库,2.直属 3.本级") @ApiModelProperty(value = "清退单据类型",name = "1.出入库,2.直属 3.本级")
......
...@@ -26,6 +26,7 @@ import java.util.List; ...@@ -26,6 +26,7 @@ import java.util.List;
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
public class RepelTaskStatistical extends BaseEntity { public class RepelTaskStatistical extends BaseEntity {
/** /**
* 数据id * 数据id
*/ */
...@@ -39,6 +40,7 @@ public class RepelTaskStatistical extends BaseEntity { ...@@ -39,6 +40,7 @@ public class RepelTaskStatistical extends BaseEntity {
*/ */
@ApiModelProperty(value = "业务id") @ApiModelProperty(value = "业务id")
private Integer repelId; private Integer repelId;
/** /**
* 父类taskId * 父类taskId
*/ */
......
...@@ -119,6 +119,9 @@ public interface RepelQueryService { ...@@ -119,6 +119,9 @@ public interface RepelQueryService {
*/ */
PagingVo repelDeviceInList(RepelManagementVo repelManagementVo); PagingVo repelDeviceInList(RepelManagementVo repelManagementVo);
/**
* 根据业务ID查询清退业务详情
*/
DeviceRepelDetail findByBillIdDeviceRepelDetail(Integer repelId); DeviceRepelDetail findByBillIdDeviceRepelDetail(Integer repelId);
/** /**
......
...@@ -39,7 +39,7 @@ import java.util.stream.Collectors; ...@@ -39,7 +39,7 @@ import java.util.stream.Collectors;
* @author zjm * @author zjm
* @version 1.0.0 * @version 1.0.0
* @ClassName AgainStorageBillServiceImpl.java * @ClassName AgainStorageBillServiceImpl.java
* @Description TODO * @Description 直接改变装备的状态记录业务
* @createTime 2021年03月16日 17:07:00 * @createTime 2021年03月16日 17:07:00
*/ */
@Service @Service
......
...@@ -29,7 +29,7 @@ import java.util.stream.Collectors; ...@@ -29,7 +29,7 @@ import java.util.stream.Collectors;
* @author zjm * @author zjm
* @version 1.0.0 * @version 1.0.0
* @ClassName DeviceRepelDetailServiceImpl.java * @ClassName DeviceRepelDetailServiceImpl.java
* @Description TODO * @Description 清退业务详情逻辑层 每一次出入库生成一条业务
* @createTime 2021年01月07日 09:52:00 * @createTime 2021年01月07日 09:52:00
*/ */
@Service @Service
...@@ -85,7 +85,6 @@ public class DeviceRepelDetailServiceImpl implements DeviceRepelDetailService { ...@@ -85,7 +85,6 @@ public class DeviceRepelDetailServiceImpl implements DeviceRepelDetailService {
@Override @Override
public List<Integer> findYearAndUnitToDeviceList(Date time,Date endTime,Integer unitId) { public List<Integer> findYearAndUnitToDeviceList(Date time,Date endTime,Integer unitId) {
Set<Integer> libraries=new HashSet<>(); Set<Integer> libraries=new HashSet<>();
List<DeviceRepelDetail> list= deviceRepelDetailDao.findAllBySendTimeBetweenAndSendUnitIdAndRepelStatus(time,endTime,unitId,2);
deviceRepelDetailDao.findAllBySendTimeBetweenAndSendUnitIdAndRepelStatus(time,endTime,unitId,2).forEach( deviceRepelDetailDao.findAllBySendTimeBetweenAndSendUnitIdAndRepelStatus(time,endTime,unitId,2).forEach(
deviceRepelDetail -> libraries.addAll(StringUtils.stringToList(deviceRepelDetail.getDeviceIds())) deviceRepelDetail -> libraries.addAll(StringUtils.stringToList(deviceRepelDetail.getDeviceIds()))
); );
...@@ -121,8 +120,6 @@ public class DeviceRepelDetailServiceImpl implements DeviceRepelDetailService { ...@@ -121,8 +120,6 @@ public class DeviceRepelDetailServiceImpl implements DeviceRepelDetailService {
private Specification<DeviceRepelDetail> getFindRetiredSpecification(RepelDetailSelectVo repelDetailSelectVo) { private Specification<DeviceRepelDetail> getFindRetiredSpecification(RepelDetailSelectVo repelDetailSelectVo) {
PredicateBuilder<DeviceRepelDetail> predicateBuilder = Specifications.and(); PredicateBuilder<DeviceRepelDetail> predicateBuilder = Specifications.and();
// List<Integer> leftStatus=new ArrayList<>();
// leftStatus.add(com.tykj.dev.config.base.DeviceLifeStatus.RETIRED.id);
if (repelDetailSelectVo.getStartTime() != null) { if (repelDetailSelectVo.getStartTime() != null) {
predicateBuilder.gt("createTime", repelDetailSelectVo.getStartTime()); predicateBuilder.gt("createTime", repelDetailSelectVo.getStartTime());
} }
......
...@@ -21,7 +21,7 @@ import java.util.stream.Collectors; ...@@ -21,7 +21,7 @@ import java.util.stream.Collectors;
* @author zjm * @author zjm
* @version 1.0.0 * @version 1.0.0
* @ClassName DeviceRepelServiceImpl.java * @ClassName DeviceRepelServiceImpl.java
* @Description TODO * @Description 清退通知详情业务层 发起清退任务 生成一次 转发生成一次
* @createTime 2021年01月07日 09:52:00 * @createTime 2021年01月07日 09:52:00
*/ */
@Service @Service
......
...@@ -442,12 +442,10 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -442,12 +442,10 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
} }
public static void main(String[] args) { public static void main(String[] args) {
// String a="[{\"model\":\"BM-002\",\"count\":0},{\"model\":\"BM-001\",\"count\":0},{\"model\":\"aa\",\"count\":0},{\"model\":\"bb\",\"count\":0}]"; // String a="[{\"model\":\"BM-002\",\"count\":0},{\"model\":\"BM-001\",\"count\":0},{\"model\":\"aa\",\"count\":0},{\"model\":\"bb\",\"count\":0}]";
// List<ModelCount> modelCountList= JacksonUtil.readValue(a, new TypeReference<List<ModelCount>>() {}); // List<ModelCount> modelCountList= JacksonUtil.readValue(a, new TypeReference<List<ModelCount>>() {});
// log.info("---{}",modelCountList.size()); // log.info("---{}",modelCountList.size());
// boolean flag= repelTaskStatisticalService.findAllRepelTaskStatistical(589,286).stream().allMatch(e->e.getTaskStatus()!=1); // boolean flag= repelTaskStatisticalService.findAllRepelTaskStatistical(589,286).stream().allMatch(e->e.getTaskStatus()!=1);
} }
@Override @Override
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
<module>dev-es</module> <module>dev-es</module>
<module>dev-loss</module> <module>dev-loss</module>
<module>dev-decommissioning</module> <module>dev-decommissioning</module>
<module>dev-excel</module>
</modules> </modules>
<properties> <properties>
...@@ -227,7 +228,11 @@ ...@@ -227,7 +228,11 @@
<artifactId>dev-decommissioning</artifactId> <artifactId>dev-decommissioning</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency>
<groupId>com.tykj</groupId>
<artifactId>dev-excel</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论